PostGIS gets a well-earned cleanup

Sun May 18 2008

As you all know, I’ve been working on PostGIS for quite a while now, and one of the things that has really been bugging me is the amount of legacy code in the codebase. Hands up all those of you who remember having to type SELECT update_geometry_stats() to build the optimiser index statistics on your database manually…!

After various discussions on the PostGIS mailing lists, I finally got the go-ahead to commit a new build system using new autoconf code and PGXS, the discussion of which can be found here. The main reasons for re-writing the build system are to move most of the version detection logic from the Makefile into autoconf/autoheader, so that we can start to think about other toolchains (think MSVC in particular), and to help maintainability of the project in the long run. Because there are so many different compile options, it was fairly easy for one developer to miss something, and hence break some else’s build environment. The new build system helps by making PROJ.4 and GEOS compulsary, which means that we considerably reduce the overhead of maintaining multiple versions of the regression tests.

One of the side effects of this is that in order to use PGXS, we require PostgreSQL > 8.0. Since last time I asked about this on-list, I received just 1 reply asking for older versions - so I don’t think too many people will lose sleep over it. It also gives me a chance to remove a lot of legacy code from the codebase - anyone browsing from the 1.3 series branch will go cross-eyed very quickly…