~elementary-os/dexter-contacts/deb-packaging

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Package Import Robot
  • Author(s): Rodrigo Moya
  • Date: 2011-09-19 20:44:32 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: package-import@ubuntu.com-20110919204432-n7bwkmxj0xaqyjze
Tags: 0.1.5.2-0ubuntu1
* New upstream release
* debian/control:
  - Build-depend on valac >= 0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
403
403
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
404
404
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
405
405
 
406
 
# Copyright (C) 1995-2002 Free Software Foundation, Inc.
407
 
# Copyright (C) 2001-2003,2004 Red Hat, Inc.
408
 
#
409
 
# This file is free software, distributed under the terms of the GNU
410
 
# General Public License.  As a special exception to the GNU General
411
 
# Public License, this file may be distributed as part of a program
412
 
# that contains a configuration script generated by Autoconf, under
413
 
# the same distribution terms as the rest of that program.
414
 
#
415
 
# This file can be copied and used freely without restrictions.  It can
416
 
# be used in projects which are not available under the GNU Public License
417
 
# but which still want to provide support for the GNU gettext functionality.
418
 
#
419
 
# Macro to add for using GNU gettext.
420
 
# Ulrich Drepper <drepper@cygnus.com>, 1995, 1996
421
 
#
422
 
# Modified to never use included libintl. 
423
 
# Owen Taylor <otaylor@redhat.com>, 12/15/1998
424
 
#
425
 
# Major rework to remove unused code
426
 
# Owen Taylor <otaylor@redhat.com>, 12/11/2002
427
 
#
428
 
# Added better handling of ALL_LINGUAS from GNU gettext version 
429
 
# written by Bruno Haible, Owen Taylor <otaylor.redhat.com> 5/30/3002
430
 
#
431
 
# Modified to require ngettext
432
 
# Matthias Clasen <mclasen@redhat.com> 08/06/2004
433
 
#
434
 
# We need this here as well, since someone might use autoconf-2.5x
435
 
# to configure GLib then an older version to configure a package
436
 
# using AM_GLIB_GNU_GETTEXT
437
 
AC_PREREQ(2.53)
438
 
 
439
 
dnl
440
 
dnl We go to great lengths to make sure that aclocal won't 
441
 
dnl try to pull in the installed version of these macros
442
 
dnl when running aclocal in the glib directory.
443
 
dnl
444
 
m4_copy([AC_DEFUN],[glib_DEFUN])
445
 
m4_copy([AC_REQUIRE],[glib_REQUIRE])
446
 
dnl
447
 
dnl At the end, if we're not within glib, we'll define the public
448
 
dnl definitions in terms of our private definitions.
449
 
dnl
450
 
 
451
 
# GLIB_LC_MESSAGES
452
 
#--------------------
453
 
glib_DEFUN([GLIB_LC_MESSAGES],
454
 
  [AC_CHECK_HEADERS([locale.h])
455
 
    if test $ac_cv_header_locale_h = yes; then
456
 
    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
457
 
      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
458
 
       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
459
 
    if test $am_cv_val_LC_MESSAGES = yes; then
460
 
      AC_DEFINE(HAVE_LC_MESSAGES, 1,
461
 
        [Define if your <locale.h> file defines LC_MESSAGES.])
462
 
    fi
463
 
  fi])
464
 
 
465
 
# GLIB_PATH_PROG_WITH_TEST
466
 
#----------------------------
467
 
dnl GLIB_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
468
 
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
469
 
glib_DEFUN([GLIB_PATH_PROG_WITH_TEST],
470
 
[# Extract the first word of "$2", so it can be a program name with args.
471
 
set dummy $2; ac_word=[$]2
472
 
AC_MSG_CHECKING([for $ac_word])
473
 
AC_CACHE_VAL(ac_cv_path_$1,
474
 
[case "[$]$1" in
475
 
  /*)
476
 
  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
477
 
  ;;
478
 
  *)
479
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
480
 
  for ac_dir in ifelse([$5], , $PATH, [$5]); do
481
 
    test -z "$ac_dir" && ac_dir=.
482
 
    if test -f $ac_dir/$ac_word; then
483
 
      if [$3]; then
484
 
        ac_cv_path_$1="$ac_dir/$ac_word"
485
 
        break
486
 
      fi
487
 
    fi
488
 
  done
489
 
  IFS="$ac_save_ifs"
490
 
dnl If no 4th arg is given, leave the cache variable unset,
491
 
dnl so AC_PATH_PROGS will keep looking.
492
 
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
493
 
])dnl
494
 
  ;;
495
 
esac])dnl
496
 
$1="$ac_cv_path_$1"
497
 
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
498
 
  AC_MSG_RESULT([$]$1)
499
 
else
500
 
  AC_MSG_RESULT(no)
501
 
fi
502
 
AC_SUBST($1)dnl
 
406
# iconv.m4 serial 11 (gettext-0.18.1)
 
407
dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
 
408
dnl This file is free software; the Free Software Foundation
 
409
dnl gives unlimited permission to copy and/or distribute it,
 
410
dnl with or without modifications, as long as this notice is preserved.
 
411
 
 
412
dnl From Bruno Haible.
 
413
 
 
414
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 
415
[
 
416
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
417
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
418
  AC_REQUIRE([AC_LIB_RPATH])
 
419
 
 
420
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
421
  dnl accordingly.
 
422
  AC_LIB_LINKFLAGS_BODY([iconv])
503
423
])
504
424
 
505
 
# GLIB_WITH_NLS
506
 
#-----------------
507
 
glib_DEFUN([GLIB_WITH_NLS],
508
 
  dnl NLS is obligatory
509
 
  [USE_NLS=yes
510
 
    AC_SUBST(USE_NLS)
511
 
 
512
 
    gt_cv_have_gettext=no
513
 
 
514
 
    CATOBJEXT=NONE
515
 
    XGETTEXT=:
516
 
    INTLLIBS=
517
 
 
518
 
    AC_CHECK_HEADER(libintl.h,
519
 
     [gt_cv_func_dgettext_libintl="no"
520
 
      libintl_extra_libs=""
521
 
 
522
 
      #
523
 
      # First check in libc
524
 
      #
525
 
      AC_CACHE_CHECK([for ngettext in libc], gt_cv_func_ngettext_libc,
526
 
        [AC_TRY_LINK([
527
 
#include <libintl.h>
528
 
],
529
 
         [return !ngettext ("","", 1)],
530
 
          gt_cv_func_ngettext_libc=yes,
531
 
          gt_cv_func_ngettext_libc=no)
532
 
        ])
533
 
  
534
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
535
 
              AC_CACHE_CHECK([for dgettext in libc], gt_cv_func_dgettext_libc,
536
 
                [AC_TRY_LINK([
537
 
#include <libintl.h>
538
 
],
539
 
                  [return !dgettext ("","")],
540
 
                  gt_cv_func_dgettext_libc=yes,
541
 
                  gt_cv_func_dgettext_libc=no)
542
 
                ])
543
 
      fi
544
 
  
545
 
      if test "$gt_cv_func_ngettext_libc" = "yes" ; then
546
 
        AC_CHECK_FUNCS(bind_textdomain_codeset)
547
 
      fi
548
 
 
549
 
      #
550
 
      # If we don't have everything we want, check in libintl
551
 
      #
552
 
      if test "$gt_cv_func_dgettext_libc" != "yes" \
553
 
         || test "$gt_cv_func_ngettext_libc" != "yes" \
554
 
         || test "$ac_cv_func_bind_textdomain_codeset" != "yes" ; then
555
 
        
556
 
        AC_CHECK_LIB(intl, bindtextdomain,
557
 
            [AC_CHECK_LIB(intl, ngettext,
558
 
                    [AC_CHECK_LIB(intl, dgettext,
559
 
                                  gt_cv_func_dgettext_libintl=yes)])])
560
 
 
561
 
        if test "$gt_cv_func_dgettext_libintl" != "yes" ; then
562
 
          AC_MSG_CHECKING([if -liconv is needed to use gettext])
563
 
          AC_MSG_RESULT([])
564
 
          AC_CHECK_LIB(intl, ngettext,
565
 
                [AC_CHECK_LIB(intl, dcgettext,
566
 
                       [gt_cv_func_dgettext_libintl=yes
567
 
                        libintl_extra_libs=-liconv],
568
 
                        :,-liconv)],
569
 
                :,-liconv)
570
 
        fi
571
 
 
572
 
        #
573
 
        # If we found libintl, then check in it for bind_textdomain_codeset();
574
 
        # we'll prefer libc if neither have bind_textdomain_codeset(),
575
 
        # and both have dgettext and ngettext
576
 
        #
577
 
        if test "$gt_cv_func_dgettext_libintl" = "yes" ; then
578
 
          glib_save_LIBS="$LIBS"
579
 
          LIBS="$LIBS -lintl $libintl_extra_libs"
580
 
          unset ac_cv_func_bind_textdomain_codeset
581
 
          AC_CHECK_FUNCS(bind_textdomain_codeset)
582
 
          LIBS="$glib_save_LIBS"
583
 
 
584
 
          if test "$ac_cv_func_bind_textdomain_codeset" = "yes" ; then
585
 
            gt_cv_func_dgettext_libc=no
586
 
          else
587
 
            if test "$gt_cv_func_dgettext_libc" = "yes" \
588
 
                && test "$gt_cv_func_ngettext_libc" = "yes"; then
589
 
              gt_cv_func_dgettext_libintl=no
590
 
            fi
591
 
          fi
592
 
        fi
593
 
      fi
594
 
 
595
 
      if test "$gt_cv_func_dgettext_libc" = "yes" \
596
 
        || test "$gt_cv_func_dgettext_libintl" = "yes"; then
597
 
        gt_cv_have_gettext=yes
598
 
      fi
599
 
  
600
 
      if test "$gt_cv_func_dgettext_libintl" = "yes"; then
601
 
        INTLLIBS="-lintl $libintl_extra_libs"
602
 
      fi
603
 
  
604
 
      if test "$gt_cv_have_gettext" = "yes"; then
605
 
        AC_DEFINE(HAVE_GETTEXT,1,
606
 
          [Define if the GNU gettext() function is already present or preinstalled.])
607
 
        GLIB_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
608
 
          [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
609
 
        if test "$MSGFMT" != "no"; then
610
 
          glib_save_LIBS="$LIBS"
611
 
          LIBS="$LIBS $INTLLIBS"
612
 
          AC_CHECK_FUNCS(dcgettext)
613
 
          MSGFMT_OPTS=
614
 
          AC_MSG_CHECKING([if msgfmt accepts -c])
615
 
          GLIB_RUN_PROG([$MSGFMT -c -o /dev/null],[
616
 
msgid ""
617
 
msgstr ""
618
 
"Content-Type: text/plain; charset=UTF-8\n"
619
 
"Project-Id-Version: test 1.0\n"
620
 
"PO-Revision-Date: 2007-02-15 12:01+0100\n"
621
 
"Last-Translator: test <foo@bar.xx>\n"
622
 
"Language-Team: C <LL@li.org>\n"
623
 
"MIME-Version: 1.0\n"
624
 
"Content-Transfer-Encoding: 8bit\n"
625
 
], [MSGFMT_OPTS=-c; AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
626
 
          AC_SUBST(MSGFMT_OPTS)
627
 
          AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
628
 
          GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
629
 
            [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
630
 
          AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
631
 
                         return _nl_msg_cat_cntr],
632
 
            [CATOBJEXT=.gmo 
633
 
             DATADIRNAME=share],
634
 
            [case $host in
635
 
            *-*-solaris*)
636
 
            dnl On Solaris, if bind_textdomain_codeset is in libc,
637
 
            dnl GNU format message catalog is always supported,
638
 
            dnl since both are added to the libc all together.
639
 
            dnl Hence, we'd like to go with DATADIRNAME=share and
640
 
            dnl and CATOBJEXT=.gmo in this case.
641
 
            AC_CHECK_FUNC(bind_textdomain_codeset,
642
 
              [CATOBJEXT=.gmo 
643
 
               DATADIRNAME=share],
644
 
              [CATOBJEXT=.mo
645
 
               DATADIRNAME=lib])
646
 
            ;;
647
 
            *)
648
 
            CATOBJEXT=.mo
649
 
            DATADIRNAME=lib
650
 
            ;;
651
 
            esac])
652
 
          LIBS="$glib_save_LIBS"
653
 
          INSTOBJEXT=.mo
654
 
        else
655
 
          gt_cv_have_gettext=no
656
 
        fi
657
 
      fi
 
425
AC_DEFUN([AM_ICONV_LINK],
 
426
[
 
427
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
 
428
  dnl those with the standalone portable GNU libiconv installed).
 
429
  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
430
 
 
431
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
432
  dnl accordingly.
 
433
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
434
 
 
435
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
 
436
  dnl because if the user has installed libiconv and not disabled its use
 
437
  dnl via --without-libiconv-prefix, he wants to use it. The first
 
438
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
 
439
  am_save_CPPFLAGS="$CPPFLAGS"
 
440
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
441
 
 
442
  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
 
443
    am_cv_func_iconv="no, consider installing GNU libiconv"
 
444
    am_cv_lib_iconv=no
 
445
    AC_TRY_LINK([#include <stdlib.h>
 
446
#include <iconv.h>],
 
447
      [iconv_t cd = iconv_open("","");
 
448
       iconv(cd,NULL,NULL,NULL,NULL);
 
449
       iconv_close(cd);],
 
450
      [am_cv_func_iconv=yes])
 
451
    if test "$am_cv_func_iconv" != yes; then
 
452
      am_save_LIBS="$LIBS"
 
453
      LIBS="$LIBS $LIBICONV"
 
454
      AC_TRY_LINK([#include <stdlib.h>
 
455
#include <iconv.h>],
 
456
        [iconv_t cd = iconv_open("","");
 
457
         iconv(cd,NULL,NULL,NULL,NULL);
 
458
         iconv_close(cd);],
 
459
        [am_cv_lib_iconv=yes]
 
460
        [am_cv_func_iconv=yes])
 
461
      LIBS="$am_save_LIBS"
 
462
    fi
 
463
  ])
 
464
  if test "$am_cv_func_iconv" = yes; then
 
465
    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
 
466
      dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
 
467
      am_save_LIBS="$LIBS"
 
468
      if test $am_cv_lib_iconv = yes; then
 
469
        LIBS="$LIBS $LIBICONV"
 
470
      fi
 
471
      AC_TRY_RUN([
 
472
#include <iconv.h>
 
473
#include <string.h>
 
474
int main ()
 
475
{
 
476
  /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
 
477
     returns.  */
 
478
  {
 
479
    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
 
480
    if (cd_utf8_to_88591 != (iconv_t)(-1))
 
481
      {
 
482
        static const char input[] = "\342\202\254"; /* EURO SIGN */
 
483
        char buf[10];
 
484
        const char *inptr = input;
 
485
        size_t inbytesleft = strlen (input);
 
486
        char *outptr = buf;
 
487
        size_t outbytesleft = sizeof (buf);
 
488
        size_t res = iconv (cd_utf8_to_88591,
 
489
                            (char **) &inptr, &inbytesleft,
 
490
                            &outptr, &outbytesleft);
 
491
        if (res == 0)
 
492
          return 1;
 
493
      }
 
494
  }
 
495
  /* Test against Solaris 10 bug: Failures are not distinguishable from
 
496
     successful returns.  */
 
497
  {
 
498
    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
 
499
    if (cd_ascii_to_88591 != (iconv_t)(-1))
 
500
      {
 
501
        static const char input[] = "\263";
 
502
        char buf[10];
 
503
        const char *inptr = input;
 
504
        size_t inbytesleft = strlen (input);
 
505
        char *outptr = buf;
 
506
        size_t outbytesleft = sizeof (buf);
 
507
        size_t res = iconv (cd_ascii_to_88591,
 
508
                            (char **) &inptr, &inbytesleft,
 
509
                            &outptr, &outbytesleft);
 
510
        if (res == 0)
 
511
          return 1;
 
512
      }
 
513
  }
 
514
#if 0 /* This bug could be worked around by the caller.  */
 
515
  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
 
516
  {
 
517
    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
 
518
    if (cd_88591_to_utf8 != (iconv_t)(-1))
 
519
      {
 
520
        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
 
521
        char buf[50];
 
522
        const char *inptr = input;
 
523
        size_t inbytesleft = strlen (input);
 
524
        char *outptr = buf;
 
525
        size_t outbytesleft = sizeof (buf);
 
526
        size_t res = iconv (cd_88591_to_utf8,
 
527
                            (char **) &inptr, &inbytesleft,
 
528
                            &outptr, &outbytesleft);
 
529
        if ((int)res > 0)
 
530
          return 1;
 
531
      }
 
532
  }
 
533
#endif
 
534
  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
 
535
     provided.  */
 
536
  if (/* Try standardized names.  */
 
537
      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
 
538
      /* Try IRIX, OSF/1 names.  */
 
539
      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
 
540
      /* Try AIX names.  */
 
541
      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
 
542
      /* Try HP-UX names.  */
 
543
      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
 
544
    return 1;
 
545
  return 0;
 
546
}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
 
547
        [case "$host_os" in
 
548
           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
 
549
           *)            am_cv_func_iconv_works="guessing yes" ;;
 
550
         esac])
 
551
      LIBS="$am_save_LIBS"
658
552
    ])
