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

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

r818@wl-72126: garnier | 2008-04-30 12:42:00 +0200
modif mise a jour sur le cvs

File size: 2.9 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 := gfortran
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 QTGLLIBS
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 QTLIBS
73    QT3LIBS    := -L$(QTHOME)/lib -lqt-mt
74    QT4LIBS    := -L$(QTHOME)/lib -lQtCore -lQtGui -lQtSql -lQtXml
75    QTLIBS     := $(shell test -f $(QTHOME)/lib/libQt3Support.so && echo $(QT4LIBS) || echo $(QT3LIBS))
76  endif
77  ifndef XAWFLAGS
78    XAWFLAGS   := -I/usr/X11R6/include
79  endif
80  ifndef XAWLIBS
81    XAWLIBS    := -lXaw
82  endif
83  DLDLIBS   := -ldl
84  ifndef OGLFLAGS
85    OGLFLAGS  := -I$(OGLHOME)/include
86  endif
87  ifndef OGLLIBS
88    OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
89  endif
90  define build-granular-shared-lib
91    @libdir=`(cd $(@D);/bin/pwd)`; \
92     cd $(G4TMPDIR); \
93     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
94  endef
95  define build-global-shared-lib
96    @libdir=`(cd $(@D);/bin/pwd)`; \
97     cd $(G4TMP)/$(G4SYSTEM); \
98     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
99                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
100  endef
101
102endif
Note: See TracBrowser for help on using the repository browser.