Ticket #13081: tor-0.2.5.12-msvs2010-build.diff

File tor-0.2.5.12-msvs2010-build.diff, 10.3 KB (added by NewEraCracker, 4 years ago)
  • Makefile.nmake

    a b  
     1# Default configuration is Release
     2!IF "$(CFG)" == ""
     3CFG=Release
     4!ENDIF
     5
     6# Check user supplied configuration to see if it matches any build profile
     7!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     8!MESSAGE Invalid configuration "$(CFG)" specified.
     9!MESSAGE
     10!MESSAGE You can specify a configuration when running NMAKE by defining
     11!MESSAGE the macro CFG on the command line.
     12!MESSAGE
     13!MESSAGE The following configurations are available:
     14!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Release"
     15!MESSAGE NMAKE /f "Makefile.nmake" all CFG="Test"
     16!MESSAGE
     17!MESSAGE To clean build tree the following configurations are available:
     18!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Release"
     19!MESSAGE NMAKE /f "Makefile.nmake" clean CFG="Test"
     20!MESSAGE
     21!MESSAGE You are advised to clean your build tree before building a
     22!MESSAGE different profile.
     23!MESSAGE
     24!ERROR An invalid configuration is specified.
     25!ENDIF
     26
    127all:
    228        cd src/common
    3         $(MAKE) /F Makefile.nmake
     29        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    430        cd ../../src/ext
    5         $(MAKE) /F Makefile.nmake
     31        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    632        cd ../../src/or
    7         $(MAKE) /F Makefile.nmake
     33        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    834        cd ../../src/test
    9         $(MAKE) /F Makefile.nmake
     35        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
     36        cd ../../src/tools
     37        $(MAKE) /F Makefile.nmake all CFG="$(CFG)"
    1038
    1139clean:
    1240        cd src/common
    13         $(MAKE) /F Makefile.nmake clean
     41        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
    1442        cd ../../src/ext
    15         $(MAKE) /F Makefile.nmake clean
     43        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
    1644        cd ../../src/or
    17         $(MAKE) /F Makefile.nmake clean
     45        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
    1846        cd ../../src/test
    19         $(MAKE) /F Makefile.nmake clean
     47        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
     48        cd ../../src/tools
     49        $(MAKE) /F Makefile.nmake clean CFG="$(CFG)"
  • src/common/Makefile.nmake

    a b  
    1 all: libor.lib libor-crypto.lib libor-event.lib
     1# Sanity check
     2!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     3!ERROR An invalid configuration is specified.
     4!ENDIF
     5
     6# Test suite is not included in Release version
     7!IF "$(CFG)" == "Release"
     8CFLAGS = /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
     9!ENDIF
     10
     11# Test suite is included in Test version
     12!IF "$(CFG)" == "Test"
     13CFLAGS = /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"
     14!ENDIF
    215
    3 CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
    4     /I ..\ext
     16all: libor.lib libor-crypto.lib libor-event.lib
    517
    618LIBOR_OBJECTS = address.obj backtrace.obj compat.obj container.obj di_ops.obj \
    719        log.obj memarea.obj mempool.obj procmon.obj sandbox.obj util.obj \
     
    2537        lib $(LIBOR_EVENT_OBJECTS) /out:libor-event.lib
    2638
    2739clean:
    28         del *.obj *.lib libor*.lib
     40        del *.obj libor.lib libor-crypto.lib libor-event.lib
  • src/common/backtrace.c

    a b  
    66
    77#include "orconfig.h"
    88#include "compat.h"
    9 #include "util.h"
    10 #include "torlog.h"
    119
    1210#ifdef HAVE_EXECINFO_H
    1311#include <execinfo.h>
     
    2119#ifdef HAVE_SIGNAL_H
    2220#include <signal.h>
    2321#endif
     22
     23#include "util.h"
     24#include "torlog.h"
    2425
    2526#ifdef HAVE_CYGWIN_SIGNAL_H
    2627#include <cygwin/signal.h>
  • src/common/compat.c

    a b  
    2727#include "compat.h"
    2828
    2929#ifdef _WIN32
     30#include <io.h>
    3031#include <process.h>
    3132#include <windows.h>
    3233#include <sys/locking.h>
  • src/common/crypto.c

    a b  
    2424#undef OCSP_RESPONSE
    2525#endif
    2626
     27#ifdef _MSC_VER
     28#include <openssl/applink.c>
     29#endif
     30
    2731#include <openssl/err.h>
    2832#include <openssl/rsa.h>
    2933#include <openssl/pem.h>
  • src/common/log.c

    a b  
    1515// #include <stdio.h>
    1616#include <stdlib.h>
    1717#include <string.h>
     18#ifdef _WIN32
     19#include <io.h>
     20#endif
    1821#ifdef HAVE_SYS_TIME_H
    1922#include <sys/time.h>
    2023#endif
  • src/ext/Makefile.nmake

    a b  
     1all: csiphash.lib tinytest.lib
     2
     3CFLAGS = /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
     4
     5csiphash.lib: csiphash.obj
     6        lib csiphash.obj /out:csiphash.lib
     7
     8tinytest.lib: tinytest.obj
     9        lib tinytest.obj /out:tinytest.lib
     10
     11clean:
     12        del *.obj *.lib
  • src/ext/tinytest.c

    a b  
    5656#define __attribute__(x)
    5757#endif
    5858
     59#ifdef _MSC_VER
     60#define snprintf _snprintf
     61#endif
     62
    5963#include "tinytest.h"
    6064#include "tinytest_macros.h"
    6165
  • src/or/Makefile.nmake

    a b  
    1 all: tor.exe
     1# Sanity check
     2!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     3!ERROR An invalid configuration is specified.
     4!ENDIF
     5
     6# Test suite is not included in Release version
     7!IF "$(CFG)" == "Release"
     8CFLAGS = /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
     9!ENDIF
     10
     11# Test suite is included in Test version
     12!IF "$(CFG)" == "Test"
     13CFLAGS = /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"
     14!ENDIF
    215
    3 CFLAGS = /O2 /MT /I ..\win32 /I ..\..\..\build-alpha\include /I ..\common \
    4     /I ..\ext
     16all: tor.exe
    517
    6 LIBS = ..\..\..\build-alpha\lib\libevent.lib \
    7  ..\..\..\build-alpha\lib\libcrypto.lib \
    8  ..\..\..\build-alpha\lib\libssl.lib \
    9  ..\..\..\build-alpha\lib\libz.lib \
     18LIBS = ..\..\..\build-alpha\lib\event.lib \
     19 ..\..\..\build-alpha\lib\libeay32.lib \
     20 ..\..\..\build-alpha\lib\ssleay32.lib \
     21 ..\..\..\build-alpha\lib\zdll.lib \
    1022 ws2_32.lib advapi32.lib shell32.lib \
    1123 crypt32.lib gdi32.lib user32.lib
    1224
     
    7486        $(CC) $(CFLAGS) $(LIBS) libtor.lib ..\common\*.lib ..\ext\*.lib tor_main.obj /Fe$@
    7587
    7688clean:
    77         del $(LIBTOR_OBJECTS) tor_main.obj *.lib tor.exe
     89        del $(LIBTOR_OBJECTS) tor_main.obj libtor.lib tor.exe tor.exp tor.lib
  • src/test/Makefile.nmake

    a b  
     1# Sanity check
     2!IF "$(CFG)" != "Release" && "$(CFG)" != "Test"
     3!ERROR An invalid configuration is specified.
     4!ENDIF
     5
     6# Test suite is not included in Release version
     7!IF "$(CFG)" == "Release"
     8all: bench.exe
     9CFLAGS = /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
     10!ENDIF
     11
     12# Test suite is included in Test version
     13!IF "$(CFG)" == "Test"
     14all: bench.exe test.exe test_bt_cl.exe test_ntor_cl.exe test-child.exe
     15CFLAGS = /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"
     16!ENDIF
     17
     18LIBS = ..\..\..\build-alpha\lib\event.lib \
     19 ..\..\..\build-alpha\lib\libeay32.lib \
     20 ..\..\..\build-alpha\lib\ssleay32.lib \
     21 ..\..\..\build-alpha\lib\zdll.lib \
     22 ws2_32.lib advapi32.lib shell32.lib \
     23 crypt32.lib gdi32.lib user32.lib
     24
     25TEST_OBJECTS = \
     26 test.obj                   \
     27 test_addr.obj              \
     28 test_buffers.obj           \
     29 test_cell_formats.obj      \
     30 test_cell_queue.obj        \
     31 test_circuitlist.obj       \
     32 test_circuitmux.obj        \
     33 test_config.obj            \
     34 test_containers.obj        \
     35 test_controller_events.obj \
     36 test_crypto.obj            \
     37 test_data.obj              \
     38 test_dir.obj               \
     39 test_extorport.obj         \
     40 test_hs.obj                \
     41 test_introduce.obj         \
     42 test_logging.obj           \
     43 test_microdesc.obj         \
     44 test_nodelist.obj          \
     45 test_oom.obj               \
     46 test_options.obj           \
     47 test_policy.obj            \
     48 test_pt.obj                \
     49 test_relaycell.obj         \
     50 test_replay.obj            \
     51 test_routerkeys.obj        \
     52 test_socks.obj             \
     53 test_status.obj            \
     54 test_util.obj
     55
     56bench.exe: bench.obj
     57        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib bench.obj /Fe$@
     58
     59test.exe: $(TEST_OBJECTS)
     60        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib $(TEST_OBJECTS) /Fe$@
     61
     62test_bt_cl.exe: test_bt_cl.obj
     63        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib test_bt_cl.obj /Fe$@
     64
     65test_ntor_cl.exe: test_ntor_cl.obj
     66        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib test_ntor_cl.obj /Fe$@
     67
     68test-child.exe: test-child.obj
     69        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib test-child.obj /Fe$@
     70
     71clean:
     72        del $(TEST_OBJECTS) *.exe *.exp *.lib *.obj
  • src/test/test_bt_cl.c

    a b  
    1818#ifdef __GNUC__
    1919#define NOINLINE __attribute__((noinline))
    2020#define NORETURN __attribute__((noreturn))
     21#else
     22#define NOINLINE
     23#define NORETURN
    2124#endif
    2225
    2326int crash(int x) NOINLINE;
  • src/tools/Makefile.nmake

    a b  
     1all: tor-checkkey.exe tor-gencert.exe tor-resolve.exe
     2
     3CFLAGS = /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
     4
     5LIBS = ..\..\..\build-alpha\lib\event.lib \
     6 ..\..\..\build-alpha\lib\libeay32.lib \
     7 ..\..\..\build-alpha\lib\ssleay32.lib \
     8 ..\..\..\build-alpha\lib\zdll.lib \
     9 ws2_32.lib advapi32.lib shell32.lib \
     10 crypt32.lib gdi32.lib user32.lib
     11
     12tor-checkkey.exe: tor-checkkey.obj
     13        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-checkkey.obj /Fe$@
     14
     15tor-gencert.exe: tor-gencert.obj
     16        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-gencert.obj /Fe$@
     17
     18tor-resolve.exe: tor-resolve.obj
     19        $(CC) $(CFLAGS) $(LIBS) ..\or\libtor.lib ..\common\*.lib ..\ext\*.lib tor-resolve.obj /Fe$@
     20
     21clean:
     22        del tor-checkkey.obj tor-gencert.obj tor-resolve.obj \
     23                tor-checkkey.lib tor-gencert.lib tor-resolve.lib \
     24                tor-checkkey.exe tor-gencert.exe tor-resolve.exe \
     25                tor-checkkey.exp tor-gencert.exp
  • src/win32/orconfig.h

    a b  
    258258
    259259#define ENUM_VALS_ARE_SIGNED 1
    260260
     261#define HAVE_EXTERN_ENVIRON_DECLARED
     262
    261263#ifndef STDOUT_FILENO
    262264#define STDOUT_FILENO 1
    263265#endif