aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2014-04-02 16:13:44 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2014-04-02 16:13:44 +0000
commitc0363d7491194efd923fae4b42be51681f16d020 (patch)
tree22e522fc7e9570840bd74b596e4d8f56336a0c68 /Mk/bsd.port.mk
parent5be0dc07b2d11d1d11451f23fdf2e10b629dc79f (diff)
downloadports-c0363d7491194efd923fae4b42be51681f16d020.tar.gz
ports-c0363d7491194efd923fae4b42be51681f16d020.zip
First bit of support to cross build the ports tree will only work
with simple ports for now, lots of improvements are pending cd devel/pkgconf; make X_BUILD_FOR=armv6-freebsd10.0 package Will create a armv6 ready package Note that right now the generated package does not have the proper ABI defined But the content is the right one
Notes
Notes: svn path=/head/; revision=349928
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk19
1 files changed, 19 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index a3cb25d68409..902f66eb0ce7 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1132,6 +1132,22 @@ NOTPHONY?=
.include "${PORTSDIR}/Mk/bsd.commands.mk"
+.if defined(X_BUILD_FOR)
+BUILD_DEPENDS= ${X_BUILD_FOR}-cc:${PORTSDIR}/devel/${X_BUILD_FOR}-xdev
+# Do not define CPP on purpose
+CC= ${X_BUILD_FOR}-cc
+CXX= ${X_BUILD_FOR}-c++
+LD= ${X_BUILD_FOR}-ld
+AS= ${X_BUILD_FOR}-as
+NM= ${X_BUILD_FOR}-nm
+STRIP_CMD= ${X_BUILD_FOR}-strip
+CFLAGS+= -B${LOCALBASE}/${X_BUILD_FOR}/usr/bin
+CXXFLAGS+= -B${LOCALBASE}/${X_BUILD_FOR}/usr/bin
+LDFLAGS+= -B${LOCALBASE}/${X_BUILD_FOR}/usr/bin
+CONFIGURE_ENV+= LD=${LD} AS=${AS} NM=${NM}
+MAKE_ENV+= LD=${LD} AS=${AS} NM=${NM}
+.endif
+
#
# DESTDIR section to start a chrooted process if invoked with DESTDIR set
#
@@ -2757,6 +2773,9 @@ GNU_CONFIGURE_PREFIX?= ${PREFIX}
GNU_CONFIGURE_MANPREFIX?= ${MANPREFIX}
CONFIG_SITE?= ${PORTSDIR}/Templates/config.site
CONFIGURE_ARGS+= --prefix=${GNU_CONFIGURE_PREFIX} $${_LATE_CONFIGURE_ARGS}
+.if defined(X_BUILD_FOR)
+CONFIGURE_ARGS+= --host=${X_BUILD_FOR}
+.endif
CONFIGURE_ENV+= CONFIG_SITE=${CONFIG_SITE} lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
HAS_CONFIGURE= yes