build: first set of updates to enable PPC support
[platform/upstream/nodejs.git] / deps / openssl / openssl.gyp
1 # Copyright (c) 2012 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   'variables': {
7     'is_clang': 0,
8     'gcc_version': 0,
9     'openssl_no_asm%': 0,
10     'llvm_version%': 0,
11     'gas_version%': 0,
12     'openssl_fips%': 'false',
13   },
14   'targets': [
15     {
16       'target_name': 'openssl',
17       'type': '<(library)',
18       'includes': ['openssl.gypi'],
19       'sources': ['<@(openssl_sources)'],
20       'sources/': [
21         ['exclude', 'md2/.*$'],
22         ['exclude', 'store/.*$']
23       ],
24       'conditions': [
25         # FIPS
26         ['openssl_fips != ""', {
27           'defines': [
28             'OPENSSL_FIPS',
29           ],
30           'include_dirs': [
31             '<(openssl_fips)/include',
32           ],
33
34           # Trick fipsld, it expects to see libcrypto.a
35           'product_name': 'crypto',
36
37           'direct_dependent_settings': {
38             'defines': [
39               'OPENSSL_FIPS',
40             ],
41             'include_dirs': [
42               '<(openssl_fips)/include',
43             ],
44           },
45         }],
46         [ 'node_byteorder=="big"', {
47             # Define Big Endian
48             'defines': ['B_ENDIAN']
49           }, {
50             # Define Little Endian
51            'defines':['L_ENDIAN']
52         }],
53         ['openssl_no_asm!=0', {
54           # Disable asm
55           'defines': [
56             'OPENSSL_NO_ASM',
57           ],
58           'sources': ['<@(openssl_sources_no_asm)'],
59         }, {
60           # "else if" was supported in https://codereview.chromium.org/601353002
61           'conditions': [
62             ['target_arch=="arm"', {
63               'defines': ['<@(openssl_defines_asm)'],
64               'sources': ['<@(openssl_sources_arm_void_gas)'],
65             }, 'target_arch=="ia32" and OS=="mac"', {
66               'defines': [
67                 '<@(openssl_defines_asm)',
68                 '<@(openssl_defines_ia32_mac)',
69               ],
70               'sources': ['<@(openssl_sources_ia32_mac_gas)'],
71             }, 'target_arch=="ia32" and OS=="win"', {
72               'defines': [
73                 '<@(openssl_defines_asm)',
74                 '<@(openssl_defines_ia32_win)',
75               ],
76               'sources': ['<@(openssl_sources_ia32_win_masm)'],
77             }, 'target_arch=="ia32"', {
78               # Linux or others
79               'defines': [
80                 '<@(openssl_defines_asm)',
81                 '<@(openssl_defines_ia32_elf)',
82               ],
83               'sources': ['<@(openssl_sources_ia32_elf_gas)'],
84             }, 'target_arch=="x64" and OS=="mac"', {
85               'defines': [
86                 '<@(openssl_defines_asm)',
87                 '<@(openssl_defines_x64_mac)',
88               ],
89               'sources': ['<@(openssl_sources_x64_mac_gas)'],
90             }, 'target_arch=="x64" and OS=="win"', {
91               'defines': [
92                 '<@(openssl_defines_asm)',
93                 '<@(openssl_defines_x64_win)',
94               ],
95               'sources': ['<@(openssl_sources_x64_win_masm)'],
96             }, 'target_arch=="x64"', {
97               # Linux or others
98               'defines': [
99                 '<@(openssl_defines_asm)',
100                 '<@(openssl_defines_x64_elf)',
101               ],
102               'sources': ['<@(openssl_sources_x64_elf_gas)'],
103             }, 'target_arch=="arm64"', {
104               'defines': ['<@(openssl_defines_arm64)',],
105               'sources': ['<@(openssl_sources_arm64_linux64_gas)'],
106             }, {
107               # Other architectures don't use assembly.
108               'defines': ['OPENSSL_NO_ASM'],
109               'sources': ['<@(openssl_sources_no_asm)'],
110             }],
111           ],
112         }], # end of conditions of openssl_no_asm
113         ['OS=="win"', {
114           'defines' : ['<@(openssl_defines_all_win)'],
115           'includes': ['masm_compile.gypi',],
116         }, {
117           'defines' : ['<@(openssl_defines_all_non_win)']
118         }]
119       ],
120       'include_dirs': ['<@(openssl_include_dirs)'],
121       'direct_dependent_settings': {
122         'include_dirs': [
123           'openssl/include'
124         ],
125       },
126     },
127     {
128       # openssl-cli target
129       'includes': ['openssl-cli.gypi',],
130     }
131   ],
132   'target_defaults': {
133     'includes': ['openssl.gypi'],
134     'include_dirs': ['<@(openssl_default_include_dirs)'],
135     'defines': ['<@(openssl_default_defines_all)'],
136     'conditions': [
137       ['OS=="win"', {
138         'defines': ['<@(openssl_default_defines_win)'],
139         'link_settings': {
140           'libraries': ['<@(openssl_default_libraries_win)'],
141         },
142       }, {
143         'defines': ['<@(openssl_default_defines_not_win)'],
144         'cflags': ['-Wno-missing-field-initializers'],
145         'conditions': [
146           ['OS=="mac"', {
147             'defines': ['<@(openssl_default_defines_mac)'],
148           }, {
149             'defines': ['<@(openssl_default_defines_linux_others)'],
150           }],
151         ]
152       }],
153       ['is_clang==1 or gcc_version>=43', {
154         'cflags': ['-Wno-old-style-declaration'],
155       }],
156       ['OS=="solaris"', {
157         'defines': ['__EXTENSIONS__'],
158       }],
159     ],
160   },
161 }
162
163 # Local Variables:
164 # tab-width:2
165 # indent-tabs-mode:nil
166 # End:
167 # vim: set expandtab tabstop=2 shiftwidth=2: