[Top][All Lists]

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

Re: -objectlist in compile mode

From: Ralf Wildenhues
Subject: Re: -objectlist in compile mode
Date: Wed, 20 May 2009 00:24:22 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hi Christopher,

* Christopher Hulbert wrote on Tue, May 19, 2009 at 06:38:10PM CEST:
> Would it be acceptable to add the -objectlist option in compile mode.
> If passed in compile mode, the .lo file compiled should be appended to
> the file for use with -objectlist at link time. The reason I am
> wondering is I have updated to automake 1.11 to check out the new
> quieter output. Unfortunately, it did not work on 1 of my packages
> because it has too many files for the command line, so I made a rule
> (taken from an older libtool/automake) like the following and then
> pass "-objectlist libvsip.objlist" at link time.

Neat idea.  In a, it could be passed in target_CFLAGS, for
example.  However, how would you cope with recompiles and changes in the
set of sources?

For example,
  touch foo.c

will then list foo.lo twice in the object list file, no?  Hmm, I guess
you can solve that with using some kind of intermediate rule that uses
'sort -u' to create a better list; but specifying that without the set
of objects as prerequisites looks to be difficult.

Similar issue however if, after 'make', you remove foo.c from the
*_SOURCES variable and recompile without a 'make clean' in between
(where presumably the object list file is listed in CLEANFILES)?
This is a scenario which makefiles typically cope fine with otherwise.

Please note that the general tool that libtool provides you with to cope
with line length issues is the convenience archive: you just collect
subsets of objects in convenience archives, and in a final step link
them together to form a real library (depending on your source language,
you might want to keep one real object around for the final link).  If
that is not sufficient yet, you can also link convenience archives into
bigger convenience archives.  Of course this approach is typically less

Another approach that doesn't require changing libtool would be
something like this (where you'd need to replace $(object_files)
with the appropriate variable name for the objects (which, incidentally,
is an internal Automake detail):

collect-object-list: $(
        @echo $< >>object-list

        : >$@
        $(MAKE) $(AM_MAKEFLAGS) collect-object-list

This assumes that you have no files named *.ls anywhere.

Bottom line is that I would like to see a clear advantage of such an
option, together with a use case that is not very difficult to use


reply via email to

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