]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Add options to enable/disable various build targets.
authorJan Safranek <jsafrane@redhat.com>
Mon, 25 May 2009 07:48:34 +0000 (09:48 +0200)
committerJan Safranek <jsafrane@redhat.com>
Mon, 25 May 2009 07:48:34 +0000 (09:48 +0200)
By default, everything is compiled. I want to add options to ./configure,
which can selectively disable tools, daemon and pam module. The library
itself is mandatory component and cannot be disabled.

Usage:
./configure --help
./configure --disable-tools --disable-pam --disable-daemon

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
configure.in
src/daemon/Makefile.am
src/pam/Makefile.am
src/tools/Makefile.am

index 04afe3192c0fd7af8315ff1a84ff55b97207b08c..b1bd2b56579bb65a8d3be32fa29943e8e6aae85b 100644 (file)
@@ -37,6 +37,45 @@ AC_ARG_ENABLE([debug],
                [Define to enable extra debugging output.])],
        [])
 
+AC_ARG_ENABLE([tools],
+       [AC_HELP_STRING([--enable-tools],
+               [compile libcgroup tools [default=yes]])],
+       [
+               if test "x$enableval" = xno; then
+                       with_tools=false
+               else
+                       with_tools=true
+               fi
+       ],
+       [with_tools=true])
+AM_CONDITIONAL([WITH_TOOLS], [test x$with_tools = xtrue])
+
+AC_ARG_ENABLE([pam],
+       [AC_HELP_STRING([--enable-pam],
+               [compile libcgroup PAM module [default=yes]])],
+       [
+               if test "x$enableval" = xno; then
+                       with_pam=false
+               else
+                       with_pam=true
+               fi
+       ],
+       [with_pam=true])
+AM_CONDITIONAL([WITH_PAM], [test x$with_pam = xtrue])
+
+AC_ARG_ENABLE([daemon],
+       [AC_HELP_STRING([--enable-daemon],
+               [compile libcgroup daemon [default=yes]])],
+       [
+               if test "x$enableval" = xno; then
+                       with_daemon=false
+               else
+                       with_daemon=true
+               fi
+       ],
+       [with_daemon=true])
+AM_CONDITIONAL([WITH_DAEMON], [test x$with_daemon = xtrue])
+
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_CC
index f0c9b92d64f98ae994ccf5fd47b2f0bc8b8ed62e..feeeb3a7161766f29b257c3bcd8990a8b234dc1f 100644 (file)
@@ -1,6 +1,10 @@
 INCLUDES = -I $(top_srcdir)/include
-sbin_PROGRAMS = cgrulesengd
 
+if WITH_DAEMON
+
+sbin_PROGRAMS = cgrulesengd
 cgrulesengd_SOURCES = cgrulesengd.c cgrulesengd.h
 cgrulesengd_LDADD = $(top_srcdir)/src/.libs/libcgroup.la -lrt
 cgrulesengd_LDFLAGS = -L$(top_srcdir)/src/.libs
+
+endif
index 1a1e782e14d6c1eeb4d4cdeccd77cd7a372bd317..2ad565eea2f3a382ced824a9adcf3d2e8a628d2a 100644 (file)
@@ -1,6 +1,10 @@
 INCLUDES = -I $(top_srcdir)/include
-lib_LTLIBRARIES = pam_cgroup.la
 
+if WITH_PAM
+
+lib_LTLIBRARIES = pam_cgroup.la
 pam_cgroup_la_SOURCES = pam_cgroup.c
 pam_cgroup_la_LDFLAGS = -module
 pam_cgroup_la_LIBADD = $(top_srcdir)/src/.libs/libcgroup.la -lpam
+
+endif
index e1cace337d86402cb7c198441de23cfe4f16bbbd..93d09ac5f99c4e8ae114ce5424c4cf57b8517ff5 100644 (file)
@@ -1,7 +1,10 @@
 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/include
 LDADD = $(top_srcdir)/src/.libs/libcgroup.la
 
+if WITH_TOOLS
+
 bin_PROGRAMS = cgexec cgclassify
+
 sbin_PROGRAMS = cgconfigparser
 
 cgexec_SOURCES = cgexec.c tools-common.c tools-common.h
@@ -10,3 +13,4 @@ cgclassify_SOURCES = cgclassify.c tools-common.c tools-common.h
 
 cgconfigparser_SOURCES = cgconfig.c
 
+endif