fixed windows cross compilation of vpcd-config
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user