]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Add ccache support.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Jan 2010 20:21:05 +0000 (21:21 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 30 Jan 2010 20:21:05 +0000 (21:21 +0100)
naoki/chroot.py
naoki/constants.py

index 64fe8bd0e90fe2110ec12eb00a87190e05edb1ae..c1fd21259bd085d7b57f7501d7d06173b4bb9539 100644 (file)
@@ -24,6 +24,7 @@ class Environment(object):
                        "umount -n %s" % self.chrootPath("proc"),
                        "umount -n %s" % self.chrootPath("sys"),
                        "umount -n %s" % self.chrootPath("usr", "src", "cache"),
+                       "umount -n %s" % self.chrootPath("usr", "src", "ccache"),
                        "umount -n %s" % self.chrootPath("usr", "src", "packages"),
                        "umount -n %s" % self.chrootPath("usr", "src", "pkgs"),
                        "umount -n %s" % self.chrootPath("usr", "src", "src"),
@@ -33,6 +34,7 @@ class Environment(object):
                        "mount -n -t proc naoki_chroot_proc %s" % self.chrootPath("proc"),
                        "mount -n -t sysfs naoki_chroot_sysfs %s" % self.chrootPath("sys"),
                        "mount -n --bind %s %s" % (os.path.join(CACHEDIR), self.chrootPath("usr", "src", "cache")),
+                       "mount -n --bind %s %s" % (os.path.join(CCACHEDIR), self.chrootPath("usr", "src", "ccache")),
                        "mount -n --bind %s %s" % (os.path.join(PACKAGESDIR), self.chrootPath("usr", "src", "packages")),
                        "mount -n --bind %s %s" % (os.path.join(PKGSDIR), self.chrootPath("usr", "src", "pkgs")),
                        "mount -n --bind %s %s" % (os.path.join(BASEDIR, "src"), self.chrootPath("usr", "src", "src")),
@@ -75,6 +77,7 @@ class Environment(object):
                        self.chrootPath("tmp"),
                        self.chrootPath("tools_i686"),
                        self.chrootPath("usr/src/cache"),
+                       self.chrootPath("usr/src/ccache"),
                        self.chrootPath("usr/src/packages"),
                        self.chrootPath("usr/src/pkgs"),
                        self.chrootPath("usr/src/src"),
@@ -127,6 +130,12 @@ class Environment(object):
                                "CHROOT"         : "1",
                        })
 
+                       if os.path.exists(self.chrootPath("usr", "ccache")):
+                               env.update({
+                                       "PATH" : "/usr/ccache/bin:%s" % env["PATH"],
+                                       "CCACHE_DIR" : "/usr/src/ccache",
+                               })
+
                        if kwargs.has_key("env"):
                                env.update(kwargs.pop("env"))
 
index 09c3cdcde652573f611893cdc5843d88b4d3de40..8e48b33cfb31eb2c6bb444a94063f81834ce406a 100644 (file)
@@ -7,6 +7,7 @@ BASEDIR = os.getcwd()
 
 BUILDDIR = os.path.join(BASEDIR, "build")
 CACHEDIR = os.path.join(BASEDIR, "cache")
+CCACHEDIR = os.path.join(BASEDIR, "ccache")
 CONFIGDIR = os.path.join(BASEDIR, "config")
 LOGDIR = os.path.join(BASEDIR, "logs")
 PKGSDIR = os.path.join(BASEDIR, "pkgs")
@@ -23,6 +24,7 @@ class Config(object):
        _items = {
                "toolchain" : False,
                "mandatory_packages" : [
+                       "core/ccache",
                        "core/gcc",
                        "core/glibc",
                        "core/make",