xref: /minix3/external/bsd/flex/dist/m4/intlmacosx.m4 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc# intlmacosx.m4 serial 3 (gettext-0.18)
2*0a6a1f1dSLionel Sambucdnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
3*0a6a1f1dSLionel Sambucdnl This file is free software; the Free Software Foundation
4*0a6a1f1dSLionel Sambucdnl gives unlimited permission to copy and/or distribute it,
5*0a6a1f1dSLionel Sambucdnl with or without modifications, as long as this notice is preserved.
6*0a6a1f1dSLionel Sambucdnl
7*0a6a1f1dSLionel Sambucdnl This file can can be used in projects which are not available under
8*0a6a1f1dSLionel Sambucdnl the GNU General Public License or the GNU Library General Public
9*0a6a1f1dSLionel Sambucdnl License but which still want to provide support for the GNU gettext
10*0a6a1f1dSLionel Sambucdnl functionality.
11*0a6a1f1dSLionel Sambucdnl Please note that the actual code of the GNU gettext library is covered
12*0a6a1f1dSLionel Sambucdnl by the GNU Library General Public License, and the rest of the GNU
13*0a6a1f1dSLionel Sambucdnl gettext package package is covered by the GNU General Public License.
14*0a6a1f1dSLionel Sambucdnl They are *not* in the public domain.
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambucdnl Checks for special options needed on MacOS X.
17*0a6a1f1dSLionel Sambucdnl Defines INTL_MACOSX_LIBS.
18*0a6a1f1dSLionel SambucAC_DEFUN([gt_INTL_MACOSX],
19*0a6a1f1dSLionel Sambuc[
20*0a6a1f1dSLionel Sambuc  dnl Check for API introduced in MacOS X 10.2.
21*0a6a1f1dSLionel Sambuc  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
22*0a6a1f1dSLionel Sambuc    [gt_cv_func_CFPreferencesCopyAppValue],
23*0a6a1f1dSLionel Sambuc    [gt_save_LIBS="$LIBS"
24*0a6a1f1dSLionel Sambuc     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
25*0a6a1f1dSLionel Sambuc     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
26*0a6a1f1dSLionel Sambuc       [CFPreferencesCopyAppValue(NULL, NULL)],
27*0a6a1f1dSLionel Sambuc       [gt_cv_func_CFPreferencesCopyAppValue=yes],
28*0a6a1f1dSLionel Sambuc       [gt_cv_func_CFPreferencesCopyAppValue=no])
29*0a6a1f1dSLionel Sambuc     LIBS="$gt_save_LIBS"])
30*0a6a1f1dSLionel Sambuc  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
31*0a6a1f1dSLionel Sambuc    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
32*0a6a1f1dSLionel Sambuc      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
33*0a6a1f1dSLionel Sambuc  fi
34*0a6a1f1dSLionel Sambuc  dnl Check for API introduced in MacOS X 10.3.
35*0a6a1f1dSLionel Sambuc  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
36*0a6a1f1dSLionel Sambuc    [gt_save_LIBS="$LIBS"
37*0a6a1f1dSLionel Sambuc     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
38*0a6a1f1dSLionel Sambuc     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
39*0a6a1f1dSLionel Sambuc       [gt_cv_func_CFLocaleCopyCurrent=yes],
40*0a6a1f1dSLionel Sambuc       [gt_cv_func_CFLocaleCopyCurrent=no])
41*0a6a1f1dSLionel Sambuc     LIBS="$gt_save_LIBS"])
42*0a6a1f1dSLionel Sambuc  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
43*0a6a1f1dSLionel Sambuc    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
44*0a6a1f1dSLionel Sambuc      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
45*0a6a1f1dSLionel Sambuc  fi
46*0a6a1f1dSLionel Sambuc  INTL_MACOSX_LIBS=
47*0a6a1f1dSLionel Sambuc  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
48*0a6a1f1dSLionel Sambuc    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
49*0a6a1f1dSLionel Sambuc  fi
50*0a6a1f1dSLionel Sambuc  AC_SUBST([INTL_MACOSX_LIBS])
51*0a6a1f1dSLionel Sambuc])
52