Blame build/autotools/intlmacosx.m4

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