source: trunk/config/sys/Darwin-g++.gmk @ 1352

Last change on this file since 1352 was 1349, checked in by garnier, 14 years ago

update

File size: 4.2 KB
Line 
1#
2# ------ MacOS-X ------
3#                                 MacOS 10.6 gcc-4.2
4#
5# Original author: Helmut Burkhardt - CERN
6#       Revisions: Guy Barrand - LAL
7#                  Gabriele Cosmo - CERN
8#                  Laurent Garnier - LAL
9#
10ifeq ($(G4SYSTEM),Darwin-g++)
11  CXX       := g++
12  CXXFLAGS  := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
13# CXXFLAGS  += -Wunused-parameter -Winline -Wunreachable-code
14  CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
15  ifdef G4OPTIMISE
16    CXXFLAGS  += -O2
17    FCFLAGS   := -O2
18    CCFLAGS   := -O2
19  else
20    ifdef G4DEBUG
21      CXXFLAGS  += -g
22      FCFLAGS   := -g
23      CCFLAGS   := -g
24    endif
25  endif
26  ifdef G4PROFILE
27    CXXFLAGS  += -pg
28    FCFLAGS   += -pg
29    CCFLAGS   += -pg
30  endif
31  ifdef G4OPTDEBUG
32    CXXFLAGS  += -O2 -g
33    FCFLAGS   += -O2 -g
34    CCFLAGS   += -O2 -g
35  endif
36  FC := gfortran
37  FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
38  LDFLAGS += -bind_at_load -arch_multiple
39  FCLIBS := -lg2c -lnsl
40  SHEXT   := dylib
41  ifndef X11FLAGS
42    X11FLAGS  := -I/usr/include/X11/extensions -I/usr/include/X11
43  endif
44  ifndef X11LIBS
45    X11LIBS   := -L/usr/X11R6/lib  -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE
46  endif
47  ifndef XMFLAGS
48    XMFLAGS   := -I/sw/include
49#   XMFLAGS   := -I/usr/X11R6/include          ##### some installations.
50  endif
51  ifndef XMLIBS
52    XMLIBS    := -L/sw/lib -lXm -lXpm
53#   XMLIBS    := -L/usr/X11R6/lib -lXm -lXpm   ##### some installations.
54  endif
55  ifndef XAWFLAGS
56    XAWFLAGS   := -I/sw/include
57#   XAWFLAGS   := -I/usr/X11R6/include         ##### some installations.
58  endif
59  ifndef XAWLIBS
60    XAWLIBS    := -lXaw
61  endif
62  DLDLIBS   := -ldl
63  ifndef OGLHOME
64    OGLHOME  := /usr/X11R6
65#   OGLHOME  := /System/Library/Frameworks/OpenGL.framework
66  endif
67  ifndef OGLFLAGS
68    OGLFLAGS  := -I$(OGLHOME)/include
69#   OGLFLAGS := -I$(OGLHOME)/Headers
70  endif
71  ifndef OGLLIBS
72    QTGLPATH  := $(shell test -f /System/Library/Frameworks/OpenGL.framework/OpenGL && echo "/System/Library/Frameworks/OpenGL.framework")
73    ifeq ($(QTGLPATH),/System/Library/Frameworks/OpenGL.framework)
74      DARWIN_VERSION = $(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/')
75      ifeq ($(DARWIN_VERSION),9)
76        # the following lines are for building on MacOSX 10.5 "Leopard"
77        OGLLIBS := -Wl,$(QTGLPATH)/Versions/A/Libraries/libGL.dylib -L$(OGLHOME)/lib -lGLU -lGL
78      else
79        ifeq ($(DARWIN_VERSION),10)
80          # the following lines are for building on MacOSX > 10.5
81          OGLLIBS := -F/System/Library/Frameworks -framework OpenGL -framework AGL
82          ifeq ($(G4VIS_USE_OPENGLX),1)
83            OGLLIBS += -L$(OGLHOME)/lib -lGLU -lGL
84          endif
85        endif
86      endif
87    else
88      OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
89    endif
90  endif
91
92# ---- QT Setup block -------------------------------------------------------
93
94  ifndef QTHOME
95    QTHOME := /Library/Frameworks
96  endif
97  ifndef QTMOC
98    ifeq ($(QTHOME),/Library/Frameworks)
99      QTMOC      := /usr/bin/moc
100    else
101      QTMOC      := $(QTHOME)/bin/moc
102    endif
103  endif
104  ifndef QTFLAGS
105    QTFLAGS   := -I $(QTHOME)/QtCore.framework/Headers
106    QTFLAGS   += -I $(QTHOME)/QtGui.framework/Headers
107    QTFLAGS   += -I $(QTHOME)/QtOpenGL.framework/Headers
108    QTFLAGS   += -I $(QTHOME)/include/Qt -I$(QTHOME)/include
109  endif
110  ifndef QTLIBPATH
111    ifeq ($(QTHOME),/Library/Frameworks)
112      QTLIBPATH  := -F$(QTHOME)
113    else
114      QTLIBPATH  := -F$(QTHOME)/lib
115    endif
116  endif
117  ifndef QTLIBS
118    QTLIBS    := $(QTLIBPATH) -framework QtCore -framework QtGui
119  endif
120  ifndef GLQTLIBS
121    GLQTLIBS    := $(QTLIBPATH) -framework QtCore -framework QtGui
122    GLQTLIBS    += -framework QtOpenGL
123  endif
124
125#----------------------------------------------------------------------------
126
127  define build-granular-shared-lib
128    @libdir=`(cd $(@D);/bin/pwd)`; \
129     cd $(G4TMPDIR); \
130     $(CXX)  -dynamiclib -single_module  -lgcov -undefined dynamic_lookup \
131         -o $$libdir/$(@F) $(INTYLIBS) *.o
132  endef
133  define build-global-shared-lib
134    @libdir=`(cd $(@D);/bin/pwd)`; \
135     cd $(G4TMP)/$(G4SYSTEM); \
136     $(CXX)  -dynamiclib -single_module  -lgcov -undefined dynamic_lookup \
137         -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
138  endef
139
140endif
Note: See TracBrowser for help on using the repository browser.