diff --git a/aclocal.m4 b/aclocal.m4 index c84778b61b2525..09ae5d1aa8a608 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -275,62 +275,6 @@ AC_DEFUN([AX_CHECK_OPENSSL], [ AC_SUBST([OPENSSL_LDFLAGS]) ]) -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_typedef.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_TYPEDEF(TYPEDEF, HEADER [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]) -# -# DESCRIPTION -# -# Check if the given typedef-name is recognized as a type. The trick is to -# use a sizeof(TYPEDEF) and see if the compiler is happy with that. -# -# This can be thought of as a mixture of AC_CHECK_TYPE(TYPEDEF,DEFAULT) -# and AC_CHECK_LIB(LIBRARY,FUNCTION,ACTION-IF-FOUND,ACTION-IF-NOT-FOUND). -# -# A convenience macro AX_CHECK_TYPEDEF_ is provided that will not emit any -# message to the user - it just executes one of the actions. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -AU_ALIAS([AC_CHECK_TYPEDEF], [AX_CHECK_TYPEDEF]) -AC_DEFUN([AX_CHECK_TYPEDEF_], -[dnl -ac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` -AC_CACHE_VAL(ac_cv_lib_$ac_lib_var, -[ eval "ac_cv_type_$ac_lib_var='not-found'" - ac_cv_check_typedef_header=`echo ifelse([$2], , stddef.h, $2)` - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <$ac_cv_check_typedef_header>]], - [[int x = sizeof($1); x = x;]])], - [eval "ac_cv_type_$ac_lib_var=yes"], - [eval "ac_cv_type_$ac_lib_var=no"]) - if test `eval echo '$ac_cv_type_'$ac_lib_var` = "no" ; then - ifelse([$4], , :, $4) - else - ifelse([$3], , :, $3) - fi -])]) - -dnl AX_CHECK_TYPEDEF(TYPEDEF, HEADER [, ACTION-IF-FOUND, -dnl [, ACTION-IF-NOT-FOUND ]]) -AC_DEFUN([AX_CHECK_TYPEDEF], -[dnl - AC_MSG_CHECKING([for $1 in $2]) - AX_CHECK_TYPEDEF_($1,$2,AC_MSG_RESULT(yes),AC_MSG_RESULT(no))dnl -]) - # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 12 (pkg-config-0.29.2) diff --git a/configure b/configure index 01e974b64e2ceb..5770b61937e6dd 100755 --- a/configure +++ b/configure @@ -11222,63 +11222,24 @@ then : fi -# checks for typedefs -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 -printf %s "checking for clock_t in time.h... " >&6; } -if test ${ac_cv_clock_t_time_h+y} -then : - printf %s "(cached) " >&6 -else $as_nop - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 -printf %s "checking for clock_t in time.h... " >&6; } - ac_lib_var=`echo clock_t'_'time.h | sed 'y%./+-%__p_%'` -if eval test \${ac_cv_lib_$ac_lib_var+y} -then : - printf %s "(cached) " >&6 -else $as_nop - eval "ac_cv_type_$ac_lib_var='not-found'" - ac_cv_check_typedef_header=`echo time.h` - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$ac_cv_check_typedef_header> -int -main (void) -{ -int x = sizeof(clock_t); x = x; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +# Check for clock_t in time.h. +ac_fn_c_check_type "$LINENO" "clock_t" "ac_cv_type_clock_t" "#include time.h +" +if test "x$ac_cv_type_clock_t" = xyes then : - eval "ac_cv_type_$ac_lib_var=yes" -else $as_nop - eval "ac_cv_type_$ac_lib_var=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - if test `eval echo '$ac_cv_type_'$ac_lib_var` = "no" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } - fi -fi +printf "%s\n" "#define HAVE_CLOCK_T 1" >>confdefs.h -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_clock_t_time_h" >&5 -printf "%s\n" "$ac_cv_clock_t_time_h" >&6; } -if test "x$ac_cv_clock_t_time_h" = xno +else $as_nop + if test "x$ac_cv_type_clock_t" = xno then : - printf "%s\n" "#define clock_t long" >>confdefs.h - fi +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for makedev" >&5 printf %s "checking for makedev... " >&6; } @@ -16126,7 +16087,7 @@ printf %s "checking for _POSIX_THREADS in unistd.h... " >&6; } #if defined(_POSIX_THREADS) /* pass */ #else -#error "not defined" +#error "check failed" #endif int @@ -16658,7 +16619,7 @@ printf %s "checking ipv6 stack type... " >&6; } #if defined(IPV6_INRIA_VERSION) /* pass */ #else -#error "not defined" +#error "check failed" #endif int @@ -16684,7 +16645,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext #if defined(__KAME__) /* pass */ #else -#error "not defined" +#error "check failed" #endif int @@ -16713,7 +16674,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext #if defined(__GLIBC__) && ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)) /* pass */ #else -#error "not defined" +#error "check failed" #endif int @@ -16756,7 +16717,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext #if defined(_TOSHIBA_INET6) /* pass */ #else -#error "not defined" +#error "check failed" #endif int @@ -16784,7 +16745,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext #if defined(__V6D__) /* pass */ #else -#error "not defined" +#error "check failed" #endif int @@ -16813,7 +16774,7 @@ rm -f conftest.err conftest.i conftest.$ac_ext #if defined(_ZETA_MINAMI_INET6) /* pass */ #else -#error "not defined" +#error "check failed" #endif int diff --git a/configure.ac b/configure.ac index dc24d6d5575c4b..b4417aa0f06023 100644 --- a/configure.ac +++ b/configure.ac @@ -73,14 +73,14 @@ AC_DEFUN([PY_CHECK_FUNC], AS_VAR_POPDEF([py_define]) ]) -dnl PY_CHECK_CPP(CPP_CHECK, [LIST-OF-INCLUDES], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl PY_CHECK_CPP(CPP_CHECK, [LIST-OF-INCLUDES], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) AC_DEFUN([PY_CHECK_CPP], [AC_PREPROC_IFELSE([AC_LANG_PROGRAM([ m4_foreach_w([incl], [$2], [@%:@include m4_newline]) @%:@if $1 /* pass */ #else -#error "not defined" +#error "check failed" #endif ])], [$3], [$4])]) @@ -2838,15 +2838,13 @@ AC_CHECK_HEADERS( #endif ]) -# checks for typedefs -AC_CACHE_CHECK([for clock_t in time.h], [ac_cv_clock_t_time_h], [ - AX_CHECK_TYPEDEF([clock_t], [time.h], [ac_cv_clock_t_time_h=yes], [ac_cv_clock_t_time_h=no]) -]) -dnl checks for "no" -AS_VAR_IF([ac_cv_clock_t_time_h], [no], [ - AC_DEFINE([clock_t], [long], - [Define to 'long' if doesn't define.]) -]) +# Check for clock_t in time.h. +AC_CHECK_TYPES([clock_t], + [], + [AS_VAR_IF([ac_cv_type_clock_t], [no], + [AC_DEFINE([clock_t], [long], + ["Define to 'long' if doesn't define."])])], + [@%:@include time.h]) AC_CACHE_CHECK([for makedev], [ac_cv_func_makedev], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ diff --git a/pyconfig.h.in b/pyconfig.h.in index 63a3437ebb3eac..bb1be397896835 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -157,6 +157,9 @@ /* Define to 1 if you have the `clock_settime' function. */ #undef HAVE_CLOCK_SETTIME +/* Define to 1 if the system has the type `clock_t'. */ +#undef HAVE_CLOCK_T + /* Define to 1 if you have the `closefrom' function. */ #undef HAVE_CLOSEFROM @@ -1938,7 +1941,7 @@ /* Define on FreeBSD to activate all library features */ #undef __BSD_VISIBLE -/* Define to 'long' if doesn't define. */ +/* "Define to 'long' if doesn't define." */ #undef clock_t /* Define to empty if `const' does not conform to ANSI C. */