From: kub Date: Tue, 7 Jul 2020 08:17:57 +0000 (+0200) Subject: libretro, fix for windows and osx X-Git-Tag: v2.00~722 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2b573c0b047e2971ead29b3c1e6abf76ad595e4;p=picodrive.git libretro, fix for windows and osx --- diff --git a/tools/mkoffsets.sh b/tools/mkoffsets.sh index 8a1092e0..d890fc0f 100755 --- a/tools/mkoffsets.sh +++ b/tools/mkoffsets.sh @@ -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 ' >/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