Vagabond / erlang-syslog

Erlang port driver for interacting with syslog via syslog(3)
Other
87 stars 56 forks source link

Improvement on build script #12

Closed edwardt closed 7 years ago

edwardt commented 11 years ago

Please improve or write instruction on building this module. Ideally when compile riak, it will be nice to see it as one go rather than hunting down errors that are not contributing to try using Riak. Riak depends on erlang-syslog and when compiling it cannot find the erl_interface.h file, which I need to set it manually. Is it possible to probe for it in the build script in future?

Error. ompiling /opt/riak/deps/syslog/c_src/syslog_drv.c /opt/riak/deps/syslog/c_src/syslog_drv.c:30:24: error: erl_driver.h: No such file or directory /opt/riak/deps/syslog/c_src/syslog_drv.c:45: error: expected specifier-qualifier-list before ‘ErlDrvPort’ /opt/riak/deps/syslog/c_src/syslog_drv.c: In function ‘encode_error’: /opt/riak/deps/syslog/c_src/syslog_drv.c:60: error: ‘ERL_DRV_ERROR_GENERAL’ undeclared (first use in this function)

edwardt commented 11 years ago

I could not find a label as enhancement, so just log this as is

edwardt commented 11 years ago

I know that we have no configure script but similar issue has been raised for couchdb: https://issues.apache.org/jira/browse/COUCHDB-162

edwardt commented 11 years ago

Hi At the mean time, I make a very simple .rc script which contains the environment variables needed. Before calling rebar compile. The script assumes a default location installation of erlang R15 which user can customize for their own needs.

export ERLANG_HOME=/usr/lib64/erlang export ERLANG_LIB=${ERLANG_HOME}/lib export ERTS_HOME=${ERLANG_HOME}/erts-5.6.5 export ERTS_INCLUDE=${ERTS_HOME}/include export ERTS_LIB=${ERTS_HOME}/lib export ERL_INTERFACE_DIR=${ERLANG_LIB}/erl_interface-3.5.9 export CFLAGS="-I${ERL_INTERFACE_DIR}/include -I${ERTS_INCLUDE}" export LDFLAGS="-L${ERL_INTERFACE_DIR}/lib -lerl_interface -lei"

,....... then a bunch of echo back the values of the environment variable for easier user feedback

Vagabond commented 10 years ago

Arguably this is a bug in rebar's port compiler. It should tell you if the environment for building a port driver is insufficent (erlang headers missing).

binarytemple-external commented 7 years ago

Candidate for close?