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 10:27:52 +0100

Bruno Haible <address@hidden> wrote:
> The configure test whether mktime works produces the result "yes" in 32-bit
> mode and "no" in 64-bit mode. In universal builds, we cannot manage these
> different results (it would become a #ifdef mess). Therefore I propose to
> combine the results to "no". OK to commit?

Hi Bruno,

That looks like it'd work fine, 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, and no need for the
indentation change in the nanosleep test).

>       * m4/mktime.m4 (AC_FUNC_MKTIME): Require gl_MULTIARCH. In Apple
>       universal builds, assume that mktime does not work.
>       * modules/mktime (Depends-on): Add multiarch.
>
> --- m4/mktime.m4.orig 2008-12-25 20:19:39.000000000 +0100
> +++ m4/mktime.m4      2008-12-25 19:09:45.000000000 +0100
> @@ -1,5 +1,5 @@
> -#serial 13
> -dnl Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
> +#serial 14
> +dnl Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software 
> Foundation, Inc.
>  dnl This file is free software; the Free Software Foundation
>  dnl gives unlimited permission to copy and/or distribute it,
>  dnl with or without modifications, as long as this notice is preserved.
> @@ -13,10 +13,12 @@
>  # AC_FUNC_MKTIME
>  # --------------
>  AC_DEFUN([AC_FUNC_MKTIME],
> -[AC_CHECK_HEADERS_ONCE(unistd.h)
> +[AC_REQUIRE([gl_MULTIARCH])
> +AC_CHECK_HEADERS_ONCE(unistd.h)
>  AC_CHECK_FUNCS_ONCE(alarm)
>  AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
> -[AC_RUN_IFELSE([AC_LANG_SOURCE(
> +[if test $APPLE_UNIVERSAL_BUILD = 0; then
> +AC_RUN_IFELSE([AC_LANG_SOURCE(
>  [[/* Test program from Paul Eggert and Tony Leneis.  */
>  #include <limits.h>
>  #include <stdlib.h>
> @@ -203,7 +205,14 @@
>  }]])],
>              [ac_cv_func_working_mktime=yes],
>              [ac_cv_func_working_mktime=no],
> -            [ac_cv_func_working_mktime=no])])
> +            [ac_cv_func_working_mktime=no])
> +  else
> +    # 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
> +])
>  if test $ac_cv_func_working_mktime = no; then
>    AC_LIBOBJ([mktime])
>  fi
> --- modules/mktime.orig       2008-12-25 20:19:39.000000000 +0100
> +++ modules/mktime    2008-12-25 20:19:26.000000000 +0100
> @@ -6,6 +6,7 @@
>  m4/mktime.m4
>
>  Depends-on:
> +multiarch
>  time_r
>
>  configure.ac:




reply via email to

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