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.
Rather than rolling your own "poor man's Automake," just use the Real Thing™. The files come out shorter and easier to read/maintain, and you get all the
dist
,check
,install
,uninstall
,clean
,distclean
(etc.) targets for free.My impetus for doing this work was to allow bc-ur to be built and installed by the package manager on Gentoo Linux. The preëxisting build system of bc-ur made too many assumptions about compiler name and flags, and it was even linking the unit test program using the wrong compiler (
CC
instead ofCXX
), for which the author had apparently attempted to work around by hard-coding links to one particular toolchain's standard C++ libraries. That, of course, fails when using any other toolchain (e.g., GCC instead of Clang). Automake and Libtool get all of this correct right out of the box, plus it becomes trivial to build bc-ur as a shared library, which is the strong preference on Gentoo. Given that bc-ur was already using Autoconf, adopting Automake as well is not much of a leap.I tried to replicate mostly the same end results with Automake as the hand-rolled recipes produced. I think I got everything, but I don't want to set up a MinGW toolchain, so I couldn't check that
ws2_32
is properly being linked on that platform.