[postgis-tickets] [PostGIS] #4324: Use pkg-config to improve dependency detection

PostGIS trac at osgeo.org
Mon Feb 11 08:31:13 PST 2019


#4324: Use pkg-config to improve dependency detection
-------------------------+---------------------------
 Reporter:  Algunenano   |      Owner:  Algunenano
     Type:  enhancement  |     Status:  assigned
 Priority:  medium       |  Milestone:  PostGIS 3.0.0
Component:  postgis      |    Version:  trunk
 Keywords:               |
-------------------------+---------------------------
 Mailist: https://lists.osgeo.org/pipermail/postgis-
 devel/2019-February/027687.html

 The idea is to use pkg-config for those dependencies that support it when
 the corresponding option (e.g. `--with-projdir`) isn't set.

 This has several benefits:
 - It doesn't matter where you've installed your packages as long as the
 pkg-build path is set up correctly, for example, OSX with brew.
 - It's much simpler to support: You can do a one-liner to check if the
 library is available and which flags to use.
 - If any dependency in the future decided to change their API (different
 include structure, change its library name), the pkg-build would work
 automatically. OTOH, it'd be a nightmare with the hardcoded paths and
 libraries.

 For now, I've kept the `--with-XXdir` options as the first priority,
 defaulting to pkg-build only if the option isn't passed and `pkg-build` is
 available. I'm also showing a warning when using those options.

 In the future (before final release) we should decide whether to keep the
 options and/or the warnings.

 Note that, for full manual configuration, if the proper "--prefix" is
 passed when configuring proj:
 {{{
 ./configure --with-projdir="/home/raul/dev/build/proj.4"
 }}}
 is equivalent to
 {{{
 ./configure PKG_CONFIG_PATH="/home/raul/dev/build/proj.4"
 }}}
 which, with current proj, is equivalent to
 {{{
 ./configure PROJ_CFLAGS="/home/raul/dev/build/proj.4/include"
 PROJ_LIBS="-L/home/raul/dev/build/proj.4/libs -lproj"
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4324>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list