2 GNUTLS_FILE
:=gnutls-
$(GNUTLS_VERSION
).
tar.xz
3 GNUTLS_DIR
:=gnutls-
$(GNUTLS_VERSION
)
5 GMP_FILE
:=gmp-5.0
.4.
tar.bz2
8 P11_KIT_FILE
:=p11-kit-0.12.
tar.gz
9 P11_KIT_DIR
:=p11-kit-0.12
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
18 DEVCPP_DIR
:=$(PWD
)/devcpp
20 all: update-gpg-keys gnutls-w32
23 gpg
--recv-keys
96865171 B565716F D92765AF A8F4C2FD DB899F46
25 $(GNUTLS_DIR
)-w32.zip
: $(LIB_DIR
) $(BIN_DIR
) $(GNUTLS_DIR
)/.installed
26 rm -rf
$(CROSS_DIR
)/etc
$(CROSS_DIR
)/share
27 cd
$(CROSS_DIR
) && zip
-r
$(PWD
)/$@
*
28 gpg
--sign
--detach
$(GNUTLS_DIR
)-w32.zip
30 gnutls-
$(GNUTLS_VERSION
)-1gn.DevPak
: $(GNUTLS_DIR
)-w32.zip
32 mkdir
-p
$(DEVCPP_DIR
)
33 cd
$(DEVCPP_DIR
) && unzip ..
/$(GNUTLS_DIR
)-w32.zip
&& tar xf ..
/devcpp.
tar && sed
-i
's/@VERSION@/$(GNUTLS_VERSION)/g' gnutls.DevPackage
34 cd
$(DEVCPP_DIR
) && tar -cjf ..
/$@ .
36 devpak
: gnutls-
$(GNUTLS_VERSION
)-1gn.DevPak
38 gnutls-w32
: $(GNUTLS_DIR
)-w32.zip
40 nettle
: $(NETTLE_DIR
)/.installed
42 gmp
: $(GMP_DIR
)/.installed
50 CONFIG_FLAGS
:= --prefix=$(CROSS_DIR
) --host
=i686-w64-mingw32
--enable-shared
--disable-static
--bindir=$(BIN_DIR
) --libdir=$(LIB_DIR
)
52 $(P11_KIT_DIR
)/.configured
:
53 test -f
$(P11_KIT_FILE
) || wget http
://p11-glue.freedesktop.org
/releases
/$(P11_KIT_FILE
)
54 test -f
$(P11_KIT_FILE
).sig || wget http
://p11-glue.freedesktop.org
/releases
/$(P11_KIT_FILE
).sig
55 gpg
--verify
$(P11_KIT_FILE
).sig
56 test -d
$(P11_KIT_DIR
) ||
tar -xf
$(P11_KIT_FILE
)
57 cd
$(P11_KIT_DIR
) && .
/configure
$(CONFIG_FLAGS
) && cd ..
60 $(P11_KIT_DIR
)/.installed
: $(P11_KIT_DIR
)/.configured
61 make
-C
$(P11_KIT_DIR
) -j2
62 make
-C
$(P11_KIT_DIR
) install -i
63 -rm -rf
$(HEADERS_DIR
)/p11-kit
64 -mv
$(HEADERS_DIR
)/p11-kit-1
/p11-kit
$(HEADERS_DIR
)
65 -rm -rf
$(HEADERS_DIR
)/p11-kit-1
66 rm -f
$(BIN_DIR
)/p11-kit.exe
69 $(GMP_DIR
)/.configured
:
70 test -f
$(GMP_FILE
) || wget ftp
://ftp.gmplib.org
/pub
/$(GMP_DIR
)/$(GMP_FILE
)
71 test -f
$(GMP_FILE
).sig || wget ftp
://ftp.gmplib.org
/pub
/$(GMP_DIR
)/$(GMP_FILE
).sig
72 gpg
--verify
$(GMP_FILE
).sig
73 test -d
$(GMP_DIR
) ||
tar -xf
$(GMP_FILE
)
74 cd
$(GMP_DIR
) && .
/configure
$(CONFIG_FLAGS
) --enable-fat
--exec-prefix
=$(LIB_DIR
) --oldincludedir=$(HEADERS_DIR
) && cd ..
77 $(GMP_DIR
)/.installed
: $(GMP_DIR
)/.configured
78 make
-C
$(GMP_DIR
) -j2
79 make
-C
$(GMP_DIR
) install -i
82 $(NETTLE_DIR
)/.configured
: $(GMP_DIR
)/.installed
83 test -f
$(NETTLE_FILE
) || wget http
://www.lysator.liu.se
/~nisse
/archive
/$(NETTLE_FILE
)
84 test -f
$(NETTLE_FILE
).sig || wget http
://www.lysator.liu.se
/~nisse
/archive
/$(NETTLE_FILE
).sig
85 gpg
--verify
$(NETTLE_FILE
).sig
86 test -d
$(NETTLE_DIR
) ||
tar -xf
$(NETTLE_FILE
)
87 cd
$(NETTLE_DIR
) && CFLAGS
="-I$(HEADERS_DIR)" CXXFLAGS
="-I$(HEADERS_DIR)" .
/configure
$(CONFIG_FLAGS
) --with-lib-path
=$(LIB_DIR
) && cd ..
90 #nettle messes up installation
91 $(NETTLE_DIR
)/.installed
: $(NETTLE_DIR
)/.configured
92 make
-C
$(NETTLE_DIR
) -j2
93 make
-C
$(NETTLE_DIR
) install -i
94 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
95 cp
$(NETTLE_DIR
)/libnettle.dll.a
$(NETTLE_DIR
)/libhogweed.dll.a
$(LIB_DIR
)/
96 cp
$(NETTLE_DIR
)/libnettle
*.dll
$(NETTLE_DIR
)/libhogweed
*.dll
$(BIN_DIR
)/
99 $(GNUTLS_DIR
)/.installed
: $(GNUTLS_DIR
)/.configured
100 make
-C
$(GNUTLS_DIR
) -j2
101 make
-C
$(GNUTLS_DIR
) install -i
102 cp
$(GNUTLS_DIR
)/COPYING
$(GNUTLS_DIR
)/COPYING.LESSER
$(CROSS_DIR
)
105 $(GNUTLS_DIR
)/.configured
: $(NETTLE_DIR
)/.installed
$(P11_KIT_DIR
)/.installed
106 test -f
$(GNUTLS_FILE
) || wget ftp
://ftp.gnu.org
/gnu
/gnutls
/$(GNUTLS_FILE
)
107 test -f
$(GNUTLS_FILE
).sig || wget ftp
://ftp.gnu.org
/gnu
/gnutls
/$(GNUTLS_FILE
).sig
108 gpg
--verify
$(GNUTLS_FILE
).sig
109 test -d
$(GNUTLS_DIR
) ||
tar -xf
$(GNUTLS_FILE
)
110 cd
$(GNUTLS_DIR
) && \
111 P11_KIT_CFLAGS
="-I$(HEADERS_DIR)" \
112 P11_KIT_LIBS
="$(LIB_DIR)/libp11-kit.la" \
113 LDFLAGS
="-L$(LIB_DIR)" CFLAGS
="-I$(HEADERS_DIR)" CXXFLAGS
="-I$(HEADERS_DIR)" \
114 .
/configure
$(CONFIG_FLAGS
) --enable-local-libopts
--with-libnettle-prefix
=$(LIB_DIR
) \
115 --disable-openssl-compatibility
&& cd ..
119 rm -rf
$(CROSS_DIR
) $(GNUTLS_DIR
)/.installed
$(NETTLE_DIR
)/.installed
$(GMP_DIR
)/.installed
$(P11_KIT_DIR
)/.installed
122 rm -rf
$(CROSS_DIR
) $(GNUTLS_DIR
) $(NETTLE_DIR
) $(GMP_DIR
) $(P11_KIT_DIR
)