Ryan | a3627c0 | 2009-05-27 14:29:55 | [diff] [blame] | 1 | # /usr/bin/env python |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 2 | import Options |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 3 | import sys, os, shutil |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 4 | from os.path import join, dirname, abspath |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 5 | from logging import fatal |
| 6 | |
Ryan | b73264d | 2009-08-27 00:15:11 | [diff] [blame] | 7 | VERSION="0.1.7" |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 8 | APPNAME="node.js" |
| 9 | |
Ryan | 63a9cd3 | 2009-04-15 08:08:28 | [diff] [blame] | 10 | import js2c |
| 11 | |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 12 | srcdir = '.' |
| 13 | blddir = 'build' |
Ryan | 115c494 | 2009-06-22 11:08:32 | [diff] [blame] | 14 | cwd = os.getcwd() |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 15 | |
| 16 | def set_options(opt): |
| 17 | # the gcc module provides a --debug-level option |
| 18 | opt.tool_options('compiler_cxx') |
| 19 | opt.tool_options('compiler_cc') |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 20 | opt.tool_options('misc') |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 21 | opt.add_option( '--debug' |
| 22 | , action='store_true' |
| 23 | , default=False |
| 24 | , help='Build debug variant [Default: False]' |
| 25 | , dest='debug' |
| 26 | ) |
Ryan | 7bad9de | 2009-06-16 13:47:57 | [diff] [blame] | 27 | opt.add_option( '--efence' |
| 28 | , action='store_true' |
| 29 | , default=False |
| 30 | , help='Build with -lefence for debugging [Default: False]' |
| 31 | , dest='efence' |
| 32 | ) |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 33 | |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 34 | def mkdir_p(dir): |
| 35 | if not os.path.exists (dir): |
| 36 | os.makedirs (dir) |
| 37 | |
| 38 | def conf_subproject (conf, subdir, command=None): |
| 39 | print("---- %s ----" % subdir) |
| 40 | src = join(conf.srcdir, subdir) |
| 41 | if not os.path.exists (src): fatal("no such subproject " + subdir) |
| 42 | |
| 43 | default_tgt = join(conf.blddir, "default", subdir) |
| 44 | |
| 45 | if not os.path.exists(default_tgt): |
| 46 | shutil.copytree(src, default_tgt) |
| 47 | |
| 48 | if command: |
| 49 | if os.system("cd %s && %s" % (default_tgt, command)) != 0: |
| 50 | fatal("Configuring %s failed." % (subdir)) |
| 51 | |
| 52 | debug_tgt = join(conf.blddir, "debug", subdir) |
| 53 | |
| 54 | if not os.path.exists(debug_tgt): |
| 55 | shutil.copytree(default_tgt, debug_tgt) |
| 56 | |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 57 | def configure(conf): |
| 58 | conf.check_tool('compiler_cxx') |
| 59 | conf.check_tool('compiler_cc') |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 60 | |
Ryan | 8e7bbf2 | 2009-04-23 17:26:56 | [diff] [blame] | 61 | conf.env["USE_DEBUG"] = Options.options.debug |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 62 | |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 63 | conf.check(lib='dl', uselib_store='DL') |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 64 | conf.env.append_value("LINKFLAGS_DL", "-rdynamic") |
| 65 | |
Ryan | 7bad9de | 2009-06-16 13:47:57 | [diff] [blame] | 66 | if Options.options.debug: |
| 67 | conf.check(lib='profiler', uselib_store='PROFILER') |
| 68 | |
| 69 | if Options.options.efence: |
| 70 | conf.check(lib='efence', libpath=['/usr/lib', '/usr/local/lib'], uselib_store='EFENCE') |
Ryan | a3627c0 | 2009-05-27 14:29:55 | [diff] [blame] | 71 | |
| 72 | if sys.platform.startswith("freebsd"): |
| 73 | if not conf.check(lib="execinfo", libpath=['/usr/lib', '/usr/local/lib'], uselib_store="EXECINFO"): |
Ryan | 7bad9de | 2009-06-16 13:47:57 | [diff] [blame] | 74 | fatal("Install the libexecinfo port from /usr/ports/devel/libexecinfo.") |
Ryan | a3627c0 | 2009-05-27 14:29:55 | [diff] [blame] | 75 | |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 76 | conf.sub_config('deps/libeio') |
| 77 | conf.sub_config('deps/libev') |
| 78 | |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 79 | conf_subproject(conf, 'deps/udns', './configure') |
| 80 | conf_subproject(conf, 'deps/v8') |
| 81 | |
Ryan | 452d3f1 | 2009-06-11 11:40:14 | [diff] [blame] | 82 | # Not using TLS yet |
| 83 | # if conf.check_cfg(package='gnutls', args='--cflags --libs', uselib_store="GNUTLS"): |
| 84 | # conf.define("HAVE_GNUTLS", 1) |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 85 | |
| 86 | conf.define("HAVE_CONFIG_H", 1) |
Ryan | c62b124 | 2009-04-22 17:55:08 | [diff] [blame] | 87 | |
Ryan | 7703ad5 | 2009-04-22 15:19:08 | [diff] [blame] | 88 | conf.env.append_value("CCFLAGS", "-DEIO_STACKSIZE=%d" % (4096*8)) |
Ryan | 427e3f5 | 2009-05-14 11:16:45 | [diff] [blame] | 89 | |
Ryan | 67af958 | 2009-04-18 13:35:42 | [diff] [blame] | 90 | # Split off debug variant before adding variant specific defines |
Ryan | 7e1350f | 2009-04-16 09:37:44 | [diff] [blame] | 91 | debug_env = conf.env.copy() |
| 92 | conf.set_env_name('debug', debug_env) |
Ryan | 7e1350f | 2009-04-16 09:37:44 | [diff] [blame] | 93 | |
Ryan | 67af958 | 2009-04-18 13:35:42 | [diff] [blame] | 94 | # Configure debug variant |
| 95 | conf.setenv('debug') |
| 96 | debug_env.set_variant('debug') |
Ryan | a623d76 | 2009-06-29 19:17:06 | [diff] [blame] | 97 | debug_env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra', '-m32']) |
| 98 | debug_env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-O0', '-Wall', '-Wextra', '-m32']) |
Ryan | 67af958 | 2009-04-18 13:35:42 | [diff] [blame] | 99 | conf.write_config_header("config.h") |
| 100 | |
| 101 | # Configure default variant |
| 102 | conf.setenv('default') |
Ryan | a623d76 | 2009-06-29 19:17:06 | [diff] [blame] | 103 | conf.env.append_value('CCFLAGS', ['-DNDEBUG', '-O3', '-m32']) |
| 104 | conf.env.append_value('CXXFLAGS', ['-DNDEBUG', '-O3', '-m32']) |
Ryan | 67af958 | 2009-04-18 13:35:42 | [diff] [blame] | 105 | conf.write_config_header("config.h") |
Ryan | 63a9cd3 | 2009-04-15 08:08:28 | [diff] [blame] | 106 | |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 107 | def build_udns(bld): |
| 108 | default_build_dir = bld.srcnode.abspath(bld.env_of_name("default")) |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 109 | |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 110 | default_dir = join(default_build_dir, "deps/udns") |
| 111 | |
| 112 | static_lib = bld.env["staticlib_PATTERN"] % "udns" |
| 113 | |
| 114 | rule = 'cd %s && make' |
| 115 | |
| 116 | default = bld.new_task_gen( |
| 117 | target= join("deps/udns", static_lib), |
| 118 | rule= rule % default_dir, |
| 119 | before= "cxx", |
| 120 | install_path= None |
| 121 | ) |
| 122 | |
| 123 | bld.env["CPPPATH_UDNS"] = "deps/udns" |
| 124 | bld.env["STATICLIB_UDNS"] = "udns" |
| 125 | |
| 126 | bld.env_of_name('default')["STATICLIB_UDNS"] = "udns" |
| 127 | bld.env_of_name('default')["LIBPATH_UDNS"] = default_dir |
| 128 | |
| 129 | if bld.env["USE_DEBUG"]: |
| 130 | debug_build_dir = bld.srcnode.abspath(bld.env_of_name("debug")) |
| 131 | debug_dir = join(debug_build_dir, "deps/udns") |
| 132 | debug = default.clone("debug") |
| 133 | debug.rule = rule % debug_dir |
| 134 | #debug.target = join(debug_dir, static_lib) |
| 135 | bld.env_of_name('debug')["STATICLIB_UDNS"] = "udns" |
| 136 | bld.env_of_name('debug')["LIBPATH_UDNS"] = debug_dir |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 137 | bld.install_files('${PREFIX}/include/node/', 'deps/udns/udns.h'); |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 138 | |
| 139 | |
| 140 | def build_v8(bld): |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 141 | deps_src = join(bld.path.abspath(),"deps") |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 142 | deps_tgt = join(bld.srcnode.abspath(bld.env_of_name("default")),"deps") |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 143 | v8dir_src = join(deps_src,"v8") |
| 144 | v8dir_tgt = join(deps_tgt, "v8") |
Ryan | 115c494 | 2009-06-22 11:08:32 | [diff] [blame] | 145 | scons = os.path.join(cwd, 'tools/scons/scons.py') |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 146 | |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 147 | v8rule = 'cd %s && ' \ |
Ryan | 115c494 | 2009-06-22 11:08:32 | [diff] [blame] | 148 | 'python %s -Q mode=%s library=static snapshot=on' |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 149 | |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 150 | v8 = bld.new_task_gen( |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 151 | target = join("deps/v8", bld.env["staticlib_PATTERN"] % "v8"), |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 152 | rule=v8rule % (v8dir_tgt, scons, "release"), |
Ryan | 8e7bbf2 | 2009-04-23 17:26:56 | [diff] [blame] | 153 | before="cxx", |
| 154 | install_path = None |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 155 | ) |
| 156 | bld.env["CPPPATH_V8"] = "deps/v8/include" |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 157 | bld.env_of_name('default')["STATICLIB_V8"] = "v8" |
| 158 | bld.env_of_name('default')["LIBPATH_V8"] = v8dir_tgt |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 159 | bld.env_of_name('default')["LINKFLAGS_V8"] = ["-pthread", "-m32"] |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 160 | |
| 161 | ### v8 debug |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 162 | if bld.env["USE_DEBUG"]: |
| 163 | deps_tgt = join(bld.srcnode.abspath(bld.env_of_name("debug")),"deps") |
| 164 | v8dir_tgt = join(deps_tgt, "v8") |
Ryan | a4593e3 | 2009-04-23 11:18:38 | [diff] [blame] | 165 | |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 166 | v8_debug = v8.clone("debug") |
| 167 | bld.env_of_name('debug')["STATICLIB_V8"] = "v8_g" |
| 168 | bld.env_of_name('debug')["LIBPATH_V8"] = v8dir_tgt |
Ryan | a623d76 | 2009-06-29 19:17:06 | [diff] [blame] | 169 | bld.env_of_name('debug')["LINKFLAGS_V8"] = ["-pthread", "-m32"] |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 170 | v8_debug.rule = v8rule % (v8dir_tgt, scons, "debug") |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 171 | v8_debug.target = join("deps/v8", bld.env["staticlib_PATTERN"] % "v8_g") |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 172 | |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 173 | bld.install_files('${PREFIX}/include/node/', 'deps/v8/include/v8*'); |
| 174 | |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 175 | def build(bld): |
| 176 | bld.add_subdirs('deps/libeio deps/libev') |
| 177 | |
| 178 | build_udns(bld) |
| 179 | build_v8(bld) |
| 180 | |
Ryan | 0fb0af3 | 2009-07-25 15:52:21 | [diff] [blame] | 181 | ### evcom |
| 182 | evcom = bld.new_task_gen("cc", "staticlib") |
| 183 | evcom.source = "deps/evcom/evcom.c" |
| 184 | evcom.includes = "deps/evcom/ deps/libev/" |
| 185 | evcom.name = "evcom" |
| 186 | evcom.target = "evcom" |
| 187 | # evcom.uselib = "GNUTLS" |
| 188 | evcom.install_path = None |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 189 | if bld.env["USE_DEBUG"]: |
Ryan | 0fb0af3 | 2009-07-25 15:52:21 | [diff] [blame] | 190 | evcom.clone("debug") |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 191 | bld.install_files('${PREFIX}/include/node/', 'deps/evcom/evcom.h'); |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 192 | |
Ryan | 5a071ad | 2009-05-03 12:09:16 | [diff] [blame] | 193 | ### http_parser |
| 194 | http_parser = bld.new_task_gen("cc", "staticlib") |
| 195 | http_parser.source = "deps/http_parser/http_parser.c" |
| 196 | http_parser.includes = "deps/http_parser/" |
| 197 | http_parser.name = "http_parser" |
| 198 | http_parser.target = "http_parser" |
| 199 | http_parser.install_path = None |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 200 | if bld.env["USE_DEBUG"]: |
Ryan | 5a071ad | 2009-05-03 12:09:16 | [diff] [blame] | 201 | http_parser.clone("debug") |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 202 | |
Ryan | 17c6a67 | 2009-08-24 18:25:24 | [diff] [blame] | 203 | ### coupling |
| 204 | coupling = bld.new_task_gen("cc", "staticlib") |
| 205 | coupling.source = "deps/coupling/coupling.c" |
| 206 | coupling.includes = "deps/coupling/" |
| 207 | coupling.name = "coupling" |
| 208 | coupling.target = "coupling" |
| 209 | coupling.install_path = None |
| 210 | if bld.env["USE_DEBUG"]: |
| 211 | coupling.clone("debug") |
| 212 | |
Ryan | 63a9cd3 | 2009-04-15 08:08:28 | [diff] [blame] | 213 | ### src/native.cc |
| 214 | def javascript_in_c(task): |
| 215 | env = task.env |
| 216 | source = map(lambda x: x.srcpath(env), task.inputs) |
| 217 | targets = map(lambda x: x.srcpath(env), task.outputs) |
| 218 | js2c.JS2C(source, targets) |
| 219 | |
| 220 | native_cc = bld.new_task_gen( |
Ryan | 2ecd7ff | 2009-06-25 17:13:20 | [diff] [blame] | 221 | source = """ |
Ryan | eb10553 | 2009-07-16 15:19:02 | [diff] [blame] | 222 | src/util.js |
Ryan | 2ecd7ff | 2009-06-25 17:13:20 | [diff] [blame] | 223 | src/events.js |
| 224 | src/http.js |
| 225 | src/file.js |
| 226 | src/node.js |
| 227 | """, |
Ryan | 63a9cd3 | 2009-04-15 08:08:28 | [diff] [blame] | 228 | target="src/natives.h", |
| 229 | rule=javascript_in_c, |
| 230 | before="cxx" |
| 231 | ) |
Ryan | 8e7bbf2 | 2009-04-23 17:26:56 | [diff] [blame] | 232 | native_cc.install_path = None |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 233 | if bld.env["USE_DEBUG"]: |
| 234 | native_cc.clone("debug") |
Ryan | 63a9cd3 | 2009-04-15 08:08:28 | [diff] [blame] | 235 | |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 236 | ### node lib |
| 237 | libnode = bld.new_task_gen("cxx", "shlib") |
| 238 | libnode.name = "node" |
| 239 | libnode.target = "node" |
| 240 | libnode.source = """ |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 241 | src/node.cc |
Ryan | 2ecd7ff | 2009-06-25 17:13:20 | [diff] [blame] | 242 | src/events.cc |
Ryan | 67af958 | 2009-04-18 13:35:42 | [diff] [blame] | 243 | src/http.cc |
Ryan | 707f244 | 2009-04-21 17:56:30 | [diff] [blame] | 244 | src/net.cc |
Ryan | 17c6a67 | 2009-08-24 18:25:24 | [diff] [blame] | 245 | src/node_stdio.cc |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 246 | src/dns.cc |
Ryan | 63a9cd3 | 2009-04-15 08:08:28 | [diff] [blame] | 247 | src/file.cc |
Ryan | f213a27 | 2009-04-29 09:00:46 | [diff] [blame] | 248 | src/timer.cc |
Ryan | ad9d683 | 2009-08-26 20:11:51 | [diff] [blame] | 249 | src/child_process.cc |
Ryan | b260a91 | 2009-05-26 17:48:49 | [diff] [blame] | 250 | src/constants.cc |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 251 | """ |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 252 | libnode.includes = """ |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 253 | src/ |
| 254 | deps/v8/include |
| 255 | deps/libev |
Ryan | 41d89f6 | 2009-07-28 10:29:18 | [diff] [blame] | 256 | deps/udns |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 257 | deps/libeio |
Ryan | 0fb0af3 | 2009-07-25 15:52:21 | [diff] [blame] | 258 | deps/evcom |
Ryan | 5a071ad | 2009-05-03 12:09:16 | [diff] [blame] | 259 | deps/http_parser |
Ryan | 17c6a67 | 2009-08-24 18:25:24 | [diff] [blame] | 260 | deps/coupling |
Ryan | 1a126ed | 2009-04-04 12:50:15 | [diff] [blame] | 261 | """ |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 262 | libnode.uselib_local = "evcom ev eio http_parser coupling" |
| 263 | libnode.uselib = "UDNS V8 EXECINFO PROFILER EFENCE DL" |
| 264 | libnode.install_path = '${PREFIX}/lib' |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 265 | |
| 266 | |
| 267 | libnode_static = bld.new_task_gen("cxx", "staticlib") |
| 268 | libnode_static.name = "node-static" |
| 269 | libnode_static.target = libnode.target |
| 270 | libnode_static.source = libnode.source |
| 271 | libnode_static.includes = libnode.includes |
| 272 | libnode_static.uselib_local = libnode.uselib_local |
| 273 | libnode_static.uselib = libnode.uselib |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 274 | |
| 275 | ### node |
| 276 | node = bld.new_task_gen("cxx", "program") |
| 277 | node.target = 'node' |
| 278 | node.source = "src/main.cc" |
| 279 | node.includes = libnode.includes |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 280 | node.uselib_local = "node-static" |
Ryan | 8e7bbf2 | 2009-04-23 17:26:56 | [diff] [blame] | 281 | node.install_path = '${PREFIX}/bin' |
| 282 | node.chmod = 0755 |
| 283 | |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 284 | def subflags(program): |
Ryan | b73264d | 2009-08-27 00:15:11 | [diff] [blame] | 285 | x = { 'CCFLAGS' : " ".join(program.env["CCFLAGS"]) |
| 286 | , 'CPPFLAGS' : " ".join(program.env["CPPFLAGS"]) |
| 287 | , 'LIBFLAGS' : " ".join(program.env["LIBFLAGS"]) |
| 288 | , 'VERSION' : VERSION |
| 289 | , 'PREFIX' : program.env["PREFIX"] |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 290 | } |
| 291 | return x; |
| 292 | |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 293 | # process file.pc.in -> file.pc |
| 294 | pkgconfig = bld.new_task_gen('subst', before="cxx") |
| 295 | pkgconfig.source = 'src/node.pc.in' |
| 296 | pkgconfig.target = 'node.pc' |
| 297 | pkgconfig.install_path = '${PREFIX}/lib/pkgconfig' |
| 298 | pkgconfig.dict = subflags(node) |
| 299 | |
Ryan | b73264d | 2009-08-27 00:15:11 | [diff] [blame] | 300 | # process file.pc.in -> file.pc |
| 301 | node_version = bld.new_task_gen('subst', before="cxx") |
| 302 | node_version.source = 'src/node_version.h.in' |
| 303 | node_version.target = 'src/node_version.h' |
| 304 | node_version.dict = subflags(node) |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 305 | node_version.install_path = '${PREFIX}/include/node' |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 306 | |
Ryan | 29b528c | 2009-04-23 15:29:31 | [diff] [blame] | 307 | if bld.env["USE_DEBUG"]: |
Ryan | 2b6d724 | 2009-06-20 13:07:10 | [diff] [blame] | 308 | node_g = node.clone("debug") |
| 309 | node_g.target = "node_g" |
| 310 | |
| 311 | libnode_g = libnode.clone("debug") |
| 312 | libnode_g.target = "node_g" |
Ryan | 67af958 | 2009-04-18 13:35:42 | [diff] [blame] | 313 | |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 314 | libnode_static_g = libnode_static.clone("debug") |
| 315 | libnode_static_g.target = "node_g" |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 316 | |
Ryan | b73264d | 2009-08-27 00:15:11 | [diff] [blame] | 317 | node_version_g = node_version.clone("debug") |
| 318 | node_version_g.dict = subflags(node_g) |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 319 | node_version_g.install_path = None |
Ryan | 4d92199 | 2009-08-26 23:11:16 | [diff] [blame] | 320 | |
Ryan | a97dce7 | 2009-08-31 09:14:34 | [diff] [blame^] | 321 | |
| 322 | bld.install_files('${PREFIX}/include/node/', """ |
| 323 | config.h |
| 324 | src/node.h |
| 325 | src/object_wrap.h |
| 326 | src/events.h |
| 327 | src/net.h |
| 328 | """); |