[GRASS5] GRASS binaries for Mac OS X

Scott W Mitchell smitch at mac.com
Mon Sep 22 10:24:12 EDT 2003


Is this it ?  This is how this was solved in WINE, as far as I can
see/understand - you use crt_externs.h and define environ... well, here's
the relevant patch:

Index: scheduler/process.c
===================================================================
RCS file: /home/wine/wine/scheduler/process.c,v
retrieving revision 1.213
diff -u -r1.213 process.c
--- scheduler/process.c 27 Apr 2003 00:47:58 -0000      1.213
+++ scheduler/process.c 27 Apr 2003 20:05:52 -0000
@@ -32,6 +32,11 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
+#ifdef __darwin__
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
+#endif
+
 #include "wine/winbase16.h"
 #include "wine/winuser16.h"
 #include "wine/exception.h"
Index: scheduler/sysdeps.c
===================================================================

On Mon, 22 Sep 2003, Markus Neteler wrote:

> Hi,
>
> I am still strying to compile GRASS 5.7 on Mac OSX.
> At time I face the general problem that, when compiling
> libraries, symbols from other GRASS libs are required.
> This doesn't happen on Linux.
>
> I solved this for some libs by adding e.g.
> EXTRA_LIBS=$(LIBLINK)
> etc to the Makefile. Like that the compile order is important
> and needs to be slightly modified. So far, so nice.
>
> But in libgis I got stuck with
>
> cd lib/gis
> make
> [...]
> OBJ.powerpc-apple-darwin6.6/writ_zeros.o OBJ.powerpc-apple-darwin6.6/yes.o
> OBJ.powerpc-apple-darwin6.6/zero.o OBJ.powerpc-apple-darwin6.6/zero_cell.o
> OBJ.powerpc-apple-darwin6.6/zone.o OBJ.powerpc-apple-darwin6.6/G_dump.o
> -lgrass_datetime -lz  -o
> /grass57exp/dist.powerpc-apple-darwin6.6/lib/libgrass_gis.dylib
> ld: Undefined symbols:
> _environ
> /usr/bin/libtool: internal link edit command failed
> make: *** [/grass57exp/dist.powerpc-apple-darwin6.6/lib/libgrass_gis.dylib]
> Error 1
>
> The file 'putenv.c' from GRASS 5.3 should probably have
> #include <unistd.h>
> added as under Linux is defined:
> grep environ /usr/include/unistd.h
>   extern char **environ;
>
> Unfortunately on Mac OSX there is nothing like that in
> /usr/include/unistd.h
> /usr/include/sys/unistd.h
> nor in another place.
>
> How to solve that?
>
> Markus
>
> PS: I can provide access to this Mac OSX machine.
>
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
>




More information about the grass-dev mailing list