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