diff --git a/Makefile b/Makefile index 230f9f0..19f1838 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,17 @@ OUT ?= ./build SRC := src CFLAGS = -Wall -fPIC -LDFLAGS = -lpthread +LDFLAGS = \ + -lpthread + +UNAME_S := $(shell uname -s) +ifneq ($(UNAME_S),Darwin) +# GNU ld specific options +LDFLAGS += \ + -Wl,--gc-sections \ + -Wl,--as-needed \ + -Wl,--version-script=./mk/libdcurl.version +endif -include $(OUT)/local.mk diff --git a/mk/libdcurl.version b/mk/libdcurl.version new file mode 100644 index 0000000..205dc04 --- /dev/null +++ b/mk/libdcurl.version @@ -0,0 +1,14 @@ +CODEABI_1.0 { + global: + /* core */ + dcurl_*; + + /* compat */ + ccurl_*; + + /* JNI */ + Java_com_iota_iri_hash_PearlDiver*; + + local: *; +}; +