From 8470738ff381594cdff09901eb53256dbd3b0aee Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Thu, 13 Aug 2009 20:07:02 +0200 Subject: [PATCH] applied the configure-lua patch to the lua branch --- Makefile.am | 2 +- configure.ac | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index ed215524..ead17433 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = include src examples tests +SUBDIRS = include src bindings examples tests EXTRA_DIST=\ CMakeLists.txt \ diff --git a/configure.ac b/configure.ac index 54ae61e8..48d2f256 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,34 @@ AS_IF([test "x$with_valgrind" != xno], ]) AM_CONDITIONAL(USE_VALGRIND, test "x$VALGRIND" != x) +dnl Check for lua +AC_MSG_CHECKING(if with lua) +AC_ARG_WITH(lua, AC_HELP_STRING([--with-lua],[lua]), +[WITH_LUA=$withval],[WITH_LUA=no]) + +if test "$WITH_LUA" != "no"; then + AC_MSG_RESULT($WITH_LUA) + # try pkgconfig + if test "$WITH_LUA" = "yes"; then + LUAPC=lua + else + LUAPC=$WITH_LUA + fi + + PKG_CHECK_MODULES(LUA, $LUAPC >= 5.1, [ + AC_DEFINE([HAVE_LUA], [1], [liblua]) + AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) + ],[ + PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [ + AC_DEFINE([HAVE_LUA], [1], [liblua]) + AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) + ]) + ]) + + AC_SUBST(LUA_CFLAGS) + AC_SUBST(LUA_LIBS) +fi + AC_CONFIG_FILES([ Makefile include/Makefile @@ -126,6 +154,8 @@ src/os/win32/Makefile examples/Makefile src/sigar_version_autoconf.c tests/Makefile +bindings/Makefile +bindings/lua/Makefile ]) AC_OUTPUT