Whamcloud - gitweb
b=11500
authorwufei <wufei>
Fri, 5 Jan 2007 10:06:56 +0000 (10:06 +0000)
committerwufei <wufei>
Fri, 5 Jan 2007 10:06:56 +0000 (10:06 +0000)
r=green

Add ccache/distcc support to lbuild.

build/lmake

index 1afbb1a..1410561 100755 (executable)
@@ -261,6 +261,25 @@ load_target()
     fi
 }
 
     fi
 }
 
+# do these after load_target(), which maybe export CC
+setup_ccache_distcc()
+{
+    # distcc can't handle ".incbin"
+    if [ "$TARGET" == "2.6-suse" -o "$TARGET" == "2.6-rhel4" ]; then
+        if [ "$TARGET_ARCH" == "x86_64" ]; then
+            unset DISTCC
+        fi
+    fi
+    
+    CC=${CC:-gcc}
+    if [ "$CCACHE" ]; then
+        CC="$CCACHE $CC"
+        [ "$DISTCC" ] && export CCACHE_PREFIX="$DISTCC"
+    else
+        [ "$DISTCC" ] && CC="$DISTCC $CC"
+    fi
+}
+
 tarflags()
 {
     case "$1" in
 tarflags()
 {
     case "$1" in
@@ -787,6 +806,7 @@ done
 
 check_options
 load_target
 
 check_options
 load_target
+setup_ccache_distcc
 
 extract_kernel
 patch_kernel
 
 extract_kernel
 patch_kernel