Skip to content

Migrate the build system from autoconf-only to autoconf + automake #75

Open
Ratler wants to merge 10 commits intomainfrom
feat/automake-migration
Open

Migrate the build system from autoconf-only to autoconf + automake #75
Ratler wants to merge 10 commits intomainfrom
feat/automake-migration

Conversation

@Ratler
Copy link
Member

@Ratler Ratler commented Mar 21, 2026

What changed

  • Makefile.inMakefile.am: All three hand-written Makefile.in files (top-level, ircd/, ircd/test/) replaced with automake equivalents
  • configure.ac: Modernized AC_INIT with package name/version, added AM_INIT_AUTOMAKE([foreign subdir-objects dist-xz])
  • autogen.sh: New bootstrap script — run this after cloning to generate configure and Makefile.in files
  • Yacc rename: y.tab.hircd_parser.h to leverage automake's native yacc support (only 3 files touched: ircd_lexer.c, s_conf.c, version.c.SH)
  • Git cleanup: Removed generated autotools files from tracking (configure, aclocal.m4, config.h.in, config.guess, config.sub, install-sh, stamp-h.in)
  • --with-maxcon: Defaults to 16384 instead of fragile ulimit -Hn check that broke on macOS
  • make check: Now actually runs the test programs (not just builds them) with PASS/FAIL reporting
  • make maintainer-clean: Removes all autogen.sh output, returning to a clean-checkout state

New capabilities

  • make dist / make dist-xz — produces ircu2.10.12.19.tar.gz / .tar.xz
  • make distcheck — builds from tarball to verify dist completeness
  • make check — builds and runs test programs (4/4 PASS)
  • make maintainer-clean — removes all autogen.sh output
  • Automatic dependency tracking (replaces 200+ hand-written dep lines)

Build workflow changes

Previously: ./configure && make

Now from a fresh clone: ./autogen.sh && ./configure && make

Distribution tarballs (make dist) still ship a pre-generated configure, so end users don't need autotools installed.

Verification

  • convert-conf binary has byte-identical __TEXT and __DATA sections before and after migration
  • ircd and umkpasswd differ only due to version.c build timestamps and non-deterministic macOS Mach-O linking metadata
  • All binaries tested: ircd -v, umkpasswd -l, convert-conf run correctly
  • Tarball extracts, configures, and builds successfully
  • All 4 test programs pass

Version note

The version in AC_INIT is hardcoded as 10.12.19. When bumping versions, update both include/patchlevel.h and configure.ac.

Ratler added 10 commits March 21, 2026 12:50
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.
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