]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
New package: ccache.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 Nov 2009 21:09:48 +0000 (22:09 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 Nov 2009 21:09:48 +0000 (22:09 +0100)
Plus: Integration to naoki.

pkgs/core/ccache/ccache.nm [new file with mode: 0644]
tools/naoki-constants
tools/naoki-functions

diff --git a/pkgs/core/ccache/ccache.nm b/pkgs/core/ccache/ccache.nm
new file mode 100644 (file)
index 0000000..0b49081
--- /dev/null
@@ -0,0 +1,60 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt                 #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include $(PKGROOT)/Include
+
+PKG_NAME       = ccache
+PKG_VER        = 2.4
+PKG_REL        = 0
+
+PKG_MAINTAINER =
+PKG_GROUP      = Development/Compilers
+PKG_URL        = http://ccache.samba.org/
+PKG_LICENSE    = GPLv2+
+PKG_SUMMARY    = C/C++ compiler cache.
+
+define PKG_DESCRIPTION
+       ccache is a compiler cache.  It acts as a caching pre-processor to \
+       C/C++ compilers, using the -E compiler switch and a hash to detect \
+       when a compilation can be satisfied from cache.  This often results in \
+       a 5 to 10 times speedup in common compilations.
+endef
+
+PKG_TARBALL    = $(THISAPP).tar.gz
+
+PKG_PATCHES   += $(THISAPP).patch
+
+###############################################################################
+# Installation Details
+###############################################################################
+
+define STAGE_INSTALL
+       cd $(DIR_APP) && make install DESTDIR=$(BUILDROOT)
+
+       mkdir -pv $(BUILDROOT)/usr/ccache/bin
+       for i in gcc g++ cc; do \
+               ln -svf ../../bin/ccache $(BUILDROOT)/usr/ccache/bin/$${i}; \
+               ln -svf ../../bin/ccache $(BUILDROOT)/usr/ccache/bin/$(TARGET)-$${i}; \
+       done
+endef
index c02bf9870a8ee5cc6494e67172cb27f7fde9d3b8..d586857d1813be92ccbf6e044d2fb4c1cc3ff047 100644 (file)
@@ -7,7 +7,7 @@ TOOLS_DIR_REAL=${BASEDIR}/build/tools_${MACHINE}
 
 ARCH=i686
 
-PACKAGES_MANDATORY="bash bzip2 coreutils cpio diffutils findutils gawk gcc grep"
+PACKAGES_MANDATORY="bash bzip2 ccache coreutils cpio diffutils findutils gawk gcc grep"
 PACKAGES_MANDATORY="${PACKAGES_MANDATORY} gzip libtool make patch sed tar util-linux-ng"
 PACKAGES_MANDATORY="${PACKAGES_MANDATORY} which"
 
index 295c8b39d649d8296b497e7860762c9458734cd6..0dbb8f89ecf4240d30bfd7baaca6bdcafe0d5b50 100644 (file)
@@ -184,6 +184,12 @@ function naoki_cmd() {
        else
                path="${path}:${toolchain_path}"
        fi
+
+       # ccache
+       if [ -x "${BUILD_DIR}/usr/bin/ccache" ]; then
+               path="/usr/ccache/bin:${path}"
+       fi
+
        log DEBUG "  PATH : ${path}"
        
        local pkgroot=${DIR_PKGS}
@@ -227,6 +233,10 @@ function naoki_cmd() {
                        TARGET_MACHINE="${MACHINE}" \
                        PARALLELISMFLAGS="${PARALLELISMFLAGS}" \
                        \
+                       CCACHE_DIR=$([ "${TOOLCHAIN}" = "1" ] && \
+                               echo "${BASEDIR}/ccache" || \
+                               echo "/usr/src/ccache") \
+                       \
                        ${cmd}
 
        ret=$?