]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Make building the API tests/examples optional
authorStéphane Graber <stgraber@ubuntu.com>
Sat, 1 Sep 2012 23:57:11 +0000 (19:57 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 12 Nov 2012 18:17:30 +0000 (13:17 -0500)
Add a new --enable-tests option to configure which is used to
optionally build the tests/examples. Default is off.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
configure.ac
src/tests/Makefile.am

index 7b98306b22903c2065c7b08403fcb2f3d7ef76cb..7018082bc5ad115b6cb93a6b887471686f70fe70 100644 (file)
@@ -83,6 +83,12 @@ AM_COND_IF([ENABLE_PYTHON],
      AC_CHECK_HEADER([python$PYTHON_VERSION/Python.h],[],[AC_MSG_ERROR([You must install python3-dev])])
      AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])
 
+AC_ARG_ENABLE([tests],
+       [AC_HELP_STRING([--enable-tests], [build test/example binaries])],
+       [enable_tests=yes], [enable_tests=no])
+
+AM_CONDITIONAL([ENABLE_TESTS], [test "x$enable_tests" = "xyes"])
+
 AS_AC_EXPAND(PREFIX, $prefix)
 AS_AC_EXPAND(LIBDIR, $libdir)
 AS_AC_EXPAND(BINDIR, $bindir)
index b880bc421ac9c798fe30841f2fac79fef8626299..c77f1fbbe91d8444c71d390a81aa4a96d09cebe8 100644 (file)
@@ -1,3 +1,5 @@
+if ENABLE_TESTS
+
 LDADD = ../lxc/liblxc.so -lrt
 containertests_SOURCES = containertests.c
 locktests_SOURCES = locktests.c
@@ -15,3 +17,5 @@ AM_CFLAGS=-I$(top_srcdir)/src \
        -DLXCINITDIR=\"$(LXCINITDIR)\"
 
 bin_PROGRAMS = containertests locktests startone destroytest saveconfig createtest shutdowntest get_item getkeys
+
+endif