Skip to content

Commit 9225013

Browse files
committed
configure: Fix kernel devel check.
According to Michal Marek <[email protected]> grepping the Makefile for VERSION and PATCHLEVEL is not supported and these variables may be removed int the future. The correct way to get kernel version from the build directory is to run 'make -s kernelversion'. Signed-off-by: Cyril Hrubis <[email protected]>
1 parent 54cee11 commit 9225013

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

m4/ltp-kernel_devel.m4

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,8 @@ AC_ARG_WITH([linux-dir],
4747
AC_SUBST(LINUX_DIR)
4848
4949
if test -f "$LINUX_DIR/Makefile"; then
50-
LINUX_VERSION_MAJOR=`sed -n '0,/^VERSION = [[0-9]]*/s,\
51-
^VERSION = ,,p' ${LINUX_DIR}/Makefile`
52-
53-
LINUX_VERSION_PATCH=`sed -n '0,/^PATCHLEVEL = [[0-9]]*/s,\
54-
^PATCHLEVEL = ,,p' ${LINUX_DIR}/Makefile`
50+
LINUX_VERSION_MAJOR=`make -C ${LINUX_DIR} -s kernelversion | cut -d. -f1`
51+
LINUX_VERSION_PATCH=`make -C ${LINUX_DIR} -s kernelversion | cut -d. -f2`
5552
fi
5653
5754
if test -n "$LINUX_VERSION_MAJOR" -a -n "$LINUX_VERSION_PATCH"; then

0 commit comments

Comments
 (0)