[core] Specify toolchain prefix in board.json
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
realtek-ambz Realtek AmebaZ Arduino Core
|
|
||||||
libretuya Interfaces for LibreTuya Arduino cores
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"build": {
|
"build": {
|
||||||
"f_cpu": "120000000L"
|
"f_cpu": "120000000L",
|
||||||
|
"prefix": "arm-none-eabi-"
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": [
|
||||||
"wifi",
|
"wifi",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"family": "RTL8710B",
|
"family": "RTL8710B",
|
||||||
"f_cpu": "125000000L",
|
"f_cpu": "125000000L",
|
||||||
|
"prefix": "arm-none-eabi-",
|
||||||
"amb_flash_addr": "0x08000000"
|
"amb_flash_addr": "0x08000000"
|
||||||
},
|
},
|
||||||
"connectivity": [
|
"connectivity": [
|
||||||
|
|||||||
@@ -28,18 +28,19 @@ if env.get("PROGNAME", "program") == "program":
|
|||||||
env.Replace(PROGSUFFIX=".elf")
|
env.Replace(PROGSUFFIX=".elf")
|
||||||
|
|
||||||
# Toolchain config - TODO multiple arch, specified in board.json
|
# Toolchain config - TODO multiple arch, specified in board.json
|
||||||
|
prefix = board.get("build.prefix", "")
|
||||||
env.Replace(
|
env.Replace(
|
||||||
AR="arm-none-eabi-gcc-ar",
|
AR=prefix + "gcc-ar",
|
||||||
AS="arm-none-eabi-gcc",
|
AS=prefix + "gcc",
|
||||||
CC="arm-none-eabi-gcc",
|
CC=prefix + "gcc",
|
||||||
CXX="arm-none-eabi-g++",
|
CXX=prefix + "g++",
|
||||||
GDB="arm-none-eabi-gdb",
|
GDB=prefix + "gdb",
|
||||||
NM="arm-none-eabi-gcc-nm",
|
NM=prefix + "gcc-nm",
|
||||||
LINK="arm-none-eabi-gcc",
|
LINK=prefix + "gcc",
|
||||||
OBJCOPY="arm-none-eabi-objcopy",
|
OBJCOPY=prefix + "objcopy",
|
||||||
OBJDUMP="arm-none-eabi-objdump",
|
OBJDUMP=prefix + "objdump",
|
||||||
# RANLIB="arm-none-eabi-gcc-ranlib",
|
# RANLIB=prefix + "gcc-ranlib",
|
||||||
SIZETOOL="arm-none-eabi-size",
|
SIZETOOL=prefix + "size",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Default environment options
|
# Default environment options
|
||||||
|
|||||||
@@ -54,11 +54,12 @@ def env_add_library(
|
|||||||
srcs.append("-<" + expr + ">")
|
srcs.append("-<" + expr + ">")
|
||||||
|
|
||||||
# queue library for further env clone and build
|
# queue library for further env clone and build
|
||||||
env.Prepend(
|
if srcs:
|
||||||
LIBQUEUE=[
|
env.Prepend(
|
||||||
(join("$BUILD_DIR", name), base_dir, srcs, options),
|
LIBQUEUE=[
|
||||||
]
|
(join("$BUILD_DIR", name), base_dir, srcs, options),
|
||||||
)
|
]
|
||||||
|
)
|
||||||
|
|
||||||
# search all include paths
|
# search all include paths
|
||||||
for dir, expr in iter_expressions(includes):
|
for dir, expr in iter_expressions(includes):
|
||||||
|
|||||||
Reference in New Issue
Block a user