Getting guile-1.6.4 to work on OS/X Chris Waterson waterson (at) maubi (dot) net 9/17/2003 It took me several tries to get guile-1.6.4 to build and install correctly under OS/X. Here's what I did: 1. Installed the `dlcompat' package from fink. (I think this may just be part of the stock fink install, actually.) 2. Got a tarball. Make `distclean' because (at least in my tarball) whoever packaged it forgot to. 3. Applied this patch: diff -ur guile-1.6.4/libguile/gc_os_dep.c guile-1.6.4-patched/libguile/gc_os_dep.c --- guile-1.6.4/libguile/gc_os_dep.c Wed Apr 16 13:16:21 2003 +++ guile-1.6.4-patched/libguile/gc_os_dep.c Sun Aug 17 22:30:15 2003 @@ -249,7 +249,7 @@ # define MACOS # define mach_type_known # endif -# if defined(macosx) +# if defined(macosx) || (defined(__APPLE__) && defined(__ppc__)) # define MACOSX # define POWERPC # define mach_type_known diff -ur guile-1.6.4/libguile/posix.c guile-1.6.4-patched/libguile/posix.c --- guile-1.6.4/libguile/posix.c Sat Dec 7 14:41:32 2002 +++ guile-1.6.4-patched/libguile/posix.c Sun Aug 17 22:29:53 2003 @@ -119,6 +119,11 @@ extern char ** environ; +#if defined(__APPLE__) +#include +char **environ = NULL; +#endif + #ifdef HAVE_GRP_H #include #endif @@ -1036,6 +1041,11 @@ "then the return value is unspecified.") #define FUNC_NAME s_scm_environ { +#if defined(__APPLE__) + if (environ == NULL) + environ = *_NSGetEnviron(); +#endif + if (SCM_UNBNDP (env)) return scm_makfromstrs (-1, environ); else I found the first chunk on the web somewhere. I can't remember exactly what it fixes. The second patch fixes the fact that OS/X doesn't have an `environ' when you link into a dylib. Stole it from Tcl, IIRC. 4. Configured with: CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib \ CPPFLAGS="-I/sw/include -traditional-cpp" ./configure You need to pick up the stuff in /sw/* (namely, dlcompat) for guile to realize that it can do dynamic linking. Specifying `-traditional-cpp' avoids some brain damage with the pre-compiled headers that otherwise cause the build to take *hours*. 5. Run with DYLD_LIBRARY_PATH=/usr/local/lib, otherwise dyld won't find any of the stuff that's `dynamic-link'-ed (e.g., srfi-13). Anyone know how to add this to OS/X's default install path? I.e., the equivalent of /etc/ld.config on Linux? I suppose I could just re-build and have it install stuff in /usr/lib, but... Anyway, good luck. Comments or feedback welcome!