164
# gettext.m4 serial 60 (gettext-0.17)
165
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
166
dnl This file is free software; the Free Software Foundation
167
dnl gives unlimited permission to copy and/or distribute it,
168
dnl with or without modifications, as long as this notice is preserved.
170
dnl This file can can be used in projects which are not available under
171
dnl the GNU General Public License or the GNU Library General Public
172
dnl License but which still want to provide support for the GNU gettext
174
dnl Please note that the actual code of the GNU gettext library is covered
175
dnl by the GNU Library General Public License, and the rest of the GNU
176
dnl gettext package package is covered by the GNU General Public License.
177
dnl They are *not* in the public domain.
180
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
181
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
183
dnl Macro to add for using GNU gettext.
185
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
186
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
187
dnl default (if it is not specified or empty) is 'no-libtool'.
188
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
189
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
190
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
191
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
192
dnl depending on --{enable,disable}-{shared,static} and on the presence of
193
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
194
dnl $(top_builddir)/intl/libintl.a will be created.
195
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
196
dnl implementations (in libc or libintl) without the ngettext() function
197
dnl will be ignored. If NEEDSYMBOL is specified and is
198
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
199
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
200
dnl INTLDIR is used to find the intl libraries. If empty,
201
dnl the value `$(top_builddir)/intl/' is used.
203
dnl The result of the configuration is one of three cases:
204
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
206
dnl Catalog format: GNU --> install in $(datadir)
207
dnl Catalog extension: .mo after installation, .gmo in source tree
208
dnl 2) GNU gettext has been found in the system's C library.
209
dnl Catalog format: GNU --> install in $(datadir)
210
dnl Catalog extension: .mo after installation, .gmo in source tree
211
dnl 3) No internationalization, always use English msgid.
212
dnl Catalog format: none
213
dnl Catalog extension: none
214
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
215
dnl The use of .gmo is historical (it was needed to avoid overwriting the
216
dnl GNU format catalogs when building on a platform with an X/Open gettext),
217
dnl but we keep it in order not to force irrelevant filename changes on the
220
AC_DEFUN([AM_GNU_GETTEXT],
222
dnl Argument checking.
223
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
224
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
226
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
227
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
229
define([gt_included_intl],
230
ifelse([$1], [external],
231
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
233
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
235
AM_GNU_GETTEXT_NEED([$2])
237
AC_REQUIRE([AM_PO_SUBDIRS])dnl
238
ifelse(gt_included_intl, yes, [
239
AC_REQUIRE([AM_INTL_SUBDIR])dnl
242
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
243
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
244
AC_REQUIRE([AC_LIB_RPATH])
246
dnl Sometimes libintl requires libiconv, so first search for libiconv.
247
dnl Ideally we would do this search only after the
248
dnl if test "$USE_NLS" = "yes"; then
249
dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
250
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
251
dnl the configure script would need to contain the same shell code
252
dnl again, outside any 'if'. There are two solutions:
253
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
254
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
255
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
256
dnl documented, we avoid it.
257
ifelse(gt_included_intl, yes, , [
258
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
261
dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
267
ifelse(gt_included_intl, yes, [
268
BUILD_INCLUDED_LIBINTL=no
269
USE_INCLUDED_LIBINTL=no
275
dnl Add a version number to the cache macros.
276
case " $gt_needs " in
277
*" need-formatstring-macros "*) gt_api_version=3 ;;
278
*" need-ngettext "*) gt_api_version=2 ;;
279
*) gt_api_version=1 ;;
281
gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
282
gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
284
dnl If we use NLS figure out what method
285
if test "$USE_NLS" = "yes"; then
286
gt_use_preinstalled_gnugettext=no
287
ifelse(gt_included_intl, yes, [
288
AC_MSG_CHECKING([whether included gettext is requested])
289
AC_ARG_WITH(included-gettext,
290
[ --with-included-gettext use the GNU gettext library included here],
291
nls_cv_force_use_gnu_gettext=$withval,
292
nls_cv_force_use_gnu_gettext=no)
293
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
295
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
296
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
298
dnl User does not insist on using GNU NLS library. Figure out what
299
dnl to use. If GNU gettext is available we use this. Else we have
300
dnl to fall back to GNU NLS library.
302
if test $gt_api_version -ge 3; then
303
gt_revision_test_code='
304
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
305
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
308
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
312
gt_revision_test_code=
314
if test $gt_api_version -ge 2; then
315
gt_expression_test_code=' + * ngettext ("", "", 0)'
317
gt_expression_test_code=
320
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
321
[AC_TRY_LINK([#include <libintl.h>
322
$gt_revision_test_code
323
extern int _nl_msg_cat_cntr;
324
extern int *_nl_domain_bindings;],
325
[bindtextdomain ("", "");
326
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
327
[eval "$gt_func_gnugettext_libc=yes"],
328
[eval "$gt_func_gnugettext_libc=no"])])
330
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
331
dnl Sometimes libintl requires libiconv, so first search for libiconv.
332
ifelse(gt_included_intl, yes, , [
335
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
336
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
337
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
338
dnl even if libiconv doesn't exist.
339
AC_LIB_LINKFLAGS_BODY([intl])
340
AC_CACHE_CHECK([for GNU gettext in libintl],
341
[$gt_func_gnugettext_libintl],
342
[gt_save_CPPFLAGS="$CPPFLAGS"
343
CPPFLAGS="$CPPFLAGS $INCINTL"
345
LIBS="$LIBS $LIBINTL"
346
dnl Now see whether libintl exists and does not depend on libiconv.
347
AC_TRY_LINK([#include <libintl.h>
348
$gt_revision_test_code
349
extern int _nl_msg_cat_cntr;
354
const char *_nl_expand_alias (const char *);],
355
[bindtextdomain ("", "");
356
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
357
[eval "$gt_func_gnugettext_libintl=yes"],
358
[eval "$gt_func_gnugettext_libintl=no"])
359
dnl Now see whether libintl exists and depends on libiconv.
360
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
361
LIBS="$LIBS $LIBICONV"
362
AC_TRY_LINK([#include <libintl.h>
363
$gt_revision_test_code
364
extern int _nl_msg_cat_cntr;
369
const char *_nl_expand_alias (const char *);],
370
[bindtextdomain ("", "");
371
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
372
[LIBINTL="$LIBINTL $LIBICONV"
373
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
374
eval "$gt_func_gnugettext_libintl=yes"
377
CPPFLAGS="$gt_save_CPPFLAGS"
378
LIBS="$gt_save_LIBS"])
381
dnl If an already present or preinstalled GNU gettext() is found,
382
dnl use it. But if this macro is used in GNU gettext, and GNU
383
dnl gettext is already preinstalled in libintl, we update this
384
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
385
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
386
|| { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
387
&& test "$PACKAGE" != gettext-runtime \
388
&& test "$PACKAGE" != gettext-tools; }; then
389
gt_use_preinstalled_gnugettext=yes
391
dnl Reset the values set by searching for libintl.
397
ifelse(gt_included_intl, yes, [
398
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
399
dnl GNU gettext is not found in the C library.
400
dnl Fall back on included GNU gettext library.
401
nls_cv_use_gnu_gettext=yes
405
if test "$nls_cv_use_gnu_gettext" = "yes"; then
406
dnl Mark actions used to generate GNU NLS library.
407
BUILD_INCLUDED_LIBINTL=yes
408
USE_INCLUDED_LIBINTL=yes
409
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
410
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
411
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
415
if test "$gt_use_preinstalled_gnugettext" = "yes" \
416
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
417
dnl Mark actions to use GNU gettext tools.
422
if test -n "$INTL_MACOSX_LIBS"; then
423
if test "$gt_use_preinstalled_gnugettext" = "yes" \
424
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
425
dnl Some extra flags are needed during linking.
426
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
427
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
431
if test "$gt_use_preinstalled_gnugettext" = "yes" \
432
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
433
AC_DEFINE(ENABLE_NLS, 1,
434
[Define to 1 if translation of program messages to the user's native language
441
AC_MSG_CHECKING([whether to use NLS])
442
AC_MSG_RESULT([$USE_NLS])
443
if test "$USE_NLS" = "yes"; then
444
AC_MSG_CHECKING([where the gettext function comes from])
445
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
446
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
447
gt_source="external libintl"
452
gt_source="included intl directory"
454
AC_MSG_RESULT([$gt_source])
457
if test "$USE_NLS" = "yes"; then
459
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
460
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
461
AC_MSG_CHECKING([how to link with libintl])
462
AC_MSG_RESULT([$LIBINTL])
463
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
466
dnl For backward compatibility. Some packages may be using this.
467
AC_DEFINE(HAVE_GETTEXT, 1,
468
[Define if the GNU gettext() function is already present or preinstalled.])
469
AC_DEFINE(HAVE_DCGETTEXT, 1,
470
[Define if the GNU dcgettext() function is already present or preinstalled.])
473
dnl We need to process the po/ directory.
477
ifelse(gt_included_intl, yes, [
478
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
479
dnl to 'yes' because some of the testsuite requires it.
480
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
481
BUILD_INCLUDED_LIBINTL=yes
484
dnl Make all variables we use known to autoconf.
485
AC_SUBST(BUILD_INCLUDED_LIBINTL)
486
AC_SUBST(USE_INCLUDED_LIBINTL)
489
dnl For backward compatibility. Some configure.ins may be using this.
493
dnl For backward compatibility. Some Makefiles may be using this.
495
AC_SUBST(DATADIRNAME)
497
dnl For backward compatibility. Some Makefiles may be using this.
501
dnl For backward compatibility. Some Makefiles may be using this.
505
dnl For backward compatibility. Some Makefiles may be using this.
507
if test "$USE_INCLUDED_LIBINTL" = yes; then
508
INTLOBJS="\$(GETTOBJS)"
512
dnl Enable libtool support if the surrounding package wishes it.
513
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
514
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
517
dnl For backward compatibility. Some Makefiles may be using this.
521
dnl Make all documented variables known to autoconf.
528
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
529
m4_define([gt_NEEDS_INIT],
531
m4_divert_text([DEFAULTS], [gt_needs=])
532
m4_define([gt_NEEDS_INIT], [])
536
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
537
AC_DEFUN([AM_GNU_GETTEXT_NEED],
539
m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
543
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
544
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
546
# iconv.m4 serial AM6 (gettext-0.17)
547
dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc.
548
dnl This file is free software; the Free Software Foundation
549
dnl gives unlimited permission to copy and/or distribute it,
550
dnl with or without modifications, as long as this notice is preserved.
552
dnl From Bruno Haible.
554
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
556
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
557
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
558
AC_REQUIRE([AC_LIB_RPATH])
560
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
562
AC_LIB_LINKFLAGS_BODY([iconv])
565
AC_DEFUN([AM_ICONV_LINK],
567
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
568
dnl those with the standalone portable GNU libiconv installed).
569
AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
571
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
573
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
575
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
576
dnl because if the user has installed libiconv and not disabled its use
577
dnl via --without-libiconv-prefix, he wants to use it. The first
578
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
579
am_save_CPPFLAGS="$CPPFLAGS"
580
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
582
AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [
583
am_cv_func_iconv="no, consider installing GNU libiconv"
585
AC_TRY_LINK([#include <stdlib.h>
587
[iconv_t cd = iconv_open("","");
588
iconv(cd,NULL,NULL,NULL,NULL);
590
am_cv_func_iconv=yes)
591
if test "$am_cv_func_iconv" != yes; then
593
LIBS="$LIBS $LIBICONV"
594
AC_TRY_LINK([#include <stdlib.h>
596
[iconv_t cd = iconv_open("","");
597
iconv(cd,NULL,NULL,NULL,NULL);
600
am_cv_func_iconv=yes)
604
if test "$am_cv_func_iconv" = yes; then
605
AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [
606
dnl This tests against bugs in AIX 5.1 and HP-UX 11.11.
608
if test $am_cv_lib_iconv = yes; then
609
LIBS="$LIBS $LIBICONV"
616
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
619
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
620
if (cd_utf8_to_88591 != (iconv_t)(-1))
622
static const char input[] = "\342\202\254"; /* EURO SIGN */
624
const char *inptr = input;
625
size_t inbytesleft = strlen (input);
627
size_t outbytesleft = sizeof (buf);
628
size_t res = iconv (cd_utf8_to_88591,
629
(char **) &inptr, &inbytesleft,
630
&outptr, &outbytesleft);
635
#if 0 /* This bug could be worked around by the caller. */
636
/* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
638
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
639
if (cd_88591_to_utf8 != (iconv_t)(-1))
641
static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
643
const char *inptr = input;
644
size_t inbytesleft = strlen (input);
646
size_t outbytesleft = sizeof (buf);
647
size_t res = iconv (cd_88591_to_utf8,
648
(char **) &inptr, &inbytesleft,
649
&outptr, &outbytesleft);
655
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
657
if (/* Try standardized names. */
658
iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
659
/* Try IRIX, OSF/1 names. */
660
&& iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
662
&& iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
663
/* Try HP-UX names. */
664
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
667
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
669
aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
670
*) am_cv_func_iconv_works="guessing yes" ;;
674
case "$am_cv_func_iconv_works" in
675
*no) am_func_iconv=no am_cv_lib_iconv=no ;;
676
*) am_func_iconv=yes ;;
679
am_func_iconv=no am_cv_lib_iconv=no
681
if test "$am_func_iconv" = yes; then
682
AC_DEFINE(HAVE_ICONV, 1,
683
[Define if you have the iconv() function and it works.])
685
if test "$am_cv_lib_iconv" = yes; then
686
AC_MSG_CHECKING([how to link with libiconv])
687
AC_MSG_RESULT([$LIBICONV])
689
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
691
CPPFLAGS="$am_save_CPPFLAGS"
702
if test "$am_cv_func_iconv" = yes; then
703
AC_MSG_CHECKING([for iconv declaration])
704
AC_CACHE_VAL(am_cv_proto_iconv, [
712
#if defined(__STDC__) || defined(__cplusplus)
713
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
717
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
718
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);"])
719
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
720
AC_MSG_RESULT([$]{ac_t:-
721
}[$]am_cv_proto_iconv)
722
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
723
[Define as const if the declaration of iconv() needs const.])
727
# intlmacosx.m4 serial 1 (gettext-0.17)
728
dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
164
# intlmacosx.m4 serial 3 (gettext-0.18)
165
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
729
166
dnl This file is free software; the Free Software Foundation
730
167
dnl gives unlimited permission to copy and/or distribute it,
731
168
dnl with or without modifications, as long as this notice is preserved.
776
213
AC_SUBST([INTL_MACOSX_LIBS])
779
# lib-ld.m4 serial 3 (gettext-0.13)
780
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
781
dnl This file is free software; the Free Software Foundation
782
dnl gives unlimited permission to copy and/or distribute it,
783
dnl with or without modifications, as long as this notice is preserved.
785
dnl Subroutines of libtool.m4,
786
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
789
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
790
AC_DEFUN([AC_LIB_PROG_LD_GNU],
791
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
792
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
793
case `$LD -v 2>&1 </dev/null` in
794
*GNU* | *'with BFD'*)
795
acl_cv_prog_gnu_ld=yes ;;
797
acl_cv_prog_gnu_ld=no ;;
799
with_gnu_ld=$acl_cv_prog_gnu_ld
802
dnl From libtool-1.4. Sets the variable LD.
803
AC_DEFUN([AC_LIB_PROG_LD],
805
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
806
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
807
AC_REQUIRE([AC_PROG_CC])dnl
808
AC_REQUIRE([AC_CANONICAL_HOST])dnl
809
# Prepare PATH_SEPARATOR.
810
# The user is always right.
811
if test "${PATH_SEPARATOR+set}" != set; then
812
echo "#! /bin/sh" >conf$$.sh
813
echo "exit 0" >>conf$$.sh
815
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
823
if test "$GCC" = yes; then
824
# Check if gcc -print-prog-name=ld gives a path.
825
AC_MSG_CHECKING([for ld used by GCC])
828
# gcc leaves a trailing carriage return which upsets mingw
829
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
831
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
834
# Accept absolute paths.
835
[[\\/]* | [A-Za-z]:[\\/]*)]
836
[re_direlt='/[^/][^/]*/\.\./']
837
# Canonicalize the path of ld
838
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
839
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
840
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
842
test -z "$LD" && LD="$ac_prog"
845
# If it fails, then pretend we aren't using GCC.
849
# If it is relative, then search for the first ld in PATH.
853
elif test "$with_gnu_ld" = yes; then
854
AC_MSG_CHECKING([for GNU ld])
856
AC_MSG_CHECKING([for non-GNU ld])
858
AC_CACHE_VAL(acl_cv_path_LD,
859
[if test -z "$LD"; then
860
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
861
for ac_dir in $PATH; do
862
test -z "$ac_dir" && ac_dir=.
863
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
864
acl_cv_path_LD="$ac_dir/$ac_prog"
865
# Check to see if the program is GNU ld. I'd rather use --version,
866
# but apparently some GNU ld's only accept -v.
867
# Break only if it was the GNU/non-GNU ld that we prefer.
868
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
869
*GNU* | *'with BFD'*)
870
test "$with_gnu_ld" != no && break ;;
872
test "$with_gnu_ld" != yes && break ;;
878
acl_cv_path_LD="$LD" # Let the user override the test with a path.
881
if test -n "$LD"; then
886
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
890
# lib-link.m4 serial 13 (gettext-0.17)
891
dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
892
dnl This file is free software; the Free Software Foundation
893
dnl gives unlimited permission to copy and/or distribute it,
894
dnl with or without modifications, as long as this notice is preserved.
896
dnl From Bruno Haible.
900
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
901
dnl the libraries corresponding to explicit and implicit dependencies.
902
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
903
dnl augments the CPPFLAGS variable.
904
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
905
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
906
AC_DEFUN([AC_LIB_LINKFLAGS],
908
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
909
AC_REQUIRE([AC_LIB_RPATH])
910
define([Name],[translit([$1],[./-], [___])])
911
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
912
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
913
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
914
AC_LIB_LINKFLAGS_BODY([$1], [$2])
915
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
916
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
917
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
918
ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
920
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
921
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
922
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
923
LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
924
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
926
AC_SUBST([LTLIB]NAME)
927
AC_SUBST([LIB]NAME[_PREFIX])
928
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
929
dnl results of this search when this library appears as a dependency.
935
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
936
dnl searches for libname and the libraries corresponding to explicit and
937
dnl implicit dependencies, together with the specified include files and
938
dnl the ability to compile and link the specified testcode. If found, it
939
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
940
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
941
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
942
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
943
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
944
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
945
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
947
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
948
AC_REQUIRE([AC_LIB_RPATH])
949
define([Name],[translit([$1],[./-], [___])])
950
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
951
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
953
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
955
AC_LIB_LINKFLAGS_BODY([$1], [$2])
957
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
958
dnl because if the user has installed lib[]Name and not disabled its use
959
dnl via --without-lib[]Name-prefix, he wants to use it.
960
ac_save_CPPFLAGS="$CPPFLAGS"
961
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
963
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
965
LIBS="$LIBS $LIB[]NAME"
966
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
969
if test "$ac_cv_lib[]Name" = yes; then
971
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
972
AC_MSG_CHECKING([how to link with lib[]$1])
973
AC_MSG_RESULT([$LIB[]NAME])
976
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
977
dnl $INC[]NAME either.
978
CPPFLAGS="$ac_save_CPPFLAGS"
983
AC_SUBST([HAVE_LIB]NAME)
985
AC_SUBST([LTLIB]NAME)
986
AC_SUBST([LIB]NAME[_PREFIX])
991
dnl Determine the platform dependent parameters needed to use rpath:
994
dnl acl_hardcode_libdir_flag_spec,
995
dnl acl_hardcode_libdir_separator,
996
dnl acl_hardcode_direct,
997
dnl acl_hardcode_minus_L.
998
AC_DEFUN([AC_LIB_RPATH],
1000
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
1001
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
1002
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1003
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1004
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1005
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1006
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1007
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1008
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1014
acl_libext="$acl_cv_libext"
1015
acl_shlibext="$acl_cv_shlibext"
1016
acl_libname_spec="$acl_cv_libname_spec"
1017
acl_library_names_spec="$acl_cv_library_names_spec"
1018
acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1019
acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1020
acl_hardcode_direct="$acl_cv_hardcode_direct"
1021
acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
1022
dnl Determine whether the user wants rpath handling at all.
1023
AC_ARG_ENABLE(rpath,
1024
[ --disable-rpath do not hardcode runtime library paths],
1025
:, enable_rpath=yes)
1028
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1029
dnl the libraries corresponding to explicit and implicit dependencies.
1030
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1031
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
1032
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
1033
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1035
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1036
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1037
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1038
dnl Autoconf >= 2.61 supports dots in --with options.
1039
define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
1040
dnl By default, look in $includedir and $libdir.
1042
AC_LIB_WITH_FINAL_PREFIX([
1043
eval additional_includedir=\"$includedir\"
1044
eval additional_libdir=\"$libdir\"
1046
AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
1047
[ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1048
--without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir],
1050
if test "X$withval" = "Xno"; then
1053
if test "X$withval" = "X"; then
1054
AC_LIB_WITH_FINAL_PREFIX([
1055
eval additional_includedir=\"$includedir\"
1056
eval additional_libdir=\"$libdir\"
1059
additional_includedir="$withval/include"
1060
additional_libdir="$withval/$acl_libdirstem"
1064
dnl Search the library and its dependencies in $additional_libdir and
1065
dnl $LDFLAGS. Using breadth-first-seach.
1072
names_already_handled=
1073
names_next_round='$1 $2'
1074
while test -n "$names_next_round"; do
1075
names_this_round="$names_next_round"
1077
for name in $names_this_round; do
1079
for n in $names_already_handled; do
1080
if test "$n" = "$name"; then
1085
if test -z "$already_handled"; then
1086
names_already_handled="$names_already_handled $name"
1087
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1088
dnl or AC_LIB_HAVE_LINKFLAGS call.
1089
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1090
eval value=\"\$HAVE_LIB$uppername\"
1091
if test -n "$value"; then
1092
if test "$value" = yes; then
1093
eval value=\"\$LIB$uppername\"
1094
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1095
eval value=\"\$LTLIB$uppername\"
1096
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1098
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1099
dnl that this library doesn't exist. So just drop it.
1103
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1104
dnl and the already constructed $LIBNAME/$LTLIBNAME.
1109
eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
1110
if test -n "$acl_shlibext"; then
1111
shrext=".$acl_shlibext" # typically: shrext=.so
1115
if test $use_additional = yes; then
1116
dir="$additional_libdir"
1117
dnl The same code as in the loop below:
1118
dnl First look for a shared library.
1119
if test -n "$acl_shlibext"; then
1120
if test -f "$dir/$libname$shrext"; then
1122
found_so="$dir/$libname$shrext"
1124
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1125
ver=`(cd "$dir" && \
1126
for f in "$libname$shrext".*; do echo "$f"; done \
1127
| sed -e "s,^$libname$shrext\\\\.,," \
1128
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1129
| sed 1q ) 2>/dev/null`
1130
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1132
found_so="$dir/$libname$shrext.$ver"
1135
eval library_names=\"$acl_library_names_spec\"
1136
for f in $library_names; do
1137
if test -f "$dir/$f"; then
1146
dnl Then look for a static library.
1147
if test "X$found_dir" = "X"; then
1148
if test -f "$dir/$libname.$acl_libext"; then
1150
found_a="$dir/$libname.$acl_libext"
1153
if test "X$found_dir" != "X"; then
1154
if test -f "$dir/$libname.la"; then
1155
found_la="$dir/$libname.la"
1159
if test "X$found_dir" = "X"; then
1160
for x in $LDFLAGS $LTLIB[]NAME; do
1161
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1164
dir=`echo "X$x" | sed -e 's/^X-L//'`
1165
dnl First look for a shared library.
1166
if test -n "$acl_shlibext"; then
1167
if test -f "$dir/$libname$shrext"; then
1169
found_so="$dir/$libname$shrext"
1171
if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
1172
ver=`(cd "$dir" && \
1173
for f in "$libname$shrext".*; do echo "$f"; done \
1174
| sed -e "s,^$libname$shrext\\\\.,," \
1175
| sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
1176
| sed 1q ) 2>/dev/null`
1177
if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
1179
found_so="$dir/$libname$shrext.$ver"
1182
eval library_names=\"$acl_library_names_spec\"
1183
for f in $library_names; do
1184
if test -f "$dir/$f"; then
1193
dnl Then look for a static library.
1194
if test "X$found_dir" = "X"; then
1195
if test -f "$dir/$libname.$acl_libext"; then
1197
found_a="$dir/$libname.$acl_libext"
1200
if test "X$found_dir" != "X"; then
1201
if test -f "$dir/$libname.la"; then
1202
found_la="$dir/$libname.la"
1207
if test "X$found_dir" != "X"; then
1212
if test "X$found_dir" != "X"; then
1213
dnl Found the library.
1214
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1215
if test "X$found_so" != "X"; then
1216
dnl Linking with a shared library. We attempt to hardcode its
1217
dnl directory into the executable's runpath, unless it's the
1218
dnl standard /usr/lib.
1219
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
1220
dnl No hardcoding is needed.
1221
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1223
dnl Use an explicit option to hardcode DIR into the resulting
1225
dnl Potentially add DIR to ltrpathdirs.
1226
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1228
for x in $ltrpathdirs; do
1229
if test "X$x" = "X$found_dir"; then
1234
if test -z "$haveit"; then
1235
ltrpathdirs="$ltrpathdirs $found_dir"
1237
dnl The hardcoding into $LIBNAME is system dependent.
1238
if test "$acl_hardcode_direct" = yes; then
1239
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1240
dnl resulting binary.
1241
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1243
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1244
dnl Use an explicit option to hardcode DIR into the resulting
1246
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1247
dnl Potentially add DIR to rpathdirs.
1248
dnl The rpathdirs will be appended to $LIBNAME at the end.
1250
for x in $rpathdirs; do
1251
if test "X$x" = "X$found_dir"; then
1256
if test -z "$haveit"; then
1257
rpathdirs="$rpathdirs $found_dir"
1260
dnl Rely on "-L$found_dir".
1261
dnl But don't add it if it's already contained in the LDFLAGS
1262
dnl or the already constructed $LIBNAME
1264
for x in $LDFLAGS $LIB[]NAME; do
1265
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1266
if test "X$x" = "X-L$found_dir"; then
1271
if test -z "$haveit"; then
1272
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1274
if test "$acl_hardcode_minus_L" != no; then
1275
dnl FIXME: Not sure whether we should use
1276
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1278
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1280
dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
1281
dnl here, because this doesn't fit in flags passed to the
1282
dnl compiler. So give up. No hardcoding. This affects only
1283
dnl very old systems.
1284
dnl FIXME: Not sure whether we should use
1285
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1287
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1293
if test "X$found_a" != "X"; then
1294
dnl Linking with a static library.
1295
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1297
dnl We shouldn't come here, but anyway it's good to have a
1299
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1302
dnl Assume the include files are nearby.
1303
additional_includedir=
1304
case "$found_dir" in
1305
*/$acl_libdirstem | */$acl_libdirstem/)
1306
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
1307
LIB[]NAME[]_PREFIX="$basedir"
1308
additional_includedir="$basedir/include"
1311
if test "X$additional_includedir" != "X"; then
1312
dnl Potentially add $additional_includedir to $INCNAME.
1313
dnl But don't add it
1314
dnl 1. if it's the standard /usr/include,
1315
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1316
dnl 3. if it's already present in $CPPFLAGS or the already
1317
dnl constructed $INCNAME,
1318
dnl 4. if it doesn't exist as a directory.
1319
if test "X$additional_includedir" != "X/usr/include"; then
1321
if test "X$additional_includedir" = "X/usr/local/include"; then
1322
if test -n "$GCC"; then
1324
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1328
if test -z "$haveit"; then
1329
for x in $CPPFLAGS $INC[]NAME; do
1330
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1331
if test "X$x" = "X-I$additional_includedir"; then
1336
if test -z "$haveit"; then
1337
if test -d "$additional_includedir"; then
1338
dnl Really add $additional_includedir to $INCNAME.
1339
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1345
dnl Look for dependencies.
1346
if test -n "$found_la"; then
1347
dnl Read the .la file. It defines the variables
1348
dnl dlname, library_names, old_library, dependency_libs, current,
1349
dnl age, revision, installed, dlopen, dlpreopen, libdir.
1350
save_libdir="$libdir"
1352
*/* | *\\*) . "$found_la" ;;
1353
*) . "./$found_la" ;;
1355
libdir="$save_libdir"
1356
dnl We use only dependency_libs.
1357
for dep in $dependency_libs; do
1360
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1361
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1362
dnl But don't add it
1363
dnl 1. if it's the standard /usr/lib,
1364
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1365
dnl 3. if it's already present in $LDFLAGS or the already
1366
dnl constructed $LIBNAME,
1367
dnl 4. if it doesn't exist as a directory.
1368
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1370
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1371
if test -n "$GCC"; then
1373
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1377
if test -z "$haveit"; then
1379
for x in $LDFLAGS $LIB[]NAME; do
1380
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1381
if test "X$x" = "X-L$additional_libdir"; then
1386
if test -z "$haveit"; then
1387
if test -d "$additional_libdir"; then
1388
dnl Really add $additional_libdir to $LIBNAME.
1389
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1393
for x in $LDFLAGS $LTLIB[]NAME; do
1394
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1395
if test "X$x" = "X-L$additional_libdir"; then
1400
if test -z "$haveit"; then
1401
if test -d "$additional_libdir"; then
1402
dnl Really add $additional_libdir to $LTLIBNAME.
1403
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1410
dir=`echo "X$dep" | sed -e 's/^X-R//'`
1411
if test "$enable_rpath" != no; then
1412
dnl Potentially add DIR to rpathdirs.
1413
dnl The rpathdirs will be appended to $LIBNAME at the end.
1415
for x in $rpathdirs; do
1416
if test "X$x" = "X$dir"; then
1421
if test -z "$haveit"; then
1422
rpathdirs="$rpathdirs $dir"
1424
dnl Potentially add DIR to ltrpathdirs.
1425
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1427
for x in $ltrpathdirs; do
1428
if test "X$x" = "X$dir"; then
1433
if test -z "$haveit"; then
1434
ltrpathdirs="$ltrpathdirs $dir"
1439
dnl Handle this in the next round.
1440
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1443
dnl Handle this in the next round. Throw away the .la's
1444
dnl directory; it is already contained in a preceding -L
1446
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1449
dnl Most likely an immediate library name.
1450
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1451
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1457
dnl Didn't find the library; assume it is in the system directories
1458
dnl known to the linker and runtime loader. (All the system
1459
dnl directories known to the linker should also be known to the
1460
dnl runtime loader, otherwise the system is severely misconfigured.)
1461
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1462
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1468
if test "X$rpathdirs" != "X"; then
1469
if test -n "$acl_hardcode_libdir_separator"; then
1470
dnl Weird platform: only the last -rpath option counts, the user must
1471
dnl pass all path elements in one option. We can arrange that for a
1472
dnl single library, but not when more than one $LIBNAMEs are used.
1474
for found_dir in $rpathdirs; do
1475
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1477
dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1478
acl_save_libdir="$libdir"
1480
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1481
libdir="$acl_save_libdir"
1482
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1484
dnl The -rpath options are cumulative.
1485
for found_dir in $rpathdirs; do
1486
acl_save_libdir="$libdir"
1488
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1489
libdir="$acl_save_libdir"
1490
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1494
if test "X$ltrpathdirs" != "X"; then
1495
dnl When using libtool, the option that works for both libraries and
1496
dnl executables is -R. The -R options are cumulative.
1497
for found_dir in $ltrpathdirs; do
1498
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1503
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1504
dnl unless already present in VAR.
1505
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1506
dnl contains two or three consecutive elements that belong together.
1507
AC_DEFUN([AC_LIB_APPENDTOVAR],
1509
for element in [$2]; do
1512
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1513
if test "X$x" = "X$element"; then
1518
if test -z "$haveit"; then
1519
[$1]="${[$1]}${[$1]:+ }$element"
1524
dnl For those cases where a variable contains several -L and -l options
1525
dnl referring to unknown libraries and directories, this macro determines the
1526
dnl necessary additional linker options for the runtime path.
1527
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1528
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1529
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1530
dnl otherwise linking without libtool is assumed.
1531
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1533
AC_REQUIRE([AC_LIB_RPATH])
1534
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1536
if test "$enable_rpath" != no; then
1537
if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1538
dnl Use an explicit option to hardcode directories into the resulting
1543
if test -n "$next"; then
1545
dnl No need to hardcode the standard /usr/lib.
1546
if test "X$dir" != "X/usr/$acl_libdirstem"; then
1547
rpathdirs="$rpathdirs $dir"
1553
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1554
dnl No need to hardcode the standard /usr/lib.
1555
if test "X$dir" != "X/usr/$acl_libdirstem"; then
1556
rpathdirs="$rpathdirs $dir"
1563
if test "X$rpathdirs" != "X"; then
1564
if test -n ""$3""; then
1565
dnl libtool is used for linking. Use -R options.
1566
for dir in $rpathdirs; do
1567
$1="${$1}${$1:+ }-R$dir"
1570
dnl The linker is used for linking directly.
1571
if test -n "$acl_hardcode_libdir_separator"; then
1572
dnl Weird platform: only the last -rpath option counts, the user
1573
dnl must pass all path elements in one option.
1575
for dir in $rpathdirs; do
1576
alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1578
acl_save_libdir="$libdir"
1580
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1581
libdir="$acl_save_libdir"
1584
dnl The -rpath options are cumulative.
1585
for dir in $rpathdirs; do
1586
acl_save_libdir="$libdir"
1588
eval flag=\"$acl_hardcode_libdir_flag_spec\"
1589
libdir="$acl_save_libdir"
1590
$1="${$1}${$1:+ }$flag"
1600
# lib-prefix.m4 serial 5 (gettext-0.15)
1601
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
1602
dnl This file is free software; the Free Software Foundation
1603
dnl gives unlimited permission to copy and/or distribute it,
1604
dnl with or without modifications, as long as this notice is preserved.
1606
dnl From Bruno Haible.
1608
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1609
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1610
dnl require excessive bracketing.
1611
ifdef([AC_HELP_STRING],
1612
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1613
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1615
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1616
dnl to access previously installed libraries. The basic assumption is that
1617
dnl a user will want packages to use other packages he previously installed
1618
dnl with the same --prefix option.
1619
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1620
dnl libraries, but is otherwise very convenient.
1621
AC_DEFUN([AC_LIB_PREFIX],
1623
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1624
AC_REQUIRE([AC_PROG_CC])
1625
AC_REQUIRE([AC_CANONICAL_HOST])
1626
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1627
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1628
dnl By default, look in $includedir and $libdir.
1630
AC_LIB_WITH_FINAL_PREFIX([
1631
eval additional_includedir=\"$includedir\"
1632
eval additional_libdir=\"$libdir\"
1634
AC_LIB_ARG_WITH([lib-prefix],
1635
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1636
--without-lib-prefix don't search for libraries in includedir and libdir],
1638
if test "X$withval" = "Xno"; then
1641
if test "X$withval" = "X"; then
1642
AC_LIB_WITH_FINAL_PREFIX([
1643
eval additional_includedir=\"$includedir\"
1644
eval additional_libdir=\"$libdir\"
1647
additional_includedir="$withval/include"
1648
additional_libdir="$withval/$acl_libdirstem"
1652
if test $use_additional = yes; then
1653
dnl Potentially add $additional_includedir to $CPPFLAGS.
1654
dnl But don't add it
1655
dnl 1. if it's the standard /usr/include,
1656
dnl 2. if it's already present in $CPPFLAGS,
1657
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1658
dnl 4. if it doesn't exist as a directory.
1659
if test "X$additional_includedir" != "X/usr/include"; then
1661
for x in $CPPFLAGS; do
1662
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1663
if test "X$x" = "X-I$additional_includedir"; then
1668
if test -z "$haveit"; then
1669
if test "X$additional_includedir" = "X/usr/local/include"; then
1670
if test -n "$GCC"; then
1672
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1676
if test -z "$haveit"; then
1677
if test -d "$additional_includedir"; then
1678
dnl Really add $additional_includedir to $CPPFLAGS.
1679
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1684
dnl Potentially add $additional_libdir to $LDFLAGS.
1685
dnl But don't add it
1686
dnl 1. if it's the standard /usr/lib,
1687
dnl 2. if it's already present in $LDFLAGS,
1688
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1689
dnl 4. if it doesn't exist as a directory.
1690
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1692
for x in $LDFLAGS; do
1693
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1694
if test "X$x" = "X-L$additional_libdir"; then
1699
if test -z "$haveit"; then
1700
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1701
if test -n "$GCC"; then
1703
linux*) haveit=yes;;
1707
if test -z "$haveit"; then
1708
if test -d "$additional_libdir"; then
1709
dnl Really add $additional_libdir to $LDFLAGS.
1710
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1718
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1719
dnl acl_final_exec_prefix, containing the values to which $prefix and
1720
dnl $exec_prefix will expand at the end of the configure script.
1721
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1723
dnl Unfortunately, prefix and exec_prefix get only finally determined
1724
dnl at the end of configure.
1725
if test "X$prefix" = "XNONE"; then
1726
acl_final_prefix="$ac_default_prefix"
1728
acl_final_prefix="$prefix"
1730
if test "X$exec_prefix" = "XNONE"; then
1731
acl_final_exec_prefix='${prefix}'
1733
acl_final_exec_prefix="$exec_prefix"
1735
acl_save_prefix="$prefix"
1736
prefix="$acl_final_prefix"
1737
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1738
prefix="$acl_save_prefix"
1741
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1742
dnl variables prefix and exec_prefix bound to the values they will have
1743
dnl at the end of the configure script.
1744
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1746
acl_save_prefix="$prefix"
1747
prefix="$acl_final_prefix"
1748
acl_save_exec_prefix="$exec_prefix"
1749
exec_prefix="$acl_final_exec_prefix"
1751
exec_prefix="$acl_save_exec_prefix"
1752
prefix="$acl_save_prefix"
1755
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
1756
dnl the basename of the libdir, either "lib" or "lib64".
1757
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1759
dnl There is no formal standard regarding lib and lib64. The current
1760
dnl practice is that on a system supporting 32-bit and 64-bit instruction
1761
dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
1762
dnl libraries go under $prefix/lib. We determine the compiler's default
1763
dnl mode by looking at the compiler's library search path. If at least
1764
dnl of its elements ends in /lib64 or points to a directory whose absolute
1765
dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
1766
dnl default, namely "lib".
1768
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1769
if test -n "$searchpath"; then
1770
acl_save_IFS="${IFS= }"; IFS=":"
1771
for searchdir in $searchpath; do
1772
if test -d "$searchdir"; then
1773
case "$searchdir" in
1774
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1775
*) searchdir=`cd "$searchdir" && pwd`
1776
case "$searchdir" in
1777
*/lib64 ) acl_libdirstem=lib64 ;;
1786
# nls.m4 serial 3 (gettext-0.15)
1787
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
1788
dnl This file is free software; the Free Software Foundation
1789
dnl gives unlimited permission to copy and/or distribute it,
1790
dnl with or without modifications, as long as this notice is preserved.
1792
dnl This file can can be used in projects which are not available under
1793
dnl the GNU General Public License or the GNU Library General Public
1794
dnl License but which still want to provide support for the GNU gettext
1796
dnl Please note that the actual code of the GNU gettext library is covered
1797
dnl by the GNU Library General Public License, and the rest of the GNU
1798
dnl gettext package package is covered by the GNU General Public License.
1799
dnl They are *not* in the public domain.
1802
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1803
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1809
AC_MSG_CHECKING([whether NLS is requested])
1810
dnl Default is enabled NLS
1812
[ --disable-nls do not use Native Language Support],
1813
USE_NLS=$enableval, USE_NLS=yes)
1814
AC_MSG_RESULT($USE_NLS)
1818
216
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
217
# serial 1 (pkg-config-0.24)
1820
219
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1949
350
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1950
351
installed software in a non-standard prefix.
1954
[AC_MSG_RESULT([no])
1956
355
elif test $pkg_failed = untried; then
1957
ifelse([$4], , [AC_MSG_FAILURE(dnl
357
m4_default([$4], [AC_MSG_FAILURE(
1958
358
[The pkg-config script could not be found or is too old. Make sure it
1959
359
is in your PATH or set the PKG_CONFIG environment variable to the full
1960
360
path to pkg-config.
1964
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
364
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])
1967
367
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1968
368
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1969
369
AC_MSG_RESULT([yes])
1970
ifelse([$3], , :, [$3])
1972
372
])# PKG_CHECK_MODULES
1974
# po.m4 serial 15 (gettext-0.17)
1975
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
1976
dnl This file is free software; the Free Software Foundation
1977
dnl gives unlimited permission to copy and/or distribute it,
1978
dnl with or without modifications, as long as this notice is preserved.
1980
dnl This file can can be used in projects which are not available under
1981
dnl the GNU General Public License or the GNU Library General Public
1982
dnl License but which still want to provide support for the GNU gettext
1984
dnl Please note that the actual code of the GNU gettext library is covered
1985
dnl by the GNU Library General Public License, and the rest of the GNU
1986
dnl gettext package package is covered by the GNU General Public License.
1987
dnl They are *not* in the public domain.
1990
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1991
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1995
dnl Checks for all prerequisites of the po subdirectory.
1996
AC_DEFUN([AM_PO_SUBDIRS],
1998
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1999
AC_REQUIRE([AC_PROG_INSTALL])dnl
2000
AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
2001
AC_REQUIRE([AM_NLS])dnl
2003
dnl Release version of the gettext macros. This is used to ensure that
2004
dnl the gettext macros and po/Makefile.in.in are in sync.
2005
AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
2007
dnl Perform the following tests also if --disable-nls has been given,
2008
dnl because they are needed for "make dist" to work.
2010
dnl Search for GNU msgfmt in the PATH.
2011
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
2012
dnl The second test excludes FreeBSD msgfmt.
2013
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
2014
[$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2015
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
2017
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
2019
dnl Test whether it is GNU msgfmt >= 0.15.
2021
case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2022
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
2023
*) MSGFMT_015=$MSGFMT ;;
2026
AC_SUBST([MSGFMT_015])
2028
case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2029
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
2030
*) GMSGFMT_015=$GMSGFMT ;;
2033
AC_SUBST([GMSGFMT_015])
2035
dnl Search for GNU xgettext 0.12 or newer in the PATH.
2036
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
2037
dnl The second test excludes FreeBSD xgettext.
2038
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
2039
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
2040
(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)],
2042
dnl Remove leftover from FreeBSD xgettext call.
2045
dnl Test whether it is GNU xgettext >= 0.15.
2047
case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
2048
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
2049
*) XGETTEXT_015=$XGETTEXT ;;
2052
AC_SUBST([XGETTEXT_015])
2054
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
2055
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
2056
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
2058
dnl Installation directories.
2059
dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
2060
dnl have to define it here, so that it can be used in po/Makefile.
2061
test -n "$localedir" || localedir='${datadir}/locale'
2062
AC_SUBST([localedir])
2064
dnl Support for AM_XGETTEXT_OPTION.
2065
test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
2066
AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
2068
AC_CONFIG_COMMANDS([po-directories], [[
2069
for ac_file in $CONFIG_FILES; do
2070
# Support "outfile[:infile[:infile...]]"
2072
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2074
# PO directories have a Makefile.in generated from Makefile.in.in.
2075
case "$ac_file" in */Makefile.in)
2076
# Adjust a relative srcdir.
2077
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2078
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2079
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2080
# In autoconf-2.13 it is called $ac_given_srcdir.
2081
# In autoconf-2.50 it is called $srcdir.
2082
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2083
case "$ac_given_srcdir" in
2084
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2085
/*) top_srcdir="$ac_given_srcdir" ;;
2086
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2088
# Treat a directory as a PO directory if and only if it has a
2089
# POTFILES.in file. This allows packages to have multiple PO
2090
# directories under different names or in different locations.
2091
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2092
rm -f "$ac_dir/POTFILES"
2093
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2094
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2095
POMAKEFILEDEPS="POTFILES.in"
2096
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2097
# on $ac_dir but don't depend on user-specified configuration
2099
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2100
# The LINGUAS file contains the set of available languages.
2101
if test -n "$OBSOLETE_ALL_LINGUAS"; then
2102
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2104
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2105
# Hide the ALL_LINGUAS assigment from automake < 1.5.
2106
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2107
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2109
# The set of available languages was given in configure.in.
2110
# Hide the ALL_LINGUAS assigment from automake < 1.5.
2111
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2114
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2115
# Compute UPDATEPOFILES
2116
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2117
# Compute DUMMYPOFILES
2118
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2120
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2121
case "$ac_given_srcdir" in
2123
*) srcdirpre='$(srcdir)/' ;;
2129
for lang in $ALL_LINGUAS; do
2130
POFILES="$POFILES $srcdirpre$lang.po"
2131
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2132
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2133
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2135
# CATALOGS depends on both $ac_dir and the user's LINGUAS
2136
# environment variable.
2138
if test -n "$ALL_LINGUAS"; then
2139
for presentlang in $ALL_LINGUAS; do
2141
if test "%UNSET%" != "$LINGUAS"; then
2142
desiredlanguages="$LINGUAS"
2144
desiredlanguages="$ALL_LINGUAS"
2146
for desiredlang in $desiredlanguages; do
2147
# Use the presentlang catalog if desiredlang is
2148
# a. equal to presentlang, or
2149
# b. a variant of presentlang (because in this case,
2150
# presentlang can be used as a fallback for messages
2151
# which are not translated in the desiredlang catalog).
2152
case "$desiredlang" in
2153
"$presentlang"*) useit=yes;;
2156
if test $useit = yes; then
2157
INST_LINGUAS="$INST_LINGUAS $presentlang"
2162
if test -n "$INST_LINGUAS"; then
2163
for lang in $INST_LINGUAS; do
2164
CATALOGS="$CATALOGS $lang.gmo"
2167
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2168
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"
2169
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2170
if test -f "$f"; then
2172
*.orig | *.bak | *~) ;;
2173
*) cat "$f" >> "$ac_dir/Makefile" ;;
2181
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2182
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2183
# from automake < 1.5.
2184
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2185
# Capture the value of LINGUAS because we need it to compute CATALOGS.
2186
LINGUAS="${LINGUAS-%UNSET%}"
2190
dnl Postprocesses a Makefile in a directory containing PO files.
2191
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2193
# When this code is run, in config.status, two variables have already been
2195
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2196
# - LINGUAS is the value of the environment variable LINGUAS at configure
2200
# Adjust a relative srcdir.
2201
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2202
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2203
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2204
# In autoconf-2.13 it is called $ac_given_srcdir.
2205
# In autoconf-2.50 it is called $srcdir.
2206
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2207
case "$ac_given_srcdir" in
2208
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2209
/*) top_srcdir="$ac_given_srcdir" ;;
2210
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
2213
# Find a way to echo strings without interpreting backslash.
2214
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2217
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2218
gt_echo='printf %s\n'
2229
# A sed script that extracts the value of VARIABLE from a Makefile.
2231
# Test if the hold space is empty.
2236
# Yes it was empty. Look if we have the expected variable definition.
2237
/^[ ]*VARIABLE[ ]*=/{
2238
# Seen the first line of the variable definition.
2239
s/^[ ]*VARIABLE[ ]*=//
2244
# Here we are processing a line from the variable definition.
2245
# Remove comment, more precisely replace it with a space.
2247
# See if the line ends in a backslash.
2251
# Print the line, without the trailing backslash.
2254
# There was no trailing backslash. The end of the variable definition is
2255
# reached. Clear the hold space.
2260
# A trailing backslash means that the variable definition continues in the
2261
# next line. Put a nonempty string into the hold space to indicate this.
2268
# Set POTFILES to the value of the Makefile variable POTFILES.
2269
sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
2270
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2271
# Compute POTFILES_DEPS as
2272
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2274
for file in $POTFILES; do
2275
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2279
if test -n "$OBSOLETE_ALL_LINGUAS"; then
2280
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2282
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2283
# The LINGUAS file contains the set of available languages.
2284
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2285
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2287
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2288
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
2289
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2291
# Hide the ALL_LINGUAS assigment from automake < 1.5.
2292
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2294
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2295
# Compute UPDATEPOFILES
2296
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2297
# Compute DUMMYPOFILES
2298
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2300
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2301
# Compute PROPERTIESFILES
2302
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2303
# Compute CLASSFILES
2304
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2306
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2308
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2309
# Compute RESOURCESDLLFILES
2310
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2311
case "$ac_given_srcdir" in
2313
*) srcdirpre='$(srcdir)/' ;;
2324
for lang in $ALL_LINGUAS; do
2325
POFILES="$POFILES $srcdirpre$lang.po"
2326
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2327
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2328
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2329
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2330
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2331
QMFILES="$QMFILES $srcdirpre$lang.qm"
2332
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2333
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2334
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/'`
2335
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2337
# CATALOGS depends on both $ac_dir and the user's LINGUAS
2338
# environment variable.
2340
if test -n "$ALL_LINGUAS"; then
2341
for presentlang in $ALL_LINGUAS; do
2343
if test "%UNSET%" != "$LINGUAS"; then
2344
desiredlanguages="$LINGUAS"
2346
desiredlanguages="$ALL_LINGUAS"
2348
for desiredlang in $desiredlanguages; do
2349
# Use the presentlang catalog if desiredlang is
2350
# a. equal to presentlang, or
2351
# b. a variant of presentlang (because in this case,
2352
# presentlang can be used as a fallback for messages
2353
# which are not translated in the desiredlang catalog).
2354
case "$desiredlang" in
2355
"$presentlang"*) useit=yes;;
2358
if test $useit = yes; then
2359
INST_LINGUAS="$INST_LINGUAS $presentlang"
2368
if test -n "$INST_LINGUAS"; then
2369
for lang in $INST_LINGUAS; do
2370
CATALOGS="$CATALOGS $lang.gmo"
2371
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2372
QTCATALOGS="$QTCATALOGS $lang.qm"
2373
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2374
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2375
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/'`
2376
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2380
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"
2381
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2382
# Add dependencies that cannot be formulated as a simple suffix rule.
2383
for lang in $ALL_LINGUAS; do
2384
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2385
cat >> "$ac_file.tmp" <<EOF
2386
$frobbedlang.msg: $lang.po
2387
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2388
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2392
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2393
# Add dependencies that cannot be formulated as a simple suffix rule.
2394
for lang in $ALL_LINGUAS; do
2395
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/'`
2396
cat >> "$ac_file.tmp" <<EOF
2397
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2398
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2399
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2403
if test -n "$POMAKEFILEDEPS"; then
2404
cat >> "$ac_file.tmp" <<EOF
2405
Makefile: $POMAKEFILEDEPS
2408
mv "$ac_file.tmp" "$ac_file"
2411
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
2412
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
2414
XGETTEXT_EXTRA_OPTIONS=
2417
dnl Registers an option to be passed to xgettext in the po subdirectory.
2418
AC_DEFUN([AM_XGETTEXT_OPTION],
2420
AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
2421
XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
2424
# progtest.m4 serial 4 (gettext-0.14.2)
2425
dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
2426
dnl This file is free software; the Free Software Foundation
2427
dnl gives unlimited permission to copy and/or distribute it,
2428
dnl with or without modifications, as long as this notice is preserved.
2430
dnl This file can can be used in projects which are not available under
2431
dnl the GNU General Public License or the GNU Library General Public
2432
dnl License but which still want to provide support for the GNU gettext
2434
dnl Please note that the actual code of the GNU gettext library is covered
2435
dnl by the GNU Library General Public License, and the rest of the GNU
2436
dnl gettext package package is covered by the GNU General Public License.
2437
dnl They are *not* in the public domain.
2440
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
2444
# Search path for a program which passes the given test.
2446
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2447
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2448
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2450
# Prepare PATH_SEPARATOR.
2451
# The user is always right.
2452
if test "${PATH_SEPARATOR+set}" != set; then
2453
echo "#! /bin/sh" >conf$$.sh
2454
echo "exit 0" >>conf$$.sh
2456
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2464
# Find out how to test for executable files. Don't use a zero-byte file,
2465
# as systems may use methods other than mode bits to determine executability.
2466
cat >conf$$.file <<_ASEOF
2470
chmod +x conf$$.file
2471
if test -x conf$$.file >/dev/null 2>&1; then
2472
ac_executable_p="test -x"
2474
ac_executable_p="test -f"
2478
# Extract the first word of "$2", so it can be a program name with args.
2479
set dummy $2; ac_word=[$]2
2480
AC_MSG_CHECKING([for $ac_word])
2481
AC_CACHE_VAL(ac_cv_path_$1,
2483
[[\\/]]* | ?:[[\\/]]*)
2484
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2487
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2488
for ac_dir in ifelse([$5], , $PATH, [$5]); do
2490
test -z "$ac_dir" && ac_dir=.
2491
for ac_exec_ext in '' $ac_executable_extensions; do
2492
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2493
echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
2495
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2502
dnl If no 4th arg is given, leave the cache variable unset,
2503
dnl so AC_PATH_PROGS will keep looking.
2504
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2509
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2510
AC_MSG_RESULT([$]$1)
2517
374
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
2519
376
# This file is free software; the Free Software Foundation