Blame m4/intlmacosx.m4

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