mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
allow environment variables to set/extend CC, CXX, CFLAGS and LDFLAGS
This commit is contained in:
parent
cfdf4e3a49
commit
235d4aba9a
3 changed files with 21 additions and 18 deletions
|
@ -18,9 +18,8 @@
|
|||
#
|
||||
|
||||
# Automagically pick clang or gcc, with preference for clang
|
||||
CC=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi)
|
||||
CXX=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi)
|
||||
|
||||
CC?=$(shell if [ -e /usr/bin/clang ]; then echo clang; else echo gcc; fi)
|
||||
CXX?=$(shell if [ -e /usr/bin/clang++ ]; then echo clang++; else echo g++; fi)
|
||||
INCLUDES=
|
||||
DEFS=
|
||||
LIBS=
|
||||
|
@ -43,16 +42,18 @@ endif
|
|||
# "make debug" is a shortcut for this
|
||||
ifeq ($(ZT_DEBUG),1)
|
||||
DEFS+=-DZT_TRACE
|
||||
CFLAGS=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
||||
CXXFLAGS=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
||||
CFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
||||
CXXFLAGS+=-Wall -g -pthread $(INCLUDES) $(DEFS)
|
||||
LDFLAGS=
|
||||
STRIP=echo
|
||||
# The following line enables optimization for the crypto code, since
|
||||
# C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box!
|
||||
ext/lz4/lz4.o node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g -pthread $(INCLUDES) $(DEFS)
|
||||
else
|
||||
CFLAGS=-Wall -O3 -fPIE -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
CXXFLAGS=-Wall -O3 -fPIE -fvisibility=hidden -fstack-protector -fno-rtti -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
CFLAGS?=-O3 -fstack-protector
|
||||
CFLAGS+=-Wall -fPIE -fvisibility=hidden -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
CXXFLAGS?=-O3 -fstack-protector
|
||||
CXXFLAGS+=-Wall -fPIE -fvisibility=hidden -fno-rtti -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
LDFLAGS=-pie -Wl,-z,relro,-z,now
|
||||
STRIP=strip --strip-all
|
||||
endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue