diff --git a/src/linux/helpers/Makefile b/src/linux/helpers/Makefile index f81563e34..860ae080b 100644 --- a/src/linux/helpers/Makefile +++ b/src/linux/helpers/Makefile @@ -2,24 +2,21 @@ top_srcdir := ../../.. releng := $(top_srcdir)/releng BUILDDIR ?= $(top_srcdir)/build -FRIDA_MONOREPO ?= $(top_srcdir)/.. +MESON ?= $(releng)/meson/meson.py ifdef FRIDA_HOST -host_os := $(shell echo $(FRIDA_HOST) | cut -f1 -d"-") -host_arch := $(shell echo $(FRIDA_HOST) | cut -f2 -d"-") +host_machine := $(FRIDA_HOST) else -host_os := $(shell $(releng)/detect-os.sh) -host_arch := $(shell $(releng)/detect-arch.sh) +host_machine := $(shell basename $$(ls -1 $(BUILDDIR)/frida-linux-*.txt | tail -1) | cut -d"." -f1 | cut -d"-" -f2-) endif +host_arch := $(shell echo $(host_machine) | cut -d"-" -f2) -crossfile := $(shell test -d "$(BUILDDIR)" \ - && echo "$(BUILDDIR)/frida-$(host_os)-$(host_arch).txt" \ - || echo $(FRIDA_MONOREPO)/build/frida*-$(host_os)-$(host_arch).txt) +crossfile := $(BUILDDIR)/frida-$(host_machine).txt build: ext/linux/tools/include/nolibc/nolibc.h rm -rf build - meson setup --cross-file $(crossfile) -Db_lto=true build - meson compile -C build + $(MESON) setup --cross-file $(crossfile) -Db_lto=true build + $(MESON) compile -C build cp build/bootstrapper.bin bootstrapper-$(host_arch).bin cp build/loader.bin loader-$(host_arch).bin diff --git a/src/linux/helpers/rebuild.sh b/src/linux/helpers/rebuild.sh index b16635d6d..06b7fef5a 100755 --- a/src/linux/helpers/rebuild.sh +++ b/src/linux/helpers/rebuild.sh @@ -44,12 +44,6 @@ usage () { exit 1 } -setup_meson () { - ln -s "$RELENG_DIR/meson/meson.py" "$TMP_MESON_DIR/meson" - chmod +x "$TMP_MESON_DIR/meson" - export PATH="$TMP_MESON_DIR:$PATH" -} - ARCHS=( x86 x86_64 @@ -84,8 +78,6 @@ build_arch () { export CC="gcc -m32" CXX="g++ -m32" STRIP="strip" fi - setup_meson - cd "$FRIDA_CORE_DIR" rm -rf "$BUILD_DIR"