659
 
 
660
 
    if test "$gt_cv_have_gettext" = "yes" ; then
661
 
      AC_DEFINE(ENABLE_NLS, 1,
662
 
        [always defined to indicate that i18n is enabled])
663
 
    fi
664
 
 
665
 
    dnl Test whether we really found GNU xgettext.
666
 
    if test "$XGETTEXT" != ":"; then
667
 
      dnl If it is not GNU xgettext we define it as : so that the
668
 
      dnl Makefiles still can work.
669
 
      if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
670
 
        : ;
671
 
      else
672
 
        AC_MSG_RESULT(
673
 
          [found xgettext program is not GNU xgettext; ignore it])
674
 
        XGETTEXT=":"
675
 
      fi
676
 
    fi
677
 
 
678
 
    # We need to process the po/ directory.
679
 
    POSUB=po
680
 
 
681
 
    AC_OUTPUT_COMMANDS(
682
 
      [case "$CONFIG_FILES" in *po/Makefile.in*)
683
 
        sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile
684
 
      esac])
685
 
 
686
 
    dnl These rules are solely for the distribution goal.  While doing this
687
 
    dnl we only have to keep exactly one list of the available catalogs
688
 
    dnl in configure.ac.
689
 
    for lang in $ALL_LINGUAS; do
690
 
      GMOFILES="$GMOFILES $lang.gmo"
691
 
      POFILES="$POFILES $lang.po"
692
 
    done
693
 
 
694
 
    dnl Make all variables we use known to autoconf.
695
 
    AC_SUBST(CATALOGS)
696
 
    AC_SUBST(CATOBJEXT)
697
 
    AC_SUBST(DATADIRNAME)
698
 
    AC_SUBST(GMOFILES)
699
 
    AC_SUBST(INSTOBJEXT)
700
 
    AC_SUBST(INTLLIBS)
701
 
    AC_SUBST(PO_IN_DATADIR_TRUE)
702
 
    AC_SUBST(PO_IN_DATADIR_FALSE)
703
 
    AC_SUBST(POFILES)
704
 
    AC_SUBST(POSUB)
705
 
  ])
706
 
 
707
 
# AM_GLIB_GNU_GETTEXT
708
 
# -------------------
709
 
# Do checks necessary for use of gettext. If a suitable implementation 
710
 
# of gettext is found in either in libintl or in the C library,
711
 
# it will set INTLLIBS to the libraries needed for use of gettext
712
 
# and AC_DEFINE() HAVE_GETTEXT and ENABLE_NLS. (The shell variable
713
 
# gt_cv_have_gettext will be set to "yes".) It will also call AC_SUBST()
714
 
# on various variables needed by the Makefile.in.in installed by 
715
 
# glib-gettextize.
716
 
dnl
717
 
glib_DEFUN([GLIB_GNU_GETTEXT],
718
 
  [AC_REQUIRE([AC_PROG_CC])dnl
719
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
720
 
   
721
 
   GLIB_LC_MESSAGES
722
 
   GLIB_WITH_NLS
723
 
 
724
 
   if test "$gt_cv_have_gettext" = "yes"; then
725
 
     if test "x$ALL_LINGUAS" = "x"; then
726
 
       LINGUAS=
727
 
     else
728
 
       AC_MSG_CHECKING(for catalogs to be installed)
729
 
       NEW_LINGUAS=
730
 
       for presentlang in $ALL_LINGUAS; do
731
 
         useit=no
732
 
         if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then
733
 
           desiredlanguages="$LINGUAS"
734
 
         else
735
 
           desiredlanguages="$ALL_LINGUAS"
736
 
         fi
737
 
         for desiredlang in $desiredlanguages; do
738
 
           # Use the presentlang catalog if desiredlang is
739
 
           #   a. equal to presentlang, or
740
 
           #   b. a variant of presentlang (because in this case,
741
 
           #      presentlang can be used as a fallback for messages
742
 
           #      which are not translated in the desiredlang catalog).
743
 
           case "$desiredlang" in
744
 
             "$presentlang"*) useit=yes;;
745
 
           esac
746
 
         done
747
 
         if test $useit = yes; then
748
 
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
749
 
         fi
750
 
       done
751
 
       LINGUAS=$NEW_LINGUAS
752
 
       AC_MSG_RESULT($LINGUAS)
753
 
     fi
754
 
 
755
 
     dnl Construct list of names of catalog files to be constructed.
756
 
     if test -n "$LINGUAS"; then
757
 
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
758
 
     fi
759
 
   fi
760
 
 
761
 
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
762
 
   dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
763
 
   dnl Try to locate is.
764
 
   MKINSTALLDIRS=
765
 
   if test -n "$ac_aux_dir"; then
766
 
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
767
 
   fi
768
 
   if test -z "$MKINSTALLDIRS"; then
769
 
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
770
 
   fi
771
 
   AC_SUBST(MKINSTALLDIRS)
772
 
 
773
 
   dnl Generate list of files to be processed by xgettext which will
774
 
   dnl be included in po/Makefile.
775
 
   test -d po || mkdir po
776
 
   if test "x$srcdir" != "x."; then
777
 
     if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
778
 
       posrcprefix="$srcdir/"
779
 
     else
780
 
       posrcprefix="../$srcdir/"
781
 
     fi
782
 
   else
783
 
     posrcprefix="../"
784
 
   fi
785
 
   rm -f po/POTFILES
786
 
   sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
787
 
        < $srcdir/po/POTFILES.in > po/POTFILES
788
 
  ])
789
 
 
790
 
# AM_GLIB_DEFINE_LOCALEDIR(VARIABLE)
791
 
# -------------------------------
792
 
# Define VARIABLE to the location where catalog files will
793
 
# be installed by po/Makefile.
794
 
