summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordas <das>2006-07-20 06:27:34 (GMT)
committerdas <das>2006-07-20 06:27:34 (GMT)
commit472d82cf26c06e8d849e9ff1ed4af3f0a2154ddc (patch)
tree9bccc02d5eafea499475873df3d395542f54fa85 /macosx
parente673c7b95612047bc886329eda3d26e3e7807c9b (diff)
downloadtk-472d82cf26c06e8d849e9ff1ed4af3f0a2154ddc.zip
tk-472d82cf26c06e8d849e9ff1ed4af3f0a2154ddc.tar.gz
tk-472d82cf26c06e8d849e9ff1ed4af3f0a2154ddc.tar.bz2
* macosx/tkMacOSXWm.c (WmAttributesCmd, WmIconbitmapCmd): add support
for weakly importing symbols not available on OSX 10.2 or 10.3, enables binaires built on later OSX versions to run on earlier ones. * macosx/README: document how to enable weak-linking; cleanup. * unix/configure.in: enforce requirement of OSX 10.2 for TkAqua; move * unix/tcl.m4: Darwin specific checks & defines that are only relevant to the tcl build out of tcl.m4; restrict framework option to Darwin; cleanup quoting. * unix/configure: autoconf-2.13 * macosx/tkMacOSXKeyEvent.c: ifdef out diagnostic messages to stderr. * macosx/tkMacOSXEvent.h: standardize MAC_OS_X_VERSION_MAX_ALLOWED * macosx/tkMacOSXMenu.c: checks per QA1316, ensure define can be * macosx/tkMacOSXMenubutton.c: overriden on command line (from default * macosx/tkMacOSXMenus.c: of current OS version). * macosx/tkMacOSXMouseEvent.c: * macosx/tkMacOSXWm.c:
Diffstat (limited to 'macosx')
-rw-r--r--macosx/README37
-rw-r--r--macosx/tkMacOSXEvent.h7
-rw-r--r--macosx/tkMacOSXKeyEvent.c19
-rw-r--r--macosx/tkMacOSXMenu.c5
-rw-r--r--macosx/tkMacOSXMenubutton.c5
-rw-r--r--macosx/tkMacOSXMenus.c5
-rw-r--r--macosx/tkMacOSXMouseEvent.c5
-rw-r--r--macosx/tkMacOSXWm.c52
8 files changed, 75 insertions, 60 deletions
diff --git a/macosx/README b/macosx/README
index 8fad1a0..ff002ca 100644
--- a/macosx/README
+++ b/macosx/README
@@ -1,7 +1,7 @@
Tcl/Tk Mac OS X README
----------------------
-RCS: @(#) $Id: README,v 1.6.2.10 2005/11/27 06:44:16 das Exp $
+RCS: @(#) $Id: README,v 1.6.2.11 2006/07/20 06:27:34 das Exp $
This is the README file for the Mac OS X/Darwin version of Tcl/Tk.
@@ -43,9 +43,12 @@ TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem].
required to run TkAqua. However OS X 10.3 or higher is recommended (certain
[file] operations behave incorrectly on earlier releases).
-- Tcl/Tk built on Mac OS X 10.x will not run on 10.y for y < x, on the other
-hand Tcl/Tk built on 10.y will run on 10.x for y < x (but without any of the
-fixes and optimizations that would be available in a binary built on 10.x).
+- Unless weak-linking is used, Tcl/Tk built on Mac OS X 10.x will not run on
+10.y with y < x; on the other hand Tcl/Tk built on 10.y will always run on 10.x
+with y <= x (but without any of the fixes and optimizations that would be
+available in a binary built on 10.x).
+Weak-linking is available on OS X 10.2 or later, it additionally allows Tcl/Tk
+built on 10.x to run on any 10.y with x > y >= z (for a chosen z >= 2).
- Wish checks the Resources/Scripts directory in its application bundle for a
file called AppMain.tcl, if found it is used as the startup script and the
@@ -151,11 +154,10 @@ tcl/macosx and tk/macosx (see below for details), but can also be built with the
standard unix configure and make buildsystem in tcl/unix resp. tk/unix as on any
other unix platform (indeed, the GNUmakefiles are just wrappers around the unix
buildsystem).
-The Mac OS X specifc configure flags are --enable-aqua, --enable-framework and
+The Mac OS X specific configure flags are --enable-aqua, --enable-framework and
--disable-corefoundation (which disables CF and notably reverts to the standard
-select based notifier, you will only need this if your require use of naked fork
-(i.e. not followed by execve) in an unthreaded core). Note that --enable-aqua is
-incompatible with --disable-corefoundation (for both Tcl and Tk configure).
+select based notifier). Note that --enable-aqua is incompatible with
+--disable-corefoundation (for both Tcl and Tk configure).
- It is also possible to build with Apple's IDE via the tk/macosx/Wish.pbproj
project, this simply calls through to the tk/macosx/GNUMakefile. It requires a
@@ -165,7 +167,7 @@ build of the tcl/macosx/Tcl.pbproj project.
export CFLAGS="-arch ppc -arch i386 \
-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4"
This requires Mac OS X 10.4 and Xcode 2.2 (_not_ Xcode 2.1) and will work on
-any of the architectures (on i386 DTKs, the -isysroot is not required).
+any of the architectures (on intel Macs, the -isysroot is not required).
Note that it is not possible to configure correctly if the current architecture
is not present in CFLAGS (i.e. -arch `arch` must always be there).
Universal builds of Tk TEA extensions are also possible with CFLAGS set as
@@ -175,7 +177,18 @@ TkX11 can be built with -arch ppc64 as the corresponding GUI libraries are not
available for 64bit at present. However, linking a universal 'ppc i386' Tk
binary against a universal 'ppc ppc64 i386' Tcl binary works just fine.
The Tk configure script automatically removes '-arch ppc64' from CFLAGS to
-facilitate universal building of both Tcl and Tk with the same CFLAGS setting.
+facilitate universal building of both Tcl and Tk with the same CFLAGS setting;
+the same happens with configure in Tk extensions based on TEA 3.5 or later.
+
+- To enable weak-linking, set the MACOSX_DEPLOYMENT_TARGET environment variable
+to the minimal OS version (>= 10.2) the binaries should be able to run on, e.g:
+ export MACOSX_DEPLOYMENT_TARGET=10.2
+This requires Mac OS X 10.2 and gcc 3.1; if you have gcc 4 or later you can set
+CFLAGS instead:
+ export CFLAGS="-mmacosx-version-min=10.2"
+The Wish.xcodeproj is setup to produce binaires that can run on 10.2 or later,
+except for the 'ReleaseUniversal'configuration, where they require 10.4.
+Support for weak-linking was added to the code for 8.4.14/8.5a5.
Detailed Instructions for building with macosx/GNUmakefile
----------------------------------------------------------
@@ -216,8 +229,8 @@ instead by passing an INSTALL_ROOT argument to make:
- The default Makefile targets will build _both_ debug and optimized versions of
the Tcl and Tk frameworks with the standard convention of naming the debug
library Tcl.framework/Tcl_debug resp. Tk.framework/Tk_debug.
-This allows you to dynamically link to the debug libraries at runtime by setting
- setenv DYLD_IMAGE_SUFFIX _debug
+This allows switching to the debug libraries at runtime by setting
+ export DYLD_IMAGE_SUFFIX=_debug
(c.f. man dyld for more details)
If you only want to build and install the debug or optimized build, use the
diff --git a/macosx/tkMacOSXEvent.h b/macosx/tkMacOSXEvent.h
index 6787f97..10eba80 100644
--- a/macosx/tkMacOSXEvent.h
+++ b/macosx/tkMacOSXEvent.h
@@ -50,7 +50,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.3.2.6 2006/04/28 06:02:59 das Exp $
+ * RCS: @(#) $Id: tkMacOSXEvent.h,v 1.3.2.7 2006/07/20 06:27:34 das Exp $
*/
#ifndef _TKMACEVENT
@@ -100,10 +100,9 @@ MODULE_SCOPE int TkMacOSXKeycodeToUnicode(
MODULE_SCOPE OSStatus TkMacOSXStartTclEventLoopCarbonTimer();
MODULE_SCOPE OSStatus TkMacOSXStopTclEventLoopCarbonTimer();
-#if !defined(MAC_OS_X_VERSION_10_3) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
/* Define constants only available on Mac OS X 10.3 or later */
-enum { kEventAppAvailableWindowBoundsChanged = 110 };
+#define kEventAppAvailableWindowBoundsChanged 110
#endif
#endif
diff --git a/macosx/tkMacOSXKeyEvent.c b/macosx/tkMacOSXKeyEvent.c
index 1a37b75..3a48fa0 100644
--- a/macosx/tkMacOSXKeyEvent.c
+++ b/macosx/tkMacOSXKeyEvent.c
@@ -54,12 +54,18 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.9 2006/05/12 18:17:55 das Exp $
+ * RCS: @(#) $Id: tkMacOSXKeyEvent.c,v 1.6.2.10 2006/07/20 06:27:34 das Exp $
*/
#include "tkMacOSXInt.h"
#include "tkMacOSXEvent.h"
+/*
+#ifdef TK_MAC_DEBUG
+#define TK_MAC_DEBUG_KEYBOARD
+#endif
+*/
+
typedef struct {
WindowRef whichWindow;
int global_x, global_y;
@@ -563,8 +569,7 @@ InitKeyEvent(
* duplicate enums and typedefs would give errrors.
*/
-#if !defined(MAC_OS_X_VERSION_10_2) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1020
#define KeyboardLayoutRef Ptr
#define KeyboardLayoutPropertyTag UInt32
#define kKLKCHRData 0
@@ -643,7 +648,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr)
if ((lastLayout != currentLayout)
|| (lastLayoutId != currentLayoutId)) {
-#ifdef TK_MAC_DEBUG
+#ifdef TK_MAC_DEBUG_KEYBOARD
fprintf (stderr, "GetKeyboardLayout(): Use KLS\n");
#endif
@@ -684,7 +689,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr)
if ((lastLayout == NULL) || (lastLayoutId != currentLayoutId)) {
-#ifdef TK_MAC_DEBUG
+#ifdef TK_MAC_DEBUG_KEYBOARD
fprintf (stderr, "GetKeyboardLayout(): Use GetResource()\n");
#endif
@@ -719,7 +724,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr)
if (hasLayoutChanged) {
-#ifdef TK_MAC_DEBUG
+#ifdef TK_MAC_DEBUG_KEYBOARD
if (KCHR != NULL) {
fprintf (stderr, "GetKeyboardLayout(): New 'KCHR' layout %d\n",
(int) (short) currentLayoutId);
@@ -747,7 +752,7 @@ GetKeyboardLayout (Ptr * resourcePtr, TextEncoding * encodingPtr)
if (KCHR != NULL) {
lastEncoding = GetKCHREncoding(currentKeyScript, currentLayoutId);
-#ifdef TK_MAC_DEBUG
+#ifdef TK_MAC_DEBUG_KEYBOARD
fprintf (stderr, "GetKeyboardLayout(): New 'KCHR' encoding %lu "
"(%lu + 0x%lX)\n",
lastEncoding, lastEncoding & 0xFFFFL,
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 2df2ba4..c4a0d7f 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.19 2006/05/12 18:18:52 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMenu.c,v 1.6.2.20 2006/07/20 06:27:34 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -28,8 +28,7 @@
#endif
*/
-#if !defined(MAC_OS_X_VERSION_10_3) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
/* Define constants only available on Mac OS X 10.3 or later */
#define kMenuAttrDoNotUseUserCommandKeys (1 << 7)
#endif
diff --git a/macosx/tkMacOSXMenubutton.c b/macosx/tkMacOSXMenubutton.c
index 511354f..d5ae817 100644
--- a/macosx/tkMacOSXMenubutton.c
+++ b/macosx/tkMacOSXMenubutton.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenubutton.c,v 1.2.2.8 2006/04/28 06:03:00 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMenubutton.c,v 1.2.2.9 2006/07/20 06:27:34 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -19,8 +19,7 @@
#include "tkMacOSXFont.h"
#include "tkMacOSXDebug.h"
-#if !defined(MAC_OS_X_VERSION_10_3) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
/* Define constants only available on Mac OS X 10.3 or later */
#define kMenuAttrDoNotUseUserCommandKeys (1 << 7)
#endif
diff --git a/macosx/tkMacOSXMenus.c b/macosx/tkMacOSXMenus.c
index fbcb239..f996c37 100644
--- a/macosx/tkMacOSXMenus.c
+++ b/macosx/tkMacOSXMenus.c
@@ -11,13 +11,12 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.2.2.10 2006/05/16 06:54:04 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMenus.c,v 1.2.2.11 2006/07/20 06:27:34 das Exp $
*/
#include "tkMacOSXInt.h"
-#if !defined(MAC_OS_X_VERSION_10_3) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
/* Define constants only available on Mac OS X 10.3 or later */
#define kMenuAttrDoNotUseUserCommandKeys (1 << 7)
#endif
diff --git a/macosx/tkMacOSXMouseEvent.c b/macosx/tkMacOSXMouseEvent.c
index b716a41..6358141 100644
--- a/macosx/tkMacOSXMouseEvent.c
+++ b/macosx/tkMacOSXMouseEvent.c
@@ -54,15 +54,14 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.6.2.14 2006/04/28 06:03:00 das Exp $
+ * RCS: @(#) $Id: tkMacOSXMouseEvent.c,v 1.6.2.15 2006/07/20 06:27:34 das Exp $
*/
#include "tkMacOSXInt.h"
#include "tkMacOSXEvent.h"
#include "tkMacOSXDebug.h"
-#if !defined(MAC_OS_X_VERSION_10_3) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
/* Define constants only available on Mac OS X 10.3 or later */
#define kEventParamWindowPartCode 'wpar'
#define typeWindowPartCode 'wpar'
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 28bda54..04d8144 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.27 2006/05/16 07:37:21 das Exp $
+ * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.28 2006/07/20 06:27:34 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -22,14 +22,12 @@
#include "tkMacOSXEvent.h"
/* Define constants only available on Mac OS X 10.3 or later */
-#if !defined(MAC_OS_X_VERSION_10_3) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
#define kSimpleWindowClass 18
#define kWindowDoesNotCycleAttribute (1L << 15)
#endif
/* Define constants only available on Mac OS X 10.4 or later */
-#if !defined(MAC_OS_X_VERSION_10_4) || \
- (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4)
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1040
#define kWindowNoTitleBarAttribute (1L << 9)
#define kWindowMetalNoContentSeparatorAttribute (1L << 11)
#endif
@@ -865,17 +863,19 @@ Tcl_Obj *CONST objv[]; /* Argument objects. */
Boolean d;
err = FSPathMakeRef((unsigned char*) path, &ref, &d);
if (err == noErr) {
-#if defined(MAC_OS_X_VERSION_10_4) && \
- (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
- err = HIWindowSetProxyFSRef(macWindow, &ref);
-#else
- AliasHandle alias;
- err = FSNewAlias(NULL, &ref, &alias);
- if (err == noErr) {
- err = SetWindowProxyAlias(macWindow, alias);
- DisposeHandle((Handle) alias);
- }
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ if (HIWindowSetProxyFSRef != NULL) {
+ err = HIWindowSetProxyFSRef(macWindow, &ref);
+ } else
#endif
+ {
+ AliasHandle alias;
+ err = FSNewAlias(NULL, &ref, &alias);
+ if (err == noErr) {
+ err = SetWindowProxyAlias(macWindow, alias);
+ DisposeHandle((Handle) alias);
+ }
+ }
}
} else {
int len;
@@ -1630,17 +1630,19 @@ Tcl_Obj *CONST objv[]; /* Argument objects. */
}
macWindow = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window));
if (len) {
-#if defined(MAC_OS_X_VERSION_10_4) && \
- (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4)
- err = HIWindowSetProxyFSRef(macWindow, &ref);
-#else
- AliasHandle alias;
- err = FSNewAlias(NULL, &ref, &alias);
- if (err == noErr) {
- err = SetWindowProxyAlias(macWindow, alias);
- DisposeHandle((Handle) alias);
- }
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040
+ if (HIWindowSetProxyFSRef != NULL) {
+ err = HIWindowSetProxyFSRef(macWindow, &ref);
+ } else
#endif
+ {
+ AliasHandle alias;
+ err = FSNewAlias(NULL, &ref, &alias);
+ if (err == noErr) {
+ err = SetWindowProxyAlias(macWindow, alias);
+ DisposeHandle((Handle) alias);
+ }
+ }
} else {
err = RemoveWindowProxy(macWindow);
if (wmPtr->hints.icon_pixmap != None) {