Blame m4/intlmacosx.m4

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