glib_DEFUN([GLIB_DEFINE_LOCALEDIR],
795
 
[glib_REQUIRE([GLIB_GNU_GETTEXT])dnl
796
 
glib_save_prefix="$prefix"
797
 
glib_save_exec_prefix="$exec_prefix"
798
 
glib_save_datarootdir="$datarootdir"
799
 
test "x$prefix" = xNONE && prefix=$ac_default_prefix
800
 
test "x$exec_prefix" = xNONE && exec_prefix=$prefix
801
 
datarootdir=`eval echo "${datarootdir}"`
802
 
if test "x$CATOBJEXT" = "x.mo" ; then
803
 
  localedir=`eval echo "${libdir}/locale"`
804
 
else
805
 
  localedir=`eval echo "${datadir}/locale"`
806
 
fi
807
 
prefix="$glib_save_prefix"
808
 
exec_prefix="$glib_save_exec_prefix"
809
 
datarootdir="$glib_save_datarootdir"
810
 
AC_DEFINE_UNQUOTED($1, "$localedir",
811
 
  [Define the location where the catalogs will be installed])
812
 
])
813
 
 
814
 
dnl
815
 
dnl Now the definitions that aclocal will find
816
 
dnl
817
 
ifdef(glib_configure_ac,[],[
818
 
AC_DEFUN([AM_GLIB_GNU_GETTEXT],[GLIB_GNU_GETTEXT($@)])
819
 
AC_DEFUN([AM_GLIB_DEFINE_LOCALEDIR],[GLIB_DEFINE_LOCALEDIR($@)])
820
 
])dnl
821
 
 
822
 
# GLIB_RUN_PROG(PROGRAM, TEST-FILE, [ACTION-IF-PASS], [ACTION-IF-FAIL])
823
 
824
 
# Create a temporary file with TEST-FILE as its contents and pass the
825
 
# file name to PROGRAM.  Perform ACTION-IF-PASS if PROGRAM exits with
826
 
# 0 and perform ACTION-IF-FAIL for any other exit status.
827
 
AC_DEFUN([GLIB_RUN_PROG],
828
 
[cat >conftest.foo <<_ACEOF
829
 
$2
830
 
_ACEOF
831
 
if AC_RUN_LOG([$1 conftest.foo]); then
832
 
  m4_ifval([$3], [$3], [:])
833
 
m4_ifvaln([$4], [else $4])dnl
834
 
echo "$as_me: failed input was:" >&AS_MESSAGE_LOG_FD
835
 
sed 's/^/| /' conftest.foo >&AS_MESSAGE_LOG_FD
836
 
fi])
837
 
 
 
553
    case "$am_cv_func_iconv_works" in
 
554
      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
 
555
      *)   am_func_iconv=yes ;;
 
556
    esac
 
557
  else
 
558
    am_func_iconv=no am_cv_lib_iconv=no
 
559
  fi
 
560
  if test "$am_func_iconv" = yes; then
 
561
    AC_DEFINE([HAVE_ICONV], [1],
 
562
      [Define if you have the iconv() function and it works.])
 
563
  fi
 
564
  if test "$am_cv_lib_iconv" = yes; then
 
565
    AC_MSG_CHECKING([how to link with libiconv])
 
566
    AC_MSG_RESULT([$LIBICONV])
 
567
  else
 
568
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
 
569
    dnl either.
 
570
    CPPFLAGS="$am_save_CPPFLAGS"
 
571
    LIBICONV=
 
572
    LTLIBICONV=
 
573
  fi
 
574
  AC_SUBST([LIBICONV])
 
575
  AC_SUBST([LTLIBICONV])
 
576
])
 
577
 
 
578
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
 
579
dnl avoid warnings like
 
580
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
 
581
dnl This is tricky because of the way 'aclocal' is implemented:
 
582
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
 
583
dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
 
584
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
 
585
dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
 
586
dnl   warnings.
 
587
m4_define([gl_iconv_AC_DEFUN],
 
588
  m4_version_prereq([2.64],
 
589
    [[AC_DEFUN_ONCE(
 
590
        [$1], [$2])]],
 
591
    [[AC_DEFUN(
 
592
        [$1], [$2])]]))
 
593
gl_iconv_AC_DEFUN([AM_ICONV],
 
594
[
 
595
  AM_ICONV_LINK
 
596
  if test "$am_cv_func_iconv" = yes; then
 
597
    AC_MSG_CHECKING([for iconv declaration])
 
598
    AC_CACHE_VAL([am_cv_proto_iconv], [
 
599
      AC_TRY_COMPILE([
 
600
#include <stdlib.h>
 
601
#include <iconv.h>
 
602
extern
 
603
#ifdef __cplusplus
 
604
"C"
 
605
#endif
 
606
#if defined(__STDC__) || defined(__cplusplus)
 
607
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 
608
#else
 
609
size_t iconv();
 
610
#endif
 
611
], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
 
612
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
 
613
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
 
614
    AC_MSG_RESULT([
 
615
         $am_cv_proto_iconv])
 
616
    AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
 
617
      [Define as const if the declaration of iconv() needs const.])
 
618
  fi
 
619
])
 
620
 
 
621
# intlmacosx.m4 serial 3 (gettext-0.18)
 
622
dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
 
623
dnl This file is free software; the Free Software Foundation
 
624
dnl gives unlimited permission to copy and/or distribute it,
 
625
dnl with or without modifications, as long as this notice is preserved.
 
626
dnl
 
627
dnl This file can can be used in projects which are not available under
 
628
dnl the GNU General Public License or the GNU Library General Public
 
629
dnl License but which still want to provide support for the GNU gettext
 
630
dnl functionality.
 
631
dnl Please note that the actual code of the GNU gettext library is covered
 
632
dnl by the GNU Library General Public License, and the rest of the GNU
 
633
dnl gettext package package is covered by the GNU General Public License.
 
634
dnl They are *not* in the public domain.
 
635
 
 
636
dnl Checks for special options needed on MacOS X.
 
637
dnl Defines INTL_MACOSX_LIBS.
 
638
AC_DEFUN([gt_INTL_MACOSX],
 
639
[
 
640
  dnl Check for API introduced in MacOS X 10.2.
 
641
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
 
642
    [gt_cv_func_CFPreferencesCopyAppValue],
 
643
    [gt_save_LIBS="$LIBS"
 
644
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
645
     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
 
646
       [CFPreferencesCopyAppValue(NULL, NULL)],
 
647
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
 
648
       [gt_cv_func_CFPreferencesCopyAppValue=no])
 
649
     LIBS="$gt_save_LIBS"])
 
650
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
651
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
 
652
      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
 
653
  fi
 
654
  dnl Check for API introduced in MacOS X 10.3.
 
655
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
 
656
    [gt_save_LIBS="$LIBS"
 
657
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
658
     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
 
659
       [gt_cv_func_CFLocaleCopyCurrent=yes],
 
660
       [gt_cv_func_CFLocaleCopyCurrent=no])
 
661
     LIBS="$gt_save_LIBS"])
 
662
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
663
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
 
664
      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
 
665
  fi
 
666
  INTL_MACOSX_LIBS=
 
667
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
668
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
 
669
  fi
 
670
  AC_SUBST([INTL_MACOSX_LIBS])
 
671
])
838
672
 
839
673
 
840
674
dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
1030
864
# AC_DEFUN([AC_PROG_INTLTOOL], ...)
1031
865
 
1032
866
 
 
867
# lib-ld.m4 serial 4 (gettext-0.18)
 
868
dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
 
869
dnl This file is free software; the Free Software Foundation
 
870
dnl gives unlimited permission to copy and/or distribute it,
 
871
dnl with or without modifications, as long as this notice is preserved.
 
872
 
 
873
dnl Subroutines of libtool.m4,
 
874
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
 
875
dnl with libtool.m4.
 
876
 
 
877
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
878
AC_DEFUN([AC_LIB_PROG_LD_GNU],
 
879
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
 
880
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
881
case `$LD -v 2>&1 </dev/null` in
 
882
*GNU* | *'with BFD'*)
 
883
  acl_cv_prog_gnu_ld=yes ;;
 
884
*)
 
885
  acl_cv_prog_gnu_ld=no ;;
 
886
esac])
 
887
with_gnu_ld=$acl_cv_prog_gnu_ld
 
888
])
 
889
 
 
890
dnl From libtool-1.4. Sets the variable LD.
 
891
AC_DEFUN([AC_LIB_PROG_LD],
 
892
[AC_ARG_WITH([gnu-ld],
 
893
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
894
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
895
AC_REQUIRE([AC_PROG_CC])dnl
 
896
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
897
# Prepare PATH_SEPARATOR.
 
898
# The user is always right.
 
899
if test "${PATH_SEPARATOR+set}" != set; then
 
900
  echo "#! /bin/sh" >conf$$.sh
 
901
  echo  "exit 0"   >>conf$$.sh
 
902
  chmod +x conf$$.sh
 
903
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
904
    PATH_SEPARATOR=';'
 
905
  else
 
906
    PATH_SEPARATOR=:
 
907
  fi
 
908
  rm -f conf$$.sh
 
909
fi
 
910
ac_prog=ld
 
911
if test "$GCC" = yes; then
 
912
  # Check if gcc -print-prog-name=ld gives a path.
 
913
  AC_MSG_CHECKING([for ld used by GCC])
 
914
  case $host in
 
915
  *-*-mingw*)
 
916
    # gcc leaves a trailing carriage return which upsets mingw
 
917
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
918
  *)
 
919
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
920
  esac
 
921
  case $ac_prog in
 
922
    # Accept absolute paths.
 
923
    [[\\/]* | [A-Za-z]:[\\/]*)]
 
924
      [re_direlt='/[^/][^/]*/\.\./']
 
925
      # Canonicalize the path of ld
 
926
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
927
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
928
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
929
      done
 
930
      test -z "$LD" && LD="$ac_prog"
 
931
      ;;
 
932
  "")
 
933
    # If it fails, then pretend we aren't using GCC.
 
934
    ac_prog=ld
 
935
    ;;
 
936
  *)
 
937
    # If it is relative, then search for the first ld in PATH.
 
938
    with_gnu_ld=unknown
 
939
    ;;
 
940
  esac
 
941
elif test "$with_gnu_ld" = yes; then
 
942
  AC_MSG_CHECKING([for GNU ld])
 
943
else
 
944
  AC_MSG_CHECKING([for non-GNU ld])
 
945
fi
 
946
AC_CACHE_VAL([acl_cv_path_LD],
 
947
[if test -z "$LD"; then
 
948
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
949
  for ac_dir in $PATH; do
 
950
    test -z "$ac_dir" && ac_dir=.
 
951
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
952
      acl_cv_path_LD="$ac_dir/$ac_prog"
 
953
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
954
      # but apparently some GNU ld's only accept -v.
 
955
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
956
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
 
957
      *GNU* | *'with BFD'*)
 
958
        test "$with_gnu_ld" != no && break ;;
 
959
      *)
 
960
        test "$with_gnu_ld" != yes && break ;;
 
961
      esac
 
962
    fi
 
963
  done
 
964
  IFS="$ac_save_ifs"
 
965
else
 
966
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
 
967
fi])
 
968
LD="$acl_cv_path_LD"
 
969
if test -n "$LD"; then
 
970
  AC_MSG_RESULT([$LD])
 
971
else
 
972
  AC_MSG_RESULT([no])
 
973
fi
 
974
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
975
AC_LIB_PROG_LD_GNU
 
976
])
 
977
 
 
978
# lib-link.m4 serial 21 (gettext-0.18)
 
979
dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
 
980
dnl This file is free software; the Free Software Foundation
 
981
dnl gives unlimited permission to copy and/or distribute it,
 
982
dnl with or without modifications, as long as this notice is preserved.
 
983
 
 
984
dnl From Bruno Haible.
 
985
 
 
986
AC_PREREQ([2.54])
 
987
 
 
988
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 
989
dnl the libraries corresponding to explicit and implicit dependencies.
 
990
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 
991
dnl augments the CPPFLAGS variable.
 
