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.5-cvs, http://www.winpt.org) |
19 |
NEED_GPGME_API=1 |
20 |
NEED_GPGME_VERSION=1.1.1 |
21 |
NEED_GPG_ERROR_VERSION=1.2 |
22 |
|
23 |
PACKAGE=$PACKAGE_NAME |
24 |
PACKAGE_GT=${PACKAGE_NAME} |
25 |
VERSION=$PACKAGE_VERSION |
26 |
|
27 |
AC_CONFIG_SRCDIR(Src/WinPT.cpp) |
28 |
AM_CONFIG_HEADER(config.h) |
29 |
AC_CANONICAL_TARGET() |
30 |
AM_INIT_AUTOMAKE |
31 |
AM_MKINSTALLDIRS |
32 |
|
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 |
# 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 |
|
65 |
|
66 |
AH_BOTTOM([ |
67 |
/* Some global constants. */ |
68 |
|
69 |
/* We need to include this header to be able to include specific parts |
70 |
of the header files. For now we require at least Internet Exploder |
71 |
4.01 to be installed. */ |
72 |
#include <w32api.h> |
73 |
#define _WIN32_IE IE401 |
74 |
]) |
75 |
|
76 |
AM_MAINTAINER_MODE |
77 |
|
78 |
# Checks for programs. |
79 |
AC_PROG_MAKE_SET |
80 |
AM_SANITY_CHECK |
81 |
missing_dir=`cd $ac_aux_dir && pwd` |
82 |
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
83 |
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
84 |
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
85 |
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
86 |
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
87 |
AC_PROG_AWK |
88 |
AC_PROG_CC |
89 |
AC_PROG_CPP |
90 |
AC_PROG_CXX |
91 |
AC_PROG_INSTALL |
92 |
AC_PROG_LN_S |
93 |
AC_PROG_MAKE_SET |
94 |
AC_PROG_RANLIB |
95 |
AC_CHECK_TOOL(AR, ar, :) |
96 |
AC_CHECK_TOOL(DLLTOOL, dlltool, :) |
97 |
AC_CHECK_TOOL(WINDRES, windres, :) |
98 |
|
99 |
try_gettext=yes |
100 |
have_dosish_system=no |
101 |
have_w32_system=no |
102 |
case "${host}" in |
103 |
*-mingw32*) |
104 |
# special stuff for Windoze NT |
105 |
ac_cv_have_dev_random=no |
106 |
AC_DEFINE(USE_ONLY_8DOT3,1, |
107 |
[set this to limit filenames to the 8.3 format]) |
108 |
AC_DEFINE(HAVE_DRIVE_LETTERS,1, |
109 |
[defined if we must run on a stupid file system]) |
110 |
AC_DEFINE(USE_SIMPLE_GETTEXT,1, |
111 |
[because the Unix gettext has too much overhead on |
112 |
MingW32 systems and these systems lack Posix functions, |
113 |
we use a simplified version of gettext]) |
114 |
have_dosish_system=yes |
115 |
have_w32_system=yes |
116 |
try_gettext="no" |
117 |
;; |
118 |
*) |
119 |
AC_MSG_ERROR([[ |
120 |
*** |
121 |
*** This software my only be build for W32 systems. Use |
122 |
*** ./autogen.sh --build-w32 |
123 |
*** to prepare it for such a build. |
124 |
***]]) |
125 |
;; |
126 |
esac |
127 |
|
128 |
|
129 |
AH_BOTTOM([ |
130 |
/* Force using of NLS for W32 even if no libintl has been found. This is |
131 |
okay because we have our own gettext implementation for W32. */ |
132 |
#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS) |
133 |
#define ENABLE_NLS 1 |
134 |
#endif |
135 |
]) |
136 |
|
137 |
# Note, that autogen.sh greps for the next line. |
138 |
AM_GNU_GETTEXT_VERSION(0.12.1) |
139 |
AM_GNU_GETTEXT([external]) |
140 |
# There is something wrong with the NLS checking here. We force using it. |
141 |
USE_NLS=yes |
142 |
|
143 |
if test "$have_dosish_system" = yes; then |
144 |
AC_DEFINE(HAVE_DOSISH_SYSTEM,1, |
145 |
[Defined if we run on some of the PCDOS like systems |
146 |
(DOS, Windoze. OS/2) with special properties like |
147 |
no file modes]) |
148 |
fi |
149 |
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) |
150 |
|
151 |
if test "$have_w32_system" = yes; then |
152 |
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) |
153 |
fi |
154 |
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) |
155 |
|
156 |
|
157 |
|
158 |
# |
159 |
# Checks for libraries. |
160 |
# |
161 |
|
162 |
|
163 |
AM_PATH_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION", |
164 |
have_gpgme=yes,have_gpgme=no) |
165 |
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION", |
166 |
have_gpg_error=yes,have_gpg_error=no) |
167 |
|
168 |
# Checks for header files. |
169 |
AC_HEADER_STDC |
170 |
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h) |
171 |
|
172 |
AC_CHECK_FUNCS(stpcpy) |
173 |
|
174 |
# Checks for typedefs, structures, and compiler characteristics. |
175 |
AC_C_CONST |
176 |
AC_C_INLINE |
177 |
AC_TYPE_SIZE_T |
178 |
AC_TYPE_SIGNAL |
179 |
|
180 |
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) |
181 |
|
182 |
# Add some extra libs here so that previous tests don't fail for |
183 |
# mysterious reasons - the final link step should bail out. |
184 |
if test "$have_w32_system" = yes; then |
185 |
W32LIBS="-lwsock32" |
186 |
fi |
187 |
|
188 |
if test "$GCC" = yes; then |
189 |
CFLAGS="$CFLAGS -Wall -mms-bitfields" |
190 |
CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields" |
191 |
if test "$USE_MAINTAINER_MODE" = "yes"; then |
192 |
CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes" |
193 |
CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security" |
194 |
CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow" |
195 |
CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security" |
196 |
fi |
197 |
fi |
198 |
|
199 |
AC_SUBST(W32LIBS) |
200 |
|
201 |
|
202 |
|
203 |
# |
204 |
# Print errors here so that they are visible all |
205 |
# together and the user can acquire them all together. |
206 |
# |
207 |
die=no |
208 |
if test "$have_gpgme" = "no"; then |
209 |
die=yes |
210 |
AC_MSG_NOTICE([[ |
211 |
*** |
212 |
*** You need gpgme to build this program. |
213 |
** This library is for example available at |
214 |
*** ftp://ftp.gnupg.org/gcrypt/gpgme/ |
215 |
*** (at least version $NEED_GPGME_VERSION is required.) |
216 |
***]]) |
217 |
fi |
218 |
if test "$have_gpg_error" = "no"; then |
219 |
die=yes |
220 |
AC_MSG_NOTICE([[ |
221 |
*** |
222 |
*** You need libgpg-error to build this program. |
223 |
** This library is for example available at |
224 |
*** ftp://ftp.gnupg.org/gcrypt/libgpg-error |
225 |
*** (at least version $NEED_GPG_ERROR_VERSION is required.) |
226 |
***]]) |
227 |
fi |
228 |
if test "$die" = "yes"; then |
229 |
AC_MSG_ERROR([[ |
230 |
*** |
231 |
*** Required libraries not found. Please consult the above messages |
232 |
*** and install them before running configure again. |
233 |
***]]) |
234 |
fi |
235 |
|
236 |
|
237 |
AC_CONFIG_FILES([ Makefile |
238 |
PTD/Makefile |
239 |
PTD/versioninfo.rc |
240 |
Src/Makefile |
241 |
Src/versioninfo.rc |
242 |
Include/Makefile |
243 |
icons/Makefile |
244 |
m4/Makefile |
245 |
Gnupg/Makefile |
246 |
Po/Makefile.in |
247 |
]) |
248 |
AC_OUTPUT |