automake
[Top][All Lists]
Advanced

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

Re: Static library naming


From: Stefano Lattarini
Subject: Re: Static library naming
Date: Tue, 02 Oct 2012 16:37:46 +0200

Hi Peter, sorry again for the delay.

On 09/26/2012 10:40 AM, Peter Rosin wrote:
> On 2012-09-25 21:33, Stefano Lattarini wrote:
>> [Dropping Automake-NG list, from the next reply]
>>
>> On 09/24/2012 10:51 AM, Peter Rosin wrote:
>>>
>>> [MEGA-SNIP]
>>>
>>> Yes, because I don't want this to be Automake-NG only. But since
>>> this scheme is opt-in, the compile script "must" be adjusted to
>>> handle libhello.a anyway. And with an adjusted compile script, I
>>> suppose the acceptable level of ugliness elsewhere is lowered, as
>>> it only fixes the (mostly) cosmetic naming problem.
>>>
>> So, if I understand correctly, you're saying that at this point it's
>> better and simpler to just adjust the 'compile' script?  Or am I
>> misunderstanding? (in which case, sorry to be so dense!)
> 
> Short answer: No, not quite, I still would like the possibility to
> have Automake generate hello.lib without jumping through hoops.
> Sorry for not being clear enough.
> 
> Long answer: I attempted to say that given the plan to require
> projects to opt-in for hello.lib instead of hardcoding libhello.a,
> the compile script has to accommodate those that don't opt-in and
> thus also support the libhello.a naming.
>
OK, clearer now.  This first step ("support the libhello.a name for
those who don't opt-in") could also be done for Automake 1.12.5,
if anyone is kind enough to provide a patch :-)

> But after having done that,
> nothing is broken except for the (mostly) cosmetic naming issue.
>
OK, so this part is lower priority, but still in the category
"it would be nice to have".  Clear.

> Given that its mostly a cosmetic issue, I just assumed that the
> tolerable level of "crap" in the Automake code and usage was
> significantly lowered, which in turn might influence what kind of
> solutions to consider. I.e. a new primary (cleanest syntax, but
> maybe too "rich"?) vs. some kind of encoding of the library name
> (&hello, lib(hello) or just libhello, which is best?) vs. something
> else (ideas welcome of course).
>
> Yes, I can probably beat Automake into generate hello.lib when
> MS tools are in use by jumping through hoops on a project by
> project basis with conditionals and (untested) stuff like the
> below example .am file, but that's not very concise and unlikely
> to ever get accepted into anything who has a decent maintainer.
> The work is also basically endless, where a fix in Automake at
> least has a chance of spreading "automatically".
> 
> if MSTOOLS
> LIBHELLO = hello.lib
> lib_LIBRARIES = hello.lib
> hello_lib_SOURCES = $(HELLOSOURCES)
> else
> LIBHELLO = libhello.a
> lib_LIBRARIES = libhello.a
> libhello_a_SOURCES = $(HELLOSOURCES)
> endif
> HELLOSOURCES = foo.c bar.c
> 
> bin_PROGRAMS = hello
> hello_SOURCES = hello.c
> hello_LDADD = $(LIBHELLO)
> 
> It would be nice to make that (something like):
> 
> lib_LIBRARIES = lib(hello)
> libhello_SOURCES = foo.c bar.c
> 
> bin_PROGRAMS = hello
> hello_SOURCES = hello.c
> hello_LDADD = $(am_libhello)
> 
> and lose the MSTOOLS crap from configure.ac in the process.
> 
> BTW, maybe it is sufficient to simply drop the .a part of the
> library name and use that to "encode" that os/tool-dependent
> naming is desired? I.e. "lib_LIBRARIES = libhello" in the above
> example.
>
IMHO we should want to be clearer that something "magic" is
going on.  So something like "lib(hello)" would still be better.
(Determining the final colour of the bikeshed is left as
exercise to the user ;-)

> Because exactly how many users have created libraries
> without any filename extension at all? The "strangest" names I
> have found are a bunch of "noinst_LIBRARIES = lib.a" in newlib
> (that usage is also present in some other projects) but I
> guess that will not translate well to any new scheme we come
> up with because .lib is probably not a good name for any
> library. But maybe I simply didn't look hard enough for
> extensionless foo_LIBRARY = names?
> 
> Cheers,
> Peter
> 

Thanks,
  Stefano



reply via email to

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