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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 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 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
install_headers('pkcs11.h', 'pkcs11x.h', subdir: 'p11-kit-1/p11-kit')
libp11_common_sources = [
'argv.c',
'attrs.c',
'array.c',
'base64.c',
'buffer.c',
'compat.c',
'constants.c',
'debug.c',
'dict.c',
'hash.c',
'hex.c',
'lexer.c',
'message.c',
'path.c',
'pem.c',
'runtime.c',
'url.c',
'vsock.c'
]
libp11_common = static_library('p11-common', libp11_common_sources,
gnu_symbol_visibility: 'hidden',
include_directories: configinc)
libp11_common_dep = declare_dependency(include_directories: [configinc,
commoninc],
link_with: libp11_common)
libp11_library = static_library('p11-library', 'library.c',
gnu_symbol_visibility: 'hidden',
include_directories: configinc)
libp11_library_dep = declare_dependency(link_with: libp11_library,
dependencies: [libp11_common_dep] + thread_deps + libintl_deps)
libp11_library_whole_dep = declare_dependency(link_whole: libp11_library,
dependencies: [libp11_common_dep] + thread_deps + libintl_deps)
if get_option('test')
libp11_test_sources = [
'mock.c',
'test.c'
]
libp11_test = static_library('p11-test', libp11_test_sources,
include_directories: configinc)
libp11_test_dep = declare_dependency(link_with: libp11_test,
dependencies: [libp11_common_dep] + thread_deps)
endif
libp11_tool_sources = [
'options.c',
'print.c'
]
if host_system != 'windows'
libp11_tool_sources += ['unix-peer.c', 'unix-peer.h']
rpl_functions = [
'readpassphrase',
]
foreach f : rpl_functions
if not cc.has_function(f, dependencies: system_deps)
libp11_tool_sources += '@0@.c'.format(f)
endif
endforeach
endif
libp11_tool = static_library('p11-tool', libp11_tool_sources,
include_directories: configinc)
libp11_tool_dep = declare_dependency(link_with: libp11_tool,
dependencies: [libp11_common_dep])
libp11_asn1_deps = []
if with_asn1
libp11_asn1_sources = [
'asn1.c',
'oid.c',
'persist.c',
]
basic_asn_h = custom_target(
'basic.asn.h',
output: 'basic.asn.h',
input: 'basic.asn',
command: [asn1Parser, '-o', '@OUTPUT@', '@INPUT@'],
)
pkix_asn_h = custom_target(
'pkix.asn.h',
output: 'pkix.asn.h',
input: 'pkix.asn',
command: [asn1Parser, '-o', '@OUTPUT@', '@INPUT@'],
)
openssl_asn_h = custom_target(
'openssl.asn.h',
output: 'openssl.asn.h',
input: 'openssl.asn',
command: [asn1Parser, '-o', '@OUTPUT@', '@INPUT@'],
)
asn_h_dep = declare_dependency(
sources: [basic_asn_h, pkix_asn_h, openssl_asn_h],
)
libp11_asn1 = static_library(
'p11-asn1', libp11_asn1_sources,
gnu_symbol_visibility: 'hidden',
include_directories: configinc,
dependencies: [asn_h_dep] + libtasn1_deps,
)
libp11_asn1_dep = declare_dependency(
include_directories: [configinc, commoninc],
link_with: libp11_asn1,
dependencies: [asn_h_dep] + libtasn1_deps,
)
libp11_asn1_deps += libp11_asn1_dep
endif
# Tests ----------------------------------------------------------------
if get_option('test')
test_init_conf = configuration_data()
test_init_conf.set_quoted('prefix', prefix)
test_init_conf.set_quoted('exec_prefix', prefix)
test_init_conf.set_quoted('datarootdir', prefix / datadir)
test_init_conf.set_quoted('datadir', prefix / datadir)
test_init_conf.set_quoted('sysconfdir', prefix / sysconfdir)
test_init_conf.set_quoted('libdir', prefix / libdir)
test_init_conf.set_quoted('libexecdir', prefix / libexecdir)
test_init_conf.set_quoted('privatedir', prefix / privatedir)
test_init_conf.set_quoted('with_trust_paths', trust_paths)
configure_file(
input: 'test-init.sh.in',
output: 'test-init.sh',
configuration: test_init_conf,
)
common_tests = [
'test-tests',
'test-compat',
'test-hash',
'test-dict',
'test-array',
'test-hex',
'test-constants',
'test-attrs',
'test-buffer',
'test-url',
'test-path',
'test-lexer',
'test-message',
'test-argv',
'test-runtime'
]
foreach name : common_tests
t = executable(name, '@0@.c'.format(name),
c_args: tests_c_args,
include_directories: configinc,
dependencies: dlopen_deps,
link_with: [libp11_test, libp11_common])
test(name, t)
endforeach
if with_asn1
asn1_tests = [
'test-asn1',
'test-oid',
]
foreach name : asn1_tests
t = executable(name, '@0@.c'.format(name),
c_args: tests_c_args,
include_directories: configinc,
dependencies: libp11_asn1_deps + dlopen_deps,
link_with: [libp11_test, libp11_common])
test(name, t)
endforeach
endif
common_progs = [
'frob-getauxval',
'frob-getenv'
]
if host_system != 'windows'
common_progs += ['frob-getprogname']
endif
foreach name : common_progs
executable(name, '@0@.c'.format(name),
c_args: tests_c_args,
include_directories: configinc,
dependencies: dlopen_deps,
link_with: [libp11_common])
endforeach
endif
|