1 dnl Macros to configure GPGME
2 dnl Copyright (C) 2004 g10 Code GmbH
4 dnl This file is part of GPGME.
6 dnl GPGME is free software; you can redistribute it and/or modify it
7 dnl under the terms of the GNU Lesser General Public License as
8 dnl published by the Free Software Foundation; either version 2.1 of the
9 dnl License, or (at your option) any later version.
11 dnl GPGME is distributed in the hope that it will be useful, but WITHOUT
12 dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14 dnl Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this program; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 dnl GNUPG_FIX_HDR_VERSION(FILE, NAME)
21 dnl Make the version number stored in NAME in the header file FILE the
22 dnl same as the one here. This is easier than to have a .in file just
23 dnl for one substitution.
24 dnl We must use a temp file in the current directory because make
25 dnl distcheck installs all sourcefiles RO.
27 AC_DEFUN([GNUPG_FIX_HDR_VERSION],
28 [ sed "s/^#define $2 \".*/#define $2 \"$VERSION\"/" $srcdir/$1 > fixhdr.tmp
29 if cmp -s $srcdir/$1 fixhdr.tmp 2>/dev/null; then
33 if mv fixhdr.tmp $srcdir/$1 ; then
38 *** Failed to fix the version string macro $2 in $1.
39 *** The old file has been saved as fixhdr.tmp
42 AC_MSG_WARN([fixed the $2 macro in $1])
46 dnl GNUPG_CHECK_VA_COPY()
47 dnl Do some check on how to implement va_copy.
48 dnl May define MUST_COPY_VA_BY_VAL.
49 dnl Actual test code taken from glib-1.1.
50 AC_DEFUN([GNUPG_CHECK_VA_COPY],
51 [ AC_MSG_CHECKING(whether va_lists must be copied by value)
52 AC_CACHE_VAL(gnupg_cv_must_copy_va_byval,[
53 if test "$cross_compiling" = yes; then
54 gnupg_cv_must_copy_va_byval=no
56 gnupg_cv_must_copy_va_byval=no
64 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
75 ],gnupg_cv_must_copy_va_byval=yes)
78 if test "$gnupg_cv_must_copy_va_byval" = yes; then
79 AC_DEFINE(MUST_COPY_VA_BYVAL,1,[used to implement the va_copy macro])
81 if test "$cross_compiling" = yes; then
82 AC_MSG_RESULT(assuming $gnupg_cv_must_copy_va_byval)
84 AC_MSG_RESULT($gnupg_cv_must_copy_va_byval)