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