aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorFrank Hunleth <[email protected]>2016-10-07 17:40:05 -0400
committerLoïc Hoguin <[email protected]>2016-10-09 00:09:27 +0200
commitc849da35563a2fef207fa824bc89dc01e7a5e96f (patch)
treede822e40d713e78224368898842716b59c8e44f4 /core/deps.mk
parent833fc7b75116322757b0f2c30d25c65124fee7a5 (diff)
downloaderlang.mk-c849da35563a2fef207fa824bc89dc01e7a5e96f.tar.gz
erlang.mk-c849da35563a2fef207fa824bc89dc01e7a5e96f.tar.bz2
erlang.mk-c849da35563a2fef207fa824bc89dc01e7a5e96f.zip
Support C compiler flag overrides for dependencies
This change makes it possible to override the ERL_CFLAGS and ERL_LDFLAGS Makefile variables in project dependencies. For the main project, the ability to override variables associated with C compilation already existed in plugins/c_src.mk. With this change, the C compiler flag semantics are similar for both the main project and dependencies. This is important for cases where the automatically determined values for the ERTS include and library directories are incorrect. This happens in cross-compiled environments where they point to the host's include and library directories. However, the desired behaviour is to have them point to those that have been cross-compiled for the target.
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/deps.mk b/core/deps.mk
index a1c1cd8..c8237e9 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -334,9 +334,9 @@ define dep_autopatch_rebar.erl
[] -> ok;
_ ->
Write("\npre-app::\n\t$$\(MAKE) -f c_src/Makefile.erlang.mk\n"),
- PortSpecWrite(io_lib:format("ERL_CFLAGS = -finline-functions -Wall -fPIC -I \\"~s/erts-~s/include\\" -I \\"~s\\"\n",
+ PortSpecWrite(io_lib:format("ERL_CFLAGS ?= -finline-functions -Wall -fPIC -I \\"~s/erts-~s/include\\" -I \\"~s\\"\n",
[code:root_dir(), erlang:system_info(version), code:lib_dir(erl_interface, include)])),
- PortSpecWrite(io_lib:format("ERL_LDFLAGS = -L \\"~s\\" -lerl_interface -lei\n",
+ PortSpecWrite(io_lib:format("ERL_LDFLAGS ?= -L \\"~s\\" -lerl_interface -lei\n",
[code:lib_dir(erl_interface, lib)])),
[PortSpecWrite(["\n", E, "\n"]) || E <- OsEnv],
FilterEnv = fun(Env) ->