forked from intel/QAT_Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
292 lines (258 loc) · 9.65 KB
/
Makefile.am
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = subdir-objects
lib_LTLIBRARIES = @[email protected]
bin_PROGRAMS =
if QAT_HW
if QAT_HW_CONTIG_MEM
QAT_HW_MEM_SRC = qae_mem_utils.c \
qat_sys_call.c
endif
if QAT_HW_MULTI_THREAD
QAT_HW_MEM_SRC = qat_hw_multi_thread_inf.c \
qat_sys_call.c
endif
if QAT_HW_USDM
QAT_HW_MEM_SRC = qat_hw_usdm_inf.c
endif
endif
if !QAT_BORINGSSL
QAT_COMMON_SRC = e_qat.c \
qat_fork.c \
qat_events.c \
qat_utils.c \
qat_evp.c
if QAT_PROVIDER
QAT_PROV_SRC = qat_prov_init.c \
qat_prov_kmgmt_rsa.c \
qat_prov_sign_rsa.c \
qat_prov_rsa.c \
qat_prov_kmgmt_ecx.c \
qat_prov_exch_ecx.c \
qat_prov_ciphers.c \
qat_prov_kmgmt_ec.c \
qat_prov_ecdsa.c \
qat_prov_ecdh.c \
qat_prov_dsa.c \
qat_prov_kmgmt_dsa.c \
qat_prov_dh.c \
qat_prov_kmgmt_dh.c \
qat_prov_hkdf.c \
qat_prov_prf.c \
qat_prov_cbc.c \
qat_prov_sha3.c \
qat_prov_bio.c \
qat_prov_capabilities.c \
qat_prov_chachapoly.c \
qat_prov_sign_sm2.c \
qat_prov_hkdf_packet.c \
qat_prov_sm4_gcm.c \
qat_prov_sm4_ccm.c \
qat_prov_sm4_cbc.c \
qat_prov_sm3.c
if QAT_FIPS
QAT_FIPS_SRC = qat_fips.c \
qat_self_test_kats.c \
qat_self_test_tls_prf.c \
qat_prov_cmvp.c \
qat_prov_sha2.c \
qat_sw_sha2.c
endif
endif
if QAT_OPENSSL_3
QAT_ERR_SRC = qat_prov_err.c
else
QAT_ERR_SRC = e_qat_err.c
endif
if QAT_HW
QAT_HW_SRC = qat_hw_init.c \
qat_hw_asym_common.c \
qat_hw_polling.c \
qat_hw_callback.c \
qat_hw_rsa.c \
qat_hw_rsa_crt.c \
qat_hw_ciphers.c \
qat_hw_dh.c \
qat_hw_dsa.c \
qat_hw_ec.c \
qat_hw_prf.c \
qat_hw_gcm.c \
qat_hw_hkdf.c \
qat_hw_ecx.c \
qat_hw_sha3.c \
qat_hw_chachapoly.c \
qat_hw_sm4_cbc.c \
qat_hw_sm3.c \
qat_hw_sm2.c \
qat_hw_ccm.c
if ENABLE_QAT_HW_KPT
QAT_HW_KPT_SRC = qat_hw_kpt.c
endif
endif
if QAT_SW
QAT_SW_SRC = qat_sw_init.c \
qat_sw_polling.c \
qat_sw_freelist.c \
qat_sw_queue.c \
qat_sw_rsa.c \
qat_sw_ecx.c \
qat_sw_ec.c \
qat_sw_sm2.c \
qat_sw_sm3.c \
qat_sw_sm4_cbc.c \
qat_sw_sm4_gcm.c \
qat_sw_sm4_ccm.c
endif
if QAT_SW_IPSEC
QAT_SW_IPSEC_SRC = qat_sw_gcm.c \
qat_sw_ipsec_inf.c
endif
endif
if QAT_BORINGSSL
QAT_COMMON_SRC = e_qat.c \
qat_utils.c \
qat_fork.c \
qat_events.c \
qat_evp.c \
qat_bssl.c
QAT_ERR_SRC = qat_bssl_err.c
if QAT_HW
QAT_HW_SRC = qat_hw_init.c \
qat_hw_asym_common.c \
qat_hw_polling.c \
qat_hw_callback.c \
qat_hw_rsa.c \
qat_hw_rsa_crt.c \
qat_hw_ec.c
endif
if QAT_SW
QAT_SW_SRC = qat_sw_init.c \
qat_sw_polling.c \
qat_sw_freelist.c \
qat_sw_queue.c \
qat_sw_rsa.c \
qat_sw_ec.c
endif
endif
@LIBQATNAME@_la_SOURCES = ${QAT_COMMON_SRC} \
${QAT_PROV_SRC} \
${QAT_FIPS_SRC} \
${QAT_ERR_SRC} \
${QAT_HW_SRC} \
${QAT_HW_MEM_SRC} \
${QAT_SW_SRC} \
${QAT_SW_IPSEC_SRC} \
${QAT_HW_KPT_SRC}
AM_CPPFLAGS = $(includes_openssl) $(includes_qat_hw_usdm) \
$(includes_qat_hw) $(includes_qat_sw_crypto_mb) \
$(includes_qat_sw_ipsec_mb) $(includes_kpt_lib)
AM_CFLAGS = $(cflags_cc_opt) $(cflags_qat_hw_intree) \
$(cflags_mem_driver) $(cflags_openssl_3) \
$(cflags_boringssl) $(cflags_qat_hw) \
$(cflags_qat_sw) $(cflags_qat_sw_ipsec) \
$(cflags_common) $(cflags_qat_debug)
if QAT_BORINGSSL
bin_PROGRAMS += qatengine_test
@LIBQATNAME@_la_LDFLAGS = -no-undefined -avoid-version \
$(QAT_LD_LIB) $(QAT_HW_DRIVER_LIB) \
$(QAT_HW_MEM_LIB) $(QAT_SW_CRYPTO_MB_LIB) \
$(QAT_SW_IPSEC_MB_LIB) $(QAT_BORINGSSL_LIB)
qatengine_test_LDFLAGS = $(QAT_LD_LIB) $(QAT_HW_DRIVER_LIB) \
$(QAT_HW_MEM_LIB) $(QAT_SW_CRYPTO_MB_LIB) \
$(QAT_SW_IPSEC_MB_LIB) $(QAT_BORINGSSL_LIB)
qatengine_test_SOURCES = test_bssl/main.c \
test_bssl/test_bssl_rsa.c \
test_bssl/test_bssl_ecdsa.c \
test_bssl/test_bssl_utils.c
qatengine_test_LDADD = $(lib_LTLIBRARIES) -lpthread
else
@LIBQATNAME@_la_LDFLAGS = -module -no-undefined -avoid-version \
-shared $(QAT_LD_LIB) $(QAT_HW_DRIVER_LIB) \
$(QAT_HW_MEM_LIB) $(QAT_SW_CRYPTO_MB_LIB) \
$(QAT_SW_IPSEC_MB_LIB)
endif
if QAT_PLOCK
lib_LTLIBRARIES += libplock.la
libplock_la_LDFLAGS = --shared -fPIC -Wextra -Wundef \
-Wdeclaration-after-statement -Wfatal-errors \
-Wtype-limits -Wshift-negative-value -Wshift-overflow=2 \
-Wduplicated-cond -Wnull-dereference \
-Wno-address-of-packed-member -Wno-unused-label \
-Wno-sign-compare -Wno-unused-parameter -Wno-clobbered \
-Wno-missing-field-initializers -Wno-cast-function-type \
-Wno-string-plus-int -Wno-atomic-alignment
libplock_la_SOURCES = plock.c
endif
if ENABLE_QAT_HW_KPT
noinst_LTLIBRARIES = libkpt.la
libkpt_la_SOURCES = kpt/lib/kpt.c
libkpt_la_CFLAGS = $(includes_qat_hw) $(includes_openssl) \
$(cflags) $(cflags_openssl_3) \
$(cflags_common)
libkpt_la_LDFLAGS = $(QAT_LD_LIB) $(QAT_HW_DRIVER_LIB) \
$(OPENSSL_LIB) -ldl -lrt -lpthread
EXTRA_PROGRAMS = kpttool testapp
kpttool_SOURCES = kpt/apps/main.c \
kpt/apps/kpt_swk.c \
kpt/apps/kpt_rsa_key.c \
kpt/apps/kpt_ecc_key.c \
kpt/apps/kpt_dev_pp.c
kpttool_CFLAGS = $(includes_qat_hw) $(includes_openssl) \
$(cflags_openssl_3) \
-fPIE -pie -g -static -z relro -z now
kpttool_LDFLAGS = $(QAT_LD_LIB) $(QAT_HW_DRIVER_LIB)
kpttool_LDADD = $(OPENSSL_LIB) $(QAT_HW_MEM_LIB) -lpthread -ldl -lrt
@LIBQATNAME@_la_LIBADD = libkpt.la
endif
mostlyclean-generic:
-rm -rf *.obj bin lib tags core .pure .nfs* \
*.old *.bak fluff *.so *.sl *.dll test/*.obj testapp \
test/.dirstamp test/*.o test_bssl/*obj test_bssl/.dirstamp \
test_bssl/*.o qatengine_test rpmbuild kpttool
if QAT_ERR_FILES_BUILD
MAKE = make err-files && make
endif
err-files:
if QAT_OPENSSL_3
perl -I$(with_openssl_dir) $(with_openssl_dir)/util/mkerr.pl -conf qat_prov.ec \
-rebuild -reindex `ls *.c | sed "s/qat_bssl_err.c//"`
else
perl -I$(with_openssl_dir) $(with_openssl_dir)/util/mkerr.pl -conf e_qat.ec \
-rebuild -reindex `ls *.c | sed "s/qat_bssl_err.c//"`
endif
if QAT_FIPS
intkat:
$(shell ./intkat.sh)
endif
if QAT_HW
depend: OpenSSL qat_hw_driver
endif
if QAT_SW
depend: OpenSSL ipsec_mb crypto_mb
endif
OpenSSL:
cd openssl && ./config -Wl,-rpath,$(with_openssl_install_dir)/lib64 --prefix=$(with_openssl_install_dir) && make clean && make -j$(nproc) && make install -j$(nproc)
if QAT_HW
qat_hw_driver:
bash ./driver_install.sh $(with_qat_hw_dir)
if QAT_4XXX
if !QAT_HW_INTREE
cflags_qat_hw += "-DQAT20_OOT"
endif
endif
endif
if QAT_SW
ipsec_mb:
cd intel-ipsec-mb && make uninstall && make clean && make -j$(nproc) && make install -j$(nproc)
crypto_mb:
cd ipp-crypto/sources/ippcp/crypto_mb && rm -rf build && cmake . -B"build" -DOPENSSL_INCLUDE_DIR=$(with_openssl_install_dir)/include -DOPENSSL_LIBRARIES=$(with_openssl_install_dir) -DOPENSSL_ROOT_DIR=$(PWD)/openssl && cd build && make clean && make -j$(nproc) && make install -j$(nproc)
endif
if QAT_4XXX
rpm_oot:
mkdir -p rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS
cp qatengine-oot.spec rpmbuild/SPECS/
rpmbuild --undefine=_disable_source_fetch --define "_topdir $(abs_srcdir)/rpmbuild" -ba rpmbuild/SPECS/qatengine-oot.spec
endif
rpm_intree:
mkdir -p rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES rpmbuild/SPECS rpmbuild/SRPMS
rpmbuild --undefine=_disable_source_fetch --define "_topdir $(abs_srcdir)/rpmbuild" -ba qatengine.spec
include test.am