Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 949 lines (792 sloc) 33.705 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 represent...
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 represent...
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 represent...
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 represent...
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 represent...
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"):
428 conf.env.append_value ('CCFLAGS', '-threads')
429 conf.env.append_value ('CXXFLAGS', '-threads')
430 #conf.env.append_value ('LINKFLAGS', ' -threads')
d56e1a3 @piscisaureus No -rdynamic and -pthread flags when building with mingw
piscisaureus authored
431 elif not sys.platform.startswith("cygwin") and not sys.platform.startswith("win32"):
97c9745 @ry Back to WAF
ry authored
432 threadflags='-pthread'
433 conf.env.append_value ('CCFLAGS', threadflags)
434 conf.env.append_value ('CXXFLAGS', threadflags)
435 conf.env.append_value ('LINKFLAGS', threadflags)
436 if sys.platform.startswith("darwin"):
437 # used by platform_darwin_*.cc
438 conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
439 # cross compile for architecture specified by DEST_CPU
440 if 'DEST_CPU' in conf.env:
441 arch = conf.env['DEST_CPU']
442 # map supported_archs to GCC names:
443 arch_mappings = {'ia32': 'i386', 'x64': 'x86_64'}
444 if arch in arch_mappings:
445 arch = arch_mappings[arch]
446 flags = ['-arch', arch]
447 conf.env.append_value('CCFLAGS', flags)
448 conf.env.append_value('CXXFLAGS', flags)
449 conf.env.append_value('LINKFLAGS', flags)
450 if 'DEST_CPU' in conf.env:
451 arch = conf.env['DEST_CPU']
452 # TODO: -m32 is only available on 64 bit machines, so check host type
453 flags = None
454 if arch == 'ia32':
455 flags = '-m32'
456 if flags:
457 conf.env.append_value('CCFLAGS', flags)
458 conf.env.append_value('CXXFLAGS', flags)
459 conf.env.append_value('LINKFLAGS', flags)
97c9745 @ry Back to WAF
ry authored
460
461 # Needed for getaddrinfo in libeio
462 conf.env.append_value("CPPFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
463 # LFS
464 conf.env.append_value('CPPFLAGS', '-D_LARGEFILE_SOURCE')
465 conf.env.append_value('CPPFLAGS', '-D_FILE_OFFSET_BITS=64')
466 conf.env.append_value('CPPFLAGS', '-DEV_MULTIPLICITY=0')
467
2655269 @piscisaureus Make select work on >64 FDs on windows
piscisaureus authored
468 # Makes select on windows support more than 64 FDs
469 if sys.platform.startswith("win32"):
470 conf.env.append_value('CPPFLAGS', '-DFD_SETSIZE=1024');
471
97c9745 @ry Back to WAF
ry authored
472 ## needed for node_file.cc fdatasync
473 ## Strangely on OSX 10.6 the g++ doesn't see fdatasync but gcc does?
474 code = """
475 #include <unistd.h>
476 int main(void)
477 {
478 int fd = 0;
479 fdatasync (fd);
480 return 0;
481 }
482 """
483 if conf.check_cxx(msg="Checking for fdatasync(2) with c++", fragment=code):
484 conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=1')
485 else:
486 conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
487
488 # platform
489 conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
490
99ba903 @piscisaureus win: Define __POSIX__ constant when the platform is POSIX-y
piscisaureus authored
491 # posix?
492 if not sys.platform.startswith('win'):
493 conf.env.append_value('CPPFLAGS', '-D__POSIX__=1')
494
4737219 @ry Print warning when using platform_none.cc
ry authored
495 platform_file = "src/platform_%s.cc" % conf.env['DEST_OS']
496 if os.path.exists(join(cwd, platform_file)):
497 Options.options.platform_file = True
498 conf.env["PLATFORM_FILE"] = platform_file
499 else:
500 Options.options.platform_file = False
501 conf.env["PLATFORM_FILE"] = "src/platform_none.cc"
502
5d80bdb @bnoordhuis Add --profile flag to configure script, enables gprof profiling.
bnoordhuis authored
503 if conf.env['USE_PROFILING'] == True:
504 conf.env.append_value('CPPFLAGS', '-pg')
505 conf.env.append_value('LINKFLAGS', '-pg')
506
f37cc87 @piscisaureus On windows, link with Winsock and WinMM
piscisaureus authored
507 if sys.platform.startswith("win32"):
508 conf.env.append_value('LIB', 'ws2_32')
509 conf.env.append_value('LIB', 'winmm')
510
a87172f @bnoordhuis Compile with `-Wno-unused-parameter -D_FORTIFY_SOURCE=2`
bnoordhuis authored
511 conf.env.append_value('CPPFLAGS', '-Wno-unused-parameter');
512 conf.env.append_value('CPPFLAGS', '-D_FORTIFY_SOURCE=2');
513
97c9745 @ry Back to WAF
ry authored
514 # Split off debug variant before adding variant specific defines
515 debug_env = conf.env.copy()
516 conf.set_env_name('debug', debug_env)
4a2cb07 @piscisaureus Fix whitespace errors introduced by porting efforts
piscisaureus authored
517
62af617 @piscisaureus Dynamically link with pthreads-w32
piscisaureus authored
518 if (sys.platform.startswith("win32")):
519 # Static pthread - crashes
520 #conf.env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2.a')
521 #debug_env.append_value('LINKFLAGS', '../deps/pthreads-w32/libpthreadGC2d.a')
522 # Pthread dll
523 conf.env.append_value('LIB', 'pthread.dll')
97c9745 @ry Back to WAF
ry authored
524
525 # Configure debug variant
526 conf.setenv('debug')
527 debug_env.set_variant('debug')
528 debug_env.append_value('CPPFLAGS', '-DDEBUG')
529 debug_compile_flags = ['-g', '-O0', '-Wall', '-Wextra']
530 debug_env.append_value('CCFLAGS', debug_compile_flags)
531 debug_env.append_value('CXXFLAGS', debug_compile_flags)
532 conf.write_config_header("config.h")
533
534 # Configure default variant
535 conf.setenv('default')
536 default_compile_flags = ['-g', '-O3']
537 conf.env.append_value('CCFLAGS', default_compile_flags)
538 conf.env.append_value('CXXFLAGS', default_compile_flags)
539 conf.write_config_header("config.h")
540
541
542 def v8_cmd(bld, variant):
543 scons = join(cwd, 'tools/scons/scons.py')
544 deps_src = join(bld.path.abspath(),"deps")
545 v8dir_src = join(deps_src,"v8")
546
547 # NOTE: We want to compile V8 to export its symbols. I.E. Do not want
548 # -fvisibility=hidden. When using dlopen() it seems that the loaded DSO
549 # cannot see symbols in the executable which are hidden, even if the
550 # executable is statically linked together...
551
552 # XXX Change this when v8 defaults x86_64 to native builds
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
553 # Possible values are (arm, ia32, x64, mips).
97c9745 @ry Back to WAF
ry authored
554 arch = ""
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
555 if bld.env['DEST_CPU']:
556 arch = "arch="+bld.env['DEST_CPU']
97c9745 @ry Back to WAF
ry authored
557
a5e67ad @piscisaureus Autodetect no-strict-aliasing, propagate toolchain option to SCons
piscisaureus authored
558 toolchain = "gcc"
559
97c9745 @ry Back to WAF
ry authored
560 if variant == "default":
561 mode = "release"
562 else:
563 mode = "debug"
564
565 if bld.env["SNAPSHOT_V8"]:
566 snapshot = "snapshot=on"
567 else:
568 snapshot = ""
569
82bc25d @bnoordhuis Remove oprofile flags in wscript.
bnoordhuis authored
570 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
571
572 cmd = cmd_R % ( scons
573 , Options.options.jobs
6f08fdb @piscisaureus Backslashes in paths wreak havoc
piscisaureus authored
574 , safe_path(bld.srcnode.abspath(bld.env_of_name(variant)))
575 , safe_path(v8dir_src)
97c9745 @ry Back to WAF
ry authored
576 , mode
577 , arch
a5e67ad @piscisaureus Autodetect no-strict-aliasing, propagate toolchain option to SCons
piscisaureus authored
578 , toolchain
97c9745 @ry Back to WAF
ry authored
579 , snapshot
580 )
d793fca @ry Add toolchain=gcc to V8 build for Sun
ry authored
581
ae30af4 @ry Disable gdbjit by default
ry authored
582 if bld.env["USE_GDBJIT"]:
583 cmd += ' gdbjit=on '
5895df4 @ry Compile gdbjit in by default on linux
ry authored
584
77044ed @ry Turn off strictaliasing on solaris
ry authored
585 if sys.platform.startswith("sunos"):
586 cmd += ' toolchain=gcc strictaliasing=off'
587
d793fca @ry Add toolchain=gcc to V8 build for Sun
ry authored
588
589
97c9745 @ry Back to WAF
ry authored
590 return ("echo '%s' && " % cmd) + cmd
591
592
593 def build_v8(bld):
594 v8 = bld.new_task_gen(
595 source = 'deps/v8/SConstruct '
596 + bld.path.ant_glob('v8/include/*')
597 + bld.path.ant_glob('v8/src/*'),
598 target = bld.env["staticlib_PATTERN"] % "v8",
599 rule = v8_cmd(bld, "default"),
600 before = "cxx",
601 install_path = None)
602 v8.uselib = "EXECINFO"
603 bld.env["CPPPATH_V8"] = "deps/v8/include"
604 t = join(bld.srcnode.abspath(bld.env_of_name("default")), v8.target)
605 bld.env_of_name('default').append_value("LINKFLAGS_V8", t)
606
607
608 ### v8 debug
609 if bld.env["USE_DEBUG"]:
610 v8_debug = v8.clone("debug")
611 v8_debug.rule = v8_cmd(bld, "debug")
612 v8_debug.target = bld.env["staticlib_PATTERN"] % "v8_g"
613 v8_debug.uselib = "EXECINFO"
614 bld.env["CPPPATH_V8_G"] = "deps/v8/include"
615 t = join(bld.srcnode.abspath(bld.env_of_name("debug")), v8_debug.target)
616 bld.env_of_name('debug').append_value("LINKFLAGS_V8_G", t)
617
618 bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/*.h')
619
620
621 def build(bld):
622 ## This snippet is to show full commands as WAF executes
623 import Build
624 old = Build.BuildContext.exec_command
625 def exec_command(self, cmd, **kw):
626 if isinstance(cmd, list): print(" ".join(cmd))
627 return old(self, cmd, **kw)
628 Build.BuildContext.exec_command = exec_command
629
630 Options.options.jobs=jobs
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
631 product_type = Options.options.product_type
632 product_type_is_lib = product_type != 'program'
97c9745 @ry Back to WAF
ry authored
633
634 print "DEST_OS: " + bld.env['DEST_OS']
635 print "DEST_CPU: " + bld.env['DEST_CPU']
636 print "Parallel Jobs: " + str(Options.options.jobs)
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
637 print "Product type: " + product_type
97c9745 @ry Back to WAF
ry authored
638
639 bld.add_subdirs('deps/libeio')
640
641 if not bld.env['USE_SHARED_V8']: build_v8(bld)
642 if not bld.env['USE_SHARED_LIBEV']: bld.add_subdirs('deps/libev')
643 if not bld.env['USE_SHARED_CARES']: bld.add_subdirs('deps/c-ares')
644
645
646 ### http_parser
647 http_parser = bld.new_task_gen("cc")
648 http_parser.source = "deps/http_parser/http_parser.c"
649 http_parser.includes = "deps/http_parser/"
650 http_parser.name = "http_parser"
651 http_parser.target = "http_parser"
652 http_parser.install_path = None
653 if bld.env["USE_DEBUG"]:
654 http_parser.clone("debug")
fd713e1 @aredridel libeio and http_parser build with PIC code
aredridel authored
655 if product_type_is_lib:
656 http_parser.ccflags = '-fPIC'
97c9745 @ry Back to WAF
ry authored
657
658 ### src/native.cc
659 def make_macros(loc, content):
068b733 @ry Land Cantrill's DTrace patch
ry authored
660 f = open(loc, 'a')
97c9745 @ry Back to WAF
ry authored
661 f.write(content)
662 f.close
663
664 macros_loc_debug = join(
665 bld.srcnode.abspath(bld.env_of_name("debug")),
666 "macros.py"
667 )
668
669 macros_loc_default = join(
670 bld.srcnode.abspath(bld.env_of_name("default")),
671 "macros.py"
672 )
673
068b733 @ry Land Cantrill's DTrace patch
ry authored
674 ### We need to truncate the macros.py file
675 f = open(macros_loc_debug, 'w')
676 f.close
677 f = open(macros_loc_default, 'w')
678 f.close
679
97c9745 @ry Back to WAF
ry authored
680 make_macros(macros_loc_debug, "") # leave debug(x) as is in debug build
681 # replace debug(x) with nothing in release build
682 make_macros(macros_loc_default, "macro debug(x) = ;\n")
f9f0e5c @ry Pre-process out assert()
ry authored
683 make_macros(macros_loc_default, "macro assert(x) = ;\n")
97c9745 @ry Back to WAF
ry authored
684
068b733 @ry Land Cantrill's DTrace patch
ry authored
685 if not bld.env["USE_DTRACE"]:
e9257b8 @ry New DTrace probes from CA team
ry authored
686 probes = [
687 'DTRACE_HTTP_CLIENT_REQUEST',
688 'DTRACE_HTTP_CLIENT_RESPONSE',
689 'DTRACE_HTTP_SERVER_REQUEST',
690 'DTRACE_HTTP_SERVER_RESPONSE',
691 'DTRACE_NET_SERVER_CONNECTION',
692 'DTRACE_NET_STREAM_END',
693 'DTRACE_NET_SOCKET_READ',
694 'DTRACE_NET_SOCKET_WRITE'
695 ]
696
697 for probe in probes:
698 make_macros(macros_loc_default, "macro %s(x) = ;\n" % probe)
699 make_macros(macros_loc_debug, "macro %s(x) = ;\n" % probe)
068b733 @ry Land Cantrill's DTrace patch
ry authored
700
97c9745 @ry Back to WAF
ry authored
701 def javascript_in_c(task):
702 env = task.env
703 source = map(lambda x: x.srcpath(env), task.inputs)
704 targets = map(lambda x: x.srcpath(env), task.outputs)
705 source.append(macros_loc_default)
706 js2c.JS2C(source, targets)
707
708 def javascript_in_c_debug(task):
709 env = task.env
710 source = map(lambda x: x.srcpath(env), task.inputs)
711 targets = map(lambda x: x.srcpath(env), task.outputs)
712 source.append(macros_loc_debug)
713 js2c.JS2C(source, targets)
714
715 native_cc = bld.new_task_gen(
716 source='src/node.js ' + bld.path.ant_glob('lib/*.js'),
717 target="src/node_natives.h",
718 before="cxx",
719 install_path=None
720 )
721
722 # Add the rule /after/ cloning the debug
723 # This is a work around for an error had in python 2.4.3 (I'll paste the
724 # error that was had into the git commit meessage. git-blame to find out
725 # where.)
726 if bld.env["USE_DEBUG"]:
727 native_cc_debug = native_cc.clone("debug")
728 native_cc_debug.rule = javascript_in_c_debug
729
c409aab @ry Assert, Debug output in normal default build
ry authored
730 native_cc.rule = javascript_in_c_debug
731
068b733 @ry Land Cantrill's DTrace patch
ry authored
732 if bld.env["USE_DTRACE"]:
733 dtrace = bld.new_task_gen(
734 name = "dtrace",
735 source = "src/node_provider.d",
736 target = "src/node_provider.h",
737 rule = "%s -x nolibs -h -o ${TGT} -s ${SRC}" % (bld.env.DTRACE),
738 before = "cxx",
739 )
740
741 if bld.env["USE_DEBUG"]:
742 dtrace_g = dtrace.clone("debug")
743
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
744 bld.install_files('${LIBDIR}/dtrace', 'src/node.d')
068b733 @ry Land Cantrill's DTrace patch
ry authored
745
746 if sys.platform.startswith("sunos"):
747 #
748 # The USDT DTrace provider works slightly differently on Solaris than on
749 # the Mac; on Solaris, any objects that have USDT DTrace probes must be
750 # post-processed with the DTrace command. (This is not true on the
751 # Mac, which has first-class linker support for USDT probes.) On
752 # Solaris, we must therefore post-process our object files. Waf doesn't
753 # seem to really have a notion for this, so we inject a task after
754 # compiling and before linking, and then find all of the node object
755 # files and shuck them off to dtrace (which will modify them in place
756 # as appropriate).
757 #
758 def dtrace_postprocess(task):
759 abspath = bld.srcnode.abspath(bld.env_of_name(task.env.variant()))
760 objs = glob.glob(abspath + 'src/*.o')
f918e57 @ry Support dtrace for debug build
ry authored
761 source = task.inputs[0].srcpath(task.env)
762 target = task.outputs[0].srcpath(task.env)
763 cmd = '%s -G -x nolibs -s %s -o %s %s' % (task.env.DTRACE,
764 source,
765 target,
766 ' '.join(objs))
767 Utils.exec_command(cmd)
068b733 @ry Land Cantrill's DTrace patch
ry authored
768
769 dtracepost = bld.new_task_gen(
770 name = "dtrace-postprocess",
771 source = "src/node_provider.d",
f918e57 @ry Support dtrace for debug build
ry authored
772 target = "node_provider.o",
068b733 @ry Land Cantrill's DTrace patch
ry authored
773 always = True,
774 before = "cxx_link",
775 after = "cxx",
f918e57 @ry Support dtrace for debug build
ry authored
776 rule = dtrace_postprocess
068b733 @ry Land Cantrill's DTrace patch
ry authored
777 )
778
f918e57 @ry Support dtrace for debug build
ry authored
779 t = join(bld.srcnode.abspath(bld.env_of_name("default")), dtracepost.target)
780 bld.env_of_name('default').append_value('LINKFLAGS', t)
068b733 @ry Land Cantrill's DTrace patch
ry authored
781
782 #
783 # Note that for the same (mysterious) issue outlined above with respect
784 # to assigning the rule to native_cc/native_cc_debug, we must apply the
785 # rule to dtracepost/dtracepost_g only after they have been cloned. We
786 # also must put node_provider.o on the link line, but because we
787 # (apparently?) lack LINKFLAGS in debug, we (shamelessly) stowaway on
788 # LINKFLAGS_V8_G.
789 #
790 if bld.env["USE_DEBUG"]:
791 dtracepost_g = dtracepost.clone("debug")
792 dtracepost_g.rule = dtrace_postprocess
f918e57 @ry Support dtrace for debug build
ry authored
793 t = join(bld.srcnode.abspath(bld.env_of_name("debug")), dtracepost.target)
794 bld.env_of_name("debug").append_value('LINKFLAGS_V8_G', t)
068b733 @ry Land Cantrill's DTrace patch
ry authored
795
97c9745 @ry Back to WAF
ry authored
796
797 ### node lib
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
798 node = bld.new_task_gen("cxx", product_type)
97c9745 @ry Back to WAF
ry authored
799 node.name = "node"
800 node.target = "node"
90348a6 Add os.cpus() and os.uptime() support for sunos
Scott McWhirter authored
801 node.uselib = 'RT EV OPENSSL CARES EXECINFO DL KVM SOCKET NSL KSTAT UTIL OPROFILE'
97c9745 @ry Back to WAF
ry authored
802 node.add_objects = 'eio http_parser'
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
803 if product_type_is_lib:
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
804 node.install_path = '${LIBDIR}'
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
805 else:
806 node.install_path = '${PREFIX}/bin'
97c9745 @ry Back to WAF
ry authored
807 node.chmod = 0755
808 node.source = """
809 src/node.cc
810 src/node_buffer.cc
811 src/node_javascript.cc
812 src/node_extensions.cc
813 src/node_http_parser.cc
814 src/node_net.cc
815 src/node_io_watcher.cc
816 src/node_constants.cc
817 src/node_cares.cc
818 src/node_events.cc
819 src/node_file.cc
820 src/node_signal_watcher.cc
821 src/node_stat_watcher.cc
822 src/node_timer.cc
823 src/node_script.cc
f1762ff @mscdex Add os module and getHostname
mscdex authored
824 src/node_os.cc
068b733 @ry Land Cantrill's DTrace patch
ry authored
825 src/node_dtrace.cc
74954ce @thughes Add string class that uses ExternalAsciiStringResource.
thughes authored
826 src/node_string.cc
97c9745 @ry Back to WAF
ry authored
827 """
4f8dd28 @ry wscript chooses win32 source files, not cpp
ry authored
828
829 if sys.platform.startswith("win32"):
830 node.source += " src/node_stdio_win32.cc "
831 node.source += " src/node_child_process_win32.cc "
832 else:
833 node.source += " src/node_stdio.cc "
834 node.source += " src/node_child_process.cc "
835
4737219 @ry Print warning when using platform_none.cc
ry authored
836 node.source += bld.env["PLATFORM_FILE"]
e5a0fbe @rsms Added support for cross compilation and also fixed DEST_CPU to represent...
rsms authored
837 if not product_type_is_lib:
838 node.source = 'src/node_main.cc '+node.source
97c9745 @ry Back to WAF
ry authored
839
840 if bld.env["USE_OPENSSL"]: node.source += " src/node_crypto.cc "
841
842 node.includes = """
843 src/
844 deps/libeio
845 deps/http_parser
846 """
847
848 if not bld.env["USE_SHARED_V8"]: node.includes += ' deps/v8/include '
849
850 if not bld.env["USE_SHARED_LIBEV"]:
851 node.add_objects += ' ev '
852 node.includes += ' deps/libev '
853
854 if not bld.env["USE_SHARED_CARES"]:
855 node.add_objects += ' cares '
856 node.includes += ' deps/c-ares deps/c-ares/' + bld.env['DEST_OS'] + '-' + bld.env['DEST_CPU']
857
858 if sys.platform.startswith('cygwin'):
859 bld.env.append_value('LINKFLAGS', '-Wl,--export-all-symbols')
860 bld.env.append_value('LINKFLAGS', '-Wl,--out-implib,default/libnode.dll.a')
861 bld.env.append_value('LINKFLAGS', '-Wl,--output-def,default/libnode.def')
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
862 bld.install_files('${LIBDIR}', "build/default/libnode.*")
97c9745 @ry Back to WAF
ry authored
863
864 def subflags(program):
865 x = { 'CCFLAGS' : " ".join(program.env["CCFLAGS"]).replace('"', '\\"')
866 , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]).replace('"', '\\"')
867 , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]).replace('"', '\\"')
6f08fdb @piscisaureus Backslashes in paths wreak havoc
piscisaureus authored
868 , 'PREFIX' : safe_path(program.env["PREFIX"])
1b8dd65 @ry Bump version to v0.4.10
ry authored
869 , '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
870 }
871 return x
872
873 # process file.pc.in -> file.pc
874
875 node_conf = bld.new_task_gen('subst', before="cxx")
876 node_conf.source = 'src/node_config.h.in'
877 node_conf.target = 'src/node_config.h'
878 node_conf.dict = subflags(node)
879 node_conf.install_path = '${PREFIX}/include/node'
880
881 if bld.env["USE_DEBUG"]:
882 node_g = node.clone("debug")
883 node_g.target = "node_g"
884 node_g.uselib += ' V8_G'
885
886 node_conf_g = node_conf.clone("debug")
887 node_conf_g.dict = subflags(node_g)
888 node_conf_g.install_path = None
889
890 # After creating the debug clone, append the V8 dep
891 node.uselib += ' V8'
892
893 bld.install_files('${PREFIX}/include/node/', """
894 config.h
895 src/node.h
896 src/node_object_wrap.h
897 src/node_buffer.h
898 src/node_events.h
899 src/node_version.h
900 """)
901
902 # Only install the man page if it exists.
903 # Do 'make doc install' to build and install it.
904 if os.path.exists('doc/node.1'):
905 bld.install_files('${PREFIX}/share/man/man1/', 'doc/node.1')
906
029180a @ry Install node-waf
ry authored
907 bld.install_files('${PREFIX}/bin/', 'tools/node-waf', chmod=0755)
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
908 bld.install_files('${LIBDIR}/node/wafadmin', 'tools/wafadmin/*.py')
909 bld.install_files('${LIBDIR}/node/wafadmin/Tools', 'tools/wafadmin/Tools/*.py')
97c9745 @ry Back to WAF
ry authored
910
911 # create a pkg-config(1) file
912 node_conf = bld.new_task_gen('subst', before="cxx")
913 node_conf.source = 'tools/nodejs.pc.in'
914 node_conf.target = 'tools/nodejs.pc'
915 node_conf.dict = subflags(node)
916
8a50f23 @aredridel Add support for specifying the libdir
aredridel authored
917 bld.install_files('${LIBDIR}/pkgconfig', 'tools/nodejs.pc')
97c9745 @ry Back to WAF
ry authored
918
919 def shutdown():
920 Options.options.debug
921 # HACK to get binding.node out of build directory.
922 # better way to do this?
923 if Options.commands['configure']:
924 if not Options.options.use_openssl:
925 print "WARNING WARNING WARNING"
926 print "OpenSSL not found. Will compile Node without crypto support!"
4737219 @ry Print warning when using platform_none.cc
ry authored
927
928 if not Options.options.platform_file:
929 print "WARNING: Platform not fully supported. Using src/platform_none.cc"
930
97c9745 @ry Back to WAF
ry authored
931 elif not Options.commands['clean']:
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
932 if sys.platform.startswith("win32"):
d1bf9cf @piscisaureus After building overwrite existing ./node(_g)?.exe
piscisaureus authored
933 if os.path.exists('build/default/node.exe'):
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
934 os.system('cp build/default/node.exe .')
d1bf9cf @piscisaureus After building overwrite existing ./node(_g)?.exe
piscisaureus authored
935 if os.path.exists('build/debug/node_g.exe'):
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
936 os.system('cp build/debug/node_g.exe .')
937 else:
938 if os.path.exists('build/default/node') and not os.path.exists('node'):
939 os.symlink('build/default/node', 'node')
940 if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'):
941 os.symlink('build/debug/node_g', 'node_g')
97c9745 @ry Back to WAF
ry authored
942 else:
9f93329 @piscisaureus wscript: use "node.exe" and avoid symlinks on windows
piscisaureus authored
943 if sys.platform.startswith("win32"):
944 if os.path.exists('node.exe'): os.unlink('node.exe')
945 if os.path.exists('node_g.exe'): os.unlink('node_g.exe')
946 else:
947 if os.path.exists('node'): os.unlink('node')
948 if os.path.exists('node_g'): os.unlink('node_g')
Something went wrong with that request. Please try again.