openssl.gyp 5.24 KB
Newer Older
1 2 3 4 5 6
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'variables': {
7
    'is_clang': 1,
8 9
    'gcc_version': 0,
    'openssl_no_asm%': 0,
10
    'llvm_version%': 0,
Maximiliano Korp's avatar
Bump  
Maximiliano Korp committed
11
    'xcode_version%': 0,
12
    'gas_version%': 0,
13
    'use_obsolete_asm%': 'true',
Maximiliano Korp's avatar
Bump  
Maximiliano Korp committed
14
    'openssl_fips%': 'false',
15
    'node_byteorder%': 'small'
16 17 18 19
  },
  'targets': [
    {
      'target_name': 'openssl',
20
      'type': 'static_library',
21 22 23 24 25 26
      'includes': ['openssl.gypi'],
      'sources': ['<@(openssl_sources)'],
      'sources/': [
        ['exclude', 'md2/.*$'],
        ['exclude', 'store/.*$']
      ],
27 28 29 30 31
      'defines': [
        'PURIFY',
        '_REENTRANT',
        'NO_WINDOWS_BRAINDEATH'
      ],
32 33 34 35 36 37 38 39 40
      'conditions': [
        [ 'OS=="aix"', {
            # AIX is missing /usr/include/endian.h
            'defines': [
              '__LITTLE_ENDIAN=1234',
              '__BIG_ENDIAN=4321',
              '__BYTE_ORDER=__BIG_ENDIAN',
              '__FLOAT_WORD_ORDER=__BIG_ENDIAN'],
        }],
Maximiliano Korp's avatar
Bump  
Maximiliano Korp committed
41 42 43 44 45 46 47
        [ 'node_byteorder=="big"', {
            # Define Big Endian
            'defines': ['B_ENDIAN']
          }, {
            # Define Little Endian
           'defines':['L_ENDIAN']
        }],
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
        ['openssl_no_asm!=0', {
          # Disable asm
          'defines': [
            'OPENSSL_NO_ASM',
          ],
          'sources': ['<@(openssl_sources_no_asm)'],
        }, {
          # "else if" was supported in https://codereview.chromium.org/601353002
          'conditions': [
            ['target_arch=="arm"', {
              'defines': ['<@(openssl_defines_asm)'],
              'sources': ['<@(openssl_sources_arm_void_gas)'],
            }, 'target_arch=="ia32" and OS=="mac"', {
              'defines': [
                '<@(openssl_defines_asm)',
                '<@(openssl_defines_ia32_mac)',
              ],
              'sources': ['<@(openssl_sources_ia32_mac_gas)'],
            }, 'target_arch=="ia32" and OS=="win"', {
              'defines': [
                '<@(openssl_defines_asm)',
                '<@(openssl_defines_ia32_win)',
              ],
              'sources': ['<@(openssl_sources_ia32_win_masm)'],
            }, 'target_arch=="ia32"', {
              # Linux or others
              'defines': [
                '<@(openssl_defines_asm)',
                '<@(openssl_defines_ia32_elf)',
              ],
              'sources': ['<@(openssl_sources_ia32_elf_gas)'],
            }, 'target_arch=="x64" and OS=="mac"', {
              'defines': [
                '<@(openssl_defines_asm)',
                '<@(openssl_defines_x64_mac)',
              ],
              'sources': ['<@(openssl_sources_x64_mac_gas)'],
            }, 'target_arch=="x64" and OS=="win"', {
              'defines': [
                '<@(openssl_defines_asm)',
                '<@(openssl_defines_x64_win)',
              ],
              'sources': ['<@(openssl_sources_x64_win_masm)'],
            }, 'target_arch=="x64"', {
              # Linux or others
              'defines': [
                '<@(openssl_defines_asm)',
                '<@(openssl_defines_x64_elf)',
              ],
              'sources': ['<@(openssl_sources_x64_elf_gas)'],
            }, 'target_arch=="arm64"', {
              'defines': ['<@(openssl_defines_arm64)',],
              'sources': ['<@(openssl_sources_arm64_linux64_gas)'],
            }, {
              # Other architectures don't use assembly.
              'defines': ['OPENSSL_NO_ASM'],
              'sources': ['<@(openssl_sources_no_asm)'],
            }],
          ],
        }], # end of conditions of openssl_no_asm
        ['OS=="win"', {
          'defines' : ['<@(openssl_defines_all_win)'],
        }, {
          'defines' : ['<@(openssl_defines_all_non_win)']
Maximiliano Korp's avatar
Bump  
Maximiliano Korp committed
112 113 114 115 116 117 118 119 120
        }],
        ['target_arch=="ia32" and OS=="win"', {
          'msvs_settings': {
            'MASM': {
              # Use /safeseh, see commit: 01fa5ee
              'UseSafeExceptionHandlers': 'true',
            },
          },
        }],
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
      ],
      'include_dirs': ['<@(openssl_include_dirs)'],
      'direct_dependent_settings': {
        'include_dirs': [
          'openssl/include'
        ],
      },
    },
    {
      # openssl-cli target
      'includes': ['openssl-cli.gypi',],
    }
  ],
  'target_defaults': {
    'includes': ['openssl.gypi'],
    'include_dirs': ['<@(openssl_default_include_dirs)'],
    'defines': ['<@(openssl_default_defines_all)'],
    'conditions': [
      ['OS=="win"', {
        'defines': ['<@(openssl_default_defines_win)'],
        'link_settings': {
          'libraries': ['<@(openssl_default_libraries_win)'],
        },
      }, {
        'defines': ['<@(openssl_default_defines_not_win)'],
        'cflags': ['-Wno-missing-field-initializers'],
        'conditions': [
          ['OS=="mac"', {
            'defines': ['<@(openssl_default_defines_mac)'],
          }, {
            'defines': ['<@(openssl_default_defines_linux_others)'],
          }],
        ]
      }],
155
      ['gcc_version>=43', {
156 157 158 159 160 161 162 163 164 165 166 167 168 169
        'cflags': ['-Wno-old-style-declaration'],
      }],
      ['OS=="solaris"', {
        'defines': ['__EXTENSIONS__'],
      }],
    ],
  },
}

# Local Variables:
# tab-width:2
# indent-tabs-mode:nil
# End:
# vim: set expandtab tabstop=2 shiftwidth=2: