Re: [Plib-users] Building Plib on Mac OSX (Darwin)
Brought to you by:
sjbaker
From: Reed H. <re...@ze...> - 2001-12-29 16:33:23
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > The "-O6" stuff was removed recently in CVS. > Dunno - some attempt to get more speed by increasing the optimisation level > I guess. Yeah, except gcc 2.95.2 only goes up to -O3, according to the documentation I have... and it fails with -O6 :) > We have to find a way to determine whether the machine we are compiling on > is running Mac OS (X) *without* forcing the user to tell us ... autoconf will detect this. I think AC_CANONICAL_SYSTEM will set a variety of variables, including "build_alias" "host_alias", etc?? On darwin this will have the value "powerpc-apple-darwin5.2" uname will also output "Darwin". Also, the compiler probably defines some symbol (__DARWIN__ or something) that can be detected in preprocessing. I will find that out. >Yes. Looking to see if glut.h is in <GLUT/glut.h> might be one way. >> 4. changed int vp [ 4 ] ; on line 202 of ssg.cxx to GLint vp [ 4 ] ; >> 5. changed int ww; on line 112 of ssgLoadTexture.cxx to GLint ww; > Why exactly was this neccessary ? > Perhaps they somehow made the GL types *not* be a simple typedef or #define > of the basic types. If that's true then writing good code is going to be > VERY painful. yup... this OpenGL demands GLint... will this break existing applications on Darwin? If so, c'est la vie, I guess. It was only those two lines in ssg though, none in sg or util. I haven't tried building the other libraries yet. Is this a big problem do you think? > Yes - but surely the old way must work too? Only with some sneaky hacks. All the directories are different, nothing like normal unix system. Normal systems have /usr/lib/libfoo.so or /usr/lib/group/libfoo.so (in which case you use - - - -L /usr/lib/group) , and /usr/include/foo.h or /usr/include/group/foo.h (in which case you use #include <group/foo.h>). Darwin has /System/Library/Frameworks/group.framework/Headers/foo.h and /System/Library/Frameworks/group.framework/Libraries/libfoo.dylib. Actually, I first tried symlinks from /usr/local/lib/GL -> /System/Library/Frameworks/OpenGL.framework/Libraries and likewise for headers, but ran into all kinds of little problems. It was easier just to link to the framework. Fink <http://fink.sf.net> includes open GL libraries (Mesa?) with the XFree port, I *think*, but I diddn't want to get tangled with those just yet. However, maybe that would work better. I can look at that too. > Apple clearly don't seem overly concerned about portability. Why else would > they have moved glut.h ? All the framework stuff is inherited from NeXt, I think. Politics probably :P. Frameworks *do* facilitate distribution of libraries without install scripts that move copy files around (they can just be dropped into place), which is nice. > Hmm ... who knows how to properly implement that stuff in our (up to now, > pretty simple) autoconf-based build system ? > I doubt you could use autoconf. It has things like '-L' and '-I' directives > hardwired in. Maybe just do what I did, but in the script-- detect darwin and append the framework directives, checking for OpenGL first, maybe, but it should be in any stock system AFAIK. I'm not sure how to implement this in autoconf though. There might be a way to get autoconf on Darwin to add in the frameworks automatically, though. I'll look for docs on it. > Perhaps we have to give up and treat it like we do MSVC and Borland under > Windoze where we just distribute a complete parallel build environment. This is another solution, It's a bit of grunt work setting up the Apple Project Builder files, but it's not to bad. The plib components can be made into frameworks, and contianed in this other concept darwin has of "umbrella" frameworks... I might be able to do this, if there is interest. Want me to send a patch for autoconf and code if I get it all more or less working correctly? My motive is working on my apple laptop, rather than my linux server/ desktop... which doesnt have a monitor :) But I can't spend too much time on it, I want to *use* plib :D I can get a monitor... Also: 1. is there a really minimal sample program I can use to test? 2. I ran configure script with --without-x. How important is X windows to any part of using plib? thanks reed -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (Darwin) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjwt528ACgkQ43zrjhPEi7/oUQCg6aYG3SPNoqzwSKpm4ouGcT+A jmYAoJrUhfw81UDAs1eB+ut2yc2AvEkV =wQ0O -----END PGP SIGNATURE----- |