From: Jean Privat Date: Mon, 20 Mar 2017 20:08:59 +0000 (-0400) Subject: Merge: Docker, portability and crosscompiling tweaks X-Git-Url: http://nitlanguage.org?hp=-c Merge: Docker, portability and crosscompiling tweaks * Add the missing SDL2 package (since #2376) to the full DockerFile. * Fix a warning raised by the C compiler when called by niti on 32 bits platforms. * Clean up Makefile generation and enable using environment variables to override the default C compiler, C++ compiler, CFLAGS and whether or not to use libunwind. Making it possible to change the compiler for cross compilation and to skip linking with libunwind to create binaries compatible with more GNU/Linux systems. Pull-Request: #2390 Reviewed-by: Romain Chanoir --- 67339271af90e06a99f5f0d85ffbaf8bf9e237e4 diff --combined src/compiler/abstract_compiler.nit index 11ff040,35c07d5..4ce8024 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@@ -349,14 -349,21 +349,21 @@@ class MakefileToolchai end var debug = toolcontext.opt_debug.value - makefile.write("CC = ccache cc\nCXX = ccache c++\nCFLAGS = -g{ if not debug then " -O2 " else " "}-Wno-unused-value -Wno-switch -Wno-attributes -Wno-trigraphs\nCINCL =\nLDFLAGS ?= \nLDLIBS ?= -lm {linker_options.join(" ")}\n\n") + 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 + CINCL = + LDFLAGS ?= + LDLIBS ?= -lm {{{linker_options.join(" ")}}} + \n""" 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 @@@ -404,7 -411,7 +411,7 @@@ ifeq ($(uname_S),Darwin endif # Special configuration for Windows under mingw64 -ifeq ($(uname_S),MINGW64_NT-10.0) +ifneq ($(findstring MINGW64,$(uname_S)),) # Use the pcreposix regex library LDLIBS += -lpcreposix