summaryrefslogtreecommitdiffstats
path: root/gl/m4/intlmacosx.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/intlmacosx.m4')
-rw-r--r--gl/m4/intlmacosx.m441
1 files changed, 25 insertions, 16 deletions
diff --git a/gl/m4/intlmacosx.m4 b/gl/m4/intlmacosx.m4
index ab97d39..4ae0d12 100644
--- a/gl/m4/intlmacosx.m4
+++ b/gl/m4/intlmacosx.m4
@@ -1,23 +1,23 @@
1# intlmacosx.m4 serial 5 (gettext-0.18.2) 1# intlmacosx.m4 serial 8 (gettext-0.20.2)
2dnl Copyright (C) 2004-2013 Free Software Foundation, Inc. 2dnl Copyright (C) 2004-2014, 2016, 2019-2021 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
6dnl 6dnl
7dnl This file can can be used in projects which are not available under 7dnl This file can be used in projects which are not available under
8dnl the GNU General Public License or the GNU Library General Public 8dnl the GNU General Public License or the GNU Lesser General Public
9dnl License but which still want to provide support for the GNU gettext 9dnl License but which still want to provide support for the GNU gettext
10dnl functionality. 10dnl functionality.
11dnl Please note that the actual code of the GNU gettext library is covered 11dnl Please note that the actual code of the GNU gettext library is covered
12dnl by the GNU Library General Public License, and the rest of the GNU 12dnl by the GNU Lesser General Public License, and the rest of the GNU
13dnl gettext package package is covered by the GNU General Public License. 13dnl gettext package is covered by the GNU General Public License.
14dnl They are *not* in the public domain. 14dnl They are *not* in the public domain.
15 15
16dnl Checks for special options needed on Mac OS X. 16dnl Checks for special options needed on Mac OS X.
17dnl Defines INTL_MACOSX_LIBS. 17dnl Defines INTL_MACOSX_LIBS.
18AC_DEFUN([gt_INTL_MACOSX], 18AC_DEFUN([gt_INTL_MACOSX],
19[ 19[
20 dnl Check for API introduced in Mac OS X 10.2. 20 dnl Check for API introduced in Mac OS X 10.4.
21 AC_CACHE_CHECK([for CFPreferencesCopyAppValue], 21 AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
22 [gt_cv_func_CFPreferencesCopyAppValue], 22 [gt_cv_func_CFPreferencesCopyAppValue],
23 [gt_save_LIBS="$LIBS" 23 [gt_save_LIBS="$LIBS"
@@ -33,23 +33,32 @@ AC_DEFUN([gt_INTL_MACOSX],
33 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], 33 AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
34 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) 34 [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
35 fi 35 fi
36 dnl Check for API introduced in Mac OS X 10.3. 36 dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
37 AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent], 37 dnl because in macOS 10.13.4 it has the following behaviour:
38 dnl When two or more languages are specified in the
39 dnl "System Preferences > Language & Region > Preferred Languages" panel,
40 dnl it returns en_CC where CC is the territory (even when English is not among
41 dnl the preferred languages!). What we want instead is what
42 dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
43 dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
44 dnl first among the preferred languages and CC is the territory.
45 AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
38 [gt_save_LIBS="$LIBS" 46 [gt_save_LIBS="$LIBS"
39 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" 47 LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
40 AC_LINK_IFELSE( 48 AC_LINK_IFELSE(
41 [AC_LANG_PROGRAM( 49 [AC_LANG_PROGRAM(
42 [[#include <CoreFoundation/CFLocale.h>]], 50 [[#include <CoreFoundation/CFLocale.h>]],
43 [[CFLocaleCopyCurrent();]])], 51 [[CFLocaleCopyPreferredLanguages();]])],
44 [gt_cv_func_CFLocaleCopyCurrent=yes], 52 [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
45 [gt_cv_func_CFLocaleCopyCurrent=no]) 53 [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
46 LIBS="$gt_save_LIBS"]) 54 LIBS="$gt_save_LIBS"])
47 if test $gt_cv_func_CFLocaleCopyCurrent = yes; then 55 if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
48 AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], 56 AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
49 [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) 57 [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
50 fi 58 fi
51 INTL_MACOSX_LIBS= 59 INTL_MACOSX_LIBS=
52 if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then 60 if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
61 || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
53 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" 62 INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
54 fi 63 fi
55 AC_SUBST([INTL_MACOSX_LIBS]) 64 AC_SUBST([INTL_MACOSX_LIBS])