xref: /OK3568_Linux_fs/buildroot/package/cryptsetup/cryptsetup.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# cryptsetup
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunCRYPTSETUP_VERSION_MAJOR = 2.3
8*4882a593SmuzhiyunCRYPTSETUP_VERSION = $(CRYPTSETUP_VERSION_MAJOR).6
9*4882a593SmuzhiyunCRYPTSETUP_SOURCE = cryptsetup-$(CRYPTSETUP_VERSION).tar.xz
10*4882a593SmuzhiyunCRYPTSETUP_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/cryptsetup/v$(CRYPTSETUP_VERSION_MAJOR)
11*4882a593SmuzhiyunCRYPTSETUP_DEPENDENCIES = \
12*4882a593Smuzhiyun	lvm2 popt host-pkgconf json-c libargon2 \
13*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_LIBICONV),libiconv) \
14*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_UTIL_LINUX_LIBS),util-linux-libs,util-linux) \
15*4882a593Smuzhiyun	$(TARGET_NLS_DEPENDENCIES)
16*4882a593SmuzhiyunCRYPTSETUP_LICENSE = GPL-2.0+ (programs), LGPL-2.1+ (library)
17*4882a593SmuzhiyunCRYPTSETUP_LICENSE_FILES = COPYING COPYING.LGPL
18*4882a593SmuzhiyunCRYPTSETUP_CPE_ID_VENDOR = cryptsetup_project
19*4882a593SmuzhiyunCRYPTSETUP_INSTALL_STAGING = YES
20*4882a593SmuzhiyunCRYPTSETUP_CONF_ENV += LDFLAGS="$(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)"
21*4882a593SmuzhiyunCRYPTSETUP_CONF_OPTS += --enable-blkid --enable-libargon2
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun# cryptsetup uses libgcrypt by default, but can be configured to use OpenSSL
24*4882a593Smuzhiyun# or kernel crypto modules instead
25*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
26*4882a593SmuzhiyunCRYPTSETUP_DEPENDENCIES += libgcrypt
27*4882a593SmuzhiyunCRYPTSETUP_CONF_ENV += LIBGCRYPT_CONFIG=$(STAGING_DIR)/usr/bin/libgcrypt-config
28*4882a593SmuzhiyunCRYPTSETUP_CONF_OPTS += --with-crypto_backend=gcrypt
29*4882a593Smuzhiyunelse ifeq ($(BR2_PACKAGE_OPENSSL),y)
30*4882a593SmuzhiyunCRYPTSETUP_DEPENDENCIES += openssl
31*4882a593SmuzhiyunCRYPTSETUP_CONF_OPTS += --with-crypto_backend=openssl
32*4882a593Smuzhiyunelse
33*4882a593SmuzhiyunCRYPTSETUP_CONF_OPTS += --with-crypto_backend=kernel
34*4882a593Smuzhiyunendif
35*4882a593Smuzhiyun
36*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_SYSTEMD_TMPFILES),y)
37*4882a593SmuzhiyunCRYPTSETUP_CONF_OPTS += --with-tmpfilesdir=/usr/lib/tmpfiles.d
38*4882a593Smuzhiyunelse
39*4882a593SmuzhiyunCRYPTSETUP_CONF_OPTS += --without-tmpfilesdir
40*4882a593Smuzhiyunendif
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunHOST_CRYPTSETUP_DEPENDENCIES = \
43*4882a593Smuzhiyun	host-pkgconf \
44*4882a593Smuzhiyun	host-lvm2 \
45*4882a593Smuzhiyun	host-popt \
46*4882a593Smuzhiyun	host-util-linux \
47*4882a593Smuzhiyun	host-json-c \
48*4882a593Smuzhiyun	host-openssl
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunHOST_CRYPTSETUP_CONF_OPTS = --with-crypto_backend=openssl \
51*4882a593Smuzhiyun	--disable-kernel_crypto \
52*4882a593Smuzhiyun	--enable-blkid \
53*4882a593Smuzhiyun	--with-tmpfilesdir=no
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun$(eval $(autotools-package))
56*4882a593Smuzhiyun$(eval $(host-autotools-package))
57