summaryrefslogtreecommitdiff
blob: 52a7caf3fc87f3b9b3b5754149609ed0bf444872 (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
113
114
115
116
117
118
119
120
121
122
123
124
125
Respect CXX, compiler flags
Fix build with --as-needed

http://bugs.gentoo.org/show_bug.cgi?id=344119

--- config/sys/Linux-g++.gmk
+++ config/sys/Linux-g++.gmk
@@ -2,9 +2,7 @@
 # ------ GNU/LINUX ------ gcc 3.2 and higher
 #
 ifeq ($(G4SYSTEM),Linux-g++)
-  CXX       := g++
-  CXXFLAGS  := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
-  CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
+  CXXFLAGS  += -ansi
 #
 # Uncomment the following options to activate Pentium4 chip specific
 # floating-point operations on the SSE unit. It will allow for more stable
@@ -14,27 +12,16 @@
 #       platforms. Will only run on Pentium4-based architectures !
 #
 # CXXFLAGS  += -march=pentium4 -mfpmath=sse
-  ifdef G4OPTIMISE
-    CXXFLAGS  += -O2
-    FCFLAGS   := -O2
-    CCFLAGS   := -O2
-  else
-    ifdef G4DEBUG
+  ifdef G4DEBUG
       CXXFLAGS  += -g
-      FCFLAGS   := -g
-      CCFLAGS   := -g
-    endif
+      FCFLAGS   += -g
+      CCFLAGS   += -g
   endif
   ifdef G4PROFILE
     CXXFLAGS  += -pg
     FCFLAGS   += -pg
     CCFLAGS   += -pg
   endif
-  ifdef G4OPTDEBUG
-    CXXFLAGS  += -O2 -g
-    FCFLAGS   += -O2 -g
-    CCFLAGS   += -O2 -g
-  endif
   ifdef G4LIB_BUILD_SHARED
     CXXFLAGS  += -fPIC
     FCFLAGS   += -fPIC
@@ -42,7 +29,6 @@
   endif
   G4RUNPATHOPTION := -Wl,-rpath 
   CC := gcc
-  FC := gfortran
   FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
   FCLIBS := -lg2c -lnsl
   ECHO   := /bin/echo -e
@@ -108,7 +94,7 @@
   endif
   ifndef QTLIBPATH
     QTLIBPATH := $(QTHOME)/lib
-    QT_SEARCH_LIB := $(shell ls  $(QTLIBPATH)/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l )
+    QT_SEARCH_LIB := $(shell ls  $(QTLIBPATH)/qt$(QT_VERSION)/lib[q,Q]t* 2>/dev/null | wc -l )
     ifneq ($(QT_SEARCH_LIB),0)
       QTLIBPATH := $(QTHOME)/lib/qt$(QT_VERSION)
     endif
@@ -140,13 +126,13 @@
   define build-granular-shared-lib
     @libdir=`(cd $(@D);/bin/pwd)`; \
      cd $(G4TMPDIR); \
-     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
+     $(CXX) $(LDFLAGS) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) *.o $(INTYLIBS);
   endef
   define build-global-shared-lib
     @libdir=`(cd $(@D);/bin/pwd)`; \
      cd $(G4TMP)/$(G4SYSTEM); \
-     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
-                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
+     $(CXX) $(LDFLAGS) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) \
+                    $(foreach dir,$(SUBLIBS),$(dir)/*.o) $(INTYLIBS);
   endef
 
 endif
--- config/sys/Linux-icc.gmk
+++ config/sys/Linux-icc.gmk
@@ -3,17 +3,11 @@
 #
 ifeq ($(G4SYSTEM),Linux-icc)
   CXX       := icc
-  CXXFLAGS  := -ansi -fp-model precise -no-gcc -w1
-  ifdef G4OPTIMISE
-    CXXFLAGS  += -O2
-    FCFLAGS   := -O2
-    CCFLAGS   := -O2
-  else
-    ifdef G4DEBUG
-      CXXFLAGS  += -g
-      FCFLAGS   := -g
-      CCFLAGS   := -g
-    endif
+  CXXFLAGS  += -ansi
+  ifdef G4DEBUG
+    CXXFLAGS  += -g
+    FCFLAGS   += -g
+    CCFLAGS   += -g
   endif
   ifdef G4PROFILE
     CXXFLAGS  += -qp
@@ -61,13 +55,13 @@
   define build-granular-shared-lib
     @libdir=`(cd $(@D);/bin/pwd)`; \
      cd $(G4TMPDIR); \
-     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
+     $(CXX) $(LDFLAGS) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) *.o $(INTYLIBS);
   endef
   define build-global-shared-lib
     @libdir=`(cd $(@D);/bin/pwd)`; \
      cd $(G4TMP)/$(G4SYSTEM); \
-     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
-                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
+     $(CXX) $(LDFLAGS) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) \
+                    $(foreach dir,$(SUBLIBS),$(dir)/*.o) $(INTYLIBS);
   endef
 
 endif