Blame m4/intlmacosx.m4

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