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

Last change on this file was 1349, checked in by garnier, 13 years ago

update

File size: 3.3 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  ARCH   := $(shell uname -m | cut -s -d "_" -f 2)
51
52  ifndef X11FLAGS
53    X11FLAGS  := -I/usr/include/X11/extensions -I/usr/include/X11
54  endif
55  ifndef X11LIBS
56    X11LIBS   := -L/usr/X11R6/lib$(ARCH)  -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
57  endif
58  ifndef XMFLAGS
59    XMFLAGS   := -I/usr/X11R6/include
60  endif
61  ifndef XMLIBS
62    XMLIBS    := -lXm -lXpm
63  endif
64  ifndef XAWFLAGS
65    XAWFLAGS   := -I/usr/X11R6/include
66  endif
67  ifndef XAWLIBS
68    XAWLIBS    := -lXaw
69  endif
70  DLDLIBS   := -ldl
71  ifndef OGLFLAGS
72    OGLFLAGS  := -I$(OGLHOME)/include
73  endif
74  ifndef OGLLIBS
75    OGLLIBS   := -L$(OGLHOME)/lib$(ARCH) -lGLU -lGL
76  endif
77
78# ---- QT Setup block -------------------------------------------------------
79
80  ifndef QTHOME
81    QTHOME     := /usr
82  endif
83  ifndef QTMOC
84    QTMOC      := $(QTHOME)/bin/moc
85  endif
86
87  QT_VERSION := $(shell $(QTMOC) 2>&1 -v | sed 's/.* .Qt \([0-9]\)\..*/\1/' )
88
89  ifndef QTFLAGS
90    QTFLAGS   := -I$(QTHOME)/include -I$(QTHOME)/include/Qt
91    QTFLAGS   += -I$(QTHOME)/include/QtCore
92    QTFLAGS   += -I$(QTHOME)/include/QtGui
93    QTFLAGS   += -I$(QTHOME)/include/QtOpenGL
94  endif
95  ifndef QTLIBPATH
96    QTLIBPATH := $(QTHOME)/lib
97    QT_SEARCH_LIB := $(shell ls  $(QTLIBPATH)/qt$(QT_VERSION)/libq* 2>/dev/null | wc -l )
98    ifneq ($(QT_SEARCH_LIB),0)
99      QTLIBPATH := $(QTHOME)/lib/qt$(QT_VERSION)
100    endif
101  endif
102  ifndef QTLIBS
103    QTLIBS   := -L$(QTLIBPATH) -lQtCore -lQtGui
104  endif
105  ifndef GLQTLIBS
106    GLQTLIBS := -L$(QTLIBPATH) -lQtCore -lQtGui -lQtOpenGL
107  endif
108
109#----------------------------------------------------------------------------
110
111  define build-granular-shared-lib
112    @libdir=`(cd $(@D);/bin/pwd)`; \
113     cd $(G4TMPDIR); \
114     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) *.o
115  endef
116  define build-global-shared-lib
117    @libdir=`(cd $(@D);/bin/pwd)`; \
118     cd $(G4TMP)/$(G4SYSTEM); \
119     $(CXX) -Wl,-soname,$(@F) -shared -o $$libdir/$(@F) $(INTYLIBS) \
120                    $(foreach dir,$(SUBLIBS),$(dir)/*.o);
121  endef
122
123endif
Note: See TracBrowser for help on using the repository browser.