]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Don't install sysctl file on non-Linux hosts
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 4 Apr 2012 10:16:34 +0000 (11:16 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 4 Apr 2012 18:31:40 +0000 (19:31 +0100)
* configure.ac: Set WITH_SYSCTL only on Linux hosts
* daemon/Makefile.am: Conditionalize install-sysctl using WITH_SYSCTL

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Cc: Jason Helfman <jhelfman@e-e.com>
configure.ac
daemon/Makefile.am

index 0e83019a3b5f162fda54f71e7f53db2980c0e1ee..3f5b3ffecb2facce3fcbfaf225b7d06abe0134b6 100644 (file)
@@ -403,6 +403,31 @@ AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_UPSTART], test "$init_upstart" = "yes")
 AM_CONDITIONAL([LIBVIRT_INIT_SCRIPT_SYSTEMD], test "$init_systemd" = "yes")
 AC_MSG_RESULT($with_init_script)
 
+
+AC_MSG_CHECKING([for whether to install sysctl config])
+AC_ARG_WITH([sysctl],
+            [AC_HELP_STRING([--with-sysctl@<:@=yes/no@:>@],
+                            [Whether to install sysctl configs @<:@default=auto@:>@])],
+                            [],[with_sysctl=check])
+
+if test "$with_sysctl" = "yes" || test "$with_sysctl" = "check"
+then
+  case $host in
+    *-*-linux*)
+      with_sysctl=yes
+      ;;
+    **)
+      if test "$with_sysctl" = "yes"; then
+         AC_MSG_ERROR([No sysctl configuration supported for $host])
+      else
+         with_sysctl=no
+      fi
+      ;;
+  esac
+fi
+AM_CONDITIONAL([WITH_SYSCTL], test "$with_sysctl" = "yes")
+AC_MSG_RESULT($with_sysctl)
+
 dnl RHEL-5 has a peculiar version of Xen, which requires some special casing
 AC_ARG_WITH([rhel5-api],
        [AC_HELP_STRING([--with-rhel5-api=@<:@ARG@:>@],
index db4abf53fe8d35627d333e23f694c45ab8827b5b..391cd99955f0cc95eb9dd9494fc53e7a4eaab9d6 100644 (file)
@@ -256,6 +256,7 @@ uninstall-sysconfig:
        rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd
        rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
 
+if WITH_SYSCTL
 install-sysctl:
        $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysctl.d
        $(INSTALL_DATA) $(srcdir)/libvirtd.sysctl \
@@ -264,6 +265,10 @@ install-sysctl:
 uninstall-sysctl:
        rm -f $(DESTDIR)$(sysconfdir)/sysctl.d/libvirtd
        rmdir $(DESTDIR)$(sysconfdir)/sysctl.d || :
+else
+install-sysctl:
+uninstall-sysctl:
+endif
 
 if LIBVIRT_INIT_SCRIPT_RED_HAT