[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

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

From: Nathan Hartman <hartman.nathan_at_gmail.com>
Date: Wed, 2 Sep 2020 11:09:03 -0400

On Tue, Sep 1, 2020 at 10:01 PM Daniel Shahaf <d.s_at_daniel.shahaf.name> wrote:
>
> Fabrice Fontaine wrote on Mon, 31 Aug 2020 15:34 +0200:
> > Le lun. 31 août 2020 à 04:40, Daniel Shahaf <d.s_at_daniel.shahaf.name> a écrit :
> > > Fabrice Fontaine wrote on Sun, 30 Aug 2020 17:24 +0200:
> > > > +++ b/build/ac-macros/macosx.m4
> > > > @@ -38,7 +38,7 @@ AC_DEFUN(SVN_LIB_MACHO_ITERATE,
> > > > AC_MSG_RESULT([yes])
> > > > ],[
> > > > AC_MSG_RESULT([no])
> > > > - ])
> > > > + ],[:])
> > >
> > > Isn't that going to DTWT when cross-compiling for a macosx target? In
> > > that case SVN_HAVE_MACHO_ITERATE should possibly be defined, but won't be.
> > I can add an AC_COMPILE_IFELSE mimicking the AC_RUN_IFELSE in the
> > action-if-cross-compiling if you prefer this solution.
>
> I suspect this wouldn't be correct, since if it were correct, whoever
> wrote the existing AC_RUN_IFELSE() call would have used
> AC_COMPILE_IFELSE() instead.

That would be brane.

Looking at the history of build/ac-macros/macosx.m4, this dyld test
originally (in r1381880) used AC_COMPILE_IFELSE. In r1413467, it is
changed to actually run the test:

[[[
r1413467 | brane | 2012-11-25 22:04:27 -0500 (Sun, 25 Nov 2012) | 8 lines

Fix the MacOS-specific autoconf macros that just appeared to work sort of
by accident.

* build/ac-macros/macosx.m4 (SVN_LIB_MACHO_ITERATE): Actually run the test
   program, and use the IFELSE part to set results.
  (SVN_LIB_MACOS_PLIST, SVN_LIB_MACOS_KEYCHAIN): Make the tests independent,
   and use AC_COMPILE_IFELSE correctly.
]]]

Looks like compiling alone to test the existence of headers and APIs
'mach-o/dyld.h', 'mach-o/loader.h', _dyld_get_image_header(), and
_dyld_get_image_name() is insufficient. I haven't yet dug further into
these APIs to learn under what circumstances they exist but shouldn't
be called. SVN_HAVE_MACHO_ITERATE allows svn_sysinfo__loaded_libs() to
list loaded shared libraries for 'svn --version --verbose'. It's
important we don't break that, as it will be more difficult to help
users when this information is needed.

Thomas's suggestion to wrap it in an AC_CACHE_CHECK() sounds like an
approach that should fix cross-compilation for buildroot and address
Daniel's point when cross-compiling for a Mach-O target.

If ya'll could provide a patch, I'll verify I can build on Mac OS X
and the macro is defined as expected and 'svn --version --verbose'
shows the loaded shared libs.

Thanks,
Nathan
Received on 2020-09-02 17:09:19 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.