mheily / libkqueue

kqueue(2) compatibility library
Other
238 stars 77 forks source link

Package pkgconfig Configuration File Is Missing '-L${libdir}' for 'Libs:' #117

Closed gerickson closed 2 years ago

gerickson commented 2 years ago

When libkqueue is installed in a location such as /usr/local/lib it may exist alongside a system version installed in /usr/lib.

Absent -L${libdir} in Libs: in libkqueue.pc, the linker will often pick-up and link against the library in /usr/lib even though the system integrator desired and configured his/her package, using pkg-config, for the libkqueue installed in /usr/local/lib.

To address this, the following diff is required in libkqueue.pc:

--- a/libkqueue.pc.in
+++ b/libkqueue.pc.in
@@ -7,6 +7,6 @@ Name: libkqueue
 Description: Emulates FreeBSD kqueue(2) on other platforms
 Version: @PROJECT_VERSION@
 Requires:
-Libs: -lkqueue
+Libs: -L${libdir} -lkqueue
 Libs.private: -lpthread -lrt
 Cflags: -I${includedir}/kqueue