-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac.template
369 lines (322 loc) · 10.3 KB
/
configure.ac.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# configure.ac - Windows Installer for Claws Mail
# Copyright (C) 2005, 2006, 2007, 2008, 2010 g10 Code GmbH
# Copyright (C) 2015, 2016 the Claws Mail team
#
# This file is part of Claws-Mail.
#
# Claws Mail is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Claws Mail is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
# (Process this file with autoconf to produce a configure script.)
AC_PREREQ(2.59)
min_automake_version="1.9.3"
# This version is here mostly for 'make dist', actual Claws Mail
# version is controlled by what is in packages/
m4_define([my_version], [3.17.8])
m4_define([my_release], [1])
m4_define([my_gitrev], [])
AC_INIT([Claws Mail Win32],
[my_version]-[my_release],[[email protected]])
PACKAGE=$PACKAGE_NAME
VERSION=$PACKAGE_VERSION
VERSION_NO_REL=my_version
REL=my_release
GIT_REVISION=my_gitrev
AC_CONFIG_SRCDIR(src/config.nsi.in)
AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE([tar-ustar])
AM_MAINTAINER_MODE
AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)
# Language support
AM_PO_SUBDIRS
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(VERSION_NO_REL)
AC_SUBST(GIT_REVISION)
AC_SUBST(REL)
if echo "${PACKAGE_VERSION}" | egrep 'svn|rc|beta|git' >/dev/null ; then
IS_BETA_BUILD=yes
else
IS_BETA_BUILD=no
fi
AC_SUBST(IS_BETA_BUILD)
# Generate extended version information. Note, that for NSIS use we
# must not translate the dots to commas in the BUILD_FILEVERSION.
BUILD_TIMESTAMP=`date --iso-8601=minutes`
BUILD_ISODATE=`date --iso-8601`
dnl changequote(,)dnl
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/-beta/./'`
AC_SUBST(BUILD_TIMESTAMP)
AC_SUBST(BUILD_ISODATE)
AC_SUBST(BUILD_FILEVERSION)
# For development of this package it is useful to build without
# creating the source installer (takes a long time). This option may
# be used to suppress creation of the source installer.
AC_ARG_ENABLE(source-installer,
AC_HELP_STRING([--disable-source-installer],
[Do not create the Source installer]),
build_source_installer=$enableval,
build_source_installer=yes)
AM_CONDITIONAL(BUILD_SOURCE_INSTALLER, test "$build_source_installer" = yes)
AC_ARG_ENABLE(fast-makensis,
AC_HELP_STRING([--enable-fast-makensis],
[Use a less efficient compressor to speed up building]),
use_fast_makensis=$enableval,
use_fast_makensis=no)
if test "$use_fast_makensis" = yes; then
EXTRA_MAKENSIS_FLAGS="${EXTRA_MAKENSIS_FLAGS} -DDISABLE_LZMA=1"
fi
AC_SUBST(EXTRA_MAKENSIS_FLAGS)
CM_DEFAULT_CFLAGS="-O2 -pipe -ggdb -mms-bitfields"
CM_DEFAULT_CXXFLAGS="${CM_DEFAULT_CFLAGS}"
AC_SUBST(CM_DEFAULT_CFLAGS)
AC_SUBST(CM_DEFAULT_CXXFLAGS)
# Required tools.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar, :)
AC_CHECK_TOOLS(STRIP, strip)
AC_CHECK_TOOLS(OBJCOPY, objcopy)
AC_CHECK_TOOLS(DLLTOOL, dlltool)
AC_CHECK_PROGS(MAKE, make)
AC_CHECK_PROGS(UNZIP, unzip)
AC_CHECK_PROGS(TAR, tar)
AC_CHECK_PROGS(MKDIR, mkdir)
AC_CHECK_PROGS(CP, cp)
AC_CHECK_PROGS(RM, rm)
AC_CHECK_PROGS(BISON, bison)
AC_CHECK_PROGS(FLEX, flex)
AC_CHECK_PROGS(PKG_CONFIG, pkg-config)
AC_CHECK_PROGS(GPERF, gperf)
AC_CHECK_PROGS(INTLTOOL_MERGE, intltool-merge)
AC_CHECK_PROGS(STOW, stow)
AC_CHECK_PROGS(MAKENSIS, makensis)
AC_CHECK_PROGS(ZCAT, zcat)
AC_CHECK_PROGS(TEXI2DVI, texi2dvi)
AC_CHECK_PROGS(DVIPDF, dvipdf)
AC_CHECK_PROGS(CONVERT, convert)
AC_CHECK_PROGS(SHA256SUM, sha256sum)
AC_CHECK_PROGS(MSGFMT, msgfmt)
AC_CHECK_PROGS(BUILD_CC, gcc cc)
AC_CHECK_PROGS(CMAKE, cmake)
AC_CHECK_PROGS(MESON, meson)
AC_CHECK_PROGS(NINJA, ninja)
AC_PROG_INSTALL
missing_tools=
for i in DLLTOOL MAKE UNZIP TAR MKDIR CP RM BISON FLEX PKG_CONFIG GPERF \
INTLTOOL_MERGE STOW MAKENSIS ZCAT TEXI2DVI DVIPDF CONVERT SHA256SUM MSGFMT \
BUILD_CC CMAKE MESON NINJA; do
eval tmp='$'$i
if test -z "$tmp"; then
missing_tools="$missing_tools `echo $i | tr 'A-Z' 'a-z'`"
fi
done
# This only works on Linux, obviously...
if test -f /proc/cpuinfo; then
NUMPROC=`grep -c processor /proc/cpuinfo`
else
NUMPROC=1
fi
AC_SUBST(NUMPROC)
changequote(,)dnl
gcc_major_minor=$($CC --version \
| awk 'NR==1 {split($3,a,"-"); split(a[1],b,"."); print b[1] "." b[2]}')
changequote([,])dnl
missing_opt_tools=""
have_libgcc_dll=no
if test "$have_libgcc_dll" = "no"; then
if test "$host" = "i686-w64-mingw32"; then
dllfile="libgcc_s_sjlj-1.dll"
elif test "$host" = "x86_64-w64-mingw32"; then
dllfile="libgcc_s_seh-1.dll"
fi
file="/usr/lib/gcc/$host/${gcc_major_minor}-win32/${dllfile}"
if test -r "$file"; then
libgcc_dll_path="$file"
libgcc_dll=$(basename "$file")
have_libgcc_dll=yes
fi
fi
if test "$have_libgcc_dll" = "no"; then
missing_opt_tools="$libgcc_dll $missing_opt_tools"
else
if test -r "$libgcc_dll_path"; then
cp $libgcc_dll_path src/${libgcc_dll}-x
else
missing_opt_tools="$libgcc_dll $missing_opt_tools"
fi
fi
libstdcpp_dll=no
AC_ARG_WITH([libstdc++-6-dll],
AC_HELP_STRING([--with-libstdc++-6-dll=FILE],
[use the libstd++-6 DLL]),
[libstdcpp_dll=$withval])
if test "$libstdcpp_dll" = "no"; then
file="/usr/lib/gcc/$host/${gcc_major_minor}-win32/libstdc++-6.dll"
if test -r "$file"; then
libstdcpp_dll="$file"
fi
fi
if test "$libstdcpp_dll" = "no"; then
missing_opt_tools="libstdc++-6.dll $missing_opt_tools"
else
if test -r "$libstdcpp_dll"; then
cp $libstdcpp_dll src/libstdc++-6.dll-x
else
missing_opt_tools="libstdc++-6.dll $missing_opt_tools"
fi
fi
libwinpthread_dll=no
AC_ARG_WITH([libwinpthread-1-dll],
AC_HELP_STRING([--with-libwinpthread-1-dll=FILE],
[use the libwinpthread-1 DLL]),
[libwinpthread_dll=$withval])
if test "$libwinpthread_dll" = "no"; then
file="/usr/$host/lib/libwinpthread-1.dll"
if test -r "$file"; then
libwinpthread_dll="$file"
fi
fi
if test "$libwinpthread_dll" = "no"; then
missing_opt_tools="libwinpthread-1.dll $missing_opt_tools"
else
if test -r "$libwinpthread_dll"; then
cp $libwinpthread_dll src/libwinpthread-1.dll-x
else
missing_opt_tools="libwinpthread-1.dll $missing_opt_tools"
fi
fi
# Set variables based on arch
if test "$host" = "i686-w64-mingw32"; then
gpg_dll_num=""
w64="no"
meson_cpu_family="x86"
elif test "$host" = "x86_64-w64-mingw32"; then
gpg_dll_num="6"
w64="yes"
meson_cpu_family="x86_64"
fi
AC_SUBST(gpg_dll_num)
AC_SUBST(libgcc_dll)
AC_SUBST(w64)
AC_SUBST(host)
AC_SUBST(host_cpu)
AC_SUBST(meson_cpu_family)
# For the manual we need:
AC_CHECK_PROGS(DOCBOOK2HTML, docbook2html)
AC_CHECK_PROGS(DOCBOOK2TXT, docbook2txt)
AC_CHECK_PROGS(DOCBOOK2PS, docbook2ps)
AC_CHECK_PROGS(DOCBOOK2PDF, docbook2pdf)
# Optional tools.
AC_CHECK_PROGS(WGET, wget)
# Packages.
cm_dup_sources=""
CM_SPKG([zlib])
CM_SPKG([bzip2])
CM_SPKG([w32pth])
CM_SPKG([jpeg])
CM_SPKG([gmp])
CM_SPKG([regex])
CM_SPKG([fribidi])
CM_SPKG([hunspell])
CM_SPKG([libiconv])
CM_SPKG([gettext], [libiconv])
CM_SPKG([libffi])
CM_SPKG([glib], [libiconv gettext libffi zlib])
CM_SPKG([expat])
CM_SPKG([pixman], [libpng])
CM_SPKG([cairo], [zlib libpng glib])
CM_SPKG([atk], [glib])
CM_SPKG([libxml2], [zlib])
CM_SPKG([libxslt], [libxml2])
CM_SPKG([fontconfig], [zlib expat freetype libiconv libxml2])
CM_SPKG([freetype], [zlib bzip2])
CM_SPKG([gdk-pixbuf], [glib])
CM_SPKG([libpng], [zlib])
CM_SPKG([enchant], [glib hunspell])
CM_SPKG([libgpg-error], [libiconv gettext])
CM_SPKG([libassuan], [libgpg-error w32pth])
CM_SPKG([gpgme], [libgpg-error libassuan glib])
CM_SPKG([libtasn1])
CM_SPKG([nettle], [gmp])
CM_SPKG([gnutls], [gmp nettle libtasn1])
CM_SPKG([glib-networking], [glib gnutls])
CM_SPKG([sqlite-autoconf])
CM_SPKG([libpsl], [icu4c])
CM_SPKG([libsoup], [gnutls libxml2 glib-networking sqlite-autoconf libpsl])
CM_SPKG([libwebp], [zlib libpng jpeg])
CM_SPKG([icu4c])
CM_SPKG([harfbuzz], [glib cairo icu4c])
CM_SPKG([pango], [harfbuzz fontconfig glib cairo fribidi])
CM_SPKG([gtk+], [libiconv gettext atk pango glib gdk-pixbuf cairo])
CM_SPKG([webkitgtk], [jpeg libpng glib gtk+ libsoup libxml2 libxslt libwebp icu4c harfbuzz])
CM_SPKG([curl], [zlib gnutls])
CM_SPKG([cyrus-sasl])
CM_SPKG([libetpan], [gnutls cyrus-sasl])
CM_BPKG_GNUWIN32([bsfilter])
CM_SPKG([libical])
CM_SPKG([ytnef])
CM_SPKG([gumbo-parser])
CM_SPKG([claws-mail], [libiconv gettext zlib gtk+ libpng enchant glib dnl
gpgme regex libetpan gnutls ytnef gumbo-parser dnl
libxml2 expat webkitgtk curl libical nettle])
CM_FINALIZE
# Throw an error if required tools are missing
if test -n "$missing_tools"; then
for i in $missing_tools; do
AC_MSG_NOTICE([$i is missing])
done
AC_MSG_ERROR([[
***
*** Required tools not found. Please consult the above messages
*** and install them before running configure again.
***]])
fi
# Throw an error if any duplicate source packages have been found
if test -n "$cm_dup_sources"; then
tmp=
for i in $cm_dup_sources; do
tmp="$tmp
$i"
done
AC_MSG_ERROR([Packages with more that one source version:$tmp])
fi
# Finalize.
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(packages/Makefile src/Makefile po/Makefile.in)
AC_CONFIG_FILES(src/Toolchain-mingw32.cmake)
AC_CONFIG_FILES(src/meson-cross.txt)
AC_CONFIG_FILES(po/build-cc)
AC_CONFIG_FILES(src/config.nsi src/claws-mail.mk)
AC_CONFIG_FILES(doc/Makefile)
AC_CONFIG_FILES(doc/logo/Makefile)
AC_CONFIG_FILES(src/dictionaries/Makefile)
AC_OUTPUT
# Throw a warning if optional tools are missing
if test -n "$missing_opt_tools"; then
AC_MSG_WARN([[
***
*** Some tools not found. They may or may not be needed depending on
*** the packages you want to include. For example GLIB and GTK+
*** require certain tools; you may need to install a recent version of
*** GLIB and GTK+ on the build machine to allow for cross-compiling.
***]])
for i in $missing_opt_tools; do
AC_MSG_NOTICE([$i is missing])
done
fi
echo "
${PACKAGE_NAME} ${VERSION_NO_REL}${GIT_REVISION}-${REL} prepared for make
Platform: $host
"