From: Jim I. <ji...@ap...> - 2005-06-16 20:28:11
|
Daniel, I ran the Tk on these systems a while ago and it seemed to work okay. Just check in the changes, and I'll give the build a whirl, and test the results. I have a "Development System" I can get my hands on. For gdb we have to configure each architecture (we actually do 4 since gdb supports ppc x i386 and i386 x ppc as well as the two native debuggers). So we can't do it all in one go, so that's not what I am familiar with... Anyway, it's useful to know that there is really no magic to getting a Universal binary, just use the cross compiler as necessary, and add one simple Unix command to stick the results together. Jim On Jun 16, 2005, at 12:06 PM, Daniel A. Steffen wrote: > Jim, > > On 16/06/2005, at 3:07, Jim Ingham wrote: > > >> Tcl, Tk and all the extensions that shipped on Tiger (not all of >> Daniel's BI distro, but a good portion) build and run just fine on >> Intel. Apple's Build folks have been building the whole OS >> "Universal" for a good while. >> > > indeed, for the Tk integration into Tiger we needed some byte > swapping changes to get the i386 build working, c.f. tk ChangeLog... > > 2004-11-11 Daniel Steffen <da...@us...> > * macosx/tkMacOSXMouseEvent.c: endianness fixes. > > all the Tiger tcl/tk BI components built correctly on i386 out of > the box, but I don't know if anybody has gone through and verified > that they actually all function correctly... > > On 16/06/2005, at 4:20, Jim Ingham wrote: > > >> Probably want to work with Jeff about this, 'cause they want to >> keep the Mac OS X stuff building with the ActiveState builds, >> etc. But building a universal binary is just running the build >> passing "-arch ppc" to gcc, and then "-arch i386", and then running >> >> lipo ppc-Tcl x86-Tcl -output Tcl >> > > This seems to be more work than necessary, given that the compiler > and linker can all build fat directly; the following works fine for > me with XCode 2.1 (with the Universal SDK installed): > export MACOSX_DEPLOYMENT_TARGET=10.4 > export CFLAGS='-arch ppc -arch i386 -isysroot /Developer/SDKs/ > MacOSX10.4u.sdk -Wno-deprecated-declarations' > export LDFLAGS='-arch ppc -arch i386 -isysroot /Developer/SDKs/ > MacOSX10.4u.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk' > make -C tcl/macosx && make -C tk/macosx > and produces fat binaries directly as desired: > $ lipo -info build/tcl/Tcl.framework/Tcl build/tcl/tclsh8.5 > build/tk/Tk.framework/Tk build/tk/Wish.app/Contents/MacOS/Wish > Architectures in the fat file: build/tcl/Tcl.framework/Tcl are: > i386 ppc > Architectures in the fat file: build/tcl/tclsh8.5 are: ppc i386 > Architectures in the fat file: build/tk/Tk.framework/Tk are: > ppc i386 > Architectures in the fat file: build/tk/Wish.app/Contents/MacOS/ > Wish are: ppc i386 > (AFAIK the double -arch is also the way the Darwin guys do fat > builds with XBS ?) > > the only issue with this approach is that the configure scripts run > only once for both architectures, AFAICT this only impacts the tcl > configure AC_C_BIGENDIAN check, if both '-arch ppc -arch i38' are > present that check always fails, i.e. WORDS_BIGENDIAN is not > defined for tcl ppc. > In core-8-4-branch, WORDS_BIGENDIAN is only used for performance > optimisation of utf8 string comparison, so it doesn't matter much; > but in HEAD, tclBinary.c actually uses it to determine behaviour, > so it needs to be correct. > IMO the easiest fix would be to check BYTE_ORDER ourselves in the > tcl headers, this needs to happen in tclInt.h as WORDS_BIGENDIAN is > used there, the patch below should do the trick (using the same > includes as AC_C_BIGENDIAN so should be portable) > > any objections to this going in ? > > if somebody has MacTel hardware to test this on, I can post the > binaries built as above (with this patch)... > > Cheers, > > Daniel > > -- > ** Daniel A. Steffen ** "And now for something completely > ** Dept. of Mathematics ** different" Monty Python > ** Macquarie University ** <mailto:st...@ma...> > ** NSW 2109 Australia ** <http://www.maths.mq.edu.au/~steffen/> > > > Index: generic/tclInt.h > =================================================================== > RCS file: /cvsroot/tcl/tcl/generic/tclInt.h,v > retrieving revision 1.235 > diff -u -p -r1.235 tclInt.h > --- generic/tclInt.h 7 Jun 2005 21:46:08 -0000 1.235 > +++ generic/tclInt.h 16 Jun 2005 18:28:14 -0000 > @@ -59,6 +59,21 @@ > typedef int ptrdiff_t; > #endif > +/* Ensure WORDS_BIGENDIAN is defined on big-endian platforms */ > +#ifndef WORDS_BIGENDIAN > +# ifdef HAVE_SYS_TYPES_H > +# include <sys/types.h> > +# endif > +# ifdef HAVE_SYS_PARAM_H > +# include <sys/param.h> > +# endif > +# if defined(BYTE_ORDER) && defined(BIG_ENDIAN) > +# if BYTE_ORDER == BIG_ENDIAN > +# define WORDS_BIGENDIAN 1 > +# endif > +# endif > +#endif > + > /* > * Used to tag functions that are only to be visible within the > module > * being built and not outside it (where this is supported by the > > |