From 8f01d29c75b03cd42275041caba475bf4824efb3 Mon Sep 17 00:00:00 2001 From: Mike Akiba Date: Fri, 3 Oct 2014 00:27:06 +0800 Subject: [PATCH 1/3] Add MSVC v18 (Visual Studio Express 2013 for Desktop) NMakefile --- Makefile.msc | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Makefile.msc diff --git a/Makefile.msc b/Makefile.msc new file mode 100644 index 00000000..ed9f7891 --- /dev/null +++ b/Makefile.msc @@ -0,0 +1,55 @@ +LOCAL_ROOT = /usr/share/polipo/www +DISK_CACHE_ROOT = /var/cache/polipo + +CC = cl +CDEBUGFLAGS = /nologo /MD /O2 /DWIN32 # /DNO_DISK_CACHE +LDLIBS = ws2_32.lib + +FILE_DEFINES = /DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \ + /DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\" + +# You may optionally also add any of the following to DEFINES: +# +# /DNO_DISK_CACHE to compile out the on-disk cache and local web server; +# /DNO_IPv6 to avoid using the RFC 3493 API and stick to stock +# Berkeley sockets; +# /DHAVE_IPv6 to force the use of the RFC 3493 API on systems other +# than GNU/Linux and BSD (let me know if it works); +# /DNO_FANCY_RESOLVER to compile out the asynchronous name resolution +# code; +# /DNO_STANDARD_RESOLVER to compile out the code that falls back to +# gethostbyname/getaddrinfo when DNS requests fail; +# /DNO_TUNNEL to compile out the code that handles CONNECT requests; +# /DNO_SOCKS to compile out the SOCKS gateway code. +# /DNO_FORBIDDEN to compile out the all of the forbidden URL code +# /DNO_REDIRECTOR to compile out the Squid-style redirector code +# /DNO_SYSLOG to compile out logging to syslog + +DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES) + +CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES) + +SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \ + config.c local.c http.c client.c server.c auth.c tunnel.c \ + http_parse.c parse_time.c dns.c forbidden.c \ + md5import.c md5.c ftsimport.c fts_compat.c socks.c mingw.c + +OBJS = util.obj event.obj io.obj chunk.obj atom.obj object.obj log.obj diskcache.obj main.obj \ + config.obj local.obj http.obj client.obj server.obj auth.obj tunnel.obj \ + http_parse.obj parse_time.obj dns.obj forbidden.obj \ + md5import.obj ftsimport.obj socks.obj mingw.obj dirent_compat.obj + +polipo.exe: $(OBJS) + $(CC) $(CFLAGS) $(LDFLAGS) -Fepolipo.exe $(OBJS) $(MD5LIBS) $(LDLIBS) + +ftsimport.obj: ftsimport.c fts_compat.c + +md5import.obj: md5import.c md5.c + +.PHONY: all clean + +all: polipo.exe + +clean: + del polipo.exe *.obj + From 3ae69820caef37a08f2bbe97717c4a77e4c4dedf Mon Sep 17 00:00:00 2001 From: Mike Akiba Date: Fri, 3 Oct 2014 00:41:22 +0800 Subject: [PATCH 2/3] F_OK missing in MSVC v18 fix --- polipo.h | 1 + 1 file changed, 1 insertion(+) diff --git a/polipo.h b/polipo.h index 5e28a569..d876aa25 100644 --- a/polipo.h +++ b/polipo.h @@ -41,6 +41,7 @@ THE SOFTWARE. #include #else #include "dirent_compat.h" +#define F_OK 0 /* Check for file existence */ #endif #include #include From 0f6783f9b4762677cf8e9da7ffa86ef3880bfb93 Mon Sep 17 00:00:00 2001 From: Mike Akiba Date: Fri, 3 Oct 2014 01:20:56 +0800 Subject: [PATCH 3/3] Use MinGW-w64 to cross compile 32-bit polipo.exe --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 6fbce38b..9a83e1bc 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,10 @@ CDEBUGFLAGS = -Os -g -Wall -fno-strict-aliasing # EXE=.exe # LDLIBS = -lws2_32 +# On mingw-w64, you also need + +# CC = i686-w64-mingw32-gcc + FILE_DEFINES = -DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \ -DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\"