Subject: bug#11863: Building test plugins

From: Stefano Lattarini <[email-masked]>
Date: Thu, 05 Jul 2012 11:55:33 +0200

tags 11863 - moreinfo
thanks

On 07/05/2012 08:19 AM, Gary V. Vaughan wrote:
> Hi Reuben,
> 
> On 5 Jul 2012, at 05:39, Reuben Thomas wrote:
>> On 4 July 2012 23:35, Stefano Lattarini <[email-masked]> wrote:
>>> tags 11863 + moreinfo
>>> thanks
>>>
>>> On 07/04/2012 10:43 PM, Reuben Thomas wrote:
>>>> I have a library that I want to build just for tests. Hence, I add it
>>>> to check_LTLIBRARIES. It's a plugin, so I want the .so (or .dll or
>>>> whatever) to be built, but it isn't!
>>>>
>>> It isn't built when you run "make check"?
>>
>> The library is built, but no .so.
> 
> check_LTLIBRARIES works somewhat like noinst_LTLIBRARIES, in that Automake
> instructs libtool to build a convenience archive by default in both cases
> (a convenience archive being a static archive of pic objects).
> 
> Arguably that's not the right thing for check_LTLIBRARIES, for exactly the
> reasons you have been tripped up by here.  And I'd be in favour of changing
> the semantics of check_LTLIBRARIES accordingly - libltdl based module
> loaders will continue to cope just fine because the .la file is examined
> to determine how to link and load the module.
>
I'll gladly accept a patch in this direction, if you, as a libtool
maintainer, think it would offer better semantics.

> Currently the best way to tell Automake to only build a libtool library
> for `make check' without installing it, but at the same time to tell libtool
> not to make a convenience archive is:
> 
>   check_LTLIBRARIES += tests/libalientest.la
> 
>   tests_libalientest_la_LDFLAGS = -module -avoid-version -rpath /dev/null
> 
> The -rpath argument tells libtool that this is not a convenience archive.
> The parameter can be anything, because Automake will not install a
> check_LTLIBRARIES object anyway, but /dev/null makes it clearer that we'r
> doing something a bit odd here.
> 
> Cheers,

Regards,
  Stefano