From cbdfc216de53008f379c452a185bdee5ca5f5624 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 2 Jul 2011 09:15:29 +0200 Subject: [PATCH] xbps-src: added XBPS_CCACHE option to xbps-src.conf. If set /usr/lib/ccache/bin will be added to PATH as the first entry, *only* for chroot. --- xbps-src/etc/xbps-src.conf.in | 7 ++++++- xbps-src/xbps-src.sh.in | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xbps-src/etc/xbps-src.conf.in b/xbps-src/etc/xbps-src.conf.in index ec617261e20..81534e2158c 100644 --- a/xbps-src/etc/xbps-src.conf.in +++ b/xbps-src/etc/xbps-src.conf.in @@ -21,11 +21,16 @@ XBPS_MASTERDIR=$XBPS_DISTRIBUTIONDIR/masterdir #XBPS_CACHEDIR=/path/to/cachedir/with/user/permissions/to/write # -# Compilation flags for cc and c++. +# Compilation flags for C and C++. # XBPS_CFLAGS="-O2 -pipe" XBPS_CXXFLAGS="$XBPS_CFLAGS" +# +# Enable or disable ccache to build packages from source. +# +#XBPS_CCACHE=yes + # # Linker flags passed to the compiler. By default we use --as-needed to # avoid linking extra libraries into binaries. See the following link diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 752784a766c..a4e8681083d 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -249,8 +249,11 @@ if [ -z "$in_chroot" ]; then MYPATH="$XBPS_MASTERDIR/usr/local/bin:$MYPATH" MYPATH="$XBPS_MASTERDIR/usr/local/sbin:$MYPATH" else + if [ -n "$XBPS_CCACHE" ]; then + CCACHEPATH="/usr/lib/ccache/bin" + fi # In chroot always prefer tools from bootstrap. - MYPATH="/usr/lib/ccache/bin:/tools/bin:/usr/local/sbin:/usr/local/bin" + MYPATH="$CCACHEPATH:/tools/bin:/usr/local/sbin:/usr/local/bin" MYPATH="$MYPATH:/bin:/sbin:/usr/bin:/usr/sbin" fi export PATH="$MYPATH"