]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
modification for MacOSX 1.4
authoralibrary <alibrary@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 May 2005 16:48:29 +0000 (16:48 +0000)
committeralibrary <alibrary@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 19 May 2005 16:48:29 +0000 (16:48 +0000)
ALIROOT/binaliroot.pkg
build/Makefile.macosx
build/module.tpl

index cad303464632e64db4e53b987da9b961f29899bf..084037c064965544d67f40b510d34bb7ab8ae28d 100644 (file)
@@ -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.
index 053ac034a2c8c71f16216904c46dd2e6be5f6042..c8e42706c0259ab981a8a25bc749afd54ed98dfc 100644 (file)
@@ -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 
 
index 5bf0a24e024e603ea743f132cb56e4f89ad47949..efcdfe7b14f36bab1aeeb8eee796a6be2bace12e 100644 (file)
@@ -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