Discussion:
[PATCH] librtlsdr.pc: use "Require: libusb-1.0" instead of "Libs: -lusb-1.0"
Bjørn Forsman
2014-10-31 07:54:05 UTC
Permalink
Using "Libs: -lusb-1.0" assumes the linker knows where libusb is
located. Using "Require: libusb-1.0" is more correct as it uses
pkg-config to locate the required package and provides correct flags
(both -l and -L).

This fix is needed to build programs that depend on librtlsdr on
NixOS[1]. (Because there is no "default" linker serach path on NixOS.)

[1]: http://nixos.org/
---
librtlsdr.pc.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/librtlsdr.pc.in b/librtlsdr.pc.in
index 5e55049..76b4190 100644
--- a/librtlsdr.pc.in
+++ b/librtlsdr.pc.in
@@ -7,5 +7,6 @@ Name: RTL-SDR Library
Description: C Utility Library
Version: @VERSION@
Cflags: -I${includedir}/ @RTLSDR_PC_CFLAGS@
-Libs: -L${libdir} -lrtlsdr -lusb-1.0
+Libs: -L${libdir} -lrtlsdr
Libs.private: @RTLSDR_PC_LIBS@
+Requires: libusb-1.0
--
2.1.2
Loading...