Ticket #13081: tor-0.2.5.6-alpha-build-with-VS-5th-version.diff​

File tor-0.2.5.6-alpha-build-with-VS-5th-version.diff​, 13.9 KB (added by NewEraCracker, 5 years ago)

Diff vs 0.2.5.6-alpha as of Sept 11th.

Line 
1diff -uNraw tor-0.2.5.6-alpha.orig/Makefile.nmake tor-0.2.5.6-alpha/Makefile.nmake
2--- tor-0.2.5.6-alpha.orig/Makefile.nmake       Sat Jun 21 21:16:03 2014
3+++ tor-0.2.5.6-alpha/Makefile.nmake    Thu Sep 11 01:06:52 2014
4@@ -1,15 +1,49 @@
5+# Default configuration is Release
6+!IF "$(CFG)" == ""
7+CFG=Release
8+!ENDIF
9+
10+# Check user supplied configuration to see if it matches any build profile
11+!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
12+!MESSAGE Invalid configuration "$(CFG)" specified.
13+!MESSAGE
14+!MESSAGE You can specify a configuration when running NMAKE by defining
15+!MESSAGE the macro CFG on the command line.
16+!MESSAGE
17+!MESSAGE The following configurations are available:
18+!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Release"
19+!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Test"
20+!MESSAGE
21+!MESSAGE To clean build tree the following configurations are available:
22+!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Release"
23+!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Test"
24+!MESSAGE
25+!MESSAGE You are advised to clean your build tree before building a
26+!MESSAGE different profile.
27+!MESSAGE
28+!ERROR An invalid configuration is specified.
29+!ENDIF
30+
31 all:
32        cd src/common
33-       $(MAKE) /F Makefile.nmake
34+       $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
35+       cd ../../src/ext
36+       $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
37        cd ../../src/or
38-       $(MAKE) /F Makefile.nmake
39+       $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
40        cd ../../src/test
41-       $(MAKE) /F Makefile.nmake
42+       $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
43+       cd ../../src/tools
44+       $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
45 
46 clean:
47        cd src/common
48-       $(MAKE) /F Makefile.nmake clean
49+       $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
50+       cd ../../src/ext
51+       $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
52        cd ../../src/or
53-       $(MAKE) /F Makefile.nmake clean
54+       $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
55        cd ../../src/test
56-       $(MAKE) /F Makefile.nmake clean
57+       $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
58+       cd ../../src/tools
59+       $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
60diff -uNraw tor-0.2.5.6-alpha.orig/src/common/Makefile.nmake tor-0.2.5.6-alpha/src/common/Makefile.nmake
61--- tor-0.2.5.6-alpha.orig/src/common/Makefile.nmake    Sat Jun 21 21:16:03 2014
62+++ tor-0.2.5.6-alpha/src/common/Makefile.nmake Thu Sep 11 01:44:51 2014
63@@ -1,12 +1,25 @@
64-all: libor.lib libor-crypto.lib libor-event.lib
65+# Sanity check
66+!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
67+!ERROR An invalid configuration is specified.
68+!ENDIF
69+
70+# Test suite is not included in Release version
71+!IF "$(CFG)" == "Release"
72+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
73+!ENDIF
74+
75+# Test suite is included in Test version
76+!IF "$(CFG)" == "Test"
77+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /D"TOR_UNIT_TESTS"
78+!ENDIF
79 
80-CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\ext
81+all: libor.lib libor-crypto.lib libor-event.lib
82 
83-LIBOR_OBJECTS = address.obj compat.obj container.obj di_ops.obj \
84-       log.obj memarea.obj mempool.obj procmon.obj util.obj \
85+LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
86+       log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
87        util_codedigest.obj
88 
89-LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj torgzip.obj tortls.obj \
90+LIBOR_CRYPTO_OBJECTS = aes.obj crypto.obj crypto_format.obj torgzip.obj tortls.obj \
91        crypto_curve25519.obj curve25519-donna.obj
92 
93 LIBOR_EVENT_OBJECTS = compat_libevent.obj
94@@ -24,4 +37,4 @@
95        lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib
96 
97 clean:
98-       del *.obj *.lib libor*.lib
99+       del *.obj libor.lib libor-crypto.lib libor-event.lib
100diff -uNraw tor-0.2.5.6-alpha.orig/src/common/backtrace.c tor-0.2.5.6-alpha/src/common/backtrace.c
101--- tor-0.2.5.6-alpha.orig/src/common/backtrace.c       Mon Jul 28 10:00:13 2014
102+++ tor-0.2.5.6-alpha/src/common/backtrace.c    Thu Sep 11 00:33:01 2014
103@@ -5,9 +5,6 @@
104 #define _GNU_SOURCE 1
105 
106 #include "orconfig.h"
107-#include "compat.h"
108-#include "util.h"
109-#include "torlog.h"
110 
111 #ifdef HAVE_EXECINFO_H
112 #include <execinfo.h>
113@@ -21,6 +18,10 @@
114 #ifdef HAVE_SIGNAL_H
115 #include <signal.h>
116 #endif
117+
118+#include "compat.h"
119+#include "util.h"
120+#include "torlog.h"
121 
122 #ifdef HAVE_CYGWIN_SIGNAL_H
123 #include <cygwin/signal.h>
124diff -uNraw tor-0.2.5.6-alpha.orig/src/common/compat.c tor-0.2.5.6-alpha/src/common/compat.c
125--- tor-0.2.5.6-alpha.orig/src/common/compat.c  Mon Jul 28 10:00:13 2014
126+++ tor-0.2.5.6-alpha/src/common/compat.c       Thu Sep 11 01:58:24 2014
127@@ -27,6 +27,7 @@
128 #include "compat.h"
129 
130 #ifdef _WIN32
131+#include <io.h>
132 #include <process.h>
133 #include <windows.h>
134 #include <sys/locking.h>
135diff -uNraw tor-0.2.5.6-alpha.orig/src/common/crypto.c tor-0.2.5.6-alpha/src/common/crypto.c
136--- tor-0.2.5.6-alpha.orig/src/common/crypto.c  Mon Jul 28 10:00:13 2014
137+++ tor-0.2.5.6-alpha/src/common/crypto.c       Thu Sep 11 00:33:01 2014
138@@ -24,6 +24,10 @@
139 #undef OCSP_RESPONSE
140 #endif
141 
142+#ifdef _MSC_VER
143+#include <openssl/applink.c>
144+#endif
145+
146 #include <openssl/err.h>
147 #include <openssl/rsa.h>
148 #include <openssl/pem.h>
149diff -uNraw tor-0.2.5.6-alpha.orig/src/common/log.c tor-0.2.5.6-alpha/src/common/log.c
150--- tor-0.2.5.6-alpha.orig/src/common/log.c     Mon Jul 28 10:00:13 2014
151+++ tor-0.2.5.6-alpha/src/common/log.c  Thu Sep 11 02:00:42 2014
152@@ -15,6 +15,9 @@
153 // #include <stdio.h>
154 #include <stdlib.h>
155 #include <string.h>
156+#ifdef _WIN32
157+#include <io.h>
158+#endif
159 #ifdef HAVE_SYS_TIME_H
160 #include <sys/time.h>
161 #endif
162diff -uNraw tor-0.2.5.6-alpha.orig/src/ext/Makefile.nmake tor-0.2.5.6-alpha/src/ext/Makefile.nmake
163--- tor-0.2.5.6-alpha.orig/src/ext/Makefile.nmake       Thu Jan  1 00:00:00 1970
164+++ tor-0.2.5.6-alpha/src/ext/Makefile.nmake    Thu Sep 11 01:44:14 2014
165@@ -0,0 +1,12 @@
166+all: csiphash.lib tinytest.lib
167+
168+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
169+
170+csiphash.lib: csiphash.obj
171+       lib csiphash.obj /out:csiphash.lib
172+
173+tinytest.lib: tinytest.obj
174+       lib tinytest.obj /out:tinytest.lib
175+
176+clean:
177+       del *.obj *.lib
178diff -uNraw tor-0.2.5.6-alpha.orig/src/ext/tinytest.c tor-0.2.5.6-alpha/src/ext/tinytest.c
179--- tor-0.2.5.6-alpha.orig/src/ext/tinytest.c   Mon Jul 28 10:00:13 2014
180+++ tor-0.2.5.6-alpha/src/ext/tinytest.c        Thu Sep 11 00:33:01 2014
181@@ -56,6 +56,10 @@
182 #define __attribute__(x)
183 #endif
184 
185+#ifdef _MSC_VER
186+#define snprintf _snprintf
187+#endif
188+
189 #include "tinytest.h"
190 #include "tinytest_macros.h"
191 
192diff -uNraw tor-0.2.5.6-alpha.orig/src/or/Makefile.nmake tor-0.2.5.6-alpha/src/or/Makefile.nmake
193--- tor-0.2.5.6-alpha.orig/src/or/Makefile.nmake        Sat Jun 21 21:16:03 2014
194+++ tor-0.2.5.6-alpha/src/or/Makefile.nmake     Thu Sep 11 01:44:51 2014
195@@ -1,12 +1,24 @@
196-all: tor.exe
197+# Sanity check
198+!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
199+!ERROR An invalid configuration is specified.
200+!ENDIF
201+
202+# Test suite is not included in Release version
203+!IF "$(CFG)" == "Release"
204+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
205+!ENDIF
206+
207+# Test suite is included in Test version
208+!IF "$(CFG)" == "Test"
209+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /D"TOR_UNIT_TESTS"
210+!ENDIF
211 
212-CFLAGS = /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
213-    /I ..\ext
214+all: tor.exe
215 
216-LIBS = ..\..\..\build-alpha\lib\libevent.lib \
217- ..\..\..\build-alpha\lib\libcrypto.lib \
218- ..\..\..\build-alpha\lib\libssl.lib \
219- ..\..\..\build-alpha\lib\libz.lib \
220+LIBS = ..\..\..\build-alpha\lib\event.lib \
221+ ..\..\..\build-alpha\lib\libeay32.lib \
222+ ..\..\..\build-alpha\lib\ssleay32.lib \
223+ ..\..\..\build-alpha\lib\zdll.lib \
224  ws2_32.lib advapi32.lib shell32.lib \
225  crypt32.lib gdi32.lib user32.lib
226 
227@@ -15,6 +27,7 @@
228   buffers.obj \
229   channel.obj \
230   channeltls.obj \
231+  circpathbias.obj \
232   circuitbuild.obj \
233   circuitlist.obj \
234   circuitmux.obj \
235@@ -35,6 +48,7 @@
236   dirvote.obj \
237   dns.obj \
238   dnsserv.obj \
239+  ext_orport.obj \
240   fp_pair.obj \
241   entrynodes.obj \
242   geoip.obj \
243@@ -69,7 +83,7 @@
244        lib $(LIBTOR_OBJECTS) /out:$@
245 
246 tor.exe: libtor.lib tor_main.obj
247-       $(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib tor_main.obj /Fe$@
248+       $(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib ..\ext\*.lib tor_main.obj /Fe$@
249 
250 clean:
251-       del $(LIBTOR_OBJECTS) *.lib tor.exe
252+       del $(LIBTOR_OBJECTS) tor_main.obj libtor.lib tor.exe tor.exp tor.lib
253diff -uNraw tor-0.2.5.6-alpha.orig/src/test/Makefile.nmake tor-0.2.5.6-alpha/src/test/Makefile.nmake
254--- tor-0.2.5.6-alpha.orig/src/test/Makefile.nmake      Thu Jan  1 00:00:00 1970
255+++ tor-0.2.5.6-alpha/src/test/Makefile.nmake   Thu Sep 11 01:44:51 2014
256@@ -0,0 +1,72 @@
257+# Sanity check
258+!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
259+!ERROR An invalid configuration is specified.
260+!ENDIF
261+
262+# Test suite is not included in Release version
263+!IF "$(CFG)" == "Release"
264+all: bench.exe
265+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
266+!ENDIF
267+
268+# Test suite is included in Test version
269+!IF "$(CFG)" == "Test"
270+all: bench.exe test.exe test_bt_cl.exe test_ntor_cl.exe test-child.exe
271+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext /D"TOR_UNIT_TESTS"
272+!ENDIF
273+
274+LIBS = ..\..\..\build-alpha\lib\event.lib \
275+ ..\..\..\build-alpha\lib\libeay32.lib \
276+ ..\..\..\build-alpha\lib\ssleay32.lib \
277+ ..\..\..\build-alpha\lib\zdll.lib \
278+ ws2_32.lib advapi32.lib shell32.lib \
279+ crypt32.lib gdi32.lib user32.lib
280+
281+TEST_OBJECTS = \
282+ test.obj                   \
283+ test_addr.obj              \
284+ test_buffers.obj           \
285+ test_cell_formats.obj      \
286+ test_cell_queue.obj        \
287+ test_circuitlist.obj       \
288+ test_circuitmux.obj        \
289+ test_config.obj            \
290+ test_containers.obj        \
291+ test_controller_events.obj \
292+ test_crypto.obj            \
293+ test_data.obj              \
294+ test_dir.obj               \
295+ test_extorport.obj         \
296+ test_hs.obj                \
297+ test_introduce.obj         \
298+ test_logging.obj           \
299+ test_microdesc.obj         \
300+ test_nodelist.obj          \
301+ test_oom.obj               \
302+ test_options.obj           \
303+ test_policy.obj            \
304+ test_pt.obj                \
305+ test_relaycell.obj         \
306+ test_replay.obj            \
307+ test_routerkeys.obj        \
308+ test_socks.obj             \
309+ test_status.obj            \
310+ test_util.obj
311+
312+bench.exe: bench.obj
313+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib bench.obj /Fe$@
314+
315+test.exe: $(TEST_OBJECTS)
316+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib $(TEST_OBJECTS) /Fe$@
317+
318+test_bt_cl.exe: test_bt_cl.obj
319+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib test_bt_cl.obj /Fe$@
320+
321+test_ntor_cl.exe: test_ntor_cl.obj
322+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib test_ntor_cl.obj /Fe$@
323+
324+test-child.exe: test-child.obj
325+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib test-child.obj /Fe$@
326+
327+clean:
328+       del $(TEST_OBJECTS) *.exe *.exp *.lib *.obj
329diff -uNraw tor-0.2.5.6-alpha.orig/src/test/test.h tor-0.2.5.6-alpha/src/test/test.h
330--- tor-0.2.5.6-alpha.orig/src/test/test.h      Mon Jul 28 10:00:13 2014
331+++ tor-0.2.5.6-alpha/src/test/test.h   Thu Sep 11 00:33:01 2014
332@@ -61,7 +61,7 @@
333 
334 #ifdef _MSC_VER
335 #define U64_PRINTF_TYPE uint64_t
336-#define U64_PRINTF_TYPE int64_t
337+#define I64_PRINTF_TYPE int64_t
338 #else
339 #define U64_PRINTF_TYPE unsigned long long
340 #define I64_PRINTF_TYPE long long
341diff -uNraw tor-0.2.5.6-alpha.orig/src/test/test_bt_cl.c tor-0.2.5.6-alpha/src/test/test_bt_cl.c
342--- tor-0.2.5.6-alpha.orig/src/test/test_bt_cl.c        Mon Jul 28 10:00:13 2014
343+++ tor-0.2.5.6-alpha/src/test/test_bt_cl.c     Thu Sep 11 00:33:01 2014
344@@ -18,6 +18,9 @@
345 #ifdef __GNUC__
346 #define NOINLINE __attribute__((noinline))
347 #define NORETURN __attribute__((noreturn))
348+#else
349+#define NOINLINE
350+#define NORETURN
351 #endif
352 
353 int crash(int x) NOINLINE;
354diff -uNraw tor-0.2.5.6-alpha.orig/src/tools/Makefile.nmake tor-0.2.5.6-alpha/src/tools/Makefile.nmake
355--- tor-0.2.5.6-alpha.orig/src/tools/Makefile.nmake     Thu Jan  1 00:00:00 1970
356+++ tor-0.2.5.6-alpha/src/tools/Makefile.nmake  Thu Sep 11 01:44:14 2014
357@@ -0,0 +1,25 @@
358+all: tor-checkkey.exe tor-gencert.exe tor-resolve.exe
359+
360+CFLAGS = /nologo /MD /W3 /O2 /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_DEPRECATE" /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common /I ..\or /I ..\ext
361+
362+LIBS = ..\..\..\build-alpha\lib\event.lib \
363+ ..\..\..\build-alpha\lib\libeay32.lib \
364+ ..\..\..\build-alpha\lib\ssleay32.lib \
365+ ..\..\..\build-alpha\lib\zdll.lib \
366+ ws2_32.lib advapi32.lib shell32.lib \
367+ crypt32.lib gdi32.lib user32.lib
368+
369+tor-checkkey.exe: tor-checkkey.obj
370+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-checkkey.obj /Fe$@
371+
372+tor-gencert.exe: tor-gencert.obj
373+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-gencert.obj /Fe$@
374+
375+tor-resolve.exe: tor-resolve.obj
376+       $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-resolve.obj /Fe$@
377+
378+clean:
379+       del tor-checkkey.obj tor-gencert.obj tor-resolve.obj \
380+               tor-checkkey.lib tor-gencert.lib tor-resolve.lib \
381+               tor-checkkey.exe tor-gencert.exe tor-resolve.exe \
382+               tor-checkkey.exp tor-gencert.exp
383diff -uNraw tor-0.2.5.6-alpha.orig/src/win32/orconfig.h tor-0.2.5.6-alpha/src/win32/orconfig.h
384--- tor-0.2.5.6-alpha.orig/src/win32/orconfig.h Mon Jul 28 10:00:13 2014
385+++ tor-0.2.5.6-alpha/src/win32/orconfig.h      Thu Sep 11 00:56:47 2014
386@@ -257,3 +257,13 @@
387 #define USE_CURVE25519_DONNA
388 
389 #define ENUM_VALS_ARE_SIGNED 1
390+
391+#define HAVE_EXTERN_ENVIRON_DECLARED
392+
393+#ifndef STDOUT_FILENO
394+#define STDOUT_FILENO 1
395+#endif
396+
397+#ifndef STDERR_FILENO
398+#define STDERR_FILENO 2
399+#endif