aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2017-08-02 23:20:57 +0800
committerimp <imp@FreeBSD.org>2017-08-02 23:20:57 +0800
commite61499b878febf027db1fddbc7c3df1b6e542b0d (patch)
treed6e5b56ccdfe0613326435ffeb87aa51b1b83084 /sysutils
parent589ccb1f7416e3fe0a58992471bf4e9158bdf8d7 (diff)
downloadfreebsd-ports-gnome-e61499b878febf027db1fddbc7c3df1b6e542b0d.tar.gz
freebsd-ports-gnome-e61499b878febf027db1fddbc7c3df1b6e542b0d.tar.zst
freebsd-ports-gnome-e61499b878febf027db1fddbc7c3df1b6e542b0d.zip
Changes to prepare for aarch64 support
o Generalize support for different architectures. o Add specific support for aarch64 o Add ALLWINNER64 as a new family using aarch64, but no ports use it yet. o CROSS_COMPILE is the string to pass to u-boot o COMPILER is the FreeBSD port (we assume gcc since that works better typically than clang). Submitted by: Emmanuel Vadot (the aarch64 bits, hacked by me to be generic)
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/u-boot-master/Makefile24
1 files changed, 20 insertions, 4 deletions
diff --git a/sysutils/u-boot-master/Makefile b/sysutils/u-boot-master/Makefile
index 391f7ae4a1a7..4b53699b207b 100644
--- a/sysutils/u-boot-master/Makefile
+++ b/sysutils/u-boot-master/Makefile
@@ -14,10 +14,10 @@ COMMENT= Cross-build das u-boot for ${MODEL}
LICENSE= GPLv2
-BUILD_DEPENDS= arm-none-eabi-gcc:devel/arm-none-eabi-gcc \
- gsed:textproc/gsed \
+BUILD_DEPENDS+= gsed:textproc/gsed \
swig:devel/swig13 \
dtc>=1.4.1:sysutils/dtc
+BUILD_DEPENDS+= ${COMPILER}:devel/${COMPILER}
USES= gmake python:build shebangfix
@@ -31,8 +31,7 @@ UBOOT_DIR= share/u-boot/${PORTNAME}${PKGNAMESUFFIX}
INST= ${PREFIX}/${UBOOT_DIR}
DESCR?= ${.CURDIR}/pkg-descr
-MAKE_ARGS+= V=1 ARCH=${UBOOT_ARCH} CROSS_COMPILE=${UBOOT_ARCH}-none-eabi- \
- DTC=${LOCALBASE}/bin/dtc
+MAKE_ARGS+= V=1 CROSS_COMPILE=${CROSS_COMPILE} DTC=${LOCALBASE}/bin/dtc ${ARCHFLAGS}
NO_ARCH= yes
@@ -53,6 +52,10 @@ UBOOT_PLIST_OMAP=u-boot.img MLO
# Overrides for ALLWINNER family
UBOOT_PLIST_ALLWINNER=u-boot.img u-boot-sunxi-with-spl.bin
+# Overrides for ALLWINNER family
+UBOOT_PLIST_ALLWINNER64=u-boot-sunxi-with-spl.bin
+UBOOT_ARCH_ALLWINNER64=aarch64
+
# Uboot variables
.if !defined(UBOOT_VERSION) && defined(UBOOT_VERSION_${FAMILY:tu})
UBOOT_VERSION=${UBOOT_VERSION_${FAMILY:tu}}
@@ -69,6 +72,19 @@ UBOOT_ARCH=${UBOOT_ARCH_${FAMILY:tu}}
.endif
UBOOT_ARCH?= arm
+.if ${UBOOT_ARCH} == arm
+CROSS_COMPILE=arm-none-eabi-
+ARCHFLAGS=ARCH=${UBOOT_ARCH}
+.elif ${UBOOT_ARCH} == aarch64
+CROSS_COMPILE=aarch64-none-elf-
+ARCHFLAGS=ARCH=arm
+.else
+# Best guess for other architectures
+CROSS_COMPILE=${UBOOT_ARCH}-none-elf-
+ARCHFLAGS=ARCH=${UBOOT_ARCH}
+.endif
+COMPILER?=${CROSS_COMPILE}gcc
+
# Each u-boot family has different files to include, bring them in.
.for i in ${UBOOT_PLIST}
PLIST_FILES+= ${UBOOT_DIR}/${i}