new plugin stuff
authorDaniel Robbins <drobbins@gentoo.org>
Fri, 24 Oct 2003 05:41:20 +0000 (05:41 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Fri, 24 Oct 2003 05:41:20 +0000 (05:41 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@18 d1e1f19c-881f-0410-ab34-b69fee027534

arch/x86.py [new file with mode: 0644]
catalyst [new file with mode: 0755]
modules/catalyst_util.py

diff --git a/arch/x86.py b/arch/x86.py
new file mode 100644 (file)
index 0000000..8cdc14b
--- /dev/null
@@ -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 (executable)
index 0000000..07d2f94
--- /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
+
index 54ca0ce8ea48f8a1b351d562a6a1e14a6a1dd340..d04df45d975a7f255690a5c74c56c58be9bcae2d 100755 (executable)
@@ -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)