From 4fc639801d041f0957591314e23c514b4d98b732 Mon Sep 17 00:00:00 2001 From: Miklos Vajna 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 | 19 +++++++++++++++++++ 2 files changed, 34 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..1a6a4c8 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,14 @@ fi AC_SUBST(BUILD_NCPUS) AC_CHECK_PROG(CCACHE, ccache, yes) +AC_CHECK_PROG(DISTCC, distcc, yes) ENABLE_CCACHE="" ENABLE_ICECREAM="" +ENABLE_DISTCC="" +if test "z`echo "$with_gcc_speedup"|grep icecream |grep distcc`" != "z"; then + AC_MSG_ERROR([icecream and distcc are mutually exclusive]) +fi for enable_speedup in `echo "$with_gcc_speedup" | sed 's/,/ /g'` do if test "$enable_speedup" = "ccache"; then @@ -768,10 +774,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 +1802,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 +1844,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