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

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

GLQT best integration

File size: 3.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  ifndef QTHOME
63    QTHOME     := /usr
64  endif
65  ifndef QTFLAGS
66    QTFLAGS    := -I$(QTHOME)/include/qt4/Qt
67    QTFLAGS    += -I$(QTHOME)/include/qt4
68  endif
69  ifndef QTMOC
70    QTMOC      := $(QTHOME)/bin/moc
71  endif
72
73  QT_VERSION   := $(shell test -f $(QTHOME)/lib/libQt3Support.so && echo QT4 || echo QT3)
74
75  ifndef GLQTLIBS
76    ifeq ($(QT_VERSION),QT3)
77      GLQTLIBS    := -L$(QTHOME)/lib -lqt-mt
78    else
79      GLQTLIBS    := -L$(QTHOME)/lib/qt4 -lQtCore -lQtGui -lQtOpenGL -lQtSql -lQtXml
80    endif
81  endif
82  ifndef QTLIBS
83    ifeq ($(QT_VERSION),QT3)
84      QTLIBS    := -L$(QTHOME)/lib -lqt-mt
85    else
86      QTLIBS    := -L$(QTHOME)/lib/qt4 -lQtCore -lQtGui -lQtSql -lQtXml
87    endif
88  endif
89  ifndef XAWFLAGS
90    XAWFLAGS   := -I/usr/X11R6/include
91  endif
92  ifndef XAWLIBS
93    XAWLIBS    := -lXaw
94  endif
95  DLDLIBS   := -ldl
96  ifndef OGLFLAGS
97    OGLFLAGS  := -I$(OGLHOME)/include
98  endif
99  ifndef OGLLIBS
100    OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
101  endif
102  define build-granular-shared-lib
103    @libdir=`(cd $(@D);/bin/pwd)`; \
104     cd $(G4TMPDIR); \
105     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
106  endef
107  define build-global-shared-lib
108    @libdir=`(cd $(@D);/bin/pwd)`; \
109     cd $(G4TMP)/$(G4SYSTEM); \
110     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
111                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
112  endef
113
114endif
Note: See TracBrowser for help on using the repository browser.