From 0972d0c13e4d431a6131d665d5c6fa8080a097ea Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 15 Feb 2013 19:53:07 -0800 Subject: [PATCH] Fix sha1 build for Windows This works at least when cross compiling. Signed-off-by: Dirk Hohndel --- Makefile | 3 ++- sha1.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a6ed5792d..17b69e0aa 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ ifeq ($(CC), i686-w64-mingw32-gcc) LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer) RESFILE = packaging/windows/subsurface.res LDFLAGS += -Wl,-subsystem,windows + LIBWINSOCK = -lwsock32 else ifeq ($(UNAME), darwin) LIBDIVECOMPUTERINCLUDES = $(shell $(PKGCONFIG) --cflags libdivecomputer) LIBDIVECOMPUTERARCHIVE = $(shell $(PKGCONFIG) --libs libdivecomputer) @@ -141,7 +142,7 @@ ifneq ($(strip $(LIBXSLT)),) endif endif -LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) $(LIBZIP) -lpthread -lm $(LIBOSMGPSMAP) $(LIBSOUP) +LIBS = $(LIBXML2) $(LIBXSLT) $(LIBGTK) $(LIBGCONF2) $(LIBDIVECOMPUTER) $(EXTRALIBS) $(LIBZIP) -lpthread -lm $(LIBOSMGPSMAP) $(LIBSOUP) $(LIBWINSOCK) MSGLANGS=$(notdir $(wildcard po/*po)) MSGOBJS=$(addprefix share/locale/,$(MSGLANGS:.po=.UTF-8/LC_MESSAGES/subsurface.mo)) diff --git a/sha1.c b/sha1.c index 8d1938034..54aa4839f 100644 --- a/sha1.c +++ b/sha1.c @@ -8,8 +8,12 @@ /* this is only to get definitions for memcpy(), ntohl() and htonl() */ #include +#include +#ifdef WIN32 +#include +#else #include - +#endif #include "sha1.h" #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))