nitc: let CC, CXX and NO_STACKTRACE use env value
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 14 Mar 2017 01:00:39 +0000 (21:00 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Tue, 14 Mar 2017 12:48:16 +0000 (08:48 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/compiler/abstract_compiler.nit

index 224de8b..35c07d5 100644 (file)
@@ -350,9 +350,9 @@ class MakefileToolchain
                var debug = toolcontext.opt_debug.value
 
                makefile.write """
-CC = ccache cc
-CXX = ccache c++
-CFLAGS = -g {{{if not debug then "-O2" else ""}}} -Wno-unused-value -Wno-switch -Wno-attributes -Wno-trigraphs
+CC ?= ccache cc
+CXX ?= ccache c++
+CFLAGS ?= -g {{{if not debug then "-O2" else ""}}} -Wno-unused-value -Wno-switch -Wno-attributes -Wno-trigraphs
 CINCL =
 LDFLAGS ?=
 LDLIBS  ?= -lm {{{linker_options.join(" ")}}}
@@ -361,9 +361,9 @@ LDLIBS  ?= -lm {{{linker_options.join(" ")}}}
                makefile.write "\n# SPECIAL CONFIGURATION FLAGS\n"
                if platform.supports_libunwind then
                        if toolcontext.opt_no_stacktrace.value then
-                               makefile.write "NO_STACKTRACE=True"
+                               makefile.write "NO_STACKTRACE ?= True"
                        else
-                               makefile.write "NO_STACKTRACE= # Set to `True` to enable"
+                               makefile.write "NO_STACKTRACE ?= # Set to `True` to enable"
                        end
                end