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)" "<(system_libdir)"',
     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 == "linux"', {
    112           'link_settings': {
    113             'libraries': [
    114               '-ldl',
    115             ],
    116           },
    117         }],
    118         [ 'OS == "mac" or OS == "ios"', {
    119           'defines': [
    120             'XP_UNIX',
    121             'DARWIN',
    122             'XP_MACOSX',
    123           ],
    124         }],
    125         [ 'OS == "mac"', {
    126           'link_settings': {
    127             'libraries': [
    128               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
    129             ],
    130           },
    131         }],
    132         [ 'OS == "win"', {
    133             'sources!': [
    134               'ssl/unix_err.c',
    135               'ssl/unix_err.h',
    136             ],
    137           },
    138           {  # else: OS != "win"
    139             'sources!': [
    140               'ssl/win32err.c',
    141               'ssl/win32err.h',
    142             ],
    143           },
    144         ],
    145         [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
    146           'include_dirs': [
    147             'ssl/bodge',
    148           ],
    149           'cflags': [
    150             '<!@(<(pkg-config) --cflags nss)',
    151           ],
    152           'ldflags': [
    153             '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
    154           ],
    155           'libraries': [
    156             '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
    157           ],
    158         }],
    159         [ 'OS == "mac" or OS == "ios" or OS == "win"', {
    160           'sources/': [
    161             ['exclude', 'ssl/bodge/'],
    162           ],
    163           'conditions': [
    164             ['OS != "ios"', {
    165               'defines': [
    166                 'NSS_PLATFORM_CLIENT_AUTH',
    167               ],
    168               'direct_dependent_settings': {
    169                 'defines': [
    170                   'NSS_PLATFORM_CLIENT_AUTH',
    171                 ],
    172               },
    173             }],
    174           ],
    175           'dependencies': [
    176             '../../../third_party/nss/nss.gyp:nspr',
    177             '../../../third_party/nss/nss.gyp:nss',
    178           ],
    179           'export_dependent_settings': [
    180             '../../../third_party/nss/nss.gyp:nspr',
    181             '../../../third_party/nss/nss.gyp:nss',
    182           ],
    183           'direct_dependent_settings': {
    184             'include_dirs': [
    185               'ssl',
    186             ],
    187           },
    188         }],
    189       ],
    190       'configurations': {
    191         'Debug_Base': {
    192           'defines': [
    193             'DEBUG',
    194           ],
    195         },
    196       },
    197     },
    198   ],
    199 }
    200