summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorKang-Che Sung (宋岡哲) <Explorer09@gmail.com>2018-02-26 21:15:05 +0800
committerHisham Muhammad <hisham@gobolinux.org>2018-02-26 10:15:05 -0300
commitc01f40eb3e599f55d408448228d95ecee4b2031f (patch)
treeb0d707947e6c6f9e3f14e486c699b4c5206ab209 /configure.ac
parenteed18dd1079a6a5212df4cd56340da62971bb450 (diff)
Fix build failure ('major' undefined) in glibc 2.28. (#746)
glibc 2.28 no longer defines 'major' and 'minor' in <sys/types.h> and requires us to include <sys/sysmacros.h>. (glibc 2.25 starts deprecating the macros in <sys/types.h>.) Now do include the latter if found on the system. At the moment, let's also utilize AC_HEADER_MAJOR in configure script. However as Autoconf 2.69 has not yet updated the AC_HEADER_MAJOR macro to reflect the glibc change [1], so add a workaround code. Fixes #663. Supersedes pull request #729. Reference: [1] https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commit;h=e17a30e987d7ee695fb4294a82d987ec3dc9b974 Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 44595050..36aebc5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,16 @@ AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[
])
AC_CHECK_HEADERS([execinfo.h],[:],[:])
+AC_HEADER_MAJOR
+dnl glibc 2.25 deprecates 'major' and 'minor' in <sys/types.h> and requires to
+dnl include <sys/sysmacros.h>. However the logic in AC_HEADER_MAJOR has not yet
+dnl been updated in Autoconf 2.69, so use a workaround:
+m4_version_prereq([2.70], [],
+[if test $ac_cv_header_sys_mkdev_h = no; then
+ AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS, 1,
+ [Define to 1 if `major', `minor', and `makedev' are declared in <sys/sysmacros.h>.])])
+fi])
+
# Checks for typedefs, structures, and compiler characteristics.
# ----------------------------------------------------------------------
AC_HEADER_STDBOOL

© 2014-2024 Faster IT GmbH | imprint | privacy policy