All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configure: Add flags for MinGW32 standalone build
@ 2021-01-07 21:38 Joshua Watt
  2021-01-08  7:25 ` Thomas Huth
  2021-01-12 21:02 ` [PATCH v2] configure: MinGW respect --bindir argument Joshua Watt
  0 siblings, 2 replies; 11+ messages in thread
From: Joshua Watt @ 2021-01-07 21:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Joshua Watt

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
    distribution
 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"
 tcg_interpreter="no"
 bigendian="no"
 mingw32="no"
+mingw32_standalone="yes"
 gcov="no"
 EXESUF="$default_feature"
 HOST_DSOSUF=".so"
@@ -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}"
 libexecdir="${libexecdir:-$prefix/libexec}"
 includedir="${includedir:-$prefix/include}"
 
-if test "$mingw32" = "yes" ; then
+if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; then
     mandir="$prefix"
     datadir="$prefix"
     docdir="$prefix"
@@ -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
 EOF
-- 
2.30.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-07 21:38 [PATCH] configure: Add flags for MinGW32 standalone build Joshua Watt
@ 2021-01-08  7:25 ` Thomas Huth
  2021-01-08 18:30   ` Joshua Watt
  2021-01-12 21:02 ` [PATCH v2] configure: MinGW respect --bindir argument Joshua Watt
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2021-01-08  7:25 UTC (permalink / raw)
  To: Joshua Watt, qemu-devel; +Cc: Stefan Weil, Yonggang Luo, Paolo Bonzini

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
>      distribution
>   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"
>   tcg_interpreter="no"
>   bigendian="no"
>   mingw32="no"
> +mingw32_standalone="yes"
>   gcov="no"
>   EXESUF="$default_feature"
>   HOST_DSOSUF=".so"
> @@ -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}"
>   libexecdir="${libexecdir:-$prefix/libexec}"
>   includedir="${includedir:-$prefix/include}"
>   
> -if test "$mingw32" = "yes" ; then
> +if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; then
>       mandir="$prefix"
>       datadir="$prefix"
>       docdir="$prefix"
> @@ -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
>   EOF

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.

  Thomas



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-08  7:25 ` Thomas Huth
@ 2021-01-08 18:30   ` Joshua Watt
  2021-01-11  7:04     ` Thomas Huth
  0 siblings, 1 reply; 11+ messages in thread
From: Joshua Watt @ 2021-01-08 18:30 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: Stefan Weil, Yonggang Luo, Paolo Bonzini


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
>>      distribution
>>   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"
>>   tcg_interpreter="no"
>>   bigendian="no"
>>   mingw32="no"
>> +mingw32_standalone="yes"
>>   gcov="no"
>>   EXESUF="$default_feature"
>>   HOST_DSOSUF=".so"
>> @@ -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}"
>>   libexecdir="${libexecdir:-$prefix/libexec}"
>>   includedir="${includedir:-$prefix/include}"
>>   -if test "$mingw32" = "yes" ; then
>> +if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; then
>>       mandir="$prefix"
>>       datadir="$prefix"
>>       docdir="$prefix"
>> @@ -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
>>   EOF
>
> 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?

