qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable.
Date: Thu, 28 May 2009 19:16:25 +0200	[thread overview]
Message-ID: <1243530985-23963-1-git-send-email-weil@mail.berlios.de> (raw)

The old value CONFIG_QEMU_SHAREDIR uses a path
which is not standard for most Windows installations
(c:\Program Files is c:\Programme in german).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 configure |    2 ++
 vl.c      |   13 +++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 21c0633..3dfd6a8 100755
--- a/configure
+++ b/configure
@@ -1394,7 +1394,9 @@ echo "bindir=\${prefix}$binsuffix" >> $config_mak
 echo "mandir=\${prefix}$mansuffix" >> $config_mak
 echo "datadir=\${prefix}$datasuffix" >> $config_mak
 echo "docdir=\${prefix}$docsuffix" >> $config_mak
+if test "$mingw32" = "no" ; then
 echo "#define CONFIG_QEMU_SHAREDIR \"$prefix$datasuffix\"" >> $config_h
+fi
 echo "MAKE=$make" >> $config_mak
 echo "INSTALL=$install" >> $config_mak
 echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_mak
diff --git a/vl.c b/vl.c
index f8c0d00..4cce5b3 100644
--- a/vl.c
+++ b/vl.c
@@ -191,7 +191,11 @@ int main(int argc, char **argv)
 /* XXX: use a two level table to limit memory usage */
 #define MAX_IOPORTS 65536
 
+#if defined(_WIN32)
+const char *bios_dir;
+#else
 const char *bios_dir = CONFIG_QEMU_SHAREDIR;
+#endif
 const char *bios_name = NULL;
 static void *ioport_opaque[MAX_IOPORTS];
 static IOPortReadFunc *ioport_read_table[3][MAX_IOPORTS];
@@ -4873,6 +4877,15 @@ int main(int argc, char **argv, char **envp)
             }
         }
     }
+
+    /* Derive the bios path name from the name of the executable. */
+    {
+        char filename[MAX_PATH];
+        GetModuleFileName(0, filename, sizeof(filename));
+        char *p = strrchr(filename, '\\');
+        if (p) *p = '\0';
+        bios_dir = qemu_strdup(filename);
+    }
 #endif
 
     module_call_init(MODULE_INIT_MACHINE);
-- 
1.5.6.5

             reply	other threads:[~2009-05-28 17:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 17:16 Stefan Weil [this message]
2009-05-29 13:26 ` [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable Amit Shah
2009-05-29 13:34   ` Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243530985-23963-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).