]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
configure: fix check for sys/sysmacros.h under glibc 2.25+
authorAndrei Borzenkov <arvidjaar@gmail.com>
Thu, 22 Dec 2016 19:48:25 +0000 (22:48 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Thu, 22 Dec 2016 19:48:25 +0000 (22:48 +0300)
glibc 2.25 still includes sys/sysmacros.h in sys/types.h but also emits
deprecation warning. So test for sys/types.h succeeds in configure but later
compilation fails because we use -Werror by default.

While this is fixed in current autoconf GIT, we really cannot force everyone
to use bleeding edge (that is not even released right now). So run test under
-Werror as well to force proper detection.

This should have no impact on autoconf 2.70+ as AC_HEADER_MAJOR in this version
simply checks for header existence.

Reported and tested by Khem Raj <raj.khem@gmail.com>

configure.ac

index dc56564d7932abf14ebfe9e5489cf5409418b907..4e980c5fe8a096d4d68613ce432133b6cb44e1bd 100644 (file)
@@ -389,7 +389,14 @@ fi
 # Check for functions and headers.
 AC_CHECK_FUNCS(posix_memalign memalign getextmntent)
 AC_CHECK_HEADERS(sys/param.h sys/mount.h sys/mnttab.h limits.h)
+
+# glibc 2.25 still includes sys/sysmacros.h in sys/types.h but emits deprecation
+# warning which causes compilation failure later with -Werror. So use -Werror here
+# as well to force proper sys/sysmacros.h detection.
+SAVED_CFLAGS="$CFLAGS"
+CFLAGS="$HOST_CFLAGS -Werror"
 AC_HEADER_MAJOR
+CFLAGS="$SAVED_CFLAGS"
 
 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$ac_includes_default
 #include <sys/param.h>