The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.

Please select the desired protocol below to get the URL.

This URL has Read-Only access.

Statistics
| Branch: | Revision:

main_repo / wscript @ 1a126ed1

History | View | Annotate | Download (2.36 KB)

1
#! /usr/bin/env python
2
import Options
3
import os
4
from os.path import join, dirname, abspath
5

    
6
VERSION='0.0.1'
7
APPNAME='node'
8

    
9
srcdir = '.'
10
blddir = 'build'
11

    
12
def set_options(opt):
13
  # the gcc module provides a --debug-level option
14
  opt.tool_options('compiler_cxx')
15
  opt.tool_options('compiler_cc')
16
  opt.tool_options('ragel', tdir = '.')
17

    
18
def configure(conf):
19
  conf.check_tool('compiler_cxx')
20
  conf.check_tool('compiler_cc')
21
  conf.check_tool('ragel', tooldir = '.')
22

    
23
  conf.sub_config('deps/libeio')
24
  conf.sub_config('deps/libev')
25

    
26
  # needs to match the symbols found in libeio and libev
27
  # __solaris
28
  # __linux
29
  # __freebsd
30
  # __hpux
31
  # __solaris
32
  platform_string = "__" + Options.platform
33
  if Options.platform == "linux2":
34
    platform_string = "__linux"
35
  conf.define(platform_string, 1)
36

    
37
  # liboi config
38
  print "--- liboi ---"
39
  if conf.check_cfg(package='gnutls', args='--cflags --libs', uselib_store="GNUTLS"):
40
    conf.define("HAVE_GNUTLS", 1)
41

    
42
  conf.define("HAVE_CONFIG_H", 1)
43
  conf.write_config_header('config.h')
44

    
45

    
46
def build(bld):
47

    
48
  bld.add_subdirs('deps/libeio deps/libev')
49

    
50
  ### v8
51
  deps_src = join(bld.path.abspath(),"deps")
52
  deps_tgt = join(bld.srcnode.abspath(bld.env),"deps")
53
  v8dir_src = join(deps_src,"v8")
54
  v8dir_tgt = join(deps_tgt, "v8")
55
  v8lib = bld.env["staticlib_PATTERN"] % "v8"
56
  v8 = bld.new_task_gen(
57
    target=join("deps/v8",v8lib),
58
    rule='cp -rf %s %s && cd %s && scons library=static' 
59
      % ( v8dir_src
60
        , deps_tgt
61
        , v8dir_tgt
62
        ),
63
    before="cxx"
64
  )
65
  bld.env["CPPPATH_V8"] = "deps/v8/include"
66
  bld.env["STATICLIB_V8"] = "v8"
67
  bld.env["LIBPATH_V8"] = v8dir_tgt
68
  bld.env["LINKFLAGS_V8"] = "-pthread"
69

    
70
  ### oi
71
  oi = bld.new_task_gen("cc", "staticlib")
72
  oi.source = "deps/oi/oi_socket.c deps/oi/oi_buf.c"
73
  oi.includes = "deps/oi/"
74
  oi.name = "oi"
75
  oi.target = "oi"
76
  oi.uselib = "GNUTLS"
77

    
78
  ### ebb
79
  ebb = bld.new_task_gen("cc", "staticlib")
80
  ebb.source = "deps/ebb/ebb_request_parser.rl"
81
  ebb.includes = "deps/ebb/"
82
  ebb.name = "ebb"
83
  ebb.target = "ebb"
84

    
85
  ### node
86
  node = bld.new_task_gen("cxx", "program")
87
  node.target = 'node'
88
  node.source = """
89
    src/node.cc
90
    src/node_http.cc
91
    src/node_tcp.cc
92
    src/node_timer.cc
93
  """
94
  node.includes = """
95
    src/ 
96
    deps/v8/include
97
    deps/libev
98
    deps/libeio
99
    deps/oi 
100
    deps/ebb
101
  """
102
  node.uselib_local = "oi ev eio ebb"
103
  node.uselib = "V8 PTHREAD"