From e2b573c0b047e2971ead29b3c1e6abf76ad595e4 Mon Sep 17 00:00:00 2001 From: kub Date: Tue, 7 Jul 2020 10:17:57 +0200 Subject: [PATCH] libretro, fix for windows and osx --- tools/mkoffsets.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.39.2