aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-04-21 19:47:26 +0000
committerJohn Crispin <blogic@openwrt.org>2016-04-21 19:47:26 +0000
commitf09470077280cf185d4b33060d8703469228c3ef (patch)
tree542c7943680beaf84795ac96b0ce40ba905ab992 /package/network
parenta72640365067d3a116f7d02baefd0d37d0c68e6f (diff)
downloadmaster-187ad058-f09470077280cf185d4b33060d8703469228c3ef.tar.gz
master-187ad058-f09470077280cf185d4b33060d8703469228c3ef.tar.bz2
master-187ad058-f09470077280cf185d4b33060d8703469228c3ef.zip
xtables-addons: build: fix configure compatiblity with POSIX shells
Fixes build with /bin/sh pointing to certain versions of dash (for example on Void Linux). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49218 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rw-r--r--package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch51
-rw-r--r--package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch12
2 files changed, 57 insertions, 6 deletions
diff --git a/package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch b/package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch
new file mode 100644
index 0000000000..e0b11b5459
--- /dev/null
+++ b/package/network/utils/xtables-addons/patches/001-build-fix-configure-compatiblity-with-POSIX-shells.patch
@@ -0,0 +1,51 @@
+From f07a0a5cb8b3c5e1aee8b30c7fa21ccfbf24a95a Mon Sep 17 00:00:00 2001
+Message-Id: <f07a0a5cb8b3c5e1aee8b30c7fa21ccfbf24a95a.1459880505.git.mschiffer@universe-factory.net>
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Fri, 1 Apr 2016 22:24:00 +0200
+Subject: [PATCH] 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.
+---
+ configure.ac | 24 +++++++++---------------
+ 1 file changed, 9 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 82a1355..5a5ea57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -44,21 +44,15 @@ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
+
+ if test -n "$kbuilddir"; then
+ AC_MSG_CHECKING([kernel version that we will build against])
+- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)";
+- kmajor="${krel%%[[^0-9]]*}";
+- kmajor="$(($kmajor+0))";
+- krel="${krel:${#kmajor}}";
+- krel="${krel#.}";
+- kminor="${krel%%[[^0-9]]*}";
+- kminor="$(($kminor+0))";
+- krel="${krel:${#kminor}}";
+- krel="${krel#.}";
+- kmicro="${krel%%[[^0-9]]*}";
+- kmicro="$(($kmicro+0))";
+- krel="${krel:${#kmicro}}";
+- krel="${krel#.}";
+- kstable="${krel%%[[^0-9]]*}";
+- kstable="$(($kstable+0))";
++ krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')";
++ save_IFS=$IFS;
++ IFS='.';
++ set x $krel;
++ IFS=$save_IFS;
++ kmajor="$(($2+0))";
++ kminor="$(($3+0))";
++ kmicro="$(($4+0))";
++ kstable="$(($5+0))";
+ if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then
+ echo "WARNING: Version detection did not succeed. Continue at own luck.";
+ else
+--
+2.8.0
+
diff --git a/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch b/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch
index e4101ad83a..6a7a099fcc 100644
--- a/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch
+++ b/package/network/utils/xtables-addons/patches/002-fix-kernel-version-detection.patch
@@ -1,11 +1,11 @@
--- a/configure.ac
+++ b/configure.ac
-@@ -44,7 +44,7 @@ regular_CFLAGS="-Wall -Waggregate-return
+@@ -44,7 +44,7 @@ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
if test -n "$kbuilddir"; then
AC_MSG_CHECKING([kernel version that we will build against])
-- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease)";
-+ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion)";
- kmajor="${krel%%[[^0-9]]*}";
- kmajor="$(($kmajor+0))";
- krel="${krel:${#kmajor}}";
+- krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')";
++ krel="$(make -sC "$kbuilddir" M=$PWD kernelversion | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')";
+ save_IFS=$IFS;
+ IFS='.';
+ set x $krel;