libretro, fix for windows and osx

This commit is contained in:
kub 2020-07-07 10:17:57 +02:00
parent 62c7479bb1
commit e2b573c0b0

View file

@ -46,14 +46,22 @@ get_define () # prefix struct member member...
line=$(printf "#define %-20s 0x%04x" $prefix$name $rodata)
}
fn="${1:-.}/pico_int_offs.h"
if echo $CFLAGS | grep -qe -flto; then CFLAGS="$CFLAGS -fno-lto"; fi
# don't do this if readelf isn't available. it doesn't matter since offsets are
# only needed for the asm parts (currently mips/arm32) and those have readelf
if ! command -v readelf >/dev/null; then
echo "/* mkoffset.sh: readelf not found, offset table not created */" >$fn
echo "WARNING: readelf not found, offset table not created"
exit
fi
# determine endianess
echo '#include <stdint.h>' >/tmp/getoffs.c
echo "const int32_t val = 1;" >>/tmp/getoffs.c
compile_rodata
ENDIAN=$(if [ "$rodata" -eq 1 ]; then echo be; else echo le; fi)
# output header
fn="${1:-.}/pico_int_offs.h"
echo "/* autogenerated by mkoffset.sh, do not edit */" >$fn
echo "/* target endianess: $ENDIAN, compiled with: $CC $CFLAGS */" >>$fn
# output offsets