summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Engestrom <eric.engestrom@imgtec.com>2018-03-16 17:07:08 +0000
committerEric Engestrom <eric.engestrom@imgtec.com>2018-03-20 14:31:07 +0000
commite8d3d885b1362caba4f1e1dfa42d45bac7163124 (patch)
tree8e85173b3168eaed28ee9031b4577db407751a9b
parent1a44bbae734fa6aa227d2ac621ff7884af1ae8ef (diff)
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>
-rw-r--r--configure.ac2
-rw-r--r--libdrm_macros.h2
-rw-r--r--meson.build7
3 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 762ca9f9..607d8597 100644
--- a/configure.ac
+++ b/configure.ac
@@ -535,6 +535,8 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([
if test "x$HAVE_ATTRIBUTE_VISIBILITY" = xyes; then
AC_DEFINE(HAVE_VISIBILITY, 1, [Compiler supports __attribute__(("hidden"))])
+else
+ AC_DEFINE(HAVE_VISIBILITY, 0)
fi
AC_SUBST(WARN_CFLAGS)
diff --git a/libdrm_macros.h b/libdrm_macros.h
index 639d0904..211fab21 100644
--- a/libdrm_macros.h
+++ b/libdrm_macros.h
@@ -23,7 +23,7 @@
#ifndef LIBDRM_LIBDRM_H
#define LIBDRM_LIBDRM_H
-#if defined(HAVE_VISIBILITY)
+#if HAVE_VISIBILITY
# define drm_private __attribute__((visibility("hidden")))
#else
# define drm_private
diff --git a/meson.build b/meson.build
index 50daa1d0..826cd915 100644
--- a/meson.build
+++ b/meson.build
@@ -256,10 +256,9 @@ with_man_pages = with_man_pages != 'false' and prog_xslt.found() and prog_sed.fo
# Used for tets
prog_bash = find_program('bash')
-if cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
- name : 'compiler supports __attribute__(("hidden"))')
- config.set10('HAVE_VISIBILITY', true)
-endif
+config.set10('HAVE_VISIBILITY',
+ cc.compiles('''int foo_hidden(void) __attribute__((visibility(("hidden"))));''',
+ name : 'compiler supports __attribute__(("hidden"))'))
foreach t : [
[with_exynos, 'EXYNOS'],