Browse Source

try pkg-config for lua if all other tests fail (fixed #247, #254, #209)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@689 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Jan Kneschke 16 years ago
parent
commit
b9623d6fd2
  1. 28
      configure.in
  2. 2
      src/Makefile.am

28
configure.in

@ -354,20 +354,32 @@ AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
AC_MSG_RESULT($WITH_LUA)
if test "$WITH_LUA" != "no"; then
AC_PATH_PROG(LUACONFIG, lua-config)
if test x"$LUACONFIG" != x; then
LUA_CFLAGS=`$LUACONFIG --include`
LUA_LIB=`$LUACONFIG --libs --extralibs`
LUA_LIBS=`$LUACONFIG --libs --extralibs`
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
else
AC_CHECK_LIB(lua, lua_open, [
AC_CHECK_HEADERS([lua.h],[
LUA_LIB="-llua -llualib"
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
])
AC_CHECK_HEADERS([lua.h],[
LUA_LIBS="-llua -llualib"
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
])
])
fi
if test x"$LUA_LIBS" = x; then
# try pkgconfig
PKG_CHECK_MODULES(LUA, lua, [
AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
])
fi
AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIB)
AC_SUBST(LUA_LIBS)
fi
@ -536,7 +548,7 @@ else
fi
plugins="mod_cml"
if test ! "x$LUA_LIB" = x; then
if test ! "x$LUA_LIBS" = x; then
do_build="$do_build $plugins"
else
no_build="$no_build $plugins"

2
src/Makefile.am

@ -78,7 +78,7 @@ lib_LTLIBRARIES += mod_cml.la
mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
mod_cml_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_cml_la_LIBADD = $(MEMCACHE_LIB) $(common_libadd) $(LUA_LIB)
mod_cml_la_LIBADD = $(MEMCACHE_LIB) $(common_libadd) $(LUA_LIBS)
lib_LTLIBRARIES += mod_trigger_b4_dl.la
mod_trigger_b4_dl_la_SOURCES = mod_trigger_b4_dl.c

Loading…
Cancel
Save