Skip to content

use Automake to generate Makefiles#17

Open
whitslack wants to merge 2 commits intoBlockchainCommons:masterfrom
whitslack:automake
Open

use Automake to generate Makefiles#17
whitslack wants to merge 2 commits intoBlockchainCommons:masterfrom
whitslack:automake

Conversation

@whitslack
Copy link

@whitslack whitslack commented Oct 29, 2024

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 of CXX), 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.

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.

1 participant

Comments