-
-
Save rampageX/28ca79a9812fe684650be9ac18df84fe to your computer and use it in GitHub Desktop.
Ubuntu distcc & ccache setup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
apt-get install -y distcc distcc-pump ccache | |
sed -ie 's/STARTDISTCC="false"/STARTDISTCC="true"/' /etc/default/distcc | |
sed -ie 's/ALLOWEDNETS="127.0.0.1"/ALLOWEDNETS="192.168.0.0\/16 172.16.0.0\/12 10.0.0.0\/8"/' /etc/default/distcc | |
sed -ie 's/LISTENER="127.0.0.1"/LISTENER="0.0.0.0"/' /etc/default/distcc | |
sed -ie "s/JOBS=\"\"/JOBS=\"`grep processor /proc/cpuinfo | wc -l`\"/" /etc/default/distcc | |
sed -ie 's/ZEROCONF="false"/ZEROCONF="true"/' /etc/default/distcc | |
#PATH here? https://midnightyell.wordpress.com/2012/10/14/a-good-compromise-cross-compiling-with-distcc/ | |
echo "PATH=/opt/tomatoware/arm-soft-mmc/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" >> /etc/default/distcc | |
service distcc restart | |
echo 'CCACHE_PREFIX="distcc"' > /etc/profile.d/ccache-distcc.sh | |
echo 'CC="ccache gcc"' >> /etc/profile.d/ccache-distcc.sh | |
#for tomatoware, arm-linux-gcc etc. must in service path, or error code 110 on Router. | |
sed -ie 's~/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin~/opt/tomatoware/arm-soft-mmc/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin~' /etc/init.d/distcc | |
#add arm-linux-gcc/g++ to whitelist of distcc (error: CRITICAL! arm-linux-gcc not in /usr/lib/distcc whitelist.) | |
cd /usr/lib/distcc | |
ln -s ../../bin/distcc ./arm-linux-gcc | |
ln -s ../../bin/distcc ./arm-linux-g++ | |
#Tomatoware REF: https://github.com/lancethepants/tomatoware/wiki/Using-distcc | |
#apt-get install Error and Fix: https://github.com/distcc/distcc/issues/311 | |
#`Traceback (most recent call last): File "/usr/bin/update-distcc-symlinks", line 39, in for gnu_host in os.listdir(gcccross_dir): FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/gcc-cross'` | |
#Fixed by disable following code: | |
#`for gnu_host in os.listdir(gcccross_dir): consider_gcc("%(gnu_host)s-" % vars(), "") for version in os.listdir(gcccross_dir + "/" + gnu_host): consider_gcc("", "-%(version)s" % vars()) consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars())` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment