]> git.ipfire.org Git - thirdparty/git.git/commitdiff
config.mak.uname: add sysinfo() configuration for cygwin
authorRamsay Jones <ramsay@ramsayjones.plus.com>
Wed, 16 Apr 2025 23:18:32 +0000 (00:18 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Apr 2025 03:43:45 +0000 (20:43 -0700)
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 <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
config.mak.uname
configure.ac

index 8fa4d2664e162bd84a8441e130cfdbe29aa553d0..ff89f2b81f47b68b4a9ad3e6c778579694281990 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2168,6 +2168,10 @@ ifdef HAVE_SYNC_FILE_RANGE
        BASIC_CFLAGS += -DHAVE_SYNC_FILE_RANGE
 endif
 
+ifdef HAVE_SYSINFO
+       BASIC_CFLAGS += -DHAVE_SYSINFO
+endif
+
 ifdef HAVE_BSD_SYSCTL
        BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
 endif
index d058b34292a159d5b12b481aca3484e63ae76e8d..e7bd07cf6ec5789e0af6af0902f35966baeec2d8 100644 (file)
@@ -58,7 +58,7 @@ ifeq ($(uname_S),Linux)
        HAVE_SYNC_FILE_RANGE = YesPlease
        HAVE_GETDELIM = YesPlease
        FREAD_READS_DIRECTORIES = UnfortunatelyYes
-       BASIC_CFLAGS += -DHAVE_SYSINFO
+       HAVE_SYSINFO = YesPlease
        PROCFS_EXECUTABLE_PATH = /proc/self/exe
        HAVE_PLATFORM_PROCINFO = YesPlease
        COMPAT_OBJS += compat/linux/procinfo.o
@@ -253,6 +253,7 @@ ifeq ($(uname_O),Cygwin)
        HAVE_GETDELIM = YesPlease
        HAVE_CLOCK_GETTIME = YesPlease
        HAVE_CLOCK_MONOTONIC = YesPlease
+       HAVE_SYSINFO = YesPlease
        HAVE_ALLOCA_H = YesPlease
        NEEDS_LIBICONV = YesPlease
        NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
index 5923edc44aa7b6cc355fa6589b6d075b0c0a7772..d7e0503f1ec580fc503e56b98b78890056db9ab7 100644 (file)
@@ -1066,6 +1066,14 @@ AC_CHECK_LIB([iconv], [locale_charset],
        [AC_CHECK_LIB([charset], [locale_charset],
                      [CHARSET_LIB=-lcharset])])
 GIT_CONF_SUBST([CHARSET_LIB])
+
+#
+# Define HAVE_SYSINFO=YesPlease if sysinfo is available.
+GIT_CHECK_FUNC(sysinfo,
+       [HAVE_SYSINFO=YesPlease],
+       [HAVE_SYSINFO=])
+GIT_CONF_SUBST([HAVE_SYSINFO])
+
 #
 # Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available.
 GIT_CHECK_FUNC(clock_gettime,