1 Crosscompiling with distcc HOWTO
2 ================================
6 croscompiling of sourcecode in general including NetBSD's source
7 tree and NetBSD's pkgsrc packages using `pkgsrc/devel/distcc'
9 Note that this current setup is not intended for build builds as it might
10 confuse the buildbuild system.
15 There are multiple terminologies in use for cross building. In pkgsrc, we use
17 build platform: the system on which you are doing the compilation of packages
19 target platform: the system on which you will run the packages
21 (An alternative terminology is that used by autoconf:
24 host: as "target", above
25 target: the architecture that the cross-built compiler produces code for
27 pkgsrc chooses the more simple build/target terms because the Canadian
28 Cross situation is not common in pkgsrc. Partially because of the
29 potential for confusion with autoconf's terminology, we avoid the word
34 1) install `pkgsrc/devel/distcc' package.
36 2) install helper script "use-distcc" in f.e. /usr/local/bin/:
40 setenv PATH "/usr/distcc/bin:$PATH"
44 3) create directory "/usr/distcc/bin" contents with softlinks :
45 lrwxr-xr-x 1 root wheel 20 Sep 16 02:58 c++@ -> ../../pkg/bin/distcc
46 lrwxr-xr-x 1 root wheel 20 Sep 16 02:57 cc@ -> ../../pkg/bin/distcc
47 lrwxr-xr-x 1 root wheel 20 Sep 16 02:58 g++@ -> ../../pkg/bin/distcc
48 lrwxr-xr-x 1 root wheel 20 Sep 16 02:57 gcc@ -> ../../pkg/bin/distcc
53 1) install `pkgsrc/devel/distcc' package.
55 2) create a crosscompiler to compile from any architecture to NetBSD/sparc,
56 go to the NetBSD src dir and run :
57 ./build.sh -a sparc -m sparc -T /usr/gcc-cross-sparc/ tools
59 this will create a directory called /usr/gcc-cross-sparc/ with the
60 crosscompilation tools.
62 3) install helper script "START-distcc'
66 setenv PATH "/usr/gcc-cross-sparc/sparc--netbsdelf/bin/:$PATH"
67 setenv DISTCC_VERBOSE 1
69 distccd -a 192.168.0.137/24 --listen 192.168.0.137 -p 3632
71 this will start the `distcc' daemon to listen on the 192.168.0/24 network
72 and listen on 192.168.0.137 specificly and on port 3632 (why doesn't it do
76 Compilation of sources (not pkgsrc):
77 ------------------------------------
78 1) on each helper machine run the `START-distcc' script
80 2) on the target machine (replace helper1, helper2 etc. by the names/ip
81 addresses of the helper machines) :
83 source /usr/local/bin/use-distcc
84 setenv DISTCC_HOSTS "helper1 helper2 helper3"
90 Compilation of pkgsrc packages:
91 -------------------------------
92 1) on each helper machine run the `START-distcc' script
94 2) on the target machine, do NOT run the `use-distcc' script, go to the
97 set the helpers (,lzo addition sets compression of the data transport):
98 setenv DISTCC_HOSTS "helper1 helper2 helper3,lzo"
100 instruct pkgsrc to use distcc:
101 setenv PKGSRC_COMPILER "distcc gcc"
103 set the concurrency level (not all packages allow this)
104 setenv BUILD_MAKE_FLAGS "-j2"
106 compile/update package