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 / node.gyp @ 35a1421e

History | View | Annotate | Download (10.6 KB)

1
{
2
  'variables': {
3
    'v8_use_snapshot%': 'true',
4
    # Turn off -Werror in V8
5
    # See http://codereview.chromium.org/8159015
6
    'werror': '',
7
    'node_use_dtrace%': 'false',
8
    'node_use_etw%': 'false',
9
    'node_shared_v8%': 'false',
10
    'node_shared_zlib%': 'false',
11
    'node_use_openssl%': 'true',
12
    'node_use_system_openssl%': 'false',
13
    'library_files': [
14
      'src/node.js',
15
      'lib/_debugger.js',
16
      'lib/_linklist.js',
17
      'lib/assert.js',
18
      'lib/buffer.js',
19
      'lib/buffer_ieee754.js',
20
      'lib/child_process.js',
21
      'lib/console.js',
22
      'lib/constants.js',
23
      'lib/crypto.js',
24
      'lib/cluster.js',
25
      'lib/dgram.js',
26
      'lib/dns.js',
27
      'lib/domain.js',
28
      'lib/events.js',
29
      'lib/freelist.js',
30
      'lib/fs.js',
31
      'lib/http.js',
32
      'lib/https.js',
33
      'lib/module.js',
34
      'lib/net.js',
35
      'lib/os.js',
36
      'lib/path.js',
37
      'lib/punycode.js',
38
      'lib/querystring.js',
39
      'lib/readline.js',
40
      'lib/repl.js',
41
      'lib/stream.js',
42
      'lib/string_decoder.js',
43
      'lib/sys.js',
44
      'lib/timers.js',
45
      'lib/tls.js',
46
      'lib/tty.js',
47
      'lib/url.js',
48
      'lib/util.js',
49
      'lib/vm.js',
50
      'lib/zlib.js',
51
    ],
52
  },
53

    
54
  'targets': [
55
    {
56
      'target_name': 'node',
57
      'type': 'executable',
58

    
59
      'dependencies': [
60
        'deps/http_parser/http_parser.gyp:http_parser',
61
        'deps/uv/uv.gyp:uv',
62
        'node_js2c#host',
63
      ],
64

    
65
      'include_dirs': [
66
        'src',
67
        'deps/uv/src/ares',
68
        '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
69
      ],
70

    
71
      'sources': [
72
        'src/fs_event_wrap.cc',
73
        'src/cares_wrap.cc',
74
        'src/handle_wrap.cc',
75
        'src/node.cc',
76
        'src/node_buffer.cc',
77
        'src/node_constants.cc',
78
        'src/node_extensions.cc',
79
        'src/node_file.cc',
80
        'src/node_http_parser.cc',
81
        'src/node_javascript.cc',
82
        'src/node_main.cc',
83
        'src/node_os.cc',
84
        'src/node_script.cc',
85
        'src/node_string.cc',
86
        'src/node_zlib.cc',
87
        'src/pipe_wrap.cc',
88
        'src/stream_wrap.cc',
89
        'src/slab_allocator.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_buffer.h',
100
        'src/node_constants.h',
101
        'src/node_crypto.h',
102
        'src/node_extensions.h',
103
        'src/node_file.h',
104
        'src/node_http_parser.h',
105
        'src/node_javascript.h',
106
        'src/node_os.h',
107
        'src/node_root_certs.h',
108
        'src/node_script.h',
109
        'src/node_string.h',
110
        'src/node_version.h',
111
        'src/ngx-queue.h',
112
        'src/pipe_wrap.h',
113
        'src/tty_wrap.h',
114
        'src/tcp_wrap.h',
115
        'src/udp_wrap.h',
116
        'src/req_wrap.h',
117
        'src/slab_allocator.h',
118
        'src/stream_wrap.h',
119
        'src/v8_typed_array.h',
120
        'deps/http_parser/http_parser.h',
121
        '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
122
        # javascript files to make for an even more pleasant IDE experience
123
        '<@(library_files)',
124
        # node.gyp is added to the project by default.
125
        'common.gypi',
126
      ],
127

    
128
      'defines': [
129
        'NODE_WANT_INTERNALS=1',
130
        'ARCH="<(target_arch)"',
131
        'PLATFORM="<(OS)"',
132
      ],
133

    
134
      'conditions': [
135
        [ 'node_use_openssl=="true"', {
136
          'defines': [ 'HAVE_OPENSSL=1' ],
137
          'sources': [ 'src/node_crypto.cc' ],
138
          'conditions': [
139
            [ 'node_use_system_openssl=="false"', {
140
              'dependencies': [ './deps/openssl/openssl.gyp:openssl' ],
141
            }]]
142
        }, {
143
          'defines': [ 'HAVE_OPENSSL=0' ]
144
        }],
145

    
146
        [ 'node_use_dtrace=="true"', {
147
          'defines': [ 'HAVE_DTRACE=1' ],
148
          'dependencies': [ 'node_dtrace_header' ],
149
          'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
150
          #
151
          # node_dtrace_provider.cc and node_dtrace_ustack.cc do not actually
152
          # exist.  They're here to trick GYP into linking the corresponding
153
          # object files into the final "node" executable.  These files are
154
          # generated by "dtrace -G" using custom actions below, and the
155
          # GYP-generated Makefiles will properly build them when needed.
156
          #
157
          'sources': [
158
            'src/node_dtrace.cc',
159
            'src/node_dtrace_provider.cc'
160
          ],
161
          'conditions': [ [
162
            'target_arch=="ia32"', {
163
              'sources': [ 'src/node_dtrace_ustack.cc' ]
164
            }
165
          ] ],
166
        } ],
167
        [ 'node_use_etw=="true"', {
168
          'defines': [ 'HAVE_ETW=1' ],
169
          'dependencies': [ 'node_etw' ],
170
          'sources': [
171
            'src/node_win32_etw_provider.h',
172
            'src/node_win32_etw_provider-inl.h',
173
            'src/node_win32_etw_provider.cc',
174
            'src/node_dtrace.cc',
175
            '<(SHARED_INTERMEDIATE_DIR)/node_etw_provider.h',
176
            '<(SHARED_INTERMEDIATE_DIR)/node_etw_provider.rc',
177
          ]
178
        } ],
179
        [ 'node_shared_v8=="true"', {
180
          'sources': [
181
            '<(node_shared_v8_includes)/v8.h',
182
            '<(node_shared_v8_includes)/v8-debug.h',
183
          ],
184
        }, {
185
          'sources': [
186
            'deps/v8/include/v8.h',
187
            'deps/v8/include/v8-debug.h',
188
          ],
189
          'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:v8' ],
190
        }],
191

    
192
        [ 'node_shared_zlib=="false"', {
193
          'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ],
194
        }],
195

    
196
        [ 'OS=="win"', {
197
          'sources': [
198
            'src/res/node.rc',
199
          ],
200
          'defines': [
201
            'FD_SETSIZE=1024',
202
            # we need to use node's preferred "win32" rather than gyp's preferred "win"
203
            'PLATFORM="win32"',
204
            '_UNICODE=1',
205
          ],
206
          'libraries': [ '-lpsapi.lib' ]
207
        },{ # POSIX
208
          'defines': [ '__POSIX__' ],
209
          'sources': [
210
            'src/node_signal_watcher.cc',
211
            'src/node_stat_watcher.cc',
212
            'src/node_io_watcher.cc',
213
          ]
214
        }],
215
        [ 'OS=="mac"', {
216
          'libraries': [ '-framework Carbon' ],
217
          'defines!': [
218
            'PLATFORM="mac"',
219
          ],
220
          'defines': [
221
            # we need to use node's preferred "darwin" rather than gyp's preferred "mac"
222
            'PLATFORM="darwin"',
223
          ],
224
        }],
225
        [ 'OS=="freebsd"', {
226
          'libraries': [
227
            '-lutil',
228
            '-lkvm',
229
          ],
230
        }],
231
        [ 'OS=="solaris"', {
232
          'libraries': [
233
            '-lkstat',
234
          ],
235
        }],
236
      ],
237
      'msvs-settings': {
238
        'VCLinkerTool': {
239
          'SubSystem': 1, # /subsystem:console
240
        },
241
      },
242
    },
243
    # generate ETW header and resource files
244
    {
245
      'target_name': 'node_etw',
246
      'type': 'none',
247
      'conditions': [
248
        [ 'node_use_etw=="true"', {
249
          'actions': [
250
            {
251
              'action_name': 'node_etw',
252
              'inputs': [ 'src/res/node_etw_provider.man' ],
253
              'outputs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
254
              'action': [ 'mc <@(_inputs) -h <@(_outputs) -r <@(_outputs)' ]
255
            }
256
          ]
257
        } ]
258
      ]
259
    },
260
    {
261
      'target_name': 'node_js2c',
262
      'type': 'none',
263
      'toolsets': ['host'],
264
      'actions': [
265
        {
266
          'action_name': 'node_js2c',
267

    
268
          'inputs': [
269
            '<@(library_files)',
270
            './config.gypi',
271
          ],
272

    
273
          'outputs': [
274
            '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
275
          ],
276

    
277
          # FIXME can the following conditions be shorted by just setting
278
          # macros.py into some variable which then gets included in the
279
          # action?
280

    
281
          'conditions': [
282
            [ 'node_use_dtrace=="true" or node_use_etw=="true"', {
283
              'action': [
284
                'python',
285
                'tools/js2c.py',
286
                '<@(_outputs)',
287
                '<@(_inputs)',
288
              ],
289
            }, { # No Dtrace
290
              'action': [
291
                'python',
292
                'tools/js2c.py',
293
                '<@(_outputs)',
294
                '<@(_inputs)',
295
                'src/macros.py'
296
              ],
297
            }]
298
          ],
299
        },
300
      ],
301
    }, # end node_js2c
302
    {
303
      'target_name': 'node_dtrace_header',
304
      'type': 'none',
305
      'conditions': [
306
        [ 'node_use_dtrace=="true"', {
307
          'actions': [
308
            {
309
              'action_name': 'node_dtrace_header',
310
              'inputs': [ 'src/node_provider.d' ],
311
              'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
312
              'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
313
                '-o', '<@(_outputs)' ]
314
            }
315
          ]
316
        } ]
317
      ]
318
    },
