summaryrefslogtreecommitdiff
path: root/source4/heimdal
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2005-08-15 01:38:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:33:23 -0500
commit65ec408473972099f08d3ff0485e5f07244ad94c (patch)
treebe5bcfcfbb0d2449e897e1b3482c935dc7afad84 /source4/heimdal
parentd452cd061cbc8a1a4fcf78139fd5386800f4f48d (diff)
downloadsamba-65ec408473972099f08d3ff0485e5f07244ad94c.tar.gz
samba-65ec408473972099f08d3ff0485e5f07244ad94c.tar.bz2
samba-65ec408473972099f08d3ff0485e5f07244ad94c.zip
r9305: Use the check-var.m4 from roken to really, really detect h_errno correctly.
This fixes the build on Fedora Core 4. Andrew Bartlett (This used to be commit aa36b2adad0d66b8171aa3ccca3057298361bec5)
Diffstat (limited to 'source4/heimdal')
-rw-r--r--source4/heimdal/cf/check-var.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/heimdal/cf/check-var.m4 b/source4/heimdal/cf/check-var.m4
new file mode 100644
index 0000000000..41401f6dd9
--- /dev/null
+++ b/source4/heimdal/cf/check-var.m4
@@ -0,0 +1,25 @@
+dnl $Id: check-var.m4,v 1.12 2005/06/16 18:59:10 lha Exp $
+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([[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
+])
+