meson,configure: always define HAVE_VISIBILITY

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
main
Eric Engestrom 2018-03-16 17:07:08 +00:00
parent 1a44bbae73
commit e8d3d885b1
3 changed files with 6 additions and 5 deletions

View File

@ -535,6 +535,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then
AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))]) AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))])
else
AC_DEFINE(HAVE_VISIBILITY, 0)
fi fi
AC_SUBST(WARN_CFLAGS) AC_SUBST(WARN_CFLAGS)

View File

@ -23,7 +23,7 @@
#ifndef LIBDRM_LIBDRM_H #ifndef LIBDRM_LIBDRM_H
#define LIBDRM_LIBDRM_H #define LIBDRM_LIBDRM_H
#if defined(HAVE_VISIBILITY) #if HAVE_VISIBILITY
# define drm_private __attribute__((visibility("hidden"))) # define drm_private __attribute__((visibility("hidden")))
#else #else
# define drm_private # define drm_private

View File

@ -256,10 +256,9 @@ with_man_pages = with_man_pages != 'false' and prog_xslt.found() and prog_sed.fo
# Used for tets # Used for tets
prog_bash = find_program('bash') prog_bash = find_program('bash')
if cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''', config.set10('HAVE_VISIBILITY',
name : 'compiler supports __attribute__(("hidden"))') cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
config.set10('HAVE_VISIBILITY', true) name : 'compiler supports __attribute__(("hidden"))'))
endif
foreach t : [ foreach t : [
[with_exynos, 'EXYNOS'], [with_exynos, 'EXYNOS'],