Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
build:

name: Build and test
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 13 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ MPD_LIB_TARFILE = $(wildcard $(C_LIB_DIR)/*.tar.gz)
MPD_LIB_DIR = $(C_LIB_DIR)/$(shell tar tzf $(MPD_LIB_TARFILE) | head -1)
MPD_LIB = $(MPD_LIB_DIR:/=)/libmpdec/libmpdec.a

ifneq ($(CROSSCOMPILE),)
# crosscompiling
CFLAGS += -fPIC
ifeq ($(CROSSCOMPILE),)
# Not crosscompiling, so check that we're on Linux for whether to compile the NIF.
ifeq ($(shell uname -s),Linux)
CFLAGS += -fPIC
LDFLAGS += -fPIC -shared
else
CFLAGS += -Ic_src/compat
LDFLAGS += -undefined dynamic_lookup -dynamiclib
USE_STUB = yes
endif
else
# not crosscompiling
ifneq ($(OS),Windows_NT)
CFLAGS += -fPIC

ifeq ($(shell uname),Darwin)
LDFLAGS += -dynamiclib -undefined dynamic_lookup
endif
endif
# Crosscompiled build
LDFLAGS += -fPIC -shared
CFLAGS += -fPIC
endif

calling_from_make:
Expand Down