mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 05:34:58 +02:00
build: fix configure compatiblity with POSIX shells
The kernel version detection code uses some bashisms, which makes the build fail on Debian systems where /bin/sh links to dash. Replace with POSIX-conforming commands at the cost of requiring awk.
This commit is contained in:

committed by
Jan Engelhardt

parent
5038e160f8
commit
e6f20befad
24
configure.ac
24
configure.ac
@@ -44,21 +44,15 @@ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
|
|||||||
|
|
||||||
if test -n "$kbuilddir"; then
|
if test -n "$kbuilddir"; then
|
||||||
AC_MSG_CHECKING([kernel version that we will build against])
|
AC_MSG_CHECKING([kernel version that we will build against])
|
||||||
krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)";
|
krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')"
|
||||||
kmajor="${krel%%[[^0-9]]*}";
|
save_IFS="$IFS"
|
||||||
kmajor="$(($kmajor+0))";
|
IFS='.'
|
||||||
krel="${krel:${#kmajor}}";
|
set x $krel
|
||||||
krel="${krel#.}";
|
IFS="$save_IFS"
|
||||||
kminor="${krel%%[[^0-9]]*}";
|
kmajor="$(($2+0))"
|
||||||
kminor="$(($kminor+0))";
|
kminor="$(($3+0))"
|
||||||
krel="${krel:${#kminor}}";
|
kmicro="$(($4+0))"
|
||||||
krel="${krel#.}";
|
kstable="$(($5+0))"
|
||||||
kmicro="${krel%%[[^0-9]]*}";
|
|
||||||
kmicro="$(($kmicro+0))";
|
|
||||||
krel="${krel:${#kmicro}}";
|
|
||||||
krel="${krel#.}";
|
|
||||||
kstable="${krel%%[[^0-9]]*}";
|
|
||||||
kstable="$(($kstable+0))";
|
|
||||||
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