planetlabs / plcompositor

seamless and cloudless image mosaics from deep stacks of satellite imagery
http://planet.com
Apache License 2.0
101 stars 21 forks source link

Converts build configuration to use GNU autoconf #11

Open jameshiebert opened 8 years ago

jameshiebert commented 8 years ago

I'm not sure if you're looking for contributions on this repository, but I was touring the code and thought that the build process could use some automation with respect to searching for the dependencies. This pull request converts the Makefile to a GNU autoconf-compatible Makefile.in template. Using this, the include and lib paths can be easily sourced from environment variables during configuration or from the gdal-config binary residing in the user's path.

A new developer can simply run autoconf, configure and make to complete the build process:

$ autoconf
$ LDFLAGS=-L$HOME/lib/ CPPFLAGS=-I$HOME/include/ ./configure
$ make

The commit in this branch:

pl-nfwarmerdam commented 8 years ago

Where is AX_LIB_GDAL supposed to come from? Is autoconf 2.69 really required? I only have 2.68.

jameshiebert commented 8 years ago

AX_LIB_GDAL comes from m4/ax_lib_gdal.m4 (from the GNU Autoconf Archive). 2.69 is probably not really required; that line was generated by GNU autoscan, and I probably should have pulled it out or at least researched whether I was using any more recent features (I highly suspect not, but I can check into it).

jameshiebert commented 8 years ago

Re: autoconf 2.69 vs 2.68, I think that it's safe to relax the dependency and omit the check for stdbool.h which autoscan had included.

With respect to AX_LIB_GDAL not being included, I had unwittingly used auto_re_conf instead of simply autoconf. autoreconf does a few extra steps for you. That includes running aclocal which expands the AC_CONFIG_MACRO_DIR([m4/]) macro and ultimately pulls in m4/ax_lib_gdal.m4. In any case, I've documented the full configure/build process in the README which you're welcome to use (or not).

I'd understand if you're skeptical :) I know that a lot of people hate GNU autotools... at times they can feel a little spaghetti-like. But OTOH, I think that it's pretty slick and configurable once it's all set up. In any case, it's your call if you think this is worth it or not.