--- toolchain-funcs.eclass.old 2012-09-13 16:21:05.000000000 -0400 +++ toolchain-funcs.eclass 2012-09-14 12:33:55.000000000 -0400 @@ -359,6 +359,9 @@ local host=$2 [[ -z ${host} ]] && host=${CTARGET:-${CHOST}} + local kv=${KV:-$KV_FULL} + [[ -z ${kv} ]] && die "toolchain-funcs.eclass: Kernel version could not be determined, please inherit kernel-2 or linux-info" + case ${host} in aarch64*) ninj aarch64 arm;; alpha*) echo alpha;; @@ -371,7 +374,7 @@ # Starting with linux-2.6.24, the 'x86_64' and 'i386' # trees have been unified into 'x86'. # FreeBSD still uses i386 - if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -lt $(KV_to_int 2.6.24) || ${host} == *freebsd* ]] ; then + if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${kv}) -lt $(KV_to_int 2.6.24) || ${host} == *freebsd* ]] ; then echo i386 else echo x86 @@ -386,9 +389,9 @@ # Starting with linux-2.6.15, the 'ppc' and 'ppc64' trees # have been unified into simply 'powerpc', but until 2.6.16, # ppc32 is still using ARCH="ppc" as default - if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.16) ]] ; then + if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${kv}) -ge $(KV_to_int 2.6.16) ]] ; then echo powerpc - elif [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -eq $(KV_to_int 2.6.15) ]] ; then + elif [[ ${type} == "kern" ]] && [[ $(KV_to_int ${kv}) -eq $(KV_to_int 2.6.15) ]] ; then if [[ ${host} == powerpc64* ]] || [[ ${PROFILE_ARCH} == "ppc64" ]] ; then echo powerpc else @@ -415,7 +418,7 @@ x86_64*) # Starting with linux-2.6.24, the 'x86_64' and 'i386' # trees have been unified into 'x86'. - if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${KV}) -ge $(KV_to_int 2.6.24) ]] ; then + if [[ ${type} == "kern" ]] && [[ $(KV_to_int ${kv}) -ge $(KV_to_int 2.6.24) ]] ; then echo x86 else ninj x86_64 amd64