]> xenbits.xensource.com Git - libvirt.git/commitdiff
configure: Add systemd detection to --with-init-script=check
authorAndrea Bolognani <abologna@redhat.com>
Thu, 28 Apr 2016 15:19:29 +0000 (17:19 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 2 May 2016 15:18:05 +0000 (17:18 +0200)
Most distributions, including RHEL, have switched to systemd,
so we should detect it and act accordingly. This also means
that 'systemd+redhat' should be preferred to legacy 'redhat'.

Our witness for the check is the availability of the systemctl
command on the host.

configure.ac

index 4149e20d93d1235786a7f68bb4dd83164f0fa46e..f5cb1c33e447e524f38701c40a4e6786598c5c7d 100644 (file)
@@ -634,7 +634,15 @@ if test "$with_init_script" = check; then
     if test "$cross_compiling" = yes; then
         with_init_script=none
     fi
+    if type systemctl >/dev/null 2>&1; then
+        if test "$with_init_script" = check; then
+            with_init_script=systemd
+        fi
+    fi
     if test -f /etc/redhat-release; then
+        if test "$with_init_script" = systemd; then
+            with_init_script=systemd+redhat
+        fi
         if test "$with_init_script" = check; then
             with_init_script=redhat
         fi