From bfff3a7100a8d2ccba501907809921098b9d20d6 Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Wed, 22 Feb 2012 13:03:56 +0000
Subject: [PATCH] Port to MacOS X 10.8 Mountain Lion.

git-svn-id: http://root.cern.ch/svn/root/trunk@43083 27541ba8-7e3a-0410-8455-c3a389f83636
---
 Makefile                  | 1 +
 cint/cint/Module.mk       | 8 ++++++++
 config/Makefile.in        | 1 +
 config/Makefile.macosx    | 7 +++++++
 config/Makefile.macosx64  | 7 +++++++
 config/Makefile.macosxicc | 6 ++++++
 configure                 | 2 ++
 graf2d/asimage/Module.mk  | 2 ++
 graf2d/x11/Module.mk      | 1 +
 graf3d/x3d/Module.mk      | 4 ++++
 net/auth/Module.mk        | 2 +-
 net/net/Module.mk         | 2 +-
 net/rpdutils/Module.mk    | 2 +-
 rootx/Module.mk           | 3 +++
 14 files changed, 45 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 5f577511233..c845a9ff46e 100644
--- a/Makefile
+++ b/Makefile
@@ -1337,6 +1337,7 @@ showbuild:
 	@echo "TABLE              = $(TABLE)"
 	@echo "XPMLIBDIR          = $(XPMLIBDIR)"
 	@echo "XPMLIB             = $(XPMLIB)"
+	@echo "X11INCDIR          = $(X11INCDIR)"
 	@echo "TTFFONTDIR         = $(TTFFONTDIR)"
 	@echo "OPENGLLIBDIR       = $(OPENGLLIBDIR)"
 	@echo "OPENGLULIB         = $(OPENGLULIB)"
diff --git a/cint/cint/Module.mk b/cint/cint/Module.mk
index e1c353a2010..b01d24f2362 100644
--- a/cint/cint/Module.mk
+++ b/cint/cint/Module.mk
@@ -161,6 +161,10 @@ ifeq ($(CLANG_MAJOR),3)
 CINTS2       := $(filter-out $(MODDIRSD)/libstrm.%,$(CINTS2))
 CINTS2       += $(MODDIRSD)/gcc4strm.cxx
 endif
+ifeq ($(CLANG_MAJOR),4)
+CINTS2       := $(filter-out $(MODDIRSD)/libstrm.%,$(CINTS2))
+CINTS2       += $(MODDIRSD)/gcc4strm.cxx
+endif
 ifeq ($(CXXCMD),xlC)
 ifeq ($(PLATFORM),macosx)
 CINTS2       := $(filter-out $(MODDIRSD)/libstrm.%,$(CINTS2))
@@ -192,6 +196,9 @@ MAKECINT     := bin/makecint$(EXEEXT)
 ##### iosenum.h #####
 IOSENUM      := $(call stripsrc,$(MODDIR)/include/iosenum.h)
 IOSENUMC     := $(CINTDIRIOSEN)/iosenum.cxx
+ifeq ($(CLANG_MAJOR),4)
+IOSENUMA     := $(CINTDIRIOSEN)/iosenum.$(ARCH)3
+else
 ifeq ($(CLANG_MAJOR),3)
 IOSENUMA     := $(CINTDIRIOSEN)/iosenum.$(ARCH)3
 else
@@ -209,6 +216,7 @@ endif
 endif
 endif
 endif
+endif
 
 # used in the main Makefile
 ALLHDRS     += $(CINTHT)
diff --git a/config/Makefile.in b/config/Makefile.in
index 9ca5a7f9485..b5e33dd6f30 100644
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -51,6 +51,7 @@ TUTDIR         := @tutdir@
 ACLOCALDIR     := @aclocaldir@
 
 BUILDX11       := @buildx11@
+X11INCDIR      := $(filter-out /usr/include, @x11incdir@)
 X11LIBDIR      := @x11libdir@
 XPMLIBDIR      := @xpmlibdir@
 XPMLIB         := @xpmlib@
