Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/config/sys/Darwin-g++.gmk is written in an unsupported language. File is not indexed.

0001 #
0002 # ------ macOS ------
0003 #                                 macOS, gcc-9.3 and higher
0004 #
0005 # Original author: Helmut Burkhardt - CERN
0006 #       Revisions: Guy Barrand - LAL
0007 #                  Gabriele Cosmo - CERN
0008 #                  Laurent Garnier - LAL
0009 #
0010 ifeq ($(G4SYSTEM),Darwin-g++)
0011   CXX       := g++
0012   CXXFLAGS  := -Wall -Wno-non-virtual-dtor -Wno-long-long
0013   CXXFLAGS  += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual
0014   CXXFLAGS  += -Wno-variadic-macros -Wshadow -pipe
0015   CXXFLAGS  += -fno-trapping-math -ftree-vectorize -fno-math-errno
0016   CPPFLAGS  += -DGL_SILENCE_DEPRECATION
0017   CPPFLAGS  += -std=c++17
0018   CXXFLAGS  += -std=c++17
0019 # CXXFLAGS  += -stdlib=libstdc++
0020   G4USE_STD17 := 1
0021   ifdef G4MULTITHREADED
0022     CXXFLAGS += -ftls-model=initial-exec -pthread
0023   endif
0024   ifdef G4OPTIMISE
0025     CXXFLAGS  += -O3
0026     FCFLAGS   := -O3
0027     CCFLAGS   := -O3
0028   else
0029     ifdef G4DEBUG
0030       CXXFLAGS  += -g
0031       FCFLAGS   := -g
0032       CCFLAGS   := -g
0033     endif
0034   endif
0035   ifdef G4PROFILE
0036     CXXFLAGS  += -pg
0037     FCFLAGS   += -pg
0038     CCFLAGS   += -pg
0039   endif
0040   ifdef G4OPTDEBUG
0041     CXXFLAGS  += -O2 -g
0042     FCFLAGS   += -O2 -g
0043     CCFLAGS   += -O2 -g
0044   endif
0045   ifdef G4LIB_BUILD_SHARED
0046     CXXFLAGS  += -fPIC
0047     FCFLAGS   += -fPIC
0048     CCFLAGS   += -fPIC
0049   endif
0050   G4RUNPATHOPTION := -Wl,-rpath, 
0051 #  G4STATIC_MODE += -Wl,-force_load
0052   FC := gfortran
0053   FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore
0054   LDFLAGS += -bind_at_load
0055   FCLIBS := -lg2c -lnsl
0056   SHEXT   := dylib
0057   LOADLIBS += -lm
0058   ifndef X11FLAGS
0059     X11FLAGS  := -I/usr/X11/include
0060   endif
0061   ifndef X11LIBS
0062     X11LIBS   := -L/usr/X11/lib  -lXmu -lXt -lXext -lX11 -lSM -lICE
0063   endif
0064   ifndef XMFLAGS
0065     XMFLAGS   := -I/usr/local/include
0066 #   XMFLAGS   := -I/usr/X11/include          ##### some installations.
0067   endif
0068   ifndef XMLIBS
0069     XMLIBS    := -L/usr/local/lib -lXm -lXpm
0070 #   XMLIBS    := -L/usr/X11/lib -lXm -lXpm   ##### some installations.
0071   endif
0072   ifndef XAWFLAGS
0073     XAWFLAGS   := -I/usr/local/include
0074 #   XAWFLAGS   := -I/usr/X11/include         ##### some installations.
0075   endif
0076   ifndef XAWLIBS
0077     XAWLIBS    := -lXaw
0078   endif
0079   DLDLIBS   := -ldl
0080   ifndef OGLHOME
0081     OGLHOME  := /usr/X11
0082 #   OGLHOME  := /System/Library/Frameworks/OpenGL.framework
0083   endif
0084   ifndef OGLFLAGS
0085     OGLFLAGS  := -I$(OGLHOME)/include 
0086 #   OGLFLAGS := -I$(OGLHOME)/Headers 
0087   endif
0088   ifndef OGLLIBS
0089     OGLPATH  := $(shell test -f /Library/Frameworks/OpenGL.framework/OpenGL && echo "/Library/Frameworks/OpenGL.framework")
0090     ifneq ($(OGLPATH),/Library/Frameworks/OpenGL.framework)
0091       OGLPATH  := $(shell test -f /System/Library/Frameworks/OpenGL.framework/OpenGL && echo "/System/Library/Frameworks/OpenGL.framework")
0092     endif
0093     ifneq ($(OGLPATH),)
0094       OGLLIBS := -F$(OGLPATH)/.. -framework OpenGL -framework AGL 
0095     else
0096       OGLLIBS := -L$(OGLHOME)/lib -lGL
0097     endif
0098   endif
0099   ifndef OGLLIBS
0100     OGLPATH  := $(shell test -f /Library/Frameworks/OpenGL.framework/OpenGL && echo "/Library/Frameworks/OpenGL.framework")
0101     ifneq ($(OGLPATH),/Library/Frameworks/OpenGL.framework)
0102       OGLPATH  := $(shell test -f /System/Library/Frameworks/OpenGL.framework/OpenGL && echo "/System/Library/Frameworks/OpenGL.framework")
0103     endif
0104     ifneq ($(OGLPATH),)
0105       DARWIN_VERSION = $(shell uname -r | sed 's/\([0-9]*\).[0-9]*.[0-9]*/\1/')
0106       ifeq ($(DARWIN_VERSION),9)
0107         # the following lines are for building on MacOSX 10.5 "Leopard"
0108         OGLLIBS := -Wl,$(OGLPATH)/Libraries/libGL.dylib -L$(OGLHOME)/lib -lGL
0109       else
0110         # the following lines are for building on MacOSX > 10.5
0111         OGLLIBS := -F$(OGLPATH)/.. -framework OpenGL -framework AGL 
0112       endif
0113     else
0114       OGLLIBS := -L$(OGLHOME)/lib -lGL
0115     endif
0116   endif
0117 
0118 # ---- Qt Setup block -------------------------------------------------------
0119 
0120   ifndef QTHOME
0121     QTHOME := /Library/Frameworks
0122   endif
0123   ifndef QT_VERSION
0124     QT_VERSION := 5
0125   endif
0126   ifeq ($(QTHOME),/Library/Frameworks)
0127     ifndef QTMOC
0128       QTMOC      := /usr/bin/moc
0129     endif
0130     ifndef QTFLAGS
0131       QTFLAGS   := -I $(QTHOME)/QtCore.framework/Headers
0132       QTFLAGS   += -I $(QTHOME)/QtGui.framework/Headers
0133       QTFLAGS   += -I $(QTHOME)/QtWidgets.framework/Headers
0134       QTFLAGS   += -I $(QTHOME)/QtOpenGL.framework/Headers
0135       QTFLAGS   += -I $(QTHOME)/Qt3DCore.framework/Headers
0136       QTFLAGS   += -I $(QTHOME)/Qt3DExtras.framework/Headers
0137       QTFLAGS   += -I $(QTHOME)/Qt3DRender.framework/Headers
0138       ifeq ($(QT_VERSION),6)
0139         QTFLAGS   += -I $(QTHOME)/QtOpenGLWidgets.framework/Headers
0140       endif
0141       QTFLAGS   += -I $(QTHOME)/include/Qt -I$(QTHOME)/include
0142     endif
0143     ifndef QTLIBPATH
0144       QTLPATH  := $(QTHOME)
0145     endif
0146     QTLIBPATH  := -F$(QTLPATH)
0147     QT_AS_FRAMEWORK := $(shell test -d $(QTLPATH)/QtCore.framework && echo yes)
0148     ifndef QTLIBS
0149       ifdef QT_AS_FRAMEWORK
0150         QTLIBS    := $(QTLIBPATH) -framework QtCore -framework QtGui
0151       else
0152         QTLIBS    := -L$(QTLPATH) -lQtCore -lQtGui
0153       endif   
0154     endif
0155     ifndef QT3DLIBS
0156       ifdef QT_AS_FRAMEWORK
0157         QT3DLIBS  := $(QTLIBPATH) -framework QtCore -framework QtGui
0158         QT3DLIBS  += -framework QtWidgets -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender
0159       else
0160         QT3DLIBS  := -L$(QTLPATH) -lQtCore -lQtGui
0161         QT3DLIBS  += -lQtWidgets -lQt3DCore -lQt3DExtras -lQt3DRender
0162       endif   
0163     endif
0164     ifndef GLQTLIBS  
0165       ifdef QT_AS_FRAMEWORK
0166         GLQTLIBS  := $(QTLIBPATH) -framework QtCore -framework QtGui -framework QtOpenGL
0167         ifeq ($(QT_VERSION),6)
0168           GLQTLIBS += -framework QtOpenGLWidgets
0169         endif
0170       else
0171         GLQTLIBS  := -L$(QTLPATH) -lQtCore -lQtGui -lQtOpenGL
0172         ifeq ($(QT_VERSION),6)
0173           GLQTLIBS += -lQtOpenGLWidgets
0174         endif
0175       endif   
0176     endif
0177   else
0178     ifndef QTMOC
0179       QTMOC      := $(QTHOME)/bin/moc
0180     endif
0181     QTLPATH  := $(QTHOME)/lib
0182     ifndef QTFLAGS
0183       QTFLAGS   := -I $(QTLPATH)/QtCore.framework/Headers 
0184       QTFLAGS   += -I $(QTLPATH)/QtGui.framework/Headers 
0185       QTFLAGS   += -I $(QTLPATH)/QtWidgets.framework/Headers
0186       QTFLAGS   += -I $(QTLPATH)/QtOpenGL.framework/Headers
0187       QTFLAGS   += -I $(QTLPATH)/Qt3DCore.framework/Headers
0188       QTFLAGS   += -I $(QTLPATH)/Qt3DExtras.framework/Headers
0189       QTFLAGS   += -I $(QTLPATH)/Qt3DRender.framework/Headers
0190       ifeq ($(QT_VERSION),6)
0191         QTFLAGS   += -I $(QTHOME)/QtOpenGLWidgets.framework/Headers
0192       endif
0193       QTFLAGS   += -I $(QTHOME)/include/Qt -I$(QTHOME)/include
0194     endif
0195     ifndef QTLIBS
0196        QTLIBS    := -F$(QTLPATH) -framework QtCore -framework QtGui
0197        QTLIBS    += -framework QtWidgets
0198     endif   
0199     ifndef QT3DLIBS
0200        QT3DLIBS    := -F$(QTLPATH) -framework QtCore -framework QtGui
0201        QT3DLIBS    += -framework QtWidgets
0202        QT3DLIBS    += -framework Qt3DCore -framework Qt3DExtras -framework Qt3DRender
0203     endif   
0204     ifndef GLQTLIBS  
0205       GLQTLIBS    := -F$(QTLPATH) -framework QtCore -framework QtGui
0206       GLQTLIBS    += -framework QtWidgets
0207       GLQTLIBS    += -framework QtOpenGL
0208       ifeq ($(QT_VERSION),6)
0209         GLQTLIBS  += -framework QtOpenGLWidgets
0210       endif
0211     endif   
0212   endif
0213 
0214 #------ Wt Setup block ------------------------------------------------------
0215 
0216   ifndef WTHOME
0217     WTHOME := /usr
0218   endif
0219   WTFLAGS := -I$(WTHOME)/include/boost -I$(WTHOME)/include -DQT_NO_KEYWORDS 
0220   WTLIBS  := -L$(WTHOME)/lib -lwt -lwtext -lwthttp  -lboost_signals  -L/usr/lib -lz -lssl -lcrypto
0221 
0222 #----------------------------------------------------------------------------
0223 
0224   define build-granular-shared-lib
0225     @libdir=`(cd $(@D);/bin/pwd)`; \
0226      cd $(G4TMPDIR); \
0227      $(CXX) -Wl,-w -dynamiclib -single_module -undefined dynamic_lookup \
0228          -o $$libdir/$(@F) $(INTYLIBS) *.o
0229   endef
0230   define build-global-shared-lib
0231     @libdir=`(cd $(@D);/bin/pwd)`; \
0232      cd $(G4TMP)/$(G4SYSTEM); \
0233      $(CXX) -Wl,-w -dynamiclib -single_module -undefined dynamic_lookup \
0234          -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o);
0235   endef
0236 
0237 endif