GRASS GIS on Mac OS X

OGDI

Last change: 2005/7/18


OGDI version: 3.1.5
ogdi.sourceforge.net (look in the Download Archive for v3.1.5 if it isn't listed on the main page.)

The OGDI source has an odd configuration. There is a 'configure', but it doesn't get Mac OS X/Darwin right. There is also a preset darwin configuration, but it needs some adjustments, and that's how we'll do it here.

In a Terminal type:

$ cd path_to_folder_containing_ogdi_source.tar.gz
$ tar -zxf ogdi-3.1.5.tar.gz

There are a couple patches to do. First, we need to tell it about Mac OS X dylib's. Edit ogdi/c-api/ecs_dyna.c in the source folder. In the function 'ecs_OpenDynamicLib', after the #else, it checks for the library extension (the default Linux .so extension, that is). Change

strcat(temp,".so");

to

strcat(temp,".dylib");

and change

if ((temp = (char *) malloc(strlen(libname)+7)) == NULL)

to

if ((temp = (char *) malloc(strlen(libname)+10)) == NULL)

With this patch, you will be able to use the driver name as specified in the GDAL format documentation for OGDI (ie: gltp:/vrf). Without it, you would have to type the whole library name for the driver (ie: gltp:/libvrf.dylib).

Then edit config/darwin.mak. Add these lines after BIG_ENDIAN = 1:

RPC_LINKLIB	=	-ldl 
PROJ_SETTING=external
PROJ_INCLUDE :=	-I/usr/local/include
PROJ_STATICLIB := -L/usr/local/lib -lproj
ZLIB_SETTING=external
ZLIB_INCLUDE :=	
ZLIB_LINKLIB := -lz
EXPAT_SETTING=external
EXPAT_INCLUDE := -I/usr/local/X11/include
EXPAT_LINKLIB := -L/usr/local/X11/lib -lexpat

Also in darwin.mak, find the $(DYNAGEN): $(OBJECTS) section. Change the $(SHLIB_LD) line to:

$(SHLIB_LD) $(SHLIB_LDFLAGS) -install_name $(INST_LIB)/$(notdir $@) $(COMMON_LDFLAGS) -o $@ $^ $(LINK_LIBS)

Then continue (Note: you DON'T run configure. If you do it will overwrite darwin.mak with something useless):

$ cd ogdi-3.1.5
$ export TOPDIR=path_to_source

path_to_source is the full path to OGDI source folder.

$ export TARGET=darwin
$ make
$ sudo make install

And clean up the environment:

$ unset TARGET TOPDIR

© 2003-2005 GRASS Development Team
Imprint | Comments about this page
Last change: $Date$