chiark / gitweb /
systemctl: enable chkconfig compat only if chkconfig is found rather than based on...
authorLennart Poettering <lennart@poettering.net>
Fri, 4 Jan 2013 21:32:31 +0000 (22:32 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 4 Jan 2013 22:26:21 +0000 (23:26 +0100)
configure.ac
src/systemctl/systemctl.c

index 92dbdf5a30552e2edda3e5b8dd2408663c46c242..a39dd6a33c79e4a1f1fca7da0640007212f7b84f 100644 (file)
@@ -232,6 +232,25 @@ if test "x${have_ima}" != xno ; then
         AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available])
 fi
 
+# ------------------------------------------------------------------------------
+have_chkconfig=yes
+AC_ARG_ENABLE([chkconfig], AS_HELP_STRING([--disable-chkconfig],[Disable optional chkconfig support]),
+                [case "${enableval}" in
+                        yes) have_chkconfig=yes ;;
+                        no) have_chkconfig=no ;;
+                        *) AC_MSG_ERROR(bad value ${enableval} for --disable-chkconfig) ;;
+                esac],
+                [AC_PATH_PROG(CHKCONFIG, chkconfig)
+                if test -z "$CHKCONFIG"; then
+                        have_chkconfig=no
+                else
+                        have_chkconfig=yes
+                fi])
+
+if test "x${have_chkconfig}" != xno ; then
+        AC_DEFINE(HAVE_CHKCONFIG, 1, [Define if CHKCONFIG is available])
+fi
+
 # ------------------------------------------------------------------------------
 have_selinux=no
 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
@@ -873,6 +892,7 @@ AC_MSG_RESULT([
         GCRYPT:                  ${have_gcrypt}
         QRENCODE:                ${have_qrencode}
         MICROHTTPD:              ${have_microhttpd}
+        CHKCONFIG:               ${have_chkconfig}
         binfmt:                  ${have_binfmt}
         vconsole:                ${have_vconsole}
         readahead:               ${have_readahead}
index 086872c696ba9f6a1de698041b9b481f2f760294..b71d5de30a6f2c48979422646be152e64b9e3ab3 100644 (file)
@@ -3436,7 +3436,7 @@ finish:
 static int enable_sysv_units(char **args) {
         int r = 0;
 
-#if defined (HAVE_SYSV_COMPAT) && (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE) || defined(TARGET_ALTLINUX) || defined(TARGET_MAGEIA))
+#if defined(HAVE_SYSV_COMPAT) && defined(HAVE_CHKCONFIG)
         const char *verb = args[0];
         unsigned f = 1, t = 1;
         LookupPaths paths;