From 4608cde9680e4fe220ed59d304d227f3c586be26 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 22 Aug 2009 10:23:15 -0700 Subject: [PATCH] Don't try to build lua if we don't ask for it. --- bindings/lua/Makefile.am | 15 +++++++++++---- configure.ac | 4 +++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bindings/lua/Makefile.am b/bindings/lua/Makefile.am index 2a27c10a..30d314c3 100644 --- a/bindings/lua/Makefile.am +++ b/bindings/lua/Makefile.am @@ -1,8 +1,12 @@ INCLUDES=@INCLUDES@ -lib_LTLIBRARIES = sigar.la +lib_LTLIBRARIES= +TESTS= -sigar_la_SOURCES =\ +if BUILD_LUA +lib_LTLIBRARIES += sigar.la + +sigar_la_SOURCES =\ sigar.c \ sigar-cpu.c \ sigar-disk.c \ @@ -19,6 +23,11 @@ sigar_la_CPPFLAGS = ${LUA_CFLAGS} sigar_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version sigar_la_LIBADD = $(top_builddir)/src/libsigar.la +TESTS += \ + sigar-test.lua + +endif + noinst_HEADERS = lua-sigar.h TESTS_ENVIRONMENT = \ @@ -27,5 +36,3 @@ TESTS_ENVIRONMENT = \ DYLD_LIBRARY_PATH="${top_builddir}/src/.libs/" \ lua -TESTS = \ - sigar-test.lua diff --git a/configure.ac b/configure.ac index 48d2f256..e42a9d14 100644 --- a/configure.ac +++ b/configure.ac @@ -129,13 +129,15 @@ if test "$WITH_LUA" != "no"; then PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [ AC_DEFINE([HAVE_LUA], [1], [liblua]) AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) - ]) + ],[WITH_LUA=no]) ]) AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_LIBS) fi +AM_CONDITIONAL([BUILD_LUA],[test "$WITH_LUA" != "no"]) + AC_CONFIG_FILES([ Makefile include/Makefile