Statistics
| Revision:

root / ac / gnupg-check-typedef.m4 @ 6

History | View | Annotate | Download (530 Bytes)

1 1 hiro
dnl GNUPG_CHECK_TYPEDEF(TYPE, HAVE_NAME [, COMMENT])
2 1 hiro
dnl Check whether a typedef exists and create a #define $2 if it exists
3 1 hiro
dnl
4 1 hiro
AC_DEFUN(GNUPG_CHECK_TYPEDEF,
5 1 hiro
  [ AC_MSG_CHECKING(for $1 typedef)
6 1 hiro
    AC_CACHE_VAL(gnupg_cv_typedef_$1,
7 1 hiro
    [AC_TRY_COMPILE([#include <stdlib.h>
8 1 hiro
    #include <sys/types.h>], [
9 1 hiro
    #undef $1
10 1 hiro
    int a = sizeof($1);
11 1 hiro
    ], gnupg_cv_typedef_$1=yes, gnupg_cv_typedef_$1=no )])
12 1 hiro
    AC_MSG_RESULT($gnupg_cv_typedef_$1)
13 1 hiro
    if test "$gnupg_cv_typedef_$1" = yes; then
14 1 hiro
        AC_DEFINE($2, 1, $3)
15 1 hiro
    fi
16 1 hiro
  ])