[Libreoffice-commits] core.git: Branch 'ports/macosx10.5/master' - 106 commits - accessibility/inc android/source apple_remote/Library_AppleRemote.mk apple_remote/source avmedia/Library_avmediaQuickTime.mk avmedia/Module_avmedia.mk avmedia/source basctl/source basegfx/source basegfx/test basic/source bridges/Library_cpp_uno.mk bridges/source chart2/source cli_ure/source comphelper/source compilerplugins/clang config_host/config_features.h.in config_host/config_global.h.in config_host.mk.in configure.ac connectivity/source cppuhelper/source cppu/source cui/source dbaccess/source desktop/Library_sofficeapp.mk desktop/source drawinglayer/source dtrans/source editeng/source embeddedobj/source extensions/Module_extensions.mk extensions/source external/beanshell external/curl external/nss external/openssl external/python3 filter/qa filter/source forms/source fpicker/Library_fps_aqua.mk fpicker/source framework/qa framework/source helpcompiler/source hwpfilter/source i18npool/inc i18npool/source idl/sou rce include/apple_remote include/basegfx include/basic include/canvas include/comphelper include/connectivity include/cppuhelper include/drawinglayer include/editeng include/i18nlangtag include/LibreOfficeKit include/linguistic include/o3tl include/oox include/osl include/rtl include/sfx2 include/svl include/svtools include/svx include/tools include/ucbhelper include/unotools include/vcl io/test javaunohelper/com jurt/test jvmfwk/plugins l10ntools/source lingucomponent/Module_lingucomponent.mk lingucomponent/source linguistic/source lotuswordpro/source offapi/com offapi/type_reference officecfg/registry onlineupdate/source oox/source package/qa package/source postprocess/Rdb_services.mk qadevOOo/runner qadevOOo/tests registry/inc reportbuilder/java reportdesign/source Repository.mk rsc/inc rsc/source sal/cpprt sal/cppunittester sal/Library_sal.mk sal/osl sal/qa sal/textenc sal/workben scaddins/source sc/inc scp2/source sc/qa scripting/java scripting/source sc/source sc/workben sdext /source sd/inc sd/sdi sd/source sfx2/inc sfx2/Library_sfx.mk sfx2/qa sfx2/source shell/Library_macbe.mk shell/source slideshow/source solenv/bin solenv/doc solenv/gbuild soltools/cpp sot/source starmath/inc starmath/source stoc/source svgio/inc svgio/source svl/source svtools/inc svtools/source svx/inc svx/Library_svxcore.mk svx/source swext/mediawiki sw/inc sw/qa sw/source sysui/desktop testtools/source toolkit/Library_tk.mk toolkit/qa toolkit/source tools/source ucbhelper/source ucb/qa ucb/source udkapi/com UnoControls/source unotest/source unotools/source unoxml/qa unoxml/source vcl/generic vcl/headless vcl/inc vcl/Library_vcl.mk vcl/opengl vcl/osx vcl/quartz vcl/source vcl/StaticLibrary_vclmain.mk vcl/unx vcl/win winaccessibility/inc winaccessibility/source wizards/com writerfilter/source xmerge/source xmlhelp/Library_ucpchelp1.mk xmlhelp/source xmloff/source xmlscript/source xmlsecurity/source

Douglas Mencken dougmencken at gmail.com
Wed Sep 30 10:37:38 PDT 2015


Rebased ref, commits from common ancestor:
commit e2d6b7b97cc019f841b20086da2481345440d5be
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Sep 30 12:16:08 2015 -0400

    external/beanshell ~ script engine: improve compatibility
    
    javax.script.Invocable may contain either two `invoke' methods or `invokeMethod' and `invokeFunction'
    
    Change-Id: I47196af79cc2de75725ded29992ab1f6f4cd623e

diff --git a/external/beanshell/UnpackedTarball_beanshell.mk b/external/beanshell/UnpackedTarball_beanshell.mk
index 828e4bd..f35dd7d 100644
--- a/external/beanshell/UnpackedTarball_beanshell.mk
+++ b/external/beanshell/UnpackedTarball_beanshell.mk
@@ -11,8 +11,13 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,beanshell))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,beanshell,$(BSH_TARBALL),,beanshell))
 
+$(eval $(call gb_UnpackedTarball_fix_end_of_line,beanshell,\
+	engine/src/TestBshScriptEngine.java \
+))
+
 $(eval $(call gb_UnpackedTarball_add_patches,beanshell,\
 	external/beanshell/bsh-2.0b1-src.patch \
+	external/beanshell/beanshell-invoke.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/beanshell/beanshell-invoke.patch b/external/beanshell/beanshell-invoke.patch
new file mode 100644
index 0000000..b78f1db
--- /dev/null
+++ b/external/beanshell/beanshell-invoke.patch
@@ -0,0 +1,78 @@
+--- old/beanshell/engine/src/bsh/engine/BshScriptEngine.java
++++ new/beanshell/engine/src/bsh/engine/BshScriptEngine.java
+@@ -229,6 +229,12 @@
+ 		}
+ 	}
+ 
++	public Object invoke( Object thiz, String name, Object... args )
++	throws ScriptException, NoSuchMethodException
++	{
++		return invokeMethod( thiz, name, args );
++	}
++
+ 	/**
+ 	 * Same as invoke(Object, String, Object...) with <code>null</code> as the
+ 	 * first argument.  Used to call top-level procedures defined in scripts.
+@@ -249,6 +255,12 @@
+ 		return invokeMethod( getGlobal(), name, args );
+ 	}
+ 
++	public Object invoke( String name, Object... args )
++		throws ScriptException, NoSuchMethodException
++	{
++		return invokeFunction( name, args );
++	}
++
+     /**
+ 	 * Returns an implementation of an interface using procedures compiled in the
+ 	 * interpreter. The methods of the interface may be implemented using the
+--- old/beanshell/engine/src/TestBshScriptEngine.java
++++ new/beanshell/engine/src/TestBshScriptEngine.java
+@@ -2,11 +2,12 @@
+ import java.io.*;
+ import javax.script.*;
+ import static javax.script.ScriptContext.*;
++import java.lang.reflect.*;
+ 
+ public class TestBshScriptEngine
+ {
+ 	public static void main( String [] args )
+-		throws ScriptException, NoSuchMethodException, IOException
++		throws ScriptException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException
+ 	{
+ 		ScriptEngineManager manager =
+ 			new ScriptEngineManager( bsh.Interpreter.class.getClassLoader() );
+@@ -39,11 +40,23 @@
+ 		assertTrue( engine.get("bar").equals("gee") );
+ 		assertTrue( engine.eval("bar").equals("gee") );
+ 
++		// use reflection to pick available method
++		Method invokeMe = null;
++		try {
++			invokeMe = Invocable.class.getMethod( "invokeFunction", String.class, Object[].class );
++		} catch ( Exception e ) { }
++		if (invokeMe == null)
++		{
++			try {
++				invokeMe = Invocable.class.getMethod( "invoke", String.class, Object[].class );
++			} catch ( Exception e ) { }
++		}
++
+ 		// install and invoke a method
+ 		engine.eval("foo() { return foo+1; }");
+ 		// invoke a method
+ 		Invocable invocable = (Invocable) engine;
+-		int foo = (Integer)invocable.invokeFunction( "foo" );
++		int foo = (Integer)invokeMe.invoke( invocable, "foo", (Object) new Object[]{} );
+ 		assertTrue( foo == 43 );
+ 
+ 		// get interface
+@@ -58,7 +71,7 @@
+ 		engine.eval(
+ 			"flag2=false; myObj() { run() { flag2=true; } return this; }");
+ 		assertTrue( (Boolean)engine.get("flag2") == false );
+-		Object scriptedObject = invocable.invokeFunction("myObj");
++		Object scriptedObject = invokeMe.invoke( invocable, "myObj", (Object) new Object[]{} );
+ 		assertTrue( scriptedObject instanceof bsh.This );
+ 		runnable =
+ 			(Runnable)invocable.getInterface( scriptedObject, Runnable.class );
commit 94b55d9547e540d7b04d84d95236d1638dff00ec
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Tue Sep 29 17:29:45 2015 -0400

    if "need these flags in case of OS X sandboxing" then check for ENABLE_MACOSX_SANDBOX
    
    see commit 57117cf52d4c91029cbabf852d1f82c386ac1d75
    
    Change-Id: Ibabc57d1ca683c28f1d258f92019c4d25fc71157

diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index df5cfb4..c90c86b 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -64,21 +64,24 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
 
 ifeq ($(OS),MACOSX)
 
-$(eval $(call gb_Library_add_cxxflags,sofficeapp,\
-    $(gb_OBJCXXFLAGS) \
-))
-
 $(eval $(call gb_Library_use_system_darwin_frameworks,sofficeapp,\
     Foundation \
 ))
 
 endif
 
+ifeq ($(ENABLE_MACOSX_SANDBOX),TRUE)
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_cxxflags,sofficeapp,\
+    $(gb_OBJCXXFLAGS) \
+))
+endif
 ifeq ($(OS),IOS)
 $(eval $(call gb_Library_add_cflags,sofficeapp,\
     $(gb_OBJCFLAGS) \
 ))
 endif
+endif
 
 $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
     desktop/source/app/app \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index ca9e5c5..ea0de70 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -91,9 +91,11 @@ $(eval $(call gb_Library_use_externals,svxcore,\
 
 ifeq ($(OS),MACOSX)
 
+ifeq ($(ENABLE_MACOSX_SANDBOX),TRUE)
 $(eval $(call gb_Library_add_cxxflags,svxcore,\
     $(gb_OBJCXXFLAGS) \
 ))
+endif
 
 $(eval $(call gb_Library_use_system_darwin_frameworks,svxcore,\
 	Foundation \
commit 55c3213b869398941f40544b18ac07ba1248c397
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Sep 9 18:00:51 2015 -0400

    avoid using new literal syntax for NSDictionary
    
    Collection literals were introduced only with LLVM 4.0 (OS X 10.8)
    
    // a dictionary literal
    NSDictionary *di = @{ @1: @"hello", @2: @"world" };
    // old style
    NSDictionary *di = [ NSDictionary dictionaryWithObjectsAndKeys: @"hello", @1, @"world", @2, nil ];
    
    Related commits:
        1276bf033b11a71961cd3454bb44bf08f997ca62
        6c2f65dfe08dd7acefec3be00b4f38dd5bca50a8
    
    Change-Id: Ie5f3eae917e8e3e14ccdea7b69adae34ab09d0ea

diff --git a/vcl/osx/PictToBmpFlt.cxx b/vcl/osx/PictToBmpFlt.cxx
index f8d8c63..601e16b 100644
--- a/vcl/osx/PictToBmpFlt.cxx
+++ b/vcl/osx/PictToBmpFlt.cxx
@@ -43,7 +43,7 @@ bool ImageToPNG( com::sun::star::uno::Sequence<sal_Int8>& rImgData,
     if( !pRep)
         return false;
 
-    NSData* pOut = [pRep representationUsingType: NSPNGFileType properties: @{ }];
+    NSData* pOut = [pRep representationUsingType: NSPNGFileType properties: [ NSDictionary dictionary ]];
     if( !pOut)
         return false;
 
@@ -66,7 +66,7 @@ bool PNGToImage( com::sun::star::uno::Sequence<sal_Int8>& rPngData,
     if( !pRep)
         return false;
 
-    NSData* pOut = [pRep representationUsingType: eOutFormat properties: @{ }];
+    NSData* pOut = [pRep representationUsingType: eOutFormat properties: [ NSDictionary dictionary ]];
     if( !pOut)
         return false;
 
diff --git a/vcl/osx/a11ytextwrapper.mm b/vcl/osx/a11ytextwrapper.mm
index bfa67d1..2905a33 100644
--- a/vcl/osx/a11ytextwrapper.mm
+++ b/vcl/osx/a11ytextwrapper.mm
@@ -270,7 +270,7 @@ using namespace ::com::sun::star::uno;
     NSAttributedString * attrString = (NSAttributedString *) [ AquaA11yTextWrapper attributedStringForRangeAttributeForElement: wrapper forParameter: range ];
     if ( attrString != nil ) {
         @try {
-            rtfData = [ attrString RTFFromRange: [ range rangeValue ] documentAttributes: @{NSDocumentTypeDocumentAttribute : NSRTFTextDocumentType} ];
+            rtfData = [ attrString RTFFromRange: [ range rangeValue ] documentAttributes: [ NSDictionary dictionaryWithObjectsAndKeys: NSRTFTextDocumentType, NSDocumentTypeDocumentAttribute, nil ] ];
         } @catch ( NSException * e) {
             // emtpy
         }
commit 61626a06ebc4a39e7adf43f17f234bf97f8a4fa2
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Sep 9 18:23:23 2015 -0400

    static_cast isn't sufficient as (SEL)nil replacement
    
    see also commits:
        0d0729ca97e67505a52dcb07d7819f6c444a0031
        f6ec07a3963a401dc736baa9bdd2ed3c7325bb66
    
    Change-Id: If44f2537a35b4dfd0013a59cd7ea9c6c86542f11

diff --git a/vcl/osx/a11ywrapper.mm b/vcl/osx/a11ywrapper.mm
index a90f917..40a79a7 100644
--- a/vcl/osx/a11ywrapper.mm
+++ b/vcl/osx/a11ywrapper.mm
@@ -149,7 +149,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) {
 // (getter with parameter)    attributeNameHereAttributeForParameter:
 // (setter)                   setAttributeNameHereAttributeForElement:to:
 -(SEL)selectorForAttribute:(NSString *)attribute asGetter:(BOOL)asGetter withGetterParameter:(BOOL)withGetterParameter {
-    SEL selector = static_cast<SEL>(nil);
+    SEL selector = reinterpret_cast<SEL>(nil);
     NSAutoreleasePool * pool = [ [ NSAutoreleasePool alloc ] init ];
     @try {
         // step 1: create method name from attribute name
@@ -175,7 +175,7 @@ static std::ostream &operator<<(std::ostream &s, NSObject *obj) {
         // step 2: create selector
         selector = NSSelectorFromString ( methodName );
     } @catch ( id exception ) {
-        selector = static_cast<SEL>(nil);
+        selector = reinterpret_cast<SEL>(nil);
     }
     [ pool release ];
     return selector;
commit 0cb42b198220a465d000728557ab64dc21c640ba
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Dec 24 10:47:02 2014 -0500

    use -lobjc-gnu and GNUstep libraries when compiler is GCC
    
    for:
      vcl
      toolkit
      apple_remote
      sfx2
      avmedia-quicktime
      fpicker-aqua
      shell-macbe1
    
    { note: path to GNUstep libraries is currently hard-coded }
    
    Change-Id: Ia28778f3e262e71c87c48e71fbfd9001d5d6ac7a

diff --git a/apple_remote/Library_AppleRemote.mk b/apple_remote/Library_AppleRemote.mk
index cf48553..5d8cbfd 100644
--- a/apple_remote/Library_AppleRemote.mk
+++ b/apple_remote/Library_AppleRemote.mk
@@ -17,6 +17,10 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,AppleRemote,\
     IOKit \
 ))
 
+$(eval $(call gb_Library_add_libs,AppleRemote,\
+    $(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
+))
+
 $(eval $(call gb_Library_add_objcobjects,AppleRemote,\
     apple_remote/source/KeyspanFrontRowControl \
     apple_remote/source/AppleRemote \
diff --git a/avmedia/Library_avmediaQuickTime.mk b/avmedia/Library_avmediaQuickTime.mk
index 20bf9c3..8bc097d 100644
--- a/avmedia/Library_avmediaQuickTime.mk
+++ b/avmedia/Library_avmediaQuickTime.mk
@@ -35,6 +35,10 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,avmediaQuickTime,\
 	QTKit \
 ))
 
+$(eval $(call gb_Library_add_libs,avmediaQuickTime,\
+	$(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
+))
+
 $(eval $(call gb_Library_add_objcxxobjects,avmediaQuickTime,\
 	avmedia/source/quicktime/framegrabber \
 	avmedia/source/quicktime/manager \
diff --git a/fpicker/Library_fps_aqua.mk b/fpicker/Library_fps_aqua.mk
index e4b7ef5..c8a2dc5 100644
--- a/fpicker/Library_fps_aqua.mk
+++ b/fpicker/Library_fps_aqua.mk
@@ -44,4 +44,8 @@ $(eval $(call gb_Library_add_objcxxobjects,fps_aqua,\
 	fpicker/source/aqua/SalAquaPicker \
 ))
 
+$(eval $(call gb_Library_add_libs,fps_aqua,\
+	$(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 9f0bb3d..9dc3ee1 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -327,7 +327,7 @@ $(eval $(call gb_Library_add_objcxxobjects,sfx,\
     sfx2/source/appl/shutdowniconaqua \
 ))
 $(eval $(call gb_Library_add_libs,sfx,\
-    -lobjc \
+    $(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
 ))
 $(eval $(call gb_Library_use_system_darwin_frameworks,sfx,\
     Cocoa \
diff --git a/shell/Library_macbe.mk b/shell/Library_macbe.mk
index c693e11..5b13704 100644
--- a/shell/Library_macbe.mk
+++ b/shell/Library_macbe.mk
@@ -18,6 +18,10 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,macbe1,\
 	SystemConfiguration \
 ))
 
+$(eval $(call gb_Library_add_libs,macbe1,\
+	$(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
+))
+
 $(eval $(call gb_Library_use_libraries,macbe1,\
 	cppu \
 	cppuhelper \
diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk
index 148a236..7d8958f 100644
--- a/toolkit/Library_tk.mk
+++ b/toolkit/Library_tk.mk
@@ -120,7 +120,7 @@ $(eval $(call gb_Library_add_objcxxflags_exception_objects,tk,\
 
 ifeq ($(OS),MACOSX)
 $(eval $(call gb_Library_add_libs,tk,\
-	-lobjc \
+	$(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
 ))
 endif
 
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 5e7754b..23a234c 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -90,7 +90,7 @@ $(eval $(call gb_Library_add_libs,vcl,\
     -framework IOKit \
     -F/System/Library/PrivateFrameworks \
     -framework CoreUI \
-    -lobjc \
+    $(if $(filter TRUE,$(COM_GCC_IS_CLANG)),-lobjc,-lobjc-gnu -L/usr/GNUstep/System/Library/Libraries -lgnustep-base -lgnustep-gui) \
 ))
 endif
 
commit 677588f8489a2e7f355b64f48771f40f91da81f8
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Tue Sep 8 08:06:37 2015 -0400

    ctfonts.cxx: add kCTForegroundColorFromContextAttributeName as extern
    
    Although the Apple documentation claims kCTForegroundColorFromContextAttributeName
    is supported on 10.5 and later, it is not defined in CTStringAttributes.h
    or anywhere else. I think it was inadvertently omitted from CTStringAttributes.h
    on 10.5, along with a few other symbols.
    
    related commit: 507efabe8b40e34c2bebfdaa00d4264c5345d3dd
    
    Change-Id: I8ea33f64d79eff4b73552ec48ea2016c7d9d0bb4

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index 1978c91..f3d3116 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -30,6 +30,10 @@
 #ifdef MACOSX
 #include "osx/saldata.hxx"
 #include "osx/salinst.h"
+# if MACOSX_SDK_VERSION < 1060
+/* symbol is defined in 10.5.x dylib but not in headers */
+extern const CFStringRef kCTForegroundColorFromContextAttributeName;
+# endif
 #endif
 #include "outfont.hxx"
 #include "PhysicalFontCollection.hxx"
