Blame m4/intlmacosx.m4

Packit 7e555f
# intlmacosx.m4 serial 1 (gettext-0.17)
Packit 7e555f
dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
Packit 7e555f
dnl This file is free software; the Free Software Foundation
Packit 7e555f
dnl gives unlimited permission to copy and/or distribute it,
Packit 7e555f
dnl with or without modifications, as long as this notice is preserved.
Packit 7e555f
dnl
Packit 7e555f
dnl This file can can be used in projects which are not available under
Packit 7e555f
dnl the GNU General Public License or the GNU Library General Public
Packit 7e555f
dnl License but which still want to provide support for the GNU gettext
Packit 7e555f
dnl functionality.
Packit 7e555f
dnl Please note that the actual code of the GNU gettext library is covered
Packit 7e555f
dnl by the GNU Library General Public License, and the rest of the GNU
Packit 7e555f
dnl gettext package package is covered by the GNU General Public License.
Packit 7e555f
dnl They are *not* in the public domain.
Packit 7e555f
Packit 7e555f
dnl Checks for special options needed on MacOS X.
Packit 7e555f
dnl Defines INTL_MACOSX_LIBS.
Packit 7e555f
AC_DEFUN([gt_INTL_MACOSX],
Packit 7e555f
[
Packit 7e555f
  dnl Check for API introduced in MacOS X 10.2.
Packit 7e555f
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
Packit 7e555f
    gt_cv_func_CFPreferencesCopyAppValue,
Packit 7e555f
    [gt_save_LIBS="$LIBS"
Packit 7e555f
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
Packit 7e555f
     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
Packit 7e555f
       [CFPreferencesCopyAppValue(NULL, NULL)],
Packit 7e555f
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
Packit 7e555f
       [gt_cv_func_CFPreferencesCopyAppValue=no])
Packit 7e555f
     LIBS="$gt_save_LIBS"])
Packit 7e555f
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
Packit 7e555f
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
Packit 7e555f
      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
Packit 7e555f
  fi
Packit 7e555f
  dnl Check for API introduced in MacOS X 10.3.
Packit 7e555f
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
Packit 7e555f
    [gt_save_LIBS="$LIBS"
Packit 7e555f
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
Packit 7e555f
     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
Packit 7e555f
       [gt_cv_func_CFLocaleCopyCurrent=yes],
Packit 7e555f
       [gt_cv_func_CFLocaleCopyCurrent=no])
Packit 7e555f
     LIBS="$gt_save_LIBS"])
Packit 7e555f
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
Packit 7e555f
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
Packit 7e555f
      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
Packit 7e555f
  fi
Packit 7e555f
  INTL_MACOSX_LIBS=
Packit 7e555f
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
Packit 7e555f
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
Packit 7e555f
  fi
Packit 7e555f
  AC_SUBST([INTL_MACOSX_LIBS])
Packit 7e555f
])