mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-20 16:10:07 +01:00
m4: fix CC_CHECK_WERROR and CC_FLAG_VISIBILITY macros
These macros come from systemd, but CC_CHECK_CFLAGS_SILENT was removed in systemd commit eb2e280f9c59b66965c9316eadc4c113a13ca744, breaking some of them. CC_FLAG_VISIBILITY doesn't need to require CC_CHECK_WERROR because CC_CHECK_FLAG_APPEND always append -Werror anyway. Which kinda brings into question why we have CC_CHECK_WERROR in the first place, but whavever. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
4e7863eee1
commit
a5a1042312
1 changed files with 6 additions and 11 deletions
|
|
@ -109,13 +109,14 @@ dnl
|
||||||
dnl Other compilers don't support -Werror per se, but they support
|
dnl Other compilers don't support -Werror per se, but they support
|
||||||
dnl an equivalent flag:
|
dnl an equivalent flag:
|
||||||
dnl - Sun Studio compiler supports -errwarn=%all
|
dnl - Sun Studio compiler supports -errwarn=%all
|
||||||
|
dnl we don't test for that, it gives us false positives when gcc doesn't
|
||||||
|
dnl actually complain about it. If someone wants to compile this on sun, let
|
||||||
|
dnl them fix it.
|
||||||
AC_DEFUN([CC_CHECK_WERROR], [
|
AC_DEFUN([CC_CHECK_WERROR], [
|
||||||
AC_CACHE_CHECK(
|
AC_CACHE_CHECK(
|
||||||
[for $CC way to treat warnings as errors],
|
[for $CC way to treat warnings as errors],
|
||||||
[cc_cv_werror],
|
[cc_cv_werror],
|
||||||
[CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror],
|
[CC_CHECK_FLAG_APPEND([cc_cv_werror], [CFLAGS], [-Werror])])
|
||||||
[CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
|
|
||||||
])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([CC_CHECK_ATTRIBUTE], [
|
AC_DEFUN([CC_CHECK_ATTRIBUTE], [
|
||||||
|
|
@ -225,17 +226,11 @@ AC_DEFUN([CC_ATTRIBUTE_CONST], [
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([CC_FLAG_VISIBILITY], [
|
AC_DEFUN([CC_FLAG_VISIBILITY], [
|
||||||
AC_REQUIRE([CC_CHECK_WERROR])
|
|
||||||
AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
|
AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
|
||||||
[cc_cv_flag_visibility],
|
[cc_cv_flag_visibility],
|
||||||
[cc_flag_visibility_save_CFLAGS="$CFLAGS"
|
[CC_CHECK_FLAG_APPEND([cc_cv_flag_visibility], [CFLAGS], [-fvisibility=hidden])])
|
||||||
CFLAGS="$CFLAGS $cc_cv_werror"
|
|
||||||
CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden],
|
|
||||||
cc_cv_flag_visibility='yes',
|
|
||||||
cc_cv_flag_visibility='no')
|
|
||||||
CFLAGS="$cc_flag_visibility_save_CFLAGS"])
|
|
||||||
|
|
||||||
AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
|
AS_IF([test "x$cc_cv_flag_visibility" != "x"],
|
||||||
[AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
|
[AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
|
||||||
[Define this if the compiler supports the -fvisibility flag])
|
[Define this if the compiler supports the -fvisibility flag])
|
||||||
$1],
|
$1],
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue