PATCH - Perl/Tk for Panther: (Mac OS X 10.3)

PATCH - Perl/Tk for Panther: (Mac OS X 10.3)

Post by Steve Lidi » Mon, 27 Oct 2003 13:39:12



First, of all, Panther rocks, Apple has done another excellent job.

Second of all, damn. I just installed Tk804.025 beta 2 in Apple's Perl
hierarchy. When "perl -V" showed 5.8.1 RC3 I just assumed it was *my*
perl ... nope ;(.

Hey, RC3 is OK in my book, it and Tk work fine, but I wanted Tk in
/usr/local!

OK, here's how to compile Tk in Panther:

. install X11 from Panther CD #3
. install XCode Tools from CD #4 (gcc 3.3)
. inside the Packages directory of CD #4, install the X11 SDK to get
the development C header files
. patch /usr/include/mach/mach.h perl below:

[lusol@Ray:/usr/include/mach] diff -u mach.h.orig mach.h
--- mach.h.orig Sat Oct 25 22:53:40 2003
+++ mach.h Sat Oct 25 22:54:29 2003
@@ -76,7 +76,8 @@
* Standard prototypes
*/
extern void panic_init(mach_port_t);
-extern void panic(const char *, ...);
+/*extern void panic(const char *, ...);*.
+extern void panic(const char *);

extern void safe_gets(char *,
char *,
[lusol@Ray:/usr/include/mach]

I have no idea what that "..." ellipsis" does ;) The build then
proceeds normally.

HTH,

Steve

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to XXXX@XXXXX.COM
 
 
 

PATCH - Perl/Tk for Panther: (Mac OS X 10.3)

Post by Nick Ing-S » Tue, 28 Oct 2003 00:10:51

Steve Lidie < XXXX@XXXXX.COM > writes:


Presumably this panic() is a printf like thing (they usually are).



It seems a little odd to patch system headers to get Tk to work!
Presumably the real problem is Lang.h :

#define panic Tcl_Panic

Then when mach.h's panic is declared it collides with declare
of Tcl_Panic

Not sure why core-tk uses 'panic' have added s/\bpanic\b/Tcl_panic/g
to pTk/Tcl-pTk, and lost the #define



-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to XXXX@XXXXX.COM

 
 
 

PATCH - Perl/Tk for Panther: (Mac OS X 10.3)

Post by Steve Lidi » Tue, 28 Oct 2003 00:53:47

>>

Still, *I've* never seen such a thing, but my C is encrusted in
barnacles.

Ha, agreed.


That almost works. But you also have to lose the define in
.../pTk/tcl.h. Compile goes fine, but Pixmap dies during ld phase:

cp Pixmap.pm ../blib/lib/Tk/Pixmap.pm
/usr/local/bin/perl /usr/local/lib/perl5/5.8.1/ExtUtils/xsubpp
-typemap /usr/local/lib/perl5/5.8.1/ExtUtils/typemap -typemap
/Users/lusol/Desktop/Downloads/Tk804.025_beta2/Tk/typemap Pixmap.xs >
Pixmap.xsc && mv Pixmap.xsc Pixmap.c
cc -c -I.. -I/usr/X11R6/include -pipe -fno-common -DDARWIN
-no-cpp-precomp -fno-strict-aliasing -Os -DVERSION=\"804.025\"
-DXS_VERSION=\"804.025\" "-I/usr/local/lib/perl5/5.8.1/darwin/CORE"
-Wall -Wno-implicit-int -Wno-comment -Wno-unused
-D__USE_FIXED_PROTOTYPES__ Pixmap.c
Running Mkbootstrap for Tk::Pixmap ()
chmod 644 Pixmap.bs
rm -f ../blib/arch/auto/Tk/Pixmap/Pixmap.bundle
LD_RUN_PATH="" cc -bundle -L/usr/local/lib
-L/usr/local/lib/perl5/5.8.1/darwin/CORE -lperl Pixmap.o -o
../blib/arch/auto/Tk/Pixmap/Pixmap.bundle ../pTk/libpTk.a
ld: Undefined symbols:
_Tcl_panic
make[1]: *** [../blib/arch/auto/Tk/Pixmap/Pixmap.bundle] Error 1
make: *** [subdirs] Error 2
[lusol@Ray:~/Desktop/Downloads/Tk804.025_beta2]

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to XXXX@XXXXX.COM
 
 
 

PATCH - Perl/Tk for Panther: (Mac OS X 10.3)

Post by Tom Cosgro » Wed, 29 Oct 2003 00:40:09

>>> Steve Lidie 26-Oct-03 03:24 >>>
:

I think this should be "*/" at the end of this line, not "*.".

The way it stands, code from this "extern void" until the next */ is
being commented out (depending on the compiler!) :-) Not good.


It indicates that the function takes a variable number of arguments.
On some architectures, this will change the calling convention used
(what parameters go into what registers/onto the stack/etc).

Thanks

Tom Cosgrove
London, UK
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to XXXX@XXXXX.COM