mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Modified the gmtime_r check to not check for it until the "check for a working
one" is made, and only if that test runs ok we define it as present. Unless crosscompiling, since then we use the former AC_CHECK_FUNCS method.
This commit is contained in:
parent
aaace2e802
commit
f425a25c98
52
configure.ac
52
configure.ac
@ -1254,7 +1254,7 @@ else
|
|||||||
dnl is there a strerror_r()
|
dnl is there a strerror_r()
|
||||||
CURL_CHECK_STRERROR_R()
|
CURL_CHECK_STRERROR_R()
|
||||||
|
|
||||||
AC_CHECK_FUNCS( gmtime_r )
|
checkfor_gmtime_r="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl for recent AIX versions, we skip all the thread-safe checks above since
|
dnl for recent AIX versions, we skip all the thread-safe checks above since
|
||||||
@ -1290,19 +1290,22 @@ if test "x$RECENTAIX" = "xyes"; then
|
|||||||
dnl is there a strerror_r()
|
dnl is there a strerror_r()
|
||||||
CURL_CHECK_STRERROR_R()
|
CURL_CHECK_STRERROR_R()
|
||||||
|
|
||||||
AC_CHECK_FUNCS( gmtime_r )
|
checkfor_gmtime_r="yes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$cross_compiling != xyes; then
|
if test x$cross_compiling != xyes; then
|
||||||
dnl if gmtime_r was found, verify that it actuall works, as (at least) HPUX
|
|
||||||
dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
|
|
||||||
dnl it.
|
|
||||||
|
|
||||||
AC_MSG_CHECKING([if gmtime_r works])
|
if test x$checkfor_gmtime_r = xyes; then
|
||||||
AC_RUN_IFELSE([[
|
|
||||||
#include <time.h>
|
dnl if gmtime_r was found, verify that it actuall works, as (at least) HPUX
|
||||||
int main(void)
|
dnl 10.20 is known to have a buggy one. If it doesn't work, disable use of
|
||||||
{
|
dnl it.
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([if gmtime_r exists and works])
|
||||||
|
AC_RUN_IFELSE([[
|
||||||
|
#include <time.h>
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
time_t local = 1170352587;
|
time_t local = 1170352587;
|
||||||
struct tm *gmt;
|
struct tm *gmt;
|
||||||
struct tm keeper;
|
struct tm keeper;
|
||||||
@ -1313,20 +1316,21 @@ if test x$cross_compiling != xyes; then
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1; /* failure */
|
return 1; /* failure */
|
||||||
}
|
}
|
||||||
]],
|
]],
|
||||||
dnl success, do nothing
|
dnl success, do nothing
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
,
|
AC_DEFINE(HAVE_GMTIME_R, 1, [if you have (a working) gmtime_r])
|
||||||
dnl failure, now disable the function
|
,
|
||||||
AC_MSG_RESULT(no)
|
dnl failure, now disable the function
|
||||||
ac_cv_func_gmtime_r="no"
|
AC_MSG_RESULT(no)
|
||||||
AC_DEFINE(HAVE_GMTIME_R, 0, [if you have gmtime_r])
|
,
|
||||||
,
|
dnl not invoked when crosscompiling)
|
||||||
dnl not invoked when crosscompiling)
|
])
|
||||||
])
|
fi
|
||||||
|
else
|
||||||
|
dnl and for crosscompilings
|
||||||
|
AC_CHECK_FUNCS(gmtime_r)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user