9ccc23e6f89a5dc25cc2671486969de29dca132d
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / gnutls / gnutls.mk
1 ################################################################################
2 #
3 # gnutls
4 #
5 ################################################################################
6
7 GNUTLS_VERSION_MAJOR = 3.3
8 GNUTLS_VERSION = $(GNUTLS_VERSION_MAJOR).15
9 GNUTLS_SOURCE = gnutls-$(GNUTLS_VERSION).tar.xz
10 GNUTLS_SITE = ftp://ftp.gnutls.org/gcrypt/gnutls/v$(GNUTLS_VERSION_MAJOR)
11 GNUTLS_LICENSE = GPLv3+ LGPLv2.1+
12 GNUTLS_LICENSE_FILES = COPYING COPYING.LESSER
13 GNUTLS_DEPENDENCIES = host-pkgconf nettle pcre \
14         $(if $(BR2_PACKAGE_P11_KIT),p11-kit) \
15         $(if $(BR2_PACKAGE_LIBIDN),libidn) \
16         $(if $(BR2_PACKAGE_LIBTASN1),libtasn1) \
17         $(if $(BR2_PACKAGE_ZLIB),zlib)
18 GNUTLS_CONF_OPTS = \
19         --with-libnettle-prefix=$(STAGING_DIR)/usr \
20         --with-librt-prefix=$(STAGING_DIR) \
21         --disable-rpath \
22         --disable-doc \
23         --disable-guile \
24         --enable-local-libopts
25 GNUTLS_CONF_ENV = gl_cv_socket_ipv6=yes \
26         ac_cv_header_wchar_h=$(if $(BR2_USE_WCHAR),yes,no) \
27         gt_cv_c_wchar_t=$(if $(BR2_USE_WCHAR),yes,no) \
28         gt_cv_c_wint_t=$(if $(BR2_USE_WCHAR),yes,no) \
29         gl_cv_func_gettimeofday_clobber=no
30 GNUTLS_INSTALL_STAGING = YES
31
32 # libpthread and libz autodetection poison the linkpath
33 GNUTLS_CONF_OPTS += $(if $(BR2_TOOLCHAIN_HAS_THREADS),--with-libpthread-prefix=$(STAGING_DIR)/usr)
34 GNUTLS_CONF_OPTS += $(if $(BR2_PACKAGE_ZLIB),--with-libz-prefix=$(STAGING_DIR)/usr)
35
36 # gnutls needs libregex, but pcre can be used too
37 # The check isn't cross-compile friendly
38 GNUTLS_CONF_ENV += libopts_cv_with_libregex=yes
39 GNUTLS_CONF_OPTS += \
40         --with-regex-header=pcreposix.h \
41         --with-libregex-cflags="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --cflags`" \
42         --with-libregex-libs="`$(PKG_CONFIG_HOST_BINARY) libpcreposix --libs`"
43
44 # Consider crywrap as part of tools because it needs WCHAR, and it's so too
45 ifeq ($(BR2_PACKAGE_GNUTLS_TOOLS),)
46 GNUTLS_CONF_OPTS += --disable-crywrap
47 endif
48
49 # libidn support for nommu must exclude the crywrap wrapper (uses fork)
50 GNUTLS_CONF_OPTS += $(if $(BR2_USE_MMU),,--disable-crywrap)
51
52 ifeq ($(BR2_PACKAGE_CRYPTODEV_LINUX),y)
53 GNUTLS_CONF_OPTS += --enable-cryptodev
54 GNUTLS_DEPENDENCIES += cryptodev-linux
55 endif
56
57 # Some examples in doc/examples use wchar
58 define GNUTLS_DISABLE_DOCS
59         $(SED) 's/ doc / /' $(@D)/Makefile.in
60 endef
61
62 define GNUTLS_DISABLE_TOOLS
63         $(SED) 's/\$$(PROGRAMS)//' $(@D)/src/Makefile.in
64         $(SED) 's/) install-exec-am/)/' $(@D)/src/Makefile.in
65 endef
66
67 GNUTLS_POST_PATCH_HOOKS += GNUTLS_DISABLE_DOCS
68 GNUTLS_POST_PATCH_HOOKS += $(if $(BR2_PACKAGE_GNUTLS_TOOLS),,GNUTLS_DISABLE_TOOLS)
69
70 $(eval $(autotools-package))