[BACK]Return to HOWTO-crosscompile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / doc

File: [cvs.NetBSD.org] / pkgsrc / doc / Attic / HOWTO-crosscompile (download)

Revision 1.1, Fri Feb 2 15:23:16 2007 UTC (13 years, 11 months ago) by reinoud
Branch: MAIN
CVS Tags: pkgsrc-2011Q3-base, pkgsrc-2011Q3, pkgsrc-2011Q2-base, pkgsrc-2011Q2, pkgsrc-2011Q1-base, pkgsrc-2011Q1, pkgsrc-2010Q4-base, pkgsrc-2010Q4, pkgsrc-2010Q3-base, pkgsrc-2010Q3, pkgsrc-2010Q2-base, pkgsrc-2010Q2, pkgsrc-2010Q1-base, pkgsrc-2010Q1, pkgsrc-2009Q4-base, pkgsrc-2009Q4, pkgsrc-2009Q3-base, pkgsrc-2009Q3, pkgsrc-2009Q2-base, pkgsrc-2009Q2, pkgsrc-2009Q1-base, pkgsrc-2009Q1, pkgsrc-2008Q4-base, pkgsrc-2008Q4, pkgsrc-2008Q3-base, pkgsrc-2008Q3, pkgsrc-2008Q2-base, pkgsrc-2008Q2, pkgsrc-2008Q1-base, pkgsrc-2008Q1, pkgsrc-2007Q4-base, pkgsrc-2007Q4, pkgsrc-2007Q3-base, pkgsrc-2007Q3, pkgsrc-2007Q2-base, pkgsrc-2007Q2, pkgsrc-2007Q1-base, pkgsrc-2007Q1, cwrapper, cube-native-xorg-base, cube-native-xorg

Initial commit of pkgsrc crosscompile HOWTO. It till needs some tweaking
and could eventually be incorporated into the guide.

Crosscompiling with distcc HOWTO

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.

Target machine setup:
1) install `pkgsrc/devel/distcc' package.

2) install helper script "use-distcc" in f.e. /usr/local/bin/:

	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' 

	setenv PATH "/usr/gcc-cross-sparc/sparc--netbsdelf/bin/:$PATH"

	distccd -a  --listen -p 3632
this will start the `distcc' daemon to listen on the 192.168.0/24 network 
and listen on 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 :)