# Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+ modules/catalyst/arch/alpha.py, modules/catalyst/arch/amd64.py,
+ modules/catalyst/arch/arm.py, modules/catalyst/arch/hppa.py,
+ modules/catalyst/arch/ia64.py, modules/catalyst/arch/mips.py,
+ modules/catalyst/arch/powerpc.py, modules/catalyst/arch/s390.py,
+ modules/catalyst/arch/sparc.py, modules/catalyst/arch/x86.py:
+ Move subarch and machine map information to variables at top of each arch
+ module and get rid of register() function
+
11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org> ChangeLog:
Add catalyst.util.load_module() function
Move arch modules under modules/catalyst/arch
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "alpha": arch_alpha,
+ "ev4": arch_ev4,
+ "ev45": arch_ev45,
+ "ev5": arch_ev5,
+ "ev56": arch_ev56,
+ "pca56": arch_pca56,
+ "ev6": arch_ev6,
+ "ev67": arch_ev67
+}
+
+__machine_map = ("alpha", )
+
class generic_alpha(builder.generic):
"abstract base class for all alpha builders"
def __init__(self,myspec):
self.settings["CFLAGS"]+=" -O2 -mcpu=ev67"
self.settings["CHOST"]="alphaev67-unknown-linux-gnu"
self.settings["HOSTUSE"]=["ev6"]
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({ "alpha":arch_alpha, "ev4":arch_ev4, "ev45":arch_ev45,
- "ev5":arch_ev5, "ev56":arch_ev56, "pca56":arch_pca56,
- "ev6":arch_ev6, "ev67":arch_ev67 },
- ("alpha", ))
import builder
+__subarch_map = {
+ "amd64" : arch_amd64,
+ "k8" : arch_k8,
+ "opteron" : arch_k8,
+ "athlon64" : arch_k8,
+ "athlonfx" : arch_k8,
+ "nocona" : arch_nocona,
+# uncomment when gcc 4.3 is stable and delete this line
+# "core2" : arch_core2,
+# "k8-sse3" : arch_k8_sse3,
+# "opteron-sse3" : arch_k8_sse3,
+# "athlon64-sse3" : arch_k8_sse3,
+# "amdfam10" : arch_amdfam10,
+# "barcelona" : arch_amdfam10
+}
+
+__machine_map = ("x86_64","amd64","nocona")
+
class generic_amd64(builder.generic):
"abstract base class for all amd64 builders"
def __init__(self,myspec):
self.settings["CFLAGS"]="-O2 -march=amdfam10 -pipe"
self.settings["CHOST"]="x86_64-pc-linux-gnu"
self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"]
-
-def register():
- "inform main catalyst program of the contents of this plugin"
- return ({
- "amd64" : arch_amd64,
- "k8" : arch_k8,
- "opteron" : arch_k8,
- "athlon64" : arch_k8,
- "athlonfx" : arch_k8,
- "nocona" : arch_nocona,
-# uncomment when gcc 4.3 is stable and delete this line
-# "core2" : arch_core2,
-# "k8-sse3" : arch_k8_sse3,
-# "opteron-sse3" : arch_k8_sse3,
-# "athlon64-sse3" : arch_k8_sse3,
-# "amdfam10" : arch_amdfam10,
-# "barcelona" : arch_amdfam10
- }, ("x86_64","amd64","nocona"))
-
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "arm" : arch_arm,
+ "armv4l" : arch_armv4l,
+ "armeb" : arch_armeb,
+ "armv5b" : arch_armv5b
+}
+
+__machine_map = ("arm", "armv4l", "armeb", "armv5b", "armv5tel")
+
class generic_arm(builder.generic):
"Abstract base class for all arm (little endian) builders"
def __init__(self,myspec):
generic_arm.__init__(self,myspec)
self.settings["CFLAGS"]+=" -mcpu=xscale"
self.settings["CHOST"]="armv5b-unknown-linux-gnu"
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({
- "arm" : arch_arm,
- "armv4l" : arch_armv4l,
- "armeb" : arch_armeb,
- "armv5b" : arch_armv5b
- }, ("arm", "armv4l", "armeb", "armv5b", "armv5tel") )
-
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "hppa": arch_hppa,
+ "hppa1.1": arch_hppa1_1,
+ "hppa2.0": arch_hppa2_0
+}
+
+__machine_map = ("parisc","parisc64","hppa","hppa64")
+
class generic_hppa(builder.generic):
"Abstract base class for all hppa builders"
def __init__(self,myspec):
generic_hppa.__init__(self,myspec)
self.settings["CFLAGS"]+=" -march=2.0"
self.settings["CHOST"]="hppa2.0-unknown-linux-gnu"
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({
- "hppa": arch_hppa,
- "hppa1.1": arch_hppa1_1,
- "hppa2.0": arch_hppa2_0
- }, ("parisc","parisc64","hppa","hppa64") )
-
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "ia64": arch_ia64
+}
+
+__machine_map = ("ia64", )
+
class arch_ia64(builder.generic):
"builder class for ia64"
def __init__(self,myspec):
self.settings["CFLAGS"]="-O2 -pipe"
self.settings["CFLAGS"]="-O2 -pipe"
self.settings["CHOST"]="ia64-unknown-linux-gnu"
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({ "ia64":arch_ia64 }, ("ia64", ))
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "cobalt" : arch_cobalt,
+ "cobalt_n32" : arch_cobalt_n32,
+ "ip27" : arch_ip27,
+ "ip27_n32" : arch_ip27_n32,
+ "ip28" : arch_ip28,
+ "ip28_n32" : arch_ip28_n32,
+ "ip30" : arch_ip30,
+ "ip30_n32" : arch_ip30_n32,
+ "mips" : arch_mips1,
+ "mips1" : arch_mips1,
+ "mips2" : arch_mips2,
+ "mips3" : arch_mips3,
+ "mips3_n32" : arch_mips3_n32,
+ "mips3_n64" : arch_mips3_n64,
+ "mips4" : arch_mips4,
+ "mips4_n32" : arch_mips4_n32,
+ "mipsel" : arch_mipsel1,
+ "mipsel1" : arch_mipsel1,
+ "mipsel2" : arch_mipsel2,
+ "mipsel3" : arch_mipsel3,
+ "mipsel3_n32" : arch_mipsel3_n32,
+ "mipsel4" : arch_mipsel4,
+ "mipsel4_n32" : arch_mipsel4_n32,
+ "loongson" : arch_mipsel3,
+}
+
+__machine_map = ("mips","mips64")
+
class generic_mips(builder.generic):
"Abstract base class for all mips builders [Big-endian]"
def __init__(self,myspec):
def __init__(self,myspec):
arch_mips4_n32.__init__(self,myspec)
self.settings["HOSTUSE"]=["ip30","n32"]
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({
- "cobalt" : arch_cobalt,
- "cobalt_n32" : arch_cobalt_n32,
- "ip27" : arch_ip27,
- "ip27_n32" : arch_ip27_n32,
- "ip28" : arch_ip28,
- "ip28_n32" : arch_ip28_n32,
- "ip30" : arch_ip30,
- "ip30_n32" : arch_ip30_n32,
- "mips" : arch_mips1,
- "mips1" : arch_mips1,
- "mips2" : arch_mips2,
- "mips3" : arch_mips3,
- "mips3_n32" : arch_mips3_n32,
- "mips3_n64" : arch_mips3_n64,
- "mips4" : arch_mips4,
- "mips4_n32" : arch_mips4_n32,
- "mipsel" : arch_mipsel1,
- "mipsel1" : arch_mipsel1,
- "mipsel2" : arch_mipsel2,
- "mipsel3" : arch_mipsel3,
- "mipsel3_n32" : arch_mipsel3_n32,
- "mipsel4" : arch_mipsel4,
- "mipsel4_n32" : arch_mipsel4_n32,
- "loongson" : arch_mipsel3,
- }, ("mips","mips64"))
import os,builder
from catalyst_support import *
+__subarch_map = {
+ "970" : arch_970,
+ "cell" : arch_cell,
+ "g3" : arch_g3,
+ "g4" : arch_g4,
+ "g5" : arch_g5,
+ "power" : arch_power,
+ "power-ppc" : arch_power_ppc,
+ "power3" : arch_power3,
+ "power4" : arch_power4,
+ "power5" : arch_power5,
+ "power6" : arch_power6,
+ "ppc" : arch_ppc,
+ "ppc64" : arch_ppc64
+}
+
+__machine_map = ("ppc","ppc64","powerpc","powerpc64")
+
class generic_ppc(builder.generic):
"abstract base class for all 32-bit powerpc builders"
def __init__(self,myspec):
arch_ppc64.__init__(self,myspec)
self.settings["CFLAGS"]="-O2 -pipe -mcpu=power6 -mtune=power6"
self.settings["HOSTUSE"]=["altivec","ibm"]
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({
- "970" : arch_970,
- "cell" : arch_cell,
- "g3" : arch_g3,
- "g4" : arch_g4,
- "g5" : arch_g5,
- "power" : arch_power,
- "power-ppc" : arch_power_ppc,
- "power3" : arch_power3,
- "power4" : arch_power4,
- "power5" : arch_power5,
- "power6" : arch_power6,
- "ppc" : arch_ppc,
- "ppc64" : arch_ppc64
- }, ("ppc","ppc64","powerpc","powerpc64"))
-
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "s390": arch_s390,
+ "s390x": arch_s390x
+}
+
+__machine_map = ("s390", "s390x")
+
class generic_s390(builder.generic):
"abstract base class for all s390 builders"
def __init__(self,myspec):
generic_s390x.__init__(self,myspec)
self.settings["CFLAGS"]="-O2 -pipe"
self.settings["CHOST"]="s390x-ibm-linux-gnu"
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({"s390":arch_s390,"s390x":arch_s390x}, ("s390", "s390x"))
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "sparc" : arch_sparc,
+ "sparc64" : arch_sparc64
+}
+
+__machine_map = ("sparc","sparc64")
+
class generic_sparc(builder.generic):
"abstract base class for all sparc builders"
def __init__(self,myspec):
generic_sparc64.__init__(self,myspec)
self.settings["CFLAGS"]="-O2 -mcpu=ultrasparc -pipe"
self.settings["CHOST"]="sparc-unknown-linux-gnu"
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({
- "sparc" : arch_sparc,
- "sparc64" : arch_sparc64
- }, ("sparc","sparc64", ))
import builder,os
from catalyst_support import *
+__subarch_map = {
+ "x86" : arch_x86,
+ "i386" : arch_i386,
+ "i486" : arch_i486,
+ "i586" : arch_i586,
+ "i686" : arch_i686,
+ "pentium" : arch_i586,
+ "pentium2" : arch_pentium2,
+ "pentium3" : arch_pentium3,
+ "pentium3m" : arch_pentium3,
+ "pentium-m" : arch_pentium_m,
+ "pentium4" : arch_pentium4,
+ "pentium4m" : arch_pentium4,
+ "pentiumpro" : arch_i686,
+ "pentium-mmx" : arch_pentium_mmx,
+ "prescott" : arch_prescott,
+ "k6" : arch_k6,
+ "k6-2" : arch_k6_2,
+ "k6-3" : arch_k6_2,
+ "athlon" : arch_athlon,
+ "athlon-tbird" : arch_athlon,
+ "athlon-4" : arch_athlon_xp,
+ "athlon-xp" : arch_athlon_xp,
+ "athlon-mp" : arch_athlon_xp
+}
+
+__machine_map = ('i386', 'i486', 'i586', 'i686')
+
class generic_x86(builder.generic):
"abstract base class for all x86 builders"
def __init__(self,myspec):
self.settings["CFLAGS"]="-O2 -march=athlon-xp -pipe"
self.settings["CHOST"]="i686-pc-linux-gnu"
self.settings["HOSTUSE"]=["mmx","3dnow","sse"]
-
-def register():
- "Inform main catalyst program of the contents of this plugin."
- return ({
- "x86" : arch_x86,
- "i386" : arch_i386,
- "i486" : arch_i486,
- "i586" : arch_i586,
- "i686" : arch_i686,
- "pentium" : arch_i586,
- "pentium2" : arch_pentium2,
- "pentium3" : arch_pentium3,
- "pentium3m" : arch_pentium3,
- "pentium-m" : arch_pentium_m,
- "pentium4" : arch_pentium4,
- "pentium4m" : arch_pentium4,
- "pentiumpro" : arch_i686,
- "pentium-mmx" : arch_pentium_mmx,
- "prescott" : arch_prescott,
- "k6" : arch_k6,
- "k6-2" : arch_k6_2,
- "k6-3" : arch_k6_2,
- "athlon" : arch_athlon,
- "athlon-tbird" : arch_athlon,
- "athlon-4" : arch_athlon_xp,
- "athlon-xp" : arch_athlon_xp,
- "athlon-mp" : arch_athlon_xp
- }, ('i386', 'i486', 'i586', 'i686'))
-