wip: build tools stuff

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/851/head
Gergely Nagy 4 years ago
parent 637579b346
commit 0774f3fc2f
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -379,6 +379,10 @@ compile () {
fi
fi
_CMD_CXX="${COMPILER_PREFIX}${CXX_COMPILER_BASENAME}${COMPILER_SUFFIX}"
_CMD_CC="${COMPILER_PREFIX}${C_COMPILER_BASENAME}${COMPILER_SUFFIX}"
_CMD_AR="${COMPILER_PREFIX}${AR_BASENAME}${COMPILER_SUFFIX}"
# SC2091: We do not care if quotes or backslashes are not respected.
# SC2086: We want word splitting.
# shellcheck disable=SC2086,SC2090
@ -401,8 +405,9 @@ compile () {
-built-in-libraries "${ARDUINO_PATH}/libraries" \
-prefs "compiler.cpp.extra_flags=${ARDUINO_CFLAGS} ${LOCAL_CFLAGS}" \
-prefs "compiler.path=${COMPILER_PATH}" \
-prefs "compiler.c.cmd=${COMPILER_PREFIX}${C_COMPILER_BASENAME}" \
-prefs "compiler.cpp.cmd=${COMPILER_PREFIX}${CXX_COMPILER_BASENAME}" \
-prefs "compiler.c.cmd=${_CMD_CC}" \
-prefs "compiler.cpp.cmd=${_CMD_CXX}" \
-prefs "compiler.ar.cmd=${_CMD_AR}" \
$CCACHE_ENABLE \
-warnings all \
${ARDUINO_VERBOSE} \

@ -151,6 +151,12 @@ if [ "${uname_S}" = "Darwin" ]; then
fi
}
if [ "${ARCH}" = "virtual" ]; then
COMPILER_PREFIX="x86_64-apple-darwin19-"
COMPILER_SUFFIX="-10"
AR_BASENAME="gcc-ar"
fi
elif [ "${uname_S}" = "FreeBSD" ]; then
find_device_port() {
@ -169,6 +175,7 @@ elif [ "${uname_S}" = "FreeBSD" ]; then
AVR_OBJDUMP="${AVR_OBJDUMP:-/usr/local/bin/avr-objdump}"
AVRDUDE="${AVRDUDE:-/usr/local/bin/avrdude}"
AVRDUDE_CONF="${AVRDUDE_CONF:-/usr/local/etc/avrdude.conf}"
ARDUINO_BUILDER="${ARDUINO_BUILDER:-/usr/local/bin/arduino-builder}"
find_bootloader_ports() {
DIR=$(dirname "$0")
@ -176,6 +183,10 @@ elif [ "${uname_S}" = "FreeBSD" ]; then
DEVICE_PORT_BOOTLOADER="$(perl ${DEVICE_PORT_PROBER})"
}
if [ "${ARCH}" = "virtual" ]; then
COMPILER_PATH="${COMPILER_PATH:-/usr/local/bin/}"
fi
elif [ "${uname_O}" = "Cygwin" ]; then
# The Windows arduino-builder.exe doesn't understand being told to exec against Cygwin symlinks
CCACHE_NOT_SUPPORTED=1
@ -249,8 +260,12 @@ ARDUINO_IDE_VERSION="10607"
# Allow the compiler path to be empty for virtual builds
COMPILER_PATH="${COMPILER_PATH-${ARDUINO_TOOLS_PATH}/avr/bin/}"
COMPILER_SUFFIX=""
C_COMPILER_BASENAME=$(basename ${CC:-gcc})
CXX_COMPILER_BASENAME=$(basename ${CXX:-g++})
AR_BASENAME=$(basename ${AR:-ar})
OBJCOPY_BASENAME=$(basename ${OBJCOPY:-objcopy})
# Allow the compiler prefix to be empty for virtual builds
COMPILER_PREFIX="${COMPILER_PREFIX-avr-}"

Loading…
Cancel
Save