aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-04-03 00:13:44 +0800
committerbapt <bapt@FreeBSD.org>2014-04-03 00:13:44 +0800
commit1b9ff83842f70004ebd0796209aa26b56f985292 (patch)
tree22e522fc7e9570840bd74b596e4d8f56336a0c68 /Mk
parent981fa020e838f2cd76a244689bdb5d641424af39 (diff)
downloadfreebsd-ports-gnome-1b9ff83842f70004ebd0796209aa26b56f985292.tar.gz
freebsd-ports-gnome-1b9ff83842f70004ebd0796209aa26b56f985292.tar.zst
freebsd-ports-gnome-1b9ff83842f70004ebd0796209aa26b56f985292.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
Diffstat (limited to '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