[Top][All Lists]

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

Re: Creating a static lib from objects and another static lib

From: Paul Smith
Subject: Re: Creating a static lib from objects and another static lib
Date: Tue, 18 Mar 2008 17:41:22 -0400

On Tue, 2008-03-18 at 14:29 -0700, muni2773 wrote:
> That helps but I would like to pick your brain if there are multiple
> old libraries ? e.g oldlib1.a and oldlib2.a

Well, then you're SOL! :-)

Really, at that point you'll have to do something gross; about the only
thing you can do is use "ar x" to extract all the objects in each of the
old libraries, then use "ar r" to add them to the new library.

You'll probably get the best results by writing a shell script to do it,
then invoking that from the makefile.  You could have your own script
named "myar" or whatever that took the command line you WISH that ar
supported, and implemented it:

        myar rcs libnew.a foo.o oldlib2.a bar.o oldlib1.a biz.o baz.o


Of course, if you ask on the binutils mailing list (where they support
and maintain ar) maybe they'll have a better idea, or maybe someone will
like the idea so much they'll code up an enhancement to ar on the spot!

 Paul D. Smith <address@hidden>       
 "Please remain calm--I may be mad, but I am a professional."--Mad Scientist

reply via email to

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