Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 442 lines (369 sloc) 14.119 kB
a3627c0 @ry Change to build on FreeBSD
ry authored
1 # /usr/bin/env python
8ddf930 @ry Build natively on x64.
ry authored
2 import re
1a126ed @ry use the WAF build system
ry authored
3 import Options
41d89f6 @ry Add DNS API.
ry authored
4 import sys, os, shutil
d979ac9 @ry Put git revision into version string
ry authored
5 from Utils import cmd_output
1a126ed @ry use the WAF build system
ry authored
6 from os.path import join, dirname, abspath
a4593e3 @ry WAF: fix the debug variant.
ry authored
7 from logging import fatal
8
d979ac9 @ry Put git revision into version string
ry authored
9 cwd = os.getcwd()
39ca935 @ry bump version
ry authored
10 VERSION="0.1.25"
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
11 APPNAME="node.js"
12
63a9cd3 @ry everything is changed. i've waited much too long to commit.
ry authored
13 import js2c
14
1a126ed @ry use the WAF build system
ry authored
15 srcdir = '.'
16 blddir = 'build'
17
18 def set_options(opt):
19 # the gcc module provides a --debug-level option
20 opt.tool_options('compiler_cxx')
21 opt.tool_options('compiler_cc')
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
22 opt.tool_options('misc')
29b528c @ry fix the waf configure --debug options. seems to work now.
ry authored
23 opt.add_option( '--debug'
24 , action='store_true'
25 , default=False
26 , help='Build debug variant [Default: False]'
27 , dest='debug'
28 )
7bad9de @ry Add electric fence option to configure process
ry authored
29 opt.add_option( '--efence'
30 , action='store_true'
31 , default=False
32 , help='Build with -lefence for debugging [Default: False]'
33 , dest='efence'
34 )
1a126ed @ry use the WAF build system
ry authored
35
41d89f6 @ry Add DNS API.
ry authored
36 def mkdir_p(dir):
37 if not os.path.exists (dir):
38 os.makedirs (dir)
39
18da8ff @ry Copy Python's shutil.copytree into wscript.
ry authored
40 # Copied from Python 2.6 because 2.4.4 at least is broken by not using
41 # mkdirs
42 # http://mail.python.org/pipermail/python-bugs-list/2005-January/027118.html
43 def copytree(src, dst, symlinks=False, ignore=None):
44 names = os.listdir(src)
45 if ignore is not None:
46 ignored_names = ignore(src, names)
47 else:
48 ignored_names = set()
49
50 os.makedirs(dst)
51 errors = []
52 for name in names:
53 if name in ignored_names:
54 continue
53ebe75 @ry Improve build for V8
ry authored
55 srcname = join(src, name)
56 dstname = join(dst, name)
18da8ff @ry Copy Python's shutil.copytree into wscript.
ry authored
57 try:
58 if symlinks and os.path.islink(srcname):
59 linkto = os.readlink(srcname)
60 os.symlink(linkto, dstname)
61 elif os.path.isdir(srcname):
62 copytree(srcname, dstname, symlinks, ignore)
63 else:
64 shutil.copy2(srcname, dstname)
65 # XXX What about devices, sockets etc.?
66 except (IOError, os.error), why:
67 errors.append((srcname, dstname, str(why)))
68 # catch the Error from the recursive copytree so that we can
69 # continue with other files
70 except Error, err:
71 errors.extend(err.args[0])
72 try:
73 shutil.copystat(src, dst)
74 except OSError, why:
75 if WindowsError is not None and isinstance(why, WindowsError):
76 # Copying file access times may fail on Windows
77 pass
78 else:
79 errors.extend((src, dst, str(why)))
80 if errors:
81 raise Error, errors
82
41d89f6 @ry Add DNS API.
ry authored
83 def conf_subproject (conf, subdir, command=None):
84 print("---- %s ----" % subdir)
85 src = join(conf.srcdir, subdir)
e801f42 @simoncpu Use conf.fatal() instead of fatal() in order to abort the configure s…
simoncpu authored
86 if not os.path.exists (src): conf.fatal("no such subproject " + subdir)
41d89f6 @ry Add DNS API.
ry authored
87
88 default_tgt = join(conf.blddir, "default", subdir)
89
90 if not os.path.exists(default_tgt):
18da8ff @ry Copy Python's shutil.copytree into wscript.
ry authored
91 copytree(src, default_tgt, True)
41d89f6 @ry Add DNS API.
ry authored
92
93 if command:
94 if os.system("cd %s && %s" % (default_tgt, command)) != 0:
e801f42 @simoncpu Use conf.fatal() instead of fatal() in order to abort the configure s…
simoncpu authored
95 conf.fatal("Configuring %s failed." % (subdir))
41d89f6 @ry Add DNS API.
ry authored
96
97 debug_tgt = join(conf.blddir, "debug", subdir)
98
99 if not os.path.exists(debug_tgt):
18da8ff @ry Copy Python's shutil.copytree into wscript.
ry authored
100 copytree(default_tgt, debug_tgt, True)
41d89f6 @ry Add DNS API.
ry authored
101
1a126ed @ry use the WAF build system
ry authored
102 def configure(conf):
103 conf.check_tool('compiler_cxx')
f379b77 @ry Error out when no compiler found
ry authored
104 if not conf.env.CXX: conf.fatal('c++ compiler not found')
1a126ed @ry use the WAF build system
ry authored
105 conf.check_tool('compiler_cc')
f379b77 @ry Error out when no compiler found
ry authored
106 if not conf.env.CC: conf.fatal('c compiler not found')
a4593e3 @ry WAF: fix the debug variant.
ry authored
107
8e7bbf2 @ry get 'make install' working
ry authored
108 conf.env["USE_DEBUG"] = Options.options.debug
1a126ed @ry use the WAF build system
ry authored
109
2b6d724 @ry First attempt at node.dlopen
ry authored
110 conf.check(lib='dl', uselib_store='DL')
0c12554 @ry Initial Solaris support
ry authored
111 if not sys.platform.startswith("sunos"):
112 conf.env.append_value("CCFLAGS", "-rdynamic")
113 conf.env.append_value("LINKFLAGS_DL", "-rdynamic")
a97dce7 @ry Build static executable.
ry authored
114
d22952b getmem for freebsd
Vanilla Hsu authored
115 if sys.platform.startswith("freebsd"):
116 conf.check(lib='kvm', uselib_store='KVM')
117
8152f9c @ry Revert static library build.
ry authored
118 #if Options.options.debug:
119 # conf.check(lib='profiler', uselib_store='PROFILER')
7bad9de @ry Add electric fence option to configure process
ry authored
120
8152f9c @ry Revert static library build.
ry authored
121 #if Options.options.efence:
122 # conf.check(lib='efence', libpath=['/usr/lib', '/usr/local/lib'], uselib_store='EFENCE')
a3627c0 @ry Change to build on FreeBSD
ry authored
123
8b62e86 @ry Fix tabs in changelog
ry authored
124 if not conf.check(lib="execinfo", libpath=['/usr/lib', '/usr/local/lib'], uselib_store="EXECINFO"):
6eb8bbc @rsms note about why execinfo detection fails on Darwin even though it exists
rsms authored
125 # Note on Darwin/OS X: This will fail, but will still be used as the
126 # execinfo stuff are part of the standard library.
8b62e86 @ry Fix tabs in changelog
ry authored
127 if sys.platform.startswith("freebsd"):
e801f42 @simoncpu Use conf.fatal() instead of fatal() in order to abort the configure s…
simoncpu authored
128 conf.fatal("Install the libexecinfo port from /usr/ports/devel/libexecinfo.")
a3627c0 @ry Change to build on FreeBSD
ry authored
129
b6dda61 @waveto Initial TLS support
waveto authored
130 if conf.check_cfg(package='gnutls',
131 args='--cflags --libs',
8a58e83 @ry Add gnutls version to configure script
ry authored
132 atleast_version='2.5.0',
b6dda61 @waveto Initial TLS support
waveto authored
133 #libpath=['/usr/lib', '/usr/local/lib'],
134 uselib_store='GNUTLS'):
135 if conf.check(lib='gpg-error',
d22952b getmem for freebsd
Vanilla Hsu authored
136 libpath=['/usr/lib', '/usr/local/lib'],
b6dda61 @waveto Initial TLS support
waveto authored
137 uselib_store='GPGERROR'):
138 conf.env.append_value("CCFLAGS", "-DEVCOM_HAVE_GNUTLS=1")
139 conf.env.append_value("CXXFLAGS", "-DEVCOM_HAVE_GNUTLS=1")
140
0c12554 @ry Initial Solaris support
ry authored
141 if sys.platform.startswith("sunos"):
142 if not conf.check(lib='socket', uselib_store="SOCKET"):
143 conf.fatal("Cannot find socket library")
144 if not conf.check(lib='nsl', uselib_store="NSL"):
145 conf.fatal("Cannot find nsl library")
146
1a126ed @ry use the WAF build system
ry authored
147 conf.sub_config('deps/libeio')
148 conf.sub_config('deps/libev')
149
0c12554 @ry Initial Solaris support
ry authored
150 if sys.platform.startswith("sunos"):
151 conf_subproject(conf, 'deps/udns', 'LIBS="-lsocket -lnsl" ./configure')
152 else:
153 conf_subproject(conf, 'deps/udns', './configure')
41d89f6 @ry Add DNS API.
ry authored
154
1a126ed @ry use the WAF build system
ry authored
155 conf.define("HAVE_CONFIG_H", 1)
c62b124 @ry add scons local for v8. check for librt in wscript
ry authored
156
1df6d61 @ry Upgrade libeio, increase xthread stacksize to 64kb.
ry authored
157 conf.env.append_value("CCFLAGS", "-DX_STACKSIZE=%d" % (1024*64))
427e3f5 @ry Introduce NODE_SET_PROTOTYPE_METHOD which properly sets the signature.
ry authored
158
2b743aa @ry Enable large file support.
ry authored
159 # LFS
160 conf.env.append_value('CCFLAGS', '-D_LARGEFILE_SOURCE')
161 conf.env.append_value('CXXFLAGS', '-D_LARGEFILE_SOURCE')
162 conf.env.append_value('CCFLAGS', '-D_FILE_OFFSET_BITS=64')
163 conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
164
f481183 @ry Add process.platform
ry authored
165 # platform
166 platform_def = '-DPLATFORM=' + sys.platform
167 conf.env.append_value('CCFLAGS', platform_def)
168 conf.env.append_value('CXXFLAGS', platform_def)
169
67af958 @ry rename a few files to remove node_ prefix
ry authored
170 # Split off debug variant before adding variant specific defines
7e1350f @ry add file.write()
ry authored
171 debug_env = conf.env.copy()
172 conf.set_env_name('debug', debug_env)
67af958 @ry rename a few files to remove node_ prefix
ry authored
173
174 # Configure debug variant
7e1350f @ry add file.write()
ry authored
175 conf.setenv('debug')
67af958 @ry rename a few files to remove node_ prefix
ry authored
176 debug_env.set_variant('debug')
8ddf930 @ry Build natively on x64.
ry authored
177 debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
178 debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra'])
67af958 @ry rename a few files to remove node_ prefix
ry authored
179 conf.write_config_header("config.h")
7e1350f @ry add file.write()
ry authored
180
67af958 @ry rename a few files to remove node_ prefix
ry authored
181 # Configure default variant
182 conf.setenv('default')
8ddf930 @ry Build natively on x64.
ry authored
183 conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-O3'])
184 conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-O3'])
67af958 @ry rename a few files to remove node_ prefix
ry authored
185 conf.write_config_header("config.h")
63a9cd3 @ry everything is changed. i've waited much too long to commit.
ry authored
186
41d89f6 @ry Add DNS API.
ry authored
187 def build_udns(bld):
188 default_build_dir = bld.srcnode.abspath(bld.env_of_name("default"))
189
190 default_dir = join(default_build_dir, "deps/udns")
191
192 static_lib = bld.env["staticlib_PATTERN"] % "udns"
1a126ed @ry use the WAF build system
ry authored
193
41d89f6 @ry Add DNS API.
ry authored
194 rule = 'cd %s && make'
195
196 default = bld.new_task_gen(
197 target= join("deps/udns", static_lib),
198 rule= rule % default_dir,
199 before= "cxx",
200 install_path= None
201 )
202
203 bld.env["CPPPATH_UDNS"] = "deps/udns"
fc937aa @ry Use full path to link to libv8.a and libudns.a
ry authored
204 t = join(bld.srcnode.abspath(bld.env_of_name("default")), default.target)
205 bld.env_of_name('default')["LINKFLAGS_UDNS"] = [t]
41d89f6 @ry Add DNS API.
ry authored
206
207 if bld.env["USE_DEBUG"]:
208 debug_build_dir = bld.srcnode.abspath(bld.env_of_name("debug"))
209 debug_dir = join(debug_build_dir, "deps/udns")
210 debug = default.clone("debug")
211 debug.rule = rule % debug_dir
fc937aa @ry Use full path to link to libv8.a and libudns.a
ry authored
212 t = join(bld.srcnode.abspath(bld.env_of_name("debug")), debug.target)
213 bld.env_of_name('debug')["LINKFLAGS_UDNS"] = [t]
0c12554 @ry Initial Solaris support
ry authored
214
bf0d278 @ry Improve "make dist" remove generated doc from repo.
ry authored
215 bld.install_files('${PREFIX}/include/node/', 'deps/udns/udns.h')
41d89f6 @ry Add DNS API.
ry authored
216
53ebe75 @ry Improve build for V8
ry authored
217 def v8_cmd(bld, variant):
218 scons = join(cwd, 'tools/scons/scons.py')
1a126ed @ry use the WAF build system
ry authored
219 deps_src = join(bld.path.abspath(),"deps")
220 v8dir_src = join(deps_src,"v8")
53ebe75 @ry Improve build for V8
ry authored
221
bc9b343 @ry Add note about symbol visibility in V8 to wscript
ry authored
222 # NOTE: We want to compile V8 to export its symbols. I.E. Do not want
223 # -fvisibility=hidden. When using dlopen() it seems that the loaded DSO
224 # cannot see symbols in the executable which are hidden, even if the
225 # executable is statically linked together...
8ddf930 @ry Build natively on x64.
ry authored
226
7d9d881 @ry Correctly guess x64 architecture
ry authored
227 # XXX Remove this when v8 defaults x86_64 to native builds
d85724d @ry Fix wscript for python 2.4
ry authored
228 arch = ""
7d9d881 @ry Correctly guess x64 architecture
ry authored
229 if bld.env['DEST_CPU'] == 'x86_64':
d85724d @ry Fix wscript for python 2.4
ry authored
230 arch = "arch=x64"
231
232 if variant == "default":
233 mode = "release"
234 else:
235 mode = "debug"
a4593e3 @ry WAF: fix the debug variant.
ry authored
236
53ebe75 @ry Improve build for V8
ry authored
237 cmd_R = 'python %s -C %s -Y %s visibility=default mode=%s %s library=static snapshot=on'
238
239 cmd = cmd_R % ( scons
240 , bld.srcnode.abspath(bld.env_of_name(variant))
241 , v8dir_src
242 , mode
243 , arch
244 )
245 return cmd
246
247
248 def build_v8(bld):
1a126ed @ry use the WAF build system
ry authored
249 v8 = bld.new_task_gen(
59b7a1b @ry More updates to wscripts v8 building.
ry authored
250 source = 'deps/v8/SConstruct '
251 + bld.path.ant_glob('v8/include/*')
252 + bld.path.ant_glob('v8/src/*'),
53ebe75 @ry Improve build for V8
ry authored
253 target = bld.env["staticlib_PATTERN"] % "v8",
254 rule = v8_cmd(bld, "default"),
255 before = "cxx",
256 install_path = None
1a126ed @ry use the WAF build system
ry authored
257 )
8b62e86 @ry Fix tabs in changelog
ry authored
258 v8.uselib = "EXECINFO"
1a126ed @ry use the WAF build system
ry authored
259 bld.env["CPPPATH_V8"] = "deps/v8/include"
fc937aa @ry Use full path to link to libv8.a and libudns.a
ry authored
260 t = join(bld.srcnode.abspath(bld.env_of_name("default")), v8.target)
0c12554 @ry Initial Solaris support
ry authored
261 if sys.platform.startswith("sunos"):
262 bld.env_of_name('default')["LINKFLAGS_V8"] = ["-mt", t]
263 else:
264 bld.env_of_name('default')["LINKFLAGS_V8"] = ["-pthread", t]
a4593e3 @ry WAF: fix the debug variant.
ry authored
265
266 ### v8 debug
29b528c @ry fix the waf configure --debug options. seems to work now.
ry authored
267 if bld.env["USE_DEBUG"]:
268 v8_debug = v8.clone("debug")
53ebe75 @ry Improve build for V8
ry authored
269 v8_debug.rule = v8_cmd(bld, "debug")
270 v8_debug.target = bld.env["staticlib_PATTERN"] % "v8_g"
8b62e86 @ry Fix tabs in changelog
ry authored
271 v8_debug.uselib = "EXECINFO"
fc937aa @ry Use full path to link to libv8.a and libudns.a
ry authored
272 t = join(bld.srcnode.abspath(bld.env_of_name("debug")), v8_debug.target)
0c12554 @ry Initial Solaris support
ry authored
273 if sys.platform.startswith("sunos"):
274 bld.env_of_name('debug')["LINKFLAGS_V8"] = ["-mt", t]
275 else:
276 bld.env_of_name('debug')["LINKFLAGS_V8"] = ["-pthread", t]
1a126ed @ry use the WAF build system
ry authored
277
53ebe75 @ry Improve build for V8
ry authored
278 bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/*.h')
2b6d724 @ry First attempt at node.dlopen
ry authored
279
41d89f6 @ry Add DNS API.
ry authored
280 def build(bld):
281 bld.add_subdirs('deps/libeio deps/libev')
282
283 build_udns(bld)
284 build_v8(bld)
285
0fb0af3 @ry Rename evnet to evcom.
ry authored
286 ### evcom
122e74b @ry Link to objects instead of shlibs for evcom, http_parser, coupling
ry authored
287 evcom = bld.new_task_gen("cc")
0fb0af3 @ry Rename evnet to evcom.
ry authored
288 evcom.source = "deps/evcom/evcom.c"
289 evcom.includes = "deps/evcom/ deps/libev/"
290 evcom.name = "evcom"
291 evcom.target = "evcom"
b6dda61 @waveto Initial TLS support
waveto authored
292 evcom.uselib = "GPGERROR GNUTLS"
0fb0af3 @ry Rename evnet to evcom.
ry authored
293 evcom.install_path = None
29b528c @ry fix the waf configure --debug options. seems to work now.
ry authored
294 if bld.env["USE_DEBUG"]:
0fb0af3 @ry Rename evnet to evcom.
ry authored
295 evcom.clone("debug")
bf0d278 @ry Improve "make dist" remove generated doc from repo.
ry authored
296 bld.install_files('${PREFIX}/include/node/', 'deps/evcom/evcom.h')
1a126ed @ry use the WAF build system
ry authored
297
5a071ad @ry Begin refactor of http.cc. Remove libebb add http_parser.
ry authored
298 ### http_parser
122e74b @ry Link to objects instead of shlibs for evcom, http_parser, coupling
ry authored
299 http_parser = bld.new_task_gen("cc")
5a071ad @ry Begin refactor of http.cc. Remove libebb add http_parser.
ry authored
300 http_parser.source = "deps/http_parser/http_parser.c"
301 http_parser.includes = "deps/http_parser/"
302 http_parser.name = "http_parser"
303 http_parser.target = "http_parser"
304 http_parser.install_path = None
29b528c @ry fix the waf configure --debug options. seems to work now.
ry authored
305 if bld.env["USE_DEBUG"]:
5a071ad @ry Begin refactor of http.cc. Remove libebb add http_parser.
ry authored
306 http_parser.clone("debug")
1a126ed @ry use the WAF build system
ry authored
307
17c6a67 @ry Introduce node.stdio
ry authored
308 ### coupling
122e74b @ry Link to objects instead of shlibs for evcom, http_parser, coupling
ry authored
309 coupling = bld.new_task_gen("cc")
17c6a67 @ry Introduce node.stdio
ry authored
310 coupling.source = "deps/coupling/coupling.c"
311 coupling.includes = "deps/coupling/"
312 coupling.name = "coupling"
313 coupling.target = "coupling"
314 coupling.install_path = None
315 if bld.env["USE_DEBUG"]:
316 coupling.clone("debug")
317
63a9cd3 @ry everything is changed. i've waited much too long to commit.
ry authored
318 ### src/native.cc
319 def javascript_in_c(task):
320 env = task.env
321 source = map(lambda x: x.srcpath(env), task.inputs)
322 targets = map(lambda x: x.srcpath(env), task.outputs)
323 js2c.JS2C(source, targets)
324
325 native_cc = bld.new_task_gen(
d737a06 @ry Combine all compiled javascript files into src/node.js
ry authored
326 source='src/node.js',
53ebe75 @ry Improve build for V8
ry authored
327 target="src/node_natives.h",
63a9cd3 @ry everything is changed. i've waited much too long to commit.
ry authored
328 before="cxx"
329 )
8e7bbf2 @ry get 'make install' working
ry authored
330 native_cc.install_path = None
4bcb01c @ry Add work-around for configure --debug with Python 2.4.3
ry authored
331
332 # Add the rule /after/ cloning the debug
333 # This is a work around for an error had in python 2.4.3 (I'll paste the
334 # error that was had into the git commit meessage. git-blame to find out
335 # where.)
29b528c @ry fix the waf configure --debug options. seems to work now.
ry authored
336 if bld.env["USE_DEBUG"]:
4bcb01c @ry Add work-around for configure --debug with Python 2.4.3
ry authored
337 native_cc_debug = native_cc.clone("debug")
338 native_cc_debug.rule = javascript_in_c
339 native_cc.rule = javascript_in_c
63a9cd3 @ry everything is changed. i've waited much too long to commit.
ry authored
340
2b6d724 @ry First attempt at node.dlopen
ry authored
341 ### node lib
8152f9c @ry Revert static library build.
ry authored
342 node = bld.new_task_gen("cxx", "program")
343 node.name = "node"
344 node.target = "node"
345 node.source = """
1a126ed @ry use the WAF build system
ry authored
346 src/node.cc
a5df0f6 @ry Prefix all source files with node_
ry authored
347 src/node_child_process.cc
348 src/node_constants.cc
349 src/node_dns.cc
350 src/node_events.cc
351 src/node_file.cc
352 src/node_http.cc
353 src/node_net.cc
354 src/node_signal_handler.cc
8d2f9e8 @ry Add process.watchFile() process.unwatchFile()
ry authored
355 src/node_stat.cc
17c6a67 @ry Introduce node.stdio
ry authored
356 src/node_stdio.cc
a5df0f6 @ry Prefix all source files with node_
ry authored
357 src/node_timer.cc
aeb7d6d @ry Add process.IdleWatcher
ry authored
358 src/node_idle_watcher.cc
1a126ed @ry use the WAF build system
ry authored
359 """
8152f9c @ry Revert static library build.
ry authored
360 node.includes = """
1a126ed @ry use the WAF build system
ry authored
361 src/
362 deps/v8/include
363 deps/libev
41d89f6 @ry Add DNS API.
ry authored
364 deps/udns
1a126ed @ry use the WAF build system
ry authored
365 deps/libeio
0fb0af3 @ry Rename evnet to evcom.
ry authored
366 deps/evcom
5a071ad @ry Begin refactor of http.cc. Remove libebb add http_parser.
ry authored
367 deps/http_parser
17c6a67 @ry Introduce node.stdio
ry authored
368 deps/coupling
1a126ed @ry use the WAF build system
ry authored
369 """
122e74b @ry Link to objects instead of shlibs for evcom, http_parser, coupling
ry authored
370 node.add_objects = 'ev eio evcom http_parser coupling'
371 node.uselib_local = ''
0c12554 @ry Initial Solaris support
ry authored
372 node.uselib = 'GNUTLS GPGERROR UDNS V8 EXECINFO DL KVM SOCKET NSL'
b6dda61 @waveto Initial TLS support
waveto authored
373
8152f9c @ry Revert static library build.
ry authored
374 node.install_path = '${PREFIX}/lib'
8e7bbf2 @ry get 'make install' working
ry authored
375 node.install_path = '${PREFIX}/bin'
376 node.chmod = 0755
377
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
378 def subflags(program):
d979ac9 @ry Put git revision into version string
ry authored
379 if os.path.exists(join(cwd, ".git")):
962e929 @ry 'git-describe' to 'git describe'
ry authored
380 actual_version=cmd_output("git describe").strip()
d979ac9 @ry Put git revision into version string
ry authored
381 else:
382 actual_version=VERSION
383
b73264d @ry Add command line arguments for accessing build flags.
ry authored
384 x = { 'CCFLAGS' : " ".join(program.env["CCFLAGS"])
385 , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"])
386 , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"])
d979ac9 @ry Put git revision into version string
ry authored
387 , 'VERSION' : actual_version
b73264d @ry Add command line arguments for accessing build flags.
ry authored
388 , 'PREFIX' : program.env["PREFIX"]
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
389 }
bf0d278 @ry Improve "make dist" remove generated doc from repo.
ry authored
390 return x
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
391
392 # process file.pc.in -> file.pc
d979ac9 @ry Put git revision into version string
ry authored
393
b73264d @ry Add command line arguments for accessing build flags.
ry authored
394 node_version = bld.new_task_gen('subst', before="cxx")
395 node_version.source = 'src/node_version.h.in'
396 node_version.target = 'src/node_version.h'
397 node_version.dict = subflags(node)
a97dce7 @ry Build static executable.
ry authored
398 node_version.install_path = '${PREFIX}/include/node'
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
399
29b528c @ry fix the waf configure --debug options. seems to work now.
ry authored
400 if bld.env["USE_DEBUG"]:
2b6d724 @ry First attempt at node.dlopen
ry authored
401 node_g = node.clone("debug")
402 node_g.target = "node_g"
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
403
b73264d @ry Add command line arguments for accessing build flags.
ry authored
404 node_version_g = node_version.clone("debug")
405 node_version_g.dict = subflags(node_g)
a97dce7 @ry Build static executable.
ry authored
406 node_version_g.install_path = None
407
4d92199 @ry Add pkgconfig files to help with dll builds.
ry authored
408
a97dce7 @ry Build static executable.
ry authored
409 bld.install_files('${PREFIX}/include/node/', """
410 config.h
411 src/node.h
5f466c8 @ry fix make install (was broken from node_ prefix change)
ry authored
412 src/node_object_wrap.h
413 src/node_events.h
414 src/node_net.h
bf0d278 @ry Improve "make dist" remove generated doc from repo.
ry authored
415 """)
416
417 # Only install the man page if it exists.
418 # Do 'make doc install' to build and install it.
419 if os.path.exists('doc/node.1'):
420 bld.install_files('${PREFIX}/share/man/man1/', 'doc/node.1')
421
422 bld.install_files('${PREFIX}/bin/', 'bin/*', chmod=0755)
6f17ca5 @ry Install wafadmin into $PREFIX/lib/node/wafadmin
ry authored
423
424 # Why am I using two lines? Because WAF SUCKS.
bf0d278 @ry Improve "make dist" remove generated doc from repo.
ry authored
425 bld.install_files('${PREFIX}/lib/node/wafadmin', 'tools/wafadmin/*.py')
426 bld.install_files('${PREFIX}/lib/node/wafadmin/Tools', 'tools/wafadmin/Tools/*.py')
6f17ca5 @ry Install wafadmin into $PREFIX/lib/node/wafadmin
ry authored
427
bf0d278 @ry Improve "make dist" remove generated doc from repo.
ry authored
428 bld.install_files('${PREFIX}/lib/node/libraries/', 'lib/*.js')
132d685 @ry Add symlinks in root directory to executables after build.
ry authored
429
430 def shutdown():
431 Options.options.debug
432 # HACK to get binding.node out of build directory.
433 # better way to do this?
434 if not Options.commands['clean']:
435 if os.path.exists('build/default/node') and not os.path.exists('node'):
436 os.symlink('build/default/node', 'node')
437 if os.path.exists('build/debug/node_g') and not os.path.exists('node_g'):
438 os.symlink('build/debug/node_g', 'node_g')
439 else:
440 if os.path.exists('node'): os.unlink('node')
441 if os.path.exists('node_g'): os.unlink('node_g')
Something went wrong with that request. Please try again.