Migrate the build system from autoconf-only to autoconf + automake #75
Open
Migrate the build system from autoconf-only to autoconf + automake #75
Conversation
Replace hand-written Makefile.in files with Makefile.am, enabling make dist, make dist-xz, automatic dependency tracking, and standard GNU build targets. - Modernize AC_INIT with package name and version - Add AM_INIT_AUTOMAKE with foreign, subdir-objects, dist-xz - Convert all three Makefile.in to Makefile.am - Rename yacc output from y.tab.h to ircd_parser.h - Add autogen.sh bootstrap script - Remove generated autotools files from git tracking - Tarball naming: ircu2.10.12.19.tar.gz (dot separator)
The ulimit -Hn check was unreliable across platforms (returns empty or 'unlimited' on macOS). Default to 16384 which is a sensible value; operators can override with --with-maxcon=N.
Add MAINTAINERCLEANFILES for configure, aclocal.m4, config.h.in, helper scripts, and generated Makefile.in files. Also ignore *~ backup files in .gitignore.
Add TESTS = $(check_PROGRAMS) so automake executes the test programs. Also add test-driver to .gitignore and MAINTAINERCLEANFILES.
On a fresh clone, include/patchlist.h doesn't exist (it's generated by ircd-patch). Create a default empty one so the build doesn't fail.
Use plain 'cat' instead of '/bin/cat' for portability across Linux distros where cat may not be in /bin (e.g. NixOS, some containers).
Backport the idea from PR #63: instead of checking yacc by piping empty input to '$YACC -V -v --version' (which was unreliable), test whether it can actually parse a minimal grammar. AC_PROG_YACC already prefers 'bison -y' over byacc over yacc, so the manual bison preference from PR #63 is unnecessary with our automake setup.
…pers Move version component defines (BASE_VERSION, MAJOR_PROTOCOL, RELEASE, PATCHLEVEL) into config.h via AC_DEFINE in configure.ac, making AC_INIT the single source of truth. patchlevel.h now just includes config.h. Remove duplicate defines from ircd.h. Also fix the broken magic number (text[218]) in m_info.c that prevented opers from seeing the entire Sources/Headers checksums in /INFO. Replace with a strcmp sentinel search for "Sources:" which adapts to any array size.
This file contains hidden or 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
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.
What changed
Makefile.in→Makefile.am: All three hand-writtenMakefile.infiles (top-level,ircd/,ircd/test/) replaced with automake equivalentsconfigure.ac: ModernizedAC_INITwith package name/version, addedAM_INIT_AUTOMAKE([foreign subdir-objects dist-xz])autogen.sh: New bootstrap script — run this after cloning to generateconfigureandMakefile.infilesy.tab.h→ircd_parser.hto leverage automake's native yacc support (only 3 files touched:ircd_lexer.c,s_conf.c,version.c.SH)configure,aclocal.m4,config.h.in,config.guess,config.sub,install-sh,stamp-h.in)--with-maxcon: Defaults to 16384 instead of fragileulimit -Hncheck that broke on macOSmake check: Now actually runs the test programs (not just builds them) with PASS/FAIL reportingmake maintainer-clean: Removes allautogen.shoutput, returning to a clean-checkout stateNew capabilities
make dist/make dist-xz— producesircu2.10.12.19.tar.gz/.tar.xzmake distcheck— builds from tarball to verify dist completenessmake check— builds and runs test programs (4/4 PASS)make maintainer-clean— removes allautogen.shoutputBuild workflow changes
Previously:
./configure && makeNow from a fresh clone:
./autogen.sh && ./configure && makeDistribution tarballs (
make dist) still ship a pre-generatedconfigure, so end users don't need autotools installed.Verification
convert-confbinary has byte-identical__TEXTand__DATAsections before and after migrationircdandumkpasswddiffer only due toversion.cbuild timestamps and non-deterministic macOS Mach-O linking metadataircd -v,umkpasswd -l,convert-confrun correctlyVersion note
The version in
AC_INITis hardcoded as10.12.19. When bumping versions, update bothinclude/patchlevel.handconfigure.ac.