Merge branch 'rj/freebsd-sysinfo-build-fix'

Build fix for FreeBSD.

* rj/freebsd-sysinfo-build-fix:
  build: fix FreeBSD build when sysinfo compat library installed
This commit is contained in:
Junio C Hamano
2025-07-14 11:19:28 -07:00
2 changed files with 41 additions and 30 deletions

View File

@@ -1331,10 +1331,6 @@ if host_machine.system() != 'windows'
endif
endif
if compiler.has_member('struct sysinfo', 'totalram', prefix: '#include <sys/sysinfo.h>')
libgit_c_args += '-DHAVE_SYSINFO'
endif
if compiler.has_member('struct stat', 'st_mtimespec.tv_nsec', prefix: '#include <sys/stat.h>')
libgit_c_args += '-DUSE_ST_TIMESPEC'
elif not compiler.has_member('struct stat', 'st_mtim.tv_nsec', prefix: '#include <sys/stat.h>')
@@ -1438,6 +1434,12 @@ if compiler.has_header('sys/sysctl.h')
endif
endif
if not has_bsd_sysctl
if compiler.has_member('struct sysinfo', 'totalram', prefix: '#include <sys/sysinfo.h>')
libgit_c_args += '-DHAVE_SYSINFO'
endif
endif
if not meson.is_cross_build() and compiler.run('''
#include <stdio.h>