From 40c469d5c23e06f43cdac779e8827495a5d40cbb Mon Sep 17 00:00:00 2001 From: hristov Date: Thu, 27 Mar 2003 15:17:52 +0000 Subject: [PATCH] Introducing Mac OSX platform (Darwin) --- .rootrc | 2 +- build/Makefile.Darwin | 64 +++++++++++++++++++++++++++++++++++++++++++ build/module.tpl | 34 +++++++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 build/Makefile.Darwin diff --git a/.rootrc b/.rootrc index 7c1e9aecfb2..645694575a8 100644 --- a/.rootrc +++ b/.rootrc @@ -5,7 +5,7 @@ # Path used by dynamic loader to find shared libraries and macros # Paths are different for Unix and Windows. The example shows the defaults # for all ROOT applications for either Unix or Windows. -Unix.*.Root.DynamicPath: .:$(ROOTSYS)/lib +Unix.*.Root.DynamicPath: .:$(ROOTSYS)/lib:$(DYLD_LIBRARY_PATH) Unix.*.Root.MacroPath: .:$(ROOTSYS)/macros:$(ALICE_ROOT)/macros WinNT.*.Root.DynamicPath: ./;$(ROOTSYS);$(ROOTSYS)/bin;$(PATH) WinNT.*.Root.MacroPath: ./;$(ROOTSYS)/macros diff --git a/build/Makefile.Darwin b/build/Makefile.Darwin new file mode 100644 index 00000000000..7636b356537 --- /dev/null +++ b/build/Makefile.Darwin @@ -0,0 +1,64 @@ +PLATFORM:=Darwin + +# The compilers +CXX = g++ +F77 = g77 +CC = gcc + +# Global optimisation +OPT = -O -g + +CXXOPTS = $(OPT) -Wall -W -pipe -fsigned-char -fno-common -fweak-coalesced +COPT = $(OPT) -Wall -W -fno-common -fweak-coalesced +FOPT = $(OPT) -fno-second-underscore -fweak-coalesced +CXXFLAGS = $(CXXOPTS) -I/sw/include +CFLAGS = -Wall -pipe + +# rootcint flags +CINTFLAGS = #$(CXXFLAGS) + +# CERNLIB defines + +CLIBDEFS = -DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ +CLIBCXXOPTS = +CLIBCOPT = +CLIBFOPT = + +# Common Fortran compilation flags +FFLAGS = $(CLIBFOPT) $(CLIBDEFS) $(FOPT) + +LD = export MACOSX_DEPLOYMENT_TARGET=10.2 ; g++ +LDFLAGS = $(OPT) + +SHLD := $(LD) +SOFLAGS := -bundle -flat_namespace -undefined suppress +SHLIB := -lg2c +SHLIB := +SOEXT := so + +DYLD := $(LD) +DYFLAGS = -dynamiclib -flat_namespace -undefined suppress -single_module +DYLIB := +DYEXT := dylib + +ALLD = ar +ALFLAGS = cr +ALLIB = +AEXT = a + + +# rmkdepend flags for building dependencies of FORTRAN files +DEPENDFFLAGS = $(FFLAGS) + +DEPENDCXXFLAGS = $(CXXFLAGS) -I/usr/include/sys + +GLIBS = -L/usr/X11R6/lib -lX11 + +#System libraries +SYSLIBS = -ldl + +EXEFLAGS+= -Xlinker -bind_at_load -Xlinker -m -lg2c + + + + diff --git a/build/module.tpl b/build/module.tpl index e1c821b6be5..e549cc55996 100644 --- a/build/module.tpl +++ b/build/module.tpl @@ -102,11 +102,19 @@ endif #The actual library file @PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT) + +ifneq ($(DYEXT),) +@PACKAGE@DLIB:=$(LIBPATH)/lib@PACKAGE@.$(DYEXT) +endif + @PACKAGE@ALIB:=$(LIBPATH)/lib@PACKAGE@.$(AEXT) #Add this to the modules libs @MODULE@LIBS += $(@PACKAGE@LIB) @MODULE@ALIBS += $(@PACKAGE@ALIB) +ifneq ($(DYEXT),) +@MODULE@DLIBS += $(@PACKAGE@DLIB) +endif #The actual binary file @@ -120,11 +128,20 @@ endif ifeq ($(TYPE),lib) ALLLIBS += $(@PACKAGE@LIB) ALLALIBS += $(@PACKAGE@ALIB) +ifneq ($(DYEXT),) +ALLLIBS += $(@PACKAGE@DLIB) +endif BINLIBS += -l@PACKAGE@ else ALLEXECS += $(@PACKAGE@BIN) endif +ifeq ($(DYEXT),) +@PACKAGE@LIB := $(@PACKAGE@LIB) +else +@PACKAGE@LIB := $(@PACKAGE@LIB) +endif + # include all dependency files INCLUDEFILES +=$(@PACKAGE@DEP) @@ -157,6 +174,20 @@ endif cd $(CURDIR) ; rm -rf $$TMPDIR $(MUTE)chmod a-w $@ +ifneq ($(DYEXT),) +$(@PACKAGE@DLIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk +ifndef ALIQUIET + @echo "***** Linking library $@ *****" +endif + $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \ + export TMPDIR; mkdir $$TMPDIR ; cd $$TMPDIR ; \ + find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\ + rm -f $(CURDIR)/$@ ;\ + $(DYLD) $(@PACKAGE@DYFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(DYLIB); + $(MUTE)chmod a-w $(CURDIR)/$@ ;\ + rm -rf $$TMPDIR +endif + $(@PACKAGE@ALIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk ifndef ALIQUIET @echo "***** Linking static library $@ *****" @@ -198,6 +229,9 @@ endif ifeq ($(TYPE),lib) all-@PACKAGE@: $(@PACKAGE@LIB) +ifneq ($(DYEXT),) +all-@PACKAGE@: $(@PACKAGE@DLIB) +endif else all-@PACKAGE@: $(@PACKAGE@BIN) endif -- 2.31.1