rules.mak 2.02 KB
Newer Older
1 2
# GnuTLS

Sébastien Blin's avatar
Sébastien Blin committed
3
GNUTLS_VERSION := 3.6.7
Adrien Béraud's avatar
Adrien Béraud committed
4
GNUTLS_URL := https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-$(GNUTLS_VERSION).tar.xz
5 6

PKGS += gnutls
7

Sébastien Blin's avatar
Sébastien Blin committed
8
ifeq ($(call need_pkg,"gnutls >= 3.6.7"),)
9 10 11 12 13 14 15 16 17 18 19 20
PKGS_FOUND += gnutls
endif

$(TARBALLS)/gnutls-$(GNUTLS_VERSION).tar.xz:
	$(call download,$(GNUTLS_URL))

.sum-gnutls: gnutls-$(GNUTLS_VERSION).tar.xz

gnutls: gnutls-$(GNUTLS_VERSION).tar.xz .sum-gnutls
	$(UNPACK)
ifdef HAVE_WIN32
	$(APPLY) $(SRC)/gnutls/gnutls-win32.patch
21 22
else
	$(APPLY) $(SRC)/gnutls/downgrade-gettext-requirement.patch
23 24 25 26
endif
ifdef HAVE_ANDROID
	$(APPLY) $(SRC)/gnutls/no-create-time-h.patch
endif
27 28 29
ifdef HAVE_MACOSX
	$(APPLY) $(SRC)/gnutls/gnutls-disable-getentropy-osx.patch
endif
30
	$(APPLY) $(SRC)/gnutls/read-file-limits.h.patch
31 32 33
ifndef HAVE_IOS
	$(APPLY) $(SRC)/gnutls/mac-keychain-lookup.patch
endif
34 35 36 37 38 39 40 41 42 43
	$(call pkg_static,"lib/gnutls.pc.in")
	$(UPDATE_AUTOCONFIG)
	$(MOVE)

GNUTLS_CONF := \
	--disable-gtk-doc \
	--without-p11-kit \
	--disable-cxx \
	--disable-srp-authentication \
	--disable-psk-authentication-FIXME \
44
	--with-included-libtasn1 \
Guillaume Roguez's avatar
Guillaume Roguez committed
45
	--with-included-unistring \
46 47 48 49
	--disable-openpgp-authentication \
	--disable-openssl-compatibility \
	--disable-guile \
	--disable-nls \
50
	--disable-dtls-srtp-support \
51
	--without-libintl-prefix \
Adrien Béraud's avatar
Adrien Béraud committed
52
	--without-idn \
53 54
	$(HOSTCONF)

55 56 57 58
ifdef HAVE_ANDROID
	GNUTLS_CONF += --disable-hardware-acceleration
endif

Guillaume Roguez's avatar
Guillaume Roguez committed
59 60 61 62
ifdef HAVE_IOS
	GNUTLS_CONF += --disable-hardware-acceleration
endif

63
DEPS_gnutls = nettle iconv
64

Edric Milaret's avatar
Edric Milaret committed
65 66 67 68 69 70

#Workaround for localtime_r function
ifdef HAVE_WIN32
CFLAGS="-D_POSIX_C_SOURCE"
endif

71 72 73 74
.gnutls: gnutls
	$(RECONF)
ifdef HAVE_ANDROID
	cd $< && $(HOSTVARS) gl_cv_header_working_stdint_h=yes ./configure $(GNUTLS_CONF)
75 76 77 78 79 80
else
ifdef HAVE_IOS
	cd $< && $(HOSTVARS) ac_cv_func_clock_gettime=no CFLAGS="$(CFLAGS)" ./configure $(GNUTLS_CONF)
else
ifdef HAVE_MACOSX
	cd $< && $(HOSTVARS) ac_cv_func_clock_gettime=no CFLAGS="$(CFLAGS)" ./configure $(GNUTLS_CONF)
81
else
82
	cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS)" ./configure $(GNUTLS_CONF)
83 84
endif
endif
85 86 87 88
endif
	cd $</gl && $(MAKE) install
	cd $</lib && $(MAKE) install
	touch $@