1 |
werner |
36 |
# configure.ac - for WinPT |
2 |
twoaday |
256 |
# Copyright (C) 2005, 2006 g10 Code GmbH |
3 |
werner |
36 |
# |
4 |
|
|
# This file is free software; as a special exception the author gives |
5 |
|
|
# unlimited permission to copy and/or distribute it, with or without |
6 |
|
|
# modifications, as long as this notice is preserved. |
7 |
|
|
# |
8 |
|
|
# This program is distributed in the hope that it will be useful, but |
9 |
|
|
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
10 |
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11 |
|
|
|
12 |
|
|
# Process this file with autoconf to produce a configure script. |
13 |
|
|
AC_PREREQ(2.59) |
14 |
twoaday |
267 |
min_automake_version="1.9.2" |
15 |
werner |
36 |
|
16 |
|
|
# Version number: Remember to change it immediately *after* a release. |
17 |
|
|
# Add a "-cvs" prefix for non-released code. |
18 |
twoaday |
276 |
AC_INIT(WinPT, 1.2.1-cvs, http://wald.intevation.org/projects/winpt) |
19 |
twoaday |
273 |
NEED_GPG_VERSION=1.4.4 |
20 |
werner |
36 |
NEED_GPGME_API=1 |
21 |
werner |
132 |
NEED_GPGME_VERSION=1.1.1 |
22 |
werner |
36 |
NEED_GPG_ERROR_VERSION=1.2 |
23 |
|
|
|
24 |
|
|
PACKAGE=$PACKAGE_NAME |
25 |
|
|
PACKAGE_GT=${PACKAGE_NAME} |
26 |
|
|
VERSION=$PACKAGE_VERSION |
27 |
|
|
|
28 |
werner |
57 |
AC_CONFIG_SRCDIR(Src/WinPT.cpp) |
29 |
werner |
36 |
AM_CONFIG_HEADER(config.h) |
30 |
|
|
AC_CANONICAL_TARGET() |
31 |
werner |
63 |
AM_INIT_AUTOMAKE |
32 |
twoaday |
127 |
AM_MKINSTALLDIRS |
33 |
werner |
36 |
|
34 |
|
|
AC_GNU_SOURCE |
35 |
|
|
|
36 |
|
|
AC_SUBST(PACKAGE) |
37 |
|
|
AC_SUBST(PACKAGE_GT) |
38 |
|
|
AC_SUBST(VERSION) |
39 |
|
|
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) |
40 |
|
|
AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT", |
41 |
|
|
[Name of this package for gettext]) |
42 |
|
|
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) |
43 |
|
|
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT", |
44 |
|
|
[Bug report address]) |
45 |
|
|
AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION", |
46 |
|
|
[Required version of GPGME]) |
47 |
twoaday |
137 |
AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION", |
48 |
|
|
[Required version of GnuPG]) |
49 |
werner |
36 |
|
50 |
|
|
BUILD_TIMESTAMP=`date --iso-8601=minutes` |
51 |
|
|
AC_SUBST(BUILD_TIMESTAMP) |
52 |
|
|
changequote(,)dnl |
53 |
|
|
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1.0/;s/\./,/g'` |
54 |
|
|
changequote([,])dnl |
55 |
|
|
AC_SUBST(BUILD_FILEVERSION) |
56 |
|
|
|
57 |
werner |
62 |
# For the distcheck target of make we need to set a few options for |
58 |
|
|
# the cross compiling environment. We assume the same conevtion as |
59 |
|
|
# used in autogen.sh; i.e. we take the root from the $w32root variable |
60 |
|
|
# or default to ~/w32root. |
61 |
|
|
if test -n "$w32root"; then |
62 |
|
|
W32ROOT="$w32root" |
63 |
|
|
else |
64 |
|
|
W32ROOT="$HOME/w32root" |
65 |
|
|
fi |
66 |
|
|
AC_SUBST(W32ROOT) |
67 |
werner |
36 |
|
68 |
werner |
62 |
|
69 |
werner |
36 |
AH_BOTTOM([ |
70 |
|
|
/* Some global constants. */ |
71 |
|
|
|
72 |
werner |
48 |
/* We need to include this header to be able to include specific parts |
73 |
|
|
of the header files. For now we require at least Internet Exploder |
74 |
|
|
4.01 to be installed. */ |
75 |
|
|
#include <w32api.h> |
76 |
twoaday |
256 |
#define _WIN32_IE IE55 |
77 |
werner |
36 |
]) |
78 |
|
|
|
79 |
|
|
AM_MAINTAINER_MODE |
80 |
|
|
|
81 |
|
|
# Checks for programs. |
82 |
|
|
AC_PROG_MAKE_SET |
83 |
|
|
AM_SANITY_CHECK |
84 |
|
|
missing_dir=`cd $ac_aux_dir && pwd` |
85 |
|
|
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
86 |
|
|
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
87 |
|
|
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
88 |
|
|
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
89 |
|
|
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
90 |
|
|
AC_PROG_AWK |
91 |
|
|
AC_PROG_CC |
92 |
|
|
AC_PROG_CPP |
93 |
|
|
AC_PROG_CXX |
94 |
|
|
AC_PROG_INSTALL |
95 |
|
|
AC_PROG_LN_S |
96 |
|
|
AC_PROG_MAKE_SET |
97 |
|
|
AC_PROG_RANLIB |
98 |
|
|
AC_CHECK_TOOL(AR, ar, :) |
99 |
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, :) |
100 |
|
|
AC_CHECK_TOOL(WINDRES, windres, :) |
101 |
|
|
|
102 |
|
|
try_gettext=yes |
103 |
|
|
have_dosish_system=no |
104 |
|
|
have_w32_system=no |
105 |
|
|
case "${host}" in |
106 |
|
|
*-mingw32*) |
107 |
|
|
# special stuff for Windoze NT |
108 |
|
|
ac_cv_have_dev_random=no |
109 |
|
|
AC_DEFINE(USE_ONLY_8DOT3,1, |
110 |
|
|
[set this to limit filenames to the 8.3 format]) |
111 |
|
|
AC_DEFINE(HAVE_DRIVE_LETTERS,1, |
112 |
|
|
[defined if we must run on a stupid file system]) |
113 |
|
|
AC_DEFINE(USE_SIMPLE_GETTEXT,1, |
114 |
|
|
[because the Unix gettext has too much overhead on |
115 |
|
|
MingW32 systems and these systems lack Posix functions, |
116 |
|
|
we use a simplified version of gettext]) |
117 |
|
|
have_dosish_system=yes |
118 |
|
|
have_w32_system=yes |
119 |
|
|
try_gettext="no" |
120 |
|
|
;; |
121 |
|
|
*) |
122 |
|
|
AC_MSG_ERROR([[ |
123 |
|
|
*** |
124 |
|
|
*** This software my only be build for W32 systems. Use |
125 |
|
|
*** ./autogen.sh --build-w32 |
126 |
|
|
*** to prepare it for such a build. |
127 |
|
|
***]]) |
128 |
|
|
;; |
129 |
|
|
esac |
130 |
|
|
|
131 |
twoaday |
126 |
|
132 |
|
|
AH_BOTTOM([ |
133 |
|
|
/* Force using of NLS for W32 even if no libintl has been found. This is |
134 |
|
|
okay because we have our own gettext implementation for W32. */ |
135 |
|
|
#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS) |
136 |
|
|
#define ENABLE_NLS 1 |
137 |
|
|
#endif |
138 |
|
|
]) |
139 |
|
|
|
140 |
|
|
# Note, that autogen.sh greps for the next line. |
141 |
|
|
AM_GNU_GETTEXT_VERSION(0.12.1) |
142 |
|
|
AM_GNU_GETTEXT([external]) |
143 |
werner |
132 |
# There is something wrong with the NLS checking here. We force using it. |
144 |
|
|
USE_NLS=yes |
145 |
twoaday |
126 |
|
146 |
werner |
36 |
if test "$have_dosish_system" = yes; then |
147 |
|
|
AC_DEFINE(HAVE_DOSISH_SYSTEM,1, |
148 |
|
|
[Defined if we run on some of the PCDOS like systems |
149 |
|
|
(DOS, Windoze. OS/2) with special properties like |
150 |
|
|
no file modes]) |
151 |
|
|
fi |
152 |
|
|
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) |
153 |
|
|
|
154 |
|
|
if test "$have_w32_system" = yes; then |
155 |
|
|
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) |
156 |
|
|
fi |
157 |
|
|
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) |
158 |
|
|
|
159 |
|
|
|
160 |
|
|
|
161 |
|
|
# |
162 |
|
|
# Checks for libraries. |
163 |
|
|
# |
164 |
|
|
|
165 |
|
|
|
166 |
|
|
AM_PATH_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION", |
167 |
|
|
have_gpgme=yes,have_gpgme=no) |
168 |
|
|
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION", |
169 |
|
|
have_gpg_error=yes,have_gpg_error=no) |
170 |
|
|
|
171 |
|
|
# Checks for header files. |
172 |
|
|
AC_HEADER_STDC |
173 |
|
|
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h) |
174 |
|
|
|
175 |
|
|
AC_CHECK_FUNCS(stpcpy) |
176 |
|
|
|
177 |
|
|
# Checks for typedefs, structures, and compiler characteristics. |
178 |
|
|
AC_C_CONST |
179 |
|
|
AC_C_INLINE |
180 |
|
|
AC_TYPE_SIZE_T |
181 |
|
|
AC_TYPE_SIGNAL |
182 |
|
|
|
183 |
|
|
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) |
184 |
|
|
|
185 |
|
|
# Add some extra libs here so that previous tests don't fail for |
186 |
|
|
# mysterious reasons - the final link step should bail out. |
187 |
|
|
if test "$have_w32_system" = yes; then |
188 |
twoaday |
163 |
W32LIBS="-lws2_32" |
189 |
werner |
36 |
fi |
190 |
|
|
|
191 |
|
|
if test "$GCC" = yes; then |
192 |
|
|
CFLAGS="$CFLAGS -Wall -mms-bitfields" |
193 |
|
|
CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields" |
194 |
|
|
if test "$USE_MAINTAINER_MODE" = "yes"; then |
195 |
|
|
CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes" |
196 |
|
|
CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security" |
197 |
|
|
CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow" |
198 |
|
|
CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security" |
199 |
|
|
fi |
200 |
|
|
fi |
201 |
|
|
|
202 |
|
|
AC_SUBST(W32LIBS) |
203 |
|
|
|
204 |
|
|
|
205 |
|
|
|
206 |
|
|
# |
207 |
|
|
# Print errors here so that they are visible all |
208 |
|
|
# together and the user can acquire them all together. |
209 |
|
|
# |
210 |
|
|
die=no |
211 |
|
|
if test "$have_gpgme" = "no"; then |
212 |
|
|
die=yes |
213 |
|
|
AC_MSG_NOTICE([[ |
214 |
|
|
*** |
215 |
|
|
*** You need gpgme to build this program. |
216 |
|
|
** This library is for example available at |
217 |
|
|
*** ftp://ftp.gnupg.org/gcrypt/gpgme/ |
218 |
|
|
*** (at least version $NEED_GPGME_VERSION is required.) |
219 |
|
|
***]]) |
220 |
|
|
fi |
221 |
|
|
if test "$have_gpg_error" = "no"; then |
222 |
|
|
die=yes |
223 |
|
|
AC_MSG_NOTICE([[ |
224 |
|
|
*** |
225 |
|
|
*** You need libgpg-error to build this program. |
226 |
|
|
** This library is for example available at |
227 |
|
|
*** ftp://ftp.gnupg.org/gcrypt/libgpg-error |
228 |
|
|
*** (at least version $NEED_GPG_ERROR_VERSION is required.) |
229 |
|
|
***]]) |
230 |
|
|
fi |
231 |
|
|
if test "$die" = "yes"; then |
232 |
|
|
AC_MSG_ERROR([[ |
233 |
|
|
*** |
234 |
|
|
*** Required libraries not found. Please consult the above messages |
235 |
|
|
*** and install them before running configure again. |
236 |
|
|
***]]) |
237 |
|
|
fi |
238 |
|
|
|
239 |
|
|
|
240 |
|
|
AC_CONFIG_FILES([ Makefile |
241 |
werner |
46 |
PTD/Makefile |
242 |
twoaday |
198 |
PTD/versioninfo.rc |
243 |
werner |
46 |
Src/Makefile |
244 |
twoaday |
198 |
Src/versioninfo.rc |
245 |
werner |
46 |
Include/Makefile |
246 |
werner |
62 |
icons/Makefile |
247 |
werner |
46 |
m4/Makefile |
248 |
|
|
Gnupg/Makefile |
249 |
twoaday |
126 |
Po/Makefile.in |
250 |
werner |
36 |
]) |
251 |
|
|
AC_OUTPUT |