/[winpt]/trunk/configure.ac
ViewVC logotype

Contents of /trunk/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 283 - (show annotations)
Sat Feb 3 18:28:38 2007 UTC (18 years ago) by twoaday
File size: 6838 byte(s)


1 # configure.ac - for WinPT
2 # Copyright (C) 2005, 2006 g10 Code GmbH
3 # Copyright (C) 2006, 2007 Timo Schulz
4 #
5 # This file is free software; as a special exception the author gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
11 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 # Process this file with autoconf to produce a configure script.
14 AC_PREREQ(2.59)
15 min_automake_version="1.9.2"
16
17 # Version number: Remember to change it immediately *after* a release.
18 # Add a "-cvs" prefix for non-released code.
19 AC_INIT(WinPT, 1.2.1-cvs, http://wald.intevation.org/projects/winpt)
20
21 # We always force to use the minimal GPG version which is
22 # known to be free of reported security issues
23 NEED_GPG_VERSION=1.4.6
24
25 NEED_GPGME_API=1
26 NEED_GPGME_VERSION=1.1.1
27 NEED_GPG_ERROR_VERSION=1.2
28
29 PACKAGE=$PACKAGE_NAME
30 PACKAGE_GT=${PACKAGE_NAME}
31 VERSION=$PACKAGE_VERSION
32
33 AC_CONFIG_SRCDIR(Src/WinPT.cpp)
34 AM_CONFIG_HEADER(config.h)
35 AC_CANONICAL_TARGET()
36 AM_INIT_AUTOMAKE
37 AM_MKINSTALLDIRS
38
39 AC_GNU_SOURCE
40
41 AC_SUBST(PACKAGE)
42 AC_SUBST(PACKAGE_GT)
43 AC_SUBST(VERSION)
44 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
45 AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT",
46 [Name of this package for gettext])
47 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
48 AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",
49 [Bug report address])
50 AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION",
51 [Required version of GPGME])
52 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
53 [Required version of GnuPG])
54
55 BUILD_TIMESTAMP=`date --iso-8601=minutes`
56 AC_SUBST(BUILD_TIMESTAMP)
57 changequote(,)dnl
58 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1.0/;s/\./,/g'`
59 changequote([,])dnl
60 AC_SUBST(BUILD_FILEVERSION)
61
62 # For the distcheck target of make we need to set a few options for
63 # the cross compiling environment. We assume the same conevtion as
64 # used in autogen.sh; i.e. we take the root from the $w32root variable
65 # or default to ~/w32root.
66 if test -n "$w32root"; then
67 W32ROOT="$w32root"
68 else
69 W32ROOT="$HOME/w32root"
70 fi
71 AC_SUBST(W32ROOT)
72
73
74 AH_BOTTOM([
75 /* Some global constants. */
76
77 /* We need to include this header to be able to include specific parts
78 of the common controls header file. */
79 #include <w32api.h>
80 #define _WIN32_IE IE55
81 ])
82
83 AM_MAINTAINER_MODE
84
85 # Checks for programs.
86 AC_PROG_MAKE_SET
87 AM_SANITY_CHECK
88 missing_dir=`cd $ac_aux_dir && pwd`
89 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
90 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
91 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
92 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
93 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
94 AC_PROG_AWK
95 AC_PROG_CC
96 AC_PROG_CPP
97 AC_PROG_CXX
98 AC_PROG_INSTALL
99 AC_PROG_LN_S
100 AC_PROG_MAKE_SET
101 AC_PROG_RANLIB
102 AC_CHECK_TOOL(AR, ar, :)
103 AC_CHECK_TOOL(DLLTOOL, dlltool, :)
104 AC_CHECK_TOOL(WINDRES, windres, :)
105
106 try_gettext=yes
107 have_dosish_system=no
108 have_w32_system=no
109 case "${host}" in
110 *-mingw32*)
111 # special stuff for Windoze NT/XP
112 ac_cv_have_dev_random=no
113 AC_DEFINE(USE_SIMPLE_GETTEXT,1,
114 [Use a lightweight gettext version for cross-compiling])
115 have_dosish_system=yes
116 have_w32_system=yes
117 try_gettext="no"
118 ;;
119 *)
120 AC_MSG_ERROR([[
121 ***
122 *** This software my only be build for W32 systems. Use
123 *** ./autogen.sh --build-w32
124 *** to prepare it for such a build.
125 ***]])
126 ;;
127 esac
128
129
130 AH_BOTTOM([
131 /* Force using of NLS for W32 even if no libintl has been found. This is
132 okay because we have our own gettext implementation for W32. */
133 #if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS)
134 #define ENABLE_NLS 1
135 #endif
136 ])
137
138 # Note, that autogen.sh greps for the next line.
139 AM_GNU_GETTEXT_VERSION(0.12.1)
140 AM_GNU_GETTEXT([external])
141 # There is something wrong with the NLS checking here. We force using it.
142 USE_NLS=yes
143
144 if test "$have_dosish_system" = yes; then
145 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
146 [Define this to indicate the binary is build for a system
147 with special properties like no posix 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 # Checks for libraries.
159 #
160
161 AM_PATH_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION",
162 have_gpgme=yes,have_gpgme=no)
163 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
164 have_gpg_error=yes,have_gpg_error=no)
165
166 # Checks for header files.
167 AC_HEADER_STDC
168 AC_CHECK_HEADERS(string.h unistd.h)
169
170 AC_CHECK_FUNCS(stpcpy)
171
172 # Checks for typedefs, structures, and compiler characteristics.
173 AC_C_CONST
174 AC_C_INLINE
175 AC_TYPE_SIZE_T
176
177 AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
178
179 # Add some extra libs here so that previous tests don't fail for
180 # mysterious reasons - the final link step should bail out.
181 if test "$have_w32_system" = yes; then
182 W32LIBS="-lws2_32"
183 fi
184
185 if test "$GCC" = yes; then
186 CFLAGS="$CFLAGS -Wall -mms-bitfields"
187 CXXFLAGS="$CXXFLAGS -Wall -mms-bitfields"
188 if test "$USE_MAINTAINER_MODE" = "yes"; then
189 CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes"
190 CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security"
191 CXXFLAGS="$CXXFLAGS -Wcast-align -Wshadow"
192 CXXFLAGS="$CXXFLAGS -Wno-format-y2k -Wformat-security"
193 fi
194 fi
195
196 AC_SUBST(W32LIBS)
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 PTD/Makefile
235 PTD/versioninfo.rc
236 Src/Makefile
237 Src/versioninfo.rc
238 Include/Makefile
239 icons/Makefile
240 m4/Makefile
241 Gnupg/Makefile
242 Generic/Makefile
243 Po/Makefile.in
244 ])
245 AC_OUTPUT

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26