19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
# gettext.m4 serial 63 (gettext-0.18)
23
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
24
dnl This file is free software; the Free Software Foundation
25
dnl gives unlimited permission to copy and/or distribute it,
26
dnl with or without modifications, as long as this notice is preserved.
28
dnl This file can can be used in projects which are not available under
29
dnl the GNU General Public License or the GNU Library General Public
30
dnl License but which still want to provide support for the GNU gettext
32
dnl Please note that the actual code of the GNU gettext library is covered
33
dnl by the GNU Library General Public License, and the rest of the GNU
34
dnl gettext package package is covered by the GNU General Public License.
35
dnl They are *not* in the public domain.
38
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
39
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
41
dnl Macro to add for using GNU gettext.
43
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
44
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
45
dnl default (if it is not specified or empty) is 'no-libtool'.
46
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
47
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
48
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
49
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
50
dnl depending on --{enable,disable}-{shared,static} and on the presence of
51
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
52
dnl $(top_builddir)/intl/libintl.a will be created.
53
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
54
dnl implementations (in libc or libintl) without the ngettext() function
55
dnl will be ignored. If NEEDSYMBOL is specified and is
56
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
57
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
58
dnl INTLDIR is used to find the intl libraries. If empty,
59
dnl the value `$(top_builddir)/intl/' is used.
61
dnl The result of the configuration is one of three cases:
62
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
64
dnl Catalog format: GNU --> install in $(datadir)
65
dnl Catalog extension: .mo after installation, .gmo in source tree
66
dnl 2) GNU gettext has been found in the system's C library.
67
dnl Catalog format: GNU --> install in $(datadir)
68
dnl Catalog extension: .mo after installation, .gmo in source tree
69
dnl 3) No internationalization, always use English msgid.
70
dnl Catalog format: none
71
dnl Catalog extension: none
72
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
73
dnl The use of .gmo is historical (it was needed to avoid overwriting the
74
dnl GNU format catalogs when building on a platform with an X/Open gettext),
75
dnl but we keep it in order not to force irrelevant filename changes on the
78
AC_DEFUN([AM_GNU_GETTEXT],
80
dnl Argument checking.
81
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
82
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
84
ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
85
[AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
86
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
87
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
89
define([gt_included_intl],
90
ifelse([$1], [external],
91
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
93
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
95
AM_GNU_GETTEXT_NEED([$2])
97
AC_REQUIRE([AM_PO_SUBDIRS])dnl
98
ifelse(gt_included_intl, yes, [
99
AC_REQUIRE([AM_INTL_SUBDIR])dnl
102
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
103
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
104
AC_REQUIRE([AC_LIB_RPATH])
106
dnl Sometimes libintl requires libiconv, so first search for libiconv.
107
dnl Ideally we would do this search only after the
108
dnl if test "$USE_NLS" = "yes"; then
109
dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
110
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
111
dnl the configure script would need to contain the same shell code
112
dnl again, outside any 'if'. There are two solutions:
113
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
114
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
115
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
116
dnl documented, we avoid it.
117
ifelse(gt_included_intl, yes, , [
118
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
121
dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
127
ifelse(gt_included_intl, yes, [
128
BUILD_INCLUDED_LIBINTL=no
129
USE_INCLUDED_LIBINTL=no
135
dnl Add a version number to the cache macros.
136
case " $gt_needs " in
137
*" need-formatstring-macros "*) gt_api_version=3 ;;
138
*" need-ngettext "*) gt_api_version=2 ;;
139
*) gt_api_version=1 ;;
141
gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
142
gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
144
dnl If we use NLS figure out what method
145
if test "$USE_NLS" = "yes"; then
146
gt_use_preinstalled_gnugettext=no
147
ifelse(gt_included_intl, yes, [
148
AC_MSG_CHECKING([whether included gettext is requested])
149
AC_ARG_WITH([included-gettext],
150
[ --with-included-gettext use the GNU gettext library included here],
151
nls_cv_force_use_gnu_gettext=$withval,
152
nls_cv_force_use_gnu_gettext=no)
153
AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
155
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
156
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
158
dnl User does not insist on using GNU NLS library. Figure out what
159
dnl to use. If GNU gettext is available we use this. Else we have
160
dnl to fall back to GNU NLS library.
162
if test $gt_api_version -ge 3; then
163
gt_revision_test_code='
164
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
165
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
168
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
172
gt_revision_test_code=
174
if test $gt_api_version -ge 2; then
175
gt_expression_test_code=' + * ngettext ("", "", 0)'
177
gt_expression_test_code=
180
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
181
[AC_TRY_LINK([#include <libintl.h>
182
$gt_revision_test_code
183
extern int _nl_msg_cat_cntr;
184
extern int *_nl_domain_bindings;],
185
[bindtextdomain ("", "");
186
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
187
[eval "$gt_func_gnugettext_libc=yes"],
188
[eval "$gt_func_gnugettext_libc=no"])])
190
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
191
dnl Sometimes libintl requires libiconv, so first search for libiconv.
192
ifelse(gt_included_intl, yes, , [
195
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
196
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
197
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
198
dnl even if libiconv doesn't exist.
199
AC_LIB_LINKFLAGS_BODY([intl])
200
AC_CACHE_CHECK([for GNU gettext in libintl],
201
[$gt_func_gnugettext_libintl],
202
[gt_save_CPPFLAGS="$CPPFLAGS"
203
CPPFLAGS="$CPPFLAGS $INCINTL"
205
LIBS="$LIBS $LIBINTL"
206
dnl Now see whether libintl exists and does not depend on libiconv.
207
AC_TRY_LINK([#include <libintl.h>
208
$gt_revision_test_code
209
extern int _nl_msg_cat_cntr;
214
const char *_nl_expand_alias (const char *);],
215
[bindtextdomain ("", "");
216
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
217
[eval "$gt_func_gnugettext_libintl=yes"],
218
[eval "$gt_func_gnugettext_libintl=no"])
219
dnl Now see whether libintl exists and depends on libiconv.
220
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
221
LIBS="$LIBS $LIBICONV"
222
AC_TRY_LINK([#include <libintl.h>
223
$gt_revision_test_code
224
extern int _nl_msg_cat_cntr;
229
const char *_nl_expand_alias (const char *);],
230
[bindtextdomain ("", "");
231
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
232
[LIBINTL="$LIBINTL $LIBICONV"
233
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
234
eval "$gt_func_gnugettext_libintl=yes"
237
CPPFLAGS="$gt_save_CPPFLAGS"
238
LIBS="$gt_save_LIBS"])
241
dnl If an already present or preinstalled GNU gettext() is found,
242
dnl use it. But if this macro is used in GNU gettext, and GNU
243
dnl gettext is already preinstalled in libintl, we update this
244
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
245
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
246
|| { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
247
&& test "$PACKAGE" != gettext-runtime \
248
&& test "$PACKAGE" != gettext-tools; }; then
249
gt_use_preinstalled_gnugettext=yes
251
dnl Reset the values set by searching for libintl.
257
ifelse(gt_included_intl, yes, [
258
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
259
dnl GNU gettext is not found in the C library.
260
dnl Fall back on included GNU gettext library.
261
nls_cv_use_gnu_gettext=yes
265
if test "$nls_cv_use_gnu_gettext" = "yes"; then
266
dnl Mark actions used to generate GNU NLS library.
267
BUILD_INCLUDED_LIBINTL=yes
268
USE_INCLUDED_LIBINTL=yes
269
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
270
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
271
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
275
if test "$gt_use_preinstalled_gnugettext" = "yes" \
276
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
277
dnl Mark actions to use GNU gettext tools.
282
if test -n "$INTL_MACOSX_LIBS"; then
283
if test "$gt_use_preinstalled_gnugettext" = "yes" \
284
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
285
dnl Some extra flags are needed during linking.
286
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
287
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
291
if test "$gt_use_preinstalled_gnugettext" = "yes" \
292
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
293
AC_DEFINE([ENABLE_NLS], [1],
294
[Define to 1 if translation of program messages to the user's native language
301
AC_MSG_CHECKING([whether to use NLS])
302
AC_MSG_RESULT([$USE_NLS])
303
if test "$USE_NLS" = "yes"; then
304
AC_MSG_CHECKING([where the gettext function comes from])
305
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
306
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
307
gt_source="external libintl"
312
gt_source="included intl directory"
314
AC_MSG_RESULT([$gt_source])
317
if test "$USE_NLS" = "yes"; then
319
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
320
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
321
AC_MSG_CHECKING([how to link with libintl])
322
AC_MSG_RESULT([$LIBINTL])
323
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
326
dnl For backward compatibility. Some packages may be using this.
327
AC_DEFINE([HAVE_GETTEXT], [1],
328
[Define if the GNU gettext() function is already present or preinstalled.])
329
AC_DEFINE([HAVE_DCGETTEXT], [1],
330
[Define if the GNU dcgettext() function is already present or preinstalled.])
333
dnl We need to process the po/ directory.
337
ifelse(gt_included_intl, yes, [
338
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
339
dnl to 'yes' because some of the testsuite requires it.
340
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
341
BUILD_INCLUDED_LIBINTL=yes
344
dnl Make all variables we use known to autoconf.
345
AC_SUBST([BUILD_INCLUDED_LIBINTL])
346
AC_SUBST([USE_INCLUDED_LIBINTL])
347
AC_SUBST([CATOBJEXT])
349
dnl For backward compatibility. Some configure.ins may be using this.
353
dnl For backward compatibility. Some Makefiles may be using this.
355
AC_SUBST([DATADIRNAME])
357
dnl For backward compatibility. Some Makefiles may be using this.
359
AC_SUBST([INSTOBJEXT])
361
dnl For backward compatibility. Some Makefiles may be using this.
365
dnl For backward compatibility. Some Makefiles may be using this.
367
if test "$USE_INCLUDED_LIBINTL" = yes; then
368
INTLOBJS="\$(GETTOBJS)"
372
dnl Enable libtool support if the surrounding package wishes it.
373
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
374
AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
377
dnl For backward compatibility. Some Makefiles may be using this.
381
dnl Make all documented variables known to autoconf.
383
AC_SUBST([LTLIBINTL])
388
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
389
m4_define([gt_NEEDS_INIT],
391
m4_divert_text([DEFAULTS], [gt_needs=])
392
m4_define([gt_NEEDS_INIT], [])
396
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
397
AC_DEFUN([AM_GNU_GETTEXT_NEED],
399
m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
403
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
404
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
406
# iconv.m4 serial 11 (gettext-0.18.1)
407
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
408
dnl This file is free software; the Free Software Foundation
409
dnl gives unlimited permission to copy and/or distribute it,
410
dnl with or without modifications, as long as this notice is preserved.
412
dnl From Bruno Haible.
414
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
416
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
417
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
418
AC_REQUIRE([AC_LIB_RPATH])
420
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
422
AC_LIB_LINKFLAGS_BODY([iconv])
425
AC_DEFUN([AM_ICONV_LINK],
427
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
428
dnl those with the standalone portable GNU libiconv installed).
429
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
431
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
433
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
435
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
436
dnl because if the user has installed libiconv and not disabled its use
437
dnl via --without-libiconv-prefix, he wants to use it. The first
438
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
439
am_save_CPPFLAGS="$CPPFLAGS"
440
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
442
AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
443
am_cv_func_iconv="no, consider installing GNU libiconv"
445
AC_TRY_LINK([#include <stdlib.h>
447
[iconv_t cd = iconv_open("","");
448
iconv(cd,NULL,NULL,NULL,NULL);
450
[am_cv_func_iconv=yes])
451
if test "$am_cv_func_iconv" != yes; then
453
LIBS="$LIBS $LIBICONV"
454
AC_TRY_LINK([#include <stdlib.h>
456
[iconv_t cd = iconv_open("","");
457
iconv(cd,NULL,NULL,NULL,NULL);
459
[am_cv_lib_iconv=yes]
460
[am_cv_func_iconv=yes])
464
if test "$am_cv_func_iconv" = yes; then
465
AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
466
dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
468
if test $am_cv_lib_iconv = yes; then
469
LIBS="$LIBS $LIBICONV"
476
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
479
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
480
if (cd_utf8_to_88591 != (iconv_t)(-1))
482
static const char input[] = "\342\202\254"; /* EURO SIGN */
484
const char *inptr = input;
485
size_t inbytesleft = strlen (input);
487
size_t outbytesleft = sizeof (buf);
488
size_t res = iconv (cd_utf8_to_88591,
489
(char **) &inptr, &inbytesleft,
490
&outptr, &outbytesleft);
495
/* Test against Solaris 10 bug: Failures are not distinguishable from
496
successful returns. */
498
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
499
if (cd_ascii_to_88591 != (iconv_t)(-1))
501
static const char input[] = "\263";
503
const char *inptr = input;
504
size_t inbytesleft = strlen (input);
506
size_t outbytesleft = sizeof (buf);
507
size_t res = iconv (cd_ascii_to_88591,
508
(char **) &inptr, &inbytesleft,
509
&outptr, &outbytesleft);
514
#if 0 /* This bug could be worked around by the caller. */
515
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
517
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
518
if (cd_88591_to_utf8 != (iconv_t)(-1))
520
static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
522
const char *inptr = input;
523
size_t inbytesleft = strlen (input);
525
size_t outbytesleft = sizeof (buf);
526
size_t res = iconv (cd_88591_to_utf8,
527
(char **) &inptr, &inbytesleft,
528
&outptr, &outbytesleft);
534
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
536
if (/* Try standardized names. */
537
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
538
/* Try IRIX, OSF/1 names. */
539
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
541
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
542
/* Try HP-UX names. */
543
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
546
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
548
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
549
*) am_cv_func_iconv_works="guessing yes" ;;
553
case "$am_cv_func_iconv_works" in
554
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
555
*) am_func_iconv=yes ;;
558
am_func_iconv=no am_cv_lib_iconv=no
560
if test "$am_func_iconv" = yes; then
561
AC_DEFINE([HAVE_ICONV], [1],
562
[Define if you have the iconv() function and it works.])
564
if test "$am_cv_lib_iconv" = yes; then
565
AC_MSG_CHECKING([how to link with libiconv])
566
AC_MSG_RESULT([$LIBICONV])
568
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
570
CPPFLAGS="$am_save_CPPFLAGS"
575
AC_SUBST([LTLIBICONV])
578
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
579
dnl avoid warnings like
580
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
581
dnl This is tricky because of the way 'aclocal' is implemented:
582
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
583
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
584
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
585
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
587
m4_define([gl_iconv_AC_DEFUN],
588
m4_version_prereq([2.64],
593
gl_iconv_AC_DEFUN([AM_ICONV],
596
if test "$am_cv_func_iconv" = yes; then
597
AC_MSG_CHECKING([for iconv declaration])
598
AC_CACHE_VAL([am_cv_proto_iconv], [
606
#if defined(__STDC__) || defined(__cplusplus)
607
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
611
], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
612
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
613
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
616
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
617
[Define as const if the declaration of iconv() needs const.])
621
# intlmacosx.m4 serial 3 (gettext-0.18)
622
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
623
dnl This file is free software; the Free Software Foundation
624
dnl gives unlimited permission to copy and/or distribute it,
625
dnl with or without modifications, as long as this notice is preserved.
627
dnl This file can can be used in projects which are not available under
628
dnl the GNU General Public License or the GNU Library General Public
629
dnl License but which still want to provide support for the GNU gettext
631
dnl Please note that the actual code of the GNU gettext library is covered
632
dnl by the GNU Library General Public License, and the rest of the GNU
633
dnl gettext package package is covered by the GNU General Public License.
634
dnl They are *not* in the public domain.
636
dnl Checks for special options needed on MacOS X.
637
dnl Defines INTL_MACOSX_LIBS.
638
AC_DEFUN([gt_INTL_MACOSX],
640
dnl Check for API introduced in MacOS X 10.2.
641
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
642
[gt_cv_func_CFPreferencesCopyAppValue],
643
[gt_save_LIBS="$LIBS"
644
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
645
AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
646
[CFPreferencesCopyAppValue(NULL, NULL)],
647
[gt_cv_func_CFPreferencesCopyAppValue=yes],
648
[gt_cv_func_CFPreferencesCopyAppValue=no])
649
LIBS="$gt_save_LIBS"])
650
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
651
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
652
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
654
dnl Check for API introduced in MacOS X 10.3.
655
AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
656
[gt_save_LIBS="$LIBS"
657
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
658
AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
659
[gt_cv_func_CFLocaleCopyCurrent=yes],
660
[gt_cv_func_CFLocaleCopyCurrent=no])
661
LIBS="$gt_save_LIBS"])
662
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
663
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
664
[Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
667
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
668
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
670
AC_SUBST([INTL_MACOSX_LIBS])
673
# lib-ld.m4 serial 4 (gettext-0.18)
674
dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
675
dnl This file is free software; the Free Software Foundation
676
dnl gives unlimited permission to copy and/or distribute it,
677
dnl with or without modifications, as long as this notice is preserved.
679
dnl Subroutines of libtool.m4,
680
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
683
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
684
AC_DEFUN([AC_LIB_PROG_LD_GNU],
685
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
686
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
687
case `$LD -v 2>&1 </dev/null` in
688
*GNU* | *'with BFD'*)
689
acl_cv_prog_gnu_ld=yes ;;
691
acl_cv_prog_gnu_ld=no ;;
693
with_gnu_ld=$acl_cv_prog_gnu_ld
696
dnl From libtool-1.4. Sets the variable LD.
697
AC_DEFUN([AC_LIB_PROG_LD],
698
[AC_ARG_WITH([gnu-ld],
699
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
700
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
701
AC_REQUIRE([AC_PROG_CC])dnl
702
AC_REQUIRE([AC_CANONICAL_HOST])dnl
703
# Prepare PATH_SEPARATOR.
704
# The user is always right.
705
if test "${PATH_SEPARATOR+set}" != set; then
706
echo "#! /bin/sh" >conf$$.sh
707
echo "exit 0" >>conf$$.sh
709
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
717
if test "$GCC" = yes; then
718
# Check if gcc -print-prog-name=ld gives a path.
719
AC_MSG_CHECKING([for ld used by GCC])
722
# gcc leaves a trailing carriage return which upsets mingw
723
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
725
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
728
# Accept absolute paths.
729
[[\\/]* | [A-Za-z]:[\\/]*)]
730
[re_direlt='/[^/][^/]*/\.\./']
731
# Canonicalize the path of ld
732
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
733
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
734
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
736
test -z "$LD" && LD="$ac_prog"
739
# If it fails, then pretend we aren't using GCC.
743
# If it is relative, then search for the first ld in PATH.
747
elif test "$with_gnu_ld" = yes; then
748
AC_MSG_CHECKING([for GNU ld])
750
AC_MSG_CHECKING([for non-GNU ld])
752
AC_CACHE_VAL([acl_cv_path_LD],
753
[if test -z "$LD"; then
754
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
755
for ac_dir in $PATH; do
756
test -z "$ac_dir" && ac_dir=.
757
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
758
acl_cv_path_LD="$ac_dir/$ac_prog"
759
# Check to see if the program is GNU ld. I'd rather use --version,
760
# but apparently some GNU ld's only accept -v.
761
# Break only if it was the GNU/non-GNU ld that we prefer.
762
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
763
*GNU* | *'with BFD'*)
764
test "$with_gnu_ld" != no && break ;;
766
test "$with_gnu_ld" != yes && break ;;
772
acl_cv_path_LD="$LD" # Let the user override the test with a path.
775
if test -n "$LD"; then
780
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
784
# lib-link.m4 serial 21 (gettext-0.18)
785
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
786
dnl This file is free software; the Free Software Foundation
787
dnl gives unlimited permission to copy and/or distribute it,
788
dnl with or without modifications, as long as this notice is preserved.
790
dnl From Bruno Haible.
794
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
795
dnl the libraries corresponding to explicit and implicit dependencies.
796
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
797
dnl augments the CPPFLAGS variable.
798
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
799
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
800
AC_DEFUN([AC_LIB_LINKFLAGS],
802
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
803
AC_REQUIRE([AC_LIB_RPATH])
804
pushdef([Name],[translit([$1],[./-], [___])])
805
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
806
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
807
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
808
AC_LIB_LINKFLAGS_BODY([$1], [$2])
809
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
810
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
811
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
812
ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
814
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
815
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
816
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
817
LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
818
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
820
AC_SUBST([LTLIB]NAME)
821
AC_SUBST([LIB]NAME[_PREFIX])
822
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
823
dnl results of this search when this library appears as a dependency.
829
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
830
dnl searches for libname and the libraries corresponding to explicit and
831
dnl implicit dependencies, together with the specified include files and
832
dnl the ability to compile and link the specified testcode. The missing-message
833
dnl defaults to 'no' and may contain additional hints for the user.
834
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
835
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
836
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
837
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
838
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
839
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
840
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
842
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
843
AC_REQUIRE([AC_LIB_RPATH])
844
pushdef([Name],[translit([$1],[./-], [___])])
845
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
846
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
848
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
850
AC_LIB_LINKFLAGS_BODY([$1], [$2])
852
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
853
dnl because if the user has installed lib[]Name and not disabled its use
854
dnl via --without-lib[]Name-prefix, he wants to use it.
855
ac_save_CPPFLAGS="$CPPFLAGS"
856
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
858
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
860
dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
861
dnl because these -l options might require -L options that are present in
862
dnl LIBS. -l options benefit only from the -L options listed before it.
863
dnl Otherwise, add it to the front of LIBS, because it may be a static
864
dnl library that depends on another static library that is present in LIBS.
865
dnl Static libraries benefit only from the static libraries listed after
867
case " $LIB[]NAME" in
868
*" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
869
*) LIBS="$LIB[]NAME $LIBS" ;;
871
AC_TRY_LINK([$3], [$4],
872
[ac_cv_lib[]Name=yes],
873
[ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
876
if test "$ac_cv_lib[]Name" = yes; then
878
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
879
AC_MSG_CHECKING([how to link with lib[]$1])
880
AC_MSG_RESULT([$LIB[]NAME])
883
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
884
dnl $INC[]NAME either.
885
CPPFLAGS="$ac_save_CPPFLAGS"
890
AC_SUBST([HAVE_LIB]NAME)
892
AC_SUBST([LTLIB]NAME)
893
AC_SUBST([LIB]NAME[_PREFIX])
898
dnl Determine the platform dependent parameters needed to use rpath:
901
dnl acl_hardcode_libdir_flag_spec,
902
dnl acl_hardcode_libdir_separator,
903
dnl acl_hardcode_direct,
904
dnl acl_hardcode_minus_L.
905
AC_DEFUN([AC_LIB_RPATH],
907
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
908
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
909
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
910
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
911
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
912
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
913
AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
914
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
915
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
921
acl_libext="$acl_cv_libext"
922
acl_shlibext="$acl_cv_shlibext"
923
acl_libname_spec="$acl_cv_libname_spec"
924
acl_library_names_spec="$acl_cv_library_names_spec"
925
acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
926
acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
927
acl_hardcode_direct="$acl_cv_hardcode_direct"
928
acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
929
dnl Determine whether the user wants rpath handling at all.
930
AC_ARG_ENABLE([rpath],
931
[ --disable-rpath do not hardcode runtime library paths],
935
dnl AC_LIB_FROMPACKAGE(name, package)
936
dnl declares that libname comes from the given package. The configure file
937
dnl will then not have a --with-libname-prefix option but a
938
dnl --with-package-prefix option. Several libraries can come from the same
939
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
940
dnl macro call that searches for libname.
941
AC_DEFUN([AC_LIB_FROMPACKAGE],
943
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
944
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
945
define([acl_frompackage_]NAME, [$2])
948
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
949
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
950
define([acl_libsinpackage_]PACKUP,
951
m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
956
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
957
dnl the libraries corresponding to explicit and implicit dependencies.
958
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
959
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
960
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
961
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
963
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
964
pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
965
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
966
pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
967
pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
968
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
969
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
970
dnl Autoconf >= 2.61 supports dots in --with options.
971
pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
972
dnl By default, look in $includedir and $libdir.
974
AC_LIB_WITH_FINAL_PREFIX([
975
eval additional_includedir=\"$includedir\"
976
eval additional_libdir=\"$libdir\"
978
AC_ARG_WITH(P_A_C_K[-prefix],
979
[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
980
--without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
982
if test "X$withval" = "Xno"; then
985
if test "X$withval" = "X"; then
986
AC_LIB_WITH_FINAL_PREFIX([
987
eval additional_includedir=\"$includedir\"
988
eval additional_libdir=\"$libdir\"
991
additional_includedir="$withval/include"
992
additional_libdir="$withval/$acl_libdirstem"
993
if test "$acl_libdirstem2" != "$acl_libdirstem" \
994
&& ! test -d "$withval/$acl_libdirstem"; then
995
additional_libdir="$withval/$acl_libdirstem2"
1000
dnl Search the library and its dependencies in $additional_libdir and
1001
dnl $LDFLAGS. Using breadth-first-seach.
1006
dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
1007
dnl computed. So it has to be reset here.
1011
names_already_handled=
1012
names_next_round='$1 $2'
1013
while test -n "$names_next_round"; do
1014
names_this_round="$names_next_round"
1016
for name in $names_this_round; do
1018
for n in $names_already_handled; do
1019
if test "$n" = "$name"; then
1024
if test -z "$already_handled"; then
1025
names_already_handled="$names_already_handled $name"
1026
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1027
dnl or AC_LIB_HAVE_LINKFLAGS call.
1028
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1029
eval value=\"\$HAVE_LIB$uppername\"
1030
if test -n "$value"; then
1031
if test "$value" = yes; then
1032
eval value=\"\$LIB$uppername\"
1033
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1034
eval value=\"\$LTLIB$uppername\"
1035
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1037
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1038
dnl that this library doesn't exist. So just drop it.
1042
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1043
dnl and the already constructed $LIBNAME/$LTLIBNAME.
1048
eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
1049
if test -n "$acl_shlibext"; then
1050
shrext=".$acl_shlibext" # typically: shrext=.so
1054
if test $use_additional = yes; then
1055
dir="$additional_libdir"
1056
dnl The same code as in the loop below:
1057
dnl First look for a shared library.
1058
if test -n "$acl_shlibext"; then
1059
if test -f "$dir/$libname$shrext"; then
1061
found_so="$dir/$libname$shrext"
1063
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1064
ver=`(cd "$dir" && \
1065
for f in "$libname$shrext".*; do echo "$f"; done \
1066
| sed -e "s,^$libname$shrext\\\\.,," \
1067
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1068
| sed 1q ) 2>/dev/null`
1069
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1071
found_so="$dir/$libname$shrext.$ver"
1074
eval library_names=\"$acl_library_names_spec\"
1075
for f in $library_names; do
1076
if test -f "$dir/$f"; then
1085
dnl Then look for a static library.
1086
if test "X$found_dir" = "X"; then
1087
if test -f "$dir/$libname.$acl_libext"; then
1089
found_a="$dir/$libname.$acl_libext"
1092
if test "X$found_dir" != "X"; then
1093
if test -f "$dir/$libname.la"; then
1094
found_la="$dir/$libname.la"
1098
if test "X$found_dir" = "X"; then
1099
for x in $LDFLAGS $LTLIB[]NAME; do
1100
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1103
dir=`echo "X$x" | sed -e 's/^X-L//'`
1104
dnl First look for a shared library.
1105
if test -n "$acl_shlibext"; then
1106
if test -f "$dir/$libname$shrext"; then
1108
found_so="$dir/$libname$shrext"
1110
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1111
ver=`(cd "$dir" && \
1112
for f in "$libname$shrext".*; do echo "$f"; done \
1113
| sed -e "s,^$libname$shrext\\\\.,," \
1114
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1115
| sed 1q ) 2>/dev/null`
1116
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1118
found_so="$dir/$libname$shrext.$ver"
1121
eval library_names=\"$acl_library_names_spec\"
1122
for f in $library_names; do
1123
if test -f "$dir/$f"; then
1132
dnl Then look for a static library.
1133
if test "X$found_dir" = "X"; then
1134
if test -f "$dir/$libname.$acl_libext"; then
1136
found_a="$dir/$libname.$acl_libext"
1139
if test "X$found_dir" != "X"; then
1140
if test -f "$dir/$libname.la"; then
1141
found_la="$dir/$libname.la"
1146
if test "X$found_dir" != "X"; then
1151
if test "X$found_dir" != "X"; then
1152
dnl Found the library.
1153
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1154
if test "X$found_so" != "X"; then
1155
dnl Linking with a shared library. We attempt to hardcode its
1156
dnl directory into the executable's runpath, unless it's the
1157
dnl standard /usr/lib.
1158
if test "$enable_rpath" = no \
1159
|| test "X$found_dir" = "X/usr/$acl_libdirstem" \
1160
|| test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
1161
dnl No hardcoding is needed.
1162
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1164
dnl Use an explicit option to hardcode DIR into the resulting
1166
dnl Potentially add DIR to ltrpathdirs.
1167
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1169
for x in $ltrpathdirs; do
1170
if test "X$x" = "X$found_dir"; then
1175
if test -z "$haveit"; then
1176
ltrpathdirs="$ltrpathdirs $found_dir"
1178
dnl The hardcoding into $LIBNAME is system dependent.
1179
if test "$acl_hardcode_direct" = yes; then
1180
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1181
dnl resulting binary.
1182
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1184
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1185
dnl Use an explicit option to hardcode DIR into the resulting
1187
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1188
dnl Potentially add DIR to rpathdirs.
1189
dnl The rpathdirs will be appended to $LIBNAME at the end.
1191
for x in $rpathdirs; do
1192
if test "X$x" = "X$found_dir"; then
1197
if test -z "$haveit"; then
1198
rpathdirs="$rpathdirs $found_dir"
1201
dnl Rely on "-L$found_dir".
1202
dnl But don't add it if it's already contained in the LDFLAGS
1203
dnl or the already constructed $LIBNAME
1205
for x in $LDFLAGS $LIB[]NAME; do
1206
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1207
if test "X$x" = "X-L$found_dir"; then
1212
if test -z "$haveit"; then
1213
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1215
if test "$acl_hardcode_minus_L" != no; then
1216
dnl FIXME: Not sure whether we should use
1217
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1219
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1221
dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1222
dnl here, because this doesn't fit in flags passed to the
1223
dnl compiler. So give up. No hardcoding. This affects only
1224
dnl very old systems.
1225
dnl FIXME: Not sure whether we should use
1226
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1228
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1234
if test "X$found_a" != "X"; then
1235
dnl Linking with a static library.
1236
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1238
dnl We shouldn't come here, but anyway it's good to have a
1240
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1243
dnl Assume the include files are nearby.
1244
additional_includedir=
1245
case "$found_dir" in
1246
*/$acl_libdirstem | */$acl_libdirstem/)
1247
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1248
if test "$name" = '$1'; then
1249
LIB[]NAME[]_PREFIX="$basedir"
1251
additional_includedir="$basedir/include"
1253
*/$acl_libdirstem2 | */$acl_libdirstem2/)
1254
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
1255
if test "$name" = '$1'; then
1256
LIB[]NAME[]_PREFIX="$basedir"
1258
additional_includedir="$basedir/include"
1261
if test "X$additional_includedir" != "X"; then
1262
dnl Potentially add $additional_includedir to $INCNAME.
1263
dnl But don't add it
1264
dnl 1. if it's the standard /usr/include,
1265
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1266
dnl 3. if it's already present in $CPPFLAGS or the already
1267
dnl constructed $INCNAME,
1268
dnl 4. if it doesn't exist as a directory.
1269
if test "X$additional_includedir" != "X/usr/include"; then
1271
if test "X$additional_includedir" = "X/usr/local/include"; then
1272
if test -n "$GCC"; then
1274
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1278
if test -z "$haveit"; then
1279
for x in $CPPFLAGS $INC[]NAME; do
1280
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1281
if test "X$x" = "X-I$additional_includedir"; then
1286
if test -z "$haveit"; then
1287
if test -d "$additional_includedir"; then
1288
dnl Really add $additional_includedir to $INCNAME.
1289
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1295
dnl Look for dependencies.
1296
if test -n "$found_la"; then
1297
dnl Read the .la file. It defines the variables
1298
dnl dlname, library_names, old_library, dependency_libs, current,
1299
dnl age, revision, installed, dlopen, dlpreopen, libdir.
1300
save_libdir="$libdir"
1302
*/* | *\\*) . "$found_la" ;;
1303
*) . "./$found_la" ;;
1305
libdir="$save_libdir"
1306
dnl We use only dependency_libs.
1307
for dep in $dependency_libs; do
1310
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1311
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1312
dnl But don't add it
1313
dnl 1. if it's the standard /usr/lib,
1314
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1315
dnl 3. if it's already present in $LDFLAGS or the already
1316
dnl constructed $LIBNAME,
1317
dnl 4. if it doesn't exist as a directory.
1318
if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
1319
&& test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
1321
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
1322
|| test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
1323
if test -n "$GCC"; then
1325
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1329
if test -z "$haveit"; then
1331
for x in $LDFLAGS $LIB[]NAME; do
1332
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1333
if test "X$x" = "X-L$additional_libdir"; then
1338
if test -z "$haveit"; then
1339
if test -d "$additional_libdir"; then
1340
dnl Really add $additional_libdir to $LIBNAME.
1341
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1345
for x in $LDFLAGS $LTLIB[]NAME; do
1346
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1347
if test "X$x" = "X-L$additional_libdir"; then
1352
if test -z "$haveit"; then
1353
if test -d "$additional_libdir"; then
1354
dnl Really add $additional_libdir to $LTLIBNAME.
1355
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1362
dir=`echo "X$dep" | sed -e 's/^X-R//'`
1363
if test "$enable_rpath" != no; then
1364
dnl Potentially add DIR to rpathdirs.
1365
dnl The rpathdirs will be appended to $LIBNAME at the end.
1367
for x in $rpathdirs; do
1368
if test "X$x" = "X$dir"; then
1373
if test -z "$haveit"; then
1374
rpathdirs="$rpathdirs $dir"
1376
dnl Potentially add DIR to ltrpathdirs.
1377
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1379
for x in $ltrpathdirs; do
1380
if test "X$x" = "X$dir"; then
1385
if test -z "$haveit"; then
1386
ltrpathdirs="$ltrpathdirs $dir"
1391
dnl Handle this in the next round.
1392
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1395
dnl Handle this in the next round. Throw away the .la's
1396
dnl directory; it is already contained in a preceding -L
1398
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1401
dnl Most likely an immediate library name.
1402
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1403
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1409
dnl Didn't find the library; assume it is in the system directories
1410
dnl known to the linker and runtime loader. (All the system
1411
dnl directories known to the linker should also be known to the
1412
dnl runtime loader, otherwise the system is severely misconfigured.)
1413
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1414
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1420
if test "X$rpathdirs" != "X"; then
1421
if test -n "$acl_hardcode_libdir_separator"; then
1422
dnl Weird platform: only the last -rpath option counts, the user must
1423
dnl pass all path elements in one option. We can arrange that for a
1424
dnl single library, but not when more than one $LIBNAMEs are used.
1426
for found_dir in $rpathdirs; do
1427
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1429
dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1430
acl_save_libdir="$libdir"
1432
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1433
libdir="$acl_save_libdir"
1434
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1436
dnl The -rpath options are cumulative.
1437
for found_dir in $rpathdirs; do
1438
acl_save_libdir="$libdir"
1440
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1441
libdir="$acl_save_libdir"
1442
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1446
if test "X$ltrpathdirs" != "X"; then
1447
dnl When using libtool, the option that works for both libraries and
1448
dnl executables is -R. The -R options are cumulative.
1449
for found_dir in $ltrpathdirs; do
1450
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1460
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1461
dnl unless already present in VAR.
1462
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1463
dnl contains two or three consecutive elements that belong together.
1464
AC_DEFUN([AC_LIB_APPENDTOVAR],
1466
for element in [$2]; do
1469
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1470
if test "X$x" = "X$element"; then
1475
if test -z "$haveit"; then
1476
[$1]="${[$1]}${[$1]:+ }$element"
1481
dnl For those cases where a variable contains several -L and -l options
1482
dnl referring to unknown libraries and directories, this macro determines the
1483
dnl necessary additional linker options for the runtime path.
1484
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1485
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1486
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1487
dnl otherwise linking without libtool is assumed.
1488
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1490
AC_REQUIRE([AC_LIB_RPATH])
1491
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1493
if test "$enable_rpath" != no; then
1494
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1495
dnl Use an explicit option to hardcode directories into the resulting
1500
if test -n "$next"; then
1502
dnl No need to hardcode the standard /usr/lib.
1503
if test "X$dir" != "X/usr/$acl_libdirstem" \
1504
&& test "X$dir" != "X/usr/$acl_libdirstem2"; then
1505
rpathdirs="$rpathdirs $dir"
1511
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1512
dnl No need to hardcode the standard /usr/lib.
1513
if test "X$dir" != "X/usr/$acl_libdirstem" \
1514
&& test "X$dir" != "X/usr/$acl_libdirstem2"; then
1515
rpathdirs="$rpathdirs $dir"
1522
if test "X$rpathdirs" != "X"; then
1523
if test -n ""$3""; then
1524
dnl libtool is used for linking. Use -R options.
1525
for dir in $rpathdirs; do
1526
$1="${$1}${$1:+ }-R$dir"
1529
dnl The linker is used for linking directly.
1530
if test -n "$acl_hardcode_libdir_separator"; then
1531
dnl Weird platform: only the last -rpath option counts, the user
1532
dnl must pass all path elements in one option.
1534
for dir in $rpathdirs; do
1535
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1537
acl_save_libdir="$libdir"
1539
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1540
libdir="$acl_save_libdir"
1543
dnl The -rpath options are cumulative.
1544
for dir in $rpathdirs; do
1545
acl_save_libdir="$libdir"
1547
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1548
libdir="$acl_save_libdir"
1549
$1="${$1}${$1:+ }$flag"
1559
# lib-prefix.m4 serial 7 (gettext-0.18)
1560
dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
1561
dnl This file is free software; the Free Software Foundation
1562
dnl gives unlimited permission to copy and/or distribute it,
1563
dnl with or without modifications, as long as this notice is preserved.
1565
dnl From Bruno Haible.
1567
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1568
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1569
dnl require excessive bracketing.
1570
ifdef([AC_HELP_STRING],
1571
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1572
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1574
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1575
dnl to access previously installed libraries. The basic assumption is that
1576
dnl a user will want packages to use other packages he previously installed
1577
dnl with the same --prefix option.
1578
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1579
dnl libraries, but is otherwise very convenient.
1580
AC_DEFUN([AC_LIB_PREFIX],
1582
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1583
AC_REQUIRE([AC_PROG_CC])
1584
AC_REQUIRE([AC_CANONICAL_HOST])
1585
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1586
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1587
dnl By default, look in $includedir and $libdir.
1589
AC_LIB_WITH_FINAL_PREFIX([
1590
eval additional_includedir=\"$includedir\"
1591
eval additional_libdir=\"$libdir\"
1593
AC_LIB_ARG_WITH([lib-prefix],
1594
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1595
--without-lib-prefix don't search for libraries in includedir and libdir],
1597
if test "X$withval" = "Xno"; then
1600
if test "X$withval" = "X"; then
1601
AC_LIB_WITH_FINAL_PREFIX([
1602
eval additional_includedir=\"$includedir\"
1603
eval additional_libdir=\"$libdir\"
1606
additional_includedir="$withval/include"
1607
additional_libdir="$withval/$acl_libdirstem"
1611
if test $use_additional = yes; then
1612
dnl Potentially add $additional_includedir to $CPPFLAGS.
1613
dnl But don't add it
1614
dnl 1. if it's the standard /usr/include,
1615
dnl 2. if it's already present in $CPPFLAGS,
1616
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1617
dnl 4. if it doesn't exist as a directory.
1618
if test "X$additional_includedir" != "X/usr/include"; then
1620
for x in $CPPFLAGS; do
1621
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1622
if test "X$x" = "X-I$additional_includedir"; then
1627
if test -z "$haveit"; then
1628
if test "X$additional_includedir" = "X/usr/local/include"; then
1629
if test -n "$GCC"; then
1631
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1635
if test -z "$haveit"; then
1636
if test -d "$additional_includedir"; then
1637
dnl Really add $additional_includedir to $CPPFLAGS.
1638
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1643
dnl Potentially add $additional_libdir to $LDFLAGS.
1644
dnl But don't add it
1645
dnl 1. if it's the standard /usr/lib,
1646
dnl 2. if it's already present in $LDFLAGS,
1647
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1648
dnl 4. if it doesn't exist as a directory.
1649
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1651
for x in $LDFLAGS; do
1652
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1653
if test "X$x" = "X-L$additional_libdir"; then
1658
if test -z "$haveit"; then
1659
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1660
if test -n "$GCC"; then
1662
linux*) haveit=yes;;
1666
if test -z "$haveit"; then
1667
if test -d "$additional_libdir"; then
1668
dnl Really add $additional_libdir to $LDFLAGS.
1669
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1677
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1678
dnl acl_final_exec_prefix, containing the values to which $prefix and
1679
dnl $exec_prefix will expand at the end of the configure script.
1680
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1682
dnl Unfortunately, prefix and exec_prefix get only finally determined
1683
dnl at the end of configure.
1684
if test "X$prefix" = "XNONE"; then
1685
acl_final_prefix="$ac_default_prefix"
1687
acl_final_prefix="$prefix"
1689
if test "X$exec_prefix" = "XNONE"; then
1690
acl_final_exec_prefix='${prefix}'
1692
acl_final_exec_prefix="$exec_prefix"
1694
acl_save_prefix="$prefix"
1695
prefix="$acl_final_prefix"
1696
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1697
prefix="$acl_save_prefix"
1700
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1701
dnl variables prefix and exec_prefix bound to the values they will have
1702
dnl at the end of the configure script.
1703
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1705
acl_save_prefix="$prefix"
1706
prefix="$acl_final_prefix"
1707
acl_save_exec_prefix="$exec_prefix"
1708
exec_prefix="$acl_final_exec_prefix"
1710
exec_prefix="$acl_save_exec_prefix"
1711
prefix="$acl_save_prefix"
1714
dnl AC_LIB_PREPARE_MULTILIB creates
1715
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1716
dnl "lib" or "lib64" or "lib/64",
1717
dnl - a variable acl_libdirstem2, as a secondary possible value for
1718
dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1720
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1722
dnl There is no formal standard regarding lib and lib64.
1723
dnl On glibc systems, the current practice is that on a system supporting
1724
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1725
dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1726
dnl the compiler's default mode by looking at the compiler's library search
1727
dnl path. If at least one of its elements ends in /lib64 or points to a
1728
dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1729
dnl Otherwise we use the default, namely "lib".
1730
dnl On Solaris systems, the current practice is that on a system supporting
1731
dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1732
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1733
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1734
AC_REQUIRE([AC_CANONICAL_HOST])
1739
dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1740
dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1741
dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1742
dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1743
dnl symlink is missing, so we set acl_libdirstem2 too.
1744
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1745
[AC_EGREP_CPP([sixtyfour bits], [
1749
], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1751
if test $gl_cv_solaris_64bit = yes; then
1752
acl_libdirstem=lib/64
1754
sparc*) acl_libdirstem2=lib/sparcv9 ;;
1755
i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1760
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1761
if test -n "$searchpath"; then
1762
acl_save_IFS="${IFS= }"; IFS=":"
1763
for searchdir in $searchpath; do
1764
if test -d "$searchdir"; then
1765
case "$searchdir" in
1766
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1768
# Better ignore directories of this form. They are misleading.
1770
*) searchdir=`cd "$searchdir" && pwd`
1771
case "$searchdir" in
1772
*/lib64 ) acl_libdirstem=lib64 ;;
1781
test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1784
# nls.m4 serial 5 (gettext-0.18)
1785
dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
1787
dnl This file is free software; the Free Software Foundation
1788
dnl gives unlimited permission to copy and/or distribute it,
1789
dnl with or without modifications, as long as this notice is preserved.
1791
dnl This file can can be used in projects which are not available under
1792
dnl the GNU General Public License or the GNU Library General Public
1793
dnl License but which still want to provide support for the GNU gettext
1795
dnl Please note that the actual code of the GNU gettext library is covered
1796
dnl by the GNU Library General Public License, and the rest of the GNU
1797
dnl gettext package package is covered by the GNU General Public License.
1798
dnl They are *not* in the public domain.
1801
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1802
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1808
AC_MSG_CHECKING([whether NLS is requested])
1809
dnl Default is enabled NLS
1810
AC_ARG_ENABLE([nls],
1811
[ --disable-nls do not use Native Language Support],
1812
USE_NLS=$enableval, USE_NLS=yes)
1813
AC_MSG_RESULT([$USE_NLS])
1817
# po.m4 serial 17 (gettext-0.18)
1818
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
1819
dnl This file is free software; the Free Software Foundation
1820
dnl gives unlimited permission to copy and/or distribute it,
1821
dnl with or without modifications, as long as this notice is preserved.
1823
dnl This file can can be used in projects which are not available under
1824
dnl the GNU General Public License or the GNU Library General Public
1825
dnl License but which still want to provide support for the GNU gettext
1827
dnl Please note that the actual code of the GNU gettext library is covered
1828
dnl by the GNU Library General Public License, and the rest of the GNU
1829
dnl gettext package package is covered by the GNU General Public License.
1830
dnl They are *not* in the public domain.
1833
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1834
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1838
dnl Checks for all prerequisites of the po subdirectory.
1839
AC_DEFUN([AM_PO_SUBDIRS],
1841
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1842
AC_REQUIRE([AC_PROG_INSTALL])dnl
1843
AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
1844
AC_REQUIRE([AM_NLS])dnl
1846
dnl Release version of the gettext macros. This is used to ensure that
1847
dnl the gettext macros and po/Makefile.in.in are in sync.
1848
AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
1850
dnl Perform the following tests also if --disable-nls has been given,
1851
dnl because they are needed for "make dist" to work.
1853
dnl Search for GNU msgfmt in the PATH.
1854
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1855
dnl The second test excludes FreeBSD msgfmt.
1856
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1857
[$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1858
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1860
AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
1862
dnl Test whether it is GNU msgfmt >= 0.15.
1864
case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1865
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
1866
*) MSGFMT_015=$MSGFMT ;;
1869
AC_SUBST([MSGFMT_015])
1871
case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1872
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
1873
*) GMSGFMT_015=$GMSGFMT ;;
1876
AC_SUBST([GMSGFMT_015])
1878
dnl Search for GNU xgettext 0.12 or newer in the PATH.
1879
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1880
dnl The second test excludes FreeBSD xgettext.
1881
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1882
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
1883
(if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1885
dnl Remove leftover from FreeBSD xgettext call.
1888
dnl Test whether it is GNU xgettext >= 0.15.
1890
case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
1891
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
1892
*) XGETTEXT_015=$XGETTEXT ;;
1895
AC_SUBST([XGETTEXT_015])
1897
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1898
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1899
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
1901
dnl Installation directories.
1902
dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
1903
dnl have to define it here, so that it can be used in po/Makefile.
1904
test -n "$localedir" || localedir='${datadir}/locale'
1905
AC_SUBST([localedir])
1907
dnl Support for AM_XGETTEXT_OPTION.
1908
test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
1909
AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
1911
AC_CONFIG_COMMANDS([po-directories], [[
1912
for ac_file in $CONFIG_FILES; do
1913
# Support "outfile[:infile[:infile...]]"
1915
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1917
# PO directories have a Makefile.in generated from Makefile.in.in.
1918
case "$ac_file" in */Makefile.in)
1919
# Adjust a relative srcdir.
1920
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1921
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1922
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1923
# In autoconf-2.13 it is called $ac_given_srcdir.
1924
# In autoconf-2.50 it is called $srcdir.
1925
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1926
case "$ac_given_srcdir" in
1927
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1928
/*) top_srcdir="$ac_given_srcdir" ;;
1929
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1931
# Treat a directory as a PO directory if and only if it has a
1932
# POTFILES.in file. This allows packages to have multiple PO
1933
# directories under different names or in different locations.
1934
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1935
rm -f "$ac_dir/POTFILES"
1936
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1937
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1938
POMAKEFILEDEPS="POTFILES.in"
1939
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
1940
# on $ac_dir but don't depend on user-specified configuration
1942
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1943
# The LINGUAS file contains the set of available languages.
1944
if test -n "$OBSOLETE_ALL_LINGUAS"; then
1945
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1947
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1948
# Hide the ALL_LINGUAS assigment from automake < 1.5.
1949
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1950
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1952
# The set of available languages was given in configure.in.
1953
# Hide the ALL_LINGUAS assigment from automake < 1.5.
1954
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1957
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1958
# Compute UPDATEPOFILES
1959
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1960
# Compute DUMMYPOFILES
1961
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1963
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1964
case "$ac_given_srcdir" in
1966
*) srcdirpre='$(srcdir)/' ;;
1972
for lang in $ALL_LINGUAS; do
1973
POFILES="$POFILES $srcdirpre$lang.po"
1974
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1975
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1976
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1978
# CATALOGS depends on both $ac_dir and the user's LINGUAS
1979
# environment variable.
1981
if test -n "$ALL_LINGUAS"; then
1982
for presentlang in $ALL_LINGUAS; do
1984
if test "%UNSET%" != "$LINGUAS"; then
1985
desiredlanguages="$LINGUAS"
1987
desiredlanguages="$ALL_LINGUAS"
1989
for desiredlang in $desiredlanguages; do
1990
# Use the presentlang catalog if desiredlang is
1991
# a. equal to presentlang, or
1992
# b. a variant of presentlang (because in this case,
1993
# presentlang can be used as a fallback for messages
1994
# which are not translated in the desiredlang catalog).
1995
case "$desiredlang" in
1996
"$presentlang"*) useit=yes;;
1999
if test $useit = yes; then
2000
INST_LINGUAS="$INST_LINGUAS $presentlang"
2005
if test -n "$INST_LINGUAS"; then
2006
for lang in $INST_LINGUAS; do
2007
CATALOGS="$CATALOGS $lang.gmo"
2010
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2011
sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
2012
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2013
if test -f "$f"; then
2015
*.orig | *.bak | *~) ;;
2016
*) cat "$f" >> "$ac_dir/Makefile" ;;
2024
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2025
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2026
# from automake < 1.5.
2027
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2028
# Capture the value of LINGUAS because we need it to compute CATALOGS.
2029
LINGUAS="${LINGUAS-%UNSET%}"
2033
dnl Postprocesses a Makefile in a directory containing PO files.
2034
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2036
# When this code is run, in config.status, two variables have already been
2038
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2039
# - LINGUAS is the value of the environment variable LINGUAS at configure
2043
# Adjust a relative srcdir.
2044
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2045
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2046
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2047
# In autoconf-2.13 it is called $ac_given_srcdir.
2048
# In autoconf-2.50 it is called $srcdir.
2049
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2050
case "$ac_given_srcdir" in
2051
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2052
/*) top_srcdir="$ac_given_srcdir" ;;
2053
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2056
# Find a way to echo strings without interpreting backslash.
2057
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2060
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2061
gt_echo='printf %s\n'
2072
# A sed script that extracts the value of VARIABLE from a Makefile.
2074
# Test if the hold space is empty.
2079
# Yes it was empty. Look if we have the expected variable definition.
2080
/^[ ]*VARIABLE[ ]*=/{
2081
# Seen the first line of the variable definition.
2082
s/^[ ]*VARIABLE[ ]*=//
2087
# Here we are processing a line from the variable definition.
2088
# Remove comment, more precisely replace it with a space.
2090
# See if the line ends in a backslash.
2094
# Print the line, without the trailing backslash.
2097
# There was no trailing backslash. The end of the variable definition is
2098
# reached. Clear the hold space.
2103
# A trailing backslash means that the variable definition continues in the
2104
# next line. Put a nonempty string into the hold space to indicate this.
2111
# Set POTFILES to the value of the Makefile variable POTFILES.
2112
sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2113
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2114
# Compute POTFILES_DEPS as
2115
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2117
for file in $POTFILES; do
2118
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2122
if test -n "$OBSOLETE_ALL_LINGUAS"; then
2123
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2125
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2126
# The LINGUAS file contains the set of available languages.
2127
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2128
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2130
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2131
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2132
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2134
# Hide the ALL_LINGUAS assigment from automake < 1.5.
2135
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2137
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2138
# Compute UPDATEPOFILES
2139
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2140
# Compute DUMMYPOFILES
2141
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2143
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2144
# Compute PROPERTIESFILES
2145
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2146
# Compute CLASSFILES
2147
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2149
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2151
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2152
# Compute RESOURCESDLLFILES
2153
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2154
case "$ac_given_srcdir" in
2156
*) srcdirpre='$(srcdir)/' ;;
2167
for lang in $ALL_LINGUAS; do
2168
POFILES="$POFILES $srcdirpre$lang.po"
2169
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2170
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2171
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2172
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2173
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2174
QMFILES="$QMFILES $srcdirpre$lang.qm"
2175
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2176
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2177
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2178
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2180
# CATALOGS depends on both $ac_dir and the user's LINGUAS
2181
# environment variable.
2183
if test -n "$ALL_LINGUAS"; then
2184
for presentlang in $ALL_LINGUAS; do
2186
if test "%UNSET%" != "$LINGUAS"; then
2187
desiredlanguages="$LINGUAS"
2189
desiredlanguages="$ALL_LINGUAS"
2191
for desiredlang in $desiredlanguages; do
2192
# Use the presentlang catalog if desiredlang is
2193
# a. equal to presentlang, or
2194
# b. a variant of presentlang (because in this case,
2195
# presentlang can be used as a fallback for messages
2196
# which are not translated in the desiredlang catalog).
2197
case "$desiredlang" in
2198
"$presentlang"*) useit=yes;;
2201
if test $useit = yes; then
2202
INST_LINGUAS="$INST_LINGUAS $presentlang"
2211
if test -n "$INST_LINGUAS"; then
2212
for lang in $INST_LINGUAS; do
2213
CATALOGS="$CATALOGS $lang.gmo"
2214
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2215
QTCATALOGS="$QTCATALOGS $lang.qm"
2216
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2217
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2218
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2219
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2223
sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
2224
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2225
# Add dependencies that cannot be formulated as a simple suffix rule.
2226
for lang in $ALL_LINGUAS; do
2227
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2228
cat >> "$ac_file.tmp" <<EOF
2229
$frobbedlang.msg: $lang.po
2230
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2231
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2235
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2236
# Add dependencies that cannot be formulated as a simple suffix rule.
2237
for lang in $ALL_LINGUAS; do
2238
frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
2239
cat >> "$ac_file.tmp" <<EOF
2240
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2241
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2242
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2246
if test -n "$POMAKEFILEDEPS"; then
2247
cat >> "$ac_file.tmp" <<EOF
2248
Makefile: $POMAKEFILEDEPS
2251
mv "$ac_file.tmp" "$ac_file"
2254
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2255
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2257
XGETTEXT_EXTRA_OPTIONS=
2260
dnl Registers an option to be passed to xgettext in the po subdirectory.
2261
AC_DEFUN([AM_XGETTEXT_OPTION],
2263
AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2264
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
2267
# progtest.m4 serial 6 (gettext-0.18)
2268
dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
2269
dnl This file is free software; the Free Software Foundation
2270
dnl gives unlimited permission to copy and/or distribute it,
2271
dnl with or without modifications, as long as this notice is preserved.
2273
dnl This file can can be used in projects which are not available under
2274
dnl the GNU General Public License or the GNU Library General Public
2275
dnl License but which still want to provide support for the GNU gettext
2277
dnl Please note that the actual code of the GNU gettext library is covered
2278
dnl by the GNU Library General Public License, and the rest of the GNU
2279
dnl gettext package package is covered by the GNU General Public License.
2280
dnl They are *not* in the public domain.
2283
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2287
# Search path for a program which passes the given test.
2289
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2290
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2291
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2293
# Prepare PATH_SEPARATOR.
2294
# The user is always right.
2295
if test "${PATH_SEPARATOR+set}" != set; then
2296
echo "#! /bin/sh" >conf$$.sh
2297
echo "exit 0" >>conf$$.sh
2299
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2307
# Find out how to test for executable files. Don't use a zero-byte file,
2308
# as systems may use methods other than mode bits to determine executability.
2309
cat >conf$$.file <<_ASEOF
2313
chmod +x conf$$.file
2314
if test -x conf$$.file >/dev/null 2>&1; then
2315
ac_executable_p="test -x"
2317
ac_executable_p="test -f"
2321
# Extract the first word of "$2", so it can be a program name with args.
2322
set dummy $2; ac_word=[$]2
2323
AC_MSG_CHECKING([for $ac_word])
2324
AC_CACHE_VAL([ac_cv_path_$1],
2326
[[\\/]]* | ?:[[\\/]]*)
2327
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2330
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2331
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2333
test -z "$ac_dir" && ac_dir=.
2334
for ac_exec_ext in '' $ac_executable_extensions; do
2335
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2336
echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2338
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2345
dnl If no 4th arg is given, leave the cache variable unset,
2346
dnl so AC_PATH_PROGS will keep looking.
2347
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2352
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2353
AC_MSG_RESULT([$][$1])
2360
22
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
2362
24
# This file is free software; the Free Software Foundation