>
>  Thomas
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-08 18:30   ` Joshua Watt
@ 2021-01-11  7:04     ` Thomas Huth
  2021-01-11  7:29       ` Stefan Weil
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2021-01-11  7:04 UTC (permalink / raw)
  To: Joshua Watt, qemu-devel; +Cc: Stefan Weil, Yonggang Luo, Paolo Bonzini

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
>>>      distribution
>>>   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"
>>>   tcg_interpreter="no"
>>>   bigendian="no"
>>>   mingw32="no"
>>> +mingw32_standalone="yes"
>>>   gcov="no"
>>>   EXESUF="$default_feature"
>>>   HOST_DSOSUF=".so"
>>> @@ -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}"
>>>   libexecdir="${libexecdir:-$prefix/libexec}"
>>>   includedir="${includedir:-$prefix/include}"
>>>   -if test "$mingw32" = "yes" ; then
>>> +if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; then
>>>       mandir="$prefix"
>>>       datadir="$prefix"
>>>       docdir="$prefix"
>>> @@ -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
>>>   EOF
>>
>> 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.

  Thomas



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-11  7:04     ` Thomas Huth
@ 2021-01-11  7:29       ` Stefan Weil
  2021-01-11  7:44         ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Weil @ 2021-01-11  7:29 UTC (permalink / raw)
  To: Thomas Huth, Joshua Watt, qemu-devel; +Cc: Paolo Bonzini, Yonggang Luo

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
>>>>      distribution
>>>>   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"
>>>>   tcg_interpreter="no"
>>>>   bigendian="no"
>>>>   mingw32="no"
>>>> +mingw32_standalone="yes"
>>>>   gcov="no"
>>>>   EXESUF="$default_feature"
>>>>   HOST_DSOSUF=".so"
>>>> @@ -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}"
>>>>   libexecdir="${libexecdir:-$prefix/libexec}"
>>>>   includedir="${includedir:-$prefix/include}"
>>>>   -if test "$mingw32" = "yes" ; then
>>>> +if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; 
>>>> then
>>>>       mandir="$prefix"
>>>>       datadir="$prefix"
>>>>       docdir="$prefix"
>>>> @@ -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
>>>>   EOF
>>>
>>> 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.
>
>  Thomas


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.

Stefan





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-11  7:29       ` Stefan Weil
@ 2021-01-11  7:44         ` Paolo Bonzini
  2021-01-11 16:01           ` Joshua Watt
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2021-01-11  7:44 UTC (permalink / raw)
  To: Stefan Weil, Thomas Huth, Joshua Watt, qemu-devel; +Cc: Yonggang Luo

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
>>>>>      distribution
>>>>>   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"
>>>>>   tcg_interpreter="no"
>>>>>   bigendian="no"
>>>>>   mingw32="no"
>>>>> +mingw32_standalone="yes"
>>>>>   gcov="no"
>>>>>   EXESUF="$default_feature"
>>>>>   HOST_DSOSUF=".so"
>>>>> @@ -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}"
>>>>>   libexecdir="${libexecdir:-$prefix/libexec}"
>>>>>   includedir="${includedir:-$prefix/include}"
>>>>>   -if test "$mingw32" = "yes" ; then
>>>>> +if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes"; 
>>>>> then
>>>>>       mandir="$prefix"
>>>>>       datadir="$prefix"
>>>>>       docdir="$prefix"
>>>>> @@ -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
>>>>>   EOF
>>>>
>>>> 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.
>>
>>  Thomas
> 
> 
> 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.

Paolo



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-11  7:44         ` Paolo Bonzini
@ 2021-01-11 16:01           ` Joshua Watt
  2021-01-11 17:34             ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Joshua Watt @ 2021-01-11 16:01 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Stefan Weil, Thomas Huth, qemu-devel, Yonggang Luo

On Mon, Jan 11, 2021 at 1:44 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> 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
> >>>>>      distribution
> >>>>>   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"
> >>>>>   tcg_interpreter="no"
> >>>>>   bigendian="no"
> >>>>>   mingw32="no"
> >>>>> +mingw32_standalone="yes"
> >>>>>   gcov="no"
> >>>>>   EXESUF="$default_feature"
> >>>>>   HOST_DSOSUF=".so"
> >>>>> @@ -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}"
> >>>>>   libexecdir="${libexecdir:-$prefix/libexec}"
> >>>>>   includedir="${includedir:-$prefix/include}"
> >>>>>   -if test "$mingw32" = "yes" ; then
> >>>>> +if test "$mingw32" = "yes" && test "$mingw32_standalone" = "yes";
> >>>>> then
> >>>>>       mandir="$prefix"
> >>>>>       datadir="$prefix"
> >>>>>       docdir="$prefix"
> >>>>> @@ -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
> >>>>>   EOF
> >>>>
> >>>> 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.
> >>
> >>  Thomas
> >
> >
> > 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.

Right. Removing the special case for MinGW would solve my problem and
be fine with me; the thing I don't know is if we need to preserve the
backward compatibility of forcing a specific "flat" layout in $prefix
when building for MinGW. There are basically 2 options I can see:
 1) Add a flag to default MinGW to the "flat" layout, but allow it to
be overridden so that it can follow a normal layout (e.g. --bindir,
etc. are respected). This what my patch adds
 2) Remove the special casing for MinGW entirely. A "flat" layout
would still be possible by doing e.g. "--bindir=$prefix
--datadir=$prefix ..." manually but it would no longer be the default.

I'm fine with either option, but I'm not familiar enough with the
project to be able to know which is better.

>
> Paolo
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] configure: Add flags for MinGW32 standalone build
  2021-01-11 16:01           ` Joshua Watt
@ 2021-01-11 17:34             ` Paolo Bonzini
  0 siblings, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2021-01-11 17:34 UTC (permalink / raw)
  To: Joshua Watt; +Cc: Stefan Weil, Thomas Huth, qemu-devel, Yonggang Luo