992
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
993
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
994
AC_DEFUN([AC_LIB_LINKFLAGS],
 
995
[
 
996
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
997
  AC_REQUIRE([AC_LIB_RPATH])
 
998
  pushdef([Name],[translit([$1],[./-], [___])])
 
999
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
1000
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1001
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
 
1002
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
1003
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
 
1004
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
 
1005
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
1006
    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
 
1007
  ])
 
1008
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
 
1009
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
 
1010
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
1011
  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
 
1012
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
1013
  AC_SUBST([LIB]NAME)
 
1014
  AC_SUBST([LTLIB]NAME)
 
1015
  AC_SUBST([LIB]NAME[_PREFIX])
 
1016
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
 
1017
  dnl results of this search when this library appears as a dependency.
 
1018
  HAVE_LIB[]NAME=yes
 
1019
  popdef([NAME])
 
1020
  popdef([Name])
 
1021
])
 
1022
 
 
1023
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
 
1024
dnl searches for libname and the libraries corresponding to explicit and
 
1025
dnl implicit dependencies, together with the specified include files and
 
1026
dnl the ability to compile and link the specified testcode. The missing-message
 
1027
dnl defaults to 'no' and may contain additional hints for the user.
 
1028
dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
 
1029
dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
1030
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 
1031
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
1032
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
 
1033
dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
1034
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
1035
[
 
1036
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1037
  AC_REQUIRE([AC_LIB_RPATH])
 
1038
  pushdef([Name],[translit([$1],[./-], [___])])
 
1039
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
1040
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1041
 
 
1042
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
 
1043
  dnl accordingly.
 
1044
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
1045
 
 
1046
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
 
1047
  dnl because if the user has installed lib[]Name and not disabled its use
 
1048
  dnl via --without-lib[]Name-prefix, he wants to use it.
 
1049
  ac_save_CPPFLAGS="$CPPFLAGS"
 
1050
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
1051
 
 
1052
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
 
1053
    ac_save_LIBS="$LIBS"
 
1054
    dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
 
1055
    dnl because these -l options might require -L options that are present in
 
1056
    dnl LIBS. -l options benefit only from the -L options listed before it.
 
1057
    dnl Otherwise, add it to the front of LIBS, because it may be a static
 
1058
    dnl library that depends on another static library that is present in LIBS.
 
1059
    dnl Static libraries benefit only from the static libraries listed after
 
1060
    dnl it.
 
1061
    case " $LIB[]NAME" in
 
1062
      *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
 
1063
      *)       LIBS="$LIB[]NAME $LIBS" ;;
 
1064
    esac
 
1065
    AC_TRY_LINK([$3], [$4],
 
1066
      [ac_cv_lib[]Name=yes],
 
1067
      [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
 
1068
    LIBS="$ac_save_LIBS"
 
1069
  ])
 
1070
  if test "$ac_cv_lib[]Name" = yes; then
 
1071
    HAVE_LIB[]NAME=yes
 
1072
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
 
1073
    AC_MSG_CHECKING([how to link with lib[]$1])
 
1074
    AC_MSG_RESULT([$LIB[]NAME])
 
1075
  else
 
1076
    HAVE_LIB[]NAME=no
 
1077
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
 
1078
    dnl $INC[]NAME either.
 
1079
    CPPFLAGS="$ac_save_CPPFLAGS"
 
1080
    LIB[]NAME=
 
1081
    LTLIB[]NAME=
 
1082
    LIB[]NAME[]_PREFIX=
 
1083
  fi
 
1084
  AC_SUBST([HAVE_LIB]NAME)
 
1085
  AC_SUBST([LIB]NAME)
 
1086
  AC_SUBST([LTLIB]NAME)
 
1087
  AC_SUBST([LIB]NAME[_PREFIX])
 
1088
  popdef([NAME])
 
1089
  popdef([Name])
 
1090
])
 
1091
 
 
1092
dnl Determine the platform dependent parameters needed to use rpath:
 
1093
dnl   acl_libext,
 
1094
dnl   acl_shlibext,
 
1095
dnl   acl_hardcode_libdir_flag_spec,
 
1096
dnl   acl_hardcode_libdir_separator,
 
1097
dnl   acl_hardcode_direct,
 
1098
dnl   acl_hardcode_minus_L.
 
1099
AC_DEFUN([AC_LIB_RPATH],
 
1100
[
 
1101
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
 
1102
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
 
1103
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
 
1104
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
 
1105
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
 
1106
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
 
1107
  AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
 
1108
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
 
1109
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
 
1110
    . ./conftest.sh
 
1111
    rm -f ./conftest.sh
 
1112
    acl_cv_rpath=done
 
1113
  ])
 
1114
  wl="$acl_cv_wl"
 
1115
  acl_libext="$acl_cv_libext"
 
1116
  acl_shlibext="$acl_cv_shlibext"
 
1117
  acl_libname_spec="$acl_cv_libname_spec"
 
1118
  acl_library_names_spec="$acl_cv_library_names_spec"
 
1119
  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
1120
  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
1121
  acl_hardcode_direct="$acl_cv_hardcode_direct"
 
1122
  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
1123
  dnl Determine whether the user wants rpath handling at all.
 
1124
  AC_ARG_ENABLE([rpath],
 
1125
    [  --disable-rpath         do not hardcode runtime library paths],
 
1126
    :, enable_rpath=yes)
 
1127
])
 
1128
 
 
1129
dnl AC_LIB_FROMPACKAGE(name, package)
 
1130
dnl declares that libname comes from the given package. The configure file
 
1131
dnl will then not have a --with-libname-prefix option but a
 
1132
dnl --with-package-prefix option. Several libraries can come from the same
 
1133
dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
 
1134
dnl macro call that searches for libname.
 
