~ubuntu-branches/ubuntu/saucy/m17n-lib/saucy

« back to all changes in this revision

Viewing changes to m4/gettext.m4

  • Committer: Bazaar Package Importer
  • Author(s): Harshula Jayasuriya
  • Date: 2010-11-23 01:39:29 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20101123013929-rs3kpqgu4kr3qx32
Tags: 1.6.2-1
* New upstream release 1.6.2.
* Update Standards-Version to Debian Policy 3.9.1. (No changes)
* debian/control: Depends: m17n-db and m17n-contrib. (Closes: #599643)
* PATCH: (make_locale): Don't call setlocale.  Just parse the arg NAME.
         (Closes: #601858)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# gettext.m4 serial 37 (gettext-0.14.4)
2
 
dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
 
1
# gettext.m4 serial 60 (gettext-0.17)
 
2
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
15
15
 
16
16
dnl Authors:
17
17
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
18
 
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
18
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006.
19
19
 
20
20
dnl Macro to add for using GNU gettext.
21
21
 
63
63
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
64
64
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
65
65
])])])])
66
 
  define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
 
66
  define([gt_included_intl],
 
67
    ifelse([$1], [external],
 
68
      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
 
69
      [yes]))
67
70
  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
 
71
  gt_NEEDS_INIT
 
72
  AM_GNU_GETTEXT_NEED([$2])
68
73
 
69
74
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
70
75
  ifelse(gt_included_intl, yes, [
78
83
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
79
84
  dnl Ideally we would do this search only after the
80
85
  dnl      if test "$USE_NLS" = "yes"; then
81
 
  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
86
  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
82
87
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
83
88
  dnl the configure script would need to contain the same shell code
84
89
  dnl again, outside any 'if'. There are two solutions:
94
99
  gt_INTL_MACOSX
95
100
 
96
101
  dnl Set USE_NLS.
97
 
  AM_NLS
 
102
  AC_REQUIRE([AM_NLS])
98
103
 
99
104
  ifelse(gt_included_intl, yes, [
100
105
    BUILD_INCLUDED_LIBINTL=no
104
109
  LTLIBINTL=
105
110
  POSUB=
106
111
 
 
112
  dnl Add a version number to the cache macros.
 
113
  case " $gt_needs " in
 
114
    *" need-formatstring-macros "*) gt_api_version=3 ;;
 
115
    *" need-ngettext "*) gt_api_version=2 ;;
 
116
    *) gt_api_version=1 ;;
 
117
  esac
 
118
  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
 
119
  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
 
120
 
107
121
  dnl If we use NLS figure out what method
108
122
  if test "$USE_NLS" = "yes"; then
109
123
    gt_use_preinstalled_gnugettext=no
122
136
        dnl to use.  If GNU gettext is available we use this.  Else we have
123
137
        dnl to fall back to GNU NLS library.
124
138
 
125
 
        dnl Add a version number to the cache macros.
126
 
        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
127
 
        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
128
 
        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
 
139
        if test $gt_api_version -ge 3; then
 
140
          gt_revision_test_code='
 
141
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
142
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 
143
#endif
 
144
changequote(,)dnl
 
145
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 
146
changequote([,])dnl
 
147
'
 
148
        else
 
149
          gt_revision_test_code=
 
150
        fi
 
151
        if test $gt_api_version -ge 2; then
 
152
          gt_expression_test_code=' + * ngettext ("", "", 0)'
 
153
        else
 
154
          gt_expression_test_code=
 
155
        fi
129
156
 
130
 
        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
 
157
        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
131
158
         [AC_TRY_LINK([#include <libintl.h>
132
 
]ifelse([$2], [need-formatstring-macros],
133
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
134
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
135
 
#endif
136
 
changequote(,)dnl
137
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
138
 
changequote([,])dnl
139
 
], [])[extern int _nl_msg_cat_cntr;
 
159
$gt_revision_test_code
 
160
extern int _nl_msg_cat_cntr;
140
161
extern int *_nl_domain_bindings;],
141
162
            [bindtextdomain ("", "");
142
 
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
143
 
            gt_cv_func_gnugettext_libc=yes,
144
 
            gt_cv_func_gnugettext_libc=no)])
 
163
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
 
