396
# gettext.m4 serial 59 (gettext-0.16.1)
397
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
398
dnl This file is free software; the Free Software Foundation
399
dnl gives unlimited permission to copy and/or distribute it,
400
dnl with or without modifications, as long as this notice is preserved.
402
dnl This file can can be used in projects which are not available under
403
dnl the GNU General Public License or the GNU Library General Public
404
dnl License but which still want to provide support for the GNU gettext
406
dnl Please note that the actual code of the GNU gettext library is covered
407
dnl by the GNU Library General Public License, and the rest of the GNU
408
dnl gettext package package is covered by the GNU General Public License.
409
dnl They are *not* in the public domain.
412
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
413
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
415
dnl Macro to add for using GNU gettext.
417
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
418
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
419
dnl default (if it is not specified or empty) is 'no-libtool'.
420
dnl INTLSYMBOL should be 'external' for packages with no intl directory,
421
dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
422
dnl If INTLSYMBOL is 'use-libtool', then a libtool library
423
dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
424
dnl depending on --{enable,disable}-{shared,static} and on the presence of
425
dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
426
dnl $(top_builddir)/intl/libintl.a will be created.
427
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
428
dnl implementations (in libc or libintl) without the ngettext() function
429
dnl will be ignored. If NEEDSYMBOL is specified and is
430
dnl 'need-formatstring-macros', then GNU gettext implementations that don't
431
dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
432
dnl INTLDIR is used to find the intl libraries. If empty,
433
dnl the value `$(top_builddir)/intl/' is used.
435
dnl The result of the configuration is one of three cases:
436
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
438
dnl Catalog format: GNU --> install in $(datadir)
439
dnl Catalog extension: .mo after installation, .gmo in source tree
440
dnl 2) GNU gettext has been found in the system's C library.
441
dnl Catalog format: GNU --> install in $(datadir)
442
dnl Catalog extension: .mo after installation, .gmo in source tree
443
dnl 3) No internationalization, always use English msgid.
444
dnl Catalog format: none
445
dnl Catalog extension: none
446
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
447
dnl The use of .gmo is historical (it was needed to avoid overwriting the
448
dnl GNU format catalogs when building on a platform with an X/Open gettext),
449
dnl but we keep it in order not to force irrelevant filename changes on the
452
AC_DEFUN([AM_GNU_GETTEXT],
454
dnl Argument checking.
455
ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
456
[errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
458
ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
459
[errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
461
define([gt_included_intl],
462
ifelse([$1], [external],
463
ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
465
define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
467
AM_GNU_GETTEXT_NEED([$2])
469
AC_REQUIRE([AM_PO_SUBDIRS])dnl
470
ifelse(gt_included_intl, yes, [
471
AC_REQUIRE([AM_INTL_SUBDIR])dnl
474
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
475
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
476
AC_REQUIRE([AC_LIB_RPATH])
478
dnl Sometimes libintl requires libiconv, so first search for libiconv.
479
dnl Ideally we would do this search only after the
480
dnl if test "$USE_NLS" = "yes"; then
481
dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
482
dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
483
dnl the configure script would need to contain the same shell code
484
dnl again, outside any 'if'. There are two solutions:
485
dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
486
dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
487
dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
488
dnl documented, we avoid it.
489
ifelse(gt_included_intl, yes, , [
490
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
493
dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
499
ifelse(gt_included_intl, yes, [
500
BUILD_INCLUDED_LIBINTL=no
501
USE_INCLUDED_LIBINTL=no
507
dnl Add a version number to the cache macros.
508
case " $gt_needs " in
509
*" need-formatstring-macros "*) gt_api_version=3 ;;
510
*" need-ngettext "*) gt_api_version=2 ;;
511
*) gt_api_version=1 ;;
513
gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
514
gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
516
dnl If we use NLS figure out what method
517
if test "$USE_NLS" = "yes"; then
518
gt_use_preinstalled_gnugettext=no
519
ifelse(gt_included_intl, yes, [
520
AC_MSG_CHECKING([whether included gettext is requested])
521
AC_ARG_WITH(included-gettext,
522
[ --with-included-gettext use the GNU gettext library included here],
523
nls_cv_force_use_gnu_gettext=$withval,
524
nls_cv_force_use_gnu_gettext=no)
525
AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
527
nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
528
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
530
dnl User does not insist on using GNU NLS library. Figure out what
531
dnl to use. If GNU gettext is available we use this. Else we have
532
dnl to fall back to GNU NLS library.
534
if test $gt_api_version -ge 3; then
535
gt_revision_test_code='
536
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
537
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
540
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
544
gt_revision_test_code=
546
if test $gt_api_version -ge 2; then
547
gt_expression_test_code=' + * ngettext ("", "", 0)'
549
gt_expression_test_code=
552
AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
553
[AC_TRY_LINK([#include <libintl.h>
554
$gt_revision_test_code
555
extern int _nl_msg_cat_cntr;
556
extern int *_nl_domain_bindings;],
557
[bindtextdomain ("", "");
558
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
559
[eval "$gt_func_gnugettext_libc=yes"],
560
[eval "$gt_func_gnugettext_libc=no"])])
562
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
563
dnl Sometimes libintl requires libiconv, so first search for libiconv.
564
ifelse(gt_included_intl, yes, , [
567
dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
568
dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
569
dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
570
dnl even if libiconv doesn't exist.
571
AC_LIB_LINKFLAGS_BODY([intl])
572
AC_CACHE_CHECK([for GNU gettext in libintl],
573
[$gt_func_gnugettext_libintl],
574
[gt_save_CPPFLAGS="$CPPFLAGS"
575
CPPFLAGS="$CPPFLAGS $INCINTL"
577
LIBS="$LIBS $LIBINTL"
578
dnl Now see whether libintl exists and does not depend on libiconv.
579
AC_TRY_LINK([#include <libintl.h>
580
$gt_revision_test_code
581
extern int _nl_msg_cat_cntr;
586
const char *_nl_expand_alias (const char *);],
587
[bindtextdomain ("", "");
588
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
589
[eval "$gt_func_gnugettext_libintl=yes"],
590
[eval "$gt_func_gnugettext_libintl=no"])
591
dnl Now see whether libintl exists and depends on libiconv.
592
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
593
LIBS="$LIBS $LIBICONV"
594
AC_TRY_LINK([#include <libintl.h>
595
$gt_revision_test_code
596
extern int _nl_msg_cat_cntr;
601
const char *_nl_expand_alias (const char *);],
602
[bindtextdomain ("", "");
603
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
604
[LIBINTL="$LIBINTL $LIBICONV"
605
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
606
eval "$gt_func_gnugettext_libintl=yes"
609
CPPFLAGS="$gt_save_CPPFLAGS"
610
LIBS="$gt_save_LIBS"])
613
dnl If an already present or preinstalled GNU gettext() is found,
614
dnl use it. But if this macro is used in GNU gettext, and GNU
615
dnl gettext is already preinstalled in libintl, we update this
616
dnl libintl. (Cf. the install rule in intl/Makefile.in.)
617
if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
618
|| { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
619
&& test "$PACKAGE" != gettext-runtime \
620
&& test "$PACKAGE" != gettext-tools; }; then
621
gt_use_preinstalled_gnugettext=yes
623
dnl Reset the values set by searching for libintl.
629
ifelse(gt_included_intl, yes, [
630
if test "$gt_use_preinstalled_gnugettext" != "yes"; then
631
dnl GNU gettext is not found in the C library.
632
dnl Fall back on included GNU gettext library.
633
nls_cv_use_gnu_gettext=yes
637
if test "$nls_cv_use_gnu_gettext" = "yes"; then
638
dnl Mark actions used to generate GNU NLS library.
639
BUILD_INCLUDED_LIBINTL=yes
640
USE_INCLUDED_LIBINTL=yes
641
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
642
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
643
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
647
if test "$gt_use_preinstalled_gnugettext" = "yes" \
648
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
649
dnl Mark actions to use GNU gettext tools.
654
if test -n "$INTL_MACOSX_LIBS"; then
655
if test "$gt_use_preinstalled_gnugettext" = "yes" \
656
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
657
dnl Some extra flags are needed during linking.
658
LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
659
LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
663
if test "$gt_use_preinstalled_gnugettext" = "yes" \
664
|| test "$nls_cv_use_gnu_gettext" = "yes"; then
665
AC_DEFINE(ENABLE_NLS, 1,
666
[Define to 1 if translation of program messages to the user's native language
673
AC_MSG_CHECKING([whether to use NLS])
674
AC_MSG_RESULT([$USE_NLS])
675
if test "$USE_NLS" = "yes"; then
676
AC_MSG_CHECKING([where the gettext function comes from])
677
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
678
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
679
gt_source="external libintl"
684
gt_source="included intl directory"
686
AC_MSG_RESULT([$gt_source])
689
if test "$USE_NLS" = "yes"; then
691
if test "$gt_use_preinstalled_gnugettext" = "yes"; then
692
if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
693
AC_MSG_CHECKING([how to link with libintl])
694
AC_MSG_RESULT([$LIBINTL])
695
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
698
dnl For backward compatibility. Some packages may be using this.
699
AC_DEFINE(HAVE_GETTEXT, 1,
700
[Define if the GNU gettext() function is already present or preinstalled.])
701
AC_DEFINE(HAVE_DCGETTEXT, 1,
702
[Define if the GNU dcgettext() function is already present or preinstalled.])
705
dnl We need to process the po/ directory.
709
ifelse(gt_included_intl, yes, [
710
dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
711
dnl to 'yes' because some of the testsuite requires it.
712
if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
713
BUILD_INCLUDED_LIBINTL=yes
716
dnl Make all variables we use known to autoconf.
717
AC_SUBST(BUILD_INCLUDED_LIBINTL)
718
AC_SUBST(USE_INCLUDED_LIBINTL)
721
dnl For backward compatibility. Some configure.ins may be using this.
725
dnl For backward compatibility. Some Makefiles may be using this.
727
AC_SUBST(DATADIRNAME)
729
dnl For backward compatibility. Some Makefiles may be using this.
733
dnl For backward compatibility. Some Makefiles may be using this.
737
dnl For backward compatibility. Some Makefiles may be using this.
739
if test "$USE_INCLUDED_LIBINTL" = yes; then
740
INTLOBJS="\$(GETTOBJS)"
744
dnl Enable libtool support if the surrounding package wishes it.
745
INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
746
AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
749
dnl For backward compatibility. Some Makefiles may be using this.
753
dnl Make all documented variables known to autoconf.
760
dnl Checks for special options needed on MacOS X.
761
dnl Defines INTL_MACOSX_LIBS.
762
AC_DEFUN([gt_INTL_MACOSX],
764
dnl Check for API introduced in MacOS X 10.2.
765
AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
766
gt_cv_func_CFPreferencesCopyAppValue,
767
[gt_save_LIBS="$LIBS"
768
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
769
AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
770
[CFPreferencesCopyAppValue(NULL, NULL)],
771
[gt_cv_func_CFPreferencesCopyAppValue=yes],
772
[gt_cv_func_CFPreferencesCopyAppValue=no])
773
LIBS="$gt_save_LIBS"])
774
if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
775
AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
776
[Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
778
dnl Check for API introduced in MacOS X 10.3.
779
AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
780
[gt_save_LIBS="$LIBS"
781
LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
782
AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
783
[gt_cv_func_CFLocaleCopyCurrent=yes],
784
[gt_cv_func_CFLocaleCopyCurrent=no])
785
LIBS="$gt_save_LIBS"])
786
if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
787
AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
788
[Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
791
if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
792
INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
794
AC_SUBST([INTL_MACOSX_LIBS])
798
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
799
m4_define([gt_NEEDS_INIT],
801
m4_divert_text([DEFAULTS], [gt_needs=])
802
m4_define([gt_NEEDS_INIT], [])
806
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
807
AC_DEFUN([AM_GNU_GETTEXT_NEED],
809
m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
813
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
814
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
815
# glibc21.m4 serial 3
816
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
817
dnl This file is free software; the Free Software Foundation
818
dnl gives unlimited permission to copy and/or distribute it,
819
dnl with or without modifications, as long as this notice is preserved.
821
# Test for the GNU C Library, version 2.1 or newer.
824
AC_DEFUN([gl_GLIBC21],
826
AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
827
ac_cv_gnu_library_2_1,
828
[AC_EGREP_CPP([Lucky GNU user],
830
#include <features.h>
831
#ifdef __GNU_LIBRARY__
832
#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
837
ac_cv_gnu_library_2_1=yes,
838
ac_cv_gnu_library_2_1=no)
842
GLIBC21="$ac_cv_gnu_library_2_1"
846
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
847
dnl This file is free software; the Free Software Foundation
848
dnl gives unlimited permission to copy and/or distribute it,
849
dnl with or without modifications, as long as this notice is preserved.
851
# Test for the GNU C Library, version 2.0 or newer.
854
AC_DEFUN([gt_GLIBC2],
856
AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
858
[AC_EGREP_CPP([Lucky GNU user],
860
#include <features.h>
861
#ifdef __GNU_LIBRARY__
867
ac_cv_gnu_library_2=yes,
868
ac_cv_gnu_library_2=no)
872
GLIBC2="$ac_cv_gnu_library_2"
875
# Configure paths for GLIB
876
# Owen Taylor 97-11-3
878
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
879
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
880
dnl gthread is specified in MODULES, pass to glib-config
882
AC_DEFUN([AM_PATH_GLIB],
884
dnl Get the cflags and libraries from the glib-config script
886
AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
887
glib_config_prefix="$withval", glib_config_prefix="")
888
AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
889
glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
890
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
891
, enable_glibtest=yes)
893
if test x$glib_config_exec_prefix != x ; then
894
glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
895
if test x${GLIB_CONFIG+set} != xset ; then
896
GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
899
if test x$glib_config_prefix != x ; then
900
glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
901
if test x${GLIB_CONFIG+set} != xset ; then
902
GLIB_CONFIG=$glib_config_prefix/bin/glib-config
910
glib_config_args="$glib_config_args gmodule"
913
glib_config_args="$glib_config_args gthread"
918
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
919
min_glib_version=ifelse([$1], ,0.99.7,$1)
920
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
922
if test "$GLIB_CONFIG" = "no" ; then
925
GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
926
GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
927
glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
928
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
929
glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
930
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
931
glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
932
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
933
if test "x$enable_glibtest" = "xyes" ; then
934
ac_save_CFLAGS="$CFLAGS"
936
CFLAGS="$CFLAGS $GLIB_CFLAGS"
937
LIBS="$GLIB_LIBS $LIBS"
939
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
940
dnl checks the results of glib-config to some extent
951
int major, minor, micro;
954
system ("touch conf.glibtest");
956
/* HP/UX 9 (%@#!) writes to sscanf strings */
957
tmp_version = g_strdup("$min_glib_version");
958
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
959
printf("%s, bad version string\n", "$min_glib_version");
963
if ((glib_major_version != $glib_config_major_version) ||
964
(glib_minor_version != $glib_config_minor_version) ||
965
(glib_micro_version != $glib_config_micro_version))
967
printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
968
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
969
glib_major_version, glib_minor_version, glib_micro_version);
970
printf ("*** was found! If glib-config was correct, then it is best\n");
971
printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
972
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
973
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
974
printf("*** required on your system.\n");
975
printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
976
printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
977
printf("*** before re-running configure\n");
979
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
980
(glib_minor_version != GLIB_MINOR_VERSION) ||
981
(glib_micro_version != GLIB_MICRO_VERSION))
983
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
984
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
985
printf("*** library (version %d.%d.%d)\n",
986
glib_major_version, glib_minor_version, glib_micro_version);
990
if ((glib_major_version > major) ||
991
((glib_major_version == major) && (glib_minor_version > minor)) ||
992
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
998
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
999
glib_major_version, glib_minor_version, glib_micro_version);
1000
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
1001
major, minor, micro);
1002
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
1004
printf("*** If you have already installed a sufficiently new version, this error\n");
1005
printf("*** probably means that the wrong copy of the glib-config shell script is\n");
1006
printf("*** being found. The easiest way to fix this is to remove the old version\n");
1007
printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
1008
printf("*** correct copy of glib-config. (In this case, you will have to\n");
1009
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1010
printf("*** so that the correct libraries are found at run-time))\n");
1015
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1016
CFLAGS="$ac_save_CFLAGS"
1017
LIBS="$ac_save_LIBS"
1020
if test "x$no_glib" = x ; then
1022
ifelse([$2], , :, [$2])
1025
if test "$GLIB_CONFIG" = "no" ; then
1026
echo "*** The glib-config script installed by GLIB could not be found"
1027
echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
1028
echo "*** your path, or set the GLIB_CONFIG environment variable to the"
1029
echo "*** full path to glib-config."
1031
if test -f conf.glibtest ; then
1034
echo "*** Could not run GLIB test program, checking why..."
1035
CFLAGS="$CFLAGS $GLIB_CFLAGS"
1036
LIBS="$LIBS $GLIB_LIBS"
1040
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
1041
[ echo "*** The test program compiled, but did not run. This usually means"
1042
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
1043
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
1044
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1045
echo "*** to the installed location Also, make sure you have run ldconfig if that"
1046
echo "*** is required on your system"
1048
echo "*** If you have an old version installed, it is best to remove it, although"
1049
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1051
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1052
echo "*** came with the system with the command"
1054
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
1055
[ echo "*** The test program failed to compile or link. See the file config.log for the"
1056
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
1057
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
1058
echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
1059
CFLAGS="$ac_save_CFLAGS"
1060
LIBS="$ac_save_LIBS"
1065
ifelse([$3], , :, [$3])
1067
AC_SUBST(GLIB_CFLAGS)
375
1071
# Configure paths for GTK+
376
1072
# Owen Taylor 97-11-3
566
1262
AC_SUBST(GTK_LIBS)
567
1263
rm -f conf.gtktest
1265
# iconv.m4 serial AM4 (gettext-0.11.3)
1266
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1267
dnl This file is free software; the Free Software Foundation
1268
dnl gives unlimited permission to copy and/or distribute it,
1269
dnl with or without modifications, as long as this notice is preserved.
1271
dnl From Bruno Haible.
1273
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1275
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1276
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1277
AC_REQUIRE([AC_LIB_RPATH])
1279
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1281
AC_LIB_LINKFLAGS_BODY([iconv])
1284
AC_DEFUN([AM_ICONV_LINK],
1286
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1287
dnl those with the standalone portable GNU libiconv installed).
1289
dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1291
AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1293
dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1294
dnl because if the user has installed libiconv and not disabled its use
1295
dnl via --without-libiconv-prefix, he wants to use it. The first
1296
dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
1297
am_save_CPPFLAGS="$CPPFLAGS"
1298
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1300
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1301
am_cv_func_iconv="no, consider installing GNU libiconv"
1303
AC_TRY_LINK([#include <stdlib.h>
1304
#include <iconv.h>],
1305
[iconv_t cd = iconv_open("","");
1306
iconv(cd,NULL,NULL,NULL,NULL);
1308
am_cv_func_iconv=yes)
1309
if test "$am_cv_func_iconv" != yes; then
1310
am_save_LIBS="$LIBS"
1311
LIBS="$LIBS $LIBICONV"
1312
AC_TRY_LINK([#include <stdlib.h>
1313
#include <iconv.h>],
1314
[iconv_t cd = iconv_open("","");
1315
iconv(cd,NULL,NULL,NULL,NULL);
1318
am_cv_func_iconv=yes)
1319
LIBS="$am_save_LIBS"
1322
if test "$am_cv_func_iconv" = yes; then
1323
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1325
if test "$am_cv_lib_iconv" = yes; then
1326
AC_MSG_CHECKING([how to link with libiconv])
1327
AC_MSG_RESULT([$LIBICONV])
1329
dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1331
CPPFLAGS="$am_save_CPPFLAGS"
1336
AC_SUBST(LTLIBICONV)
1339
AC_DEFUN([AM_ICONV],
1342
if test "$am_cv_func_iconv" = yes; then
1343
AC_MSG_CHECKING([for iconv declaration])
1344
AC_CACHE_VAL(am_cv_proto_iconv, [
1352
#if defined(__STDC__) || defined(__cplusplus)
1353
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1357
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1358
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);"])
1359
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1360
AC_MSG_RESULT([$]{ac_t:-
1361
}[$]am_cv_proto_iconv)
1362
AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1363
[Define as const if the declaration of iconv() needs const.])
1366
# intdiv0.m4 serial 1 (gettext-0.11.3)
1367
dnl Copyright (C) 2002 Free Software Foundation, Inc.
1368
dnl This file is free software; the Free Software Foundation
1369
dnl gives unlimited permission to copy and/or distribute it,
1370
dnl with or without modifications, as long as this notice is preserved.
1372
dnl From Bruno Haible.
1374
AC_DEFUN([gt_INTDIV0],
1376
AC_REQUIRE([AC_PROG_CC])dnl
1377
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1379
AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
1380
gt_cv_int_divbyzero_sigfpe,
1388
sigfpe_handler (int sig)
1390
sigfpe_handler (sig) int sig;
1393
/* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
1394
exit (sig != SIGFPE);
1404
signal (SIGFPE, sigfpe_handler);
1405
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
1406
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
1407
signal (SIGTRAP, sigfpe_handler);
1409
/* Linux/SPARC yields signal SIGILL. */
1410
#if defined (__sparc__) && defined (__linux__)
1411
signal (SIGILL, sigfpe_handler);
1418
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
1420
# Guess based on the CPU.
1422
alpha* | i[34567]86 | m68k | s390*)
1423
gt_cv_int_divbyzero_sigfpe="guessing yes";;
1425
gt_cv_int_divbyzero_sigfpe="guessing no";;
1429
case "$gt_cv_int_divbyzero_sigfpe" in
1433
AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
1434
[Define if integer division by zero raises signal SIGFPE.])
1436
# intldir.m4 serial 1 (gettext-0.16)
1437
dnl Copyright (C) 2006 Free Software Foundation, Inc.
1438
dnl This file is free software; the Free Software Foundation
1439
dnl gives unlimited permission to copy and/or distribute it,
1440
dnl with or without modifications, as long as this notice is preserved.
1442
dnl This file can can be used in projects which are not available under
1443
dnl the GNU General Public License or the GNU Library General Public
1444
dnl License but which still want to provide support for the GNU gettext
1446
dnl Please note that the actual code of the GNU gettext library is covered
1447
dnl by the GNU Library General Public License, and the rest of the GNU
1448
dnl gettext package package is covered by the GNU General Public License.
1449
dnl They are *not* in the public domain.
1453
dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
1454
AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
1455
# intl.m4 serial 3 (gettext-0.16)
1456
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
1457
dnl This file is free software; the Free Software Foundation
1458
dnl gives unlimited permission to copy and/or distribute it,
1459
dnl with or without modifications, as long as this notice is preserved.
1461
dnl This file can can be used in projects which are not available under
1462
dnl the GNU General Public License or the GNU Library General Public
1463
dnl License but which still want to provide support for the GNU gettext
1465
dnl Please note that the actual code of the GNU gettext library is covered
1466
dnl by the GNU Library General Public License, and the rest of the GNU
1467
dnl gettext package package is covered by the GNU General Public License.
1468
dnl They are *not* in the public domain.
1471
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1472
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006.
1476
dnl Checks for all prerequisites of the intl subdirectory,
1477
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1478
dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1479
AC_DEFUN([AM_INTL_SUBDIR],
1481
AC_REQUIRE([AC_PROG_INSTALL])dnl
1482
AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
1483
AC_REQUIRE([AC_PROG_CC])dnl
1484
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1485
AC_REQUIRE([gt_GLIBC2])dnl
1486
AC_REQUIRE([AC_PROG_RANLIB])dnl
1487
AC_REQUIRE([gl_VISIBILITY])dnl
1488
AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
1489
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
1490
AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
1491
AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
1492
AC_REQUIRE([gt_TYPE_WINT_T])dnl
1493
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1494
AC_REQUIRE([gt_TYPE_INTMAX_T])
1495
AC_REQUIRE([gt_PRINTF_POSIX])
1496
AC_REQUIRE([gl_GLIBC21])dnl
1497
AC_REQUIRE([gl_XSIZE])dnl
1498
AC_REQUIRE([gt_INTL_MACOSX])dnl
1500
AC_CHECK_TYPE([ptrdiff_t], ,
1501
[AC_DEFINE([ptrdiff_t], [long],
1502
[Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
1504
AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
1505
AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
1507
dnl Use the _snprintf function only if it is declared (because on NetBSD it
1508
dnl is defined as a weak alias of snprintf; we prefer to use the latter).
1509
gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
1510
gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
1512
dnl Use the *_unlocked functions only if they are declared.
1513
dnl (because some of them were defined without being declared in Solaris
1514
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1515
dnl on Solaris 2.5.1 to run on Solaris 2.6).
1516
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
1517
gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
1519
case $gt_cv_func_printf_posix in
1520
*yes) HAVE_POSIX_PRINTF=1 ;;
1521
*) HAVE_POSIX_PRINTF=0 ;;
1523
AC_SUBST([HAVE_POSIX_PRINTF])
1524
if test "$ac_cv_func_asprintf" = yes; then
1529
AC_SUBST([HAVE_ASPRINTF])
1530
if test "$ac_cv_func_snprintf" = yes; then
1535
AC_SUBST([HAVE_SNPRINTF])
1536
if test "$ac_cv_func_wprintf" = yes; then
1541
AC_SUBST([HAVE_WPRINTF])
1546
dnl Compilation on mingw and Cygwin needs special Makefile rules, because
1547
dnl 1. when we install a shared library, we must arrange to export
1548
dnl auxiliary pointer variables for every exported variable,
1549
dnl 2. when we install a shared library and a static library simultaneously,
1550
dnl the include file specifies __declspec(dllimport) and therefore we
1551
dnl must arrange to define the auxiliary pointer variables for the
1552
dnl exported variables _also_ in the static library.
1553
if test "$enable_shared" = yes; then
1555
cygwin*) is_woe32dll=yes ;;
1556
*) is_woe32dll=no ;;
1561
WOE32DLL=$is_woe32dll
1562
AC_SUBST([WOE32DLL])
1564
dnl Rename some macros and functions used for locking.
1566
#define __libc_lock_t gl_lock_t
1567
#define __libc_lock_define gl_lock_define
1568
#define __libc_lock_define_initialized gl_lock_define_initialized
1569
#define __libc_lock_init gl_lock_init
1570
#define __libc_lock_lock gl_lock_lock
1571
#define __libc_lock_unlock gl_lock_unlock
1572
#define __libc_lock_recursive_t gl_recursive_lock_t
1573
#define __libc_lock_define_recursive gl_recursive_lock_define
1574
#define __libc_lock_define_initialized_recursive gl_recursive_lock_define_initialized
1575
#define __libc_lock_init_recursive gl_recursive_lock_init
1576
#define __libc_lock_lock_recursive gl_recursive_lock_lock
1577
#define __libc_lock_unlock_recursive gl_recursive_lock_unlock
1578
#define glthread_in_use libintl_thread_in_use
1579
#define glthread_lock_init libintl_lock_init
1580
#define glthread_lock_lock libintl_lock_lock
1581
#define glthread_lock_unlock libintl_lock_unlock
1582
#define glthread_lock_destroy libintl_lock_destroy
1583
#define glthread_rwlock_init libintl_rwlock_init
1584
#define glthread_rwlock_rdlock libintl_rwlock_rdlock
1585
#define glthread_rwlock_wrlock libintl_rwlock_wrlock
1586
#define glthread_rwlock_unlock libintl_rwlock_unlock
1587
#define glthread_rwlock_destroy libintl_rwlock_destroy
1588
#define glthread_recursive_lock_init libintl_recursive_lock_init
1589
#define glthread_recursive_lock_lock libintl_recursive_lock_lock
1590
#define glthread_recursive_lock_unlock libintl_recursive_lock_unlock
1591
#define glthread_recursive_lock_destroy libintl_recursive_lock_destroy
1592
#define glthread_once libintl_once
1593
#define glthread_once_call libintl_once_call
1594
#define glthread_once_singlethreaded libintl_once_singlethreaded
1599
dnl Checks for the core files of the intl subdirectory:
1606
dnl hash-string.h hash-string.c
1608
dnl libgnuintl.h.in (except the *printf stuff)
1613
dnl plural-exp.h plural-exp.c
1615
dnl Used by libglocale.
1616
AC_DEFUN([gt_INTL_SUBDIR_CORE],
1618
AC_REQUIRE([AC_C_INLINE])dnl
1619
AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1620
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1621
AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1622
AC_REQUIRE([AC_FUNC_MMAP])dnl
1623
AC_REQUIRE([gt_INTDIV0])dnl
1624
AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
1625
AC_REQUIRE([gt_INTTYPES_PRI])dnl
1626
AC_REQUIRE([gl_LOCK])dnl
1629
[int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
1631
[AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
1632
[Define to 1 if the compiler understands __builtin_expect.])])
1634
AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
1635
AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
1636
stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
1637
argz_next __fsetlocking])
1639
dnl Use the *_unlocked functions only if they are declared.
1640
dnl (because some of them were defined without being declared in Solaris
1641
dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1642
dnl on Solaris 2.5.1 to run on Solaris 2.6).
1643
dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
1644
gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
1645
gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
1649
dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
1650
dnl and a _NL_LOCALE_NAME macro always.
1651
AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
1652
[AC_TRY_LINK([#include <langinfo.h>
1653
#include <locale.h>],
1654
[char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
1655
gt_cv_nl_locale_name=yes,
1656
gt_cv_nl_locale_name=no)
1658
if test $gt_cv_nl_locale_name = yes; then
1659
AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
1660
[Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
1663
dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1664
dnl because plural.y uses bison specific features. It requires at least
1665
dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1667
dnl bison is only needed for the maintainer (who touches plural.y). But in
1668
dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1669
dnl the rule in general Makefile. Now, some people carelessly touch the
1670
dnl files or have a broken "make" program, hence the plural.c rule will
1671
dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1672
dnl present or too old.
1673
AC_CHECK_PROGS([INTLBISON], [bison])
1674
if test -z "$INTLBISON"; then
1677
dnl Found it, now check the version.
1678
AC_MSG_CHECKING([version of bison])
1679
changequote(<<,>>)dnl
1680
ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1681
case $ac_prog_version in
1682
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1683
1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1685
ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1686
*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1688
AC_MSG_RESULT([$ac_prog_version])
1690
if test $ac_verc_fail = yes; then
1696
dnl gt_CHECK_DECL(FUNC, INCLUDES)
1697
dnl Check whether a function is declared.
1698
AC_DEFUN([gt_CHECK_DECL],
1700
AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
1701
[AC_TRY_COMPILE([$2], [
1703
char *p = (char *) $1;
1705
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
1706
if test $ac_cv_have_decl_$1 = yes; then
1711
AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
1712
[Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
1714
# intmax.m4 serial 3 (gettext-0.16)
1715
dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
1716
dnl This file is free software; the Free Software Foundation
1717
dnl gives unlimited permission to copy and/or distribute it,
1718
dnl with or without modifications, as long as this notice is preserved.
1720
dnl From Bruno Haible.
1721
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
1722
dnl find a replacement if it is lacking.
1724
AC_DEFUN([gt_TYPE_INTMAX_T],
1726
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
1727
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
1728
AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
1732
#if HAVE_STDINT_H_WITH_UINTMAX
1735
#if HAVE_INTTYPES_H_WITH_UINTMAX
1736
#include <inttypes.h>
1738
], [intmax_t x = -1;
1740
gt_cv_c_intmax_t=yes,
1741
gt_cv_c_intmax_t=no)])
1742
if test $gt_cv_c_intmax_t = yes; then
1743
AC_DEFINE(HAVE_INTMAX_T, 1,
1744
[Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
1747
# inttypes_h.m4 serial 7
1748
dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
1749
dnl This file is free software; the Free Software Foundation
1750
dnl gives unlimited permission to copy and/or distribute it,
1751
dnl with or without modifications, as long as this notice is preserved.
1753
dnl From Paul Eggert.
1755
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1756
# doesn't clash with <sys/types.h>, and declares uintmax_t.
1758
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
1760
AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
1762
[#include <sys/types.h>
1763
#include <inttypes.h>],
1764
[uintmax_t i = (uintmax_t) -1; return !i;],
1765
gl_cv_header_inttypes_h=yes,
1766
gl_cv_header_inttypes_h=no)])
1767
if test $gl_cv_header_inttypes_h = yes; then
1768
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
1769
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1770
and declares uintmax_t. ])
1773
# inttypes-pri.m4 serial 4 (gettext-0.16)
1774
dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
1775
dnl This file is free software; the Free Software Foundation
1776
dnl gives unlimited permission to copy and/or distribute it,
1777
dnl with or without modifications, as long as this notice is preserved.
1779
dnl From Bruno Haible.
1783
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1784
# macros to non-string values. This is the case on AIX 4.3.3.
1786
AC_DEFUN([gt_INTTYPES_PRI],
1788
AC_CHECK_HEADERS([inttypes.h])
1789
if test $ac_cv_header_inttypes_h = yes; then
1790
AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1791
gt_cv_inttypes_pri_broken,
1793
AC_TRY_COMPILE([#include <inttypes.h>
1797
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1800
if test "$gt_cv_inttypes_pri_broken" = yes; then
1801
AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1802
[Define if <inttypes.h> exists and defines unusable PRI* macros.])
1807
AC_SUBST([PRI_MACROS_BROKEN])
1809
# lcmessage.m4 serial 4 (gettext-0.14.2)
1810
dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
1811
dnl This file is free software; the Free Software Foundation
1812
dnl gives unlimited permission to copy and/or distribute it,
1813
dnl with or without modifications, as long as this notice is preserved.
1815
dnl This file can can be used in projects which are not available under
1816
dnl the GNU General Public License or the GNU Library General Public
1817
dnl License but which still want to provide support for the GNU gettext
1819
dnl Please note that the actual code of the GNU gettext library is covered
1820
dnl by the GNU Library General Public License, and the rest of the GNU
1821
dnl gettext package package is covered by the GNU General Public License.
1822
dnl They are *not* in the public domain.
1825
dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
1827
# Check whether LC_MESSAGES is available in <locale.h>.
1829
AC_DEFUN([gt_LC_MESSAGES],
1831
AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
1832
[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1833
gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
1834
if test $gt_cv_val_LC_MESSAGES = yes; then
1835
AC_DEFINE(HAVE_LC_MESSAGES, 1,
1836
[Define if your <locale.h> file defines LC_MESSAGES.])
1839
# lib-ld.m4 serial 3 (gettext-0.13)
1840
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1841
dnl This file is free software; the Free Software Foundation
1842
dnl gives unlimited permission to copy and/or distribute it,
1843
dnl with or without modifications, as long as this notice is preserved.
1845
dnl Subroutines of libtool.m4,
1846
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1847
dnl with libtool.m4.
1849
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1850
AC_DEFUN([AC_LIB_PROG_LD_GNU],
1851
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1852
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1853
case `$LD -v 2>&1 </dev/null` in
1854
*GNU* | *'with BFD'*)
1855
acl_cv_prog_gnu_ld=yes ;;
1857
acl_cv_prog_gnu_ld=no ;;
1859
with_gnu_ld=$acl_cv_prog_gnu_ld
1862
dnl From libtool-1.4. Sets the variable LD.
1863
AC_DEFUN([AC_LIB_PROG_LD],
1864
[AC_ARG_WITH(gnu-ld,
1865
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
1866
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1867
AC_REQUIRE([AC_PROG_CC])dnl
1868
AC_REQUIRE([AC_CANONICAL_HOST])dnl
1869
# Prepare PATH_SEPARATOR.
1870
# The user is always right.
1871
if test "${PATH_SEPARATOR+set}" != set; then
1872
echo "#! /bin/sh" >conf$$.sh
1873
echo "exit 0" >>conf$$.sh
1875
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1883
if test "$GCC" = yes; then
1884
# Check if gcc -print-prog-name=ld gives a path.
1885
AC_MSG_CHECKING([for ld used by GCC])
1888
# gcc leaves a trailing carriage return which upsets mingw
1889
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1891
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1894
# Accept absolute paths.
1895
[[\\/]* | [A-Za-z]:[\\/]*)]
1896
[re_direlt='/[^/][^/]*/\.\./']
1897
# Canonicalize the path of ld
1898
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1899
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1900
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1902
test -z "$LD" && LD="$ac_prog"
1905
# If it fails, then pretend we aren't using GCC.
1909
# If it is relative, then search for the first ld in PATH.
1913
elif test "$with_gnu_ld" = yes; then
1914
AC_MSG_CHECKING([for GNU ld])
1916
AC_MSG_CHECKING([for non-GNU ld])
1918
AC_CACHE_VAL(acl_cv_path_LD,
1919
[if test -z "$LD"; then
1920
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1921
for ac_dir in $PATH; do
1922
test -z "$ac_dir" && ac_dir=.
1923
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1924
acl_cv_path_LD="$ac_dir/$ac_prog"
1925
# Check to see if the program is GNU ld. I'd rather use --version,
1926
# but apparently some GNU ld's only accept -v.
1927
# Break only if it was the GNU/non-GNU ld that we prefer.
1928
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
1929
*GNU* | *'with BFD'*)
1930
test "$with_gnu_ld" != no && break ;;
1932
test "$with_gnu_ld" != yes && break ;;
1938
acl_cv_path_LD="$LD" # Let the user override the test with a path.
1940
LD="$acl_cv_path_LD"
1941
if test -n "$LD"; then
1946
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1949
# lib-link.m4 serial 9 (gettext-0.16)
1950
dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
1951
dnl This file is free software; the Free Software Foundation
1952
dnl gives unlimited permission to copy and/or distribute it,
1953
dnl with or without modifications, as long as this notice is preserved.
1955
dnl From Bruno Haible.
1959
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1960
dnl the libraries corresponding to explicit and implicit dependencies.
1961
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1962
dnl augments the CPPFLAGS variable.
1963
AC_DEFUN([AC_LIB_LINKFLAGS],
1965
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1966
AC_REQUIRE([AC_LIB_RPATH])
1967
define([Name],[translit([$1],[./-], [___])])
1968
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1969
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1970
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1971
AC_LIB_LINKFLAGS_BODY([$1], [$2])
1972
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1973
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1974
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1976
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1977
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1978
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1979
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1981
AC_SUBST([LTLIB]NAME)
1982
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1983
dnl results of this search when this library appears as a dependency.
1989
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1990
dnl searches for libname and the libraries corresponding to explicit and
1991
dnl implicit dependencies, together with the specified include files and
1992
dnl the ability to compile and link the specified testcode. If found, it
1993
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1994
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1995
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1996
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1997
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1999
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2000
AC_REQUIRE([AC_LIB_RPATH])
2001
define([Name],[translit([$1],[./-], [___])])
2002
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2003
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2005
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2007
AC_LIB_LINKFLAGS_BODY([$1], [$2])
2009
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2010
dnl because if the user has installed lib[]Name and not disabled its use
2011
dnl via --without-lib[]Name-prefix, he wants to use it.
2012
ac_save_CPPFLAGS="$CPPFLAGS"
2013
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2015
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2016
ac_save_LIBS="$LIBS"
2017
LIBS="$LIBS $LIB[]NAME"
2018
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
2019
LIBS="$ac_save_LIBS"
2021
if test "$ac_cv_lib[]Name" = yes; then
2023
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
2024
AC_MSG_CHECKING([how to link with lib[]$1])
2025
AC_MSG_RESULT([$LIB[]NAME])
2028
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2029
dnl $INC[]NAME either.
2030
CPPFLAGS="$ac_save_CPPFLAGS"
2034
AC_SUBST([HAVE_LIB]NAME)
2036
AC_SUBST([LTLIB]NAME)
2041
dnl Determine the platform dependent parameters needed to use rpath:
2042
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
2043
dnl hardcode_direct, hardcode_minus_L.
2044
AC_DEFUN([AC_LIB_RPATH],
2046
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
2047
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
2048
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
2049
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
2050
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
2051
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2052
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
2053
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2054
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2060
libext="$acl_cv_libext"
2061
shlibext="$acl_cv_shlibext"
2062
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2063
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2064
hardcode_direct="$acl_cv_hardcode_direct"
2065
hardcode_minus_L="$acl_cv_hardcode_minus_L"
2066
dnl Determine whether the user wants rpath handling at all.
2067
AC_ARG_ENABLE(rpath,
2068
[ --disable-rpath do not hardcode runtime library paths],
2069
:, enable_rpath=yes)
2072
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2073
dnl the libraries corresponding to explicit and implicit dependencies.
2074
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2075
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2077
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2078
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2079
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2080
dnl By default, look in $includedir and $libdir.
2082
AC_LIB_WITH_FINAL_PREFIX([
2083
eval additional_includedir=\"$includedir\"
2084
eval additional_libdir=\"$libdir\"
2086
AC_LIB_ARG_WITH([lib$1-prefix],
2087
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
2088
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
2090
if test "X$withval" = "Xno"; then
2093
if test "X$withval" = "X"; then
2094
AC_LIB_WITH_FINAL_PREFIX([
2095
eval additional_includedir=\"$includedir\"
2096
eval additional_libdir=\"$libdir\"
2099
additional_includedir="$withval/include"
2100
additional_libdir="$withval/$acl_libdirstem"
2104
dnl Search the library and its dependencies in $additional_libdir and
2105
dnl $LDFLAGS. Using breadth-first-seach.
2111
names_already_handled=
2112
names_next_round='$1 $2'
2113
while test -n "$names_next_round"; do
2114
names_this_round="$names_next_round"
2116
for name in $names_this_round; do
2118
for n in $names_already_handled; do
2119
if test "$n" = "$name"; then
2124
if test -z "$already_handled"; then
2125
names_already_handled="$names_already_handled $name"
2126
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2127
dnl or AC_LIB_HAVE_LINKFLAGS call.
2128
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2129
eval value=\"\$HAVE_LIB$uppername\"
2130
if test -n "$value"; then
2131
if test "$value" = yes; then
2132
eval value=\"\$LIB$uppername\"
2133
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2134
eval value=\"\$LTLIB$uppername\"
2135
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2137
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2138
dnl that this library doesn't exist. So just drop it.
2142
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2143
dnl and the already constructed $LIBNAME/$LTLIBNAME.
2148
if test $use_additional = yes; then
2149
if test -n "$shlibext" \
2150
&& { test -f "$additional_libdir/lib$name.$shlibext" \
2151
|| { test "$shlibext" = dll \
2152
&& test -f "$additional_libdir/lib$name.dll.a"; }; }; then
2153
found_dir="$additional_libdir"
2154
if test -f "$additional_libdir/lib$name.$shlibext"; then
2155
found_so="$additional_libdir/lib$name.$shlibext"
2157
found_so="$additional_libdir/lib$name.dll.a"
2159
if test -f "$additional_libdir/lib$name.la"; then
2160
found_la="$additional_libdir/lib$name.la"
2163
if test -f "$additional_libdir/lib$name.$libext"; then
2164
found_dir="$additional_libdir"
2165
found_a="$additional_libdir/lib$name.$libext"
2166
if test -f "$additional_libdir/lib$name.la"; then
2167
found_la="$additional_libdir/lib$name.la"
2172
if test "X$found_dir" = "X"; then
2173
for x in $LDFLAGS $LTLIB[]NAME; do
2174
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2177
dir=`echo "X$x" | sed -e 's/^X-L//'`
2178
if test -n "$shlibext" \
2179
&& { test -f "$dir/lib$name.$shlibext" \
2180
|| { test "$shlibext" = dll \
2181
&& test -f "$dir/lib$name.dll.a"; }; }; then
2183
if test -f "$dir/lib$name.$shlibext"; then
2184
found_so="$dir/lib$name.$shlibext"
2186
found_so="$dir/lib$name.dll.a"
2188
if test -f "$dir/lib$name.la"; then
2189
found_la="$dir/lib$name.la"
2192
if test -f "$dir/lib$name.$libext"; then
2194
found_a="$dir/lib$name.$libext"
2195
if test -f "$dir/lib$name.la"; then
2196
found_la="$dir/lib$name.la"
2202
if test "X$found_dir" != "X"; then
2207
if test "X$found_dir" != "X"; then
2208
dnl Found the library.
2209
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2210
if test "X$found_so" != "X"; then
2211
dnl Linking with a shared library. We attempt to hardcode its
2212
dnl directory into the executable's runpath, unless it's the
2213
dnl standard /usr/lib.
2214
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
2215
dnl No hardcoding is needed.
2216
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2218
dnl Use an explicit option to hardcode DIR into the resulting
2220
dnl Potentially add DIR to ltrpathdirs.
2221
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2223
for x in $ltrpathdirs; do
2224
if test "X$x" = "X$found_dir"; then
2229
if test -z "$haveit"; then
2230
ltrpathdirs="$ltrpathdirs $found_dir"
2232
dnl The hardcoding into $LIBNAME is system dependent.
2233
if test "$hardcode_direct" = yes; then
2234
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2235
dnl resulting binary.
2236
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2238
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2239
dnl Use an explicit option to hardcode DIR into the resulting
2241
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2242
dnl Potentially add DIR to rpathdirs.
2243
dnl The rpathdirs will be appended to $LIBNAME at the end.
2245
for x in $rpathdirs; do
2246
if test "X$x" = "X$found_dir"; then
2251
if test -z "$haveit"; then
2252
rpathdirs="$rpathdirs $found_dir"
2255
dnl Rely on "-L$found_dir".
2256
dnl But don't add it if it's already contained in the LDFLAGS
2257
dnl or the already constructed $LIBNAME
2259
for x in $LDFLAGS $LIB[]NAME; do
2260
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2261
if test "X$x" = "X-L$found_dir"; then
2266
if test -z "$haveit"; then
2267
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2269
if test "$hardcode_minus_L" != no; then
2270
dnl FIXME: Not sure whether we should use
2271
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2273
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2275
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2276
dnl here, because this doesn't fit in flags passed to the
2277
dnl compiler. So give up. No hardcoding. This affects only
2278
dnl very old systems.
2279
dnl FIXME: Not sure whether we should use
2280
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2282
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2288
if test "X$found_a" != "X"; then
2289
dnl Linking with a static library.
2290
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2292
dnl We shouldn't come here, but anyway it's good to have a
2294
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2297
dnl Assume the include files are nearby.
2298
additional_includedir=
2299
case "$found_dir" in
2300
*/$acl_libdirstem | */$acl_libdirstem/)
2301
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
2302
additional_includedir="$basedir/include"
2305
if test "X$additional_includedir" != "X"; then
2306
dnl Potentially add $additional_includedir to $INCNAME.
2307
dnl But don't add it
2308
dnl 1. if it's the standard /usr/include,
2309
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
2310
dnl 3. if it's already present in $CPPFLAGS or the already
2311
dnl constructed $INCNAME,
2312
dnl 4. if it doesn't exist as a directory.
2313
if test "X$additional_includedir" != "X/usr/include"; then
2315
if test "X$additional_includedir" = "X/usr/local/include"; then
2316
if test -n "$GCC"; then
2318
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2322
if test -z "$haveit"; then
2323
for x in $CPPFLAGS $INC[]NAME; do
2324
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2325
if test "X$x" = "X-I$additional_includedir"; then
2330
if test -z "$haveit"; then
2331
if test -d "$additional_includedir"; then
2332
dnl Really add $additional_includedir to $INCNAME.
2333
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2339
dnl Look for dependencies.
2340
if test -n "$found_la"; then
2341
dnl Read the .la file. It defines the variables
2342
dnl dlname, library_names, old_library, dependency_libs, current,
2343
dnl age, revision, installed, dlopen, dlpreopen, libdir.
2344
save_libdir="$libdir"
2346
*/* | *\\*) . "$found_la" ;;
2347
*) . "./$found_la" ;;
2349
libdir="$save_libdir"
2350
dnl We use only dependency_libs.
2351
for dep in $dependency_libs; do
2354
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2355
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2356
dnl But don't add it
2357
dnl 1. if it's the standard /usr/lib,
2358
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
2359
dnl 3. if it's already present in $LDFLAGS or the already
2360
dnl constructed $LIBNAME,
2361
dnl 4. if it doesn't exist as a directory.
2362
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2364
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2365
if test -n "$GCC"; then
2367
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2371
if test -z "$haveit"; then
2373
for x in $LDFLAGS $LIB[]NAME; do
2374
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2375
if test "X$x" = "X-L$additional_libdir"; then
2380
if test -z "$haveit"; then
2381
if test -d "$additional_libdir"; then
2382
dnl Really add $additional_libdir to $LIBNAME.
2383
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2387
for x in $LDFLAGS $LTLIB[]NAME; do
2388
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2389
if test "X$x" = "X-L$additional_libdir"; then
2394
if test -z "$haveit"; then
2395
if test -d "$additional_libdir"; then
2396
dnl Really add $additional_libdir to $LTLIBNAME.
2397
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2404
dir=`echo "X$dep" | sed -e 's/^X-R//'`
2405
if test "$enable_rpath" != no; then
2406
dnl Potentially add DIR to rpathdirs.
2407
dnl The rpathdirs will be appended to $LIBNAME at the end.
2409
for x in $rpathdirs; do
2410
if test "X$x" = "X$dir"; then
2415
if test -z "$haveit"; then
2416
rpathdirs="$rpathdirs $dir"
2418
dnl Potentially add DIR to ltrpathdirs.
2419
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2421
for x in $ltrpathdirs; do
2422
if test "X$x" = "X$dir"; then
2427
if test -z "$haveit"; then
2428
ltrpathdirs="$ltrpathdirs $dir"
2433
dnl Handle this in the next round.
2434
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2437
dnl Handle this in the next round. Throw away the .la's
2438
dnl directory; it is already contained in a preceding -L
2440
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2443
dnl Most likely an immediate library name.
2444
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2445
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2451
dnl Didn't find the library; assume it is in the system directories
2452
dnl known to the linker and runtime loader. (All the system
2453
dnl directories known to the linker should also be known to the
2454
dnl runtime loader, otherwise the system is severely misconfigured.)
2455
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2456
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2462
if test "X$rpathdirs" != "X"; then
2463
if test -n "$hardcode_libdir_separator"; then
2464
dnl Weird platform: only the last -rpath option counts, the user must
2465
dnl pass all path elements in one option. We can arrange that for a
2466
dnl single library, but not when more than one $LIBNAMEs are used.
2468
for found_dir in $rpathdirs; do
2469
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2471
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2472
acl_save_libdir="$libdir"
2474
eval flag=\"$hardcode_libdir_flag_spec\"
2475
libdir="$acl_save_libdir"
2476
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2478
dnl The -rpath options are cumulative.
2479
for found_dir in $rpathdirs; do
2480
acl_save_libdir="$libdir"
2482
eval flag=\"$hardcode_libdir_flag_spec\"
2483
libdir="$acl_save_libdir"
2484
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2488
if test "X$ltrpathdirs" != "X"; then
2489
dnl When using libtool, the option that works for both libraries and
2490
dnl executables is -R. The -R options are cumulative.
2491
for found_dir in $ltrpathdirs; do
2492
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2497
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2498
dnl unless already present in VAR.
2499
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2500
dnl contains two or three consecutive elements that belong together.
2501
AC_DEFUN([AC_LIB_APPENDTOVAR],
2503
for element in [$2]; do
2506
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2507
if test "X$x" = "X$element"; then
2512
if test -z "$haveit"; then
2513
[$1]="${[$1]}${[$1]:+ }$element"
2518
dnl For those cases where a variable contains several -L and -l options
2519
dnl referring to unknown libraries and directories, this macro determines the
2520
dnl necessary additional linker options for the runtime path.
2521
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
2522
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
2523
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
2524
dnl otherwise linking without libtool is assumed.
2525
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
2527
AC_REQUIRE([AC_LIB_RPATH])
2528
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2530
if test "$enable_rpath" != no; then
2531
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2532
dnl Use an explicit option to hardcode directories into the resulting
2537
if test -n "$next"; then
2539
dnl No need to hardcode the standard /usr/lib.
2540
if test "X$dir" != "X/usr/$acl_libdirstem"; then
2541
rpathdirs="$rpathdirs $dir"
2547
-L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
2548
dnl No need to hardcode the standard /usr/lib.
2549
if test "X$dir" != "X/usr/$acl_libdirstem"; then
2550
rpathdirs="$rpathdirs $dir"
2557
if test "X$rpathdirs" != "X"; then
2558
if test -n ""$3""; then
2559
dnl libtool is used for linking. Use -R options.
2560
for dir in $rpathdirs; do
2561
$1="${$1}${$1:+ }-R$dir"
2564
dnl The linker is used for linking directly.
2565
if test -n "$hardcode_libdir_separator"; then
2566
dnl Weird platform: only the last -rpath option counts, the user
2567
dnl must pass all path elements in one option.
2569
for dir in $rpathdirs; do
2570
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
2572
acl_save_libdir="$libdir"
2574
eval flag=\"$hardcode_libdir_flag_spec\"
2575
libdir="$acl_save_libdir"
2578
dnl The -rpath options are cumulative.
2579
for dir in $rpathdirs; do
2580
acl_save_libdir="$libdir"
2582
eval flag=\"$hardcode_libdir_flag_spec\"
2583
libdir="$acl_save_libdir"
2584
$1="${$1}${$1:+ }$flag"
569
2593
# Configure paths for libmikmod
571
2595
# Derived from glib.m4 (Owen Taylor 97-11-3)
773
2797
AC_SUBST(LIBMIKMOD_LDADD)
774
2798
rm -f conf.mikmodtest
2800
# lib-prefix.m4 serial 5 (gettext-0.15)
2801
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
2802
dnl This file is free software; the Free Software Foundation
2803
dnl gives unlimited permission to copy and/or distribute it,
2804
dnl with or without modifications, as long as this notice is preserved.
2806
dnl From Bruno Haible.
2808
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
2809
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
2810
dnl require excessive bracketing.
2811
ifdef([AC_HELP_STRING],
2812
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
2813
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
2815
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2816
dnl to access previously installed libraries. The basic assumption is that
2817
dnl a user will want packages to use other packages he previously installed
2818
dnl with the same --prefix option.
2819
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2820
dnl libraries, but is otherwise very convenient.
2821
AC_DEFUN([AC_LIB_PREFIX],
2823
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2824
AC_REQUIRE([AC_PROG_CC])
2825
AC_REQUIRE([AC_CANONICAL_HOST])
2826
AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
2827
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2828
dnl By default, look in $includedir and $libdir.
2830
AC_LIB_WITH_FINAL_PREFIX([
2831
eval additional_includedir=\"$includedir\"
2832
eval additional_libdir=\"$libdir\"
2834
AC_LIB_ARG_WITH([lib-prefix],
2835
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2836
--without-lib-prefix don't search for libraries in includedir and libdir],
2838
if test "X$withval" = "Xno"; then
2841
if test "X$withval" = "X"; then
2842
AC_LIB_WITH_FINAL_PREFIX([
2843
eval additional_includedir=\"$includedir\"
2844
eval additional_libdir=\"$libdir\"
2847
additional_includedir="$withval/include"
2848
additional_libdir="$withval/$acl_libdirstem"
2852
if test $use_additional = yes; then
2853
dnl Potentially add $additional_includedir to $CPPFLAGS.
2854
dnl But don't add it
2855
dnl 1. if it's the standard /usr/include,
2856
dnl 2. if it's already present in $CPPFLAGS,
2857
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
2858
dnl 4. if it doesn't exist as a directory.
2859
if test "X$additional_includedir" != "X/usr/include"; then
2861
for x in $CPPFLAGS; do
2862
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2863
if test "X$x" = "X-I$additional_includedir"; then
2868
if test -z "$haveit"; then
2869
if test "X$additional_includedir" = "X/usr/local/include"; then
2870
if test -n "$GCC"; then
2872
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
2876
if test -z "$haveit"; then
2877
if test -d "$additional_includedir"; then
2878
dnl Really add $additional_includedir to $CPPFLAGS.
2879
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2884
dnl Potentially add $additional_libdir to $LDFLAGS.
2885
dnl But don't add it
2886
dnl 1. if it's the standard /usr/lib,
2887
dnl 2. if it's already present in $LDFLAGS,
2888
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
2889
dnl 4. if it doesn't exist as a directory.
2890
if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
2892
for x in $LDFLAGS; do
2893
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2894
if test "X$x" = "X-L$additional_libdir"; then
2899
if test -z "$haveit"; then
2900
if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
2901
if test -n "$GCC"; then
2903
linux*) haveit=yes;;
2907
if test -z "$haveit"; then
2908
if test -d "$additional_libdir"; then
2909
dnl Really add $additional_libdir to $LDFLAGS.
2910
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2918
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2919
dnl acl_final_exec_prefix, containing the values to which $prefix and
2920
dnl $exec_prefix will expand at the end of the configure script.
2921
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2923
dnl Unfortunately, prefix and exec_prefix get only finally determined
2924
dnl at the end of configure.
2925
if test "X$prefix" = "XNONE"; then
2926
acl_final_prefix="$ac_default_prefix"
2928
acl_final_prefix="$prefix"
2930
if test "X$exec_prefix" = "XNONE"; then
2931
acl_final_exec_prefix='${prefix}'
2933
acl_final_exec_prefix="$exec_prefix"
2935
acl_save_prefix="$prefix"
2936
prefix="$acl_final_prefix"
2937
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2938
prefix="$acl_save_prefix"
2941
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2942
dnl variables prefix and exec_prefix bound to the values they will have
2943
dnl at the end of the configure script.
2944
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2946
acl_save_prefix="$prefix"
2947
prefix="$acl_final_prefix"
2948
acl_save_exec_prefix="$exec_prefix"
2949
exec_prefix="$acl_final_exec_prefix"
2951
exec_prefix="$acl_save_exec_prefix"
2952
prefix="$acl_save_prefix"
2955
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
2956
dnl the basename of the libdir, either "lib" or "lib64".
2957
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
2959
dnl There is no formal standard regarding lib and lib64. The current
2960
dnl practice is that on a system supporting 32-bit and 64-bit instruction
2961
dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
2962
dnl libraries go under $prefix/lib. We determine the compiler's default
2963
dnl mode by looking at the compiler's library search path. If at least
2964
dnl of its elements ends in /lib64 or points to a directory whose absolute
2965
dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
2966
dnl default, namely "lib".
2968
searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
2969
if test -n "$searchpath"; then
2970
acl_save_IFS="${IFS= }"; IFS=":"
2971
for searchdir in $searchpath; do
2972
if test -d "$searchdir"; then
2973
case "$searchdir" in
2974
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
2975
*) searchdir=`cd "$searchdir" && pwd`
2976
case "$searchdir" in
2977
*/lib64 ) acl_libdirstem=lib64 ;;
2985
# lock.m4 serial 6 (gettext-0.16)
2986
dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
2987
dnl This file is free software; the Free Software Foundation
2988
dnl gives unlimited permission to copy and/or distribute it,
2989
dnl with or without modifications, as long as this notice is preserved.
2991
dnl From Bruno Haible.
2993
dnl Tests for a multithreading library to be used.
2994
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
2995
dnl USE_PTH_THREADS, USE_WIN32_THREADS
2996
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
2997
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
2999
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
3000
dnl programs that really need multithread functionality. The difference
3001
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
3002
dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
3003
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
3004
dnl multithread-safe programs.
3006
AC_DEFUN([gl_LOCK_EARLY],
3008
AC_REQUIRE([gl_LOCK_EARLY_BODY])
3011
dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
3013
AC_DEFUN([gl_LOCK_EARLY_BODY],
3015
dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
3016
dnl influences the result of the autoconf tests that test for *_unlocked
3017
dnl declarations, on AIX 5 at least. Therefore it must come early.
3018
AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
3019
AC_BEFORE([$0], [gl_ARGP])dnl
3021
AC_REQUIRE([AC_CANONICAL_HOST])
3022
AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
3023
dnl Check for multithreading.
3024
AC_ARG_ENABLE(threads,
3025
AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
3026
AC_HELP_STRING([--disable-threads], [build without multithread safety]),
3027
[gl_use_threads=$enableval],
3029
dnl Disable multithreading by default on OSF/1, because it interferes
3030
dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
3031
dnl process gets an endless segmentation fault inside execvp().
3032
osf*) gl_use_threads=no ;;
3033
*) gl_use_threads=yes ;;
3036
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
3037
# For using <pthread.h>:
3040
# On OSF/1, the compiler needs the flag -D_REENTRANT so that it
3041
# groks <pthread.h>. cc also understands the flag -pthread, but
3042
# we don't use it because 1. gcc-2.95 doesn't understand -pthread,
3043
# 2. putting a flag into CPPFLAGS that has an effect on the linker
3044
# causes the AC_TRY_LINK test below to succeed unexpectedly,
3045
# leading to wrong values of LIBTHREAD and LTLIBTHREAD.
3046
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
3049
# Some systems optimize for single-threaded programs by default, and
3050
# need special flags to disable these optimizations. For example, the
3051
# definition of 'errno' in <errno.h>.
3053
aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
3054
solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
3059
dnl The guts of gl_LOCK. Needs to be expanded only once.
3061
AC_DEFUN([gl_LOCK_BODY],
3063
AC_REQUIRE([gl_LOCK_EARLY_BODY])
3069
if test "$gl_use_threads" != no; then
3070
dnl Check whether the compiler and linker support weak declarations.
3071
AC_MSG_CHECKING([whether imported symbols can be declared weak])
3073
AC_TRY_LINK([extern void xyzzy ();
3074
#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
3075
AC_MSG_RESULT([$gl_have_weak])
3076
if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
3077
# On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
3078
# it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
3079
AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
3080
if test "$gl_have_pthread_h" = yes; then
3081
# Other possible tests:
3082
# -lpthreads (FSU threads, PCthreads)
3085
# Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
3086
# in libc. IRIX 6.5 has the first one in both libc and libpthread, but
3087
# the second one only in libpthread, and lock.c needs it.
3088
AC_TRY_LINK([#include <pthread.h>],
3089
[pthread_mutex_lock((pthread_mutex_t*)0);
3090
pthread_mutexattr_init((pthread_mutexattr_t*)0);],
3091
[gl_have_pthread=yes])
3092
# Test for libpthread by looking for pthread_kill. (Not pthread_self,
3093
# since it is defined as a macro on OSF/1.)
3094
if test -n "$gl_have_pthread"; then
3095
# The program links fine without libpthread. But it may actually
3096
# need to link with libpthread in order to create multiple threads.
3097
AC_CHECK_LIB(pthread, pthread_kill,
3098
[LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
3099
# On Solaris and HP-UX, most pthread functions exist also in libc.
3100
# Therefore pthread_in_use() needs to actually try to create a
3101
# thread: pthread_create from libc will fail, whereas
3102
# pthread_create will actually create a thread.
3105
AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
3106
[Define if the pthread_in_use() detection is hard.])
3110
# Some library is needed. Try libpthread and libc_r.
3111
AC_CHECK_LIB(pthread, pthread_kill,
3112
[gl_have_pthread=yes
3113
LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
3114
LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
3115
if test -z "$gl_have_pthread"; then
3117
AC_CHECK_LIB(c_r, pthread_kill,
3118
[gl_have_pthread=yes
3119
LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
3120
LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
3123
if test -n "$gl_have_pthread"; then
3124
gl_threads_api=posix
3125
AC_DEFINE([USE_POSIX_THREADS], 1,
3126
[Define if the POSIX multithreading library can be used.])
3127
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
3128
if test $gl_have_weak = yes; then
3129
AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
3130
[Define if references to the POSIX multithreading library should be made weak.])
3135
# OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
3136
# pthread_rwlock_* functions.
3137
AC_CHECK_TYPE([pthread_rwlock_t],
3138
[AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
3139
[Define if the POSIX multithreading library has read/write locks.])],
3141
[#include <pthread.h>])
3142
# glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
3143
AC_TRY_COMPILE([#include <pthread.h>],
3144
[#if __FreeBSD__ == 4
3145
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
3147
int x = (int)PTHREAD_MUTEX_RECURSIVE;
3150
[AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
3151
[Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
3155
if test -z "$gl_have_pthread"; then
3156
if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
3157
gl_have_solaristhread=
3158
gl_save_LIBS="$LIBS"
3159
LIBS="$LIBS -lthread"
3160
AC_TRY_LINK([#include <thread.h>
3161
#include <synch.h>],
3163
[gl_have_solaristhread=yes])
3164
LIBS="$gl_save_LIBS"
3165
if test -n "$gl_have_solaristhread"; then
3166
gl_threads_api=solaris
3168
LTLIBTHREAD=-lthread
3169
LIBMULTITHREAD="$LIBTHREAD"
3170
LTLIBMULTITHREAD="$LTLIBTHREAD"
3171
AC_DEFINE([USE_SOLARIS_THREADS], 1,
3172
[Define if the old Solaris multithreading library can be used.])
3173
if test $gl_have_weak = yes; then
3174
AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
3175
[Define if references to the old Solaris multithreading library should be made weak.])
3182
if test "$gl_use_threads" = pth; then
3183
gl_save_CPPFLAGS="$CPPFLAGS"
3184
AC_LIB_LINKFLAGS(pth)
3186
gl_save_LIBS="$LIBS"
3188
AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
3189
LIBS="$gl_save_LIBS"
3190
if test -n "$gl_have_pth"; then
3193
LTLIBTHREAD="$LTLIBPTH"
3194
LIBMULTITHREAD="$LIBTHREAD"
3195
LTLIBMULTITHREAD="$LTLIBTHREAD"
3196
AC_DEFINE([USE_PTH_THREADS], 1,
3197
[Define if the GNU Pth multithreading library can be used.])
3198
if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
3199
if test $gl_have_weak = yes; then
3200
AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
3201
[Define if references to the GNU Pth multithreading library should be made weak.])
3207
CPPFLAGS="$gl_save_CPPFLAGS"
3210
if test -z "$gl_have_pthread"; then
3211
if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
3212
if { case "$host_os" in
3217
gl_threads_api=win32
3218
AC_DEFINE([USE_WIN32_THREADS], 1,
3219
[Define if the Win32 multithreading API can be used.])
3224
AC_MSG_CHECKING([for multithread API to use])
3225
AC_MSG_RESULT([$gl_threads_api])
3227
AC_SUBST(LTLIBTHREAD)
3228
AC_SUBST(LIBMULTITHREAD)
3229
AC_SUBST(LTLIBMULTITHREAD)
3234
AC_REQUIRE([gl_LOCK_EARLY])
3235
AC_REQUIRE([gl_LOCK_BODY])
3239
# Prerequisites of lib/lock.c.
3240
AC_DEFUN([gl_PREREQ_LOCK], [
3241
AC_REQUIRE([AC_C_INLINE])
3244
dnl Survey of platforms:
3246
dnl Platform Available Compiler Supports test-lock
3247
dnl flavours option weak result
3248
dnl --------------- --------- --------- -------- ---------
3249
dnl Linux 2.4/glibc posix -lpthread Y OK
3251
dnl GNU Hurd/glibc posix
3253
dnl FreeBSD 5.3 posix -lc_r Y
3255
dnl posix -lpthread ? Y
3258
dnl FreeBSD 5.2 posix -lc_r Y
3262
dnl FreeBSD 4.0,4.10 posix -lc_r Y OK
3266
dnl OpenBSD 3.4 posix -lpthread Y OK
3268
dnl MacOS X 10.[123] posix -lpthread Y OK
3270
dnl Solaris 7,8,9 posix -lpthread Y Sol 7,8: 0.0; Sol 9: OK
3271
dnl solaris -lthread Y Sol 7,8: 0.0; Sol 9: OK
3273
dnl HP-UX 11 posix -lpthread N (cc) OK
3276
dnl IRIX 6.5 posix -lpthread Y 0.5
3278
dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK
3280
dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK
3281
dnl -lpthread (gcc) Y
3283
dnl Cygwin posix -lpthread Y OK
3285
dnl Any of the above pth -lpth 0.0
3287
dnl Mingw win32 N OK
3291
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
3293
dnl OK if all three tests terminate OK,
3294
dnl 0.5 if the first test terminates OK but the second one loops endlessly,
3295
dnl 0.0 if the first test already loops endlessly.
3296
# longdouble.m4 serial 2 (gettext-0.15)
3297
dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
3298
dnl This file is free software; the Free Software Foundation
3299
dnl gives unlimited permission to copy and/or distribute it,
3300
dnl with or without modifications, as long as this notice is preserved.
3302
dnl From Bruno Haible.
3303
dnl Test whether the compiler supports the 'long double' type.
3304
dnl Prerequisite: AC_PROG_CC
3306
dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
3307
dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
3309
AC_DEFUN([gt_TYPE_LONGDOUBLE],
3311
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
3312
[if test "$GCC" = yes; then
3313
gt_cv_c_long_double=yes
3316
/* The Stardent Vistra knows sizeof(long double), but does not support it. */
3317
long double foo = 0.0;
3318
/* On Ultrix 4.3 cc, long double is 4 and double is 8. */
3319
int array [2*(sizeof(long double) >= sizeof(double)) - 1];
3321
gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
3323
if test $gt_cv_c_long_double = yes; then
3324
AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
3327
# longlong.m4 serial 8
3328
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
3329
dnl This file is free software; the Free Software Foundation
3330
dnl gives unlimited permission to copy and/or distribute it,
3331
dnl with or without modifications, as long as this notice is preserved.
3333
dnl From Paul Eggert.
3335
# Define HAVE_LONG_LONG_INT if 'long long int' works.
3336
# This fixes a bug in Autoconf 2.60, but can be removed once we
3337
# assume 2.61 everywhere.
3339
# Note: If the type 'long long int' exists but is only 32 bits large
3340
# (as on some very old compilers), AC_TYPE_LONG_LONG_INT will not be
3341
# defined. In this case you can treat 'long long int' like 'long int'.
3343
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
3345
AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
3348
[[long long int ll = 9223372036854775807ll;
3349
long long int nll = -9223372036854775807LL;
3350
typedef int a[((-9223372036854775807LL < 0
3351
&& 0 < 9223372036854775807ll)
3354
[[long long int llmax = 9223372036854775807ll;
3355
return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
3356
| (llmax / ll) | (llmax % ll));]])],
3357
[ac_cv_type_long_long_int=yes],
3358
[ac_cv_type_long_long_int=no])])
3359
if test $ac_cv_type_long_long_int = yes; then
3360
AC_DEFINE([HAVE_LONG_LONG_INT], 1,
3361
[Define to 1 if the system has the type `long long int'.])
3365
# This macro is obsolescent and should go away soon.
3366
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
3368
AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
3369
ac_cv_type_long_long=$ac_cv_type_long_long_int
3370
if test $ac_cv_type_long_long = yes; then
3371
AC_DEFINE(HAVE_LONG_LONG, 1,
3372
[Define if you have the 'long long' type.])
3375
# nls.m4 serial 3 (gettext-0.15)
3376
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
3377
dnl This file is free software; the Free Software Foundation
3378
dnl gives unlimited permission to copy and/or distribute it,
3379
dnl with or without modifications, as long as this notice is preserved.
3381
dnl This file can can be used in projects which are not available under
3382
dnl the GNU General Public License or the GNU Library General Public
3383
dnl License but which still want to provide support for the GNU gettext
3385
dnl Please note that the actual code of the GNU gettext library is covered
3386
dnl by the GNU Library General Public License, and the rest of the GNU
3387
dnl gettext package package is covered by the GNU General Public License.
3388
dnl They are *not* in the public domain.
3391
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3392
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3398
AC_MSG_CHECKING([whether NLS is requested])
3399
dnl Default is enabled NLS
3401
[ --disable-nls do not use Native Language Support],
3402
USE_NLS=$enableval, USE_NLS=yes)
3403
AC_MSG_RESULT($USE_NLS)
776
3406
# Configure paths for libogg
777
3407
# Jack Moffitt <jack@icecast.org> 10-21-2000
778
3408
# Shamelessly stolen from Owen Taylor and Manish Singh
868
3498
AC_SUBST(OGG_LIBS)
869
3499
rm -f conf.oggtest
3501
# po.m4 serial 13 (gettext-0.15)
3502
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
3503
dnl This file is free software; the Free Software Foundation
3504
dnl gives unlimited permission to copy and/or distribute it,
3505
dnl with or without modifications, as long as this notice is preserved.
3507
dnl This file can can be used in projects which are not available under
3508
dnl the GNU General Public License or the GNU Library General Public
3509
dnl License but which still want to provide support for the GNU gettext
3511
dnl Please note that the actual code of the GNU gettext library is covered
3512
dnl by the GNU Library General Public License, and the rest of the GNU
3513
dnl gettext package package is covered by the GNU General Public License.
3514
dnl They are *not* in the public domain.
3517
dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
3518
dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
3522
dnl Checks for all prerequisites of the po subdirectory.
3523
AC_DEFUN([AM_PO_SUBDIRS],
3525
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
3526
AC_REQUIRE([AC_PROG_INSTALL])dnl
3527
AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
3528
AC_REQUIRE([AM_NLS])dnl
3530
dnl Perform the following tests also if --disable-nls has been given,
3531
dnl because they are needed for "make dist" to work.
3533
dnl Search for GNU msgfmt in the PATH.
3534
dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
3535
dnl The second test excludes FreeBSD msgfmt.
3536
AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
3537
[$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3538
(if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
3540
AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
3542
dnl Test whether it is GNU msgfmt >= 0.15.
3544
case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3545
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
3546
*) MSGFMT_015=$MSGFMT ;;
3549
AC_SUBST([MSGFMT_015])
3551
case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3552
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
3553
*) GMSGFMT_015=$GMSGFMT ;;
3556
AC_SUBST([GMSGFMT_015])
3558
dnl Search for GNU xgettext 0.12 or newer in the PATH.
3559
dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
3560
dnl The second test excludes FreeBSD xgettext.
3561
AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
3562
[$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
3563
(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)],
3565
dnl Remove leftover from FreeBSD xgettext call.
3568
dnl Test whether it is GNU xgettext >= 0.15.
3570
case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
3571
'' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
3572
*) XGETTEXT_015=$XGETTEXT ;;
3575
AC_SUBST([XGETTEXT_015])
3577
dnl Search for GNU msgmerge 0.11 or newer in the PATH.
3578
AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
3579
[$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
3581
dnl Installation directories.
3582
dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
3583
dnl have to define it here, so that it can be used in po/Makefile.
3584
test -n "$localedir" || localedir='${datadir}/locale'
3585
AC_SUBST([localedir])
3587
AC_CONFIG_COMMANDS([po-directories], [[
3588
for ac_file in $CONFIG_FILES; do
3589
# Support "outfile[:infile[:infile...]]"
3591
*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
3593
# PO directories have a Makefile.in generated from Makefile.in.in.
3594
case "$ac_file" in */Makefile.in)
3595
# Adjust a relative srcdir.
3596
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3597
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
3598
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3599
# In autoconf-2.13 it is called $ac_given_srcdir.
3600
# In autoconf-2.50 it is called $srcdir.
3601
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3602
case "$ac_given_srcdir" in
3603
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3604
/*) top_srcdir="$ac_given_srcdir" ;;
3605
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3607
# Treat a directory as a PO directory if and only if it has a
3608
# POTFILES.in file. This allows packages to have multiple PO
3609
# directories under different names or in different locations.
3610
if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
3611
rm -f "$ac_dir/POTFILES"
3612
test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
3613
cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
3614
POMAKEFILEDEPS="POTFILES.in"
3615
# ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
3616
# on $ac_dir but don't depend on user-specified configuration
3618
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3619
# The LINGUAS file contains the set of available languages.
3620
if test -n "$OBSOLETE_ALL_LINGUAS"; then
3621
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3623
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3624
# Hide the ALL_LINGUAS assigment from automake < 1.5.
3625
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3626
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3628
# The set of available languages was given in configure.in.
3629
# Hide the ALL_LINGUAS assigment from automake < 1.5.
3630
eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
3633
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3634
# Compute UPDATEPOFILES
3635
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3636
# Compute DUMMYPOFILES
3637
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3639
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3640
case "$ac_given_srcdir" in
3642
*) srcdirpre='$(srcdir)/' ;;
3648
for lang in $ALL_LINGUAS; do
3649
POFILES="$POFILES $srcdirpre$lang.po"
3650
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3651
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3652
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3654
# CATALOGS depends on both $ac_dir and the user's LINGUAS
3655
# environment variable.
3657
if test -n "$ALL_LINGUAS"; then
3658
for presentlang in $ALL_LINGUAS; do
3660
if test "%UNSET%" != "$LINGUAS"; then
3661
desiredlanguages="$LINGUAS"
3663
desiredlanguages="$ALL_LINGUAS"
3665
for desiredlang in $desiredlanguages; do
3666
# Use the presentlang catalog if desiredlang is
3667
# a. equal to presentlang, or
3668
# b. a variant of presentlang (because in this case,
3669
# presentlang can be used as a fallback for messages
3670
# which are not translated in the desiredlang catalog).
3671
case "$desiredlang" in
3672
"$presentlang"*) useit=yes;;
3675
if test $useit = yes; then
3676
INST_LINGUAS="$INST_LINGUAS $presentlang"
3681
if test -n "$INST_LINGUAS"; then
3682
for lang in $INST_LINGUAS; do
3683
CATALOGS="$CATALOGS $lang.gmo"
3686
test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
3687
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"
3688
for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
3689
if test -f "$f"; then
3691
*.orig | *.bak | *~) ;;
3692
*) cat "$f" >> "$ac_dir/Makefile" ;;
3700
[# Capture the value of obsolete ALL_LINGUAS because we need it to compute
3701
# POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
3702
# from automake < 1.5.
3703
eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
3704
# Capture the value of LINGUAS because we need it to compute CATALOGS.
3705
LINGUAS="${LINGUAS-%UNSET%}"
3709
dnl Postprocesses a Makefile in a directory containing PO files.
3710
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
3712
# When this code is run, in config.status, two variables have already been
3714
# - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
3715
# - LINGUAS is the value of the environment variable LINGUAS at configure
3719
# Adjust a relative srcdir.
3720
ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
3721
ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
3722
ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
3723
# In autoconf-2.13 it is called $ac_given_srcdir.
3724
# In autoconf-2.50 it is called $srcdir.
3725
test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
3726
case "$ac_given_srcdir" in
3727
.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
3728
/*) top_srcdir="$ac_given_srcdir" ;;
3729
*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
3732
# Find a way to echo strings without interpreting backslash.
3733
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
3736
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
3737
gt_echo='printf %s\n'
3748
# A sed script that extracts the value of VARIABLE from a Makefile.
3750
# Test if the hold space is empty.
3755
# Yes it was empty. Look if we have the expected variable definition.
3756
/^[ ]*VARIABLE[ ]*=/{
3757
# Seen the first line of the variable definition.
3758
s/^[ ]*VARIABLE[ ]*=//
3763
# Here we are processing a line from the variable definition.
3764
# Remove comment, more precisely replace it with a space.
3766
# See if the line ends in a backslash.
3770
# Print the line, without the trailing backslash.
3773
# There was no trailing backslash. The end of the variable definition is
3774
# reached. Clear the hold space.
3779
# A trailing backslash means that the variable definition continues in the
3780
# next line. Put a nonempty string into the hold space to indicate this.
3787
# Set POTFILES to the value of the Makefile variable POTFILES.
3788
sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
3789
POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
3790
# Compute POTFILES_DEPS as
3791
# $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
3793
for file in $POTFILES; do
3794
POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
3798
if test -n "$OBSOLETE_ALL_LINGUAS"; then
3799
test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
3801
if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
3802
# The LINGUAS file contains the set of available languages.
3803
ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
3804
POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
3806
# Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
3807
sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
3808
ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
3810
# Hide the ALL_LINGUAS assigment from automake < 1.5.
3811
eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
3813
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
3814
# Compute UPDATEPOFILES
3815
# as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
3816
# Compute DUMMYPOFILES
3817
# as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
3819
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
3820
# Compute PROPERTIESFILES
3821
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
3822
# Compute CLASSFILES
3823
# as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
3825
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
3827
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
3828
# Compute RESOURCESDLLFILES
3829
# as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
3830
case "$ac_given_srcdir" in
3832
*) srcdirpre='$(srcdir)/' ;;
3843
for lang in $ALL_LINGUAS; do
3844
POFILES="$POFILES $srcdirpre$lang.po"
3845
UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
3846
DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
3847
GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
3848
PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
3849
CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
3850
QMFILES="$QMFILES $srcdirpre$lang.qm"
3851
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3852
MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
3853
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/'`
3854
RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
3856
# CATALOGS depends on both $ac_dir and the user's LINGUAS
3857
# environment variable.
3859
if test -n "$ALL_LINGUAS"; then
3860
for presentlang in $ALL_LINGUAS; do
3862
if test "%UNSET%" != "$LINGUAS"; then
3863
desiredlanguages="$LINGUAS"
3865
desiredlanguages="$ALL_LINGUAS"
3867
for desiredlang in $desiredlanguages; do
3868
# Use the presentlang catalog if desiredlang is
3869
# a. equal to presentlang, or
3870
# b. a variant of presentlang (because in this case,
3871
# presentlang can be used as a fallback for messages
3872
# which are not translated in the desiredlang catalog).
3873
case "$desiredlang" in
3874
"$presentlang"*) useit=yes;;
3877
if test $useit = yes; then
3878
INST_LINGUAS="$INST_LINGUAS $presentlang"
3887
if test -n "$INST_LINGUAS"; then
3888
for lang in $INST_LINGUAS; do
3889
CATALOGS="$CATALOGS $lang.gmo"
3890
JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
3891
QTCATALOGS="$QTCATALOGS $lang.qm"
3892
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3893
TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
3894
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/'`
3895
CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
3899
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"
3900
if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
3901
# Add dependencies that cannot be formulated as a simple suffix rule.
3902
for lang in $ALL_LINGUAS; do
3903
frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
3904
cat >> "$ac_file.tmp" <<EOF
3905
$frobbedlang.msg: $lang.po
3906
@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
3907
\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3911
if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
3912
# Add dependencies that cannot be formulated as a simple suffix rule.
3913
for lang in $ALL_LINGUAS; do
3914
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/'`
3915
cat >> "$ac_file.tmp" <<EOF
3916
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
3917
@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
3918
\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
3922
if test -n "$POMAKEFILEDEPS"; then
3923
cat >> "$ac_file.tmp" <<EOF
3924
Makefile: $POMAKEFILEDEPS
3927
mv "$ac_file.tmp" "$ac_file"
3929
# printf-posix.m4 serial 2 (gettext-0.13.1)
3930
dnl Copyright (C) 2003 Free Software Foundation, Inc.
3931
dnl This file is free software; the Free Software Foundation
3932
dnl gives unlimited permission to copy and/or distribute it,
3933
dnl with or without modifications, as long as this notice is preserved.
3935
dnl From Bruno Haible.
3936
dnl Test whether the printf() function supports POSIX/XSI format strings with
3939
AC_DEFUN([gt_PRINTF_POSIX],
3941
AC_REQUIRE([AC_PROG_CC])
3942
AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3943
gt_cv_func_printf_posix,
3948
/* The string "%2$d %1$d", with dollar characters protected from the shell's
3949
dollar expansion (possibly an autoconf bug). */
3950
static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3951
static char buf[100];
3954
sprintf (buf, format, 33, 55);
3955
return (strcmp (buf, "55 33") != 0);
3956
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
3958
AC_EGREP_CPP(notposix, [
3959
#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3962
], gt_cv_func_printf_posix="guessing no",
3963
gt_cv_func_printf_posix="guessing yes")
3966
case $gt_cv_func_printf_posix in
3968
AC_DEFINE(HAVE_POSIX_PRINTF, 1,
3969
[Define if your printf() function supports format strings with positions.])
3973
# progtest.m4 serial 4 (gettext-0.14.2)
3974
dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
3975
dnl This file is free software; the Free Software Foundation
3976
dnl gives unlimited permission to copy and/or distribute it,
3977
dnl with or without modifications, as long as this notice is preserved.
3979
dnl This file can can be used in projects which are not available under
3980
dnl the GNU General Public License or the GNU Library General Public
3981
dnl License but which still want to provide support for the GNU gettext
3983
dnl Please note that the actual code of the GNU gettext library is covered
3984
dnl by the GNU Library General Public License, and the rest of the GNU
3985
dnl gettext package package is covered by the GNU General Public License.
3986
dnl They are *not* in the public domain.
3989
dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
3993
# Search path for a program which passes the given test.
3995
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
3996
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
3997
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
3999
# Prepare PATH_SEPARATOR.
4000
# The user is always right.
4001
if test "${PATH_SEPARATOR+set}" != set; then
4002
echo "#! /bin/sh" >conf$$.sh
4003
echo "exit 0" >>conf$$.sh
4005
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
4013
# Find out how to test for executable files. Don't use a zero-byte file,
4014
# as systems may use methods other than mode bits to determine executability.
4015
cat >conf$$.file <<_ASEOF
4019
chmod +x conf$$.file
4020
if test -x conf$$.file >/dev/null 2>&1; then
4021
ac_executable_p="test -x"
4023
ac_executable_p="test -f"
4027
# Extract the first word of "$2", so it can be a program name with args.
4028
set dummy $2; ac_word=[$]2
4029
AC_MSG_CHECKING([for $ac_word])
4030
AC_CACHE_VAL(ac_cv_path_$1,
4032
[[\\/]]* | ?:[[\\/]]*)
4033
ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
4036
ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
4037
for ac_dir in ifelse([$5], , $PATH, [$5]); do
4039
test -z "$ac_dir" && ac_dir=.
4040
for ac_exec_ext in '' $ac_executable_extensions; do
4041
if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
4042
echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
4044
ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
4051
dnl If no 4th arg is given, leave the cache variable unset,
4052
dnl so AC_PATH_PROGS will keep looking.
4053
ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
4058
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
4059
AC_MSG_RESULT([$]$1)
872
4066
dnl Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>