add .gitignore
[swift-upb.git] / SConstruct
index 33970ee..ef52d27 100644 (file)
@@ -5,16 +5,6 @@
 #  - scons: Cross-platform build system    http://www.scons.org/
 #  - googletest: Google C++ Test Framework http://code.google.com/p/googletest/
 #       * Install in ..\gtest-1.4.0
-#  - google-glog: Google Logging Library for C++  http://code.google.com/p/google-glog/
-#       * Install in ..\glog-0.3.0 
-#       * I get ..\glog-0.3.0\src\windows\glog/log_severity.h(51) : error C2059: syntax error :
-#         'constant' while running scons. Apparently the ERROR constant is already defined somewhere.
-#         #undef ERROR before the def allows include.
-#
-#  - OpenSSL: http://www.slproweb.com/products/Win32OpenSSL.html
-#       * Install non-light Win32 binary in \openssl
-#       * Using a openssl-0.9.8k tar-ball doesn't work as the includes there
-#         are symbolic links which get turned into 0 length files by 7Zip. 
 #
 
 import os
@@ -25,8 +15,10 @@ DEBUG = True
 
 TestDir='tests'
 
-target = 'p2tp'
-source = [ 'bin64.cpp','hashtree.cpp','datagram.cpp','bins.cpp', 'transfer.cpp', 'compat/hirestimeofday.cpp', 'compat/util.cpp']
+target = 'swift'
+source = [ 'bin64.cpp','sha1.cpp','hashtree.cpp','datagram.cpp','bins.cpp',
+    'transfer.cpp', 'channel.cpp', 'sendrecv.cpp', 'send_control.cpp',
+    'compat.cpp']
 
 env = Environment()
 if sys.platform == "win32":
@@ -36,12 +28,11 @@ if sys.platform == "win32":
 
        # Make sure scons finds std MSVC include files
        if not 'INCLUDE' in os.environ:
-               print "p2tp: Please run scons in a Visual Studio Command Prompt"
+               print "swift: Please run scons in a Visual Studio Command Prompt"
                sys.exit(-1)
                
        include = os.environ['INCLUDE']
        include += '..\\gtest-1.4.0\\include;'
-       include += '..\\glog-0.3.0\\src\\windows;' # Funky
        include += '\\openssl\\include;' 
        
        env.Append ( ENV = { 'INCLUDE' : include } )
@@ -56,7 +47,7 @@ if sys.platform == "win32":
        source += ['compat/unixio.cpp']
  
        # Set libs to link to
-       libs = ['libglog','ws2_32']
+       libs = ['ws2_32']
        if DEBUG:
                libs += ['gtestd','libeay32MTd']
        else:
@@ -66,11 +57,9 @@ if sys.platform == "win32":
        libpath = os.environ['LIBPATH']
        if DEBUG:
                libpath += '\\build\\gtest-1.4.0\\msvc\\gtest\\Debug;'
-               libpath += '\\build\\glog-0.3.0\\vsprojects\\libglog\\Debug;'
                libpath += '\\openssl\\lib\\VC\\static;'
        else:
                libpath += '\\build\\gtest-1.4.0\\msvc\\gtest\\Release;'
-               libpath += '\\build\\glog-0.3.0\\vsprojects\\libglog\\Release;'
                libpath += '\\openssl\\lib;'
        # Somehow linker can't find uuid.lib
        libpath += 'C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib;'
@@ -83,25 +72,35 @@ else:
            cpppath = ""
            print "To use external libs, set CPPPATH environment variable to list of colon-separated include dirs"
        env.Append(CPPPATH=".:"+cpppath)
-        env.Append(LINKFLAGS="--static")
+    #env.Append(LINKFLAGS="--static")
 
        #if DEBUG:
        #       env.Append(CXXFLAGS="-g")
 
        # Set libs to link to
-       libs = ['stdc++','gtest','glog','pthread','crypto']
+       libs = ['stdc++','pthread']
        if 'LIBPATH' in os.environ:
            libpath = os.environ['LIBPATH']
        else:
            libpath = ""
            print "To use external libs, set LIBPATH environment variable to list of colon-separated lib dirs"
 
+if DEBUG:
+       env.Append(CXXFLAGS="-DDEBUG")
+
 env.StaticLibrary (
-    target= target,
+    target='libswift',
     source = source,
     LIBS=libs,
     LIBPATH=libpath )
 
+env.Program(
+   target='swift',
+   source=['swift.cpp','httpgw.cpp'],
+   CPPPATH=cpppath,
+   LIBS=[libs,'libswift'],
+   LIBPATH=libpath+':.' )
+
 Export("env")
 Export("libs")
 Export("libpath")