summaryrefslogtreecommitdiffstats
path: root/gl/m4/visibility.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/visibility.m4')
-rw-r--r--gl/m4/visibility.m414
1 files changed, 8 insertions, 6 deletions
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index f0468e89..c2cd38d0 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,8 +1,10 @@
1# visibility.m4 serial 8 1# visibility.m4
2dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc. 2# serial 9
3dnl Copyright (C) 2005, 2008, 2010-2025 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7dnl This file is offered as-is, without any warranty.
6 8
7dnl From Bruno Haible. 9dnl From Bruno Haible.
8 10
@@ -31,18 +33,18 @@ AC_DEFUN([gl_VISIBILITY],
31 dnl user has put into $CC $CFLAGS $CPPFLAGS. 33 dnl user has put into $CC $CFLAGS $CPPFLAGS.
32 AC_CACHE_CHECK([whether the -Werror option is usable], 34 AC_CACHE_CHECK([whether the -Werror option is usable],
33 [gl_cv_cc_vis_werror], 35 [gl_cv_cc_vis_werror],
34 [gl_save_CFLAGS="$CFLAGS" 36 [gl_saved_CFLAGS="$CFLAGS"
35 CFLAGS="$CFLAGS -Werror" 37 CFLAGS="$CFLAGS -Werror"
36 AC_COMPILE_IFELSE( 38 AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM([[]], [[]])], 39 [AC_LANG_PROGRAM([[]], [[]])],
38 [gl_cv_cc_vis_werror=yes], 40 [gl_cv_cc_vis_werror=yes],
39 [gl_cv_cc_vis_werror=no]) 41 [gl_cv_cc_vis_werror=no])
40 CFLAGS="$gl_save_CFLAGS" 42 CFLAGS="$gl_saved_CFLAGS"
41 ]) 43 ])
42 dnl Now check whether visibility declarations are supported. 44 dnl Now check whether visibility declarations are supported.
43 AC_CACHE_CHECK([for simple visibility declarations], 45 AC_CACHE_CHECK([for simple visibility declarations],
44 [gl_cv_cc_visibility], 46 [gl_cv_cc_visibility],
45 [gl_save_CFLAGS="$CFLAGS" 47 [gl_saved_CFLAGS="$CFLAGS"
46 CFLAGS="$CFLAGS -fvisibility=hidden" 48 CFLAGS="$CFLAGS -fvisibility=hidden"
47 dnl We use the option -Werror and a function dummyfunc, because on some 49 dnl We use the option -Werror and a function dummyfunc, because on some
48 dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning 50 dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
@@ -68,7 +70,7 @@ AC_DEFUN([gl_VISIBILITY],
68 [[]])], 70 [[]])],
69 [gl_cv_cc_visibility=yes], 71 [gl_cv_cc_visibility=yes],
70 [gl_cv_cc_visibility=no]) 72 [gl_cv_cc_visibility=no])
71 CFLAGS="$gl_save_CFLAGS" 73 CFLAGS="$gl_saved_CFLAGS"
72 ]) 74 ])
73 if test $gl_cv_cc_visibility = yes; then 75 if test $gl_cv_cc_visibility = yes; then
74 CFLAG_VISIBILITY="-fvisibility=hidden" 76 CFLAG_VISIBILITY="-fvisibility=hidden"