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
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 2 of the License, or
9 dnl (at your option) any later version.
11 dnl GPGME is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 dnl GNU General Public License for more details.
16 dnl You should have received a copy of the GNU General Public License
17 dnl 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 gnupg_cv_must_copy_va_byval=no
61 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
72 ],gnupg_cv_must_copy_va_byval=yes)
74 if test "$gnupg_cv_must_copy_va_byval" = yes; then
75 AC_DEFINE(MUST_COPY_VA_BYVAL,1,[used to implement the va_copy macro])
77 AC_MSG_RESULT($gnupg_cv_must_copy_va_byval)