summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXInit.c
diff options
context:
space:
mode:
authordas <das>2005-05-26 11:20:08 (GMT)
committerdas <das>2005-05-26 11:20:08 (GMT)
commit977f577b341fb9cd0aab1d1e446b848f0b7af5e9 (patch)
tree023036afa4136f7b0c8d74629597e43ebb8ffc8d /macosx/tkMacOSXInit.c
parentaa1be7ab30d1c2ca8e670adf84553da846c1fc07 (diff)
downloadtk-977f577b341fb9cd0aab1d1e446b848f0b7af5e9.zip
tk-977f577b341fb9cd0aab1d1e446b848f0b7af5e9.tar.gz
tk-977f577b341fb9cd0aab1d1e446b848f0b7af5e9.tar.bz2
* macosx/tkMacOSXInit.c (TkpInit): fixed resource file extraction
from __tk_rsrc section to work with non-prebound .dylib and .bundle. * macosx/Makefile: corrected EMBEDDED_BUILD check, use separate tcl and tk version vars to properly support tk/x11 framework version overriding, rewrite tkConfig.sh when overriding tk version, corrected Wish.app symlink in tk build dir. * unix/configure.in: corrected framework finalization to softlink stub library to Versions/8.x subdir instead of Versions/Current. * unix/configure: autoconf-2.13
Diffstat (limited to 'macosx/tkMacOSXInit.c')
-rw-r--r--macosx/tkMacOSXInit.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/macosx/tkMacOSXInit.c b/macosx/tkMacOSXInit.c
index 7b469a7..7f7df86 100644
--- a/macosx/tkMacOSXInit.c
+++ b/macosx/tkMacOSXInit.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: tkMacOSXInit.c,v 1.3.2.6 2005/05/24 04:21:32 das Exp $
+ * RCS: @(#) $Id: tkMacOSXInit.c,v 1.3.2.7 2005/05/26 11:20:09 das Exp $
*/
#include "tkInt.h"
@@ -174,23 +174,20 @@ TkpInit(interp)
unsigned long size;
int fd = -1;
char fileName[L_tmpnam + 15];
+ int i, n;
/* Get resource data from __tk_rsrc section of tk library file */
-#ifdef HAVE__DYLD_GET_IMAGE_HEADER_CONTAINING_ADDRESS
- image = _dyld_get_image_header_containing_address((unsigned long)&TkpInit);
- if (image) {
- data = getsectdatafromheader(image, SEG_TEXT, "__tk_rsrc", &size);
- }
-#else
- int i, n = _dyld_image_count();
+ n = _dyld_image_count();
for (i = 0; i < n; i++) {
image = _dyld_get_image_header(i);
if (image) {
data = getsectdatafromheader(image, SEG_TEXT, "__tk_rsrc", &size);
+ if (data) {
+ data += _dyld_get_image_vmaddr_slide(i);
+ break;
+ }
}
- if (data) break;
}
-#endif
while (data) {
OSStatus err;
FSRef ref;
@@ -209,6 +206,7 @@ TkpInit(interp)
err = FSPathMakeRef(fileName, &ref, NULL);
if (err != noErr) break;
err = FSOpenResourceFile(&ref, 0, NULL, fsRdPerm, &refNum);
+ if (err != noErr) fprintf(stderr,"FSOpenResourceFile error %d\n",err);
break;
}
if (fd != -1) {