summaryrefslogtreecommitdiff
blob: 4c8f22d7940907c08d0eaf5cf9f0ce1fb57ee650 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- a/Makefile
+++ b/Makefile
@@ -61,8 +61,8 @@
 # compiler settings:
 ifneq ($(CC),use__A_CC__instead_of__CC)
 
-A_CC:=$(CC)# compile C
-A_CXX:=$(CXX)# compile C++
+A_CC:=${CC}# compile C
+A_CXX:=${CXX}# compile C++
 
 # uncomment to ensure no submakefile uses CC and CXX directly
 override CC:=use__A_CC__instead_of__CC
@@ -119,12 +119,7 @@
  endif
 endif
 
-ifeq ($(USE_CLANG),1)
-# accept all clang versions:
 ALLOWED_COMPILER_VERSIONS=$(COMPILER_VERSION)
-else
-ALLOWED_COMPILER_VERSIONS=$(ALLOWED_gcc_VERSIONS)
-endif
 
 COMPILER_VERSION_ALLOWED=$(strip $(subst ___,,$(foreach version,$(ALLOWED_COMPILER_VERSIONS),$(findstring ___$(version)___,___$(COMPILER_VERSION)___))))
 
@@ -184,20 +179,13 @@
 
 shared_cflags :=# flags for shared lib compilation
 lflags :=# linker flags
-clflags :=# linker flags (when passed through gcc)
+clflags := ${LDFLAGS} # linker flags (when passed through gcc)
 extended_warnings :=# warning flags for C and C++-compiler
 extended_cpp_warnings :=# warning flags for C++-compiler only
 
 
 ifeq ($(DEBUG),0)
 	dflags := -DNDEBUG# defines
-	ifeq ($(USE_CLANG),1)
-		cflags := -O3# compiler flags (C and C++)
-	else
-		cflags := -O3# compiler flags (C and C++)
-		lflags += -O2# linker flags
-		clflags += -Wl,-O2# passthrough linker flags
-	endif
 endif
 
 ifeq ($(DEBIAN),1)
@@ -526,6 +514,9 @@
 	cxxflags += $(CPPFLAGS)
 endif
 
+cflags := ${CFLAGS} $(cflags)
+cxxflags += ${CXXFLAGS}
+
 ifeq ('$(USE_GCC_47_OR_HIGHER)','yes')
 cxxflags += -std=gnu++11# see also TEMPLATES/cxxforward.h@USE_Cxx11
 else