gdal-config --libs listing lots of unnecessary things to link against
|Reported by:||warmerdam||Owned by:||warmerdam|
|Cc:||Mateusz Łoskot, dustymugs, l|
On systems like linux the GDAL shared library internally depends on various sublibraries; however, it is not necessary for applications linking against GDAL to also link against these sublibraries.
An example of this if GDAL is built against mysql, gdal-config --libs lists something like "-L/usr/lib/mysql -lmysqlclient" amoung lots of other things. But an application linking against libgdal.so does *not* need to link against the mysqlclient library.
If a packaged GDAL is being used to build another package, like MapServer, this extra linking will force MapServer to need the mysql-dev package (with libmysqlclient.so) when really the only requirment is the runtime package (with something like libmysqlclient.so.15). This is the case with MapServer ticket 3199:
Somehow we need to work out how to limit gdal-config --libs to only listing required libraries for applications building against the GDAL library. I would think in most cases this would be only "-L/wrk/home/warmerda/gdal -lgdal".