speedo: Do not not assume GNU tar.
[gnupg.git] / build-aux / speedo.mk
1 # speedo.mk - Speedo rebuilds speedily.
2 # Copyright (C) 2008, 2014 g10 Code GmbH
3 #
4 # speedo is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # speedo is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, see <http://www.gnu.org/licenses/>.
16
17 # speedo builds gnupg-related packages from GIT and installs them in a
18 # user directory, thereby providing a non-obstrusive test environment.
19 # speedo does only work with GNU make.  The build system is similar to
20 # that of gpg4win.  The following commands are supported:
21 #
22 #   make -f speedo.mk all  pkg2rep=/dir/with/tarballs
23 # or
24 #   make -f speedo.mk
25 #
26 # Builds all packages and installs them under PLAY/inst.  At the end,
27 # speedo prints commands that can be executed in the local shell to
28 # make use of the installed packages.
29 #
30 #   make -f speedo.mk clean
31 # or
32 #   make -f speedo.mk clean-PACKAGE
33 #
34 # Removes all packages or the package PACKAGE from the installation
35 # and build tree.  A subsequent make will rebuild these (and only
36 # these) packages.
37 #
38 #   make -f speedo.mk report
39 # or
40 #   make -f speedo.mk report-PACKAGE
41 #
42 # Lists packages and versions.
43 #
44
45 # We need to know our own name.
46 SPEEDO_MK := $(realpath $(lastword $(MAKEFILE_LIST)))
47
48 .PHONY : help native native-gui w32-installer w32-source
49 .PHONY :      git-native git-native-gui git-w32-installer git-w32-source
50 .PHONY :      this-native this-native-gui this-w32-installer this-w32-source
51
52 help:
53         @echo 'usage: make -f speedo.mk TARGET'
54         @echo '       with TARGET being one of:'
55         @echo '  help           This help'
56         @echo '  native         Native build of the GnuPG core'
57         @echo '  native-gui     Ditto but with pinentry and GPA'
58         @echo '  w32-installer  Build a Windows installer'
59         @echo '  w32-source     Pack a source archive'
60         @echo
61         @echo 'You may append INSTALL_REFIX=<dir> for native builds.'
62         @echo 'Prepend TARGET with "git-" to build from GIT repos.'
63         @echo 'Prepend TARGET with "this-" to build from the source tarball.'
64
65
66 SPEEDOMAKE := $(MAKE) -f $(SPEEDO_MK) UPD_SWDB=1
67
68 native: check-tools
69         $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=0 all
70
71 git-native: check-tools
72         $(SPEEDOMAKE) TARGETOS=native WHAT=git     WITH_GUI=0 all
73
74 this-native: check-tools
75         $(SPEEDOMAKE) TARGETOS=native WHAT=this    WITH_GUI=0 all
76
77 native-gui: check-tools
78         $(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=1 all
79
80 git-native-gui: check-tools
81         $(SPEEDOMAKE) TARGETOS=native WHAT=git     WITH_GUI=1 all
82
83 this-native-gui: check-tools
84         $(SPEEDOMAKE) TARGETOS=native WHAT=this    WITH_GUI=1 all
85
86 w32-installer: check-tools
87         $(SPEEDOMAKE) TARGETOS=w32    WHAT=release WITH_GUI=1 installer
88
89 git-w32-installer: check-tools
90         $(SPEEDOMAKE) TARGETOS=w32    WHAT=git     WITH_GUI=1 installer
91
92 this-w32-installer: check-tools
93         $(SPEEDOMAKE) TARGETOS=w32    WHAT=this    WITH_GUI=1 installer
94
95 w32-source: check-tools
96         $(SPEEDOMAKE) TARGETOS=w32    WHAT=release WITH_GUI=1 dist-source
97
98 git-w32-source: check-tools
99         $(SPEEDOMAKE) TARGETOS=w32    WHAT=git     WITH_GUI=1 dist-source
100
101 this-w32-source: check-tools
102         $(SPEEDOMAKE) TARGETOS=w32    WHAT=git     WITH_GUI=1 dist-source
103
104
105 # Set this to "git" to build from git,
106 #          to "release" from tarballs,
107 #          to "this" from the unpacked sources.
108 WHAT=git
109
110 # Set target to "native" or "w32"
111 TARGETOS=
112
113 # Set to 1 to build the GUI tools
114 WITH_GUI=0
115
116 # Set to 1 to really download the swdb.
117 UPD_SWDB=0
118
119 # Set to the location of the directory with tarballs of
120 # external packages.
121 TARBALLS=$(shell pwd)/../tarballs
122
123 #  Number of parallel make jobs
124 MAKE_J=3
125
126 # Name to use for the w32 installer and sources
127 INST_NAME=gnupg-w32
128
129 # Use this to override the installaion directory for native builds.
130 INSTALL_PREFIX=none
131
132
133 # Directory names.
134 # They must be absolute, as we switch directories pretty often.
135 root := $(shell pwd)/PLAY
136 sdir := $(root)/src
137 bdir := $(root)/build
138 bdir6:= $(root)/build-w64
139 ifeq ($(INSTALL_PREFIX),none)
140 idir := $(root)/inst
141 else
142 idir := $(abspath $(INSTALL_PREFIX))
143 endif
144 idir6:= $(root)/inst-w64
145 stampdir := $(root)/stamps
146 topsrc := $(shell cd $(dir $(SPEEDO_MK)).. && pwd)
147 auxsrc := $(topsrc)/build-aux/speedo
148 patdir := $(topsrc)/build-aux/speedo/patches
149 w32src := $(topsrc)/build-aux/speedo/w32
150
151 # =====BEGIN LIST OF PACKAGES=====
152 # The packages that should be built.  The order is also the build order.
153 # Fixme: Do we need to build pkg-config for cross-building?
154
155 speedo_spkgs  = \
156         libgpg-error npth libgcrypt
157
158 ifeq ($(TARGETOS),w32)
159 speedo_spkgs += \
160         zlib bzip2 libiconv gettext
161 endif
162
163 speedo_spkgs += \
164         libassuan libksba gnupg
165
166 ifeq ($(TARGETOS),w32)
167 speedo_spkgs += \
168         libffi glib pkg-config
169 endif
170
171 speedo_spkgs += \
172         gpgme
173
174 ifeq ($(TARGETOS),w32)
175 speedo_spkgs += \
176         libpng \
177         gdk-pixbuf atk pixman cairo pango gtk+
178 endif
179
180
181 ifeq ($(WITH_GUI),1)
182 speedo_spkgs += \
183         pinentry gpa
184 endif
185
186 ifeq ($(TARGETOS),w32)
187 speedo_spkgs += \
188         gpgex
189 endif
190
191 # =====END LIST OF PACKAGES=====
192
193
194 # Packages which are additionally build for 64 bit Windows
195 speedo_w64_spkgs  = \
196         libgpg-error libiconv gettext libassuan gpgex
197
198 # Packages which use the gnupg autogen.sh build style
199 speedo_gnupg_style = \
200         libgpg-error npth libgcrypt  \
201         libassuan libksba gnupg gpgme \
202         pinentry gpa gpgex
203
204 # Packages which use only make and no build directory
205 speedo_make_only_style = \
206         zlib bzip2
207
208 # Get the content of the software DB.
209 ifeq ($(UPD_SWDB),1)
210 SWDB := $(shell $(topsrc)/build-aux/getswdb.sh && echo okay)
211 ifeq ($(strip $(SWDB)),)
212 $(error Error getting GnuPG software version database)
213 endif
214
215 # Version numbers of the released packages
216 gnupg_ver = $(shell cat $(topsrc)/VERSION)
217
218 libgpg_error_ver := $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst)
219 libgpg_error_sha1:= $(shell awk '$$1=="libgpg_error_sha1" {print $$2}' swdb.lst)
220
221 npth_ver  := $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst)
222 npth_sha1 := $(shell awk '$$1=="npth_sha1" {print $$2}' swdb.lst)
223
224 libgcrypt_ver  := $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst)
225 libgcrypt_sha1 := $(shell awk '$$1=="libgcrypt_sha1" {print $$2}' swdb.lst)
226
227 libassuan_ver  := $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst)
228 libassuan_sha1 := $(shell awk '$$1=="libassuan_sha1" {print $$2}' swdb.lst)
229
230 libksba_ver  := $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst)
231 libksba_sha1 := $(shell awk '$$1=="libksba_sha1" {print $$2}' swdb.lst)
232
233 gpgme_ver  := $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst)
234 gpgme_sha1 := $(shell awk '$$1=="gpgme_sha1" {print $$2}' swdb.lst)
235
236 pinentry_ver  := $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst)
237 pinentry_sha1 := $(shell awk '$$1=="pinentry_sha1" {print $$2}' swdb.lst)
238
239 gpa_ver  := $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst)
240 gpa_sha1 := $(shell awk '$$1=="gpa_sha1" {print $$2}' swdb.lst)
241
242 gpgex_ver  := $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst)
243 gpgex_sha1 := $(shell awk '$$1=="gpgex_sha1" {print $$2}' swdb.lst)
244
245 zlib_ver  := $(shell awk '$$1=="zlib_ver" {print $$2}' swdb.lst)
246 zlib_sha1 := $(shell awk '$$1=="zlib_sha1_gz" {print $$2}' swdb.lst)
247
248 bzip2_ver  := $(shell awk '$$1=="bzip2_ver" {print $$2}' swdb.lst)
249 bzip2_sha1 := $(shell awk '$$1=="bzip2_sha1_gz" {print $$2}' swdb.lst)
250
251 $(info Information from the version database)
252 $(info GnuPG ..........: $(gnupg_ver))
253 $(info Libgpg-error ...: $(libgpg_error_ver))
254 $(info Npth ...........: $(npth_ver))
255 $(info Libgcrypt ......: $(libgcrypt_ver))
256 $(info Libassuan ......: $(libassuan_ver))
257 $(info Zlib ...........: $(zlib_ver))
258 $(info Bzip2 ..........: $(bzip2_ver))
259 $(info GPGME ..........: $(gpgme_ver))
260 $(info Pinentry .......: $(pinentry_ver))
261 $(info GPA ............: $(gpa_ver))
262 $(info GpgEX.... ......: $(gpgex_ver))
263 endif
264
265 # Version number for external packages
266 pkg_config_ver = 0.23
267 zlib_ver = 1.2.8
268 libiconv_ver = 1.14
269 gettext_ver = 0.18.2.1
270 libffi_ver = 3.0.13
271 glib_ver = 2.34.3
272 libpng_ver = 1.4.12
273 gdk_pixbuf_ver = 2.26.5
274 atk_ver = 1.32.0
275 pango_ver = 1.29.4
276 pixman_ver = 0.32.4
277 cairo_ver = 1.12.16
278 gtk__ver = 2.24.17
279
280
281 # The GIT repository.  Using a local repo is much faster.
282 #gitrep = git://git.gnupg.org
283 gitrep = ${HOME}/s
284
285 # The tarball directories
286 pkgrep = ftp://ftp.gnupg.org/gcrypt
287 pkg10rep = ftp://ftp.g10code.com/g10code
288 pkg2rep = $(TARBALLS)
289
290 # For each package, the following variables can be defined:
291 #
292 # speedo_pkg_PACKAGE_git: The GIT repository that should be built.
293 # speedo_pkg_PACKAGE_gitref: The GIT revision to checkout
294 #
295 # speedo_pkg_PACKAGE_tar: URL to the tar file that should be built.
296 #
297 # Exactly one of the above variables is required.  Note that this
298 # version of speedo does not cache repositories or tar files, and does
299 # not test the integrity of the downloaded software.  If you care
300 # about this, you can also specify filenames to locally verified files.
301 # Filenames are differentiated from URLs by starting with a slash '/'.
302 #
303 # speedo_pkg_PACKAGE_configure: Extra arguments to configure.
304 #
305 # speedo_pkg_PACKAGE_make_args: Extra arguments to make.
306 #
307 # speedo_pkg_PACKAGE_make_args_inst: Extra arguments to make install.
308 #
309 # Note that you can override the defaults in this file in a local file
310 # "config.mk"
311
312 ifeq ($(WHAT),this)
313 else ifeq ($(WHAT),git)
314   speedo_pkg_libgpg_error_git = $(gitrep)/libgpg-error
315   speedo_pkg_libgpg_error_gitref = master
316   speedo_pkg_npth_git = $(gitrep)/npth
317   speedo_pkg_npth_gitref = master
318   speedo_pkg_libassuan_git = $(gitrep)/libassuan
319   speedo_pkg_libassuan_gitref = master
320   speedo_pkg_libgcrypt_git = $(gitrep)/libgcrypt
321   speedo_pkg_libgcrypt_gitref = LIBGCRYPT-1-6-BRANCH
322   speedo_pkg_libksba_git = $(gitrep)/libksba
323   speedo_pkg_libksba_gitref = master
324   speedo_pkg_gpgme_git = $(gitrep)/gpgme
325   speedo_pkg_gpgme_gitref = master
326   speedo_pkg_pinentry_git = $(gitrep)/pinentry
327   speedo_pkg_pinentry_gitref = master
328   speedo_pkg_gpa_git = $(gitrep)/gpa
329   speedo_pkg_gpa_gitref = master
330   speedo_pkg_gpgex_git = $(gitrep)/gpgex
331   speedo_pkg_gpgex_gitref = master
332 else ifeq ($(WHAT),release)
333   speedo_pkg_libgpg_error_tar = \
334         $(pkgrep)/libgpg-error/libgpg-error-$(libgpg_error_ver).tar.bz2
335   speedo_pkg_npth_tar = \
336         $(pkgrep)/npth/npth-$(npth_ver).tar.bz2
337   speedo_pkg_libassuan_tar = \
338         $(pkgrep)/libassuan/libassuan-$(libassuan_ver).tar.bz2
339   speedo_pkg_libgcrypt_tar = \
340         $(pkgrep)/libgcrypt/libgcrypt-$(libgcrypt_ver).tar.bz2
341   speedo_pkg_libksba_tar = \
342         $(pkgrep)/libksba/libksba-$(libksba_ver).tar.bz2
343   speedo_pkg_gpgme_tar = \
344         $(pkgrep)/gpgme/gpgme-$(gpgme_ver).tar.bz2
345   speedo_pkg_pinentry_tar = \
346         $(pkgrep)/pinentry/pinentry-$(pinentry_ver).tar.bz2
347   speedo_pkg_gpa_tar = \
348         $(pkgrep)/gpa/gpa-$(gpa_ver).tar.bz2
349   speedo_pkg_gpgex_tar = \
350         $(pkg10rep)/gpgex/gpgex-$(gpgex_ver).tar.bz2
351 else
352   $(error invalid value for WHAT (use on of: git release this))
353 endif
354
355 speedo_pkg_pkg_config_tar = $(pkg2rep)/pkg-config-$(pkg_config_ver).tar.gz
356 speedo_pkg_zlib_tar       = $(pkgrep)/zlib/zlib-$(zlib_ver).tar.gz
357 speedo_pkg_bzip2_tar      = $(pkgrep)/bzip2/bzip2-$(bzip2_ver).tar.gz
358 speedo_pkg_libiconv_tar   = $(pkg2rep)/libiconv-$(libiconv_ver).tar.gz
359 speedo_pkg_gettext_tar    = $(pkg2rep)/gettext-$(gettext_ver).tar.gz
360 speedo_pkg_libffi_tar     = $(pkg2rep)/libffi-$(libffi_ver).tar.gz
361 speedo_pkg_glib_tar       = $(pkg2rep)/glib-$(glib_ver).tar.xz
362 speedo_pkg_libpng_tar     = $(pkg2rep)/libpng-$(libpng_ver).tar.bz2
363 speedo_pkg_gdk_pixbuf_tar = $(pkg2rep)/gdk-pixbuf-$(gdk_pixbuf_ver).tar.xz
364 speedo_pkg_atk_tar        = $(pkg2rep)/atk-$(atk_ver).tar.bz2
365 speedo_pkg_pango_tar      = $(pkg2rep)/pango-$(pango_ver).tar.bz2
366 speedo_pkg_pixman_tar     = $(pkg2rep)/pixman-$(pixman_ver).tar.gz
367 speedo_pkg_cairo_tar      = $(pkg2rep)/cairo-$(cairo_ver).tar.xz
368 speedo_pkg_gtk__tar       = $(pkg2rep)/gtk+-$(gtk__ver).tar.xz
369
370
371 #
372 # Package build options
373 #
374
375 speedo_pkg_libgpg_error_configure = --enable-static
376 speedo_pkg_w64_libgpg_error_configure = --enable-static
377
378 speedo_pkg_libassuan_configure = --enable-static
379 speedo_pkg_w64_libassuan_configure = --enable-static
380
381 speedo_pkg_libgcrypt_configure = --disable-static
382
383 speedo_pkg_libksba_configure = --disable-static
384
385 ifeq ($(TARGETOS),w32)
386 speedo_pkg_gnupg_configure = --enable-gpg2-is-gpg --disable-g13 --disable-ntbtls
387 else
388 speedo_pkg_gnupg_configure = --disable-g13
389 endif
390 speedo_pkg_gnupg_extracflags = -g
391
392 # Create the version info files only for W32 so that they won't get
393 # installed if for example INSTALL_PREFIX=/usr/local is used.
394 ifeq ($(TARGETOS),w32)
395 define speedo_pkg_gnupg_post_install
396 (set -e; \
397  sed -n  's/.*PACKAGE_VERSION "\(.*\)"/\1/p' config.h >$(idir)/INST_VERSION; \
398  sed -n  's/.*W32INFO_VI_PRODUCTVERSION \(.*\)/\1/p' common/w32info-rc.h \
399     |sed 's/,/./g' >$(idir)/INST_PROD_VERSION )
400 endef
401 endif
402
403 # The LDFLAGS is needed for -lintl for glib.
404 speedo_pkg_gpgme_configure = \
405         --enable-static --enable-w32-glib --disable-w32-qt \
406         --with-gpg-error-prefix=$(idir) \
407         LDFLAGS=-L$(idir)/lib
408
409 speedo_pkg_pinentry_configure = \
410         --disable-pinentry-qt --disable-pinentry-qt4 --disable-pinentry-gtk \
411         --enable-pinentry-gtk2 \
412         --with-glib-prefix=$(idir) --with-gtk-prefix=$(idir) \
413         CPPFLAGS=-I$(idir)/include   \
414         LDFLAGS=-L$(idir)/lib        \
415         CXXFLAGS=-static-libstdc++
416
417 speedo_pkg_gpa_configure = \
418         --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
419         --with-gpgme-prefix=$(idir) --with-zlib=$(idir) \
420         --with-libassuan-prefix=$(idir) --with-gpg-error-prefix=$(idir)
421
422 speedo_pkg_gpgex_configure = \
423         --with-gpg-error-prefix=$(idir) \
424         --with-libassuan-prefix=$(idir) \
425         --enable-gpa-only
426
427 speedo_pkg_w64_gpgex_configure = \
428         --with-gpg-error-prefix=$(idir6) \
429         --with-libassuan-prefix=$(idir6) \
430         --enable-gpa-only
431
432
433 #
434 # External packages
435 #
436
437 ifeq ($(TARGETOS),w32)
438 speedo_pkg_zlib_make_args = \
439         -fwin32/Makefile.gcc PREFIX=$(host)- IMPLIB=libz.dll.a
440
441 speedo_pkg_zlib_make_args_inst = \
442         -fwin32/Makefile.gcc \
443         BINARY_PATH=$(idir)/bin INCLUDE_PATH=$(idir)/include \
444         LIBRARY_PATH=$(idir)/lib SHARED_MODE=1 IMPLIB=libz.dll.a
445
446 # Zlib needs some special magic to generate a libtool file.
447 # We also install the pc file here.
448 define speedo_pkg_zlib_post_install
449 (set -e; mkdir $(idir)/lib/pkgconfig || true;           \
450 cp $(auxsrc)/zlib.pc $(idir)/lib/pkgconfig/;            \
451 cd $(idir);                                             \
452 echo "# Generated by libtool" > lib/libz.la             \
453 echo "dlname='../bin/zlib1.dll'" >> lib/libz.la;        \
454 echo "library_names='libz.dll.a'" >> lib/libz.la;       \
455 echo "old_library='libz.a'" >> lib/libz.la;             \
456 echo "dependency_libs=''" >> lib/libz.la;               \
457 echo "current=1" >> lib/libz.la;                        \
458 echo "age=2" >> lib/libz.la;                            \
459 echo "revision=5" >> lib/libz.la;                       \
460 echo "installed=yes" >> lib/libz.la;                    \
461 echo "shouldnotlink=no" >> lib/libz.la;                 \
462 echo "dlopen=''" >> lib/libz.la;                        \
463 echo "dlpreopen=''" >> lib/libz.la;                     \
464 echo "libdir=\"$(idir)/lib\"" >> lib/libz.la)
465 endef
466
467 endif
468
469 ifeq ($(TARGETOS),w32)
470 speedo_pkg_bzip2_make_args = \
471         CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
472
473 speedo_pkg_bzip2_make_args_inst = \
474         PREFIX=$(idir) CC="$(host)-gcc" AR="$(host)-ar" RANLIB="$(host)-ranlib"
475 endif
476
477 speedo_pkg_w64_libiconv_configure = \
478         --enable-shared=no --enable-static=yes
479
480 speedo_pkg_gettext_configure = \
481         --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
482         CPPFLAGS=-I$(idir)/include LDFLAGS=-L$(idir)/lib
483 speedo_pkg_w64_gettext_configure = \
484         --with-lib-prefix=$(idir) --with-libiconv-prefix=$(idir) \
485         CPPFLAGS=-I$(idir6)/include LDFLAGS=-L$(idir6)/lib
486 speedo_pkg_gettext_extracflags = -O2
487 # We only need gettext-runtime and there is sadly no top level
488 # configure option for this
489 speedo_pkg_gettext_make_dir = gettext-runtime
490
491
492 speedo_pkg_glib_configure = \
493         --disable-modular-tests \
494         --with-libiconv=gnu \
495         CPPFLAGS=-I$(idir)/include \
496         LDFLAGS=-L$(idir)/lib \
497         CCC=$(host)-g++ \
498         LIBFFI_CFLAGS=-I$(idir)/lib/libffi-$(libffi_ver)/include \
499         LIBFFI_LIBS=\"-L$(idir)/lib -lffi\"
500 ifeq ($(TARGETOS),w32)
501 speedo_pkg_glib_extracflags = -march=i486
502 endif
503
504 ifeq ($(TARGETOS),w32)
505 speedo_pkg_libpng_configure = \
506         CPPFLAGS=\"-I$(idir)/include -DPNG_BUILD_DLL\" \
507         LDFLAGS=\"-L$(idir)/lib\" LIBPNG_DEFINES=\"-DPNG_BUILD_DLL\"
508 else
509 speedo_pkg_libpng_configure = \
510         CPPFLAGS=\"-I$(idir)/include\" \
511         LDFLAGS=\"-L$(idir)/lib\"
512 endif
513
514 ifneq ($(TARGETOS),w32)
515 speedo_pkg_gdk_pixbuf_configure = --without-libtiff --without-libjpeg
516 endif
517
518 speedo_pkg_pixman_configure = \
519         CPPFLAGS=-I$(idir)/include \
520         LDFLAGS=-L$(idir)/lib
521
522 ifeq ($(TARGETOS),w32)
523 speedo_pkg_cairo_configure = \
524         --disable-qt --disable-ft --disable-fc \
525         --enable-win32 --enable-win32-font \
526         CPPFLAGS=-I$(idir)/include \
527         LDFLAGS=-L$(idir)/lib
528 else
529 speedo_pkg_cairo_configure = \
530         --disable-qt \
531         CPPFLAGS=-I$(idir)/include \
532         LDFLAGS=-L$(idir)/lib
533 endif
534
535 speedo_pkg_pango_configure = \
536         --disable-gtk-doc  \
537         CPPFLAGS=-I$(idir)/include \
538         LDFLAGS=-L$(idir)/lib
539
540 speedo_pkg_gtk__configure = \
541         --disable-cups \
542         CPPFLAGS=-I$(idir)/include \
543         LDFLAGS=-L$(idir)/lib
544
545
546 # ---------
547
548 all: all-speedo
549
550 report: report-speedo
551
552 clean: clean-speedo
553
554 ifeq ($(TARGETOS),w32)
555 STRIP = i686-w64-mingw32-strip
556 else
557 STRIP = strip
558 endif
559 W32CC = i686-w64-mingw32-gcc
560
561 -include config.mk
562
563 #
564 #  The generic speedo code
565 #
566
567 MKDIR=mkdir
568 MAKENSIS=makensis
569 SHA1SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha1sum)
570 ifeq ($(SHA1SUM),false)
571 $(error The sha1sum tool is missing)
572 endif
573
574
575 BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
576
577 # The next two macros will work only after gnupg has been build.
578 ifeq ($(TARGETOS),w32)
579 INST_VERSION=$(shell head -1 $(idir)/INST_VERSION)
580 INST_PROD_VERSION=$(shell head -1 $(idir)/INST_PROD_VERSION)
581 endif
582
583 # List with packages
584 speedo_build_list = $(speedo_spkgs)
585 speedo_w64_build_list = $(speedo_w64_spkgs)
586
587 # To avoid running external commands during the read phase (":=" style
588 # assignments), we check that the targetos has been given
589 ifneq ($(TARGETOS),)
590
591 # Determine build and host system
592 build := $(shell $(topsrc)/autogen.sh --silent --print-build)
593 ifeq ($(TARGETOS),w32)
594   speedo_autogen_buildopt := --build-w32
595   speedo_autogen_buildopt6 := --build-w64
596   host := $(shell $(topsrc)/autogen.sh --silent --print-host --build-w32)
597   host6:= $(shell $(topsrc)/autogen.sh --silent --print-host --build-w64)
598   speedo_host_build_option := --host=$(host) --build=$(build)
599   speedo_host_build_option6 := --host=$(host6) --build=$(build)
600   speedo_w32_cflags := -mms-bitfields
601 else
602   speedo_autogen_buildopt :=
603   host :=
604   speedo_host_build_option :=
605   speedo_w32_cflags :=
606 endif
607
608 ifeq ($(MAKE_J),)
609   speedo_makeopt=
610 else
611   speedo_makeopt=-j$(MAKE_J)
612 endif
613
614 # End non-empty TARGETOS
615 endif
616
617
618
619 # The playground area is our scratch area, where we unpack, build and
620 # install the packages.
621 $(stampdir)/stamp-directories:
622         $(MKDIR) $(root) || true
623         $(MKDIR) $(stampdir) || true
624         $(MKDIR) $(sdir)  || true
625         $(MKDIR) $(bdir)  || true
626         $(MKDIR) $(idir)   || true
627 ifeq ($(TARGETOS),w32)
628         $(MKDIR) $(bdir6)  || true
629         $(MKDIR) $(idir6)   || true
630 endif
631         touch $(stampdir)/stamp-directories
632
633 # Frob the name $1 by converting all '-' and '+' characters to '_'.
634 define FROB_macro
635 $(subst +,_,$(subst -,_,$(1)))
636 endef
637
638 # Get the variable $(1) (which may contain '-' and '+' characters).
639 define GETVAR
640 $($(call FROB_macro,$(1)))
641 endef
642
643 # Set a couple of common variables.
644 define SETVARS
645         pkg="$(1)";                                                     \
646         git="$(call GETVAR,speedo_pkg_$(1)_git)";                       \
647         gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)";                 \
648         tar="$(call GETVAR,speedo_pkg_$(1)_tar)";                       \
649         sha1="$(call GETVAR,$(1)_sha1)";                                \
650         pkgsdir="$(sdir)/$(1)";                                         \
651         if [ "$(1)" = "gnupg" ]; then                                   \
652           git='';                                                       \
653           gitref='';                                                    \
654           tar='';                                                       \
655           pkgsdir="$(topsrc)";                                          \
656         fi;                                                             \
657         pkgbdir="$(bdir)/$(1)";                                         \
658         pkgcfg="$(call GETVAR,speedo_pkg_$(1)_configure)";              \
659         tmp="$(speedo_w32_cflags)                                       \
660              $(call GETVAR,speedo_pkg_$(1)_extracflags)";               \
661         if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then   \
662           pkgextracflags="CFLAGS=\"$$$$tmp\"";                          \
663         else                                                            \
664           pkgextracflags=;                                              \
665         fi;                                                             \
666         pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)";             \
667         pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)";           \
668         pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
669         pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
670         export PKG_CONFIG="/usr/bin/pkg-config";                        \
671         export PKG_CONFIG_PATH="$(idir)/lib/pkgconfig";                 \
672         [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR="";     \
673         export SYSROOT="$(idir)";                                       \
674         export PATH="$(idir)/bin:$${PATH}";                             \
675         export LD_LIBRARY_PATH="$(idir)/lib:$${LD_LIBRARY_PATH}"
676 endef
677
678 define SETVARS_W64
679         pkg="$(1)";                                                     \
680         git="$(call GETVAR,speedo_pkg_$(1)_git)";                       \
681         gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)";                 \
682         tar="$(call GETVAR,speedo_pkg_$(1)_tar)";                       \
683         sha1="$(call GETVAR,$(1)_sha1)";                                \
684         pkgsdir="$(sdir)/$(1)";                                         \
685         if [ "$(1)" = "gnupg" ]; then                                   \
686           git='';                                                       \
687           gitref='';                                                    \
688           tar='';                                                       \
689           pkgsdir="$(topsrc)";                                          \
690         fi;                                                             \
691         pkgbdir="$(bdir6)/$(1)";                                        \
692         pkgcfg="$(call GETVAR,speedo_pkg_w64_$(1)_configure)";          \
693         tmp="$(speedo_w32_cflags)                                       \
694              $(call GETVAR,speedo_pkg_$(1)_extracflags)";               \
695         if [ x$$$$(echo "$$$$tmp" | tr -d '[:space:]')x != xx ]; then   \
696           pkgextracflags="CFLAGS=\"$$$$tmp\"";                          \
697         else                                                            \
698           pkgextracflags=;                                              \
699         fi;                                                             \
700         pkgmkdir="$(call GETVAR,speedo_pkg_$(1)_make_dir)";             \
701         pkgmkargs="$(call GETVAR,speedo_pkg_$(1)_make_args)";           \
702         pkgmkargs_inst="$(call GETVAR,speedo_pkg_$(1)_make_args_inst)"; \
703         pkgmkargs_uninst="$(call GETVAR,speedo_pkg_$(1)_make_args_uninst)"; \
704         export PKG_CONFIG="/usr/bin/pkg-config";                        \
705         export PKG_CONFIG_PATH="$(idir6)/lib/pkgconfig";                \
706         [ "$(TARGETOS)" != native ] && export PKG_CONFIG_LIBDIR="";     \
707         export SYSROOT="$(idir6)";                                      \
708         export PATH="$(idir6)/bin:$${PATH}";                            \
709         export LD_LIBRARY_PATH="$(idir6)/lib:$${LD_LIBRARY_PATH}"
710 endef
711
712
713 # Template for source packages.
714
715 # Note that the gnupg package is special: The package source dir is
716 # the same as the topsrc dir and thus we need to detect the gnupg
717 # package and cd to that directory.  We also test that no in-source build
718 # has been done.  autogen.sh is not run for gnupg.
719 #
720 define SPKG_template
721
722 $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
723         @echo "speedo: /*"
724         @echo "speedo:  *   $(1)"
725         @echo "speedo:  */"
726         @(set -e; cd $(sdir);                           \
727          $(call SETVARS,$(1));                          \
728          if [ "$(WHAT)" = "this" ]; then                \
729            echo "speedo: using included source";        \
730          elif [ "$(1)" = "gnupg" ]; then                \
731            cd $$$${pkgsdir};                            \
732            if [ -f config.log ]; then                   \
733              echo "GnuPG has already been build in-source" >&2  ;\
734              echo "Please run \"make distclean\" and retry" >&2 ;\
735              exit 1 ;                                   \
736            fi;                                          \
737            echo "speedo: unpacking gnupg not needed";   \
738          elif [ -n "$$$${git}" ]; then                  \
739            echo "speedo: unpacking $(1) from $$$${git}:$$$${gitref}"; \
740            git clone -b "$$$${gitref}" "$$$${git}" "$$$${pkg}"; \
741            cd "$$$${pkg}";                              \
742            AUTOGEN_SH_SILENT=1 ./autogen.sh;            \
743          elif [ -n "$$$${tar}" ]; then                  \
744            echo "speedo: unpacking $(1) from $$$${tar}"; \
745            case "$$$${tar}" in                          \
746              *.gz) pretar=zcat ;;                       \
747              *.bz2) pretar=bzcat ;;                     \
748              *.xz) pretar=xzcat ;;                      \
749              *) pretar=cat ;;                           \
750            esac;                                        \
751            [ -f tmp.tgz ] && rm tmp.tgz;                \
752            case "$$$${tar}" in                          \
753              /*) $$$${pretar} < $$$${tar} | tar xf - ;; \
754              *)  wget -q -O - $$$${tar} | tee tmp.tgz   \
755                   | $$$${pretar} | tar x$$$${opt}f - ;; \
756            esac;                                        \
757            if [ -f tmp.tgz ]; then                      \
758              if [ -n "$$$${sha1}" ]; then               \
759                tmp=$$$$($(SHA1SUM) <tmp.tgz|cut -d' ' -f1);\
760                if [ "$$$${tmp}" != "$$$${sha1}" ]; then \
761                  echo "speedo:";                        \
762                  echo "speedo: ERROR: checksum mismatch for $(1)";\
763                  echo "speedo:";                        \
764                  exit 1;                                \
765                fi;                                      \
766              else                                       \
767                echo "speedo:";                          \
768                echo "speedo: Warning: No checksum known for $(1)";\
769                echo "speedo:";                          \
770              fi;                                        \
771              rm tmp.tgz;                                \
772            fi;                                          \
773            base=`echo "$$$${tar}" | sed -e 's,^.*/,,'   \
774                  | sed -e 's,\.tar.*$$$$,,'`;           \
775            mv $$$${base} $(1);                          \
776            patch="$(patdir)/$(1)-$$$${base#$(1)-}.patch";\
777            if [ -x "$$$${patch}" ]; then                \
778              echo "speedo: applying patch $$$${patch}"; \
779              cd $(1); "$$$${patch}";                    \
780            elif [ -f "$$$${patch}" ]; then              \
781              echo "speedo: warning: $$$${patch} is not executable"; \
782            fi;                                          \
783          else                                           \
784            echo "speedo: unpacking $(1) from UNKNOWN";  \
785          fi)
786         @touch $(stampdir)/stamp-$(1)-00-unpack
787
788 $(stampdir)/stamp-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
789         @echo "speedo: configuring $(1)"
790 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
791         @echo "speedo: configure run not required"
792 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
793         @($(call SETVARS,$(1));                         \
794          mkdir "$$$${pkgbdir}";                         \
795          cd "$$$${pkgbdir}";                            \
796          if [ -n "$(speedo_autogen_buildopt)" ]; then   \
797             eval AUTOGEN_SH_SILENT=1 w32root="$(idir)"  \
798                "$$$${pkgsdir}/autogen.sh"               \
799                $(speedo_autogen_buildopt)               \
800                $$$${pkgcfg} $$$${pkgextracflags};       \
801          else                                           \
802             eval "$$$${pkgsdir}/configure"              \
803                --silent                                 \
804                --enable-maintainer-mode                 \
805                --prefix="$(idir)"                       \
806                $$$${pkgcfg} $$$${pkgextracflags};       \
807          fi)
808 else
809         @($(call SETVARS,$(1));                         \
810          mkdir "$$$${pkgbdir}";                         \
811          cd "$$$${pkgbdir}";                            \
812          eval "$$$${pkgsdir}/configure"                 \
813              --silent $(speedo_host_build_option)       \
814              --prefix="$(idir)"                         \
815              $$$${pkgcfg}  $$$${pkgextracflags};        \
816          )
817 endif
818         @touch $(stampdir)/stamp-$(1)-01-configure
819
820 # Note that unpack has no 64 bit version becuase it is just the source.
821 # Fixme: We should use templates to create the standard and w64
822 # version of these rules.
823 $(stampdir)/stamp-w64-$(1)-01-configure: $(stampdir)/stamp-$(1)-00-unpack
824         @echo "speedo: configuring $(1) (64 bit)"
825 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
826         @echo "speedo: configure run not required"
827 else ifneq ($(findstring $(1),$(speedo_gnupg_style)),)
828         @($(call SETVARS_W64,$(1));                     \
829          mkdir "$$$${pkgbdir}";                         \
830          cd "$$$${pkgbdir}";                            \
831          if [ -n "$(speedo_autogen_buildopt)" ]; then   \
832             eval AUTOGEN_SH_SILENT=1 w64root="$(idir6)" \
833                "$$$${pkgsdir}/autogen.sh"               \
834                $(speedo_autogen_buildopt6)              \
835                $$$${pkgcfg} $$$${pkgextracflags};       \
836          else                                           \
837             eval "$$$${pkgsdir}/configure"              \
838                --silent                                 \
839                --enable-maintainer-mode                 \
840                --prefix="$(idir6)"                      \
841                $$$${pkgcfg} $$$${pkgextracflags};       \
842          fi)
843 else
844         @($(call SETVARS_W64,$(1));                     \
845          mkdir "$$$${pkgbdir}";                         \
846          cd "$$$${pkgbdir}";                            \
847          eval "$$$${pkgsdir}/configure"                 \
848              --silent $(speedo_host_build_option6)      \
849              --prefix="$(idir6)"                        \
850              $$$${pkgcfg} $$$${pkgextracflags};         \
851          )
852 endif
853         @touch $(stampdir)/stamp-w64-$(1)-01-configure
854
855
856 $(stampdir)/stamp-$(1)-02-make: $(stampdir)/stamp-$(1)-01-configure
857         @echo "speedo: making $(1)"
858 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
859         @($(call SETVARS,$(1));                         \
860           cd "$$$${pkgsdir}";                           \
861           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
862           if test "$$$${pkg}" = zlib -a "$(TARGETOS)" != w32 ; then \
863             ./configure --prefix="$(idir)" ; \
864           fi ;\
865           $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
866 else
867         @($(call SETVARS,$(1));                         \
868           cd "$$$${pkgbdir}";                           \
869           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
870           $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
871 endif
872         @touch $(stampdir)/stamp-$(1)-02-make
873
874 $(stampdir)/stamp-w64-$(1)-02-make: $(stampdir)/stamp-w64-$(1)-01-configure
875         @echo "speedo: making $(1) (64 bit)"
876 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
877         @($(call SETVARS_W64,$(1));                             \
878           cd "$$$${pkgsdir}";                           \
879           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
880           $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
881 else
882         @($(call SETVARS_W64,$(1));                             \
883           cd "$$$${pkgbdir}";                           \
884           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
885           $(MAKE) --no-print-directory $(speedo_makeopt) $$$${pkgmkargs} V=0)
886 endif
887         @touch $(stampdir)/stamp-w64-$(1)-02-make
888
889 # Note that post_install must come last because it may be empty and
890 # "; ;" is a syntax error.
891 $(stampdir)/stamp-$(1)-03-install: $(stampdir)/stamp-$(1)-02-make
892         @echo "speedo: installing $(1)"
893 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
894         @($(call SETVARS,$(1));                         \
895           cd "$$$${pkgsdir}";                           \
896           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
897           $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
898           $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
899 else
900         @($(call SETVARS,$(1));                         \
901           cd "$$$${pkgbdir}";                           \
902           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
903           $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
904           $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
905 endif
906         touch $(stampdir)/stamp-$(1)-03-install
907
908 $(stampdir)/stamp-w64-$(1)-03-install: $(stampdir)/stamp-w64-$(1)-02-make
909         @echo "speedo: installing $(1) (64 bit)"
910 ifneq ($(findstring $(1),$(speedo_make_only_style)),)
911         @($(call SETVARS_W64,$(1));                             \
912           cd "$$$${pkgsdir}";                           \
913           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
914           $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install V=0;\
915           $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
916 else
917         @($(call SETVARS_W64,$(1));                             \
918           cd "$$$${pkgbdir}";                           \
919           test -n "$$$${pkgmkdir}" && cd "$$$${pkgmkdir}"; \
920           $(MAKE) --no-print-directory $$$${pkgmkargs_inst} install-strip V=0;\
921           $(call speedo_pkg_$(call FROB_macro,$(1))_post_install))
922 endif
923         touch $(stampdir)/stamp-w64-$(1)-03-install
924
925 $(stampdir)/stamp-final-$(1): $(stampdir)/stamp-$(1)-03-install
926         @echo "speedo: $(1) done"
927         @touch $(stampdir)/stamp-final-$(1)
928
929 $(stampdir)/stamp-w64-final-$(1): $(stampdir)/stamp-w64-$(1)-03-install
930         @echo "speedo: $(1) (64 bit) done"
931         @touch $(stampdir)/stamp-w64-final-$(1)
932
933 .PHONY : clean-$(1)
934 clean-$(1):
935         @echo "speedo: uninstalling $(1)"
936         @($(call SETVARS,$(1));                           \
937          (cd "$$$${pkgbdir}" 2>/dev/null &&               \
938           $(MAKE) --no-print-directory                    \
939            $$$${pkgmkargs_uninst} uninstall V=0 ) || true;\
940          if [ "$(1)" = "gnupg" ]; then                    \
941            rm -fR "$$$${pkgbdir}" || true                ;\
942          else                                             \
943            rm -fR "$$$${pkgsdir}" "$$$${pkgbdir}" || true;\
944          fi)
945         -rm -f $(stampdir)/stamp-final-$(1) $(stampdir)/stamp-$(1)-*
946
947
948 .PHONY : build-$(1)
949 build-$(1): $(stampdir)/stamp-final-$(1)
950
951
952 .PHONY : report-$(1)
953 report-$(1):
954         @($(call SETVARS,$(1));                         \
955          echo -n $(1):\  ;                              \
956          if [ -n "$$$${git}" ]; then                    \
957            if [ -e "$$$${pkgsdir}/.git" ]; then         \
958              cd "$$$${pkgsdir}" &&                      \
959              git describe ;                             \
960            else                                         \
961              echo missing;                              \
962            fi                                           \
963          elif [ -n "$$$${tar}" ]; then                  \
964            base=`echo "$$$${tar}" | sed -e 's,^.*/,,'   \
965                  | sed -e 's,\.tar.*$$$$,,'`;           \
966            echo $$$${base} ;                            \
967          fi)
968
969 endef
970
971
972 # Insert the template for each source package.
973 $(foreach spkg, $(speedo_spkgs), $(eval $(call SPKG_template,$(spkg))))
974
975 $(stampdir)/stamp-final: $(stampdir)/stamp-directories
976 ifeq ($(TARGETOS),w32)
977 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-w64-final-,$(speedo_w64_build_list))
978 endif
979 $(stampdir)/stamp-final: $(addprefix $(stampdir)/stamp-final-,$(speedo_build_list))
980         touch $(stampdir)/stamp-final
981
982 all-speedo: $(stampdir)/stamp-final
983
984 report-speedo: $(addprefix report-,$(speedo_build_list))
985
986 # Just to check if we catched all stamps.
987 clean-stamps:
988         $(RM) -fR $(stampdir)
989
990 clean-speedo:
991         $(RM) -fR PLAY
992
993
994 #
995 # Windows installer
996 #
997 # {{{
998 ifeq ($(TARGETOS),w32)
999
1000 dist-source: all
1001         for i in 00 01 02 03; do sleep 1;touch PLAY/stamps/stamp-*-${i}-*;done
1002         (set -e;\
1003          tarname="$(INST_NAME)-$(INST_VERSION)_$(BUILD_ISODATE).tar" ;\
1004          [ -f "$$tarname" ] && rm "$$tarname" ;\
1005          tar -C $(topsrc) -cf "$$tarname" --exclude-backups --exclude-vc \
1006              --transform='s,^\./,$(INST_NAME)-$(INST_VERSION)/,' \
1007              --anchored --exclude './PLAY' . ;\
1008          tar --totals -rf "$$tarname" --exclude-backups --exclude-vc \
1009               --transform='s,^,$(INST_NAME)-$(INST_VERSION)/,' \
1010              PLAY/stamps/stamp-*-00-unpack PLAY/src ;\
1011          xz "$$tarname" ;\
1012         )
1013
1014
1015 $(bdir)/NEWS.tmp: $(topsrc)/NEWS
1016         sed -e '/^#/d' <$(topsrc)/NEWS >$(bdir)/NEWS.tmp
1017
1018 $(bdir)/README.txt: $(bdir)/NEWS.tmp $(w32src)/README.txt \
1019                     $(w32src)/pkg-copyright.txt
1020         sed -e '/^;.*/d;' \
1021         -e '/!NEWSFILE!/{r NEWS.tmp' -e 'd;}' \
1022         -e '/!PKG-COPYRIGHT!/{r $(w32src)/pkg-copyright.txt' -e 'd;}' \
1023         -e 's,!VERSION!,$(INST_VERSION),g' \
1024            < $(w32src)/README.txt \
1025            | awk '{printf "%s\r\n", $$0}' >$(bdir)/README.txt
1026
1027 $(bdir)/g4wihelp.dll: $(w32src)/g4wihelp.c $(w32src)/exdll.h
1028         (set -e; cd $(bdir); \
1029          $(W32CC) -I. -shared -O2 -o g4wihelp.dll $(w32src)/g4wihelp.c \
1030                   -lwinmm -lgdi32; \
1031          $(STRIP) g4wihelp.dll)
1032
1033 w32_insthelpers: $(bdir)/g4wihelp.dll
1034
1035 $(bdir)/inst-options.ini: $(w32src)/inst-options.ini
1036         cat $(w32src)/inst-options.ini >$(bdir)/inst-options.ini
1037
1038 installer: all w32_insthelpers $(w32src)/inst-options.ini $(bdir)/README.txt
1039         $(MAKENSIS) -V2 \
1040                     -DINST_DIR=$(idir) \
1041                     -DINST6_DIR=$(idir6) \
1042                     -DBUILD_DIR=$(bdir) \
1043                     -DTOP_SRCDIR=$(topsrc) \
1044                     -DW32_SRCDIR=$(w32src) \
1045                     -DBUILD_ISODATE=$(BUILD_ISODATE) \
1046                     -DNAME=$(INST_NAME) \
1047                     -DVERSION=$(INST_VERSION) \
1048                     -DPROD_VERSION=$(INST_PROD_VERSION) \
1049                     $(w32src)/inst.nsi
1050         @echo "Ready: $(idir)/$(INST_NAME)-$(INST_VERSION)"
1051
1052 endif
1053 # }}} W32
1054
1055
1056 #
1057 # Check availibility of standard tools
1058 #
1059 check-tools:
1060
1061
1062 #
1063 # Mark phony targets
1064 #
1065 .PHONY: all all-speedo report-speedo clean-stamps clean-speedo installer \
1066         w32_insthelpers check-tools