[GRASS5] gdal-config --dep-libs

Glynn Clements glynn at gclements.plus.com
Sat Nov 13 10:02:15 EST 2004


Radim Blazek wrote:

> >>Should be `gdal-config --dep-libs` also added to GDAL_LIBS?
> > 
> > 
> > Yes; although we need to check when that switch was added (it hasn't
> > always been there), and possibly update REQUIREMENTS.html accordingly.
> > 
> > 
> >>How is it possible that GRASS compiles without GDAL dep-libs?
> > 
> > 
> > If GDAL is a shared library, it normally includes dependency
> > information, so linking against libgdal automatically pulls in the
> > dependencies.
> > 
> > If it's a static library, it won't work (this has been reported
> > previously on one of the GRASS lists; this may be the reason why that
> > switch was added).
> 
> http://xserve.flids.com/pipermail/gdal-dev/2004-February/004965.html
> So it should be in 1.2.1?
> 
> My suggestion:
> 
> if test -n `gdal-config | grep 'dep-libs'` ; then
>      GDAL_DEP_LIBS=`"$GDAL_CONFIG" --dep-libs`
>      GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS"
> fi

Or:
	GDAL_DEP_LIBS=`"$GDAL_CONFIG" --dep-libs 2>/dev/null`
	GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS"

If gdal-config doesn't understand the --dep-libs switch, it won't
write anything to stdout.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list