From c69ab4252d9aea274f44f96b1e3f41ca57185987 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 May 2010 11:53:03 +0200 Subject: [PATCH] s3: Test for "__attribute__((destructor))" (cherry picked from commit 36e736871e28665ffcbbc4d0c87e1a2b60fcf0e0) Fix bug #8322 (HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR is missing from 3.5.x). --- source3/configure.in | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source3/configure.in b/source3/configure.in index 2c9fe1e7c42..24945936d92 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1331,6 +1331,22 @@ if test x"$samba_cv_stat_dos_flags" = x"yes" ; then AC_DEFINE(HAVE_STAT_DOS_FLAGS, 1, [whether there is DOS flags support in the stat struct]) fi +AC_CACHE_CHECK([whether we can compile with __attribute__((destructor))], + samba_cv_function_attribute_destructor, + [ + AC_COMPILE_IFELSE( + [ + __attribute__((destructor)) + static void cleanup(void) { } + ], + samba_cv_function_attribute_destructor=yes) + ]) + +if test x"$samba_cv_function_attribute_destructor" = xyes ; then + AC_DEFINE(HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR, 1, + [whether we can compile with __attribute__((destructor))]) +fi + ##################################### # needed for SRV lookups AC_CHECK_LIB(resolv, dn_expand) -- 2.11.4.GIT