summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-10-07 18:23:05 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-10-11 14:31:41 +0200
commit0c1b38d1a86460a638fa0d97099a6eba10cfccf0 (patch)
treeb1c0a11fd47ab4d58e1207b0203733aeef887e04
parentf4f2edba5c555773d7c9adfa95562b96b0c0cdb2 (diff)
downloadsssd-0c1b38d1a86460a638fa0d97099a6eba10cfccf0.tar.gz
sssd-0c1b38d1a86460a638fa0d97099a6eba10cfccf0.tar.xz
sssd-0c1b38d1a86460a638fa0d97099a6eba10cfccf0.zip
BUILD: Detect the path of the "service" executable
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--configure.ac6
-rw-r--r--src/external/service.m413
2 files changed, 15 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 8760a8561..3dbcf9e1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,6 +188,7 @@ m4_include([src/external/cwrap.m4])
m4_include([src/external/libresolv.m4])
m4_include([src/external/intgcheck.m4])
m4_include([src/external/systemtap.m4])
+m4_include([src/external/service.m4])
if test x$with_secrets = xyes; then
m4_include([src/external/libhttp_parser.m4])
@@ -221,10 +222,7 @@ if test x$initscript = xsystemd; then
WITH_SYSTEMD_UNIT_DIR
WITH_SYSTEMD_CONF_DIR
else
- AC_CHECK_PROG(HAVE_SERVICE, service, yes, no)
- AS_IF([test x$HAVE_SERVICE = xyes],
- [AC_DEFINE(HAVE_SERVICE, 1,
- [Whether the service command is available])])
+ CHECK_SERVICE_EXECUTABLE
fi
PKG_CHECK_MODULES([DBUS],[dbus-1])
diff --git a/src/external/service.m4 b/src/external/service.m4
new file mode 100644
index 000000000..f475f26e3
--- /dev/null
+++ b/src/external/service.m4
@@ -0,0 +1,13 @@
+AC_DEFUN([CHECK_SERVICE_EXECUTABLE],
+ [ AC_PATH_PROG(SERVICE, service)
+ AC_MSG_CHECKING(for the executable \"service\")
+ if test -x "$SERVICE"; then
+ AC_DEFINE(HAVE_SERVICE, 1, [Whether the service command is available])
+ AC_DEFINE_UNQUOTED([SERVICE_PATH], ["$SERVICE"], [The path to service])
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([the service executable is not available])
+ fi
+ ]
+)