Skip to content
Newer
Older
100644 347 lines (306 sloc) 11.7 KB
0e1d2c0 @tokuhirom optimized
authored Mar 3, 2012
1 # vim: set filetype=python:
b5a1cae @tokuhirom test target
authored Jan 31, 2012
2 import os
3 import subprocess
f3a0821 @tokuhirom better sconscript
authored Feb 2, 2012
4 import platform
5 import re
6 import sys
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
7 import json
049728b @tokuhirom config
authored Mar 22, 2012
8
f3a0821 @tokuhirom better sconscript
authored Feb 1, 2012
9 from os.path import join, dirname, abspath
10 from types import DictType, StringTypes
91effe6 @tokuhirom added test cases for lexer in c++.
authored Feb 20, 2012
11 from glob import glob
b5a1cae @tokuhirom test target
authored Jan 30, 2012
12
e895262 @tokuhirom fixed uv build
authored Apr 7, 2012
13 TORA_VERSION_STR='0.0.5'
2c4b861 @tokuhirom better lib path settings
authored Mar 20, 2012
14
c02343d @mattn default prefix for windows.
mattn authored Apr 3, 2012
15 tools = ['default']
16 default_prefix = '/usr/local'
17 if os.name == 'nt':
18 tools = ['mingw']
19 default_prefix = 'c:/tora'
20
2c4b861 @tokuhirom better lib path settings
authored Mar 20, 2012
21 AddOption('--prefix',
22 dest='prefix',
23 nargs=1,
24 type='string',
25 action='store',
26 metavar='DIR',
c02343d @mattn default prefix for windows.
mattn authored Apr 3, 2012
27 default=default_prefix,
2c4b861 @tokuhirom better lib path settings
authored Mar 20, 2012
28 help='installation prefix'
29 )
30
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
31 if os.name == 'nt':
32 env = Environment(
33 ENV={'PATH': os.environ['PATH']},
34 LIBS=['re2', 'pthread', 'ws2_32'],
ea5a1ad @tokuhirom use system icu. Bytes#decode
authored Apr 4, 2012
35 LIBPATH=['./'],
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
36 CXXFLAGS=['-std=c++0x'],
f7ac56a @tokuhirom Merge branch 'master' of github.com:tokuhirom/tora
authored Apr 2, 2012
37 CCFLAGS=['-Wall', '-Wno-sign-compare', '-I' + os.getcwd() + '/vendor/boost_1_49_0/', '-I' + os.getcwd() + '/vendor/re2/', '-I' + os.getcwd() + "/tora/", '-march=native', '-g',
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
38 # '-DPERLISH_CLOSURE'
39 ],
40 PREFIX=GetOption('prefix'),
41 tools=tools
42 )
43 re2_env = Environment(
44 ENV={'PATH': os.environ['PATH']},
45 CCFLAGS=['-Wno-sign-compare', '-O2', '-I./vendor/re2/'],
46 LIBS=['pthread'],
47 tools=tools
48 )
69ea042 @mattn for windows, icu-config makes dependency fo msys. so add manually.
mattn authored Apr 5, 2012
49 env.MergeFlags([
50 '-licuuc48 -licudt48'
51 ])
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
52 else:
53 env = Environment(
3144254 @tokuhirom better link flags
authored Jul 14, 2012
54 LIBS=['re2', 'pthread', 'dl', 'icudata', 'icuuc', 'boost_program_options'],
2920368 @tokuhirom remove icu from repo..
authored Apr 9, 2012
55 LIBPATH=['./'],
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
56 CXXFLAGS=['-std=c++0x'],
bf77886 @tokuhirom use CPPPATH for portability
authored Apr 10, 2012
57 CPPPATH=[os.path.abspath(x) for x in ['vendor/boost_1_49_0/', 'vendor/re2/', 'tora/']],
58 CCFLAGS=[
59 '-Wall',
60 '-Wno-sign-compare',
61 '-fstack-protector',
62 '-g',
0b81c8e @tokuhirom - disable object pool by default
authored Apr 10, 2012
63 '-fPIC',
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
64 # '-DPERLISH_CLOSURE'
c32df29 @tokuhirom remove -march=native flags.
authored Apr 9, 2012
65 # '-march=native',
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
66 ],
67 PREFIX=GetOption('prefix'),
68 tools=tools
69 )
70 re2_env = Environment(
bf77886 @tokuhirom use CPPPATH for portability
authored Apr 9, 2012
71 CCFLAGS=[
72 '-pthread',
73 '-Wno-sign-compare',
74 '-O2',
75 '-I./vendor/re2/',
76 '-fPIC'
77 ],
78 CPPPATH=['vendor/re2/'],
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
79 LIBS=['pthread'],
80 tools=tools
81 )
8c02f84 @tokuhirom workaround for icu-config
authored Apr 9, 2012
82 icu_config = 'icu-config'
83 if os.uname()[0] == 'Darwin':
0a0ce5c @tokuhirom oops
authored Apr 9, 2012
84 # workaround for homebrew's issue.
85 # see https://github.com/mxcl/homebrew/issues/issue/167
86 files = Glob('/usr/local/Cellar/icu4c/*/bin/icu-config')
87 if len(files) > 0:
88 icu_config = files[-1]
2920368 @tokuhirom remove icu from repo..
authored Apr 9, 2012
89 env.MergeFlags([
8c02f84 @tokuhirom workaround for icu-config
authored Apr 9, 2012
90 '!%s --cppflags --ldflags' % (icu_config)
2920368 @tokuhirom remove icu from repo..
authored Apr 9, 2012
91 ])
69ea042 @mattn for windows, icu-config makes dependency fo msys. so add manually.
mattn authored Apr 5, 2012
92
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
93 env.Append(TORA_LIBPREFIX=env.get('PREFIX') + "/lib/tora-" + TORA_VERSION_STR + "/")
6f08135 @tokuhirom fast building
authored Feb 28, 2012
94
6a42c86 @tokuhirom portability
authored Apr 10, 2012
95 exe_suffix = env.get('PROGSUFFIX')
96 ext_suffix = env.get('SHLIBSUFFIX')
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
97 lemon = os.name == 'nt' and '.\\tools\\lemon\\lemon.exe' or './tools/lemon/lemon'
98
99 if os.name == 'nt':
100 #re2_env.Replace(CXX='g++')
101 #env.Replace(CXX='g++')
03902b3 @mattn deliver $PATH into sub SConstructs.
mattn authored Apr 6, 2012
102 #env.Append(
103 # LINKFLAGS=['-Wl,-E'],
104 #)
105 pass
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
106 elif os.uname()[0]=='Darwin':
6f08135 @tokuhirom fast building
authored Feb 27, 2012
107 re2_env.Replace(CXX='clang++', CC='clang')
108 env.Replace(CXX='clang++', CC='clang')
cc8ad7e @tokuhirom warnings clean
authored Feb 8, 2012
109 # env.Append(CXXFLAGS=['-Werror'])
31838d9 @tokuhirom port to osx
authored Mar 14, 2012
110 env.Append(
c103ce1 @tokuhirom include icu to repository for portability.
authored Apr 9, 2012
111 CCFLAGS=['-Wno-unused-function', '-DBOOST_NO_CHAR16_T', '-DBOOST_NO_CHAR32_T',
a64ab22 @tokuhirom - fucking more portable SConstruct script for fucking osx
authored Apr 9, 2012
112 '-arch', 'x86_64',
c103ce1 @tokuhirom include icu to repository for portability.
authored Apr 9, 2012
113 ],
31838d9 @tokuhirom port to osx
authored Mar 14, 2012
114 CXXFLAGS=['-Wno-unneeded-internal-declaration'],
115 )
c8e0923 @tokuhirom osx support
authored Feb 8, 2012
116 else:
6f08135 @tokuhirom fast building
authored Feb 27, 2012
117 re2_env.Replace(CXX='g++')
118 env.Replace(CXX='g++')
31838d9 @tokuhirom port to osx
authored Mar 14, 2012
119 env.Append(
b7092d2 @tokuhirom uv
authored Mar 14, 2012
120 LINKFLAGS=['-Wl,-E', '-Wl,-Bsymbolic', '-rdynamic'],
31838d9 @tokuhirom port to osx
authored Mar 14, 2012
121 )
7974422 @tokuhirom use scons
authored Jan 31, 2012
122
e7b1e70 @tokuhirom - // comment is obsoleted.
authored Mar 20, 2012
123 if ARGUMENTS.get('glog', 0):
124 env.Append(LIBS=['glog'], CCFLAGS=['-DENABLE_GLOG'])
125
0058781 @tokuhirom refactoring
authored Feb 7, 2012
126 if ARGUMENTS.get('profile', 0):
8c85056 @tokuhirom optimized
authored Feb 28, 2012
127 env.Append(CXXFLAGS=['-pg', '-Dprofile'])
0058781 @tokuhirom refactoring
authored Feb 7, 2012
128 env.Append(LINKFLAGS=['-pg'])
129
c26d11d @tokuhirom use debug=1 instead of ndebug=0
authored Apr 10, 2012
130 if ARGUMENTS.get('debug', 0):
131 env.Append(CCFLAGS=['-O0'])
132 else:
93eae3e @tokuhirom -DNDEBUG support
authored Feb 22, 2012
133 env.Append(CCFLAGS=['-DNDEBUG'])
925949a @tokuhirom require!
authored Feb 23, 2012
134 env.Append(CCFLAGS=['-O2'])
b5a1cae @tokuhirom test target
authored Jan 30, 2012
135
df158e1 @tokuhirom import re2
authored Feb 8, 2012
136 re2files = [
137 Glob('vendor/re2/re2/*.cc'),
138 'vendor/re2/util/rune.cc',
139 'vendor/re2/util/valgrind.cc',
140 'vendor/re2/util/stringprintf.cc',
141 'vendor/re2/util/strutil.cc',
142 'vendor/re2/util/hash.cc',
143 'vendor/re2/util/stringpiece.cc',
144 ]
91effe6 @tokuhirom added test cases for lexer in c++.
authored Feb 20, 2012
145 libfiles = [
c190655 @tokuhirom - better string literal
authored Mar 20, 2012
146 "tora/" + x for x in Split('''
8e9561c @tokuhirom new style object.
authored Mar 10, 2012
147 parser.cc value.cc compiler.cc
148 node.cc op.cc vm.cc util.cc
e5f7275 @tokuhirom It's new style namespace. Class is first class object.
authored Apr 7, 2012
149 symbol_table.cc frame.cc operator.cc
00d0f5e @tokuhirom split builtin functions
authored Mar 5, 2012
150 builtin.cc
eb38f04 @tokuhirom better closure impl!
authored Mar 23, 2012
151 object.cc pad_list.cc
b9b77c7 @tokuhirom sprintf, printf
authored Apr 1, 2012
152 printf.cc
8e9561c @tokuhirom new style object.
authored Mar 9, 2012
153
6da2e9e @tokuhirom DESTROY in pure tora is works.
authored Mar 13, 2012
154 ops.gen.cc token.gen.cc lexer.gen.cc vm.gen.cc nodes.gen.cc symbols.gen.cc
8e9561c @tokuhirom new style object.
authored Mar 9, 2012
155
156 inspector.cc peek.cc disasm.cc
157
158 value/code.cc value/hash.cc value/str.cc value/array.cc value/regexp.cc value/range.cc
4385b5a @tokuhirom refactoring
authored Mar 9, 2012
159 value/object.cc value/int.cc value/bool.cc value/exception.cc
e5f7275 @tokuhirom It's new style namespace. Class is first class object.
authored Apr 6, 2012
160 value/bytes.cc value/class.cc
8e9561c @tokuhirom new style object.
authored Mar 9, 2012
161
e80af5c @tokuhirom fixed for linux
authored Apr 2, 2012
162 object/str.cc object/array.cc object/dir.cc object/stat.cc object/env.cc object/time.cc object/file.cc object/internals.cc object/caller.cc object/code.cc object/symbol.cc
e5f7275 @tokuhirom It's new style namespace. Class is first class object.
authored Apr 6, 2012
163 object/dynaloader.cc object/object.cc object/class.cc
06a3f7e @tokuhirom hash methods.
authored Mar 29, 2012
164 object/bytes.cc object/regexp.cc object/hash.cc
05c5abf @tokuhirom added matched object
authored Mar 24, 2012
165 object/re2_regexp_matched.cc
e5f7275 @tokuhirom It's new style namespace. Class is first class object.
authored Apr 6, 2012
166 object/int.cc object/double.cc
21d42f6 @tokuhirom no more global namespace. you can use python-ish class namespace.
authored Apr 7, 2012
167 object/metaclass.cc object/file_package.cc
8e9561c @tokuhirom new style object.
authored Mar 9, 2012
168
6257d7d @tokuhirom refactoring
authored Feb 26, 2012
169 ''')
91effe6 @tokuhirom added test cases for lexer in c++.
authored Feb 20, 2012
170 ]
df158e1 @tokuhirom import re2
authored Feb 7, 2012
171
91effe6 @tokuhirom added test cases for lexer in c++.
authored Feb 20, 2012
172 ########
173 # tests.
c7ba36f @tokuhirom better numeric addition
authored Feb 28, 2012
174
bc66096 @mattn fix installation for windows.
mattn authored Apr 3, 2012
175 programs = ['bin/tora' + exe_suffix]
c7ba36f @tokuhirom better numeric addition
authored Feb 27, 2012
176 for src in glob("tests/test_*.cc"):
198f255 @mattn add TORA_OS.
mattn authored Apr 10, 2012
177 programs.append(env.NoClean(env.Program(src.rstrip(".cc") + '.t' + exe_suffix, [
c7ba36f @tokuhirom better numeric addition
authored Feb 27, 2012
178 libfiles,
179 src,
198f255 @mattn add TORA_OS.
mattn authored Apr 10, 2012
180 ])))
c7ba36f @tokuhirom better numeric addition
authored Feb 27, 2012
181
5e56ded @mattn fix test proving on windows.
mattn authored Apr 10, 2012
182 sep = os.name == 'nt' and ';' or ':'
183 prove_prefix = 'PERL5LIB=' + os.path.abspath('util/') + sep + os.path.abspath('util/Test-Simple-0.98/lib/') + '$PERL5LIB '
12e5a4d @yappo use including prove for ext libs
yappo authored Apr 10, 2012
184 prove_path = 'perl -I ' + os.path.abspath('util/Test-Harness-3.23/lib/') + ' ' + os.path.abspath('util/Test-Harness-3.23/bin/prove')
185 try:
186 os.stat('/Users/tokuhirom/perl5/perlbrew/perls/perl-5.15.3/bin/prove') # throws exception if not exists
187 prove_path = '/Users/tokuhirom/perl5/perlbrew/perls/perl-5.15.3/bin/prove'
188 except: pass
189 try:
190 os.stat('/Users/tokuhirom/perl5/perlbrew/perls/perl-5.15.2/bin/prove')
191 prove_path = '/Users/tokuhirom/perl5/perlbrew/perls/perl-5.15.2/bin/prove'
192 except: pass
5e56ded @mattn fix test proving on windows.
mattn authored Apr 10, 2012
193 if os.name == 'nt':
194 prove_prefix = prove_prefix.replace('\\', '/')
195 prove_command = "cmd /c set %s ^&^& %s" % (prove_prefix, prove_path)
196 else:
197 prove_command = prove_prefix + ' ' + prove_path
c65737d @tokuhirom do not run test script in default target
authored Feb 2, 2012
198 if 'test' in COMMAND_LINE_TARGETS:
e352ca3 @tokuhirom new style test cases
authored Apr 17, 2012
199 env.Command('test', programs, prove_command + ' --source TCC --source Tora --source Executable -r tests/ t/tra/*.tra t/tra/*/*.tra t/spec/*/*.tcc --source Perl t')
91effe6 @tokuhirom added test cases for lexer in c++.
authored Feb 20, 2012
200
bc66096 @mattn fix installation for windows.
mattn authored Apr 3, 2012
201 env.Command('test.valgrind', ['bin/tora' + exe_suffix], 'perl misc/valgrind.pl');
78b462a @tokuhirom optimize to_s
authored Mar 6, 2012
202
35d0384 @tokuhirom cache find package
authored Mar 5, 2012
203 if 'bench' in COMMAND_LINE_TARGETS:
71d00e5 @tokuhirom better directory structure
authored Mar 20, 2012
204 env.Command('bench', [], 'git log --oneline | head -1 && scons ndebug=1 test && ./bin/tora -V && time ./bin/tora benchmark/fib/fib.tra 39')
35d0384 @tokuhirom cache find package
authored Mar 4, 2012
205
e760ff0 @tokuhirom optimized
authored Mar 5, 2012
206 if 'op' in COMMAND_LINE_TARGETS:
71d00e5 @tokuhirom better directory structure
authored Mar 20, 2012
207 env.Command('op', [], 'git log --oneline | head -1 && scons && ./bin/tora -V ; sudo opcontrol --reset; sudo opcontrol --start && time ./bin/tora benchmark/fib/fib.tra 39 ; sudo opcontrol --stop')
e760ff0 @tokuhirom optimized
authored Mar 4, 2012
208
b619eec @tokuhirom path fix for docgen
authored Apr 10, 2012
209 env.Command('docs', ['bin/tora' + exe_suffix, Glob("tora/object/*.cc"), Glob("docs/source/*")], './bin/tora -I vendor/Path/lib/ util/docgen.tra && cd docs/ && make html')
15f2038 @tokuhirom docs
authored Apr 1, 2012
210
91effe6 @tokuhirom added test cases for lexer in c++.
authored Feb 20, 2012
211 ########
212 # main programs
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
213
c103ce1 @tokuhirom include icu to repository for portability.
authored Apr 9, 2012
214 env.Command(['tora/nodes.gen.h', 'tora/nodes.gen.cc'], 'tora/nodes.gen.pl', 'perl tora/nodes.gen.pl > tora/nodes.gen.h')
215 env.Command(['tora/token.gen.cc', 'tora/token.gen.h'], ['tora/token.gen.pl', 'tora/parser.h'], 'perl tora/token.gen.pl')
216 env.Command(['tora/lexer.gen.cc'], 'tora/lexer.re', 're2c tora/lexer.re > tora/lexer.gen.cc')
217 env.Command(['tora/vm.gen.cc', 'tora/ops.gen.h', 'tora/ops.gen.cc'], ['tora/vm.gen.pl', 'vm.inc'], 'perl -I misc/Text-MicroTemplate/ tora/vm.gen.pl')
218 env.Command(['tora/symbols.gen.cc', 'tora/symbols.gen.h'], ['tora/symbols.gen.pl'], 'perl -I misc/Text-MicroTemplate/ tora/symbols.gen.pl')
219 t = env.Command(['tora/parser.h', 'tora/parser.cc'], [lemon, 'tora/parser.yy', 'tora/lempar.c'], lemon + ' tora/parser.yy')
c190655 @tokuhirom - better string literal
authored Mar 20, 2012
220 Clean(t, 'tora/parser.out')
6f08135 @tokuhirom fast building
authored Feb 27, 2012
221
f64fa1e @tokuhirom better to_double
authored Mar 7, 2012
222 libre2 = re2_env.Library('re2', re2files)
049728b @tokuhirom config
authored Mar 22, 2012
223
224 TORA_PREFIX = env.get('PREFIX')
225 TORA_CC = env.get('CC')
226 TORA_CXX = env.get('CXX')
da0fa72 @mattn ready to make libtora.a
mattn authored Apr 2, 2012
227 TORA_CCFLAGS = ' '.join(env.get('CCFLAGS')).replace("\\", "/")
228 TORA_CXXFLAGS = ' '.join(env.get('CXXFLAGS')).replace("\\", "/")
b2ab0f7 @tokuhirom comment
authored Apr 10, 2012
229
230 # TORA_OS would compatible with Perl5.
9cc6c71 @tokuhirom fix TORA_OS for osx/linux systems.
authored Apr 10, 2012
231 if os.name == 'nt':
ebb876e @mattn OS name like per5.
mattn authored Apr 10, 2012
232 TORA_OS = 'MSWin32'
9cc6c71 @tokuhirom fix TORA_OS for osx/linux systems.
authored Apr 10, 2012
233 elif os.uname()[0] == 'Darwin':
234 TORA_OS = 'darwin'
3a6be33 @tokuhirom oops. os.uname()[0] on linux is 'Linux'
authored Apr 11, 2012
235 elif os.uname()[0] == 'Linux':
9cc6c71 @tokuhirom fix TORA_OS for osx/linux systems.
authored Apr 10, 2012
236 TORA_OS = 'linux'
237 else:
3a6be33 @tokuhirom oops. os.uname()[0] on linux is 'Linux'
authored Apr 10, 2012
238 exit("Oops. unknown operating system: %s,%s." % (os.name, os.uname()[0]))
9cc6c71 @tokuhirom fix TORA_OS for osx/linux systems.
authored Apr 10, 2012
239
f64fa1e @tokuhirom better to_double
authored Mar 7, 2012
240 # config.h
c190655 @tokuhirom - better string literal
authored Mar 20, 2012
241 with open('tora/config.h', 'w') as f:
0e1d2c0 @tokuhirom optimized
authored Mar 2, 2012
242 f.write("#pragma once\n")
cad2c35 @tokuhirom put more vars to config.h
authored Apr 2, 2012
243 f.write('#define TORA_CC "' + TORA_CC + "\"\n")
244 f.write('#define TORA_CXX "' + TORA_CXX + "\"\n")
049728b @tokuhirom config
authored Mar 22, 2012
245 f.write('#define TORA_CCFLAGS "' + TORA_CCFLAGS + "\"\n")
246 f.write('#define TORA_PREFIX "' + TORA_PREFIX + "\"\n")
2090bf9 @tokuhirom installable tora
authored Mar 20, 2012
247 f.write('#define TORA_VERSION_STR "' + TORA_VERSION_STR + "\"\n")
b7092d2 @tokuhirom uv
authored Mar 14, 2012
248
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
249 with open('config.json', 'w') as f:
667e05e @tokuhirom - libtora is not required on non nt env
authored Apr 10, 2012
250 libs = env.get('LIBS')
f5de0aa @mattn fix order of linking libraries.
mattn authored Apr 10, 2012
251 libs = ['tora'] + libs
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
252 f.write(json.dumps({
03902b3 @mattn deliver $PATH into sub SConstructs.
mattn authored Apr 6, 2012
253 'PATH': os.environ['PATH'],
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
254 'CC': TORA_CC,
255 'CXX': TORA_CXX,
256 'CCFLAGS': env.get('CCFLAGS'),
4affe2d @mattn fix build.
mattn authored Apr 6, 2012
257 'CPPPATH': env.get('CPPPATH') or [],
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
258 'CXXFLAGS': env.get('CXXFLAGS'),
259 'PREFIX': env.get('PREFIX'),
667e05e @tokuhirom - libtora is not required on non nt env
authored Apr 9, 2012
260 'LIBS': libs,
da0fa72 @mattn ready to make libtora.a
mattn authored Apr 2, 2012
261 'TOOLS': tools,
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
262 'SHLIBPREFIX': '',
263 'LINKFLAGS': ['' + x for x in env.get('LINKFLAGS')[1:]],
264 'TORA_VERSION_STR': TORA_VERSION_STR,
265 'TORA_LIBPREFIX': env.get('PREFIX') + "/lib/tora-" + TORA_VERSION_STR + "/",
da0fa72 @mattn ready to make libtora.a
mattn authored Apr 2, 2012
266 'TORA_EXESUFFIX': exe_suffix,
267 'TORA_EXTSUFFIX': ext_suffix,
12e5a4d @yappo use including prove for ext libs
yappo authored Apr 10, 2012
268 'TORA_PROVE': prove_command,
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
269 }))
270
049728b @tokuhirom config
authored Mar 22, 2012
271 with open('lib/Config.tra', 'w') as f:
272 f.write("my $Config = {\n")
1f1f8bd @tokuhirom export SHLIBSUFFIX to XSLoader.
authored Apr 5, 2012
273 f.write(" SHLIBSUFFIX => '" + env.get("SHLIBSUFFIX") + "',\n")
049728b @tokuhirom config
authored Mar 22, 2012
274 f.write(" TORA_PREFIX => '" + TORA_PREFIX + "',\n")
275 f.write(" TORA_CC => '" + TORA_CC + "',\n")
198f255 @mattn add TORA_OS.
mattn authored Apr 10, 2012
276 f.write(" TORA_OS => '" + TORA_OS + "',\n")
049728b @tokuhirom config
authored Mar 22, 2012
277 f.write(" TORA_CXX => '" + TORA_CXX + "',\n")
278 f.write(" TORA_CCFLAGS => '" + TORA_CCFLAGS + "',\n")
279 f.write(" TORA_CXXFLAGS => '" + TORA_CXXFLAGS + "',\n")
280 f.write(" TORA_VERSION_STR => '" + TORA_VERSION_STR + "',\n")
281 f.write("};\n")
282 f.write("sub tora_config() {\n")
283 f.write(" $Config;\n")
284 f.write("}\n")
285
c103ce1 @tokuhirom include icu to repository for portability.
authored Apr 9, 2012
286 def build_tora():
0b81c8e @tokuhirom - disable object pool by default
authored Apr 10, 2012
287 libtora = env.Library('tora', [
288 libfiles,
289 libre2,
290 ])
c103ce1 @tokuhirom include icu to repository for portability.
authored Apr 9, 2012
291 if os.name == 'nt':
292 tora = env.Program('bin/tora' + exe_suffix, [
293 ['tora/main.cc'],
294 libtora,
295 libre2
296 ])
297 Default(tora)
298 return tora
299 else:
300 tora = env.Program('bin/tora' + exe_suffix, [
301 ['tora/main.cc'],
0b81c8e @tokuhirom - disable object pool by default
authored Apr 10, 2012
302 libtora,
c103ce1 @tokuhirom include icu to repository for portability.
authored Apr 9, 2012
303 libre2
304 ])
305 Default(tora)
306 return tora
307
308 tora = build_tora()
6f08135 @tokuhirom fast building
authored Feb 27, 2012
309
310 # lemon
311 lemon_env = Environment()
312 lemon_env.Append(CCFLAGS=['-O2'])
c252421 @mattn win32 porting.
mattn authored Apr 2, 2012
313 lemon_env.Program(lemon, ['tools/lemon/lemon.c']);
6f08135 @tokuhirom fast building
authored Feb 27, 2012
314
a0830e4 @tokuhirom test.ext
authored Apr 3, 2012
315 # ----------------------------------------------------------------------
316 # test extensions
51b4f63 @tokuhirom fix fucking build issue
authored Apr 10, 2012
317
a0830e4 @tokuhirom test.ext
authored Apr 3, 2012
318 def test_exts():
319 exts = []
b317036 @tokuhirom build fcntl on posix systems only.
authored Apr 10, 2012
320 src = []
321 if os.name == 'posix':
322 src += ['Fcntl']
323 src += Split('JSON Digest-MD5 Socket Path URI-Escape UV Curl')
51b4f63 @tokuhirom fix fucking build issue
authored Apr 9, 2012
324 src += Split('HTTP IRC') # depends on Socket
325 for ext in src:
1d9e87d @tokuhirom fixed extension deps.
authored Apr 10, 2012
326 exts += [env.Command(['ext/%s/_tested' % ext], [tora]+exts+Glob('ext/' + ext + '/*'), 'cd ext/%s/ && scons test' % ext)]
a0830e4 @tokuhirom test.ext
authored Apr 3, 2012
327 env.Command('test.ext', exts, 'echo ok')
328 test_exts()
c138568 @tokuhirom all extension modules are installbale.
authored Apr 2, 2012
329
330 # ----------------------------------------------------------------------
6f08135 @tokuhirom fast building
authored Feb 27, 2012
331 # instalation
26bc876 @tokuhirom do not run installer without 'install' as target.
authored Apr 10, 2012
332
333 if 'install' in COMMAND_LINE_TARGETS:
334 installs = []
335 installs += [env.Install(env['PREFIX']+'/bin/', source=[tora])];
336 exts = []
337 for ext in os.listdir('ext'):
338 exts += [env.Command(['ext/%s/_installed' % ext], Glob('ext/' + ext + "/*"), "cd ext/" + ext + " && scons install")]
b3019ed fixed lib/* dose'nt install
Kazuhiro Osawa authored Apr 12, 2012
339 libs = []
26bc876 @tokuhirom do not run installer without 'install' as target.
authored Apr 10, 2012
340 env.Alias('install', [
b3019ed fixed lib/* dose'nt install
Kazuhiro Osawa authored Apr 12, 2012
341 env.InstallAs(env['PREFIX']+'/lib/tora-'+TORA_VERSION_STR, 'lib/'),
26bc876 @tokuhirom do not run installer without 'install' as target.
authored Apr 10, 2012
342 exts,
343 env['PREFIX']+'/bin/',
344 installs
345 ])
dc2f408 @tokuhirom added new $ARGV global variable
authored Feb 12, 2012
346
Something went wrong with that request. Please try again.