tests: Use here-doc kadmin in Java test
[heimdal.git] / cf / ax_check_sign.m4
blobbc2c3f034ce77ef5a8e2d6c6eb5475bb5d0ceedf
1 # ===========================================================================
2 #      https://www.gnu.org/software/autoconf-archive/ax_check_sign.html
3 # ===========================================================================
5 # SYNOPSIS
7 #   AX_CHECK_SIGN (TYPE, [ACTION-IF-SIGNED], [ACTION-IF-UNSIGNED], [INCLUDES])
9 # DESCRIPTION
11 #   Checks whether TYPE is signed or not. If no INCLUDES are specified, the
12 #   default includes are used. If ACTION-IF-SIGNED is given, it is
13 #   additional shell code to execute when the type is signed. If
14 #   ACTION-IF-UNSIGNED is given, it is executed when the type is unsigned.
16 #   This macro assumes that the type exists. Therefore the existence of the
17 #   type should be checked before calling this macro. For example:
19 #     AC_CHECK_HEADERS([wchar.h])
20 #     AC_CHECK_TYPE([wchar_t],,[ AC_MSG_ERROR([Type wchar_t not found.]) ])
21 #     AX_CHECK_SIGN([wchar_t],
22 #       [ AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ],
23 #       [ AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned]) ], [
24 #     #ifdef HAVE_WCHAR_H
25 #     #include <wchar.h>
26 #     #endif
27 #     ])
29 # LICENSE
31 #   Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
33 #   Copying and distribution of this file, with or without modification, are
34 #   permitted in any medium without royalty provided the copyright notice
35 #   and this notice are preserved. This file is offered as-is, without any
36 #   warranty.
38 #serial 7
40 AU_ALIAS([VL_CHECK_SIGN], [AX_CHECK_SIGN])
41 AC_DEFUN([AX_CHECK_SIGN], [
42  typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"`
43  AC_CACHE_CHECK([whether $1 is signed], ax_cv_decl_${typename}_signed, [
44    AC_TRY_COMPILE([$4],
45      [ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ],
46      [ eval "ax_cv_decl_${typename}_signed=\"yes\"" ],
47      [ eval "ax_cv_decl_${typename}_signed=\"no\"" ])])
48  symbolname=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g" | tr "a-z" "A-Z"`
49  if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
50    $2
51  elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
52    $3
53  fi
54 ])dnl