From bb1bbc4004d321f5f42a580c3bfbf2def425e70f Mon Sep 17 00:00:00 2001
Message-Id: <bb1bbc4004d321f5f42a580c3bfbf2def425e70f.1372244120.git.minovotn@redhat.com>
In-Reply-To: <24977988cb53a0f50e2996977c2221c5a358a4b8.1372244120.git.minovotn@redhat.com>
References: <24977988cb53a0f50e2996977c2221c5a358a4b8.1372244120.git.minovotn@redhat.com>
From: Laszlo Ersek <lersek@redhat.com>
Date: Fri, 7 Jun 2013 12:23:55 +0200
Subject: [PATCH 03/12] configure: don't save any fixed local_statedir for
 win32

RH-Author: Laszlo Ersek <lersek@redhat.com>
Message-id: <1370607840-30295-4-git-send-email-lersek@redhat.com>
Patchwork-id: 51776
O-Subject: [RHEL-6.5 qemu-kvm PATCH 3/8] configure: don't save any fixed local_statedir for win32
Bugzilla: 962669
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Gal Hammer <ghammer@redhat.com>
RH-Acked-by: Michal Novotny <minovotn@redhat.com>

... because now we can get the dynamic value with
qemu_get_local_state_pathname().

The only user of the fixed value was the guest agent, which we've moved to
qemu_get_local_state_pathname() in the previous patch.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>

RHEL-6 notes:
- manual port of 5a699bbbf300902141d2458682d05cd310d7a07f,
- "local_statedir" default was determined differently from upstream, added
  a place-holder comment for "git blame"
- "local state directory" used to go unreported in the RHEL-6 configure
  summary before.
---
 configure |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 configure | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index ff58e9f..b4259d5 100755
--- a/configure
+++ b/configure
@@ -796,7 +796,7 @@ echo "  --make=MAKE              use specified make [$make]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --static                 enable static build [$static]"
 echo "  --sysconfdir=PATH        install config in PATH"
-echo "  --localstatedir=PATH     install local state in PATH"
+echo "  --localstatedir=PATH     install local state in PATH (set at runtime on win32)"
 echo "  --enable-debug-tcg       enable TCG debugging"
 echo "  --disable-debug-tcg      disable TCG debugging (default)"
 echo "  --enable-debug           enable common debug build options"
@@ -2231,9 +2231,8 @@ if test "$mingw32" = "yes" ; then
   if test -z "$sysconfdir" ; then
       sysconfdir="${prefix}"
   fi
-  if test -z "$local_statedir" ; then
-      local_statedir="${prefix}"
-  fi
+  # no need to set a fixed default local_statedir on Win32, the value depends
+  # on the runtime environment
 else
   if test -z "$prefix" ; then
       prefix="/usr/local"
@@ -2268,8 +2267,11 @@ echo "Install prefix    $prefix"
 echo "BIOS directory    $prefix$datasuffix"
 echo "binary directory  $prefix$binsuffix"
 if test "$mingw32" = "no" ; then
+echo "local state directory   `eval echo $local_statedir`"
 echo "Manual directory  $prefix$mansuffix"
 echo "ELF interp prefix $interp_prefix"
+else
+echo "local state directory   queried at runtime"
 fi
 echo "Source path       $source_path"
 echo "C compiler        $cc"
@@ -2672,7 +2674,9 @@ echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
 echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
 echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
-echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
+if test "$mingw32" = "no" ; then
+  echo "qemu_localstatedir=$local_statedir" >> $config_host_mak
+fi
 echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
 echo "INSTALL=$install" >> $config_host_mak
-- 
1.7.11.7

