[sr-dev] git:master:01f4a230: erlang: fix Makefile problem

Seudin Kasumovic seudin.kasumovic at gmail.com
Mon May 25 11:05:21 CEST 2015


Module: kamailio
Branch: master
Commit: 01f4a230dc15b9564c101d03811eac9189f91210
URL: https://github.com/kamailio/kamailio/commit/01f4a230dc15b9564c101d03811eac9189f91210

Author: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Committer: Seudin Kasumovic <seudin.kasumovic at gmail.com>
Date: 2015-05-25T11:00:27+02:00

erlang: fix Makefile problem

Read from Erlang shell include and library path.

---

Modified: modules/erlang/Makefile

---

Diff:  https://github.com/kamailio/kamailio/commit/01f4a230dc15b9564c101d03811eac9189f91210.diff
Patch: https://github.com/kamailio/kamailio/commit/01f4a230dc15b9564c101d03811eac9189f91210.patch

---

diff --git a/modules/erlang/Makefile b/modules/erlang/Makefile
index e53026f..61e0336 100644
--- a/modules/erlang/Makefile
+++ b/modules/erlang/Makefile
@@ -5,12 +5,20 @@ include ../../Makefile.defs
 auto_gen=
 NAME=erlang.so
 
-LIBS=-L$(LOCALBASE)/lib/erlang/usr/lib -lei -lpthread
+ERLANG=$(shell which erl)
+
+ifneq ($(ERLANG),)
+ERLANG_LIBDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1)
+ERLANG_INCDIR=$(shell $(ERLANG) -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1)
+else
+$(error Not found Erlang)
+endif
+LIBS=-L$(ERLANG_LIBDIR) -lei -lpthread
 
 SERLIBPATH=../../lib
 SER_LIBS+=$(SERLIBPATH)/kcore/kcore
 
-DEFS+=-I/usr/local/lib/erlang/usr/include
+DEFS+=-I$(ERLANG_INCDIR)
 DEFS+=-DKAMAILIO_MOD_INTERFACE -D_REENTRANT
 
 




More information about the sr-dev mailing list