Blame gettext-runtime/m4/intlmacosx.m4

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