source: trunk/config/sys/Linux-g++.gmk @ 893

Last change on this file since 893 was 893, checked in by garnier, 15 years ago

make 3.80 added because 3.81 is bad

File size: 4.0 KB
Line 
1#
2# ------ GNU/LINUX ------ gcc 3.2 and higher
3#
4ifeq ($(G4SYSTEM),Linux-g++)
5  CXX       := g++
6  CXXFLAGS  := -W -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
7  CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
8#
9# Uncomment the following options to activate Pentium4 chip specific
10# floating-point operations on the SSE unit. It will allow for more stable
11# results (no output differences between debug/optimised runs) and little
12# performance improvement (in the order of 2%).
13# NOTE: binaries built using these options will NOT be portable cross
14#       platforms. Will only run on Pentium4-based architectures !
15#
16# CXXFLAGS  += -march=pentium4 -mfpmath=sse
17  ifdef G4OPTIMISE
18    CXXFLAGS  += -O2
19    FCFLAGS   := -O2
20    CCFLAGS   := -O2
21  else
22    ifdef G4DEBUG
23      CXXFLAGS  += -g
24      FCFLAGS   := -g
25      CCFLAGS   := -g
26    endif
27  endif
28  ifdef G4PROFILE
29    CXXFLAGS  += -pg
30    FCFLAGS   += -pg
31    CCFLAGS   += -pg
32  endif
33  ifdef G4OPTDEBUG
34    CXXFLAGS  += -O2 -g
35    FCFLAGS   += -O2 -g
36    CCFLAGS   += -O2 -g
37  endif
38  ifdef G4LIB_BUILD_SHARED
39    CXXFLAGS  += -fPIC
40    FCFLAGS   += -fPIC
41    CCFLAGS   += -fPIC
42  endif
43  G4RUNPATHOPTION := -Wl,-rpath
44  CC := gcc
45  FC := gfortran
46  FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
47  FCLIBS := -lg2c -lnsl
48  ECHO    := /bin/echo -e
49  SHEXT   := so
50  ifndef X11FLAGS
51    X11FLAGS  := -I/usr/include/X11/extensions -I/usr/include/X11
52  endif
53  ifndef X11LIBS
54    X11LIBS   := -L/usr/X11R6/lib  -lXmu -lXt -lXext -lX11 -lSM -lICE
55  endif
56  ifndef XMFLAGS
57    XMFLAGS   := -I/usr/X11R6/include
58  endif
59  ifndef XMLIBS
60    XMLIBS    := -lXm -lXpm
61  endif
62
63# ---- QT Setup block -------------------------------------------------------
64  ifndef QTHOME
65    QTHOME     := /usr
66  endif
67  ifndef QTMOC
68    QTMOC      := $(QTHOME)/bin/moc
69  endif
70
71  QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' )
72
73  ifndef QTFLAGS
74    ifeq ($(QT_VERSION),4)
75      QTFLAGS   += -I$(QTHOME)/include/qt$(QT_VERSION)
76      QTFLAGS   += -I $(QTHOME)/include/qt$(QT_VERSION)/QtCore
77      QTFLAGS   += -I $(QTHOME)/include/qt$(QT_VERSION)/QtGui
78      QTFLAGS   += -I $(QTHOME)/include/qt$(QT_VERSION)/QtOpenGL
79    else
80      QTFLAGS    := -I$(QTHOME)/include/qt$(QT_VERSION)/Qt
81      QTFLAGS    += -I$(QTHOME)/include/qt$(QT_VERSION)
82    endif
83  endif
84  ifndef QTLIBPATH
85    QT_SEARCH_LIB1 := $(shell ls  $(QTHOME)/lib/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l )
86    QT_SEARCH_LIB2 := $(shell ls  $(QTHOME)/lib/libq*  2>/dev/null | wc -l )
87    ifneq ($(QT_SEARCH_LIB1),0)
88      QTLIBPATH   := /lib/qt$(QT_VERSION)
89    endif
90    ifneq ($(QT_SEARCH_LIB2),0)
91      QTLIBPATH   := /lib
92    endif
93  endif
94  ifndef QTLIBS
95    QTLIBS   := -L$(QTHOME)$(QTLIBPATH)
96    ifeq ($(QT_VERSION),3)
97      QT3_MT  := $(shell ls  $(QTHOME)$(QTLIBPATH)/libqt-mt.* | wc -l )
98      ifneq ($(QT3_MT),0)
99        QTLIBS  += -lqt-mt
100      else
101        QTLIBS  += -lqt
102      endif
103      QTLIBS   += -lqui
104    else
105      QTLIBS    += -lQtCore -lQtGui
106    endif
107  endif
108  ifndef GLQTLIBS
109    ifeq ($(QT_VERSION),3)
110        # already done in QTLIBS
111        #      GLQTLIBS    := $(QTLIBS)
112    else
113      GLQTLIBS    := -L$(QTHOME)$(QTLIBPATH) -lQtCore -lQtGui -lQtOpenGL
114    endif
115  endif
116#----------------------------------------------------------------------------
117
118  ifndef XAWFLAGS
119    XAWFLAGS   := -I/usr/X11R6/include
120  endif
121  ifndef XAWLIBS
122    XAWLIBS    := -lXaw
123  endif
124  DLDLIBS   := -ldl
125  ifndef OGLFLAGS
126    OGLFLAGS  := -I$(OGLHOME)/include
127  endif
128  ifndef OGLLIBS
129    OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
130  endif
131  define build-granular-shared-lib
132    @libdir=`(cd $(@D);/bin/pwd)`; \
133     cd $(G4TMPDIR); \
134     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
135  endef
136  define build-global-shared-lib
137    @libdir=`(cd $(@D);/bin/pwd)`; \
138     cd $(G4TMP)/$(G4SYSTEM); \
139     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
140                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
141  endef
142
143endif
Note: See TracBrowser for help on using the repository browser.