[Top][All Lists]

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

Re: Library creation command

From: Paul Thomas
Subject: Re: Library creation command
Date: Thu, 24 Oct 2002 14:07:28 -0600

Matthias Dietrich wrote:

> Unfortunately we run into a big problem. Automake assumes
> that a library is built by calling "ar cru" and at least
> one of our machine has a toolset where "ar" is not
> available. We have another tool to build a library, it's not
> called "ar" and it doesn't take "cru" as arguments.
> Just to give you a little more information: this machine is
> an embedded system on which we cannot run the compiler,
> linker, etc. We need to cross compile from another workstation.
> On this workstation a local "ar" is available but it breaks
> the object files for our embedded system. So I really need to
> use the platform-specific tool to build libraries.
> I found that replacing "ar" is possible by inserting
> AC_SUBST(AR) into the file and then setting
> AR to my tool. But the "cru" parameters seem to be hardcoded
> into automake.

> I am quite surprised about the "ar" command. It
> seems almost every possible tool involved in a build process
> can be defined (CC,LD,CPP,CXX, etc.) but not AR. It is even
> possible to redefine AR on a per-library basis using the
> _AR variables, but why not having the ability to redefine AR
> globally with the appropriate arguments ?

I ran into the same issue and I agree that AR and AR_FLAGS
should be configurable.  I have been able to achieve this with
the following patches (line numbers from automake 1.7.1):

source path:
installed path: bin/automake (automake-1.x)
<         &define_variable ($xlib . '_AR', '$(AR) cru');
>         &define_variable ($xlib . '_AR', '$(AR) $(AR_FLAGS)');

source path: m4/init.m4
installed path: share/aclocal-1.x/init.m4
> # Use AR and AR_FLAGS as defined by configure
> # (set to 'ar' and 'cru' by default)
> if test -z "$AR"; then
>   AR=ar
> fi
> if test -z "$AR_FLAGS"; then
>   AR_FLAGS=cru
> fi
> AC_SUBST([AR])dnl

source path: lib/am/
installed path: share/automake-1.x/ams/
< AR = ar
> AR = @AR@

I strongly recommend that these patches (or similar ones) be included in 

Paul Thomas

reply via email to

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