s3: Test for "__attribute__((destructor))"
authorVolker Lendecke <vl@samba.org>
Mon, 10 May 2010 09:53:03 +0000 (11:53 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 10 May 2010 10:11:19 +0000 (12:11 +0200)
source3/configure.in

index d61fed8a366446592c674afee9f204ca430311cb..f7c06770544e569c282091847bb8afe5f5bb451f 100644 (file)
@@ -1362,6 +1362,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)