diff -Nurd -x'*~' libdap-3.5.2.orig/gl/putenv.c libdap-3.5.2/gl/putenv.c --- libdap-3.5.2.orig/gl/putenv.c 2005-08-08 18:11:06.000000000 -0400 +++ libdap-3.5.2/gl/putenv.c 2007-08-06 13:19:58.000000000 -0400 @@ -46,7 +46,12 @@ #if HAVE_GNU_LD # define environ __environ #else -extern char **environ; +#ifdef __APPLE__ +#include +#define environ (*_NSGetEnviron()) +#else + extern char **environ; +#endif #endif #if _LIBC