Post-release fixup.
[gpgme.git] / configure.ac
1 # configure.ac for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 g10 Code GmbH
4
5 # This file is part of GPGME.
6
7 # GPGME is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 2.1 of the
10 # License, or (at your option) any later version.
11
12 # GPGME is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
15 # Public License for more details.
16
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20  
21 # (Process this file with autoconf to produce a configure script.)
22 AC_PREREQ(2.59)
23 min_automake_version="1.9.3"
24
25 # Version number: Remember to change it immediately *after* a release.
26 #                 Make sure to run  "svn up" before a "make dist".
27 #                 See below for the LT versions.
28 #
29 # The CVS version is usually the next intended release version with
30 # the string "-cvs" appended.  The reason for this is that tests for a
31 # specific feature can already be done under the assumption that the
32 # CVS version is the most recent one in a branch.  To disable the CVS
33 # version for the real release, just comment out the my_iscvs macro.
34 # Note, that we are now using Subversion instead of CVS and append the
35 # SVN revision number to the "cvs" suffix.  To make this most useful
36 # for snapshot releases please do an "svn up" right before recreating
37 # the configure script, so that a proper revision number for all files
38 # is available when running a "make distcheck".
39 m4_define(my_version, [1.1.5])
40 m4_define(my_iscvs, yes)
41 AC_INIT([gpgme], my_version[]m4_ifdef([my_iscvs], [-cvs[]m4_translit(
42                [$Revision$],[Ra-z $:])]),
43                [bug-gpgme@gnupg.org])
44
45 # LT Version numbers, remember to change them just *before* a release.
46 #   (Code changed:                      REVISION++)
47 #   (Interfaces added/removed/changed:  CURRENT++, REVISION=0)
48 #   (Interfaces added:                  AGE++)
49 #   (Interfaces removed/changed:        AGE=0)
50 #
51 LIBGPGME_LT_CURRENT=17
52 # Subtract 2 from this value if you want to make the LFS transition an
53 # ABI break.  [Note to self: Remove this comment with the next regular break.]
54 LIBGPGME_LT_AGE=6
55 LIBGPGME_LT_REVISION=4
56
57 # If the API is changed in an incompatible way: increment the next counter.
58 GPGME_CONFIG_API_VERSION=1
59 ##############################################
60
61
62 PACKAGE=$PACKAGE_NAME
63 VERSION=$PACKAGE_VERSION
64
65 AC_CONFIG_SRCDIR(gpgme/gpgme.h)
66 dnl FIXME: Enable this with autoconf 2.59.
67 dnl AC_CONFIG_MACRO_DIR(m4)
68 AM_CONFIG_HEADER(config.h)
69 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
70 AM_MAINTAINER_MODE
71 AC_CANONICAL_HOST
72
73 # Enable GNU extensions on systems that have them.
74 AC_GNU_SOURCE
75
76 AH_VERBATIM([_REENTRANT],
77 [/* To allow the use of GPGME in multithreaded programs we have to use
78   special features from the library.
79   IMPORTANT: gpgme is not yet fully reentrant and you should use it
80   only from one thread.  */
81 #ifndef _REENTRANT
82 # define _REENTRANT 1
83 #endif])
84
85 AC_PROG_CC
86
87 AC_SUBST(LIBGPGME_LT_CURRENT)
88 AC_SUBST(LIBGPGME_LT_AGE)
89 AC_SUBST(LIBGPGME_LT_REVISION)
90
91 AC_SUBST(PACKAGE)
92 AC_SUBST(VERSION)
93 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
94 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
95
96 # Don't default to build static libs.
97 AC_DISABLE_STATIC
98 AC_LIBTOOL_WIN32_DLL
99 AC_LIBTOOL_RC
100 AC_PROG_LIBTOOL
101
102 # For now we hardcode the use of version scripts.  It would be better
103 # to write a test for this or even implement this within libtool.
104 have_ld_version_script=no
105 case "${host}" in
106     *-*-linux*)
107         have_ld_version_script=yes
108         ;;
109     *-*-gnu*)
110         have_ld_version_script=yes
111         ;;
112 esac
113 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
114
115 GPG_DEFAULT=no
116 GPGSM_DEFAULT=no
117 component_system=None
118 have_dosish_system=no
119 have_w32_system=no
120 case "${host}" in
121     *-mingw32*)
122         # special stuff for Windoze NT
123         have_dosish_system=yes
124         have_w32_system=yes
125         GPG_DEFAULT='c:\\gnupg\\gpg.exe'
126         GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
127         #component_system='COM+'
128         ;;
129     *)
130         AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
131         if test "$have_pth" = yes; then
132           AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
133         fi
134         AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
135         if test "$have_pthread" = yes; then
136           AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
137         fi
138
139         # XXX: Probably use exec-prefix here?
140 #       GPG_DEFAULT='/usr/bin/gpg'
141 #       GPGSM_DEFAULT='/usr/bin/gpgsm'
142         ;;
143 esac
144
145 if test "$have_dosish_system" = yes; then
146    AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
147              [Defined if we run on some of the PCDOS like systems 
148               (DOS, Windoze. OS/2) with special properties like
149               no file modes])
150 fi
151 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
152
153 if test "$have_w32_system" = yes; then
154    AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
155 fi
156 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
157
158 build_w32_glib=no
159 AM_PATH_GLIB_2_0
160 AC_ARG_ENABLE(w32-glib,
161             AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
162             build_w32_glib=$withval)
163 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
164
165 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
166 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
167
168
169 # Checks for header files.
170 AC_CHECK_HEADERS(sys/select.h)
171
172
173 # Type checks.
174 AC_C_INLINE
175 AC_CHECK_SIZEOF(unsigned int)
176 AC_SYS_LARGEFILE
177 AC_TYPE_OFF_T
178
179 # Checks for compiler features.
180 if test "$GCC" = yes; then
181     CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
182     if test "$have_w32_system" = yes; then
183        CFLAGS="$CFLAGS -mms-bitfields"
184     fi
185 fi
186
187 # Network library fun.
188 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
189         [NETLIBS="-lnsl $NETLIBS"]))
190 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
191         [NETLIBS="-lsocket $NETLIBS"]))
192 AC_SUBST(NETLIBS)
193
194 # Checks for library functions.
195 AC_FUNC_FSEEKO
196
197 AC_REPLACE_FUNCS(vasprintf)
198 if test "$ac_cv_func_vasprintf" != yes; then
199   GNUPG_CHECK_VA_COPY
200 fi
201
202 # Try to find a thread-safe version of ttyname().
203 AC_REPLACE_FUNCS(ttyname_r)
204 if test "$ac_cv_func_ttyname_r" != yes; then
205   AC_MSG_WARN([
206 ***
207 *** ttyname() is not thread-safe and ttyname_r() does not exist
208 ***])
209 fi
210
211 # Try to find a thread-safe version of getenv().
212 have_thread_safe_getenv=no
213 jm_GLIBC21
214 if test $GLIBC21 = yes; then
215   have_thread_safe_getenv=yes
216 fi
217 if test $have_thread_safe_getenv = yes; then
218   AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
219 fi
220 have_getenv_r=no
221 AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
222 if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
223   AC_MSG_WARN([
224 ***
225 *** getenv() is not thread-safe and getenv_r() does not exist
226 ***])
227 fi
228
229 # For converting time strings to seconds since Epoch, we need the timegm
230 # function.
231 AC_CHECK_FUNCS(timegm)
232 if test "$ac_cv_func_timegm" != yes; then
233   AC_MSG_WARN([
234 ***
235 *** timegm() not available - a non-thread-safe kludge will be used
236 *** and the TZ variable might be changed at runtime.
237 ***])
238 fi
239
240 # Checking for libgpg-error.
241 AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
242 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
243           [The default error source for GPGME.])
244
245
246
247 # Checks for system services
248 NEED_GPG_VERSION_DEFAULT=1.3.0
249 NEED_GPGSM_VERSION_DEFAULT=1.9.6
250 NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
251 NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
252 AC_ARG_WITH(gpg-version,
253             AC_HELP_STRING([--with-gpg-version=VER], [require GnuPG version VER]),
254             NEED_GPG_VERSION=$withval)
255 if test "$NEED_GPG_VERSION" = "yes"; then
256   NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
257 fi
258 if test "$NEED_GPG_VERSION" = "no"; then
259   NEED_GPG_VERSION=0.0.0
260 fi
261 AC_ARG_WITH(gpgsm-version,
262             AC_HELP_STRING([--with-gpgsm-version=VER], [require GPGSM version VER]),
263             NEED_GPGSM_VERSION=$withval)
264 if test "$NEED_GPGSM_VERSION" = "yes"; then
265   NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
266 fi
267 if test "$NEED_GPGSM_VERSION" = "no"; then
268   NEED_GPGSM_VERSION=0.0.0
269 fi
270
271 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
272                                      [Min. needed GnuPG version.])
273 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
274                                        [Min. needed GPGSM version.])
275
276
277 NO_OVERRIDE=no
278 AC_ARG_WITH(gpg,
279             AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
280             GPG=$withval, NO_OVERRIDE=yes)
281 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
282   GPG=
283   NO_OVERRIDE=yes
284   if test "$cross_compiling" != "yes"; then
285     AC_PATH_PROG(GPG, gpg)
286   fi
287   if test -z "$GPG"; then
288     GPG="$GPG_DEFAULT"
289   fi
290 fi
291 if test "$GPG" = no; then
292   if test "$NO_OVERRIDE" = "yes"; then
293     if test "$cross_compiling" != "yes"; then
294       AC_MSG_WARN([
295 ***
296 *** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it
297 ***])
298     else
299       AC_MSG_ERROR([
300 ***
301 *** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH
302 ***])
303     fi
304   fi
305 else
306   AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
307   AC_SUBST(GPG)
308 fi
309 dnl Check for GnuPG version requirement.
310 GPG_VERSION=unknown
311 ok=maybe
312 if test -z "$GPG" -o "x$GPG" = "xno"; then
313   ok=no
314 else
315   if test "$cross_compiling" = "yes"; then
316     AC_MSG_WARN([GnuPG version can not be checked when cross compiling])
317     ok=no
318   else
319     if test ! -x "$GPG"; then
320       AC_MSG_WARN([GnuPG not executable, version check disabled])
321       ok=no
322     fi
323   fi
324 fi
325 if test "$ok" = "maybe"; then
326   AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
327   req_major=`echo $NEED_GPG_VERSION | \
328              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
329   req_minor=`echo $NEED_GPG_VERSION | \
330              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
331   req_micro=`echo $NEED_GPG_VERSION | \
332              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
333   GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
334   major=`echo $GPG_VERSION | \
335          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
336   minor=`echo $GPG_VERSION | \
337          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
338   micro=`echo $GPG_VERSION | \
339          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
340
341   if test "$major" -gt "$req_major"; then
342     ok=yes
343   else
344     if test "$major" -eq "$req_major"; then
345       if test "$minor" -gt "$req_minor"; then
346         ok=yes
347       else
348         if test "$minor" -eq "$req_minor"; then
349           if test "$micro" -ge "$req_micro"; then
350             ok=yes
351           fi
352         fi
353       fi
354     fi
355   fi
356   if test "$ok" = "yes"; then
357     AC_MSG_RESULT(yes)
358   else
359     AC_MSG_RESULT(no)
360     AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
361   fi
362 fi
363 run_gpg_test="$ok"
364 AC_ARG_ENABLE(gpg-test,
365   AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
366          run_gpg_test=$enableval)
367 AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
368 AC_SUBST(GPG_PATH)
369
370 NO_OVERRIDE=no
371 AC_ARG_WITH(gpgsm,
372             AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
373             GPGSM=$withval, NO_OVERRIDE=yes)
374 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
375   GPGSM=
376   NO_OVERRIDE=yes
377   if test "$cross_compiling" != "yes"; then
378     AC_PATH_PROG(GPGSM, gpgsm)
379   fi
380   if test -z "$GPGSM"; then
381     GPGSM="$GPGSM_DEFAULT"
382   fi
383 fi
384 if test "$GPGSM" = no; then
385   if test "$NO_OVERRIDE" = "yes"; then
386     if test "$cross_compiling" != "yes"; then
387       AC_MSG_WARN([
388 ***
389 *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it
390 ***])
391     else
392       AC_MSG_ERROR([
393 ***
394 *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH
395 ***])
396     fi
397   fi
398 else
399   AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
400   AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled])
401 fi
402 AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no")
403
404
405 dnl Check for GPGSM version requirement.
406 GPGSM_VERSION=unknown
407 ok=maybe
408 if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then
409   ok=no
410 else
411   if test "$cross_compiling" = "yes"; then
412     AC_MSG_WARN([GPGSM version can not be checked when cross compiling])
413     ok=no
414   else
415     if test ! -x "$GPGSM"; then
416       AC_MSG_WARN([GPGSM not executable, version check disabled])
417       ok=no
418     fi
419   fi
420 fi
421 if test "$ok" = "maybe"; then
422   AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION)
423   req_major=`echo $NEED_GPGSM_VERSION | \
424              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
425   req_minor=`echo $NEED_GPGSM_VERSION | \
426              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
427   req_micro=`echo $NEED_GPGSM_VERSION | \
428              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
429   GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
430   major=`echo $GPGSM_VERSION | \
431          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
432   minor=`echo $GPGSM_VERSION | \
433          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
434   micro=`echo $GPGSM_VERSION | \
435          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
436
437   if test "$major" -gt "$req_major"; then
438     ok=yes
439   else
440     if test "$major" -eq "$req_major"; then
441       if test "$minor" -gt "$req_minor"; then
442         ok=yes
443       else
444         if test "$minor" -eq "$req_minor"; then
445           if test "$micro" -ge "$req_micro"; then
446             ok=yes
447           fi
448         fi
449       fi
450     fi
451   fi
452   if test "$ok" = "yes"; then
453     AC_MSG_RESULT(yes)
454   else
455     AC_MSG_RESULT(no)
456     AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
457   fi
458 fi
459 run_gpgsm_test="$ok"
460 AC_ARG_ENABLE(gpgsm-test,
461   AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
462          run_gpgsm_test=$enableval)
463 AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
464
465
466 # FIXME: Only build if supported.
467 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
468 if test "$GPGSM" != "no"; then
469   AC_DEFINE(HAVE_ASSUAN_H, 1,
470             [Defined if we are building with assuan support.])
471 fi
472
473 # Check for funopen
474 AC_CHECK_FUNCS(funopen)
475 if test $ac_cv_func_funopen != yes; then
476     # No funopen but we can implement that in terms of fopencookie.
477     AC_CHECK_FUNCS(fopencookie)
478     if test $ac_cv_func_fopencookie = yes; then
479         AC_REPLACE_FUNCS(funopen)
480     else
481         AC_MSG_WARN([
482 ***
483 *** No implementation of fopencookie or funopen available
484 ***])
485     fi
486 fi
487
488 # More assuan replacement functions.
489 AC_REPLACE_FUNCS(isascii)
490 AC_REPLACE_FUNCS(putc_unlocked)
491 AC_REPLACE_FUNCS(memrchr)
492 AC_REPLACE_FUNCS(stpcpy)
493 # Check for unistd.h for setenv replacement function.
494 AC_CHECK_HEADERS(unistd.h)
495 AC_REPLACE_FUNCS(setenv)
496
497 # More assuan checks.
498 AC_CHECK_HEADERS([sys/uio.h])
499
500 # Assuan check for descriptor passing.
501 AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
502                 [supports_descriptor_passing=yes],
503                 [supports_descriptor_passing=no
504                  AC_MSG_WARN([
505 ***
506 *** Data structure for sending ancillary data missing.
507 *** Descriptor passing won't work.
508 ***])],[
509 #include <stdlib.h>
510 #include <stddef.h>
511 #include <stdio.h>
512 #include <sys/types.h>
513 #include <sys/socket.h>
514 #include <sys/un.h>
515 #if HAVE_SYS_UIO_H
516 #include <sys/uio.h>
517 #endif
518 #include <unistd.h>
519        ])
520
521 AC_ARG_ENABLE(fd-passing,
522   AC_HELP_STRING([--enable-fd-passing], [use FD passing if supported]),
523   use_descriptor_passing=$enableval)
524
525 if test "$supports_descriptor_passing" != "yes"; then
526   use_descriptor_passing=no
527 fi
528
529 if test "$use_descriptor_passing" = "yes"; then
530 AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
531           [Defined if descriptor passing is enabled and supported])
532 fi
533
534 AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
535
536 # Assuan check for the getsockopt SO_PEERCRED
537 AC_MSG_CHECKING(for SO_PEERCRED)
538 AC_CACHE_VAL(assuan_cv_sys_so_peercred,
539       [AC_TRY_COMPILE([#include <sys/socket.h>], 
540          [struct ucred cr; 
541           int cl = sizeof cr;
542           getsockopt (1, SOL_SOCKET, SO_PEERCRED, &cr, &cl);],
543           assuan_cv_sys_so_peercred=yes,
544           assuan_cv_sys_so_peercred=no)
545        ])
546 AC_MSG_RESULT($assuan_cv_sys_so_peercred) 
547 if test $assuan_cv_sys_so_peercred = yes; then
548   AC_DEFINE(HAVE_SO_PEERCRED, 1,
549             [Defined if SO_PEERCRED is supported (Linux specific)])
550 fi
551
552 if test "$have_w32_system" = yes; then
553    NETLIBS="-lws2_32 $NETLIBS"
554 fi
555
556 # End of assuan checks.
557
558 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
559
560 # Make the version number in gpgme/gpgme.h the same as the one here.
561 # (this is easier than to have a *.in file just for one substitution)
562 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
563
564 # Generate values for the DLL version info
565 changequote(,)dnl 
566 BUILD_REVISION="`echo '$Revision$' | sed 's/[^0-9]//g'`"
567 changequote([,])dnl
568 test -z "$BUILD_REVISION" && BUILD_REVISION="0"
569 if test "$have_w32_system" = yes; then
570     BUILD_TIMESTAMP=`date --iso-8601=minutes`
571     changequote(,)dnl 
572     BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
573     changequote([,])dnl
574     BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
575 fi
576 AC_SUBST(BUILD_REVISION)
577 AC_SUBST(BUILD_TIMESTAMP)
578 AC_SUBST(BUILD_FILEVERSION)
579
580 # Add a few constants to help porting to W32
581 AH_VERBATIM([SEPCONSTANTS],
582 [
583 /* Separators as used in $PATH.  */
584 #ifdef HAVE_DOSISH_SYSTEM
585 #define PATHSEP_C ';'
586 #else
587 #define PATHSEP_C ':'
588 #endif
589 ])
590
591 AH_BOTTOM([
592 /* Definition of GCC specific attributes.  */
593 #if __GNUC__ > 2 
594 # define GPGME_GCC_A_PURE  __attribute__ ((__pure__))
595 #else
596 # define GPGME_GCC_A_PURE
597 #endif
598 ])
599
600
601 # Substitution used for gpgme-config 
602 GPGME_CONFIG_LIBS="-lgpgme"
603 GPGME_CONFIG_CFLAGS=""
604 AC_SUBST(GPGME_CONFIG_API_VERSION)
605 AC_SUBST(GPGME_CONFIG_LIBS)
606 AC_SUBST(GPGME_CONFIG_CFLAGS)
607
608 # Frob'da Variables
609 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
610            sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
611 AC_SUBST(LTLIBOBJS)
612
613 #
614 # Create config files 
615
616 AC_CONFIG_FILES(Makefile assuan/Makefile gpgme/Makefile
617                 tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
618                 doc/Makefile complus/Makefile
619                 gpgme/versioninfo.rc)
620 AC_CONFIG_FILES(gpgme/gpgme-config, chmod +x gpgme/gpgme-config)
621 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
622 AC_OUTPUT
623
624 echo "
625         GPGME v${VERSION} has been configured as follows:
626
627         GnuPG path:    $GPG
628         GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
629
630         GpgSM path:    $GPGSM
631         GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
632
633         GPGME Pthread: $have_pthread
634         GPGME Pth:     $have_pth
635 "