319
    {
320
      'target_name': 'node_dtrace_provider',
321
      'type': 'none',
322
      'conditions': [
323
        [ 'node_use_dtrace=="true"', {
324
          'actions': [
325
            {
326
              'action_name': 'node_dtrace_provider_o',
327
              'inputs': [
328
                'src/node_provider.d',
329
                '<(PRODUCT_DIR)/obj.target/node/src/node_dtrace.o'
330
              ],
331
              'outputs': [
332
                '<(PRODUCT_DIR)/obj.target/node/src/node_dtrace_provider.o'
333
              ],
334
              'action': [ 'dtrace', '-G', '-xnolibs', '-s', '<@(_inputs)',
335
                '-o', '<@(_outputs)' ]
336
            }
337
          ]
338
        } ]
339
      ]
340
    },
341
    {
342
      'target_name': 'node_dtrace_ustack',
343
      'type': 'none',
344
      'conditions': [
345
        [ 'node_use_dtrace=="true" and target_arch=="ia32"', {
346
          'actions': [
347
            {
348
              'action_name': 'node_dtrace_ustack_constants',
349
              'inputs': [
350
                '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a'
351
              ],
352
              'outputs': [
353
                '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
354
              ],
355
              'action': [
356
                'tools/genv8constants.py',
357
                '<@(_outputs)',
358
                '<@(_inputs)'
359
              ]
360
            },
361
            {
362
              'action_name': 'node_dtrace_ustack',
363
              'inputs': [
364
                'src/v8ustack.d',
365
                '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
366
              ],
367
              'outputs': [
368
                '<(PRODUCT_DIR)/obj.target/node/src/node_dtrace_ustack.o'
369
              ],
370
              'action': [
371
                'dtrace', '-32', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
372
                '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
373
              ]
374
            }
375
          ]
376
        } ],
377
      ]
378
    }
379
  ] # end targets
380
}
381