From d9a7eb8f55ca5b886682cedd19f69292752ebd6b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Sun, 26 Dec 2021 18:47:33 +0100 Subject: [PATCH] configure: Generate config files for PCI_OS_WINDOWS This change adds support for using configure script for cross-compiling pciutils on Linux for Windows platforms. Following command can be used to compile pcitils for Windows platform: make CROSS_COMPILE=i586-mingw32msvc- HOST=i386-windows ZLIB=no IDSDIR=. PCI_OS_WINDOWS does not support BSD DNS functions, so do not automatically enable DNS support. Library ioperm is cygwin specific and is used only for PCI_OS_CYGWIN. --- lib/configure | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/configure b/lib/configure index ddcad87..9069248 100755 --- a/lib/configure +++ b/lib/configure @@ -142,10 +142,16 @@ case $sys in echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' EXEEXT=.exe ;; - cygwin) + cygwin|windows) echo_n " i386-ports" echo >>$c '#define PCI_HAVE_PM_INTEL_CONF' - echo >>$m 'WITH_LIBS+=-lioperm' + if [ "$sys" = "cygwin" ] ; then + # ioperm is cygwin specific library and used only by lib/i386-io-cygwin.h + echo >>$m 'WITH_LIBS+=-lioperm' + elif [ "$sys" = "windows" ] ; then + # advapi32 is windows system library and used only by lib/i386-io-windows.h + echo >>$m 'WITH_LIBS+=-ladvapi32' + fi EXEEXT=.exe ;; beos|haiku) @@ -199,7 +205,7 @@ echo_n "Checking for DNS support... " if [ "$DNS" = yes -o "$DNS" = no ] ; then echo "$DNS (set manually)" else - if [ -f "$SYSINCLUDE/resolv.h" ] ; then + if [ "$sys" != "windows" -a -f "$SYSINCLUDE/resolv.h" ] ; then DNS=yes else DNS=no -- 2.39.5