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
RevLine 
[472]1#
2# ------ MacOS-X ------
[1349]3#                                 MacOS 10.6 gcc-4.2
[472]4#
5# Original author: Helmut Burkhardt - CERN
6#       Revisions: Guy Barrand - LAL
7#                  Gabriele Cosmo - CERN
[875]8#                  Laurent Garnier - LAL
[472]9#
10ifeq ($(G4SYSTEM),Darwin-g++)
11  CXX       := g++
12  CXXFLAGS  := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long
[1185]13# CXXFLAGS  += -Wunused-parameter -Winline -Wunreachable-code
14  CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe
[472]15  ifdef G4OPTIMISE
[1185]16    CXXFLAGS  += -O2
17    FCFLAGS   := -O2
18    CCFLAGS   := -O2
[472]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
[1185]31  ifdef G4OPTDEBUG
32    CXXFLAGS  += -O2 -g
33    FCFLAGS   += -O2 -g
34    CCFLAGS   += -O2 -g
35  endif
[689]36  FC := gfortran
[472]37  FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
[1185]38  LDFLAGS += -bind_at_load -arch_multiple
[472]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
[1337]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
[472]62  DLDLIBS   := -ldl
63  ifndef OGLHOME
64    OGLHOME  := /usr/X11R6
[1349]65#   OGLHOME  := /System/Library/Frameworks/OpenGL.framework
[472]66  endif
67  ifndef OGLFLAGS
68    OGLFLAGS  := -I$(OGLHOME)/include
[1349]69#   OGLFLAGS := -I$(OGLHOME)/Headers
[472]70  endif
71  ifndef OGLLIBS
[1349]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
[886]87    else
[1349]88      OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL
[886]89    endif
[472]90  endif
[893]91
92# ---- QT Setup block -------------------------------------------------------
[1349]93
[758]94  ifndef QTHOME
[1349]95    QTHOME := /Library/Frameworks
[758]96  endif
[875]97  ifndef QTMOC
[1349]98    ifeq ($(QTHOME),/Library/Frameworks)
99      QTMOC      := /usr/bin/moc
[865]100    else
[1349]101      QTMOC      := $(QTHOME)/bin/moc
[865]102    endif
[758]103  endif
[1349]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
[868]110  ifndef QTLIBPATH
[1349]111    ifeq ($(QTHOME),/Library/Frameworks)
112      QTLIBPATH  := -F$(QTHOME)
[868]113    else
[1349]114      QTLIBPATH  := -F$(QTHOME)/lib
[868]115    endif
116  endif
[758]117  ifndef QTLIBS
[1349]118    QTLIBS    := $(QTLIBPATH) -framework QtCore -framework QtGui
[766]119  endif
120  ifndef GLQTLIBS
[1349]121    GLQTLIBS    := $(QTLIBPATH) -framework QtCore -framework QtGui
122    GLQTLIBS    += -framework QtOpenGL
[758]123  endif
[1349]124
[893]125#----------------------------------------------------------------------------
[472]126
127  define build-granular-shared-lib
[1017]128    @libdir=`(cd $(@D);/bin/pwd)`; \
[472]129     cd $(G4TMPDIR); \
[921]130     $(CXX)  -dynamiclib -single_module  -lgcov -undefined dynamic_lookup \
[472]131         -o $$libdir/$(@F) $(INTYLIBS) *.o
132  endef
133  define build-global-shared-lib
134    @libdir=`(cd $(@D);/bin/pwd)`; \
135     cd $(G4TMP)/$(G4SYSTEM); \
[921]136     $(CXX)  -dynamiclib -single_module  -lgcov -undefined dynamic_lookup \
[472]137         -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
138  endef
139
140endif
Note: See TracBrowser for help on using the repository browser.