Add ARM platforms to the build script
This commit is contained in:
parent
1503fb4ebc
commit
96943eb68b
24 changed files with 125 additions and 13 deletions
|
@ -5,10 +5,10 @@ cc=""
|
|||
cxx=""
|
||||
ld=""
|
||||
ranlib=""
|
||||
cflags=(-Wall -pipe)
|
||||
cxxonly=("")
|
||||
ldflags=("")
|
||||
libs=("")
|
||||
cflags+=(-Wall -pipe)
|
||||
cxxonly+=("")
|
||||
ldflags+=("")
|
||||
libs+=("")
|
||||
|
||||
# Use ccache if it's available
|
||||
if command -v ccache &> /dev/null; then
|
||||
|
|
2
scripts/automator/build/gcc-linux_armv7_mali
Normal file
2
scripts/automator/build/gcc-linux_armv7_mali
Normal file
|
@ -0,0 +1,2 @@
|
|||
# GCC flags for generically identified ARMv7 MALI SBCs
|
||||
cflags_release+=(-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard)
|
3
scripts/automator/build/gcc-linux_imx6
Normal file
3
scripts/automator/build/gcc-linux_imx6
Normal file
|
@ -0,0 +1,3 @@
|
|||
# GCC flags specific to NXP's series of i.MX 6 SBCs
|
||||
cflags_release+=(-march=armv7-a -mfpu=neon -mtune=cortex-a9
|
||||
-mfloat-abi=hard)
|
2
scripts/automator/build/gcc-linux_odroid_c1
Normal file
2
scripts/automator/build/gcc-linux_odroid_c1
Normal file
|
@ -0,0 +1,2 @@
|
|||
# GCC flags specific to Hardkernel Co's ODROID-C1 SBC
|
||||
cflags_release+=(-mcpu=cortex-a5 -mfpu=neon-vfpv4 -mfloat-abi=hard)
|
3
scripts/automator/build/gcc-linux_odroid_c2
Normal file
3
scripts/automator/build/gcc-linux_odroid_c2
Normal file
|
@ -0,0 +1,3 @@
|
|||
# GCC flags specific to Hardkernel Co's ODROID-C2 SBC
|
||||
cflags_release+=(-march=armv8-a+crc -mtune=cortex-a53
|
||||
-mfpu=neon-fp-armv8)
|
2
scripts/automator/build/gcc-linux_odroid_xu
Normal file
2
scripts/automator/build/gcc-linux_odroid_xu
Normal file
|
@ -0,0 +1,2 @@
|
|||
# GCC flags specific to Hardkernel Co's ODROID-XU SBC
|
||||
cflags_release+=(-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard)
|
2
scripts/automator/build/gcc-linux_rpi1
Normal file
2
scripts/automator/build/gcc-linux_rpi1
Normal file
|
@ -0,0 +1,2 @@
|
|||
# GCC flags specific to the Raspberry Pi 1 series of SBC
|
||||
cflags_release+=(-mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard)
|
2
scripts/automator/build/gcc-linux_rpi2
Normal file
2
scripts/automator/build/gcc-linux_rpi2
Normal file
|
@ -0,0 +1,2 @@
|
|||
# GCC flags specific to the Raspberry Pi 2 series of SBC
|
||||
cflags_release+=(-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard)
|
4
scripts/automator/build/gcc-linux_rpi3
Normal file
4
scripts/automator/build/gcc-linux_rpi3
Normal file
|
@ -0,0 +1,4 @@
|
|||
# GCC flags specific to the Raspberry Pi 3 series of SBC
|
||||
cflags_release+=(-march=armv8-a+crc -mtune=cortex-a53
|
||||
-mfpu=neon-fp-armv8 -mfloat-abi=hard)
|
||||
|
3
scripts/automator/build/gcc-linux_rpi4
Normal file
3
scripts/automator/build/gcc-linux_rpi4
Normal file
|
@ -0,0 +1,3 @@
|
|||
# GCC flags specific to the Raspberry Pi 4 series of SBC
|
||||
cflags_release+=(-march=armv8-a+crc -mtune=cortex-a72
|
||||
-mfpu=neon-fp-armv8 -mfloat-abi=hard)
|
3
scripts/automator/build/gcc-linux_tinker
Normal file
3
scripts/automator/build/gcc-linux_tinker
Normal file
|
@ -0,0 +1,3 @@
|
|||
# GCC flags specific to the ASUS Tinker Board SBC
|
||||
cflags_release+=(-marm -march=armv7-a -mtune=cortex-a17 -mfpu=neon-vfpv4
|
||||
-mfloat-abi=hard)
|
2
scripts/automator/build/gcc-linux_vero4k
Normal file
2
scripts/automator/build/gcc-linux_vero4k
Normal file
|
@ -0,0 +1,2 @@
|
|||
# GCC flags specific to the OSMC Vero 4K SBC
|
||||
cflags_release+=(-mcpu=cortex-a7 -mfpu=neon-vfpv4)
|
0
scripts/automator/build/machine-odroid_c2
Normal file
0
scripts/automator/build/machine-odroid_c2
Normal file
0
scripts/automator/build/machine-odroid_xu
Normal file
0
scripts/automator/build/machine-odroid_xu
Normal file
0
scripts/automator/build/machine-rpi1
Normal file
0
scripts/automator/build/machine-rpi1
Normal file
0
scripts/automator/build/machine-rpi2
Normal file
0
scripts/automator/build/machine-rpi2
Normal file
0
scripts/automator/build/machine-rpi3
Normal file
0
scripts/automator/build/machine-rpi3
Normal file
0
scripts/automator/build/machine-rpi4
Normal file
0
scripts/automator/build/machine-rpi4
Normal file
0
scripts/automator/build/machine-tinker
Normal file
0
scripts/automator/build/machine-tinker
Normal file
3
scripts/automator/build/machine-vero4k
Normal file
3
scripts/automator/build/machine-vero4k
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Universal flags specific to the OSMC Vero 4K SBC
|
||||
cflags+=(-I/opt/vero3/include)
|
||||
ldflags+=(-L/opt/vero3/lib)
|
|
@ -9,10 +9,11 @@
|
|||
# If run without arguments, the script asks for required arguments one
|
||||
# by one, which includes the above two (--compiler and --build-type).
|
||||
#
|
||||
# Optional arguments include the version of compiler and additional
|
||||
# build modifiers such as link-time-optimizations (--modifier lto),
|
||||
# feedback-directed-optimizations (--modifier fdo), and taking advantage
|
||||
# of the building-machine's full instructions sets (--modifier native).
|
||||
# Optional arguments allow specifying the version of compiler,
|
||||
# machine type, and applying build modifiers such as:
|
||||
# - link-time-optimizations (--modifier lto),
|
||||
# - feedback-directed-optimizations (--modifier fdo)
|
||||
# - current processor instructions sets (--modifier native)
|
||||
# All modifiers are available simulatenously.
|
||||
#
|
||||
# Usage examples:
|
||||
|
@ -25,6 +26,73 @@
|
|||
#
|
||||
set -euo pipefail
|
||||
|
||||
# Detects the machine type and sets the 'machine' variable
|
||||
function query_machine() {
|
||||
# Start with a sane and safe default
|
||||
machine="$(uname -m | sed 's/-.*//')"
|
||||
|
||||
# Only attempt further detection on Linux-based systems
|
||||
if [[ ! -f /proc/cpuinfo ]]; then
|
||||
return
|
||||
fi
|
||||
# ARM differentiation based on
|
||||
# https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/system.sh
|
||||
case "$(sed -n '/^Hardware/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)" in
|
||||
BCM*)
|
||||
# calculated based on information from
|
||||
# https://github.com/AndrewFromMelbourne/raspberry_pi_revision
|
||||
local rev
|
||||
rev="0x$(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo)"
|
||||
# if bit 23 is not set, we are on a rpi1
|
||||
# (bit 23 means the revision is a bitfield)
|
||||
if [[ $((("$rev" >> 23) & 1)) -eq 0 ]]; then
|
||||
machine="rpi1"
|
||||
else
|
||||
# if bit 23 is set, get the cpu from bits 12-15
|
||||
local cpu
|
||||
cpu=$((("$rev" >> 12) & 15))
|
||||
case $cpu in
|
||||
0)
|
||||
machine="rpi1"
|
||||
;;
|
||||
1)
|
||||
machine="rpi2"
|
||||
;;
|
||||
2)
|
||||
machine="rpi3"
|
||||
;;
|
||||
3)
|
||||
machine="rpi4"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
ODROIDC)
|
||||
machine="odroid_c1"
|
||||
;;
|
||||
ODROID-C2)
|
||||
machine="odroid_c2"
|
||||
;;
|
||||
"Freescale i.MX6 Quad/DualLite (Device Tree)")
|
||||
machine="imx6"
|
||||
;;
|
||||
ODROID-XU[34])
|
||||
machine="odroid_xu"
|
||||
;;
|
||||
"Rockchip (Device Tree)")
|
||||
machine="tinker"
|
||||
;;
|
||||
Vero4K|Vero4KPlus)
|
||||
machine="vero4k"
|
||||
;;
|
||||
"Allwinner sun8i Family")
|
||||
machine="armv7_mali"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function parse_args() {
|
||||
# Gather the parameters that define this build
|
||||
postfix=""
|
||||
|
@ -36,19 +104,32 @@ function parse_args() {
|
|||
-t|--build-type) selected_type="${2}"; shift 2;;
|
||||
-m|--modifier) modifiers+=("${2}"); shift 2;;
|
||||
-p|--bin-path) PATH="${2}:${PATH}"; shift 2;;
|
||||
-a|--machine) machine="${2}"; shift 2;;
|
||||
*) configure_additions+=("${1}"); shift;;
|
||||
esac; done
|
||||
|
||||
# Import our settings and report missing values
|
||||
machine="$(uname -m | sed 's/-.*//')"; import machine "${machine}"
|
||||
os="$(uname -s | sed 's/-.*//')"; import os "${os}"
|
||||
# Determine and import machine-specific rules
|
||||
if [[ -z "${machine:-}" ]]; then
|
||||
query_machine
|
||||
fi
|
||||
import machine "${machine}"
|
||||
|
||||
# Determine and import OS-specific rules
|
||||
os="$(uname -s | sed 's/-.*//')"
|
||||
import os "${os}"
|
||||
|
||||
# Import compiler rules, plus any OS + machine customizations
|
||||
import compiler "${compiler:-}"
|
||||
import "${compiler:-}" "${os}_${machine}"
|
||||
if [[ -z "${selected_type:-}" ]]; then arg_error "--build-type" "${TYPES[*]}"; fi
|
||||
if [[ -z "${selected_type:-}" ]]; then
|
||||
arg_error "--build-type" "${TYPES[*]}"
|
||||
fi
|
||||
|
||||
# Create a pretty modifier string that we can add to our build-type
|
||||
printf -v mod_string '+%s' "${modifiers[@]:1}"
|
||||
if [[ "${mod_string}" == "+" ]]; then mod_string=""; fi
|
||||
if [[ "${mod_string}" == "+" ]]; then
|
||||
mod_string=""
|
||||
fi
|
||||
|
||||
# Print a summary of our build configuration
|
||||
underline "Compiling a ${selected_type}${mod_string} build using "`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue