/
[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 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.3])
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=1
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         # XXX Assuan is not supported in this configuration.
127         #GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
128         #component_system='COM+'
129         ;;
130     *)
131         AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
132         if test "$have_pth" = yes; then
133           AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
134         fi
135         AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
136         if test "$have_pthread" = yes; then
137           AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
138         fi
139
140         # XXX: Probably use exec-prefix here?
141 #       GPG_DEFAULT='/usr/bin/gpg'
142 #       GPGSM_DEFAULT='/usr/bin/gpgsm'
143         ;;
144 esac
145
146 if test "$have_dosish_system" = yes; then
147    AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
148              [Defined if we run on some of the PCDOS like systems 
149               (DOS, Windoze. OS/2) with special properties like
150               no file modes])
151 fi
152 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
153
154 if test "$have_w32_system" = yes; then
155    AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
156 fi
157 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
158
159 build_w32_glib=no
160 AM_PATH_GLIB_2_0
161 AC_ARG_ENABLE(w32-glib,
162             AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
163             build_w32_glib=$withval)
164 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
165
166 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
167 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
168
169
170 # Checks for header files.
171 AC_CHECK_HEADERS(sys/select.h)
172
173
174 # Type checks.
175 AC_C_INLINE
176 AC_CHECK_SIZEOF(unsigned int)
177 AC_SYS_LARGEFILE
178 AC_TYPE_OFF_T
179
180 # Checks for compiler features.
181 if test "$GCC" = yes; then
182     CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
183     if test "$have_w32_system" = yes; then
184        CFLAGS="$CFLAGS -mms-bitfields"
185     fi
186 fi
187
188 # Network library fun.
189 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
190         [NETLIBS="-lnsl $NETLIBS"]))
191 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
192         [NETLIBS="-lsocket $NETLIBS"]))
193 AC_SUBST(NETLIBS)
194
195 # Checks for library functions.
196 AC_FUNC_FSEEKO
197
198 AC_REPLACE_FUNCS(vasprintf)
199 if test "$ac_cv_func_vasprintf" != yes; then
200   GNUPG_CHECK_VA_COPY
201 fi
202
203 # Try to find a thread-safe version of ttyname().
204 AC_REPLACE_FUNCS(ttyname_r)
205 if test "$ac_cv_func_ttyname_r" != yes; then
206   AC_MSG_WARN([
207 ***
208 *** ttyname() is not thread-safe and ttyname_r() does not exist
209 ***])
210 fi
211
212 # Try to find a thread-safe version of getenv().
213 have_thread_safe_getenv=no
214 jm_GLIBC21
215 if test $GLIBC21 = yes; then
216   have_thread_safe_getenv=yes
217 fi
218 if test $have_thread_safe_getenv = yes; then
219   AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
220 fi
221 have_getenv_r=no
222 AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
223 if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
224   AC_MSG_WARN([
225 ***
226 *** getenv() is not thread-safe and getenv_r() does not exist
227 ***])
228 fi
229
230 # For converting time strings to seconds since Epoch, we need the timegm
231 # function.
232 AC_CHECK_FUNCS(timegm)
233 if test "$ac_cv_func_timegm" != yes; then
234   AC_MSG_WARN([
235 ***
236 *** timegm() not available - a non-thread-safe kludge will be used
237 *** and the TZ variable might be changed at runtime.
238 ***])
239 fi
240
241 # Checking for libgpg-error.
242 AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
243 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
244           [The default error source for GPGME.])
245
246
247
248 # Checks for system services
249 NEED_GPG_VERSION_DEFAULT=1.3.0
250 NEED_GPGSM_VERSION_DEFAULT=1.9.6
251 NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
252 NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
253 AC_ARG_WITH(gpg-version,
254             AC_HELP_STRING([--with-gpg-version=VER], [require GnuPG version VER]),
255             NEED_GPG_VERSION=$withval)
256 if test "$NEED_GPG_VERSION" = "yes"; then
257   NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
258 fi
259 if test "$NEED_GPG_VERSION" = "no"; then
260   NEED_GPG_VERSION=0.0.0
261 fi
262 AC_ARG_WITH(gpgsm-version,
263             AC_HELP_STRING([--with-gpgsm-version=VER], [require GPGSM version VER]),
264             NEED_GPGSM_VERSION=$withval)
265 if test "$NEED_GPGSM_VERSION" = "yes"; then
266   NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
267 fi
268 if test "$NEED_GPGSM_VERSION" = "no"; then
269   NEED_GPGSM_VERSION=0.0.0
270 fi
271
272 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
273                                      [Min. needed GnuPG version.])
274 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
275                                        [Min. needed GPGSM version.])
276
277
278 NO_OVERRIDE=no
279 AC_ARG_WITH(gpg,
280             AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
281             GPG=$withval, NO_OVERRIDE=yes)
282 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
283   GPG=
284   NO_OVERRIDE=yes
285   if test "$cross_compiling" != "yes"; then
286     AC_PATH_PROG(GPG, gpg)
287   fi
288   if test -z "$GPG"; then
289     GPG="$GPG_DEFAULT"
290   fi
291 fi
292 if test "$GPG" = no; then
293   if test "$NO_OVERRIDE" = "yes"; then
294     if test "$cross_compiling" != "yes"; then
295       AC_MSG_WARN([
296 ***
297 *** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it
298 ***])
299     else
300       AC_MSG_ERROR([
301 ***
302 *** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH
303 ***])
304     fi
305   fi
306 else
307   AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
308   AC_SUBST(GPG)
309 fi
310 dnl Check for GnuPG version requirement.
311 GPG_VERSION=unknown
312 ok=maybe
313 if test -z "$GPG" -o "x$GPG" = "xno"; then
314   ok=no
315 else
316   if test "$cross_compiling" = "yes"; then
317     AC_MSG_WARN([GnuPG version can not be checked when cross compiling])
318     ok=no
319   else
320     if test ! -x "$GPG"; then
321       AC_MSG_WARN([GnuPG not executable, version check disabled])
322       ok=no
323     fi
324   fi
325 fi
326 if test "$ok" = "maybe"; then
327   AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
328   req_major=`echo $NEED_GPG_VERSION | \
329              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
330   req_minor=`echo $NEED_GPG_VERSION | \
331              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
332   req_micro=`echo $NEED_GPG_VERSION | \
333              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
334   GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
335   major=`echo $GPG_VERSION | \
336          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
337   minor=`echo $GPG_VERSION | \
338          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
339   micro=`echo $GPG_VERSION | \
340          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
341
342   if test "$major" -gt "$req_major"; then
343     ok=yes
344   else
345     if test "$major" -eq "$req_major"; then
346       if test "$minor" -gt "$req_minor"; then
347         ok=yes
348       else
349         if test "$minor" -eq "$req_minor"; then
350           if test "$micro" -ge "$req_micro"; then
351             ok=yes
352           fi
353         fi
354       fi
355     fi
356   fi
357   if test "$ok" = "yes"; then
358     AC_MSG_RESULT(yes)
359   else
360     AC_MSG_RESULT(no)
361     AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
362   fi
363 fi
364 run_gpg_test="$ok"
365 AC_ARG_ENABLE(gpg-test,
366   AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
367          run_gpg_test=$enableval)
368 AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
369 AC_SUBST(GPG_PATH)
370
371 NO_OVERRIDE=no
372 AC_ARG_WITH(gpgsm,
373             AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
374             GPGSM=$withval, NO_OVERRIDE=yes)
375 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
376   GPGSM=
377   NO_OVERRIDE=yes
378   if test "$cross_compiling" != "yes"; then
379     AC_PATH_PROG(GPGSM, gpgsm)
380   fi
381   if test -z "$GPGSM"; then
382     GPGSM="$GPGSM_DEFAULT"
383   fi
384 fi
385 if test "$GPGSM" = no; then
386   if test "$NO_OVERRIDE" = "yes"; then
387     if test "$cross_compiling" != "yes"; then
388       AC_MSG_WARN([
389 ***
390 *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it
391 ***])
392     else
393       AC_MSG_ERROR([
394 ***
395 *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH
396 ***])
397     fi
398   fi
399 else
400   AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
401   AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled])
402 fi
403 AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no")
404
405
406 dnl Check for GPGSM version requirement.
407 GPGSM_VERSION=unknown
408 ok=maybe
409 if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then
410   ok=no
411 else
412   if test "$cross_compiling" = "yes"; then
413     AC_MSG_WARN([GPGSM version can not be checked when cross compiling])
414     ok=no
415   else
416     if test ! -x "$GPGSM"; then
417       AC_MSG_WARN([GPGSM not executable, version check disabled])
418       ok=no
419     fi
420   fi
421 fi
422 if test "$ok" = "maybe"; then
423   AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION)
424   req_major=`echo $NEED_GPGSM_VERSION | \
425              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
426   req_minor=`echo $NEED_GPGSM_VERSION | \
427              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
428   req_micro=`echo $NEED_GPGSM_VERSION | \
429              sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
430   GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
431   major=`echo $GPGSM_VERSION | \
432          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
433   minor=`echo $GPGSM_VERSION | \
434          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
435   micro=`echo $GPGSM_VERSION | \
436          sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
437
438   if test "$major" -gt "$req_major"; then
439     ok=yes
440   else
441     if test "$major" -eq "$req_major"; then
442       if test "$minor" -gt "$req_minor"; then
443         ok=yes
444       else
445         if test "$minor" -eq "$req_minor"; then
446           if test "$micro" -ge "$req_micro"; then
447             ok=yes
448           fi
449         fi
450       fi
451     fi
452   fi
453   if test "$ok" = "yes"; then
454     AC_MSG_RESULT(yes)
455   else
456     AC_MSG_RESULT(no)
457     AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
458   fi
459 fi
460 run_gpgsm_test="$ok"
461 AC_ARG_ENABLE(gpgsm-test,
462   AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
463          run_gpgsm_test=$enableval)
464 AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
465
466
467 # FIXME: Only build if supported.
468 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
469 if test "$GPGSM" != "no"; then
470   AC_DEFINE(HAVE_ASSUAN_H, ,[Defined if we are building with assuan support.])
471 fi
472
473 # The assuan code uses funopen but it will also build without it.  So
474 # test for it.  Frankly, this is not required in gpgme, but thats the
475 # way we handle it in libassuan.
476 AC_CHECK_FUNCS(funopen)
477 if test $ac_cv_func_funopen != yes; then
478     # No funopen but we can implement that in terms of fopencookie.
479     AC_CHECK_FUNCS(fopencookie)
480     if test $ac_cv_func_fopencookie = yes; then
481         AC_LIBOBJ([funopen])
482     else
483         AC_MSG_WARN([
484 ***
485 *** No implementation of fopencookie or funopen available
486 ***])
487     fi
488 fi
489
490 # More assuan replacement functions.
491 AC_REPLACE_FUNCS(isascii)
492 AC_REPLACE_FUNCS(putc_unlocked)
493 AC_REPLACE_FUNCS(memrchr)
494 AC_REPLACE_FUNCS(stpcpy)
495 # Check for unistd.h for setenv replacement function.
496 AC_CHECK_HEADERS(unistd.h)
497 AC_REPLACE_FUNCS(setenv)
498
499 # More assuan checks.
500 AC_CHECK_HEADERS([sys/uio.h])
501
502 # Assuan check for descriptor passing.
503 AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
504                 [supports_descriptor_passing=yes],
505                 [supports_descriptor_passing=no
506                  AC_MSG_WARN([
507 ***
508 *** Data structure for sending ancillary data missing.
509 *** Descriptor passing won't work.
510 ***])],[
511 #include <stdlib.h>
512 #include <stddef.h>
513 #include <stdio.h>
514 #include <sys/types.h>
515 #include <sys/socket.h>
516 #include <sys/un.h>
517 #if HAVE_SYS_UIO_H
518 #include <sys/uio.h>
519 #endif
520 #include <unistd.h>
521        ])
522
523 AC_ARG_ENABLE(fd-passing,
524   AC_HELP_STRING([--enable-fd-passing], [use FD passing if supported]),
525   use_descriptor_passing=$enableval)
526
527 if test "$supports_descriptor_passing" != "yes"; then
528   use_descriptor_passing=no
529 fi
530
531 if test "$use_descriptor_passing" = "yes"; then
532   fd_passing=1
533 else
534   fd_passing=0
535 fi
536
537 AC_DEFINE_UNQUOTED(USE_DESCRIPTOR_PASSING, $fd_passing,
538           [Defined if descriptor passing is enabled and supported])
539 AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
540
541 # End of assuan checks.
542
543 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
544
545 # Make the version number in gpgme/gpgme.h the same as the one here.
546 # (this is easier than to have a *.in file just for one substitution)
547 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
548
549 # Generate values for the DLL version info
550 changequote(,)dnl 
551 BUILD_REVISION="`echo '$Revision$' | sed 's/[^0-9]//g'`"
552 changequote([,])dnl
553 test -z "$BUILD_REVISION" && BUILD_REVISION="0"
554 if test "$have_w32_system" = yes; then
555     BUILD_TIMESTAMP=`date --iso-8601=minutes`
556     changequote(,)dnl 
557     BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
558     changequote([,])dnl
559     BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
560 fi
561 AC_SUBST(BUILD_REVISION)
562 AC_SUBST(BUILD_TIMESTAMP)
563 AC_SUBST(BUILD_FILEVERSION)
564
565 # Add a few constants to help porting to W32
566 AH_VERBATIM([SEPCONSTANTS],
567 [
568 /* Separators as used in file names and $PATH. Please note that the
569    string version must not contain more than one character because
570    the using code assumes strlen()==1 */
571 #ifdef HAVE_DOSISH_SYSTEM
572 #define DIRSEP_C '\\\\'
573 #define EXTSEP_C '.'
574 #define DIRSEP_S "\\\\"
575 #define EXTSEP_S "."
576 #define PATHSEP_C ';'
577 #define PATHSEP_S ";"
578 #else
579 #define DIRSEP_C '/'
580 #define EXTSEP_C '.'
581 #define DIRSEP_S "/"
582 #define EXTSEP_S "."
583 #define PATHSEP_C ':'
584 #define PATHSEP_S ":"
585 #endif
586 ])
587
588 AH_BOTTOM([
589 /* Definition of GCC specific attributes.  */
590 #if __GNUC__ > 2 
591 # define GPGME_GCC_A_PURE  __attribute__ ((__pure__))
592 #else
593 # define GPGME_GCC_A_PURE
594 #endif
595 ])
596
597
598 # Substitution used for gpgme-config 
599 GPGME_CONFIG_LIBS="-lgpgme"
600 GPGME_CONFIG_CFLAGS=""
601 AC_SUBST(GPGME_CONFIG_API_VERSION)
602 AC_SUBST(GPGME_CONFIG_LIBS)
603 AC_SUBST(GPGME_CONFIG_CFLAGS)
604
605 # Frob'da Variables
606 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
607            sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
608 AC_SUBST(LTLIBOBJS)
609
610 #
611 # Create config files 
612
613 AC_CONFIG_FILES(Makefile assuan/Makefile gpgme/Makefile
614                 tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
615                 doc/Makefile complus/Makefile
616                 gpgme/versioninfo.rc)
617 AC_CONFIG_FILES(gpgme/gpgme-config, chmod +x gpgme/gpgme-config)
618 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
619 AC_OUTPUT
620
621 echo "
622         GPGME v${VERSION} has been configured as follows:
623
624         GnuPG path:    $GPG
625         GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
626
627         GpgSM path:    $GPGSM
628         GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
629
630         GPGME Pthread: $have_pthread
631         GPGME Pth:     $have_pth
632 "