aboutsummaryrefslogtreecommitdiff
blob: ac46e0ddde7636e80a89e718accc023992f8c4c6 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
diff --git a/src/Makefile b/src/Makefile
index e2770f5a0..3cdb81a4c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -388,6 +388,22 @@ endif
 #  and remove -fomit-frame-pointer from CXXFLAGS.  It added a bunch of complication and wasn't
 #  really used.
 
+ifeq ($(BUILDOPTIMIZED), 1)
+else
+  CXXFLAGS ?= -g3
+endif
+
+ifeq ($(BUILDDEBUG), 1)
+else
+  ifeq (${OSTYPE}, FreeBSD)
+  ifeq (${MACHINETYPE}, amd64)
+    CXXFLAGS ?= -O3 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
+  else
+    CXXFLAGS ?= -O4 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
+  endif
+  endif
+endif
+
 ifeq (${OSTYPE}, Linux)
   CC        ?= gcc
   CXX       ?= g++
@@ -398,16 +414,6 @@ ifeq (${OSTYPE}, Linux)
   CXXFLAGS  += -Wall -Wextra -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat
 
   BUILDSTACKTRACE ?= 1
-
-  ifeq ($(BUILDOPTIMIZED), 1)
-  else
-    CXXFLAGS += -g3
-  endif
-
-  ifeq ($(BUILDDEBUG), 1)
-  else
-    CXXFLAGS += -O4 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-  endif
 endif
 
 
@@ -479,16 +485,6 @@ ifeq (${OSTYPE}, Darwin)
 
   CXXFLAGS += -pthread -fPIC -m64 -Wall -Wextra -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wno-format-truncation -Wformat
   LDFLAGS  += -pthread -lm
-
-  ifeq ($(BUILDOPTIMIZED), 1)
-  else
-    CXXFLAGS += -g3
-  endif
-
-  ifeq ($(BUILDDEBUG), 1)
-  else
-    CXXFLAGS += -O4 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-  endif
 endif
 
 
@@ -519,16 +515,6 @@ ifeq (${MACHINETYPE}, amd64)
 
   #  callgrind
   #CXXFLAGS  += -g3 -Wa,--gstabs -save-temps
-
-  ifeq ($(BUILDOPTIMIZED), 1)
-  else
-    CXXFLAGS += -g3
-  endif
-
-  ifeq ($(BUILDDEBUG), 1)
-  else
-    CXXFLAGS += -O3 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-  endif
 endif
 endif
 
@@ -544,16 +530,6 @@ ifeq (${MACHINETYPE}, arm)
   CXXFLAGS  += -Wall -Wextra -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat -Wno-parentheses
   CXXFLAGS  += -funroll-loops -fomit-frame-pointer
   LDFLAGS   += 
-
-  ifeq ($(BUILDOPTIMIZED), 1)
-  else
-    CXXFLAGS += -g3
-  endif
-
-  ifeq ($(BUILDDEBUG), 1)
-  else
-    CXXFLAGS += -O4 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-  endif
 endif
 endif
 
@@ -566,16 +542,6 @@ ifneq (,$(findstring CYGWIN, ${OSTYPE}))
   LDFLAGS   := -fopenmp -pthread -lm
 
   CXXFLAGS  += -Wall -Wextra -Wno-write-strings -Wno-unused -Wno-char-subscripts -Wno-sign-compare -Wformat
-
-  ifeq ($(BUILDOPTIMIZED), 1)
-  else
-    CXXFLAGS += -g3
-  endif
-
-  ifeq ($(BUILDDEBUG), 1)
-  else
-    CXXFLAGS += -O4 -funroll-loops -fexpensive-optimizations -finline-functions -fomit-frame-pointer
-  endif
 endif