RetroPie-Setup/scriptmodules/libretrocores/lr-dosbox-pure.sh
Jools Wills 1917b4ebbf lr-dosbox-pure - install g++ v9 on arm if v10 is the system default
This fixes building on Bullseye.

According to https://github.com/libretro/dosbox-pure/commit/603b1c7ae

>Switch to gcc 9 to avoid buggy assembly genetation [sic] of gcc 10
>On armv7l, gcc 10.2 with -O2 on the file core_dynrec.cpp generates assembly that wrongfully passes NULL to the runcode function
>resulting in a segfault crash. It can be observed by writing block->cache.start to stdout twice where it is NULL at first
>and then the actual value thereafter. This affects upstream SVN DOSBox as well as this core.
2023-03-05 13:49:26 +00:00

50 lines
1.5 KiB
Bash

#!/usr/bin/env bash
# This file is part of The RetroPie Project
#
# The RetroPie Project is the legal property of its developers, whose names are
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
#
# See the LICENSE.md file at the top-level directory of this distribution and
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
#
rp_module_id="lr-dosbox-pure"
rp_module_desc="DOS emulator"
rp_module_help="ROM Extensions: .bat .com .cue .dosz .exe .ins .ima .img .iso .m3u .m3u8 .vhd .zip\n\nCopy your DOS games to $ROMDIR/pc"
rp_module_licence="GPL2 https://raw.githubusercontent.com/libretro/dosbox-pure/main/LICENSE"
rp_module_repo="git https://github.com/libretro/dosbox-pure.git main"
rp_module_section="exp"
rp_module_flags=""
function depends_lr-dosbox-pure() {
# lr-dosbox-pure will try and use g++ v9 on arm if the system default is v10 due to bugs
# see https://github.com/libretro/dosbox-pure/commit/603b1c7ae
isPlatform "arm" && [[ "$__gcc_version" -eq 10 ]] && getDepends g++-9
}
function sources_lr-dosbox-pure() {
gitPullOrClone
}
function build_lr-dosbox-pure() {
make clean
make
md_ret_require="$md_build/dosbox_pure_libretro.so"
}
function install_lr-dosbox-pure() {
md_ret_files=(
'LICENSE'
'dosbox_pure_libretro.so'
'README.md'
)
}
function configure_lr-dosbox-pure() {
mkRomDir "pc"
defaultRAConfig "pc"
addEmulator 0 "$md_id" "pc" "$md_inst/dosbox_pure_libretro.so"
addSystem "pc"
}