* [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable.
@ 2009-05-28 17:16 Stefan Weil
2009-05-29 13:26 ` Amit Shah
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2009-05-28 17:16 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable.
2009-05-28 17:16 [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable Stefan Weil
@ 2009-05-29 13:26 ` Amit Shah
2009-05-29 13:34 ` Stefan Weil
0 siblings, 1 reply; 3+ messages in thread
From: Amit Shah @ 2009-05-29 13:26 UTC (permalink / raw)
To: Stefan Weil; +Cc: qemu-devel
On (Thu) May 28 2009 [19:16:25], Stefan Weil wrote:
> 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).
Will the patch at
http://article.gmane.org/gmane.comp.emulators.qemu/38346
help this?
Amit
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable.
2009-05-29 13:26 ` Amit Shah
@ 2009-05-29 13:34 ` Stefan Weil
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Weil @ 2009-05-29 13:34 UTC (permalink / raw)
To: Amit Shah; +Cc: qemu-devel
Amit Shah schrieb:
> On (Thu) May 28 2009 [19:16:25], Stefan Weil wrote:
>> 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).
>
> Will the patch at
>
> http://article.gmane.org/gmane.comp.emulators.qemu/38346
>
> help this?
>
> Amit
No, it won't help. That patch still uses CONFIG_QEMU_SHAREDIR:
+ set_datafile_dir(CONFIG_QEMU_SHAREDIR);
And using this constant macro is the problem, because
Windows program directory is not constant.
Regards,
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-29 13:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-28 17:16 [Qemu-devel] [PATCH] Win32: Get bios_dir from path of executable Stefan Weil
2009-05-29 13:26 ` Amit Shah
2009-05-29 13:34 ` Stefan Weil
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).