1 |
# 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 |
AC_INIT(WinPT, 0.11.7-cvs, http://www.winpt.org) |
19 |
NEED_GPG_VERSION=1.4.2 |
20 |
NEED_GPGME_API=1 |
21 |
NEED_GPGME_VERSION=1.1.1 |
22 |
NEED_GPG_ERROR_VERSION=1.2 |
23 |
|
24 |
PACKAGE=$PACKAGE_NAME |
25 |
PACKAGE_GT=${PACKAGE_NAME} |
26 |
VERSION=$PACKAGE_VERSION |
27 |
|
28 |
AC_CONFIG_SRCDIR(Src/WinPT.cpp) |
29 |
AM_CONFIG_HEADER(config.h) |
30 |
AC_CANONICAL_TARGET() |
31 |
AM_INIT_AUTOMAKE |
32 |
AM_MKINSTALLDIRS |
33 |
|
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 |
AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION", |
48 |
[Required version of GnuPG]) |
49 |
|
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 |
# 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 |
|
68 |
|
69 |
AH_BOTTOM([ |
70 |
/* Some global constants. */ |
71 |
|
72 |
/* 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 |
#define _WIN32_IE IE401 |
77 |
]) |
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 |
|
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 |
# There is something wrong with the NLS checking here. We force using it. |
144 |
USE_NLS=yes |
145 |
|
146 |
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 |
#W32LIBS="-lwsock32" |
189 |
W32LIBS="-lws2_32" |
190 |
fi |
191 |
|
192 |
if test "$GCC" = yes; then |
193 |
CFLAGS="$CFLAGS -Wall -mms-bitfields" |
194 |
CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields" |
195 |
if test "$USE_MAINTAINER_MODE" = "yes"; then |
196 |
CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes" |
197 |
CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security" |
198 |
CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow" |
199 |
CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security" |
200 |
fi |
201 |
fi |
202 |
|
203 |
AC_SUBST(W32LIBS) |
204 |
|
205 |
|
206 |
|
207 |
# |
208 |
# Print errors here so that they are visible all |
209 |
# together and the user can acquire them all together. |
210 |
# |
211 |
die=no |
212 |
if test "$have_gpgme" = "no"; then |
213 |
die=yes |
214 |
AC_MSG_NOTICE([[ |
215 |
*** |
216 |
*** You need gpgme to build this program. |
217 |
** This library is for example available at |
218 |
*** ftp://ftp.gnupg.org/gcrypt/gpgme/ |
219 |
*** (at least version $NEED_GPGME_VERSION is required.) |
220 |
***]]) |
221 |
fi |
222 |
if test "$have_gpg_error" = "no"; then |
223 |
die=yes |
224 |
AC_MSG_NOTICE([[ |
225 |
*** |
226 |
*** You need libgpg-error to build this program. |
227 |
** This library is for example available at |
228 |
*** ftp://ftp.gnupg.org/gcrypt/libgpg-error |
229 |
*** (at least version $NEED_GPG_ERROR_VERSION is required.) |
230 |
***]]) |
231 |
fi |
232 |
if test "$die" = "yes"; then |
233 |
AC_MSG_ERROR([[ |
234 |
*** |
235 |
*** Required libraries not found. Please consult the above messages |
236 |
*** and install them before running configure again. |
237 |
***]]) |
238 |
fi |
239 |
|
240 |
|
241 |
AC_CONFIG_FILES([ Makefile |
242 |
PTD/Makefile |
243 |
PTD/versioninfo.rc |
244 |
Src/Makefile |
245 |
Src/versioninfo.rc |
246 |
Include/Makefile |
247 |
icons/Makefile |
248 |
m4/Makefile |
249 |
Gnupg/Makefile |
250 |
Po/Makefile.in |
251 |
]) |
252 |
AC_OUTPUT |