]> Savannah Git Hosting - gnulib.git/commitdiff
localename: fix link error on Illumos
authorDaiki Ueno <ueno@gnu.org>
Tue, 7 Jul 2015 06:36:43 +0000 (15:36 +0900)
committerDaiki Ueno <ueno@gnu.org>
Tue, 7 Jul 2015 06:44:01 +0000 (15:44 +0900)
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.

ChangeLog
lib/localename.c
m4/localename.m4

index e8fd9ed12e337cd42979501d372f52a757e7aa08..b6b7c9824fca171bf3efa5fec932626bf6beba47 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-07-07  Daiki Ueno  <ueno@gnu.org>
+
+       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  <ueno@gnu.org>
 
        unistr/uN-strtok-tests: avoid a trivial leak
index f3733eb46c542ab4aae8f69fb16f72f866d65d11..f8cf3f2362154bec1d4fb3aff336fcdfd1f8fcfa 100644 (file)
@@ -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__
index ef5dd5f2c1caee52fbb793181086be4d969238e2..2bdf31ecb7de3c74a176cb57ebdfdbdf52215156 100644 (file)
@@ -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
 ])