Skip to content

Commit c07e87c

Browse files
committed
system - use architecture for __platform instead of x86
For architectures not handled by custom logic, we previously checked `uname -m` for i686/x86_64/amd64 and then set __platform=x86. This change switches to using the actual output of `uname -m` as the __platform variable. If a platform_$__platform function exists, we will call it, otherwise we call platform_native (which used to be platform_x86). In platform_native we check if the platform is i386/i686/x86_64 and then set an x86 flag. This seems more logical and allows us to more easily check for x86_86 in scriptmodule flags. It also resolves redream incorrectly having x86_64 added to the flags in d877a81 (which work after this change). The error: fatalError "Unknown platform - please manually set the __platform variable to one of the following is now removed. As we default to platform_native this could potentially allow RetroPie-Setup to work on something we don't specifically support.
1 parent 1eedc5a commit c07e87c

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

scriptmodules/system.sh

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,12 @@ function get_platform() {
430430
;;
431431
esac
432432
else
433-
case $architecture in
434-
i686|x86_64|amd64)
435-
__platform="x86"
436-
;;
437-
esac
433+
__platform="$architecture"
438434
fi
439435
;;
440436
esac
441437
fi
442438

443-
if ! fnExists "platform_${__platform}"; then
444-
fatalError "Unknown platform - please manually set the __platform variable to one of the following: $(compgen -A function platform_ | cut -b10- | paste -s -d' ')"
445-
fi
446-
447439
# check if we wish to target kms for platform
448440
if [[ -z "$__has_kms" ]]; then
449441
iniConfig " = " '"' "$configdir/all/retropie.cfg"
@@ -453,7 +445,13 @@ function get_platform() {
453445
fi
454446

455447
set_platform_defaults
456-
platform_${__platform}
448+
449+
# if we have a function for the platform, call it, otherwise use the default "native" one.
450+
if fnExists "platform_${__platform}"; then
451+
platform_${__platform}
452+
else
453+
platform_native
454+
fi
457455
}
458456

459457
function set_platform_defaults() {
@@ -586,18 +584,16 @@ function platform_tinker() {
586584
__platform_flags+=(kms gles)
587585
}
588586

589-
function platform_x86() {
587+
function platform_native() {
590588
__default_cpu_flags="-march=native"
591589
__platform_flags+=(gl)
592590
if [[ "$__has_kms" -eq 1 ]]; then
593591
__platform_flags+=(kms)
594592
else
595593
__platform_flags+=(x11)
596594
fi
597-
}
598-
599-
function platform_generic-x11() {
600-
__platform_flags+=(x11 gl)
595+
# add x86 platform flag for x86/x86_64 archictures.
596+
[[ "$__platform_arch" =~ (i386|i686|x86_64) ]] && __platform_flags+=(x86)
601597
}
602598

603599
function platform_armv7-mali() {

0 commit comments

Comments
 (0)