From bca6bbaf496f45ce3a3eea8ae2153ef73009b6b8 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 2 Nov 2014 11:10:45 +0100 Subject: [PATCH] Configure: HWDB is specific for Linux --- Makefile | 3 +++ lib/configure | 34 +++++++++++++++++----------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 9589ea3..bcc3b1a 100644 --- 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 diff --git a/lib/configure b/lib/configure index 95d52ab..3783f57 100755 --- a/lib/configure +++ b/lib/configure @@ -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)" -- 2.39.5