commit:     e7d904a382110a59941aab8ca905616276df7ace
Author:     Matija Skala <mskala <AT> gmx <DOT> com>
AuthorDate: Fri Jul  6 17:43:28 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jul  7 18:19:59 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7d904a3

sys-libs/glibc: don't check for linux version on non-linux systems

Closes: https://github.com/gentoo/gentoo/pull/9069

 sys-libs/glibc/glibc-9999.ebuild | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 8fe8178fbb4..a0c2c4f3d45 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -684,12 +684,6 @@ sanity_prechecks() {
 
        # When we actually have to compile something...
        if ! just_headers ; then
-               local run_kv build_kv want_kv
-
-               run_kv=$(g_get_running_KV)
-               build_kv=$(g_int_to_KV $(get_kheader_version))
-               want_kv=${MIN_KERN_VER}
-
                ebegin "Checking gcc for __thread support"
                if ! eend $(want__thread ; echo $?) ; then
                        echo
@@ -698,21 +692,29 @@ sanity_prechecks() {
                        die "No __thread support in gcc!"
                fi
 
-               if ! is_crosscompile && ! tc-is-cross-compiler ; then
-                       # Building fails on an non-supporting kernel
-                       ebegin "Checking running kernel version (${run_kv} >= 
${want_kv})"
-                       if ! eend_KV ${run_kv} ${want_kv} ; then
-                               echo
-                               eerror "You need a kernel of at least 
${want_kv}!"
-                               die "Kernel version too low!"
+               if [[ ${CTARGET} == *-linux* ]] ; then
+                       local run_kv build_kv want_kv
+
+                       run_kv=$(g_get_running_KV)
+                       build_kv=$(g_int_to_KV $(get_kheader_version))
+                       want_kv=${MIN_KERN_VER}
+
+                       if ! is_crosscompile && ! tc-is-cross-compiler ; then
+                               # Building fails on an non-supporting kernel
+                               ebegin "Checking running kernel version 
(${run_kv} >= ${want_kv})"
+                               if ! eend_KV ${run_kv} ${want_kv} ; then
+                                       echo
+                                       eerror "You need a kernel of at least 
${want_kv}!"
+                                       die "Kernel version too low!"
+                               fi
                        fi
-               fi
 
-               ebegin "Checking linux-headers version (${build_kv} >= 
${want_kv})"
-               if ! eend_KV ${build_kv} ${want_kv} ; then
-                       echo
-                       eerror "You need linux-headers of at least ${want_kv}!"
-                       die "linux-headers version too low!"
+                       ebegin "Checking linux-headers version (${build_kv} >= 
${want_kv})"
+                       if ! eend_KV ${build_kv} ${want_kv} ; then
+                               echo
+                               eerror "You need linux-headers of at least 
${want_kv}!"
+                               die "linux-headers version too low!"
+                       fi
                fi
        fi
 }

Reply via email to