1 From f07a0a5cb8b3c5e1aee8b30c7fa21ccfbf24a95a Mon Sep 17 00:00:00 2001
2 Message-Id: <f07a0a5cb8b3c5e1aee8b30c7fa21ccfbf24a95a.1459880505.git.mschiffer@universe-factory.net>
3 From: Matthias Schiffer <mschiffer@universe-factory.net>
4 Date: Fri, 1 Apr 2016 22:24:00 +0200
5 Subject: [PATCH] build: fix configure compatiblity with POSIX shells
7 The kernel version detection code uses some bashisms, which makes the build
8 fail on Debian systems where /bin/sh links to dash. Replace with POSIX-
9 conforming commands at the cost of requiring awk.
11 configure.ac | 24 +++++++++---------------
12 1 file changed, 9 insertions(+), 15 deletions(-)
14 diff --git a/configure.ac b/configure.ac
15 index 82a1355..5a5ea57 100644
18 @@ -44,21 +44,15 @@ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
20 if test -n "$kbuilddir"; then
21 AC_MSG_CHECKING([kernel version that we will build against])
22 - krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)";
23 - kmajor="${krel%%[[^0-9]]*}";
24 - kmajor="$(($kmajor+0))";
25 - krel="${krel:${#kmajor}}";
27 - kminor="${krel%%[[^0-9]]*}";
28 - kminor="$(($kminor+0))";
29 - krel="${krel:${#kminor}}";
31 - kmicro="${krel%%[[^0-9]]*}";
32 - kmicro="$(($kmicro+0))";
33 - krel="${krel:${#kmicro}}";
35 - kstable="${krel%%[[^0-9]]*}";
36 - kstable="$(($kstable+0))";
37 + krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')";
45 + kstable="$(($5+0))";
46 if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then
47 echo "WARNING: Version detection did not succeed. Continue at own luck.";