gtk+: Build from source.
[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 AC_CHECK_PROGS(GLIB_GENMARSHAL, glib-genmarshal)
228 AC_CHECK_PROGS(GLIB_COMPILE_SCHEMAS, glib-compile-schemas)
229 AC_CHECK_PROGS(GLIB_COMPILE_RESOURCES, glib-compile-resources)
230 AC_CHECK_PROGS(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource)
231 AC_CHECK_PROGS(GS, gs)
232 # For the claws manual we need:
233 AC_CHECK_PROGS(DOCBOOK2HTML, docbook2html)
234 AC_CHECK_PROGS(DOCBOOK2TXT, docbook2txt)
235 AC_CHECK_PROGS(DOCBOOK2PS, docbook2ps)
236 AC_CHECK_PROGS(DOCBOOK2PDF, docbook2pdf)
237
238
239 missing_opt_tools=
240 for i in GLIB_GENMARSHAL GLIB_COMPILE_SCHEMAS GLIB_COMPILE_RESOURCES \
241          GDK_PIXBUF_CSOURCE GS \
242          DOCBOOK2PDF DOCBOOK2TXT DOCBOOK2PS DOCBOOK2PDF; do
243    eval tmp='$'$i
244    if test -z "$tmp"; then
245       missing_opt_tools="$missing_opt_tools `echo $i | tr 'A-Z' 'a-z'`"
246    fi
247 done
248
249
250
251 # Optional tools.
252
253 AC_CHECK_PROGS(WGET, wget)
254
255
256 # Packages.
257 gpg4win_dup_sources=""
258
259 GPG4WIN_BPKG_GNU([libiconv])
260 GPG4WIN_BPKG_GNU([gettext], [libiconv])
261
262 GPG4WIN_SPKG([zlib])
263 GPG4WIN_BPKG_GNUWIN32([bsfilter])
264
265 GPG4WIN_BPKG_GTK([pkgconfig])
266
267 GPG4WIN_SPKG([libffi], [pkgconfig])
268 GPG4WIN_SPKG([glib], [libiconv gettext pkgconfig libffi zlib])
269 GPG4WIN_BPKG_GTK_DEV([atk], [glib pkgconfig])
270 GPG4WIN_BPKG_GTK_DEV([pango], [glib pkgconfig])
271 GPG4WIN_BPKG_GTK_DEV([cairo], [glib pkgconfig])
272 GPG4WIN_BPKG_GTK_DEV([expat])
273 GPG4WIN_BPKG_GTK_DEV([freetype], [pkgconfig zlib])
274 GPG4WIN_BPKG_GTK_DEV([fontconfig], [pkgconfig zlib expat])
275 GPG4WIN_SPKG([gdk-pixbuf], [glib])
276 GPG4WIN_SPKG([gtk+], [libiconv gettext pkgconfig atk pango dnl
277                       glib gdk-pixbuf cairo])
278 GPG4WIN_SPKG([libpng], [pkgconfig])
279 GPG4WIN_SPKG([enchant], [pkgconfig glib])
280
281 GPG4WIN_SPKG([bzip2])
282 GPG4WIN_SPKG([adns])
283 GPG4WIN_SPKG([libgpg-error], [libiconv gettext])
284 GPG4WIN_SPKG([libgcrypt], [libgpg-error])
285 GPG4WIN_SPKG([libksba], [libgpg-error])
286 GPG4WIN_SPKG([w32pth])
287 GPG4WIN_SPKG([libassuan], [libgpg-error w32pth])
288 GPG4WIN_SPKG([dirmngr], [libgpg-error libgcrypt libassuan libksba w32pth])
289 GPG4WIN_SPKG([pinentry], [libiconv gtk+])
290 GPG4WIN_SPKG([gpgme], [libgpg-error gnupg2 glib])
291 GPG4WIN_SPKG([curl], [zlib gnutls])
292 GPG4WIN_SPKG([gnupg2], [libiconv libgcrypt libksba libassuan libgpg-error dnl
293                         w32pth zlib bzip2 adns pinentry])
294 GPG4WIN_SPKG([pthreads-w32])
295 GPG4WIN_SPKG([gpgol], [gpgme libassuan])
296 GPG4WIN_SPKG([gpgex], [libassuan])
297 GPG4WIN_SPKG([scute], [libgpg-error libassuan])
298 GPG4WIN_SPKG([paperkey])
299 GPG4WIN_SPKG([gpa], [libiconv gettext zlib gtk+ libpng glib gpgme])
300 GPG4WIN_SPKG([libgsasl])
301 GPG4WIN_SPKG([libtasn1])
302 GPG4WIN_SPKG([gnutls], [libgsasl libtasn1 libgcrypt])
303 GPG4WIN_SPKG([libetpan], [pthreads-w32 gnutls])
304 GPG4WIN_SPKG([libxml2], [zlib])
305 GPG4WIN_SPKG([regex])
306 GPG4WIN_SPKG([crypt])
307 GPG4WIN_SPKG([claws-mail], [libiconv gettext zlib gtk+ libpng enchant glib dnl
308                             gpgme pthreads-w32 crypt regex libetpan gnutls])
309 GPG4WIN_SPKG([notification_plugin], [claws-mail])
310 GPG4WIN_SPKG([gtkhtml2_viewer], [curl claws-mail libxml2])
311 GPG4WIN_SPKG([vcalendar], [curl claws-mail])
312 GPG4WIN_SPKG([rssyl], [curl claws-mail])
313 GPG4WIN_SPKG([tnef_parse], [claws-mail])
314 GPG4WIN_SPKG([attachwarner], [claws-mail])
315 GPG4WIN_SPKG([bsfilter_plugin], [claws-mail])
316 GPG4WIN_IPKG([compendium])
317
318 # Qt related stuff.
319 GPG4WIN_BPKG_GNUWIN32([kdesupport])
320 GPG4WIN_BPKG_BINSRC([oxygen-icons])
321 GPG4WIN_BPKG_GNUWIN32([qt], [kdesupport])
322 GPG4WIN_BPKG_GNUWIN32([kdelibs], [qt oxygen-icons])
323 GPG4WIN_BPKG_BINSRC([kleopatra], [gpgme gnupg2 kdelibs])
324 #GPG4WIN_BPKG_GNUWIN32([kleopatra], [gpgme gnupg2 kdelibs])
325
326 GPG4WIN_FINALIZE
327
328 # Qt is compiled with -mthreads, and thus requires the mingwm10.dll.
329 mingwm_dll=no
330 AC_ARG_WITH([mingwm-dll],
331             AC_HELP_STRING([--with-mingwm-dll=FILE], [use the mingwm DLL]),
332             [mingwm_dll=$withval])
333 if test "$mingwm_dll" = "no"; then
334   file="/usr/share/doc/mingw32-runtime/mingwm10.dll.gz"
335   if test -r "$file"; then
336     mingwm_dll="$file"
337   fi
338 fi
339 if test "$mingwm_dll" = "no"; then
340   missing_tools="mingwm10.dll $missing_tools"
341 fi
342 # To make things simple, we just install a copy of the file in the
343 # source directory.  No need to make this ugly hack any uglier by
344 # messing around with the build system.
345 case "$mingwm_dll" in
346     *.gz)
347       $ZCAT $mingwm_dll > src/mingwm10.dll
348       ;;
349     *)
350       cp $mingwm_dll src/mingwm10.dll
351       ;;
352 esac
353
354
355 # Throw an error if required tools are missing
356 if test -n "$missing_tools"; then
357     for i in $missing_tools; do
358       AC_MSG_NOTICE([$i is missing])
359     done
360     AC_MSG_ERROR([[
361 ***
362 *** Required tools not found. Please consult the above messages
363 *** and install them before running configure again.
364 ***]])
365 fi
366
367 # Throw an error if any duplicate source packages have been found
368 if test -n "$gpg4win_dup_sources"; then
369     tmp=
370     for i in $gpg4win_dup_sources; do
371       tmp="$tmp
372 $i"
373     done
374     AC_MSG_ERROR([Packages with more that one source version:$tmp])
375 fi
376
377
378 # Finalize.
379
380 AC_CONFIG_COMMANDS([gpg4win-conf],[[
381 chmod +x patches/gnupg2/01-version.patch
382 ]])
383
384 AC_CONFIG_FILES(Makefile)
385 AC_CONFIG_FILES(packages/Makefile include/Makefile src/Makefile po/Makefile.in)
386 AC_CONFIG_FILES(include/config.nsi src/gpg4win.mk)
387 AC_CONFIG_FILES(doc/Makefile)
388 AC_CONFIG_FILES(doc/logo/Makefile)
389 AC_CONFIG_FILES(doc/manual/Makefile doc/manual/version.tex)
390 AC_CONFIG_FILES(doc/website/Makefile)
391 AC_CONFIG_FILES(src/dictionaries/Makefile)
392 AC_CONFIG_FILES(patches/gnupg2/01-version.patch)
393 AC_OUTPUT
394
395 # Throw a warning if optional tools are missing
396 if test -n "$missing_opt_tools"; then
397     AC_MSG_WARN([[
398 ***
399 *** Some tools not found.  They may or may not be needed depending on
400 *** the packages you want to include.  For example GLIB and GTK+
401 *** require certain tools; you may need to install a recent version of
402 *** GLIB and GTK+ on the build machine to allow for cross-compiling.
403 ***]])
404     for i in $missing_opt_tools; do
405       AC_MSG_NOTICE([$i is missing])
406     done
407 fi