qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
@ 2012-08-24  9:47 Brad Smith
  2012-08-24  9:55 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Brad Smith @ 2012-08-24  9:47 UTC (permalink / raw)
  To: qemu-devel

OpenBSD's uname works as expected with the -s flag so remove the special
handling when determining the target OS. Use arch -s to retrieve the
hardware architecture as uname -m will return the meta architecture
instead of the hardware architecture (.e.g. macppc vs powerpc).


Signed-off-by: Brad Smith <brad@comstyle.com> 

diff --git a/configure b/configure
index d97fd81..6073dd2 100755
--- a/configure
+++ b/configure
@@ -303,8 +303,6 @@ if check_define __linux__ ; then
   targetos="Linux"
 elif check_define _WIN32 ; then
   targetos='MINGW32'
-elif check_define __OpenBSD__ ; then
-  targetos='OpenBSD'
 elif check_define __sun__ ; then
   targetos='SunOS'
 elif check_define __HAIKU__ ; then
@@ -332,6 +330,11 @@ SunOS)
   if test -z "$cpu" && test "$(isainfo -k)" = "amd64"; then
     cpu="x86_64"
   fi
+  ;;
+OpenBSD)
+  # 'uname -m' returns the meta arch macppc instead of the hw arch powerpc
+  cpu=`arch -s`
+  ;;
 esac
 
 if test ! -z "$cpu" ; then

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