1135
AC_DEFUN([AC_LIB_FROMPACKAGE],
 
1136
[
 
1137
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
1138
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1139
  define([acl_frompackage_]NAME, [$2])
 
1140
  popdef([NAME])
 
1141
  pushdef([PACK],[$2])
 
1142
  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
 
1143
                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1144
  define([acl_libsinpackage_]PACKUP,
 
1145
    m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
 
1146
  popdef([PACKUP])
 
1147
  popdef([PACK])
 
1148
])
 
1149
 
 
1150
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 
1151
dnl the libraries corresponding to explicit and implicit dependencies.
 
1152
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
1153
dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
 
1154
dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
 
1155
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 
1156
[
 
1157
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
1158
  pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
1159
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1160
  pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
 
1161
  pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
 
1162
                                  [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1163
  pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
 
1164
  dnl Autoconf >= 2.61 supports dots in --with options.
 
1165
  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
 
1166
  dnl By default, look in $includedir and $libdir.
 
1167
  use_additional=yes
 
1168
  AC_LIB_WITH_FINAL_PREFIX([
 
1169
    eval additional_includedir=\"$includedir\"
 
1170
    eval additional_libdir=\"$libdir\"
 
1171
  ])
 
1172
  AC_ARG_WITH(P_A_C_K[-prefix],
 
1173
[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
 
1174
  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
 
1175
[
 
1176
    if test "X$withval" = "Xno"; then
 
1177
      use_additional=no
 
1178
    else
 
1179
      if test "X$withval" = "X"; then
 
1180
        AC_LIB_WITH_FINAL_PREFIX([
 
1181
          eval additional_includedir=\"$includedir\"
 
1182
          eval additional_libdir=\"$libdir\"
 
1183
        ])
 
1184
      else
 
1185
        additional_includedir="$withval/include"
 
1186
        additional_libdir="$withval/$acl_libdirstem"
 
1187
        if test "$acl_libdirstem2" != "$acl_libdirstem" \
 
1188
           && ! test -d "$withval/$acl_libdirstem"; then
 
1189
          additional_libdir="$withval/$acl_libdirstem2"
 
1190
        fi
 
1191
      fi
 
1192
    fi
 
1193
])
 
1194
  dnl Search the library and its dependencies in $additional_libdir and
 
1195
  dnl $LDFLAGS. Using breadth-first-seach.
 
1196
  LIB[]NAME=
 
1197
  LTLIB[]NAME=
 
1198
  INC[]NAME=
 
1199
  LIB[]NAME[]_PREFIX=
 
1200
  dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
 
1201
  dnl computed. So it has to be reset here.
 
1202
  HAVE_LIB[]NAME=
 
1203
  rpathdirs=
 
1204
  ltrpathdirs=
 
1205
  names_already_handled=
 
1206
  names_next_round='$1 $2'
 
1207
  while test -n "$names_next_round"; do
 
1208
    names_this_round="$names_next_round"
 
1209
    names_next_round=
 
1210
    for name in $names_this_round; do
 
1211
      already_handled=
 
1212
      for n in $names_already_handled; do
 
1213
        if test "$n" = "$name"; then
 
1214
          already_handled=yes
 
1215
          break
 
1216
        fi
 
1217
      done
 
1218
      if test -z "$already_handled"; then
 
1219
        names_already_handled="$names_already_handled $name"
 
1220
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
 
1221
        dnl or AC_LIB_HAVE_LINKFLAGS call.
 
1222
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
1223
        eval value=\"\$HAVE_LIB$uppername\"
 
1224
        if test -n "$value"; then
 
1225
          if test "$value" = yes; then
 
1226
            eval value=\"\$LIB$uppername\"
 
1227
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
 
1228
            eval value=\"\$LTLIB$uppername\"
 
1229
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
 
1230
          else
 
1231
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
 
1232
            dnl that this library doesn't exist. So just drop it.
 
1233
            :
 
1234
          fi
 
1235
        else
 
1236
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
 
1237
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
 
1238
          found_dir=
 
1239
          found_la=
 
1240
          found_so=
 
1241
          found_a=
 
1242
          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
 
1243
          if test -n "$acl_shlibext"; then
 
1244
            shrext=".$acl_shlibext"             # typically: shrext=.so
 
1245
          else
 
1246
            shrext=
 
1247
          fi
 
1248
          if test $use_additional = yes; then
 
1249
            dir="$additional_libdir"
 
1250
            dnl The same code as in the loop below:
 
1251
            dnl First look for a shared library.
 
1252
            if test -n "$acl_shlibext"; then
 
1253
              if test -f "$dir/$libname$shrext"; then
 
1254
                found_dir="$dir"
 
1255
                found_so="$dir/$libname$shrext"
 
1256
              else
 
1257
                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
1258
                  ver=`(cd "$dir" && \
 
1259
                        for f in "$libname$shrext".*; do echo "$f"; done \
 
1260
                        | sed -e "s,^$libname$shrext\\\\.,," \
 
1261
                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
1262
                        | sed 1q ) 2>/dev/null`
 
1263
                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
1264
                    found_dir="$dir"
 
1265
                    found_so="$dir/$libname$shrext.$ver"
 
1266
                  fi
 
1267
                else
 
1268
                  eval library_names=\"$acl_library_names_spec\"
 
1269
                  for f in $library_names; do
 
1270
                    if test -f "$dir/$f"; then
 
1271
                      found_dir="$dir"
 
1272
                      found_so="$dir/$f"
 
1273
                      break
 
1274
                    fi
 
1275
                  done
 
1276
                fi
 
1277
              fi
 
1278
            fi
 
1279
            dnl Then look for a static library.
 
1280
            if test "X$found_dir" = "X"; then
 
1281
              if test -f "$dir/$libname.$acl_libext"; then
 
1282
                found_dir="$dir"
 
1283
                found_a="$dir/$libname.$acl_libext"
 
1284
              fi
 
1285
            fi
 
1286
            if test "X$found_dir" != "X"; then
 
1287
              if test -f "$dir/$libname.la"; then
 
1288
                found_la="$dir/$libname.la"
 
1289
              fi
 
1290
            fi
 
1291
          fi
 
1292
          if test "X$found_dir" = "X"; then
 
1293
            for x in $LDFLAGS $LTLIB[]NAME; do
 
1294
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1295
              case "$x" in
 
1296
                -L*)
 
1297
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
 
1298
                  dnl First look for a shared library.
 
1299
                  if test -n "$acl_shlibext"; then
 
1300
                    if test -f "$dir/$libname$shrext"; then
 
1301
                      found_dir="$dir"
 
1302
                      found_so="$dir/$libname$shrext"
 
1303
                    else
 
1304
                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
 
1305
                        ver=`(cd "$dir" && \
 
1306
                              for f in "$libname$shrext".*; do echo "$f"; done \
 
1307
                              | sed -e "s,^$libname$shrext\\\\.,," \
 
1308
                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
 
1309
                              | sed 1q ) 2>/dev/null`
 
1310
                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
 
1311
                          found_dir="$dir"
 
1312
                          found_so="$dir/$libname$shrext.$ver"
 
1313
                        fi
 
1314
                      else
 
1315
                        eval library_names=\"$acl_library_names_spec\"
 
1316
                        for f in $library_names; do
 
1317
                          if test -f "$dir/$f"; then
 
1318
                            found_dir="$dir"
 
1319
                            found_so="$dir/$f"
 
1320
                            break
 
1321
                          fi
 
1322
                        done
 
1323
                      fi
 
1324
                    fi
 
1325
                  fi
 
1326
                  dnl Then look for a static library.
 
1327
                  if test "X$found_dir" = "X"; then
 
1328
                    if test -f "$dir/$libname.$acl_libext"; then
 
1329
                      found_dir="$dir"
 
1330
                      found_a="$dir/$libname.$acl_libext"
 
1331
                    fi
 
1332
                  fi
 
1333
                  if test "X$found_dir" != "X"; then
 
1334
                    if test -f "$dir/$libname.la"; then
 
1335
                      found_la="$dir/$libname.la"
 
1336
                    fi
 
1337
                  fi
 
1338
                  ;;
 
1339
              esac
 
1340
              if test "X$found_dir" != "X"; then
 
1341
                break
 
1342
              fi
 
1343
            done
 
1344
          fi
 
1345
          if test "X$found_dir" != "X"; then
 
1346
            dnl Found the library.
 
1347
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
 
1348
            if test "X$found_so" != "X"; then
 
1349
              dnl Linking with a shared library. We attempt to hardcode its
 
1350
              dnl directory into the executable's runpath, unless it's the
 
1351
              dnl standard /usr/lib.
 
1352
              if test "$enable_rpath" = no \
 
1353
                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
 
1354
                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
 
1355
                dnl No hardcoding is needed.
 
1356
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1357
              else
 
1358
                dnl Use an explicit option to hardcode DIR into the resulting
 
1359
                dnl binary.
 
1360
                dnl Potentially add DIR to ltrpathdirs.
 
1361
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
1362
                haveit=
 
1363
                for x in $ltrpathdirs; do
 
1364
                  if test "X$x" = "X$found_dir"; then
 
1365
                    haveit=yes
 
1366
                    break
 
1367
                  fi
 
1368
                done
 
1369
                if test -z "$haveit"; then
 
1370
                  ltrpathdirs="$ltrpathdirs $found_dir"
 
1371
                fi
 
1372
                dnl The hardcoding into $LIBNAME is system dependent.
 
1373
                if test "$acl_hardcode_direct" = yes; then
 
1374
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
 
1375
                  dnl resulting binary.
 
1376
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1377
                else
 
1378
                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
1379
                    dnl Use an explicit option to hardcode DIR into the resulting
 
1380
                    dnl binary.
 
1381
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1382
                    dnl Potentially add DIR to rpathdirs.
 
1383
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
 
1384
                    haveit=
 
1385
                    for x in $rpathdirs; do
 
1386
                      if test "X$x" = "X$found_dir"; then
 
1387
                        haveit=yes
 
1388
                        break
 
1389
                      fi
 
1390
                    done
 
1391
                    if test -z "$haveit"; then
 
1392
                      rpathdirs="$rpathdirs $found_dir"
 
1393
                    fi
 
1394
                  else
 
1395
                    dnl Rely on "-L$found_dir".
 
1396
                    dnl But don't add it if it's already contained in the LDFLAGS
 
1397
                    dnl or the already constructed $LIBNAME
 
1398
                    haveit=
 
1399
                    for x in $LDFLAGS $LIB[]NAME; do
 
1400
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1401
                      if test "X$x" = "X-L$found_dir"; then
 
1402
                        haveit=yes
 
1403
                        break
 
1404
                      fi
 
1405
                    done
 
1406
                    if test -z "$haveit"; then
 
1407
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
 
1408
                    fi
 
1409
                    if test "$acl_hardcode_minus_L" != no; then
 
1410
                      dnl FIXME: Not sure whether we should use
 
1411
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
1412
                      dnl here.
 
1413
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
1414
                    else
 
1415
                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
 
1416
                      dnl here, because this doesn't fit in flags passed to the
 
1417
                      dnl compiler. So give up. No hardcoding. This affects only
 
1418
                      dnl very old systems.
 
1419
                      dnl FIXME: Not sure whether we should use
 
1420
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
1421
                      dnl here.
 
1422
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
1423
                    fi
 
1424
                  fi
 
1425
                fi
 
1426
              fi
 
1427
            else
 
1428
              if test "X$found_a" != "X"; then
 
1429
                dnl Linking with a static library.
 
1430
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
 
1431
              else
 
1432
                dnl We shouldn't come here, but anyway it's good to have a
 
1433
                dnl fallback.
 
1434
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
 
1435
              fi
 
1436
            fi
 
1437
            dnl Assume the include files are nearby.
 
1438
            additional_includedir=
 
1439
            case "$found_dir" in
 
1440
              */$acl_libdirstem | */$acl_libdirstem/)
 
1441
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
 
1442
                if test "$name" = '$1'; then
 
1443
                  LIB[]NAME[]_PREFIX="$basedir"
 
1444
                fi
 
1445
                additional_includedir="$basedir/include"
 
1446
                ;;
 
1447
              */$acl_libdirstem2 | */$acl_libdirstem2/)
 
1448
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
 
1449
                if test "$name" = '$1'; then
 
1450
                  LIB[]NAME[]_PREFIX="$basedir"
 
1451
                fi
 
1452
                additional_includedir="$basedir/include"
 
1453
                ;;
 
1454
            esac
 
1455
            if test "X$additional_includedir" != "X"; then
 
1456
              dnl Potentially add $additional_includedir to $INCNAME.
 
1457
              dnl But don't add it
 
1458
              dnl   1. if it's the standard /usr/include,
 
1459
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
 
1460
              dnl   3. if it's already present in $CPPFLAGS or the already
 
1461
              dnl      constructed $INCNAME,
 
1462
              dnl   4. if it doesn't exist as a directory.
 
1463
              if test "X$additional_includedir" != "X/usr/include"; then
 
1464
                haveit=
 
1465
                if test "X$additional_includedir" = "X/usr/local/include"; then
 
1466
                  if test -n "$GCC"; then
 
1467
                    case $host_os in
 
1468
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
1469
                    esac
 
1470
                  fi
 
1471
                fi
 
1472
                if test -z "$haveit"; then
 
1473
                  for x in $CPPFLAGS $INC[]NAME; do
 
1474
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1475
                    if test "X$x" = "X-I$additional_includedir"; then
 
1476
                      haveit=yes
 
1477
                      break
 
1478
                    fi
 
1479
                  done
 
1480
                  if test -z "$haveit"; then
 
1481
                    if test -d "$additional_includedir"; then
 
1482
                      dnl Really add $additional_includedir to $INCNAME.
 
1483
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
 
1484
                    fi
 
1485
                  fi
 
1486
                fi
 
1487
              fi
 
1488
            fi
 
1489
            dnl Look for dependencies.
 
1490
            if test -n "$found_la"; then
 
1491
              dnl Read the .la file. It defines the variables
 
1492
              dnl dlname, library_names, old_library, dependency_libs, current,
 
1493
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
 
1494
              save_libdir="$libdir"
 
1495
              case "$found_la" in
 
1496
                */* | *\\*) . "$found_la" ;;
 
1497
                *) . "./$found_la" ;;
 
1498
              esac
 
1499
              libdir="$save_libdir"
 
1500
              dnl We use only dependency_libs.
 
1501
              for dep in $dependency_libs; do
 
1502
                case "$dep" in
 
1503
                  -L*)
 
1504
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
 
1505
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
 
1506
                    dnl But don't add it
 
1507
                    dnl   1. if it's the standard /usr/lib,
 
1508
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
 
1509
                    dnl   3. if it's already present in $LDFLAGS or the already
 
1510
                    dnl      constructed $LIBNAME,
 
1511
                    dnl   4. if it doesn't exist as a directory.
 
1512
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
 
1513
                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
 
1514
                      haveit=
 
1515
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
 
1516
                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
 
1517
                        if test -n "$GCC"; then
 
1518
                          case $host_os in
 
1519
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
1520
                          esac
 
1521
                        fi
 
1522
                      fi
 
1523
                      if test -z "$haveit"; then
 
1524
                        haveit=
 
1525
                        for x in $LDFLAGS $LIB[]NAME; do
 
1526
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1527
                          if test "X$x" = "X-L$additional_libdir"; then
 
1528
                            haveit=yes
 
1529
                            break
 
1530
                          fi
 
1531
                        done
 
1532
                        if test -z "$haveit"; then
 
1533
                          if test -d "$additional_libdir"; then
 
1534
                            dnl Really add $additional_libdir to $LIBNAME.
 
1535
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
 
1536
                          fi
 
1537
                        fi
 
1538
                        haveit=
 
1539
                        for x in $LDFLAGS $LTLIB[]NAME; do
 
1540
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1541
                          if test "X$x" = "X-L$additional_libdir"; then
 
1542
                            haveit=yes
 
1543
                            break
 
1544
                          fi
 
1545
                        done
 
1546
                        if test -z "$haveit"; then
 
1547
                          if test -d "$additional_libdir"; then
 
1548
                            dnl Really add $additional_libdir to $LTLIBNAME.
 
1549
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
 
1550
                          fi
 
1551
                        fi
 
1552
                      fi
 
1553
                    fi
 
1554
                    ;;
 
1555
                  -R*)
 
1556
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
 
1557
                    if test "$enable_rpath" != no; then
 
1558
                      dnl Potentially add DIR to rpathdirs.
 
1559
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
 
1560
                      haveit=
 
1561
                      for x in $rpathdirs; do
 
1562
                        if test "X$x" = "X$dir"; then
 
1563
                          haveit=yes
 
1564
                          break
 
1565
                        fi
 
1566
                      done
 
1567
                      if test -z "$haveit"; then
 
1568
                        rpathdirs="$rpathdirs $dir"
 
1569
                      fi
 
1570
                      dnl Potentially add DIR to ltrpathdirs.
 
1571
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
1572
                      haveit=
 
1573
                      for x in $ltrpathdirs; do
 
1574
                        if test "X$x" = "X$dir"; then
 
1575
                          haveit=yes
 
1576
                          break
 
1577
                        fi
 
1578
                      done
 
1579
                      if test -z "$haveit"; then
 
1580
                        ltrpathdirs="$ltrpathdirs $dir"
 
1581
                      fi
 
1582
                    fi
 
1583
                    ;;
 
1584
                  -l*)
 
1585
                    dnl Handle this in the next round.
 
1586
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
 
1587
                    ;;
 
1588
                  *.la)
 
1589
                    dnl Handle this in the next round. Throw away the .la's
 
1590
                    dnl directory; it is already contained in a preceding -L
 
1591
                    dnl option.
 
1592
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
 
1593
                    ;;
 
1594
                  *)
 
1595
                    dnl Most likely an immediate library name.
 
1596
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
 
1597
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
 
1598
                    ;;
 
1599
                esac
 
1600
              done
 
1601
            fi
 
1602
          else
 
1603
            dnl Didn't find the library; assume it is in the system directories
 
1604
            dnl known to the linker and runtime loader. (All the system
 
1605
            dnl directories known to the linker should also be known to the
 
1606
            dnl runtime loader, otherwise the system is severely misconfigured.)
 
1607
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
1608
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
 
1609
          fi
 
1610
        fi
 
1611
      fi
 
1612
    done
 
1613
  done
 
1614
  if test "X$rpathdirs" != "X"; then
 
1615
    if test -n "$acl_hardcode_libdir_separator"; then
 
1616
      dnl Weird platform: only the last -rpath option counts, the user must
 
1617
      dnl pass all path elements in one option. We can arrange that for a
 
1618
      dnl single library, but not when more than one $LIBNAMEs are used.
 
1619
      alldirs=
 
1620
      for found_dir in $rpathdirs; do
 
1621
        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
 
1622
      done
 
1623
      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
 
1624
      acl_save_libdir="$libdir"
 
1625
      libdir="$alldirs"
 
1626
      eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1627
      libdir="$acl_save_libdir"
 
1628
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
1629
    else
 
1630
      dnl The -rpath options are cumulative.
 
1631
      for found_dir in $rpathdirs; do
 
1632
        acl_save_libdir="$libdir"
 
1633
        libdir="$found_dir"
 
1634
        eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1635
        libdir="$acl_save_libdir"
 
1636
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
1637
      done
 
1638
    fi
 
1639
  fi
 
1640
  if test "X$ltrpathdirs" != "X"; then
 
1641
    dnl When using libtool, the option that works for both libraries and
 
1642
    dnl executables is -R. The -R options are cumulative.
 
1643
    for found_dir in $ltrpathdirs; do
 
1644
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
 
1645
    done
 
1646
  fi
 
1647
  popdef([P_A_C_K])
 
1648
  popdef([PACKLIBS])
 
1649
  popdef([PACKUP])
 
1650
  popdef([PACK])
 
1651
  popdef([NAME])
 
1652
])
 
1653
 
 
1654
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
 
1655
dnl unless already present in VAR.
 
1656
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
 
1657
dnl contains two or three consecutive elements that belong together.
 
1658
AC_DEFUN([AC_LIB_APPENDTOVAR],
 
1659
[
 
1660
  for element in [$2]; do
 
1661
    haveit=
 
1662
    for x in $[$1]; do
 
1663
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1664
      if test "X$x" = "X$element"; then
 
1665
        haveit=yes
 
1666
        break
 
1667
      fi
 
1668
    done
 
1669
    if test -z "$haveit"; then
 
1670
      [$1]="${[$1]}${[$1]:+ }$element"
 
1671
    fi
 
1672
  done
 
1673
])
 
1674
 
 
1675
dnl For those cases where a variable contains several -L and -l options
 
1676
dnl referring to unknown libraries and directories, this macro determines the
 
1677
dnl necessary additional linker options for the runtime path.
 
1678
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
 
1679
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
 
1680
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
 
1681
dnl otherwise linking without libtool is assumed.
 
1682
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
 
1683
[
 
1684
  AC_REQUIRE([AC_LIB_RPATH])
 
1685
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
1686
  $1=
 
1687
  if test "$enable_rpath" != no; then
 
1688
    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
 
1689
      dnl Use an explicit option to hardcode directories into the resulting
 
1690
      dnl binary.
 
1691
      rpathdirs=
 
1692
      next=
 
1693
      for opt in $2; do
 
1694
        if test -n "$next"; then
 
1695
          dir="$next"
 
1696
          dnl No need to hardcode the standard /usr/lib.
 
1697
          if test "X$dir" != "X/usr/$acl_libdirstem" \
 
1698
             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
 
1699
            rpathdirs="$rpathdirs $dir"
 
1700
          fi
 
1701
          next=
 
1702
        else
 
1703
          case $opt in
 
1704
            -L) next=yes ;;
 
1705
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
 
1706
                 dnl No need to hardcode the standard /usr/lib.
 
1707
                 if test "X$dir" != "X/usr/$acl_libdirstem" \
 
1708
                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
 
1709
                   rpathdirs="$rpathdirs $dir"
 
1710
                 fi
 
1711
                 next= ;;
 
1712
            *) next= ;;
 
1713
          esac
 
1714
        fi
 
1715
      done
 
1716
      if test "X$rpathdirs" != "X"; then
 
1717
        if test -n ""$3""; then
 
1718
          dnl libtool is used for linking. Use -R options.
 
1719
          for dir in $rpathdirs; do
 
1720
            $1="${$1}${$1:+ }-R$dir"
 
1721
          done
 
1722
        else
 
1723
          dnl The linker is used for linking directly.
 
1724
          if test -n "$acl_hardcode_libdir_separator"; then
 
1725
            dnl Weird platform: only the last -rpath option counts, the user
 
1726
            dnl must pass all path elements in one option.
 
1727
            alldirs=
 
1728
            for dir in $rpathdirs; do
 
1729
              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
 
1730
            done
 
1731
            acl_save_libdir="$libdir"
 
1732
            libdir="$alldirs"
 
1733
            eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1734
            libdir="$acl_save_libdir"
 
1735
            $1="$flag"
 
1736
          else
 
1737
            dnl The -rpath options are cumulative.
 
1738
            for dir in $rpathdirs; do
 
1739
              acl_save_libdir="$libdir"
 
1740
              libdir="$dir"
 
1741
              eval flag=\"$acl_hardcode_libdir_flag_spec\"
 
1742
              libdir="$acl_save_libdir"
 
1743
              $1="${$1}${$1:+ }$flag"
 
1744
            done
 
1745
          fi
 
1746
        fi
 
1747
      fi
 
1748
    fi
 
1749
  fi
 
1750
  AC_SUBST([$1])
 
1751
])
 
1752
 
 
1753
# lib-prefix.m4 serial 7 (gettext-0.18)
 
1754
dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
 
1755
dnl This file is free software; the Free Software Foundation
 
1756
dnl gives unlimited permission to copy and/or distribute it,
 
1757
dnl with or without modifications, as long as this notice is preserved.
 
1758
 
 
1759
dnl From Bruno Haible.
 
1760
 
 
1761
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
 
1762
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
 
1763
dnl require excessive bracketing.
 
1764
ifdef([AC_HELP_STRING],
 
1765
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
 
1766
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
 
1767
 
 
1768
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 
1769
dnl to access previously installed libraries. The basic assumption is that
 
1770
dnl a user will want packages to use other packages he previously installed
 
1771
dnl with the same --prefix option.
 
1772
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
 
1773
dnl libraries, but is otherwise very convenient.
 
1774
AC_DEFUN([AC_LIB_PREFIX],
 
1775
[
 
1776
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
 
1777
  AC_REQUIRE([AC_PROG_CC])
 
1778
  AC_REQUIRE([AC_CANONICAL_HOST])
 
1779
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
1780
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1781
  dnl By default, look in $includedir and $libdir.
 
1782
  use_additional=yes
 
1783
  AC_LIB_WITH_FINAL_PREFIX([
 
1784
    eval additional_includedir=\"$includedir\"
 
1785
    eval additional_libdir=\"$libdir\"
 
1786
  ])
 
1787
  AC_LIB_ARG_WITH([lib-prefix],
 
1788
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
 
1789
  --without-lib-prefix    don't search for libraries in includedir and libdir],
 
1790
[
 
1791
    if test "X$withval" = "Xno"; then
 
1792
      use_additional=no
 
1793
    else
 
1794
      if test "X$withval" = "X"; then
 
1795
        AC_LIB_WITH_FINAL_PREFIX([
 
1796
          eval additional_includedir=\"$includedir\"
 
1797
          eval additional_libdir=\"$libdir\"
 
1798
        ])
 
1799
      else
 
1800
        additional_includedir="$withval/include"
 
1801
        additional_libdir="$withval/$acl_libdirstem"
 
1802
      fi
 
1803
    fi
 
1804
])
 
1805
  if test $use_additional = yes; then
 
1806
    dnl Potentially add $additional_includedir to $CPPFLAGS.
 
1807
    dnl But don't add it
 
1808
    dnl   1. if it's the standard /usr/include,
 
1809
    dnl   2. if it's already present in $CPPFLAGS,
 
1810
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
 
1811
    dnl   4. if it doesn't exist as a directory.
 
1812
    if test "X$additional_includedir" != "X/usr/include"; then
 
1813
      haveit=
 
1814
      for x in $CPPFLAGS; do
 
1815
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1816
        if test "X$x" = "X-I$additional_includedir"; then
 
1817
          haveit=yes
 
1818
          break
 
1819
        fi
 
1820
      done
 
1821
      if test -z "$haveit"; then
 
1822
        if test "X$additional_includedir" = "X/usr/local/include"; then
 
1823
          if test -n "$GCC"; then
 
1824
            case $host_os in
 
1825
              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
1826
            esac
 
1827
          fi
 
1828
        fi
 
1829
        if test -z "$haveit"; then
 
1830
          if test -d "$additional_includedir"; then
 
1831
            dnl Really add $additional_includedir to $CPPFLAGS.
 
1832
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
 
1833
          fi
 
1834
        fi
 
1835
      fi
 
1836
    fi
 
1837
    dnl Potentially add $additional_libdir to $LDFLAGS.
 
1838
    dnl But don't add it
 
1839
    dnl   1. if it's the standard /usr/lib,
 
1840
    dnl   2. if it's already present in $LDFLAGS,
 
1841
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
 
1842
    dnl   4. if it doesn't exist as a directory.
 
1843
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
 
1844
      haveit=
 
1845
      for x in $LDFLAGS; do
 
1846
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1847
        if test "X$x" = "X-L$additional_libdir"; then
 
1848
          haveit=yes
 
1849
          break
 
1850
        fi
 
1851
      done
 
1852
      if test -z "$haveit"; then
 
1853
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
 
1854
          if test -n "$GCC"; then
 
1855
            case $host_os in
 
1856
              linux*) haveit=yes;;
 
1857
            esac
 
1858
          fi
 
1859
        fi
 
1860
        if test -z "$haveit"; then
 
1861
          if test -d "$additional_libdir"; then
 
1862
            dnl Really add $additional_libdir to $LDFLAGS.
 
1863
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
 
1864
          fi
 
1865
        fi
 
1866
      fi
 
1867
    fi
 
1868
  fi
 
1869
])
 
1870
 
 
1871
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
 
1872
dnl acl_final_exec_prefix, containing the values to which $prefix and
 
1873
dnl $exec_prefix will expand at the end of the configure script.
 
1874
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
 
1875
[
 
1876
  dnl Unfortunately, prefix and exec_prefix get only finally determined
 
1877
  dnl at the end of configure.
 
1878
  if test "X$prefix" = "XNONE"; then
 
1879
    acl_final_prefix="$ac_default_prefix"
 
1880
  else
 
1881
    acl_final_prefix="$prefix"
 
1882
  fi
 
1883
  if test "X$exec_prefix" = "XNONE"; then
 
1884
    acl_final_exec_prefix='${prefix}'
 
1885
  else
 
1886
    acl_final_exec_prefix="$exec_prefix"
 
1887
  fi
 
1888
  acl_save_prefix="$prefix"
 
1889
  prefix="$acl_final_prefix"
 
1890
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
 
1891
  prefix="$acl_save_prefix"
 
1892
])
 
1893
 
 
1894
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
 
1895
dnl variables prefix and exec_prefix bound to the values they will have
 
1896
dnl at the end of the configure script.
 
1897
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 
1898
[
 
1899
  acl_save_prefix="$prefix"
 
1900
  prefix="$acl_final_prefix"
 
1901
  acl_save_exec_prefix="$exec_prefix"
 
1902
  exec_prefix="$acl_final_exec_prefix"
 
1903
  $1
 
1904
  exec_prefix="$acl_save_exec_prefix"
 
1905
  prefix="$acl_save_prefix"
 
1906
])
 
1907
 
 
1908
dnl AC_LIB_PREPARE_MULTILIB creates
 
1909
dnl - a variable acl_libdirstem, containing the basename of the libdir, either
 
1910
dnl   "lib" or "lib64" or "lib/64",
 
1911
dnl - a variable acl_libdirstem2, as a secondary possible value for
 
1912
dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
 
1913
dnl   "lib/amd64".
 
1914
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 
1915
[
 
1916
  dnl There is no formal standard regarding lib and lib64.
 
1917
  dnl On glibc systems, the current practice is that on a system supporting
 
1918
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
 
1919
  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
 
1920
  dnl the compiler's default mode by looking at the compiler's library search
 
1921
  dnl path. If at least one of its elements ends in /lib64 or points to a
 
1922
  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
 
1923
  dnl Otherwise we use the default, namely "lib".
 
1924
  dnl On Solaris systems, the current practice is that on a system supporting
 
1925
  dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
 
1926
  dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
 
1927
  dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
 
1928
  AC_REQUIRE([AC_CANONICAL_HOST])
 
1929
  acl_libdirstem=lib
 
1930
  acl_libdirstem2=
 
1931
  case "$host_os" in
 
1932
    solaris*)
 
1933
      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
 
1934
      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
 
1935
      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
 
1936
      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
 
1937
      dnl symlink is missing, so we set acl_libdirstem2 too.
 
1938
      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
 
1939
        [AC_EGREP_CPP([sixtyfour bits], [
 
1940
#ifdef _LP64
 
1941
sixtyfour bits
 
1942
#endif
 
1943
           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
 
1944
        ])
 
1945
      if test $gl_cv_solaris_64bit = yes; then
 
1946
        acl_libdirstem=lib/64
 
1947
        case "$host_cpu" in
 
1948
          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
 
1949
          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
 
1950
        esac
 
1951
      fi
 
1952
      ;;
 
1953
    *)
 
1954
      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
 
1955
      if test -n "$searchpath"; then
 
1956
        acl_save_IFS="${IFS=    }"; IFS=":"
 
1957
        for searchdir in $searchpath; do
 
1958
          if test -d "$searchdir"; then
 
1959
            case "$searchdir" in
 
1960
              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
 
1961
              */../ | */.. )
 
