[Tutor] Re: Compiling Python on MacOSX.

Derrick 'dman' Hudson dman@dman.ddts.net
Tue, 24 Sep 2002 00:57:41 -0400


--XStn23h1fwudRqtG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Sep 21, 2002 at 10:30:43AM -0500, montana wrote:
| Hi Everyone-
|=20
| I'm following the directions from:
|=20
| http://tony.lownds.com/macosx/tkinter.html
|=20
| I'm trying to  compile Python 2.2 with aqua Tk support for my computer.=
=20
| I'm running 10.2.1 on a G4 Powerbook. When I run 'make' it barfs on the=
=20
| followign error:
|=20
| Modules/_tkinter.c: In function `Sleep':
| Modules/_tkinter.c:252: warning: implicit declaration of function=20
| `select'
| make: *** [Modules/_tkinter.o] Error 1

Ooh, ouch.  Does anyone know if OSX lacks a select()?

On my Debian/linux system, sleep() is declared in
/usr/include/sys/select.h.  Do you have a file like that?

If you look in Include/pyport.h, you'll see that sys/select.h is
included but only if the macro HAVE_SYS_SELECT_H is defined.  The
purpose of that C idiom is to allow the actual code being compiled to
change based on what is available on the system.  If <sys/select.h>
doesn't exist on some platform, then the code doesn't try to include
it (which would be an error).

One way to see if that macro is defined on your system is to put this
line just below it :
    #warn HAVE_SYS_SELECT_H _is_ defined
and put this line just below the #else line
    #warn HAVE_SYS_SELECT_H is _not_ defined

| Here is the guilty piece of code:
|=20
| static void
| Sleep(int milli)
| {
| 	/* XXX Too bad if you don't have select(). */
=2E..
| 	select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &t);

Don't you just love that comment?  ;-)

| Any ideas how to get around this?

(see above)

| Is this an issues with the new gcc 3 on 10.2 versus the old gcc from
| 10.1?

I don't know.

HTH,
-D

--=20
If Microsoft would build a car...
=2E.. Occasionally your car would die on the freeway for no reason. You
would have to pull over to the side of the road, close all of the car
windows, shut it off, restart it, and reopen the windows before you
could continue. For some reason you would simply accept this.
=20
http://dman.ddts.net/~dman/

--XStn23h1fwudRqtG
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj2P8MQACgkQO8l8XBKTpRQ3EACgnpiBTDTL6/RDPKGzaL2Tcsln
PzMAnj+1/f7dDMWYXWaXsWrSzO54UIjk
=I/9Z
-----END PGP SIGNATURE-----

--XStn23h1fwudRqtG--