summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2021-01-12 17:39:19 +0800
committerTomáš Mráz <tm@t8m.info>2021-01-27 08:36:28 +0100
commit95b464f8417da81d8c495fb424e24de5e196ab12 (patch)
treea8535ed01d70532f21298dfe7700b271b0a50bc4
parentd54870f993e97fe75e2cd0470a3701d5af22877c (diff)
configure.ac: add --with-systemdunitdir option
* Add this option to support the following scenario: prefix = '/usr' servicedir = '/lib/systemd/system' * The default behavior is changed: If this option is not given, servicedir will be set to the value that is obtained from systemd pkg-config file. If the value cannot be obtained, servicedir will be set to the default value '$(prefix)/lib/systemd/system'. Signed-off-by: Changqing Li <changqing.li@windriver.com>
-rw-r--r--configure.ac10
-rw-r--r--modules/pam_namespace/Makefile.am2
2 files changed, 11 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e325bdd3..bd806473 100644
--- a/configure.ac
+++ b/configure.ac
@@ -613,6 +613,16 @@ test -n "$opt_kerneloverflowuid" ||
opt_kerneloverflowuid=65534
AC_DEFINE_UNQUOTED(PAM_USERTYPE_OVERFLOW_UID, $opt_kerneloverflowuid, [Kernel overflow uid.])
+AC_ARG_WITH([systemdunitdir],
+AS_HELP_STRING([--with-systemdunitdir=DIR], [path to systemd service directory]),
+ [],
+ [
+ PKG_CHECK_EXISTS([systemd],
+ [with_systemdunitdir=$($PKG_CONFIG --variable=systemdunitdir systemd)],
+ [with_systemdunitdir='${prefix}/lib/systemd/system'])
+ ])
+AC_SUBST([systemdunitdir], [$with_systemdunitdir])
+
AC_ARG_ENABLE([unix],
[AS_HELP_STRING([--disable-unix],
[do not build pam_unix module])],
diff --git a/modules/pam_namespace/Makefile.am b/modules/pam_namespace/Makefile.am
index 21e1b33a..47cc38e1 100644
--- a/modules/pam_namespace/Makefile.am
+++ b/modules/pam_namespace/Makefile.am
@@ -18,7 +18,7 @@ TESTS = $(dist_check_SCRIPTS)
securelibdir = $(SECUREDIR)
secureconfdir = $(SCONFIGDIR)
namespaceddir = $(SCONFIGDIR)/namespace.d
-servicedir = $(prefix)/lib/systemd/system
+servicedir = $(systemdunitdir)
AM_CFLAGS = -I$(top_srcdir)/libpam/include -I$(top_srcdir)/libpamc/include \
-DSECURECONF_DIR=\"$(SCONFIGDIR)/\" $(WARN_CFLAGS)