From 351297108488d0a77f4ce666c1b7d82e6aae0831 Mon Sep 17 00:00:00 2001 From: Explorer09 Date: Sun, 30 Dec 2018 12:18:27 +0800 Subject: [PATCH] Fix configure 'major' workaround causing to miss. A logic mistake in pull request #746 causes to be *not* included when AC_HEADER_MAJOR (before autoconf-2.70) finds 'major' in . Though this would still build htop, it would still bring deprecation warning in systems using glibc 2.25-2.27. Fix the logic and suppress the warning. Also, include config.h in Process.c for the sake of strengthening the code. Signed-off-by: Kang-Che Sung --- Process.c | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Process.c b/Process.c index 54c41af4..420311dc 100644 --- a/Process.c +++ b/Process.c @@ -8,6 +8,8 @@ in the source distribution for its full text. #include "Process.h" #include "Settings.h" +#include "config.h" + #include "CRT.h" #include "StringUtils.h" #include "RichString.h" diff --git a/configure.ac b/configure.ac index ffd8fede..4c7360e6 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ dnl glibc 2.25 deprecates 'major' and 'minor' in and requires to dnl include . 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 "x$ac_cv_header_sys_mkdev_h" = xno; then +[if test "x$ac_cv_header_sys_mkdev_h" != xyes; then AC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS, 1, [Define to 1 if `major', `minor', and `makedev' are declared in .])]) fi])