source: trunk/config/sys/Darwin-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.7 KB
Line 
1#
2# ------ MacOS-X ------
3#                                 MacOS 10.3 gcc-3.3
4#                                 MacOS 10.4 gcc-4.0
5#
6# Original author: Helmut Burkhardt - CERN
7#       Revisions: Guy Barrand - LAL
8#                  Gabriele Cosmo - CERN
9#
10ifeq ($(G4SYSTEM),Darwin-g++)
11  CXX       := g++
12  CXXFLAGS  := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
13  CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
14  ifdef G4OPTIMISE
15    CXXFLAGS  += -O2
16    FCFLAGS   := -O2
17    CCFLAGS   := -O2
18  else
19    ifdef G4DEBUG
20      CXXFLAGS  += -g
21      FCFLAGS   := -g
22      CCFLAGS   := -g
23    endif
24  endif
25  ifdef G4PROFILE
26    CXXFLAGS  += -pg
27    FCFLAGS   += -pg
28    CCFLAGS   += -pg
29  endif
30  FC := gfortran
31  FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
32  LDFLAGS += -bind_at_load
33  FCLIBS := -lg2c -lnsl
34  SHEXT   := dylib
35  ifndef X11FLAGS
36    X11FLAGS  := -I/usr/include/X11/extensions -I/usr/include/X11
37  endif
38  ifndef X11LIBS
39    X11LIBS   := -L/usr/X11R6/lib  -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
40  endif
41  ifndef XMFLAGS
42    XMFLAGS   := -I/sw/include
43#   XMFLAGS   := -I/usr/X11R6/include          ##### some installations.
44  endif
45  ifndef XMLIBS
46    XMLIBS    := -L/sw/lib -lXm -lXpm
47#   XMLIBS    := -L/usr/X11R6/lib -lXm -lXpm   ##### some installations.
48  endif
49  ifndef XAWFLAGS
50    XAWFLAGS   := -I/sw/include
51#   XAWFLAGS   := -I/usr/X11R6/include         ##### some installations.
52  endif
53  ifndef XAWLIBS
54    XAWLIBS    := -lXaw
55  endif
56  DLDLIBS   := -ldl
57  ifndef OGLHOME
58    OGLHOME  := /usr/X11R6
59  endif
60  ifndef OGLFLAGS
61    OGLFLAGS  := -I$(OGLHOME)/include
62  endif
63  ifndef OGLLIBS
64    OGLLIBS   := -L$(OGLHOME)/lib -lGLU -lGL
65# It may be required to uncomment the following lines for building on MacOSX 10.5 "Leopard"
66#    OGLLIBS   += -dylib_file \
67#                 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\
68#                 /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
69  endif
70  ifndef QTHOME
71    QTHOME     := /sw
72  endif
73
74  QT_VERSION   := $(shell test -f $(QTHOME)/Qt3Support.framework/Qt3Support && echo QT3 || echo QT4)
75
76  ifndef QTFLAGS
77    ifeq ($(QT_VERSION),QT4)
78      QTFLAFG   := "-I ${QTHOME}/QtCore.framework/Headers "
79      QTFLAFG   += "-I ${QTHOME}/QtGui.framework/Headers "
80      QTFLAFG   += "-I ${QTHOME}/QtOpenGL.framework/Headers "
81      QTFLAFG   += "-I ${QTHOME}/QtSql.framework/Headers "
82      QTFLAFG   += "-I ${QTHOME}/QtXml.framework/Headers "
83    else
84      QTFLAGS   := -I$(QTHOME)/include/Qt -I$(QTHOME)/include
85    endif
86  endif
87  ifndef QTMOC
88    ifeq ($(QT_VERSION),QT4)
89      QTMOC      := /usr/bin/moc
90    else
91      QTMOC      := $(QTHOME)/bin/moc
92    endif
93  endif
94  ifndef QTLIBS
95    ifeq ($(QT_VERSION),QT3)
96      QTLIBS    := -L$(QTHOME)/lib -lqt -lqui
97    else
98      QTLIBS    := -F$(QTHOME) -framework QtCore -framework QtGui
99      QTLIBS    += -framework QtSql -framework QtXml
100    endif
101  endif
102
103  ifndef GLQTLIBS
104    ifeq ($(QT_VERSION),QT3)
105      GLQTLIBS    := -L$(QTHOME)/lib -lqt -lqui
106    else
107      GLQTLIBS    := -F$(QTHOME) -framework QtCore -framework QtGui
108      GLQTLIBS    += -framework QtOpenGL -framework QtSql -framework QtXml
109    endif
110  endif
111
112  define build-granular-shared-lib
113    @libdir=`(cd $(@D);/bin/pwd)`; \
114     cd $(G4TMPDIR); \
115     g++ -dynamiclib -single_module -undefined dynamic_lookup \
116         -o $$libdir/$(@F) $(INTYLIBS) *.o
117  endef
118  define build-global-shared-lib
119    @libdir=`(cd $(@D);/bin/pwd)`; \
120     cd $(G4TMP)/$(G4SYSTEM); \
121     g++ -dynamiclib -single_module -undefined dynamic_lookup \
122         -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
123  endef
124
125endif
Note: See TracBrowser for help on using the repository browser.