[PATCH] build/ac-macros/macosx.m4: workaround AC_RUN_IFELSE

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] build/ac-macros/macosx.m4: workaround AC_RUN_IFELSE

Fabrice Fontaine
The SVN_LIB_MACHO_ITERATE macro contains an AC_RUN_IFELSE test that
doesn't work when cross-compiling. However, this macro is related to
testing Mac OS X APIs, so in the context of Buildroot, we don't care,
and the test program is not even going to build. So we simply
workaround this by turning the test into an AC_COMPILE_IFELSE.

Signed-off-by: Thomas Petazzoni <[hidden email]>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/subversion/0002-workaround-ac-run-ifelse.patch]
Signed-off-by: Fabrice Fontaine <[hidden email]>
---
 build/ac-macros/macosx.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/ac-macros/macosx.m4 b/build/ac-macros/macosx.m4
index 92fa58e0bc..31acfd9dd6 100644
--- a/build/ac-macros/macosx.m4
+++ b/build/ac-macros/macosx.m4
@@ -24,7 +24,7 @@ dnl Check for _dyld_image_name and _dyld_image_header availability
 AC_DEFUN(SVN_LIB_MACHO_ITERATE,
 [
   AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
-  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
     #include <mach-o/dyld.h>
     #include <mach-o/loader.h>
   ]],[[
--
2.28.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] build/ac-macros/macosx.m4: workaround AC_RUN_IFELSE

Nathan Hartman
On Sun, Aug 30, 2020 at 10:59 AM Fabrice Fontaine
<[hidden email]> wrote:

> The SVN_LIB_MACHO_ITERATE macro contains an AC_RUN_IFELSE test that
> doesn't work when cross-compiling. However, this macro is related to
> testing Mac OS X APIs, so in the context of Buildroot, we don't care,
> and the test program is not even going to build. So we simply
> workaround this by turning the test into an AC_COMPILE_IFELSE.
>
> Signed-off-by: Thomas Petazzoni <[hidden email]>
> [Retrieved from:
> https://git.buildroot.net/buildroot/tree/package/subversion/0002-workaround-ac-run-ifelse.patch]
> Signed-off-by: Fabrice Fontaine <[hidden email]>
> ---
>  build/ac-macros/macosx.m4 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/build/ac-macros/macosx.m4 b/build/ac-macros/macosx.m4
> index 92fa58e0bc..31acfd9dd6 100644
> --- a/build/ac-macros/macosx.m4
> +++ b/build/ac-macros/macosx.m4
> @@ -24,7 +24,7 @@ dnl Check for _dyld_image_name and _dyld_image_header availability
>  AC_DEFUN(SVN_LIB_MACHO_ITERATE,
>  [
>    AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
> -  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
> +  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
>      #include <mach-o/dyld.h>
>      #include <mach-o/loader.h>
>    ]],[[
> --
> 2.28.0

Hello,

Thanks for your patch.

What impact would this change have on native (non-cross-compiling) builds?

Would it be preferable to keep AC_RUN_IFELSE and pass the optional
last parameter, 'action-if-cross-compiling' (which we're not currently
doing)?

Cheers,
Nathan
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] build/ac-macros/macosx.m4: workaround AC_RUN_IFELSE

Fabrice Fontaine
Hello,

Le dim. 30 août 2020 à 17:12, Nathan Hartman
<[hidden email]> a écrit :

>
> On Sun, Aug 30, 2020 at 10:59 AM Fabrice Fontaine
> <[hidden email]> wrote:
> > The SVN_LIB_MACHO_ITERATE macro contains an AC_RUN_IFELSE test that
> > doesn't work when cross-compiling. However, this macro is related to
> > testing Mac OS X APIs, so in the context of Buildroot, we don't care,
> > and the test program is not even going to build. So we simply
> > workaround this by turning the test into an AC_COMPILE_IFELSE.
> >
> > Signed-off-by: Thomas Petazzoni <[hidden email]>
> > [Retrieved from:
> > https://git.buildroot.net/buildroot/tree/package/subversion/0002-workaround-ac-run-ifelse.patch]
> > Signed-off-by: Fabrice Fontaine <[hidden email]>
> > ---
> >  build/ac-macros/macosx.m4 | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/build/ac-macros/macosx.m4 b/build/ac-macros/macosx.m4
> > index 92fa58e0bc..31acfd9dd6 100644
> > --- a/build/ac-macros/macosx.m4
> > +++ b/build/ac-macros/macosx.m4
> > @@ -24,7 +24,7 @@ dnl Check for _dyld_image_name and _dyld_image_header availability
> >  AC_DEFUN(SVN_LIB_MACHO_ITERATE,
> >  [
> >    AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
> > -  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
> > +  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
> >      #include <mach-o/dyld.h>
> >      #include <mach-o/loader.h>
> >    ]],[[
> > --
> > 2.28.0
>
> Hello,
>
> Thanks for your patch.
>
> What impact would this change have on native (non-cross-compiling) builds?
>
> Would it be preferable to keep AC_RUN_IFELSE and pass the optional
> last parameter, 'action-if-cross-compiling' (which we're not currently
> doing)?
Indeed, this is a better solution. I'll post a v2.
>
> Cheers,
> Nathan
Best Regards,

Fabrice