[Buildroot] [PATCH v2 3/4] package/avrdude: depends on libftdi1 instead of libftdi

Samuel Martin s.martin49 at gmail.com
Tue Mar 17 17:25:52 UTC 2015


On Tue, Mar 17, 2015 at 5:48 PM, Thomas Petazzoni
<thomas.petazzoni at free-electrons.com> wrote:
> Dear Samuel Martin,
>
> On Tue, 17 Mar 2015 17:24:07 +0100, Samuel Martin wrote:
>
>> Well, my first thought was simply to drop the libftdi support because
>> of the additional dependency it pulls (libusb-compat):
>> - with dependency on libftdi:
>>   arvdude -> libftdi -> libusb-compat -> libusb
>> - with dependency on libftdi1:
>>   arvdude -> libftdi1 -> libusb
>>
>> Note that, the configure script uses libftdi1 (if found) in priority
>> over libftdi.
>
> Yes, but what happens if the user has BR2_PACKAGE_AVRDUDE=y and
> BR2_PACKAGE_LIBFTDI=y ? Then with your patch, we have an "undefined
> behavior": if libftdi happens to be built before avrdude, avrdude will
> have libftdi support, otherwise not.
>
> Unless of course you propose a patch that allows to explicitly
> enable/disable libftdi support in avrdude. But otherwise, if avrdude
> *can* use libftdi, then it should have an optional dependency on it.

Nope, the behavior is not undefined: if libftdi gets built before
arvdude, libftdi1 will also be built before avrdude (because it's one
of its deps,), so the avrdude configure script will detect both but
use libfti1 in priority over libftdi, see the arvdude confi summary:

<snip>
Configuration summary:
----------------------
DO HAVE    libelf
DO HAVE    libusb
DO HAVE    libusb_1_0
DO HAVE    libftdi1
DO HAVE    libftdi (but prefer to use libftdi1)
</snip>

Regards,

-- 
Samuel


More information about the buildroot mailing list