1962
                # Better ignore directories of this form. They are misleading.
 
1963
                ;;
 
1964
              *) searchdir=`cd "$searchdir" && pwd`
 
1965
                 case "$searchdir" in
 
1966
                   */lib64 ) acl_libdirstem=lib64 ;;
 
1967
                 esac ;;
 
1968
            esac
 
1969
          fi
 
1970
        done
 
1971
        IFS="$acl_save_IFS"
 
1972
      fi
 
1973
      ;;
 
1974
  esac
 
1975
  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
 
1976
])
 
1977
 
1033
1978
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
1034
1979
#
1035
1980
#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9652
10597
fi[]dnl
9653
10598
])# PKG_CHECK_MODULES
9654
10599
 
 
10600
# po.m4 serial 17 (gettext-0.18)
 
10601
dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
 
10602
dnl This file is free software; the Free Software Foundation
 
10603
dnl gives unlimited permission to copy and/or distribute it,
 
10604
dnl with or without modifications, as long as this notice is preserved.
 
10605
dnl
 
10606
dnl This file can can be used in projects which are not available under
 
10607
dnl the GNU General Public License or the GNU Library General Public
 
10608
dnl License but which still want to provide support for the GNU gettext
 
10609
dnl functionality.
 
10610
dnl Please note that the actual code of the GNU gettext library is covered
 