commit 3cb65efab7f9280c6e90b05213c8b2b57508d4ed
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Mon Sep 7 06:15:08 2015 -0400

    vcl, toolkit: don't force gb_OBJCXXFLAGS for every .cxx file
    
    Change-Id: I6abc1e3d325e2f5e28fb8fe084b3bfab3803d92f

diff --git a/toolkit/Library_tk.mk b/toolkit/Library_tk.mk
index e5aaad5..148a236 100644
--- a/toolkit/Library_tk.mk
+++ b/toolkit/Library_tk.mk
@@ -64,13 +64,9 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
     toolkit/source/awt/vclxprinter \
     toolkit/source/awt/vclxregion \
     toolkit/source/awt/vclxspinbutton \
-    toolkit/source/awt/vclxsystemdependentwindow \
     toolkit/source/awt/vclxtabpagecontainer \
     toolkit/source/awt/animatedimagespeer \
-    toolkit/source/awt/vclxtoolkit \
-    toolkit/source/awt/vclxtopwindow \
     toolkit/source/awt/vclxwindow \
-    toolkit/source/awt/vclxwindow1 \
     toolkit/source/awt/vclxwindows \
     toolkit/source/controls/accessiblecontrolcontext \
     toolkit/source/controls/controlmodelcontainerbase \
@@ -115,18 +111,17 @@ $(eval $(call gb_Library_add_exception_objects,tk,\
     toolkit/source/helper/vclunohelper \
 ))
 
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_Library_add_cxxflags,tk,\
-	$(gb_OBJCXXFLAGS) \
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,tk,\
+    toolkit/source/awt/vclxwindow1 \
+    toolkit/source/awt/vclxsystemdependentwindow \
+    toolkit/source/awt/vclxtopwindow \
+    toolkit/source/awt/vclxtoolkit \
 ))
+
+ifeq ($(OS),MACOSX)
 $(eval $(call gb_Library_add_libs,tk,\
 	-lobjc \
 ))
 endif
 
-ifeq ($(OS),IOS)
-$(eval $(call gb_Library_add_cxxflags,tk,\
-    $(gb_OBJCXXFLAGS)))
-endif
-
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 6ec0959..5e7754b 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -93,16 +93,11 @@ $(eval $(call gb_Library_add_libs,vcl,\
     -lobjc \
 ))
 endif
-ifeq ($(OS),MACOSX)
-
-$(eval $(call gb_Library_add_cxxflags,vcl,\
-    $(gb_OBJCXXFLAGS) \
-))
 
-$(eval $(call gb_Library_add_exception_objects,vcl,\
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,vcl,\
     vcl/osx/OpenGLWrapper \
 ))
-
 endif
 
 ifeq ($(ENABLE_JAVA),TRUE)
@@ -133,7 +128,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 	vcl/opengl/program \
 	vcl/opengl/texture \
 	vcl/opengl/FixedTextureAtlas \
-    vcl/source/opengl/OpenGLContext \
     vcl/source/opengl/OpenGLHelper \
     vcl/source/window/cairo_cairo \
     vcl/source/window/openglwin \
@@ -391,6 +385,10 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/fontsubset/xlat \
 ))
 
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,vcl,\
+    vcl/source/opengl/OpenGLContext \
+))
+
 $(eval $(call gb_Library_add_cobjects,vcl,\
     vcl/source/filter/jpeg/transupp \
 ))
@@ -430,15 +428,11 @@ vcl_coretext_code= \
 
 ifeq ($(OS),MACOSX)
 
