Subject: CVS commit: pkgsrc/mk
To: None <pkgsrc-changes@NetBSD.org>
From: Joerg Sonnenberger <joerg@netbsd.org>
List: pkgsrc-changes
Date: 08/02/2007 18:19:33
Module Name:	pkgsrc
Committed By:	joerg
Date:		Thu Aug  2 18:19:33 UTC 2007

Modified Files:
	pkgsrc/mk: bsd.prefs.mk
	pkgsrc/mk/buildlink3: bsd.buildlink3.mk
	pkgsrc/mk/compiler: gcc.mk
	pkgsrc/mk/flavor/pkg: flavor-vars.mk package.mk
	pkgsrc/mk/install: bin-install.mk
	pkgsrc/mk/tools: tools.NetBSD.mk
	pkgsrc/mk/wrapper: arg-source bsd.wrapper.mk
Added Files:
	pkgsrc/mk/wrapper: cmd-sink-cross-cpp cmd-sink-cross-gcc

Log Message:
Add core of the infrastructure support for cross-compilation.

- USE_CROSS_COMPILATION activates it, CROSS_DESTDIR specifies root of
  the target filesystem
- derive _CROSS_DESTDIR from CROSS_DESTDIR or MAKEOBJDIR
- buildlink3.mk prefixes the files to symlink with _CROSS_DESTDIR
- compiler/gcc.mk knows about the target prefix (e.g. i386--netbsdelf)
- PKG_DBDIR is prefixed with _CROSS_DESTDIR
- package-install and bin-install are not called with su
- install and strip are redirected to the tool version
- links for the target specific ar, as, ld, nm, objdump, ranlib and
  strip are added
- compiler wrapper detect if linking is requested or not
- special command sinks for CPP and CC/CXX add the cross-compile magic:
  - modify include dirs to get the target /usr/include
  - modify linker dirs and runpath to use target /usr/lib at link time,
    but keep correct rpath entries

Supported-by: Google SoC 2007
Basic tests by he@ on Sparc. Review from jlam@.


To generate a diff of this commit:
cvs rdiff -r1.260 -r1.261 pkgsrc/mk/bsd.prefs.mk
cvs rdiff -r1.196 -r1.197 pkgsrc/mk/buildlink3/bsd.buildlink3.mk
cvs rdiff -r1.90 -r1.91 pkgsrc/mk/compiler/gcc.mk
cvs rdiff -r1.3 -r1.4 pkgsrc/mk/flavor/pkg/flavor-vars.mk
cvs rdiff -r1.7 -r1.8 pkgsrc/mk/flavor/pkg/package.mk
cvs rdiff -r1.9 -r1.10 pkgsrc/mk/install/bin-install.mk
cvs rdiff -r1.35 -r1.36 pkgsrc/mk/tools/tools.NetBSD.mk
cvs rdiff -r1.12 -r1.13 pkgsrc/mk/wrapper/arg-source
cvs rdiff -r1.70 -r1.71 pkgsrc/mk/wrapper/bsd.wrapper.mk
cvs rdiff -r0 -r1.1 pkgsrc/mk/wrapper/cmd-sink-cross-cpp \
    pkgsrc/mk/wrapper/cmd-sink-cross-gcc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.