From f3564e28e8f9245422de67a787eec8433f5c2cf7 Mon Sep 17 00:00:00 2001 From: alibrary Date: Thu, 19 May 2005 16:48:29 +0000 Subject: [PATCH] modification for MacOSX 1.4 --- ALIROOT/binaliroot.pkg | 2 +- build/Makefile.macosx | 43 +++++++++++++++++++++++++++++++++--------- build/module.tpl | 8 ++++++++ 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/ALIROOT/binaliroot.pkg b/ALIROOT/binaliroot.pkg index cad30346463..084037c0649 100644 --- a/ALIROOT/binaliroot.pkg +++ b/ALIROOT/binaliroot.pkg @@ -27,7 +27,7 @@ ifeq (macosx,$(ALICE_TARGET)) PACKLDFLAGS:=$(LDFLAGS) $(@PACKAGE@LIBSINIT:%=-Wl,-u,_G__cpp_setupG__%) # On Mac OS X gcc we need g2c ELIBS+=g2c - +ELIBSDIR+=$(dir $(shell find $(FINK_ROOT) -name 'libg2c.*')) endif # The two variables below are used for the creation of profile target. diff --git a/build/Makefile.macosx b/build/Makefile.macosx index 053ac034a2c..c8e42706c02 100644 --- a/build/Makefile.macosx +++ b/build/Makefile.macosx @@ -1,10 +1,26 @@ # Makefile for AliRoot for MacOS X with gcc +# OS version +MACOSX_MAJOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1)) +MACOSX_MINOR := $(strip $(shell sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2)) + +# fink directories +FINK_ROOT := $(shell which fink | sed -e 's?/bin/fink??') + # The compilers CXX = g++ -F77 = g77 CC = gcc +ifneq ($(MACOSX_MINOR),4) +F77 = g77 +else +ifeq (g95,$(findstring g95,$(ROOTBUILD))) +F77 = g95 +else +F77 = gfortran +endif +endif + # Global optimisation OPT = -O0 -g NOOPT = -g @@ -21,9 +37,9 @@ CLIBCOPT = CLIBFOPT = $(CLIBDEFS) # Compiler flags -CXXFLAGS = $(CXXOPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -I/sw/include -Wno-long-double #-Weffc++ -Woverloaded-virtual -CXXFLAGSNO = $(CXXNOOPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -I/sw/include -Wno-long-double -CFLAGS = $(COPT) -Wall -W -fno-common -fweak-coalesced -pipe -I/sw/include +CXXFLAGS = $(CXXOPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -I$(FINK_ROOT)/include -Wno-long-double #-Weffc++ -Woverloaded-virtual +CXXFLAGSNO = $(CXXNOOPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced -fmessage-length=0 -I$(FINK_ROOT)/include -Wno-long-double +CFLAGS = $(COPT) -Wall -W -fno-common -fweak-coalesced -pipe -I$(FINK_ROOT)/include FFLAGS = $(CLIBFOPT) $(FOPT) # rmkdepend flags for building dependencies of FORTRAN files DEPENDFFLAGS = $(FFLAGS) @@ -31,19 +47,19 @@ DEPENDFFLAGS = $(FFLAGS) # rootcint flags CINTFLAGS = -LD = export MACOSX_DEPLOYMENT_TARGET=10.3 ; \ +LD = export MACOSX_DEPLOYMENT_TARGET=$(MACOSX_MAJOR).$(MACOSX_MINOR) ; \ unset LD_PREBIND ; \ g++ LDFLAGS = $(OPT) $(DICTLOAD) SHLD := $(LD) SOFLAGS := -bundle -undefined dynamic_lookup -SHLIB := -L/sw/lib -lg2c +SHLIB := SOEXT := so DYLD := $(LD) DYFLAGS = -dynamiclib -undefined dynamic_lookup -single_module -DYLIB := -L/sw/lib -lg2c +DYLIB := DYEXT := dylib ALLD = ar @@ -55,8 +71,17 @@ DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys GLIBS = -L/usr/X11R6/lib -lX11 +EXEFLAGS += -bind_at_load + #System libraries -SYSLIBS = -ldl +ifneq ($(MACOSX_MINOR),4) +SYSLIBS := -lg2c +else +ifeq (g95,$(findstring g95,$(ROOTBUILD))) +SYSLIBS := -L$(dir $(shell find $(FINK_ROOT) -name libf95.a)) -lf95 +else +SYSLIBS := -ldl -L$(dir $(shell find $(FINK_ROOT) -name libgfortran.dylib)) -lgfortranbegin -lgfortran +endif +endif -EXEFLAGS+= -bind_at_load diff --git a/build/module.tpl b/build/module.tpl index 5bf0a24e024..efcdfe7b14f 100644 --- a/build/module.tpl +++ b/build/module.tpl @@ -185,6 +185,13 @@ endif #------------------------------------------------------------------------ +ifeq ($(MACOSX_MINOR),4) +$(@PACKAGE@LIB): $(@PACKAGE@DLIB) $(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk +ifndef ALIQUIET + @echo "***** Linking library $@ *****" +endif + $(MUTE)rm -f $@; cd $(dir $@); ln -s $(notdir $(@PACKAGE@DLIB)) $(notdir $@) +else $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk ifndef ALIQUIET @echo "***** Linking library $@ *****" @@ -197,6 +204,7 @@ endif $(SHLD) $(@PACKAGE@SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\ chmod a-w $(CURDIR)/$@ ;\ cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR +endif ifneq ($(DYEXT),) $(@PACKAGE@DLIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk -- 2.39.3