From 8bd2c972b1e2343620cad5b0f56de0f2524b7564 Mon Sep 17 00:00:00 2001 From: Reuben Hawkins Date: Thu, 8 Jan 2015 12:00:55 -0800 Subject: configure.ac: check 'tv_nsec' field in 'struct stat' Detect 'tv_nsec' field in 'struct stat' and set Makefile variable NO_NSEC appropriately. A side-effect of the above detection is that we also determine whether 'stat.st_mtimespec' is available, so, as a bonus, set the Makefile variable USE_ST_TIMESPEC, as well. Signed-off-by: Reuben Hawkins Helped-by: Eric Sunshine Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5c1312f24a..583af8ab5f 100644 --- a/configure.ac +++ b/configure.ac @@ -754,6 +754,19 @@ AC_CHECK_TYPES([struct itimerval], [#include ]) GIT_CONF_SUBST([NO_STRUCT_ITIMERVAL]) # +# Define USE_ST_TIMESPEC=YesPlease when stat.st_mtimespec.tv_nsec exists. +# Define NO_NSEC=YesPlease when neither stat.st_mtim.tv_nsec nor +# stat.st_mtimespec.tv_nsec exists. +AC_CHECK_MEMBER([struct stat.st_mtimespec.tv_nsec]) +AC_CHECK_MEMBER([struct stat.st_mtim.tv_nsec]) +if test x$ac_cv_member_struct_stat_st_mtimespec_tv_nsec = xyes; then + USE_ST_TIMESPEC=YesPlease + GIT_CONF_SUBST([USE_ST_TIMESPEC]) +elif test x$ac_cv_member_struct_stat_st_mtim_tv_nsec != xyes; then + NO_NSEC=YesPlease + GIT_CONF_SUBST([NO_NSEC]) +fi +# # Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent. AC_CHECK_MEMBER(struct dirent.d_ino, [NO_D_INO_IN_DIRENT=], -- cgit v1.2.3 From a6c3c638acea34116c6be7cc4be41a9bc55a7fa1 Mon Sep 17 00:00:00 2001 From: Reuben Hawkins Date: Thu, 8 Jan 2015 12:00:56 -0800 Subject: configure.ac: check for clock_gettime and CLOCK_MONOTONIC Set or clear Makefile variables HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC based upon results of the checks (overriding default values from config.mak.uname). CLOCK_MONOTONIC isn't available on RHEL3, but there are still RHEL3 systems being used in production. Signed-off-by: Reuben Hawkins Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- configure.ac | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 583af8ab5f..6361dcbd50 100644 --- a/configure.ac +++ b/configure.ac @@ -947,6 +947,28 @@ AC_CHECK_LIB([iconv], [locale_charset], [CHARSET_LIB=-lcharset])]) GIT_CONF_SUBST([CHARSET_LIB]) # +# Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available. +GIT_CHECK_FUNC(clock_gettime, + [HAVE_CLOCK_GETTIME=YesPlease], + [HAVE_CLOCK_GETTIME=]) +GIT_CONF_SUBST([HAVE_CLOCK_GETTIME]) + +AC_DEFUN([CLOCK_MONOTONIC_SRC], [ +AC_LANG_PROGRAM([[ +#include +clockid_t id = CLOCK_MONOTONIC; +]])]) + +# +# Define HAVE_CLOCK_MONOTONIC=YesPlease if CLOCK_MONOTONIC is available. +AC_MSG_CHECKING([for CLOCK_MONOTONIC]) +AC_COMPILE_IFELSE([CLOCK_MONOTONIC_SRC], + [AC_MSG_RESULT([yes]) + HAVE_CLOCK_MONOTONIC=YesPlease], + [AC_MSG_RESULT([no]) + HAVE_CLOCK_MONOTONIC=]) +GIT_CONF_SUBST([HAVE_CLOCK_MONOTONIC]) +# # Define NO_SETITIMER if you don't have setitimer. GIT_CHECK_FUNC(setitimer, [NO_SETITIMER=], -- cgit v1.2.3 From 88e011814b9498ee1170d82462a19f72a86f9d82 Mon Sep 17 00:00:00 2001 From: Reuben Hawkins Date: Thu, 8 Jan 2015 12:00:57 -0800 Subject: configure.ac: check for HMAC_CTX_cleanup OpenSSL version 0.9.6b and before defined the function HMAC_cleanup. Newer versions define HMAC_CTX_cleanup. Check for HMAC_CTX_cleanup and fall back to HMAC_cleanup when the newer function is missing. Signed-off-by: Reuben Hawkins Reviewed-by: Eric Sunshine Signed-off-by: Junio C Hamano --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6361dcbd50..55e5a9b3e6 100644 --- a/configure.ac +++ b/configure.ac @@ -947,6 +947,10 @@ AC_CHECK_LIB([iconv], [locale_charset], [CHARSET_LIB=-lcharset])]) GIT_CONF_SUBST([CHARSET_LIB]) # +# Define NO_HMAC_CTX_CLEANUP=YesPlease if HMAC_CTX_cleanup is missing. +AC_CHECK_LIB([crypto], [HMAC_CTX_cleanup], + [], [GIT_CONF_SUBST([NO_HMAC_CTX_CLEANUP], [YesPlease])]) +# # Define HAVE_CLOCK_GETTIME=YesPlease if clock_gettime is available. GIT_CHECK_FUNC(clock_gettime, [HAVE_CLOCK_GETTIME=YesPlease], -- cgit v1.2.3