configure.in contains broken check of Linux kernel version: case $host in ... *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` ;; It fails with all kernels >=3.10.0. It also treats e.g. 2.6.3 and 2.6.32 as the same version. ./configure prints: ... checking for create_area... no checking for MAP_ANON in sys/mman.h... yes checking for /dev/zero... yes checking for mmap that can map /dev/zero... yes ./configure: line 21360: test: 3.10.17-gentoo: integer expression expected decision on anonymous shared memory allocation method... 4.4BSD-style mmap() via MAP_ANON ./configure: line 21672: test: 3.10.17-gentoo: integer expression expected decision on namebased memory allocation method... SysV IPC shmget() checking for size_t... yes checking for working alloca.h... yes checking for alloca... yes ...
I just noticed this yesterday for the first time... 3.11.x kernel is breaking it. Fixed in r1535027 If you're able to test that on a 2.6 or pre-2.4 Linux I'd appreciate that.
(I do not use old kernels anymore.) Your solution does not work for 4.0.* versions. If also fails when the last ".0" is skipped. I have tested your solution in shell by defining uname() function. $ uname() { echo 3.11.6; } $ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'` $ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'` $ declare -p os_major os_minor declare -- os_major="3" declare -- os_minor="11" $ uname() { echo 4.0.1; } $ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'` $ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'` $ declare -p os_major os_minor declare -- os_major="4" declare -- os_minor="4.0.1" $ uname() { echo 3.12; } $ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'` $ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([1-9][0-9]*\)\..*/\1/'` $ declare -p os_major os_minor declare -- os_major="3" declare -- os_minor="3.12"
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #2) > Your solution does not work for 4.0.* versions. Or just 3.0.*.
Thanks - r1535157 - anything still broken?
Oh, and Linux has always used x.y.z-style versioning AFAIK so I'm not worried about failing if .z is missing.
(In reply to Joe Orton from comment #5) > Oh, and Linux has always used x.y.z-style versioning AFAIK so I'm not > worried about failing if .z is missing. The last .0 is skipped at least in names of tarballs. https://www.kernel.org/pub/linux/kernel/v3.x/
(In reply to Joe Orton from comment #4) > Thanks - r1535157 - anything still broken? It does not fix os_minor. You need to escape + character: $ uname() { echo 3.0.5; } $ os_major=`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'` $ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]+\)\..*/\1/'` $ declare -p os_major os_minor declare -- os_major="3" declare -- os_minor="3.0.5" $ os_minor=`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]\+\)\..*/\1/'` $ declare -p os_major os_minor declare -- os_major="3" declare -- os_minor="0"
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #7) And something like this now occurs: ... configure: Check for compiler flags... checking whether the compiler provides atomic builtins... yes checking whether to enable -D_LARGEFILE64_SOURCE... no ./configure: line 19058: test: 3.11.7-gentoo: integer expression expected configure: Configured for Linux 3.3.11.7-gentoo configure: configure: Checking for libraries... checking for library containing gethostbyname... none required checking for library containing gethostname... none required ... Sufficient patch: --- configure.in +++ configure.in @@ -681,7 +681,7 @@ ;; *linux*) os_major=[`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`] - os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]+\)\..*/\1/'`] + os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]\+\)\..*/\1/'`] if test $os_major -lt 2 -o \( $os_major -eq 2 -a $os_minor -lt 4 \); then AC_MSG_WARN([Configured for pre-2.4 Linux $os_major.$os_minor]) os_pre24linux=1 [
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #8) ... > Sufficient patch: ... > - os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]+\)\..*/\1/'`] > + os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]\+\)\..*/\1/'`] This patch committed to apr trunk as r1541486... All three revisions merged to the 1.5.x branch with r1541489...
Thanks Jeff and Arfrever.