libtool
[Top][All Lists]
Advanced

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

problem getting ARFLAGS to work...


From: Ed Hartnett
Subject: problem getting ARFLAGS to work...
Date: Wed, 21 May 2008 08:17:56 -0600
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Hello all!

I am the maintainer of a free software package for scientific data
storage: netcdf.

I have been asking about a problem on the automake mailing list, but
they tell me that this is a libtool issue, so now I will ask here on
the libtool list. 

I am using automake 1.10 and libtool 2.2.2.

In order to build my library on AIX in 64-bit mode, I have to be able
to set the ARFLAGS, but I can't get that to work. No matter what I do,
my ARFLAGS are ignored, and "cru" is used.

I have created a minimalistic example. A single C file, small.c, with
one function, is turned into a libtool library. The configure.ac,
Makefile.am, and code file are appended to this email.

>From the info pages on Automake:

   `AR' and `ARFLAGS' default to `ar' and `cru' respectively; you can
   override these two variables my setting them in your `Makefile.am',
   by `AC_SUBST'ing them from your `configure.ac', or by defining a
   per-library `maude_AR' variable (*note Program and Library
   Variables::).

However, this is not working for me. Nor is setting AM_ARFLAGS, nor
using a per-library variable. Here's how I build this:

autoreconf -i && ARFLAGS=lalala ./configure && make

Here's the build output:

make[1]: Entering directory `/home/ed/small_autotools'
/bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -Wall 
-g -MT small.lo -MD -MP -MF .deps/small.Tpo -c -o small.lo small.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wall -g -MT small.lo -MD -MP -MF 
.deps/small.Tpo -c small.c -o small.o
mv -f .deps/small.Tpo .deps/small.Plo
/bin/sh ./libtool --tag=CC   --mode=link gcc  -Wall -g   -o libsmall.la -rpath 
/usr/local/lib small.lo  
libtool: link: ar cru .libs/libsmall.a  small.o
libtool: link: ranlib .libs/libsmall.a
libtool: link: ( cd ".libs" && rm -f "libsmall.la" && ln -s "../libsmall.la" 
"libsmall.la" )
make[1]: Leaving directory `/home/ed/small_autotools

As you can see, ar is using "cru" instead of "lalala", which is what
ARFLAGS is set to. Interestingly, the Makefile does have ARFLAGS
defined:

ARFLAGS = lalala

But neither ar nor ranlib seem to be actually used in the Makefile. 

but this seems to be ignored when building the library.

So what am I doing wrong here?

Thanks,

Ed


configure.ac:

AC_INIT([small], [1.0], address@hidden)
AC_CANONICAL_HOST
AM_DISABLE_SHARED
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
AC_CONFIG_SRCDIR([small.c])
LT_INIT()
AC_SUBST(ARFLAGS, ["$ARFLAGS"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT()

Makefile.am:

AM_ARFLAGS = $(ARFLAGS)
lib_LTLIBRARIES = libsmall.la
libsmall_la_SOURCES = small.c

small.c:

int
fun()
{
   return 42;
}

-- 
Ed Hartnett  -- address@hidden




reply via email to

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