Don't try to build lua if we don't ask for it.

This commit is contained in:
Monty Taylor 2009-08-22 10:23:15 -07:00
parent 713e91d59a
commit 4608cde968
2 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,10 @@
INCLUDES=@INCLUDES@ INCLUDES=@INCLUDES@
lib_LTLIBRARIES = sigar.la lib_LTLIBRARIES=
TESTS=
if BUILD_LUA
lib_LTLIBRARIES += sigar.la
sigar_la_SOURCES =\ sigar_la_SOURCES =\
sigar.c \ sigar.c \
@ -19,6 +23,11 @@ sigar_la_CPPFLAGS = ${LUA_CFLAGS}
sigar_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version sigar_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
sigar_la_LIBADD = $(top_builddir)/src/libsigar.la sigar_la_LIBADD = $(top_builddir)/src/libsigar.la
TESTS += \
sigar-test.lua
endif
noinst_HEADERS = lua-sigar.h noinst_HEADERS = lua-sigar.h
TESTS_ENVIRONMENT = \ TESTS_ENVIRONMENT = \
@ -27,5 +36,3 @@ TESTS_ENVIRONMENT = \
DYLD_LIBRARY_PATH="${top_builddir}/src/.libs/" \ DYLD_LIBRARY_PATH="${top_builddir}/src/.libs/" \
lua lua
TESTS = \
sigar-test.lua

View File

@ -129,13 +129,15 @@ if test "$WITH_LUA" != "no"; then
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1, [
AC_DEFINE([HAVE_LUA], [1], [liblua]) AC_DEFINE([HAVE_LUA], [1], [liblua])
AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) AC_DEFINE([HAVE_LUA_H], [1], [lua.h])
]) ],[WITH_LUA=no])
]) ])
AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_CFLAGS)
AC_SUBST(LUA_LIBS) AC_SUBST(LUA_LIBS)
fi fi
AM_CONDITIONAL([BUILD_LUA],[test "$WITH_LUA" != "no"])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
include/Makefile include/Makefile