intlmacosx.m4 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # intlmacosx.m4 serial 5 (gettext-0.18.2)
  2. dnl Copyright (C) 2004-2014 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. dnl
  7. dnl This file can can be used in projects which are not available under
  8. dnl the GNU General Public License or the GNU Library General Public
  9. dnl License but which still want to provide support for the GNU gettext
  10. dnl functionality.
  11. dnl Please note that the actual code of the GNU gettext library is covered
  12. dnl by the GNU Library General Public License, and the rest of the GNU
  13. dnl gettext package package is covered by the GNU General Public License.
  14. dnl They are *not* in the public domain.
  15. dnl Checks for special options needed on Mac OS X.
  16. dnl Defines INTL_MACOSX_LIBS.
  17. AC_DEFUN([gt_INTL_MACOSX],
  18. [
  19. dnl Check for API introduced in Mac OS X 10.2.
  20. AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
  21. [gt_cv_func_CFPreferencesCopyAppValue],
  22. [gt_save_LIBS="$LIBS"
  23. LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
  24. AC_LINK_IFELSE(
  25. [AC_LANG_PROGRAM(
  26. [[#include <CoreFoundation/CFPreferences.h>]],
  27. [[CFPreferencesCopyAppValue(NULL, NULL)]])],
  28. [gt_cv_func_CFPreferencesCopyAppValue=yes],
  29. [gt_cv_func_CFPreferencesCopyAppValue=no])
  30. LIBS="$gt_save_LIBS"])
  31. if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
  32. AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
  33. [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
  34. fi
  35. dnl Check for API introduced in Mac OS X 10.3.
  36. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
  37. [gt_save_LIBS="$LIBS"
  38. LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
  39. AC_LINK_IFELSE(
  40. [AC_LANG_PROGRAM(
  41. [[#include <CoreFoundation/CFLocale.h>]],
  42. [[CFLocaleCopyCurrent();]])],
  43. [gt_cv_func_CFLocaleCopyCurrent=yes],
  44. [gt_cv_func_CFLocaleCopyCurrent=no])
  45. LIBS="$gt_save_LIBS"])
  46. if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
  47. AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
  48. [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
  49. fi
  50. INTL_MACOSX_LIBS=
  51. if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
  52. INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
  53. fi
  54. AC_SUBST([INTL_MACOSX_LIBS])
  55. ])