1 PHP_ARG_WITH(lua,for LUA support,
2 [ --with-lua[=DIR] Include LUA support])
4 if test "$PHP_LUA" != "no"; then
5 PHP_NEW_EXTENSION(lua, lua.c, $ext_shared)
6 if test "$PHP_LUA" != "yes"; then
7 LUA_SEARCH_DIRS=$PHP_LUA
9 LUA_SEARCH_DIRS="/usr/local /usr"
11 for i in $LUA_SEARCH_DIRS; do
12 if test -f $i/include/lua/lua.h; then
14 LUA_INCDIR=$i/include/lua
15 elif test -f $i/include/lua5.1/lua.h; then
17 LUA_INCDIR=$i/include/lua5.1
18 elif test -f $i/include/lua.h; then
24 if test -z "$LUA_DIR"; then
25 AC_MSG_ERROR(Cannot find lua)
28 LUA_LIBDIR=$LUA_DIR/$PHP_LIBDIR
30 PHP_ADD_LIBRARY_WITH_PATH(lua, $LUA_LIBDIR, LUA_SHARED_LIBADD)
32 PHP_CHECK_LIBRARY(lua,lua_new_state,
34 PHP_ADD_LIBRARY_WITH_PATH(lua, $LUA_LIBDIR, LUA_SHARED_LIBADD)
39 PHP_ADD_INCLUDE($LUA_INCDIR)
40 PHP_SUBST(LUA_SHARED_LIBADD)
41 AC_DEFINE(HAVE_LUA,1,[ ])