10611
dnl by the GNU Library General Public License, and the rest of the GNU
 
10612
dnl gettext package package is covered by the GNU General Public License.
 
10613
dnl They are *not* in the public domain.
 
10614
 
 
10615
dnl Authors:
 
10616
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
10617
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
10618
 
 
10619
AC_PREREQ([2.50])
 
10620
 
 
10621
dnl Checks for all prerequisites of the po subdirectory.
 
10622
AC_DEFUN([AM_PO_SUBDIRS],
 
10623
[
 
10624
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
10625
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
10626
  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
 
10627
  AC_REQUIRE([AM_NLS])dnl
 
10628
 
 
10629
  dnl Release version of the gettext macros. This is used to ensure that
 
10630
  dnl the gettext macros and po/Makefile.in.in are in sync.
 
10631
  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
 
10632
 
 
10633
  dnl Perform the following tests also if --disable-nls has been given,
 
10634
  dnl because they are needed for "make dist" to work.
 
10635
 
 
10636
  dnl Search for GNU msgfmt in the PATH.
 
10637
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
 
10638
  dnl The second test excludes FreeBSD msgfmt.
 
10639
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
10640
    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
10641
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
10642
    :)
 
10643
  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
 
10644
 
 
10645
  dnl Test whether it is GNU msgfmt >= 0.15.
 
10646
changequote(,)dnl
 
10647
  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
10648
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
 
10649
    *) MSGFMT_015=$MSGFMT ;;
 
10650
  esac
 
10651
changequote([,])dnl
 
10652
  AC_SUBST([MSGFMT_015])
 
10653
changequote(,)dnl
 
10654
  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
10655
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
 
10656
    *) GMSGFMT_015=$GMSGFMT ;;
 
10657
  esac
 
10658
changequote([,])dnl
 
10659
  AC_SUBST([GMSGFMT_015])
 
10660
 
 
10661
  dnl Search for GNU xgettext 0.12 or newer in the PATH.
 
10662
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
 
10663
  dnl The second test excludes FreeBSD xgettext.
 
10664
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
10665
    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
10666
     (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)],
 
10667
    :)
 
10668
  dnl Remove leftover from FreeBSD xgettext call.
 
10669
  rm -f messages.po
 
10670
 
 
10671
  dnl Test whether it is GNU xgettext >= 0.15.
 
10672
changequote(,)dnl
 
10673
  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
10674
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
 
10675
    *) XGETTEXT_015=$XGETTEXT ;;
 
10676
  esac
 
10677
changequote([,])dnl
 
10678
  AC_SUBST([XGETTEXT_015])
 
10679
 
 
10680
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
 
10681
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
 
10682
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
10683
 
 
10684
  dnl Installation directories.
 
10685
  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
 
10686
  dnl have to define it here, so that it can be used in po/Makefile.
 
10687
  test -n "$localedir" || localedir='${datadir}/locale'
 
10688
  AC_SUBST([localedir])
 
10689
 
 
10690
  dnl Support for AM_XGETTEXT_OPTION.
 
10691
  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
 
10692
  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
 
