168
199
AC_SUBST(GCC3DEP)
202
# gettext.m4 serial 28 (gettext-0.13)
203
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
204
dnl This file is free software, distributed under the terms of the GNU
205
dnl General Public License. As a special exception to the GNU General
206
dnl Public License, this file may be distributed as part of a program
207
dnl that contains a configuration script generated by Autoconf, under
208
dnl the same distribution terms as the rest of that program.
210
dnl This file can can be used in projects which are not available under
211
dnl the GNU General Public License or the GNU Library General Public
212
dnl License but which still want to provide support for the GNU gettext
214
dnl Please note that the actual code of the GNU gettext library is covered
215
dnl by the GNU Library General Public License, and the rest of the GNU
216
dnl gettext package package is covered by the GNU General Public License.
217
dnl They are *not* in the public domain.
220
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
221
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
223
dnl Macro to add for using GNU gettext.
225
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
226
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
227
dnl default (if it is not specified or empty) is 'no-libtool'.
228
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
229
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
230
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
231
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
232
dnl depending on --{enable,disable}-{shared,static} and on the presence of
233
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
234
dnl $(top_builddir)/intl/libintl.a will be created.
235
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
236
dnl implementations (in libc or libintl) without the ngettext() function
237
dnl will be ignored. If NEEDSYMBOL is specified and is
238
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
239
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
240
dnl INTLDIR is used to find the intl libraries. If empty,
241
dnl the value `$(top_builddir)/intl/' is used.
243
dnl The result of the configuration is one of three cases:
244
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
246
dnl Catalog format: GNU --> install in $(datadir)
247
dnl Catalog extension: .mo after installation, .gmo in source tree
248
dnl 2) GNU gettext has been found in the system's C library.
249
dnl Catalog format: GNU --> install in $(datadir)
250
dnl Catalog extension: .mo after installation, .gmo in source tree
251
dnl 3) No internationalization, always use English msgid.
252
dnl Catalog format: none
253
dnl Catalog extension: none
254
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
255
dnl The use of .gmo is historical (it was needed to avoid overwriting the
256
dnl GNU format catalogs when building on a platform with an X/Open gettext),
257
dnl but we keep it in order not to force irrelevant filename changes on the
260
AC_DEFUN([AM_GNU_GETTEXT],
262
dnl Argument checking.
263
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
264
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
266
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
267
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
269
define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
270
define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
272
AC_REQUIRE([AM_PO_SUBDIRS])dnl
273
ifelse(gt_included_intl, yes, [
274
AC_REQUIRE([AM_INTL_SUBDIR])dnl
277
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
278
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
279
AC_REQUIRE([AC_LIB_RPATH])
281
dnl Sometimes libintl requires libiconv, so first search for libiconv.
282
dnl Ideally we would do this search only after the
283
dnl if test "$USE_NLS" = "yes"; then
284
dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
285
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
286
dnl the configure script would need to contain the same shell code
287
dnl again, outside any 'if'. There are two solutions:
288
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
289
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
290
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
291
dnl documented, we avoid it.
292
ifelse(gt_included_intl, yes, , [
293
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
299
ifelse(gt_included_intl, yes, [
300
BUILD_INCLUDED_LIBINTL=no
301
USE_INCLUDED_LIBINTL=no
307
dnl If we use NLS figure out what method
308
if test "$USE_NLS" = "yes"; then
309
gt_use_preinstalled_gnugettext=no
310
ifelse(gt_included_intl, yes, [
311
AC_MSG_CHECKING([whether included gettext is requested])
312
AC_ARG_WITH(included-gettext,
313
[ --with-included-gettext use the GNU gettext library included here],
314
nls_cv_force_use_gnu_gettext=$withval,
315
nls_cv_force_use_gnu_gettext=no)
316
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
318
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
319
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
321
dnl User does not insist on using GNU NLS library. Figure out what
322
dnl to use. If GNU gettext is available we use this. Else we have
323
dnl to fall back to GNU NLS library.
325
dnl Add a version number to the cache macros.
326
define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
327
define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
328
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
330
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
331
[AC_TRY_LINK([#include <libintl.h>
332
]ifelse([$2], [need-formatstring-macros],
333
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
334
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
337
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
339
], [])[extern int _nl_msg_cat_cntr;
340
extern int *_nl_domain_bindings;],
341
[bindtextdomain ("", "");
342
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
343
gt_cv_func_gnugettext_libc=yes,
344
gt_cv_func_gnugettext_libc=no)])
346
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
347
dnl Sometimes libintl requires libiconv, so first search for libiconv.
348
ifelse(gt_included_intl, yes, , [
351
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
352
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
353
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
354
dnl even if libiconv doesn't exist.
355
AC_LIB_LINKFLAGS_BODY([intl])
356
AC_CACHE_CHECK([for GNU gettext in libintl],
357
gt_cv_func_gnugettext_libintl,
358
[gt_save_CPPFLAGS="$CPPFLAGS"
359
CPPFLAGS="$CPPFLAGS $INCINTL"
361
LIBS="$LIBS $LIBINTL"
362
dnl Now see whether libintl exists and does not depend on libiconv.
363
AC_TRY_LINK([#include <libintl.h>
364
]ifelse([$2], [need-formatstring-macros],
365
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
366
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
369
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
371
], [])[extern int _nl_msg_cat_cntr;
376
const char *_nl_expand_alias ();],
377
[bindtextdomain ("", "");
378
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
379
gt_cv_func_gnugettext_libintl=yes,
380
gt_cv_func_gnugettext_libintl=no)
381
dnl Now see whether libintl exists and depends on libiconv.
382
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
383
LIBS="$LIBS $LIBICONV"
384
AC_TRY_LINK([#include <libintl.h>
385
]ifelse([$2], [need-formatstring-macros],
386
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
387
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
390
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
392
], [])[extern int _nl_msg_cat_cntr;
397
const char *_nl_expand_alias ();],
398
[bindtextdomain ("", "");
399
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
400
[LIBINTL="$LIBINTL $LIBICONV"
401
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
402
gt_cv_func_gnugettext_libintl=yes
405
CPPFLAGS="$gt_save_CPPFLAGS"
406
LIBS="$gt_save_LIBS"])
409
dnl If an already present or preinstalled GNU gettext() is found,
410
dnl use it. But if this macro is used in GNU gettext, and GNU
411
dnl gettext is already preinstalled in libintl, we update this
412
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
413
if test "$gt_cv_func_gnugettext_libc" = "yes" \
414
|| { test "$gt_cv_func_gnugettext_libintl" = "yes" \
415
&& test "$PACKAGE" != gettext-runtime \
416
&& test "$PACKAGE" != gettext-tools; }; then
417
gt_use_preinstalled_gnugettext=yes
419
dnl Reset the values set by searching for libintl.
425
ifelse(gt_included_intl, yes, [
426
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
427
dnl GNU gettext is not found in the C library.
428
dnl Fall back on included GNU gettext library.
429
nls_cv_use_gnu_gettext=yes
433
if test "$nls_cv_use_gnu_gettext" = "yes"; then
434
dnl Mark actions used to generate GNU NLS library.
435
BUILD_INCLUDED_LIBINTL=yes
436
USE_INCLUDED_LIBINTL=yes
437
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
438
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
439
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
442
if test "$gt_use_preinstalled_gnugettext" = "yes" \
443
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
444
dnl Mark actions to use GNU gettext tools.
449
if test "$gt_use_preinstalled_gnugettext" = "yes" \
450
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
451
AC_DEFINE(ENABLE_NLS, 1,
452
[Define to 1 if translation of program messages to the user's native language
459
AC_MSG_CHECKING([whether to use NLS])
460
AC_MSG_RESULT([$USE_NLS])
461
if test "$USE_NLS" = "yes"; then
462
AC_MSG_CHECKING([where the gettext function comes from])
463
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
464
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
465
gt_source="external libintl"
470
gt_source="included intl directory"
472
AC_MSG_RESULT([$gt_source])
475
if test "$USE_NLS" = "yes"; then
477
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
478
if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
479
AC_MSG_CHECKING([how to link with libintl])
480
AC_MSG_RESULT([$LIBINTL])
481
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
484
dnl For backward compatibility. Some packages may be using this.
485
AC_DEFINE(HAVE_GETTEXT, 1,
486
[Define if the GNU gettext() function is already present or preinstalled.])
487
AC_DEFINE(HAVE_DCGETTEXT, 1,
488
[Define if the GNU dcgettext() function is already present or preinstalled.])
491
dnl We need to process the po/ directory.
495
ifelse(gt_included_intl, yes, [
496
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
497
dnl to 'yes' because some of the testsuite requires it.
498
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
499
BUILD_INCLUDED_LIBINTL=yes
502
dnl Make all variables we use known to autoconf.
503
AC_SUBST(BUILD_INCLUDED_LIBINTL)
504
AC_SUBST(USE_INCLUDED_LIBINTL)
507
dnl For backward compatibility. Some configure.ins may be using this.
511
dnl For backward compatibility. Some Makefiles may be using this.
513
AC_SUBST(DATADIRNAME)
515
dnl For backward compatibility. Some Makefiles may be using this.
519
dnl For backward compatibility. Some Makefiles may be using this.
523
dnl For backward compatibility. Some Makefiles may be using this.
524
if test "$USE_INCLUDED_LIBINTL" = yes; then
525
INTLOBJS="\$(GETTOBJS)"
529
dnl Enable libtool support if the surrounding package wishes it.
530
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
531
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
534
dnl For backward compatibility. Some Makefiles may be using this.
538
dnl Make all documented variables known to autoconf.
545
dnl Checks for all prerequisites of the intl subdirectory,
546
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
547
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
548
AC_DEFUN([AM_INTL_SUBDIR],
550
AC_REQUIRE([AC_PROG_INSTALL])dnl
551
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
552
AC_REQUIRE([AC_PROG_CC])dnl
553
AC_REQUIRE([AC_CANONICAL_HOST])dnl
554
AC_REQUIRE([AC_PROG_RANLIB])dnl
555
AC_REQUIRE([AC_ISC_POSIX])dnl
556
AC_REQUIRE([AC_HEADER_STDC])dnl
557
AC_REQUIRE([AC_C_CONST])dnl
558
AC_REQUIRE([bh_C_SIGNED])dnl
559
AC_REQUIRE([AC_C_INLINE])dnl
560
AC_REQUIRE([AC_TYPE_OFF_T])dnl
561
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
562
AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
563
AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
564
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
565
AC_REQUIRE([gt_TYPE_WINT_T])dnl
566
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
567
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
568
AC_REQUIRE([gt_TYPE_INTMAX_T])
569
AC_REQUIRE([gt_PRINTF_POSIX])
570
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
571
AC_REQUIRE([AC_FUNC_MMAP])dnl
572
AC_REQUIRE([jm_GLIBC21])dnl
573
AC_REQUIRE([gt_INTDIV0])dnl
574
AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
575
AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
576
AC_REQUIRE([gt_INTTYPES_PRI])dnl
577
AC_REQUIRE([gl_XSIZE])dnl
579
AC_CHECK_TYPE([ptrdiff_t], ,
580
[AC_DEFINE([ptrdiff_t], [long],
581
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
583
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
584
stdlib.h string.h unistd.h sys/param.h])
585
AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
586
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
587
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
590
dnl Use the _snprintf function only if it is declared (because on NetBSD it
591
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
592
gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
593
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
595
dnl Use the *_unlocked functions only if they are declared.
596
dnl (because some of them were defined without being declared in Solaris
597
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
598
dnl on Solaris 2.5.1 to run on Solaris 2.6).
599
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
600
gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
601
gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
602
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
604
case $gt_cv_func_printf_posix in
605
*yes) HAVE_POSIX_PRINTF=1 ;;
606
*) HAVE_POSIX_PRINTF=0 ;;
608
AC_SUBST([HAVE_POSIX_PRINTF])
609
if test "$ac_cv_func_asprintf" = yes; then
614
AC_SUBST([HAVE_ASPRINTF])
615
if test "$ac_cv_func_snprintf" = yes; then
620
AC_SUBST([HAVE_SNPRINTF])
621
if test "$ac_cv_func_wprintf" = yes; then
626
AC_SUBST([HAVE_WPRINTF])
630
if test $ac_cv_header_locale_h = yes; then
634
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
635
dnl because plural.y uses bison specific features. It requires at least
636
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
638
dnl bison is only needed for the maintainer (who touches plural.y). But in
639
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
640
dnl the rule in general Makefile. Now, some people carelessly touch the
641
dnl files or have a broken "make" program, hence the plural.c rule will
642
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
643
dnl present or too old.
644
AC_CHECK_PROGS([INTLBISON], [bison])
645
if test -z "$INTLBISON"; then
648
dnl Found it, now check the version.
649
AC_MSG_CHECKING([version of bison])
650
changequote(<<,>>)dnl
651
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
652
case $ac_prog_version in
653
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
654
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
656
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
657
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
659
AC_MSG_RESULT([$ac_prog_version])
661
if test $ac_verc_fail = yes; then
667
dnl gt_CHECK_DECL(FUNC, INCLUDES)
668
dnl Check whether a function is declared.
669
AC_DEFUN([gt_CHECK_DECL],
671
AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
672
[AC_TRY_COMPILE([$2], [
674
char *p = (char *) $1;
676
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
677
if test $ac_cv_have_decl_$1 = yes; then
682
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
683
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
687
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
688
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
690
# po.m4 serial 3 (gettext-0.14)
691
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
692
dnl This file is free software, distributed under the terms of the GNU
693
dnl General Public License. As a special exception to the GNU General
694
dnl Public License, this file may be distributed as part of a program
695
dnl that contains a configuration script generated by Autoconf, under
696
dnl the same distribution terms as the rest of that program.
698
dnl This file can can be used in projects which are not available under
699
dnl the GNU General Public License or the GNU Library General Public
700
dnl License but which still want to provide support for the GNU gettext
702
dnl Please note that the actual code of the GNU gettext library is covered
703
dnl by the GNU Library General Public License, and the rest of the GNU
704
dnl gettext package package is covered by the GNU General Public License.
705
dnl They are *not* in the public domain.
708
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
709
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
711
dnl Checks for all prerequisites of the po subdirectory.
712
AC_DEFUN([AM_PO_SUBDIRS],
714
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
715
AC_REQUIRE([AC_PROG_INSTALL])dnl
716
AC_REQUIRE([AM_MKINSTALLDIRS])dnl
717
AC_REQUIRE([AM_NLS])dnl
719
dnl Perform the following tests also if --disable-nls has been given,
720
dnl because they are needed for "make dist" to work.
722
dnl Search for GNU msgfmt in the PATH.
723
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
724
dnl The second test excludes FreeBSD msgfmt.
725
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
726
[$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
727
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
729
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
731
dnl Search for GNU xgettext 0.12 or newer in the PATH.
732
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
733
dnl The second test excludes FreeBSD xgettext.
734
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
735
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
736
(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)],
738
dnl Remove leftover from FreeBSD xgettext call.
741
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
742
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
743
[$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
745
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
746
dnl Test whether we really found GNU msgfmt.
747
if test "$GMSGFMT" != ":"; then
748
dnl If it is no GNU msgfmt we define it as : so that the
749
dnl Makefiles still can work.
750
if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
751
(if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
754
GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
756
[found $GMSGFMT program is not GNU msgfmt; ignore it])
761
dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
762
dnl Test whether we really found GNU xgettext.
763
if test "$XGETTEXT" != ":"; then
764
dnl If it is no GNU xgettext we define it as : so that the
765
dnl Makefiles still can work.
766
if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
767
(if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
771
[found xgettext program is not GNU xgettext; ignore it])
774
dnl Remove leftover from FreeBSD xgettext call.
779
for ac_file in $CONFIG_FILES; do
780
# Support "outfile[:infile[:infile...]]"
782
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
784
# PO directories have a Makefile.in generated from Makefile.in.in.
785
case "$ac_file" in */Makefile.in)
786
# Adjust a relative srcdir.
787
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
788
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
789
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
790
# In autoconf-2.13 it is called $ac_given_srcdir.
791
# In autoconf-2.50 it is called $srcdir.
792
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
793
case "$ac_given_srcdir" in
794
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
795
/*) top_srcdir="$ac_given_srcdir" ;;
796
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
798
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
799
rm -f "$ac_dir/POTFILES"
800
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
801
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
802
POMAKEFILEDEPS="POTFILES.in"
803
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
804
# on $ac_dir but don't depend on user-specified configuration
806
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
807
# The LINGUAS file contains the set of available languages.
808
if test -n "$OBSOLETE_ALL_LINGUAS"; then
809
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
811
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
812
# Hide the ALL_LINGUAS assigment from automake.
813
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
814
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
816
# The set of available languages was given in configure.in.
817
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
820
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
821
# Compute UPDATEPOFILES
822
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
823
# Compute DUMMYPOFILES
824
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
826
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
827
case "$ac_given_srcdir" in
829
*) srcdirpre='$(srcdir)/' ;;
835
for lang in $ALL_LINGUAS; do
836
POFILES="$POFILES $srcdirpre$lang.po"
837
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
838
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
839
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
841
# CATALOGS depends on both $ac_dir and the user's LINGUAS
842
# environment variable.
844
if test -n "$ALL_LINGUAS"; then
845
for presentlang in $ALL_LINGUAS; do
847
if test "%UNSET%" != "$LINGUAS"; then
848
desiredlanguages="$LINGUAS"
850
desiredlanguages="$ALL_LINGUAS"
852
for desiredlang in $desiredlanguages; do
853
# Use the presentlang catalog if desiredlang is
854
# a. equal to presentlang, or
855
# b. a variant of presentlang (because in this case,
856
# presentlang can be used as a fallback for messages
857
# which are not translated in the desiredlang catalog).
858
case "$desiredlang" in
859
"$presentlang"*) useit=yes;;
862
if test $useit = yes; then
863
INST_LINGUAS="$INST_LINGUAS $presentlang"
868
if test -n "$INST_LINGUAS"; then
869
for lang in $INST_LINGUAS; do
870
CATALOGS="$CATALOGS $lang.gmo"
873
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
874
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"
875
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
876
if test -f "$f"; then
878
*.orig | *.bak | *~) ;;
879
*) cat "$f" >> "$ac_dir/Makefile" ;;
887
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
888
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
890
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
891
# Capture the value of LINGUAS because we need it to compute CATALOGS.
892
LINGUAS="${LINGUAS-%UNSET%}"
896
dnl Postprocesses a Makefile in a directory containing PO files.
897
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
899
# When this code is run, in config.status, two variables have already been
901
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
902
# - LINGUAS is the value of the environment variable LINGUAS at configure
906
# Adjust a relative srcdir.
907
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
908
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
909
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
910
# In autoconf-2.13 it is called $ac_given_srcdir.
911
# In autoconf-2.50 it is called $srcdir.
912
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
913
case "$ac_given_srcdir" in
914
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
915
/*) top_srcdir="$ac_given_srcdir" ;;
916
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
919
# Find a way to echo strings without interpreting backslash.
920
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
923
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
924
gt_echo='printf %s\n'
935
# A sed script that extracts the value of VARIABLE from a Makefile.
937
# Test if the hold space is empty.
942
# Yes it was empty. Look if we have the expected variable definition.
943
/^[ ]*VARIABLE[ ]*=/{
944
# Seen the first line of the variable definition.
945
s/^[ ]*VARIABLE[ ]*=//
950
# Here we are processing a line from the variable definition.
951
# Remove comment, more precisely replace it with a space.
953
# See if the line ends in a backslash.
957
# Print the line, without the trailing backslash.
960
# There was no trailing backslash. The end of the variable definition is
961
# reached. Clear the hold space.
966
# A trailing backslash means that the variable definition continues in the
967
# next line. Put a nonempty string into the hold space to indicate this.
974
# Set POTFILES to the value of the Makefile variable POTFILES.
975
sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
976
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
977
# Compute POTFILES_DEPS as
978
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
980
for file in $POTFILES; do
981
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
985
if test -n "$OBSOLETE_ALL_LINGUAS"; then
986
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
988
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
989
# The LINGUAS file contains the set of available languages.
990
ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
991
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
993
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
994
sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
995
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
997
# Hide the ALL_LINGUAS assigment from automake.
998
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1000
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
1001
# Compute UPDATEPOFILES
1002
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
1003
# Compute DUMMYPOFILES
1004
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
1006
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
1007
# Compute PROPERTIESFILES
1008
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
1009
# Compute CLASSFILES
1010
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
1012
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
1014
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
1015
# Compute RESOURCESDLLFILES
1016
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
1017
case "$ac_given_srcdir" in
1019
*) srcdirpre='$(srcdir)/' ;;
1030
for lang in $ALL_LINGUAS; do
1031
POFILES="$POFILES $srcdirpre$lang.po"
1032
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1033
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1034
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1035
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
1036
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
1037
QMFILES="$QMFILES $srcdirpre$lang.qm"
1038
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1039
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
1040
frobbedlang=`echo $lang | sed -e 's/_/-/g'`
1041
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
1043
# CATALOGS depends on both $ac_dir and the user's LINGUAS
1044
# environment variable.
1046
if test -n "$ALL_LINGUAS"; then
1047
for presentlang in $ALL_LINGUAS; do
1049
if test "%UNSET%" != "$LINGUAS"; then
1050
desiredlanguages="$LINGUAS"
1052
desiredlanguages="$ALL_LINGUAS"
1054
for desiredlang in $desiredlanguages; do
1055
# Use the presentlang catalog if desiredlang is
1056
# a. equal to presentlang, or
1057
# b. a variant of presentlang (because in this case,
1058
# presentlang can be used as a fallback for messages
1059
# which are not translated in the desiredlang catalog).
1060
case "$desiredlang" in
1061
"$presentlang"*) useit=yes;;
1064
if test $useit = yes; then
1065
INST_LINGUAS="$INST_LINGUAS $presentlang"
1074
if test -n "$INST_LINGUAS"; then
1075
for lang in $INST_LINGUAS; do
1076
CATALOGS="$CATALOGS $lang.gmo"
1077
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
1078
QTCATALOGS="$QTCATALOGS $lang.qm"
1079
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1080
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
1081
frobbedlang=`echo $lang | sed -e 's/_/-/g'`
1082
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
1086
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"
1087
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
1088
# Add dependencies that cannot be formulated as a simple suffix rule.
1089
for lang in $ALL_LINGUAS; do
1090
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
1091
cat >> "$ac_file.tmp" <<EOF
1092
$frobbedlang.msg: $lang.po
1093
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
1094
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1098
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
1099
# Add dependencies that cannot be formulated as a simple suffix rule.
1100
for lang in $ALL_LINGUAS; do
1101
frobbedlang=`echo $lang | sed -e 's/_/-/g'`
1102
cat >> "$ac_file.tmp" <<EOF
1103
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
1104
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
1105
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
1109
if test -n "$POMAKEFILEDEPS"; then
1110
cat >> "$ac_file.tmp" <<EOF
1111
Makefile: $POMAKEFILEDEPS
1114
mv "$ac_file.tmp" "$ac_file"
1117
# nls.m4 serial 1 (gettext-0.12)
1118
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1119
dnl This file is free software, distributed under the terms of the GNU
1120
dnl General Public License. As a special exception to the GNU General
1121
dnl Public License, this file may be distributed as part of a program
1122
dnl that contains a configuration script generated by Autoconf, under
1123
dnl the same distribution terms as the rest of that program.
1125
dnl This file can can be used in projects which are not available under
1126
dnl the GNU General Public License or the GNU Library General Public
1127
dnl License but which still want to provide support for the GNU gettext
1129
dnl Please note that the actual code of the GNU gettext library is covered
1130
dnl by the GNU Library General Public License, and the rest of the GNU
1131
dnl gettext package package is covered by the GNU General Public License.
1132
dnl They are *not* in the public domain.
1135
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1136
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1140
AC_MSG_CHECKING([whether NLS is requested])
1141
dnl Default is enabled NLS
1143
[ --disable-nls do not use Native Language Support],
1144
USE_NLS=$enableval, USE_NLS=yes)
1145
AC_MSG_RESULT($USE_NLS)
1149
AC_DEFUN([AM_MKINSTALLDIRS],
1151
dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1152
dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1153
dnl Try to locate it.
1155
if test -n "$ac_aux_dir"; then
1156
case "$ac_aux_dir" in
1157
/*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1158
*) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1161
if test -z "$MKINSTALLDIRS"; then
1162
MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1164
AC_SUBST(MKINSTALLDIRS)
1167
# progtest.m4 serial 3 (gettext-0.12)
1168
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1169
dnl This file is free software, distributed under the terms of the GNU
1170
dnl General Public License. As a special exception to the GNU General
1171
dnl Public License, this file may be distributed as part of a program
1172
dnl that contains a configuration script generated by Autoconf, under
1173
dnl the same distribution terms as the rest of that program.
1175
dnl This file can can be used in projects which are not available under
1176
dnl the GNU General Public License or the GNU Library General Public
1177
dnl License but which still want to provide support for the GNU gettext
1179
dnl Please note that the actual code of the GNU gettext library is covered
1180
dnl by the GNU Library General Public License, and the rest of the GNU
1181
dnl gettext package package is covered by the GNU General Public License.
1182
dnl They are *not* in the public domain.
1185
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
1187
# Search path for a program which passes the given test.
1189
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1190
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1191
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1193
# Prepare PATH_SEPARATOR.
1194
# The user is always right.
1195
if test "${PATH_SEPARATOR+set}" != set; then
1196
echo "#! /bin/sh" >conf$$.sh
1197
echo "exit 0" >>conf$$.sh
1199
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1207
# Find out how to test for executable files. Don't use a zero-byte file,
1208
# as systems may use methods other than mode bits to determine executability.
1209
cat >conf$$.file <<_ASEOF
1213
chmod +x conf$$.file
1214
if test -x conf$$.file >/dev/null 2>&1; then
1215
ac_executable_p="test -x"
1217
ac_executable_p="test -f"
1221
# Extract the first word of "$2", so it can be a program name with args.
1222
set dummy $2; ac_word=[$]2
1223
AC_MSG_CHECKING([for $ac_word])
1224
AC_CACHE_VAL(ac_cv_path_$1,
1226
[[\\/]]* | ?:[[\\/]]*)
1227
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1230
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
1231
for ac_dir in ifelse([$5], , $PATH, [$5]); do
1233
test -z "$ac_dir" && ac_dir=.
1234
for ac_exec_ext in '' $ac_executable_extensions; do
1235
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
1237
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
1244
dnl If no 4th arg is given, leave the cache variable unset,
1245
dnl so AC_PATH_PROGS will keep looking.
1246
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1251
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1252
AC_MSG_RESULT([$]$1)
1259
# lib-prefix.m4 serial 3 (gettext-0.13)
1260
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1261
dnl This file is free software, distributed under the terms of the GNU
1262
dnl General Public License. As a special exception to the GNU General
1263
dnl Public License, this file may be distributed as part of a program
1264
dnl that contains a configuration script generated by Autoconf, under
1265
dnl the same distribution terms as the rest of that program.
1267
dnl From Bruno Haible.
1269
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1270
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1271
dnl require excessive bracketing.
1272
ifdef([AC_HELP_STRING],
1273
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1274
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1276
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1277
dnl to access previously installed libraries. The basic assumption is that
1278
dnl a user will want packages to use other packages he previously installed
1279
dnl with the same --prefix option.
1280
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1281
dnl libraries, but is otherwise very convenient.
1282
AC_DEFUN([AC_LIB_PREFIX],
1284
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1285
AC_REQUIRE([AC_PROG_CC])
1286
AC_REQUIRE([AC_CANONICAL_HOST])
1287
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1288
dnl By default, look in $includedir and $libdir.
1290
AC_LIB_WITH_FINAL_PREFIX([
1291
eval additional_includedir=\"$includedir\"
1292
eval additional_libdir=\"$libdir\"
1294
AC_LIB_ARG_WITH([lib-prefix],
1295
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1296
--without-lib-prefix don't search for libraries in includedir and libdir],
1298
if test "X$withval" = "Xno"; then
1301
if test "X$withval" = "X"; then
1302
AC_LIB_WITH_FINAL_PREFIX([
1303
eval additional_includedir=\"$includedir\"
1304
eval additional_libdir=\"$libdir\"
1307
additional_includedir="$withval/include"
1308
additional_libdir="$withval/lib"
1312
if test $use_additional = yes; then
1313
dnl Potentially add $additional_includedir to $CPPFLAGS.
1314
dnl But don't add it
1315
dnl 1. if it's the standard /usr/include,
1316
dnl 2. if it's already present in $CPPFLAGS,
1317
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
1318
dnl 4. if it doesn't exist as a directory.
1319
if test "X$additional_includedir" != "X/usr/include"; then
1321
for x in $CPPFLAGS; do
1322
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1323
if test "X$x" = "X-I$additional_includedir"; then
1328
if test -z "$haveit"; then
1329
if test "X$additional_includedir" = "X/usr/local/include"; then
1330
if test -n "$GCC"; then
1332
linux*) haveit=yes;;
1336
if test -z "$haveit"; then
1337
if test -d "$additional_includedir"; then
1338
dnl Really add $additional_includedir to $CPPFLAGS.
1339
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1344
dnl Potentially add $additional_libdir to $LDFLAGS.
1345
dnl But don't add it
1346
dnl 1. if it's the standard /usr/lib,
1347
dnl 2. if it's already present in $LDFLAGS,
1348
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
1349
dnl 4. if it doesn't exist as a directory.
1350
if test "X$additional_libdir" != "X/usr/lib"; then
1352
for x in $LDFLAGS; do
1353
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1354
if test "X$x" = "X-L$additional_libdir"; then
1359
if test -z "$haveit"; then
1360
if test "X$additional_libdir" = "X/usr/local/lib"; then
1361
if test -n "$GCC"; then
1363
linux*) haveit=yes;;
1367
if test -z "$haveit"; then
1368
if test -d "$additional_libdir"; then
1369
dnl Really add $additional_libdir to $LDFLAGS.
1370
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1378
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1379
dnl acl_final_exec_prefix, containing the values to which $prefix and
1380
dnl $exec_prefix will expand at the end of the configure script.
1381
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1383
dnl Unfortunately, prefix and exec_prefix get only finally determined
1384
dnl at the end of configure.
1385
if test "X$prefix" = "XNONE"; then
1386
acl_final_prefix="$ac_default_prefix"
1388
acl_final_prefix="$prefix"
1390
if test "X$exec_prefix" = "XNONE"; then
1391
acl_final_exec_prefix='${prefix}'
1393
acl_final_exec_prefix="$exec_prefix"
1395
acl_save_prefix="$prefix"
1396
prefix="$acl_final_prefix"
1397
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1398
prefix="$acl_save_prefix"
1401
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1402
dnl variables prefix and exec_prefix bound to the values they will have
1403
dnl at the end of the configure script.
1404
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1406
acl_save_prefix="$prefix"
1407
prefix="$acl_final_prefix"
1408
acl_save_exec_prefix="$exec_prefix"
1409
exec_prefix="$acl_final_exec_prefix"
1411
exec_prefix="$acl_save_exec_prefix"
1412
prefix="$acl_save_prefix"
1415
# lib-link.m4 serial 4 (gettext-0.12)
1416
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1417
dnl This file is free software, distributed under the terms of the GNU
1418
dnl General Public License. As a special exception to the GNU General
1419
dnl Public License, this file may be distributed as part of a program
1420
dnl that contains a configuration script generated by Autoconf, under
1421
dnl the same distribution terms as the rest of that program.
1423
dnl From Bruno Haible.
1425
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1426
dnl the libraries corresponding to explicit and implicit dependencies.
1427
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1428
dnl augments the CPPFLAGS variable.
1429
AC_DEFUN([AC_LIB_LINKFLAGS],
1431
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1432
AC_REQUIRE([AC_LIB_RPATH])
1433
define([Name],[translit([$1],[./-], [___])])
1434
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1435
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1436
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1437
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1438
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1439
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1440
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1442
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1443
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1444
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1445
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1447
AC_SUBST([LTLIB]NAME)
1448
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1449
dnl results of this search when this library appears as a dependency.
1455
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1456
dnl searches for libname and the libraries corresponding to explicit and
1457
dnl implicit dependencies, together with the specified include files and
1458
dnl the ability to compile and link the specified testcode. If found, it
1459
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1460
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1461
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1462
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1463
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1465
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1466
AC_REQUIRE([AC_LIB_RPATH])
1467
define([Name],[translit([$1],[./-], [___])])
1468
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1469
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1471
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1473
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1475
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1476
dnl because if the user has installed lib[]Name and not disabled its use
1477
dnl via --without-lib[]Name-prefix, he wants to use it.
1478
ac_save_CPPFLAGS="$CPPFLAGS"
1479
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1481
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1482
ac_save_LIBS="$LIBS"
1483
LIBS="$LIBS $LIB[]NAME"
1484
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1485
LIBS="$ac_save_LIBS"
1487
if test "$ac_cv_lib[]Name" = yes; then
1489
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1490
AC_MSG_CHECKING([how to link with lib[]$1])
1491
AC_MSG_RESULT([$LIB[]NAME])
1494
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1495
dnl $INC[]NAME either.
1496
CPPFLAGS="$ac_save_CPPFLAGS"
1500
AC_SUBST([HAVE_LIB]NAME)
1502
AC_SUBST([LTLIB]NAME)
1507
dnl Determine the platform dependent parameters needed to use rpath:
1508
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1509
dnl hardcode_direct, hardcode_minus_L.
1510
AC_DEFUN([AC_LIB_RPATH],
1512
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
1513
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
1514
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
1515
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1516
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1517
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1518
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1524
libext="$acl_cv_libext"
1525
shlibext="$acl_cv_shlibext"
1526
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1527
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1528
hardcode_direct="$acl_cv_hardcode_direct"
1529
hardcode_minus_L="$acl_cv_hardcode_minus_L"
1530
dnl Determine whether the user wants rpath handling at all.
1531
AC_ARG_ENABLE(rpath,
1532
[ --disable-rpath do not hardcode runtime library paths],
1533
:, enable_rpath=yes)
1536
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1537
dnl the libraries corresponding to explicit and implicit dependencies.
1538
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1539
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1541
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1542
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1543
dnl By default, look in $includedir and $libdir.
1545
AC_LIB_WITH_FINAL_PREFIX([
1546
eval additional_includedir=\"$includedir\"
1547
eval additional_libdir=\"$libdir\"
1549
AC_LIB_ARG_WITH([lib$1-prefix],
1550
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
1551
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
1553
if test "X$withval" = "Xno"; then
1556
if test "X$withval" = "X"; then
1557
AC_LIB_WITH_FINAL_PREFIX([
1558
eval additional_includedir=\"$includedir\"
1559
eval additional_libdir=\"$libdir\"
1562
additional_includedir="$withval/include"
1563
additional_libdir="$withval/lib"
1567
dnl Search the library and its dependencies in $additional_libdir and
1568
dnl $LDFLAGS. Using breadth-first-seach.
1574
names_already_handled=
1575
names_next_round='$1 $2'
1576
while test -n "$names_next_round"; do
1577
names_this_round="$names_next_round"
1579
for name in $names_this_round; do
1581
for n in $names_already_handled; do
1582
if test "$n" = "$name"; then
1587
if test -z "$already_handled"; then
1588
names_already_handled="$names_already_handled $name"
1589
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1590
dnl or AC_LIB_HAVE_LINKFLAGS call.
1591
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1592
eval value=\"\$HAVE_LIB$uppername\"
1593
if test -n "$value"; then
1594
if test "$value" = yes; then
1595
eval value=\"\$LIB$uppername\"
1596
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1597
eval value=\"\$LTLIB$uppername\"
1598
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1600
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1601
dnl that this library doesn't exist. So just drop it.
1605
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1606
dnl and the already constructed $LIBNAME/$LTLIBNAME.
1611
if test $use_additional = yes; then
1612
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1613
found_dir="$additional_libdir"
1614
found_so="$additional_libdir/lib$name.$shlibext"
1615
if test -f "$additional_libdir/lib$name.la"; then
1616
found_la="$additional_libdir/lib$name.la"
1619
if test -f "$additional_libdir/lib$name.$libext"; then
1620
found_dir="$additional_libdir"
1621
found_a="$additional_libdir/lib$name.$libext"
1622
if test -f "$additional_libdir/lib$name.la"; then
1623
found_la="$additional_libdir/lib$name.la"
1628
if test "X$found_dir" = "X"; then
1629
for x in $LDFLAGS $LTLIB[]NAME; do
1630
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1633
dir=`echo "X$x" | sed -e 's/^X-L//'`
1634
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1636
found_so="$dir/lib$name.$shlibext"
1637
if test -f "$dir/lib$name.la"; then
1638
found_la="$dir/lib$name.la"
1641
if test -f "$dir/lib$name.$libext"; then
1643
found_a="$dir/lib$name.$libext"
1644
if test -f "$dir/lib$name.la"; then
1645
found_la="$dir/lib$name.la"
1651
if test "X$found_dir" != "X"; then
1656
if test "X$found_dir" != "X"; then
1657
dnl Found the library.
1658
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1659
if test "X$found_so" != "X"; then
1660
dnl Linking with a shared library. We attempt to hardcode its
1661
dnl directory into the executable's runpath, unless it's the
1662
dnl standard /usr/lib.
1663
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1664
dnl No hardcoding is needed.
1665
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1667
dnl Use an explicit option to hardcode DIR into the resulting
1669
dnl Potentially add DIR to ltrpathdirs.
1670
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1672
for x in $ltrpathdirs; do
1673
if test "X$x" = "X$found_dir"; then
1678
if test -z "$haveit"; then
1679
ltrpathdirs="$ltrpathdirs $found_dir"
1681
dnl The hardcoding into $LIBNAME is system dependent.
1682
if test "$hardcode_direct" = yes; then
1683
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1684
dnl resulting binary.
1685
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1687
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1688
dnl Use an explicit option to hardcode DIR into the resulting
1690
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1691
dnl Potentially add DIR to rpathdirs.
1692
dnl The rpathdirs will be appended to $LIBNAME at the end.
1694
for x in $rpathdirs; do
1695
if test "X$x" = "X$found_dir"; then
1700
if test -z "$haveit"; then
1701
rpathdirs="$rpathdirs $found_dir"
1704
dnl Rely on "-L$found_dir".
1705
dnl But don't add it if it's already contained in the LDFLAGS
1706
dnl or the already constructed $LIBNAME
1708
for x in $LDFLAGS $LIB[]NAME; do
1709
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1710
if test "X$x" = "X-L$found_dir"; then
1715
if test -z "$haveit"; then
1716
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1718
if test "$hardcode_minus_L" != no; then
1719
dnl FIXME: Not sure whether we should use
1720
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1722
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1724
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1725
dnl here, because this doesn't fit in flags passed to the
1726
dnl compiler. So give up. No hardcoding. This affects only
1727
dnl very old systems.
1728
dnl FIXME: Not sure whether we should use
1729
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1731
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1737
if test "X$found_a" != "X"; then
1738
dnl Linking with a static library.
1739
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1741
dnl We shouldn't come here, but anyway it's good to have a
1743
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1746
dnl Assume the include files are nearby.
1747
additional_includedir=
1748
case "$found_dir" in
1750
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1751
additional_includedir="$basedir/include"
1754
if test "X$additional_includedir" != "X"; then
1755
dnl Potentially add $additional_includedir to $INCNAME.
1756
dnl But don't add it
1757
dnl 1. if it's the standard /usr/include,
1758
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
1759
dnl 3. if it's already present in $CPPFLAGS or the already
1760
dnl constructed $INCNAME,
1761
dnl 4. if it doesn't exist as a directory.
1762
if test "X$additional_includedir" != "X/usr/include"; then
1764
if test "X$additional_includedir" = "X/usr/local/include"; then
1765
if test -n "$GCC"; then
1767
linux*) haveit=yes;;
1771
if test -z "$haveit"; then
1772
for x in $CPPFLAGS $INC[]NAME; do
1773
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1774
if test "X$x" = "X-I$additional_includedir"; then
1779
if test -z "$haveit"; then
1780
if test -d "$additional_includedir"; then
1781
dnl Really add $additional_includedir to $INCNAME.
1782
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
1788
dnl Look for dependencies.
1789
if test -n "$found_la"; then
1790
dnl Read the .la file. It defines the variables
1791
dnl dlname, library_names, old_library, dependency_libs, current,
1792
dnl age, revision, installed, dlopen, dlpreopen, libdir.
1793
save_libdir="$libdir"
1795
*/* | *\\*) . "$found_la" ;;
1796
*) . "./$found_la" ;;
1798
libdir="$save_libdir"
1799
dnl We use only dependency_libs.
1800
for dep in $dependency_libs; do
1803
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
1804
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
1805
dnl But don't add it
1806
dnl 1. if it's the standard /usr/lib,
1807
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
1808
dnl 3. if it's already present in $LDFLAGS or the already
1809
dnl constructed $LIBNAME,
1810
dnl 4. if it doesn't exist as a directory.
1811
if test "X$additional_libdir" != "X/usr/lib"; then
1813
if test "X$additional_libdir" = "X/usr/local/lib"; then
1814
if test -n "$GCC"; then
1816
linux*) haveit=yes;;
1820
if test -z "$haveit"; then
1822
for x in $LDFLAGS $LIB[]NAME; do
1823
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1824
if test "X$x" = "X-L$additional_libdir"; then
1829
if test -z "$haveit"; then
1830
if test -d "$additional_libdir"; then
1831
dnl Really add $additional_libdir to $LIBNAME.
1832
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
1836
for x in $LDFLAGS $LTLIB[]NAME; do
1837
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1838
if test "X$x" = "X-L$additional_libdir"; then
1843
if test -z "$haveit"; then
1844
if test -d "$additional_libdir"; then
1845
dnl Really add $additional_libdir to $LTLIBNAME.
1846
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
1853
dir=`echo "X$dep" | sed -e 's/^X-R//'`
1854
if test "$enable_rpath" != no; then
1855
dnl Potentially add DIR to rpathdirs.
1856
dnl The rpathdirs will be appended to $LIBNAME at the end.
1858
for x in $rpathdirs; do
1859
if test "X$x" = "X$dir"; then
1864
if test -z "$haveit"; then
1865
rpathdirs="$rpathdirs $dir"
1867
dnl Potentially add DIR to ltrpathdirs.
1868
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1870
for x in $ltrpathdirs; do
1871
if test "X$x" = "X$dir"; then
1876
if test -z "$haveit"; then
1877
ltrpathdirs="$ltrpathdirs $dir"
1882
dnl Handle this in the next round.
1883
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1886
dnl Handle this in the next round. Throw away the .la's
1887
dnl directory; it is already contained in a preceding -L
1889
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1892
dnl Most likely an immediate library name.
1893
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1894
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1900
dnl Didn't find the library; assume it is in the system directories
1901
dnl known to the linker and runtime loader. (All the system
1902
dnl directories known to the linker should also be known to the
1903
dnl runtime loader, otherwise the system is severely misconfigured.)
1904
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1905
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1911
if test "X$rpathdirs" != "X"; then
1912
if test -n "$hardcode_libdir_separator"; then
1913
dnl Weird platform: only the last -rpath option counts, the user must
1914
dnl pass all path elements in one option. We can arrange that for a
1915
dnl single library, but not when more than one $LIBNAMEs are used.
1917
for found_dir in $rpathdirs; do
1918
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
1920
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
1921
acl_save_libdir="$libdir"
1923
eval flag=\"$hardcode_libdir_flag_spec\"
1924
libdir="$acl_save_libdir"
1925
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1927
dnl The -rpath options are cumulative.
1928
for found_dir in $rpathdirs; do
1929
acl_save_libdir="$libdir"
1931
eval flag=\"$hardcode_libdir_flag_spec\"
1932
libdir="$acl_save_libdir"
1933
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1937
if test "X$ltrpathdirs" != "X"; then
1938
dnl When using libtool, the option that works for both libraries and
1939
dnl executables is -R. The -R options are cumulative.
1940
for found_dir in $ltrpathdirs; do
1941
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1946
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1947
dnl unless already present in VAR.
1948
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1949
dnl contains two or three consecutive elements that belong together.
1950
AC_DEFUN([AC_LIB_APPENDTOVAR],
1952
for element in [$2]; do
1955
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1956
if test "X$x" = "X$element"; then
1961
if test -z "$haveit"; then
1962
[$1]="${[$1]}${[$1]:+ }$element"
1967
# lib-ld.m4 serial 3 (gettext-0.13)
1968
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1969
dnl This file is free software, distributed under the terms of the GNU
1970
dnl General Public License. As a special exception to the GNU General
1971
dnl Public License, this file may be distributed as part of a program
1972
dnl that contains a configuration script generated by Autoconf, under
1973
dnl the same distribution terms as the rest of that program.
1975
dnl Subroutines of libtool.m4,
1976
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1977
dnl with libtool.m4.
1979
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1980
AC_DEFUN([AC_LIB_PROG_LD_GNU],
1981
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1982
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1983
case `$LD -v 2>&1 </dev/null` in
1984
*GNU* | *'with BFD'*)
1985
acl_cv_prog_gnu_ld=yes ;;
1987
acl_cv_prog_gnu_ld=no ;;
1989
with_gnu_ld=$acl_cv_prog_gnu_ld
1992
dnl From libtool-1.4. Sets the variable LD.
1993
AC_DEFUN([AC_LIB_PROG_LD],
1994
[AC_ARG_WITH(gnu-ld,
1995
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1996
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1997
AC_REQUIRE([AC_PROG_CC])dnl
1998
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1999
# Prepare PATH_SEPARATOR.
2000
# The user is always right.
2001
if test "${PATH_SEPARATOR+set}" != set; then
2002
echo "#! /bin/sh" >conf$$.sh
2003
echo "exit 0" >>conf$$.sh
2005
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2013
if test "$GCC" = yes; then
2014
# Check if gcc -print-prog-name=ld gives a path.
2015
AC_MSG_CHECKING([for ld used by GCC])
2018
# gcc leaves a trailing carriage return which upsets mingw
2019
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2021
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2024
# Accept absolute paths.
2025
[[\\/]* | [A-Za-z]:[\\/]*)]
2026
[re_direlt='/[^/][^/]*/\.\./']
2027
# Canonicalize the path of ld
2028
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2029
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2030
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2032
test -z "$LD" && LD="$ac_prog"
2035
# If it fails, then pretend we aren't using GCC.
2039
# If it is relative, then search for the first ld in PATH.
2043
elif test "$with_gnu_ld" = yes; then
2044
AC_MSG_CHECKING([for GNU ld])
2046
AC_MSG_CHECKING([for non-GNU ld])
2048
AC_CACHE_VAL(acl_cv_path_LD,
2049
[if test -z "$LD"; then
2050
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2051
for ac_dir in $PATH; do
2052
test -z "$ac_dir" && ac_dir=.
2053
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2054
acl_cv_path_LD="$ac_dir/$ac_prog"
2055
# Check to see if the program is GNU ld. I'd rather use --version,
2056
# but apparently some GNU ld's only accept -v.
2057
# Break only if it was the GNU/non-GNU ld that we prefer.
2058
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
2059
*GNU* | *'with BFD'*)
2060
test "$with_gnu_ld" != no && break ;;
2062
test "$with_gnu_ld" != yes && break ;;
2068
acl_cv_path_LD="$LD" # Let the user override the test with a path.
2070
LD="$acl_cv_path_LD"
2071
if test -n "$LD"; then
2076
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2080
# iconv.m4 serial AM4 (gettext-0.11.3)
2081
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2082
dnl This file is free software, distributed under the terms of the GNU
2083
dnl General Public License. As a special exception to the GNU General
2084
dnl Public License, this file may be distributed as part of a program
2085
dnl that contains a configuration script generated by Autoconf, under
2086
dnl the same distribution terms as the rest of that program.
2088
dnl From Bruno Haible.
2090
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2092
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2093
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2094
AC_REQUIRE([AC_LIB_RPATH])
2096
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2098
AC_LIB_LINKFLAGS_BODY([iconv])
2101
AC_DEFUN([AM_ICONV_LINK],
2103
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2104
dnl those with the standalone portable GNU libiconv installed).
2106
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2108
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2110
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2111
dnl because if the user has installed libiconv and not disabled its use
2112
dnl via --without-libiconv-prefix, he wants to use it. The first
2113
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2114
am_save_CPPFLAGS="$CPPFLAGS"
2115
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2117
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2118
am_cv_func_iconv="no, consider installing GNU libiconv"
2120
AC_TRY_LINK([#include <stdlib.h>
2121
#include <iconv.h>],
2122
[iconv_t cd = iconv_open("","");
2123
iconv(cd,NULL,NULL,NULL,NULL);
2125
am_cv_func_iconv=yes)
2126
if test "$am_cv_func_iconv" != yes; then
2127
am_save_LIBS="$LIBS"
2128
LIBS="$LIBS $LIBICONV"
2129
AC_TRY_LINK([#include <stdlib.h>
2130
#include <iconv.h>],
2131
[iconv_t cd = iconv_open("","");
2132
iconv(cd,NULL,NULL,NULL,NULL);
2135
am_cv_func_iconv=yes)
2136
LIBS="$am_save_LIBS"
2139
if test "$am_cv_func_iconv" = yes; then
2140
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2142
if test "$am_cv_lib_iconv" = yes; then
2143
AC_MSG_CHECKING([how to link with libiconv])
2144
AC_MSG_RESULT([$LIBICONV])
2146
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2148
CPPFLAGS="$am_save_CPPFLAGS"
2153
AC_SUBST(LTLIBICONV)
2156
AC_DEFUN([AM_ICONV],
2159
if test "$am_cv_func_iconv" = yes; then
2160
AC_MSG_CHECKING([for iconv declaration])
2161
AC_CACHE_VAL(am_cv_proto_iconv, [
2169
#if defined(__STDC__) || defined(__cplusplus)
2170
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2174
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2175
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);"])
2176
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2177
AC_MSG_RESULT([$]{ac_t:-
2178
}[$]am_cv_proto_iconv)
2179
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2180
[Define as const if the declaration of iconv() needs const.])
2184
# signed.m4 serial 1 (gettext-0.10.40)
2185
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2186
dnl This file is free software, distributed under the terms of the GNU
2187
dnl General Public License. As a special exception to the GNU General
2188
dnl Public License, this file may be distributed as part of a program
2189
dnl that contains a configuration script generated by Autoconf, under
2190
dnl the same distribution terms as the rest of that program.
2192
dnl From Bruno Haible.
2194
AC_DEFUN([bh_C_SIGNED],
2196
AC_CACHE_CHECK([for signed], bh_cv_c_signed,
2197
[AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
2198
if test $bh_cv_c_signed = no; then
2200
[Define to empty if the C compiler doesn't support this keyword.])
2204
# longlong.m4 serial 4
2205
dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2206
dnl This file is free software, distributed under the terms of the GNU
2207
dnl General Public License. As a special exception to the GNU General
2208
dnl Public License, this file may be distributed as part of a program
2209
dnl that contains a configuration script generated by Autoconf, under
2210
dnl the same distribution terms as the rest of that program.
2212
dnl From Paul Eggert.
2214
# Define HAVE_LONG_LONG if 'long long' works.
2216
AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2218
AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2219
[AC_TRY_LINK([long long ll = 1LL; int i = 63;],
2220
[long long llmax = (long long) -1;
2221
return ll << i | ll >> i | llmax / ll | llmax % ll;],
2222
ac_cv_type_long_long=yes,
2223
ac_cv_type_long_long=no)])
2224
if test $ac_cv_type_long_long = yes; then
2225
AC_DEFINE(HAVE_LONG_LONG, 1,
2226
[Define if you have the 'long long' type.])
2230
# longdouble.m4 serial 1 (gettext-0.12)
2231
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2232
dnl This file is free software, distributed under the terms of the GNU
2233
dnl General Public License. As a special exception to the GNU General
2234
dnl Public License, this file may be distributed as part of a program
2235
dnl that contains a configuration script generated by Autoconf, under
2236
dnl the same distribution terms as the rest of that program.
2238
dnl From Bruno Haible.
2239
dnl Test whether the compiler supports the 'long double' type.
2240
dnl Prerequisite: AC_PROG_CC
2242
AC_DEFUN([gt_TYPE_LONGDOUBLE],
2244
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
2245
[if test "$GCC" = yes; then
2246
gt_cv_c_long_double=yes
2249
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
2250
long double foo = 0.0;
2251
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
2252
int array [2*(sizeof(long double) >= sizeof(double)) - 1];
2254
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
2256
if test $gt_cv_c_long_double = yes; then
2257
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
2261
# wchar_t.m4 serial 1 (gettext-0.12)
2262
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2263
dnl This file is free software, distributed under the terms of the GNU
2264
dnl General Public License. As a special exception to the GNU General
2265
dnl Public License, this file may be distributed as part of a program
2266
dnl that contains a configuration script generated by Autoconf, under
2267
dnl the same distribution terms as the rest of that program.
2269
dnl From Bruno Haible.
2270
dnl Test whether <stddef.h> has the 'wchar_t' type.
2271
dnl Prerequisite: AC_PROG_CC
2273
AC_DEFUN([gt_TYPE_WCHAR_T],
2275
AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
2276
[AC_TRY_COMPILE([#include <stddef.h>
2277
wchar_t foo = (wchar_t)'\0';], ,
2278
gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
2279
if test $gt_cv_c_wchar_t = yes; then
2280
AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
2284
# wint_t.m4 serial 1 (gettext-0.12)
2285
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2286
dnl This file is free software, distributed under the terms of the GNU
2287
dnl General Public License. As a special exception to the GNU General
2288
dnl Public License, this file may be distributed as part of a program
2289
dnl that contains a configuration script generated by Autoconf, under
2290
dnl the same distribution terms as the rest of that program.
2292
dnl From Bruno Haible.
2293
dnl Test whether <wchar.h> has the 'wint_t' type.
2294
dnl Prerequisite: AC_PROG_CC
2296
AC_DEFUN([gt_TYPE_WINT_T],
2298
AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
2299
[AC_TRY_COMPILE([#include <wchar.h>
2300
wint_t foo = (wchar_t)'\0';], ,
2301
gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
2302
if test $gt_cv_c_wint_t = yes; then
2303
AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
2307
# inttypes_h.m4 serial 5 (gettext-0.12)
2308
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2309
dnl This file is free software, distributed under the terms of the GNU
2310
dnl General Public License. As a special exception to the GNU General
2311
dnl Public License, this file may be distributed as part of a program
2312
dnl that contains a configuration script generated by Autoconf, under
2313
dnl the same distribution terms as the rest of that program.
2315
dnl From Paul Eggert.
2317
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2318
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2320
AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2322
AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2324
[#include <sys/types.h>
2325
#include <inttypes.h>],
2326
[uintmax_t i = (uintmax_t) -1;],
2327
jm_ac_cv_header_inttypes_h=yes,
2328
jm_ac_cv_header_inttypes_h=no)])
2329
if test $jm_ac_cv_header_inttypes_h = yes; then
2330
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2331
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2332
and declares uintmax_t. ])
2336
# stdint_h.m4 serial 3 (gettext-0.12)
2337
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2338
dnl This file is free software, distributed under the terms of the GNU
2339
dnl General Public License. As a special exception to the GNU General
2340
dnl Public License, this file may be distributed as part of a program
2341
dnl that contains a configuration script generated by Autoconf, under
2342
dnl the same distribution terms as the rest of that program.
2344
dnl From Paul Eggert.
2346
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2347
# doesn't clash with <sys/types.h>, and declares uintmax_t.
2349
AC_DEFUN([jm_AC_HEADER_STDINT_H],
2351
AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2353
[#include <sys/types.h>
2354
#include <stdint.h>],
2355
[uintmax_t i = (uintmax_t) -1;],
2356
jm_ac_cv_header_stdint_h=yes,
2357
jm_ac_cv_header_stdint_h=no)])
2358
if test $jm_ac_cv_header_stdint_h = yes; then
2359
AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2360
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2361
and declares uintmax_t. ])
2365
# intmax.m4 serial 1 (gettext-0.12)
2366
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2367
dnl This file is free software, distributed under the terms of the GNU
2368
dnl General Public License. As a special exception to the GNU General
2369
dnl Public License, this file may be distributed as part of a program
2370
dnl that contains a configuration script generated by Autoconf, under
2371
dnl the same distribution terms as the rest of that program.
2373
dnl From Bruno Haible.
2374
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
2375
dnl find a replacement if it is lacking.
2377
AC_DEFUN([gt_TYPE_INTMAX_T],
2379
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2380
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2381
AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
2385
#if HAVE_STDINT_H_WITH_UINTMAX
2388
#if HAVE_INTTYPES_H_WITH_UINTMAX
2389
#include <inttypes.h>
2391
], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
2392
if test $gt_cv_c_intmax_t = yes; then
2393
AC_DEFINE(HAVE_INTMAX_T, 1,
2394
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
2398
# printf-posix.m4 serial 2 (gettext-0.13.1)
2399
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2400
dnl This file is free software, distributed under the terms of the GNU
2401
dnl General Public License. As a special exception to the GNU General
2402
dnl Public License, this file may be distributed as part of a program
2403
dnl that contains a configuration script generated by Autoconf, under
2404
dnl the same distribution terms as the rest of that program.
2406
dnl From Bruno Haible.
2407
dnl Test whether the printf() function supports POSIX/XSI format strings with
2410
AC_DEFUN([gt_PRINTF_POSIX],
2412
AC_REQUIRE([AC_PROG_CC])
2413
AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
2414
gt_cv_func_printf_posix,
2419
/* The string "%2$d %1$d", with dollar characters protected from the shell's
2420
dollar expansion (possibly an autoconf bug). */
2421
static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
2422
static char buf[100];
2425
sprintf (buf, format, 33, 55);
2426
return (strcmp (buf, "55 33") != 0);
2427
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
2429
AC_EGREP_CPP(notposix, [
2430
#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
2433
], gt_cv_func_printf_posix="guessing no",
2434
gt_cv_func_printf_posix="guessing yes")
2437
case $gt_cv_func_printf_posix in
2439
AC_DEFINE(HAVE_POSIX_PRINTF, 1,
2440
[Define if your printf() function supports format strings with positions.])
2445
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2446
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2447
dnl This file is free software, distributed under the terms of the GNU
2448
dnl General Public License. As a special exception to the GNU General
2449
dnl Public License, this file may be distributed as part of a program
2450
dnl that contains a configuration script generated by Autoconf, under
2451
dnl the same distribution terms as the rest of that program.
2453
# Test for the GNU C Library, version 2.1 or newer.
2454
# From Bruno Haible.
2456
AC_DEFUN([jm_GLIBC21],
2458
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2459
ac_cv_gnu_library_2_1,
2460
[AC_EGREP_CPP([Lucky GNU user],
2462
#include <features.h>
2463
#ifdef __GNU_LIBRARY__
2464
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2469
ac_cv_gnu_library_2_1=yes,
2470
ac_cv_gnu_library_2_1=no)
2474
GLIBC21="$ac_cv_gnu_library_2_1"
2478
# intdiv0.m4 serial 1 (gettext-0.11.3)
2479
dnl Copyright (C) 2002 Free Software Foundation, Inc.
2480
dnl This file is free software, distributed under the terms of the GNU
2481
dnl General Public License. As a special exception to the GNU General
2482
dnl Public License, this file may be distributed as part of a program
2483
dnl that contains a configuration script generated by Autoconf, under
2484
dnl the same distribution terms as the rest of that program.
2486
dnl From Bruno Haible.
2488
AC_DEFUN([gt_INTDIV0],
2490
AC_REQUIRE([AC_PROG_CC])dnl
2491
AC_REQUIRE([AC_CANONICAL_HOST])dnl
2493
AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2494
gt_cv_int_divbyzero_sigfpe,
2502
sigfpe_handler (int sig)
2504
sigfpe_handler (sig) int sig;
2507
/* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
2508
exit (sig != SIGFPE);
2518
signal (SIGFPE, sigfpe_handler);
2519
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
2520
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2521
signal (SIGTRAP, sigfpe_handler);
2523
/* Linux/SPARC yields signal SIGILL. */
2524
#if defined (__sparc__) && defined (__linux__)
2525
signal (SIGILL, sigfpe_handler);
2532
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2534
# Guess based on the CPU.
2536
alpha* | i[34567]86 | m68k | s390*)
2537
gt_cv_int_divbyzero_sigfpe="guessing yes";;
2539
gt_cv_int_divbyzero_sigfpe="guessing no";;
2543
case "$gt_cv_int_divbyzero_sigfpe" in
2547
AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2548
[Define if integer division by zero raises signal SIGFPE.])
2551
# uintmax_t.m4 serial 7 (gettext-0.12)
2552
dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2553
dnl This file is free software, distributed under the terms of the GNU
2554
dnl General Public License. As a special exception to the GNU General
2555
dnl Public License, this file may be distributed as part of a program
2556
dnl that contains a configuration script generated by Autoconf, under
2557
dnl the same distribution terms as the rest of that program.
2559
dnl From Paul Eggert.
2563
# Define uintmax_t to 'unsigned long' or 'unsigned long long'
2564
# if it is not already defined in <stdint.h> or <inttypes.h>.
2566
AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2568
AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2569
AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2570
if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2571
AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2572
test $ac_cv_type_unsigned_long_long = yes \
2573
&& ac_type='unsigned long long' \
2574
|| ac_type='unsigned long'
2575
AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2576
[Define to unsigned long or unsigned long long
2577
if <stdint.h> and <inttypes.h> don't define.])
2579
AC_DEFINE(HAVE_UINTMAX_T, 1,
2580
[Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2584
# ulonglong.m4 serial 3
2585
dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2586
dnl This file is free software, distributed under the terms of the GNU
2587
dnl General Public License. As a special exception to the GNU General
2588
dnl Public License, this file may be distributed as part of a program
2589
dnl that contains a configuration script generated by Autoconf, under
2590
dnl the same distribution terms as the rest of that program.
2592
dnl From Paul Eggert.
2594
# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2596
AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2598
AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2599
[AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2600
[unsigned long long ullmax = (unsigned long long) -1;
2601
return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2602
ac_cv_type_unsigned_long_long=yes,
2603
ac_cv_type_unsigned_long_long=no)])
2604
if test $ac_cv_type_unsigned_long_long = yes; then
2605
AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2606
[Define if you have the 'unsigned long long' type.])
2610
# inttypes.m4 serial 1 (gettext-0.11.4)
2611
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2612
dnl This file is free software, distributed under the terms of the GNU
2613
dnl General Public License. As a special exception to the GNU General
2614
dnl Public License, this file may be distributed as part of a program
2615
dnl that contains a configuration script generated by Autoconf, under
2616
dnl the same distribution terms as the rest of that program.
2618
dnl From Paul Eggert.
2620
# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2623
AC_DEFUN([gt_HEADER_INTTYPES_H],
2625
AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2628
[#include <sys/types.h>
2629
#include <inttypes.h>],
2630
[], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2632
if test $gt_cv_header_inttypes_h = yes; then
2633
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2634
[Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2638
# inttypes-pri.m4 serial 1 (gettext-0.11.4)
2639
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2640
dnl This file is free software, distributed under the terms of the GNU
2641
dnl General Public License. As a special exception to the GNU General
2642
dnl Public License, this file may be distributed as part of a program
2643
dnl that contains a configuration script generated by Autoconf, under
2644
dnl the same distribution terms as the rest of that program.
2646
dnl From Bruno Haible.
2648
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2649
# macros to non-string values. This is the case on AIX 4.3.3.
2651
AC_DEFUN([gt_INTTYPES_PRI],
2653
AC_REQUIRE([gt_HEADER_INTTYPES_H])
2654
if test $gt_cv_header_inttypes_h = yes; then
2655
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2656
gt_cv_inttypes_pri_broken,
2658
AC_TRY_COMPILE([#include <inttypes.h>
2662
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2665
if test "$gt_cv_inttypes_pri_broken" = yes; then
2666
AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2667
[Define if <inttypes.h> exists and defines unusable PRI* macros.])
2672
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2673
dnl This file is free software, distributed under the terms of the GNU
2674
dnl General Public License. As a special exception to the GNU General
2675
dnl Public License, this file may be distributed as part of a program
2676
dnl that contains a configuration script generated by Autoconf, under
2677
dnl the same distribution terms as the rest of that program.
2679
AC_DEFUN([gl_XSIZE],
2681
dnl Prerequisites of lib/xsize.h.
2682
AC_REQUIRE([gl_SIZE_MAX])
2683
AC_CHECK_HEADERS(stdint.h)
2686
# size_max.m4 serial 2
2687
dnl Copyright (C) 2003 Free Software Foundation, Inc.
2688
dnl This file is free software, distributed under the terms of the GNU
2689
dnl General Public License. As a special exception to the GNU General
2690
dnl Public License, this file may be distributed as part of a program
2691
dnl that contains a configuration script generated by Autoconf, under
2692
dnl the same distribution terms as the rest of that program.
2694
dnl From Bruno Haible.
2696
AC_DEFUN([gl_SIZE_MAX],
2698
AC_CHECK_HEADERS(stdint.h)
2699
dnl First test whether the system already has SIZE_MAX.
2700
AC_MSG_CHECKING([for SIZE_MAX])
2702
AC_EGREP_CPP([Found it], [
2711
if test -z "$result"; then
2712
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
2713
dnl than the type 'unsigned long'.
2714
dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
2715
dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
2716
_AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
2717
[#include <stddef.h>], result=?)
2718
_AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
2719
[#include <stddef.h>], result=?)
2720
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
2721
[#include <stddef.h>], result=?)
2722
if test "$fits_in_uint" = 1; then
2723
dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
2724
dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
2725
AC_TRY_COMPILE([#include <stddef.h>
2727
extern unsigned long foo;
2728
], [], fits_in_uint=0)
2730
if test -z "$result"; then
2731
if test "$fits_in_uint" = 1; then
2732
result="$res_hi$res_lo"U
2734
result="$res_hi$res_lo"UL
2737
dnl Shouldn't happen, but who knows...
2741
AC_MSG_RESULT([$result])
2742
if test "$result" != yes; then
2743
AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
2744
[Define as the maximum value of type 'size_t', if the system doesn't define it.])
2748
# codeset.m4 serial AM1 (gettext-0.10.40)
2749
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2750
dnl This file is free software, distributed under the terms of the GNU
2751
dnl General Public License. As a special exception to the GNU General
2752
dnl Public License, this file may be distributed as part of a program
2753
dnl that contains a configuration script generated by Autoconf, under
2754
dnl the same distribution terms as the rest of that program.
2756
dnl From Bruno Haible.
2758
AC_DEFUN([AM_LANGINFO_CODESET],
2760
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2761
[AC_TRY_LINK([#include <langinfo.h>],
2762
[char* cs = nl_langinfo(CODESET);],
2763
am_cv_langinfo_codeset=yes,
2764
am_cv_langinfo_codeset=no)
2766
if test $am_cv_langinfo_codeset = yes; then
2767
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2768
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2772
# lcmessage.m4 serial 3 (gettext-0.11.3)
2773
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2774
dnl This file is free software, distributed under the terms of the GNU
2775
dnl General Public License. As a special exception to the GNU General
2776
dnl Public License, this file may be distributed as part of a program
2777
dnl that contains a configuration script generated by Autoconf, under
2778
dnl the same distribution terms as the rest of that program.
2780
dnl This file can can be used in projects which are not available under
2781
dnl the GNU General Public License or the GNU Library General Public
2782
dnl License but which still want to provide support for the GNU gettext
2784
dnl Please note that the actual code of the GNU gettext library is covered
2785
dnl by the GNU Library General Public License, and the rest of the GNU
2786
dnl gettext package package is covered by the GNU General Public License.
2787
dnl They are *not* in the public domain.
2790
dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
2792
# Check whether LC_MESSAGES is available in <locale.h>.
2794
AC_DEFUN([AM_LC_MESSAGES],
2796
AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2797
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2798
am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2799
if test $am_cv_val_LC_MESSAGES = yes; then
2800
AC_DEFINE(HAVE_LC_MESSAGES, 1,
2801
[Define if your <locale.h> file defines LC_MESSAGES.])