summaryrefslogtreecommitdiffstats
path: root/third_party/netty-tcnative/netty-tcnative.gyp
blob: 9362cb00670a281400bfa1eb7cf9fecb509202c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# Builds the Netty fork of Tomcat Native. See http://netty.io/wiki/forked-tomcat-native.html
{
  'targets': [
    {
      'target_name': 'netty-tcnative-so',
      'product_name': 'netty-tcnative',
      'type': 'shared_library',
      'sources': [
        'src/c/address.c',
        'src/c/bb.c',
        'src/c/dir.c',
        'src/c/error.c',
        'src/c/file.c',
        'src/c/info.c',
        'src/c/jnilib.c',
        'src/c/lock.c',
        'src/c/misc.c',
        'src/c/mmap.c',
        'src/c/multicast.c',
        'src/c/network.c',
        'src/c/os.c',
        'src/c/os_unix_system.c',
        'src/c/os_unix_uxpipe.c',
        'src/c/poll.c',
        'src/c/pool.c',
        'src/c/proc.c',
        'src/c/shm.c',
        'src/c/ssl.c',
        'src/c/sslcontext.c',
        'src/c/sslinfo.c',
        'src/c/sslnetwork.c',
        'src/c/ssl_private.h',
        'src/c/sslutils.c',
        'src/c/stdlib.c',
        'src/c/tcn_api.h',
        'src/c/tcn.h',
        'src/c/tcn_version.h',
        'src/c/thread.c',
        'src/c/user.c',
      ],
      'include_dirs': [
        '../apache-portable-runtime/src/include',
      ],
      'defines': [
        'HAVE_OPENSSL',
      ],
      'cflags': [
        '-w',
      ],
      'dependencies': [
        '../apache-portable-runtime/apr.gyp:apr',
        '../boringssl/boringssl.gyp:boringssl',
      ],
      'variables': {
        'use_native_jni_exports': 1,
      },
    },
    {
      'target_name': 'netty-tcnative',
      'type': 'none',
      'variables': {
        'java_in_dir': 'src/java',
        'javac_includes': [ '**/org/apache/tomcat/jni/*.java' ],
        'run_findbugs': 0,
      },
      'includes': [ '../../build/java.gypi' ],
      'dependencies': [
        'netty-tcnative-so',
        'rename_netty_tcnative_so_file',
      ],
      'export_dependent_settings': [
        'rename_netty_tcnative_so_file',
      ],
    },
    {
      # libnetty-tcnative shared library should have a specific name when
      # it is copied to the test APK. This target renames (actually makes
      # a copy of) the 'so' file if it has a different name.
      'target_name': 'rename_netty_tcnative_so_file',
      'type': 'none',
      'conditions': [
        ['component=="shared_library"', {
          'actions': [
          {
            'action_name': 'copy',
            'inputs': ['<(PRODUCT_DIR)/lib/libnetty-tcnative.cr.so'],
            'outputs': ['<(PRODUCT_DIR)/lib/libnetty-tcnative.so'],
            'action': [
              'cp',
              '<@(_inputs)',
              '<@(_outputs)',
            ],
          }],
       }],
      ],
      'dependencies': [
        'netty-tcnative-so',
      ],
      'direct_dependent_settings': {
        'variables': {
          'netty_tcnative_so_file_location': '<(PRODUCT_DIR)/lib/libnetty-tcnative.so',
        },
      },
    },
  ],
}