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 |
|
|
AC_INIT(WinPT, 0.11.0-cvs, http://www.winpt.org) |
19 |
|
|
|
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 |
|
|
AC_CONFIG_SRCDIR(src/WinPT.cpp) |
29 |
|
|
AM_CONFIG_HEADER(config.h) |
30 |
|
|
AC_CANONICAL_TARGET() |
31 |
|
|
AM_INIT_AUTOMAKE($PACKAGE, $VERSION) |
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 |
|
|
|
55 |
|
|
AH_BOTTOM([ |
56 |
|
|
/* Some global constants. */ |
57 |
|
|
|
58 |
|
|
/* Set to distinguish between the old custom Makefile based build |
59 |
werner |
47 |
system and our new automake based one. This is only required in |
60 |
|
|
Include/wptVersion.h. Fixme: See whether we may define the constants |
61 |
|
|
there by means of command line apssed args or similar. */ |
62 |
werner |
36 |
#define WINPT_MODERN_BUILD 1 |
63 |
|
|
|
64 |
werner |
47 |
/* FIXME: For what is this needed? */ |
65 |
|
|
#define WINPT_IPC 1 |
66 |
|
|
|
67 |
werner |
36 |
]) |
68 |
|
|
|
69 |
|
|
AM_MAINTAINER_MODE |
70 |
|
|
|
71 |
|
|
# Checks for programs. |
72 |
|
|
AC_PROG_MAKE_SET |
73 |
|
|
AM_SANITY_CHECK |
74 |
|
|
missing_dir=`cd $ac_aux_dir && pwd` |
75 |
|
|
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
76 |
|
|
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
77 |
|
|
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
78 |
|
|
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
79 |
|
|
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
80 |
|
|
AC_PROG_AWK |
81 |
|
|
AC_PROG_CC |
82 |
|
|
AC_PROG_CPP |
83 |
|
|
AC_PROG_CXX |
84 |
|
|
AC_PROG_INSTALL |
85 |
|
|
AC_PROG_LN_S |
86 |
|
|
AC_PROG_MAKE_SET |
87 |
|
|
AC_PROG_RANLIB |
88 |
|
|
AC_CHECK_TOOL(AR, ar, :) |
89 |
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, :) |
90 |
|
|
AC_CHECK_TOOL(WINDRES, windres, :) |
91 |
|
|
|
92 |
|
|
|
93 |
|
|
try_gettext=yes |
94 |
|
|
have_dosish_system=no |
95 |
|
|
have_w32_system=no |
96 |
|
|
case "${host}" in |
97 |
|
|
*-mingw32*) |
98 |
|
|
# special stuff for Windoze NT |
99 |
|
|
ac_cv_have_dev_random=no |
100 |
|
|
AC_DEFINE(USE_ONLY_8DOT3,1, |
101 |
|
|
[set this to limit filenames to the 8.3 format]) |
102 |
|
|
AC_DEFINE(HAVE_DRIVE_LETTERS,1, |
103 |
|
|
[defined if we must run on a stupid file system]) |
104 |
|
|
AC_DEFINE(USE_SIMPLE_GETTEXT,1, |
105 |
|
|
[because the Unix gettext has too much overhead on |
106 |
|
|
MingW32 systems and these systems lack Posix functions, |
107 |
|
|
we use a simplified version of gettext]) |
108 |
|
|
have_dosish_system=yes |
109 |
|
|
have_w32_system=yes |
110 |
|
|
try_gettext="no" |
111 |
|
|
;; |
112 |
|
|
*) |
113 |
|
|
AC_MSG_ERROR([[ |
114 |
|
|
*** |
115 |
|
|
*** This software my only be build for W32 systems. Use |
116 |
|
|
*** ./autogen.sh --build-w32 |
117 |
|
|
*** to prepare it for such a build. |
118 |
|
|
***]]) |
119 |
|
|
;; |
120 |
|
|
esac |
121 |
|
|
|
122 |
|
|
if test "$have_dosish_system" = yes; then |
123 |
|
|
AC_DEFINE(HAVE_DOSISH_SYSTEM,1, |
124 |
|
|
[Defined if we run on some of the PCDOS like systems |
125 |
|
|
(DOS, Windoze. OS/2) with special properties like |
126 |
|
|
no file modes]) |
127 |
|
|
fi |
128 |
|
|
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) |
129 |
|
|
|
130 |
|
|
if test "$have_w32_system" = yes; then |
131 |
|
|
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) |
132 |
|
|
fi |
133 |
|
|
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) |
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
# |
138 |
|
|
# Checks for libraries. |
139 |
|
|
# |
140 |
|
|
|
141 |
|
|
|
142 |
|
|
AM_PATH_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION", |
143 |
|
|
have_gpgme=yes,have_gpgme=no) |
144 |
|
|
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION", |
145 |
|
|
have_gpg_error=yes,have_gpg_error=no) |
146 |
|
|
|
147 |
|
|
# Checks for header files. |
148 |
|
|
AC_HEADER_STDC |
149 |
|
|
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h) |
150 |
|
|
|
151 |
|
|
AC_CHECK_FUNCS(stpcpy) |
152 |
|
|
|
153 |
|
|
# Checks for typedefs, structures, and compiler characteristics. |
154 |
|
|
AC_C_CONST |
155 |
|
|
AC_C_INLINE |
156 |
|
|
AC_TYPE_SIZE_T |
157 |
|
|
AC_TYPE_SIGNAL |
158 |
|
|
|
159 |
|
|
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) |
160 |
|
|
|
161 |
|
|
# Add some extra libs here so that previous tests don't fail for |
162 |
|
|
# mysterious reasons - the final link step should bail out. |
163 |
|
|
if test "$have_w32_system" = yes; then |
164 |
|
|
W32LIBS="-lwsock32" |
165 |
|
|
fi |
166 |
|
|
|
167 |
|
|
if test "$GCC" = yes; then |
168 |
|
|
CFLAGS="$CFLAGS -Wall -mms-bitfields" |
169 |
|
|
CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields" |
170 |
|
|
if test "$USE_MAINTAINER_MODE" = "yes"; then |
171 |
|
|
CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes" |
172 |
|
|
CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security" |
173 |
|
|
CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow" |
174 |
|
|
CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security" |
175 |
|
|
fi |
176 |
|
|
fi |
177 |
|
|
|
178 |
|
|
AC_SUBST(W32LIBS) |
179 |
|
|
|
180 |
|
|
|
181 |
|
|
|
182 |
|
|
# |
183 |
|
|
# Print errors here so that they are visible all |
184 |
|
|
# together and the user can acquire them all together. |
185 |
|
|
# |
186 |
|
|
die=no |
187 |
|
|
if test "$have_gpgme" = "no"; then |
188 |
|
|
die=yes |
189 |
|
|
AC_MSG_NOTICE([[ |
190 |
|
|
*** |
191 |
|
|
*** You need gpgme to build this program. |
192 |
|
|
** This library is for example available at |
193 |
|
|
*** ftp://ftp.gnupg.org/gcrypt/gpgme/ |
194 |
|
|
*** (at least version $NEED_GPGME_VERSION is required.) |
195 |
|
|
***]]) |
196 |
|
|
fi |
197 |
|
|
if test "$have_gpg_error" = "no"; then |
198 |
|
|
die=yes |
199 |
|
|
AC_MSG_NOTICE([[ |
200 |
|
|
*** |
201 |
|
|
*** You need libgpg-error to build this program. |
202 |
|
|
** This library is for example available at |
203 |
|
|
*** ftp://ftp.gnupg.org/gcrypt/libgpg-error |
204 |
|
|
*** (at least version $NEED_GPG_ERROR_VERSION is required.) |
205 |
|
|
***]]) |
206 |
|
|
fi |
207 |
|
|
if test "$die" = "yes"; then |
208 |
|
|
AC_MSG_ERROR([[ |
209 |
|
|
*** |
210 |
|
|
*** Required libraries not found. Please consult the above messages |
211 |
|
|
*** and install them before running configure again. |
212 |
|
|
***]]) |
213 |
|
|
fi |
214 |
|
|
|
215 |
|
|
|
216 |
|
|
AC_CONFIG_FILES([ Makefile |
217 |
werner |
46 |
PTD/Makefile |
218 |
|
|
PTD/versioninfo.rc |
219 |
|
|
Src/Makefile |
220 |
|
|
Src/versioninfo.rc |
221 |
|
|
Include/Makefile |
222 |
|
|
Ico/Makefile |
223 |
|
|
m4/Makefile |
224 |
|
|
w32gpgme/Makefile |
225 |
|
|
Gnupg/Makefile |
226 |
werner |
36 |
]) |
227 |
|
|
AC_OUTPUT |