diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /third_party/heimdal/cf/check-var.m4 | |
parent | Initial commit. (diff) | |
download | samba-upstream.tar.xz samba-upstream.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal/cf/check-var.m4')
-rw-r--r-- | third_party/heimdal/cf/check-var.m4 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/third_party/heimdal/cf/check-var.m4 b/third_party/heimdal/cf/check-var.m4 new file mode 100644 index 0000000..71d6f70 --- /dev/null +++ b/third_party/heimdal/cf/check-var.m4 @@ -0,0 +1,28 @@ +dnl $Id$ +dnl +dnl rk_CHECK_VAR(variable, includes) +AC_DEFUN([rk_CHECK_VAR], [ +AC_MSG_CHECKING(for $1) +AC_CACHE_VAL(ac_cv_var_$1, [ +m4_ifval([$2],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2 + void * foo(void) { return &$1; }]],[[foo()]])], + [ac_cv_var_$1=yes],[ac_cv_var_$1=no])]) +if test "$ac_cv_var_$1" != yes ; then +AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2 +extern int $1; +int foo(void) { return $1; }]],[[foo()]])], + [ac_cv_var_$1=yes],[ac_cv_var_$1=no]) +fi +]) +ac_foo=`eval echo \\$ac_cv_var_$1` +AC_MSG_RESULT($ac_foo) +if test "$ac_foo" = yes; then + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]$1), 1, + [Define if you have the `]$1[' variable.]) + m4_ifval([$2], [AC_CHECK_DECLS([$1],[],[],[$2])]) +fi +]) + +AC_WARNING_ENABLE([obsolete]) +AU_DEFUN([AC_CHECK_VAR], [rk_CHECK_VAR([$2], [$1])], [foo]) |