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
$(CROSS_DIR
)/lib
/include $(CROSS_DIR
)/lib
/pkgconfig
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 devcpp.
tar
32 mkdir
-p
$(DEVCPP_DIR
)
33 cd
$(DEVCPP_DIR
) && unzip ..
/$(GNUTLS_DIR
)-w32.zip
34 cd
$(DEVCPP_DIR
) && tar xf ..
/devcpp.
tar && sed
-i
's/@VERSION@/$(GNUTLS_VERSION)/g' gnutls.DevPackage
35 cd
$(DEVCPP_DIR
) && tar -cjf ..
/$@ .
37 devpak
: gnutls-
$(GNUTLS_VERSION
)-1gn.DevPak
39 gnutls-w32
: $(GNUTLS_DIR
)-w32.zip
41 nettle
: $(NETTLE_DIR
)/.installed
43 gmp
: $(GMP_DIR
)/.installed
51 CONFIG_FLAGS
:= --prefix=$(CROSS_DIR
) --host
=i686-w64-mingw32
--enable-shared
--disable-static
--bindir=$(BIN_DIR
) --libdir=$(LIB_DIR
) --includedir=$(HEADERS_DIR
)
53 $(P11_KIT_DIR
)/.configured
:
54 test -f
$(P11_KIT_FILE
) || wget http
://p11-glue.freedesktop.org
/releases
/$(P11_KIT_FILE
)
55 test -f
$(P11_KIT_FILE
).sig || wget http
://p11-glue.freedesktop.org
/releases
/$(P11_KIT_FILE
).sig
56 gpg
--verify
$(P11_KIT_FILE
).sig
57 test -d
$(P11_KIT_DIR
) ||
tar -xf
$(P11_KIT_FILE
)
58 cd
$(P11_KIT_DIR
) && .
/configure
$(CONFIG_FLAGS
) && cd ..
61 $(P11_KIT_DIR
)/.installed
: $(P11_KIT_DIR
)/.configured
62 make
-C
$(P11_KIT_DIR
) -j2
63 make
-C
$(P11_KIT_DIR
) install -i
64 -rm -rf
$(HEADERS_DIR
)/p11-kit
65 -mv
$(HEADERS_DIR
)/p11-kit-1
/p11-kit
$(HEADERS_DIR
)
66 -rm -rf
$(HEADERS_DIR
)/p11-kit-1
67 rm -f
$(BIN_DIR
)/p11-kit.exe
70 $(GMP_DIR
)/.configured
:
71 test -f
$(GMP_FILE
) || wget ftp
://ftp.gmplib.org
/pub
/$(GMP_DIR
)/$(GMP_FILE
)
72 test -f
$(GMP_FILE
).sig || wget ftp
://ftp.gmplib.org
/pub
/$(GMP_DIR
)/$(GMP_FILE
).sig
73 gpg
--verify
$(GMP_FILE
).sig
74 test -d
$(GMP_DIR
) ||
tar -xf
$(GMP_FILE
)
75 cd
$(GMP_DIR
) && .
/configure
$(CONFIG_FLAGS
) --enable-fat
--exec-prefix
=$(LIB_DIR
) --oldincludedir=$(HEADERS_DIR
) && cd ..
78 $(GMP_DIR
)/.installed
: $(GMP_DIR
)/.configured
79 make
-C
$(GMP_DIR
) -j2
80 make
-C
$(GMP_DIR
) install -i
81 mv
$(LIB_DIR
)/include/* $(HEADERS_DIR
)/
82 rmdir
$(LIB_DIR
)/include/
85 $(NETTLE_DIR
)/.configured
: $(GMP_DIR
)/.installed
86 test -f
$(NETTLE_FILE
) || wget http
://www.lysator.liu.se
/~nisse
/archive
/$(NETTLE_FILE
)
87 test -f
$(NETTLE_FILE
).sig || wget http
://www.lysator.liu.se
/~nisse
/archive
/$(NETTLE_FILE
).sig
88 gpg
--verify
$(NETTLE_FILE
).sig
89 test -d
$(NETTLE_DIR
) ||
tar -xf
$(NETTLE_FILE
)
90 cd
$(NETTLE_DIR
) && CFLAGS
="-I$(HEADERS_DIR)" CXXFLAGS
="-I$(HEADERS_DIR)" .
/configure
$(CONFIG_FLAGS
) --with-lib-path
=$(LIB_DIR
) && cd ..
93 #nettle messes up installation
94 $(NETTLE_DIR
)/.installed
: $(NETTLE_DIR
)/.configured
95 make
-C
$(NETTLE_DIR
) -j2
96 make
-C
$(NETTLE_DIR
) install -i
97 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
98 cp
$(NETTLE_DIR
)/libnettle.dll.a
$(NETTLE_DIR
)/libhogweed.dll.a
$(LIB_DIR
)/
99 cp
$(NETTLE_DIR
)/libnettle
*.dll
$(NETTLE_DIR
)/libhogweed
*.dll
$(BIN_DIR
)/
102 $(GNUTLS_DIR
)/.installed
: $(GNUTLS_DIR
)/.configured
103 make
-C
$(GNUTLS_DIR
) -j2
104 make
-C
$(GNUTLS_DIR
) install -i
105 cp
$(GNUTLS_DIR
)/COPYING
$(GNUTLS_DIR
)/COPYING.LESSER
$(CROSS_DIR
)
108 $(GNUTLS_DIR
)/.configured
: $(NETTLE_DIR
)/.installed
$(P11_KIT_DIR
)/.installed
109 test -f
$(GNUTLS_FILE
) || wget ftp
://ftp.gnu.org
/gnu
/gnutls
/$(GNUTLS_FILE
)
110 test -f
$(GNUTLS_FILE
).sig || wget ftp
://ftp.gnu.org
/gnu
/gnutls
/$(GNUTLS_FILE
).sig
111 gpg
--verify
$(GNUTLS_FILE
).sig
112 test -d
$(GNUTLS_DIR
) ||
tar -xf
$(GNUTLS_FILE
)
113 cd
$(GNUTLS_DIR
) && \
114 P11_KIT_CFLAGS
="-I$(HEADERS_DIR)" \
115 P11_KIT_LIBS
="$(LIB_DIR)/libp11-kit.la" \
116 LDFLAGS
="-L$(LIB_DIR)" CFLAGS
="-I$(HEADERS_DIR)" CXXFLAGS
="-I$(HEADERS_DIR)" \
117 .
/configure
$(CONFIG_FLAGS
) --enable-local-libopts
--with-libnettle-prefix
=$(LIB_DIR
) \
118 --disable-openssl-compatibility
&& cd ..
122 rm -rf
$(CROSS_DIR
) $(GNUTLS_DIR
)/.installed
$(NETTLE_DIR
)/.installed
$(GMP_DIR
)/.installed
$(P11_KIT_DIR
)/.installed
125 rm -rf
$(CROSS_DIR
) $(GNUTLS_DIR
) $(NETTLE_DIR
) $(GMP_DIR
) $(P11_KIT_DIR
)