The compile function expects a list of paths in the LibDirs parameter,
however when calling erlang_check_file.erl with an additional path (for
example when using the "g:syntastic_erlc_include_path" option), a
string would be passed instead. Because strings in Erlang are lists,
each character of the string would have been interpreted as a lib path.
I want to use lib_dirs and sub_dirs from rebar file and run compile with
this paths. So I search for the next rebar.config file and pass this in
g:syntastic_erlc_include_path.
see: https://github.com/scrooloose/syntastic/issues/685
When having nested directories (for instance `src/protocol/tm_protocol.erl`)
autocompilation would fail. This fix adds the abspath of all depdencies to
the codepath and sets compile option {i, _} to support both `deps/` and `lib/`.