]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/configure
Let filters accept vendor and device 0xffff.
[pciutils.git] / lib / configure
index 20720230189bfa2398aec8090fe4a9e87e175f17..d2f56f8d5b5034e7086279cd3528b5af90006306 100755 (executable)
@@ -44,7 +44,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]'`"
-echo >$m 'LDLIBS='
+echo >$m 'WITH_LIBS='
 
 echo_n "Looking for access methods..."
 
@@ -62,7 +62,6 @@ case $sys in
                                                ;;
                esac
                echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
-               echo >>$c '#define PCI_USE_DNS'
                ;;
        sunos)
                case $cpu in
@@ -97,8 +96,8 @@ case $sys in
                echo_n " nbsd-libpci"
                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 'LIBNAME=libpciutils'
+               echo >>$m 'WITH_LIBS+=-lpci'
                ;;
        gnu)
                echo_n " i386-ports"
@@ -128,7 +127,7 @@ if [ "$ZLIB" = yes ] ; then
        echo >>$c '#define PCI_COMPRESSED_IDS'
        echo >>$c '#define PCI_IDS "pci.ids.gz"'
        echo >>$m 'LIBZ=-lz'
-       echo >>$m 'LDLIBS+=$(LIBZ)'
+       echo >>$m 'WITH_LIBS+=$(LIBZ)'
 else
        echo >>$c '#define PCI_IDS "pci.ids"'
 fi
@@ -147,9 +146,25 @@ else
 fi
 if [ "$DNS" = yes ] ; then
        echo >>$c "#define PCI_USE_DNS"
-       echo >>$c "#define PCI_ID_DOMAIN \"pci-id.ucw.cz\""
-       echo >>$m 'LDLIBS+=-lresolv'
+       echo >>$c "#define PCI_ID_DOMAIN \"pci.id.ucw.cz\""
+       echo >>$m 'WITH_LIBS+=-lresolv'
 fi
 
+echo "Checking whether to build a shared library... $SHARED (set manually)"
+if [ "$SHARED" = no ] ; then
+       echo >>$m 'PCILIB=$(LIBNAME).a'
+       echo >>$m 'LDLIBS=$(WITH_LIBS)'
+       echo >>$m 'LIB_LDLIBS='
+else
+       echo >>$m 'PCILIB=$(LIBNAME).so.$(VERSION)'
+       # We link the dependencies _to_ the library, so we do not need explicit deps in .pc
+       echo >>$m 'LDLIBS='
+       echo >>$m 'LIB_LDLIBS=$(WITH_LIBS)'
+       if [ "$SHARED" = yes ] ; then
+               echo >>$m 'SONAME=-Wl,-soname,$(LIBNAME).so$(ABI_VERSION)'
+       fi
+fi
+echo >>$m 'PCILIBPC=$(LIBNAME).pc'
+
 echo >>$c "#define PCILIB_VERSION \"$VERSION\""
 sed '/"/{s/^#define \([^ ]*\) "\(.*\)"$/\1=\2/;p;d;};s/^#define \(.*\)/\1=1/' <$c >>$m