Blame m4/intlmacosx.m4

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