[with_tests=true])
AM_CONDITIONAL([WITH_TESTS], [test x$with_tests = xtrue])
+AC_ARG_ENABLE([samples],
+ [AS_HELP_STRING([--enable-samples],[compile libcgroup samples C programs [default=no]])],
+ [
+ if test "x$enableval" == xno; then
+ with_samples=false
+ else
+ with_samples=true
+ fi
+ ],
+ [with_samples=false])
+AM_CONDITIONAL([WITH_SAMPLES], [test x$with_samples = xtrue])
+
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AM_CPPFLAGS = -I$(top_srcdir)/include
LDADD = $(top_builddir)/src/.libs/libcgroup.la
-# Uncomment to build the sample programs.
-#noinst_PROGRAMS = setuid walk_test read_stats walk_task get_controller \
-# get_mount_point proctest get_all_controller \
-# get_variable_names test_named_hierarchy \
-# get_procs wrapper_test logger empty_cgroup_v2
+if WITH_SAMPLES
+
+noinst_PROGRAMS = setuid walk_test read_stats walk_task get_controller \
+ get_mount_point proctest get_all_controller \
+ get_variable_names test_named_hierarchy \
+ get_procs wrapper_test logger empty_cgroup_v2
setuid_SOURCES=setuid.c
walk_test_SOURCES=walk_test.c
wrapper_test_SOURCES=wrapper_test.c
logger_SOURCES=logger.c
empty_cgroup_v2_SOURCES=empty_cgroup_v2.c
+
+endif