]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/configure
lspci: Indent PCIe Capability DevCap2 & DevCtl2 correctly
[pciutils.git] / lib / configure
index a647d336b091a9f3795ac961a1198907b632d69c..7d4cec85fd2ca8d8838ed2d1ba5f7c5a0a93c1af 100755 (executable)
@@ -44,7 +44,7 @@ if [ -z "$HOST" ] ; then
 fi
 [ -n "$RELEASE" ] && rel="${RELEASE}"
 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
-host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
+host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\2/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo " $host $rel $cpu $sys"
@@ -103,7 +103,7 @@ case $sys in
                ;;
 
         darwin*)
-               echo_n " darwin-device"
+               echo_n " darwin"
                echo >>$c '#define PCI_HAVE_PM_DARWIN_DEVICE'
                echo >>$m 'WITH_LIBS+=-lresolv -framework CoreFoundation -framework IOKit'
                echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
@@ -222,6 +222,23 @@ if [ "$sys" = linux ] ; then
                echo >>$m "LIBKMOD_CFLAGS=$($PKG_CONFIG --cflags libkmod)"
                echo >>$m "LIBKMOD_LIBS=$($PKG_CONFIG --libs libkmod)"
        fi
+
+       echo_n "Checking for udev hwdb support... "
+       if [ "$HWDB" = yes -o "$HWDB" = no ] ; then
+               echo "$HWDB (set manually)"
+       else
+               if `which pkg-config >/dev/null && pkg-config --atleast-version=196 libudev` ; then
+                       HWDB=yes
+               else
+                       HWDB=no
+               fi
+               echo "$HWDB (auto-detected)"
+       fi
+       if [ "$HWDB" = yes ] ; then
+               echo >>$c '#define PCI_HAVE_HWDB'
+               echo >>$m 'LIBUDEV=-ludev'
+               echo >>$m 'WITH_LIBS+=$(LIBUDEV)'
+       fi
 fi
 
 echo "Checking whether to build a shared library... $SHARED (set manually)"