mirror of
https://github.com/nilfs-dev/nilfs-utils.git
synced 2026-01-26 21:52:12 +00:00
Add a mechanism to embed the git revision into the compiled binaries. This allows users and developers to identify the exact source commit used for the build, which aids in debugging and tracking versions. The git revision is obtained using 'git describe' and stored in the .comment ELF section using the new NILFS_UTILS_GITID() macro defined in util.h. This section is not loaded into memory at runtime. The embedded revision can be checked using 'readelf -p .comment <binary>'. This feature is opt-in to ensure deterministic builds for package maintainers. It is enabled only if the environment variable NILFS_UTILS_USE_GITID is set to 1, true, on, or yes when generating the configure script (e.g. by running autoconf or autogen.sh). Also, bump the minimum Autoconf version to 2.64 to utilize m4_esyscmd_s. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>