8b0fafbd33ca1b37dafd5a4fa66fa0819707bf13
[vlc.git] / contrib / src / gcrypt / rules.mak
1 # GCRYPT
2 GCRYPT_VERSION := 1.7.6
3 GCRYPT_URL := ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-$(GCRYPT_VERSION).tar.bz2
4
5 PKGS += gcrypt
6
7 $(TARBALLS)/libgcrypt-$(GCRYPT_VERSION).tar.bz2:
8         $(call download_pkg,$(GCRYPT_URL),gcrypt)
9
10 .sum-gcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2
11
12 libgcrypt: libgcrypt-$(GCRYPT_VERSION).tar.bz2 .sum-gcrypt
13         $(UNPACK)
14         $(APPLY) $(SRC)/gcrypt/disable-tests-compilation.patch
15         $(APPLY) $(SRC)/gcrypt/fix-pthread-detection.patch
16 ifdef HAVE_WINSTORE
17         $(APPLY) $(SRC)/gcrypt/winrt.patch
18 endif
19 ifdef HAVE_WIN64
20         $(APPLY) $(SRC)/gcrypt/64bits-relocation.patch
21 endif
22 ifeq ($(CC), clang)
23 ifeq ($(ARCH),mips64el)
24         $(APPLY) $(SRC)/gcrypt/clang-mips64.patch
25 endif
26 endif
27         $(MOVE)
28
29 DEPS_gcrypt = gpg-error
30
31 GCRYPT_CONF = \
32         --enable-ciphers=aes,des,rfc2268,arcfour \
33         --enable-digests=sha1,md5,rmd160,sha256,sha512 \
34         --enable-pubkey-ciphers=dsa,rsa,ecc \
35         --disable-docs
36
37 ifdef HAVE_WIN64
38 GCRYPT_CONF += --disable-asm --disable-padlock-support
39 endif
40 ifdef HAVE_IOS
41 GCRYPT_EXTRA_CFLAGS = -fheinous-gnu-extensions
42 else
43 GCRYPT_EXTRA_CFLAGS =
44 endif
45 ifdef HAVE_MACOSX
46 GCRYPT_CONF += --disable-aesni-support
47 else
48 ifdef HAVE_BSD
49 GCRYPT_CONF += --disable-asm --disable-aesni-support
50 endif
51 endif
52 ifdef HAVE_ANDROID
53 ifeq ($(ANDROID_ABI), x86)
54 GCRYPT_CONF += ac_cv_sys_symbol_underscore=no
55 endif
56 ifeq ($(ANDROID_ABI), x86_64)
57 GCRYPT_CONF += ac_cv_sys_symbol_underscore=no
58 endif
59 endif
60 ifdef HAVE_TIZEN
61 ifeq ($(TIZEN_ABI), x86)
62 GCRYPT_CONF += ac_cv_sys_symbol_underscore=no
63 endif
64 endif
65
66 .gcrypt: libgcrypt
67         $(RECONF)
68         cd $< && $(HOSTVARS) CFLAGS="$(CFLAGS) $(GCRYPT_EXTRA_CFLAGS)" ./configure $(HOSTCONF) $(GCRYPT_CONF)
69         cd $< && $(MAKE) install
70         touch $@