diff options
author | Mike Pall <mike> | 2015-10-24 19:10:40 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2015-10-24 19:10:40 +0200 |
commit | f416cf6a6439782e4ae7c4b29387d4564bb765db (patch) | |
tree | e5897c0e21b2e61155e8faef6bf5461782427150 /src | |
parent | 3639ff41420610969f44eceebac11253ff7c8025 (diff) | |
download | luajit-f416cf6a6439782e4ae7c4b29387d4564bb765db.tar.gz luajit-f416cf6a6439782e4ae7c4b29387d4564bb765db.tar.bz2 luajit-f416cf6a6439782e4ae7c4b29387d4564bb765db.zip |
OSX: Switch to Clang as the default compiler.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/src/Makefile b/src/Makefile index 5021e479..9c95c4ce 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -24,11 +24,13 @@ NODOTABIVER= 51 | |||
24 | # removing the '#' in front of them. Make sure you force a full recompile | 24 | # removing the '#' in front of them. Make sure you force a full recompile |
25 | # with "make clean", followed by "make" if you change any options. | 25 | # with "make clean", followed by "make" if you change any options. |
26 | # | 26 | # |
27 | DEFAULT_CC = gcc | ||
28 | # | ||
27 | # LuaJIT builds as a native 32 or 64 bit binary by default. | 29 | # LuaJIT builds as a native 32 or 64 bit binary by default. |
28 | CC= gcc | 30 | CC= $(DEFAULT_CC) |
29 | # | 31 | # |
30 | # Use this if you want to force a 32 bit build on a 64 bit multilib OS. | 32 | # Use this if you want to force a 32 bit build on a 64 bit multilib OS. |
31 | #CC= gcc -m32 | 33 | #CC= $(DEFAULT_CC) -m32 |
32 | # | 34 | # |
33 | # Since the assembler part does NOT maintain a frame pointer, it's pointless | 35 | # Since the assembler part does NOT maintain a frame pointer, it's pointless |
34 | # to slow down the C part by not omitting it. Debugging, tracebacks and | 36 | # to slow down the C part by not omitting it. Debugging, tracebacks and |
@@ -151,6 +153,29 @@ XCFLAGS= | |||
151 | ############################################################################## | 153 | ############################################################################## |
152 | 154 | ||
153 | ############################################################################## | 155 | ############################################################################## |
156 | # Host system detection. | ||
157 | ############################################################################## | ||
158 | |||
159 | ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM)) | ||
160 | HOST_SYS= Windows | ||
161 | HOST_RM= del | ||
162 | else | ||
163 | HOST_SYS:= $(shell uname -s) | ||
164 | ifneq (,$(findstring MINGW,$(HOST_SYS))) | ||
165 | HOST_SYS= Windows | ||
166 | HOST_MSYS= mingw | ||
167 | endif | ||
168 | ifneq (,$(findstring CYGWIN,$(HOST_SYS))) | ||
169 | HOST_SYS= Windows | ||
170 | HOST_MSYS= cygwin | ||
171 | endif | ||
172 | # Use Clang for OSX host. | ||
173 | ifeq (Darwin,$(HOST_SYS)) | ||
174 | DEFAULT_CC= clang | ||
175 | endif | ||
176 | endif | ||
177 | |||
178 | ############################################################################## | ||
154 | # Flags and options for host and target. | 179 | # Flags and options for host and target. |
155 | ############################################################################## | 180 | ############################################################################## |
156 | 181 | ||
@@ -263,24 +288,9 @@ ifneq (,$(LMULTILIB)) | |||
263 | endif | 288 | endif |
264 | 289 | ||
265 | ############################################################################## | 290 | ############################################################################## |
266 | # System detection. | 291 | # Target system detection. |
267 | ############################################################################## | 292 | ############################################################################## |
268 | 293 | ||
269 | ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM)) | ||
270 | HOST_SYS= Windows | ||
271 | HOST_RM= del | ||
272 | else | ||
273 | HOST_SYS:= $(shell uname -s) | ||
274 | ifneq (,$(findstring MINGW,$(HOST_SYS))) | ||
275 | HOST_SYS= Windows | ||
276 | HOST_MSYS= mingw | ||
277 | endif | ||
278 | ifneq (,$(findstring CYGWIN,$(HOST_SYS))) | ||
279 | HOST_SYS= Windows | ||
280 | HOST_MSYS= cygwin | ||
281 | endif | ||
282 | endif | ||
283 | |||
284 | TARGET_SYS?= $(HOST_SYS) | 294 | TARGET_SYS?= $(HOST_SYS) |
285 | ifeq (Windows,$(TARGET_SYS)) | 295 | ifeq (Windows,$(TARGET_SYS)) |
286 | TARGET_STRIP+= --strip-unneeded | 296 | TARGET_STRIP+= --strip-unneeded |