diff --git a/config/Makefile.macosx b/config/Makefile.macosx
index 2d4ec42f60b..10d5504d2de 100644
--- a/config/Makefile.macosx
+++ b/config/Makefile.macosx
@@ -144,6 +144,13 @@ FINK_CFLAGS   := $(shell [ -d $(FINK_DIR)/include ] && echo -I$(FINK_DIR)/includ
 FINK_LDFLAGS  := $(shell [ -d $(FINK_DIR)/lib ] && echo -L$(FINK_DIR)/lib)
 endif
 
+ifeq ($(MACOSX_MINOR),7)
+MACOSX_SSL_DEPRECATED = yes
+endif
+ifeq ($(MACOSX_MINOR),8)
+MACOSX_SSL_DEPRECATED = yes
+endif
+
 ifeq ($(CONFIGURE),yes)
 showcxx:
 	@echo "$(CXX)"
diff --git a/config/Makefile.macosx64 b/config/Makefile.macosx64
index 7b961cb4ea6..f10e3bf23dc 100644
--- a/config/Makefile.macosx64
+++ b/config/Makefile.macosx64
@@ -129,6 +129,13 @@ FINK_CFLAGS   := $(shell [ -d $(FINK_DIR)/include ] && echo -I$(FINK_DIR)/includ
 FINK_LDFLAGS  := $(shell [ -d $(FINK_DIR)/lib ] && echo -L$(FINK_DIR)/lib)
 endif
 
+ifeq ($(MACOSX_MINOR),7)
+MACOSX_SSL_DEPRECATED = yes
+endif
+ifeq ($(MACOSX_MINOR),8)
+MACOSX_SSL_DEPRECATED = yes
+endif
+
 ifeq ($(CONFIGURE),yes)
 showcxx:
 	@echo "$(CXX)"
diff --git a/config/Makefile.macosxicc b/config/Makefile.macosxicc
index b626dda9d76..d5a5c113274 100644
--- a/config/Makefile.macosxicc
+++ b/config/Makefile.macosxicc
@@ -166,3 +166,9 @@ INSTALL      := /bin/cp -pPR
 INSTALLDATA  := /bin/cp -pPR
 
 # Extras
+ifeq ($(MACOSX_MINOR),7)
+MACOSX_SSL_DEPRECATED = yes
+endif
+ifeq ($(MACOSX_MINOR),8)
+MACOSX_SSL_DEPRECATED = yes
+endif
diff --git a/configure b/configure
index a4374daeec9..ee55279d337 100755
--- a/configure
+++ b/configure
@@ -2247,6 +2247,7 @@ if test ! "x$enable_x11" = "xno" ; then
         /usr/include /usr/X11R6/include /usr/include/X11 /usr/openwin/include \
         /usr/local/include /usr/local/include/X11 /usr/local/X11R6/include \
         /usr/X11/include /usr/include/X11R5
+    x11incdir=$found_dir
 
     if test "x$found_dir" = "x" ; then
         result "`basename $0`: X11 headers MUST be installed"
@@ -6620,6 +6621,7 @@ sed -e "s|@srcdir@|$ac_srcdir|"                 \
     -e "s|@xmllib@|$xmllib|"                    \
     -e "s|@xmllibdir@|$xmllibdir|"              \
     -e "s|@buildx11@|$enable_x11|"              \
+    -e "s|@x11incdir@|$x11incdir|"              \
     -e "s|@x11libdir@|$x11libdir|"              \
     -e "s|@xpmlib@|$xpmlib|"                    \
     -e "s|@xpmlibdir@|$xpmlibdir|"              \
diff --git a/graf2d/asimage/Module.mk b/graf2d/asimage/Module.mk
index da1525388be..45d6a912a3f 100644
--- a/graf2d/asimage/Module.mk
+++ b/graf2d/asimage/Module.mk
@@ -301,3 +301,5 @@ $(ASIMAGEO): CXXFLAGS += $(FREETYPEINC) $(ASTEPDIRI)
 
 $(ASIMAGEGUIO) $(ASIMAGEGUIDO) $(ASIMAGEDO): $(ASTEPDEP)
 $(ASIMAGEGUIO) $(ASIMAGEGUIDO) $(ASIMAGEDO): CXXFLAGS += $(ASTEPDIRI)
+
+$(ASIMAGEGUIO): CXXFLAGS += $(X11INCDIR:%=-I%)
diff --git a/graf2d/x11/Module.mk b/graf2d/x11/Module.mk
index 2cd5f1a04e3..641dca38e2d 100644
--- a/graf2d/x11/Module.mk
+++ b/graf2d/x11/Module.mk
@@ -73,3 +73,4 @@ distclean::     distclean-$(MODNAME)
 ifeq ($(PLATFORM),aix5)
 $(X11O): CXXFLAGS += -I$(X11DIRI)
 endif
+$(X11O) $(X11DO): CXXFLAGS += $(X11INCDIR:%=-I%)
diff --git a/graf3d/x3d/Module.mk b/graf3d/x3d/Module.mk
index cdd4a24d477..8ffbce3ea71 100644
--- a/graf3d/x3d/Module.mk
+++ b/graf3d/x3d/Module.mk
@@ -69,3 +69,7 @@ distclean-$(MODNAME): clean-$(MODNAME)
 		@rm -f $(X3DDEP) $(X3DDS) $(X3DDH) $(X3DLIB) $(X3DMAP)
 
 distclean::     distclean-$(MODNAME)
+
+##### extra rules ######
+$(X3DO): CXXFLAGS += $(X11INCDIR:%=-I%)
+$(X3DO): CFLAGS   += $(X11INCDIR:%=-I%)
diff --git a/net/auth/Module.mk b/net/auth/Module.mk
index af1b5cd9e64..30eed2de31b 100644
--- a/net/auth/Module.mk
+++ b/net/auth/Module.mk
@@ -141,6 +141,6 @@ distclean::     distclean-$(MODNAME)
 ##### extra rules ######
 $(RAUTHO):      CXXFLAGS += $(EXTRA_RAUTHFLAGS)
 $(AFSAUTHO):    CXXFLAGS += $(AFSINCDIR) $(AFSEXTRACFLAGS)
-ifeq ($(MACOSX_MINOR),7)
+ifeq ($(MACOSX_SSL_DEPRECATED),yes)
 $(call stripsrc,$(AUTHDIRS)/TAuthenticate.o): CXXFLAGS += -Wno-deprecated-declarations
 endif
diff --git a/net/net/Module.mk b/net/net/Module.mk
index 7bd5ebbc705..fe6c2097033 100644
--- a/net/net/Module.mk
+++ b/net/net/Module.mk
@@ -88,7 +88,7 @@ distclean-$(MODNAME): clean-$(MODNAME)
 distclean::     distclean-$(MODNAME)
 
 ##### extra rules ######
-ifeq ($(MACOSX_MINOR),7)
+ifeq ($(MACOSX_SSL_DEPRECATED),yes)
 $(call stripsrc,$(NETDIRS)/TSSLSocket.o): CXXFLAGS += -Wno-deprecated-declarations
 endif
 $(call stripsrc,$(NETDIRS)/TWebFile.o): CXXFLAGS += $(NETSSL)
diff --git a/net/rpdutils/Module.mk b/net/rpdutils/Module.mk
index 5621a0139f6..e4ccd040d07 100644
--- a/net/rpdutils/Module.mk
+++ b/net/rpdutils/Module.mk
@@ -117,6 +117,6 @@ distclean::     distclean-$(MODNAME)
 
 ##### extra rules ######
 $(RPDUTILO): CXXFLAGS += $(AUTHFLAGS)
-ifeq ($(MACOSX_MINOR),7)
+ifeq ($(MACOSX_SSL_DEPRECATED),yes)
 $(call stripsrc,$(RPDUTILDIRS)/rpdutils.o): CXXFLAGS += -Wno-deprecated-declarations
 endif
diff --git a/rootx/Module.mk b/rootx/Module.mk
index 8bbeb517033..b5f8761de6a 100644
--- a/rootx/Module.mk
+++ b/rootx/Module.mk
@@ -46,3 +46,6 @@ distclean-$(MODNAME): clean-$(MODNAME)
 		@rm -f $(ROOTXDEP) $(ROOTX)
 
 distclean::     distclean-$(MODNAME)
+
+##### extra rules ######
+$(ROOTXO): CXXFLAGS += $(X11INCDIR:%=-I%)
-- 
GitLab