summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac72
1 files changed, 69 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 5db3013de..7e0584d2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,7 @@ AC_SUBST([LD])
93AC_C_INLINE 93AC_C_INLINE
94 94
95AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>]) 95AC_CHECK_DECL([LLONG_MAX], [have_llong_max=1], , [#include <limits.h>])
96AC_CHECK_DECL([LONG_LONG_MAX], [have_long_long_max=1], , [#include <limits.h>])
96AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [ 97AC_CHECK_DECL([SYSTR_POLICY_KILL], [have_systr_policy_kill=1], , [
97 #include <sys/types.h> 98 #include <sys/types.h>
98 #include <sys/param.h> 99 #include <sys/param.h>
@@ -413,6 +414,7 @@ AC_CHECK_HEADERS([ \
413 string.h \ 414 string.h \
414 strings.h \ 415 strings.h \
415 sys/bitypes.h \ 416 sys/bitypes.h \
417 sys/byteorder.h \
416 sys/bsdtty.h \ 418 sys/bsdtty.h \
417 sys/cdefs.h \ 419 sys/cdefs.h \
418 sys/dir.h \ 420 sys/dir.h \
@@ -2047,6 +2049,19 @@ AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1],
2047AC_SEARCH_LIBS([clock_gettime], [rt], 2049AC_SEARCH_LIBS([clock_gettime], [rt],
2048 [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) 2050 [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])])
2049 2051
2052dnl check if we need -D_REENTRANT for localtime_r declaration.
2053AC_CHECK_DECL([localtime_r], [],
2054 [ saved_CPPFLAGS="$CFLAGS"
2055 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
2056 unset ac_cv_have_decl_localtime_r
2057 AC_CHECK_DECL([localtime_r], [],
2058 [ CPPFLAGS="$saved_CPPFLAGS" ],
2059 [ #include <time.h> ]
2060 )
2061 ],
2062 [ #include <time.h> ]
2063)
2064
2050dnl Make sure prototypes are defined for these before using them. 2065dnl Make sure prototypes are defined for these before using them.
2051AC_CHECK_DECL([strsep], 2066AC_CHECK_DECL([strsep],
2052 [AC_CHECK_FUNCS([strsep])], 2067 [AC_CHECK_FUNCS([strsep])],
@@ -2066,10 +2081,11 @@ AC_CHECK_DECL([tcsendbreak],
2066 2081
2067AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>]) 2082AC_CHECK_DECLS([h_errno], , ,[#include <netdb.h>])
2068 2083
2069AC_CHECK_DECLS([SHUT_RD], , , 2084AC_CHECK_DECLS([SHUT_RD, getpeereid], , ,
2070 [ 2085 [
2071#include <sys/types.h> 2086#include <sys/types.h>
2072#include <sys/socket.h> 2087#include <sys/socket.h>
2088#include <unistd.h>
2073 ]) 2089 ])
2074 2090
2075AC_CHECK_DECLS([O_NONBLOCK], , , 2091AC_CHECK_DECLS([O_NONBLOCK], , ,
@@ -2578,6 +2594,45 @@ static void sighandler(int sig) { _exit(1); }
2578 ) 2594 )
2579fi 2595fi
2580 2596
2597AC_MSG_CHECKING([if SA_RESTARTed signals interrupt select()])
2598AC_RUN_IFELSE(
2599 [AC_LANG_PROGRAM([[
2600#ifdef HAVE_SYS_SELECT
2601# include <sys/select.h>
2602#endif
2603#include <sys/types.h>
2604#include <sys/time.h>
2605#include <stdlib.h>
2606#include <signal.h>
2607static void sighandler(int sig) { }
2608 ]], [[
2609 int r;
2610 pid_t pid;
2611 struct sigaction sa;
2612
2613 sa.sa_handler = sighandler;
2614 sa.sa_flags = SA_RESTART;
2615 (void)sigaction(SIGTERM, &sa, NULL);
2616 if ((pid = fork()) == 0) { /* child */
2617 pid = getppid();
2618 sleep(1);
2619 kill(pid, SIGTERM);
2620 sleep(1);
2621 if (getppid() == pid) /* if parent did not exit, shoot it */
2622 kill(pid, SIGKILL);
2623 exit(0);
2624 } else { /* parent */
2625 r = select(0, NULL, NULL, NULL, NULL);
2626 }
2627 exit(r == -1 ? 0 : 1);
2628 ]])],
2629 [AC_MSG_RESULT([yes])],
2630 [AC_MSG_RESULT([no])
2631 AC_DEFINE([NO_SA_RESTART], [1],
2632 [SA_RESTARTed signals do no interrupt select])],
2633 [AC_MSG_WARN([cross compiling: assuming yes])]
2634)
2635
2581AC_CHECK_FUNCS([getpgrp],[ 2636AC_CHECK_FUNCS([getpgrp],[
2582 AC_MSG_CHECKING([if getpgrp accepts zero args]) 2637 AC_MSG_CHECKING([if getpgrp accepts zero args])
2583 AC_COMPILE_IFELSE( 2638 AC_COMPILE_IFELSE(
@@ -2883,6 +2938,7 @@ if test "x$openssl" = "xyes" ; then
2883 EVP_PKEY_get0_RSA \ 2938 EVP_PKEY_get0_RSA \
2884 EVP_MD_CTX_new \ 2939 EVP_MD_CTX_new \
2885 EVP_MD_CTX_free \ 2940 EVP_MD_CTX_free \
2941 EVP_chacha20 \
2886 ]) 2942 ])
2887 2943
2888 if test "x$openssl_engine" = "xyes" ; then 2944 if test "x$openssl_engine" = "xyes" ; then
@@ -3161,6 +3217,10 @@ AC_MSG_RESULT([$enable_pkcs11])
3161AC_MSG_CHECKING([whether to enable U2F]) 3217AC_MSG_CHECKING([whether to enable U2F])
3162if test "x$enable_sk" = "xyes" ; then 3218if test "x$enable_sk" = "xyes" ; then
3163 AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support]) 3219 AC_DEFINE([ENABLE_SK], [], [Enable for U2F/FIDO support])
3220 AC_SUBST(SK_DUMMY_LIBRARY, [regress/misc/sk-dummy/sk-dummy.so])
3221else
3222 # Do not try to build sk-dummy library.
3223 AC_SUBST(SK_DUMMY_LIBRARY, [""])
3164fi 3224fi
3165AC_MSG_RESULT([$enable_sk]) 3225AC_MSG_RESULT([$enable_sk])
3166 3226
@@ -3190,9 +3250,15 @@ if test "x$enable_sk" = "xyes" -a "x$enable_sk_internal" = "xyes" ; then
3190 AC_DEFINE([ENABLE_SK_INTERNAL], [], 3250 AC_DEFINE([ENABLE_SK_INTERNAL], [],
3191 [Enable for built-in U2F/FIDO support]) 3251 [Enable for built-in U2F/FIDO support])
3192 enable_sk="built-in" 3252 enable_sk="built-in"
3193 ], [ ], 3253 ], [ AC_MSG_ERROR([no usable libfido2 found]) ],
3194 [ $OTHERLIBS ] 3254 [ $OTHERLIBS ]
3195 ) 3255 )
3256 AC_CHECK_HEADER([fido.h], [],
3257 AC_MSG_ERROR([missing fido.h from libfido2]))
3258 AC_CHECK_HEADER([fido/credman.h], [],
3259 AC_MSG_ERROR([missing fido/credman.h from libfido2]),
3260 [#include <fido.h>]
3261 )
3196fi 3262fi
3197 3263
3198AC_CHECK_FUNCS([ \ 3264AC_CHECK_FUNCS([ \
@@ -3645,7 +3711,7 @@ if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
3645fi 3711fi
3646 3712
3647# compute LLONG_MIN and LLONG_MAX if we don't know them. 3713# compute LLONG_MIN and LLONG_MAX if we don't know them.
3648if test -z "$have_llong_max"; then 3714if test -z "$have_llong_max" && test -z "$have_long_long_max"; then
3649 AC_MSG_CHECKING([for max value of long long]) 3715 AC_MSG_CHECKING([for max value of long long])
3650 AC_RUN_IFELSE( 3716 AC_RUN_IFELSE(
3651 [AC_LANG_PROGRAM([[ 3717 [AC_LANG_PROGRAM([[