crypto/snow3g: use IPsec library
[dpdk.git] / drivers / crypto / snow3g / Makefile
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2016-2019 Intel Corporation
3
4 include $(RTE_SDK)/mk/rte.vars.mk
5
6 # library name
7 LIB = librte_pmd_snow3g.a
8
9 # build flags
10 CFLAGS += -O3
11 CFLAGS += $(WERROR_FLAGS)
12 CFLAGS += -DALLOW_EXPERIMENTAL_API
13
14 # versioning export map
15 EXPORT_MAP := rte_pmd_snow3g_version.map
16
17 # external library dependencies
18 LDLIBS += -lIPSec_MB
19 LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring
20 LDLIBS += -lrte_cryptodev
21 LDLIBS += -lrte_bus_vdev
22
23 IMB_HDR = $(shell echo '\#include <intel-ipsec-mb.h>' | \
24         $(CC) -E $(EXTRA_CFLAGS) - | grep 'intel-ipsec-mb.h' | \
25         head -n1 | cut -d'"' -f2)
26
27 # Detect library version
28 IMB_VERSION = $(shell grep -e "IMB_VERSION_STR" $(IMB_HDR) | cut -d'"' -f2)
29 IMB_VERSION_NUM = $(shell grep -e "IMB_VERSION_NUM" $(IMB_HDR) | cut -d' ' -f3)
30
31 ifeq ($(IMB_VERSION),)
32 $(error "IPSec_MB version >= 0.53 is required")
33 endif
34
35 ifeq ($(shell expr $(IMB_VERSION_NUM) \< 0x3400), 1)
36 $(error "IPSec_MB version >= 0.53 is required")
37 endif
38
39 # library source files
40 SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd.c
41 SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd_ops.c
42
43 include $(RTE_SDK)/mk/rte.lib.mk