]> git.apps.os.sepia.ceph.com Git - autobuild-ceph.git/commitdiff
build: use ccache wrappers rather than setting CC/CXX wip-ccache 72/head
authorJosh Durgin <jdurgin@redhat.com>
Wed, 6 Apr 2016 00:29:09 +0000 (17:29 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 6 Apr 2016 00:29:11 +0000 (17:29 -0700)
Taken from https://github.com/ceph/ceph/pull/8461 - works around a bug
in distutils (https://bugs.python.org/issue8027)

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
build-ceph-deb-native.sh
build-ceph-deb.sh
build-ceph-gcov.sh
build-ceph-notcmalloc.sh
build-ceph-rpm.sh
build-ceph.sh
build-kernel-deb.sh
build-kernel-raw.sh
build-kernel-rpm.sh

index a4c12c09c00f27ce93de5a299159e96a87af53c4..8b3a6d269f1356a2372c485b1a1a2d4547888c5b 100755 (executable)
@@ -46,7 +46,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 146b0b3bcea535310014805638d505b17788d9b1..cf21eb6e91e19e4784021d818124281438a32378 100755 (executable)
@@ -46,7 +46,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 31ccf8a16c30688c8d63755725a7a282348a5afb..138e9dd396b06a45b5e2c164a5902611a87633c2 100755 (executable)
@@ -44,7 +44,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 049720e3f3bd8f56af50251e5862a23b27f41314..bc31da9f126dab81397c25ea818361d7bf145566 100755 (executable)
@@ -45,7 +45,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index b1b3818b1a18fbff7e208d3fe9159d6702ef7885..8daab87ff4eb88466127de5bae62903d6be1401c 100755 (executable)
@@ -72,7 +72,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 006a5603aaf58a7522225ffbb014de7aea533013..6680fbbe9284c26e4f8baacf589f291b3412549e 100755 (executable)
@@ -50,7 +50,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 75c983450623940c9d07179de0813d0ee04829ba..a9e93f0ccf5424427003cc96a590d7b02ccea58b 100755 (executable)
@@ -17,7 +17,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 76a2bce23e7fca0e2fb37ace0391ba349c70ea94..142e840b10df1609c882f857252d668ba049d43c 100755 (executable)
@@ -19,7 +19,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2
index 0141ac63536da5c71b85f32cf5093ddb5ba87821..cb0e2f5b466efb50ee5e1f259249b7080167e048 100755 (executable)
@@ -40,7 +40,11 @@ if command -v ccache >/dev/null; then
   if [ ! -e "$CCACHE_DIR" ]; then
     echo "$0: have ccache but cache directory does not exist: $CCACHE_DIR" 1>&2
   else
-    set -- CC='ccache gcc' CXX='ccache g++'
+    CCACHE_PATH="$PATH"
+    for d in /usr/{lib64,lib,lib32,libexec}/ccache{,/bin} ; do
+      test -d "$d" && test -x "$d/g++" && CCACHE_PATH="$d:$PATH" && break
+    done
+    export PATH="$CCACHE_PATH"
   fi
 else
   echo "$0: no ccache found, compiles will be slower." 1>&2