[Mesa-dev] [PATCH mesa] configure.ac: fix the <sys/sysmacro.h> check
Eric Engestrom
eric.engestrom at imgtec.com
Tue May 16 14:17:09 UTC 2017
AC_HEADER_MAJOR only defines MAJOR_IN_SYSMACROS if major() is _not_
defined by <sys/types.h> alone. It is, but it warns, and that's ugly.
To fix this, push -Werror into CFLAGS when invoking AC_HEADER_MAJOR so
the warning makes the compilation test fail.
Cc: Emil Velikov <emil.velilkov at collabora.com>
Signed-off-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
---
This is a port of ajax's 7040fea02 on libdrm.
Honestly, I haven't seen this wall of warnings in Mesa yet, but
I suspect this is just by some random "happy accident", so I think
we might as well adjust the macro here too before something changes
and we get spammed.
---
configure.ac | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/configure.ac b/configure.ac
index ce5301f3e4..ac07daa591 100644
--- a/configure.ac
+++ b/configure.ac
@@ -787,7 +787,12 @@ if test "x$enable_asm" = xyes; then
esac
fi
+save_CFLAGS="$CFLAGS"
+export CFLAGS="$CFLAGS -Werror"
AC_HEADER_MAJOR
+CFLAGS="$save_CFLAGS"
+
+
AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
--
Cheers,
Eric
More information about the mesa-dev
mailing list