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)/\" 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 + 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