head	1.3;
access;
symbols
	pkgsrc-2026Q1:1.3.0.44
	pkgsrc-2026Q1-base:1.3
	pkgsrc-2025Q4:1.3.0.42
	pkgsrc-2025Q4-base:1.3
	pkgsrc-2025Q3:1.3.0.40
	pkgsrc-2025Q3-base:1.3
	pkgsrc-2025Q2:1.3.0.38
	pkgsrc-2025Q2-base:1.3
	pkgsrc-2025Q1:1.3.0.36
	pkgsrc-2025Q1-base:1.3
	pkgsrc-2024Q4:1.3.0.34
	pkgsrc-2024Q4-base:1.3
	pkgsrc-2024Q3:1.3.0.32
	pkgsrc-2024Q3-base:1.3
	pkgsrc-2024Q2:1.3.0.30
	pkgsrc-2024Q2-base:1.3
	pkgsrc-2024Q1:1.3.0.28
	pkgsrc-2024Q1-base:1.3
	pkgsrc-2023Q4:1.3.0.26
	pkgsrc-2023Q4-base:1.3
	pkgsrc-2023Q3:1.3.0.24
	pkgsrc-2023Q3-base:1.3
	pkgsrc-2023Q2:1.3.0.22
	pkgsrc-2023Q2-base:1.3
	pkgsrc-2023Q1:1.3.0.20
	pkgsrc-2023Q1-base:1.3
	pkgsrc-2022Q4:1.3.0.18
	pkgsrc-2022Q4-base:1.3
	pkgsrc-2022Q3:1.3.0.16
	pkgsrc-2022Q3-base:1.3
	pkgsrc-2022Q2:1.3.0.14
	pkgsrc-2022Q2-base:1.3
	pkgsrc-2022Q1:1.3.0.12
	pkgsrc-2022Q1-base:1.3
	pkgsrc-2021Q4:1.3.0.10
	pkgsrc-2021Q4-base:1.3
	pkgsrc-2021Q3:1.3.0.8
	pkgsrc-2021Q3-base:1.3
	pkgsrc-2021Q2:1.3.0.6
	pkgsrc-2021Q2-base:1.3
	pkgsrc-2021Q1:1.3.0.4
	pkgsrc-2021Q1-base:1.3
	pkgsrc-2020Q4:1.3.0.2
	pkgsrc-2020Q4-base:1.3
	pkgsrc-2020Q3:1.2.0.60
	pkgsrc-2020Q3-base:1.2
	pkgsrc-2020Q2:1.2.0.56
	pkgsrc-2020Q2-base:1.2
	pkgsrc-2020Q1:1.2.0.36
	pkgsrc-2020Q1-base:1.2
	pkgsrc-2019Q4:1.2.0.58
	pkgsrc-2019Q4-base:1.2
	pkgsrc-2019Q3:1.2.0.54
	pkgsrc-2019Q3-base:1.2
	pkgsrc-2019Q2:1.2.0.52
	pkgsrc-2019Q2-base:1.2
	pkgsrc-2019Q1:1.2.0.50
	pkgsrc-2019Q1-base:1.2
	pkgsrc-2018Q4:1.2.0.48
	pkgsrc-2018Q4-base:1.2
	pkgsrc-2018Q3:1.2.0.46
	pkgsrc-2018Q3-base:1.2
	pkgsrc-2018Q2:1.2.0.44
	pkgsrc-2018Q2-base:1.2
	pkgsrc-2018Q1:1.2.0.42
	pkgsrc-2018Q1-base:1.2
	pkgsrc-2017Q4:1.2.0.40
	pkgsrc-2017Q4-base:1.2
	pkgsrc-2017Q3:1.2.0.38
	pkgsrc-2017Q3-base:1.2
	pkgsrc-2017Q2:1.2.0.34
	pkgsrc-2017Q2-base:1.2
	pkgsrc-2017Q1:1.2.0.32
	pkgsrc-2017Q1-base:1.2
	pkgsrc-2016Q4:1.2.0.30
	pkgsrc-2016Q4-base:1.2
	pkgsrc-2016Q3:1.2.0.28
	pkgsrc-2016Q3-base:1.2
	pkgsrc-2016Q2:1.2.0.26
	pkgsrc-2016Q2-base:1.2
	pkgsrc-2016Q1:1.2.0.24
	pkgsrc-2016Q1-base:1.2
	pkgsrc-2015Q4:1.2.0.22
	pkgsrc-2015Q4-base:1.2
	pkgsrc-2015Q3:1.2.0.20
	pkgsrc-2015Q3-base:1.2
	pkgsrc-2015Q2:1.2.0.18
	pkgsrc-2015Q2-base:1.2
	pkgsrc-2015Q1:1.2.0.16
	pkgsrc-2015Q1-base:1.2
	pkgsrc-2014Q4:1.2.0.14
	pkgsrc-2014Q4-base:1.2
	pkgsrc-2014Q3:1.2.0.12
	pkgsrc-2014Q3-base:1.2
	pkgsrc-2014Q2:1.2.0.10
	pkgsrc-2014Q2-base:1.2
	pkgsrc-2014Q1:1.2.0.8
	pkgsrc-2014Q1-base:1.2
	pkgsrc-2013Q4:1.2.0.6
	pkgsrc-2013Q4-base:1.2
	pkgsrc-2013Q3:1.2.0.4
	pkgsrc-2013Q3-base:1.2
	pkgsrc-2013Q2:1.2.0.2
	pkgsrc-2013Q2-base:1.2;
locks; strict;
comment	@# @;


1.3
date	2020.12.12.10.42.47;	author fcambus;	state Exp;
branches;
next	1.2;
commitid	iViekbQmCivuqrzC;

1.2
date	2013.05.10.00.00.46;	author riastradh;	state Exp;
branches;
next	1.1;

1.1
date	2013.05.09.23.56.25;	author riastradh;	state Exp;
branches;
next	;


desc
@@


1.3
log
@*: fix a bunch of typos in README and various documentation files.
@
text
@$NetBSD: HOWTO-distcc,v 1.2 2013/05/10 00:00:46 riastradh Exp $

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 specifically 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 :)

@


1.2
log
@Add $NetBSD$ tag to HOWTO-distcc.
@
text
@d1 1
a1 1
$NetBSD$
d74 1
a74 1
and listen on 192.168.0.137 specificly and on port 3632 (why doesn't it do 
@


1.1
log
@Rename HOWTO-crosscompile to HOWTO-distcc for clarity.

ok agc
@
text
@d1 2
@

