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

Last change on this file since 726 was 726, checked in by garnier, 16 years ago

ameliorations pour les MOC

File size: 2.7 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 G4LIB_BUILD_SHARED
34    CXXFLAGS  += -fPIC
35    FCFLAGS   += -fPIC
36    CCFLAGS   += -fPIC
37  endif
38  G4RUNPATHOPTION := -Wl,-rpath
39  CC := gcc
40  FC := g77
41  FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
42  FCLIBS := -lg2c -lnsl
43  ECHO    := /bin/echo -e
44  SHEXT   := so
45  ifndef X11FLAGS
46    X11FLAGS  := -I/usr/include/X11/extensions -I/usr/include/X11
47  endif
48  ifndef X11LIBS
49    X11LIBS   := -L/usr/X11R6/lib  -lXmu -lXt -lXext -lX11 -lSM -lICE
50  endif
51  ifndef XMFLAGS
52    XMFLAGS   := -I/usr/X11R6/include
53  endif
54  ifndef XMLIBS
55    XMLIBS    := -lXm -lXpm
56  endif
57  ifndef QTHOME
58    QTHOME  := /usr/local/Qt
59  endif
60  ifndef QTFLAGS
61    QTFLAGS   := -I$(QTHOME)/include/Qt
62    QTFLAGS   += -I$(QTHOME)/include
63  endif
64  ifndef QTMOC
65    QTMOC       := $(QTHOME)/bin/moc
66  endif
67  ifndef QTLIBS
68    QT3LIBS    := -L$(QTHOME)/lib -lqt-mt
69    QT4LIBS    := -L$(QTHOME)/lib -lQtCore -lQtGui -lQtOpenGL -lQtSql -lQtXml
70    QTLIBS     := $(shell test -f $(QTHOME)/lib/libQt3Support.so && echo $(QT4LIBS) || echo $(QT3LIBS))
71  endif
72  ifndef XAWFLAGS
73    XAWFLAGS   := -I/usr/X11R6/include
74  endif
75  ifndef XAWLIBS
76    XAWLIBS    := -lXaw
77  endif
78  DLDLIBS   := -ldl
79  ifndef OGLFLAGS
80    OGLFLAGS  := -I$(OGLHOME)/include
81  endif
82  ifndef OGLLIBS
83    OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
84  endif
85  define build-granular-shared-lib
86    @libdir=`(cd $(@D);/bin/pwd)`; \
87     cd $(G4TMPDIR); \
88     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
89  endef
90  define build-global-shared-lib
91    @libdir=`(cd $(@D);/bin/pwd)`; \
92     cd $(G4TMP)/$(G4SYSTEM); \
93     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
94                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
95  endef
96
97endif
Note: See TracBrowser for help on using the repository browser.