-
-
Save jvcleave/7149545 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>distccd-rpi</string> | |
<key>Program</key> | |
<string>/Users/YOUR_USER_NAME/Scripts/launchd-distccd.sh</string> | |
<key>RunAtLoad</key> | |
<true/> | |
</dict> | |
</plist> | |
<!--this file goes in /Library/LaunchDaemons/distccd-rpi.plist --> |
#ON THE RASPBERRY PI | |
$ sudo apt-get install distcc | |
$ nano ~/.profile | |
#insert as last line, CTRL+O to save, CTRL+X to exit | |
export MAKEFLAGS="-j 64 CC=distcc arm-linux-gcc CXX=distcc arm-linux-g++" | |
$ source ~/.profile | |
$ cd | |
$ nano .distcc/hosts | |
#put in your Mac's IP Address, CTRL+O to save, CTRL+X to exit | |
#for example my file contains only | |
192.168.200.25 | |
#ON THE MAC | |
$ nano ~/.profile | |
#if file exists the important thing is to insert | |
# /usr/local/arm-linux/bin: right after PATH= | |
#this is mine | |
export PATH=/usr/local/arm-linux/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin | |
$ source ~/.profile | |
#further steps will require Homebrew | |
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
#this will download the install script below | |
$ curl -O https://gist.github.com/jvcleave/7149545/raw/c2274f09b734fba2a9ecfeeea45dbab84d53704c/install.sh | |
$ chmod +x install.sh | |
$ ./install.sh | |
#this will start the distcc server | |
#verbose will print messages that you can look at in the Mac Console (printed to system.log) | |
#my ip block is 192.168.200.0, change below to match yours | |
$ distccd --daemon --allow 192.168.200.0/23 --no-detach --verbose | |
#!/bin/bash | |
PKG=~/Desktop/arm-linux-gnueabihf.pkg | |
if [ -f $PKG ]; | |
then | |
echo "$PKG exists" | |
else | |
echo "$PKG does not exist" | |
cd ~/Desktop | |
curl -O http://www.jvcref.com/files/PI/arm-linux-gnueabihf.pkg | |
fi | |
brew install distcc | |
sudo installer -pkg $PKG -target / | |
cd /usr/local/arm-linux/bin | |
for file in `ls`; do | |
if [[ "$file" == "link" ]] || [[ "$file" = arm-cortex_a8-linux-gnueabi-* ]]; then | |
#echo $file | |
#echo ${file#arm-cortex_a8-linux-gnueabi-} | |
continue | |
fi | |
ln -s $file ${file#arm-cortex_a8-linux-gnueabi-} | |
done | |
for file in `ls`; do | |
if [[ "$file" = arm-linux-* ]]; then | |
#echo $file | |
#echo ${file#arm-linux-} | |
sudo mv $file ${file#arm-linux-} | |
continue | |
fi | |
done |
#!/bin/sh | |
export PATH=/usr/local/arm-linux/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin | |
/usr/local/bin/distccd --daemon --allow 192.168.200.0/23 --no-detach --verbose | |
#this file is for launchd so you can run at startup (on the Mac) | |
#I placed this in /Users/YOUR_USER_NAME/Scripts/launchd-distccd.sh |
Also, if you want to advertise the service via zeroconf (this isn't possible w/ brew distcc
on the mac b/c it is compiled w/o avahi / dns-sd. Since my pis are looking for distcc
servers using avahi, you might do something like this as a part of a startup script:
dns-sd -R distcc@mac _distcc._tcp . 3632 txtvers=1 cpus=8 distcc=3.2rc1 gnuhost=osx cc_version=4.7.1 cc_machine=arm-cortex_a8-linux-gnueabi
@bakercp yes - I forgot to install distcc via brew - now updated
What is the proper way to start distccd? After install through brew, it says:
Use 'brew services start distcc' to start distccd automatically on login.
By default, it will allow access to all clients on 192.168.0.1/24.
To have launchd start distcc now and restart at login:
brew services start distcc
Is there a config file like on linux /etc/default/distcc ?
You could skip the
brew
install by usingcurl
... did you mean to installdistccd
somewhere w/ brew too?