Merge branch 'master' of git+ssh://playfair.gnupg.org/git/gpg4win
[gpg4win.git] / configure.ac
1 # configure.ac for GPG4Win
2 # Copyright (C) 2005, 2006, 2007, 2008, 2010 g10 Code GmbH
3 #
4 # This file is part of GPG4Win
5 #
6 # GPG4Win is free software; you can redistribute it and/or modify it
7 # 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, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # 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, see <http://www.gnu.org/licenses/>.
18
19 # (Process this file with autoconf to produce a configure script.)
20
21 AC_PREREQ(2.59)
22 min_automake_version="1.9.3"
23
24 # Remember to change the version number immediately *after* a release.
25 # Set my_isgit to "yes" for non-released code.
26 # Right after a release the make target "copy-news" is to be called!
27 m4_define([my_version], [2.1.1])
28 m4_define([my_isgit], [yes])
29
30 m4_define([git_revision], m4_esyscmd([git branch -v 2>/dev/null \
31           | awk '/^\* / {printf "%s",$3}']))
32 # We also define a decimal version of the git revision.
33 m4_define([git_revision_dec],
34   m4_esyscmd_s([echo 0000$((0x$(echo ]git_revision[|head -c 4)))|tail -c 6]))
35 m4_define([my_full_version],
36           [my_version[]m4_if(my_isgit,[yes],[-[]git_revision_dec[]-beta])])
37 AC_INIT([gpg4win],[my_full_version],[gpg4win-devel@wald.intevation.org])
38
39 # Remember to update these version numbers also in the NEWS file.
40 MANUALVERSION_EINSTEIGER="2.0.2"
41 MANUALDATE_EINSTEIGER="30. Mai 2006"
42 MANUALVERSION_DURCHBLICKER="2.0.2"
43 MANUALDATE_DURCHBLICKER="30. Mai 2006"
44 MANUALVERSION_NOVICES="1.0.0"
45 MANUALDATE_NOVICES="Nov. 30, 2006"
46 MANUALVERSION_ADVANCED="0.0.0"
47 MANUALDATE_ADVANCED="Nov. 30, 2006"
48 COMPENDIUM_VERSION_DE="3.0.0"
49 COMPENDIUM_DATE_DE="21. Mai 2010"
50 COMPENDIUMINPROGRESS_DE="zuletzt geringfügig korrigiert am 4. Januar 2012"
51 COMPENDIUM_VERSION_EN="3.0.0-beta1"
52 COMPENDIUM_DATE_EN="31. August 2010"
53 COMPENDIUMINPROGRESS_EN="last minor changes from 4. January 2012"
54
55 MANUALINPROGRESS_DE=m4_if(my_isgit,[yes],["~und evtl. seitdem weiter bearbeitet"])
56 MANUALINPROGRESS_EN=m4_if(my_isgit,[yes],["~and may have been further edited"])
57 PACKAGE=$PACKAGE_NAME
58 VERSION=$PACKAGE_VERSION
59 GIT_REVISION=git_revision
60 GIT_REVISION_DEC=git_revision_dec
61
62
63 AC_CONFIG_SRCDIR(include/config.nsi.in)
64 AC_CONFIG_MACRO_DIR(m4)
65
66 AM_INIT_AUTOMAKE([tar-ustar])
67 AM_MAINTAINER_MODE
68 AC_CANONICAL_HOST
69 AM_CONFIG_HEADER(config.h)
70
71 # Language support
72 AM_PO_SUBDIRS
73
74
75 AC_SUBST(PACKAGE)
76 AC_SUBST(VERSION)
77 AC_SUBST(MANUALVERSION_EINSTEIGER)
78 AC_SUBST(MANUALDATE_EINSTEIGER)
79 AC_SUBST(MANUALVERSION_DURCHBLICKER)
80 AC_SUBST(MANUALDATE_DURCHBLICKER)
81 AC_SUBST(MANUALINPROGRESS_DE)
82 AC_SUBST(MANUALVERSION_NOVICES)
83 AC_SUBST(MANUALDATE_NOVICES)
84 AC_SUBST(MANUALVERSION_ADVANCED)
85 AC_SUBST(MANUALDATE_ADVANCED)
86 AC_SUBST(MANUALINPROGRESS_EN)
87 AC_SUBST(COMPENDIUM_VERSION_DE)
88 AC_SUBST(COMPENDIUM_DATE_DE)
89 AC_SUBST(COMPENDIUMINPROGRESS_DE)
90 AC_SUBST(COMPENDIUM_VERSION_EN)
91 AC_SUBST(COMPENDIUM_DATE_EN)
92 AC_SUBST(COMPENDIUMINPROGRESS_EN)
93
94 if echo "${PACKAGE_VERSION}" | egrep 'svn|rc|beta|git' >/dev/null ; then
95   IS_BETA_BUILD=yes
96 else
97   IS_BETA_BUILD=no
98 fi
99 AC_SUBST(IS_BETA_BUILD)
100
101 # Generate extended version information.  Note, that for NSIS use we
102 # must not translate the dots to commas in the BUILD_FILEVERSION.
103 BUILD_TIMESTAMP=`date --iso-8601=minutes`
104 BUILD_ISODATE=`date --iso-8601`
105 changequote(,)dnl
106 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
107 changequote([,])dnl
108 BUILD_FILEVERSION="${BUILD_FILEVERSION}${GIT_REVISION_DEC}"
109 AC_SUBST(BUILD_TIMESTAMP)
110 AC_SUBST(BUILD_ISODATE)
111 AC_SUBST(BUILD_FILEVERSION)
112
113 # To test the manuals using an actual web server, the preview target
114 # may be used in doc/manuals.  The default is my (wk) test environment
115 # but may be overriden using another preview variable.  PREVIEWHOST is
116 # expected to be the target for an rsync command.
117 if test -z "$PREVIEWHOST" ; then
118    PREVIEWHOST="vigenere:/var/www/all/preview.gpg4win.org/htdocs/"
119 fi
120 AC_SUBST(PREVIEWHOST)
121
122 # The final release is copied to an archive server.  The default
123 # location may be changed by setting the RELEASEHOST envvar.
124 if test -z "$RELEASEHOST" ; then
125    RELEASEHOST="vigenere:tarballs/gpg4win"
126    if test "${IS_BETA_BUILD}" = yes ; then
127       RELEASEHOST="${RELEASEHOST}/Beta"
128    fi
129 fi
130 AC_SUBST(RELEASEHOST)
131
132 # Substitutions to set generated files in a Emacs buffer to read-only.
133 AC_SUBST(emacs_local_vars_begin, ['Local Variables:'])
134 AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t'])
135 AC_SUBST(emacs_local_vars_end, ['End:'])
136
137 # For development of this package it is useful to build without
138 # creating the source installer (takes a long time).  This option may
139 # be used to suppress creation of the source installer.
140 AC_ARG_ENABLE(source-installer,
141     AC_HELP_STRING([--disable-source-installer],
142                    [Do not create the Source installer]),
143                     build_source_installer=$enableval,
144                     build_source_installer=yes)
145 AM_CONDITIONAL(BUILD_SOURCE_INSTALLER, test "$build_source_installer" = yes)
146
147
148 # You can build a light version of the installer in addition to the
149 # regular version.  This one does not contain the manuals.
150 AC_ARG_ENABLE(light-installer,
151     AC_HELP_STRING([--disable-light-installer],
152                    [Do not create the light version of the installer]),
153                     build_light_installer=$enableval,
154                     build_light_installer=yes)
155 AM_CONDITIONAL(BUILD_LIGHT_INSTALLER, test "$build_light_installer" = yes)
156
157 # You can build a vanilla version of the installer, featuring only
158 # GnuPG, a pinentry and GPGME, in addition to the regular version.
159 # This one does not contain the manuals.
160 AC_ARG_ENABLE(vanilla-installer,
161     AC_HELP_STRING([--disable-vanilla-installer],
162                    [Do not create the vanilla version of the installer]),
163                     build_vanilla_installer=$enableval,
164                     build_vanilla_installer=yes)
165 AM_CONDITIONAL(BUILD_VANILLA_INSTALLER, test "$build_vanilla_installer" = yes)
166
167 # If you want to build only the light or vanilla installer, you may
168 # disable building of the full installer.
169 AC_ARG_ENABLE(full-installer,
170     AC_HELP_STRING([--disable-full-installer],
171                    [Do not create the full version of the installer]),
172                     build_full_installer=$enableval,
173                     build_full_installer=yes)
174 AM_CONDITIONAL(BUILD_FULL_INSTALLER, test "$build_full_installer" = yes)
175
176 # For development it is often faster to build without manuals.
177 AC_ARG_ENABLE(manuals,
178     AC_HELP_STRING([--disable-manuals],
179                    [Do not build the manuals (for debugging)]),
180                     build_manuals=$enableval,
181                     build_manuals=yes)
182 AM_CONDITIONAL(BUILD_MANUALS, test "$build_manuals" = yes)
183
184
185 AC_ARG_ENABLE(fast-makensis,
186     AC_HELP_STRING([--enable-fast-makensis],
187                    [Use a less efficient compressor to speed up building]),
188                     use_fast_makensis=$enableval,
189                     use_fast_makensis=no)
190 if test "$use_fast_makensis" = yes; then
191   EXTRA_MAKENSIS_FLAGS="${EXTRA_MAKENSIS_FLAGS} -DDISABLE_LZMA=1"
192 fi
193 AC_SUBST(EXTRA_MAKENSIS_FLAGS)
194
195
196 # Required tools.
197 AC_PROG_CC
198 AC_PROG_CPP
199 AC_PROG_RANLIB
200 AC_CHECK_TOOL(AR, ar, :)
201 AC_CHECK_TOOLS(STRIP, strip)
202 AC_CHECK_TOOLS(DLLTOOL, dlltool)
203 AC_CHECK_PROGS(MAKE, make)
204 AC_CHECK_PROGS(UNZIP, unzip)
205 AC_CHECK_PROGS(TAR, tar)
206 AC_CHECK_PROGS(MKDIR, mkdir)
207 AC_CHECK_PROGS(CP, cp)
208 AC_CHECK_PROGS(RM, rm)
209 AC_CHECK_PROGS(STOW, stow)
210 AC_CHECK_PROGS(MAKENSIS, makensis)
211 AC_CHECK_PROGS(ZCAT, zcat)
212 AC_CHECK_PROGS(TEXI2DVI, texi2dvi)
213 AC_CHECK_PROGS(DVIPDF, dvipdf)
214 AC_CHECK_PROGS(CONVERT, convert)
215 AC_CHECK_PROGS(SHA1SUM, sha1sum)
216 AC_CHECK_PROGS(MSGFMT, msgfmt)
217 AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog,
218                [build-aux/gitlog-to-changelog])
219 AC_PROG_INSTALL
220
221 missing_tools=
222 for i in DLLTOOL MAKE UNZIP TAR MKDIR CP RM STOW MAKENSIS ZCAT TEXI2DVI \
223          DVIPDF CONVERT SHA1SUM MSGFMT ; do
224    eval tmp='$'$i
225    if test -z "$tmp"; then
226       missing_tools="$missing_tools `echo $i | tr 'A-Z' 'a-z'`"
227    fi
228 done
229
230 AC_CHECK_PROGS(GLIB_GENMARSHAL, glib-genmarshal)
231 AC_CHECK_PROGS(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
232 AC_CHECK_PROGS(GLIB_COMPILE_RESOURCES, glib-compile-resources)
233 AC_CHECK_PROGS(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
234 AC_CHECK_PROGS(GS, gs)
235 # For the claws manual we need:
236 AC_CHECK_PROGS(DOCBOOK2HTML, docbook2html)
237 AC_CHECK_PROGS(DOCBOOK2TXT, docbook2txt)
238 AC_CHECK_PROGS(DOCBOOK2PS, docbook2ps)
239 AC_CHECK_PROGS(DOCBOOK2PDF, docbook2pdf)
240
241
242 missing_opt_tools=
243 for i in GLIB_GENMARSHAL GLIB_COMPILE_SCHEMAS GLIB_COMPILE_RESOURCES \
244          GDK_PIXBUF_CSOURCE GS \
245          DOCBOOK2PDF DOCBOOK2TXT DOCBOOK2PS DOCBOOK2PDF; do
246    eval tmp='$'$i
247    if test -z "$tmp"; then
248       missing_opt_tools="$missing_opt_tools `echo $i | tr 'A-Z' 'a-z'`"
249    fi
250 done
251
252
253
254 # Optional tools.
255
256 AC_CHECK_PROGS(WGET, wget)
257
258
259 # Packages.
260 gpg4win_dup_sources=""
261
262 GPG4WIN_BPKG_GNU([libiconv])
263 GPG4WIN_BPKG_GNU([gettext], [libiconv])
264
265 GPG4WIN_SPKG([zlib])
266 GPG4WIN_BPKG_GNUWIN32([bsfilter])
267
268 GPG4WIN_BPKG_GTK([pkgconfig])
269
270 GPG4WIN_SPKG([libffi], [pkgconfig])
271 GPG4WIN_SPKG([glib], [libiconv gettext pkgconfig libffi zlib])
272 GPG4WIN_BPKG_GTK_DEV([atk], [glib pkgconfig])
273 GPG4WIN_BPKG_GTK_DEV([pango], [glib pkgconfig])
274 GPG4WIN_BPKG_GTK_DEV([cairo], [glib pkgconfig])
275 GPG4WIN_BPKG_GTK_DEV([expat])
276 GPG4WIN_BPKG_GTK_DEV([freetype], [pkgconfig zlib])
277 GPG4WIN_BPKG_GTK_DEV([fontconfig], [pkgconfig zlib expat])
278 GPG4WIN_SPKG([gdk-pixbuf], [glib])
279 GPG4WIN_SPKG([gtk+], [libiconv gettext pkgconfig atk pango dnl
280                       glib gdk-pixbuf cairo])
281 GPG4WIN_SPKG([libpng], [pkgconfig])
282 GPG4WIN_SPKG([enchant], [pkgconfig glib])
283
284 GPG4WIN_SPKG([bzip2])
285 GPG4WIN_SPKG([adns])
286 GPG4WIN_SPKG([libgpg-error], [libiconv gettext])
287 GPG4WIN_SPKG([libgcrypt], [libgpg-error])
288 GPG4WIN_SPKG([libksba], [libgpg-error])
289 GPG4WIN_SPKG([w32pth])
290 GPG4WIN_SPKG([libassuan], [libgpg-error w32pth])
291 GPG4WIN_SPKG([dirmngr], [libgpg-error libgcrypt libassuan libksba w32pth])
292 GPG4WIN_SPKG([pinentry], [libiconv gtk+])
293 GPG4WIN_SPKG([gpgme], [libgpg-error gnupg2 glib])
294 GPG4WIN_SPKG([curl], [zlib gnutls])
295 GPG4WIN_SPKG([gnupg2], [libiconv libgcrypt libksba libassuan libgpg-error dnl
296                         w32pth zlib bzip2 adns pinentry])
297 GPG4WIN_SPKG([pthreads-w32])
298 GPG4WIN_SPKG([gpgol], [gpgme libassuan])
299 GPG4WIN_SPKG([gpgex], [libassuan])
300 GPG4WIN_SPKG([scute], [libgpg-error libassuan])
301 GPG4WIN_SPKG([paperkey])
302 GPG4WIN_SPKG([gpa], [libiconv gettext zlib gtk+ libpng glib gpgme])
303 GPG4WIN_SPKG([libgsasl])
304 GPG4WIN_SPKG([libtasn1])
305 GPG4WIN_SPKG([gnutls], [libgsasl libtasn1 libgcrypt])
306 GPG4WIN_SPKG([libetpan], [pthreads-w32 gnutls])
307 GPG4WIN_SPKG([libxml2], [zlib])
308 GPG4WIN_SPKG([regex])
309 GPG4WIN_SPKG([crypt])
310 GPG4WIN_SPKG([claws-mail], [libiconv gettext zlib gtk+ libpng enchant glib dnl
311                             gpgme pthreads-w32 crypt regex libetpan gnutls])
312 GPG4WIN_SPKG([notification_plugin], [claws-mail])
313 GPG4WIN_SPKG([gtkhtml2_viewer], [curl claws-mail libxml2])
314 GPG4WIN_SPKG([vcalendar], [curl claws-mail])
315 GPG4WIN_SPKG([rssyl], [curl claws-mail])
316 GPG4WIN_SPKG([tnef_parse], [claws-mail])
317 GPG4WIN_SPKG([attachwarner], [claws-mail])
318 GPG4WIN_SPKG([bsfilter_plugin], [claws-mail])
319 GPG4WIN_IPKG([compendium])
320
321 # Qt related stuff.
322 GPG4WIN_BPKG_GNUWIN32([kdesupport])
323 GPG4WIN_BPKG_BINSRC([oxygen-icons])
324 GPG4WIN_BPKG_GNUWIN32([qt], [kdesupport])
325 GPG4WIN_BPKG_GNUWIN32([kdelibs], [qt oxygen-icons])
326 GPG4WIN_BPKG_BINSRC([kleopatra], [gpgme gnupg2 kdelibs])
327 #GPG4WIN_BPKG_GNUWIN32([kleopatra], [gpgme gnupg2 kdelibs])
328
329 GPG4WIN_FINALIZE
330
331 # Qt is compiled with -mthreads, and thus requires the mingwm10.dll.
332 mingwm_dll=no
333 AC_ARG_WITH([mingwm-dll],
334             AC_HELP_STRING([--with-mingwm-dll=FILE], [use the mingwm DLL]),
335             [mingwm_dll=$withval])
336 if test "$mingwm_dll" = "no"; then
337   file="/usr/share/doc/mingw32-runtime/mingwm10.dll.gz"
338   if test -r "$file"; then
339     mingwm_dll="$file"
340   fi
341 fi
342 if test "$mingwm_dll" = "no"; then
343   missing_tools="mingwm10.dll $missing_tools"
344 fi
345 # To make things simple, we just install a copy of the file in the
346 # source directory.  No need to make this ugly hack any uglier by
347 # messing around with the build system.
348 case "$mingwm_dll" in
349     *.gz)
350       $ZCAT $mingwm_dll > src/mingwm10.dll
351       ;;
352     *)
353       cp $mingwm_dll src/mingwm10.dll
354       ;;
355 esac
356
357
358 # Throw an error if required tools are missing
359 if test -n "$missing_tools"; then
360     for i in $missing_tools; do
361       AC_MSG_NOTICE([$i is missing])
362     done
363     AC_MSG_ERROR([[
364 ***
365 *** Required tools not found. Please consult the above messages
366 *** and install them before running configure again.
367 ***]])
368 fi
369
370 # Throw an error if any duplicate source packages have been found
371 if test -n "$gpg4win_dup_sources"; then
372     tmp=
373     for i in $gpg4win_dup_sources; do
374       tmp="$tmp
375 $i"
376     done
377     AC_MSG_ERROR([Packages with more that one source version:$tmp])
378 fi
379
380
381 # Finalize.
382
383 AC_CONFIG_COMMANDS([gpg4win-conf],[[
384 chmod +x patches/gnupg2/01-version.patch
385 ]])
386
387 AC_CONFIG_FILES(Makefile)
388 AC_CONFIG_FILES(packages/Makefile include/Makefile src/Makefile po/Makefile.in)
389 AC_CONFIG_FILES(include/config.nsi src/gpg4win.mk)
390 AC_CONFIG_FILES(doc/Makefile)
391 AC_CONFIG_FILES(doc/logo/Makefile)
392 AC_CONFIG_FILES(doc/manual/Makefile doc/manual/version.tex)
393 AC_CONFIG_FILES(doc/website/Makefile)
394 AC_CONFIG_FILES(src/dictionaries/Makefile)
395 AC_CONFIG_FILES(patches/gnupg2/01-version.patch)
396 AC_OUTPUT
397
398 # Throw a warning if optional tools are missing
399 if test -n "$missing_opt_tools"; then
400     AC_MSG_WARN([[
401 ***
402 *** Some tools not found.  They may or may not be needed depending on
403 *** the packages you want to include.  For example GLIB and GTK+
404 *** require certain tools; you may need to install a recent version of
405 *** GLIB and GTK+ on the build machine to allow for cross-compiling.
406 ***]])
407     for i in $missing_opt_tools; do
408       AC_MSG_NOTICE([$i is missing])
409     done
410 fi