Following up on a link of tips provided by @Unxmaal (https://gitlab.com/gnuwget/wget2/-/wikis/Developer-hints:-Increasing-speed-of-GNU-toolchain), here's a little recipe that's currently working pretty well for me.
Caution: Use of the autoconf
So, cautionary tale out of the way - steps for setup:
* Directory and
I currently use a
* Environment variable telling
* Run
Be amazed as nothing is sped up - but wait!
* Rerun
How this works:
Basically it takes a bunch of environment vars like CFLAGS and LDFLAGS, hashes them and creates a unique
On the whole it works pretty well. If you're getting strange behaviour, you can delete the files it creates, or unset the environment variable to avoid it altogether.
Enjoy.
Caution: Use of the autoconf
config.cache
can potentially cause weird things to fail that otherwise shouldn't (due to collisions in test naming). This can certainly speed you up when it works flawlessly - but in the case where autoconf (configure
) is failing - you _may_ be seeing a false positive. Buyer beware.So, cautionary tale out of the way - steps for setup:
* Directory and
config.site
script directing autoconf where stuff is cachedI currently use a
~/devtools/configcache
directory, you can adjust this where suits you, adjust paths in the following.~/devtools/configcache/config.site
contents:
Code:
if test "$cache_file" = /dev/null; then
# Can't do this, results in new cache for each package
# hash=`env|shasum|cut -d ' ' -f1`
hash=`echo $CPPFLAGS $CC $M4 $PERL $PERL_PATH $SED $CXX $CFLAGS $CXXFLAGS $LDFLAGS $LIBS $host_alias $build_alias|shasum|cut -d ' ' -f1`
cache_file=$HOME/devtools/configcache/config.cache.$hash
cache_file_dir=$HOME/devtools/config.cache.$hash.dir
mkdir -p $cache_file_dir
cache_file_descr=$cache_file_dir/description
echo "$RPM_PACKAGE_NAME CPPFLAGS=$CPPFLAGS CC=$CC M4=$M4 PERL=$PERL PERL_PATH=$PERL_PATH SED=$SED CXX=$CXX CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS LDFLAGS=$LDFLAGS LIBS=$LIBS" >>$cache_file_descr
touch $cache_file
fi
* Environment variable telling
configure
that you have a cache and want to use it:
Code:
export CONFIG_SITE=$HOME/devtools/configcache/config.site
configure
for the package you want (this can include rpmbuild
, too)Be amazed as nothing is sped up - but wait!
* Rerun
configure
- and now the benefit should start to be a little more obvious.How this works:
Basically it takes a bunch of environment vars like CFLAGS and LDFLAGS, hashes them and creates a unique
configure
cache for each of those keys.On the whole it works pretty well. If you're getting strange behaviour, you can delete the files it creates, or unset the environment variable to avoid it altogether.
Enjoy.