using -isystem for the libc standard include directory is the only way
to make it the first candidate for #include <foo> path search, and to
suppress warnings when building 3rd party code including them.
as discussed in #89, few structs have different layout depending on the
_PSP_FW_VERSION macro.
this makes a noticable (i.e. resulting in potential memory corruption)
difference only in few structs that are supposed to be used only by
kernel experts, but it makes it clear to non-experts that the struct
layouts they program for are the latest ones.
an expert trying to target an older firmware version, can still override
the macro on the commandline.
closes#89
`MEMSIZE` would not be set as expected if `PSP_FW_VERSION` was set to `1` above firmware 3.90 and the warning was sent to the console. This is addressed.
I've also made the `MEMSIZE` field a make var (`EXPAND_MEMORY`) that gets set on/off in the tree and just gets used by `SFO` flags at the end of it, instead of setting them in multiple spaces.
The current state of building .SFO binaries is rather primitive --
as it stood, build.mak forced its own flags to be used, always.
If you were building without PSP_LARGE_MEMORY, build.mak would use
a deprecated tool for generation as well, one that cobbles together
undocumented flags in an array of bytes and shoves it into a file.
The first change this commit makes is by enabling use of the "new"
mkfsoex, which creates a smaller but still bootable SFO without
any arguments given. Developers are now able to provide custom
SFO flags now using this, added via `SFOFLAGS` in their Makefile.
This means that developers can now (at their own discretion) provide
custom region information, parental control level, minimum firmware
boot level, etc. with:
```make
SFOFLAGS = -d REGION=16394 -d PARENTAL_LEVEL=4 -s PSP_SYSTEM_VER=4.01
```
As a side-effect, this also makes the SDK more adapted to new
custom firmware releases that may add new SFO flags.
The second change made is turning `PSP_LARGE_MEMORY` into an opt-out
/enabled by default flag if developers are targeting a firmware
version newer than 3.90. Custom firmware versions starting from
4.01 M33 guard against expanding the user memory partition to 52mB
if the unit detected is PSP-1000. Therefore having this check in
place becomes redundant, potentially complicating Makefiles. A
warning is printed out allowing developers to be aware of this fact
and removing the flag from their Makefile.
This make it so that when using the following code:
```
include(FindPkgConfig)
pkg_search_module(SDL2 REQUIRED sdl2)
```
The variables ``${SDL2_INCLUDE_DIRS}`` and ``${SDL2_LIBRARIES}`` are set to the expected values within CMake.
CMAKE_TARGET_INSTALL_PREFIX isn't actually documented anywhere on the cmake website, so I guess that was a mistake. This change does not seem to cause warnings while building applications.