From: Daniel Robbins Date: Fri, 24 Oct 2003 05:41:20 +0000 (+0000) Subject: new plugin stuff X-Git-Tag: CATALYST_1_0_1~222 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2dd8619f8c753dffa246d43a0eefd907f930afab;p=catalyst.git new plugin stuff git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@18 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/arch/x86.py b/arch/x86.py new file mode 100644 index 00000000..8cdc14b7 --- /dev/null +++ b/arch/x86.py @@ -0,0 +1,31 @@ +class generic_target: + def __init__(self): + self.settings={} + +class base_x86(generic_target): + def __init__(self): + self.settings["mainarch"]="x86" + +class arch_x86(base_x86): + def __init__(self): + base_x86.__init__(self) + self.settings["CFLAGS"]="-O2 -mcpu=i686 -fomit-frame-pointer" + +class arch_pentium4(base_x86): + def __init__(self): + base_x86.__init__(self) + self.settings["CFLAGS"]="-O2 -mcpu=i686 -fomit-frame-pointer" + self.settings["CHOST"]="i686-pc-linux-gnu" + self.settings["HOSTUSE"]=["mmx","sse"] + +class x86_factory: + def __init__(self): + self.subarchdict={"x86":arch_x86,"pentium4":arch_pentium4} + def get_target(self,target): + if self.subarchdict.has_key(target): + return self.subarchdict[target]() + def is_target(self,target): + return target in self.subarchdict.keys() + + + diff --git a/catalyst b/catalyst new file mode 100755 index 00000000..07d2f940 --- /dev/null +++ b/catalyst @@ -0,0 +1,31 @@ +#!/usr/bin/python + +import os,sys,imp,string + +machinemap={ "i386" : "x86", + "i486" : "x86", + "i586" : "x86", + "i686" : "x86", + "x86_64" : "amd64" + } + +targetmap={ "x86" : ["x86"], + "amd64" : ["x86","amd64"] + } + +mymachine=os.uname()[4] +if not machinemap.has_key(mymachine): + print "Unknown machine type:",mymachine + sys.exit(1) +hostarch=machinemap[mymachine] +print "Host architecture:",hostarch +print "Supported architecture targets:",string.join(targetmap[hostarch]) +print "Loading plugins:", +archmap={} +for x in targetmap[hostarch]: + fh=open("arch/"+x+".py") + archmap[x]=imp.load_module(x,fh,"arch/"+x+".py",(".py","r",imp.PY_SOURCE)) + fh.close() + print x, +print + diff --git a/modules/catalyst_util.py b/modules/catalyst_util.py index 54ca0ce8..d04df45d 100755 --- a/modules/catalyst_util.py +++ b/modules/catalyst_util.py @@ -35,7 +35,7 @@ subarch pentium4 user (from spec) rel_type default user (from spec) (was BUILDTYPE) rel_version 1.4 user (from spec) (was MAINVERSION) snapshot 20031016 user (from spec) -source default-x86-1.4/stage2-pentium4-20031016 user (from spec) +source_subpath default-x86-1.4/stage2-pentium4-20031016 user (from spec) target_subpath default-x86-1.4/stage3-pentium4-20031016 @@ -53,16 +53,16 @@ source_path /var/tmp/catalyst/builds/default-x86-1.4/stage2-pentium4-20031016. chroot_path /var/tmp/catalyst/tmp/default-x86-1.4/stage3-pentium4-20031016 storedir+"/tmp/"+target_subpath +pkgcache_path /var/tmp/catalyst/packages/default-x86-1.4/stage3-pentium4-20031016 + storedir+"/packages/"+target_subpath locals, auto-generated: -pkgdir default (package cache dir) mainarch x86 auto -catdirname default-x86-1.4/stage3-pentium4-20031016 auto -cflags -O2 auto -cxxflags -O2 auto -hostuse mmx sse auto -chost i686-pc-linux-gnu auto +cflags -O2 auto, or user +cxxflags -O2 auto, or user +hostuse mmx sse auto, or user +chost i686-pc-linux-gnu auto, or user makeopts -j2 auto (but overridable from catalyst.conf) chroot chroot auto (linux32 chroot or chroot)