diff options
author | riastradh <riastradh@pkgsrc.org> | 2013-05-09 23:56:25 +0000 |
---|---|---|
committer | riastradh <riastradh@pkgsrc.org> | 2013-05-09 23:56:25 +0000 |
commit | b1c71e0003b6645e13b5967d60267c7e130abab8 (patch) | |
tree | fca04ce45a53623e07b336e8180e56d2b5370608 /doc/HOWTO-distcc | |
parent | 4fc9f564bc1e55c92794e22b9db447cf95ad6873 (diff) | |
download | pkgsrc-b1c71e0003b6645e13b5967d60267c7e130abab8.tar.gz |
Rename HOWTO-crosscompile to HOWTO-distcc for clarity.
ok agc
Diffstat (limited to 'doc/HOWTO-distcc')
-rw-r--r-- | doc/HOWTO-distcc | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/doc/HOWTO-distcc b/doc/HOWTO-distcc new file mode 100644 index 00000000000..db79ea60d5b --- /dev/null +++ b/doc/HOWTO-distcc @@ -0,0 +1,110 @@ +Crosscompiling with distcc HOWTO +================================ + +Purpose: +-------- +croscompiling of sourcecode in general including NetBSD's source +tree and NetBSD's pkgsrc packages using `pkgsrc/devel/distcc' + +Note that this current setup is not intended for build builds as it might +confuse the buildbuild system. + +Terminology: +------------ + +There are multiple terminologies in use for cross building. In pkgsrc, we use + + build platform: the system on which you are doing the compilation of packages + + target platform: the system on which you will run the packages + +(An alternative terminology is that used by autoconf: + + build: as above + host: as "target", above + target: the architecture that the cross-built compiler produces code for + +pkgsrc chooses the more simple build/target terms because the Canadian +Cross situation is not common in pkgsrc. Partially because of the +potential for confusion with autoconf's terminology, we avoid the word +"host". + +Target machine setup: +--------------------- +1) install `pkgsrc/devel/distcc' package. + +2) install helper script "use-distcc" in f.e. /usr/local/bin/: + --------- + #!/usr/pkg/bin/tcsh + + setenv PATH "/usr/distcc/bin:$PATH" + setenv CC gcc + --------- + +3) create directory "/usr/distcc/bin" contents with softlinks : + lrwxr-xr-x 1 root wheel 20 Sep 16 02:58 c++@ -> ../../pkg/bin/distcc + lrwxr-xr-x 1 root wheel 20 Sep 16 02:57 cc@ -> ../../pkg/bin/distcc + lrwxr-xr-x 1 root wheel 20 Sep 16 02:58 g++@ -> ../../pkg/bin/distcc + lrwxr-xr-x 1 root wheel 20 Sep 16 02:57 gcc@ -> ../../pkg/bin/distcc + + +Helper machine setup: +--------------------- +1) install `pkgsrc/devel/distcc' package. + +2) create a crosscompiler to compile from any architecture to NetBSD/sparc, +go to the NetBSD src dir and run : + ./build.sh -a sparc -m sparc -T /usr/gcc-cross-sparc/ tools + +this will create a directory called /usr/gcc-cross-sparc/ with the +crosscompilation tools. + +3) install helper script "START-distcc' + ------------ + #!/usr/pkg/bin/tcsh + + setenv PATH "/usr/gcc-cross-sparc/sparc--netbsdelf/bin/:$PATH" + setenv DISTCC_VERBOSE 1 + + distccd -a 192.168.0.137/24 --listen 192.168.0.137 -p 3632 + ----------- +this will start the `distcc' daemon to listen on the 192.168.0/24 network +and listen on 192.168.0.137 specificly and on port 3632 (why doesn't it do +this on default?) + + +Compilation of sources (not pkgsrc): +------------------------------------ +1) on each helper machine run the `START-distcc' script + +2) on the target machine (replace helper1, helper2 etc. by the names/ip +addresses of the helper machines) : + ----------- + source /usr/local/bin/use-distcc + setenv DISTCC_HOSTS "helper1 helper2 helper3" + cd .../sourcedir + make -j2 target + ----------- + + +Compilation of pkgsrc packages: +------------------------------- +1) on each helper machine run the `START-distcc' script + +2) on the target machine, do NOT run the `use-distcc' script, go to the +package dir and set : + +set the helpers (,lzo addition sets compression of the data transport): + setenv DISTCC_HOSTS "helper1 helper2 helper3,lzo" + +instruct pkgsrc to use distcc: + setenv PKGSRC_COMPILER "distcc gcc" + +set the concurrency level (not all packages allow this) + setenv BUILD_MAKE_FLAGS "-j2" + +compile/update package + make update + +thats all :) + |