* the -DGL_GLEXT_PROTOTYPES define is required for c++ also (this likely broke during recent system.sh refactoring)
* fixes lr-mupen64plus building and possibly other modules
* remove unneeded space in __default_cflags assignment
* according to GCC docs, this should be equivalent - historically, in some cases older GCC had some issues (or wasn't aware of the CPU depending on version), but shouldn't be an issue now.
* don't use -mcpu=native for odroid-c2 64bit, in case we want to force target/cross compile
* GCC on Ubuntu 18.04 for Odroid XU defaults to -mthumb which isn't a good default for RetroPie.
* fixes building/linking with lr-flycast - we override the (messy) Makefile logic which set this previously.
* -marm has been for other odroid platforms as a precaution in case their OS versions have similar defaults (unchecked).
* default signing key can be overridden with __gpg_signing_key
* added gpg dependency by default
* download retropie key from ubuntu keyserver if it doesn't exist in keyring
* added download helper function
* rework logic for rp_installBin and rp_createBin
* copy secret key to chroots for package building
This only affected amiberry binaries since Feb 2020 when the build logic was switched
to use this flag. This meant a pure SDL2 version was being built rather than the dispmanx+SDL2 version.
Also corrected the flag setting which was changed in the rpi_aarch64 branch to be an array but this was missed.
The code actually still worked, but it should have been +=(dispmanx) not +=" dispmanx".
__has_dispmanx env var can be used to force this flag for kms/fkms.
* check for 32bit to enable binaries for rpi
* use -mcpu only for rpi3/rpi4 aarch targets - but we need to revisit and simplify gcc params for 32bit targets also
* odroid xu has 8 cores but only 2GB ram - so building with 8 threads is likely to run out of memory. The new logic would allow 3 max
* -pipe option is an old retropie parameter, and may cause issues in some low memory situations. Safer to remove it by default.
Older GCC on at least Debian used to output a 3 part version like 6.3.0 with gcc -dumpversion
Newer GCC / OS seems to only output the major version which broke comparisons as dpkg will consider a version such as "6" to be lower than 6.0.0
Noticed some messages right after calling retropie_setup.sh and before the dialog:
```
/home/meleu/RetroPie-Setup/scriptmodules/system.sh: linha 49: "8078788" / 1024 : erro de sintaxe: operando esperado (token com erro é ""8078788" / 1024 ")
```
It happens because the bash version on the computer I'm running it is 4.3, and it doesn't accept quotes inside the arithmetic expansion `$((...))`.
I also removed the `$` prefix for variables for consistency (like used on line 56).
* Ubuntu 20.04 will no longer include python-pyudev
* Use stderr for /dev/tty opening error msg
* Use python3 in runcommand module for compilation
* Open with 'append' which was added in f614804f fails with python3 on rpi4 console. Use lower level os.open and O_WRONLY to avoid possible buffer issues. Could not reproduce the ghost inputs the append was added for
* use __cflags / __cxxflags / __asflags / __makeflags to avoid any issues with existing environment vars
(although by default sudo will not pass them through)
* use ___default_cpu_flags in platform_functions instead of putting everything in __default_cflags
* remove optisation level from platform functions - can be overridden with __opt_flags
* can produce bad code (eg zdoom had issues before)
* no measurable performance increase from testing - but can add back for some modules if proven useful
we now have these - currently unused except in system (but will be used in rpSwap function)
__memory_total_kb = total physical memory in Kilobytes
__memory_fofal = total physical memory in Megabytes
__memory_free_kb = free memory in Kilobytes including cached memory (but not swap)
__memory_free = free memory in Megabytes
minor cosmetic cleanup to comment / logic to add -pipe
also switched to using DISTCC_HOSTS="" to disable distcc when needed as previous
string replacement was hacky/unreliable and failed due to path duplication bug as
only the first path was removed from MAKEFLAGS