ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
578 stars 241 forks source link

gmake deps fails on macos #909

Closed pankajsoni19 closed 3 years ago

pankajsoni19 commented 3 years ago

https://github.com/processone/fast_xml.git is failing compile.

Error log

gmake deps     
 DEP    fast_xml (1.1.43)
 CONF   fast_xml
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether make sets $(MAKE)... yes
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for ANSI C header files... (cached) yes
checking for erl... /usr/local/bin/erl
checking for erlc... /usr/local/bin/erlc
checking expat.h usability... yes
checking expat.h presence... yes
checking for expat.h... yes
checking for library containing XML_ParserCreate... -lexpat
configure: creating ./config.status
config.status: creating vars.config
gmake[1]: Entering directory '/Users/pankajsoni/Documents/Git/Rivers/ejabberd/staging/deps/fast_xml'
cc -c -o c_src/fxml.o c_src/fxml.c -g -O2 -Wall -finline-functions -Wall -fPIC -I "/usr/local/Cellar/erlang/23.1.1/lib/erlang/erts-11.1.1/include" -I "/usr/local/Cellar/erlang/23.1.1/lib/erlang/lib/erl_interface-4.0.1/include" -fPIC 
cc -o priv/lib/fxml.so c_src/fxml.o -lexpat  -flat_namespace -undefined suppress -L -lei  
ld: warning: directory not found for option '-L-lei'
cc -c -o c_src/fxml_stream.o c_src/fxml_stream.c -g -O2 -Wall -finline-functions -Wall -fPIC -I "/usr/local/Cellar/erlang/23.1.1/lib/erlang/erts-11.1.1/include" -I "/usr/local/Cellar/erlang/23.1.1/lib/erlang/lib/erl_interface-4.0.1/include" -fPIC 
cc -o priv/lib/fxml_stream.so c_src/fxml_stream.o -lexpat  -flat_namespace -undefined suppress -L -lei  
ld: warning: directory not found for option '-L-lei'
 DEPEND fast_xml.d
 ERLC   fast_xml.erl fxml.erl fxml_gen.erl fxml_gen_pt.erl fxml_stream.erl fxml_sup.erl fxmlrpc.erl fxmlrpc_codec.erl fxmlrpc_codec_external.erl
src/fxmlrpc_codec.erl:6: Warning: export_all flag enabled - all functions will be exported
src/fxmlrpc_codec_external.erl:6: Warning: export_all flag enabled - all functions will be exported
 APP    fast_xml.app.src
gmake[1]: Leaving directory '/Users/pankajsoni/Documents/Git/Rivers/ejabberd/staging/deps/fast_xml'
gmake[1]: Entering directory '/Users/pankajsoni/Documents/Git/Rivers/ejabberd/staging/deps/xmpp'
cc -o priv/lib/jid.so c_src/jid.o -flat_namespace -undefined suppress -L "/usr/local/Cellar/erlang/23.1.1/lib/erlang/lib/erl_interface-4.0.1/lib" -lerl_interface -lei  
ld: library not found for -lerl_interface
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [c_src/Makefile.erlang.mk:25: priv/lib/jid.so] Error 1
gmake[1]: *** [Makefile:31: pre-app] Error 2
gmake[1]: Leaving directory '/Users/pankajsoni/Documents/Git/Rivers/ejabberd/staging/deps/xmpp'
gmake: *** [erlang.mk:4512: deps] Error 2

My Sample makefile

PROJECT = server
PROJECT_VERSION = $(shell head -n 1 relx.config | awk '{split($$0, a, "\""); print a[2]}')

LOCAL_DEPS = inets mnesia os_mon runtime_tools
DEPS = lager p1_utils cache_tab stringprep fast_xml xmpp uuid eredis ranch cowboy erlkaf shotgun erlpool jsx mysql_poolboy edate

dep_p1_utils = git https://github.com/processone/p1_utils.git 1.0.20
dep_cache_tab = git https://github.com/processone/cache_tab.git 1.0.25
dep_fast_xml = git https://github.com/processone/fast_xml.git 1.1.43
dep_stringprep = git https://github.com/processone/stringprep.git 1.0.22

include erlang.mk

ERLC_OPTS := $(filter-out -Werror,$(ERLC_OPTS))

ERLC_COMPILE_OPTS= +'{parse_transform, lager_transform}'
ERLC_OPTS += $(ERLC_COMPILE_OPTS)
TEST_ERLC_OPTS += $(ERLC_COMPILE_OPTS)
pankajsoni19 commented 3 years ago

I am on erlang 23.1.1 & macos 10.15.7

pankajsoni19 commented 3 years ago

I updated the build script and it now compiles.