164
            [eval "$gt_func_gnugettext_libc=yes"],
 
165
            [eval "$gt_func_gnugettext_libc=no"])])
145
166
 
146
 
        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
167
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
147
168
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
148
169
          ifelse(gt_included_intl, yes, , [
149
170
            AM_ICONV_LINK
154
175
          dnl even if libiconv doesn't exist.
155
176
          AC_LIB_LINKFLAGS_BODY([intl])
156
177
          AC_CACHE_CHECK([for GNU gettext in libintl],
157
 
            gt_cv_func_gnugettext_libintl,
 
178
            [$gt_func_gnugettext_libintl],
158
179
           [gt_save_CPPFLAGS="$CPPFLAGS"
159
180
            CPPFLAGS="$CPPFLAGS $INCINTL"
160
181
            gt_save_LIBS="$LIBS"
161
182
            LIBS="$LIBS $LIBINTL"
162
183
            dnl Now see whether libintl exists and does not depend on libiconv.
163
184
            AC_TRY_LINK([#include <libintl.h>
164
 
]ifelse([$2], [need-formatstring-macros],
165
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
166
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
167
 
#endif
168
 
changequote(,)dnl
169
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
170
 
changequote([,])dnl
171
 
], [])[extern int _nl_msg_cat_cntr;
 
185
$gt_revision_test_code
 
186
extern int _nl_msg_cat_cntr;
172
187
extern
173
188
#ifdef __cplusplus
174
189
"C"
175
190
#endif
176
191
const char *_nl_expand_alias (const char *);],
177
192
              [bindtextdomain ("", "");
178
 
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
179
 
              gt_cv_func_gnugettext_libintl=yes,
180
 
              gt_cv_func_gnugettext_libintl=no)
 
193
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
194
              [eval "$gt_func_gnugettext_libintl=yes"],
 
195
              [eval "$gt_func_gnugettext_libintl=no"])
181
196
            dnl Now see whether libintl exists and depends on libiconv.
182
 
            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
 
197
            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
183
198
              LIBS="$LIBS $LIBICONV"
184
199
              AC_TRY_LINK([#include <libintl.h>
185
 
]ifelse([$2], [need-formatstring-macros],
186
 
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
187
 
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
188
 
#endif
189
 
changequote(,)dnl
190
 
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
191
 
changequote([,])dnl
192
 
], [])[extern int _nl_msg_cat_cntr;
 
200
$gt_revision_test_code
 
201
extern int _nl_msg_cat_cntr;
193
202
extern
194
203
#ifdef __cplusplus
195
204
"C"
196
205
#endif
197
206
const char *_nl_expand_alias (const char *);],
198
207
                [bindtextdomain ("", "");
199
 
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
208
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
200
209
               [LIBINTL="$LIBINTL $LIBICONV"
201
210
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
202
 
                gt_cv_func_gnugettext_libintl=yes
 
211
                eval "$gt_func_gnugettext_libintl=yes"
203
212
               ])
204
213
            fi
205
214
            CPPFLAGS="$gt_save_CPPFLAGS"
210
219
        dnl use it.  But if this macro is used in GNU gettext, and GNU
211
220
        dnl gettext is already preinstalled in libintl, we update this
212
221
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
213
 
        if test "$gt_cv_func_gnugettext_libc" = "yes" \
214
 
           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
 
222
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
 
223
           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
215
224
                && test "$PACKAGE" != gettext-runtime \
216
225
                && test "$PACKAGE" != gettext-tools; }; then
217
226
          gt_use_preinstalled_gnugettext=yes
234
243
        dnl Mark actions used to generate GNU NLS library.
235
244
        BUILD_INCLUDED_LIBINTL=yes
236
245
        USE_INCLUDED_LIBINTL=yes
237
 
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
238
 
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
 
246
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
 
247
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
239
248
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
240
249
      fi
241
250
 
271
280
  if test "$USE_NLS" = "yes"; then
272
281
    AC_MSG_CHECKING([where the gettext function comes from])
273
282
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
274
 
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
283
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
275
284
        gt_source="external libintl"
276
285
      else
277
286
        gt_source="libc"
285
294
  if test "$USE_NLS" = "yes"; then
286
295
 
287
296
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
288
 
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
297
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
289
298
        AC_MSG_CHECKING([how to link with libintl])
290
299
        AC_MSG_RESULT([$LIBINTL])
291
300
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
353
362
])
354
363
 
