[GRASS5] FIX: gdal/v.in.dgn support with grass 5.0.2

Thierry Laronde tlaronde at polynum.org
Sun Jul 20 08:49:53 EDT 2003


[I have set some Bcc since the message might be of some interest to both
users, developers and packagers. Hope I don't make a mistake!]

Hello,

First sorry if the solution has already been given.

I wanted, in order to be more convincing about the adoption of GRASS, to
compile in the support for dgn (we use Microstation here).

This is the 5.0.2 release of GRASS. I have retrieved the 1.1.9 version of
gdal and I work on a FreeBSD 4.5 system, with user ports upgraded merely
to the 5.1 branch and adapted if necessary by hand.

Since the integration of the dgn library in gdal, the API has changed
and several things need to be adjusted for the module v.in.dgn (for
instance, DGNOpen now takes 2 arguments).

First, one need to use `--with-gdal=<PATH_TO_gdal-config>' as an
argument to `configure' and have gdal 1.1.9 compiled on the system with
the ogr support. If the `ogr' support has been compiled in, then the
DGN* functions are included in the gdal library. One doesn't need
something else. To verify the version of gdal (if installed):

gdal-config --version

To verify the presence of the DGN* functions one can use `nm' but a test
should be inserted in the configure script (I'm not an autoconf user, so
the patches are not given).

One problem with `gdal' is that the dgn* headers are not installed. I
have so added the relevant headers directly in v.in.dgn subdirectory,
but the "right" solution should be the installation of these by gdal.

The attached patches (named after the FreeBSD ports convention) are
sufficient to have v.in.dgn compiled successfully (it is not compiled by
default, you need to compile it with gmake5 and launch gmakelink5
afterwards ---BTW, how could one have it compiled by default if gdal
support is selected at configure time?).

Just a note : since `gdal-config --libs' mixes LDFLAGS (-L) and library
argument (-l), a dependency against GDAL_LIBS was puzzling gmake.


Thanks for the great work!
--
Thierry Laronde <tlaronde at polynum.org>
Site Debian Francophone (aka SDF) : http://www.debian-france.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-src::src::mapdev::v.in.dgn::main.c
Type: text/x-csrc
Size: 729 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20030720/e174a146/main.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-src::src::mapdev::v.in.dgn::dgnlibp.h
Type: text/x-chdr
Size: 5895 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20030720/e174a146/dgnlibp.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-src::src::mapdev::v.in.dgn::dgnlib.h
Type: text/x-chdr
Size: 28111 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20030720/e174a146/dgnlib.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-src::src::mapdev::v.in.dgn::cpl_conv.h
Type: text/x-chdr
Size: 7547 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20030720/e174a146/cpl_conv.bin
-------------- next part --------------
--- src/mapdev/v.in.dgn/Gmakefile.orig	Sat Jul 19 13:54:15 2003
+++ src/mapdev/v.in.dgn/Gmakefile	Sat Jul 19 19:29:55 2003
@@ -2,15 +2,12 @@
 
 OBJ = main.o
 
-DGNLIB=$(LIBDIR)/libdgn.a
-CPLLIB=$(LIBDIR)/libcpl.a
-
-LIBES=$(VECTLIB) $(GISLIB) $(DGNLIB) $(CPLLIB) $(MATHLIB) $(GDAL_LIBS) -lz
-DEPLIBS=$(DEPVECTLIB) $(DEPGISLIB) $(DGNLIB) $(CPLLIB) $(MATHLIB) $(GDAL_LIBS) -lz
+LIBES=$(VECTLIB) $(GISLIB) $(MATHLIB) -lz
+DEPLIBS=$(DEPVECTLIB) $(DEPGISLIB) $(MATHLIB) -lz
 
 
 $(BIN_CMD)/$(PGM):  $(OBJ) $(DEPLIBS) 
-	$(CC) -o $@ $(OBJ) $(LIBES)
+	$(CC) -o $@ $(OBJ) $(LDFLAGS) $(GDAL_LIBS) $(LIBES) 
 
 $(DEPVECTLIB): #
 $(DEPGISLIB): #


More information about the grass-dev mailing list