From e802199cb3a2ebb4c09eaf4949e279acd3b46fc8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 1 Aug 2011 12:36:59 -0400 Subject: Initial patch to build Tor with msvc and nmake We'll still need to tweak it so that it looks for includes and libraries somewhere more sensible than "where we happened to find them on Erinn's system"; so that tests and tools get built too; so that it's a bit documented; and so that we actually try running the output. Work done with Erinn Clark. --- src/common/Makefile.am | 2 +- src/common/Makefile.nmake | 20 ++++++++++++++++++++ src/common/torgzip.c | 4 ---- src/common/util.c | 6 +++--- 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 src/common/Makefile.nmake (limited to 'src/common') diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 48218491b5..2244fe58d3 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,7 +1,7 @@ noinst_LIBRARIES = libor.a libor-crypto.a libor-event.a -EXTRA_DIST = common_sha1.i sha256.c +EXTRA_DIST = common_sha1.i sha256.c Makefile.nmake #CFLAGS = -Wall -Wpointer-arith -O2 diff --git a/src/common/Makefile.nmake b/src/common/Makefile.nmake new file mode 100644 index 0000000000..c8b5988666 --- /dev/null +++ b/src/common/Makefile.nmake @@ -0,0 +1,20 @@ +all: libor.lib libor-crypto.lib libor-event.lib + +CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include + +LIBOR_OBJECTS = address.obj compat.obj container.obj di_ops.obj \ + log.obj memarea.obj mempool.obj procmon.obj util.obj \ + util_codedigest.obj + +LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj torgzip.obj tortls.obj + +LIBOR_EVENT_OBJECTS = compat_libevent.obj + +libor.lib: $(LIBOR_OBJECTS) + lib $(LIBOR_OBJECTS) /out:libor.lib + +libor-crypto.lib: $(LIBOR_CRYPTO_OBJECTS) + lib $(LIBOR_CRYPTO_OBJECTS) /out:libor-crypto.lib + +libor-event.lib: $(LIBOR_EVENT_OBJECTS) + lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib diff --git a/src/common/torgzip.c b/src/common/torgzip.c index 2937c67de2..ae7d7cfc09 100644 --- a/src/common/torgzip.c +++ b/src/common/torgzip.c @@ -43,11 +43,7 @@ #define off64_t int64_t #endif -#ifdef _MSC_VER -#include "..\..\contrib\zlib\zlib.h" -#else #include -#endif /** Set to 1 if zlib is a version that supports gzip; set to 0 if it doesn't; * set to -1 if we haven't checked yet. */ diff --git a/src/common/util.c b/src/common/util.c index 15b6e7130e..601f2be3e2 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -14,6 +14,9 @@ #define _GNU_SOURCE #include "orconfig.h" +#ifdef HAVE_FCNTL_H +#include +#endif #define UTIL_PRIVATE #include "util.h" #include "torlog.h" @@ -68,9 +71,6 @@ #ifdef HAVE_SYS_FCNTL_H #include #endif -#ifdef HAVE_FCNTL_H -#include -#endif #ifdef HAVE_TIME_H #include #endif -- cgit v1.2.3-54-g00ecf