diff --git a/virtualsmartcard/configure.ac b/virtualsmartcard/configure.ac index f724619..fbf7d55 100644 --- a/virtualsmartcard/configure.ac +++ b/virtualsmartcard/configure.ac @@ -20,6 +20,17 @@ ifdef( ] ) +dnl Check for windows build +case "${host}" in + *-mingw*|*-winnt*) + WIN32="yes" + ;; + *-cygwin*) + WIN32="yes" + ;; +esac +AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) + # Checks for programs. AC_PROG_CC AC_PROG_INSTALL diff --git a/virtualsmartcard/src/vpcd-config/Makefile.am b/virtualsmartcard/src/vpcd-config/Makefile.am index b834498..6a16c0f 100644 --- a/virtualsmartcard/src/vpcd-config/Makefile.am +++ b/virtualsmartcard/src/vpcd-config/Makefile.am @@ -5,3 +5,10 @@ bin_PROGRAMS = vpcd-config vpcd_config_CFLAGS = $(QRENCODE_CFLAGS) -I$(srcdir)/../vpcd vpcd_config_SOURCES = vpcd-config.c local-ip.c vpcd_config_LDADD = $(QRENCODE_LIBS) + +if WIN32 + +vpcd_config_CFLAGS += -D_WIN32_WINNT=0x0600 +vpcd_config_LDADD += -lws2_32 + +endif diff --git a/virtualsmartcard/src/vpcd-config/local-ip.c b/virtualsmartcard/src/vpcd-config/local-ip.c index 7ecf9ee..1fcd89f 100644 --- a/virtualsmartcard/src/vpcd-config/local-ip.c +++ b/virtualsmartcard/src/vpcd-config/local-ip.c @@ -11,7 +11,7 @@ #include #ifdef _WIN32 #include -#include +#include #define close(s) closesocket(s) #else #include //socket