10693
 
 
10694
  AC_CONFIG_COMMANDS([po-directories], [[
 
10695
    for ac_file in $CONFIG_FILES; do
 
10696
      # Support "outfile[:infile[:infile...]]"
 
10697
      case "$ac_file" in
 
10698
        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
 
10699
      esac
 
10700
      # PO directories have a Makefile.in generated from Makefile.in.in.
 
10701
      case "$ac_file" in */Makefile.in)
 
10702
        # Adjust a relative srcdir.
 
10703
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
10704
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
10705
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
10706
        # In autoconf-2.13 it is called $ac_given_srcdir.
 
10707
        # In autoconf-2.50 it is called $srcdir.
 
10708
        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
10709
        case "$ac_given_srcdir" in
 
10710
          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
10711
          /*) top_srcdir="$ac_given_srcdir" ;;
 
10712
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
10713
        esac
 
10714
        # Treat a directory as a PO directory if and only if it has a
 
10715
        # POTFILES.in file. This allows packages to have multiple PO
 
10716
        # directories under different names or in different locations.
 
10717
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
 
10718
          rm -f "$ac_dir/POTFILES"
 
10719
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
 
10720
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
 
10721
          POMAKEFILEDEPS="POTFILES.in"
 
10722
          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
 
10723
          # on $ac_dir but don't depend on user-specified configuration
 
10724
          # parameters.
 
10725
          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
10726
            # The LINGUAS file contains the set of available languages.
 
10727
            if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
10728
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
10729
            fi
 
10730
            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
10731
            # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
10732
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
10733
            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
10734
          else
 
10735
            # The set of available languages was given in configure.in.
 
10736
            # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
10737
            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
 
10738
          fi
 
10739
          # Compute POFILES
 
10740
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
10741
          # Compute UPDATEPOFILES
 
10742
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
10743
          # Compute DUMMYPOFILES
 
10744
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
10745
          # Compute GMOFILES
 
10746
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
10747
          case "$ac_given_srcdir" in
 
10748
            .) srcdirpre= ;;
 
10749
            *) srcdirpre='$(srcdir)/' ;;
 
10750
          esac
 
10751
          POFILES=
 
10752
          UPDATEPOFILES=
 
10753
          DUMMYPOFILES=
 
10754
          GMOFILES=
 
10755
          for lang in $ALL_LINGUAS; do
 
10756
            POFILES="$POFILES $srcdirpre$lang.po"
 
10757
            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
10758
            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
10759
            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
10760
          done
 
10761
          # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
10762
          # environment variable.
 
10763
          INST_LINGUAS=
 
10764
          if test -n "$ALL_LINGUAS"; then
 
10765
            for presentlang in $ALL_LINGUAS; do
 
10766
              useit=no
 
10767
              if test "%UNSET%" != "$LINGUAS"; then
 
10768
                desiredlanguages="$LINGUAS"
 
10769
              else
 
10770
                desiredlanguages="$ALL_LINGUAS"
 
10771
              fi
 
10772
              for desiredlang in $desiredlanguages; do
 
10773
                # Use the presentlang catalog if desiredlang is
 
10774
                #   a. equal to presentlang, or
 
10775
                #   b. a variant of presentlang (because in this case,
 
10776
                #      presentlang can be used as a fallback for messages
 
10777
                #      which are not translated in the desiredlang catalog).
 
10778
                case "$desiredlang" in
 
10779
                  "$presentlang"*) useit=yes;;
 
10780
                esac
 
10781
              done
 
10782
              if test $useit = yes; then
 
10783
                INST_LINGUAS="$INST_LINGUAS $presentlang"
 
10784
              fi
 
10785
            done
 
10786
          fi
 
10787
          CATALOGS=
 
10788
          if test -n "$INST_LINGUAS"; then
 
10789
            for lang in $INST_LINGUAS; do
 
10790
              CATALOGS="$CATALOGS $lang.gmo"
 
10791
            done
 
10792
          fi
 
10793
          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
 
10794
          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"
 
10795
          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
 
10796
            if test -f "$f"; then
 
10797
              case "$f" in
 
10798
                *.orig | *.bak | *~) ;;
 
10799
                *) cat "$f" >> "$ac_dir/Makefile" ;;
 
10800
              esac
 
10801
            fi
 
10802
          done
 
10803
        fi
 
10804
        ;;
 
10805
      esac
 
10806
    done]],
 
10807
   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
 
10808
    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
 
10809
    # from automake < 1.5.
 
10810
    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
 
10811
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
 
10812
    LINGUAS="${LINGUAS-%UNSET%}"
 
10813
   ])
 
10814
])
 
10815
 
 
10816
dnl Postprocesses a Makefile in a directory containing PO files.
 
10817
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
 
10818
[
 
10819
  # When this code is run, in config.status, two variables have already been
 
10820
  # set:
 
10821
  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
 
10822
  # - LINGUAS is the value of the environment variable LINGUAS at configure
 
10823
  #   time.
 
10824
 
 
10825
changequote(,)dnl
 
10826
  # Adjust a relative srcdir.
 
10827
  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
10828
  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
10829
  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
10830
  # In autoconf-2.13 it is called $ac_given_srcdir.
 
10831
  # In autoconf-2.50 it is called $srcdir.
 
10832
  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
10833
  case "$ac_given_srcdir" in
 
10834
    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
10835
    /*) top_srcdir="$ac_given_srcdir" ;;
 
10836
    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
10837
  esac
 
10838
 
 
10839
  # Find a way to echo strings without interpreting backslash.
 
10840
  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
 
10841
    gt_echo='echo'
 
10842
  else
 
10843
    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
 
10844
      gt_echo='printf %s\n'
 
10845
    else
 
10846
      echo_func () {
 
10847
        cat <<EOT
 
10848
$*
 
10849
EOT
 
10850
      }
 
10851
      gt_echo='echo_func'
 
10852
    fi
 
10853
  fi
 
10854
 
 
10855
  # A sed script that extracts the value of VARIABLE from a Makefile.
 
10856
  sed_x_variable='
 
10857
# Test if the hold space is empty.
 
10858
x
 
10859
s/P/P/
 
10860
x
 
10861
ta
 
10862
# Yes it was empty. Look if we have the expected variable definition.
 
10863
/^[      ]*VARIABLE[     ]*=/{
 
10864
  # Seen the first line of the variable definition.
 
10865
  s/^[   ]*VARIABLE[     ]*=//
 
10866
  ba
 
10867
}
 
10868
bd
 
10869
:a
 
10870
# Here we are processing a line from the variable definition.
 
10871
# Remove comment, more precisely replace it with a space.
 
10872
s/#.*$/ /
 
10873
# See if the line ends in a backslash.
 
10874
tb
 
10875
:b
 
10876
s/\\$//
 
10877
# Print the line, without the trailing backslash.
 
10878
p
 
10879
tc
 
10880
# There was no trailing backslash. The end of the variable definition is
 
10881
# reached. Clear the hold space.
 
10882
s/^.*$//
 
10883
x
 
10884
bd
 
10885
:c
 
10886
# A trailing backslash means that the variable definition continues in the
 
10887
# next line. Put a nonempty string into the hold space to indicate this.
 
10888
s/^.*$/P/
 
10889
x
 
10890
:d
 
10891
'
 
10892
changequote([,])dnl
 
10893
 
 
10894
  # Set POTFILES to the value of the Makefile variable POTFILES.
 
10895
  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
 
10896
  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
 
10897
  # Compute POTFILES_DEPS as
 
10898
  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
 
10899
  POTFILES_DEPS=
 
10900
  for file in $POTFILES; do
 
10901
    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
 
10902
  done
 
10903
  POMAKEFILEDEPS=""
 
10904
 
 
10905
  if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
10906
    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
10907
  fi
 
10908
  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
10909
    # The LINGUAS file contains the set of available languages.
 
10910
    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
10911
    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
10912
  else
 
10913
    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
 
10914
    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
 
10915
    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
 
10916
  fi
 
10917
  # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
10918
  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
10919
  # Compute POFILES
 
10920
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
10921
  # Compute UPDATEPOFILES
 
10922
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
10923
  # Compute DUMMYPOFILES
 
10924
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
10925
  # Compute GMOFILES
 
10926
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
10927
  # Compute PROPERTIESFILES
 
10928
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
 
10929
  # Compute CLASSFILES
 
10930
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
 
10931
  # Compute QMFILES
 
10932
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
 
10933
  # Compute MSGFILES
 
10934
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
 
10935
  # Compute RESOURCESDLLFILES
 
10936
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
 
10937
  case "$ac_given_srcdir" in
 
10938
    .) srcdirpre= ;;
 
10939
    *) srcdirpre='$(srcdir)/' ;;
 
10940
  esac
 
10941
  POFILES=
 
10942
  UPDATEPOFILES=
 
10943
  DUMMYPOFILES=
 
10944
  GMOFILES=
 
10945
  PROPERTIESFILES=
 
10946
  CLASSFILES=
 
10947
  QMFILES=
 
10948
  MSGFILES=
 
10949
  RESOURCESDLLFILES=
 
10950
  for lang in $ALL_LINGUAS; do
 
10951
    POFILES="$POFILES $srcdirpre$lang.po"
 
10952
    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
10953
    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
10954
    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
10955
    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
 
10956
    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
 
10957
    QMFILES="$QMFILES $srcdirpre$lang.qm"
 
10958
    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
10959
    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
 
10960
    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/'`
 
10961
    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
 
10962
  done
 
10963
  # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
10964
  # environment variable.
 
10965
  INST_LINGUAS=
 
10966
  if test -n "$ALL_LINGUAS"; then
 
10967
    for presentlang in $ALL_LINGUAS; do
 
10968
      useit=no
 
10969
      if test "%UNSET%" != "$LINGUAS"; then
 
10970
        desiredlanguages="$LINGUAS"
 
10971
      else
 
10972
        desiredlanguages="$ALL_LINGUAS"
 
10973
      fi
 
10974
      for desiredlang in $desiredlanguages; do
 
10975
        # Use the presentlang catalog if desiredlang is
 
10976
        #   a. equal to presentlang, or
 
10977
        #   b. a variant of presentlang (because in this case,
 
10978
        #      presentlang can be used as a fallback for messages
 
10979
        #      which are not translated in the desiredlang catalog).
 
10980
        case "$desiredlang" in
 
10981
          "$presentlang"*) useit=yes;;
 
10982
        esac
 
10983
      done
 
10984
      if test $useit = yes; then
 
10985
        INST_LINGUAS="$INST_LINGUAS $presentlang"
 
10986
      fi
 
10987
    done
 
10988
  fi
 
10989
  CATALOGS=
 
10990
  JAVACATALOGS=
 
10991
  QTCATALOGS=
 
10992
  TCLCATALOGS=
 
10993
  CSHARPCATALOGS=
 
10994
  if test -n "$INST_LINGUAS"; then
 
10995
    for lang in $INST_LINGUAS; do
 
10996
      CATALOGS="$CATALOGS $lang.gmo"
 
10997
      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
 
10998
      QTCATALOGS="$QTCATALOGS $lang.qm"
 
10999
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
11000
      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
 
11001
      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/'`
 
11002
      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
 
11003
    done
 
11004
  fi
 
11005
 
 
11006
  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"
 
11007
  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
 
11008
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
11009
    for lang in $ALL_LINGUAS; do
 
11010
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
11011
      cat >> "$ac_file.tmp" <<EOF
 
11012
$frobbedlang.msg: $lang.po
 
11013
        @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
 
11014
        \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
11015
EOF
 
11016
    done
 
11017
  fi
 
11018
  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
 
11019
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
11020
    for lang in $ALL_LINGUAS; do
 
11021
      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/'`
 
11022
      cat >> "$ac_file.tmp" <<EOF
 
11023
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
 
11024
        @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
 
11025
        \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
11026
EOF
 
11027
    done
 
11028
  fi
 
11029
  if test -n "$POMAKEFILEDEPS"; then
 
11030
    cat >> "$ac_file.tmp" <<EOF
 
11031
Makefile: $POMAKEFILEDEPS
 
11032
EOF
 
11033
  fi
 
11034
  mv "$ac_file.tmp" "$ac_file"
 
11035
])
 
11036
 
 
11037
dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
 
11038
AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
 
11039
[
 
11040
  XGETTEXT_EXTRA_OPTIONS=
 
11041
])
 
11042
 
 
11043
dnl Registers an option to be passed to xgettext in the po subdirectory.
 
11044
AC_DEFUN([AM_XGETTEXT_OPTION],
 
11045
[
 
11046
  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
 
11047
  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
 
11048
])
 
11049
 
 
11050
# progtest.m4 serial 6 (gettext-0.18)
 
11051
dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
 
11052
dnl This file is free software; the Free Software Foundation
 
11053
dnl gives unlimited permission to copy and/or distribute it,
 
11054
dnl with or without modifications, as long as this notice is preserved.
 
11055
dnl
 
11056
dnl This file can can be used in projects which are not available under
 
11057
dnl the GNU General Public License or the GNU Library General Public
 
11058
dnl License but which still want to provide support for the GNU gettext
 
11059
dnl functionality.
 
11060
dnl Please note that the actual code of the GNU gettext library is covered
 
11061
dnl by the GNU Library General Public License, and the rest of the GNU
 
11062
dnl gettext package package is covered by the GNU General Public License.
 
11063
dnl They are *not* in the public domain.
 
11064
 
 
11065
dnl Authors:
 
11066
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
 
11067
 
 
11068
AC_PREREQ([2.50])
 
11069
 
 
11070
# Search path for a program which passes the given test.
 
11071
 
 
11072
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
11073
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
11074
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
 
11075
[
 
11076
# Prepare PATH_SEPARATOR.
 
11077
# The user is always right.
 
11078
if test "${PATH_SEPARATOR+set}" != set; then
 
11079
  echo "#! /bin/sh" >conf$$.sh
 
11080
  echo  "exit 0"   >>conf$$.sh
 
11081
  chmod +x conf$$.sh
 
11082
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
11083
    PATH_SEPARATOR=';'
 
11084
  else
 
11085
    PATH_SEPARATOR=:
 
11086
  fi
 
11087
  rm -f conf$$.sh
 
11088
fi
 
11089
 
 
11090
# Find out how to test for executable files. Don't use a zero-byte file,
 
11091
# as systems may use methods other than mode bits to determine executability.
 
11092
cat >conf$$.file <<_ASEOF
 
11093
#! /bin/sh
 
11094
exit 0
 
11095
_ASEOF
 
11096
chmod +x conf$$.file
 
11097
if test -x conf$$.file >/dev/null 2>&1; then
 
11098
  ac_executable_p="test -x"
 
11099
else
 
11100
  ac_executable_p="test -f"
 
11101
fi
 
11102
rm -f conf$$.file
 
11103
 
 
11104
# Extract the first word of "$2", so it can be a program name with args.
 
11105
set dummy $2; ac_word=[$]2
 
11106
AC_MSG_CHECKING([for $ac_word])
 
11107
AC_CACHE_VAL([ac_cv_path_$1],
 
11108
[case "[$]$1" in
 
11109
  [[\\/]]* | ?:[[\\/]]*)
 
11110
    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
11111
    ;;
 
11112
  *)
 
11113
    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
 
11114
    for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
11115
      IFS="$ac_save_IFS"
 
11116
      test -z "$ac_dir" && ac_dir=.
 
11117
      for ac_exec_ext in '' $ac_executable_extensions; do
 
11118
        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
 
11119
          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
 
11120
          if [$3]; then
 
11121
            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
 
11122
            break 2
 
11123
          fi
 
11124
        fi
 
11125
      done
 
11126
    done
 
11127
    IFS="$ac_save_IFS"
 
11128
dnl If no 4th arg is given, leave the cache variable unset,
 
11129
dnl so AC_PATH_PROGS will keep looking.
 
11130
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
11131
])dnl
 
11132
    ;;
 
11133
esac])dnl
 
11134
$1="$ac_cv_path_$1"
 
11135
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
11136
  AC_MSG_RESULT([$][$1])
 
11137
else
 
11138
  AC_MSG_RESULT([no])
 
11139
fi
 
11140
AC_SUBST([$1])dnl
 
11141
])
 
11142
 
9655
11143
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
9656
11144
#
9657
11145
# This file is free software; the Free Software Foundation