Home | History | Annotate | Download | only in nss
      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   'conditions': [
      7     [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
      8       'conditions': [
      9         ['sysroot!=""', {
     10           'variables': {
     11             'pkg-config': '../../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
     12           },
     13         }, {
     14           'variables': {
     15             'pkg-config': 'pkg-config'
     16           },
     17         }],
     18       ],
     19     }],
     20   ],
     21 
     22   'targets': [
     23     {
     24       'target_name': 'libssl',
     25       'type': '<(component)',
     26       'product_name': 'crssl',  # Don't conflict with OpenSSL's libssl
     27       'sources': [
     28         'ssl/authcert.c',
     29         'ssl/cmpcert.c',
     30         'ssl/derive.c',
     31         'ssl/dtlscon.c',
     32         'ssl/os2_err.c',
     33         'ssl/os2_err.h',
     34         'ssl/preenc.h',
     35         'ssl/prelib.c',
     36         'ssl/ssl.h',
     37         'ssl/ssl3con.c',
     38         'ssl/ssl3ecc.c',
     39         'ssl/ssl3ext.c',
     40         'ssl/ssl3gthr.c',
     41         'ssl/ssl3prot.h',
     42         'ssl/sslauth.c',
     43         'ssl/sslcon.c',
     44         'ssl/ssldef.c',
     45         'ssl/sslenum.c',
     46         'ssl/sslerr.c',
     47         'ssl/sslerr.h',
     48         'ssl/SSLerrs.h',
     49         'ssl/sslerrstrs.c',
     50         'ssl/sslgathr.c',
     51         'ssl/sslimpl.h',
     52         'ssl/sslinfo.c',
     53         'ssl/sslinit.c',
     54         'ssl/sslmutex.c',
     55         'ssl/sslmutex.h',
     56         'ssl/sslnonce.c',
     57         'ssl/sslplatf.c',
     58         'ssl/sslproto.h',
     59         'ssl/sslreveal.c',
     60         'ssl/sslsecur.c',
     61         'ssl/sslsnce.c',
     62         'ssl/sslsock.c',
     63         'ssl/sslt.h',
     64         'ssl/ssltrace.c',
     65         'ssl/sslver.c',
     66         'ssl/unix_err.c',
     67         'ssl/unix_err.h',
     68         'ssl/win32err.c',
     69         'ssl/win32err.h',
     70         'ssl/bodge/secitem_array.c',
     71       ],
     72       'sources!': [
     73         'ssl/os2_err.c',
     74         'ssl/os2_err.h',
     75       ],
     76       'defines': [
     77         'NO_PKCS11_BYPASS',
     78         'NSS_ENABLE_ECC',
     79         'USE_UTIL_DIRECTLY',
     80       ],
     81       'msvs_disabled_warnings': [4018, 4244, 4267],
     82       'conditions': [
     83         ['component == "shared_library"', {
     84           'conditions': [
     85             ['OS == "mac" or OS == "ios"', {
     86               'xcode_settings': {
     87                 'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
     88               },
     89             }],
     90             ['OS == "win"', {
     91               'sources': [
     92                 'ssl/exports_win.def',
     93               ],
     94             }],
     95             ['os_posix == 1 and OS != "mac" and OS != "ios"', {
     96               'cflags!': ['-fvisibility=hidden'],
     97             }],
     98           ],
     99         }],
    100         [ 'clang == 1', {
    101           'cflags': [
    102             # See http://crbug.com/138571#c8. In short, sslsecur.c picks up the
    103             # system's cert.h because cert.h isn't in chromium's repo.
    104             '-Wno-incompatible-pointer-types',
    105 
    106             # There is a broken header guard in /usr/include/nss/secmod.h:
    107             # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
    108             '-Wno-header-guard',
    109           ],
    110         }],
    111         [ 'OS == "mac" or OS == "ios"', {
    112           'defines': [
    113             'XP_UNIX',
    114             'DARWIN',
    115             'XP_MACOSX',
    116           ],
    117         }],
    118         [ 'OS == "mac"', {
    119           'link_settings': {
    120             'libraries': [
    121               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
    122             ],
    123           },
    124         }],
    125         [ 'OS == "win"', {
    126             'sources!': [
    127               'ssl/unix_err.c',
    128               'ssl/unix_err.h',
    129             ],
    130           },
    131           {  # else: OS != "win"
    132             'sources!': [
    133               'ssl/win32err.c',
    134               'ssl/win32err.h',
    135             ],
    136           },
    137         ],
    138         [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
    139           'include_dirs': [
    140             'ssl/bodge',
    141           ],
    142           'cflags': [
    143             '<!@(<(pkg-config) --cflags nss)',
    144           ],
    145           'ldflags': [
    146             '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
    147           ],
    148           'libraries': [
    149             '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
    150           ],
    151         }],
    152         [ 'OS == "mac" or OS == "ios" or OS == "win"', {
    153           'sources/': [
    154             ['exclude', 'ssl/bodge/'],
    155           ],
    156           'conditions': [
    157             ['OS != "ios"', {
    158               'defines': [
    159                 'NSS_PLATFORM_CLIENT_AUTH',
    160               ],
    161               'direct_dependent_settings': {
    162                 'defines': [
    163                   'NSS_PLATFORM_CLIENT_AUTH',
    164                 ],
    165               },
    166             }],
    167           ],
    168           'dependencies': [
    169             '../../../third_party/nss/nss.gyp:nspr',
    170             '../../../third_party/nss/nss.gyp:nss',
    171           ],
    172           'export_dependent_settings': [
    173             '../../../third_party/nss/nss.gyp:nspr',
    174             '../../../third_party/nss/nss.gyp:nss',
    175           ],
    176           'direct_dependent_settings': {
    177             'include_dirs': [
    178               'ssl',
    179             ],
    180           },
    181         }],
    182       ],
    183       'configurations': {
    184         'Debug_Base': {
    185           'defines': [
    186             'DEBUG',
    187           ],
    188         },
    189       },
    190     },
    191   ],
    192 }
    193