-$(eval $(call gb_Library_add_cxxflags,vcl,\
-    $(gb_OBJCXXFLAGS) \
-))
-
 $(eval $(call gb_Library_add_defs,vcl,\
 	-DMACOSX_BUNDLE_IDENTIFIER=\"$(MACOSX_BUNDLE_IDENTIFIER)\" \
 ))
 
-$(eval $(call gb_Library_add_exception_objects,vcl,\
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,vcl,\
     $(vcl_coretext_code) \
 ))
 
@@ -480,7 +474,7 @@ $(eval $(call gb_Library_add_objcxxobjects,vcl,\
     vcl/osx/salframeview \
     vcl/osx/salnsmenu \
 ))
-$(eval $(call gb_Library_add_exception_objects,vcl,\
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,vcl,\
     vcl/osx/a11yfocuslistener \
     vcl/osx/a11yfocustracker \
     vcl/osx/a11ylistener \
@@ -646,10 +640,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
 endif
 
 ifeq ($(OS),IOS)
-$(eval $(call gb_Library_add_cxxflags,vcl,\
-    $(gb_OBJCXXFLAGS) \
-))
-$(eval $(call gb_Library_add_exception_objects,vcl,\
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,vcl,\
     vcl/ios/iosinst \
     vcl/ios/dummies \
     $(vcl_really_generic_code) \
diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk
index dd7b27d..9ab7305 100644
--- a/vcl/StaticLibrary_vclmain.mk
+++ b/vcl/StaticLibrary_vclmain.mk
@@ -19,12 +19,6 @@
 
 $(eval $(call gb_StaticLibrary_StaticLibrary,vclmain))
 
-ifeq ($(OS),IOS)
-$(eval $(call gb_StaticLibrary_add_cxxflags,vclmain,\
-    $(gb_OBJCXXFLAGS) \
-))
-endif
-
 $(eval $(call gb_StaticLibrary_set_include,vclmain,\
     $$(INCLUDE) \
     -I$(SRCDIR)/vcl/inc \
@@ -35,7 +29,7 @@ $(eval $(call gb_StaticLibrary_use_api,vclmain,\
     udkapi \
 ))
 
-$(eval $(call gb_StaticLibrary_add_exception_objects,vclmain,\
+$(eval $(call gb_StaticLibrary_add_objcxxflags_exception_objects,vclmain,\
     vcl/source/salmain/salmain \
 ))
 
commit a7ef59fa2f38981a0b1e37bf0cc82c458823d561
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Mon Sep 7 05:59:05 2015 -0400

    gbuild: introduce add_objcxxflags_exception_object/objects
    
    add_objcxxflags_exception_object is the same as add_exception_object
    but with gb_OBJCXXFLAGS
    
    changes to Library_sal.mk ~-
        * adapt to add_objcxxflags_exception_objects
        * remove redundant sal/osl/unx/uunxapi.mm
    
    Change-Id: If54cf29f572175869ef4c461d755e3b1518c983b

diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 14b72ae..e9b6157 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -127,12 +127,6 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
 	sal/textenc/unichars \
 ))
 
-ifeq ($(OS),IOS)
-$(eval $(call gb_Library_add_cxxflags,sal,\
-    $(gb_OBJCXXFLAGS) \
-))
-endif
-
 ifeq ($(OS),ANDROID)
 $(eval $(call gb_Library_add_exception_objects,sal,\
 	sal/textenc/context \
@@ -181,16 +175,9 @@ $(eval $(call gb_Library_add_exception_objects,sal,\
         $(if $(filter DESKTOP,$(BUILD_TYPE)), sal/osl/unx/salinit) \
 ))
 
-# Note that the uunxapi.mm file just includes the uunxapi.cxx one
-ifeq ($(OS),MACOSX)
-$(eval $(call gb_Library_add_objcxxobjects,sal,\
+$(eval $(call gb_Library_add_objcxxflags_exception_objects,sal,\
 	sal/osl/unx/uunxapi \
 ))
-else
-$(eval $(call gb_Library_add_exception_objects,sal,\
-	sal/osl/unx/uunxapi \
-))
-endif
 
 ifneq ($(filter $(OS),MACOSX IOS),)
 $(eval $(call gb_Library_add_exception_objects,sal,\
diff --git a/sal/osl/unx/uunxapi.mm b/sal/osl/unx/uunxapi.mm
deleted file mode 100644
index 5a7e17f..0000000
--- a/sal/osl/unx/uunxapi.mm
+++ /dev/null
@@ -1 +0,0 @@
-#include "uunxapi.cxx"
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 8042f33..06f61de 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -178,6 +178,7 @@ $(eval $(foreach method,\
 	add_asmobject \
 	add_asmobjects \
 	add_exception_objects \
+	add_objcxxflags_exception_objects \
 	add_x64_generated_exception_objects \
 	add_generated_cobjects \
 	add_generated_cxxobjects \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index b4b9060..ca13792 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -943,6 +943,11 @@ endif
 
 endef
 
+# call gb_LinkTarget_add_objcxxflags_exception_object,linktarget,sourcefile,cxxflags,linktargetmakefilename
+define gb_LinkTarget_add_objcxxflags_exception_object
+$(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS) $(call gb_LinkTarget__get_cxxflags,$(3)) $(gb_OBJCXXFLAGS))
+endef
+
 # call gb_LinkTarget_add_objcobject,linktarget,sourcefile,objcflags,linktargetmakefilename
 define gb_LinkTarget_add_objcobject
 $(if $(wildcard $(call gb_ObjCObject_get_source,$(SRCDIR),$(2))),,$(eval $(call gb_Output_error,No such source file $(call gb_ObjCObject_get_source,$(SRCDIR),$(2)))))
@@ -1144,6 +1149,11 @@ define gb_LinkTarget_add_objcxxobjects
 $(foreach obj,$(2),$(call gb_LinkTarget_add_objcxxobject,$(1),$(obj),$(3),$(4)))
 endef
 
+# call gb_LinkTarget_add_objcxxflags_exception_objects,linktarget,sourcefiles,cxxflags,linktargetmakefilename
+define gb_LinkTarget_add_objcxxflags_exception_objects
+$(foreach obj,$(2),$(call gb_LinkTarget_add_objcxxflags_exception_object,$(1),$(obj),$(3),$(4)))
+endef
+
 # call gb_LinkTarget_add_asmobjects,linktarget,sourcefiles,asmflags,linktargetmakefilename
 define gb_LinkTarget_add_asmobjects
 $(foreach obj,$(2),$(call gb_LinkTarget_add_asmobject,$(1),$(obj),$(3)))
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index dc7778f..1b5ab3f 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -77,6 +77,7 @@ $(eval $(foreach method,\
 	add_asmobject \
 	add_asmobjects \
 	add_exception_objects \
+	add_objcxxflags_exception_objects \
 	add_x64_generated_exception_objects \
 	add_generated_cobjects \
 	add_x64_generated_cobjects \
commit a69cc881164b249daa30e91b2dda325892683754
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sun Sep 6 12:38:02 2015 -0400

    fix build for some `external/' packages
    
    also move patch entries for tracking them in future
    
      * restore osx-ppc hunks @ external/nss/nss_macosx.patch
        related commit: 6e7991dfd8c54a833f4a9795a0d57f4690e92e6b
    
      * --noexecstack isn't very compatible with some versions of `as'
        ( FATAL:/usr/bin/../libexec/gcc/darwin/ppc/as: I don't understand '-' flag! )
        related: 04a98015101b8fea3b200e0bf3a2469d8c75fdf7
    
    Change-Id: I6cd3192121b74d105ac478f71f42bca872f92541

diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index d297ee4b..13aca66 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -15,13 +15,13 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
 	external/nss/nss.patch \
 	external/nss/nss.aix.patch \
 	external/nss/nss-3.13.5-zlib-werror.patch \
-	external/nss/nss_macosx.patch \
 	external/nss/nss-win32-make.patch.1 \
 	$(if $(filter WNTMSC,$(OS)$(COM)),external/nss/nss.windows.patch \
 		external/nss/nss.vs2015.patch) \
 	$(if $(filter WNTGCC,$(OS)$(COM)),external/nss/nspr-4.9-build.patch.3 \
 		external/nss/nss-3.13.3-build.patch.3 \
 		external/nss/nss.mingw.patch.3) \
+	external/nss/nss_macosx.patch \
     external/nss/ubsan.patch.0 \
     $(if $(filter IOS,$(OS)), \
         external/nss/nss-chromium-nss-static.patch \
diff --git a/external/nss/nss_macosx.patch b/external/nss/nss_macosx.patch
index 40d02c9..cb0ec68 100644
--- a/external/nss/nss_macosx.patch
+++ b/external/nss/nss_macosx.patch
@@ -1,6 +1,17 @@
 diff -ru a/nspr/configure b/nspr/configure
 --- a/a/nspr/configure	2014-09-29 16:50:33.907375937 +0100
 +++ b/b/nspr/configure	2014-09-29 16:51:59.213931947 +0100
+@@ -6568,7 +6568,9 @@
+             ;;
+     esac
+     if test "`echo $CC | grep -c '\-arch '`" = "0"; then
+-        CC="$CC -arch $CPU_ARCH"
++        if test "$CPU_ARCH" != "ppc"; then
++            CC="$CC -arch $CPU_ARCH"
++        fi
+     fi
+     ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default"
+ if test "x$ac_cv_header_crt_externs_h" = xyes; then :
 @@ -6577,7 +6579,7 @@
  
  
@@ -10,6 +21,20 @@ diff -ru a/nspr/configure b/nspr/configure
      _OPTIMIZE_FLAGS=-O2
      MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
      STRIP="$STRIP -x -S"
+diff -ru a/nspr/configure.in b/nspr/configure.in
+--- a/a/nspr/configure.in	2014-09-29 16:50:33.908375942 +0100
++++ b/b/nspr/configure.in	2014-09-29 16:51:59.209931921 +0100
+@@ -1402,7 +1402,9 @@
+             ;;
+     esac
+     if test "`echo $CC | grep -c '\-arch '`" = "0"; then
+-        CC="$CC -arch $CPU_ARCH"
++        if test "$CPU_ARCH" != "ppc"; then
++            CC="$CC -arch $CPU_ARCH"
++        fi
+     fi
+     AC_CHECK_HEADER(crt_externs.h)
+     DSO_CFLAGS=-fPIC
 diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk
 --- a/a/nss/coreconf/Darwin.mk	2014-09-29 16:50:22.992304799 +0100
 +++ b/b/nss/coreconf/Darwin.mk	2014-09-29 16:51:59.214931953 +0100
@@ -44,7 +69,12 @@ diff -ru a/nss/coreconf/Darwin.mk b/nss/coreconf/Darwin.mk
  override CPU_ARCH	= x86
  endif
  else
-@@ -31,12 +39,16 @@
+@@ -31,17 +39,20 @@
+ # Nothing set for arm currently.
+ else
+ OS_REL_CFLAGS	= -Dppc
+-CC              += -arch ppc
+ endif
  endif
  
  ifneq (,$(MACOS_SDK_DIR))
diff --git a/external/openssl/UnpackedTarball_openssl.mk b/external/openssl/UnpackedTarball_openssl.mk
index b44f576..4ae5357 100644
--- a/external/openssl/UnpackedTarball_openssl.mk
+++ b/external/openssl/UnpackedTarball_openssl.mk
@@ -22,14 +22,14 @@ $(eval $(call gb_UnpackedTarball_set_pre_action,openssl,\
 endif
 
 $(eval $(call gb_UnpackedTarball_add_patches,openssl,\
-	external/openssl/openssllnx.patch \
+	$(if $(filter MACOSX,$(OS)),,external/openssl/openssllnx.patch) \
+	external/openssl/opensslosxppc.patch \
 	external/openssl/opensslmingw.patch \
 	external/openssl/opensslwnt.patch \
 	external/openssl/openssl-1.0.1g-msvc2012-winxp.patch.1 \
 	external/openssl/openssl-1.0.1h-win64.patch.1 \
 	external/openssl/opensslsol.patch \
 	external/openssl/opensslios.patch \
-	external/openssl/opensslosxppc.patch \
 	external/openssl/openssl-3650-masm.patch.1 \
 ))
 
commit f80fa0b41c07dc69c334d05933a5b2d68f707e46
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Fri Dec 26 08:59:41 2014 -0500

    fpicker:aqua - deal with OBJC_EXPORT and objc_msgSend
    
    Change-Id: I414f5dcbfca9697b22a20d2d45f94c91ec4cd691

diff --git a/fpicker/source/aqua/CFStringUtilities.hxx b/fpicker/source/aqua/CFStringUtilities.hxx
index 3c76a81..15a0acf 100644
--- a/fpicker/source/aqua/CFStringUtilities.hxx
+++ b/fpicker/source/aqua/CFStringUtilities.hxx
@@ -21,6 +21,9 @@
 #define INCLUDED_FPICKER_SOURCE_AQUA_CFSTRINGUTILITIES_HXX
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Carbon/Carbon.h>
 #include <Cocoa/Cocoa.h>
 #include <postmac.h>
diff --git a/fpicker/source/aqua/ControlHelper.hxx b/fpicker/source/aqua/ControlHelper.hxx
index c564c18..966c678 100644
--- a/fpicker/source/aqua/ControlHelper.hxx
+++ b/fpicker/source/aqua/ControlHelper.hxx
@@ -27,6 +27,9 @@
 #include <map>
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include <postmac.h>
 #include "SalAquaConstants.h"
diff --git a/fpicker/source/aqua/NSString_OOoAdditions.hxx b/fpicker/source/aqua/NSString_OOoAdditions.hxx
index 08bfbd4..62b824f 100644
--- a/fpicker/source/aqua/NSString_OOoAdditions.hxx
+++ b/fpicker/source/aqua/NSString_OOoAdditions.hxx
@@ -21,6 +21,9 @@
 #define INCLUDED_FPICKER_SOURCE_AQUA_NSSTRING_OOOADDITIONS_HXX
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 #include <postmac.h>
 #include <rtl/ustring.hxx>
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index 020143a..2b65501 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -204,12 +204,13 @@ sal_Int16 SAL_CALL SalAquaFilePicker::execute() throw( uno::RuntimeException )
 
     //Set the delegate to be notified of certain events
 
-    // I don't know why, but with gcc 4.2.1, this line results in the warning:
+#if MACOSX_SDK_VERSION < 1060
+    [m_pDialog setDelegate:m_pDelegate];
+#else
+    // with gcc 4.2.1, [m_pDialog setDelegate:m_pDelegate] results in the warning
     // class 'AquaFilePickerDelegate' does not implement the 'NSOpenSavePanelDelegate' protocol
-    // So instead of:
-    // [m_pDialog setDelegate:m_pDelegate];
-    // do:
     objc_msgSend(m_pDialog, @selector(setDelegate:), m_pDelegate);
+#endif
 
     int nStatus = runandwaitforresult();
 
diff --git a/fpicker/source/aqua/resourceprovider.hxx b/fpicker/source/aqua/resourceprovider.hxx
index fd6647e..e736801 100644
--- a/fpicker/source/aqua/resourceprovider.hxx
+++ b/fpicker/source/aqua/resourceprovider.hxx
@@ -23,6 +23,10 @@
 
 #include <sal/types.h>
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
+
 #include <premac.h>
 #include <Cocoa/Cocoa.h>
 #include <postmac.h>
commit 9fc331930196d0bfccfdb0000a369751851ca1d4
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Dec 24 12:59:04 2014 -0500

    sfx2:shutdowniconaqua.mm: deal with OBJC_EXPORT and objc_msgSend
    
    Change-Id: I7ad0ce3067d8f51d968d4233f77d70300d0d913e

diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 19d9eaf..75606a8 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -41,6 +41,9 @@
 
 #include "premac.h"
 #include <objc/objc-runtime.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 
@@ -352,15 +355,13 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
     [pItem setEnabled: YES];
     NSMenu* pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ];
 
+#if MACOSX_SDK_VERSION < 1060
+    [pRecentMenu setDelegate: pRecentDelegate];
+#else
     // When compiling against 10.6 SDK, we get the warning:
     // class 'RecentMenuDelegate' does not implement the 'NSMenuDelegate' protocol
-
-    // No idea if that is a bogus warning, or if the way this is
-    // implemented just is so weird that the compiler gets
-    // confused. Anyway, to avoid warnings, instead of this:
-    // [pRecentMenu setDelegate: pRecentDelegate];
-    // do this:
     objc_msgSend(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+#endif
 
     [pRecentMenu setAutoenablesItems: NO];
     [pItem setSubmenu: pRecentMenu];
@@ -375,9 +376,11 @@ static void appendRecentMenu( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUStri
         [pItem setEnabled: YES];
         pRecentMenu = [[NSMenu alloc] initWithTitle: getAutoreleasedString( i_rTitle ) ];
 
-        // See above
-        // [pRecentMenu setDelegate: pRecentDelegate];
+#if MACOSX_SDK_VERSION < 1060
+        [pRecentMenu setDelegate: pRecentDelegate];
+#else
         objc_msgSend(pRecentMenu, @selector(setDelegate:), pRecentDelegate);
+#endif
 
         [pRecentMenu setAutoenablesItems: NO];
         [pItem setSubmenu: pRecentMenu];
commit ab360a15b48388fe03248b4c23126815ea761608
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sat Oct 25 11:03:56 2014 -0400

    vcl: workarounds for `objc_msgSend setDelegate' on OS X 10.5
    
    (vcl/osx/salframe.cxx, vcl/osx/salmenu.cxx)
    
    plus, move conditional includes in salframe.cxx down a bit
    
    Change-Id: I39886b4590f227ec69042fed0f5240ba0b0fd7f2

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index d218d94..da9ed80 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -38,11 +38,6 @@
 #include "osx/a11yfactory.h"
 #include "quartz/utils.h"
 
-#if MACOSX_SDK_VERSION < 1060
-#include "vcl/timer.hxx"
-#include "osx/saltimer.h"
-#endif
-
 #include "salwtype.hxx"
 
 #include "premac.h"
@@ -55,6 +50,11 @@
 #include <Carbon/Carbon.h>
 #include "postmac.h"
 
+#if MACOSX_SDK_VERSION < 1060
+#include "vcl/timer.hxx"
+#include "osx/saltimer.h"
+#endif
+
 using namespace std;
 
 AquaSalFrame* AquaSalFrame::s_pCaptureFrame = NULL;
@@ -202,16 +202,16 @@ void AquaSalFrame::initWindowAndView()
         [mpNSWindow setAcceptsMouseMovedEvents: YES];
     [mpNSWindow setHasShadow: YES];
 
-#if MACOSX_SDK_VERSION < 1060
-    objc_msgSend(mpNSWindow, @selector(setDelegate:), mpNSWindow);
-#else
+#if MACOSX_SDK_VERSION >= 1060
+    /* objc_msgSend(mpNSWindow, @selector(setDelegate:), mpNSWindow); */
     [mpNSWindow setDelegate: static_cast<id<NSWindowDelegate> >(mpNSWindow)];
-#endif
 
     if( [mpNSWindow respondsToSelector: @selector(setRestorable:)])
     {
         objc_msgSend(mpNSWindow, @selector(setRestorable:), NO);
     }
+#endif
+
     const NSRect aRect = { NSZeroPoint, NSMakeSize( maGeometry.nWidth, maGeometry.nHeight )};
     mnTrackingRectTag = [mpNSView addTrackingRect: aRect owner: mpNSView userData: nil assumeInside: NO];
 
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index 2bdc20c..55d9c5f 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -264,9 +264,8 @@ AquaSalMenu::AquaSalMenu( bool bMenuBar ) :
     if( ! mbMenuBar )
     {
         mpMenu = [[SalNSMenu alloc] initWithMenu: this];
-#if MACOSX_SDK_VERSION < 1060
-        objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu);
-#else
+#if MACOSX_SDK_VERSION >= 1060
+        /* objc_msgSend(mpMenu, @selector(setDelegate:), mpMenu); */
         [mpMenu setDelegate: reinterpret_cast< id<NSMenuDelegate> >(mpMenu)];
 #endif
     }
commit 42389584c852ffc0b39ea8377e3e08540378ac88
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sun Oct 26 06:38:10 2014 -0400

    vcl: fix some "cannot convert 'objc_object*' to..." issues
    
    Change-Id: I4b0e32c412937da4b2ea4bf350be32ea31362b3c

diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 043b56b..dc90ce7 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -483,7 +483,7 @@ static AquaSalFrame* getMouseContainerFrame()
         mpFrame = pFrame;
         mMarkedRange = NSMakeRange(NSNotFound, 0);
         mSelectedRange = NSMakeRange(NSNotFound, 0);
-        mpReferenceWrapper = nil;
+        mpReferenceWrapper = reinterpret_cast<ReferenceWrapper*>(nil);
         mpMouseEventListener = nil;
         mpLastSuperEvent = nil;
     }
@@ -1790,7 +1790,7 @@ private:
         // some frames never become visible ..
         vcl::Window *pWindow = mpFrame -> GetWindow();
         if ( ! pWindow )
-            return nil;
+            return reinterpret_cast<::com::sun::star::accessibility::XAccessibleContext*>(nil);
 
         mpReferenceWrapper = new ReferenceWrapper;
         mpReferenceWrapper -> rAccessibleContext =  pWindow -> /*GetAccessibleChildWindow( 0 ) ->*/ GetAccessible() -> getAccessibleContext();
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index c1734b2..3539910 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -422,7 +422,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
                         [NSNumber numberWithBool:NO], @"kCUIWindowFrameDrawTitleSeparatorKey",
                         [NSNumber numberWithBool:YES], @"is.flipped",
                         nil]),
-                        nil);;
+                        reinterpret_cast<const __CFDictionary**>(nil));;
             }
             else
             {
commit d0e03b6ca12d90ce5e02998c8c7e7862bf2b7ebf
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Tue Oct 28 13:18:59 2014 -0400

    fix "trying to encode non-integer type as a bitfield"
    
    this problem arises when you compile with GCC
    (GNU objective-C mode)
    
    Change-Id: Ifa4ff252ae5a7b71320d41873a2c412a32dd0333

diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index 0920119..2a736a4 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -62,13 +62,13 @@ public:
     int                             mnMaxWidth;             // max. client width in pixels
     int                             mnMaxHeight;            // max. client height in pixels
     NSRect                          maFullScreenRect;       // old window size when in FullScreen
-    bool                            mbGraphics:1;           // is Graphics used?
-    bool                            mbFullScreen:1;         // is Window in FullScreen?
-    bool                            mbShown:1;
-    bool                            mbInitShow:1;
-    bool                            mbPositioned:1;
-    bool                            mbSized:1;
-    bool                            mbPresentation:1;
+    int                             mbGraphics:1;           // is Graphics used?
+    int                             mbFullScreen:1;         // is Window in FullScreen?
+    int                             mbShown:1;
+    int                             mbInitShow:1;
+    int                             mbPositioned:1;
+    int                             mbSized:1;
+    int                             mbPresentation:1;
 
     sal_uLong                           mnStyle;
     unsigned int                    mnStyleMask;            // our style mask from NSWindow creation
commit fad460d5510fbd9c1f4078584755fd42ac4e31a7
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sun Oct 26 03:17:10 2014 -0400

    vcl, apple_remote, toolkit: fix "OBJC_EXPORT is not defined"
    
    ( include <objc/objc-api.h> )
    
    Change-Id: Idcbfff670fb9d83e950e7eac60000ef3e0130f95

diff --git a/apple_remote/source/AppleRemote.h b/apple_remote/source/AppleRemote.h
index f80431b..a5da1b9 100644
--- a/apple_remote/source/AppleRemote.h
+++ b/apple_remote/source/AppleRemote.h
@@ -29,6 +29,9 @@
  *
  *****************************************************************************/
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 
 #import "HIDRemoteControlDevice.h"
diff --git a/apple_remote/source/KeyspanFrontRowControl.h b/apple_remote/source/KeyspanFrontRowControl.h
index c75e86b..fa527bb 100644
--- a/apple_remote/source/KeyspanFrontRowControl.h
+++ b/apple_remote/source/KeyspanFrontRowControl.h
@@ -29,6 +29,9 @@
  *
  *****************************************************************************/
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 
 #import "HIDRemoteControlDevice.h"
diff --git a/include/apple_remote/RemoteControl.h b/include/apple_remote/RemoteControl.h
index 04fab5a..589cfd9 100644
--- a/include/apple_remote/RemoteControl.h
+++ b/include/apple_remote/RemoteControl.h
@@ -31,6 +31,9 @@
 
 #include <sal/config.h>
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 
 #include <sal/types.h>
diff --git a/include/apple_remote/RemoteMainController.h b/include/apple_remote/RemoteMainController.h
index c4ee0ac..158ba6d 100644
--- a/include/apple_remote/RemoteMainController.h
+++ b/include/apple_remote/RemoteMainController.h
@@ -31,6 +31,9 @@
 
 #include <sal/config.h>
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 
 #include <sal/types.h>
diff --git a/toolkit/source/awt/vclxsystemdependentwindow.cxx b/toolkit/source/awt/vclxsystemdependentwindow.cxx
index 1ee5600..7e6d93f 100644
--- a/toolkit/source/awt/vclxsystemdependentwindow.cxx
+++ b/toolkit/source/awt/vclxsystemdependentwindow.cxx
@@ -30,6 +30,9 @@
 
 #ifdef MACOSX
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 #endif
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 09751da..fd4d86c 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -61,6 +61,9 @@
 
 #ifdef MACOSX
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 #endif
diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx
index 06cba55..e3fd071 100644
--- a/toolkit/source/awt/vclxtopwindow.cxx
+++ b/toolkit/source/awt/vclxtopwindow.cxx
@@ -22,6 +22,9 @@
 
 #if defined ( MACOSX )
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 #endif
diff --git a/toolkit/source/awt/vclxwindow1.cxx b/toolkit/source/awt/vclxwindow1.cxx
index 46b2e72..f2cc331 100644
--- a/toolkit/source/awt/vclxwindow1.cxx
+++ b/toolkit/source/awt/vclxwindow1.cxx
@@ -28,6 +28,9 @@
 #include <postwin.h>
 #elif defined ( MACOSX )
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 #endif
diff --git a/vcl/inc/OpenGLWrapper.hxx b/vcl/inc/OpenGLWrapper.hxx
index 9134801..833a070 100644
--- a/vcl/inc/OpenGLWrapper.hxx
+++ b/vcl/inc/OpenGLWrapper.hxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
+
 #include "AppKit/NSOpenGLView.h"
 #include "AppKit/NSOpenGL.h"
 
diff --git a/vcl/inc/osx/a11yfactory.h b/vcl/inc/osx/a11yfactory.h
index c739f3e..4e92126 100644
--- a/vcl/inc/osx/a11yfactory.h
+++ b/vcl/inc/osx/a11yfactory.h
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_VCL_INC_OSX_A11YFACTORY_H
 #define INCLUDED_VCL_INC_OSX_A11YFACTORY_H
 
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
+
 #include "osxvcltypes.h"
 #include "a11ywrapper.h"
 #include <com/sun/star/accessibility/XAccessibleContext.hpp>
diff --git a/vcl/inc/osx/osxvcltypes.h b/vcl/inc/osx/osxvcltypes.h
index f1659c4..96edccc 100644
--- a/vcl/inc/osx/osxvcltypes.h
+++ b/vcl/inc/osx/osxvcltypes.h
@@ -21,6 +21,9 @@
 #define INCLUDED_VCL_INC_OSX_OSXVCLTYPES_H
 
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 #import <AppKit/NSEvent.h>
 #include "postmac.h"
diff --git a/vcl/inc/osx/printview.h b/vcl/inc/osx/printview.h
index e396bd8..b63900b 100644
--- a/vcl/inc/osx/printview.h
+++ b/vcl/inc/osx/printview.h
@@ -21,6 +21,9 @@
 #define INCLUDED_VCL_INC_OSX_PRINTVIEW_H
 
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 
diff --git a/vcl/inc/osx/saldata.hxx b/vcl/inc/osx/saldata.hxx
index fc8d3e8..6c1650d 100644
--- a/vcl/inc/osx/saldata.hxx
+++ b/vcl/inc/osx/saldata.hxx
@@ -23,6 +23,9 @@
 #include <config_features.h>
 
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h
index ba0eb12..e8f797e 100644
--- a/vcl/inc/osx/salinst.h
+++ b/vcl/inc/osx/salinst.h
@@ -27,6 +27,9 @@
 #include <osl/thread.hxx>
 
 #ifdef MACOSX
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include "osx/osxvcltypes.h"
 #endif
 #include "salinst.hxx"
diff --git a/vcl/inc/osx/saltimer.h b/vcl/inc/osx/saltimer.h
index b751a81..e663c65 100644
--- a/vcl/inc/osx/saltimer.h
+++ b/vcl/inc/osx/saltimer.h
@@ -21,6 +21,9 @@
 #define INCLUDED_VCL_INC_OSX_SALTIMER_H
 
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include "postmac.h"
 
diff --git a/vcl/inc/osx/vclnsapp.h b/vcl/inc/osx/vclnsapp.h
index c899ffc..9a603a5 100644
--- a/vcl/inc/osx/vclnsapp.h
+++ b/vcl/inc/osx/vclnsapp.h
@@ -23,6 +23,9 @@
 #include <config_features.h>
 
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include "Cocoa/Cocoa.h"
 #include "postmac.h"
 
diff --git a/vcl/inc/quartz/utils.h b/vcl/inc/quartz/utils.h
index 57a0402..ed7876a 100644
--- a/vcl/inc/quartz/utils.h
+++ b/vcl/inc/quartz/utils.h
@@ -23,6 +23,9 @@
 #include <iostream>
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <CoreFoundation/CoreFoundation.h>
 #include <Foundation/Foundation.h>
 #ifdef MACOSX
diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx
index 374ac54..7ff2819 100644
--- a/vcl/osx/DataFlavorMapping.cxx
+++ b/vcl/osx/DataFlavorMapping.cxx
@@ -35,6 +35,9 @@
 #include <string.h>
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Cocoa/Cocoa.h>
 #include <postmac.h>
 
diff --git a/vcl/osx/DataFlavorMapping.hxx b/vcl/osx/DataFlavorMapping.hxx
index 9632313..93754a5 100644
--- a/vcl/osx/DataFlavorMapping.hxx
+++ b/vcl/osx/DataFlavorMapping.hxx
@@ -26,6 +26,9 @@
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 #include <postmac.h>
 
diff --git a/vcl/osx/DragActionConversion.hxx b/vcl/osx/DragActionConversion.hxx
index fbb5ea3..b77047d 100644
--- a/vcl/osx/DragActionConversion.hxx
+++ b/vcl/osx/DragActionConversion.hxx
@@ -23,6 +23,9 @@
 #include <sal/types.h>
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 #include <postmac.h>
 
diff --git a/vcl/osx/DragSource.hxx b/vcl/osx/DragSource.hxx
index 58b18c1..aa4f473 100644
--- a/vcl/osx/DragSource.hxx
+++ b/vcl/osx/DragSource.hxx
@@ -33,6 +33,9 @@
 #include <boost/noncopyable.hpp>
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #import <Cocoa/Cocoa.h>
 #include <postmac.h>
 
diff --git a/vcl/osx/PictToBmpFlt.cxx b/vcl/osx/PictToBmpFlt.cxx
index dc04348..f8d8c63 100644
--- a/vcl/osx/PictToBmpFlt.cxx
+++ b/vcl/osx/PictToBmpFlt.cxx
@@ -18,6 +18,9 @@
  */
 
 #include <premac.h>
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Carbon/Carbon.h>
 #include <QuickTime/QuickTime.h>
 #include <postmac.h>
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 24184af..d218d94 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -46,6 +46,9 @@
 #include "salwtype.hxx"
 
 #include "premac.h"
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <objc/objc-runtime.h>
 // needed for theming
 // FIXME: move theming code to salnativewidgets.cxx
commit d98d5825b7a0ade11c50dc219f673a66b85fb47f
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Oct 8 10:38:28 2014 -0400

    Use GNU objc ABI/runtime instead of NeXT ABI/runtime when compiler is GCC
    
    also,
      + fix "cannot find interface declaration for NXConstantString"
      + sal/osl/unx/system.h: include <objc/objc-api.h> when OBJC_EXPORT
        is not defined
    
    Change-Id: I5f0df322435be8244d372642dee1c21d783306f1

diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx
index 3d6ab4d..8e9dbda 100644
--- a/sal/osl/unx/system.hxx
+++ b/sal/osl/unx/system.hxx
@@ -199,6 +199,9 @@
 #ifdef MACOSX
 #define __OPENTRANSPORTPROVIDERS__ // these are already defined
 #define TimeValue CFTimeValue      // Do not conflict with TimeValue in sal/inc/osl/time.h
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <Carbon/Carbon.h>
 #undef TimeValue
 #   ifndef ETIME
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 81b6fef..5ac6328 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -59,9 +59,21 @@ gb_CXXFLAGS := \
 
 # these are to get g++ to switch to Objective-C++ mode
 # (see toolkit module for a case where it is necessary to do it this way)
-gb_OBJCXXFLAGS := -x objective-c++ -fobjc-exceptions
-
-gb_OBJCFLAGS := -x objective-c -fobjc-exceptions
+gb_OBJCXXFLAGS := \
+	-x objective-c++ \
+	-fobjc-exceptions \
+	$(if $(filter TRUE,$(COM_GCC_IS_CLANG)),,\
+		-fgnu-runtime \
+		-fconstant-string-class=NSConstantString \
+	)
+
+gb_OBJCFLAGS := \
+	-x objective-c \
+	-fobjc-exceptions \
+	$(if $(filter TRUE,$(COM_GCC_IS_CLANG)),,\
+		-fgnu-runtime \
+		-fconstant-string-class=NSConstantString \
+	)
 
 # LinkTarget class
 
commit bd4fc57449b6c0927adacc3a69bdba5c30d0eadb
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Fri Dec 26 09:48:06 2014 -0500

    lingucomponent:MacOSXSpell: switch off for OS X 10.5
    
    Change-Id: I8f8eb6717b904aa4c231466ee7a1b873bc0035c1

diff --git a/Repository.mk b/Repository.mk
index d3e0a30..c4dafe1 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -457,7 +457,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 			AppleRemote \
 		) \
 		fps_aqua \
-		MacOSXSpell \
+		$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),MacOSXSpell) \
 	) \
 ))
 
diff --git a/lingucomponent/Module_lingucomponent.mk b/lingucomponent/Module_lingucomponent.mk
index 92d582c..68dcb78 100644
--- a/lingucomponent/Module_lingucomponent.mk
+++ b/lingucomponent/Module_lingucomponent.mk
@@ -14,7 +14,9 @@ $(eval $(call gb_Module_add_targets,lingucomponent,\
 	Library_guesslang \
 	Library_hyphen \
 	Library_lnth \
-	$(if $(filter MACOSX,$(OS)),Library_MacOSXSpell) \
+	$(if $(filter MACOSX,$(OS)),\
+		$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),Library_MacOSXSpell) \
+	) \
 	Library_spell \
 	StaticLibrary_ulingu \
 ))
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index e567683..7009484 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -132,7 +132,7 @@ $(eval $(call gb_Rdb_add_components,services,\
 				$(call gb_Helper_optional,AVMEDIA,avmedia/source/quicktime/avmediaQuickTime) \
 			) \
 		) \
-		lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \
+		$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),lingucomponent/source/spellcheck/macosxspell/MacOSXSpell) \
 		fpicker/source/aqua/fps_aqua \
 		shell/source/backends/macbe/macbe1 \
 		vcl/vcl.macosx \
commit 608a16aa5257a09267a5b1f6977e92f7a614d22d
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Thu Dec 25 16:19:29 2014 -0500

    Disable OOoSpotlightImporter extension for OS X 10.5
    
    Change-Id: I0d9c48d511094fe3a5464f6abc811c2fb33bab4e

diff --git a/extensions/Module_extensions.mk b/extensions/Module_extensions.mk
index fa527f5..c7d478c 100644
--- a/extensions/Module_extensions.mk
+++ b/extensions/Module_extensions.mk
@@ -113,9 +113,9 @@ endif # ENABLE_NPAPI_FROM_BROWSER=TRUE
 
 ifeq ($(OS),MACOSX)
 $(eval $(call gb_Module_add_targets,extensions,\
-	Library_OOoSpotlightImporter \
-	Package_mdibundle \
-	Package_OOoSpotlightImporter \
+	$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),Library_OOoSpotlightImporter) \
+	$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),Package_mdibundle) \
+	$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),Package_OOoSpotlightImporter) \
 ))
 endif # OS=MACOSX
 
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index b0f3382..32de282 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -408,6 +408,7 @@ End
 #endif
 
 #ifdef MACOSX
+#if MACOSX_SDK_VERSION >= 1060
 File gid_File_Spotlight_Bundle
     TXT_FILE_BODY;
     Dir = FILELIST_DIR;
@@ -422,6 +423,7 @@ File gid_File_Spotlight_Bundle_lib
     Styles = (FILELIST,USE_INTERNAL_RIGHTS);
 End
 #endif
+#endif
 
 File gid_File_Images
     TXT_FILE_BODY;
commit 504678d7727ea02e30cbdda906a51344bdd09282
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Dec 24 15:03:00 2014 -0500

    avmedia: disable avmediaQuickTime for OS X 10.5
    
    + fix `OBJC_EXPORT is not defined' and `cannot convert to NSError**'
    
    Change-Id: I4842a74feffe9707b031b81c7941eccac0211ce0

diff --git a/Repository.mk b/Repository.mk
index 5de0234..d3e0a30 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -271,7 +271,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 	$(call gb_Helper_optional,AVMEDIA,avmedia) \
 	$(if $(filter MACOSX,$(OS)),\
 		$(if $(filter-out 1050 1060,$(MACOSX_SDK_VERSION)),avmediaMacAVF) \
-		$(if $(ENABLE_MACOSX_SANDBOX),,avmediaQuickTime) \
+		$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)), \
+			$(if $(ENABLE_MACOSX_SANDBOX),,avmediaQuickTime) \
+		) \
 	) \
 	$(call gb_Helper_optional,SCRIPTING, \
 		basctl \
diff --git a/avmedia/Module_avmedia.mk b/avmedia/Module_avmedia.mk
index 27b588d..f2eecc3 100644
--- a/avmedia/Module_avmedia.mk
+++ b/avmedia/Module_avmedia.mk
@@ -36,12 +36,14 @@ $(eval $(call gb_Module_add_targets,avmedia,\
 endif
 
 ifeq ($(OS),MACOSX)
+ifneq (1050,$(MACOSX_SDK_VERSION))
 ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE)
 $(eval $(call gb_Module_add_targets,avmedia,\
 	Library_avmediaQuickTime \
 ))
 endif
 endif
+endif
 
 ifeq ($(OS),MACOSX)
 ifneq (1050,$(MACOSX_SDK_VERSION))
diff --git a/avmedia/source/quicktime/framegrabber.mm b/avmedia/source/quicktime/framegrabber.mm
index 401c17d..0bf06d9 100644
--- a/avmedia/source/quicktime/framegrabber.mm
+++ b/avmedia/source/quicktime/framegrabber.mm
@@ -74,7 +74,7 @@ bool FrameGrabber::create( const ::rtl::OUString& rURL )
 
     // create the Movie
 
-        mpMovie = [mpMovie initWithURL:aURL error:nil];
+        mpMovie = [mpMovie initWithURL:aURL error:reinterpret_cast<NSError **>(nil)];
         if(mpMovie)
         {
             [mpMovie retain];
diff --git a/avmedia/source/quicktime/quicktimecommon.hxx b/avmedia/source/quicktime/quicktimecommon.hxx
index 1dedfab..637619c 100644
--- a/avmedia/source/quicktime/quicktimecommon.hxx
+++ b/avmedia/source/quicktime/quicktimecommon.hxx
@@ -21,6 +21,9 @@
 #define INCLUDED_AVMEDIA_SOURCE_QUICKTIME_QUICKTIMECOMMON_HXX
 
 #ifdef MACOSX
+#ifndef OBJC_EXPORT
+#include <objc/objc-api.h>
+#endif
 #include <premac.h>
 #import <Cocoa/Cocoa.h>
 #import <QTKit/QTKit.h>
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index b9bea85..e567683 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -128,7 +128,9 @@ $(eval $(call gb_Rdb_add_components,services,\
 			$(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \
 		) \
 		$(if $(filter TRUE,$(ENABLE_MACOSX_SANDBOX)),, \
-			$(call gb_Helper_optional,AVMEDIA,avmedia/source/quicktime/avmediaQuickTime) \
+			$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)), \
+				$(call gb_Helper_optional,AVMEDIA,avmedia/source/quicktime/avmediaQuickTime) \
+			) \
 		) \
 		lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \
 		fpicker/source/aqua/fps_aqua \
commit 25788d051faa175549e8b38ee223032aa4409052
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Thu Dec 25 11:01:26 2014 -0500

    disable OpenCL (and glew) on OS X 10.5
    
    Change-Id: I6d3fdcca15b3c5191851feea33434b9b5df7b26f

diff --git a/configure.ac b/configure.ac
index 8d3509f..09d6570 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10406,11 +10406,15 @@ dnl =================================================
 dnl Check whether to build with OpenCL support.
 dnl =================================================
 
-if test $_os != iOS -a $_os != Android; then
+if test "$_os" = "Darwin" -a "$with_macosx_sdk" = "10.5"; then
+    HAVE_FEATURE_OPENCL=
+else
+  if test $_os != iOS -a $_os != Android; then
     # OPENCL in BUILD_TYPE tells that OpenCL is potentially available on the platform (optional at run-time,
     # used through clew).
     BUILD_TYPE="$BUILD_TYPE OPENCL"
     AC_DEFINE(HAVE_FEATURE_OPENCL)
+  fi
 fi
 
 dnl ===================================================================
commit bbd64652855bd5a5d195d6a7372edd98ddb25c3e
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Tue Nov 4 12:21:54 2014 -0500

    sd/source/ui/remotecontrol: there're not only OS X >=10.8
    
    related commit: 8bfc9a20ccea2689fec1ffe0654db1f95179bd4f
    
    Change-Id: I9862aecc02a9cfb8f4db97159f1bd4560eff1cef

diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index fb817dd..eebd8d5 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -41,7 +41,7 @@
 #ifdef MACOSX
   #include <osl/conditn.hxx>
   #include <premac.h>
-  #if MACOSX_SDK_VERSION == 1080
+  #if MACOSX_SDK_VERSION >= 1070
     #import <IOBluetooth/IOBluetooth.h>
   #else
     #import <CoreFoundation/CoreFoundation.h>
commit 1f9f6d5b76e25006bbee3c6094bf0151935ce366
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Fri Dec 26 23:41:06 2014 -0500

    solenv-filelists.pm: fix "can't call method `mode' on an undefined value"
    
    Change-Id: I2b69aad61b8fa674be510b8822b6f1959a1c501e

diff --git a/solenv/bin/modules/installer/filelists.pm b/solenv/bin/modules/installer/filelists.pm
index bf9dc2f..bc1dafd 100644
--- a/solenv/bin/modules/installer/filelists.pm
+++ b/solenv/bin/modules/installer/filelists.pm
@@ -88,7 +88,10 @@ sub resolve_filelist_flag
                         if ($use_internal_rights)
                         {
                             my $st = stat($path);
-                            $newfile{'UnixRights'} = sprintf("%o", $st->mode & 0777);
+                            if ($st)
+                            {
+                                $newfile{'UnixRights'} = sprintf("%o", $st->mode & 0777);
+                            }
                         }
 
                         push @newfiles, \%newfile;
commit aec33ef3039c90b175d4664dd64cf20bafcec0c9
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sat Jun 13 10:51:22 2015 -0400

    restore testsuite workarounds for pre-10.6 OS X
    
    Change-Id: I4edf27007a25ad52385c67c51b8a1ac83f14460d

diff --git a/filter/qa/cppunit/xslt-test.cxx b/filter/qa/cppunit/xslt-test.cxx
index a424c98..72d7d87 100644
--- a/filter/qa/cppunit/xslt-test.cxx
+++ b/filter/qa/cppunit/xslt-test.cxx
@@ -46,8 +46,10 @@ public:
     void testXsltCopyNew();
 
     CPPUNIT_TEST_SUITE(XsltFilterTest);
+#if !( defined(MACOSX) && (MACOSX_SDK_VERSION < 1060) )
     CPPUNIT_TEST(testXsltCopyOld);
     CPPUNIT_TEST(testXsltCopyNew);
+#endif
     CPPUNIT_TEST_SUITE_END();
 };
 
diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx
index ea430f9..5a1a7ea 100644
--- a/sal/qa/osl/process/osl_process.cxx
+++ b/sal/qa/osl/process/osl_process.cxx
@@ -469,8 +469,8 @@ public:
     }
 
     CPPUNIT_TEST_SUITE(Test_osl_executeProcess);
-    //TODO: Repair these (at least under Windows)
-#if !defined(WNT)
+    //TODO: Repair these
+#if !defined(WNT) && !(defined(MACOSX) && (MACOSX_SDK_VERSION < 1060))
     CPPUNIT_TEST(osl_execProc_parent_equals_child_environment);
     CPPUNIT_TEST(osl_execProc_merged_child_environment);
 #endif
commit 0bbabdde9a88d6fbc49cb22d43d9d8344160fea8
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Sep 9 18:44:15 2015 -0400

    vcl/osx/DropTarget.cxx: use `convertScreenToBase' for OS X < 10.7
    
    related commit: 7bfe288dabae31ea36ce053359ffef215b0e480b
    
    Change-Id: I25aedee29c3bbad8dcbde13e22f7a31377ad069e

diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index 9bcc8f8..ed74170 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -203,8 +203,11 @@ NSDragOperation DropTarget::draggingEntered(id sender)
         NSPoint mouseLoc = [NSEvent mouseLocation];
 
         id wnd = [mView window];
+#if MACOSX_SDK_VERSION < 1070
+        NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil];
+#else
         NSPoint dragLocation = [mView convertPoint:[wnd convertRectFromScreen:NSMakeRect(mouseLoc.x, mouseLoc.y, 1, 1)].origin fromView:nil];
-
+#endif
         CocoaToVCL(dragLocation, bounds);
 
         sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
@@ -244,8 +247,11 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
         NSPoint mouseLoc = [NSEvent mouseLocation];
 
         id wnd = [mView window];
+#if MACOSX_SDK_VERSION < 1070
+        NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil];
+#else
         NSPoint dragLocation = [mView convertPoint:[wnd convertRectFromScreen:NSMakeRect(mouseLoc.x, mouseLoc.y, 1, 1)].origin fromView:nil];
-
+#endif
         CocoaToVCL(dragLocation, bounds);
 
         sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
@@ -318,8 +324,11 @@ BOOL DropTarget::performDragOperation()
         NSPoint mouseLoc = [NSEvent mouseLocation];
 
         id wnd = [mView window];
+#if MACOSX_SDK_VERSION < 1070
+        NSPoint dragLocation = [mView convertPoint:[wnd convertScreenToBase:mouseLoc] fromView:nil];
+#else
         NSPoint dragLocation = [mView convertPoint:[wnd convertRectFromScreen:NSMakeRect(mouseLoc.x, mouseLoc.y, 1, 1)].origin fromView:nil];
-
+#endif
         CocoaToVCL(dragLocation, bounds);
 
         sal_Int32 posX = static_cast<sal_Int32>(dragLocation.x);
commit eff2ee2c4d344c601f1e30ba9ff7d16ecaeed73c
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Fri Oct 31 13:40:18 2014 -0400

    vlc: use OpenGL "2.1 legacy context" for OS X versions < 10.7
    
    ``With Mac OS X 10.7 Lion OpenGL 3.2 support was added. Till then
    only OpenGL 2.1 was available.''
    
    related commit: 8b384c946cb6725d691123152f5e7c6ac0692185

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 6d8c460..dd773f93 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -778,7 +778,13 @@ SalObject* AquaSalInstance::CreateObject( SalFrame* pParent, SystemWindowData* p
     AquaSalObject *pObject = NULL;
 
     if ( pParent )
+    {
+#if defined(MACOSX) && MACOSX_SDK_VERSION < 1070
+        if (pWindowData && pWindowData->bOpenGL)
+            pWindowData->bLegacy = true;
+#endif
         pObject = new AquaSalObject( static_cast<AquaSalFrame*>(pParent), pWindowData );
+    }
 
     return pObject;
 }
diff --git a/vcl/osx/salobj.cxx b/vcl/osx/salobj.cxx
index 58e2c64..4657d52 100644
--- a/vcl/osx/salobj.cxx
+++ b/vcl/osx/salobj.cxx
@@ -66,6 +66,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
             };
             pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
         }
+#if defined(MACOSX) && MACOSX_SDK_VERSION >= 1070
         else
         {
             NSOpenGLPixelFormatAttribute aAttributes[] =
@@ -81,6 +82,7 @@ AquaSalObject::AquaSalObject( AquaSalFrame* pFrame, SystemWindowData* pWindowDat
             };
             pixFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:aAttributes];
         }
+#endif
 
         maSysData.mpNSView = [[NSOpenGLView alloc] initWithFrame: aInitFrame pixelFormat:pixFormat];
     }
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index c44b95b..d092ab3 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -58,7 +58,11 @@ OpenGLContext::OpenGLContext():
     m_pChildWindow(NULL),
     mbInitialized(false),
     mnRefCount(0),
+#if defined(MACOSX) && MACOSX_SDK_VERSION < 1070
+    mbRequestLegacyContext(true),
+#else
     mbRequestLegacyContext(false),
+#endif
     mbUseDoubleBufferedRendering(true),
     mnFramebufferCount(0),
     mpCurrentFramebuffer(NULL),
@@ -1044,8 +1048,14 @@ bool OpenGLContext::initWindow()
 {
     if( !m_pChildWindow )
     {
-        SystemWindowData winData = generateWinData(mpWindow, false);
+#if defined(MACOSX) && MACOSX_SDK_VERSION < 1070
+        SystemWindowData winData = generateWinData(mpWindow, /* bLegacy */ true);
+#else
+        SystemWindowData winData = generateWinData(mpWindow, /* bLegacy */ false);
+#endif
+        //m_pChildWindow = new SystemChildWindow(mpWindow, 0, &winData, false);
         m_pChildWindow = VclPtr<SystemChildWindow>::Create(mpWindow, 0, &winData, false);
+        m_xChildWindowGC.reset(m_pChildWindow);
     }
 
     if( m_pChildWindow )
commit f3bee8ff659b8af59d9d4ff76a243e7dcd2b273f
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Dec 24 03:42:47 2014 -0500

    drop -fvisibility=hidden @ gb_VISIBILITY_FLAGS on OS X 10.5
    
    Change-Id: I4353d36f4ab4941441e384aeac0ca7a3d2c9bdd8

diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 93b35a4..06ce425 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -90,7 +90,9 @@ endif
 
 ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE)
 gb_VISIBILITY_FLAGS := -DHAVE_GCC_VISIBILITY_FEATURE
-# If CC or CXX already include -fvisibility=hidden, don't duplicate it
+# avoid -fvisibility=hidden when building for OS X 10.5
+ifneq ($(MACOSX_SDK_VERSION),1050)
+# don't duplicate -fvisibility=hidden if CC or CXX already include it
 ifeq (,$(filter -fvisibility=hidden,$(CC)))
 gb__visibility_hidden := -fvisibility=hidden
 ifeq ($(COM_GCC_IS_CLANG),TRUE)
@@ -100,6 +102,8 @@ endif
 endif
 gb_VISIBILITY_FLAGS += $(gb__visibility_hidden)
 endif
+endif
+
 ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE)
 gb_VISIBILITY_FLAGS_CXX := -fvisibility-inlines-hidden
 endif
commit 59bc4f181293f627df788bc2ba05795468ee36b0
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Dec 24 07:19:21 2014 -0500

    add NS_BUILD_32_LIKE_64 definition to build line flags (gb_OSDEFS)
    
    For example, it makes NSRect to be the same as CGRect.
    (see NSGeometry.h)
    
    Change-Id: I182703b3ab5e0791c0a092f51a0151d1dfa8fe6a

diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 2ca243a..81b6fef 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -35,6 +35,7 @@ gb_OSDEFS := \
 	-D_REENTRANT \
 	-DNO_PTHREAD_PRIORITY \
 	-DMACOSX_SDK_VERSION=$(MACOSX_SDK_VERSION) \
+	-DNS_BUILD_32_LIKE_64 \
 	$(EXTRA_CDEFS) \
 
 
commit 154a254a0897d758c833157b01d35c271fda3e79
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sat Oct 25 11:05:30 2014 -0400

    Don't assume that /usr/bin/mktemp is always a BSD mktemp on OSX, add backup for GNU mktemp
    
    Change-Id: Ifb119dd13062593cba5aa3cb1dacc54194339544

diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index a2941cd..2ca243a 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -24,8 +24,8 @@ gb_SDKDIR := $(MACOSX_SDK_PATH)
 
 include $(GBUILDDIR)/platform/com_GCC_defs.mk
 
-# Darwin mktemp -t expects a prefix, not a pattern
-gb_MKTEMP ?= /usr/bin/mktemp -t gbuild.
+# Note that BSD mktemp -t expects a prefix, not a pattern; if it fails, assume GNU syntax
+gb_MKTEMP ?= /usr/bin/mktemp -t gbuild. 2>/dev/null || mktemp -t gbuild.XXXXXX
 
 gb_OSDEFS := \
 	-D$(OS) \
commit 5b07b65ed649ae1cd7744ace6c1b0b72bf204fc5
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sat Dec 27 06:25:11 2014 -0500

    macosx_x86_64 is not "the only architecture" for OS X
    
    use ::globals::os eq 'MACOSX' check in solenv/bin/modules/installer
    
    add PLATFORM_MACOSX_POWERPC to isValidPlatform @ dp_platform.cxx
    
    Change-Id: Iced611e001ce69860d001b10c84d12a568b40a59

diff --git a/desktop/source/deployment/misc/dp_platform.cxx b/desktop/source/deployment/misc/dp_platform.cxx
index dd8648e..e56bf2e 100644
--- a/desktop/source/deployment/misc/dp_platform.cxx
+++ b/desktop/source/deployment/misc/dp_platform.cxx
@@ -59,6 +59,7 @@
 #define PLATFORM_FREEBSD_X86_64     "freebsd_x86_64"
 #define PLATFORM_NETBSD_X86         "netbsd_x86"
 #define PLATFORM_NETBSD_X86_64      "netbsd_x86_64"
+#define PLATFORM_MACOSX_POWERPC     "macosx_powerpc"
 #define PLATFORM_MACOSX_X86         "macosx_x86"
 #define PLATFORM_MACOSX_X86_64      "macosx_x86_64"
 #define PLATFORM_OPENBSD_X86        "openbsd_x86"
@@ -175,6 +176,8 @@ namespace
             ret = checkOSandCPU("NetBSD", "x86");
         else if (token == PLATFORM_NETBSD_X86_64)
             ret = checkOSandCPU("NetBSD", "X86_64");
+        else if (token == PLATFORM_MACOSX_POWERPC)
+            ret = checkOSandCPU("MacOSX", "PowerPC");
         else if (token == PLATFORM_MACOSX_X86)
             ret = checkOSandCPU("MacOSX", "x86");
         else if (token == PLATFORM_MACOSX_X86_64)
diff --git a/solenv/bin/modules/installer/download.pm b/solenv/bin/modules/installer/download.pm
index d62680d..b8a5b4e 100644
--- a/solenv/bin/modules/installer/download.pm
+++ b/solenv/bin/modules/installer/download.pm
@@ -576,7 +576,7 @@ sub resolve_variables_in_downloadname
     elsif ( $installer::globals::issolarissparcbuild ) { $os = "solsparc"; }
     elsif ( $installer::globals::issolarisx86build ) { $os = "solia"; }
     elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; }
-    elsif ( $installer::globals::platformid eq 'macosx_x86_64' ) { $os = "macosxx"; }
+    elsif ( $installer::globals::os eq 'MACOSX' ) { $os = "macosx"; }
     else { $os = ""; }
     $downloadname =~ s/\{os\}/$os/;
 
diff --git a/solenv/bin/modules/installer/parameter.pm b/solenv/bin/modules/installer/parameter.pm
index bb98b7c..9029ed5 100644
--- a/solenv/bin/modules/installer/parameter.pm
+++ b/solenv/bin/modules/installer/parameter.pm
@@ -273,7 +273,7 @@ sub setglobalvariables
         }
     }
 
-    if ( $installer::globals::platformid eq 'macosx_x86_64')
+    if ( $installer::globals::os eq 'MACOSX')
     {
         $installer::globals::ismacbuild = 1;
 
diff --git a/solenv/bin/modules/installer/simplepackage.pm b/solenv/bin/modules/installer/simplepackage.pm
index ac33798..084c523 100644
--- a/solenv/bin/modules/installer/simplepackage.pm
+++ b/solenv/bin/modules/installer/simplepackage.pm
@@ -670,7 +670,7 @@ sub create_simple_package
     my $extensionfolder = get_extensions_dir($subfolderdir);
     installer::systemactions::remove_empty_dirs_in_folder($extensionfolder);
 
-    if ( $installer::globals::platformid eq 'macosx_x86_64' )
+    if ( $installer::globals::os eq 'MACOSX' )
     {
         installer::worker::put_scpactions_into_installset("$installdir/$packagename");
     }
commit b7d10db0d89ecd4c546f602cefaf8337746cbda4
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sun Nov 2 12:39:47 2014 -0500

    provide universal implementation for aligned memory allocation
    
    use posix_memalign only if it's available; if not, try memalign first
    
    don't blindly guess their availability by platform
    (with an exception for Android)
    
    introduce HAVE_MEMALIGN and HAVE_POSIX_MEMALIGN
    
    Note that posix_memalign is not available everywhere
    (as are its replacements like memalign). For example,
    Darwin/OSX < 10.6 has neither posix_memalign or memalign.
    
    Change-Id: I0cb3b14e1f2d94d4aa02b40c36d353c2b7a78dba

diff --git a/config_host.mk.in b/config_host.mk.in
index 90f9741..101d83b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -263,6 +263,8 @@ export HAVE_LD_BSYMBOLIC_FUNCTIONS=@HAVE_LD_BSYMBOLIC_FUNCTIONS@
 export HAVE_LD_HASH_STYLE=@HAVE_LD_HASH_STYLE@
 export HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION=@HAVE_NON_CONST_NPP_GETMIMEDESCRIPTION@
 export HAVE_POSIX_FALLOCATE=@HAVE_POSIX_FALLOCATE@
+export HAVE_POSIX_MEMALIGN=@HAVE_POSIX_MEMALIGN@
+export HAVE_MEMALIGN=@HAVE_MEMALIGN@
 export HAVE_THREADSAFE_STATICS=@HAVE_THREADSAFE_STATICS@
 export HELP_COMMON_ONLY=@HELP_COMMON_ONLY@
 export HOST_PLATFORM=@host@
diff --git a/configure.ac b/configure.ac
index 0ebde2f..8d3509f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4611,6 +4611,14 @@ AC_SUBST(SDKDIRNAME_FOR_BUILD)
 AC_SUBST(WORKDIR_FOR_BUILD)
 
 dnl ===================================================================
+dnl Check for availability of posix_memalign and memalign
+dnl ===================================================================
+AC_CHECK_FUNC([posix_memalign], [HAVE_POSIX_MEMALIGN=YES], [HAVE_POSIX_MEMALIGN=NO])
+AC_CHECK_FUNC([memalign], [HAVE_MEMALIGN=YES], [HAVE_MEMALIGN=NO])
+AC_SUBST(HAVE_POSIX_MEMALIGN)
+AC_SUBST(HAVE_MEMALIGN)
+
+dnl ===================================================================
 dnl Check for syslog header
 dnl ===================================================================
 AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 79a0e2a..14b72ae 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -19,6 +19,13 @@ $(eval $(call gb_Library_set_include,sal,\
 	-I$(SRCDIR)/sal/inc \
 ))
 
+ifeq ($(HAVE_POSIX_MEMALIGN),YES)
+$(eval $(call gb_Library_add_defs,sal,-DHAVE_POSIX_MEMALIGN))
+endif
+ifeq ($(HAVE_MEMALIGN),YES)
+$(eval $(call gb_Library_add_defs,sal,-DHAVE_MEMALIGN))
+endif
+
 $(eval $(call gb_Library_add_defs,sal,\
 	$(if $(filter $(ALLOC),SYS_ALLOC TCMALLOC JEMALLOC)$(filter-out X$(ENABLE_RUNTIME_OPTIMIZATIONS),XTRUE), \
 		-DFORCE_SYSALLOC \
diff --git a/sal/osl/unx/memory.cxx b/sal/osl/unx/memory.cxx
index e9fb9a8..4d60581 100644
--- a/sal/osl/unx/memory.cxx
+++ b/sal/osl/unx/memory.cxx
@@ -10,8 +10,12 @@
 #include <internal/oslmemory.h>
 
 #include <stdlib.h>
+
 #ifdef __ANDROID__
 #include <malloc.h>
+#ifndef HAVE_MEMALIGN
+#define HAVE_MEMALIGN 1 /* for Android, we are really sure about memalign */
+#endif
 #endif
 
 void* osl_aligned_alloc( sal_Size align, sal_Size size )
@@ -22,19 +26,30 @@ void* osl_aligned_alloc( sal_Size align, sal_Size size )
     }
     else
     {
-#if defined __ANDROID__
-        return memalign(align, size);
-#else
+#if defined(HAVE_POSIX_MEMALIGN)
         void* ptr;
         int err = posix_memalign(&ptr, align, size);
         return err ? NULL : ptr;
+#elif defined(HAVE_MEMALIGN)
+        return memalign(align, size);
+#else
+        void* ptr = malloc(size + (align - 1) + sizeof(void*));
+        if (!ptr) return NULL;
+        char* aptr = ((char*)ptr) + sizeof(void*);
+        aptr += (align - ((size_t)aptr & (align - 1))) & (align - 1);
+        ((void**)aptr)[-1] = ptr;
+        return aptr;
 #endif
     }
 }
 
 void osl_aligned_free( void* p )
 {
+#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN)
     free(p);
+#else
+    free(((void**)p)[-1]);
+#endif
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1978d09f14710cb1e10a46d7ed30d9f6eb569742
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Aug 26 19:30:04 2015 -0400

    vcl: restore other bits of pre-10.8 conditional code
    
    related commits:
      4fa8282816cb39692678e9da6b6693e821a3039b
      ec147012340219c8bb5eaf8fe3d41be7836bc261
      16996c6b91b53e3c7d316296833bdb8a9cb60c22
    
    Change-Id: Ie8962f8d26f163eed91fdf6b137b0d9830183dd2

diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index d38fb7c..24184af 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1248,7 +1248,12 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
     getAppleScrollBarVariant(aStyleSettings);
 
     // set scrollbar size
+#if MACOSX_SDK_VERSION >= 1070
     aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]) );
+#else
+    aStyleSettings.SetScrollBarSize( static_cast<long int>([NSScroller scrollerWidth]) );
+#endif
+
     // images in menus false for MacOSX
     aStyleSettings.SetPreferredUseImagesInMenus( false );
     aStyleSettings.SetHideDisabledMenuItems( true );
diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx
index f2c3c9f..2bdc20c 100644
--- a/vcl/osx/salmenu.cxx
+++ b/vcl/osx/salmenu.cxx
@@ -884,7 +884,12 @@ Rectangle AquaSalMenu::GetMenuBarButtonRectPixel( sal_uInt16 i_nItemId, SalFrame
     if( ! pNSWin )
         return Rectangle();
 
+#if MACOSX_SDK_VERSION >= 1070
     NSRect aRect = [pNSWin convertRectToScreen:[pNSWin frame]];
+#else
+    NSRect aRect = [pNSWin frame];
+    aRect.origin = [pNSWin convertBaseToScreen: NSMakePoint( 0, 0 )];
+#endif
 
     // make coordinates relative to reference frame
     static_cast<AquaSalFrame*>(i_pReferenceFrame)->CocoaToVCL( aRect.origin );
diff --git a/vcl/quartz/CTRunData.hxx b/vcl/quartz/CTRunData.hxx
index 3201acf..0bbd762 100644
--- a/vcl/quartz/CTRunData.hxx
+++ b/vcl/quartz/CTRunData.hxx
@@ -10,8 +10,20 @@
 #define CTRunData_Included
 
 #include "premac.h"
+#if defined(MACOSX) && MACOSX_SDK_VERSION < 1080
+#include <ApplicationServices/ApplicationServices.h>
+#if MACOSX_SDK_VERSION < 1060
+// The following symbols are SPI (System Programming Interface) in 10.5
+extern "C" {
+    void CTRunGetAdvances(CTRunRef run, CFRange range, CGSize buffer[]);
+    const CGSize* CTRunGetAdvancesPtr(CTRunRef run);
+    extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel;
+}
+#endif
+#else
 #include <CoreGraphics/CoreGraphics.h>
 #include <CoreText/CoreText.h>
+#endif
 #include "postmac.h"
 
 class CTRunData
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index b3c7e12..1978c91 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -254,7 +254,11 @@ int CoreTextFontData::GetFontTable( const char pTagName[5], unsigned char* pResu
     // get the raw table length
     CTFontDescriptorRef pFontDesc = reinterpret_cast<CTFontDescriptorRef>( GetFontId());
     CTFontRef rCTFont = CTFontCreateWithFontDescriptor( pFontDesc, 0.0, NULL);
+#if defined(MACOSX) && MACOSX_SDK_VERSION < 1080
+    const uint32_t opts( kCTFontTableOptionExcludeSynthetic );
+#else
     const uint32_t opts( kCTFontTableOptionNoOptions );
+#endif
     CFDataRef pDataRef = CTFontCopyTable( rCTFont, nTagCode, opts);
     CFRelease( rCTFont);
     if( !pDataRef)
commit 63c1c36af182cf33e024f20ad9dfc0d9436d61bf
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sat Oct 25 03:58:37 2014 -0400

    resurrect conditional code for OSX SDKs < 10.8 from "mass purge"
    
    plus, use MACOSX_SDK_VERSION instead of "legacy" MAC_OS_X_VERSION_MAX_ALLOWED/MIN_REQUIRED
    
    commitsi reverted:
      b02e958fa0bf7d062a5b8aff03d22325e3068feb
      fe25090e992eefd0c43ca73b656632a650793b1a
    
    note: sal/osl/unx/memory.c posix_memalign issue will be addressed in another commit
    
    Modified: 23 files (19 from b02e958f + 6 from fe25090e - 1 common - 1 unx/memory.c)
    
    Change-Id: Ib6e63e664dc073a8d751306f613e8be4918c406a

diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk
index e31f5d6..f5e1e4c 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -42,9 +42,10 @@ $(call gb_ExternalProject_get_state_target,curl,build):
 		CPPFLAGS="$(curl_CPPFLAGS)" \
 		LDFLAGS=$(curl_LDFLAGS) \
 		./configure \
-			$(if $(filter IOS MACOSX,$(OS)),\
-				--with-darwinssl,\
-				--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out")) \
+			$(if $(filter IOS MACOSX,$(OS)),,--with-nss$(if $(SYSTEM_NSS),,="$(call gb_UnpackedTarball_get_dir,nss)/dist/out")) \
+			$(if $(filter IOS,$(OS)),--with-darwinssl) \
+			$(if $(filter MACOSX,$(OS)),\
+				$(if $(filter 1050,$(MACOSX_SDK_VERSION)),,--with-darwinssl)) \
 			--without-ssl --without-gnutls --without-polarssl --without-cyassl --without-axtls \
 			--without-libidn --enable-ftp --enable-ipv6 --enable-http --disable-gopher \
 			--disable-file --disable-ldap --disable-telnet --disable-dict --without-libssh2 \
diff --git a/external/nss/ExternalPackage_nss.mk b/external/nss/ExternalPackage_nss.mk
index c6d8953fd..986565e 100644
--- a/external/nss/ExternalPackage_nss.mk
+++ b/external/nss/ExternalPackage_nss.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
 		dist/out/lib/libsmime3.dylib \
 		dist/out/lib/libsoftokn3.dylib \
 		dist/out/lib/libssl3.dylib \
+		$(if $(filter 1050,$(MACOSX_SDK_VERSION)),dist/out/lib/libsqlite3.dylib) \
 ))
 else ifeq ($(OS),WNT)
 $(eval $(call gb_ExternalPackage_add_files,nss,$(LIBO_LIB_FOLDER),\
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index 17ea6f1..0706a39 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -65,7 +65,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalProject
 			$(if $(filter arm64,$(CC)),USE_64=1)) \
 		$(if $(filter MACOSX,$(OS)),\
 			$(if $(filter-out POWERPC,$(CPUNAME)),MACOS_SDK_DIR=$(MACOSX_SDK_PATH)) \
-			NSS_USE_SYSTEM_SQLITE=1) \
+			$(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),NSS_USE_SYSTEM_SQLITE=1)) \
 		$(if $(filter SOLARIS,$(OS)),NS_USE_GCC=1) \
 		$(if $(CROSS_COMPILING),\
 			$(if $(filter MACOSXPOWERPC,$(OS)$(CPUNAME)),CPU_ARCH=ppc) \
diff --git a/external/python3/ExternalProject_python3.mk b/external/python3/ExternalProject_python3.mk
index 098b1ea..536dacf 100644
--- a/external/python3/ExternalProject_python3.mk
+++ b/external/python3/ExternalProject_python3.mk
@@ -67,8 +67,8 @@ $(call gb_ExternalProject_get_state_target,python3,build) :
 		$(if $(filter WNT-GCC,$(OS)-$(COM)),--with-threads ac_cv_printf_zd_format=no) \
 		$(if $(filter MACOSX,$(OS)), \
 			$(if $(filter INTEL,$(CPUNAME)),--enable-universalsdk=$(MACOSX_SDK_PATH) \
-                                --with-universal-archs=intel \
-            ) \
+                                $(if $(filter 1050,$(MACOSX_SDK_VERSION)),--with-universal-archs=32-bit,--with-universal-archs=intel) \
+                        ) \
 			--enable-framework=/@__________________________________________________OOO --with-framework-name=LibreOfficePython, \
 			--enable-shared \
 		) \
diff --git a/fpicker/source/aqua/FilterHelper.mm b/fpicker/source/aqua/FilterHelper.mm
index fecea53f..3e87834 100644
--- a/fpicker/source/aqua/FilterHelper.mm
+++ b/fpicker/source/aqua/FilterHelper.mm
@@ -392,7 +392,11 @@ bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
     }
 
     NSFileManager *manager = [NSFileManager defaultManager];
+#if MACOSX_SDK_VERSION < 1060
+    NSDictionary* pAttribs = [manager fileAttributesAtPath: sFilename traverseLink: NO];
+#else
     NSDictionary* pAttribs = [manager attributesOfItemAtPath: sFilename error: nil];
+#endif
     if( pAttribs )
     {
         NSObject* pType = [pAttribs objectForKey: NSFileType];
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm
index 1fc59af..83dc0a3 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm
@@ -83,6 +83,25 @@ NSString* resolveAlias( NSString* i_pSystemPath )
                                                    kCFURLPOSIXPathStyle, false);
     if( rUrl != NULL )
     {
+#if MACOSX_SDK_VERSION < 1060
+        FSRef rFS;
+        if( CFURLGetFSRef( rUrl, &rFS ) )
+        {
+            Boolean bIsFolder = false;
+            Boolean bAlias = false;
+            OSErr err = FSResolveAliasFile( &rFS, true, &bIsFolder, &bAlias);
+            if( (err == noErr) && bAlias )
+            {
+                CFURLRef rResolvedUrl = CFURLCreateFromFSRef( kCFAllocatorDefault, &rFS );
+                if( rResolvedUrl != NULL )
+                {
+                    pResolvedPath = (NSString*)CFURLCopyFileSystemPath( rResolvedUrl, kCFURLPOSIXPathStyle );
+                    CFRelease( rResolvedUrl );
+                }
+            }
+        }
+        CFRelease( rUrl );
+#else
         CFErrorRef rError;
         CFDataRef rBookmark = CFURLCreateBookmarkDataFromFile( NULL, rUrl, &rError );
         CFRelease( rUrl );
@@ -102,6 +121,7 @@ NSString* resolveAlias( NSString* i_pSystemPath )
                 CFRelease( rResolvedUrl );
             }
         }
+#endif
     }
     
     return pResolvedPath;
diff --git a/fpicker/source/aqua/SalAquaFilePicker.mm b/fpicker/source/aqua/SalAquaFilePicker.mm
index 5ee5892..020143a 100644
--- a/fpicker/source/aqua/SalAquaFilePicker.mm
+++ b/fpicker/source/aqua/SalAquaFilePicker.mm
@@ -321,7 +321,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles() thro
 
     SolarMutexGuard aGuard;
 
-#if HAVE_FEATURE_MACOSX_SANDBOX
+#if MACOSX_SDK_VERSION >= 1070 && HAVE_FEATURE_MACOSX_SANDBOX
     static NSUserDefaults *userDefaults;
     static bool triedUserDefaults = false;
 
@@ -350,7 +350,7 @@ uno::Sequence<rtl::OUString> SAL_CALL SalAquaFilePicker::getSelectedFiles() thro
     {
         NSURL *url = [files objectAtIndex:nIndex];
 
-#if HAVE_FEATURE_MACOSX_SANDBOX
+#if MACOSX_SDK_VERSION >= 1070 && HAVE_FEATURE_MACOSX_SANDBOX
         if (userDefaults != NULL &&
             [url respondsToSelector:@selector(bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:)])
         {
@@ -765,7 +765,11 @@ void SalAquaFilePicker::updateSaveFileNameExtension() {
         rtl::OUString suffix = (*(aStringList.begin())).copy(1);
         NSString *requiredFileType = [NSString stringWithOUString:suffix];
 
+#if MACOSX_SDK_VERSION < 1060
+        [m_pDialog setRequiredFileType:requiredFileType];
+#else
         [m_pDialog setAllowedFileTypes:[NSArray arrayWithObjects:requiredFileType, nil]];
+#endif
 
         OSL_TRACE("disallowing other file types");
         [m_pDialog setAllowsOtherFileTypes:NO];
diff --git a/fpicker/source/aqua/SalAquaPicker.mm b/fpicker/source/aqua/SalAquaPicker.mm
index e45a37e..3e4e288 100644
--- a/fpicker/source/aqua/SalAquaPicker.mm
+++ b/fpicker/source/aqua/SalAquaPicker.mm
@@ -164,6 +164,19 @@ int SalAquaPicker::run()
 
     int retVal = 0;
 
+#if MACOSX_SDK_VERSION < 1060
+    NSString *startDirectory;
+    if (m_sDisplayDirectory.getLength() > 0) {
+        NSString *temp = [NSString stringWithOUString:m_sDisplayDirectory];
+        NSURL *url = [NSURL URLWithString:temp];
+        startDirectory = [url path];
+
+        OSL_TRACE("start dir: %s", [startDirectory UTF8String]);
+    }
+    else {
+        startDirectory = NSHomeDirectory();
+    }
+#else
     NSURL *startDirectory;
     if (m_sDisplayDirectory.getLength() > 0) {
         NSString *temp = [NSString stringWithOUString:m_sDisplayDirectory];
@@ -174,17 +187,26 @@ int SalAquaPicker::run()
     else {
         startDirectory = [NSURL fileURLWithPath:NSHomeDirectory() isDirectory:YES];
     }
+#endif
 
     switch(m_nDialogType) {
         case NAVIGATIONSERVICES_DIRECTORY:
         case NAVIGATIONSERVICES_OPEN:
+#if MACOSX_SDK_VERSION < 1060
+            retVal = [(NSOpenPanel*)m_pDialog runModalForDirectory:startDirectory file:nil types:nil];
+#else
             [m_pDialog setDirectoryURL:startDirectory];
             retVal = [(NSOpenPanel*)m_pDialog runModal];
+#endif
             break;
         case NAVIGATIONSERVICES_SAVE:
+#if MACOSX_SDK_VERSION < 1060
+            retVal = [m_pDialog runModalForDirectory:startDirectory file:[NSString stringWithOUString:((SalAquaFilePicker*)this)->getSaveFileName()]];
+#else
             [m_pDialog setDirectoryURL:startDirectory];
             [m_pDialog setNameFieldStringValue:[NSString stringWithOUString:static_cast<SalAquaFilePicker*>(this)->getSaveFileName()]];
             retVal = [m_pDialog runModal];
+#endif
             break;
         // [m_pDialog beginSheetForDirectory:startDirectory file:[m_pDialog saveFilename] modalForWindow:[NSApp keyWindow] modalDelegate:((SalAquaFilePicker*)this)->getDelegate() didEndSelector:@selector(savePanelDidEnd:returnCode:contextInfo:) contextInfo:nil];
         default:
@@ -192,10 +214,17 @@ int SalAquaPicker::run()
     }
 
     if (retVal == NSFileHandlingPanelOKButton) {
+#if MACOSX_SDK_VERSION < 1060
+        NSString* pDir = [m_pDialog directory];
+        if (pDir) {
+            implsetDisplayDirectory([[NSURL fileURLWithPath:pDir] OUStringForInfo:FULLPATH]);
+        }
+#else
         NSURL* pDir = [m_pDialog directoryURL];
         if (pDir) {
             implsetDisplayDirectory([pDir OUStringForInfo:FULLPATH]);
         }
+#endif
     }
     DBG_PRINT_EXIT(CLASS_NAME, __func__, retVal);
 
diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
index 20e9e52..6459b7e 100644
--- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
+++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm
@@ -350,7 +350,11 @@ Reference< XSpellAlternatives >
             aLang = [aLang  stringByAppendingString:aTaggedCountry];
         }
         [macSpell setLanguage:aLang];
+#if MACOSX_SDK_VERSION < 1060
+        NSArray *guesses = [macSpell guessesForWord:aNSStr];
+#else
         NSArray *guesses = [macSpell guessesForWordRange:NSMakeRange(0, [aNSStr length]) inString:aNSStr language:aLang inSpellDocumentWithTag:0];
+#endif
         count = [guesses count];
         if (count)
         {
diff --git a/sal/osl/unx/system.cxx b/sal/osl/unx/system.cxx
index 847a575..bb9bea0 100644
--- a/sal/osl/unx/system.cxx
+++ b/sal/osl/unx/system.cxx
@@ -157,10 +157,17 @@ int macxp_resolveAlias(char *path, int buflen)
   (void) buflen;
   return 0;
 #else
+#if MACOSX_SDK_VERSION < 1060
+  FSRef aFSRef;
+  OSStatus nErr;
+  Boolean bFolder;
+  Boolean bAliased;
+#else
   CFStringRef cfpath;
   CFURLRef cfurl;
   CFErrorRef cferror;
   CFDataRef cfbookmark;
+#endif
 
   char *unprocessedPath = path;
 
@@ -174,6 +181,49 @@ int macxp_resolveAlias(char *path, int buflen)
       if ( unprocessedPath )
           *unprocessedPath = '\0';
 
+#if MACOSX_SDK_VERSION < 1060
+      nErr = noErr;
+      bFolder = FALSE;
+      bAliased = FALSE;
+
+      if ( FSPathMakeRef( (const UInt8 *)path, &aFSRef, 0 ) == noErr )
+      {
+          nErr = FSResolveAliasFileWithMountFlags( &aFSRef, TRUE, &bFolder, &bAliased, kResolveAliasFileNoUI );
+          if ( nErr == nsvErr )
+          {
+              errno = ENOENT;
+              nRet = -1;
+          }
+          else if ( nErr == noErr && bAliased )
+          {
+              char tmpPath[ PATH_MAX ];
+              if ( FSRefMakePath( &aFSRef, (UInt8 *)tmpPath, PATH_MAX ) == noErr )
+              {
+                  int nLen = strlen( tmpPath ) + ( unprocessedPath ? strlen( unprocessedPath + 1 ) + 1 : 0 );
+                  if ( nLen < buflen && nLen < PATH_MAX )
+                  {
+                      if ( unprocessedPath )
+                      {
+                          int nTmpPathLen = strlen( tmpPath );
+                          strcat( tmpPath, "/" );
+                          strcat( tmpPath, unprocessedPath + 1 );
+                          strcpy( path, tmpPath);
+                          unprocessedPath = path + nTmpPathLen;
+                      }
+                      else if ( !unprocessedPath )
+                      {
+                          strcpy( path, tmpPath);
+                      }
+                  }
+                  else
+                  {
+                      errno = ENAMETOOLONG;
+                      nRet = -1;
+                  }
+              }
+          }
+      }
+#else
       cfpath = CFStringCreateWithCString( NULL, path, kCFStringEncodingUTF8 );
       cfurl = CFURLCreateWithFileSystemPath( NULL, cfpath, kCFURLPOSIXPathStyle, false );
       CFRelease( cfpath );
@@ -233,6 +283,7 @@ int macxp_resolveAlias(char *path, int buflen)
               }
           }
       }
+#endif
 
       if ( unprocessedPath )
           *unprocessedPath++ = '/';
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx
index 5a2a326..b5b9165 100644
--- a/sal/osl/unx/uunxapi.cxx
+++ b/sal/osl/unx/uunxapi.cxx
@@ -35,7 +35,7 @@ inline rtl::OString OUStringToOString(const rtl_uString* s)
                                   osl_getThreadTextEncoding());
 }
 
-#if HAVE_FEATURE_MACOSX_SANDBOX
+#if defined(MACOSX) && MACOSX_SDK_VERSION >= 1070 && HAVE_FEATURE_MACOSX_SANDBOX
 
 #include <Foundation/Foundation.h>
 #include <Security/Security.h>
@@ -289,7 +289,7 @@ int open_c(const char *cpPath, int oflag, int mode)
 
     int result = open(cpPath, oflag, mode);
 
-#if HAVE_FEATURE_MACOSX_SANDBOX
+#if defined(MACOSX) && MACOSX_SDK_VERSION >= 1070 && HAVE_FEATURE_MACOSX_SANDBOX
     if (isSandboxed && result != -1 && (oflag & O_CREAT) && (oflag & O_EXCL))
     {
         // A new file was created. Check if it is outside the sandbox.
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h
index f426200..0920119 100644
--- a/vcl/inc/osx/salframe.h
+++ b/vcl/inc/osx/salframe.h
@@ -93,7 +93,11 @@ public:
     InputContextFlags               mnICOptions;
 
     // To prevent display sleep during presentation
+#if MACOSX_SDK_VERSION < 1060
+    boost::shared_ptr< Timer >      mpActivityTimer;
+#else
     IOPMAssertionID                 mnAssertionID;
+#endif
 
 public:
     /** Constructor
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h
index 93f8b8f..d125743 100644
--- a/vcl/inc/osx/salframeview.h
+++ b/vcl/inc/osx/salframeview.h
@@ -22,7 +22,11 @@
 
 #include "osx/a11ywrapper.h"
 
+#if MACOSX_SDK_VERSION < 1060
+ at interface SalFrameWindow : NSWindow
+#else
 @interface SalFrameWindow : NSWindow<NSWindowDelegate>
+#endif
 {
     AquaSalFrame*       mpFrame;
     id mDraggingDestinationHandler;
@@ -59,7 +63,11 @@
 -(void)unregisterDraggingDestinationHandler:(id)theHandler;
 @end
 
+#if MACOSX_SDK_VERSION < 1060
+ at interface SalFrameView : AquaA11yWrapper <NSTextInput>
+#else
 @interface SalFrameView : AquaA11yWrapper <NSTextInputClient>
+#endif
 {
     AquaSalFrame*       mpFrame;
 
@@ -113,7 +121,11 @@
 /*
     text action methods
 */
+#if MACOSX_SDK_VERSION < 1060
+-(void)insertText:(id)aString;
+#else
 -(void)insertText:(id)aString replacementRange:(NSRange)replacementRange;
+#endif
 -(void)insertTab: (id)aSender;
 -(void)insertBacktab: (id)aSender;
 -(void)moveLeft: (id)aSender;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 98ebd87..19d8666 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -29,6 +29,15 @@
 #include <ApplicationServices/ApplicationServices.h>
 #include "osx/osxvcltypes.h"
 #include "osx/salframe.h"
+
+#if MACOSX_SDK_VERSION < 1060
+// The following symbols are SPI (System Programming Interface) in 10.5.
+extern "C" {
+    void CTRunGetAdvances(CTRunRef run, CFRange range, CGSize buffer[]);
+    const CGSize* CTRunGetAdvancesPtr(CTRunRef run);
+    extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel;
+}
+#endif
 #else
 #include <CoreGraphics/CoreGraphics.h>
 #include <CoreText/CoreText.h>
diff --git a/vcl/osx/DropTarget.cxx b/vcl/osx/DropTarget.cxx
index 3c836ee..9bcc8f8 100644
--- a/vcl/osx/DropTarget.cxx
+++ b/vcl/osx/DropTarget.cxx
@@ -270,9 +270,17 @@ NSDragOperation DropTarget::draggingUpdated(id sender)
     }
 
     if (dragOp == NSDragOperationNone)
+#if MACOSX_SDK_VERSION < 1060
+        SetThemeCursor(kThemeNotAllowedCursor);
+#else
         [[NSCursor operationNotAllowedCursor] set];
+#endif
     else if (dragOp == NSDragOperationCopy)
+#if MACOSX_SDK_VERSION < 1060
+        SetThemeCursor(kThemeCopyArrowCursor);
+#else
         [[NSCursor dragCopyCursor] set];
+#endif
     else
         [[NSCursor arrowCursor] set];
 
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 3fabeb4..d38fb7c 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -38,6 +38,11 @@
 #include "osx/a11yfactory.h"
 #include "quartz/utils.h"
 
+#if MACOSX_SDK_VERSION < 1060
+#include "vcl/timer.hxx"
+#include "osx/saltimer.h"
+#endif
+
 #include "salwtype.hxx"
 
 #include "premac.h"
@@ -194,7 +199,11 @@ void AquaSalFrame::initWindowAndView()
         [mpNSWindow setAcceptsMouseMovedEvents: YES];
     [mpNSWindow setHasShadow: YES];
 
+#if MACOSX_SDK_VERSION < 1060
+    objc_msgSend(mpNSWindow, @selector(setDelegate:), mpNSWindow);
+#else
     [mpNSWindow setDelegate: static_cast<id<NSWindowDelegate> >(mpNSWindow)];
+#endif
 
     if( [mpNSWindow respondsToSelector: @selector(setRestorable:)])
     {
@@ -751,6 +760,27 @@ void AquaSalFrame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay )
         SendPaintEvent();
 }
 
+#if MACOSX_SDK_VERSION < 1060
+class PreventSleepTimer : public AutoTimer
+{
+public:
+    PreventSleepTimer()
+    {
+        SetTimeout( 30000 );
+        Start();
+    }
+
+    virtual ~PreventSleepTimer()
+    {
+    }
+
+    virtual void Timeout()
+    {
+        UpdateSystemActivity(OverallAct);
+    }
+};
+#endif
+
 void AquaSalFrame::StartPresentation( bool bStart )
 {
     if ( !mpNSWindow )
@@ -762,10 +792,14 @@ void AquaSalFrame::StartPresentation( bool bStart )
     if( bStart )
     {
         GetSalData()->maPresentationFrames.push_back( this );
+#if MACOSX_SDK_VERSION < 1060
+        mpActivityTimer.reset( new PreventSleepTimer() );
+#else
         IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
                                     kIOPMAssertionLevelOn,
                                     CFSTR("LibreOffice presentation running"),
                                     &mnAssertionID);
+#endif
         [mpNSWindow setLevel: NSPopUpMenuWindowLevel];
         if( mbShown )
             [mpNSWindow makeMainWindow];
@@ -773,7 +807,11 @@ void AquaSalFrame::StartPresentation( bool bStart )
     else
     {
         GetSalData()->maPresentationFrames.remove( this );
+#if MACOSX_SDK_VERSION < 1060
+        mpActivityTimer.reset();
+#else
         IOPMAssertionRelease(mnAssertionID);
+#endif
         [mpNSWindow setLevel: NSNormalWindowLevel];
     }
 }
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 5be7cc3..043b56b 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -35,6 +35,14 @@
 
 #define WHEEL_EVENT_FACTOR 1.5
 
+// for fullscreen support on OS X < 10.7
+#if MACOSX_SDK_VERSION < 1070
+    #define NSWindowCollectionBehaviorFullScreenPrimary   (1 << 7)
+    #define NSWindowCollectionBehaviorFullScreenAuxiliary (1 << 8)
+//  #define NSFullScreenWindowMask (1 << 14)
+#endif
+
+
 static sal_uInt16 ImplGetModifierMask( unsigned int nMask )
 {
     sal_uInt16 nRet = 0;
@@ -159,6 +167,18 @@ static const struct ExceptionalKey
 static AquaSalFrame* getMouseContainerFrame()
 {
     AquaSalFrame* pDispatchFrame = NULL;
+#if MACOSX_SDK_VERSION < 1060
+    NSInteger nWindows = 0;
+    NSCountWindows( &nWindows );
+    NSInteger* pWindows = (NSInteger*)alloca( nWindows * sizeof(NSInteger) );
+    NSWindowList( nWindows, pWindows ); // NSWindowList is supposed to be in z-order front to back
+    for(int i = 0; i < nWindows && ! pDispatchFrame; i++ )
+    {
+        NSWindow* pWin = [NSApp windowWithWindowNumber: pWindows[i]];
+        if( pWin && [pWin isMemberOfClass: [SalFrameWindow class]] && [(SalFrameWindow*)pWin containsMouse] )
+            pDispatchFrame = [(SalFrameWindow*)pWin getSalFrame];
+    }
+#else
     NSArray* aWindows = [NSWindow windowNumbersWithOptions:0];
     for(NSUInteger i = 0; i < [aWindows count] && ! pDispatchFrame; i++ )
     {
@@ -166,6 +186,7 @@ static AquaSalFrame* getMouseContainerFrame()

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list