@@ -1067,32 +1067,6 @@ AC_CHECK_LIB([iconv], [locale_charset],
10671067 [ CHARSET_LIB=-lcharset] ) ] )
10681068GIT_CONF_SUBST([ CHARSET_LIB] )
10691069
1070- #
1071- # Define HAVE_SYSINFO=YesPlease if sysinfo is available.
1072- #
1073- AC_DEFUN ( [ HAVE_SYSINFO_SRC] , [
1074- AC_LANG_PROGRAM ( [ [
1075- #include <stdint.h>
1076- #include <sys/sysinfo.h>
1077- ] ] , [ [
1078- struct sysinfo si;
1079- uint64_t t = 0;
1080- if (!sysinfo(&si)) {
1081- t = si.totalram;
1082- if (si.mem_unit > 1)
1083- t *= (uint64_t)si.mem_unit;
1084- }
1085- return t;
1086- ] ] ) ] )
1087-
1088- AC_MSG_CHECKING ( [ for sysinfo] )
1089- AC_COMPILE_IFELSE ( [ HAVE_SYSINFO_SRC] ,
1090- [ AC_MSG_RESULT ( [ yes] )
1091- HAVE_SYSINFO=YesPlease] ,
1092- [ AC_MSG_RESULT ( [ no] )
1093- HAVE_SYSINFO=] )
1094- GIT_CONF_SUBST([ HAVE_SYSINFO] )
1095-
10961070#
10971071# Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available.
10981072GIT_CHECK_FUNC(clock_gettime,
@@ -1213,6 +1187,41 @@ AC_COMPILE_IFELSE([BSD_SYSCTL_SRC],
12131187 HAVE_BSD_SYSCTL=] )
12141188GIT_CONF_SUBST([ HAVE_BSD_SYSCTL] )
12151189
1190+ #
1191+ # Define HAVE_SYSINFO=YesPlease if sysinfo is available.
1192+ #
1193+
1194+ HAVE_SYSINFO=
1195+ # on a *BSD system, sysctl() takes precedence over the
1196+ # sysinfo() compatibility library (if installed).
1197+
1198+ if test -z "$HAVE_BSD_SYSCTL"; then
1199+
1200+ AC_DEFUN ( [ HAVE_SYSINFO_SRC] , [
1201+ AC_LANG_PROGRAM ( [ [
1202+ #include <stdint.h>
1203+ #include <sys/sysinfo.h>
1204+ ] ] , [ [
1205+ struct sysinfo si;
1206+ uint64_t t = 0;
1207+ if (!sysinfo(&si)) {
1208+ t = si.totalram;
1209+ if (si.mem_unit > 1)
1210+ t *= (uint64_t)si.mem_unit;
1211+ }
1212+ return t;
1213+ ] ] ) ] )
1214+
1215+ AC_MSG_CHECKING ( [ for sysinfo] )
1216+ AC_COMPILE_IFELSE ( [ HAVE_SYSINFO_SRC] ,
1217+ [ AC_MSG_RESULT ( [ yes] )
1218+ HAVE_SYSINFO=YesPlease] ,
1219+ [ AC_MSG_RESULT ( [ no] )
1220+ HAVE_SYSINFO=] )
1221+ GIT_CONF_SUBST([ HAVE_SYSINFO] )
1222+
1223+ fi
1224+
12161225# # Other checks.
12171226# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
12181227# Enable it on Windows. By default, symrefs are still used.
0 commit comments