bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: support for universal binaries on MacOS X (5/6)


From: Jim Meyering
Subject: Re: support for universal binaries on MacOS X (5/6)
Date: Fri, 26 Dec 2008 12:52:41 +0100

Bruno Haible <address@hidden> wrote:
>> That looks like it'd work fine
>
> It does work fine. I tested it :-)
>
>> but I'd like it even more if it were
>> to set the cache variable to "no" *before* the use of AC_CACHE_CHECK.
>> Then, this change would be more compact and would not affect the logical
>> structure (i.e. no need for the else clause here
>
> Well, the logical structure here is that we have a general case (the
> AC_TRY_RUN code) and then one or several platform specific special cases.
> Now there's only APPLE_UNIVERSAL_BUILD but I can well foresee that there
> will be others, such as WINDOWS_UNIVERSAL_BUILD or AIX_UNIVERSAL_BUILD.
> (The latter nearly already exists: Shared libraries on 64-bit AIX systems
> contain a 32-bit .o file and a 64-bit .o file together. Someday we should
> extend libtool to support this...) Therefore using the value of one of
> these special cases as the default for all platforms is inappropriate.
>
>> and no need for the indentation change in the nanosleep test).
>
> The indentation change in the nanosleep test is because of the 'if',
> which won't go away either way.

It looks to me like the change below is equivalent to yours,
modulo copyright+serial# updates.  No?

The idea is to set the cache variable up front,
so the AC_CACHE_CHECK sees that and just falls through.

If someday there is an AIX universal build, just
add an elif test $AIX_UNIVERSAL_BUILD = 1; then ....
etc.  Then the nesting/logic of the majority of lines in
that file doesn't change.

diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 5faf393..b1884f5 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -15,6 +15,13 @@ dnl From Jim Meyering.
 AC_DEFUN([AC_FUNC_MKTIME],
 [AC_CHECK_HEADERS_ONCE(unistd.h)
 AC_CHECK_FUNCS_ONCE(alarm)
+AC_REQUIRE([gl_MULTIARCH])
+if test $APPLE_UNIVERSAL_BUILD = 1; then
+  # A universal build on Apple MacOS X platforms.
+  # The test result would be 'yes' in 32-bit mode and 'no' in 64-bit mode.
+  # But we need a configuration result that is valid in both modes.
+  ac_cv_func_working_mktime=no
+fi
 AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
 [AC_RUN_IFELSE([AC_LANG_SOURCE(
 [[/* Test program from Paul Eggert and Tony Leneis.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]