mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-23 09:56:37 +08:00
d5f5d5d1ad
This patch moves the scan for an ARM gcc into a separate shell script. To prevent against recursion issues, the new script adds "-maxdepth 1" to the find invocation; and it now also correctly handles directories in $PATH that contain spaces in their name. Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
14 lines
398 B
Bash
Executable File
14 lines
398 B
Bash
Executable File
#
|
|
# Try to locate suitable ARM cross compilers available via $PATH
|
|
# If any are found, this function will output them as a TAB-delimited list
|
|
#
|
|
scan_path () {
|
|
IFS=":"
|
|
for path in $PATH; do
|
|
find "$path" -maxdepth 1 -executable -name 'arm*-gcc' -printf '%f\t' 2>/dev/null
|
|
done
|
|
}
|
|
|
|
# Use only the first field from result, and convert it to a toolchain prefix
|
|
scan_path | cut -f 1 | sed -e 's/-gcc/-/'
|