configure: set HAVE___ATTRIBUTE__ for heimdal
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Mon, 7 Mar 2016 21:23:09 +0000 (10:23 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 9 Mar 2016 12:52:26 +0000 (13:52 +0100)
Without this, heimdal ends up defining __attribute__ away, causing
gcc-6 compile errors with -Werror=return-type because it can't tell
when functions have __attribute__((noreturn)).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar  9 13:52:26 CET 2016 on sn-devel-144

buildtools/wafsamba/wscript

index 586cc4be5f17194d6b0c784f95d70e6a0ae5fc71..8802e5a39d45020f9a7918148f1919acaa25ab49 100755 (executable)
@@ -402,6 +402,22 @@ def configure(conf):
             addmain=False,
             msg='Checking for library destructor support')
 
+    conf.CHECK_CODE('''
+            void test_attribute(void) __attribute__ (());
+
+            void test_attribute(void)
+            {
+                return;
+            }
+
+            int main(void) {
+                return 0;
+            }
+            ''',
+            'HAVE___ATTRIBUTE__',
+            addmain=False,
+            msg='Checking for __attribute__')
+
     if sys.platform.startswith('aix'):
         conf.DEFINE('_ALL_SOURCE', 1, add_to_cflags=True)
         # Might not be needed if ALL_SOURCE is defined