Skip to content

Commit

Permalink
support the compile on linux system, like ubuntu and centos (#202)
Browse files Browse the repository at this point in the history
* switches to static builds in make-rust-dependencies

Co-authored-by: alonlong <alonlong@163.com>
Co-authored-by: Dmitry Filimonov <dmitry@pyroscope.io>
  • Loading branch information
3 people committed May 24, 2021
1 parent a69794d commit 5098f57
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ else
ENABLED_SPIES ?= "rbspy,pyspy"
endif

ifeq ("$(shell go env GOOS || true)", "linux")
THIRD_PARTY_DEPENDENCIES ?= "build-rust-dependencies build-phpspy-dependencies"
else
THIRD_PARTY_DEPENDENCIES ?= "build-rust-dependencies"
endif

EMBEDDED_ASSETS ?= ""
EMBEDDED_ASSETS_DEPS ?= "assets-release"
EXTRA_LDFLAGS ?= ""
Expand All @@ -34,7 +40,15 @@ build-release: embedded-assets

.PHONY: build-rust-dependencies
build-rust-dependencies:
cd third_party/rustdeps && cargo build --release
cd third_party/rustdeps && RUSTFLAGS="-C target-feature=+crt-static" cargo build --release

.PHONY: build-phpspy-dependencies
build-phpspy-dependencies:
cd third_party && git clone https://github.com/pyroscope-io/phpspy.git
cd phpspy && USE_ZEND=1 make

.PHONY: build-third-party-dependencies
build-third-party-dependencies: $(shell echo $(THIRD_PARTY_DEPENDENCIES))

.PHONY: test
test:
Expand Down

0 comments on commit 5098f57

Please sign in to comment.