test tls: make tests use new `tls.connect` API
[platform/upstream/nodejs.git] / node.gyp
1 {
2   'variables': {
3     'v8_use_snapshot': 'true',
4     # Turn off -Werror in V8
5     # See http://codereview.chromium.org/8159015
6     'werror': '',
7     'target_arch': 'ia32',
8     'node_use_dtrace': 'false',
9     'node_use_openssl%': 'true',
10     'node_use_system_openssl%': 'false',
11     'library_files': [
12       'src/node.js',
13       'lib/_debugger.js',
14       'lib/_linklist.js',
15       'lib/assert.js',
16       'lib/buffer.js',
17       'lib/buffer_ieee754.js',
18       'lib/child_process.js',
19       'lib/console.js',
20       'lib/constants.js',
21       'lib/crypto.js',
22       'lib/cluster.js',
23       'lib/dgram.js',
24       'lib/dns.js',
25       'lib/events.js',
26       'lib/freelist.js',
27       'lib/fs.js',
28       'lib/http.js',
29       'lib/https.js',
30       'lib/module.js',
31       'lib/net.js',
32       'lib/os.js',
33       'lib/path.js',
34       'lib/punycode.js',
35       'lib/querystring.js',
36       'lib/readline.js',
37       'lib/repl.js',
38       'lib/stream.js',
39       'lib/string_decoder.js',
40       'lib/sys.js',
41       'lib/timers.js',
42       'lib/tls.js',
43       'lib/tty.js',
44       'lib/url.js',
45       'lib/util.js',
46       'lib/vm.js',
47       'lib/zlib.js',
48     ],
49   },
50
51   'targets': [
52     {
53       'target_name': 'node',
54       'type': 'executable',
55
56       'dependencies': [
57         'deps/http_parser/http_parser.gyp:http_parser',
58         'deps/v8/tools/gyp/v8.gyp:v8',
59         'deps/uv/uv.gyp:uv',
60         'deps/zlib/zlib.gyp:zlib',
61         'node_js2c#host',
62       ],
63
64       'include_dirs': [
65         'src',
66         'deps/uv/src/ares',
67         '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
68       ],
69
70       'sources': [
71         'src/fs_event_wrap.cc',
72         'src/cares_wrap.cc',
73         'src/handle_wrap.cc',
74         'src/node.cc',
75         'src/node_vars.cc',
76         'src/node_buffer.cc',
77         'src/node_isolate.cc',
78         'src/node_constants.cc',
79         'src/node_extensions.cc',
80         'src/node_file.cc',
81         'src/node_http_parser.cc',
82         'src/node_javascript.cc',
83         'src/node_main.cc',
84         'src/node_os.cc',
85         'src/node_script.cc',
86         'src/node_string.cc',
87         'src/node_zlib.cc',
88         'src/pipe_wrap.cc',
89         'src/stream_wrap.cc',
90         'src/tcp_wrap.cc',
91         'src/timer_wrap.cc',
92         'src/tty_wrap.cc',
93         'src/process_wrap.cc',
94         'src/v8_typed_array.cc',
95         'src/udp_wrap.cc',
96         # headers to make for a more pleasant IDE experience
97         'src/handle_wrap.h',
98         'src/node.h',
99         'src/node_vars.h',
100         'src/node_buffer.h',
101         'src/node_isolate.h',
102         'src/node_constants.h',
103         'src/node_crypto.h',
104         'src/node_extensions.h',
105         'src/node_file.h',
106         'src/node_http_parser.h',
107         'src/node_javascript.h',
108         'src/node_os.h',
109         'src/node_root_certs.h',
110         'src/node_script.h',
111         'src/node_string.h',
112         'src/node_version.h',
113         'src/pipe_wrap.h',
114         'src/req_wrap.h',
115         'src/stream_wrap.h',
116         'src/v8_typed_array.h',
117         'deps/http_parser/http_parser.h',
118         'deps/v8/include/v8.h',
119         'deps/v8/include/v8-debug.h',
120         '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
121         # javascript files to make for an even more pleasant IDE experience
122         '<@(library_files)',
123         # node.gyp is added to the project by default.
124         'common.gypi',
125       ],
126
127       'defines': [
128         'NODE_WANT_INTERNALS=1',
129         'ARCH="<(target_arch)"',
130         'PLATFORM="<(OS)"',
131       ],
132
133       'conditions': [
134         [ 'node_use_isolates=="true"', {
135           'defines': [ 'HAVE_ISOLATES=1' ],
136         }, {
137           'defines': [ 'HAVE_ISOLATES=0' ],
138         }],
139
140         [ 'node_use_openssl=="true"', {
141           'defines': [ 'HAVE_OPENSSL=1' ],
142           'sources': [ 'src/node_crypto.cc' ],
143           'conditions': [
144             [ 'node_use_system_openssl=="false"', {
145               'dependencies': [ './deps/openssl/openssl.gyp:openssl' ],
146             }]]
147         }, {
148           'defines': [ 'HAVE_OPENSSL=0' ]
149         }],
150
151         [ 'node_use_dtrace=="true"', {
152           'sources': [
153             'src/node_dtrace.cc',
154             'src/node_dtrace.h',
155             # why does node_provider.h get generated into src and not
156             # SHARED_INTERMEDIATE_DIR?
157             'src/node_provider.h',
158           ],
159         }],
160
161         [ 'OS=="win"', {
162           'sources': [
163             'tools/msvs/res/node.rc',
164           ],
165           'defines': [
166             'FD_SETSIZE=1024',
167             # we need to use node's preferred "win32" rather than gyp's preferred "win"
168             'PLATFORM="win32"',
169           ],
170           'libraries': [ '-lpsapi.lib' ]
171         },{ # POSIX
172           'defines': [ '__POSIX__' ],
173           'sources': [
174             'src/node_signal_watcher.cc',
175             'src/node_stat_watcher.cc',
176             'src/node_io_watcher.cc',
177           ]
178         }],
179         [ 'OS=="mac"', {
180           'libraries': [ '-framework Carbon' ],
181         }],
182         [ 'OS=="linux"', {
183           'libraries': [
184             '-ldl',
185             '-lutil' # needed for openpty
186           ],
187         }],
188         [ 'OS=="freebsd"', {
189           'libraries': [
190             '-lutil',
191             '-lkvm',
192           ],
193         }],
194         [ 'OS=="solaris"', {
195           'libraries': [
196             '-lkstat',
197           ],
198         }],
199       ],
200       'msvs-settings': {
201         'VCLinkerTool': {
202           'SubSystem': 1, # /subsystem:console
203         },
204       },
205     },
206
207     {
208       'target_name': 'node_js2c',
209       'type': 'none',
210       'toolsets': ['host'],
211       'actions': [
212         {
213           'action_name': 'node_js2c',
214
215           'inputs': [
216             './tools/js2c.py',
217             '<@(library_files)',
218           ],
219
220           'outputs': [
221             '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
222           ],
223
224           # FIXME can the following conditions be shorted by just setting
225           # macros.py into some variable which then gets included in the
226           # action?
227
228           'conditions': [
229             [ 'node_use_dtrace=="true"', {
230               'action': [
231                 'python',
232                 'tools/js2c.py',
233                 '<@(_outputs)',
234                 '<@(library_files)'
235               ],
236             }, { # No Dtrace
237               'action': [
238                 'python',
239                 'tools/js2c.py',
240                 '<@(_outputs)',
241                 '<@(library_files)',
242                 'src/macros.py'
243               ],
244             }]
245           ],
246         },
247       ],
248     }, # end node_js2c
249   ] # end targets
250 }
251