Handle cpu optimization patch for different gcc versions
authorMike Pagano <mpagano@gentoo.org>
Fri, 13 Feb 2015 01:30:50 +0000 (01:30 +0000)
committerMike Pagano <mpagano@gentoo.org>
Fri, 13 Feb 2015 01:30:50 +0000 (01:30 +0000)
eclass/kernel-2.eclass

index 4b850146e33e2d596f12e630799e968cf4827560..82c15791407c2ef0d7dcce1a1e51949b8d5e63f9 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.297 2014/11/28 17:40:20 mpagano Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.298 2015/02/13 01:30:50 mpagano Exp $
 
 # Description: kernel.eclass rewrite for a clean base regarding the 2.6
 #              series of kernel with back-compatibility for 2.4
@@ -157,6 +157,16 @@ handle_genpatches() {
                        if use experimental ; then
                                UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
                                debug-print "genpatches tarball: $tarball"
+
+                               # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010                 
+                               if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then
+                                               # drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch
+                                               UNIPATCH_EXCLUDE+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+                               else
+                                       #drop 5000_enable-additional-cpu-optimizations-for-gcc.patch
+                                       UNIPATCH_EXCLUDE+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
+                               fi
+
                        fi
                else
                        UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"