X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=configure.ac;h=ef10e958400681392f89a234ec1e28af0027d1f9;hb=0725a71d237fced80bffef5c1822b2b045fc649c;hp=1c72dffec2b405d0f9b9f3833cb1b3632d5dd5be;hpb=48ac7aa4dd337d51bc577d6dfd931e42868daeb3;p=shibboleth%2Fsp.git diff --git a/configure.ac b/configure.ac index 1c72dff..ef10e95 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ AC_STRUCT_TM # Checks for library functions. AC_FUNC_STRFTIME AC_FUNC_STRERROR_R -AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r ctime_r strtok_r strcasecmp]) +AC_CHECK_FUNCS([strchr strdup strstr timegm gmtime_r strtok_r strcasecmp]) # checks for pthreads ACX_PTHREAD([enable_threads="pthread"],[enable_threads="no"]) @@ -82,6 +82,36 @@ else CXXFLAGS="$PTHREAD_CFLAGS $CXXFLAGS" fi +# Thank you Solaris, really. +AC_MSG_CHECKING(for ctime_r) + if test -z "$ac_cv_ctime_args"; then + AC_TRY_COMPILE( + [#include ], + [ + time_t clock; + char buf[26]; + ctime_r(&clock, buf); + ], ac_cv_ctime_args=2) + + AC_TRY_COMPILE( + [#include ], + [ + time_t clock; + char buf[26]; + ctime_r(&clock, buf, 26); + ], ac_cv_ctime_args=3) + fi + if test -z "$ac_cv_ctime_args"; then + AC_MSG_RESULT(no) + else + if test "$ac_cv_ctime_args" = 2; then + AC_DEFINE(HAVE_CTIME_R_2,1,[Define if ctime_r is present with 2 parameters.]) + elif test "$ac_cv_ctime_args" = 3; then + AC_DEFINE(HAVE_CTIME_R_3,1,[Define if ctime_r is present with 3 parameters.]) + fi + AC_MSG_RESULT([yes, and it takes $ac_cv_ctime_args arguments]) + fi + # OpenSSL settings AC_ARG_WITH(openssl, AC_HELP_STRING([--with-openssl=PATH], [where openssl is installed]),