Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,22 @@ CC=c99
endif

# Test for GCC
ifneq (,$(findstring gcc,$(shell $(CC) 2>&1)))

GCC=$(findstring gcc,$(shell $(CC) 2>&1))
CLANG=$(findstring clang,$(shell $(CC) 2>&1))

ifneq (,$(or $(GCC), $(CLANG)))
CC=cc
GCCFLAGS=-std=c99 -Wall -Wno-parentheses -fno-strict-aliasing -Wp,-D_FORTIFY_SOURCE=2

ifneq (,$(GCC))
# link-time optimizer only on GCC 4.6+
GCC_VERSION_GT_46=$(shell expr `$(CC) -dumpversion` ">=" 4.6)
ifeq ($(GCC_VERSION_GT_46),1)
GCCFLAGS+= -flto=auto -ffat-lto-objects
LDFLAGS=-flto=auto
endif
endif

endif

Expand Down