mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 20:55:13 +02:00
build: improve kernel version detection again
Apparently people don't just begin the EXTRAVERSION with a dash. So rewrite it all and throw out /anything/ non-numeric.
This commit is contained in:
24
configure.ac
24
configure.ac
@@ -50,20 +50,20 @@ if grep -q "CentOS release 5\." /etc/redhat-release 2>/dev/null ||
|
|||||||
fi;
|
fi;
|
||||||
AC_MSG_CHECKING([kernel version that we will build against])
|
AC_MSG_CHECKING([kernel version that we will build against])
|
||||||
krel="$(make -sC ${kbuilddir} kernelrelease)";
|
krel="$(make -sC ${kbuilddir} kernelrelease)";
|
||||||
krel="${krel%%-*}";
|
kmajor="${krel%%[[^0-9]]*}";
|
||||||
kmajor="${krel%%.*}";
|
kmajor="$(($kmajor+0))";
|
||||||
krel="${krel#*.}";
|
krel="${krel:${#kmajor}}";
|
||||||
kminor="${krel%%.*}";
|
krel="${krel#.}";
|
||||||
krel="${krel#*.}";
|
kminor="${krel%%[[^0-9]]*}";
|
||||||
kmicro="${krel%%.*}";
|
kminor="$(($kminor+0))";
|
||||||
if test "$kmicro" = "$krel"; then
|
krel="${krel:${#kminor}}";
|
||||||
kmicro="$(($kmicro+0))"; # Get rid of non numbers ("2.6.36+" -> "2.6.36")
|
krel="${krel#.}";
|
||||||
kstable=0;
|
kmicro="${krel%%[[^0-9]]*}";
|
||||||
else
|
|
||||||
kmicro="$(($kmicro+0))";
|
kmicro="$(($kmicro+0))";
|
||||||
kstable="${krel#*.}";
|
krel="${krel:${#kmicro}}";
|
||||||
|
krel="${krel#.}";
|
||||||
|
kstable="${krel%%[[^0-9]]*}";
|
||||||
kstable="$(($kstable+0))";
|
kstable="$(($kstable+0))";
|
||||||
fi;
|
|
||||||
if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then
|
if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then
|
||||||
echo "WARNING: Version detection did not succeed. Continue at own luck.";
|
echo "WARNING: Version detection did not succeed. Continue at own luck.";
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user