summaryrefslogtreecommitdiff
path: root/source3/aclocal.m4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-05-30 12:28:13 +0000
committerAndrew Tridgell <tridge@samba.org>2001-05-30 12:28:13 +0000
commit05d08414728313e2ca04cd5ccbd3ce9d3470a0a3 (patch)
treeb2af01ef32b440fec6d89b097246aa86840b1941 /source3/aclocal.m4
parentad7c3ea0f0918f09283ab28e4fe99f1156ab52f1 (diff)
downloadsamba-05d08414728313e2ca04cd5ccbd3ce9d3470a0a3.tar.gz
samba-05d08414728313e2ca04cd5ccbd3ce9d3470a0a3.tar.bz2
samba-05d08414728313e2ca04cd5ccbd3ce9d3470a0a3.zip
- added AC_HAVE_DECL() macro to aclocal.m4, so we can easily add
tests for a fn or variable being defined in headers - used this to add prototypes for asprintf and vasprintf on systems that don't have them (This used to be commit ab2465239414853a14529f88a25f13c392aa2d3f)
Diffstat (limited to 'source3/aclocal.m4')
-rw-r--r--source3/aclocal.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/aclocal.m4 b/source3/aclocal.m4
index 9a7145402a..13788f99be 100644
--- a/source3/aclocal.m4
+++ b/source3/aclocal.m4
@@ -49,6 +49,20 @@ fi
rm -f conftest*
])])
+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])
+ fi
+])
+
+
dnl check for a function in a library, but don't
dnl keep adding the same library to the LIBS variable.
dnl AC_LIBTESTFUNC(lib,func)