Blame m4/intlmacosx.m4

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