summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh29
1 files changed, 27 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1d5c6f90c..a89b530c9 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -493,7 +493,32 @@ econf() {
LOCAL_EXTRA_ECONF="--libdir=${CONF_LIBDIR_RESULT} ${LOCAL_EXTRA_ECONF}"
fi
- echo "${ECONF_SOURCE}/configure" \
+ local TMP_CONFCACHE_DIR CONFCACHE_ARG
+ if hasq confcache $FEATURES && ! hasq confcache $RESTRICT; then
+ CONFCACHE="$(type -p confcache)"
+ if [ -z "${CONFCACHE}" ]; then
+ ewarn "disabling confcache, binary cannot be found"
+ else
+ CONFCACHE="${CONFCACHE/ /\ }"
+ TMP_CONFCACHE_DIR="${CONFCACHE:+${CONFCACHE_DIR:-${PORTAGE_TMPDIR}/confcache}}"
+ TMP_CONFCACHE_DIR="${TMP_CONFCACHE_DIR/ /\ }"
+ CONFCACHE_ARG="--confcache-dir"
+ local s
+ if [ -n "$CCACHE_DIR" ]; then
+ s="$CCACHE_DIR"
+ fi
+ if [ -n "$DISTCC_DIR" ]; then
+ s="${s:+${s}:}$DISTCC_DIR"
+ fi
+ if [ -n "$s" ]; then
+ CONFCACHE_ARG="--confcache-ignore $s $CONFCACHE_ARG"
+ fi
+ fi
+ else
+ CONFCACHE=
+ fi
+
+ echo ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
--prefix=/usr \
--host=${CHOST} \
--mandir=/usr/share/man \
@@ -504,7 +529,7 @@ econf() {
"$@" \
${LOCAL_EXTRA_ECONF}
- if ! "${ECONF_SOURCE}/configure" \
+ if ! ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
--prefix=/usr \
--host=${CHOST} \
--mandir=/usr/share/man \