From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Todd Newsgroups: gmane.lisp.guile.bugs Subject: patch to build guile CVS on Mac OS X Date: Tue, 6 Jan 2004 04:17:10 -0600 Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Message-ID: <20040106101709.GA27012@Richard-Todds-Computer.local> Reply-To: Richard Todd NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="i7F3eY7HS/tUJxUd" X-Trace: sea.gmane.org 1073414605 23271 80.91.224.253 (6 Jan 2004 18:43:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2004 18:43:25 +0000 (UTC) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Jan 06 19:43:22 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AdwAj-0001gz-00 for ; Tue, 06 Jan 2004 19:43:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Adx87-0002K9-Vj for guile-bugs@m.gmane.org; Tue, 06 Jan 2004 14:44:43 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Adx7q-0002B0-Tv for bug-guile@gnu.org; Tue, 06 Jan 2004 14:44:26 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Adx7H-0001Ou-Pm for bug-guile@gnu.org; Tue, 06 Jan 2004 14:44:23 -0500 Original-Received: from [66.171.156.242] (helo=Richard-Todds-Computer.local) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Adx6G-0000IR-44 for bug-guile@gnu.org; Tue, 06 Jan 2004 14:42:48 -0500 Original-Received: by Richard-Todds-Computer.local (Postfix, from userid 501) id C836E80721; Tue, 6 Jan 2004 04:17:10 -0600 (CST) Original-To: bug-guile@gnu.org Content-Disposition: inline User-Agent: Mutt/1.4i X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GUILE, GNU's Ubiquitous Extension Language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.bugs:1066 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.bugs:1066 --i7F3eY7HS/tUJxUd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all,=20 These changes made guile CVS build for me on Mac OS X. Non-scientific testing (ran some of my programs) seems to show that it's working. I'd appreciate it if this, or something like it, could get applied. BTW, on 12/30 I submitted a patch to bug-guile for a problem with ice-9/q.scm and haven't gotten an ACK from anyone about it. Should I re-submit after a while, or ...? Summary of changes:=20 1) Mac OS X has a funny quirk about getting to the environment from shared libs. Patches exactly like what I'm submitting were applied to many other programs (like python and tcl) for this exact issue. posix.c and stime.c were hit. 2) The SCM_MUTEX_MAX_SIZE was too small. I also added to the error message in threads-plugin.c, so that it tells you what the size should be. This was faster than getting to that point in a debugger! It may be that you'd want to just raise the size for all platforms, but I took the conservative approach and just raised it for __APPLE__. 3) numbers.c defined s_bignum but did not use it, and guile compiles such that this was an error. Maybe it'd be right to just get rid of it...but to get this to work I just #ifdef'ed it out for __APPLE__ Richard Todd richardt at vzavenue dot net --i7F3eY7HS/tUJxUd Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mac_osx.patch" Content-Transfer-Encoding: quoted-printable Index: libguile/numbers.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/guile/guile/guile-core/libguile/numbers.c,v retrieving revision 1.220 diff -u -r1.220 numbers.c --- libguile/numbers.c 3 Jan 2004 21:38:38 -0000 1.220 +++ libguile/numbers.c 6 Jan 2004 09:49:32 -0000 @@ -153,7 +153,9 @@ =20 =0C =20 +#ifndef __APPLE__ static const char s_bignum[] =3D "bignum"; +#endif =20 SCM_C_INLINE_KEYWORD SCM scm_i_mkbig () Index: libguile/posix.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/guile/guile/guile-core/libguile/posix.c,v retrieving revision 1.120 diff -u -r1.120 posix.c --- libguile/posix.c 15 Sep 2003 12:36:57 -0000 1.120 +++ libguile/posix.c 6 Jan 2004 09:49:34 -0000 @@ -97,7 +97,12 @@ =20 #include =20 +#if defined(__APPLE__) && defined(__DYNAMIC__) +#include +static char ** environ; +#else extern char ** environ; +#endif=20 =20 #ifdef HAVE_GRP_H #include @@ -1735,6 +1740,10 @@ void=20 scm_init_posix () { +#if defined(__APPLE__) && defined(__DYNAMIC__) + environ =3D *_NSGetEnviron(); +#endif + scm_add_feature ("posix"); #ifdef HAVE_GETEUID scm_add_feature ("EIDs"); Index: libguile/stime.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/guile/guile/guile-core/libguile/stime.c,v retrieving revision 1.82 diff -u -r1.82 stime.c --- libguile/stime.c 3 Jan 2004 22:25:24 -0000 1.82 +++ libguile/stime.c 6 Jan 2004 09:49:34 -0000 @@ -260,7 +260,12 @@ } =20 static char tzvar[3] =3D "TZ"; +#if defined(__APPLE__) && defined(__DYNAMIC__) +#include +static char ** environ; +#else extern char ** environ; +#endif =20 /* if zone is set, create a temporary environment with only a TZ string. other threads or interrupt handlers shouldn't be allowed @@ -671,6 +676,10 @@ void scm_init_stime() { +#if defined(__APPLE__) && defined(__DYNAMIC__) + environ =3D *_NSGetEnviron(); +#endif + scm_c_define ("internal-time-units-per-second", scm_long2num((long) SCM_TIME_UNITS_PER_SECOND)); =20 Index: libguile/threads-plugin.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/guile/guile/guile-core/libguile/threads-plugin.c,v retrieving revision 1.4 diff -u -r1.4 threads-plugin.c --- libguile/threads-plugin.c 5 Apr 2003 19:10:22 -0000 1.4 +++ libguile/threads-plugin.c 6 Jan 2004 09:49:35 -0000 @@ -181,6 +181,16 @@ || scm_i_plugin_rec_mutex_size > SCM_REC_MUTEX_MAXSIZE) { fprintf (stderr, "Internal error: Need to upgrade mutex size\n"); + fprintf (stderr,=20 + "Mutex Size: %d\tCurrent Max: %ld\n", + scm_i_plugin_mutex_size,=20 + SCM_MUTEX_MAXSIZE); + fprintf (stderr,=20 + "Recursive Mutex Size: %d\tCurrent Max: %ld\n", + scm_i_plugin_rec_mutex_size,=20 + SCM_REC_MUTEX_MAXSIZE); + + =20 abort (); } } Index: libguile/threads-plugin.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/guile/guile/guile-core/libguile/threads-plugin.h,v retrieving revision 1.3 diff -u -r1.3 threads-plugin.h --- libguile/threads-plugin.h 5 Apr 2003 19:10:22 -0000 1.3 +++ libguile/threads-plugin.h 6 Jan 2004 09:49:35 -0000 @@ -24,7 +24,11 @@ #include /* This file should *not* need to include pthread.h */ =20 /* Size is checked in scm_init_threads_plugin */ +#ifdef __APPLE__ +#define SCM_MUTEX_MAXSIZE (12 * sizeof (long)) +#else #define SCM_MUTEX_MAXSIZE (9 * sizeof (long)) +#endif typedef struct { char _[SCM_MUTEX_MAXSIZE]; } scm_t_mutex; =20 /*fixme* Should be defined similarly to scm_t_mutex. */ --i7F3eY7HS/tUJxUd Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://mail.gnu.org/mailman/listinfo/bug-guile --i7F3eY7HS/tUJxUd--