Project

General

Profile

Bug #209 ยป lighttpd-1.4.0.lua-config.patch

Patch enabling use of lua-config to find the lub-libraries to link against. -- roques - Anonymous, 2005-08-19 17:38

View differences:

configure.in (working copy)
301 301
AC_MSG_CHECKING(for lua)
302 302
AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua engine for mod_cml]),
303 303
[AC_MSG_RESULT(yes)
304
 AC_CHECK_LIB(lua, lua_open, [
305
         AC_CHECK_HEADERS([lua.h],[
306
	         LUA_LIB="-llua -llualib -lm"
307
                 AC_DEFINE([HAVE_LUA], [1], [liblua])
308
		 AC_DEFINE([HAVE_LUA_H], [1])
309
         ])
310
 ])
304
 AC_PATH_PROG(LUACONFIG, lua-config)
305
 if test x"$LUACONFIG" != x; then
306
   LUA_CFLAGS=`$LUACONFIG --include`
307
   LUA_LIB=`$LUACONFIG --libs --extralibs`
308
   OLDCPPFLAGS="$CPPFLAGS"
309
   OLDLIBS="$LIBS"
310
   CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
311
   LIBS="$LIBS $LUA_LIB"
312
   AC_LINK_IFELSE([AC_LANG_CALL([], [lua_open])], [], [
313
     LUA_CFLAGS=""
314
     LUA_LIB=""
315
   ])
316
   CPPFLAGS="$OLDCPPFLAGS"
317
   LIBS="$OLDLIBS"
318
 fi
311 319
],[AC_MSG_RESULT(no)])
320
AC_SUBST(LUA_CFLAGS)
312 321
AC_SUBST(LUA_LIB)
313 322

  
314 323

  
src/Makefile.am (working copy)
75 75

  
76 76
lib_LTLIBRARIES += mod_cml.la
77 77
mod_cml_la_SOURCES = mod_cml.c mod_cml_lua.c mod_cml_funcs.c
78
mod_cml_la_CFLAGS = $(AM_CFLAGS) $(LUA_CFLAGS)
78 79
mod_cml_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
79 80
mod_cml_la_LIBADD = $(MEMCACHE_LIB) $(common_libadd) $(LUA_LIB)
80 81

  
    (1-1/1)