Blame m4/intlmacosx.m4

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