]> mj.ucw.cz Git - pciutils.git/commitdiff
configure: Generate config files for PCI_OS_WINDOWS
authorPali Rohár <pali@kernel.org>
Sun, 26 Dec 2021 17:47:33 +0000 (18:47 +0100)
committerMartin Mareš <mj@ucw.cz>
Sun, 26 Dec 2021 21:51:59 +0000 (22:51 +0100)
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

index ddcad874b06fc4e9f0b9371b1fbc3e864790b1d9..90692482249541d161611387a679e0c7b52da451 100755 (executable)
@@ -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