Patchwork [v2,3/8] build: avoid automake warnings about AM_PROG_AR requirement

login
register
mail settings
Submitter Jim Meyering
Date Dec. 1, 2011, 12:27 p.m.
Message ID <1322742439-2171-4-git-send-email-jim@meyering.net>
Download mbox | patch
Permalink /patch/128688/
State Rejected
Headers show

Comments

Jim Meyering - Dec. 1, 2011, 12:27 p.m.
From: Jim Meyering <meyering@redhat.com>

* configure.ac: Use AM_PROG_AR (must precede LT_INIT).
Without this, when using what will soon be automake-1.11.2, we'd
get a warning like this for each .a file:
  automake: warnings are treated as errors
  /usr/share/automake-1.11a/am/library.am: warning: `libadmin.a':\
    linking libraries using a non-POSIX
  /usr/share/automake-1.11a/am/library.am: archiver requires \
    `AM_PROG_AR' in `configure.ac'
  src/libadmin/Makefile.am:26:   while processing library `libadmin.a'

Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 configure.ac |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Chuck Lever - Dec. 1, 2011, 5:19 p.m.
On Dec 1, 2011, at 7:27 AM, Jim Meyering wrote:

> From: Jim Meyering <meyering@redhat.com>
> 
> * configure.ac: Use AM_PROG_AR (must precede LT_INIT).
> Without this, when using what will soon be automake-1.11.2, we'd
> get a warning like this for each .a file:
>  automake: warnings are treated as errors
>  /usr/share/automake-1.11a/am/library.am: warning: `libadmin.a':\
>    linking libraries using a non-POSIX
>  /usr/share/automake-1.11a/am/library.am: archiver requires \
>    `AM_PROG_AR' in `configure.ac'
>  src/libadmin/Makefile.am:26:   while processing library `libadmin.a'

After applying this on my Fedora 15 build system, I get:

[cel@degas fedfs-utils]$ sh ./autogen.sh 
cleaning up................... done
configure.ac:35: warning: macro `AM_PROG_AR' not found in library
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./config.guess'
libtoolize: copying file `./config.sub'
libtoolize: copying file `./install-sh'
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:39: installing `./missing'
src/fedfsc/Makefile.am: installing `./depcomp'
configure.ac:35: error: possibly undefined macro: AM_PROG_AR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
[cel@degas fedfs-utils]$

So simply adding AM_PROG_AR to ./configure is probably not enough.

Also, in a little while I'm going to convert all of these internal libraries to be dynamically loadable.  I'd like to wait until that patch is committed before making another change here.  Maybe AM_PROG_AR won't be necessary?

> Signed-off-by: Jim Meyering <meyering@redhat.com>
> ---
> configure.ac |    2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 2a2052f..6e84293 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_CONFIG_SRCDIR([src])
> AC_CONFIG_HEADERS([config.h])
> AC_CONFIG_MACRO_DIR([m4])
> 
> +AM_PROG_AR
> +
> # Automake and libtools initialization
> LT_INIT
> AM_INIT_AUTOMAKE([-Wall -Werror silent-rules])
> -- 
> 1.7.8.rc4
> 
> 
> _______________________________________________
> fedfs-utils-devel mailing list
> fedfs-utils-devel@oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/fedfs-utils-devel

Patch

diff --git a/configure.ac b/configure.ac
index 2a2052f..6e84293 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,8 @@  AC_CONFIG_SRCDIR([src])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])

+AM_PROG_AR
+
 # Automake and libtools initialization
 LT_INIT
 AM_INIT_AUTOMAKE([-Wall -Werror silent-rules])