355
364
 
356
 
dnl Checks for all prerequisites of the intl subdirectory,
357
 
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
358
 
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
359
 
AC_DEFUN([AM_INTL_SUBDIR],
360
 
[
361
 
  AC_REQUIRE([AC_PROG_INSTALL])dnl
362
 
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
363
 
  AC_REQUIRE([AC_PROG_CC])dnl
364
 
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
365
 
  AC_REQUIRE([gt_GLIBC2])dnl
366
 
  AC_REQUIRE([AC_PROG_RANLIB])dnl
367
 
  AC_REQUIRE([AC_ISC_POSIX])dnl
368
 
  AC_REQUIRE([AC_HEADER_STDC])dnl
369
 
  AC_REQUIRE([AC_C_CONST])dnl
370
 
  AC_REQUIRE([bh_C_SIGNED])dnl
371
 
  AC_REQUIRE([AC_C_INLINE])dnl
372
 
  AC_REQUIRE([AC_TYPE_OFF_T])dnl
373
 
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
374
 
  AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
375
 
  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
376
 
  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
377
 
  AC_REQUIRE([gt_TYPE_WINT_T])dnl
378
 
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
379
 
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
380
 
  AC_REQUIRE([gt_TYPE_INTMAX_T])
381
 
  AC_REQUIRE([gt_PRINTF_POSIX])
382
 
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
383
 
  AC_REQUIRE([AC_FUNC_MMAP])dnl
384
 
  AC_REQUIRE([gl_GLIBC21])dnl
385
 
  AC_REQUIRE([gt_INTDIV0])dnl
386
 
  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
387
 
  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
388
 
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
389
 
  AC_REQUIRE([gl_XSIZE])dnl
390
 
  AC_REQUIRE([gt_INTL_MACOSX])dnl
391
 
 
392
 
  AC_CHECK_TYPE([ptrdiff_t], ,
393
 
    [AC_DEFINE([ptrdiff_t], [long],
394
 
       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
395
 
    ])
396
 
  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
397
 
stdlib.h string.h unistd.h sys/param.h])
398
 
  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
399
 
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
400
 
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
401
 
__fsetlocking])
402
 
 
403
 
  dnl Use the _snprintf function only if it is declared (because on NetBSD it
404
 
  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
405
 
  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
406
 
  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
407
 
 
408
 
  dnl Use the *_unlocked functions only if they are declared.
409
 
  dnl (because some of them were defined without being declared in Solaris
410
 
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
411
 
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
412
 
  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
413
 
  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
414
 
  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
415
 
  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
416
 
 
417
 
  case $gt_cv_func_printf_posix in
418
 
    *yes) HAVE_POSIX_PRINTF=1 ;;
419
 
    *) HAVE_POSIX_PRINTF=0 ;;
420
 
  esac
421
 
  AC_SUBST([HAVE_POSIX_PRINTF])
422
 
  if test "$ac_cv_func_asprintf" = yes; then
423
 
    HAVE_ASPRINTF=1
424
 
  else
425
 
    HAVE_ASPRINTF=0
426
 
  fi
427
 
  AC_SUBST([HAVE_ASPRINTF])
428
 
  if test "$ac_cv_func_snprintf" = yes; then
429
 
    HAVE_SNPRINTF=1
430
 
  else
431
 
    HAVE_SNPRINTF=0
432
 
  fi
433
 
  AC_SUBST([HAVE_SNPRINTF])
434
 
  if test "$ac_cv_func_wprintf" = yes; then
435
 
    HAVE_WPRINTF=1
436
 
  else
437
 
    HAVE_WPRINTF=0
438
 
  fi
439
 
  AC_SUBST([HAVE_WPRINTF])
440
 
 
441
 
  AM_ICONV
442
 
  AM_LANGINFO_CODESET
443
 
  if test $ac_cv_header_locale_h = yes; then
444
 
    gt_LC_MESSAGES
445
 
  fi
446
 
 
447
 
  if test -n "$INTL_MACOSX_LIBS"; then