* Re: [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
  2012-08-24  9:47 [Qemu-devel] [PATCH] configure: some fixes for OpenBSD Brad Smith
@ 2012-08-24  9:55 ` Peter Maydell
  2012-08-24 10:03   ` Brad Smith
  2012-08-24 11:56   ` Paolo Bonzini
  0 siblings, 2 replies; 7+ messages in thread
From: Peter Maydell @ 2012-08-24  9:55 UTC (permalink / raw)
  To: Brad Smith; +Cc: qemu-devel

On 24 August 2012 10:47, Brad Smith <brad@comstyle.com> wrote:
> OpenBSD's uname works as expected with the -s flag so remove the special
> handling when determining the target OS. Use arch -s to retrieve the
> hardware architecture as uname -m will return the meta architecture
> instead of the hardware architecture (.e.g. macppc vs powerpc).

I'm afraid I think this patch is moving in the wrong direction.
Wherever possible we should be using compiler checks like check_define,
not looking at the output of 'uname' and the like. The former will
work when cross compiling, and the latter will give the wrong answers.
In some places we have that kind of 'look at uname/etc' check but
we should be trying to reduce and eliminate it where possible.

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
  2012-08-24  9:55 ` Peter Maydell
@ 2012-08-24 10:03   ` Brad Smith
  2012-08-24 11:56   ` Paolo Bonzini
  1 sibling, 0 replies; 7+ messages in thread
From: Brad Smith @ 2012-08-24 10:03 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

On Fri, Aug 24, 2012 at 10:55:10AM +0100, Peter Maydell wrote:
> On 24 August 2012 10:47, Brad Smith <brad@comstyle.com> wrote:
> > OpenBSD's uname works as expected with the -s flag so remove the special
> > handling when determining the target OS. Use arch -s to retrieve the
> > hardware architecture as uname -m will return the meta architecture
> > instead of the hardware architecture (.e.g. macppc vs powerpc).
> 
> I'm afraid I think this patch is moving in the wrong direction.
> Wherever possible we should be using compiler checks like check_define,
> not looking at the output of 'uname' and the like. The former will
> work when cross compiling, and the latter will give the wrong answers.
> In some places we have that kind of 'look at uname/etc' check but
> we should be trying to reduce and eliminate it where possible.

Ah, ok. I thought maybe it could be simplified in favor of using
uname more so. That's fine with me. I'll drop it.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

* Re: [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
  2012-08-24  9:55 ` Peter Maydell
  2012-08-24 10:03   ` Brad Smith
@ 2012-08-24 11:56   ` Paolo Bonzini
  2012-08-24 12:00     ` Brad Smith
  1 sibling, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2012-08-24 11:56 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Brad Smith

Il 24/08/2012 11:55, Peter Maydell ha scritto:
>> > OpenBSD's uname works as expected with the -s flag so remove the special
>> > handling when determining the target OS. Use arch -s to retrieve the
>> > hardware architecture as uname -m will return the meta architecture
>> > instead of the hardware architecture (.e.g. macppc vs powerpc).
> I'm afraid I think this patch is moving in the wrong direction.
> Wherever possible we should be using compiler checks like check_define,
> not looking at the output of 'uname' and the like. The former will
> work when cross compiling, and the latter will give the wrong answers.
> In some places we have that kind of 'look at uname/etc' check but
> we should be trying to reduce and eliminate it where possible.

Right, we should support GNU triplets and a --host argument, and replace
uname checks with pattern matching on the triplet.

Paolo

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

* Re: [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
  2012-08-24 11:56   ` Paolo Bonzini
@ 2012-08-24 12:00     ` Brad Smith
  2012-08-24 12:02       ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Brad Smith @ 2012-08-24 12:00 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel

On Fri, Aug 24, 2012 at 01:56:31PM +0200, Paolo Bonzini wrote:
> Il 24/08/2012 11:55, Peter Maydell ha scritto:
> >> > OpenBSD's uname works as expected with the -s flag so remove the special
> >> > handling when determining the target OS. Use arch -s to retrieve the
> >> > hardware architecture as uname -m will return the meta architecture
> >> > instead of the hardware architecture (.e.g. macppc vs powerpc).
> > I'm afraid I think this patch is moving in the wrong direction.
> > Wherever possible we should be using compiler checks like check_define,
> > not looking at the output of 'uname' and the like. The former will
> > work when cross compiling, and the latter will give the wrong answers.
> > In some places we have that kind of 'look at uname/etc' check but
> > we should be trying to reduce and eliminate it where possible.
> 
> Right, we should support GNU triplets and a --host argument, and replace
> uname checks with pattern matching on the triplet.

That still requires a means of generating that triplet in the first place.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

* Re: [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
  2012-08-24 12:00     ` Brad Smith
@ 2012-08-24 12:02       ` Paolo Bonzini
  2012-08-24 12:15         ` Brad Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2012-08-24 12:02 UTC (permalink / raw)
  To: Brad Smith; +Cc: Peter Maydell, qemu-devel

Il 24/08/2012 14:00, Brad Smith ha scritto:
>>>>> > >> > OpenBSD's uname works as expected with the -s flag so remove the special
>>>>> > >> > handling when determining the target OS. Use arch -s to retrieve the
>>>>> > >> > hardware architecture as uname -m will return the meta architecture
>>>>> > >> > instead of the hardware architecture (.e.g. macppc vs powerpc).
>>> > > I'm afraid I think this patch is moving in the wrong direction.
>>> > > Wherever possible we should be using compiler checks like check_define,
>>> > > not looking at the output of 'uname' and the like. The former will
>>> > > work when cross compiling, and the latter will give the wrong answers.
>>> > > In some places we have that kind of 'look at uname/etc' check but
>>> > > we should be trying to reduce and eliminate it where possible.
>> > 
>> > Right, we should support GNU triplets and a --host argument, and replace
>> > uname checks with pattern matching on the triplet.
> That still requires a means of generating that triplet in the first place.

That's what GNU config.guess is for, but it is only used in the
non-cross-compilation case.  QEMU's homegrown configure hardly
distinguishes between native and cross builds.

Paolo

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

* Re: [Qemu-devel] [PATCH] configure: some fixes for OpenBSD
  2012-08-24 12:02       ` Paolo Bonzini
@ 2012-08-24 12:15         ` Brad Smith
  0 siblings, 0 replies; 7+ messages in thread
From: Brad Smith @ 2012-08-24 12:15 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel

On Fri, Aug 24, 2012 at 02:02:57PM +0200, Paolo Bonzini wrote:
> Il 24/08/2012 14:00, Brad Smith ha scritto:
> >>>>> > >> > OpenBSD's uname works as expected with the -s flag so remove the special
> >>>>> > >> > handling when determining the target OS. Use arch -s to retrieve the
> >>>>> > >> > hardware architecture as uname -m will return the meta architecture
> >>>>> > >> > instead of the hardware architecture (.e.g. macppc vs powerpc).
> >>> > > I'm afraid I think this patch is moving in the wrong direction.
> >>> > > Wherever possible we should be using compiler checks like check_define,
> >>> > > not looking at the output of 'uname' and the like. The former will
> >>> > > work when cross compiling, and the latter will give the wrong answers.
> >>> > > In some places we have that kind of 'look at uname/etc' check but
> >>> > > we should be trying to reduce and eliminate it where possible.
> >> > 
> >> > Right, we should support GNU triplets and a --host argument, and replace
> >> > uname checks with pattern matching on the triplet.
> > That still requires a means of generating that triplet in the first place.
> 
> That's what GNU config.guess is for, but it is only used in the
> non-cross-compilation case.  QEMU's homegrown configure hardly
> distinguishes between native and cross builds.

OK well if you're going in that direction that's fine as config.guess
knows how to do the right thing.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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

end of thread, other threads:[~2012-08-24 12:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24  9:47 [Qemu-devel] [PATCH] configure: some fixes for OpenBSD Brad Smith
2012-08-24  9:55 ` Peter Maydell
2012-08-24 10:03   ` Brad Smith
2012-08-24 11:56   ` Paolo Bonzini
2012-08-24 12:00     ` Brad Smith
2012-08-24 12:02       ` Paolo Bonzini
2012-08-24 12:15         ` Brad Smith

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).