12e5b6d6dSopenharmony_ci# vim:ft=python 22e5b6d6dSopenharmony_ciimport os 32e5b6d6dSopenharmony_ci 42e5b6d6dSopenharmony_cidouble_conversion_sources = ['double-conversion/' + x for x in SConscript('double-conversion/SConscript')] 52e5b6d6dSopenharmony_cidouble_conversion_test_sources = ['test/cctest/' + x for x in SConscript('test/cctest/SConscript')] 62e5b6d6dSopenharmony_ci 72e5b6d6dSopenharmony_ciDESTDIR = ARGUMENTS.get('DESTDIR', '') 82e5b6d6dSopenharmony_ciprefix = ARGUMENTS.get('prefix', '/usr/local') 92e5b6d6dSopenharmony_cilib = ARGUMENTS.get('libsuffix', 'lib') 102e5b6d6dSopenharmony_cilibdir = os.path.join(DESTDIR + prefix, lib) 112e5b6d6dSopenharmony_ci 122e5b6d6dSopenharmony_cienv = Environment(CPPPATH='#', LIBS=['m', 'stdc++'], 132e5b6d6dSopenharmony_ci CXXFLAGS=ARGUMENTS.get('CXXFLAGS', '')) 142e5b6d6dSopenharmony_cidebug = ARGUMENTS.get('debug', 0) 152e5b6d6dSopenharmony_cioptimize = ARGUMENTS.get('optimize', 0) 162e5b6d6dSopenharmony_cienv.Replace(CXX = ARGUMENTS.get('CXX', 'g++')) 172e5b6d6dSopenharmony_ci 182e5b6d6dSopenharmony_ci# for shared lib, requires scons 2.3.0 192e5b6d6dSopenharmony_cienv['SHLIBVERSION'] = '3.0.0' 202e5b6d6dSopenharmony_ci 212e5b6d6dSopenharmony_ciCCFLAGS = [] 222e5b6d6dSopenharmony_ciif int(debug): 232e5b6d6dSopenharmony_ci CCFLAGS.append(ARGUMENTS.get('CXXFLAGS', '-g -Wall -Wshadow -Werror -UNDEBUG')) 242e5b6d6dSopenharmony_ciif int(optimize): 252e5b6d6dSopenharmony_ci CCFLAGS.append(ARGUMENTS.get('CXXFLAGS', '-O3 -DNDEBUG=1')) 262e5b6d6dSopenharmony_ci 272e5b6d6dSopenharmony_cienv.Append(CCFLAGS = " ".join(CCFLAGS)) 282e5b6d6dSopenharmony_ci 292e5b6d6dSopenharmony_cidouble_conversion_shared_objects = [ 302e5b6d6dSopenharmony_ci env.SharedObject(src) for src in double_conversion_sources] 312e5b6d6dSopenharmony_cidouble_conversion_static_objects = [ 322e5b6d6dSopenharmony_ci env.StaticObject(src) for src in double_conversion_sources] 332e5b6d6dSopenharmony_ci 342e5b6d6dSopenharmony_cilibrary_name = 'double-conversion' 352e5b6d6dSopenharmony_ci 362e5b6d6dSopenharmony_cistatic_lib = env.StaticLibrary(library_name, double_conversion_static_objects) 372e5b6d6dSopenharmony_cistatic_lib_pic = env.StaticLibrary(library_name + '_pic', double_conversion_shared_objects) 382e5b6d6dSopenharmony_cishared_lib = env.SharedLibrary(library_name, double_conversion_shared_objects) 392e5b6d6dSopenharmony_ci 402e5b6d6dSopenharmony_cienv.Program('run_tests', double_conversion_test_sources, LIBS=[static_lib]) 412e5b6d6dSopenharmony_ci 422e5b6d6dSopenharmony_cienv.InstallVersionedLib(libdir, shared_lib) 432e5b6d6dSopenharmony_cienv.Install(libdir, static_lib) 442e5b6d6dSopenharmony_cienv.Install(libdir, static_lib_pic) 452e5b6d6dSopenharmony_ci 462e5b6d6dSopenharmony_cienv.Alias('install', libdir) 47