448
 
    CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
449
 
  fi
450
 
 
451
 
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
452
 
  dnl because plural.y uses bison specific features. It requires at least
453
 
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
454
 
  dnl compile.
455
 
  dnl bison is only needed for the maintainer (who touches plural.y). But in
456
 
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
457
 
  dnl the rule in general Makefile. Now, some people carelessly touch the
458
 
  dnl files or have a broken "make" program, hence the plural.c rule will
459
 
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
460
 
  dnl present or too old.
461
 
  AC_CHECK_PROGS([INTLBISON], [bison])
462
 
  if test -z "$INTLBISON"; then
463
 
    ac_verc_fail=yes
464
 
  else
465
 
    dnl Found it, now check the version.
466
 
    AC_MSG_CHECKING([version of bison])
467
 
changequote(<<,>>)dnl
468
 
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
469
 
    case $ac_prog_version in
470
 
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
471
 
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
472
 
changequote([,])dnl
473
 
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
474
 
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
475
 
    esac
476
 
    AC_MSG_RESULT([$ac_prog_version])
477
 
  fi
478
 
  if test $ac_verc_fail = yes; then
479
 
    INTLBISON=:
480
 
  fi
481
 
])
482
 
 
483
 
 
484
 
dnl Checks for special options needed on MacOS X.
485
 
dnl Defines INTL_MACOSX_LIBS.
486
 
AC_DEFUN([gt_INTL_MACOSX],
487
 
[
488
 
  dnl Check for API introduced in MacOS X 10.2.
489
 
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
490
 
    gt_cv_func_CFPreferencesCopyAppValue,
491
 
    [gt_save_CPPFLAGS="$CPPFLAGS"
492
 
     CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
493
 
     gt_save_LIBS="$LIBS"
494
 
     LIBS="$LIBS -framework CoreFoundation"
495
 
     AC_TRY_LINK([#include <CFPreferences.h>],
496
 
       [CFPreferencesCopyAppValue(NULL, NULL)],
497
 
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
498
 
       [gt_cv_func_CFPreferencesCopyAppValue=no])
499
 
     CPPFLAGS="$gt_save_CPPFLAGS"
500
 
     LIBS="$gt_save_LIBS"])
501
 
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
502
 
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
503
 
      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
504
 
  fi
505
 
  dnl Check for API introduced in MacOS X 10.3.
506
 
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
507
 
    [gt_save_CPPFLAGS="$CPPFLAGS"
508
 
     CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
509
 
     gt_save_LIBS="$LIBS"
510
 
     LIBS="$LIBS -framework CoreFoundation"
511
 
     AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
512
 
       [gt_cv_func_CFLocaleCopyCurrent=yes],
513
 
       [gt_cv_func_CFLocaleCopyCurrent=no])
514
 
     CPPFLAGS="$gt_save_CPPFLAGS"
515
 
     LIBS="$gt_save_LIBS"])
516
 
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
517
 
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
518
 
      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
519
 
  fi
520
 
  INTL_MACOSX_LIBS=
521
 
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
522
 
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
523
 
  fi
524
 
  AC_SUBST([INTL_MACOSX_LIBS])
525
 
])
526
 
 
527
 
 
528
 
dnl gt_CHECK_DECL(FUNC, INCLUDES)
529
 
dnl Check whether a function is declared.
530
 
AC_DEFUN([gt_CHECK_DECL],
531
 
[
532
 
  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
533
 
    [AC_TRY_COMPILE([$2], [
534
 
#ifndef $1
535
 
  char *p = (char *) $1;
536
 
#endif
537
 
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
538
 
  if test $ac_cv_have_decl_$1 = yes; then
539
 
    gt_value=1
540
 
  else
541
 
    gt_value=0
542
 
  fi
543
 
  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
544
 
    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
 
365
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
 
366
m4_define([gt_NEEDS_INIT],
 
367
[
 
368
  m4_divert_text([DEFAULTS], [gt_needs=])
 
369
  m4_define([gt_NEEDS_INIT], [])
 
370
])
 
371
 
 
372
 
 
373
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
 
374
AC_DEFUN([AM_GNU_GETTEXT_NEED],
 
375
[
 
376
  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
545
377
])
546
378
 
547
379