fixed windows cross compilation of vpcd-config

This commit is contained in:
Frank Morgner
2015-08-21 03:46:46 +02:00
parent dc342cf682
commit e4b438e870
3 changed files with 19 additions and 1 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -11,7 +11,7 @@
#include<string.h>
#ifdef _WIN32
#include<winsock2.h>
#include<WS2tcpip.h>
#include<ws2tcpip.h>
#define close(s) closesocket(s)
#else
#include<sys/socket.h> //socket