Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converts build configuration to use GNU autoconf #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jameshiebert
Copy link

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:

  • Adds a configure.ac script
  • Sources lib and include paths from the environment
  • Converts Makefiles to Makefile.in templates
  • Modifies the README to specify WJElement as a dependency

* Adds a configure.ac script
* Sources lib and include paths from the environment
* Converts Makefiles to Makefile.in templates
* Modifies the README to specify WJElement as a dependency
@pl-nfwarmerdam
Copy link
Contributor

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

@jameshiebert
Copy link
Author

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).

Assuming that we don't need to check for stdbool.h (since the package
doesn't use it), we won't need autoconf 2.69 which introduced the
AC_HEADER_CHECK_STDBOOL macro
@jameshiebert
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants