]> git.ipfire.org Git - thirdparty/git.git/commit
configure.ac: upgrade to a compilation check for sysinfo
authorRamsay Jones <ramsay@ramsayjones.plus.com>
Mon, 19 May 2025 16:25:23 +0000 (17:25 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 May 2025 18:34:00 +0000 (11:34 -0700)
commit187ce0222f73dd5e8e8c0f5d0b764b4820cc9143
tree84982eee81ef2d785855daca864ba22fb6a793b4
parent837f637cf51ee066e98ceefea76cc6e9c3277469
configure.ac: upgrade to a compilation check for sysinfo

Commit f5e3c6c57d ("meson: do a full usage-based compile check for
sysinfo", 2025-04-25) updated the 'sysinfo()' check, as part of the
meson build, due to the failure of the check on Solaris. Prior to
that commit, the meson build only checked the availability of the
'<sys/sysinfo.h>' header file. On Solaris, both the header and the
'sysinfo()' function exist, but are completely unrelated to the same
function on Linux (and cygwin).

Commit 50dec7c566 ("config.mak.uname: add sysinfo() configuration for
cygwin", 2025-04-17) added a similar 'sysinfo()' check to the autoconf
build. This check looked for the 'sysinfo()' function itself, rather
than just the header, but it will fail (incorrectly set HAVE_SYSINFO)
for the same reason.

In order to correctly identify the 'sysinfo()' function we require as
part of 'git-gc' (used in the 'total_ram() function), we also upgrade
to a compilation check, in a similar way to the meson commit. Note that
since commit c9a51775a3 ("builtin/gc.c: correct RAM calculation when
using sysinfo", 2025-04-17) both the 'totalram' and 'mem_unit' fields
of the 'struct sysinfo' are used, so the new check includes both of
those fields in the compile check.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
configure.ac