diff -uNraw tor-0.2.5.6-alpha/Makefile.nmake tor-0.2.5.6-alpha.new/Makefile.nmake --- tor-0.2.5.6-alpha/Makefile.nmake Sat Jun 21 21:16:03 2014 +++ tor-0.2.5.6-alpha.new/Makefile.nmake Tue Sep 9 19:41:12 2014 @@ -1,15 +1,44 @@ +# Check user supplied configuration to see if it matches any build profile +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE by defining +!MESSAGE the macro CFG on the command line. +!MESSAGE +!MESSAGE The following configurations are available: +!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Release" +!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Debug" +!MESSAGE +!MESSAGE To clean build tree the following configurations are available: +!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Release" +!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Debug" +!MESSAGE +!MESSAGE You are advised to clean your build tree before building a +!MESSAGE diferent profile. +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + all: cd src/common - $(MAKE) /F Makefile.nmake + $(MAKE) /F Makefile.nmake all CFG="$(CFG)" + cd ../../src/ext + $(MAKE) /F Makefile.nmake all CFG="$(CFG)" cd ../../src/or - $(MAKE) /F Makefile.nmake + $(MAKE) /F Makefile.nmake all CFG="$(CFG)" cd ../../src/test - $(MAKE) /F Makefile.nmake + $(MAKE) /F Makefile.nmake all CFG="$(CFG)" + cd ../../src/tools + $(MAKE) /F Makefile.nmake all CFG="$(CFG)" clean: cd src/common - $(MAKE) /F Makefile.nmake clean + $(MAKE) /F Makefile.nmake clean CFG="$(CFG)" + cd ../../src/ext + $(MAKE) /F Makefile.nmake clean CFG="$(CFG)" cd ../../src/or - $(MAKE) /F Makefile.nmake clean + $(MAKE) /F Makefile.nmake clean CFG="$(CFG)" cd ../../src/test - $(MAKE) /F Makefile.nmake clean + $(MAKE) /F Makefile.nmake clean CFG="$(CFG)" + cd ../../src/tools + $(MAKE) /F Makefile.nmake clean CFG="$(CFG)" diff -uNraw tor-0.2.5.6-alpha/src/common/Makefile.nmake tor-0.2.5.6-alpha.new/src/common/Makefile.nmake --- tor-0.2.5.6-alpha/src/common/Makefile.nmake Sat Jun 21 21:16:03 2014 +++ tor-0.2.5.6-alpha.new/src/common/Makefile.nmake Tue Sep 9 19:38:33 2014 @@ -1,12 +1,25 @@ -all: libor.lib libor-crypto.lib libor-event.lib +# Sanity check +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!ERROR An invalid configuration is specified. +!ENDIF + +# Test suite is not included in Release version +!IF "$(CFG)" == "Release" +CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext +!ENDIF + +# Test suite is included in Debug version +!IF "$(CFG)" == "Debug" +CFLAGS = /D TOR_UNIT_TESTS /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext +!ENDIF -CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\ext +all: libor.lib libor-crypto.lib libor-event.lib -LIBOR_OBJECTS = address.obj compat.obj container.obj di_ops.obj \ - log.obj memarea.obj mempool.obj procmon.obj util.obj \ +LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \ + log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \ util_codedigest.obj -LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj torgzip.obj tortls.obj \ +LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj torgzip.obj tortls.obj \ crypto_curve25519.obj curve25519-donna.obj LIBOR_EVENT_OBJECTS = compat_libevent.obj @@ -24,4 +37,4 @@ lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib clean: - del *.obj *.lib libor*.lib + del *.obj libor.lib libor-crypto.lib libor-event.lib diff -uNraw tor-0.2.5.6-alpha/src/common/backtrace.c tor-0.2.5.6-alpha.new/src/common/backtrace.c --- tor-0.2.5.6-alpha/src/common/backtrace.c Mon Jul 28 10:00:13 2014 +++ tor-0.2.5.6-alpha.new/src/common/backtrace.c Tue Sep 9 18:22:27 2014 @@ -4,11 +4,6 @@ #define __USE_GNU #define _GNU_SOURCE 1 -#include "orconfig.h" -#include "compat.h" -#include "util.h" -#include "torlog.h" - #ifdef HAVE_EXECINFO_H #include #endif @@ -21,6 +16,11 @@ #ifdef HAVE_SIGNAL_H #include #endif + +#include "orconfig.h" +#include "compat.h" +#include "util.h" +#include "torlog.h" #ifdef HAVE_CYGWIN_SIGNAL_H #include diff -uNraw tor-0.2.5.6-alpha/src/common/crypto.c tor-0.2.5.6-alpha.new/src/common/crypto.c --- tor-0.2.5.6-alpha/src/common/crypto.c Mon Jul 28 10:00:13 2014 +++ tor-0.2.5.6-alpha.new/src/common/crypto.c Tue Sep 9 18:22:27 2014 @@ -24,6 +24,10 @@ #undef OCSP_RESPONSE #endif +#ifdef _MSC_VER +#include +#endif + #include #include #include diff -uNraw tor-0.2.5.6-alpha/src/ext/Makefile.nmake tor-0.2.5.6-alpha.new/src/ext/Makefile.nmake --- tor-0.2.5.6-alpha/src/ext/Makefile.nmake Thu Jan 1 00:00:00 1970 +++ tor-0.2.5.6-alpha.new/src/ext/Makefile.nmake Tue Sep 9 18:22:27 2014 @@ -0,0 +1,12 @@ +all: csiphash.lib tinytest.lib + +CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext + +csiphash.lib: csiphash.obj + lib csiphash.obj /out:csiphash.lib + +tinytest.lib: tinytest.obj + lib tinytest.obj /out:tinytest.lib + +clean: + del *.obj *.lib diff -uNraw tor-0.2.5.6-alpha/src/ext/tinytest.c tor-0.2.5.6-alpha.new/src/ext/tinytest.c --- tor-0.2.5.6-alpha/src/ext/tinytest.c Mon Jul 28 10:00:13 2014 +++ tor-0.2.5.6-alpha.new/src/ext/tinytest.c Tue Sep 9 18:22:27 2014 @@ -56,6 +56,10 @@ #define __attribute__(x) #endif +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + #include "tinytest.h" #include "tinytest_macros.h" diff -uNraw tor-0.2.5.6-alpha/src/or/Makefile.nmake tor-0.2.5.6-alpha.new/src/or/Makefile.nmake --- tor-0.2.5.6-alpha/src/or/Makefile.nmake Sat Jun 21 21:16:03 2014 +++ tor-0.2.5.6-alpha.new/src/or/Makefile.nmake Tue Sep 9 19:44:36 2014 @@ -1,7 +1,19 @@ -all: tor.exe +# Sanity check +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!ERROR An invalid configuration is specified. +!ENDIF + +# Test suite is not included in Release version +!IF "$(CFG)" == "Release" +CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext +!ENDIF + +# Test suite is included in Debug version +!IF "$(CFG)" == "Debug" +CFLAGS = /D TOR_UNIT_TESTS /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext +!ENDIF -CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \ - /I ..\ext +all: tor.exe LIBS = ..\..\..\build-alpha\lib\libevent.lib \ ..\..\..\build-alpha\lib\libcrypto.lib \ @@ -15,6 +27,7 @@ buffers.obj \ channel.obj \ channeltls.obj \ + circpathbias.obj \ circuitbuild.obj \ circuitlist.obj \ circuitmux.obj \ @@ -35,6 +48,7 @@ dirvote.obj \ dns.obj \ dnsserv.obj \ + ext_orport.obj \ fp_pair.obj \ entrynodes.obj \ geoip.obj \ @@ -69,7 +83,7 @@ lib $(LIBTOR_OBJECTS) /out:$@ tor.exe: libtor.lib tor_main.obj - $(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib tor_main.obj /Fe$@ + $(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib ..\ext\*.lib tor_main.obj /Fe$@ clean: - del $(LIBTOR_OBJECTS) *.lib tor.exe + del $(LIBTOR_OBJECTS) tor_main.obj libtor.lib tor.exe tor.exp tor.lib diff -uNraw tor-0.2.5.6-alpha/src/test/Makefile.nmake tor-0.2.5.6-alpha.new/src/test/Makefile.nmake --- tor-0.2.5.6-alpha/src/test/Makefile.nmake Thu Jan 1 00:00:00 1970 +++ tor-0.2.5.6-alpha.new/src/test/Makefile.nmake Tue Sep 9 19:44:16 2014 @@ -0,0 +1,65 @@ +# Sanity check +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!ERROR An invalid configuration is specified. +!ENDIF + +# Test suite is not included in Release version +!IF "$(CFG)" == "Release" +all: bench.exe +CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext +!ENDIF + +# Test suite is included in Debug version +!IF "$(CFG)" == "Debug" +all: bench.exe test.exe +CFLAGS = /D TOR_UNIT_TESTS /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext +!ENDIF + +LIBS = ..\..\..\build-alpha\lib\libevent.lib \ + ..\..\..\build-alpha\lib\libcrypto.lib \ + ..\..\..\build-alpha\lib\libssl.lib \ + ..\..\..\build-alpha\lib\libz.lib \ + ws2_32.lib advapi32.lib shell32.lib \ + crypt32.lib gdi32.lib user32.lib + +TEST_OBJECTS = \ + test.obj \ + test_addr.obj \ +# test_bt_cl.obj \ + test_buffers.obj \ + test_cell_formats.obj \ + test_cell_queue.obj \ + test_circuitlist.obj \ + test_circuitmux.obj \ + test_config.obj \ + test_containers.obj \ + test_controller_events.obj \ + test_crypto.obj \ + test_data.obj \ + test_dir.obj \ + test_extorport.obj \ + test_hs.obj \ + test_introduce.obj \ + test_logging.obj \ + test_microdesc.obj \ + test_nodelist.obj \ +# test_ntor_cl.obj \ + test_oom.obj \ + test_options.obj \ + test_policy.obj \ + test_pt.obj \ + test_relaycell.obj \ + test_replay.obj \ + test_routerkeys.obj \ + test_socks.obj \ + test_status.obj \ + test_util.obj + +bench.exe: bench.obj + $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib bench.obj /Fe$@ + +test.exe: $(TEST_OBJECTS) + $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib $(TEST_OBJECTS) /Fe$@ + +clean: + del bench.obj $(TEST_OBJECTS) bench.exe bench.exp bench.lib test.exe test.exp test.lib diff -uNraw tor-0.2.5.6-alpha/src/test/test.h tor-0.2.5.6-alpha.new/src/test/test.h --- tor-0.2.5.6-alpha/src/test/test.h Mon Jul 28 10:00:13 2014 +++ tor-0.2.5.6-alpha.new/src/test/test.h Tue Sep 9 18:22:27 2014 @@ -61,7 +61,7 @@ #ifdef _MSC_VER #define U64_PRINTF_TYPE uint64_t -#define U64_PRINTF_TYPE int64_t +#define I64_PRINTF_TYPE int64_t #else #define U64_PRINTF_TYPE unsigned long long #define I64_PRINTF_TYPE long long diff -uNraw tor-0.2.5.6-alpha/src/test/test_bt_cl.c tor-0.2.5.6-alpha.new/src/test/test_bt_cl.c --- tor-0.2.5.6-alpha/src/test/test_bt_cl.c Mon Jul 28 10:00:13 2014 +++ tor-0.2.5.6-alpha.new/src/test/test_bt_cl.c Tue Sep 9 18:22:27 2014 @@ -18,6 +18,9 @@ #ifdef __GNUC__ #define NOINLINE __attribute__((noinline)) #define NORETURN __attribute__((noreturn)) +#else +#define NOINLINE +#define NORETURN #endif int crash(int x) NOINLINE; diff -uNraw tor-0.2.5.6-alpha/src/tools/Makefile.nmake tor-0.2.5.6-alpha.new/src/tools/Makefile.nmake --- tor-0.2.5.6-alpha/src/tools/Makefile.nmake Thu Jan 1 00:00:00 1970 +++ tor-0.2.5.6-alpha.new/src/tools/Makefile.nmake Tue Sep 9 19:46:27 2014 @@ -0,0 +1,25 @@ +all: tor-checkkey.exe tor-gencert.exe tor-resolve.exe + +CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext + +LIBS = ..\..\..\build-alpha\lib\libevent.lib \ + ..\..\..\build-alpha\lib\libcrypto.lib \ + ..\..\..\build-alpha\lib\libssl.lib \ + ..\..\..\build-alpha\lib\libz.lib \ + ws2_32.lib advapi32.lib shell32.lib \ + crypt32.lib gdi32.lib user32.lib + +tor-checkkey.exe: tor-checkkey.obj + $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-checkkey.obj /Fe$@ + +tor-gencert.exe: tor-gencert.obj + $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-gencert.obj /Fe$@ + +tor-resolve.exe: tor-resolve.obj + $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-resolve.obj /Fe$@ + +clean: + del tor-checkkey.obj tor-gencert.obj tor-resolve.obj \ + tor-checkkey.lib tor-gencert.lib tor-resolve.lib \ + tor-checkkey.exe tor-gencert.exe tor-resolve.exe \ + tor-checkkey.exp tor-gencert.exp diff -uNraw tor-0.2.5.6-alpha/src/win32/orconfig.h tor-0.2.5.6-alpha.new/src/win32/orconfig.h --- tor-0.2.5.6-alpha/src/win32/orconfig.h Mon Jul 28 10:00:13 2014 +++ tor-0.2.5.6-alpha.new/src/win32/orconfig.h Tue Sep 9 18:22:27 2014 @@ -257,3 +257,11 @@ #define USE_CURVE25519_DONNA #define ENUM_VALS_ARE_SIGNED 1 + +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif + +#ifndef STDERR_FILENO +#define STDERR_FILENO 2 +#endif