-
Notifications
You must be signed in to change notification settings - Fork 6
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
Autotools build system #8
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Feb 18, 2018
Add `configure.ac` and `Makefile.am` for generating a configure script and Makefile. To match with convention, source files have been moved into the `src` subdirectory. The build files can be generated with `autoreconf -i`. We make use of some extensions (`AX_*` macros), so we require the build machone to have the autoconf archive installed (`autoconf-archive` on Arch Linux). Note that as many compiler warnings as possible are enabled by default. For development versions (i.e. commits not tagged with a version string) of the code, warnings will cause an error. Release versions are slightly more slack, and will just emit warnings: this is a feature of the `AX_COMPILER_FLAGS` macro, and is the intended behaviour.
This cleans up some code smell: * Explicitly declare functions that take no arguments like `foo(void)` rather than `foo()`. We should now get compiler errors when calling zero-argument functions with arguments. * Remove (completely benign) signed/unsigned comparison in loop counter. * Add the `noreturn` attribute to `die()`. We do an explicit check for the `stdnoreturn.h` header so we can compile on non-C11 systems.
Without this the tarballs produced by `make dist` were broken.
Autotools automatically uses a cached version of `configure` if `configure.ac` has not changed since `autoreconf` was last run. We want `git describe` to update `PACKAGE_VERSION` in `configure` no matter what, so this commit adds an `.autm4te.cfg` that stops `configure` being cached.
Bump the required version of autoconf to 2.64. It was previously 2.63, which is *really* old (2008), and unsupported by the third-party macros we are using. This commit also adds the `AM_PROG_CC_C_O` macro, which is now obsolete but is required by older (e.g. 2.69 as shipped with RHEL7) versions of autotools.
e1a97e3
to
667b9f6
Compare
667b9f6
to
e0d1422
Compare
livibetter
reviewed
Feb 19, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating .gitignore
?
The following was what I got from git status
after make
:
Makefile
Makefile.in
aclocal.m4
autoconf-archive/
compile
config.h
config.h.in
config.log
config.status
configure
depcomp
install-sh
missing
src/.deps/
src/.dirstamp
stamp-h1
@livibetter Good call. I'm going to merge this now so there is a good base to work off of for future changes. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add an autotools build system. Compared to the existing Makefile, this provides
install
anduninstall
targets, more robust tests for curses, more compiler warnings, and adist
target to build a release tarball.The downside is that building a version of this directly from git will require autotools. I've used a few macros from the autoconf archive in
configure.ac
, so the user will also need the autoconf archive. This won't be a problem when we make a release or for packaged versions, which will either be based on a release or point to the git repository and include autotools as a build dependency.I would like for this to supersede #6 if there are no objections to the more complex build system.