summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2018-03-03 13:56:03 +0100
committerAlexander Traud <pabstraud@compuserve.com>2018-03-03 13:56:03 +0100
commit974952452014013545a2aba1cd1fd8304427b429 (patch)
tree5f93511a2bc65916fd65fa5d555e2965152d9784
parente58ae393b1f83981178c7ddedf4cfb40e6ca5f31 (diff)
BuildSystem: Detect whether uselocale(.) is available.
ASTERISK-27712 Reported by: Joerg Sonnenberger, D'Arcy Cain Change-Id: Idf1c9d43617a3e13028b95b313415903d80ef807
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--main/stdtime/localtime.c4
4 files changed, 7 insertions, 4 deletions
diff --git a/configure b/configure
index 2849fe591..a95da6958 100755
--- a/configure
+++ b/configure
@@ -16701,7 +16701,7 @@ fi
done
-for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl
+for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.ac b/configure.ac
index 1bb4bc4ff..4622f955e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -754,7 +754,7 @@ AC_FUNC_STRNLEN
AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
+AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl])
AC_MSG_CHECKING(for htonll)
AC_LINK_IFELSE(
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 4a9a273b7..06114616d 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -1203,6 +1203,9 @@
/* Define to 1 if you have the uriparser library library. */
#undef HAVE_URIPARSER
+/* Define to 1 if you have the `uselocale' function. */
+#undef HAVE_USELOCALE
+
/* Define to 1 if you have the `utime' function. */
#undef HAVE_UTIME
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index 2976e59c1..d0be9bb84 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -310,7 +310,7 @@ static struct state * sstate_alloc(void);
static void sstate_free(struct state *p);
static AST_LIST_HEAD_STATIC(zonelist, state);
-#ifdef HAVE_NEWLOCALE
+#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE)
static AST_LIST_HEAD_STATIC(localelist, locale_entry);
#endif
@@ -2362,7 +2362,7 @@ struct timeval ast_mktime(struct ast_tm *tmp, const char *zone)
return time1(tmp, localsub, 0L, sp);
}
-#ifdef HAVE_NEWLOCALE
+#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE)
static struct locale_entry *find_by_locale(locale_t locale)
{
struct locale_entry *cur;