[ooo-build] distcc support
Miklos Vajna
vmiklos at frugalware.org
Tue Aug 3 08:08:35 PDT 2010
Hi Kendy,
I'm attaching a patch that adds support for distcc - it's useful in
environment where distcc is available but icecream is not.
Let me know if it's OK or not OK to push it.
Thanks!
-------------- next part --------------
From 9e14a9706d839a27c31558dd80621d2bdcf458b2 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos at frugalware.org>
Date: Tue, 3 Aug 2010 17:05:17 +0200
Subject: [PATCH] Add distcc support
* bin/setup.in: add distcc to $CC / $CXX if requested
* configure.in: check for distcc
---
bin/setup.in | 15 +++++++++++++++
configure.in | 16 ++++++++++++++++
2 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/bin/setup.in b/bin/setup.in
index 4715143..bacd43c 100755
--- a/bin/setup.in
+++ b/bin/setup.in
@@ -21,6 +21,7 @@ APPLY_DIR='@APPLY_DIR@'
BUILD_NCPUS='@BUILD_NCPUS@'
ENABLE_CCACHE='@ENABLE_CCACHE@'
ENABLE_ICECREAM='@ENABLE_ICECREAM@'
+ENABLE_DISTCC='@ENABLE_DISTCC@'
ICECREAM_BINDIR='@ICECREAM_BINDIR@'
MAX_JOBS='@MAX_JOBS@'
export OOO_BUILD_NOARCH='@OOO_BUILD_NOARCH@'
@@ -230,6 +231,15 @@ if test "z$CCACHE_DIR" = "z" ; then
CCACHE_DIR=$BUILDDIR/.ccache
fi
+if test "z$ENABLE_DISTCC" != "z" ; then
+ CC="distcc gcc"; export CC
+ CXX="distcc g++"; export CXX
+ if test "z$ENABLE_CCACHE" != "z" ; then
+ CC="ccache $CC"; export CC
+ CXX="ccache $CXX"; export CXX
+ fi
+fi
+
# how to mark config files in file lists
if test "z$VENDORNAME" = "zNovell" -o "z$VENDORNAME" = "zRedHat"; then
RPM_CONFIG_FILE_TAGS="%config"
@@ -361,6 +371,11 @@ if test "$ENABLE_ICECREAM" = "yes"; then
else
echo " icecream: no"
fi
+if test "$ENABLE_DISTCC" = "yes"; then
+ echo " distcc: yes"
+else
+ echo " distcc: no"
+fi
if test "$MAX_JOBS" -gt 1; then
echo " Max number of jobs to run in parallel is '$MAX_JOBS'"
fi
diff --git a/configure.in b/configure.in
index ba581a4..a129ed7 100644
--- a/configure.in
+++ b/configure.in
@@ -228,6 +228,7 @@ AC_ARG_WITH(gcc-speedup,
ccache (caching results of previous compilation) and
icecream (distributed compiling tool) are supported.
Both can be used at the same time.
+ You can also choose distcc instead of icecream.
Example: --with-gcc-speedup=ccache,icecream],
,)
@@ -755,9 +756,11 @@ fi
AC_SUBST(BUILD_NCPUS)
AC_CHECK_PROG(CCACHE, ccache, yes)
+AC_CHECK_PROG(DISTCC, distcc, yes)
ENABLE_CCACHE=""
ENABLE_ICECREAM=""
+ENABLE_DISTCC=""
for enable_speedup in `echo "$with_gcc_speedup" | sed 's/,/ /g'`
do
if test "$enable_speedup" = "ccache"; then
@@ -768,10 +771,17 @@ do
fi
elif test "$enable_speedup" = "icecream"; then
ENABLE_ICECREAM="yes"
+ elif test "$enable_speedup" = "distcc"; then
+ if test "$DISTCC" != "yes"; then
+ AC_MSG_ERROR([distcc not found, but set in --with-gcc-speedup])
+ else
+ ENABLE_DISTCC="yes"
+ fi
fi
done
AC_SUBST(ENABLE_CCACHE)
AC_SUBST(ENABLE_ICECREAM)
+AC_SUBST(ENABLE_DISTCC)
ICECREAM_BINDIR="/opt/icecream/bin"
if test "z$with_icecream_bindir" != "z"; then
@@ -1789,6 +1799,11 @@ if test "$ENABLE_ICECREAM" = "yes"; then
else
icecream_message="no"
fi
+if test "$ENABLE_DISTCC" = "yes"; then
+ distcc_message="yes"
+else
+ distcc_message="no"
+fi
if test "$MAX_JOBS" -gt 1; then
max_job_message="'$MAX_JOBS'"
else
@@ -1826,6 +1841,7 @@ Building openoffice
ooo-install-dir: $OOOINSTALLDIRNAME
ccache: $ccache_message
icecream: $icecream_message
+ distcc: $distcc_message
max jobs: $max_job_message
cairo: $cairo_enabled
build type: $build_product build
--
1.7.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/ooo-build/attachments/20100803/68f19956/attachment.pgp>
More information about the ooo-build
mailing list