Skip to content
Browse files

applied the configure-lua patch to the lua branch

  • Loading branch information...
1 parent 5d22257 commit 8470738ff381594cdff09901eb53256dbd3b0aee @weigon weigon committed Aug 13, 2009
Showing with 31 additions and 1 deletion.
  1. +1 −1 Makefile.am
  2. +30 −0 configure.ac
View
2 Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = include src examples tests
+SUBDIRS = include src bindings examples tests
EXTRA_DIST=\
CMakeLists.txt \
View
30 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

0 comments on commit 8470738

Please sign in to comment.
Something went wrong with that request. Please try again.