]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
src/Makefile: compile systemd support by default
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Sat, 25 Nov 2023 14:32:34 +0000 (20:02 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 7 Dec 2023 15:58:13 +0000 (08:58 -0700)
Compile systemd support file by default, now we have stub and defined
versions of the systemd functions for both non-systemd and systemd
enabled configurations.  Pass linker flag WITH_SYSTEMD only when
--enable-systemd is set, that will call the defined function, otherwise
call the stub functions.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/Makefile.am

index 12c94b37d98173b215b83a013d80ee8fe1426fee..50065cf97f16f21926b07934141f19fcd07bf25a 100644 (file)
@@ -7,7 +7,10 @@ SUBDIRS = . daemon pam tools
 if ENABLE_PYTHON
 SUBDIRS += python
 endif
+
+if WITH_SYSTEMD
 EXTRA_DIST = libcgroup_systemd_idle_thread
+endif
 
 # generate parse.h  from parse.y
 AM_YFLAGS = -d
@@ -28,10 +31,7 @@ lib_LTLIBRARIES = libcgroup.la
 libcgroup_la_SOURCES = parse.h parse.y lex.l api.c config.c libcgroup-internal.h libcgroup.map \
                       wrapper.c log.c abstraction-common.c abstraction-common.h \
                       abstraction-map.c abstraction-map.h abstraction-cpu.c abstraction-cpuset.c \
-                      tools/cgxget.c tools/cgxset.c
-if WITH_SYSTEMD
-libcgroup_la_SOURCES += systemd.c
-endif
+                      systemd.c tools/cgxget.c tools/cgxset.c
 
 libcgroup_la_LIBADD = -lpthread $(CODE_COVERAGE_LIBS)
 libcgroup_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DSTATIC=static -DLIBCG_LIB -fPIC
@@ -47,10 +47,7 @@ noinst_LTLIBRARIES = libcgroupfortesting.la
 libcgroupfortesting_la_SOURCES = parse.h parse.y lex.l api.c config.c libcgroup-internal.h \
                                 libcgroup.map wrapper.c log.c abstraction-common.c \
                                 abstraction-common.h abstraction-map.c abstraction-map.h \
-                                abstraction-cpu.c abstraction-cpuset.c
-if WITH_SYSTEMD
-libcgroupfortesting_la_SOURCES += systemd.c
-endif
+                                abstraction-cpu.c abstraction-cpuset.c systemd.c
 
 libcgroupfortesting_la_LIBADD = -lpthread $(CODE_COVERAGE_LIBS)
 libcgroupfortesting_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) -DSTATIC= -DUNIT_TEST