]> git.kaiwu.me - nginx.git/commitdiff
Configure: catch up with new Linux version numbering (ticket #5).
authorMaxim Dounin <mdounin@mdounin.ru>
Sat, 13 Aug 2011 15:15:50 +0000 (15:15 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Sat, 13 Aug 2011 15:15:50 +0000 (15:15 +0000)
Catch up with new Linux version numbering scheme as announced at [1] and
suppress unrecognized versions to actually use default 0.

[1] https://lkml.org/lkml/2011/5/29/204

auto/os/linux

index 9db5f26f332b18a570d95f62e14ea9456c895602..394cd87bce1c1e5b30a0c33f5b428f9ca72a21fe 100644 (file)
@@ -18,7 +18,9 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
 # Linux kernel version
 
 version=$((`uname -r \
-       | sed 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1*256*256+\2*256+\3/'`))
+    | sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \
+                                                 \1*256*256+\2*256+\3/p' \
+             -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`))
 
 version=${version:-0}