From: Daiki Ueno Date: Tue, 7 Jul 2015 06:36:43 +0000 (+0900) Subject: localename: fix link error on Illumos X-Git-Tag: v1.0~7005 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=9b6679dcac7631a9d75adfbcfdfb9004362f3d18;p=gnulib.git localename: fix link error on Illumos Illumos defines __sun, but does not have getlocalename_l nor the equivalent. This partially reverts commit 387c214. * m4/localename.m4 (gl_LOCALENAME): Check if getlocalename_l is available, as well as uselocale. * lib/localename.c [HAVE_USELOCALE && __sun]: Don't fallback to use getlocalename_l if it is not available. --- diff --git a/ChangeLog b/ChangeLog index e8fd9ed12e..b6b7c9824f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2015-07-07 Daiki Ueno + + localename: fix link error on Illumos + Illumos defines __sun, but does not have getlocalename_l nor the + equivalent. This partially reverts commit 387c214. + * m4/localename.m4 (gl_LOCALENAME): Check if getlocalename_l is + available, as well as uselocale. + * lib/localename.c [HAVE_USELOCALE && __sun]: Don't fallback to + use getlocalename_l if it is not available. + 2015-07-07 Daiki Ueno unistr/uN-strtok-tests: avoid a trivial leak diff --git a/lib/localename.c b/lib/localename.c index f3733eb46c..f8cf3f2362 100644 --- a/lib/localename.c +++ b/lib/localename.c @@ -42,7 +42,7 @@ # if !defined IN_LIBINTL # include "glthread/lock.h" # endif -# if defined __sun +# if defined __sun && HAVE_GETLOCALENAME_L /* Solaris >= 12. */ extern char * getlocalename_l(int, locale_t); # endif @@ -2727,7 +2727,7 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname) return ""; } return querylocale (mask, thread_locale); -# elif defined __sun +# elif defined __sun && HAVE_GETLOCALENAME_L /* Solaris >= 12. */ return getlocalename_l (category, thread_locale); # elif defined __ANDROID__ diff --git a/m4/localename.m4 b/m4/localename.m4 index ef5dd5f2c1..2bdf31ecb7 100644 --- a/m4/localename.m4 +++ b/m4/localename.m4 @@ -9,4 +9,9 @@ AC_DEFUN([gl_LOCALENAME], AC_REQUIRE([gt_LC_MESSAGES]) AC_REQUIRE([gt_INTL_MACOSX]) AC_CHECK_FUNCS([setlocale uselocale]) + dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have + dnl it nor the equivalent. + if test $ac_cv_func_uselocale = yes; then + AC_CHECK_FUNCS([getlocalename_l]) + fi ])