Browse Source

add basic ccache support

Waldemar Brodkorb 14 years ago
parent
commit
3ccce9f9a1
5 changed files with 18 additions and 3 deletions
  1. 0 1
      TODO
  2. 5 1
      mk/vars.mk
  3. 0 1
      package/openssl/Makefile
  4. 7 0
      scripts/scan-pkgs.sh
  5. 6 0
      target/config/Config.in.adk

+ 0 - 1
TODO

@@ -3,7 +3,6 @@
 - add and test brcm 2.6 wireless support
 - man pages in ipkg/tgz packages (automatic)
 - automate /etc handling via conffiles
-- ccache support for speedup
 - distcc evaluation
 - LTO GCC evaluation
 - fix qemu package

+ 5 - 1
mk/vars.mk

@@ -10,7 +10,6 @@ MAKEFLAGS=		$(EXTRA_MAKEFLAGS)
 BUILD_USER=		$(shell id -un)
 BUILD_GROUP=		$(shell id -gn)
 
-
 BASE_DIR:=		$(TOPDIR)
 DISTDIR?=		${BASE_DIR}/dl
 BUILD_DIR:=		${BASE_DIR}/build_${ADK_TARGET_SYSTEM}_${CPU_ARCH}_${ADK_TARGET_LIBC}
@@ -37,6 +36,7 @@ TARGET_DIR_PFX:=	$(BASE_DIR)/root_*
 TARGET_PATH=		${SCRIPT_DIR}:${TOOLS_DIR}:${STAGING_HOST_DIR}/bin:${STAGING_HOST_DIR}/usr/bin:${STAGING_TARGET_DIR}/scripts:${_PATH}
 REAL_GNU_TARGET_NAME=	$(CPU_ARCH)-$(ADK_VENDOR)-linux-$(ADK_TARGET_SUFFIX)
 GNU_TARGET_NAME=	$(CPU_ARCH)-$(ADK_VENDOR)-linux
+
 ifeq ($(ADK_NATIVE),y) 
 TARGET_CROSS:=
 TARGET_COMPILER_PREFIX?=
@@ -45,6 +45,10 @@ TARGET_CROSS:=		$(STAGING_HOST_DIR)/bin/$(REAL_GNU_TARGET_NAME)-
 TARGET_COMPILER_PREFIX?=${TARGET_CROSS}
 endif
 
+ifneq ($(strip ${ADK_USE_CCACHE}),)
+TARGET_COMPILER_PREFIX=ccache ${TARGET_CROSS}
+endif
+
 # target compiler flags
 TARGET_CC:=		${TARGET_COMPILER_PREFIX}gcc
 TARGET_CXX:=		${TARGET_COMPILER_PREFIX}g++

+ 0 - 1
package/openssl/Makefile

@@ -59,7 +59,6 @@ do-configure:
 
 do-build:
 	$(MAKE) -C $(WRKBUILD) \
-		MAKEDEPPROG="$(TARGET_CC)" \
 		OPTIMIZATION_FLAGS="$(TARGET_CFLAGS) -fPIC" \
 		depend
 	$(MAKE) -C $(WRKBUILD) \

+ 7 - 0
scripts/scan-pkgs.sh

@@ -326,4 +326,11 @@ if [[ -n $NEED_PYTHON ]]; 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

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

@@ -32,6 +32,12 @@ config ADK_STATIC
 	help
 	  Useful for toolchain only target devices.
 
+config ADK_USE_CCACHE
+	bool "Use ccache to speedup recompilation"
+	default n
+	help
+	  Useful if you have enough space for the cache and need speedup compilation.
+
 config ADK_MAKE_JOBS
 	int
 	default 1 if ! ADK_MAKE_PARALLEL