From: Michael Tremer Date: Sat, 30 Jan 2010 20:21:05 +0000 (+0100) Subject: naoki: Add ccache support. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1f441dbc9f151c34b32fa3099bcf270695d651d;p=ipfire-3.x.git naoki: Add ccache support. --- diff --git a/naoki/chroot.py b/naoki/chroot.py index 64fe8bd0e..c1fd21259 100644 --- a/naoki/chroot.py +++ b/naoki/chroot.py @@ -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")) diff --git a/naoki/constants.py b/naoki/constants.py index 09c3cdcde..8e48b33cf 100644 --- a/naoki/constants.py +++ b/naoki/constants.py @@ -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",