# # ------ MacOS-X ------ # MacOS 10.3 gcc-3.3 # MacOS 10.4 gcc-4.0 # # Original author: Helmut Burkhardt - CERN # Revisions: Guy Barrand - LAL # Gabriele Cosmo - CERN # ifeq ($(G4SYSTEM),Darwin-g++) CXX := g++ CXXFLAGS := -Wall -ansi -pedantic -Wno-non-virtual-dtor -Wno-long-long CXXFLAGS += -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -pipe ifdef G4OPTIMISE CXXFLAGS += -O2 FCFLAGS := -O2 CCFLAGS := -O2 else ifdef G4DEBUG CXXFLAGS += -g FCFLAGS := -g CCFLAGS := -g endif endif ifdef G4PROFILE CXXFLAGS += -pg FCFLAGS += -pg CCFLAGS += -pg endif FC := gfortran FCFLAGS += -fno-automatic -fno-backslash -fno-second-underscore LDFLAGS += -bind_at_load FCLIBS := -lg2c -lnsl SHEXT := dylib ifndef X11FLAGS X11FLAGS := -I/usr/include/X11/extensions -I/usr/include/X11 endif ifndef X11LIBS X11LIBS := -L/usr/X11R6/lib -lXmu -lXt -lXext -lX11 -lXi -lSM -lICE endif ifndef XMFLAGS XMFLAGS := -I/sw/include # XMFLAGS := -I/usr/X11R6/include ##### some installations. endif ifndef XMLIBS XMLIBS := -L/sw/lib -lXm -lXpm # XMLIBS := -L/usr/X11R6/lib -lXm -lXpm ##### some installations. endif ifndef XAWFLAGS XAWFLAGS := -I/sw/include # XAWFLAGS := -I/usr/X11R6/include ##### some installations. endif ifndef XAWLIBS XAWLIBS := -lXaw endif DLDLIBS := -ldl ifndef OGLHOME OGLHOME := /usr/X11R6 endif ifndef OGLFLAGS OGLFLAGS := -I$(OGLHOME)/include endif ifndef OGLLIBS OGLLIBS := -L$(OGLHOME)/lib -lGLU -lGL # It may be required to uncomment the following lines for building on MacOSX 10.5 "Leopard" # OGLLIBS += -dylib_file \ # /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:\ # /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib endif ifndef QTHOME QTHOME := /sw endif QT_VERSION := $(shell test -f $(QTHOME)/Qt3Support.framework/Qt3Support && echo QT3 || echo QT4) ifndef QTFLAGS ifeq ($(QT_VERSION),QT4) QTFLAFG := "-I ${QTHOME}/QtCore.framework/Headers " QTFLAFG += "-I ${QTHOME}/QtGui.framework/Headers " QTFLAFG += "-I ${QTHOME}/QtOpenGL.framework/Headers " QTFLAFG += "-I ${QTHOME}/QtSql.framework/Headers " QTFLAFG += "-I ${QTHOME}/QtXml.framework/Headers " else QTFLAGS := -I$(QTHOME)/include/Qt -I$(QTHOME)/include endif endif ifndef QTMOC ifeq ($(QT_VERSION),QT4) QTMOC := /usr/bin/moc else QTMOC := $(QTHOME)/bin/moc endif endif ifndef QTLIBS ifeq ($(QT_VERSION),QT3) QTLIBS := -L$(QTHOME)/lib -lqt -lqui else QTLIBS := -F$(QTHOME) -framework QtCore -framework QtGui QTLIBS += -framework QtSql -framework QtXml endif endif ifndef GLQTLIBS ifeq ($(QT_VERSION),QT3) GLQTLIBS := -L$(QTHOME)/lib -lqt -lqui else GLQTLIBS := -F$(QTHOME) -framework QtCore -framework QtGui GLQTLIBS += -framework QtOpenGL -framework QtSql -framework QtXml endif endif define build-granular-shared-lib @libdir=`(cd $(@D);/bin/pwd)`; \ cd $(G4TMPDIR); \ g++ -dynamiclib -single_module -undefined dynamic_lookup \ -o $$libdir/$(@F) $(INTYLIBS) *.o endef define build-global-shared-lib @libdir=`(cd $(@D);/bin/pwd)`; \ cd $(G4TMP)/$(G4SYSTEM); \ g++ -dynamiclib -single_module -undefined dynamic_lookup \ -o $$libdir/$(@F) $(INTYLIBS) $(foreach dir,$(SUBLIBS),$(dir)/*.o); endef endif