[gdal-dev] Error compiling GDAL from trunk on Mac OS X 10.6.8

Even Rouault even.rouault at mines-paris.org
Fri Mar 15 14:36:36 PDT 2013


Le vendredi 15 mars 2013 20:09:57, Jorge Arévalo a écrit :
> Hello,
> 
> I'm getting an error compiling GDAL from trunk (r25758). I successfully
> compiled GDAL from trunk before with this configure script:
> 
> https://dl.dropbox.com/u/6599273/gdal/configure_gdal.sh
> 
> But after last svn update to r25758, I get this error
> 
> https://dl.dropbox.com/u/6599273/errors/gdal_trunk_compile_error.log
> 
> I haven't compiled GDAL on Mac for a while. So, The problem isn't
> necessarily caused by the last update.
> 
> Anyone else with the same problem?

Cool that someone tests on the Mac and reports.

Well, I assumed that "extern char** environ" that contains the environment 
variable was available on all POSIX platforms, but apparently not.

http://www.gnu.org/software/gnulib/manual/html_node/environ.html suggests me 
the following patch. Please test and report if it works.

Index: port/cpl_spawn.cpp
===================================================================
--- port/cpl_spawn.cpp	(revision 25734)
+++ port/cpl_spawn.cpp	(working copy)
@@ -461,8 +461,13 @@
 #include <signal.h>
 #ifdef HAVE_POSIX_SPAWNP
 #include <spawn.h>
+#ifdef MACOSX_FRAMEWORK
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
 extern char** environ;
 #endif
+#endif
 
 #if 0
 /************************************************************************/


> 
> Thanks in advance,


More information about the gdal-dev mailing list