Skip to content

Commit 50dec7c

Browse files
ramsay-jonesgitster
authored andcommitted
config.mak.uname: add sysinfo() configuration for cygwin
Although sysinfo() is a 'Linux only' function, cygwin provides an implementation which appears to be functional. The assumption that this function is Linux only is reflected in the way the HAVE_SYSINFO build variable is handled by the Makefile and config.mak.uname. Rework the setting of HAVE_SYSINFO in the Linux section of the system specific config file, along with the corresponding setting of the BASIC_CFLAGS in the Makefile. Add the setting of HAVE_SYSINFO to the cygwin section of 'config.mak.uname'. While here, add a test for the sysinfo() function to the autoconf build system. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c9a5177 commit 50dec7c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,6 +2168,10 @@ ifdef HAVE_SYNC_FILE_RANGE
21682168
BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE
21692169
endif
21702170

2171+
ifdef HAVE_SYSINFO
2172+
BASIC_CFLAGS += -DHAVE_SYSINFO
2173+
endif
2174+
21712175
ifdef HAVE_BSD_SYSCTL
21722176
BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
21732177
endif

config.mak.uname

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ ifeq ($(uname_S),Linux)
5858
HAVE_SYNC_FILE_RANGE = YesPlease
5959
HAVE_GETDELIM = YesPlease
6060
FREAD_READS_DIRECTORIES = UnfortunatelyYes
61-
BASIC_CFLAGS += -DHAVE_SYSINFO
61+
HAVE_SYSINFO = YesPlease
6262
PROCFS_EXECUTABLE_PATH = /proc/self/exe
6363
HAVE_PLATFORM_PROCINFO = YesPlease
6464
COMPAT_OBJS += compat/linux/procinfo.o
@@ -253,6 +253,7 @@ ifeq ($(uname_O),Cygwin)
253253
HAVE_GETDELIM = YesPlease
254254
HAVE_CLOCK_GETTIME = YesPlease
255255
HAVE_CLOCK_MONOTONIC = YesPlease
256+
HAVE_SYSINFO = YesPlease
256257
HAVE_ALLOCA_H = YesPlease
257258
NEEDS_LIBICONV = YesPlease
258259
NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,14 @@ AC_CHECK_LIB([iconv], [locale_charset],
10661066
[AC_CHECK_LIB([charset], [locale_charset],
10671067
[CHARSET_LIB=-lcharset])])
10681068
GIT_CONF_SUBST([CHARSET_LIB])
1069+
1070+
#
1071+
# Define HAVE_SYSINFO=YesPlease if sysinfo is available.
1072+
GIT_CHECK_FUNC(sysinfo,
1073+
[HAVE_SYSINFO=YesPlease],
1074+
[HAVE_SYSINFO=])
1075+
GIT_CONF_SUBST([HAVE_SYSINFO])
1076+
10691077
#
10701078
# Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available.
10711079
GIT_CHECK_FUNC(clock_gettime,

0 commit comments

Comments
 (0)