2005-10-21 Marcus Brinkmann <marcus@g10code.de>
[gpg4win.git] / src / Makefile.am
1 # Makefile.am - Installer for GnuPG 4 Windows Makefile.
2 # Copyright (C) 2005 g10 Code GmbH
3
4 # This file is part of GPG4Win.
5
6 # GPG4Win is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # GPG4Win is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19
20
21 EXTRA_DIST = pkg-config $(common_nsi) gpg4win.nsi gpg4win-src.nsi
22
23 # Supported source packages.
24 gpg4win_spkgs := gnupg libgpg-error gpgme gpgol gpa
25
26 # Extra options to configure for individual packages.
27 # We can use $(idir) here for the installation prefix.
28 gpg4win_pkg_gpgme_configure = \
29   --with-gpg-error-prefix=$(idir) --without-gpgsm --enable-static
30
31 gpg4win_pkg_gpa_configure = \
32   --with-libiconv-prefix=$(idir) --with-libintl-prefix=$(idir) \
33   --with-gpgme-prefix=$(idir) --with-zlib=$(idir)
34
35 gpg4win_pkg_gpgol_configure = \
36   --with-gpgme-prefix=$(idir) --with-gpg-error-prefix=$(idir)
37
38 # Supported binary packages.
39 gpg4win_bpkgs :=  libiconv gettext pkgconfig zlib glib libpng pango atk gtk+
40
41 # Zlib needs some special magic to generate a libtool file.
42 define gpg4win_pkg_zlib_post_install
43 (cd $$$${pkgidir_dev};                                  \
44 echo "dlname='../bin/zlib1.dll'" > lib/libz.la; \
45 echo "library_names='libz.dll.a'" >> lib/libz.la;       \
46 echo "old_library='libz.a'" >> lib/libz.la;             \
47 echo "dependency_libs=''" >> lib/libz.la;               \
48 echo "current=1" >> lib/libz.la;                        \
49 echo "age=2" >> lib/libz.la;                            \
50 echo "revision=3" >> lib/libz.la;                       \
51 echo "installed=yes" >> lib/libz.la;                    \
52 echo "shouldnotlink=no" >> lib/libz.la;                 \
53 echo "dlopen=''" >> lib/libz.la;                        \
54 echo "dlpreopen=''" >> lib/libz.la;                     \
55 echo "libdir=\"$$$${pkgidir}/lib\"" >> lib/libz.la;)
56 endef
57
58
59 # We need to fix the prefix in the various packages using pkgconfig,
60 # or we can't substitute it properly in our pkg-config wrapper.
61 define gpg4win_pkg_glib_post_install
62  (cd $$$${pkgidir_dev};                                                 \
63  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
64 endef
65
66 define gpg4win_pkg_atk_post_install
67  (cd $$$${pkgidir_dev};                                                 \
68  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
69 endef
70
71 define gpg4win_pkg_pango_post_install
72  (cd $$$${pkgidir_dev};                                                 \
73  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
74 endef
75
76 define gpg4win_pkg_gtk__post_install
77  (cd $$$${pkgidir_dev};                                                 \
78  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
79 endef
80
81 # In libpng, the pkg-config files are surprisingly found in the
82 # runtime package.
83 define gpg4win_pkg_libpng_post_install
84  (cd $$$${pkgidir};                                                     \
85  perl -pi -e 's/^prefix=.*$$$$/prefix=\/usr/' `find . -name \*.pc`)
86 endef
87
88
89 # Now do the bunch of the work.  This is a bunch of dirty magic to
90 # integrate our special makefile into automake, while not actually
91 # including it (make should include it).  This is in turn necessary
92 # because automake can't deal with the elegant magic in the actual
93 # Makefile.
94
95 define INCLUDE_BY_MAKE
96 include $(1)
97 endef
98
99 $(eval $(call INCLUDE_BY_MAKE,gpg4win.mk))
100
101 clean-local: clean-gpg4win
102
103 common_nsi := inst-sections.nsi installer.nsi installer-finish.nsi \
104   $(addsuffix .nsi,$(addprefix inst-,$(gpg4win_build_list)))
105
106 gpg4win-$(VERSION).exe: gpg4win.nsi $(common_nsi) stamps/stamp-final
107         $(MAKENSIS) gpg4win.nsi
108
109 gpg4win-src-$(VERSION).exe: gpg4win-src.nsi $(common_nsi) stamps/stamp-final
110         $(MAKENSIS) gpg4win-src.nsi
111
112 all-local: gpg4win-$(VERSION).exe gpg4win-src-$(VERSION).exe
113
114 clean-local:
115         rm -f gpg4win-$(VERSION).exe gpg4win-src-$(VERSION).exe