]> mj.ucw.cz Git - pciutils.git/commitdiff
Fix the primitive system dependency discovery for Darwin systems
authorLaurin-Luis Lehning <65224843+e820@users.noreply.github.com>
Thu, 4 Mar 2021 18:55:31 +0000 (19:55 +0100)
committerMartin Mareš <mj@ucw.cz>
Sun, 26 Dec 2021 21:19:10 +0000 (22:19 +0100)
lib/configure

index e181b7fda13ef9632f3dda10a30b11255979e475..77a081626e0b8b08840bb66bc8dd713e27bdae5a 100755 (executable)
@@ -62,6 +62,7 @@ echo >$m 'WITH_LIBS='
 echo_n "Looking for access methods..."
 LIBRESOLV=-lresolv
 LIBEXT=so
+MACSDKROOT=
 
 case $sys in
        linux*)
@@ -112,6 +113,7 @@ case $sys in
                echo >>$c '#define PCI_HAVE_64BIT_ADDRESS'
                LIBRESOLV=
                LIBEXT=dylib
+               MACSDKROOT=$(xcrun --sdk macosx --show-sdk-path)
                ;;
        aix)
                echo_n " aix-device"
@@ -172,7 +174,7 @@ echo_n "Checking for zlib support... "
 if [ "$ZLIB" = yes -o "$ZLIB" = no ] ; then
        echo "$ZLIB (set manually)"
 else
-       if [ -f /usr/include/zlib.h -o -f /usr/local/include/zlib.h ] ; then
+       if [ -f "$MACSDKROOT"/usr/include/zlib.h -o -f /usr/local/include/zlib.h ] ; then
                ZLIB=yes
        else
                ZLIB=no
@@ -193,7 +195,7 @@ echo_n "Checking for DNS support... "
 if [ "$DNS" = yes -o "$DNS" = no ] ; then
        echo "$DNS (set manually)"
 else
-       if [ -f /usr/include/resolv.h ] ; then
+       if [ -f "$MACSDKROOT"/usr/include/resolv.h ] ; then
                DNS=yes
        else
                DNS=no