]> mj.ucw.cz Git - pciutils.git/commitdiff
pkgconfig: Fix libpci.pc for static linking
authorBrice Goglin <bgoglin@debian.org>
Fri, 4 Jan 2013 16:31:14 +0000 (17:31 +0100)
committerGuillem Jover <guillem@hadrons.org>
Wed, 16 Sep 2020 01:18:30 +0000 (03:18 +0200)
The libpci.pc file does not seem to be correct for static linking.

  $ pkg-config --libs --static libpci
  -lpci

It brings no dependencies while -lresolv (and likely -lz) seems needed:

  /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/
   libpci.a(names-net.o):function pci_id_net_lookup:
   error: undefined reference to '__res_query'

Something like:

  Libs.private: -lresolv -lz

Signed-off-by: Guillem Jover <guillem@hadrons.org>
lib/Makefile
lib/libpci.pc.in

index d89cd6c83d92dc2e6ef803ff9fb32ab2788fe67b..0332508bce7383caae1f5e6c9c0fa1ae097fcba8 100644 (file)
@@ -77,7 +77,8 @@ $(PCILIBPC): libpci.pc.in
                -e 's,@LIBDIR@,$(LIBDIR),' \
                -e 's,@IDSDIR@,$(IDSDIR),' \
                -e 's,@VERSION@,$(VERSION),' \
                -e 's,@LIBDIR@,$(LIBDIR),' \
                -e 's,@IDSDIR@,$(IDSDIR),' \
                -e 's,@VERSION@,$(VERSION),' \
-               -e 's,@LDLIBS@,$(LDLIBS),'
+               -e 's,@LDLIBS@,$(LDLIBS),' \
+               -e 's,@WITH_LIBS@,$(WITH_LIBS),'
 
 init.o: init.c $(INCL)
 access.o: access.c $(INCL)
 
 init.o: init.c $(INCL)
 access.o: access.c $(INCL)
index 9d7e8a079ec8d3cc14dc66e97999bd0c3d005c2b..29c6910318f501f74d343e7079398778bd85815e 100644 (file)
@@ -7,5 +7,5 @@ Name: libpci
 Description: libpci
 Version: @VERSION@
 Libs: -L${libdir} -lpci
 Description: libpci
 Version: @VERSION@
 Libs: -L${libdir} -lpci
-Libs.private: @LDLIBS@
+Libs.private: @LDLIBS@ @WITH_LIBS@
 Cflags: -I${includedir}
 Cflags: -I${includedir}