summaryrefslogtreecommitdiff
path: root/mk/tools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2007-08-02 18:19:31 +0000
committerjoerg <joerg@pkgsrc.org>2007-08-02 18:19:31 +0000
commit005620851f14ccfbf69fb7ccaffc6f6e6d0f968a (patch)
tree7eeb466964543e6a95e208d441bf203db2c07e58 /mk/tools
parent6989e7a043e210e423d5d0252d903c71166a1096 (diff)
downloadpkgsrc-005620851f14ccfbf69fb7ccaffc6f6e6d0f968a.tar.gz
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@.
Diffstat (limited to 'mk/tools')
-rw-r--r--mk/tools/tools.NetBSD.mk23
1 files changed, 22 insertions, 1 deletions
diff --git a/mk/tools/tools.NetBSD.mk b/mk/tools/tools.NetBSD.mk
index 1a7b05f1e8a..f3061bf0e00 100644
--- a/mk/tools/tools.NetBSD.mk
+++ b/mk/tools/tools.NetBSD.mk
@@ -1,4 +1,4 @@
-# $NetBSD: tools.NetBSD.mk,v 1.35 2007/06/19 17:01:13 joerg Exp $
+# $NetBSD: tools.NetBSD.mk,v 1.36 2007/08/02 18:19:32 joerg Exp $
#
# System-supplied tools for the NetBSD operating system.
@@ -45,7 +45,11 @@ TOOLS_PLATFORM.head?= /usr/bin/head
TOOLS_PLATFORM.hostname?= /bin/hostname
TOOLS_PLATFORM.id?= /usr/bin/id
TOOLS_PLATFORM.ident?= /usr/bin/ident
+.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.install?= /usr/bin/install
+.else
+TOOLS_PLATFORM.install?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install
+.endif
.if exists(/usr/bin/install-info)
TOOLS_PLATFORM.install-info?= /usr/bin/install-info
.endif
@@ -84,7 +88,12 @@ TOOLS_PLATFORM.shlock?= /usr/bin/shlock
TOOLS_PLATFORM.sleep?= /bin/sleep
TOOLS_PLATFORM.soelim?= /usr/bin/soelim
TOOLS_PLATFORM.sort?= /usr/bin/sort
+.if empty(USE_CROSS_COMPILE:M[yY][eE][sS])
TOOLS_PLATFORM.strip?= /usr/bin/strip
+.else
+TOOLS_PLATFORM.strip?= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
+.endif
+
TOOLS_PLATFORM.tail?= /usr/bin/tail
.if exists(/bin/tar)
TOOLS_PLATFORM.tar?= /bin/tar
@@ -104,3 +113,15 @@ TOOLS_PLATFORM.xargs?= /usr/bin/xargs
TOOLS_PLATFORM.xgettext?= /usr/bin/xgettext
.endif
TOOLS_PLATFORM.yacc?= /usr/bin/yacc
+
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
+.for _t_ in ar as ld nm objdump ranlib strip
+TOOLS_PATH.${MACHINE_GNU_PLATFORM}-${_t_}?= \
+ ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-${_t_}
+TOOLS_CREATE+= ${MACHINE_GNU_PLATFORM}-${_t_}
+.endfor
+
+NATIVE_CC:= /usr/bin/cc
+CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
+
+.endif