s3: Test for "__attribute__((destructor))"
authorVolker Lendecke <vl@samba.org>
Mon, 10 May 2010 09:53:03 +0000 (11:53 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 2 Aug 2011 19:10:01 +0000 (21:10 +0200)
(cherry picked from commit 36e736871e28665ffcbbc4d0c87e1a2b60fcf0e0)

Fix bug #8322 (HAVE_FUNCTION_ATTRIBUTE_DESTRUCTOR is missing from 3.5.x).
(cherry picked from commit c69ab4252d9aea274f44f96b1e3f41ca57185987)

source3/configure.in

index 2c9fe1e7c42323f7ed801fca4dd1372a83ac04f5..24945936d921886e760afda928241fc10645155c 100644 (file)
@@ -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)