bug-gnulib
[Top][All Lists]
Advanced

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

Re: [gnulib PATCH]: new warning from ar on rawhide systems


From: Eric Blake
Subject: Re: [gnulib PATCH]: new warning from ar on rawhide systems
Date: Tue, 14 Jul 2015 06:29:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1

On 07/02/2015 06:32 AM, Pavel Raiskup wrote:

> Subject: [PATCH] gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
> 
> The gl_PROG_AR_RANLIB (it is always called by gl_EARLY) sets AR
> and ARFLAGS variables.  Doing this unconditionally could brake

s/brake/break/

> latter Automake's AM_PROG_AR invocation (at least it's

s/latter/later/

> AC_CHECK_TOOLS call to detect correct 'ar' binary).
> 
> Original purpose of the gl_PROG_AR_RANLIB was only to handle the
> Amsterdam Compiler Kit, so make the previous code to have effects
> only on ACK, and rather automatically call the Automkake's

s/Automkake/Automake/

> AM_PROG_AR as soon as possible to decide other cases.
> 
> References:
> http://lists.gnu.org/archive/html/bug-gnulib/2015-07/msg00001.html
> 
> * m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): AC_BEFORE AM_PROG_AR.
> Set the AR/ARFLAGS to ACK defaults OR call AM_PROG_AR.  If neither
> is possible, keep setting AR/ARFLAGS to reasonable defaults.
> * gnulib-tool (func_import): Put the gl_USE_SYSTEM_EXTENSIONS
> right before gl_PROG_AR_RANLIB into gnulib-comp.m4 (if the
> 'extensions' module is used.
> * modules/extensions (configure.ac-early): Remove as this snippet
> is added to gnulib-comp.m4 earlier anyway.
> ---
>  ChangeLog           | 22 ++++++++++++++++++++++
>  gnulib-tool         |  6 ++++++
>  m4/gnulib-common.m4 | 43 ++++++++++++++++++++++++++++---------------
>  modules/extensions  |  3 ---
>  4 files changed, 56 insertions(+), 18 deletions(-)
> 
> diff --git a/ChangeLog b/ChangeLog
> index e6992f4..bd8c49e 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,25 @@
> +2015-07-02  Pavel Raiskup  <address@hidden>
> +
> +     gnulib-common.m4: fix gl_PROG_AR_RANLIB/AM_PROG_AR clash
> +     The gl_PROG_AR_RANLIB (it is always called by gl_EARLY) sets AR
> +     and ARFLAGS variables.  Doing this unconditionally could brake
> +     latter Automake's AM_PROG_AR invocation (at least it's

same typos as in commit message

> +     AC_CHECK_TOOLS call to detect correct 'ar' binary).
> +     Original purpose of the gl_PROG_AR_RANLIB was only to handle the
> +     Amsterdam Compiler Kit, so make the previous code to have effects
> +     only on ACK, and rather automatically call the Automkake's
> +     AM_PROG_AR as soon as possible to decide other cases.
> +     References:
> +     http://lists.gnu.org/archive/html/bug-gnulib/2015-07/msg00001.html
> +     * m4/gnulib-common.m4 (gl_PROG_AR_RANLIB): AC_BEFORE AM_PROG_AR.
> +     Set the AR/ARFLAGS to ACK defaults OR call AM_PROG_AR.  If neither
> +     is possible, keep setting AR/ARFLAGS to reasonable defaults.
> +     * gnulib-tool (func_import): Put the gl_USE_SYSTEM_EXTENSIONS
> +     right before gl_PROG_AR_RANLIB into gnulib-comp.m4 (if the
> +     'extensions' module is used.
> +     * modules/extensions (configure.ac-early): Remove as this snippet
> +     is added to gnulib-comp.m4 earlier anyway.
> +
>  2015-07-02  Daiki Ueno  <address@hidden>
>  
>       u{16,32}-strstr-tests: relax timeout condition
> diff --git a/gnulib-tool b/gnulib-tool
> index ec82f35..28758f5 100755
> --- a/gnulib-tool
> +++ b/gnulib-tool
> @@ -5188,6 +5188,12 @@ s,//*$,/,'
>      echo "  m4_pattern_allow([^gl_ES\$])dnl a valid locale name"
>      echo "  m4_pattern_allow([^gl_LIBOBJS\$])dnl a variable"
>      echo "  m4_pattern_allow([^gl_LTLIBOBJS\$])dnl a variable"
> +
> +    # We need to call gl_USE_SYSTEM_EXTENSIONS before gl_PROG_AR_RANLIB.  
> Doing
> +    # AC_REQUIRE in configure-ac.early is not early enough.
> +    echo "$final_modules" | LANG=C grep "^extensions$" >/dev/null \
> +        && echo "  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])"

Seems reasonable to me.

> +
>      echo "  AC_REQUIRE([gl_PROG_AR_RANLIB])"
>      if test -n "$uses_subdirs"; then
>        echo "  AC_REQUIRE([AM_PROG_CC_C_O])"
> diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
> index 40e82f6..34d0f20 100644
> --- a/m4/gnulib-common.m4
> +++ b/m4/gnulib-common.m4
> @@ -253,9 +253,10 @@ AC_DEFUN([gl_PROG_AR_RANLIB],
>  [
>    dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
>    dnl as "cc", and GCC as "gcc". They have different object file formats and
> -  dnl library formats. In particular, the GNU binutils programs ar, ranlib
> +  dnl library formats. In particular, the GNU binutils programs ar and ranlib
>    dnl produce libraries that work only with gcc, not with cc.
>    AC_REQUIRE([AC_PROG_CC])
> +  AC_BEFORE([$0], [AM_PROG_AR])
>    AC_CACHE_CHECK([for Minix Amsterdam compiler], 
> [gl_cv_c_amsterdam_compiler],
>      [
>        AC_EGREP_CPP([Amsterdam],
> @@ -267,25 +268,37 @@ Amsterdam
>          [gl_cv_c_amsterdam_compiler=yes],
>          [gl_cv_c_amsterdam_compiler=no])
>      ])
> -  if test -z "$AR"; then
> -    if test $gl_cv_c_amsterdam_compiler = yes; then
> +
> +  dnl Don't compete with AM_PROG_AR's decission about AR/ARFLAGS if we are 
> not

s/decission/decision/

> +  dnl building with __ACK__.
> +  if test $gl_cv_c_amsterdam_compiler = yes; then
> +    if test -z "$AR"; then
>        AR='cc -c.a'
> -      if test -z "$ARFLAGS"; then
> -        ARFLAGS='-o'
> -      fi
> -    else
> -      dnl Use the Automake-documented default values for AR and ARFLAGS,
> -      dnl but prefer ${host}-ar over ar (useful for cross-compiling).
> -      AC_CHECK_TOOL([AR], [ar], [ar])
> -      if test -z "$ARFLAGS"; then
> -        ARFLAGS='cr'
> -      fi
>      fi
> -  else
>      if test -z "$ARFLAGS"; then
> -      ARFLAGS='cr'
> +      ARFLAGS='-o'
>      fi
> +  else
> +    dnl AM_PROG_AR was added in automake v1.11.2.  AM_PROG_AR does not 
> AC_SUBST
> +    dnl ARFLAGS variable (it is filed into Makefile.in directly by automake
> +    dnl script on-demand, if not specified by ./configure of course).
> +    dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above
> +    dnl will be ignored.  Also, pay attention to call AM_PROG_AR in else 
> block
> +    dnl because AM_PROG_AR is written so it could re-set AR variable even for
> +    dnl __ACK__.  It may seem like its easier to avoid calling the macro 
> here,
> +    dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some 
> good
> +    dnl default value and automake should usually know them).
> +    m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
>    fi
> +
> +  dnl In case the code above have not helped with setting AR/ARFLAGS, use

s/have/has/

> +  dnl Automake-documented default values for AR and ARFLAGS, but prefer
> +  dnl ${host}-ar over ar (useful for cross-compiling).
> +  AC_CHECK_TOOL([AR], [ar], [ar])
> +  if test -z "$ARFLAGS"; then
> +    ARFLAGS='cr'
> +  fi
> +
>    AC_SUBST([AR])
>    AC_SUBST([ARFLAGS])
>    if test -z "$RANLIB"; then
> diff --git a/modules/extensions b/modules/extensions
> index 76e5a96..b7e37bb 100644
> --- a/modules/extensions
> +++ b/modules/extensions
> @@ -6,9 +6,6 @@ m4/extensions.m4
>  
>  Depends-on:
>  
> -configure.ac-early:
> -AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
> -
>  configure.ac:
>  
>  Makefile.am:
> -- 2.1.0
> 

Overall, seems like it is correct, once you fix the typos.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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