[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 17/28] Use configure --localstatedir=BASEDIR to set path to /var



This is helpful to test make uninstall with --prefix=/private/dir as
unprivileged user. No change in behaviour is expected by this change.

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 m4/paths.m4    | 24 ++++++++++++++++--------
 tools/Makefile |  2 +-
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/m4/paths.m4 b/m4/paths.m4
index b924ffc..7ca4e53 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -2,6 +2,14 @@ AC_DEFUN([AX_XEN_EXPAND_CONFIG], [
 dnl expand these early so we can use this for substitutions
 test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
 test "x$exec_prefix" = "xNONE" && exec_prefix=${prefix}
+
+dnl Use /var instead of /usr/local/var because there can be only one
+dnl xenstored active at a time. All tools have to share this dir, even
+dnl if they come from a different --prefix=.
+if test "$localstatedir" = '${prefix}/var' ; then
+    localstatedir=/var
+fi
+
 dnl expand exec_prefix or it will endup in substituted variables
 bindir=`eval echo $bindir`
 sbindir=`eval echo $sbindir`
@@ -58,13 +66,13 @@ dnl This variable will be substituted in various .in files
 LIBEXEC_BIN=`eval echo $libexecdir/$PACKAGE_TARNAME/bin`
 AC_SUBST(LIBEXEC_BIN)
 
-XEN_RUN_DIR=/var/run/xen
+XEN_RUN_DIR=$localstatedir/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
-XEN_LOG_DIR=/var/log/xen
+XEN_LOG_DIR=$localstatedir/log/xen
 AC_SUBST(XEN_LOG_DIR)
 
-XEN_LIB_STORED=/var/lib/xenstored
+XEN_LIB_STORED=$localstatedir/lib/xenstored
 AC_SUBST(XEN_LIB_STORED)
 
 SHAREDIR=$prefix/share
@@ -96,15 +104,15 @@ XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
 AC_SUBST(XEN_SCRIPT_DIR)
 
 case "$host_os" in
-*freebsd*) XEN_LOCK_DIR=/var/lib ;;
-*netbsd*) XEN_LOCK_DIR=/var/lib ;;
-*) XEN_LOCK_DIR=/var/lock ;;
+*freebsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*netbsd*) XEN_LOCK_DIR=$localstatedir/lib ;;
+*) XEN_LOCK_DIR=$localstatedir/lock ;;
 esac
 AC_SUBST(XEN_LOCK_DIR)
 
-XEN_RUN_DIR=/var/run/xen
+XEN_RUN_DIR=$localstatedir/run/xen
 AC_SUBST(XEN_RUN_DIR)
 
-XEN_PAGING_DIR=/var/lib/xen/xenpaging
+XEN_PAGING_DIR=$localstatedir/lib/xen/xenpaging
 AC_SUBST(XEN_PAGING_DIR)
 ])
diff --git a/tools/Makefile b/tools/Makefile
index 284b73e..67e1dc5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -201,7 +201,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
                -Wl,-rpath=$(PREFIX)/lib/xen/lib" \
                --bindir=$(LIBEXEC_BIN) \
                --datadir=$(SHAREDIR)/qemu-xen \
-               --localstatedir=/var \
+               --localstatedir=$(localstatedir) \
                --disable-kvm \
                --disable-docs \
                --disable-guest-agent \

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.