1 # Written by Victor Grishchenko, Arno Bakker
2 # see LICENSE.txt for license information
5 # - scons: Cross-platform build system http://www.scons.org/
6 # - googletest: Google C++ Test Framework http://code.google.com/p/googletest/
7 # * Install in ..\gtest-1.4.0
8 # - OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html
9 # * Install non-light Win32 binary in \openssl
10 # * Using a openssl-0.9.8k tar-ball doesn't work as the includes there
11 # are symbolic links which get turned into 0 length files by 7Zip.
23 source = [ 'bin64.cpp','sha1.cpp','hashtree.cpp','datagram.cpp','bins.cpp',
24 'transfer.cpp', 'p2tp.cpp', 'sendrecv.cpp', 'ext/send_control.cpp',
25 'compat/hirestimeofday.cpp', 'compat.cpp', 'compat/util.cpp']
28 if sys.platform == "win32":
29 # "MSVC works out of the box". Sure.
30 # Make sure scons finds cl.exe, etc.
31 env.Append ( ENV = { 'PATH' : os.environ['PATH'] } )
33 # Make sure scons finds std MSVC include files
34 if not 'INCLUDE' in os.environ:
35 print "p2tp: Please run scons in a Visual Studio Command Prompt"
38 include = os.environ['INCLUDE']
39 include += '..\\gtest-1.4.0\\include;'
40 include += '\\openssl\\include;'
42 env.Append ( ENV = { 'INCLUDE' : include } )
44 # Other compiler flags
45 env.Append(CPPPATH=".")
47 env.Append(CXXFLAGS="/Zi /Yd /MTd")
48 env.Append(LINKFLAGS="/DEBUG")
50 # Add simulated pread/write
51 source += ['compat/unixio.cpp']
56 libs += ['gtestd','libeay32MTd']
58 libs += ['gtest','libeay32']
60 # Update lib search path
61 libpath = os.environ['LIBPATH']
63 libpath += '\\build\\gtest-1.4.0\\msvc\\gtest\\Debug;'
64 libpath += '\\openssl\\lib\\VC\\static;'
66 libpath += '\\build\\gtest-1.4.0\\msvc\\gtest\\Release;'
67 libpath += '\\openssl\\lib;'
68 # Somehow linker can't find uuid.lib
69 libpath += 'C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib;'
72 # Enable the user defining external includes
73 if 'CPPPATH' in os.environ:
74 cpppath = os.environ['CPPPATH']
77 print "To use external libs, set CPPPATH environment variable to list of colon-separated include dirs"
78 env.Append(CPPPATH=".:"+cpppath)
79 #env.Append(LINKFLAGS="--static")
82 # env.Append(CXXFLAGS="-g")
85 libs = ['stdc++','pthread']
86 if 'LIBPATH' in os.environ:
87 libpath = os.environ['LIBPATH']
90 print "To use external libs, set LIBPATH environment variable to list of colon-separated lib dirs"
102 SConscript('tests/SConscript')
103 SConscript('exec/SConscript')