aboutsummaryrefslogtreecommitdiff
blob: eea519f5faea041bf336476e3535c9685c200e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
--- SConstruct.orig	2012-07-11 14:21:27.783375399 -0700
+++ SConstruct	2012-07-11 15:10:28.400764573 -0700
@@ -1,3 +1,4 @@
+import os
 double_conversion_sources = ['src/' + x for x in SConscript('src/SConscript')]
 double_conversion_test_sources = ['test/cctest/' + x for x in SConscript('test/cctest/SConscript')]
 test = double_conversion_sources + double_conversion_test_sources
@@ -7,8 +8,16 @@
 optimize = ARGUMENTS.get('optimize', 0)
 if int(debug):
   env.Append(CCFLAGS = '-g -Wall -Werror')
-if int(optimize):
+elif int(optimize):
   env.Append(CCFLAGS = '-O3')
+else:
+  env.Append(CCFLAGS = os.environ['CXXFLAGS'])
+env.Append(LINKFLAGS = os.environ['LDFLAGS'])
 print double_conversion_sources
 print double_conversion_test_sources
-env.Program('run_tests', double_conversion_sources + double_conversion_test_sources)
+libname = 'double-conversion'
+# tofix: line below only works for linux?
+env.Append(SHLINKFLAGS=" -Wl,-soname=lib"+libname+".so ")
+shlib = env.SharedLibrary(libname, [env.SharedObject(src) for src in double_conversion_sources])
+env.StaticLibrary(libname, [env.StaticObject(src) for src in double_conversion_sources])
+env.Program('run_tests', double_conversion_test_sources, LIBS=[shlib])