From 43037b379b10637eca15dc5c2ce4de80abd73f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 18 Jan 2015 16:44:57 +0100 Subject: [PATCH] waf: Implement check whether compiler supports -fvisibility=hidden This is a bit better than compiler == 'gcc'. Tested with gcc 4.9 (success) and gcc 3.4.5 (not supported). --- wscript | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wscript b/wscript index 49bdd8912..9548d26d4 100644 --- a/wscript +++ b/wscript @@ -186,6 +186,7 @@ def configure(conf): conf.load('compiler_c') is_win32 = _target_is_win32(conf) + visibility_hidden_supported = conf.check_cc(cflags=['-Werror', '-fvisibility=hidden'], mandatory=False) conf.check_cc(header_name='fcntl.h', mandatory=False) conf.check_cc(header_name='fnmatch.h', mandatory=False) conf.check_cc(header_name='glob.h', mandatory=False) @@ -310,9 +311,7 @@ but you then may not have a local copy of the HTML manual.''' # GEANY_EXPORT_SYMBOL and GEANY_API_SYMBOL if is_win32: geany_symbol_flags = ['-DGEANY_EXPORT_SYMBOL=__declspec(dllexport)'] - # FIXME: check for -fvisibility and the __attribute__((visibility)), or - # at least for GCC >= 4 - elif conf.env['CC_NAME'] == 'gcc': + elif visibility_hidden_supported: geany_symbol_flags = ['-fvisibility=hidden', '-DGEANY_EXPORT_SYMBOL=__attribute__((visibility("default")))'] else: # unknown, define to nothing