stream_base: remove static JSMethod declarations
[platform/upstream/nodejs.git] / node.gyp
1 {
2   'variables': {
3     'v8_use_snapshot%': 'false',
4     'node_use_dtrace%': 'false',
5     'node_use_lttng%': 'false',
6     'node_use_etw%': 'false',
7     'node_use_perfctr%': 'false',
8     'node_has_winsdk%': 'false',
9     'node_shared_v8%': 'false',
10     'node_shared_zlib%': 'false',
11     'node_shared_http_parser%': 'false',
12     'node_shared_libuv%': 'false',
13     'node_use_openssl%': 'true',
14     'node_shared_openssl%': 'false',
15     'node_use_mdb%': 'false',
16     'node_v8_options%': '',
17     'library_files': [
18       'src/node.js',
19       'lib/_debug_agent.js',
20       'lib/_debugger.js',
21       'lib/_linklist.js',
22       'lib/assert.js',
23       'lib/buffer.js',
24       'lib/child_process.js',
25       'lib/console.js',
26       'lib/constants.js',
27       'lib/crypto.js',
28       'lib/cluster.js',
29       'lib/dgram.js',
30       'lib/dns.js',
31       'lib/domain.js',
32       'lib/events.js',
33       'lib/freelist.js',
34       'lib/fs.js',
35       'lib/http.js',
36       'lib/_http_agent.js',
37       'lib/_http_client.js',
38       'lib/_http_common.js',
39       'lib/_http_incoming.js',
40       'lib/_http_outgoing.js',
41       'lib/_http_server.js',
42       'lib/https.js',
43       'lib/module.js',
44       'lib/net.js',
45       'lib/os.js',
46       'lib/path.js',
47       'lib/process.js',
48       'lib/punycode.js',
49       'lib/querystring.js',
50       'lib/readline.js',
51       'lib/repl.js',
52       'lib/smalloc.js',
53       'lib/stream.js',
54       'lib/_stream_readable.js',
55       'lib/_stream_writable.js',
56       'lib/_stream_duplex.js',
57       'lib/_stream_transform.js',
58       'lib/_stream_passthrough.js',
59       'lib/_stream_wrap.js',
60       'lib/string_decoder.js',
61       'lib/sys.js',
62       'lib/timers.js',
63       'lib/tls.js',
64       'lib/_tls_common.js',
65       'lib/_tls_legacy.js',
66       'lib/_tls_wrap.js',
67       'lib/tty.js',
68       'lib/url.js',
69       'lib/util.js',
70       'lib/v8.js',
71       'lib/vm.js',
72       'lib/zlib.js',
73     ],
74   },
75
76   'targets': [
77     {
78       'target_name': 'iojs',
79       'type': 'executable',
80
81       'dependencies': [
82         'node_js2c#host',
83         'deps/cares/cares.gyp:cares'
84       ],
85
86       'include_dirs': [
87         'src',
88         'tools/msvs/genfiles',
89         'deps/uv/src/ares',
90         '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
91       ],
92
93       'sources': [
94         'src/debug-agent.cc',
95         'src/async-wrap.cc',
96         'src/fs_event_wrap.cc',
97         'src/cares_wrap.cc',
98         'src/handle_wrap.cc',
99         'src/js_stream.cc',
100         'src/node.cc',
101         'src/node_buffer.cc',
102         'src/node_constants.cc',
103         'src/node_contextify.cc',
104         'src/node_file.cc',
105         'src/node_http_parser.cc',
106         'src/node_javascript.cc',
107         'src/node_main.cc',
108         'src/node_os.cc',
109         'src/node_v8.cc',
110         'src/node_v8_platform.cc',
111         'src/node_stat_watcher.cc',
112         'src/node_watchdog.cc',
113         'src/node_zlib.cc',
114         'src/node_i18n.cc',
115         'src/pipe_wrap.cc',
116         'src/signal_wrap.cc',
117         'src/smalloc.cc',
118         'src/spawn_sync.cc',
119         'src/string_bytes.cc',
120         'src/stream_base.cc',
121         'src/stream_wrap.cc',
122         'src/tcp_wrap.cc',
123         'src/timer_wrap.cc',
124         'src/tty_wrap.cc',
125         'src/process_wrap.cc',
126         'src/udp_wrap.cc',
127         'src/uv.cc',
128         # headers to make for a more pleasant IDE experience
129         'src/async-wrap.h',
130         'src/async-wrap-inl.h',
131         'src/base-object.h',
132         'src/base-object-inl.h',
133         'src/debug-agent.h',
134         'src/env.h',
135         'src/env-inl.h',
136         'src/handle_wrap.h',
137         'src/js_stream.h',
138         'src/node.h',
139         'src/node_buffer.h',
140         'src/node_constants.h',
141         'src/node_file.h',
142         'src/node_http_parser.h',
143         'src/node_internals.h',
144         'src/node_javascript.h',
145         'src/node_root_certs.h',
146         'src/node_version.h',
147         'src/node_watchdog.h',
148         'src/node_wrap.h',
149         'src/node_i18n.h',
150         'src/pipe_wrap.h',
151         'src/smalloc.h',
152         'src/tty_wrap.h',
153         'src/tcp_wrap.h',
154         'src/udp_wrap.h',
155         'src/req-wrap.h',
156         'src/req-wrap-inl.h',
157         'src/string_bytes.h',
158         'src/stream_base.h',
159         'src/stream_base-inl.h',
160         'src/stream_wrap.h',
161         'src/tree.h',
162         'src/util.h',
163         'src/util-inl.h',
164         'src/util.cc',
165         'deps/http_parser/http_parser.h',
166         '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
167         # javascript files to make for an even more pleasant IDE experience
168         '<@(library_files)',
169         # node.gyp is added to the project by default.
170         'common.gypi',
171       ],
172
173       'defines': [
174         'NODE_ARCH="<(target_arch)"',
175         'NODE_PLATFORM="<(OS)"',
176         'NODE_TAG="<(node_tag)"',
177         'NODE_V8_OPTIONS="<(node_v8_options)"',
178         'NODE_WANT_INTERNALS=1',
179       ],
180
181       'conditions': [
182         [ 'v8_enable_i18n_support==1', {
183           'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ],
184           'dependencies': [
185             '<(icu_gyp_path):icui18n',
186             '<(icu_gyp_path):icuuc',
187           ],
188           'conditions': [
189             [ 'icu_small=="true"', {
190               'defines': [ 'NODE_HAVE_SMALL_ICU=1' ],
191           }]],
192         }],
193         [ 'node_use_openssl=="true"', {
194           'defines': [ 'HAVE_OPENSSL=1' ],
195           'sources': [
196             'src/node_crypto.cc',
197             'src/node_crypto_bio.cc',
198             'src/node_crypto_clienthello.cc',
199             'src/node_crypto.h',
200             'src/node_crypto_bio.h',
201             'src/node_crypto_clienthello.h',
202             'src/tls_wrap.cc',
203             'src/tls_wrap.h'
204           ],
205           'conditions': [
206             [ 'node_shared_openssl=="false"', {
207               'dependencies': [
208                 './deps/openssl/openssl.gyp:openssl',
209
210                 # For tests
211                 './deps/openssl/openssl.gyp:openssl-cli',
212               ],
213               # Do not let unused OpenSSL symbols to slip away
214               'xcode_settings': {
215                 'OTHER_LDFLAGS': [
216                   '-Wl,-force_load,<(PRODUCT_DIR)/libopenssl.a',
217                 ],
218               },
219               'conditions': [
220                 ['OS in "linux freebsd"', {
221                   'ldflags': [
222                     '-Wl,--whole-archive <(PRODUCT_DIR)/libopenssl.a -Wl,--no-whole-archive',
223                   ],
224                 }],
225               ],
226             }]]
227         }, {
228           'defines': [ 'HAVE_OPENSSL=0' ]
229         }],
230         [ 'node_use_dtrace=="true"', {
231           'defines': [ 'HAVE_DTRACE=1' ],
232           'dependencies': [
233             'node_dtrace_header',
234             'specialize_node_d',
235           ],
236           'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
237
238           #
239           # DTrace is supported on linux, solaris, mac, and bsd.  There are
240           # three object files associated with DTrace support, but they're
241           # not all used all the time:
242           #
243           #   node_dtrace.o           all configurations
244           #   node_dtrace_ustack.o    not supported on mac and linux
245           #   node_dtrace_provider.o  All except OS X.  "dtrace -G" is not
246           #                           used on OS X.
247           #
248           # Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not
249           # actually exist.  They're listed here to trick GYP into linking the
250           # corresponding object files into the final "node" executable.  These
251           # object files are generated by "dtrace -G" using custom actions
252           # below, and the GYP-generated Makefiles will properly build them when
253           # needed.
254           #
255           'sources': [ 'src/node_dtrace.cc' ],
256           'conditions': [
257             [ 'OS=="linux"', {
258               'sources': [
259                 '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
260               ],
261             }],
262             [ 'OS!="mac" and OS!="linux"', {
263               'sources': [
264                 'src/node_dtrace_ustack.cc',
265                 'src/node_dtrace_provider.cc',
266               ]
267             }
268           ] ]
269         } ],
270         [ 'node_use_lttng=="true"', {
271           'defines': [ 'HAVE_LTTNG=1' ],
272           'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
273           'libraries': [ '-llttng-ust' ],
274           'sources': [
275             'src/node_lttng.cc'
276           ],
277         } ],
278         [ 'node_use_mdb=="true"', {
279           'dependencies': [ 'node_mdb' ],
280           'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
281           'sources': [
282             'src/node_mdb.cc',
283           ],
284         } ],
285         [ 'node_use_etw=="true"', {
286           'defines': [ 'HAVE_ETW=1' ],
287           'dependencies': [ 'node_etw' ],
288           'sources': [
289             'src/node_win32_etw_provider.h',
290             'src/node_win32_etw_provider-inl.h',
291             'src/node_win32_etw_provider.cc',
292             'src/node_dtrace.cc',
293             'tools/msvs/genfiles/node_etw_provider.h',
294             'tools/msvs/genfiles/node_etw_provider.rc',
295           ]
296         } ],
297         [ 'node_use_perfctr=="true"', {
298           'defines': [ 'HAVE_PERFCTR=1' ],
299           'dependencies': [ 'node_perfctr' ],
300           'sources': [
301             'src/node_win32_perfctr_provider.h',
302             'src/node_win32_perfctr_provider.cc',
303             'src/node_counters.cc',
304             'src/node_counters.h',
305             'tools/msvs/genfiles/node_perfctr_provider.rc',
306           ]
307         } ],
308         [ 'v8_postmortem_support=="true"', {
309           'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:postmortem-metadata' ],
310           'xcode_settings': {
311             'OTHER_LDFLAGS': [
312               '-Wl,-force_load,<(V8_BASE)',
313             ],
314           },
315         }],
316         [ 'node_shared_v8=="false"', {
317           'sources': [
318             'deps/v8/include/v8.h',
319             'deps/v8/include/v8-debug.h',
320           ],
321           'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:v8' ],
322         }],
323
324         [ 'node_shared_zlib=="false"', {
325           'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
326         }],
327
328         [ 'node_shared_http_parser=="false"', {
329           'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ],
330         }],
331
332         [ 'node_shared_libuv=="false"', {
333           'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
334         }],
335
336         [ 'OS=="win"', {
337           'sources': [
338             'src/res/node.rc',
339           ],
340           'defines!': [
341             'NODE_PLATFORM="win"',
342           ],
343           'defines': [
344             'FD_SETSIZE=1024',
345             # we need to use node's preferred "win32" rather than gyp's preferred "win"
346             'NODE_PLATFORM="win32"',
347             '_UNICODE=1',
348           ],
349           'libraries': [ '-lpsapi.lib' ]
350         }, { # POSIX
351           'defines': [ '__POSIX__' ],
352         }],
353         [ 'OS=="mac"', {
354           # linking Corefoundation is needed since certain OSX debugging tools
355           # like Instruments require it for some features
356           'libraries': [ '-framework CoreFoundation' ],
357           'defines!': [
358             'NODE_PLATFORM="mac"',
359           ],
360           'defines': [
361             # we need to use node's preferred "darwin" rather than gyp's preferred "mac"
362             'NODE_PLATFORM="darwin"',
363           ],
364         }],
365         [ 'OS=="freebsd"', {
366           'libraries': [
367             '-lutil',
368             '-lkvm',
369           ],
370         }],
371         [ 'OS=="solaris"', {
372           'libraries': [
373             '-lkstat',
374             '-lumem',
375           ],
376           'defines!': [
377             'NODE_PLATFORM="solaris"',
378           ],
379           'defines': [
380             # we need to use node's preferred "sunos"
381             # rather than gyp's preferred "solaris"
382             'NODE_PLATFORM="sunos"',
383           ],
384         }],
385         [ 'OS=="freebsd" or OS=="linux"', {
386           'ldflags': [ '-Wl,-z,noexecstack' ],
387         }],
388         [ 'OS=="sunos"', {
389           'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
390         }],
391         [
392           'OS in "linux freebsd" and node_shared_v8=="false"', {
393             'ldflags': [
394               '-Wl,--whole-archive <(V8_BASE) -Wl,--no-whole-archive',
395             ],
396         }],
397       ],
398       'msvs_settings': {
399         'VCManifestTool': {
400           'EmbedManifest': 'true',
401           'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
402         }
403       },
404     },
405     # generate ETW header and resource files
406     {
407       'target_name': 'node_etw',
408       'type': 'none',
409       'conditions': [
410         [ 'node_use_etw=="true" and node_has_winsdk=="true"', {
411           'actions': [
412             {
413               'action_name': 'node_etw',
414               'inputs': [ 'src/res/node_etw_provider.man' ],
415               'outputs': [
416                 'tools/msvs/genfiles/node_etw_provider.rc',
417                 'tools/msvs/genfiles/node_etw_provider.h',
418                 'tools/msvs/genfiles/node_etw_providerTEMP.BIN',
419               ],
420               'action': [ 'mc <@(_inputs) -h tools/msvs/genfiles -r tools/msvs/genfiles' ]
421             }
422           ]
423         } ]
424       ]
425     },
426     # generate perf counter header and resource files
427     {
428       'target_name': 'node_perfctr',
429       'type': 'none',
430       'conditions': [
431         [ 'node_use_perfctr=="true" and node_has_winsdk=="true"', {
432           'actions': [
433             {
434               'action_name': 'node_perfctr_man',
435               'inputs': [ 'src/res/node_perfctr_provider.man' ],
436               'outputs': [
437                 'tools/msvs/genfiles/node_perfctr_provider.h',
438                 'tools/msvs/genfiles/node_perfctr_provider.rc',
439                 'tools/msvs/genfiles/MSG00001.BIN',
440               ],
441               'action': [ 'ctrpp <@(_inputs) '
442                           '-o tools/msvs/genfiles/node_perfctr_provider.h '
443                           '-rc tools/msvs/genfiles/node_perfctr_provider.rc'
444               ]
445             },
446           ],
447         } ]
448       ]
449     },
450     {
451       'target_name': 'node_js2c',
452       'type': 'none',
453       'toolsets': ['host'],
454       'actions': [
455         {
456           'action_name': 'node_js2c',
457           'inputs': [
458             '<@(library_files)',
459             './config.gypi',
460           ],
461           'outputs': [
462             '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
463           ],
464           'conditions': [
465             [ 'node_use_dtrace=="false" and node_use_etw=="false"', {
466               'inputs': [ 'src/notrace_macros.py' ]
467             }],
468             ['node_use_lttng=="false"', {
469               'inputs': [ 'src/nolttng_macros.py' ]
470             }],
471             [ 'node_use_perfctr=="false"', {
472               'inputs': [ 'src/perfctr_macros.py' ]
473             }]
474           ],
475           'action': [
476             '<(python)',
477             'tools/js2c.py',
478             '<@(_outputs)',
479             '<@(_inputs)',
480           ],
481         },
482       ],
483     }, # end node_js2c
484     {
485       'target_name': 'node_dtrace_header',
486       'type': 'none',
487       'conditions': [
488         [ 'node_use_dtrace=="true" and OS!="linux"', {
489           'actions': [
490             {
491               'action_name': 'node_dtrace_header',
492               'inputs': [ 'src/node_provider.d' ],
493               'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
494               'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
495                 '-o', '<@(_outputs)' ]
496             }
497           ]
498         } ],
499         [ 'node_use_dtrace=="true" and OS=="linux"', {
500           'actions': [
501             {
502               'action_name': 'node_dtrace_header',
503               'inputs': [ 'src/node_provider.d' ],
504               'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
505               'action': [ 'dtrace', '-h', '-s', '<@(_inputs)',
506                 '-o', '<@(_outputs)' ]
507             }
508           ]
509         } ],
510       ]
511     },
512     {
513       'target_name': 'node_mdb',
514       'type': 'none',
515       'conditions': [
516         [ 'node_use_mdb=="true"',
517           {
518             'dependencies': [ 'deps/mdb_v8/mdb_v8.gyp:mdb_v8' ],
519             'actions': [
520               {
521                 'action_name': 'node_mdb',
522                 'inputs': [ '<(PRODUCT_DIR)/obj.target/deps/mdb_v8/mdb_v8.so' ],
523                 'outputs': [ '<(PRODUCT_DIR)/obj.target/node/src/node_mdb.o' ],
524                 'conditions': [
525                   [ 'target_arch=="ia32"', {
526                     'action': [ 'elfwrap', '-o', '<@(_outputs)', '<@(_inputs)' ],
527                   } ],
528                   [ 'target_arch=="x64"', {
529                     'action': [ 'elfwrap', '-64', '-o', '<@(_outputs)', '<@(_inputs)' ],
530                   } ],
531                 ],
532               },
533             ],
534           },
535         ],
536       ],
537     },
538     {
539       'target_name': 'node_dtrace_provider',
540       'type': 'none',
541       'conditions': [
542         [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
543           'actions': [
544             {
545               'action_name': 'node_dtrace_provider_o',
546               'inputs': [
547                 '<(OBJ_DIR)/iojs/src/node_dtrace.o',
548               ],
549               'outputs': [
550                 '<(OBJ_DIR)/iojs/src/node_dtrace_provider.o'
551               ],
552               'action': [ 'dtrace', '-G', '-xnolibs', '-s', 'src/node_provider.d',
553                 '<@(_inputs)', '-o', '<@(_outputs)' ]
554             }
555           ]
556         }],
557         [ 'node_use_dtrace=="true" and OS=="linux"', {
558           'actions': [
559             {
560               'action_name': 'node_dtrace_provider_o',
561               'inputs': [ 'src/node_provider.d' ],
562               'outputs': [
563                 '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
564               ],
565               'action': [
566                 'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)'
567               ],
568             }
569           ],
570         }],
571       ]
572     },
573     {
574       'target_name': 'node_dtrace_ustack',
575       'type': 'none',
576       'conditions': [
577         [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
578           'actions': [
579             {
580               'action_name': 'node_dtrace_ustack_constants',
581               'inputs': [
582                 '<(V8_BASE)'
583               ],
584               'outputs': [
585                 '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
586               ],
587               'action': [
588                 'tools/genv8constants.py',
589                 '<@(_outputs)',
590                 '<@(_inputs)'
591               ]
592             },
593             {
594               'action_name': 'node_dtrace_ustack',
595               'inputs': [
596                 'src/v8ustack.d',
597                 '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
598               ],
599               'outputs': [
600                 '<(OBJ_DIR)/iojs/src/node_dtrace_ustack.o'
601               ],
602               'conditions': [
603                 [ 'target_arch=="ia32"', {
604                   'action': [
605                     'dtrace', '-32', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
606                     '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
607                   ]
608                 } ],
609                 [ 'target_arch=="x64"', {
610                   'action': [
611                     'dtrace', '-64', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
612                     '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
613                   ]
614                 } ],
615               ]
616             },
617           ]
618         } ],
619       ]
620     },
621     {
622       'target_name': 'specialize_node_d',
623       'type': 'none',
624       'conditions': [
625         [ 'node_use_dtrace=="true"', {
626           'actions': [
627             {
628               'action_name': 'specialize_node_d',
629               'inputs': [
630                 'src/node.d'
631               ],
632               'outputs': [
633                 '<(PRODUCT_DIR)/node.d',
634               ],
635               'action': [
636                 'tools/specialize_node_d.py',
637                 '<@(_outputs)',
638                 '<@(_inputs)',
639                 '<@(OS)',
640                 '<@(target_arch)',
641               ],
642             },
643           ],
644         } ],
645       ]
646     }
647   ] # end targets
648 }