diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 149 |
1 files changed, 136 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 6af964797f..0b15f04b10 100644 --- a/configure.ac +++ b/configure.ac @@ -471,6 +471,13 @@ if test -n "$ASCIIDOC"; then esac fi +if grep -a ascii configure.ac >/dev/null; then + AC_MSG_RESULT([Using 'grep -a' for sane_grep]) + SANE_TEXT_GREP=-a +else + SANE_TEXT_GREP= +fi +GIT_CONF_SUBST([SANE_TEXT_GREP]) ## Checks for libraries. AC_MSG_NOTICE([CHECKS for libraries]) @@ -525,6 +532,30 @@ GIT_UNSTASH_FLAGS($CURLDIR) GIT_CONF_SUBST([NO_CURL]) +if test -z "$NO_CURL"; then + +AC_CHECK_PROG([CURL_CONFIG], [curl-config], +[curl-config], +[no]) + +if test $CURL_CONFIG != no; then + GIT_CONF_SUBST([CURL_CONFIG]) + if test -z "${NO_OPENSSL}"; then + AC_MSG_CHECKING([if Curl supports SSL]) + if test $(curl-config --features|grep SSL) = SSL; then + NEEDS_SSL_WITH_CURL=YesPlease + AC_MSG_RESULT([yes]) + else + NEEDS_SSL_WITH_CURL= + AC_MSG_RESULT([no]) + fi + GIT_CONF_SUBST([NEEDS_SSL_WITH_CURL]) + fi +fi + +fi + + # # Define NO_EXPAT if you do not have expat installed. git-http-push is # not built, and you cannot push using http:// and https:// transports. @@ -754,12 +785,18 @@ AC_CHECK_TYPES([struct itimerval], [#include <sys/time.h>]) GIT_CONF_SUBST([NO_STRUCT_ITIMERVAL]) # -# 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=], -[NO_D_INO_IN_DIRENT=YesPlease], -[#include <dirent.h>]) -GIT_CONF_SUBST([NO_D_INO_IN_DIRENT]) +# 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_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks # d_type in struct dirent (latest Cygwin -- will be fixed soonish). @@ -799,9 +836,10 @@ AC_CHECK_TYPE([struct addrinfo],[ ]) GIT_CONF_SUBST([NO_IPV6]) # -# Define NO_REGEX if you have no or inferior regex support in your C library. -AC_CACHE_CHECK([whether the platform regex can handle null bytes], - [ac_cv_c_excellent_regex], [ +# Define NO_REGEX if your C library lacks regex support with REG_STARTEND +# feature. +AC_CACHE_CHECK([whether the platform regex supports REG_STARTEND], + [ac_cv_c_regex_with_reg_startend], [ AC_EGREP_CPP(yippeeyeswehaveit, AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT #include <regex.h> @@ -810,10 +848,10 @@ AC_EGREP_CPP(yippeeyeswehaveit, yippeeyeswehaveit #endif ]), - [ac_cv_c_excellent_regex=yes], - [ac_cv_c_excellent_regex=no]) + [ac_cv_c_regex_with_reg_startend=yes], + [ac_cv_c_regex_with_reg_startend=no]) ]) -if test $ac_cv_c_excellent_regex = yes; then +if test $ac_cv_c_regex_with_reg_startend = yes; then NO_REGEX= else NO_REGEX=YesPlease @@ -873,6 +911,29 @@ else SNPRINTF_RETURNS_BOGUS= fi GIT_CONF_SUBST([SNPRINTF_RETURNS_BOGUS]) +# +# Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type +# bits in mode values. +AC_CACHE_CHECK([whether the platform uses typical file type bits], + [ac_cv_sane_mode_bits], [ +AC_EGREP_CPP(yippeeyeswehaveit, + AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], +[#if S_IFMT == 0170000 && \ + S_IFREG == 0100000 && S_IFDIR == 0040000 && S_IFLNK == 0120000 && \ + S_IFBLK == 0060000 && S_IFCHR == 0020000 && \ + S_IFIFO == 0010000 && S_IFSOCK == 0140000 +yippeeyeswehaveit +#endif +]), + [ac_cv_sane_mode_bits=yes], + [ac_cv_sane_mode_bits=no]) +]) +if test $ac_cv_sane_mode_bits = yes; then + NEEDS_MODE_TRANSLATION= +else + NEEDS_MODE_TRANSLATION=UnfortunatelyYes +fi +GIT_CONF_SUBST([NEEDS_MODE_TRANSLATION]) ## Checks for library functions. @@ -911,6 +972,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 <time.h> +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=], @@ -979,11 +1062,40 @@ GIT_CHECK_FUNC(initgroups, [NO_INITGROUPS=YesPlease]) GIT_CONF_SUBST([NO_INITGROUPS]) # +# Define HAVE_GETDELIM if you have getdelim in the C library. +GIT_CHECK_FUNC(getdelim, +[HAVE_GETDELIM=YesPlease], +[HAVE_GETDELIM=]) +GIT_CONF_SUBST([HAVE_GETDELIM]) +# # # Define NO_MMAP if you want to avoid mmap. # # Define NO_ICONV if your libc does not properly support iconv. +AC_DEFUN([BSD_SYSCTL_SRC], [ +AC_LANG_PROGRAM([[ +#include <stddef.h> +#include <sys/types.h> +#include <sys/sysctl.h> +]],[[ +int val, mib[2]; +size_t len; +mib[0] = CTL_HW; +mib[1] = 1; +len = sizeof(val); +return sysctl(mib, 2, &val, &len, NULL, 0) ? 1 : 0; +]])]) + +# +# Define HAVE_BSD_SYSCTL=YesPlease if a BSD-compatible sysctl function is available. +AC_MSG_CHECKING([for BSD sysctl]) +AC_COMPILE_IFELSE([BSD_SYSCTL_SRC], + [AC_MSG_RESULT([yes]) + HAVE_BSD_SYSCTL=YesPlease], + [AC_MSG_RESULT([no]) + HAVE_BSD_SYSCTL=]) +GIT_CONF_SUBST([HAVE_BSD_SYSCTL]) ## Other checks. # Define USE_PIC if you need the main git objects to be built with -fPIC @@ -998,14 +1110,19 @@ GIT_CONF_SUBST([NO_INITGROUPS]) AC_DEFUN([PTHREADTEST_SRC], [ AC_LANG_PROGRAM([[ #include <pthread.h> +static void *noop(void *ignore) { return ignore; } ]], [[ pthread_mutex_t test_mutex; pthread_key_t test_key; + pthread_t th; int retcode = 0; + void *ret = (void *)0; retcode |= pthread_key_create(&test_key, (void *)0); retcode |= pthread_mutex_init(&test_mutex,(void *)0); retcode |= pthread_mutex_lock(&test_mutex); retcode |= pthread_mutex_unlock(&test_mutex); + retcode |= pthread_create(&th, ret, noop, ret); + retcode |= pthread_join(th, &ret); return retcode; ]])]) @@ -1035,7 +1152,12 @@ elif test -z "$PTHREAD_CFLAGS"; then # would then trigger compiler warnings on every single file we compile. for opt in "" -mt -pthread -lpthread; do old_CFLAGS="$CFLAGS" - CFLAGS="$opt $CFLAGS" + old_LIBS="$LIBS" + case "$opt" in + -l*) LIBS="$opt $LIBS" ;; + *) CFLAGS="$opt $CFLAGS" ;; + esac + AC_MSG_CHECKING([for POSIX Threads with '$opt']) AC_LINK_IFELSE([PTHREADTEST_SRC], [AC_MSG_RESULT([yes]) @@ -1047,6 +1169,7 @@ elif test -z "$PTHREAD_CFLAGS"; then ], [AC_MSG_RESULT([no])]) CFLAGS="$old_CFLAGS" + LIBS="$old_LIBS" done if test $threads_found != yes; then AC_CHECK_LIB([pthread], [pthread_create], |