HI Even,

I understand the good intention of cleaning up code but that should not remove 
functionality. You are breaking backward compatibility. What if someone updates 
GDAL in some installation, proj4 is there and it will not going to be used?


I my case, I *cannot* distribute proj4 into my GDAL build and I *need* to have 
the options to let the user decided if they want to add proj4 shared libraries.


Regards,

Ivan





________________________________
From: Even Rouault <even.roua...@spatialys.com>
Sent: Saturday, May 6, 2017 1:35:18 PM
To: Ivan Lucena
Cc: Kurt Schwehr; gdal dev
Subject: Re: [gdal-dev] Dropping dlopen/LoadLibrary loading of proj.4 ?


On samedi 6 mai 2017 17:04:33 CEST Ivan Lucena wrote:

> -1

>

>

> We have the options to build drivers against static and dynamic libraries of

> its SDKs, like HDF4,5 and openjpeg for example, using the same

> "--with-driver-name"

>

>

> Why not keep that same option for proj4?



I think you are confusing things. For a good reason since the 
--with-static-proj4 name is confusing. --with-static-proj4 can link against 
libproj.a or libproj.so depending on which is available, which is classic build 
time linking. My suggestion is to keep this as the only option to use proj.4, 
and rename it --with-proj4 for more clarity and consistency



When this option is not specified, proj4 is optionaly loaded through 
dlopen()/LoadLibrary(), which is runtime linking and what I'm proposing to drop 
for simplicity.



HDF4, 5, openjpeg are only supported through build time linking.



>

>

> --with-proj4=<static or dynamic>-library-path

>

>

> I have projects where I let user to decide if they want to download and

> install proj4 while using GDAL and I would prefer to keep that option.

>



Well, that seem to be a rather particular use case. Given the small size of 
libproj regarding libgdal, you could always build against proj.



After my cleanup and removal of pre-4.8 support, ogrct.cpp is now down to 1110 
lines against 1311 before, and much easier to follow. And that save testing 
behaviour in --with-static-proj4 and --without-static-proj4 cases



>

> Maybe with a compiler option we can basically "remove" the dynamic load when

> static linked proj4 was used.



That's already the case. If currently you use --with-static-proj4, dynamic 
loading at runtime is disabled.



--

Spatialys - Geospatial professional services

http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to