summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-09-06 02:07:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:36 -0500
commit3e11f4c06131542565149496d659f0050411a68f (patch)
tree78cbbf85c488eaac3679121fa3ac68035a6b61d7
parent0e8d1e9412b4538ceb008b82ddec423c2019757f (diff)
downloadsamba-3e11f4c06131542565149496d659f0050411a68f.tar.gz
samba-3e11f4c06131542565149496d659f0050411a68f.tar.bz2
samba-3e11f4c06131542565149496d659f0050411a68f.zip
r18127: Add macro AC_CHECK_DECL() for systems that don't have it.
(This used to be commit 589a1c250934a61db0f86c1e98962e195e681c79)
-rw-r--r--source4/lib/replace/libreplace.m413
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index c396f11dfd..ce36ee39b4 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -1,3 +1,16 @@
+dnl see if a declaration exists for a function or variable
+dnl defines HAVE_function_DECL if it exists
+dnl AC_HAVE_DECL(var, includes)
+AC_DEFUN(AC_HAVE_DECL,
+[
+ AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
+ AC_TRY_COMPILE([$2],[int i = (int)$1],
+ ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
+ if test x"$ac_cv_have_$1_decl" = x"yes"; then
+ AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
+ fi
+])
+
dnl find the libreplace sources. This is meant to work both for
dnl libreplace standalone builds, and builds of packages using libreplace
libreplacedir=""