All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] package/libftdi: fix libftdi.pc
Date: Tue, 13 Jan 2015 14:15:49 +0100	[thread overview]
Message-ID: <20150113141549.4737488b@free-electrons.com> (raw)
In-Reply-To: <1421097965-15600-2-git-send-email-s.martin49@gmail.com>

Dear Samuel Martin,

On Mon, 12 Jan 2015 22:26:05 +0100, Samuel Martin wrote:

> +diff --git a/libftdi.pc.in b/libftdi.pc.in
> +index 2061b91..95eb491 100644
> +--- a/libftdi.pc.in
> ++++ b/libftdi.pc.in
> +@@ -6,6 +6,7 @@ includedir=@includedir@
> + Name: libftdi
> + Description: Library to program and control the FTDI USB controller
> + Requires:
> ++Requires.private: libusb
> + Version: @VERSION@
> + Libs: -L${libdir} -lftdi -lusb
> + Cflags: -I${includedir}

Are you sure this is the right fix? I believe the right fix is rather:

-Requires:
+Requires: libusb
...
-Libs: -L${libdir} -lftdi -lusb
+Libs: -L${libdir} -lftdi

This properly declares the fact that libftdi requires libusb. And
libusb.pc already has the appropriate Requires.private field on
libusb-1.0. With this change, you get what I believe is the correct
behavior:

When linking dynamically, we're only linked against -lusb (i.e the
libusb-compat library) :

$ ./output/host/usr/bin/pkg-config --libs libftdi
-lftdi -L/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lusb  

When linking statically, we correct get both -lusb and -lusb-1.0:

$ ./output/host/usr/bin/pkg-config --static --libs libftdi
-lftdi -lusb -L/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lusb-1.0 -pthread

This is more or less what was done upstream at
http://developer.intra2net.com/git/?p=libftdi;a=commitdiff;h=ac5790a7af9ffb45c00bde056b308643cd52537e,
though this commit was after they switched to libusb instead of
libusb-compat.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  parent reply	other threads:[~2015-01-13 13:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 21:26 [Buildroot] [PATCH 1/2] package/libftdi: rename patches to the new naming convention Samuel Martin
2015-01-12 21:26 ` [Buildroot] [PATCH 2/2] package/libftdi: fix libftdi.pc Samuel Martin
2015-01-12 23:03   ` Yann E. MORIN
2015-01-13 13:15   ` Thomas Petazzoni [this message]
2015-01-19 22:47     ` Samuel Martin
2015-01-12 23:00 ` [Buildroot] [PATCH 1/2] package/libftdi: rename patches to the new naming convention Yann E. MORIN
2015-01-14 15:55 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150113141549.4737488b@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.