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