]> mj.ucw.cz Git - pciutils.git/commitdiff
Use LDLIBS for all libraries on which libpci depends.
authorMartin Mares <mj@ucw.cz>
Wed, 13 Feb 2008 16:58:20 +0000 (17:58 +0100)
committerMartin Mares <mj@ucw.cz>
Wed, 13 Feb 2008 16:58:20 +0000 (17:58 +0100)
This way, libpci.pc gets all dependencies, including -lpci on NetBSD.
Clearing LDLIBS at the top of config.mk is necessary, because this file
can get read twice.

Makefile
lib/Makefile
lib/configure
lib/libpci.pc.in

index f37bf80978c900533dfaa497d990be4ed6d83349..0ba55247a10f27b8f0ca32fe7a6cd5874f22dba9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,8 +42,8 @@ force:
 lib/config.h lib/config.mk:
        cd lib && ./configure "$(IDSDIR)" "$(VERSION)" "$(HOST)" "$(RELEASE)" "$(ZLIB)"
 
-lspci: lspci.o common.o $(PCILIB) /usr/lib/libresolv.a
-setpci: setpci.o common.o $(PCILIB) /usr/lib/libresolv.a
+lspci: lspci.o common.o $(PCILIB)
+setpci: setpci.o common.o $(PCILIB)
 
 lspci.o: lspci.c pciutils.h $(PCIINC)
 setpci.o: setpci.c pciutils.h $(PCIINC)
index 49eb6fbcfb39f508e2d9023a46c5c2294fabe018..18fff3a9df7de4e1d624a7752a14169c6bbdc4d4 100644 (file)
@@ -59,7 +59,7 @@ $(PCILIBPC): $(PCILIBPC).in
                -e 's,@LIBDIR@,$(LIBDIR),' \
                -e 's,@IDSDIR@,$(IDSDIR),' \
                -e 's,@VERSION@,$(VERSION),' \
-               -e 's,@LIBZ@,$(LIBZ),'
+               -e 's,@LDLIBS@,$(LDLIBS),'
 
 init.o: init.c $(INCL)
 access.o: access.c $(INCL)
index 0e1fab150c339da91c34e22678173896eea96fda..b41628c92d253ecc7d08824fb557ad52b84d6a5b 100755 (executable)
@@ -39,7 +39,7 @@ c=config.h
 m=config.mk
 echo >$c "#define PCI_ARCH_`echo $cpu | tr '[a-z]' '[A-Z]'`"
 echo >>$c "#define PCI_OS_`echo $sys | tr '[a-z]' '[A-Z]'`"
-rm -f $m
+echo >$m 'LDLIBS='
 
 echo_n "Looking for access methods..."
 
@@ -58,6 +58,7 @@ case $sys in
                esac
                echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
                echo >>$c '#define PCI_USE_DNS'
+               echo >>$m 'LDLIBS+=-lresolv'
                ;;
        sunos)
                case $cpu in
@@ -71,18 +72,21 @@ case $sys in
                esac
                echo >>$c '#define PCI_HAVE_STDINT_H'
                echo >>$c '#define PCI_USE_DNS'
+               echo >>$m 'LDLIBS+=-lresolv'
                ;;
        freebsd)
                echo_n " fbsd-device"
                echo >>$c '#define PCI_HAVE_PM_FBSD_DEVICE'
                echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"'
                echo >>$c '#define PCI_USE_DNS'
+               echo >>$m 'LDLIBS+=-lresolv'
                ;;
         openbsd)
                echo_n " obsd-device"
                echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE'
                echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"'
                echo >>$c '#define PCI_USE_DNS'
+               echo >>$m 'LDLIBS+=-lresolv'
                ;;
        aix)
                echo_n " aix-device"
@@ -97,12 +101,13 @@ case $sys in
                echo >>$c '#define PCI_HAVE_PM_NBSD_LIBPCI'
                echo >>$c '#define PCI_PATH_NBSD_DEVICE "/dev/pci0"'
                echo >>$m 'PCILIB=lib/libpciutils.a'
-               echo >>$m 'LDLIBS+=-lpci'
+               echo >>$m 'LDLIBS+=-lpci -lresolv'
                ;;
        gnu)
                echo_n " i386-ports"
                echo >>$c '#define PCI_HAVE_PM_INTEL_CONF'
                echo >>$c '#define PCI_USE_DNS'
+               echo >>$m 'LDLIBS+=-lresolv'
                ;;
         *)
                echo " Unfortunately, your OS is not supported by the PCI Library"
index 3e476988b28b45c223722f57d85cd05634820592..f43f4981f6b87fddf962c41b94eec3bdc727b725 100644 (file)
@@ -6,5 +6,5 @@ idsdir=@IDSDIR@
 Name: libpci
 Description: libpci
 Version: @VERSION@
-Libs: -L${libdir} -lpci @LIBZ@
+Libs: -L${libdir} -lpci @LDLIBS@
 Cflags: -I${includedir}