diff mbox

configure: fix Darwin target detection

Message ID 1408354577-21953-1-git-send-email-cristian.iorga@intel.com
State New
Headers show

Commit Message

Cristian Iorga Aug. 18, 2014, 9:36 a.m. UTC
fix Darwin target detection for qemu
cross-compilation.

Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

Comments

Peter Maydell Aug. 18, 2014, 2:16 p.m. UTC | #1
On 18 August 2014 10:36, Cristian Iorga <cristian.iorga@intel.com> wrote:
> fix Darwin target detection for qemu
> cross-compilation.
>
> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
> ---
>  configure | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/configure b/configure
> index 283c71c..1c66a11 100755
> --- a/configure
> +++ b/configure
> @@ -444,6 +444,8 @@ elif check_define __sun__ ; then
>    targetos='SunOS'
>  elif check_define __HAIKU__ ; then
>    targetos='Haiku'
> +elif check_define __APPLE__ ; then
> +  targetos='Darwin'
>  else
>    targetos=`uname -s`
>  fi

You cross compile to Darwin? From which host?
This patch seems like it would be necessary but not
sufficient, since for instance code further on in configure
tries to run sysctl to check for 32 bit or 64 bit compile,
which won't work if you're cross compiling.
Or do you explicitly pass configure a --cpu argument?

thanks
-- PMM
Cristian Iorga Aug. 18, 2014, 2:59 p.m. UTC | #2
Hello Peter,

We cross-compile from a X86-64 Linux host to a MacOSX/Darwin target.
The target CPU is passed on explicitly.
Indeed, sysctl will not work; but the patch does not touch that area, others can fix that if there is interest.

Regards,
Cristian Iorga
Yocto Project
Intel Corporation

-----Original Message-----
From: Peter Maydell [mailto:peter.maydell@linaro.org] 

Sent: Monday, August 18, 2014 5:16 PM
To: Iorga, Cristian
Cc: QEMU Developers
Subject: Re: [Qemu-devel] [PATCH] configure: fix Darwin target detection

On 18 August 2014 10:36, Cristian Iorga <cristian.iorga@intel.com> wrote:
> fix Darwin target detection for qemu

> cross-compilation.

>

> Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>

> ---

>  configure | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/configure b/configure

> index 283c71c..1c66a11 100755

> --- a/configure

> +++ b/configure

> @@ -444,6 +444,8 @@ elif check_define __sun__ ; then

>    targetos='SunOS'

>  elif check_define __HAIKU__ ; then

>    targetos='Haiku'

> +elif check_define __APPLE__ ; then

> +  targetos='Darwin'

>  else

>    targetos=`uname -s`

>  fi


You cross compile to Darwin? From which host?
This patch seems like it would be necessary but not sufficient, since for instance code further on in configure tries to run sysctl to check for 32 bit or 64 bit compile, which won't work if you're cross compiling.
Or do you explicitly pass configure a --cpu argument?

thanks
-- PMM
Peter Maydell Aug. 18, 2014, 3:16 p.m. UTC | #3
On 18 August 2014 15:59, Iorga, Cristian <cristian.iorga@intel.com> wrote:
> Hello Peter,
>
> We cross-compile from a X86-64 Linux host to a MacOSX/Darwin target.
> The target CPU is passed on explicitly.
> Indeed, sysctl will not work; but the patch does not touch that area, others can fix that if there is interest.

OK, that makes sense. I think ideally we should get
rid of that check on uname completely, so this is a
useful small step in the right direction...

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
diff mbox

Patch

diff --git a/configure b/configure
index 283c71c..1c66a11 100755
--- a/configure
+++ b/configure
@@ -444,6 +444,8 @@  elif check_define __sun__ ; then
   targetos='SunOS'
 elif check_define __HAIKU__ ; then
   targetos='Haiku'
+elif check_define __APPLE__ ; then
+  targetos='Darwin'
 else
   targetos=`uname -s`
 fi