]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
Configure: HWDB is specific for Linux
authorMartin Mares <mj@ucw.cz>
Sun, 2 Nov 2014 10:10:45 +0000 (11:10 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 2 Nov 2014 10:10:45 +0000 (11:10 +0100)
Makefile
lib/configure

index 9589ea34d95cedec2751c881b304def8e4c16caf..bcc3b1a844c84a7ba7b10123d599f5dd1866dbde 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,9 @@ SHARED=no
 # Use libkmod to resolve kernel modules on Linux (yes/no, default: detect)
 LIBKMOD=
 
+# Use libudev to resolve device names using hwdb on Linux (yes/no, default: detect)
+HWDB=
+
 # ABI version suffix in the name of the shared library
 # (as we use proper symbol versioning, this seldom needs changing)
 ABI_VERSION=.3
index 95d52aba89096100c5ee73f02c8f00ca4e5d5c91..3783f57558279bc05ce2b910ededf5599d123d79 100755 (executable)
@@ -152,23 +152,6 @@ echo >>$m "LIBEXT="$LIBEXT
 echo >>$c '#define PCI_HAVE_PM_DUMP'
 echo " dump"
 
-echo_n "Checking for udev hwdb support... "
-if [ "$HWDB" = yes -o "$HWDB" = no ] ; then
-       echo "$HWDB (set manually)"
-else
-       if `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
-
 echo_n "Checking for zlib support... "
 if [ "$ZLIB" = yes -o "$ZLIB" = no ] ; then
        echo "$ZLIB (set manually)"
@@ -239,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)"