On 11/01/21 17:01, Joshua Watt wrote:
>> 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.
> Right. Removing the special case for MinGW would solve my problem and
> be fine with me; the thing I don't know is if we need to preserve the
> backward compatibility of forcing a specific "flat" layout in $prefix
> when building for MinGW. There are basically 2 options I can see:
>   1) Add a flag to default MinGW to the "flat" layout, but allow it to
> be overridden so that it can follow a normal layout (e.g. --bindir,
> etc. are respected). This what my patch adds
>   2) Remove the special casing for MinGW entirely. A "flat" layout
> would still be possible by doing e.g. "--bindir=$prefix
> --datadir=$prefix ..." manually but it would no longer be the default.
> 
> I'm fine with either option, but I'm not familiar enough with the
> project to be able to know which is better.

I think it's okay if you remove the special case _almost_ entirely. 
That is, MinGW would still default to --bindir=$prefix (and that would 
be the only "flattened" directory), but it would be possible to override 
it for your use case.

Paolo



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2] configure: MinGW respect --bindir argument
  2021-01-07 21:38 [PATCH] configure: Add flags for MinGW32 standalone build Joshua Watt
  2021-01-08  7:25 ` Thomas Huth
@ 2021-01-12 21:02 ` Joshua Watt
  2021-01-13  5:33   ` Thomas Huth
  2021-01-13 10:01   ` Paolo Bonzini
  1 sibling, 2 replies; 11+ messages in thread
From: Joshua Watt @ 2021-01-12 21:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, thuth, luoyonggang, Joshua Watt

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 the QEMU executable files should be
    rooted in $prefix to ensure they can be easily found by the user
 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.

Restructures the MinGW path configuration so that all of the paths
except bindir use the same rules as when building for other platforms.
This satisfies #2 and #1 since these files do not need to be directly in
$prefix anyway.

The handling for --bindir is changed so that it defaults to $prefix on
MinGW (maintaining the compatibility with #1), but if the user specifies
a specific path when configuring it can also satisfy #2.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 configure | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index 5860bdb77b..092e2926bc 100755
--- a/configure
+++ b/configure
@@ -1571,20 +1571,15 @@ libexecdir="${libexecdir:-$prefix/libexec}"
 includedir="${includedir:-$prefix/include}"
 
 if test "$mingw32" = "yes" ; then
-    mandir="$prefix"
-    datadir="$prefix"
-    docdir="$prefix"
-    bindir="$prefix"
-    sysconfdir="$prefix"
-    local_statedir="$prefix"
+    bindir="${bindir:-$prefix}"
 else
-    mandir="${mandir:-$prefix/share/man}"
-    datadir="${datadir:-$prefix/share}"
-    docdir="${docdir:-$prefix/share/doc}"
     bindir="${bindir:-$prefix/bin}"
-    sysconfdir="${sysconfdir:-$prefix/etc}"
-    local_statedir="${local_statedir:-$prefix/var}"
 fi
+mandir="${mandir:-$prefix/share/man}"
+datadir="${datadir:-$prefix/share}"
+docdir="${docdir:-$prefix/share/doc}"
+sysconfdir="${sysconfdir:-$prefix/etc}"
+local_statedir="${local_statedir:-$prefix/var}"
 firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
 localedir="${localedir:-$datadir/locale}"
 
-- 
2.30.0



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] configure: MinGW respect --bindir argument
  2021-01-12 21:02 ` [PATCH v2] configure: MinGW respect --bindir argument Joshua Watt
@ 2021-01-13  5:33   ` Thomas Huth
  2021-01-13 10:01   ` Paolo Bonzini
  1 sibling, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2021-01-13  5:33 UTC (permalink / raw)
  To: Joshua Watt, qemu-devel; +Cc: QEMU Trivial, pbonzini, luoyonggang

On 12/01/2021 22.02, 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 the QEMU executable files should be
>      rooted in $prefix to ensure they can be easily found by the user
>   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.
> 
> Restructures the MinGW path configuration so that all of the paths
> except bindir use the same rules as when building for other platforms.
> This satisfies #2 and #1 since these files do not need to be directly in
> $prefix anyway.
> 
> The handling for --bindir is changed so that it defaults to $prefix on
> MinGW (maintaining the compatibility with #1), but if the user specifies
> a specific path when configuring it can also satisfy #2.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>   configure | 17 ++++++-----------
>   1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/configure b/configure
> index 5860bdb77b..092e2926bc 100755
> --- a/configure
> +++ b/configure
> @@ -1571,20 +1571,15 @@ libexecdir="${libexecdir:-$prefix/libexec}"
>   includedir="${includedir:-$prefix/include}"
>   
>   if test "$mingw32" = "yes" ; then
> -    mandir="$prefix"
> -    datadir="$prefix"
> -    docdir="$prefix"
> -    bindir="$prefix"
> -    sysconfdir="$prefix"
> -    local_statedir="$prefix"
> +    bindir="${bindir:-$prefix}"
>   else
> -    mandir="${mandir:-$prefix/share/man}"
> -    datadir="${datadir:-$prefix/share}"
> -    docdir="${docdir:-$prefix/share/doc}"
>       bindir="${bindir:-$prefix/bin}"
> -    sysconfdir="${sysconfdir:-$prefix/etc}"
> -    local_statedir="${local_statedir:-$prefix/var}"
>   fi
> +mandir="${mandir:-$prefix/share/man}"
> +datadir="${datadir:-$prefix/share}"
> +docdir="${docdir:-$prefix/share/doc}"
> +sysconfdir="${sysconfdir:-$prefix/etc}"
> +local_statedir="${local_statedir:-$prefix/var}"
>   firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
>   localedir="${localedir:-$datadir/locale}"

Yes, I think this makes most sense, thanks for the update!

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2] configure: MinGW respect --bindir argument
  2021-01-12 21:02 ` [PATCH v2] configure: MinGW respect --bindir argument Joshua Watt
  2021-01-13  5:33   ` Thomas Huth
@ 2021-01-13 10:01   ` Paolo Bonzini
  1 sibling, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2021-01-13 10:01 UTC (permalink / raw)
  To: Joshua Watt, qemu-devel; +Cc: thuth, luoyonggang

