0c891019d37cceca2ee674acd27c96b969c3110d
[gpg4win.git] / configure.ac
1 # configure.ac for GPG4Win
2 # Copyright (C) 2005, 2006, 2007 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, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19  
20 # (Process this file with autoconf to produce a configure script.)
21
22 AC_PREREQ(2.59)
23 min_automake_version="1.9.3"
24
25 # Remember to change the version number immediately *after* a release.
26 # Set my_issvn to "yes" for non-released code.  Remember to run an
27 # "svn up" and "autogen.sh" right before creating a distribution.
28 # Right after a release the make target "copy-news" is to be called!
29 m4_define([my_version], [1.9.0])
30 m4_define([my_issvn], [yes])
31
32 m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
33           ||echo 'Revision: 0')|sed -n '/^Revision:/ s/[^0-9]//gp'|head -1)]))
34 AC_INIT([gpg4win], 
35         [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
36         [gpg4win-devel@wald.intevation.org])
37
38 # Remember to update these version numbers also in the NEWS file.
39 MANUALVERSION_EINSTEIGER="2.0.2"
40 MANUALDATE_EINSTEIGER="30. Mai 2006"
41 MANUALVERSION_DURCHBLICKER="2.0.2"
42 MANUALDATE_DURCHBLICKER="30. Mai 2006"
43 MANUALVERSION_NOVICES="1.0.0"
44 MANUALDATE_NOVICES="Nov. 30, 2006"
45 MANUALVERSION_ADVANCED="0.0.0"
46 MANUALDATE_ADVANCED="Nov. 30, 2006"
47
48
49 MANUALINPROGRESS_DE=m4_if(my_issvn,[yes],["~und evtl. seitdem weiter bearbeitet"])
50 MANUALINPROGRESS_EN=m4_if(my_issvn,[yes],["~and may have been further edited"])
51 SVN_REVISION=svn_revision
52 PACKAGE=$PACKAGE_NAME
53 VERSION=$PACKAGE_VERSION
54
55
56 AC_CONFIG_SRCDIR(include/config.nsi.in)
57 AC_CONFIG_MACRO_DIR(m4)
58
59 AM_INIT_AUTOMAKE
60 AM_MAINTAINER_MODE
61 AC_CANONICAL_HOST
62 AM_CONFIG_HEADER(config.h)
63
64 # Language support
65 AM_PO_SUBDIRS
66
67
68 AC_SUBST(PACKAGE)
69 AC_SUBST(VERSION)
70 AC_SUBST(MANUALVERSION_EINSTEIGER)
71 AC_SUBST(MANUALDATE_EINSTEIGER)
72 AC_SUBST(MANUALVERSION_DURCHBLICKER)
73 AC_SUBST(MANUALDATE_DURCHBLICKER)
74 AC_SUBST(MANUALINPROGRESS_DE)
75 AC_SUBST(MANUALVERSION_NOVICES)
76 AC_SUBST(MANUALDATE_NOVICES)
77 AC_SUBST(MANUALVERSION_ADVANCED)
78 AC_SUBST(MANUALDATE_ADVANCED)
79 AC_SUBST(MANUALINPROGRESS_EN)
80
81
82 # Generate extended version information.  Note, that for NSIS use we
83 # must not translate the dots to commas in the BUILD_FILEVERSION.
84 BUILD_TIMESTAMP=`date --iso-8601=minutes`
85 BUILD_ISODATE=`date --iso-8601`
86 changequote(,)dnl
87 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
88 changequote([,])dnl
89 BUILD_FILEVERSION="${BUILD_FILEVERSION}${SVN_REVISION}"
90 AC_SUBST(BUILD_TIMESTAMP)
91 AC_SUBST(BUILD_ISODATE)
92 AC_SUBST(BUILD_FILEVERSION)
93
94
95 # To test tye manuals using an actual web server, the preview target
96 # may be used in doc/manuals.  The default is my (wk) test environment
97 # but may be overriden using another preview variable.  PREVIEWHOST is
98 # expected to be the target for an rsync command.
99 if test -z "$PREVIEWHOST" ; then
100    PREVIEWHOST="vigenere:/var/www/all/preview.gpg4win.org/htdocs/"
101 fi
102 AC_SUBST(PREVIEWHOST)
103
104
105 # For development of this package it is useful to build without
106 # creating the source installer (takes a long time).  This option may
107 # be used to suppress creation of the source installer.
108 AC_ARG_ENABLE(source-installer,
109     AC_HELP_STRING([--disable-source-installer],
110                    [Do not create the Source installer]),
111                     build_source_installer=$enableval,
112                     build_source_installer=yes)
113 AC_MSG_RESULT($source_installer)
114 AM_CONDITIONAL(BUILD_SOURCE_INSTALLER, test "$build_source_installer" = yes)
115
116
117 # You can build a light version of the installer in addition to the
118 # regular version.  This one does not contain the manuals.
119 AC_ARG_ENABLE(light-installer,
120     AC_HELP_STRING([--disable-light-installer],
121                    [Do not create the light version of the installer]),
122                     build_light_installer=$enableval,
123                     build_light_installer=yes)
124 AC_MSG_RESULT($light_installer)
125 AM_CONDITIONAL(BUILD_LIGHT_INSTALLER, test "$build_light_installer" = yes)
126
127
128 # Required tools.
129 AC_PROG_CC
130 AC_PROG_CPP
131 AC_PROG_RANLIB
132 AC_CHECK_TOOL(AR, ar, :)
133 AC_CHECK_TOOLS(STRIP, strip)
134 AC_CHECK_TOOLS(DLLTOOL, dlltool)
135 AC_CHECK_PROGS(MAKE, make)
136 AC_CHECK_PROGS(UNZIP, unzip)
137 AC_CHECK_PROGS(TAR, tar)
138 AC_CHECK_PROGS(MKDIR, mkdir)
139 AC_CHECK_PROGS(CP, cp)
140 AC_CHECK_PROGS(RM, rm)
141 AC_CHECK_PROGS(STOW, stow)
142 AC_CHECK_PROGS(MAKENSIS, makensis)
143 AC_CHECK_PROGS(ZCAT, zcat)
144 AC_CHECK_PROGS(TEXI2DVI, texi2dvi)
145 AC_CHECK_PROGS(DVIPDF, dvipdf)
146 AC_CHECK_PROGS(CONVERT, convert)
147 AC_CHECK_PROGS(SHA1SUM, sha1sum)
148 AC_CHECK_PROGS(MSGFMT, msgfmt)
149 AC_PROG_INSTALL
150
151 missing_tools=
152 for i in DLLTOOL MAKE UNZIP TAR MKDIR CP RM STOW MAKENSIS ZCAT TEXI2DVI \
153          DVIPDF CONVERT SHA1SUM MSGFMT ; do
154    eval tmp='$'$i
155    if test -z "$tmp"; then 
156       missing_tools="$missing_tools `echo $i | tr 'A-Z' 'a-z'`"
157    fi
158 done
159
160
161 # Optional tools.
162
163 AC_CHECK_PROGS(WGET, wget)
164
165
166 # Packages.
167
168 GPG4WIN_BPKG_GNU([libiconv])
169 GPG4WIN_BPKG_GNU([gettext], [libiconv])
170
171 GPG4WIN_BPKG_GNUWIN32([zlib])
172 GPG4WIN_BPKG_GNUWIN32_LIB([crypt])
173 GPG4WIN_BPKG_GNUWIN32([regex])
174 GPG4WIN_BPKG_GNUWIN32([libpng], [pkgconfig])
175 GPG4WIN_BPKG_GNUWIN32([jpeg])
176
177 GPG4WIN_BPKG_GTK([pkgconfig])
178 # We build our own version of glib, because we need to apply a few patches.
179 # GPG4WIN_BPKG_GTK_DEV([glib], [pkgconfig])
180 GPG4WIN_SPKG([glib], [libiconv gettext pkgconfig])
181 GPG4WIN_BPKG_GTK_DEV([gtk+], [atk pango glib libiconv gettext pkgconfig cairo])
182 GPG4WIN_BPKG_GTK_DEV([atk], [glib pkgconfig])
183 GPG4WIN_BPKG_GTK_DEV([pango], [glib pkgconfig])
184 GPG4WIN_BPKG_GTK_DEV([cairo], [glib pkgconfig])
185
186 GPG4WIN_BPKG_BINSRC([GPGee], [gnupg])
187
188 GPG4WIN_SPKG([bzip2])
189 GPG4WIN_SPKG([libgpg-error], [libiconv gettext])
190 GPG4WIN_SPKG([libgcrypt], [libgpg-error])
191 GPG4WIN_SPKG([libksba], [libgpg-error])
192 GPG4WIN_SPKG([libassuan], [w32pth])
193 GPG4WIN_SPKG([dirmngr], [libgpg-error libgcrypt libassuan libksba])
194 GPG4WIN_SPKG([w32pth])
195 GPG4WIN_SPKG([pinentry], [libiconv gtk+])
196 GPG4WIN_SPKG([gpgme], [libgpg-error gnupg glib qt])
197 GPG4WIN_SPKG([gnupg], [libiconv bzip2])
198 GPG4WIN_SPKG([gnupg2], [libiconv libgcrypt libksba libassuan libgpg-error dnl
199                         w32pth zlib bzip2 pinentry])
200 GPG4WIN_SPKG([pthreads-w32])
201 GPG4WIN_SPKG([gpgol], [gpgme libassuan])
202 GPG4WIN_SPKG([gpgex], [libassuan])
203 GPG4WIN_SPKG([gpa], [libiconv gettext zlib gtk+ libpng glib gpgme])
204 GPG4WIN_SPKG([winpt], [gpgme gnupg])
205 GPG4WIN_SPKG([sylpheed-claws], [libiconv gettext zlib gtk+ libpng jpeg glib dnl
206                                 gpgme pthreads-w32 crypt regex])
207 GPG4WIN_SPKG([libetpan], [pthreads-w32])
208 GPG4WIN_SPKG([claws-mail], [libiconv gettext zlib gtk+ libpng jpeg glib dnl
209                             gpgme pthreads-w32 crypt regex libetpan])
210 # The Eudora license (the one for the EMS API) is still not acceptable.
211 #GPG4WIN_SPKG([eudoragpg])
212 GPG4WIN_IPKG([man_novice_de])
213 GPG4WIN_IPKG([man_advanced_de])
214 GPG4WIN_IPKG([man_novice_en])
215 #GPG4WIN_IPKG([man_advanced_en])
216
217 # Qt related stuff.
218 GPG4WIN_BPKG_GNUWIN32([kdesupport])
219 GPG4WIN_BPKG_GNUWIN32([qt], [kdesupport])
220 GPG4WIN_BPKG_BINSRC([oxygen-icons])
221 GPG4WIN_BPKG_GNUWIN32([kdelibs], [qt oxygen-icons])
222 GPG4WIN_BPKG_BINSRC([kleopatra], [gpgme gnupg gnupg2 kdelibs])
223
224 GPG4WIN_FINALIZE
225
226 # Qt is compiled with -mthreads, and thus requires the mingwm10.dll.
227 mingwm_dll=no
228 AC_ARG_WITH([mingwm-dll],
229             AC_HELP_STRING([--with-mingwm-dll=FILE], [use the mingwm DLL]),
230             [mingwm_dll=$withval])
231 if test "$mingwm_dll" = "no"; then
232   file="/usr/share/doc/mingw32-runtime/mingwm10.dll.gz"
233   if test -r "$file"; then
234     mingwm_dll="$file"
235   fi
236 fi
237 if test "$mingwm_dll" = "no"; then
238   missing_tools="mingwm10.dll $missing_tools"
239 fi
240 # To make things simple, we just install a copy of the file in the
241 # source directory.  No need to make this ugly hack any uglier by
242 # messing around with the build system.
243 case "$mingwm_dll" in
244     *.gz)
245       $ZCAT $mingwm_dll > src/mingwm10.dll
246       ;;
247     *)
248       cp $mingwm_dll src/mingwm10.dll
249       ;;
250 esac
251
252
253 # Throw an error if required tools are missing
254 if test -n "$missing_tools"; then
255     for i in $missing_tools; do 
256       AC_MSG_NOTICE([$i is missing])
257     done
258     AC_MSG_ERROR([[
259 ***
260 *** Required tools not found. Please consult the above messages
261 *** and install them before running configure again.
262 ***]])
263 fi
264
265
266 # Finalize.
267
268 AC_CONFIG_COMMANDS([gpg4win-conf],[[
269 chmod +x patches/gnupg2/01-version.patch
270 ]])
271
272 AC_CONFIG_FILES(Makefile)
273 AC_CONFIG_FILES(packages/Makefile include/Makefile src/Makefile po/Makefile.in)
274 AC_CONFIG_FILES(include/config.nsi src/gpg4win.mk)
275 AC_CONFIG_FILES(doc/Makefile)
276 AC_CONFIG_FILES(doc/logo/Makefile)
277 AC_CONFIG_FILES(doc/manual/Makefile doc/manual/version.tex)
278 AC_CONFIG_FILES(doc/website/Makefile)
279 AC_CONFIG_FILES(patches/gnupg2/01-version.patch)
280 AC_OUTPUT