aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2025-03-19 12:27:02 +0100
committerLoïc Hoguin <[email protected]>2025-03-20 12:40:51 +0100
commite13b4c71d764cc92a1e5a92f5f2dd1c1f59b4a3c (patch)
tree4f450882a1a25339b58ff70905522f4f04ff61d5 /core
parent9f43c7fdbf0ae84a173be112c1c6a712ddde28c7 (diff)
downloaderlang.mk-e13b4c71d764cc92a1e5a92f5f2dd1c1f59b4a3c.tar.gz
erlang.mk-e13b4c71d764cc92a1e5a92f5f2dd1c1f59b4a3c.tar.bz2
erlang.mk-e13b4c71d764cc92a1e5a92f5f2dd1c1f59b4a3c.zip
Properly handle asdf-installed ElixirHEADmaster
Diffstat (limited to 'core')
-rw-r--r--core/elixir.mk7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/elixir.mk b/core/elixir.mk
index 8d1dba9..eb5c487 100644
--- a/core/elixir.mk
+++ b/core/elixir.mk
@@ -10,7 +10,12 @@ export ELIXIR
ifeq ($(ELIXIR),system)
# We expect 'elixir' to be on the path.
-ELIXIR_LIBS ?= $(dir $(shell readlink -f `which elixir`))/../lib
+ELIXIR_BIN ?= $(shell readlink -f `which elixir`)
+ELIXIR_LIBS ?= $(abspath $(dir $(ELIXIR_BIN))/../lib)
+# Fallback in case 'elixir' is a shim.
+ifeq ($(wildcard $(ELIXIR_LIBS)/elixir/),)
+ELIXIR_LIBS = $(abspath $(shell elixir -e 'IO.puts(:code.lib_dir(:elixir))')/../)
+endif
ELIXIR_LIBS := $(ELIXIR_LIBS)
export ELIXIR_LIBS
ERL_LIBS := $(ERL_LIBS):$(ELIXIR_LIBS)