meson,configure: always define HAVE_VISIBILITY
authorEric Engestrom <eric.engestrom@imgtec.com>
Fri, 16 Mar 2018 17:07:08 +0000 (17:07 +0000)
committerEric Engestrom <eric.engestrom@imgtec.com>
Tue, 20 Mar 2018 14:31:07 +0000 (14:31 +0000)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
configure.ac
libdrm_macros.h
meson.build

index 762ca9f..607d859 100644 (file)
@@ -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)
index 639d090..211fab2 100644 (file)
@@ -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
index 50daa1d..826cd91 100644 (file)
@@ -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'],