diff options
-rw-r--r-- | kconfig/ccache.kconfig | 49 | ||||
-rw-r--r-- | kconfig/toolchain.kconfig | 5 | ||||
-rw-r--r-- | mk/ccache.mk | 56 | ||||
-rw-r--r-- | mk/macros.mk | 2 | ||||
-rw-r--r-- | mk/toolchain.mk | 4 |
5 files changed, 78 insertions, 38 deletions
diff --git a/kconfig/ccache.kconfig b/kconfig/ccache.kconfig new file mode 100644 index 0000000..83c764a --- /dev/null +++ b/kconfig/ccache.kconfig @@ -0,0 +1,49 @@ +################################################################################ +# Embtoolkit +# Copyright(C) 2011 Abdoulaye Walsimou GAYE. +# +# This program is free software; you can distribute it and/or modify it +## +# 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 2 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/>. +# +################################################################################ +# +# \file ccache.kconfig +# \brief Here we install ccache to speed up +# \author Abdoulaye Walsimou GAYE <awg@embtoolkit.org> +# \date July 2011 +################################################################################ + +config EMBTK_HAVE_CCACHE + bool + select EMBTK_CCACHE_PKG_IS_TARBZ2 + default y + help + ccache is a compiler cache. It speeds up recompilation by + caching previous compilations and detecting when the same + compilation is being done again. Supported languages are C, + C++, Objective-C and Objective-C++. + +config EMBTK_CCACHE_VERSION_STRING + string + default "3.1.5" + +config EMBTK_CCACHE_NEED_PATCH + bool +config EMBTK_CCACHE_NEED_AUTORECONF + bool +config EMBTK_CCACHE_PKG_IS_TARGZ + bool +config EMBTK_CCACHE_PKG_IS_TARBZ2 + bool diff --git a/kconfig/toolchain.kconfig b/kconfig/toolchain.kconfig index 86f7259..ddf896b 100644 --- a/kconfig/toolchain.kconfig +++ b/kconfig/toolchain.kconfig @@ -79,6 +79,11 @@ source "kconfig/mpchost.kconfig" endmenu # +# ccache +# +source kconfig/ccache.kconfig + +# # Autotools # source kconfig/m4.kconfig diff --git a/mk/ccache.mk b/mk/ccache.mk index dfe9534..59233e9 100644 --- a/mk/ccache.mk +++ b/mk/ccache.mk @@ -26,44 +26,28 @@ # \date May 2009 ################################################################################ -CCACHE_VERSION := 3.1.5 -CCACHE_SITE := http://samba.org/ftp/ccache -CCACHE_PACKAGE := ccache-$(CCACHE_VERSION).tar.bz2 -CCACHE_HOST_BUILD_DIR := $(TOOLS_BUILD)/ccachehost-build -CCACHE_HOST_DIR := $(HOSTTOOLS)/usr/local/ccachehost - -CCACHE_DIR := $(CCACHE_HOST_DIR) -HOSTCC_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(HOSTCC)" -HOSTCXX_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(HOSTCXX)" -TARGETCC_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(TARGETCC)" -TARGETCXX_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(TARGETCXX)" +CCACHE_NAME := ccache +CCACHE_VERSION := $(call embtk_get_pkgversion,ccache) +CCACHE_SITE := http://samba.org/ftp/ccache +CCACHE_SITE_MIRROR3 := ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror +CCACHE_PATCH_SITE := ftp://ftp.embtoolkit.org/embtoolkit.org/ccache/$(CCACHE_VERSION) +CCACHE_PACKAGE := ccache-$(CCACHE_VERSION).tar.bz2 +CCACHE_SRC_DIR := $(TOOLS_BUILD)/ccache-$(CCACHE_VERSION) +CCACHE_BUILD_DIR := $(TOOLS_BUILD)/ccachehost-build + +CCACHE_HOST_DIR := $(HOSTTOOLS)/usr/local/ccachehost +CCACHE_DIR := $(CCACHE_HOST_DIR) +HOSTCC_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(HOSTCC)" +HOSTCXX_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(HOSTCXX)" +TARGETCC_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(TARGETCC)" +TARGETCXX_CACHED := "$(CCACHE_HOST_DIR)/bin/ccache $(TARGETCXX)" export CCACHE_DIR HOSTCC_CACHED HOSTCXX_CACHED TARGETCC_CACHED TARGETCXX_CACHED -ccachehost_install: $(CCACHE_HOST_BUILD_DIR)/.installed - -$(CCACHE_HOST_BUILD_DIR)/.installed: ccache_download \ - $(CCACHE_HOST_BUILD_DIR)/.decompressed \ - $(CCACHE_HOST_BUILD_DIR)/.configured - $(MAKE) -C $(CCACHE_HOST_BUILD_DIR) $(J) - $(MAKE) -C $(CCACHE_HOST_BUILD_DIR) install - @touch $@ - -ccache_download: - @test -e $(DOWNLOAD_DIR)/$(CCACHE_PACKAGE) || \ - wget -O $(DOWNLOAD_DIR)/$(CCACHE_PACKAGE) \ - $(CCACHE_SITE)/$(CCACHE_PACKAGE) +CCACHE_PREFIX := $(CCACHE_HOST_DIR) -$(CCACHE_HOST_BUILD_DIR)/.decompressed: - $(call embtk_generic_message,"Decompressing $(CCACHE_PACKAGE) ...") - @tar -C $(TOOLS_BUILD) -xjf $(DOWNLOAD_DIR)/$(CCACHE_PACKAGE) - @mkdir -p $(CCACHE_HOST_BUILD_DIR) - @touch $@ +ccache_install: + $(call embtk_install_hostpkg,ccache) -$(CCACHE_HOST_BUILD_DIR)/.configured: - $(call embtk_generic_message,"Configure ccache-$(CCACHE_VERSION) ...") - cd $(CCACHE_HOST_BUILD_DIR) ; \ - $(TOOLS_BUILD)/ccache-$(CCACHE_VERSION)/configure \ - --prefix=$(CCACHE_HOST_DIR) \ - --build=$(HOST_BUILD) --host=$(HOST_ARCH) - @touch $@ +download_ccache: + $(call embtk_download_pkg,ccache) diff --git a/mk/macros.mk b/mk/macros.mk index 3297707..79fc367 100644 --- a/mk/macros.mk +++ b/mk/macros.mk @@ -266,6 +266,8 @@ define embtk_configure_hostpkg @cd $($(PKGV)_BUILD_DIR); \ CPPFLAGS="-I$(HOSTTOOLS)/usr/include" \ LDFLAGS="-L$(HOSTTOOLS)/$(LIBDIR) -L$(HOSTTOOLS)/usr/$(LIBDIR)" \ + $(if $(call __embtk_mk_strcmp,$(PKGV),CCACHE),,CC=$(HOSTCC_CACHED)) \ + $(if $(call __embtk_mk_strcmp,$(PKGV),CCACHE),,CXX=$(HOSTCXX_CACHED)) \ $($(PKGV)_CONFIGURE_ENV) \ $(CONFIG_SHELL) $($(PKGV)_SRC_DIR)/configure \ --build=$(HOST_BUILD) --host=$(HOST_ARCH) \ diff --git a/mk/toolchain.mk b/mk/toolchain.mk index dce0fca..7bfa80b 100644 --- a/mk/toolchain.mk +++ b/mk/toolchain.mk @@ -93,7 +93,7 @@ ifeq ($(CONFIG_EMBTK_CLIB_EGLIBC),y) #EGLIBC include $(EMBTK_ROOT)/mk/eglibc.mk TOOLCHAINBUILD := mkinitialpath $(AUTOTOOLS_INSTALL) $(EMBTK_CMAKE_INSTALL) \ - kernel-headers_install ccachehost_install \ + kernel-headers_install ccache_install \ gmphost_install mpfrhost_install mpchost_install \ binutils_install gcc1_install eglibc-headers_install \ gcc2_install eglibc_install gcc3_install @@ -101,7 +101,7 @@ else #uClibc include $(EMBTK_ROOT)/mk/uclibc.mk TOOLCHAINBUILD := mkinitialpath $(AUTOTOOLS_INSTALL) $(EMBTK_CMAKE_INSTALL) \ - kernel-headers_install ccachehost_install \ + kernel-headers_install ccache_install \ gmphost_install mpfrhost_install mpchost_install \ binutils_install gcc1_install uclibc_install gcc3_install endif |