2 GNUTLS_FILE
:=gnutls-3.0
.15.
tar.xz
3 GNUTLS_DIR
:=gnutls-3.0
.15
5 GMP_FILE
:=gmp-5.0
.2.
tar.bz2
8 P11_KIT_FILE
:=p11-kit-0.11.
tar.gz
9 P11_KIT_DIR
:=p11-kit-0.11
11 NETTLE_FILE
:=nettle-2.4.
tar.gz
12 NETTLE_DIR
:=nettle-2.4
14 CROSS_DIR
:=$(PWD
)/win32
15 BIN_DIR
:=$(CROSS_DIR
)/bin
16 LIB_DIR
:=$(CROSS_DIR
)/lib
17 HEADERS_DIR
:=$(CROSS_DIR
)/include
19 all: update-gpg-keys gnutls-w32
22 gpg
--recv-keys
96865171 B565716F D92765AF A8F4C2FD DB899F46
24 $(GNUTLS_DIR
)-w32.zip
: $(LIB_DIR
) $(BIN_DIR
) $(GNUTLS_DIR
)/.installed
25 rm -rf
$(CROSS_DIR
)/etc
$(CROSS_DIR
)/share
26 cd
$(CROSS_DIR
) && zip
-r
$(PWD
)/$@
*
27 gpg
--sign
--detach
$(GNUTLS_DIR
)-w32.zip
29 gnutls-w32
: $(GNUTLS_DIR
)-w32.zip
31 nettle
: $(NETTLE_DIR
)/.installed
33 gmp
: $(GMP_DIR
)/.installed
41 CONFIG_FLAGS
:= --prefix=$(CROSS_DIR
) --host
=i686-w64-mingw32
--enable-shared
--disable-static
--bindir=$(BIN_DIR
) --libdir=$(LIB_DIR
)
43 $(P11_KIT_DIR
)/.configured
:
44 test -f
$(P11_KIT_FILE
) || wget http
://p11-glue.freedesktop.org
/releases
/$(P11_KIT_FILE
)
45 test -f
$(P11_KIT_FILE
).sig || wget http
://p11-glue.freedesktop.org
/releases
/$(P11_KIT_FILE
).sig
46 gpg
--verify
$(P11_KIT_FILE
).sig
47 test -d
$(P11_KIT_DIR
) ||
tar -xf
$(P11_KIT_FILE
)
48 cd
$(P11_KIT_DIR
) && .
/configure
$(CONFIG_FLAGS
) && cd ..
51 $(P11_KIT_DIR
)/.installed
: $(P11_KIT_DIR
)/.configured
52 make
-C
$(P11_KIT_DIR
) -j2
53 make
-C
$(P11_KIT_DIR
) install -i
54 -rm -rf
$(HEADERS_DIR
)/p11-kit
55 -mv
$(HEADERS_DIR
)/p11-kit-1
/p11-kit
$(HEADERS_DIR
)
56 -rm -rf
$(HEADERS_DIR
)/p11-kit-1
57 rm -f
$(BIN_DIR
)/p11-kit.exe
60 $(GMP_DIR
)/.configured
:
61 test -f
$(GMP_FILE
) || wget ftp
://ftp.gmplib.org
/pub
/$(GMP_DIR
)/$(GMP_FILE
)
62 test -f
$(GMP_FILE
).sig || wget ftp
://ftp.gmplib.org
/pub
/$(GMP_DIR
)/$(GMP_FILE
).sig
63 gpg
--verify
$(GMP_FILE
).sig
64 test -d
$(GMP_DIR
) ||
tar -xf
$(GMP_FILE
)
65 cd
$(GMP_DIR
) && .
/configure
$(CONFIG_FLAGS
) --enable-fat
--exec-prefix
=$(LIB_DIR
) --oldincludedir=$(HEADERS_DIR
) && cd ..
68 $(GMP_DIR
)/.installed
: $(GMP_DIR
)/.configured
69 make
-C
$(GMP_DIR
) -j2
70 make
-C
$(GMP_DIR
) install -i
73 $(NETTLE_DIR
)/.configured
: $(GMP_DIR
)/.installed
74 test -f
$(NETTLE_FILE
) || wget http
://www.lysator.liu.se
/~nisse
/archive
/$(NETTLE_FILE
)
75 test -f
$(NETTLE_FILE
).sig || wget http
://www.lysator.liu.se
/~nisse
/archive
/$(NETTLE_FILE
).sig
76 gpg
--verify
$(NETTLE_FILE
).sig
77 test -d
$(NETTLE_DIR
) ||
tar -xf
$(NETTLE_FILE
)
78 cd
$(NETTLE_DIR
) && CFLAGS
="-I$(HEADERS_DIR)" CXXFLAGS
="-I$(HEADERS_DIR)" .
/configure
$(CONFIG_FLAGS
) --with-lib-path
=$(LIB_DIR
) && cd ..
81 #nettle messes up installation
82 $(NETTLE_DIR
)/.installed
: $(NETTLE_DIR
)/.configured
83 make
-C
$(NETTLE_DIR
) -j2
84 make
-C
$(NETTLE_DIR
) install -i
85 rm -f
$(LIB_DIR
)/libnettle.a
$(LIB_DIR
)/libhogweed.a
$(BIN_DIR
)/nettle-hash.exe
$(BIN_DIR
)/nettle-lfib-stream.exe
$(BIN_DIR
)/pkcs1-conv.exe
$(BIN_DIR
)/sexp-conv.exe
86 cp
$(NETTLE_DIR
)/libnettle.dll.a
$(NETTLE_DIR
)/libhogweed.dll.a
$(LIB_DIR
)/
87 cp
$(NETTLE_DIR
)/libnettle
*.dll
$(NETTLE_DIR
)/libhogweed
*.dll
$(BIN_DIR
)/
90 $(GNUTLS_DIR
)/.installed
: $(GNUTLS_DIR
)/.configured
91 make
-C
$(GNUTLS_DIR
) -j2
92 make
-C
$(GNUTLS_DIR
) install -i
93 cp
$(GNUTLS_DIR
)/COPYING
$(GNUTLS_DIR
)/COPYING.LESSER
$(CROSS_DIR
)
96 $(GNUTLS_DIR
)/.configured
: $(NETTLE_DIR
)/.installed
$(P11_KIT_DIR
)/.installed
97 test -f
$(GNUTLS_FILE
) || wget ftp
://ftp.gnu.org
/gnu
/gnutls
/$(GNUTLS_FILE
)
98 test -f
$(GNUTLS_FILE
).sig || wget ftp
://ftp.gnu.org
/gnu
/gnutls
/$(GNUTLS_FILE
).sig
99 gpg
--verify
$(GNUTLS_FILE
).sig
100 test -d
$(GNUTLS_DIR
) ||
tar -xf
$(GNUTLS_FILE
)
101 cd
$(GNUTLS_DIR
) && \
102 P11_KIT_CFLAGS
="-I$(HEADERS_DIR)" \
103 P11_KIT_LIBS
="$(LIB_DIR)/libp11-kit.la" \
104 LDFLAGS
="-L$(LIB_DIR)" CFLAGS
="-I$(HEADERS_DIR)" CXXFLAGS
="-I$(HEADERS_DIR)" \
105 .
/configure
$(CONFIG_FLAGS
) --enable-local-libopts
--with-libnettle-prefix
=$(LIB_DIR
) \
106 --disable-openssl-compatibility
&& cd ..
110 rm -rf
$(CROSS_DIR
) $(GNUTLS_DIR
)/.installed
$(NETTLE_DIR
)/.installed
$(GMP_DIR
)/.installed
$(P11_KIT_DIR
)/.installed
113 rm -rf
$(CROSS_DIR
) $(GNUTLS_DIR
) $(NETTLE_DIR
) $(GMP_DIR
) $(P11_KIT_DIR
)