diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-03-22 16:21:03 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-03-22 16:21:03 +0100 |
commit | c36dbe6eb447239824f0014ec6beae2df9f42a7c (patch) | |
tree | 62c0655c362b82b340f3084bee1d0a9ccdab8a8a /ffi | |
parent | 6a9e2743d149fecd5d7706b273dc69a45fe25ea2 (diff) |
Fix build on macOS.
- Use GNU install, use the correct extension for dynamic libraries.
- Fixes #226.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/Makefile | 25 | ||||
-rw-r--r-- | ffi/lang/python/Makefile | 7 |
2 files changed, 24 insertions, 8 deletions
diff --git a/ffi/Makefile b/ffi/Makefile index 8d2756eb..361ae0dd 100644 --- a/ffi/Makefile +++ b/ffi/Makefile @@ -12,8 +12,19 @@ CARGO_TARGET_DIR := $(abspath $(CARGO_TARGET_DIR)) VERSION ?= $(shell grep '^version[[:space:]]*=[[:space:]]*' Cargo.toml | cut -d'"' -f2) VERSION_MAJOR = $(shell echo $(VERSION) | cut -d'.' -f1) +# Build the right library +ifeq ($(shell uname -s), Darwin) + _SEQ_LIB_EXT = dylib +else + _SEQ_LIB_EXT = so +endif + # Tools. -INSTALL ?= install +ifeq ($(shell uname -s), Darwin) + INSTALL ?= ginstall +else + INSTALL ?= install +endif # Make sure subprocesses pick these up. export PREFIX @@ -60,12 +71,12 @@ install: $(INSTALL) -t $(DESTDIR)$(PREFIX)/include/sequoia \ include/sequoia/*.h $(INSTALL) -d $(DESTDIR)$(PREFIX)/lib - $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.so \ - $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.so.$(VERSION) - ln -fs libsequoia_ffi.so.$(VERSION) \ - $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.so.$(VERSION_MAJOR) - ln -fs libsequoia_ffi.so.$(VERSION) \ - $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.so + $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.$(_SEQ_LIB_EXT) \ + $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION) + ln -fs libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION) \ + $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION_MAJOR) + ln -fs libsequoia_ffi.$(_SEQ_LIB_EXT).$(VERSION) \ + $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.$(_SEQ_LIB_EXT) $(INSTALL) $(CARGO_TARGET_DIR)/release/libsequoia_ffi.a \ $(DESTDIR)$(PREFIX)/lib/libsequoia_ffi.a # Now the bindings. diff --git a/ffi/lang/python/Makefile b/ffi/lang/python/Makefile index 78a9481e..f398c0c2 100644 --- a/ffi/lang/python/Makefile +++ b/ffi/lang/python/Makefile @@ -9,7 +9,12 @@ CFLAGS += -I../../include -I../../../openpgp-ffi/include PYTHON ?= python3 IPYTHON ?= ipython3 PYTEST ?= pytest-3 -INSTALL ?= install +ifeq ($(shell uname -s), Darwin) + INSTALL ?= ginstall +else + INSTALL ?= install +endif + CARGO_TARGET_DIR ?= ../../../target |