Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / native_client / src / untrusted / nacl / nacl.gyp
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 {
6   'includes': [
7     '../../../build/common.gypi',
8   ],
9   'variables': {
10     'sources_for_standard_interfaces': [
11       'access.c',
12       'chdir.c',
13       'chmod.c',
14       'clock.c',
15       'clock_getres.c',
16       'clock_gettime.c',
17       'close.c',
18       'dup.c',
19       '_exit.c',
20       'fchdir.c',
21       'fchmod.c',
22       'fdatasync.c',
23       'fstat.c',
24       'fsync.c',
25       'ftruncate.c',
26       'getcwd.c',
27       'getdents.c',
28       'gethostname.c',
29       'getpagesize.c',
30       'getpid.c',
31       'gettimeofday.c',
32       'isatty.c',
33       'link.c',
34       'lock.c',
35       'lseek.c',
36       'lstat.c',
37       'malloc.c',
38       'mkdir.c',
39       'mmap.c',
40       'mprotect.c',
41       'munmap.c',
42       'nanosleep.c',
43       'nacl_interface_query.c',
44       'nacl_irt_fdio.c',
45       'nacl_irt_filename.c',
46       'nacl_read_tp.c',
47       'nacl_add_tp.c',
48       'open.c',
49       'read.c',
50       'readlink.c',
51       'rename.c',
52       'rmdir.c',
53       'pthread_initialize_minimal.c',
54       'pthread_stubs.c',
55       'sbrk.c',
56       'sched_yield.c',
57       'stacktrace.c',
58       'start.c',
59       'stat.c',
60       'symlink.c',
61       'sysconf.c',
62       'tls.c',
63       'truncate.c',
64       'unlink.c',
65       'utimes.c',
66       'write.c',
67     ],
68     'sources_for_stubs': [
69       'stubs/chown.c',
70       'stubs/endpwent.c',
71       'stubs/environ.c',
72       'stubs/_execve.c',
73       'stubs/fchown.c',
74       'stubs/fcntl.c',
75       'stubs/fork.c',
76       'stubs/get_current_dir_name.c',
77       'stubs/getegid.c',
78       'stubs/geteuid.c',
79       'stubs/getgid.c',
80       'stubs/getlogin.c',
81       'stubs/getrusage.c',
82       'stubs/getppid.c',
83       'stubs/getpwent.c',
84       'stubs/getpwnam.c',
85       'stubs/getpwnam_r.c',
86       'stubs/getpwuid.c',
87       'stubs/getpwuid_r.c',
88       'stubs/getuid.c',
89       'stubs/getwd.c',
90       'stubs/ioctl.c',
91       'stubs/issetugid.c',
92       'stubs/kill.c',
93       'stubs/lchown.c',
94       'stubs/llseek.c',
95       'stubs/pipe.c',
96       'stubs/pselect.c',
97       'stubs/recv.c',
98       'stubs/select.c',
99       'stubs/send.c',
100       'stubs/setegid.c',
101       'stubs/seteuid.c',
102       'stubs/setgid.c',
103       'stubs/setpwent.c',
104       'stubs/settimeofday.c',
105       'stubs/setuid.c',
106       'stubs/signal.c',
107       'stubs/sigprocmask.c',
108       'stubs/tcdrain.c',
109       'stubs/tcflow.c',
110       'stubs/tcflush.c',
111       'stubs/tcgetattr.c',
112       'stubs/tcsendbreak.c',
113       'stubs/tcsetattr.c',
114       'stubs/times.c',
115       'stubs/ttyname.c',
116       'stubs/ttyname_r.c',
117       'stubs/umask.c',
118       'stubs/utime.c',
119       'stubs/vfork.c',
120       'stubs/wait.c',
121       'stubs/waitpid.c',
122     ],
123     'sources_for_nacl_extensions': [
124       'gc_hooks.c',
125       'nacl_irt.c',
126       'nacl_irt_init.c',
127       'nacl_tls_get.c',
128       'nacl_tls_init.c',
129       'random.c',
130     ],
131     'imc_syscalls': [
132       'imc_accept.c',
133       'imc_connect.c',
134       'imc_makeboundsock.c',
135       'imc_mem_obj_create.c',
136       'imc_recvmsg.c',
137       'imc_sendmsg.c',
138       'imc_socketpair.c',
139       'nameservice.c',
140     ],
141   },
142
143   'targets' : [
144     {
145       'target_name': 'nacl_lib',
146       'type': 'none',
147       'dependencies': [
148         'nacl_lib_newlib',
149       ],
150       'conditions': [
151         # NOTE: We do not support glibc on arm and mips yet.
152         ['target_arch!="arm" and target_arch!="mipsel"', {
153            'dependencies': [
154              'nacl_lib_glibc'
155            ]
156          }],
157       ],
158     },
159
160     {
161       'target_name': 'nacl_lib_glibc',
162       'type': 'none',
163       'variables': {
164         'nlib_target': 'libnacl.a',
165         'build_glibc': 1,
166         'build_newlib': 0,
167       },
168       'sources': ['<@(sources_for_nacl_extensions)'],
169       'dependencies': [
170         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
171       ],
172     },
173     {
174       'target_name': 'nacl_lib_newlib',
175       'type': 'none',
176       'variables': {
177         'nlib_target': 'libnacl.a',
178         'build_glibc': 0,
179         'build_newlib': 1,
180         'build_irt': 1,
181         'build_pnacl_newlib': 1,
182       },
183       'sources': [
184         '<@(sources_for_nacl_extensions)',
185         '<@(sources_for_standard_interfaces)',
186         '<@(sources_for_stubs)',
187       ],
188       'conditions': [
189         ['target_arch=="arm"', {
190           'variables': {
191             'native_sources': [
192               'aeabi_read_tp.S'
193             ]
194           }
195         }],
196       ],
197       'dependencies': [
198         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
199       ],
200     },
201     {
202       'target_name': 'nacl_dynacode_lib',
203       'type': 'none',
204       'variables': {
205         'nlib_target': 'libnacl_dyncode.a',
206         'nso_target': 'libnacl_dyncode.so',
207         'build_glibc': 1,
208         'build_newlib': 1,
209         'build_pnacl_newlib': 1,
210       },
211       'sources': ['dyncode.c'],
212       'dependencies': [
213         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
214       ],
215     },
216     {
217       'target_name': 'nacl_dyncode_private_lib',
218       'type': 'none',
219       'variables': {
220         'nlib_target': 'libnacl_dyncode_private.a',
221         'build_glibc': 0,
222         'build_newlib': 1,
223         'build_pnacl_newlib': 1,
224       },
225       'sources': ['dyncode_private.c'],
226       'dependencies': [
227         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
228       ],
229     },
230     {
231       'target_name': 'nacl_exception_lib',
232       'type': 'none',
233       'variables': {
234         'nlib_target': 'libnacl_exception.a',
235         'nso_target': 'libnacl_exception.so',
236         'build_glibc': 1,
237         'build_newlib': 1,
238         'build_pnacl_newlib': 1,
239       },
240       'sources': ['nacl_exception.c'],
241       'dependencies': [
242         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
243       ],
244     },
245     {
246       'target_name': 'nacl_exception_private_lib',
247       'type': 'none',
248       'variables': {
249         'nlib_target': 'libnacl_exception_private.a',
250         'build_glibc': 1,
251         'build_newlib': 1,
252         'build_pnacl_newlib': 1,
253       },
254       'sources': ['nacl_exception_private.c'],
255       'dependencies': [
256         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
257       ],
258     },
259     {
260       'target_name': 'nacl_list_mappings_lib',
261       'type': 'none',
262       'variables': {
263         'nlib_target': 'libnacl_list_mappings.a',
264         'nso_target': 'libnacl_list_mappings.so',
265         'build_glibc': 1,
266         'build_newlib': 1,
267         'build_pnacl_newlib': 1,
268       },
269       'sources': ['list_mappings.c'],
270       'dependencies': [
271         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
272       ],
273     },
274     {
275       'target_name': 'nacl_list_mappings_private_lib',
276       'type': 'none',
277       'variables': {
278         'nlib_target': 'libnacl_list_mappings_private.a',
279         'build_glibc': 0,
280         'build_newlib': 1,
281       },
282       'sources': ['list_mappings_private.c'],
283       'dependencies': [
284         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
285       ],
286     },
287     {
288       'target_name': 'imc_syscalls_lib',
289       'type': 'none',
290       'variables': {
291         'nlib_target': 'libimc_syscalls.a',
292         'nso_target': 'libimc_syscalls.so',
293         'build_glibc': 1,
294         'build_newlib': 1,
295         'build_pnacl_newlib': 1,
296         'build_irt': 1,
297       },
298       'sources': ['<@(imc_syscalls)'],
299       'dependencies': [
300         '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
301       ],
302     },
303   ],
304 }