diff options
author | Andrew Bartlett <abartlet@samba.org> | 2015-02-24 13:26:29 +1300 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2015-10-09 20:14:06 +0200 |
commit | 1dc05386f20481596ee7360d6f4e628a16675d3f (patch) | |
tree | 3145de0a4c237250602e75504620635ea8dbf41d /buildtools | |
parent | f25a5c9e84e802bc7005d6bd400cbf784fb30fdf (diff) | |
download | samba-1dc05386f20481596ee7360d6f4e628a16675d3f.tar.gz |
build: Move __attribute__ ((destructor)) and ((constructor)) tests to wafsamba
This allows us to use them in talloc as well.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'buildtools')
-rwxr-xr-x | buildtools/wafsamba/wscript | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index d6bb6885a1c..422b74254ff 100755 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -361,6 +361,40 @@ def configure(conf): cflags=conf.env.VISIBILITY_CFLAGS, define='HAVE_VISIBILITY_ATTR', addmain=False) + # check HAVE_CONSTRUCTOR_ATTRIBUTE + conf.CHECK_CODE(''' + void test_constructor_attribute(void) __attribute__ ((constructor)); + + void test_constructor_attribute(void) + { + return; + } + + int main(void) { + return 0; + } + ''', + 'HAVE_CONSTRUCTOR_ATTRIBUTE', + addmain=False, + msg='Checking for library constructor support') + + # check HAVE_DESTRUCTOR_ATTRIBUTE + conf.CHECK_CODE(''' + void test_destructor_attribute(void) __attribute__ ((destructor)); + + void test_destructor_attribute(void) + { + return; + } + + int main(void) { + return 0; + } + ''', + 'HAVE_DESTRUCTOR_ATTRIBUTE', + addmain=False, + msg='Checking for library destructor support') + if sys.platform.startswith('aix'): conf.DEFINE('_ALL_SOURCE', 1, add_to_cflags=True) # Might not be needed if ALL_SOURCE is defined |