net/xtables-addons: fix r24433
[openwrt/svn-archive/archive.git] / net / xtables-addons / patches / 005-kernel_detect.patch
1 --- xtables-addons-1.31/configure.ac.old 2010-12-06 16:34:40.566685991 +0100
2 +++ xtables-addons-1.31/configure.ac 2010-12-06 16:35:29.978686360 +0100
3 @@ -48,7 +48,6 @@
4 # Well, just a warning. Maybe the admin updated the kernel.
5 echo "WARNING: This distribution's shipped kernel is not supported.";
6 fi;
7 -AC_MSG_CHECKING([kernel version that we will build against])
8 krel="$(make -sC ${kbuilddir} kernelrelease)";
9 krel="${krel%%-*}";
10 kmajor="${krel%%.*}";
11 @@ -57,28 +56,22 @@
12 krel="${krel#*.}";
13 kmicro="${krel%%.*}";
14 if test "$kmicro" = "$krel"; then
15 - kmicro="$(($kmicro+0))"; # Get rid of non numbers ("2.6.36+" -> "2.6.36")
16 kstable=0;
17 else
18 - kmicro="$(($kmicro+0))";
19 kstable="${krel#*.}";
20 - kstable="$(($kstable+0))";
21 -fi;
22 -if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then
23 - echo "WARNING: Version detection did not succeed. Continue at own luck.";
24 -else
25 - echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
26 - if test "$kmajor" -gt 2 -o "$kminor" -gt 6 -o "$kmicro" -gt 36; then
27 - echo "WARNING: You are trying a newer kernel. Results may vary. :-)";
28 - elif test \( "$kmajor" -lt 2 -o \
29 - \( "$kmajor" -eq 2 -a "$kminor" -lt 6 \) -o \
30 - \( "$kmajor" -eq 2 -a "$kminor" -eq 0 -a "$kmicro" -lt 17 \) -o \
31 - \( "$kmajor" -eq 2 -a "$kminor" -eq 6 -a "$kmicro" -eq 18 -a \
32 - "$kstable" -lt 5 \) \); then
33 - echo "ERROR: That kernel version is not supported. Please see INSTALL for minimum configuration.";
34 - exit 1;
35 + if test -z "$kstable"; then
36 + kstable=0;
37 fi;
38 fi;
39 +echo "Found kernel version $kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
40 +if test "$kmajor" -gt 2 -o "$kminor" -gt 6 -o "$kmicro" -gt 36; then
41 + echo "WARNING: You are trying a newer kernel. Results may vary. :-)";
42 +elif test \( "$kmajor" -lt 2 -o "$kminor" -lt 6 -o "$kmicro" -lt 17 \) -o \
43 + \( "$kmajor" -eq 2 -a "$kminor" -eq 6 -a "$kmicro" -eq 18 -a \
44 + "$kstable" -lt 5 \); then
45 + echo "ERROR: That kernel version is not supported. Please see INSTALL for minimum configuration.";
46 + exit 1;
47 +fi;
48
49 AC_SUBST([regular_CFLAGS])
50 AC_SUBST([kbuilddir])
51 --- xtables-addons-1.31/configure.old 2010-12-06 16:54:55.450685329 +0100
52 +++ xtables-addons-1.31/configure 2010-12-06 16:55:51.878685448 +0100
53 @@ -10809,8 +10809,6 @@
54 # Well, just a warning. Maybe the admin updated the kernel.
55 echo "WARNING: This distribution's shipped kernel is not supported.";
56 fi;
57 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel version that we will build against" >&5
58 -$as_echo_n "checking kernel version that we will build against... " >&6; }
59 krel="$(make -sC ${kbuilddir} kernelrelease)";
60 krel="${krel%%-*}";
61 kmajor="${krel%%.*}";
62 @@ -10819,28 +10817,22 @@
63 krel="${krel#*.}";
64 kmicro="${krel%%.*}";
65 if test "$kmicro" = "$krel"; then
66 - kmicro="$(($kmicro+0))"; # Get rid of non numbers ("2.6.36+" -> "2.6.36")
67 kstable=0;
68 else
69 - kmicro="$(($kmicro+0))";
70 kstable="${krel#*.}";
71 - kstable="$(($kstable+0))";
72 -fi;
73 -if test -z "$kmajor" -o -z "$kminor" -o -z "$kmicro"; then
74 - echo "WARNING: Version detection did not succeed. Continue at own luck.";
75 -else
76 - echo "$kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
77 - if test "$kmajor" -gt 2 -o "$kminor" -gt 6 -o "$kmicro" -gt 36; then
78 - echo "WARNING: You are trying a newer kernel. Results may vary. :-)";
79 - elif test \( "$kmajor" -lt 2 -o \
80 - \( "$kmajor" -eq 2 -a "$kminor" -lt 6 \) -o \
81 - \( "$kmajor" -eq 2 -a "$kminor" -eq 0 -a "$kmicro" -lt 17 \) -o \
82 - \( "$kmajor" -eq 2 -a "$kminor" -eq 6 -a "$kmicro" -eq 18 -a \
83 - "$kstable" -lt 5 \) \); then
84 - echo "ERROR: That kernel version is not supported. Please see INSTALL for minimum configuration.";
85 - exit 1;
86 + if test -z "$kstable"; then
87 + kstable=0;
88 fi;
89 fi;
90 +echo "Found kernel version $kmajor.$kminor.$kmicro.$kstable in $kbuilddir";
91 +if test "$kmajor" -gt 2 -o "$kminor" -gt 6 -o "$kmicro" -gt 36; then
92 + echo "WARNING: You are trying a newer kernel. Results may vary. :-)";
93 +elif test \( "$kmajor" -lt 2 -o "$kminor" -lt 6 -o "$kmicro" -lt 17 \) -o \
94 + \( "$kmajor" -eq 2 -a "$kminor" -eq 6 -a "$kmicro" -eq 18 -a \
95 + "$kstable" -lt 5 \); then
96 + echo "ERROR: That kernel version is not supported. Please see INSTALL for minimum configuration.";
97 + exit 1;
98 +fi;
99
100
101