Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 952 lines (795 sloc) 33.859 kB
97c9745 @ry Back to WAF
ry authored
1 #!/usr/bin/env python
55048cd @ry Update copyright headers
ry authored
2
3 # Copyright Joyent, Inc. and other Node contributors.
4 #
5 # Permission is hereby granted, free of charge, to any person obtaining a
6 # copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to permit
10 # persons to whom the Software is furnished to do so, subject to the
11 # following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
19 # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
21 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
22 # USE OR OTHER DEALINGS IN THE SOFTWARE.
23
97c9745 @ry Back to WAF
ry authored
24 import re
25 import Options
068b733 @ry Land Cantrill's DTrace patch
ry authored
26 import sys, os, shutil, glob
27 import Utils
97c9745 @ry Back to WAF
ry authored
28 from Utils import cmd_output
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
29 from os.path import join, dirname, abspath, normpath
97c9745 @ry Back to WAF
ry authored
30 from logging import fatal
31
32 cwd = os.getcwd()
33 APPNAME="node.js"
34
a326eeb @ry Put tools/ into PYTHON_PATH
ry authored
35 # Use the directory that this file is found in to find the tools
36 # directory where the js2c.py file can be found.
37 sys.path.append(sys.argv[0] + '/tools');
97c9745 @ry Back to WAF
ry authored
38 import js2c
39
40 srcdir = '.'
41 blddir = 'build'
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
42 supported_archs = ('arm', 'ia32', 'x64') # 'mips' supported by v8, but not node
97c9745 @ry Back to WAF
ry authored
43
44 jobs=1
45 if os.environ.has_key('JOBS'):
46 jobs = int(os.environ['JOBS'])
47
6f08fdb @piscisaureus Backslashes in paths wreak havoc
piscisaureus authored
48 def safe_path(path):
49 return path.replace("\\", "/")
97c9745 @ry Back to WAF
ry authored
50
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
51 def canonical_cpu_type(arch):
25eecd1 @ry Fix configure on x86
ry authored
52 m = {'x86': 'ia32', 'i386':'ia32', 'x86_64':'x64', 'amd64':'x64'}
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
53 if arch in m: arch = m[arch]
54 if not arch in supported_archs:
55 raise Exception("supported architectures are "+', '.join(supported_archs)+\
56 " but NOT '" + arch + "'.")
57 return arch
58
97c9745 @ry Back to WAF
ry authored
59 def set_options(opt):
60 # the gcc module provides a --debug-level option
61 opt.tool_options('compiler_cxx')
62 opt.tool_options('compiler_cc')
63 opt.tool_options('misc')
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
64 opt.add_option( '--libdir'
65 , action='store'
66 , type='string'
67 , default=False
68 , help='Install into this libdir [Default: ${PREFIX}/lib]'
69 )
97c9745 @ry Back to WAF
ry authored
70 opt.add_option( '--debug'
71 , action='store_true'
72 , default=False
73 , help='Build debug variant [Default: False]'
74 , dest='debug'
75 )
5d80bdb @bnoordhuis Add --profile flag to configure script, enables gprof profiling.
bnoordhuis authored
76 opt.add_option( '--profile'
77 , action='store_true'
78 , default=False
79 , help='Enable profiling [Default: False]'
80 , dest='profile'
81 )
97c9745 @ry Back to WAF
ry authored
82 opt.add_option( '--efence'
83 , action='store_true'
84 , default=False
85 , help='Build with -lefence for debugging [Default: False]'
86 , dest='efence'
87 )
88
89 opt.add_option( '--without-snapshot'
90 , action='store_true'
91 , default=False
92 , help='Build without snapshotting V8 libraries. You might want to set this for cross-compiling. [Default: False]'
93 , dest='without_snapshot'
94 )
95
96 opt.add_option( '--without-ssl'
97 , action='store_true'
98 , default=False
99 , help='Build without SSL'
100 , dest='without_ssl'
101 )
102
103
104 opt.add_option('--shared-v8'
105 , action='store_true'
106 , default=False
107 , help='Link to a shared V8 DLL instead of static linking'
108 , dest='shared_v8'
109 )
110
111 opt.add_option( '--shared-v8-includes'
112 , action='store'
113 , default=False
114 , help='Directory containing V8 header files'
115 , dest='shared_v8_includes'
116 )
117
118 opt.add_option( '--shared-v8-libpath'
119 , action='store'
120 , default=False
121 , help='A directory to search for the shared V8 DLL'
122 , dest='shared_v8_libpath'
123 )
124
125 opt.add_option( '--shared-v8-libname'
126 , action='store'
127 , default=False
128 , help="Alternative lib name to link to (default: 'v8')"
129 , dest='shared_v8_libname'
130 )
131
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
132 opt.add_option( '--openssl-includes'
133 , action='store'
134 , default=False
135 , help='A directory to search for the OpenSSL includes'
136 , dest='openssl_includes'
137 )
138
139 opt.add_option( '--openssl-libpath'
140 , action='store'
141 , default=False
142 , help="A directory to search for the OpenSSL libraries"
143 , dest='openssl_libpath'
144 )
145
f23c45f @kapouer Option to disable SSL v2
kapouer authored
146 opt.add_option( '--no-ssl2'
147 , action='store_true'
148 , default=False
149 , help="Disable OpenSSL v2"
150 , dest='openssl_nov2'
151 )
152
86e6870 @ry waf: display oprofile and gdbjit options for all platforms
ry authored
153 opt.add_option( '--gdb'
154 , action='store_true'
155 , default=False
156 , help="add gdb support"
157 , dest='use_gdbjit'
158 )
33685fe @ry Add configure flag for oprofile
ry authored
159
97c9745 @ry Back to WAF
ry authored
160
161 opt.add_option('--shared-cares'
162 , action='store_true'
163 , default=False
164 , help='Link to a shared C-Ares DLL instead of static linking'
165 , dest='shared_cares'
166 )
167
168 opt.add_option( '--shared-cares-includes'
169 , action='store'
170 , default=False
171 , help='Directory containing C-Ares header files'
172 , dest='shared_cares_includes'
173 )
174
175 opt.add_option( '--shared-cares-libpath'
176 , action='store'
177 , default=False
178 , help='A directory to search for the shared C-Ares DLL'
179 , dest='shared_cares_libpath'
180 )
181
182
183 opt.add_option('--shared-libev'
184 , action='store_true'
185 , default=False
186 , help='Link to a shared libev DLL instead of static linking'
187 , dest='shared_libev'
188 )
189
190 opt.add_option( '--shared-libev-includes'
191 , action='store'
192 , default=False
193 , help='Directory containing libev header files'
194 , dest='shared_libev_includes'
195 )
196
197 opt.add_option( '--shared-libev-libpath'
198 , action='store'
199 , default=False
200 , help='A directory to search for the shared libev DLL'
201 , dest='shared_libev_libpath'
202 )
203
068b733 @ry Land Cantrill's DTrace patch
ry authored
204 opt.add_option( '--with-dtrace'
205 , action='store_true'
206 , default=False
207 , help='Build with DTrace (experimental)'
208 , dest='dtrace'
209 )
210
97c9745 @ry Back to WAF
ry authored
211
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
212 opt.add_option( '--product-type'
213 , action='store'
214 , default='program'
215 , help='What kind of product to produce (program, cstaticlib '\
216 'or cshlib) [default: %default]'
217 , dest='product_type'
218 )
219
220 opt.add_option( '--dest-cpu'
221 , action='store'
222 , default=None
223 , help='CPU architecture to build for. Valid values are: '+\
224 ', '.join(supported_archs)
225 , dest='dest_cpu'
226 )
227
228
97c9745 @ry Back to WAF
ry authored
229
230
231 def configure(conf):
232 conf.check_tool('compiler_cxx')
233 if not conf.env.CXX: conf.fatal('c++ compiler not found')
234 conf.check_tool('compiler_cc')
235 if not conf.env.CC: conf.fatal('c compiler not found')
236
237 o = Options.options
238
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
239 if o.libdir:
240 conf.env['LIBDIR'] = o.libdir
241 else:
242 conf.env['LIBDIR'] = conf.env['PREFIX'] + '/lib'
243
97c9745 @ry Back to WAF
ry authored
244 conf.env["USE_DEBUG"] = o.debug
583f2e5 @piscisaureus Follow-up fix for v8 cygwin build
piscisaureus authored
245 # Snapshot building does noet seem to work on cygwin and mingw32
a293f90 @piscisaureus Improve V8 support for Cygwin
piscisaureus authored
246 conf.env["SNAPSHOT_V8"] = not o.without_snapshot and not sys.platform.startswith("win32")
c9d3a81 @ry Patch V8 to compile on solaris
ry authored
247 if sys.platform.startswith("sunos"):
248 conf.env["SNAPSHOT_V8"] = False
5d80bdb @bnoordhuis Add --profile flag to configure script, enables gprof profiling.
bnoordhuis authored
249 conf.env["USE_PROFILING"] = o.profile
97c9745 @ry Back to WAF
ry authored
250
251 conf.env["USE_SHARED_V8"] = o.shared_v8 or o.shared_v8_includes or o.shared_v8_libpath or o.shared_v8_libname
252 conf.env["USE_SHARED_CARES"] = o.shared_cares or o.shared_cares_includes or o.shared_cares_libpath
253 conf.env["USE_SHARED_LIBEV"] = o.shared_libev or o.shared_libev_includes or o.shared_libev_libpath
254
ae30af4 @ry Disable gdbjit by default
ry authored
255 conf.env["USE_GDBJIT"] = o.use_gdbjit
33685fe @ry Add configure flag for oprofile
ry authored
256
97c9745 @ry Back to WAF
ry authored
257 conf.check(lib='dl', uselib_store='DL')
d56e1a3 @piscisaureus No -rdynamic and -pthread flags when building with mingw
piscisaureus authored
258 if not sys.platform.startswith("sunos") and not sys.platform.startswith("cygwin") and not sys.platform.startswith("win32"):
97c9745 @ry Back to WAF
ry authored
259 conf.env.append_value("CCFLAGS", "-rdynamic")
260 conf.env.append_value("LINKFLAGS_DL", "-rdynamic")
261
d75c338 @mscdex Add more functionality to the os module
mscdex authored
262 if sys.platform.startswith("freebsd") or sys.platform.startswith("openbsd"):
97c9745 @ry Back to WAF
ry authored
263 conf.check(lib='kvm', uselib_store='KVM')
264
265 #if Options.options.debug:
266 # conf.check(lib='profiler', uselib_store='PROFILER')
267
068b733 @ry Land Cantrill's DTrace patch
ry authored
268 if Options.options.dtrace:
269 if not sys.platform.startswith("sunos"):
270 conf.fatal('DTrace support only currently available on Solaris')
271
272 conf.find_program('dtrace', var='DTRACE', mandatory=True)
273 conf.env["USE_DTRACE"] = True
274 conf.env.append_value("CXXFLAGS", "-DHAVE_DTRACE=1")
275
97c9745 @ry Back to WAF
ry authored
276 if Options.options.efence:
277 conf.check(lib='efence', libpath=['/usr/lib', '/usr/local/lib'], uselib_store='EFENCE')
278
279 if sys.platform.startswith("freebsd"):
280 if not conf.check(lib="execinfo",
281 includes=['/usr/include', '/usr/local/include'],
282 libpath=['/usr/lib', '/usr/local/lib'],
283 uselib_store="EXECINFO"):
284 conf.fatal("Install the libexecinfo port from /usr/ports/devel/libexecinfo.")
285
286 if not Options.options.without_ssl:
4a6f451 @deanm Don't override explicit openssl paths with pkg-config results.
deanm authored
287 # Don't override explicitly supplied openssl paths with pkg-config results.
288 explicit_openssl = o.openssl_includes or o.openssl_libpath
f23c45f @kapouer Option to disable SSL v2
kapouer authored
289
290 # Disable ssl v2 methods
291 if o.openssl_nov2:
292 conf.env.append_value("CPPFLAGS", "-DOPENSSL_NO_SSL2=1")
293
4a6f451 @deanm Don't override explicit openssl paths with pkg-config results.
deanm authored
294 if not explicit_openssl and conf.check_cfg(package='openssl',
295 args='--cflags --libs',
296 uselib_store='OPENSSL'):
97c9745 @ry Back to WAF
ry authored
297 Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
298 conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
299 else:
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
300 if o.openssl_libpath:
301 openssl_libpath = [o.openssl_libpath]
302 elif not sys.platform.startswith('win32'):
303 openssl_libpath = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib']
304 else:
305 openssl_libpath = [normpath(join(cwd, '../openssl'))]
306
307 if o.openssl_includes:
308 openssl_includes = [o.openssl_includes]
309 elif not sys.platform.startswith('win32'):
310 openssl_includes = [];
311 else:
312 openssl_includes = [normpath(join(cwd, '../openssl/include'))];
313
314 openssl_lib_names = ['ssl', 'crypto']
315 if sys.platform.startswith('win32'):
316 openssl_lib_names += ['ws2_32', 'gdi32']
317
318 libssl = conf.check_cc(lib=openssl_lib_names,
97c9745 @ry Back to WAF
ry authored
319 header_name='openssl/ssl.h',
320 function_name='SSL_library_init',
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
321 includes=openssl_includes,
322 libpath=openssl_libpath,
97c9745 @ry Back to WAF
ry authored
323 uselib_store='OPENSSL')
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
324
97c9745 @ry Back to WAF
ry authored
325 libcrypto = conf.check_cc(lib='crypto',
326 header_name='openssl/crypto.h',
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
327 includes=openssl_includes,
328 libpath=openssl_libpath,
97c9745 @ry Back to WAF
ry authored
329 uselib_store='OPENSSL')
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
330
97c9745 @ry Back to WAF
ry authored
331 if libcrypto and libssl:
332 conf.env["USE_OPENSSL"] = Options.options.use_openssl = True
333 conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
3ef6433 @piscisaureus MinGW: OpenSSL support
piscisaureus authored
334 elif sys.platform.startswith('win32'):
335 conf.fatal("Could not autodetect OpenSSL support. " +
336 "Use the --openssl-libpath and --openssl-includes options to set the search path. " +
337 "Use configure --without-ssl to disable this message.")
97c9745 @ry Back to WAF
ry authored
338 else:
339 conf.fatal("Could not autodetect OpenSSL support. " +
340 "Make sure OpenSSL development packages are installed. " +
341 "Use configure --without-ssl to disable this message.")
342 else:
343 Options.options.use_openssl = conf.env["USE_OPENSSL"] = False
344
a0e9a51 @ry Introduce require('tty')
ry authored
345 conf.check(lib='util', libpath=['/usr/lib', '/usr/local/lib'],
346 uselib_store='UTIL')
347
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
348 # normalize DEST_CPU from --dest-cpu, DEST_CPU or built-in value
349 if Options.options.dest_cpu and Options.options.dest_cpu:
350 conf.env['DEST_CPU'] = canonical_cpu_type(Options.options.dest_cpu)
351 elif 'DEST_CPU' in os.environ and os.environ['DEST_CPU']:
352 conf.env['DEST_CPU'] = canonical_cpu_type(os.environ['DEST_CPU'])
353 elif 'DEST_CPU' in conf.env and conf.env['DEST_CPU']:
354 conf.env['DEST_CPU'] = canonical_cpu_type(conf.env['DEST_CPU'])
355
97c9745 @ry Back to WAF
ry authored
356 conf.check(lib='rt', uselib_store='RT')
357
358 if sys.platform.startswith("sunos"):
359 if not conf.check(lib='socket', uselib_store="SOCKET"):
360 conf.fatal("Cannot find socket library")
361 if not conf.check(lib='nsl', uselib_store="NSL"):
362 conf.fatal("Cannot find nsl library")
90348a6 Add os.cpus() and os.uptime() support for sunos
Scott McWhirter authored
363 if not conf.check(lib='kstat', uselib_store="KSTAT"):
364 conf.fatal("Cannot find kstat library")
97c9745 @ry Back to WAF
ry authored
365
366 conf.sub_config('deps/libeio')
367
368 if conf.env['USE_SHARED_V8']:
369 v8_includes = [];
370 if o.shared_v8_includes: v8_includes.append(o.shared_v8_includes);
371
372 v8_libpath = [];
373 if o.shared_v8_libpath: v8_libpath.append(o.shared_v8_libpath);
374
375 if not o.shared_v8_libname: o.shared_v8_libname = 'v8'
376
377 if not conf.check_cxx(lib=o.shared_v8_libname, header_name='v8.h',
378 uselib_store='V8',
379 includes=v8_includes,
380 libpath=v8_libpath):
381 conf.fatal("Cannot find v8")
382
383 if o.debug:
384 if not conf.check_cxx(lib=o.shared_v8_libname + '_g', header_name='v8.h',
385 uselib_store='V8_G',
386 includes=v8_includes,
387 libpath=v8_libpath):
388 conf.fatal("Cannot find v8_g")
389
276b0b1 @piscisaureus Always use statically linked c-ares on windows; fix build
piscisaureus authored
390 if sys.platform.startswith("win32"):
391 # On win32 CARES is always static, so we can call internal functions like ares_inet_pton et al.
392 # CARES_STATICLIB must be defined or gcc will try to make DLL stub calls
393 conf.env.append_value('CPPFLAGS', '-DCARES_STATICLIB=1')
394 conf.sub_config('deps/c-ares')
395 elif conf.env['USE_SHARED_CARES']:
97c9745 @ry Back to WAF
ry authored
396 cares_includes = [];
397 if o.shared_cares_includes: cares_includes.append(o.shared_cares_includes);
398 cares_libpath = [];
399 if o.shared_cares_libpath: cares_libpath.append(o.shared_cares_libpath);
400 if not conf.check_cxx(lib='cares',
401 header_name='ares.h',
402 uselib_store='CARES',
403 includes=cares_includes,
404 libpath=cares_libpath):
405 conf.fatal("Cannot find c-ares")
406 else:
407 conf.sub_config('deps/c-ares')
408
409
410 if conf.env['USE_SHARED_LIBEV']:
411 libev_includes = [];
412 if o.shared_libev_includes: libev_includes.append(o.shared_libev_includes);
413 libev_libpath = [];
414 if o.shared_libev_libpath: libev_libpath.append(o.shared_libev_libpath);
415 if not conf.check_cxx(lib='ev', header_name='ev.h',
416 uselib_store='EV',
417 includes=libev_includes,
418 libpath=libev_libpath):
419 conf.fatal("Cannot find libev")
420 else:
421 conf.sub_config('deps/libev')
422
423
424
425 conf.define("HAVE_CONFIG_H", 1)
426
427 if sys.platform.startswith("sunos"):
1f4e0c0 @trentm build: fix gcc 4.7 sunos build
trentm authored
428 # In gcc 4.2 '-pthread' was added as an alias for '-pthreads'. We use
429 # '-pthreads' to not break older gcc versions.
430 threadflags='-pthreads'
431 conf.env.append_value ('CCFLAGS', threadflags)
432 conf.env.append_value ('CXXFLAGS', threadflags)
433 conf.env.append_value ('LINKFLAGS', threadflags)
d56e1a3 @piscisaureus No -rdynamic and -pthread flags when building with mingw
piscisaureus authored
434 elif not sys.platform.startswith("cygwin") and not sys.platform.startswith("win32"):
97c9745 @ry Back to WAF
ry authored
435 threadflags='-pthread'
436 conf.env.append_value ('CCFLAGS', threadflags)
437 conf.env.append_value ('CXXFLAGS', threadflags)
438 conf.env.append_value ('LINKFLAGS', threadflags)
439 if sys.platform.startswith("darwin"):
440 # used by platform_darwin_*.cc
441 conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
442 # cross compile for architecture specified by DEST_CPU
443 if 'DEST_CPU' in conf.env:
444 arch = conf.env['DEST_CPU']
445 # map supported_archs to GCC names:
446 arch_mappings = {'ia32': 'i386', 'x64': 'x86_64'}
447 if arch in arch_mappings:
448 arch = arch_mappings[arch]
449 flags = ['-arch', arch]
450 conf.env.append_value('CCFLAGS', flags)
451 conf.env.append_value('CXXFLAGS', flags)
452 conf.env.append_value('LINKFLAGS', flags)
453 if 'DEST_CPU' in conf.env:
454 arch = conf.env['DEST_CPU']
455 # TODO: -m32 is only available on 64 bit machines, so check host type
456 flags = None
457 if arch == 'ia32':
458 flags = '-m32'
459 if flags:
460 conf.env.append_value('CCFLAGS', flags)
461 conf.env.append_value('CXXFLAGS', flags)
462 conf.env.append_value('LINKFLAGS', flags)
97c9745 @ry Back to WAF
ry authored
463
464 # Needed for getaddrinfo in libeio
465 conf.env.append_value("CPPFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
466 # LFS
467 conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
468 conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
469 conf.env.append_value('CPPFLAGS', '-DEV_MULTIPLICITY=0')
470
2655269 @piscisaureus Make select work on >64 FDs on windows
piscisaureus authored
471 # Makes select on windows support more than 64 FDs
472 if sys.platform.startswith("win32"):
473 conf.env.append_value('CPPFLAGS', '-DFD_SETSIZE=1024');
474
97c9745 @ry Back to WAF
ry authored
475 ## needed for node_file.cc fdatasync
476 ## Strangely on OSX 10.6 the g++ doesn't see fdatasync but gcc does?
477 code = """
478 #include <unistd.h>
479 int main(void)
480 {
481 int fd = 0;
482 fdatasync (fd);
483 return 0;
484 }
485 """
486 if conf.check_cxx(msg="Checking for fdatasync(2) with c++", fragment=code):
487 conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=1')
488 else:
489 conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
490
491 # platform
492 conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
493
99ba903 @piscisaureus win: Define __POSIX__ constant when the platform is POSIX-y
piscisaureus authored
494 # posix?
495 if not sys.platform.startswith('win'):
496 conf.env.append_value('CPPFLAGS', '-D__POSIX__=1')
497
4737219 @ry Print warning when using platform_none.cc
ry authored
498 platform_file = "src/platform_%s.cc" % conf.env['DEST_OS']
499 if os.path.exists(join(cwd, platform_file)):
500 Options.options.platform_file = True
501 conf.env["PLATFORM_FILE"] = platform_file
502 else:
503 Options.options.platform_file = False
504 conf.env["PLATFORM_FILE"] = "src/platform_none.cc"
505
5d80bdb @bnoordhuis Add --profile flag to configure script, enables gprof profiling.
bnoordhuis authored
506 if conf.env['USE_PROFILING'] == True:
507 conf.env.append_value('CPPFLAGS', '-pg')
508 conf.env.append_value('LINKFLAGS', '-pg')
509
f37cc87 @piscisaureus On windows, link with Winsock and WinMM
piscisaureus authored
510 if sys.platform.startswith("win32"):
511 conf.env.append_value('LIB', 'ws2_32')
512 conf.env.append_value('LIB', 'winmm')
513
a87172f @bnoordhuis Compile with `-Wno-unused-parameter -D_FORTIFY_SOURCE=2`
bnoordhuis authored
514 conf.env.append_value('CPPFLAGS', '-Wno-unused-parameter');
515 conf.env.append_value('CPPFLAGS', '-D_FORTIFY_SOURCE=2');
516
97c9745 @ry Back to WAF
ry authored
517 # Split off debug variant before adding variant specific defines
518 debug_env = conf.env.copy()
519 conf.set_env_name('debug', debug_env)
4a2cb07 @piscisaureus Fix whitespace errors introduced by porting efforts
piscisaureus authored
520
62af617 @piscisaureus Dynamically link with pthreads-w32
piscisaureus authored
521 if (sys.platform.startswith("win32")):
522 # Static pthread - crashes
523 #conf.env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2.a')
524 #debug_env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2d.a')
525 # Pthread dll
526 conf.env.append_value('LIB', 'pthread.dll')
97c9745 @ry Back to WAF
ry authored
527
528 # Configure debug variant
529 conf.setenv('debug')
530 debug_env.set_variant('debug')
531 debug_env.append_value('CPPFLAGS', '-DDEBUG')
532 debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
533 debug_env.append_value('CCFLAGS', debug_compile_flags)
534 debug_env.append_value('CXXFLAGS', debug_compile_flags)
535 conf.write_config_header("config.h")
536
537 # Configure default variant
538 conf.setenv('default')
539 default_compile_flags = ['-g', '-O3']
540 conf.env.append_value('CCFLAGS', default_compile_flags)
541 conf.env.append_value('CXXFLAGS', default_compile_flags)
542 conf.write_config_header("config.h")
543
544
545 def v8_cmd(bld, variant):
546 scons = join(cwd, 'tools/scons/scons.py')
547 deps_src = join(bld.path.abspath(),"deps")
548 v8dir_src = join(deps_src,"v8")
549
550 # NOTE: We want to compile V8 to export its symbols. I.E. Do not want
551 # -fvisibility=hidden. When using dlopen() it seems that the loaded DSO
552 # cannot see symbols in the executable which are hidden, even if the
553 # executable is statically linked together...
554
555 # XXX Change this when v8 defaults x86_64 to native builds
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
556 # Possible values are (arm, ia32, x64, mips).
97c9745 @ry Back to WAF
ry authored
557 arch = ""
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
558 if bld.env['DEST_CPU']:
559 arch = "arch="+bld.env['DEST_CPU']
97c9745 @ry Back to WAF
ry authored
560
a5e67ad @piscisaureus Autodetect no-strict-aliasing, propagate toolchain option to SCons
piscisaureus authored
561 toolchain = "gcc"
562
97c9745 @ry Back to WAF
ry authored
563 if variant == "default":
564 mode = "release"
565 else:
566 mode = "debug"
567
568 if bld.env["SNAPSHOT_V8"]:
569 snapshot = "snapshot=on"
570 else:
571 snapshot = ""
572
82bc25d @bnoordhuis Remove oprofile flags in wscript.
bnoordhuis authored
573 cmd_R = sys.executable + ' "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s toolchain=%s library=static %s'
97c9745 @ry Back to WAF
ry authored
574
575 cmd = cmd_R % ( scons
576 , Options.options.jobs
6f08fdb @piscisaureus Backslashes in paths wreak havoc
piscisaureus authored
577 , safe_path(bld.srcnode.abspath(bld.env_of_name(variant)))
578 , safe_path(v8dir_src)
97c9745 @ry Back to WAF
ry authored
579 , mode
580 , arch
a5e67ad @piscisaureus Autodetect no-strict-aliasing, propagate toolchain option to SCons
piscisaureus authored
581 , toolchain
97c9745 @ry Back to WAF
ry authored
582 , snapshot
583 )
d793fca @ry Add toolchain=gcc to V8 build for Sun
ry authored
584
ae30af4 @ry Disable gdbjit by default
ry authored
585 if bld.env["USE_GDBJIT"]:
586 cmd += ' gdbjit=on '
5895df4 @ry Compile gdbjit in by default on linux
ry authored
587
77044ed @ry Turn off strictaliasing on solaris
ry authored
588 if sys.platform.startswith("sunos"):
589 cmd += ' toolchain=gcc strictaliasing=off'
590
d793fca @ry Add toolchain=gcc to V8 build for Sun
ry authored
591
592
97c9745 @ry Back to WAF
ry authored
593 return ("echo '%s' && " % cmd) + cmd
594
595
596 def build_v8(bld):
597 v8 = bld.new_task_gen(
598 source = 'deps/v8/SConstruct '
599 + bld.path.ant_glob('v8/include/*')
600 + bld.path.ant_glob('v8/src/*'),
601 target = bld.env["staticlib_PATTERN"] % "v8",
602 rule = v8_cmd(bld, "default"),
603 before = "cxx",
604 install_path = None)
605 v8.uselib = "EXECINFO"
606 bld.env["CPPPATH_V8"] = "deps/v8/include"
607 t = join(bld.srcnode.abspath(bld.env_of_name("default")), v8.target)
608 bld.env_of_name('default').append_value("LINKFLAGS_V8", t)
609
610
611 ### v8 debug
612 if bld.env["USE_DEBUG"]:
613 v8_debug = v8.clone("debug")
614 v8_debug.rule = v8_cmd(bld, "debug")
615 v8_debug.target = bld.env["staticlib_PATTERN"] % "v8_g"
616 v8_debug.uselib = "EXECINFO"
617 bld.env["CPPPATH_V8_G"] = "deps/v8/include"
618 t = join(bld.srcnode.abspath(bld.env_of_name("debug")), v8_debug.target)
619 bld.env_of_name('debug').append_value("LINKFLAGS_V8_G", t)
620
621 bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/*.h')
622
623
624 def build(bld):
625 ## This snippet is to show full commands as WAF executes
626 import Build
627 old = Build.BuildContext.exec_command
628 def exec_command(self, cmd, **kw):
629 if isinstance(cmd, list): print(" ".join(cmd))
630 return old(self, cmd, **kw)
631 Build.BuildContext.exec_command = exec_command
632
633 Options.options.jobs=jobs
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
634 product_type = Options.options.product_type
635 product_type_is_lib = product_type != 'program'
97c9745 @ry Back to WAF
ry authored
636
637 print "DEST_OS: " + bld.env['DEST_OS']
638 print "DEST_CPU: " + bld.env['DEST_CPU']
639 print "Parallel Jobs: " + str(Options.options.jobs)
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
640 print "Product type: " + product_type
97c9745 @ry Back to WAF
ry authored
641
642 bld.add_subdirs('deps/libeio')
643
644 if not bld.env['USE_SHARED_V8']: build_v8(bld)
645 if not bld.env['USE_SHARED_LIBEV']: bld.add_subdirs('deps/libev')
646 if not bld.env['USE_SHARED_CARES']: bld.add_subdirs('deps/c-ares')
647
648
649 ### http_parser
650 http_parser = bld.new_task_gen("cc")
651 http_parser.source = "deps/http_parser/http_parser.c"
652 http_parser.includes = "deps/http_parser/"
653 http_parser.name = "http_parser"
654 http_parser.target = "http_parser"
655 http_parser.install_path = None
656 if bld.env["USE_DEBUG"]:
657 http_parser.clone("debug")
fd713e1 @aredridel libeio and http_parser build with PIC code
aredridel authored
658 if product_type_is_lib:
659 http_parser.ccflags = '-fPIC'
97c9745 @ry Back to WAF
ry authored
660
661 ### src/native.cc
662 def make_macros(loc, content):
068b733 @ry Land Cantrill's DTrace patch
ry authored
663 f = open(loc, 'a')
97c9745 @ry Back to WAF
ry authored
664 f.write(content)
665 f.close
666
667 macros_loc_debug = join(
668 bld.srcnode.abspath(bld.env_of_name("debug")),
669 "macros.py"
670 )
671
672 macros_loc_default = join(
673 bld.srcnode.abspath(bld.env_of_name("default")),
674 "macros.py"
675 )
676
068b733 @ry Land Cantrill's DTrace patch
ry authored
677 ### We need to truncate the macros.py file
678 f = open(macros_loc_debug, 'w')
679 f.close
680 f = open(macros_loc_default, 'w')
681 f.close
682
97c9745 @ry Back to WAF
ry authored
683 make_macros(macros_loc_debug, "") # leave debug(x) as is in debug build
684 # replace debug(x) with nothing in release build
685 make_macros(macros_loc_default, "macro debug(x) = ;\n")
f9f0e5c @ry Pre-process out assert()
ry authored
686 make_macros(macros_loc_default, "macro assert(x) = ;\n")
97c9745 @ry Back to WAF
ry authored
687
068b733 @ry Land Cantrill's DTrace patch
ry authored
688 if not bld.env["USE_DTRACE"]:
e9257b8 @ry New DTrace probes from CA team
ry authored
689 probes = [
690 'DTRACE_HTTP_CLIENT_REQUEST',
691 'DTRACE_HTTP_CLIENT_RESPONSE',
692 'DTRACE_HTTP_SERVER_REQUEST',
693 'DTRACE_HTTP_SERVER_RESPONSE',
694 'DTRACE_NET_SERVER_CONNECTION',
695 'DTRACE_NET_STREAM_END',
696 'DTRACE_NET_SOCKET_READ',
697 'DTRACE_NET_SOCKET_WRITE'
698 ]
699
700 for probe in probes:
701 make_macros(macros_loc_default, "macro %s(x) = ;\n" % probe)
702 make_macros(macros_loc_debug, "macro %s(x) = ;\n" % probe)
068b733 @ry Land Cantrill's DTrace patch
ry authored
703
97c9745 @ry Back to WAF
ry authored
704 def javascript_in_c(task):
705 env = task.env
706 source = map(lambda x: x.srcpath(env), task.inputs)
707 targets = map(lambda x: x.srcpath(env), task.outputs)
708 source.append(macros_loc_default)
709 js2c.JS2C(source, targets)
710
711 def javascript_in_c_debug(task):
712 env = task.env
713 source = map(lambda x: x.srcpath(env), task.inputs)
714 targets = map(lambda x: x.srcpath(env), task.outputs)
715 source.append(macros_loc_debug)
716 js2c.JS2C(source, targets)
717
718 native_cc = bld.new_task_gen(
719 source='src/node.js ' + bld.path.ant_glob('lib/*.js'),
720 target="src/node_natives.h",
721 before="cxx",
722 install_path=None
723 )
724
725 # Add the rule /after/ cloning the debug
726 # This is a work around for an error had in python 2.4.3 (I'll paste the
727 # error that was had into the git commit meessage. git-blame to find out
728 # where.)
729 if bld.env["USE_DEBUG"]:
730 native_cc_debug = native_cc.clone("debug")
731 native_cc_debug.rule = javascript_in_c_debug
732
c409aab @ry Assert, Debug output in normal default build
ry authored
733 native_cc.rule = javascript_in_c_debug
734
068b733 @ry Land Cantrill's DTrace patch
ry authored
735 if bld.env["USE_DTRACE"]:
736 dtrace = bld.new_task_gen(
737 name = "dtrace",
738 source = "src/node_provider.d",
739 target = "src/node_provider.h",
740 rule = "%s -x nolibs -h -o ${TGT} -s ${SRC}" % (bld.env.DTRACE),
741 before = "cxx",
742 )
743
744 if bld.env["USE_DEBUG"]:
745 dtrace_g = dtrace.clone("debug")
746
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
747 bld.install_files('${LIBDIR}/dtrace', 'src/node.d')
068b733 @ry Land Cantrill's DTrace patch
ry authored
748
749 if sys.platform.startswith("sunos"):
750 #
751 # The USDT DTrace provider works slightly differently on Solaris than on
752 # the Mac; on Solaris, any objects that have USDT DTrace probes must be
753 # post-processed with the DTrace command. (This is not true on the
754 # Mac, which has first-class linker support for USDT probes.) On
755 # Solaris, we must therefore post-process our object files. Waf doesn't
756 # seem to really have a notion for this, so we inject a task after
757 # compiling and before linking, and then find all of the node object
758 # files and shuck them off to dtrace (which will modify them in place
759 # as appropriate).
760 #
761 def dtrace_postprocess(task):
762 abspath = bld.srcnode.abspath(bld.env_of_name(task.env.variant()))
763 objs = glob.glob(abspath + 'src/*.o')
f918e57 @ry Support dtrace for debug build
ry authored
764 source = task.inputs[0].srcpath(task.env)
765 target = task.outputs[0].srcpath(task.env)
766 cmd = '%s -G -x nolibs -s %s -o %s %s' % (task.env.DTRACE,
767 source,
768 target,
769 ' '.join(objs))
770 Utils.exec_command(cmd)
068b733 @ry Land Cantrill's DTrace patch
ry authored
771
772 dtracepost = bld.new_task_gen(
773 name = "dtrace-postprocess",
774 source = "src/node_provider.d",
f918e57 @ry Support dtrace for debug build
ry authored
775 target = "node_provider.o",
068b733 @ry Land Cantrill's DTrace patch
ry authored
776 always = True,
777 before = "cxx_link",
778 after = "cxx",
f918e57 @ry Support dtrace for debug build
ry authored
779 rule = dtrace_postprocess
068b733 @ry Land Cantrill's DTrace patch
ry authored
780 )
781
f918e57 @ry Support dtrace for debug build
ry authored
782 t = join(bld.srcnode.abspath(bld.env_of_name("default")), dtracepost.target)
783 bld.env_of_name('default').append_value('LINKFLAGS', t)
068b733 @ry Land Cantrill's DTrace patch
ry authored
784
785 #
786 # Note that for the same (mysterious) issue outlined above with respect
787 # to assigning the rule to native_cc/native_cc_debug, we must apply the
788 # rule to dtracepost/dtracepost_g only after they have been cloned. We
789 # also must put node_provider.o on the link line, but because we
790 # (apparently?) lack LINKFLAGS in debug, we (shamelessly) stowaway on
791 # LINKFLAGS_V8_G.
792 #
793 if bld.env["USE_DEBUG"]:
794 dtracepost_g = dtracepost.clone("debug")
795 dtracepost_g.rule = dtrace_postprocess
f918e57 @ry Support dtrace for debug build
ry authored
796 t = join(bld.srcnode.abspath(bld.env_of_name("debug")), dtracepost.target)
797 bld.env_of_name("debug").append_value('LINKFLAGS_V8_G', t)
068b733 @ry Land Cantrill's DTrace patch
ry authored
798
97c9745 @ry Back to WAF
ry authored
799
800 ### node lib
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
801 node = bld.new_task_gen("cxx", product_type)
97c9745 @ry Back to WAF
ry authored
802 node.name = "node"
803 node.target = "node"
90348a6 Add os.cpus() and os.uptime() support for sunos
Scott McWhirter authored
804 node.uselib = 'RT EV OPENSSL CARES EXECINFO DL KVM SOCKET NSL KSTAT UTIL OPROFILE'
97c9745 @ry Back to WAF
ry authored
805 node.add_objects = 'eio http_parser'
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
806 if product_type_is_lib:
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
807 node.install_path = '${LIBDIR}'
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
808 else:
809 node.install_path = '${PREFIX}/bin'
97c9745 @ry Back to WAF
ry authored
810 node.chmod = 0755
811 node.source = """
812 src/node.cc
813 src/node_buffer.cc
814 src/node_javascript.cc
815 src/node_extensions.cc
816 src/node_http_parser.cc
817 src/node_net.cc
818 src/node_io_watcher.cc
819 src/node_constants.cc
820 src/node_cares.cc
821 src/node_events.cc
822 src/node_file.cc
823 src/node_signal_watcher.cc
824 src/node_stat_watcher.cc
825 src/node_timer.cc
826 src/node_script.cc
f1762ff @mscdex Add os module and getHostname
mscdex authored
827 src/node_os.cc
068b733 @ry Land Cantrill's DTrace patch
ry authored
828 src/node_dtrace.cc
74954ce @thughes Add string class that uses ExternalAsciiStringResource.
thughes authored
829 src/node_string.cc
97c9745 @ry Back to WAF
ry authored
830 """
4f8dd28 @ry wscript chooses win32 source files, not cpp
ry authored
831
832 if sys.platform.startswith("win32"):
833 node.source += " src/node_stdio_win32.cc "
834 node.source += " src/node_child_process_win32.cc "
835 else:
836 node.source += " src/node_stdio.cc "
837 node.source += " src/node_child_process.cc "
838
4737219 @ry Print warning when using platform_none.cc
ry authored
839 node.source += bld.env["PLATFORM_FILE"]
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to repres…
rsms authored
840 if not product_type_is_lib:
841 node.source = 'src/node_main.cc '+node.source
97c9745 @ry Back to WAF
ry authored
842
843 if bld.env["USE_OPENSSL"]: node.source += " src/node_crypto.cc "
844
845 node.includes = """
846 src/
847 deps/libeio
848 deps/http_parser
849 """
850
851 if not bld.env["USE_SHARED_V8"]: node.includes += ' deps/v8/include '
852
853 if not bld.env["USE_SHARED_LIBEV"]:
854 node.add_objects += ' ev '
855 node.includes += ' deps/libev '
856
857 if not bld.env["USE_SHARED_CARES"]:
858 node.add_objects += ' cares '
859 node.includes += ' deps/c-ares deps/c-ares/' + bld.env['DEST_OS'] + '-' + bld.env['DEST_CPU']
860
861 if sys.platform.startswith('cygwin'):
862 bld.env.append_value('LINKFLAGS', '-Wl,--export-all-symbols')
863 bld.env.append_value('LINKFLAGS', '-Wl,--out-implib,default/libnode.dll.a')
864 bld.env.append_value('LINKFLAGS', '-Wl,--output-def,default/libnode.def')
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
865 bld.install_files('${LIBDIR}', "build/default/libnode.*")
97c9745 @ry Back to WAF
ry authored
866
867 def subflags(program):
868 x = { 'CCFLAGS' : " ".join(program.env["CCFLAGS"]).replace('"', '\\"')
869 , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"')
870 , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"')
6f08fdb @piscisaureus Backslashes in paths wreak havoc
piscisaureus authored
871 , 'PREFIX' : safe_path(program.env["PREFIX"])
1b8dd65 @ry Bump version to v0.4.10
ry authored
872 , 'VERSION' : '0.4.10' # FIXME should not be hard-coded, see NODE_VERSION_STRING in src/node_version.
97c9745 @ry Back to WAF
ry authored
873 }
874 return x
875
876 # process file.pc.in -> file.pc
877
878 node_conf = bld.new_task_gen('subst', before="cxx")
879 node_conf.source = 'src/node_config.h.in'
880 node_conf.target = 'src/node_config.h'
881 node_conf.dict = subflags(node)
882 node_conf.install_path = '${PREFIX}/include/node'
883
884 if bld.env["USE_DEBUG"]:
885 node_g = node.clone("debug")
886 node_g.target = "node_g"
887 node_g.uselib += ' V8_G'
888
889 node_conf_g = node_conf.clone("debug")
890 node_conf_g.dict = subflags(node_g)
891 node_conf_g.install_path = None
892
893 # After creating the debug clone, append the V8 dep
894 node.uselib += ' V8'
895
896 bld.install_files('${PREFIX}/include/node/', """
897 config.h
898 src/node.h
899 src/node_object_wrap.h
900 src/node_buffer.h
901 src/node_events.h
902 src/node_version.h
903 """)
904
905 # Only install the man page if it exists.
906 # Do 'make doc install' to build and install it.
907 if os.path.exists('doc/node.1'):
908 bld.install_files('${PREFIX}/share/man/man1/', 'doc/node.1')
909
029180a @ry Install node-waf
ry authored
910 bld.install_files('${PREFIX}/bin/', 'tools/node-waf', chmod=0755)
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
911 bld.install_files('${LIBDIR}/node/wafadmin', 'tools/wafadmin/*.py')
912 bld.install_files('${LIBDIR}/node/wafadmin/Tools', 'tools/wafadmin/Tools/*.py')
97c9745 @ry Back to WAF
ry authored
913
914 # create a pkg-config(1) file
915 node_conf = bld.new_task_gen('subst', before="cxx")
916 node_conf.source = 'tools/nodejs.pc.in'
917 node_conf.target = 'tools/nodejs.pc'
918 node_conf.dict = subflags(node)
919
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
920 bld.install_files('${LIBDIR}/pkgconfig', 'tools/nodejs.pc')
97c9745 @ry Back to WAF
ry authored
921
922 def shutdown():
923 Options.options.debug
924 # HACK to get binding.node out of build directory.
925 # better way to do this?
926 if Options.commands['configure']:
927 if not Options.options.use_openssl:
928 print "WARNING WARNING WARNING"
929 print "OpenSSL not found. Will compile Node without crypto support!"
4737219 @ry Print warning when using platform_none.cc
ry authored
930
931 if not Options.options.platform_file:
932 print "WARNING: Platform not fully supported. Using src/platform_none.cc"
933
97c9745 @ry Back to WAF
ry authored
934 elif not Options.commands['clean']:
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
935 if sys.platform.startswith("win32"):
d1bf9cf @piscisaureus After building overwrite existing ./node(_g)?.exe
piscisaureus authored
936 if os.path.exists('build/default/node.exe'):
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
937 os.system('cp build/default/node.exe .')
d1bf9cf @piscisaureus After building overwrite existing ./node(_g)?.exe
piscisaureus authored
938 if os.path.exists('build/debug/node_g.exe'):
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
939 os.system('cp build/debug/node_g.exe .')
940 else:
941 if os.path.exists('build/default/node') and not os.path.exists('node'):
942 os.symlink('build/default/node', 'node')
943 if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'):
944 os.symlink('build/debug/node_g', 'node_g')
97c9745 @ry Back to WAF
ry authored
945 else:
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
946 if sys.platform.startswith("win32"):
947 if os.path.exists('node.exe'): os.unlink('node.exe')
948 if os.path.exists('node_g.exe'): os.unlink('node_g.exe')
949 else:
950 if os.path.exists('node'): os.unlink('node')
951 if os.path.exists('node_g'): os.unlink('node_g')
Something went wrong with that request. Please try again.