Browse Source

add ccache to host tools

Waldemar Brodkorb 10 years ago
parent
commit
35137e6c09
5 changed files with 33 additions and 7 deletions
  1. 0 7
      scripts/scan-pkgs.sh
  2. 1 0
      target/config/Config.in.adk
  3. 4 0
      target/config/Config.in.tools
  4. 3 0
      tools/Makefile
  5. 25 0
      tools/ccache/Makefile

+ 0 - 7
scripts/scan-pkgs.sh

@@ -83,11 +83,4 @@ if [[ -n $NEED_JAVA ]]; then
 	fi
 fi
 
-if [[ -n $ADK_USE_CCACHE ]]; then
-        if ! which ccache >/dev/null 2>&1; then
-                echo >&2 You have selected to build with ccache, but ccache could not be found.
-                out=1
-        fi
-fi
-
 exit $out

+ 1 - 0
target/config/Config.in.adk

@@ -46,6 +46,7 @@ config ADK_WGET_TIMEOUT
 
 config ADK_USE_CCACHE
 	bool "Use ccache to speedup recompilation"
+	select ADK_HOST_NEED_CCACHE
 	default n
 	help
 	  Useful if you have enough space for the cache and need speedup compilation.

+ 4 - 0
target/config/Config.in.tools

@@ -34,6 +34,10 @@ config ADK_HOST_NEED_XZ
 	boolean
 	default n
 
+config ADK_HOST_NEED_CCACHE
+	boolean
+	default n
+
 config ADK_TOOLS_ADDPATTERN_ARGS
 	string
 	default "-p W54G -v v4.20.6" if ADK_TARGET_BROADCOM_MODEL_LINKSYS_WRT54G

+ 3 - 0
tools/Makefile

@@ -29,6 +29,9 @@ endif
 ifeq ($(ADK_HOST_NEED_LZMA),y)
 TARGETS+=lzma
 endif
+ifeq ($(ADK_HOST_NEED_CCACHE),y)
+TARGETS+=ccache
+endif
 
 TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS))
 TARGETS_CLEAN:=$(patsubst %,%-clean,$(TARGETS))

+ 25 - 0
tools/ccache/Makefile

@@ -0,0 +1,25 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		ccache
+PKG_VERSION:=		3.1.9
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		a5e9954b1dae036762f7b13673a2cf76
+PKG_SITES:=		http://samba.org/ftp/ccache/
+
+include ../rules.mk
+
+install: ${STAGING_HOST_DIR}/usr/bin/ccache
+
+$(WRKBUILD)/.compiled: ${WRKDIST}/.prepared
+	(cd ${WRKBUILD}; ./configure --prefix=$(STAGING_HOST_DIR)/usr)
+	${MAKE} -C ${WRKBUILD} CC='${CC_FOR_BUILD}'
+	touch $@
+
+${STAGING_HOST_DIR}/usr/bin/ccache: $(WRKBUILD)/.compiled
+	$(INSTALL_BIN) $(WRKBUILD)/ccache \
+		${STAGING_HOST_DIR}/usr/bin
+
+include $(TOPDIR)/mk/tools.mk