mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
With Clang, compile in GNU89 mode and fix clang detection in the Makefiles.
The default C99 mode is giving us linking errors from xdelta3. git-svn-id: https://svn.eduke32.com/eduke32@2672 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
8a4519324e
commit
1c530d4b2f
3 changed files with 8 additions and 8 deletions
|
@ -191,7 +191,7 @@ endif
|
||||||
# PLATFORM SPECIFIC SETTINGS
|
# PLATFORM SPECIFIC SETTINGS
|
||||||
|
|
||||||
ifeq ($(PLATFORM),LINUX)
|
ifeq ($(PLATFORM),LINUX)
|
||||||
ifneq ($(CC),clang)
|
ifeq (0,$(CLANG))
|
||||||
OURCFLAGS += -fno-pic
|
OURCFLAGS += -fno-pic
|
||||||
endif
|
endif
|
||||||
OURASFLAGS += -f elf
|
OURASFLAGS += -f elf
|
||||||
|
|
|
@ -79,7 +79,7 @@ RANLIB=ranlib
|
||||||
STRIP=strip
|
STRIP=strip
|
||||||
|
|
||||||
ifneq (0,$(CLANG))
|
ifneq (0,$(CLANG))
|
||||||
CC=clang
|
CC=clang -std=gnu89
|
||||||
CXX=clang++
|
CXX=clang++
|
||||||
# AR=llvm-ar
|
# AR=llvm-ar
|
||||||
# RANLIB=llvm-ranlib
|
# RANLIB=llvm-ranlib
|
||||||
|
@ -103,7 +103,7 @@ endif
|
||||||
|
|
||||||
ifneq ($(RELEASE)$(DEBUGANYWAY),10)
|
ifneq ($(RELEASE)$(DEBUGANYWAY),10)
|
||||||
# debug build or DEBUGANYWAY=1 --> -g flag
|
# debug build or DEBUGANYWAY=1 --> -g flag
|
||||||
ifeq ($(CC),clang)
|
ifneq (0,$(CLANG))
|
||||||
debug=-g
|
debug=-g
|
||||||
else
|
else
|
||||||
debug=-ggdb
|
debug=-ggdb
|
||||||
|
@ -113,7 +113,7 @@ endif
|
||||||
ifneq (0,$(RELEASE))
|
ifneq (0,$(RELEASE))
|
||||||
# Debugging disabled
|
# Debugging disabled
|
||||||
debug+= -O$(OPTLEVEL)
|
debug+= -O$(OPTLEVEL)
|
||||||
ifneq ($(CC),clang)
|
ifeq (0,$(CLANG))
|
||||||
debug+= -funswitch-loops
|
debug+= -funswitch-loops
|
||||||
endif
|
endif
|
||||||
ifeq (0,$(DEBUGANYWAY))
|
ifeq (0,$(DEBUGANYWAY))
|
||||||
|
@ -133,7 +133,7 @@ else
|
||||||
debug+= -DDEBUGGINGAIDS=2
|
debug+= -DDEBUGGINGAIDS=2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CC),clang)
|
ifneq (0,$(CLANG))
|
||||||
# CLANG_MAJOR := $(shell clang -dM -E -x c /dev/null | grep __clang_major__ | awk '{ print $$3 }')
|
# CLANG_MAJOR := $(shell clang -dM -E -x c /dev/null | grep __clang_major__ | awk '{ print $$3 }')
|
||||||
debug+= -fcatch-undefined-behavior
|
debug+= -fcatch-undefined-behavior
|
||||||
# ifeq ($(CLANG_MAJOR),3)
|
# ifeq ($(CLANG_MAJOR),3)
|
||||||
|
@ -157,7 +157,7 @@ else
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(CC),clang)
|
ifeq (0,$(CLANG))
|
||||||
W_NO_UNUSED_RESULT := $(shell echo '' | $(CC) -E -Wno-unused-result - 2>/dev/null && echo -Wno-unused-result)
|
W_NO_UNUSED_RESULT := $(shell echo '' | $(CC) -E -Wno-unused-result - 2>/dev/null && echo -Wno-unused-result)
|
||||||
W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT))
|
W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT))
|
||||||
else
|
else
|
||||||
|
@ -168,7 +168,7 @@ BASECFLAGS=$(debug) -W -Wall -Werror-implicit-function-declaration \
|
||||||
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
|
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
|
||||||
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH) \
|
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH) \
|
||||||
-Wextra #-Wwrite-strings -Waddress -Wlogical-op
|
-Wextra #-Wwrite-strings -Waddress -Wlogical-op
|
||||||
ifeq ($(CC),clang)
|
ifneq (0,$(CLANG))
|
||||||
BASECFLAGS+= -Wno-unused-value -Wno-parentheses
|
BASECFLAGS+= -Wno-unused-value -Wno-parentheses
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ ifeq (4,$(GCC_MAJOR))
|
||||||
F_NO_STACK_PROTECTOR := -fno-stack-protector
|
F_NO_STACK_PROTECTOR := -fno-stack-protector
|
||||||
# there are some link-time issues with stack protectors, so make it possible to override
|
# there are some link-time issues with stack protectors, so make it possible to override
|
||||||
F_STACK_PROTECTOR_ALL ?= -fstack-protector-all
|
F_STACK_PROTECTOR_ALL ?= -fstack-protector-all
|
||||||
ifneq ($(CC),clang)
|
ifeq (0,$(CLANG))
|
||||||
F_JUMP_TABLES := -fjump-tables
|
F_JUMP_TABLES := -fjump-tables
|
||||||
endif
|
endif
|
||||||
M_TUNE_GENERIC := -mtune=generic
|
M_TUNE_GENERIC := -mtune=generic
|
||||||
|
|
Loading…
Reference in a new issue