[Top][All Lists]

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

Re: [PATCH] configure: Add flags for MinGW32 standalone build

From: Paolo Bonzini
Subject: Re: [PATCH] configure: Add flags for MinGW32 standalone build
Date: Mon, 11 Jan 2021 08:44:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

On 11/01/21 08:29, Stefan Weil wrote:
Am 11.01.21 um 08:04 schrieb Thomas Huth:

On 08/01/2021 19.30, Joshua Watt wrote:

On 1/8/21 1:25 AM, Thomas Huth wrote:
On 07/01/2021 22.38, Joshua Watt wrote:
There are two cases that need to be accounted for when compiling QEMU
for MinGW32:
  1) A standalone distribution, where QEMU is self contained and
     extracted by the user, such as a user would download from the QEMU
     website. In this case, all of the QEMU files should be rooted in
     $prefix to ensure they can be easily packaged together for
  2) QEMU integrated into a distribution image/sysroot/SDK and
     distributed with other programs. In this case, the provided
     arguments for bindir/datadir/etc. should be respected as they for a
     Linux build.

Add a configure time flags --enable-standalone-mingw and
--disable-standalone-mingw that allows the user to control this
behavior. The flag defaults to "enabled" if unspecified to retain the
existing build behavior

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
  configure | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 5860bdb77b..5c83edb502 100755
--- a/configure
+++ b/configure
@@ -358,6 +358,7 @@ strip_opt="yes"
@@ -1558,6 +1559,10 @@ for opt do
    --disable-fuse-lseek) fuse_lseek="disabled"
+  --enable-standalone-mingw) mingw32_standalone="yes"
+  ;;
+  --disable-standalone-mingw) mingw32_standalone="no"
+  ;;
        echo "ERROR: unknown option $opt"
        echo "Try '$0 --help' for more information"
@@ -1570,7 +1575,7 @@ libdir="${libdir:-$prefix/lib}"
  -if test "$mingw32" = "yes" ; then
+if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; then
@@ -1897,6 +1902,7 @@ disabled with --disable-FEATURE, default is enabled if available
    libdaxctl       libdaxctl support
    fuse            FUSE block device export
    fuse-lseek      SEEK_HOLE/SEEK_DATA support for FUSE exports
+  standalone-mingw  Build for standalone distribution on MinGW
    NOTE: The object files are built at the place where configure is launched

I think this should maybe be done independently from MinGW, so that it could be used on other systems, too. Thus maybe rather name the switch "--enable-standalone-distribution" or "--enable-standalone-installation" or something like this? On MinGW, the value of the switch could then default to "yes" while on other systems it would be "no" by default.

We could, but I'm curious how useful that is? Does that make the option just a shorthand for "--mandir=$prefix --bindir=$prefix --datadir=$prefix etc..." for all builds?

Yes, that would basically be a shorthand for that. Could be useful for people who want to create standalone binaries on Linux etc., too.


Aren't nearly all files already rooted in $prefix? The only exception I know is /etc/qemu.

Rooting in $prefix still allows hierarchical subdirectories. I'd prefer them for MinGW, too.

I agree, it was an issue before 5.2 but now we have relocatable installations. So it would be better to remove all the special casing of mingw, except that (for backwards compatibility) on mingw bindir defaults to $prefix instead of $prefix/bin. Then Joshua's usecase is covered simply by --bindir=/mingw/bin.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]