From: Michael Tremer Date: Thu, 26 Nov 2009 21:09:48 +0000 (+0100) Subject: New package: ccache. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9efad0d0adc20e5471b19e989ebf5d10dd8e6630;p=ipfire-3.x.git New package: ccache. Plus: Integration to naoki. --- diff --git a/pkgs/core/ccache/ccache.nm b/pkgs/core/ccache/ccache.nm new file mode 100644 index 000000000..0b4908128 --- /dev/null +++ b/pkgs/core/ccache/ccache.nm @@ -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 . # +# # +############################################################################### + +############################################################################### +# 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 diff --git a/tools/naoki-constants b/tools/naoki-constants index c02bf9870..d586857d1 100644 --- a/tools/naoki-constants +++ b/tools/naoki-constants @@ -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" diff --git a/tools/naoki-functions b/tools/naoki-functions index 295c8b39d..0dbb8f89e 100644 --- a/tools/naoki-functions +++ b/tools/naoki-functions @@ -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=$?