OSDN Git Service

configure: Fix the <sys/sysmacros.h> check
authorAdam Jackson <ajax@redhat.com>
Thu, 4 May 2017 16:25:01 +0000 (12:25 -0400)
committerAdam Jackson <ajax@redhat.com>
Thu, 4 May 2017 18:36:55 +0000 (14:36 -0400)
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.

Reviewed-by: Emil Velikov <emil.velilkov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
configure.ac

index e5158b7..43fcf68 100644 (file)
@@ -54,7 +54,11 @@ AC_USE_SYSTEM_EXTENSIONS
 AC_SYS_LARGEFILE
 AC_FUNC_ALLOCA
 
+save_CFLAGS="$CFLAGS"
+export CFLAGS="$CFLAGS -Werror"
 AC_HEADER_MAJOR
+CFLAGS="$save_CFLAGS"
+
 AC_CHECK_HEADERS([sys/sysctl.h sys/select.h])
 
 # Initialize libtool