Add a CMake build alongside autotools#606
Open
matejk wants to merge 4 commits into
Open
Conversation
The version string lived only in configure.ac's AC_INIT. Move it to a
neutral VERSION file (line 1: numeric X.Y.Z.W, line 2: optional suffix)
so a second build system can read the same source. AC_INIT now joins
the two lines via m4_esyscmd_s; the resulting PACKAGE_VERSION is
unchanged ("2.4.8.4 (Prelim)").
…stem make_message_src.sh hardcoded the genrb/pkgdata paths per-OS and assumed the in-source messages/ layout (cd into the bundle dir, write the archive to ../../). Honor $GENRB/$PKGDATA from the environment when set, and accept optional source-bundle and output directories so an out-of-source build can call the same script. The one-argument form keeps the historical behavior, so messages/Makefile.am is unchanged.
actions/checkout v4 runs on Node.js 20, which GitHub deprecates in June 2026; move to v6. codeql-action moves to v4 and create-pull-request to v8 for the same reason.
CMake >= 3.18, coexisting with the autotools build; both read the
package version from the shared VERSION file. Linux is fully wired
(libltfs, the ltfs/mkltfs/ltfsck executables, the sg/file/itdtimg tape
backends, both I/O schedulers, both key managers); macOS builds the
iokit tape backend; the FreeBSD/NetBSD backends are skipped with a
notice and remain autotools-only. The build targets libfuse 2, like
autotools; the FUSE 3 selection arrives with the FUSE 3 port.
Notable differences from the autotools implementation:
- ICU is found through CMake's ICU module instead of the icu-config
tool that ICU removed in 2018, and ICU6x is defined automatically
for ICU >= 60. libxml2 uses find_package(LibXml2); fuse/uuid/
net-snmp have no CMake packages and use pkg-config imported targets.
- config.h is generated from cmake/config.h.in, covering the subset
of macros the sources use; feature toggles are passed on the
command line, as in the autotools build.
- The message bundles are compiled by the same shared
messages/make_message_src.sh, invoked with explicit source/output
directories and the discovered genrb/pkgdata.
- The per-backend source symlinks and the CRC_OPTIMIZE compile rule
are replaced by direct source paths and one SSE4.2-flagged OBJECT
library linked into every tape backend.
- Plugins are MODULE libraries named exactly as ltfs.conf expects
(libtape-sg.so etc.), installed to <libdir>/ltfs.
- ctest registers tests/t/*.sh by glob via the shared harness
(SKIP_RETURN_CODE 77 outside Linux/fuse hosts), so the build works
with or without the integration test suite.
A CI workflow configures, builds, and runs ctest on ubuntu.
Verified in an Ubuntu VM: the build and all 14 tests pass via ctest
with the test suite present; the install tree matches autotools (bin,
lib, lib/ltfs plugins, etc/ltfs.conf{,.local}, pkgconfig, man,
headers); ltfs --version reports the identical version string; the
autotools build and make check stay green. On macOS 26 (arm64,
macFUSE SDK) the CMake build produces libltfs, the executables, and
all plugins including libtape-iokit.so.
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.
Summary
Adds a CMake build (>= 3.18) that coexists with the autotools build, plus CI updates. 4 commits based directly on
main:AC_INITto a top-levelVERSIONfile read by both build systems, so there is a single source of truth. The resultingPACKAGE_VERSIONstring is unchanged.messages/make_message_src.shaccepts optional source/output directories and honors$GENRB/$PKGDATA, so an out-of-source build can call it; the one-argument form keeps the historical behavior andmessages/Makefile.amis unchanged.Scope
Linux is fully wired: libltfs, the
ltfs/mkltfs/ltfsckexecutables, the sg/file/itdtimg tape backends, both I/O schedulers, both key managers. macOS additionally builds the iokit tape backend. The FreeBSD/NetBSD backends are skipped with a notice and remain autotools-only. The build targets libfuse 2, matching autotools; the FUSE 3 selection follows as a small extension once #603 merges.Notable differences from the autotools implementation:
icu-configtool that ICU removed in 2018 (ICU6xis set automatically for ICU >= 60); libxml2 usesfind_package(LibXml2); fuse/uuid/net-snmp use pkg-config imported targets.CRC_OPTIMIZErule are replaced by direct source paths and one SSE4.2-flagged OBJECT library.ltfs.confexpects (libtape-sg.soetc.), installed to<libdir>/ltfs.tests/t/*.shby glob via the shared harness, so the build works with or without the integration test suite (Add an integration test suite using the file tape backend #611) and picks up its tests automatically.Verification
Ubuntu VM: the CMake build and all 14 integration tests pass via ctest (with #611 merged alongside); the install tree matches autotools (bin, lib, plugins,
etc/ltfs.conf{,.local}, pkgconfig, man, headers);ltfs --versionreports the identical string; the autotools build andmake checkstay green. macOS 26 (arm64, macFUSE SDK): the build produces libltfs, the executables, and all plugins includinglibtape-iokit.so.Fixes #521.