1 |
twoaday |
3 |
# configure.ac - for GPGOE |
2 |
|
|
|
3 |
|
|
# Process this file with autoconf to produce a configure script. |
4 |
|
|
AC_PREREQ(2.59) |
5 |
|
|
min_automake_version="1.9.4" |
6 |
|
|
|
7 |
|
|
# Version number: Remember to change it immediately *after* a release. |
8 |
|
|
# Make sure to run "svn up" before a "make dist". |
9 |
|
|
# Add a "-cvs" prefix for non-released code. |
10 |
|
|
AC_INIT(gpgoe, 0.6.0, [email protected]) |
11 |
|
|
|
12 |
|
|
NEED_GPGME_API=1 |
13 |
|
|
NEED_GPGME_VERSION=1.1.0 |
14 |
|
|
|
15 |
|
|
|
16 |
|
|
PACKAGE=$PACKAGE_NAME |
17 |
|
|
PACKAGE_GT=${PACKAGE_NAME} |
18 |
|
|
VERSION=$PACKAGE_VERSION |
19 |
|
|
|
20 |
|
|
AC_CONFIG_SRCDIR(src/GPGOE.c) |
21 |
|
|
AM_CONFIG_HEADER(config.h) |
22 |
|
|
AC_CANONICAL_TARGET() |
23 |
|
|
AM_INIT_AUTOMAKE |
24 |
|
|
|
25 |
|
|
AC_GNU_SOURCE |
26 |
|
|
|
27 |
|
|
AC_SUBST(PACKAGE) |
28 |
|
|
AC_SUBST(PACKAGE_GT) |
29 |
|
|
AC_SUBST(VERSION) |
30 |
|
|
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) |
31 |
|
|
AC_DEFINE_UNQUOTED(PACKAGE_GT, "$PACKAGE_GT", |
32 |
|
|
[Name of this package for gettext]) |
33 |
|
|
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) |
34 |
|
|
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT", |
35 |
|
|
[Bug report address]) |
36 |
|
|
AC_DEFINE_UNQUOTED(NEED_GPGME_VERSION, "$NEED_GPGME_VERSION", |
37 |
|
|
[Required version of GPGME]) |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
BUILD_TIMESTAMP=`date --iso-8601=minutes` |
41 |
|
|
AC_SUBST(BUILD_TIMESTAMP) |
42 |
|
|
changequote(,)dnl |
43 |
|
|
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` |
44 |
|
|
tmp="`echo '$Revision$' | sed 's/[^0-9]//g'`" |
45 |
|
|
changequote([,])dnl |
46 |
|
|
test -z "$tmp" && tmp="0" |
47 |
|
|
BUILD_FILEVERSION="${BUILD_FILEVERSION}$tmp" |
48 |
|
|
AC_SUBST(BUILD_FILEVERSION) |
49 |
|
|
|
50 |
|
|
|
51 |
|
|
AH_BOTTOM([ |
52 |
|
|
/* Some global constants. */ |
53 |
|
|
|
54 |
|
|
/* Force using of NLS for W32 even if no libintl has been found. This is |
55 |
|
|
okay because we have our own gettext implementation for W32. */ |
56 |
|
|
#if defined(HAVE_W32_SYSTEM) && !defined(ENABLE_NLS) |
57 |
|
|
#define ENABLE_NLS 1 |
58 |
|
|
#endif |
59 |
|
|
]) |
60 |
|
|
|
61 |
|
|
AM_MAINTAINER_MODE |
62 |
|
|
|
63 |
|
|
# Checks for programs. |
64 |
|
|
AC_PROG_MAKE_SET |
65 |
|
|
AM_SANITY_CHECK |
66 |
|
|
missing_dir=`cd $ac_aux_dir && pwd` |
67 |
|
|
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) |
68 |
|
|
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) |
69 |
|
|
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) |
70 |
|
|
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) |
71 |
|
|
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) |
72 |
|
|
AC_PROG_AWK |
73 |
|
|
AC_PROG_CC |
74 |
|
|
AC_PROG_CPP |
75 |
|
|
AC_PROG_CXX |
76 |
|
|
AC_PROG_INSTALL |
77 |
|
|
AC_PROG_LN_S |
78 |
|
|
AC_PROG_MAKE_SET |
79 |
|
|
AC_PROG_RANLIB |
80 |
|
|
AC_CHECK_TOOL(AR, ar, :) |
81 |
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, :) |
82 |
|
|
AC_CHECK_TOOL(WINDRES, windres, :) |
83 |
|
|
|
84 |
|
|
|
85 |
|
|
have_dosish_system=no |
86 |
|
|
have_w32_system=no |
87 |
|
|
case "${host}" in |
88 |
|
|
*-mingw32*) |
89 |
|
|
# special stuff for Windoze NT |
90 |
|
|
ac_cv_have_dev_random=no |
91 |
|
|
have_dosish_system=yes |
92 |
|
|
have_w32_system=yes |
93 |
|
|
;; |
94 |
|
|
*) |
95 |
|
|
AC_MSG_ERROR([[ |
96 |
|
|
*** |
97 |
|
|
*** This software my only be build for W32 systems. Use |
98 |
|
|
*** ./autogen.sh --build-w32 |
99 |
|
|
*** to prepare it for such a build. |
100 |
|
|
***]]) |
101 |
|
|
;; |
102 |
|
|
esac |
103 |
|
|
|
104 |
|
|
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes) |
105 |
|
|
if test "$have_w32_system" = yes; then |
106 |
|
|
AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system]) |
107 |
|
|
fi |
108 |
|
|
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes) |
109 |
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
|
|
# |
113 |
|
|
# Checks for libraries. |
114 |
|
|
# |
115 |
|
|
AM_PATH_GPGME("$NEED_GPGME_API:$NEED_GPGME_VERSION", |
116 |
|
|
have_gpgme=yes,have_gpgme=no) |
117 |
|
|
AM_PATH_GPG_ERROR(0.5,, AC_MSG_ERROR([libgpg-error was not found])) |
118 |
|
|
|
119 |
|
|
|
120 |
|
|
# Note, that autogen.sh greps for the next line. |
121 |
|
|
AM_GNU_GETTEXT_VERSION(0.12.1) |
122 |
|
|
AM_GNU_GETTEXT([external]) |
123 |
|
|
# We always want NLs, despite what the above macro figures out. |
124 |
|
|
USE_NLS=yes |
125 |
|
|
|
126 |
|
|
# Checks for header files. |
127 |
|
|
AC_HEADER_STDC |
128 |
|
|
AC_CHECK_HEADERS(string.h) |
129 |
|
|
|
130 |
|
|
# Checks for typedefs, structures, and compiler characteristics. |
131 |
|
|
AC_C_CONST |
132 |
|
|
AC_TYPE_SIZE_T |
133 |
|
|
|
134 |
|
|
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes) |
135 |
|
|
|
136 |
|
|
# Add some extra libs here so that previous tests don't fail for |
137 |
|
|
# mysterious reasons - the final link step should bail out. |
138 |
|
|
if test "$have_w32_system" = yes; then |
139 |
|
|
W32LIBS="" |
140 |
|
|
fi |
141 |
|
|
|
142 |
|
|
if test "$GCC" = yes; then |
143 |
|
|
CFLAGS="$CFLAGS -Wall -mms-bitfields" |
144 |
|
|
if test "$USE_MAINTAINER_MODE" = "yes"; then |
145 |
|
|
CFLAGS="$CFLAGS -Wcast-align -Wshadow -Wstrict-prototypes" |
146 |
|
|
CFLAGS="$CFLAGS -Wno-format-y2k -Wformat-security" |
147 |
|
|
|
148 |
|
|
fi |
149 |
|
|
fi |
150 |
|
|
|
151 |
|
|
AC_SUBST(W32LIBS) |
152 |
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
# |
156 |
|
|
# Print errors here so that they are visible all |
157 |
|
|
# together and the user can acquire them all together. |
158 |
|
|
# |
159 |
|
|
die=no |
160 |
|
|
if test "$have_gpgme" = "no"; then |
161 |
|
|
die=yes |
162 |
|
|
AC_MSG_NOTICE([[ |
163 |
|
|
*** |
164 |
|
|
*** You need gpgme to build this program. |
165 |
|
|
** This library is for example available at |
166 |
|
|
*** ftp://ftp.gnupg.org/gcrypt/gpgme/ |
167 |
|
|
*** (at least version $NEED_GPGME_VERSION is required.) |
168 |
|
|
***]]) |
169 |
|
|
fi |
170 |
|
|
if test "$die" = "yes"; then |
171 |
|
|
AC_MSG_ERROR([[ |
172 |
|
|
*** |
173 |
|
|
*** Required libraries not found. Please consult the above messages |
174 |
|
|
*** and install them before running configure again. |
175 |
|
|
***]]) |
176 |
|
|
fi |
177 |
|
|
|
178 |
|
|
|
179 |
|
|
AC_CONFIG_FILES([ Makefile |
180 |
|
|
src/Makefile |
181 |
|
|
po/Makefile.in |
182 |
|
|
m4/Makefile |
183 |
|
|
init/Makefile |
184 |
|
|
]) |
185 |
|
|
AC_OUTPUT |