On 12/01/21 22:02, 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 the QEMU executable files should be
>      rooted in $prefix to ensure they can be easily found by the user
>   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.
> 
> Restructures the MinGW path configuration so that all of the paths
> except bindir use the same rules as when building for other platforms.
> This satisfies #2 and #1 since these files do not need to be directly in
> $prefix anyway.
> 
> The handling for --bindir is changed so that it defaults to $prefix on
> MinGW (maintaining the compatibility with #1), but if the user specifies
> a specific path when configuring it can also satisfy #2.
> 
> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
> ---
>   configure | 17 ++++++-----------
>   1 file changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/configure b/configure
> index 5860bdb77b..092e2926bc 100755
> --- a/configure
> +++ b/configure
> @@ -1571,20 +1571,15 @@ libexecdir="${libexecdir:-$prefix/libexec}"
>   includedir="${includedir:-$prefix/include}"
>   
>   if test "$mingw32" = "yes" ; then
> -    mandir="$prefix"
> -    datadir="$prefix"
> -    docdir="$prefix"
> -    bindir="$prefix"
> -    sysconfdir="$prefix"
> -    local_statedir="$prefix"
> +    bindir="${bindir:-$prefix}"
>   else
> -    mandir="${mandir:-$prefix/share/man}"
> -    datadir="${datadir:-$prefix/share}"
> -    docdir="${docdir:-$prefix/share/doc}"
>       bindir="${bindir:-$prefix/bin}"
> -    sysconfdir="${sysconfdir:-$prefix/etc}"
> -    local_statedir="${local_statedir:-$prefix/var}"
>   fi
> +mandir="${mandir:-$prefix/share/man}"
> +datadir="${datadir:-$prefix/share}"
> +docdir="${docdir:-$prefix/share/doc}"
> +sysconfdir="${sysconfdir:-$prefix/etc}"
> +local_statedir="${local_statedir:-$prefix/var}"
>   firmwarepath="${firmwarepath:-$datadir/qemu-firmware}"
>   localedir="${localedir:-$datadir/locale}"
>   
> 

Queued, thanks!

Paolo



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-13 10:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 21:38 [PATCH] configure: Add flags for MinGW32 standalone build Joshua Watt
2021-01-08  7:25 ` Thomas Huth
2021-01-08 18:30   ` Joshua Watt
2021-01-11  7:04     ` Thomas Huth
2021-01-11  7:29       ` Stefan Weil
2021-01-11  7:44         ` Paolo Bonzini
2021-01-11 16:01           ` Joshua Watt
2021-01-11 17:34             ` Paolo Bonzini
2021-01-12 21:02 ` [PATCH v2] configure: MinGW respect --bindir argument Joshua Watt
2021-01-13  5:33   ` Thomas Huth
2021-01-13 10:01   ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.