~ubuntu-branches/ubuntu/wily/alsaplayer/wily

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Hubert Chathi
  • Date: 2007-10-10 15:33:10 UTC
  • mto: (9.2.5 sid)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20071010153310-h3holq75eu2cigb0
Tags: upstream-0.99.80~rc4
ImportĀ upstreamĀ versionĀ 0.99.80~rc4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
running cat m4/audiofile.m4 m4/esd.m4 m4/gtk.m4 m4/libmikmod.m4 m4/ogg.m4 m4/qt.m4 m4/vorbis.m4 ...
 
1
running cat m4/audiofile.m4 m4/codeset.m4 m4/esd.m4 m4/gettext.m4 m4/glibc21.m4 m4/glibc2.m4 m4/glib.m4 m4/gtk.m4 m4/iconv.m4 m4/intdiv0.m4 m4/intldir.m4 m4/intl.m4 m4/intmax.m4 m4/inttypes_h.m4 m4/inttypes-pri.m4 m4/lcmessage.m4 m4/lib-ld.m4 m4/lib-link.m4 m4/libmikmod.m4 m4/lib-prefix.m4 m4/lock.m4 m4/longdouble.m4 m4/longlong.m4 m4/nls.m4 m4/ogg.m4 m4/po.m4 m4/printf-posix.m4 m4/progtest.m4 m4/qt.m4 m4/size_max.m4 m4/stdint_h.m4 m4/uintmax_t.m4 m4/ulonglong.m4 m4/visibility.m4 m4/vorbis.m4 m4/wchar_t.m4 m4/wint_t.m4 m4/xsize.m4 ...
2
2
# Configure paths for the Audio File Library
3
3
# Bertrand Guiheneuf 98-10-21
4
4
# stolen from esd.m4 in esound :
178
178
  AC_SUBST(AUDIOFILE_LIBS)
179
179
  rm -f conf.audiofiletest
180
180
])
 
181
# codeset.m4 serial 2 (gettext-0.16)
 
182
dnl Copyright (C) 2000-2002, 2006 Free Software Foundation, Inc.
 
183
dnl This file is free software; the Free Software Foundation
 
184
dnl gives unlimited permission to copy and/or distribute it,
 
185
dnl with or without modifications, as long as this notice is preserved.
 
186
 
 
187
dnl From Bruno Haible.
 
188
 
 
189
AC_DEFUN([AM_LANGINFO_CODESET],
 
190
[
 
191
  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
 
192
    [AC_TRY_LINK([#include <langinfo.h>],
 
193
      [char* cs = nl_langinfo(CODESET); return !cs;],
 
194
      am_cv_langinfo_codeset=yes,
 
195
      am_cv_langinfo_codeset=no)
 
196
    ])
 
197
  if test $am_cv_langinfo_codeset = yes; then
 
198
    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
 
199
      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
 
200
  fi
 
201
])
181
202
# Configure paths for ESD
182
203
# Manish Singh    98-9-30
183
204
# stolen back from Frank Belew
372
393
    fi
373
394
  )
374
395
])
 
396
# gettext.m4 serial 59 (gettext-0.16.1)
 
397
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
 
398
dnl This file is free software; the Free Software Foundation
 
399
dnl gives unlimited permission to copy and/or distribute it,
 
400
dnl with or without modifications, as long as this notice is preserved.
 
401
dnl
 
402
dnl This file can can be used in projects which are not available under
 
403
dnl the GNU General Public License or the GNU Library General Public
 
404
dnl License but which still want to provide support for the GNU gettext
 
405
dnl functionality.
 
406
dnl Please note that the actual code of the GNU gettext library is covered
 
407
dnl by the GNU Library General Public License, and the rest of the GNU
 
408
dnl gettext package package is covered by the GNU General Public License.
 
409
dnl They are *not* in the public domain.
 
410
 
 
411
dnl Authors:
 
412
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
413
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006.
 
414
 
 
415
dnl Macro to add for using GNU gettext.
 
416
 
 
417
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
 
418
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
 
419
dnl    default (if it is not specified or empty) is 'no-libtool'.
 
420
dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
 
421
dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
 
422
dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
 
423
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 
424
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
 
425
dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
 
426
dnl    $(top_builddir)/intl/libintl.a will be created.
 
427
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 
428
dnl    implementations (in libc or libintl) without the ngettext() function
 
429
dnl    will be ignored.  If NEEDSYMBOL is specified and is
 
430
dnl    'need-formatstring-macros', then GNU gettext implementations that don't
 
431
dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
 
432
dnl INTLDIR is used to find the intl libraries.  If empty,
 
433
dnl    the value `$(top_builddir)/intl/' is used.
 
434
dnl
 
435
dnl The result of the configuration is one of three cases:
 
436
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
 
437
dnl    and used.
 
438
dnl    Catalog format: GNU --> install in $(datadir)
 
439
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
440
dnl 2) GNU gettext has been found in the system's C library.
 
441
dnl    Catalog format: GNU --> install in $(datadir)
 
442
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
443
dnl 3) No internationalization, always use English msgid.
 
444
dnl    Catalog format: none
 
445
dnl    Catalog extension: none
 
446
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
 
447
dnl The use of .gmo is historical (it was needed to avoid overwriting the
 
448
dnl GNU format catalogs when building on a platform with an X/Open gettext),
 
449
dnl but we keep it in order not to force irrelevant filename changes on the
 
450
dnl maintainers.
 
451
dnl
 
452
AC_DEFUN([AM_GNU_GETTEXT],
 
453
[
 
454
  dnl Argument checking.
 
455
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
 
456
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
 
457
])])])])])
 
458
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
 
459
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 
460
])])])])
 
461
  define([gt_included_intl],
 
462
    ifelse([$1], [external],
 
463
      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
 
464
      [yes]))
 
465
  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
 
466
  gt_NEEDS_INIT
 
467
  AM_GNU_GETTEXT_NEED([$2])
 
468
 
 
469
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
 
470
  ifelse(gt_included_intl, yes, [
 
471
    AC_REQUIRE([AM_INTL_SUBDIR])dnl
 
472
  ])
 
473
 
 
474
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
475
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
476
  AC_REQUIRE([AC_LIB_RPATH])
 
477
 
 
478
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
479
  dnl Ideally we would do this search only after the
 
480
  dnl      if test "$USE_NLS" = "yes"; then
 
481
  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
 
482
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
 
483
  dnl the configure script would need to contain the same shell code
 
484
  dnl again, outside any 'if'. There are two solutions:
 
485
  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
 
486
  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
 
487
  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
 
488
  dnl documented, we avoid it.
 
489
  ifelse(gt_included_intl, yes, , [
 
490
    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
491
  ])
 
492
 
 
493
  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
 
494
  gt_INTL_MACOSX
 
495
 
 
496
  dnl Set USE_NLS.
 
497
  AC_REQUIRE([AM_NLS])
 
498
 
 
499
  ifelse(gt_included_intl, yes, [
 
500
    BUILD_INCLUDED_LIBINTL=no
 
501
    USE_INCLUDED_LIBINTL=no
 
502
  ])
 
503
  LIBINTL=
 
504
  LTLIBINTL=
 
505
  POSUB=
 
506
 
 
507
  dnl Add a version number to the cache macros.
 
508
  case " $gt_needs " in
 
509
    *" need-formatstring-macros "*) gt_api_version=3 ;;
 
510
    *" need-ngettext "*) gt_api_version=2 ;;
 
511
    *) gt_api_version=1 ;;
 
512
  esac
 
513
  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
 
514
  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
 
515
 
 
516
  dnl If we use NLS figure out what method
 
517
  if test "$USE_NLS" = "yes"; then
 
518
    gt_use_preinstalled_gnugettext=no
 
519
    ifelse(gt_included_intl, yes, [
 
520
      AC_MSG_CHECKING([whether included gettext is requested])
 
521
      AC_ARG_WITH(included-gettext,
 
522
        [  --with-included-gettext use the GNU gettext library included here],
 
523
        nls_cv_force_use_gnu_gettext=$withval,
 
524
        nls_cv_force_use_gnu_gettext=no)
 
525
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 
526
 
 
527
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
 
528
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 
529
    ])
 
530
        dnl User does not insist on using GNU NLS library.  Figure out what
 
531
        dnl to use.  If GNU gettext is available we use this.  Else we have
 
532
        dnl to fall back to GNU NLS library.
 
533
 
 
534
        if test $gt_api_version -ge 3; then
 
535
          gt_revision_test_code='
 
536
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
537
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 
538
#endif
 
539
changequote(,)dnl
 
540
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 
541
changequote([,])dnl
 
542
'
 
543
        else
 
544
          gt_revision_test_code=
 
545
        fi
 
546
        if test $gt_api_version -ge 2; then
 
547
          gt_expression_test_code=' + * ngettext ("", "", 0)'
 
548
        else
 
549
          gt_expression_test_code=
 
550
        fi
 
551
 
 
552
        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
 
553
         [AC_TRY_LINK([#include <libintl.h>
 
554
$gt_revision_test_code
 
555
extern int _nl_msg_cat_cntr;
 
556
extern int *_nl_domain_bindings;],
 
557
            [bindtextdomain ("", "");
 
558
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings],
 
559
            [eval "$gt_func_gnugettext_libc=yes"],
 
560
            [eval "$gt_func_gnugettext_libc=no"])])
 
561
 
 
562
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
 
563
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
564
          ifelse(gt_included_intl, yes, , [
 
565
            AM_ICONV_LINK
 
566
          ])
 
567
          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
 
568
          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
 
569
          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
 
570
          dnl even if libiconv doesn't exist.
 
571
          AC_LIB_LINKFLAGS_BODY([intl])
 
572
          AC_CACHE_CHECK([for GNU gettext in libintl],
 
573
            [$gt_func_gnugettext_libintl],
 
574
           [gt_save_CPPFLAGS="$CPPFLAGS"
 
575
            CPPFLAGS="$CPPFLAGS $INCINTL"
 
576
            gt_save_LIBS="$LIBS"
 
577
            LIBS="$LIBS $LIBINTL"
 
578
            dnl Now see whether libintl exists and does not depend on libiconv.
 
579
            AC_TRY_LINK([#include <libintl.h>
 
580
$gt_revision_test_code
 
581
extern int _nl_msg_cat_cntr;
 
582
extern
 
583
#ifdef __cplusplus
 
584
"C"
 
585
#endif
 
586
const char *_nl_expand_alias (const char *);],
 
587
              [bindtextdomain ("", "");
 
588
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
589
              [eval "$gt_func_gnugettext_libintl=yes"],
 
590
              [eval "$gt_func_gnugettext_libintl=no"])
 
591
            dnl Now see whether libintl exists and depends on libiconv.
 
592
            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
 
593
              LIBS="$LIBS $LIBICONV"
 
594
              AC_TRY_LINK([#include <libintl.h>
 
595
$gt_revision_test_code
 
596
extern int _nl_msg_cat_cntr;
 
597
extern
 
598
#ifdef __cplusplus
 
599
"C"
 
600
#endif
 
601
const char *_nl_expand_alias (const char *);],
 
602
                [bindtextdomain ("", "");
 
603
return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
604
               [LIBINTL="$LIBINTL $LIBICONV"
 
605
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
 
606
                eval "$gt_func_gnugettext_libintl=yes"
 
607
               ])
 
608
            fi
 
609
            CPPFLAGS="$gt_save_CPPFLAGS"
 
610
            LIBS="$gt_save_LIBS"])
 
611
        fi
 
612
 
 
613
        dnl If an already present or preinstalled GNU gettext() is found,
 
614
        dnl use it.  But if this macro is used in GNU gettext, and GNU
 
615
        dnl gettext is already preinstalled in libintl, we update this
 
616
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
 
617
        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
 
618
           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
 
619
                && test "$PACKAGE" != gettext-runtime \
 
620
                && test "$PACKAGE" != gettext-tools; }; then
 
621
          gt_use_preinstalled_gnugettext=yes
 
622
        else
 
623
          dnl Reset the values set by searching for libintl.
 
624
          LIBINTL=
 
625
          LTLIBINTL=
 
626
          INCINTL=
 
627
        fi
 
628
 
 
629
    ifelse(gt_included_intl, yes, [
 
630
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
 
631
          dnl GNU gettext is not found in the C library.
 
632
          dnl Fall back on included GNU gettext library.
 
633
          nls_cv_use_gnu_gettext=yes
 
634
        fi
 
635
      fi
 
636
 
 
637
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
 
638
        dnl Mark actions used to generate GNU NLS library.
 
639
        BUILD_INCLUDED_LIBINTL=yes
 
640
        USE_INCLUDED_LIBINTL=yes
 
641
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
 
642
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
 
643
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
 
644
      fi
 
645
 
 
646
      CATOBJEXT=
 
647
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
648
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
649
        dnl Mark actions to use GNU gettext tools.
 
650
        CATOBJEXT=.gmo
 
651
      fi
 
652
    ])
 
653
 
 
654
    if test -n "$INTL_MACOSX_LIBS"; then
 
655
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
656
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
657
        dnl Some extra flags are needed during linking.
 
658
        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
 
659
        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
 
660
      fi
 
661
    fi
 
662
 
 
663
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
664
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
665
      AC_DEFINE(ENABLE_NLS, 1,
 
666
        [Define to 1 if translation of program messages to the user's native language
 
667
   is requested.])
 
668
    else
 
669
      USE_NLS=no
 
670
    fi
 
671
  fi
 
672
 
 
673
  AC_MSG_CHECKING([whether to use NLS])
 
674
  AC_MSG_RESULT([$USE_NLS])
 
675
  if test "$USE_NLS" = "yes"; then
 
676
    AC_MSG_CHECKING([where the gettext function comes from])
 
677
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
678
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
 
679
        gt_source="external libintl"
 
680
      else
 
681
        gt_source="libc"
 
682
      fi
 
683
    else
 
684
      gt_source="included intl directory"
 
685
    fi
 
686
    AC_MSG_RESULT([$gt_source])
 
687
  fi
 
688
 
 
689
  if test "$USE_NLS" = "yes"; then
 
690
 
 
691
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
692
      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
 
693
        AC_MSG_CHECKING([how to link with libintl])
 
694
        AC_MSG_RESULT([$LIBINTL])
 
695
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
 
696
      fi
 
697
 
 
698
      dnl For backward compatibility. Some packages may be using this.
 
699
      AC_DEFINE(HAVE_GETTEXT, 1,
 
700
       [Define if the GNU gettext() function is already present or preinstalled.])
 
701
      AC_DEFINE(HAVE_DCGETTEXT, 1,
 
702
       [Define if the GNU dcgettext() function is already present or preinstalled.])
 
703
    fi
 
704
 
 
705
    dnl We need to process the po/ directory.
 
706
    POSUB=po
 
707
  fi
 
708
 
 
709
  ifelse(gt_included_intl, yes, [
 
710
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
 
711
    dnl to 'yes' because some of the testsuite requires it.
 
712
    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
 
713
      BUILD_INCLUDED_LIBINTL=yes
 
714
    fi
 
715
 
 
716
    dnl Make all variables we use known to autoconf.
 
717
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
718
    AC_SUBST(USE_INCLUDED_LIBINTL)
 
719
    AC_SUBST(CATOBJEXT)
 
720
 
 
721
    dnl For backward compatibility. Some configure.ins may be using this.
 
722
    nls_cv_header_intl=
 
723
    nls_cv_header_libgt=
 
724
 
 
725
    dnl For backward compatibility. Some Makefiles may be using this.
 
726
    DATADIRNAME=share
 
727
    AC_SUBST(DATADIRNAME)
 
728
 
 
729
    dnl For backward compatibility. Some Makefiles may be using this.
 
730
    INSTOBJEXT=.mo
 
731
    AC_SUBST(INSTOBJEXT)
 
732
 
 
733
    dnl For backward compatibility. Some Makefiles may be using this.
 
734
    GENCAT=gencat
 
735
    AC_SUBST(GENCAT)
 
736
 
 
737
    dnl For backward compatibility. Some Makefiles may be using this.
 
738
    INTLOBJS=
 
739
    if test "$USE_INCLUDED_LIBINTL" = yes; then
 
740
      INTLOBJS="\$(GETTOBJS)"
 
741
    fi
 
742
    AC_SUBST(INTLOBJS)
 
743
 
 
744
    dnl Enable libtool support if the surrounding package wishes it.
 
745
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
 
746
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
 
747
  ])
 
748
 
 
749
  dnl For backward compatibility. Some Makefiles may be using this.
 
750
  INTLLIBS="$LIBINTL"
 
751
  AC_SUBST(INTLLIBS)
 
752
 
 
753
  dnl Make all documented variables known to autoconf.
 
754
  AC_SUBST(LIBINTL)
 
755
  AC_SUBST(LTLIBINTL)
 
756
  AC_SUBST(POSUB)
 
757
])
 
758
 
 
759
 
 
760
dnl Checks for special options needed on MacOS X.
 
761
dnl Defines INTL_MACOSX_LIBS.
 
762
AC_DEFUN([gt_INTL_MACOSX],
 
763
[
 
764
  dnl Check for API introduced in MacOS X 10.2.
 
765
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
 
766
    gt_cv_func_CFPreferencesCopyAppValue,
 
767
    [gt_save_LIBS="$LIBS"
 
768
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
769
     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
 
770
       [CFPreferencesCopyAppValue(NULL, NULL)],
 
771
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
 
772
       [gt_cv_func_CFPreferencesCopyAppValue=no])
 
773
     LIBS="$gt_save_LIBS"])
 
774
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
775
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
 
776
      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
 
777
  fi
 
778
  dnl Check for API introduced in MacOS X 10.3.
 
779
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
 
780
    [gt_save_LIBS="$LIBS"
 
781
     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
 
782
     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
 
783
       [gt_cv_func_CFLocaleCopyCurrent=yes],
 
784
       [gt_cv_func_CFLocaleCopyCurrent=no])
 
785
     LIBS="$gt_save_LIBS"])
 
786
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
787
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
 
788
      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
 
789
  fi
 
790
  INTL_MACOSX_LIBS=
 
791
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
792
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
 
793
  fi
 
794
  AC_SUBST([INTL_MACOSX_LIBS])
 
795
])
 
796
 
 
797
 
 
798
dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
 
799
m4_define([gt_NEEDS_INIT],
 
800
[
 
801
  m4_divert_text([DEFAULTS], [gt_needs=])
 
802
  m4_define([gt_NEEDS_INIT], [])
 
803
])
 
804
 
 
805
 
 
806
dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
 
807
AC_DEFUN([AM_GNU_GETTEXT_NEED],
 
808
[
 
809
  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
 
810
])
 
811
 
 
812
 
 
813
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 
814
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
 
815
# glibc21.m4 serial 3
 
816
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
 
817
dnl This file is free software; the Free Software Foundation
 
818
dnl gives unlimited permission to copy and/or distribute it,
 
819
dnl with or without modifications, as long as this notice is preserved.
 
820
 
 
821
# Test for the GNU C Library, version 2.1 or newer.
 
822
# From Bruno Haible.
 
823
 
 
824
AC_DEFUN([gl_GLIBC21],
 
825
  [
 
826
    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
 
827
      ac_cv_gnu_library_2_1,
 
828
      [AC_EGREP_CPP([Lucky GNU user],
 
829
        [
 
830
#include <features.h>
 
831
#ifdef __GNU_LIBRARY__
 
832
 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
 
833
  Lucky GNU user
 
834
 #endif
 
835
#endif
 
836
        ],
 
837
        ac_cv_gnu_library_2_1=yes,
 
838
        ac_cv_gnu_library_2_1=no)
 
839
      ]
 
840
    )
 
841
    AC_SUBST(GLIBC21)
 
842
    GLIBC21="$ac_cv_gnu_library_2_1"
 
843
  ]
 
844
)
 
845
# glibc2.m4 serial 1
 
846
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
 
847
dnl This file is free software; the Free Software Foundation
 
848
dnl gives unlimited permission to copy and/or distribute it,
 
849
dnl with or without modifications, as long as this notice is preserved.
 
850
 
 
851
# Test for the GNU C Library, version 2.0 or newer.
 
852
# From Bruno Haible.
 
853
 
 
854
AC_DEFUN([gt_GLIBC2],
 
855
  [
 
856
    AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
 
857
      ac_cv_gnu_library_2,
 
858
      [AC_EGREP_CPP([Lucky GNU user],
 
859
        [
 
860
#include <features.h>
 
861
#ifdef __GNU_LIBRARY__
 
862
 #if (__GLIBC__ >= 2)
 
863
  Lucky GNU user
 
864
 #endif
 
865
#endif
 
866
        ],
 
867
        ac_cv_gnu_library_2=yes,
 
868
        ac_cv_gnu_library_2=no)
 
869
      ]
 
870
    )
 
871
    AC_SUBST(GLIBC2)
 
872
    GLIBC2="$ac_cv_gnu_library_2"
 
873
  ]
 
874
)
 
875
# Configure paths for GLIB
 
876
# Owen Taylor     97-11-3
 
877
 
 
878
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
879
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
 
880
dnl gthread is specified in MODULES, pass to glib-config
 
881
dnl
 
882
AC_DEFUN([AM_PATH_GLIB],
 
883
[dnl 
 
884
dnl Get the cflags and libraries from the glib-config script
 
885
dnl
 
886
AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
 
887
            glib_config_prefix="$withval", glib_config_prefix="")
 
888
AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
 
889
            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
 
890
AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
 
891
                    , enable_glibtest=yes)
 
892
 
 
893
  if test x$glib_config_exec_prefix != x ; then
 
894
     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
 
895
     if test x${GLIB_CONFIG+set} != xset ; then
 
896
        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
 
897
     fi
 
898
  fi
 
899
  if test x$glib_config_prefix != x ; then
 
900
     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
 
901
     if test x${GLIB_CONFIG+set} != xset ; then
 
902
        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
 
903
     fi
 
904
  fi
 
905
 
 
906
  for module in . $4
 
907
  do
 
908
      case "$module" in
 
909
         gmodule) 
 
910
             glib_config_args="$glib_config_args gmodule"
 
911
         ;;
 
912
         gthread) 
 
913
             glib_config_args="$glib_config_args gthread"
 
914
         ;;
 
915
      esac
 
916
  done
 
917
 
 
918
  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
 
919
  min_glib_version=ifelse([$1], ,0.99.7,$1)
 
920
  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
 
921
  no_glib=""
 
922
  if test "$GLIB_CONFIG" = "no" ; then
 
923
    no_glib=yes
 
924
  else
 
925
    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
 
926
    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
 
927
    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
 
928
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
929
    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
 
930
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
931
    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
 
932
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
933
    if test "x$enable_glibtest" = "xyes" ; then
 
934
      ac_save_CFLAGS="$CFLAGS"
 
935
      ac_save_LIBS="$LIBS"
 
936
      CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
937
      LIBS="$GLIB_LIBS $LIBS"
 
938
dnl
 
939
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
 
940
dnl checks the results of glib-config to some extent
 
941
dnl
 
942
      rm -f conf.glibtest
 
943
      AC_TRY_RUN([
 
944
#include <glib.h>
 
945
#include <stdio.h>
 
946
#include <stdlib.h>
 
947
 
 
948
int 
 
949
main ()
 
950
{
 
951
  int major, minor, micro;
 
952
  char *tmp_version;
 
953
 
 
954
  system ("touch conf.glibtest");
 
955
 
 
956
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
957
  tmp_version = g_strdup("$min_glib_version");
 
958
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
959
     printf("%s, bad version string\n", "$min_glib_version");
 
960
     exit(1);
 
961
   }
 
962
 
 
963
  if ((glib_major_version != $glib_config_major_version) ||
 
964
      (glib_minor_version != $glib_config_minor_version) ||
 
965
      (glib_micro_version != $glib_config_micro_version))
 
966
    {
 
967
      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
 
968
             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
 
969
             glib_major_version, glib_minor_version, glib_micro_version);
 
970
      printf ("*** was found! If glib-config was correct, then it is best\n");
 
971
      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
 
972
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
973
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
974
      printf("*** required on your system.\n");
 
975
      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
 
976
      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
 
977
      printf("*** before re-running configure\n");
 
978
    } 
 
979
  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
 
980
           (glib_minor_version != GLIB_MINOR_VERSION) ||
 
981
           (glib_micro_version != GLIB_MICRO_VERSION))
 
982
    {
 
983
      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
 
984
             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
 
985
      printf("*** library (version %d.%d.%d)\n",
 
986
             glib_major_version, glib_minor_version, glib_micro_version);
 
987
    }
 
988
  else
 
989
    {
 
990
      if ((glib_major_version > major) ||
 
991
        ((glib_major_version == major) && (glib_minor_version > minor)) ||
 
992
        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
 
993
      {
 
994
        return 0;
 
995
       }
 
996
     else
 
997
      {
 
998
        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
 
999
               glib_major_version, glib_minor_version, glib_micro_version);
 
1000
        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
 
1001
               major, minor, micro);
 
1002
        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
 
1003
        printf("***\n");
 
1004
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
1005
        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
 
1006
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
1007
        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
 
1008
        printf("*** correct copy of glib-config. (In this case, you will have to\n");
 
1009
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
1010
        printf("*** so that the correct libraries are found at run-time))\n");
 
1011
      }
 
1012
    }
 
1013
  return 1;
 
1014
}
 
1015
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
1016
       CFLAGS="$ac_save_CFLAGS"
 
1017
       LIBS="$ac_save_LIBS"
 
1018
     fi
 
1019
  fi
 
1020
  if test "x$no_glib" = x ; then
 
1021
     AC_MSG_RESULT(yes)
 
1022
     ifelse([$2], , :, [$2])     
 
1023
  else
 
1024
     AC_MSG_RESULT(no)
 
1025
     if test "$GLIB_CONFIG" = "no" ; then
 
1026
       echo "*** The glib-config script installed by GLIB could not be found"
 
1027
       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
 
1028
       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
 
1029
       echo "*** full path to glib-config."
 
1030
     else
 
1031
       if test -f conf.glibtest ; then
 
1032
        :
 
1033
       else
 
1034
          echo "*** Could not run GLIB test program, checking why..."
 
1035
          CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
1036
          LIBS="$LIBS $GLIB_LIBS"
 
1037
          AC_TRY_LINK([
 
1038
#include <glib.h>
 
1039
#include <stdio.h>
 
1040
],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
 
1041
        [ echo "*** The test program compiled, but did not run. This usually means"
 
1042
          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
 
1043
          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
 
1044
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
1045
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
1046
          echo "*** is required on your system"
 
1047
          echo "***"
 
1048
          echo "*** If you have an old version installed, it is best to remove it, although"
 
1049
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 
1050
          echo "***"
 
1051
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
 
1052
          echo "*** came with the system with the command"
 
1053
          echo "***"
 
1054
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
 
1055
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
1056
          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
 
1057
          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
 
1058
          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
 
1059
          CFLAGS="$ac_save_CFLAGS"
 
1060
          LIBS="$ac_save_LIBS"
 
1061
       fi
 
1062
     fi
 
1063
     GLIB_CFLAGS=""
 
1064
     GLIB_LIBS=""
 
1065
     ifelse([$3], , :, [$3])
 
1066
  fi
 
1067
  AC_SUBST(GLIB_CFLAGS)
 
1068
  AC_SUBST(GLIB_LIBS)
 
1069
  rm -f conf.glibtest
 
1070
])
375
1071
# Configure paths for GTK+
376
1072
# Owen Taylor     97-11-3
377
1073
 
566
1262
  AC_SUBST(GTK_LIBS)
567
1263
  rm -f conf.gtktest
568
1264
])
 
1265
# iconv.m4 serial AM4 (gettext-0.11.3)
 
1266
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
 
1267
dnl This file is free software; the Free Software Foundation
 
1268
dnl gives unlimited permission to copy and/or distribute it,
 
1269
dnl with or without modifications, as long as this notice is preserved.
 
1270
 
 
1271
dnl From Bruno Haible.
 
1272
 
 
1273
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 
1274
[
 
1275
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
1276
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1277
  AC_REQUIRE([AC_LIB_RPATH])
 
1278
 
 
1279
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
1280
  dnl accordingly.
 
1281
  AC_LIB_LINKFLAGS_BODY([iconv])
 
1282
])
 
1283
 
 
1284
AC_DEFUN([AM_ICONV_LINK],
 
1285
[
 
1286
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
 
1287
  dnl those with the standalone portable GNU libiconv installed).
 
1288
 
 
1289
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
1290
  dnl accordingly.
 
1291
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
1292
 
 
1293
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
 
1294
  dnl because if the user has installed libiconv and not disabled its use
 
1295
  dnl via --without-libiconv-prefix, he wants to use it. The first
 
1296
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
 
1297
  am_save_CPPFLAGS="$CPPFLAGS"
 
1298
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
1299
 
 
1300
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
 
1301
    am_cv_func_iconv="no, consider installing GNU libiconv"
 
1302
    am_cv_lib_iconv=no
 
1303
    AC_TRY_LINK([#include <stdlib.h>
 
1304
#include <iconv.h>],
 
1305
      [iconv_t cd = iconv_open("","");
 
1306
       iconv(cd,NULL,NULL,NULL,NULL);
 
1307
       iconv_close(cd);],
 
1308
      am_cv_func_iconv=yes)
 
1309
    if test "$am_cv_func_iconv" != yes; then
 
1310
      am_save_LIBS="$LIBS"
 
1311
      LIBS="$LIBS $LIBICONV"
 
1312
      AC_TRY_LINK([#include <stdlib.h>
 
1313
#include <iconv.h>],
 
1314
        [iconv_t cd = iconv_open("","");
 
1315
         iconv(cd,NULL,NULL,NULL,NULL);
 
1316
         iconv_close(cd);],
 
1317
        am_cv_lib_iconv=yes
 
1318
        am_cv_func_iconv=yes)
 
1319
      LIBS="$am_save_LIBS"
 
1320
    fi
 
1321
  ])
 
1322
  if test "$am_cv_func_iconv" = yes; then
 
1323
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
 
1324
  fi
 
1325
  if test "$am_cv_lib_iconv" = yes; then
 
1326
    AC_MSG_CHECKING([how to link with libiconv])
 
1327
    AC_MSG_RESULT([$LIBICONV])
 
1328
  else
 
1329
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
 
1330
    dnl either.
 
1331
    CPPFLAGS="$am_save_CPPFLAGS"
 
1332
    LIBICONV=
 
1333
    LTLIBICONV=
 
1334
  fi
 
1335
  AC_SUBST(LIBICONV)
 
1336
  AC_SUBST(LTLIBICONV)
 
1337
])
 
1338
 
 
1339
AC_DEFUN([AM_ICONV],
 
1340
[
 
1341
  AM_ICONV_LINK
 
1342
  if test "$am_cv_func_iconv" = yes; then
 
1343
    AC_MSG_CHECKING([for iconv declaration])
 
1344
    AC_CACHE_VAL(am_cv_proto_iconv, [
 
1345
      AC_TRY_COMPILE([
 
1346
#include <stdlib.h>
 
1347
#include <iconv.h>
 
1348
extern
 
1349
#ifdef __cplusplus
 
1350
"C"
 
1351
#endif
 
1352
#if defined(__STDC__) || defined(__cplusplus)
 
1353
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 
1354
#else
 
1355
size_t iconv();
 
1356
#endif
 
1357
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
 
1358
      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
 
1359
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
 
1360
    AC_MSG_RESULT([$]{ac_t:-
 
1361
         }[$]am_cv_proto_iconv)
 
1362
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
 
1363
      [Define as const if the declaration of iconv() needs const.])
 
1364
  fi
 
1365
])
 
1366
# intdiv0.m4 serial 1 (gettext-0.11.3)
 
1367
dnl Copyright (C) 2002 Free Software Foundation, Inc.
 
1368
dnl This file is free software; the Free Software Foundation
 
1369
dnl gives unlimited permission to copy and/or distribute it,
 
1370
dnl with or without modifications, as long as this notice is preserved.
 
1371
 
 
1372
dnl From Bruno Haible.
 
1373
 
 
1374
AC_DEFUN([gt_INTDIV0],
 
1375
[
 
1376
  AC_REQUIRE([AC_PROG_CC])dnl
 
1377
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1378
 
 
1379
  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
 
1380
    gt_cv_int_divbyzero_sigfpe,
 
1381
    [
 
1382
      AC_TRY_RUN([
 
1383
#include <stdlib.h>
 
1384
#include <signal.h>
 
1385
 
 
1386
static void
 
1387
#ifdef __cplusplus
 
1388
sigfpe_handler (int sig)
 
1389
#else
 
1390
sigfpe_handler (sig) int sig;
 
1391
#endif
 
1392
{
 
1393
  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
 
1394
  exit (sig != SIGFPE);
 
1395
}
 
1396
 
 
1397
int x = 1;
 
1398
int y = 0;
 
1399
int z;
 
1400
int nan;
 
1401
 
 
1402
int main ()
 
1403
{
 
1404
  signal (SIGFPE, sigfpe_handler);
 
1405
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
 
1406
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
 
1407
  signal (SIGTRAP, sigfpe_handler);
 
1408
#endif
 
1409
/* Linux/SPARC yields signal SIGILL.  */
 
1410
#if defined (__sparc__) && defined (__linux__)
 
1411
  signal (SIGILL, sigfpe_handler);
 
1412
#endif
 
1413
 
 
1414
  z = x / y;
 
1415
  nan = y / y;
 
1416
  exit (1);
 
1417
}
 
1418
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
 
1419
        [
 
1420
          # Guess based on the CPU.
 
1421
          case "$host_cpu" in
 
1422
            alpha* | i[34567]86 | m68k | s390*)
 
1423
              gt_cv_int_divbyzero_sigfpe="guessing yes";;
 
1424
            *)
 
1425
              gt_cv_int_divbyzero_sigfpe="guessing no";;
 
1426
          esac
 
1427
        ])
 
1428
    ])
 
1429
  case "$gt_cv_int_divbyzero_sigfpe" in
 
1430
    *yes) value=1;;
 
1431
    *) value=0;;
 
1432
  esac
 
1433
  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
 
1434
    [Define if integer division by zero raises signal SIGFPE.])
 
1435
])
 
1436
# intldir.m4 serial 1 (gettext-0.16)
 
1437
dnl Copyright (C) 2006 Free Software Foundation, Inc.
 
1438
dnl This file is free software; the Free Software Foundation
 
1439
dnl gives unlimited permission to copy and/or distribute it,
 
1440
dnl with or without modifications, as long as this notice is preserved.
 
1441
dnl
 
1442
dnl This file can can be used in projects which are not available under
 
1443
dnl the GNU General Public License or the GNU Library General Public
 
1444
dnl License but which still want to provide support for the GNU gettext
 
1445
dnl functionality.
 
1446
dnl Please note that the actual code of the GNU gettext library is covered
 
1447
dnl by the GNU Library General Public License, and the rest of the GNU
 
1448
dnl gettext package package is covered by the GNU General Public License.
 
1449
dnl They are *not* in the public domain.
 
1450
 
 
1451
AC_PREREQ(2.52)
 
1452
 
 
1453
dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory.
 
1454
AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], [])
 
1455
# intl.m4 serial 3 (gettext-0.16)
 
1456
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
 
1457
dnl This file is free software; the Free Software Foundation
 
1458
dnl gives unlimited permission to copy and/or distribute it,
 
1459
dnl with or without modifications, as long as this notice is preserved.
 
1460
dnl
 
1461
dnl This file can can be used in projects which are not available under
 
1462
dnl the GNU General Public License or the GNU Library General Public
 
1463
dnl License but which still want to provide support for the GNU gettext
 
1464
dnl functionality.
 
1465
dnl Please note that the actual code of the GNU gettext library is covered
 
1466
dnl by the GNU Library General Public License, and the rest of the GNU
 
1467
dnl gettext package package is covered by the GNU General Public License.
 
1468
dnl They are *not* in the public domain.
 
1469
 
 
1470
dnl Authors:
 
1471
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1472
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006.
 
1473
 
 
1474
AC_PREREQ(2.52)
 
1475
 
 
1476
dnl Checks for all prerequisites of the intl subdirectory,
 
1477
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
 
1478
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
 
1479
AC_DEFUN([AM_INTL_SUBDIR],
 
1480
[
 
1481
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
1482
  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
 
1483
  AC_REQUIRE([AC_PROG_CC])dnl
 
1484
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1485
  AC_REQUIRE([gt_GLIBC2])dnl
 
1486
  AC_REQUIRE([AC_PROG_RANLIB])dnl
 
1487
  AC_REQUIRE([gl_VISIBILITY])dnl
 
1488
  AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
 
1489
  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
 
1490
  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
 
1491
  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
 
1492
  AC_REQUIRE([gt_TYPE_WINT_T])dnl
 
1493
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
1494
  AC_REQUIRE([gt_TYPE_INTMAX_T])
 
1495
  AC_REQUIRE([gt_PRINTF_POSIX])
 
1496
  AC_REQUIRE([gl_GLIBC21])dnl
 
1497
  AC_REQUIRE([gl_XSIZE])dnl
 
1498
  AC_REQUIRE([gt_INTL_MACOSX])dnl
 
1499
 
 
1500
  AC_CHECK_TYPE([ptrdiff_t], ,
 
1501
    [AC_DEFINE([ptrdiff_t], [long],
 
1502
       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
 
1503
    ])
 
1504
  AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
 
1505
  AC_CHECK_FUNCS([asprintf fwprintf putenv setenv setlocale snprintf wcslen])
 
1506
 
 
1507
  dnl Use the _snprintf function only if it is declared (because on NetBSD it
 
1508
  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
 
1509
  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
 
1510
  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
 
1511
 
 
1512
  dnl Use the *_unlocked functions only if they are declared.
 
1513
  dnl (because some of them were defined without being declared in Solaris
 
1514
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
 
1515
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
 
1516
  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
 
1517
  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
 
1518
 
 
1519
  case $gt_cv_func_printf_posix in
 
1520
    *yes) HAVE_POSIX_PRINTF=1 ;;
 
1521
    *) HAVE_POSIX_PRINTF=0 ;;
 
1522
  esac
 
1523
  AC_SUBST([HAVE_POSIX_PRINTF])
 
1524
  if test "$ac_cv_func_asprintf" = yes; then
 
1525
    HAVE_ASPRINTF=1
 
1526
  else
 
1527
    HAVE_ASPRINTF=0
 
1528
  fi
 
1529
  AC_SUBST([HAVE_ASPRINTF])
 
1530
  if test "$ac_cv_func_snprintf" = yes; then
 
1531
    HAVE_SNPRINTF=1
 
1532
  else
 
1533
    HAVE_SNPRINTF=0
 
1534
  fi
 
1535
  AC_SUBST([HAVE_SNPRINTF])
 
1536
  if test "$ac_cv_func_wprintf" = yes; then
 
1537
    HAVE_WPRINTF=1
 
1538
  else
 
1539
    HAVE_WPRINTF=0
 
1540
  fi
 
1541
  AC_SUBST([HAVE_WPRINTF])
 
1542
 
 
1543
  AM_LANGINFO_CODESET
 
1544
  gt_LC_MESSAGES
 
1545
 
 
1546
  dnl Compilation on mingw and Cygwin needs special Makefile rules, because
 
1547
  dnl 1. when we install a shared library, we must arrange to export
 
1548
  dnl    auxiliary pointer variables for every exported variable,
 
1549
  dnl 2. when we install a shared library and a static library simultaneously,
 
1550
  dnl    the include file specifies __declspec(dllimport) and therefore we
 
1551
  dnl    must arrange to define the auxiliary pointer variables for the
 
1552
  dnl    exported variables _also_ in the static library.
 
1553
  if test "$enable_shared" = yes; then
 
1554
    case "$host_os" in
 
1555
      cygwin*) is_woe32dll=yes ;;
 
1556
      *) is_woe32dll=no ;;
 
1557
    esac
 
1558
  else
 
1559
    is_woe32dll=no
 
1560
  fi
 
1561
  WOE32DLL=$is_woe32dll
 
1562
  AC_SUBST([WOE32DLL])
 
1563
 
 
1564
  dnl Rename some macros and functions used for locking.
 
1565
  AH_BOTTOM([
 
1566
#define __libc_lock_t                   gl_lock_t
 
1567
#define __libc_lock_define              gl_lock_define
 
1568
#define __libc_lock_define_initialized  gl_lock_define_initialized
 
1569
#define __libc_lock_init                gl_lock_init
 
1570
#define __libc_lock_lock                gl_lock_lock
 
1571
#define __libc_lock_unlock              gl_lock_unlock
 
1572
#define __libc_lock_recursive_t                   gl_recursive_lock_t
 
1573
#define __libc_lock_define_recursive              gl_recursive_lock_define
 
1574
#define __libc_lock_define_initialized_recursive  gl_recursive_lock_define_initialized
 
1575
#define __libc_lock_init_recursive                gl_recursive_lock_init
 
1576
#define __libc_lock_lock_recursive                gl_recursive_lock_lock
 
1577
#define __libc_lock_unlock_recursive              gl_recursive_lock_unlock
 
1578
#define glthread_in_use  libintl_thread_in_use
 
1579
#define glthread_lock_init     libintl_lock_init
 
1580
#define glthread_lock_lock     libintl_lock_lock
 
1581
#define glthread_lock_unlock   libintl_lock_unlock
 
1582
#define glthread_lock_destroy  libintl_lock_destroy
 
1583
#define glthread_rwlock_init     libintl_rwlock_init
 
1584
#define glthread_rwlock_rdlock   libintl_rwlock_rdlock
 
1585
#define glthread_rwlock_wrlock   libintl_rwlock_wrlock
 
1586
#define glthread_rwlock_unlock   libintl_rwlock_unlock
 
1587
#define glthread_rwlock_destroy  libintl_rwlock_destroy
 
1588
#define glthread_recursive_lock_init     libintl_recursive_lock_init
 
1589
#define glthread_recursive_lock_lock     libintl_recursive_lock_lock
 
1590
#define glthread_recursive_lock_unlock   libintl_recursive_lock_unlock
 
1591
#define glthread_recursive_lock_destroy  libintl_recursive_lock_destroy
 
1592
#define glthread_once                 libintl_once
 
1593
#define glthread_once_call            libintl_once_call
 
1594
#define glthread_once_singlethreaded  libintl_once_singlethreaded
 
1595
])
 
1596
])
 
1597
 
 
1598
 
 
1599
dnl Checks for the core files of the intl subdirectory:
 
1600
dnl   dcigettext.c
 
1601
dnl   eval-plural.h
 
1602
dnl   explodename.c
 
1603
dnl   finddomain.c
 
1604
dnl   gettextP.h
 
1605
dnl   gmo.h
 
1606
dnl   hash-string.h hash-string.c
 
1607
dnl   l10nflist.c
 
1608
dnl   libgnuintl.h.in (except the *printf stuff)
 
1609
dnl   loadinfo.h
 
1610
dnl   loadmsgcat.c
 
1611
dnl   localealias.c
 
1612
dnl   log.c
 
1613
dnl   plural-exp.h plural-exp.c
 
1614
dnl   plural.y
 
1615
dnl Used by libglocale.
 
1616
AC_DEFUN([gt_INTL_SUBDIR_CORE],
 
1617
[
 
1618
  AC_REQUIRE([AC_C_INLINE])dnl
 
1619
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
1620
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
1621
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
1622
  AC_REQUIRE([AC_FUNC_MMAP])dnl
 
1623
  AC_REQUIRE([gt_INTDIV0])dnl
 
1624
  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
 
1625
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
 
1626
  AC_REQUIRE([gl_LOCK])dnl
 
1627
 
 
1628
  AC_TRY_LINK(
 
1629
    [int foo (int a) { a = __builtin_expect (a, 10); return a == 10 ? 0 : 1; }],
 
1630
    [],
 
1631
    [AC_DEFINE([HAVE_BUILTIN_EXPECT], 1,
 
1632
       [Define to 1 if the compiler understands __builtin_expect.])])
 
1633
 
 
1634
  AC_CHECK_HEADERS([argz.h inttypes.h limits.h unistd.h sys/param.h])
 
1635
  AC_CHECK_FUNCS([getcwd getegid geteuid getgid getuid mempcpy munmap \
 
1636
    stpcpy strcasecmp strdup strtoul tsearch argz_count argz_stringify \
 
1637
    argz_next __fsetlocking])
 
1638
 
 
1639
  dnl Use the *_unlocked functions only if they are declared.
 
1640
  dnl (because some of them were defined without being declared in Solaris
 
1641
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
 
1642
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
 
1643
  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
 
1644
  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
 
1645
  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
 
1646
 
 
1647
  AM_ICONV
 
1648
 
 
1649
  dnl glibc >= 2.4 has a NL_LOCALE_NAME macro when _GNU_SOURCE is defined,
 
1650
  dnl and a _NL_LOCALE_NAME macro always.
 
1651
  AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
 
1652
    [AC_TRY_LINK([#include <langinfo.h>
 
1653
#include <locale.h>],
 
1654
      [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
 
1655
      gt_cv_nl_locale_name=yes,
 
1656
      gt_cv_nl_locale_name=no)
 
1657
    ])
 
1658
  if test $gt_cv_nl_locale_name = yes; then
 
1659
    AC_DEFINE(HAVE_NL_LOCALE_NAME, 1,
 
1660
      [Define if you have <langinfo.h> and it defines the NL_LOCALE_NAME macro if _GNU_SOURCE is defined.])
 
1661
  fi
 
1662
 
 
1663
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
 
1664
  dnl because plural.y uses bison specific features. It requires at least
 
1665
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
 
1666
  dnl compile.
 
1667
  dnl bison is only needed for the maintainer (who touches plural.y). But in
 
1668
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
 
1669
  dnl the rule in general Makefile. Now, some people carelessly touch the
 
1670
  dnl files or have a broken "make" program, hence the plural.c rule will
 
1671
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
 
1672
  dnl present or too old.
 
1673
  AC_CHECK_PROGS([INTLBISON], [bison])
 
1674
  if test -z "$INTLBISON"; then
 
1675
    ac_verc_fail=yes
 
1676
  else
 
1677
    dnl Found it, now check the version.
 
1678
    AC_MSG_CHECKING([version of bison])
 
1679
changequote(<<,>>)dnl
 
1680
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
 
1681
    case $ac_prog_version in
 
1682
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
 
1683
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
 
1684
changequote([,])dnl
 
1685
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
 
1686
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
1687
    esac
 
1688
    AC_MSG_RESULT([$ac_prog_version])
 
1689
  fi
 
1690
  if test $ac_verc_fail = yes; then
 
1691
    INTLBISON=:
 
1692
  fi
 
1693
])
 
1694
 
 
1695
 
 
1696
dnl gt_CHECK_DECL(FUNC, INCLUDES)
 
1697
dnl Check whether a function is declared.
 
1698
AC_DEFUN([gt_CHECK_DECL],
 
1699
[
 
1700
  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
 
1701
    [AC_TRY_COMPILE([$2], [
 
1702
#ifndef $1
 
1703
  char *p = (char *) $1;
 
1704
#endif
 
1705
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
 
1706
  if test $ac_cv_have_decl_$1 = yes; then
 
1707
    gt_value=1
 
1708
  else
 
1709
    gt_value=0
 
1710
  fi
 
1711
  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
 
1712
    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
 
1713
])
 
1714
# intmax.m4 serial 3 (gettext-0.16)
 
1715
dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
 
1716
dnl This file is free software; the Free Software Foundation
 
1717
dnl gives unlimited permission to copy and/or distribute it,
 
1718
dnl with or without modifications, as long as this notice is preserved.
 
1719
 
 
1720
dnl From Bruno Haible.
 
1721
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
 
1722
dnl find a replacement if it is lacking.
 
1723
 
 
1724
AC_DEFUN([gt_TYPE_INTMAX_T],
 
1725
[
 
1726
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
1727
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
1728
  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
 
1729
    [AC_TRY_COMPILE([
 
1730
#include <stddef.h>
 
1731
#include <stdlib.h>
 
1732
#if HAVE_STDINT_H_WITH_UINTMAX
 
1733
#include <stdint.h>
 
1734
#endif
 
1735
#if HAVE_INTTYPES_H_WITH_UINTMAX
 
1736
#include <inttypes.h>
 
1737
#endif
 
1738
],     [intmax_t x = -1;
 
1739
        return !x;],
 
1740
       gt_cv_c_intmax_t=yes,
 
1741
       gt_cv_c_intmax_t=no)])
 
1742
  if test $gt_cv_c_intmax_t = yes; then
 
1743
    AC_DEFINE(HAVE_INTMAX_T, 1,
 
1744
      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
 
1745
  fi
 
1746
])
 
1747
# inttypes_h.m4 serial 7
 
1748
dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
 
1749
dnl This file is free software; the Free Software Foundation
 
1750
dnl gives unlimited permission to copy and/or distribute it,
 
1751
dnl with or without modifications, as long as this notice is preserved.
 
1752
 
 
1753
dnl From Paul Eggert.
 
1754
 
 
1755
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
 
1756
# doesn't clash with <sys/types.h>, and declares uintmax_t.
 
1757
 
 
1758
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 
1759
[
 
1760
  AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
 
1761
  [AC_TRY_COMPILE(
 
1762
    [#include <sys/types.h>
 
1763
#include <inttypes.h>],
 
1764
    [uintmax_t i = (uintmax_t) -1; return !i;],
 
1765
    gl_cv_header_inttypes_h=yes,
 
1766
    gl_cv_header_inttypes_h=no)])
 
1767
  if test $gl_cv_header_inttypes_h = yes; then
 
1768
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
 
1769
      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
 
1770
       and declares uintmax_t. ])
 
1771
  fi
 
1772
])
 
1773
# inttypes-pri.m4 serial 4 (gettext-0.16)
 
1774
dnl Copyright (C) 1997-2002, 2006 Free Software Foundation, Inc.
 
1775
dnl This file is free software; the Free Software Foundation
 
1776
dnl gives unlimited permission to copy and/or distribute it,
 
1777
dnl with or without modifications, as long as this notice is preserved.
 
1778
 
 
1779
dnl From Bruno Haible.
 
1780
 
 
1781
AC_PREREQ(2.52)
 
1782
 
 
1783
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
 
1784
# macros to non-string values.  This is the case on AIX 4.3.3.
 
1785
 
 
1786
AC_DEFUN([gt_INTTYPES_PRI],
 
1787
[
 
1788
  AC_CHECK_HEADERS([inttypes.h])
 
1789
  if test $ac_cv_header_inttypes_h = yes; then
 
1790
    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
 
1791
      gt_cv_inttypes_pri_broken,
 
1792
      [
 
1793
        AC_TRY_COMPILE([#include <inttypes.h>
 
1794
#ifdef PRId32
 
1795
char *p = PRId32;
 
1796
#endif
 
1797
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
 
1798
      ])
 
1799
  fi
 
1800
  if test "$gt_cv_inttypes_pri_broken" = yes; then
 
1801
    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
 
1802
      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
 
1803
    PRI_MACROS_BROKEN=1
 
1804
  else
 
1805
    PRI_MACROS_BROKEN=0
 
1806
  fi
 
1807
  AC_SUBST([PRI_MACROS_BROKEN])
 
1808
])
 
1809
# lcmessage.m4 serial 4 (gettext-0.14.2)
 
1810
dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
 
1811
dnl This file is free software; the Free Software Foundation
 
1812
dnl gives unlimited permission to copy and/or distribute it,
 
1813
dnl with or without modifications, as long as this notice is preserved.
 
1814
dnl
 
1815
dnl This file can can be used in projects which are not available under
 
1816
dnl the GNU General Public License or the GNU Library General Public
 
1817
dnl License but which still want to provide support for the GNU gettext
 
1818
dnl functionality.
 
1819
dnl Please note that the actual code of the GNU gettext library is covered
 
1820
dnl by the GNU Library General Public License, and the rest of the GNU
 
1821
dnl gettext package package is covered by the GNU General Public License.
 
1822
dnl They are *not* in the public domain.
 
1823
 
 
1824
dnl Authors:
 
1825
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
 
1826
 
 
1827
# Check whether LC_MESSAGES is available in <locale.h>.
 
1828
 
 
1829
AC_DEFUN([gt_LC_MESSAGES],
 
1830
[
 
1831
  AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
 
1832
    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
1833
       gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
 
1834
  if test $gt_cv_val_LC_MESSAGES = yes; then
 
1835
    AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1836
      [Define if your <locale.h> file defines LC_MESSAGES.])
 
1837
  fi
 
1838
])
 
1839
# lib-ld.m4 serial 3 (gettext-0.13)
 
1840
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
 
1841
dnl This file is free software; the Free Software Foundation
 
1842
dnl gives unlimited permission to copy and/or distribute it,
 
1843
dnl with or without modifications, as long as this notice is preserved.
 
1844
 
 
1845
dnl Subroutines of libtool.m4,
 
1846
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
 
1847
dnl with libtool.m4.
 
1848
 
 
1849
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
1850
AC_DEFUN([AC_LIB_PROG_LD_GNU],
 
1851
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 
1852
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
1853
case `$LD -v 2>&1 </dev/null` in
 
1854
*GNU* | *'with BFD'*)
 
1855
  acl_cv_prog_gnu_ld=yes ;;
 
1856
*)
 
1857
  acl_cv_prog_gnu_ld=no ;;
 
1858
esac])
 
1859
with_gnu_ld=$acl_cv_prog_gnu_ld
 
1860
])
 
1861
 
 
1862
dnl From libtool-1.4. Sets the variable LD.
 
1863
AC_DEFUN([AC_LIB_PROG_LD],
 
1864
[AC_ARG_WITH(gnu-ld,
 
1865
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
1866
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
1867
AC_REQUIRE([AC_PROG_CC])dnl
 
1868
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1869
# Prepare PATH_SEPARATOR.
 
1870
# The user is always right.
 
1871
if test "${PATH_SEPARATOR+set}" != set; then
 
1872
  echo "#! /bin/sh" >conf$$.sh
 
1873
  echo  "exit 0"   >>conf$$.sh
 
1874
  chmod +x conf$$.sh
 
1875
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
1876
    PATH_SEPARATOR=';'
 
1877
  else
 
1878
    PATH_SEPARATOR=:
 
1879
  fi
 
1880
  rm -f conf$$.sh
 
1881
fi
 
1882
ac_prog=ld
 
1883
if test "$GCC" = yes; then
 
1884
  # Check if gcc -print-prog-name=ld gives a path.
 
1885
  AC_MSG_CHECKING([for ld used by GCC])
 
1886
  case $host in
 
1887
  *-*-mingw*)
 
1888
    # gcc leaves a trailing carriage return which upsets mingw
 
1889
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
1890
  *)
 
1891
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
1892
  esac
 
1893
  case $ac_prog in
 
1894
    # Accept absolute paths.
 
1895
    [[\\/]* | [A-Za-z]:[\\/]*)]
 
1896
      [re_direlt='/[^/][^/]*/\.\./']
 
1897
      # Canonicalize the path of ld
 
1898
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
1899
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
1900
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
1901
      done
 
1902
      test -z "$LD" && LD="$ac_prog"
 
1903
      ;;
 
1904
  "")
 
1905
    # If it fails, then pretend we aren't using GCC.
 
1906
    ac_prog=ld
 
1907
    ;;
 
1908
  *)
 
1909
    # If it is relative, then search for the first ld in PATH.
 
1910
    with_gnu_ld=unknown
 
1911
    ;;
 
1912
  esac
 
1913
elif test "$with_gnu_ld" = yes; then
 
1914
  AC_MSG_CHECKING([for GNU ld])
 
1915
else
 
1916
  AC_MSG_CHECKING([for non-GNU ld])
 
1917
fi
 
1918
AC_CACHE_VAL(acl_cv_path_LD,
 
1919
[if test -z "$LD"; then
 
1920
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
1921
  for ac_dir in $PATH; do
 
1922
    test -z "$ac_dir" && ac_dir=.
 
1923
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
1924
      acl_cv_path_LD="$ac_dir/$ac_prog"
 
1925
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
1926
      # but apparently some GNU ld's only accept -v.
 
1927
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
1928
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
 
1929
      *GNU* | *'with BFD'*)
 
1930
        test "$with_gnu_ld" != no && break ;;
 
1931
      *)
 
1932
        test "$with_gnu_ld" != yes && break ;;
 
1933
      esac
 
1934
    fi
 
1935
  done
 
1936
  IFS="$ac_save_ifs"
 
1937
else
 
1938
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
 
1939
fi])
 
1940
LD="$acl_cv_path_LD"
 
1941
if test -n "$LD"; then
 
1942
  AC_MSG_RESULT($LD)
 
1943
else
 
1944
  AC_MSG_RESULT(no)
 
1945
fi
 
1946
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
1947
AC_LIB_PROG_LD_GNU
 
1948
])
 
1949
# lib-link.m4 serial 9 (gettext-0.16)
 
1950
dnl Copyright (C) 2001-2006 Free Software Foundation, Inc.
 
1951
dnl This file is free software; the Free Software Foundation
 
1952
dnl gives unlimited permission to copy and/or distribute it,
 
1953
dnl with or without modifications, as long as this notice is preserved.
 
1954
 
 
1955
dnl From Bruno Haible.
 
1956
 
 
1957
AC_PREREQ(2.50)
 
1958
 
 
1959
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 
1960
dnl the libraries corresponding to explicit and implicit dependencies.
 
1961
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 
1962
dnl augments the CPPFLAGS variable.
 
1963
AC_DEFUN([AC_LIB_LINKFLAGS],
 
1964
[
 
1965
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1966
  AC_REQUIRE([AC_LIB_RPATH])
 
1967
  define([Name],[translit([$1],[./-], [___])])
 
1968
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
1969
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
1970
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
 
1971
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
1972
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
 
1973
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
 
1974
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
1975
  ])
 
1976
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
 
1977
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
 
1978
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
1979
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
1980
  AC_SUBST([LIB]NAME)
 
1981
  AC_SUBST([LTLIB]NAME)
 
1982
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
 
1983
  dnl results of this search when this library appears as a dependency.
 
1984
  HAVE_LIB[]NAME=yes
 
1985
  undefine([Name])
 
1986
  undefine([NAME])
 
1987
])
 
1988
 
 
1989
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 
1990
dnl searches for libname and the libraries corresponding to explicit and
 
1991
dnl implicit dependencies, together with the specified include files and
 
1992
dnl the ability to compile and link the specified testcode. If found, it
 
1993
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
 
1994
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
1995
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 
1996
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
1997
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
1998
[
 
1999
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
2000
  AC_REQUIRE([AC_LIB_RPATH])
 
2001
  define([Name],[translit([$1],[./-], [___])])
 
2002
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
2003
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
2004
 
 
2005
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
 
2006
  dnl accordingly.
 
2007
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
2008
 
 
2009
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
 
2010
  dnl because if the user has installed lib[]Name and not disabled its use
 
2011
  dnl via --without-lib[]Name-prefix, he wants to use it.
 
2012
  ac_save_CPPFLAGS="$CPPFLAGS"
 
2013
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
2014
 
 
2015
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
 
2016
    ac_save_LIBS="$LIBS"
 
2017
    LIBS="$LIBS $LIB[]NAME"
 
2018
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
 
2019
    LIBS="$ac_save_LIBS"
 
2020
  ])
 
2021
  if test "$ac_cv_lib[]Name" = yes; then
 
2022
    HAVE_LIB[]NAME=yes
 
2023
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
 
2024
    AC_MSG_CHECKING([how to link with lib[]$1])
 
2025
    AC_MSG_RESULT([$LIB[]NAME])
 
2026
  else
 
2027
    HAVE_LIB[]NAME=no
 
2028
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
 
2029
    dnl $INC[]NAME either.
 
2030
    CPPFLAGS="$ac_save_CPPFLAGS"
 
2031
    LIB[]NAME=
 
2032
    LTLIB[]NAME=
 
2033
  fi
 
2034
  AC_SUBST([HAVE_LIB]NAME)
 
2035
  AC_SUBST([LIB]NAME)
 
2036
  AC_SUBST([LTLIB]NAME)
 
2037
  undefine([Name])
 
2038
  undefine([NAME])
 
2039
])
 
2040
 
 
2041
dnl Determine the platform dependent parameters needed to use rpath:
 
2042
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
 
2043
dnl hardcode_direct, hardcode_minus_L.
 
2044
AC_DEFUN([AC_LIB_RPATH],
 
2045
[
 
2046
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
 
2047
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
 
2048
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
 
2049
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
 
2050
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
 
2051
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
 
2052
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
 
2053
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
 
2054
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
 
2055
    . ./conftest.sh
 
2056
    rm -f ./conftest.sh
 
2057
    acl_cv_rpath=done
 
2058
  ])
 
2059
  wl="$acl_cv_wl"
 
2060
  libext="$acl_cv_libext"
 
2061
  shlibext="$acl_cv_shlibext"
 
2062
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
2063
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
2064
  hardcode_direct="$acl_cv_hardcode_direct"
 
2065
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
2066
  dnl Determine whether the user wants rpath handling at all.
 
2067
  AC_ARG_ENABLE(rpath,
 
2068
    [  --disable-rpath         do not hardcode runtime library paths],
 
2069
    :, enable_rpath=yes)
 
2070
])
 
2071
 
 
2072
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 
2073
dnl the libraries corresponding to explicit and implicit dependencies.
 
2074
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
2075
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 
2076
[
 
2077
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
2078
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
2079
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
2080
  dnl By default, look in $includedir and $libdir.
 
2081
  use_additional=yes
 
2082
  AC_LIB_WITH_FINAL_PREFIX([
 
2083
    eval additional_includedir=\"$includedir\"
 
2084
    eval additional_libdir=\"$libdir\"
 
2085
  ])
 
2086
  AC_LIB_ARG_WITH([lib$1-prefix],
 
2087
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
 
2088
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
 
2089
[
 
2090
    if test "X$withval" = "Xno"; then
 
2091
      use_additional=no
 
2092
    else
 
2093
      if test "X$withval" = "X"; then
 
2094
        AC_LIB_WITH_FINAL_PREFIX([
 
2095
          eval additional_includedir=\"$includedir\"
 
2096
          eval additional_libdir=\"$libdir\"
 
2097
        ])
 
2098
      else
 
2099
        additional_includedir="$withval/include"
 
2100
        additional_libdir="$withval/$acl_libdirstem"
 
2101
      fi
 
2102
    fi
 
2103
])
 
2104
  dnl Search the library and its dependencies in $additional_libdir and
 
2105
  dnl $LDFLAGS. Using breadth-first-seach.
 
2106
  LIB[]NAME=
 
2107
  LTLIB[]NAME=
 
2108
  INC[]NAME=
 
2109
  rpathdirs=
 
2110
  ltrpathdirs=
 
2111
  names_already_handled=
 
2112
  names_next_round='$1 $2'
 
2113
  while test -n "$names_next_round"; do
 
2114
    names_this_round="$names_next_round"
 
2115
    names_next_round=
 
2116
    for name in $names_this_round; do
 
2117
      already_handled=
 
2118
      for n in $names_already_handled; do
 
2119
        if test "$n" = "$name"; then
 
2120
          already_handled=yes
 
2121
          break
 
2122
        fi
 
2123
      done
 
2124
      if test -z "$already_handled"; then
 
2125
        names_already_handled="$names_already_handled $name"
 
2126
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
 
2127
        dnl or AC_LIB_HAVE_LINKFLAGS call.
 
2128
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
2129
        eval value=\"\$HAVE_LIB$uppername\"
 
2130
        if test -n "$value"; then
 
2131
          if test "$value" = yes; then
 
2132
            eval value=\"\$LIB$uppername\"
 
2133
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
 
2134
            eval value=\"\$LTLIB$uppername\"
 
2135
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
 
2136
          else
 
2137
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
 
2138
            dnl that this library doesn't exist. So just drop it.
 
2139
            :
 
2140
          fi
 
2141
        else
 
2142
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
 
2143
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
 
2144
          found_dir=
 
2145
          found_la=
 
2146
          found_so=
 
2147
          found_a=
 
2148
          if test $use_additional = yes; then
 
2149
            if test -n "$shlibext" \
 
2150
               && { test -f "$additional_libdir/lib$name.$shlibext" \
 
2151
                    || { test "$shlibext" = dll \
 
2152
                         && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
 
2153
              found_dir="$additional_libdir"
 
2154
              if test -f "$additional_libdir/lib$name.$shlibext"; then
 
2155
                found_so="$additional_libdir/lib$name.$shlibext"
 
2156
              else
 
2157
                found_so="$additional_libdir/lib$name.dll.a"
 
2158
              fi
 
2159
              if test -f "$additional_libdir/lib$name.la"; then
 
2160
                found_la="$additional_libdir/lib$name.la"
 
2161
              fi
 
2162
            else
 
2163
              if test -f "$additional_libdir/lib$name.$libext"; then
 
2164
                found_dir="$additional_libdir"
 
2165
                found_a="$additional_libdir/lib$name.$libext"
 
2166
                if test -f "$additional_libdir/lib$name.la"; then
 
2167
                  found_la="$additional_libdir/lib$name.la"
 
2168
                fi
 
2169
              fi
 
2170
            fi
 
2171
          fi
 
2172
          if test "X$found_dir" = "X"; then
 
2173
            for x in $LDFLAGS $LTLIB[]NAME; do
 
2174
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2175
              case "$x" in
 
2176
                -L*)
 
2177
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
 
2178
                  if test -n "$shlibext" \
 
2179
                     && { test -f "$dir/lib$name.$shlibext" \
 
2180
                          || { test "$shlibext" = dll \
 
2181
                               && test -f "$dir/lib$name.dll.a"; }; }; then
 
2182
                    found_dir="$dir"
 
2183
                    if test -f "$dir/lib$name.$shlibext"; then
 
2184
                      found_so="$dir/lib$name.$shlibext"
 
2185
                    else
 
2186
                      found_so="$dir/lib$name.dll.a"
 
2187
                    fi
 
2188
                    if test -f "$dir/lib$name.la"; then
 
2189
                      found_la="$dir/lib$name.la"
 
2190
                    fi
 
2191
                  else
 
2192
                    if test -f "$dir/lib$name.$libext"; then
 
2193
                      found_dir="$dir"
 
2194
                      found_a="$dir/lib$name.$libext"
 
2195
                      if test -f "$dir/lib$name.la"; then
 
2196
                        found_la="$dir/lib$name.la"
 
2197
                      fi
 
2198
                    fi
 
2199
                  fi
 
2200
                  ;;
 
2201
              esac
 
2202
              if test "X$found_dir" != "X"; then
 
2203
                break
 
2204
              fi
 
2205
            done
 
2206
          fi
 
2207
          if test "X$found_dir" != "X"; then
 
2208
            dnl Found the library.
 
2209
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
 
2210
            if test "X$found_so" != "X"; then
 
2211
              dnl Linking with a shared library. We attempt to hardcode its
 
2212
              dnl directory into the executable's runpath, unless it's the
 
2213
              dnl standard /usr/lib.
 
2214
              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
 
2215
                dnl No hardcoding is needed.
 
2216
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2217
              else
 
2218
                dnl Use an explicit option to hardcode DIR into the resulting
 
2219
                dnl binary.
 
2220
                dnl Potentially add DIR to ltrpathdirs.
 
2221
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
2222
                haveit=
 
2223
                for x in $ltrpathdirs; do
 
2224
                  if test "X$x" = "X$found_dir"; then
 
2225
                    haveit=yes
 
2226
                    break
 
2227
                  fi
 
2228
                done
 
2229
                if test -z "$haveit"; then
 
2230
                  ltrpathdirs="$ltrpathdirs $found_dir"
 
2231
                fi
 
2232
                dnl The hardcoding into $LIBNAME is system dependent.
 
2233
                if test "$hardcode_direct" = yes; then
 
2234
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
 
2235
                  dnl resulting binary.
 
2236
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2237
                else
 
2238
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
 
2239
                    dnl Use an explicit option to hardcode DIR into the resulting
 
2240
                    dnl binary.
 
2241
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2242
                    dnl Potentially add DIR to rpathdirs.
 
2243
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
 
2244
                    haveit=
 
2245
                    for x in $rpathdirs; do
 
2246
                      if test "X$x" = "X$found_dir"; then
 
2247
                        haveit=yes
 
2248
                        break
 
2249
                      fi
 
2250
                    done
 
2251
                    if test -z "$haveit"; then
 
2252
                      rpathdirs="$rpathdirs $found_dir"
 
2253
                    fi
 
2254
                  else
 
2255
                    dnl Rely on "-L$found_dir".
 
2256
                    dnl But don't add it if it's already contained in the LDFLAGS
 
2257
                    dnl or the already constructed $LIBNAME
 
2258
                    haveit=
 
2259
                    for x in $LDFLAGS $LIB[]NAME; do
 
2260
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2261
                      if test "X$x" = "X-L$found_dir"; then
 
2262
                        haveit=yes
 
2263
                        break
 
2264
                      fi
 
2265
                    done
 
2266
                    if test -z "$haveit"; then
 
2267
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
 
2268
                    fi
 
2269
                    if test "$hardcode_minus_L" != no; then
 
2270
                      dnl FIXME: Not sure whether we should use
 
2271
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
2272
                      dnl here.
 
2273
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2274
                    else
 
2275
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
 
2276
                      dnl here, because this doesn't fit in flags passed to the
 
2277
                      dnl compiler. So give up. No hardcoding. This affects only
 
2278
                      dnl very old systems.
 
2279
                      dnl FIXME: Not sure whether we should use
 
2280
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
2281
                      dnl here.
 
2282
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
2283
                    fi
 
2284
                  fi
 
2285
                fi
 
2286
              fi
 
2287
            else
 
2288
              if test "X$found_a" != "X"; then
 
2289
                dnl Linking with a static library.
 
2290
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
 
2291
              else
 
2292
                dnl We shouldn't come here, but anyway it's good to have a
 
2293
                dnl fallback.
 
2294
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
 
2295
              fi
 
2296
            fi
 
2297
            dnl Assume the include files are nearby.
 
2298
            additional_includedir=
 
2299
            case "$found_dir" in
 
2300
              */$acl_libdirstem | */$acl_libdirstem/)
 
2301
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
 
2302
                additional_includedir="$basedir/include"
 
2303
                ;;
 
2304
            esac
 
2305
            if test "X$additional_includedir" != "X"; then
 
2306
              dnl Potentially add $additional_includedir to $INCNAME.
 
2307
              dnl But don't add it
 
2308
              dnl   1. if it's the standard /usr/include,
 
2309
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
 
2310
              dnl   3. if it's already present in $CPPFLAGS or the already
 
2311
              dnl      constructed $INCNAME,
 
2312
              dnl   4. if it doesn't exist as a directory.
 
2313
              if test "X$additional_includedir" != "X/usr/include"; then
 
2314
                haveit=
 
2315
                if test "X$additional_includedir" = "X/usr/local/include"; then
 
2316
                  if test -n "$GCC"; then
 
2317
                    case $host_os in
 
2318
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
2319
                    esac
 
2320
                  fi
 
2321
                fi
 
2322
                if test -z "$haveit"; then
 
2323
                  for x in $CPPFLAGS $INC[]NAME; do
 
2324
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2325
                    if test "X$x" = "X-I$additional_includedir"; then
 
2326
                      haveit=yes
 
2327
                      break
 
2328
                    fi
 
2329
                  done
 
2330
                  if test -z "$haveit"; then
 
2331
                    if test -d "$additional_includedir"; then
 
2332
                      dnl Really add $additional_includedir to $INCNAME.
 
2333
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
 
2334
                    fi
 
2335
                  fi
 
2336
                fi
 
2337
              fi
 
2338
            fi
 
2339
            dnl Look for dependencies.
 
2340
            if test -n "$found_la"; then
 
2341
              dnl Read the .la file. It defines the variables
 
2342
              dnl dlname, library_names, old_library, dependency_libs, current,
 
2343
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
 
2344
              save_libdir="$libdir"
 
2345
              case "$found_la" in
 
2346
                */* | *\\*) . "$found_la" ;;
 
2347
                *) . "./$found_la" ;;
 
2348
              esac
 
2349
              libdir="$save_libdir"
 
2350
              dnl We use only dependency_libs.
 
2351
              for dep in $dependency_libs; do
 
2352
                case "$dep" in
 
2353
                  -L*)
 
2354
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
 
2355
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
 
2356
                    dnl But don't add it
 
2357
                    dnl   1. if it's the standard /usr/lib,
 
2358
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
 
2359
                    dnl   3. if it's already present in $LDFLAGS or the already
 
2360
                    dnl      constructed $LIBNAME,
 
2361
                    dnl   4. if it doesn't exist as a directory.
 
2362
                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
 
2363
                      haveit=
 
2364
                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
 
2365
                        if test -n "$GCC"; then
 
2366
                          case $host_os in
 
2367
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
2368
                          esac
 
2369
                        fi
 
2370
                      fi
 
2371
                      if test -z "$haveit"; then
 
2372
                        haveit=
 
2373
                        for x in $LDFLAGS $LIB[]NAME; do
 
2374
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2375
                          if test "X$x" = "X-L$additional_libdir"; then
 
2376
                            haveit=yes
 
2377
                            break
 
2378
                          fi
 
2379
                        done
 
2380
                        if test -z "$haveit"; then
 
2381
                          if test -d "$additional_libdir"; then
 
2382
                            dnl Really add $additional_libdir to $LIBNAME.
 
2383
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
 
2384
                          fi
 
2385
                        fi
 
2386
                        haveit=
 
2387
                        for x in $LDFLAGS $LTLIB[]NAME; do
 
2388
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2389
                          if test "X$x" = "X-L$additional_libdir"; then
 
2390
                            haveit=yes
 
2391
                            break
 
2392
                          fi
 
2393
                        done
 
2394
                        if test -z "$haveit"; then
 
2395
                          if test -d "$additional_libdir"; then
 
2396
                            dnl Really add $additional_libdir to $LTLIBNAME.
 
2397
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
 
2398
                          fi
 
2399
                        fi
 
2400
                      fi
 
2401
                    fi
 
2402
                    ;;
 
2403
                  -R*)
 
2404
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
 
2405
                    if test "$enable_rpath" != no; then
 
2406
                      dnl Potentially add DIR to rpathdirs.
 
2407
                      dnl The rpathdirs will be appended to $LIBNAME at the end.
 
2408
                      haveit=
 
2409
                      for x in $rpathdirs; do
 
2410
                        if test "X$x" = "X$dir"; then
 
2411
                          haveit=yes
 
2412
                          break
 
2413
                        fi
 
2414
                      done
 
2415
                      if test -z "$haveit"; then
 
2416
                        rpathdirs="$rpathdirs $dir"
 
2417
                      fi
 
2418
                      dnl Potentially add DIR to ltrpathdirs.
 
2419
                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
2420
                      haveit=
 
2421
                      for x in $ltrpathdirs; do
 
2422
                        if test "X$x" = "X$dir"; then
 
2423
                          haveit=yes
 
2424
                          break
 
2425
                        fi
 
2426
                      done
 
2427
                      if test -z "$haveit"; then
 
2428
                        ltrpathdirs="$ltrpathdirs $dir"
 
2429
                      fi
 
2430
                    fi
 
2431
                    ;;
 
2432
                  -l*)
 
2433
                    dnl Handle this in the next round.
 
2434
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
 
2435
                    ;;
 
2436
                  *.la)
 
2437
                    dnl Handle this in the next round. Throw away the .la's
 
2438
                    dnl directory; it is already contained in a preceding -L
 
2439
                    dnl option.
 
2440
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
 
2441
                    ;;
 
2442
                  *)
 
2443
                    dnl Most likely an immediate library name.
 
2444
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
 
2445
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
 
2446
                    ;;
 
2447
                esac
 
2448
              done
 
2449
            fi
 
2450
          else
 
2451
            dnl Didn't find the library; assume it is in the system directories
 
2452
            dnl known to the linker and runtime loader. (All the system
 
2453
            dnl directories known to the linker should also be known to the
 
2454
            dnl runtime loader, otherwise the system is severely misconfigured.)
 
2455
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
2456
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
 
2457
          fi
 
2458
        fi
 
2459
      fi
 
2460
    done
 
2461
  done
 
2462
  if test "X$rpathdirs" != "X"; then
 
2463
    if test -n "$hardcode_libdir_separator"; then
 
2464
      dnl Weird platform: only the last -rpath option counts, the user must
 
2465
      dnl pass all path elements in one option. We can arrange that for a
 
2466
      dnl single library, but not when more than one $LIBNAMEs are used.
 
2467
      alldirs=
 
2468
      for found_dir in $rpathdirs; do
 
2469
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
 
2470
      done
 
2471
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
 
2472
      acl_save_libdir="$libdir"
 
2473
      libdir="$alldirs"
 
2474
      eval flag=\"$hardcode_libdir_flag_spec\"
 
2475
      libdir="$acl_save_libdir"
 
2476
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
2477
    else
 
2478
      dnl The -rpath options are cumulative.
 
2479
      for found_dir in $rpathdirs; do
 
2480
        acl_save_libdir="$libdir"
 
2481
        libdir="$found_dir"
 
2482
        eval flag=\"$hardcode_libdir_flag_spec\"
 
2483
        libdir="$acl_save_libdir"
 
2484
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
2485
      done
 
2486
    fi
 
2487
  fi
 
2488
  if test "X$ltrpathdirs" != "X"; then
 
2489
    dnl When using libtool, the option that works for both libraries and
 
2490
    dnl executables is -R. The -R options are cumulative.
 
2491
    for found_dir in $ltrpathdirs; do
 
2492
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
 
2493
    done
 
2494
  fi
 
2495
])
 
2496
 
 
2497
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
 
2498
dnl unless already present in VAR.
 
2499
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
 
2500
dnl contains two or three consecutive elements that belong together.
 
2501
AC_DEFUN([AC_LIB_APPENDTOVAR],
 
2502
[
 
2503
  for element in [$2]; do
 
2504
    haveit=
 
2505
    for x in $[$1]; do
 
2506
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2507
      if test "X$x" = "X$element"; then
 
2508
        haveit=yes
 
2509
        break
 
2510
      fi
 
2511
    done
 
2512
    if test -z "$haveit"; then
 
2513
      [$1]="${[$1]}${[$1]:+ }$element"
 
2514
    fi
 
2515
  done
 
2516
])
 
2517
 
 
2518
dnl For those cases where a variable contains several -L and -l options
 
2519
dnl referring to unknown libraries and directories, this macro determines the
 
2520
dnl necessary additional linker options for the runtime path.
 
2521
dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
 
2522
dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
 
2523
dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
 
2524
dnl otherwise linking without libtool is assumed.
 
2525
AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
 
2526
[
 
2527
  AC_REQUIRE([AC_LIB_RPATH])
 
2528
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
2529
  $1=
 
2530
  if test "$enable_rpath" != no; then
 
2531
    if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
 
2532
      dnl Use an explicit option to hardcode directories into the resulting
 
2533
      dnl binary.
 
2534
      rpathdirs=
 
2535
      next=
 
2536
      for opt in $2; do
 
2537
        if test -n "$next"; then
 
2538
          dir="$next"
 
2539
          dnl No need to hardcode the standard /usr/lib.
 
2540
          if test "X$dir" != "X/usr/$acl_libdirstem"; then
 
2541
            rpathdirs="$rpathdirs $dir"
 
2542
          fi
 
2543
          next=
 
2544
        else
 
2545
          case $opt in
 
2546
            -L) next=yes ;;
 
2547
            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
 
2548
                 dnl No need to hardcode the standard /usr/lib.
 
2549
                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
 
2550
                   rpathdirs="$rpathdirs $dir"
 
2551
                 fi
 
2552
                 next= ;;
 
2553
            *) next= ;;
 
2554
          esac
 
2555
        fi
 
2556
      done
 
2557
      if test "X$rpathdirs" != "X"; then
 
2558
        if test -n ""$3""; then
 
2559
          dnl libtool is used for linking. Use -R options.
 
2560
          for dir in $rpathdirs; do
 
2561
            $1="${$1}${$1:+ }-R$dir"
 
2562
          done
 
2563
        else
 
2564
          dnl The linker is used for linking directly.
 
2565
          if test -n "$hardcode_libdir_separator"; then
 
2566
            dnl Weird platform: only the last -rpath option counts, the user
 
2567
            dnl must pass all path elements in one option.
 
2568
            alldirs=
 
2569
            for dir in $rpathdirs; do
 
2570
              alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$dir"
 
2571
            done
 
2572
            acl_save_libdir="$libdir"
 
2573
            libdir="$alldirs"
 
2574
            eval flag=\"$hardcode_libdir_flag_spec\"
 
2575
            libdir="$acl_save_libdir"
 
2576
            $1="$flag"
 
2577
          else
 
2578
            dnl The -rpath options are cumulative.
 
2579
            for dir in $rpathdirs; do
 
2580
              acl_save_libdir="$libdir"
 
2581
              libdir="$dir"
 
2582
              eval flag=\"$hardcode_libdir_flag_spec\"
 
2583
              libdir="$acl_save_libdir"
 
2584
              $1="${$1}${$1:+ }$flag"
 
2585
            done
 
2586
          fi
 
2587
        fi
 
2588
      fi
 
2589
    fi
 
2590
  fi
 
2591
  AC_SUBST([$1])
 
2592
])
569
2593
# Configure paths for libmikmod
570
2594
#
571
2595
# Derived from glib.m4 (Owen Taylor 97-11-3)
773
2797
  AC_SUBST(LIBMIKMOD_LDADD)
774
2798
  rm -f conf.mikmodtest
775
2799
])
 
2800
# lib-prefix.m4 serial 5 (gettext-0.15)
 
2801
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
 
2802
dnl This file is free software; the Free Software Foundation
 
2803
dnl gives unlimited permission to copy and/or distribute it,
 
2804
dnl with or without modifications, as long as this notice is preserved.
 
2805
 
 
2806
dnl From Bruno Haible.
 
2807
 
 
2808
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
 
2809
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
 
2810
dnl require excessive bracketing.
 
2811
ifdef([AC_HELP_STRING],
 
2812
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
 
2813
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
 
2814
 
 
2815
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 
2816
dnl to access previously installed libraries. The basic assumption is that
 
2817
dnl a user will want packages to use other packages he previously installed
 
2818
dnl with the same --prefix option.
 
2819
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
 
2820
dnl libraries, but is otherwise very convenient.
 
2821
AC_DEFUN([AC_LIB_PREFIX],
 
2822
[
 
2823
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
 
2824
  AC_REQUIRE([AC_PROG_CC])
 
2825
  AC_REQUIRE([AC_CANONICAL_HOST])
 
2826
  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
 
2827
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
2828
  dnl By default, look in $includedir and $libdir.
 
2829
  use_additional=yes
 
2830
  AC_LIB_WITH_FINAL_PREFIX([
 
2831
    eval additional_includedir=\"$includedir\"
 
2832
    eval additional_libdir=\"$libdir\"
 
2833
  ])
 
2834
  AC_LIB_ARG_WITH([lib-prefix],
 
2835
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
 
2836
  --without-lib-prefix    don't search for libraries in includedir and libdir],
 
2837
[
 
2838
    if test "X$withval" = "Xno"; then
 
2839
      use_additional=no
 
2840
    else
 
2841
      if test "X$withval" = "X"; then
 
2842
        AC_LIB_WITH_FINAL_PREFIX([
 
2843
          eval additional_includedir=\"$includedir\"
 
2844
          eval additional_libdir=\"$libdir\"
 
2845
        ])
 
2846
      else
 
2847
        additional_includedir="$withval/include"
 
2848
        additional_libdir="$withval/$acl_libdirstem"
 
2849
      fi
 
2850
    fi
 
2851
])
 
2852
  if test $use_additional = yes; then
 
2853
    dnl Potentially add $additional_includedir to $CPPFLAGS.
 
2854
    dnl But don't add it
 
2855
    dnl   1. if it's the standard /usr/include,
 
2856
    dnl   2. if it's already present in $CPPFLAGS,
 
2857
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
 
2858
    dnl   4. if it doesn't exist as a directory.
 
2859
    if test "X$additional_includedir" != "X/usr/include"; then
 
2860
      haveit=
 
2861
      for x in $CPPFLAGS; do
 
2862
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2863
        if test "X$x" = "X-I$additional_includedir"; then
 
2864
          haveit=yes
 
2865
          break
 
2866
        fi
 
2867
      done
 
2868
      if test -z "$haveit"; then
 
2869
        if test "X$additional_includedir" = "X/usr/local/include"; then
 
2870
          if test -n "$GCC"; then
 
2871
            case $host_os in
 
2872
              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
2873
            esac
 
2874
          fi
 
2875
        fi
 
2876
        if test -z "$haveit"; then
 
2877
          if test -d "$additional_includedir"; then
 
2878
            dnl Really add $additional_includedir to $CPPFLAGS.
 
2879
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
 
2880
          fi
 
2881
        fi
 
2882
      fi
 
2883
    fi
 
2884
    dnl Potentially add $additional_libdir to $LDFLAGS.
 
2885
    dnl But don't add it
 
2886
    dnl   1. if it's the standard /usr/lib,
 
2887
    dnl   2. if it's already present in $LDFLAGS,
 
2888
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
 
2889
    dnl   4. if it doesn't exist as a directory.
 
2890
    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
 
2891
      haveit=
 
2892
      for x in $LDFLAGS; do
 
2893
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2894
        if test "X$x" = "X-L$additional_libdir"; then
 
2895
          haveit=yes
 
2896
          break
 
2897
        fi
 
2898
      done
 
2899
      if test -z "$haveit"; then
 
2900
        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
 
2901
          if test -n "$GCC"; then
 
2902
            case $host_os in
 
2903
              linux*) haveit=yes;;
 
2904
            esac
 
2905
          fi
 
2906
        fi
 
2907
        if test -z "$haveit"; then
 
2908
          if test -d "$additional_libdir"; then
 
2909
            dnl Really add $additional_libdir to $LDFLAGS.
 
2910
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
 
2911
          fi
 
2912
        fi
 
2913
      fi
 
2914
    fi
 
2915
  fi
 
2916
])
 
2917
 
 
2918
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
 
2919
dnl acl_final_exec_prefix, containing the values to which $prefix and
 
2920
dnl $exec_prefix will expand at the end of the configure script.
 
2921
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
 
2922
[
 
2923
  dnl Unfortunately, prefix and exec_prefix get only finally determined
 
2924
  dnl at the end of configure.
 
2925
  if test "X$prefix" = "XNONE"; then
 
2926
    acl_final_prefix="$ac_default_prefix"
 
2927
  else
 
2928
    acl_final_prefix="$prefix"
 
2929
  fi
 
2930
  if test "X$exec_prefix" = "XNONE"; then
 
2931
    acl_final_exec_prefix='${prefix}'
 
2932
  else
 
2933
    acl_final_exec_prefix="$exec_prefix"
 
2934
  fi
 
2935
  acl_save_prefix="$prefix"
 
2936
  prefix="$acl_final_prefix"
 
2937
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
 
2938
  prefix="$acl_save_prefix"
 
2939
])
 
2940
 
 
2941
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
 
2942
dnl variables prefix and exec_prefix bound to the values they will have
 
2943
dnl at the end of the configure script.
 
2944
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 
2945
[
 
2946
  acl_save_prefix="$prefix"
 
2947
  prefix="$acl_final_prefix"
 
2948
  acl_save_exec_prefix="$exec_prefix"
 
2949
  exec_prefix="$acl_final_exec_prefix"
 
2950
  $1
 
2951
  exec_prefix="$acl_save_exec_prefix"
 
2952
  prefix="$acl_save_prefix"
 
2953
])
 
2954
 
 
2955
dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
 
2956
dnl the basename of the libdir, either "lib" or "lib64".
 
2957
AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 
2958
[
 
2959
  dnl There is no formal standard regarding lib and lib64. The current
 
2960
  dnl practice is that on a system supporting 32-bit and 64-bit instruction
 
2961
  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
 
2962
  dnl libraries go under $prefix/lib. We determine the compiler's default
 
2963
  dnl mode by looking at the compiler's library search path. If at least
 
2964
  dnl of its elements ends in /lib64 or points to a directory whose absolute
 
2965
  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
 
2966
  dnl default, namely "lib".
 
2967
  acl_libdirstem=lib
 
2968
  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
 
2969
  if test -n "$searchpath"; then
 
2970
    acl_save_IFS="${IFS=        }"; IFS=":"
 
2971
    for searchdir in $searchpath; do
 
2972
      if test -d "$searchdir"; then
 
2973
        case "$searchdir" in
 
2974
          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
 
2975
          *) searchdir=`cd "$searchdir" && pwd`
 
2976
             case "$searchdir" in
 
2977
               */lib64 ) acl_libdirstem=lib64 ;;
 
2978
             esac ;;
 
2979
        esac
 
2980
      fi
 
2981
    done
 
2982
    IFS="$acl_save_IFS"
 
2983
  fi
 
2984
])
 
2985
# lock.m4 serial 6 (gettext-0.16)
 
2986
dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
 
2987
dnl This file is free software; the Free Software Foundation
 
2988
dnl gives unlimited permission to copy and/or distribute it,
 
2989
dnl with or without modifications, as long as this notice is preserved.
 
2990
 
 
2991
dnl From Bruno Haible.
 
2992
 
 
2993
dnl Tests for a multithreading library to be used.
 
2994
dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
 
2995
dnl USE_PTH_THREADS, USE_WIN32_THREADS
 
2996
dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
 
2997
dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
 
2998
dnl libtool).
 
2999
dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
 
3000
dnl programs that really need multithread functionality. The difference
 
3001
dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
 
3002
dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
 
3003
dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
 
3004
dnl multithread-safe programs.
 
3005
 
 
3006
AC_DEFUN([gl_LOCK_EARLY],
 
3007
[
 
3008
  AC_REQUIRE([gl_LOCK_EARLY_BODY])
 
3009
])
 
3010
 
 
3011
dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
 
3012
 
 
3013
AC_DEFUN([gl_LOCK_EARLY_BODY],
 
3014
[
 
3015
  dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
 
3016
  dnl influences the result of the autoconf tests that test for *_unlocked
 
3017
  dnl declarations, on AIX 5 at least. Therefore it must come early.
 
3018
  AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
 
3019
  AC_BEFORE([$0], [gl_ARGP])dnl
 
3020
 
 
3021
  AC_REQUIRE([AC_CANONICAL_HOST])
 
3022
  AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
 
3023
  dnl Check for multithreading.
 
3024
  AC_ARG_ENABLE(threads,
 
3025
AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
 
3026
AC_HELP_STRING([--disable-threads], [build without multithread safety]),
 
3027
    [gl_use_threads=$enableval],
 
3028
    [case "$host_os" in
 
3029
       dnl Disable multithreading by default on OSF/1, because it interferes
 
3030
       dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
 
3031
       dnl process gets an endless segmentation fault inside execvp().
 
3032
       osf*) gl_use_threads=no ;;
 
3033
       *)    gl_use_threads=yes ;;
 
3034
     esac
 
3035
    ])
 
3036
  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
 
3037
    # For using <pthread.h>:
 
3038
    case "$host_os" in
 
3039
      osf*)
 
3040
        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
 
3041
        # groks <pthread.h>. cc also understands the flag -pthread, but
 
3042
        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
 
3043
        # 2. putting a flag into CPPFLAGS that has an effect on the linker
 
3044
        # causes the AC_TRY_LINK test below to succeed unexpectedly,
 
3045
        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
 
3046
        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 
3047
        ;;
 
3048
    esac
 
3049
    # Some systems optimize for single-threaded programs by default, and
 
3050
    # need special flags to disable these optimizations. For example, the
 
3051
    # definition of 'errno' in <errno.h>.
 
3052
    case "$host_os" in
 
3053
      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
 
3054
      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
 
3055
    esac
 
3056
  fi
 
3057
])
 
3058
 
 
3059
dnl The guts of gl_LOCK. Needs to be expanded only once.
 
3060
 
 
3061
AC_DEFUN([gl_LOCK_BODY],
 
3062
[
 
3063
  AC_REQUIRE([gl_LOCK_EARLY_BODY])
 
3064
  gl_threads_api=none
 
3065
  LIBTHREAD=
 
3066
  LTLIBTHREAD=
 
3067
  LIBMULTITHREAD=
 
3068
  LTLIBMULTITHREAD=
 
3069
  if test "$gl_use_threads" != no; then
 
3070
    dnl Check whether the compiler and linker support weak declarations.
 
3071
    AC_MSG_CHECKING([whether imported symbols can be declared weak])
 
3072
    gl_have_weak=no
 
3073
    AC_TRY_LINK([extern void xyzzy ();
 
3074
#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
 
3075
    AC_MSG_RESULT([$gl_have_weak])
 
3076
    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
 
3077
      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
 
3078
      # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
 
3079
      AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
 
3080
      if test "$gl_have_pthread_h" = yes; then
 
3081
        # Other possible tests:
 
3082
        #   -lpthreads (FSU threads, PCthreads)
 
3083
        #   -lgthreads
 
3084
        gl_have_pthread=
 
3085
        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
 
3086
        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
 
3087
        # the second one only in libpthread, and lock.c needs it.
 
3088
        AC_TRY_LINK([#include <pthread.h>],
 
3089
          [pthread_mutex_lock((pthread_mutex_t*)0);
 
3090
           pthread_mutexattr_init((pthread_mutexattr_t*)0);],
 
3091
          [gl_have_pthread=yes])
 
3092
        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
 
3093
        # since it is defined as a macro on OSF/1.)
 
3094
        if test -n "$gl_have_pthread"; then
 
3095
          # The program links fine without libpthread. But it may actually
 
3096
          # need to link with libpthread in order to create multiple threads.
 
3097
          AC_CHECK_LIB(pthread, pthread_kill,
 
3098
            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
 
3099
             # On Solaris and HP-UX, most pthread functions exist also in libc.
 
3100
             # Therefore pthread_in_use() needs to actually try to create a
 
3101
             # thread: pthread_create from libc will fail, whereas
 
3102
             # pthread_create will actually create a thread.
 
3103
             case "$host_os" in
 
3104
               solaris* | hpux*)
 
3105
                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
 
3106
                   [Define if the pthread_in_use() detection is hard.])
 
3107
             esac
 
3108
            ])
 
3109
        else
 
3110
          # Some library is needed. Try libpthread and libc_r.
 
3111
          AC_CHECK_LIB(pthread, pthread_kill,
 
3112
            [gl_have_pthread=yes
 
3113
             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
 
3114
             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
 
3115
          if test -z "$gl_have_pthread"; then
 
3116
            # For FreeBSD 4.
 
3117
            AC_CHECK_LIB(c_r, pthread_kill,
 
3118
              [gl_have_pthread=yes
 
3119
               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
 
3120
               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
 
3121
          fi
 
3122
        fi
 
3123
        if test -n "$gl_have_pthread"; then
 
3124
          gl_threads_api=posix
 
3125
          AC_DEFINE([USE_POSIX_THREADS], 1,
 
3126
            [Define if the POSIX multithreading library can be used.])
 
3127
          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
 
3128
            if test $gl_have_weak = yes; then
 
3129
              AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
 
3130
                [Define if references to the POSIX multithreading library should be made weak.])
 
3131
              LIBTHREAD=
 
3132
              LTLIBTHREAD=
 
3133
            fi
 
3134
          fi
 
3135
          # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
 
3136
          # pthread_rwlock_* functions.
 
3137
          AC_CHECK_TYPE([pthread_rwlock_t],
 
3138
            [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
 
3139
               [Define if the POSIX multithreading library has read/write locks.])],
 
3140
            [],
 
3141
            [#include <pthread.h>])
 
3142
          # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
 
3143
          AC_TRY_COMPILE([#include <pthread.h>],
 
3144
            [#if __FreeBSD__ == 4
 
3145
error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
 
3146
#else
 
3147
int x = (int)PTHREAD_MUTEX_RECURSIVE;
 
3148
return !x;
 
3149
#endif],
 
3150
            [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
 
3151
               [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
 
3152
        fi
 
3153
      fi
 
3154
    fi
 
3155
    if test -z "$gl_have_pthread"; then
 
3156
      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
 
3157
        gl_have_solaristhread=
 
3158
        gl_save_LIBS="$LIBS"
 
3159
        LIBS="$LIBS -lthread"
 
3160
        AC_TRY_LINK([#include <thread.h>
 
3161
#include <synch.h>],
 
3162
          [thr_self();],
 
3163
          [gl_have_solaristhread=yes])
 
3164
        LIBS="$gl_save_LIBS"
 
3165
        if test -n "$gl_have_solaristhread"; then
 
3166
          gl_threads_api=solaris
 
3167
          LIBTHREAD=-lthread
 
3168
          LTLIBTHREAD=-lthread
 
3169
          LIBMULTITHREAD="$LIBTHREAD"
 
3170
          LTLIBMULTITHREAD="$LTLIBTHREAD"
 
3171
          AC_DEFINE([USE_SOLARIS_THREADS], 1,
 
3172
            [Define if the old Solaris multithreading library can be used.])
 
3173
          if test $gl_have_weak = yes; then
 
3174
            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
 
3175
              [Define if references to the old Solaris multithreading library should be made weak.])
 
3176
            LIBTHREAD=
 
3177
            LTLIBTHREAD=
 
3178
          fi
 
3179
        fi
 
3180
      fi
 
3181
    fi
 
3182
    if test "$gl_use_threads" = pth; then
 
3183
      gl_save_CPPFLAGS="$CPPFLAGS"
 
3184
      AC_LIB_LINKFLAGS(pth)
 
3185
      gl_have_pth=
 
3186
      gl_save_LIBS="$LIBS"
 
3187
      LIBS="$LIBS -lpth"
 
3188
      AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
 
3189
      LIBS="$gl_save_LIBS"
 
3190
      if test -n "$gl_have_pth"; then
 
3191
        gl_threads_api=pth
 
3192
        LIBTHREAD="$LIBPTH"
 
3193
        LTLIBTHREAD="$LTLIBPTH"
 
3194
        LIBMULTITHREAD="$LIBTHREAD"
 
3195
        LTLIBMULTITHREAD="$LTLIBTHREAD"
 
3196
        AC_DEFINE([USE_PTH_THREADS], 1,
 
3197
          [Define if the GNU Pth multithreading library can be used.])
 
3198
        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
 
3199
          if test $gl_have_weak = yes; then
 
3200
            AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
 
3201
              [Define if references to the GNU Pth multithreading library should be made weak.])
 
3202
            LIBTHREAD=
 
3203
            LTLIBTHREAD=
 
3204
          fi
 
3205
        fi
 
3206
      else
 
3207
        CPPFLAGS="$gl_save_CPPFLAGS"
 
3208
      fi
 
3209
    fi
 
3210
    if test -z "$gl_have_pthread"; then
 
3211
      if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
 
3212
        if { case "$host_os" in
 
3213
               mingw*) true;;
 
3214
               *) false;;
 
3215
             esac
 
3216
           }; then
 
3217
          gl_threads_api=win32
 
3218
          AC_DEFINE([USE_WIN32_THREADS], 1,
 
3219
            [Define if the Win32 multithreading API can be used.])
 
3220
        fi
 
3221
      fi
 
3222
    fi
 
3223
  fi
 
3224
  AC_MSG_CHECKING([for multithread API to use])
 
3225
  AC_MSG_RESULT([$gl_threads_api])
 
3226
  AC_SUBST(LIBTHREAD)
 
3227
  AC_SUBST(LTLIBTHREAD)
 
3228
  AC_SUBST(LIBMULTITHREAD)
 
3229
  AC_SUBST(LTLIBMULTITHREAD)
 
3230
])
 
3231
 
 
3232
AC_DEFUN([gl_LOCK],
 
3233
[
 
3234
  AC_REQUIRE([gl_LOCK_EARLY])
 
3235
  AC_REQUIRE([gl_LOCK_BODY])
 
3236
  gl_PREREQ_LOCK
 
3237
])
 
3238
 
 
3239
# Prerequisites of lib/lock.c.
 
3240
AC_DEFUN([gl_PREREQ_LOCK], [
 
3241
  AC_REQUIRE([AC_C_INLINE])
 
3242
])
 
3243
 
 
3244
dnl Survey of platforms:
 
3245
dnl
 
3246
dnl Platform          Available   Compiler    Supports   test-lock
 
3247
dnl                   flavours    option      weak       result
 
3248
dnl ---------------   ---------   ---------   --------   ---------
 
3249
dnl Linux 2.4/glibc   posix       -lpthread       Y      OK
 
3250
dnl
 
3251
dnl GNU Hurd/glibc    posix
 
3252
dnl
 
3253
dnl FreeBSD 5.3       posix       -lc_r           Y
 
3254
dnl                   posix       -lkse ?         Y
 
3255
dnl                   posix       -lpthread ?     Y
 
3256
dnl                   posix       -lthr           Y
 
3257
dnl
 
3258
dnl FreeBSD 5.2       posix       -lc_r           Y
 
3259
dnl                   posix       -lkse           Y
 
3260
dnl                   posix       -lthr           Y
 
3261
dnl
 
3262
dnl FreeBSD 4.0,4.10  posix       -lc_r           Y      OK
 
3263
dnl
 
3264
dnl NetBSD 1.6        --
 
3265
dnl
 
3266
dnl OpenBSD 3.4       posix       -lpthread       Y      OK
 
3267
dnl
 
3268
dnl MacOS X 10.[123]  posix       -lpthread       Y      OK
 
3269
dnl
 
3270
dnl Solaris 7,8,9     posix       -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
 
3271
dnl                   solaris     -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
 
3272
dnl
 
3273
dnl HP-UX 11          posix       -lpthread       N (cc) OK
 
3274
dnl                                               Y (gcc)
 
3275
dnl
 
3276
dnl IRIX 6.5          posix       -lpthread       Y      0.5
 
3277
dnl
 
3278
dnl AIX 4.3,5.1       posix       -lpthread       N      AIX 4: 0.5; AIX 5: OK
 
3279
dnl
 
3280
dnl OSF/1 4.0,5.1     posix       -pthread (cc)   N      OK
 
3281
dnl                               -lpthread (gcc) Y
 
3282
dnl
 
3283
dnl Cygwin            posix       -lpthread       Y      OK
 
3284
dnl
 
3285
dnl Any of the above  pth         -lpth                  0.0
 
3286
dnl
 
3287
dnl Mingw             win32                       N      OK
 
3288
dnl
 
3289
dnl BeOS 5            --
 
3290
dnl
 
3291
dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
 
3292
dnl turned off:
 
3293
dnl   OK if all three tests terminate OK,
 
3294
dnl   0.5 if the first test terminates OK but the second one loops endlessly,
 
3295
dnl   0.0 if the first test already loops endlessly.
 
3296
# longdouble.m4 serial 2 (gettext-0.15)
 
3297
dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
 
3298
dnl This file is free software; the Free Software Foundation
 
3299
dnl gives unlimited permission to copy and/or distribute it,
 
3300
dnl with or without modifications, as long as this notice is preserved.
 
3301
 
 
3302
dnl From Bruno Haible.
 
3303
dnl Test whether the compiler supports the 'long double' type.
 
3304
dnl Prerequisite: AC_PROG_CC
 
3305
 
 
3306
dnl This file is only needed in autoconf <= 2.59.  Newer versions of autoconf
 
3307
dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
 
3308
 
 
3309
AC_DEFUN([gt_TYPE_LONGDOUBLE],
 
3310
[
 
3311
  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
 
3312
    [if test "$GCC" = yes; then
 
3313
       gt_cv_c_long_double=yes
 
3314
     else
 
3315
       AC_TRY_COMPILE([
 
3316
         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
 
3317
         long double foo = 0.0;
 
3318
         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
 
3319
         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
 
3320
         ], ,
 
3321
         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
 
3322
     fi])
 
3323
  if test $gt_cv_c_long_double = yes; then
 
3324
    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
 
3325
  fi
 
3326
])
 
3327
# longlong.m4 serial 8
 
3328
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
 
3329
dnl This file is free software; the Free Software Foundation
 
3330
dnl gives unlimited permission to copy and/or distribute it,
 
3331
dnl with or without modifications, as long as this notice is preserved.
 
3332
 
 
3333
dnl From Paul Eggert.
 
3334
 
 
3335
# Define HAVE_LONG_LONG_INT if 'long long int' works.
 
3336
# This fixes a bug in Autoconf 2.60, but can be removed once we
 
3337
# assume 2.61 everywhere.
 
3338
 
 
3339
# Note: If the type 'long long int' exists but is only 32 bits large
 
3340
# (as on some very old compilers), AC_TYPE_LONG_LONG_INT will not be
 
3341
# defined. In this case you can treat 'long long int' like 'long int'.
 
3342
 
 
3343
AC_DEFUN([AC_TYPE_LONG_LONG_INT],
 
3344
[
 
3345
  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
 
3346
    [AC_LINK_IFELSE(
 
3347
       [AC_LANG_PROGRAM(
 
3348
          [[long long int ll = 9223372036854775807ll;
 
3349
            long long int nll = -9223372036854775807LL;
 
3350
            typedef int a[((-9223372036854775807LL < 0
 
3351
                            && 0 < 9223372036854775807ll)
 
3352
                           ? 1 : -1)];
 
3353
            int i = 63;]],
 
3354
          [[long long int llmax = 9223372036854775807ll;
 
3355
            return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
 
3356
                    | (llmax / ll) | (llmax % ll));]])],
 
3357
       [ac_cv_type_long_long_int=yes],
 
3358
       [ac_cv_type_long_long_int=no])])
 
3359
  if test $ac_cv_type_long_long_int = yes; then
 
3360
    AC_DEFINE([HAVE_LONG_LONG_INT], 1,
 
3361
      [Define to 1 if the system has the type `long long int'.])
 
3362
  fi
 
3363
])
 
3364
 
 
3365
# This macro is obsolescent and should go away soon.
 
3366
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
 
3367
[
 
3368
  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
 
3369
  ac_cv_type_long_long=$ac_cv_type_long_long_int
 
3370
  if test $ac_cv_type_long_long = yes; then
 
3371
    AC_DEFINE(HAVE_LONG_LONG, 1,
 
3372
      [Define if you have the 'long long' type.])
 
3373
  fi
 
3374
])
 
3375
# nls.m4 serial 3 (gettext-0.15)
 
3376
dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
 
3377
dnl This file is free software; the Free Software Foundation
 
3378
dnl gives unlimited permission to copy and/or distribute it,
 
3379
dnl with or without modifications, as long as this notice is preserved.
 
3380
dnl
 
3381
dnl This file can can be used in projects which are not available under
 
3382
dnl the GNU General Public License or the GNU Library General Public
 
3383
dnl License but which still want to provide support for the GNU gettext
 
3384
dnl functionality.
 
3385
dnl Please note that the actual code of the GNU gettext library is covered
 
3386
dnl by the GNU Library General Public License, and the rest of the GNU
 
3387
dnl gettext package package is covered by the GNU General Public License.
 
3388
dnl They are *not* in the public domain.
 
3389
 
 
3390
dnl Authors:
 
3391
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
3392
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
3393
 
 
3394
AC_PREREQ(2.50)
 
3395
 
 
3396
AC_DEFUN([AM_NLS],
 
3397
[
 
3398
  AC_MSG_CHECKING([whether NLS is requested])
 
3399
  dnl Default is enabled NLS
 
3400
  AC_ARG_ENABLE(nls,
 
3401
    [  --disable-nls           do not use Native Language Support],
 
3402
    USE_NLS=$enableval, USE_NLS=yes)
 
3403
  AC_MSG_RESULT($USE_NLS)
 
3404
  AC_SUBST(USE_NLS)
 
3405
])
776
3406
# Configure paths for libogg
777
3407
# Jack Moffitt <jack@icecast.org> 10-21-2000
778
3408
# Shamelessly stolen from Owen Taylor and Manish Singh
868
3498
  AC_SUBST(OGG_LIBS)
869
3499
  rm -f conf.oggtest
870
3500
])
 
3501
# po.m4 serial 13 (gettext-0.15)
 
3502
dnl Copyright (C) 1995-2006 Free Software Foundation, Inc.
 
3503
dnl This file is free software; the Free Software Foundation
 
3504
dnl gives unlimited permission to copy and/or distribute it,
 
3505
dnl with or without modifications, as long as this notice is preserved.
 
3506
dnl
 
3507
dnl This file can can be used in projects which are not available under
 
3508
dnl the GNU General Public License or the GNU Library General Public
 
3509
dnl License but which still want to provide support for the GNU gettext
 
3510
dnl functionality.
 
3511
dnl Please note that the actual code of the GNU gettext library is covered
 
3512
dnl by the GNU Library General Public License, and the rest of the GNU
 
3513
dnl gettext package package is covered by the GNU General Public License.
 
3514
dnl They are *not* in the public domain.
 
3515
 
 
3516
dnl Authors:
 
3517
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
3518
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
3519
 
 
3520
AC_PREREQ(2.50)
 
3521
 
 
3522
dnl Checks for all prerequisites of the po subdirectory.
 
3523
AC_DEFUN([AM_PO_SUBDIRS],
 
3524
[
 
3525
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
3526
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
3527
  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
 
3528
  AC_REQUIRE([AM_NLS])dnl
 
3529
 
 
3530
  dnl Perform the following tests also if --disable-nls has been given,
 
3531
  dnl because they are needed for "make dist" to work.
 
3532
 
 
3533
  dnl Search for GNU msgfmt in the PATH.
 
3534
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
 
3535
  dnl The second test excludes FreeBSD msgfmt.
 
3536
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
3537
    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
3538
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
3539
    :)
 
3540
  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
3541
 
 
3542
  dnl Test whether it is GNU msgfmt >= 0.15.
 
3543
changequote(,)dnl
 
3544
  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
3545
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
 
3546
    *) MSGFMT_015=$MSGFMT ;;
 
3547
  esac
 
3548
changequote([,])dnl
 
3549
  AC_SUBST([MSGFMT_015])
 
3550
changequote(,)dnl
 
3551
  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
3552
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
 
3553
    *) GMSGFMT_015=$GMSGFMT ;;
 
3554
  esac
 
3555
changequote([,])dnl
 
3556
  AC_SUBST([GMSGFMT_015])
 
3557
 
 
3558
  dnl Search for GNU xgettext 0.12 or newer in the PATH.
 
3559
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
 
3560
  dnl The second test excludes FreeBSD xgettext.
 
3561
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
3562
    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
3563
     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
3564
    :)
 
3565
  dnl Remove leftover from FreeBSD xgettext call.
 
3566
  rm -f messages.po
 
3567
 
 
3568
  dnl Test whether it is GNU xgettext >= 0.15.
 
3569
changequote(,)dnl
 
3570
  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
 
3571
    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
 
3572
    *) XGETTEXT_015=$XGETTEXT ;;
 
3573
  esac
 
3574
changequote([,])dnl
 
3575
  AC_SUBST([XGETTEXT_015])
 
3576
 
 
3577
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
 
3578
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
 
3579
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
3580
 
 
3581
  dnl Installation directories.
 
3582
  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
 
3583
  dnl have to define it here, so that it can be used in po/Makefile.
 
3584
  test -n "$localedir" || localedir='${datadir}/locale'
 
3585
  AC_SUBST([localedir])
 
3586
 
 
3587
  AC_CONFIG_COMMANDS([po-directories], [[
 
3588
    for ac_file in $CONFIG_FILES; do
 
3589
      # Support "outfile[:infile[:infile...]]"
 
3590
      case "$ac_file" in
 
3591
        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
 
3592
      esac
 
3593
      # PO directories have a Makefile.in generated from Makefile.in.in.
 
3594
      case "$ac_file" in */Makefile.in)
 
3595
        # Adjust a relative srcdir.
 
3596
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
3597
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
3598
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
3599
        # In autoconf-2.13 it is called $ac_given_srcdir.
 
3600
        # In autoconf-2.50 it is called $srcdir.
 
3601
        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
3602
        case "$ac_given_srcdir" in
 
3603
          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
3604
          /*) top_srcdir="$ac_given_srcdir" ;;
 
3605
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
3606
        esac
 
3607
        # Treat a directory as a PO directory if and only if it has a
 
3608
        # POTFILES.in file. This allows packages to have multiple PO
 
3609
        # directories under different names or in different locations.
 
3610
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
 
3611
          rm -f "$ac_dir/POTFILES"
 
3612
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
 
3613
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
 
3614
          POMAKEFILEDEPS="POTFILES.in"
 
3615
          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
 
3616
          # on $ac_dir but don't depend on user-specified configuration
 
3617
          # parameters.
 
3618
          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
3619
            # The LINGUAS file contains the set of available languages.
 
3620
            if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
3621
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
3622
            fi
 
3623
            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
3624
            # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
3625
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
3626
            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
3627
          else
 
3628
            # The set of available languages was given in configure.in.
 
3629
            # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
3630
            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
 
3631
          fi
 
3632
          # Compute POFILES
 
3633
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
3634
          # Compute UPDATEPOFILES
 
3635
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
3636
          # Compute DUMMYPOFILES
 
3637
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
3638
          # Compute GMOFILES
 
3639
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
3640
          case "$ac_given_srcdir" in
 
3641
            .) srcdirpre= ;;
 
3642
            *) srcdirpre='$(srcdir)/' ;;
 
3643
          esac
 
3644
          POFILES=
 
3645
          UPDATEPOFILES=
 
3646
          DUMMYPOFILES=
 
3647
          GMOFILES=
 
3648
          for lang in $ALL_LINGUAS; do
 
3649
            POFILES="$POFILES $srcdirpre$lang.po"
 
3650
            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
3651
            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
3652
            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
3653
          done
 
3654
          # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
3655
          # environment variable.
 
3656
          INST_LINGUAS=
 
3657
          if test -n "$ALL_LINGUAS"; then
 
3658
            for presentlang in $ALL_LINGUAS; do
 
3659
              useit=no
 
3660
              if test "%UNSET%" != "$LINGUAS"; then
 
3661
                desiredlanguages="$LINGUAS"
 
3662
              else
 
3663
                desiredlanguages="$ALL_LINGUAS"
 
3664
              fi
 
3665
              for desiredlang in $desiredlanguages; do
 
3666
                # Use the presentlang catalog if desiredlang is
 
3667
                #   a. equal to presentlang, or
 
3668
                #   b. a variant of presentlang (because in this case,
 
3669
                #      presentlang can be used as a fallback for messages
 
3670
                #      which are not translated in the desiredlang catalog).
 
3671
                case "$desiredlang" in
 
3672
                  "$presentlang"*) useit=yes;;
 
3673
                esac
 
3674
              done
 
3675
              if test $useit = yes; then
 
3676
                INST_LINGUAS="$INST_LINGUAS $presentlang"
 
3677
              fi
 
3678
            done
 
3679
          fi
 
3680
          CATALOGS=
 
3681
          if test -n "$INST_LINGUAS"; then
 
3682
            for lang in $INST_LINGUAS; do
 
3683
              CATALOGS="$CATALOGS $lang.gmo"
 
3684
            done
 
3685
          fi
 
3686
          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
 
3687
          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
 
3688
          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
 
3689
            if test -f "$f"; then
 
3690
              case "$f" in
 
3691
                *.orig | *.bak | *~) ;;
 
3692
                *) cat "$f" >> "$ac_dir/Makefile" ;;
 
3693
              esac
 
3694
            fi
 
3695
          done
 
3696
        fi
 
3697
        ;;
 
3698
      esac
 
3699
    done]],
 
3700
   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
 
3701
    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
 
3702
    # from automake < 1.5.
 
3703
    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
 
3704
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
 
3705
    LINGUAS="${LINGUAS-%UNSET%}"
 
3706
   ])
 
3707
])
 
3708
 
 
3709
dnl Postprocesses a Makefile in a directory containing PO files.
 
3710
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
 
3711
[
 
3712
  # When this code is run, in config.status, two variables have already been
 
3713
  # set:
 
3714
  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
 
3715
  # - LINGUAS is the value of the environment variable LINGUAS at configure
 
3716
  #   time.
 
3717
 
 
3718
changequote(,)dnl
 
3719
  # Adjust a relative srcdir.
 
3720
  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
3721
  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
3722
  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
3723
  # In autoconf-2.13 it is called $ac_given_srcdir.
 
3724
  # In autoconf-2.50 it is called $srcdir.
 
3725
  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
3726
  case "$ac_given_srcdir" in
 
3727
    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
3728
    /*) top_srcdir="$ac_given_srcdir" ;;
 
3729
    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
3730
  esac
 
3731
 
 
3732
  # Find a way to echo strings without interpreting backslash.
 
3733
  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
 
3734
    gt_echo='echo'
 
3735
  else
 
3736
    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
 
3737
      gt_echo='printf %s\n'
 
3738
    else
 
3739
      echo_func () {
 
3740
        cat <<EOT
 
3741
$*
 
3742
EOT
 
3743
      }
 
3744
      gt_echo='echo_func'
 
3745
    fi
 
3746
  fi
 
3747
 
 
3748
  # A sed script that extracts the value of VARIABLE from a Makefile.
 
3749
  sed_x_variable='
 
3750
# Test if the hold space is empty.
 
3751
x
 
3752
s/P/P/
 
3753
x
 
3754
ta
 
3755
# Yes it was empty. Look if we have the expected variable definition.
 
3756
/^[      ]*VARIABLE[     ]*=/{
 
3757
  # Seen the first line of the variable definition.
 
3758
  s/^[   ]*VARIABLE[     ]*=//
 
3759
  ba
 
3760
}
 
3761
bd
 
3762
:a
 
3763
# Here we are processing a line from the variable definition.
 
3764
# Remove comment, more precisely replace it with a space.
 
3765
s/#.*$/ /
 
3766
# See if the line ends in a backslash.
 
3767
tb
 
3768
:b
 
3769
s/\\$//
 
3770
# Print the line, without the trailing backslash.
 
3771
p
 
3772
tc
 
3773
# There was no trailing backslash. The end of the variable definition is
 
3774
# reached. Clear the hold space.
 
3775
s/^.*$//
 
3776
x
 
3777
bd
 
3778
:c
 
3779
# A trailing backslash means that the variable definition continues in the
 
3780
# next line. Put a nonempty string into the hold space to indicate this.
 
3781
s/^.*$/P/
 
3782
x
 
3783
:d
 
3784
'
 
3785
changequote([,])dnl
 
3786
 
 
3787
  # Set POTFILES to the value of the Makefile variable POTFILES.
 
3788
  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
 
3789
  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
 
3790
  # Compute POTFILES_DEPS as
 
3791
  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
 
3792
  POTFILES_DEPS=
 
3793
  for file in $POTFILES; do
 
3794
    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
 
3795
  done
 
3796
  POMAKEFILEDEPS=""
 
3797
 
 
3798
  if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
3799
    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
3800
  fi
 
3801
  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
3802
    # The LINGUAS file contains the set of available languages.
 
3803
    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
3804
    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
3805
  else
 
3806
    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
 
3807
    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
 
3808
    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
 
3809
  fi
 
3810
  # Hide the ALL_LINGUAS assigment from automake < 1.5.
 
3811
  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
3812
  # Compute POFILES
 
3813
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
3814
  # Compute UPDATEPOFILES
 
3815
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
3816
  # Compute DUMMYPOFILES
 
3817
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
3818
  # Compute GMOFILES
 
3819
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
3820
  # Compute PROPERTIESFILES
 
3821
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
 
3822
  # Compute CLASSFILES
 
3823
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
 
3824
  # Compute QMFILES
 
3825
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
 
3826
  # Compute MSGFILES
 
3827
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
 
3828
  # Compute RESOURCESDLLFILES
 
3829
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
 
3830
  case "$ac_given_srcdir" in
 
3831
    .) srcdirpre= ;;
 
3832
    *) srcdirpre='$(srcdir)/' ;;
 
3833
  esac
 
3834
  POFILES=
 
3835
  UPDATEPOFILES=
 
3836
  DUMMYPOFILES=
 
3837
  GMOFILES=
 
3838
  PROPERTIESFILES=
 
3839
  CLASSFILES=
 
3840
  QMFILES=
 
3841
  MSGFILES=
 
3842
  RESOURCESDLLFILES=
 
3843
  for lang in $ALL_LINGUAS; do
 
3844
    POFILES="$POFILES $srcdirpre$lang.po"
 
3845
    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
3846
    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
3847
    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
3848
    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
 
3849
    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
 
3850
    QMFILES="$QMFILES $srcdirpre$lang.qm"
 
3851
    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
3852
    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
 
3853
    frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
 
3854
    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
 
3855
  done
 
3856
  # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
3857
  # environment variable.
 
3858
  INST_LINGUAS=
 
3859
  if test -n "$ALL_LINGUAS"; then
 
3860
    for presentlang in $ALL_LINGUAS; do
 
3861
      useit=no
 
3862
      if test "%UNSET%" != "$LINGUAS"; then
 
3863
        desiredlanguages="$LINGUAS"
 
3864
      else
 
3865
        desiredlanguages="$ALL_LINGUAS"
 
3866
      fi
 
3867
      for desiredlang in $desiredlanguages; do
 
3868
        # Use the presentlang catalog if desiredlang is
 
3869
        #   a. equal to presentlang, or
 
3870
        #   b. a variant of presentlang (because in this case,
 
3871
        #      presentlang can be used as a fallback for messages
 
3872
        #      which are not translated in the desiredlang catalog).
 
3873
        case "$desiredlang" in
 
3874
          "$presentlang"*) useit=yes;;
 
3875
        esac
 
3876
      done
 
3877
      if test $useit = yes; then
 
3878
        INST_LINGUAS="$INST_LINGUAS $presentlang"
 
3879
      fi
 
3880
    done
 
3881
  fi
 
3882
  CATALOGS=
 
3883
  JAVACATALOGS=
 
3884
  QTCATALOGS=
 
3885
  TCLCATALOGS=
 
3886
  CSHARPCATALOGS=
 
3887
  if test -n "$INST_LINGUAS"; then
 
3888
    for lang in $INST_LINGUAS; do
 
3889
      CATALOGS="$CATALOGS $lang.gmo"
 
3890
      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
 
3891
      QTCATALOGS="$QTCATALOGS $lang.qm"
 
3892
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
3893
      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
 
3894
      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
 
3895
      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
 
3896
    done
 
3897
  fi
 
3898
 
 
3899
  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
 
3900
  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
 
3901
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
3902
    for lang in $ALL_LINGUAS; do
 
3903
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
3904
      cat >> "$ac_file.tmp" <<EOF
 
3905
$frobbedlang.msg: $lang.po
 
3906
        @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
 
3907
        \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
3908
EOF
 
3909
    done
 
3910
  fi
 
3911
  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
 
3912
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
3913
    for lang in $ALL_LINGUAS; do
 
3914
      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
 
3915
      cat >> "$ac_file.tmp" <<EOF
 
3916
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
 
3917
        @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
 
3918
        \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
3919
EOF
 
3920
    done
 
3921
  fi
 
3922
  if test -n "$POMAKEFILEDEPS"; then
 
3923
    cat >> "$ac_file.tmp" <<EOF
 
3924
Makefile: $POMAKEFILEDEPS
 
3925
EOF
 
3926
  fi
 
3927
  mv "$ac_file.tmp" "$ac_file"
 
3928
])
 
3929
# printf-posix.m4 serial 2 (gettext-0.13.1)
 
3930
dnl Copyright (C) 2003 Free Software Foundation, Inc.
 
3931
dnl This file is free software; the Free Software Foundation
 
3932
dnl gives unlimited permission to copy and/or distribute it,
 
3933
dnl with or without modifications, as long as this notice is preserved.
 
3934
 
 
3935
dnl From Bruno Haible.
 
3936
dnl Test whether the printf() function supports POSIX/XSI format strings with
 
3937
dnl positions.
 
3938
 
 
3939
AC_DEFUN([gt_PRINTF_POSIX],
 
3940
[
 
3941
  AC_REQUIRE([AC_PROG_CC])
 
3942
  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
 
3943
    gt_cv_func_printf_posix,
 
3944
    [
 
3945
      AC_TRY_RUN([
 
3946
#include <stdio.h>
 
3947
#include <string.h>
 
3948
/* The string "%2$d %1$d", with dollar characters protected from the shell's
 
3949
   dollar expansion (possibly an autoconf bug).  */
 
3950
static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
 
3951
static char buf[100];
 
3952
int main ()
 
3953
{
 
3954
  sprintf (buf, format, 33, 55);
 
3955
  return (strcmp (buf, "55 33") != 0);
 
3956
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
 
3957
      [
 
3958
        AC_EGREP_CPP(notposix, [
 
3959
#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
 
3960
  notposix
 
3961
#endif
 
3962
        ], gt_cv_func_printf_posix="guessing no",
 
3963
           gt_cv_func_printf_posix="guessing yes")
 
3964
      ])
 
3965
    ])
 
3966
  case $gt_cv_func_printf_posix in
 
3967
    *yes)
 
3968
      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
 
3969
        [Define if your printf() function supports format strings with positions.])
 
3970
      ;;
 
3971
  esac
 
3972
])
 
3973
# progtest.m4 serial 4 (gettext-0.14.2)
 
3974
dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
 
3975
dnl This file is free software; the Free Software Foundation
 
3976
dnl gives unlimited permission to copy and/or distribute it,
 
3977
dnl with or without modifications, as long as this notice is preserved.
 
3978
dnl
 
3979
dnl This file can can be used in projects which are not available under
 
3980
dnl the GNU General Public License or the GNU Library General Public
 
3981
dnl License but which still want to provide support for the GNU gettext
 
3982
dnl functionality.
 
3983
dnl Please note that the actual code of the GNU gettext library is covered
 
3984
dnl by the GNU Library General Public License, and the rest of the GNU
 
3985
dnl gettext package package is covered by the GNU General Public License.
 
3986
dnl They are *not* in the public domain.
 
3987
 
 
3988
dnl Authors:
 
3989
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
 
3990
 
 
3991
AC_PREREQ(2.50)
 
3992
 
 
3993
# Search path for a program which passes the given test.
 
3994
 
 
3995
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
3996
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
3997
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
 
3998
[
 
3999
# Prepare PATH_SEPARATOR.
 
4000
# The user is always right.
 
4001
if test "${PATH_SEPARATOR+set}" != set; then
 
4002
  echo "#! /bin/sh" >conf$$.sh
 
4003
  echo  "exit 0"   >>conf$$.sh
 
4004
  chmod +x conf$$.sh
 
4005
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
4006
    PATH_SEPARATOR=';'
 
4007
  else
 
4008
    PATH_SEPARATOR=:
 
4009
  fi
 
4010
  rm -f conf$$.sh
 
4011
fi
 
4012
 
 
4013
# Find out how to test for executable files. Don't use a zero-byte file,
 
4014
# as systems may use methods other than mode bits to determine executability.
 
4015
cat >conf$$.file <<_ASEOF
 
4016
#! /bin/sh
 
4017
exit 0
 
4018
_ASEOF
 
4019
chmod +x conf$$.file
 
4020
if test -x conf$$.file >/dev/null 2>&1; then
 
4021
  ac_executable_p="test -x"
 
4022
else
 
4023
  ac_executable_p="test -f"
 
4024
fi
 
4025
rm -f conf$$.file
 
4026
 
 
4027
# Extract the first word of "$2", so it can be a program name with args.
 
4028
set dummy $2; ac_word=[$]2
 
4029
AC_MSG_CHECKING([for $ac_word])
 
4030
AC_CACHE_VAL(ac_cv_path_$1,
 
4031
[case "[$]$1" in
 
4032
  [[\\/]]* | ?:[[\\/]]*)
 
4033
    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
4034
    ;;
 
4035
  *)
 
4036
    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
 
4037
    for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
4038
      IFS="$ac_save_IFS"
 
4039
      test -z "$ac_dir" && ac_dir=.
 
4040
      for ac_exec_ext in '' $ac_executable_extensions; do
 
4041
        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
 
4042
          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
 
4043
          if [$3]; then
 
4044
            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
 
4045
            break 2
 
4046
          fi
 
4047
        fi
 
4048
      done
 
4049
    done
 
4050
    IFS="$ac_save_IFS"
 
4051
dnl If no 4th arg is given, leave the cache variable unset,
 
4052
dnl so AC_PATH_PROGS will keep looking.
 
4053
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
4054
])dnl
 
4055
    ;;
 
4056
esac])dnl
 
4057
$1="$ac_cv_path_$1"
 
4058
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
4059
  AC_MSG_RESULT([$]$1)
 
4060
else
 
4061
  AC_MSG_RESULT(no)
 
4062
fi
 
4063
AC_SUBST($1)dnl
 
4064
])
871
4065
dnl qt.m4
872
4066
dnl Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
873
4067
 
1038
4232
LDFLAGS="$saved_LDFLAGS"
1039
4233
LIBS="$saved_LIBS"
1040
4234
])
 
4235
# size_max.m4 serial 5
 
4236
dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
 
4237
dnl This file is free software; the Free Software Foundation
 
4238
dnl gives unlimited permission to copy and/or distribute it,
 
4239
dnl with or without modifications, as long as this notice is preserved.
 
4240
 
 
4241
dnl From Bruno Haible.
 
4242
 
 
4243
AC_DEFUN([gl_SIZE_MAX],
 
4244
[
 
4245
  AC_CHECK_HEADERS(stdint.h)
 
4246
  dnl First test whether the system already has SIZE_MAX.
 
4247
  AC_MSG_CHECKING([for SIZE_MAX])
 
4248
  AC_CACHE_VAL([gl_cv_size_max], [
 
4249
    gl_cv_size_max=
 
4250
    AC_EGREP_CPP([Found it], [
 
4251
#include <limits.h>
 
4252
#if HAVE_STDINT_H
 
4253
#include <stdint.h>
 
4254
#endif
 
4255
#ifdef SIZE_MAX
 
4256
Found it
 
4257
#endif
 
4258
], gl_cv_size_max=yes)
 
4259
    if test -z "$gl_cv_size_max"; then
 
4260
      dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
 
4261
      dnl than the type 'unsigned long'. Try hard to find a definition that can
 
4262
      dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
 
4263
      _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
 
4264
        [#include <stddef.h>
 
4265
#include <limits.h>], size_t_bits_minus_1=)
 
4266
      _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
 
4267
        [#include <stddef.h>], fits_in_uint=)
 
4268
      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
 
4269
        if test $fits_in_uint = 1; then
 
4270
          dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
 
4271
          dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
 
4272
          AC_TRY_COMPILE([#include <stddef.h>
 
4273
            extern size_t foo;
 
4274
            extern unsigned long foo;
 
4275
            ], [], fits_in_uint=0)
 
4276
        fi
 
4277
        dnl We cannot use 'expr' to simplify this expression, because 'expr'
 
4278
        dnl works only with 'long' integers in the host environment, while we
 
4279
        dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
 
4280
        if test $fits_in_uint = 1; then
 
4281
          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
 
4282
        else
 
4283
          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
 
4284
        fi
 
4285
      else
 
4286
        dnl Shouldn't happen, but who knows...
 
4287
        gl_cv_size_max='((size_t)~(size_t)0)'
 
4288
      fi
 
4289
    fi
 
4290
  ])
 
4291
  AC_MSG_RESULT([$gl_cv_size_max])
 
4292
  if test "$gl_cv_size_max" != yes; then
 
4293
    AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
 
4294
      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
 
4295
  fi
 
4296
])
 
4297
# stdint_h.m4 serial 6
 
4298
dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
 
4299
dnl This file is free software; the Free Software Foundation
 
4300
dnl gives unlimited permission to copy and/or distribute it,
 
4301
dnl with or without modifications, as long as this notice is preserved.
 
4302
 
 
4303
dnl From Paul Eggert.
 
4304
 
 
4305
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
 
4306
# doesn't clash with <sys/types.h>, and declares uintmax_t.
 
4307
 
 
4308
AC_DEFUN([gl_AC_HEADER_STDINT_H],
 
4309
[
 
4310
  AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
 
4311
  [AC_TRY_COMPILE(
 
4312
    [#include <sys/types.h>
 
4313
#include <stdint.h>],
 
4314
    [uintmax_t i = (uintmax_t) -1; return !i;],
 
4315
    gl_cv_header_stdint_h=yes,
 
4316
    gl_cv_header_stdint_h=no)])
 
4317
  if test $gl_cv_header_stdint_h = yes; then
 
4318
    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
 
4319
      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
 
4320
       and declares uintmax_t. ])
 
4321
  fi
 
4322
])
 
4323
# uintmax_t.m4 serial 9
 
4324
dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
 
4325
dnl This file is free software; the Free Software Foundation
 
4326
dnl gives unlimited permission to copy and/or distribute it,
 
4327
dnl with or without modifications, as long as this notice is preserved.
 
4328
 
 
4329
dnl From Paul Eggert.
 
4330
 
 
4331
AC_PREREQ(2.13)
 
4332
 
 
4333
# Define uintmax_t to 'unsigned long' or 'unsigned long long'
 
4334
# if it is not already defined in <stdint.h> or <inttypes.h>.
 
4335
 
 
4336
AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
 
4337
[
 
4338
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
4339
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
4340
  if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
 
4341
    AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
 
4342
    test $ac_cv_type_unsigned_long_long = yes \
 
4343
      && ac_type='unsigned long long' \
 
4344
      || ac_type='unsigned long'
 
4345
    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
 
4346
      [Define to unsigned long or unsigned long long
 
4347
       if <stdint.h> and <inttypes.h> don't define.])
 
4348
  else
 
4349
    AC_DEFINE(HAVE_UINTMAX_T, 1,
 
4350
      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
 
4351
  fi
 
4352
])
 
4353
# ulonglong.m4 serial 6
 
4354
dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
 
4355
dnl This file is free software; the Free Software Foundation
 
4356
dnl gives unlimited permission to copy and/or distribute it,
 
4357
dnl with or without modifications, as long as this notice is preserved.
 
4358
 
 
4359
dnl From Paul Eggert.
 
4360
 
 
4361
# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
 
4362
# This fixes a bug in Autoconf 2.60, but can be removed once we
 
4363
# assume 2.61 everywhere.
 
4364
 
 
4365
# Note: If the type 'unsigned long long int' exists but is only 32 bits
 
4366
# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
 
4367
# will not be defined. In this case you can treat 'unsigned long long int'
 
4368
# like 'unsigned long int'.
 
4369
 
 
4370
AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
 
4371
[
 
4372
  AC_CACHE_CHECK([for unsigned long long int],
 
4373
    [ac_cv_type_unsigned_long_long_int],
 
4374
    [AC_LINK_IFELSE(
 
4375
       [AC_LANG_PROGRAM(
 
4376
          [[unsigned long long int ull = 18446744073709551615ULL;
 
4377
            typedef int a[(18446744073709551615ULL <= (unsigned long long int) -1
 
4378
                           ? 1 : -1)];
 
4379
           int i = 63;]],
 
4380
          [[unsigned long long int ullmax = 18446744073709551615ull;
 
4381
            return (ull << 63 | ull >> 63 | ull << i | ull >> i
 
4382
                    | ullmax / ull | ullmax % ull);]])],
 
4383
       [ac_cv_type_unsigned_long_long_int=yes],
 
4384
       [ac_cv_type_unsigned_long_long_int=no])])
 
4385
  if test $ac_cv_type_unsigned_long_long_int = yes; then
 
4386
    AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
 
4387
      [Define to 1 if the system has the type `unsigned long long int'.])
 
4388
  fi
 
4389
])
 
4390
 
 
4391
# This macro is obsolescent and should go away soon.
 
4392
AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
 
4393
[
 
4394
  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
 
4395
  ac_cv_type_unsigned_long_long=$ac_cv_type_unsigned_long_long_int
 
4396
  if test $ac_cv_type_unsigned_long_long = yes; then
 
4397
    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
 
4398
      [Define if you have the 'unsigned long long' type.])
 
4399
  fi
 
4400
])
 
4401
# visibility.m4 serial 1 (gettext-0.15)
 
4402
dnl Copyright (C) 2005 Free Software Foundation, Inc.
 
4403
dnl This file is free software; the Free Software Foundation
 
4404
dnl gives unlimited permission to copy and/or distribute it,
 
4405
dnl with or without modifications, as long as this notice is preserved.
 
4406
 
 
4407
dnl From Bruno Haible.
 
4408
 
 
4409
dnl Tests whether the compiler supports the command-line option
 
4410
dnl -fvisibility=hidden and the function and variable attributes
 
4411
dnl __attribute__((__visibility__("hidden"))) and
 
4412
dnl __attribute__((__visibility__("default"))).
 
4413
dnl Does *not* test for __visibility__("protected") - which has tricky
 
4414
dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
 
4415
dnl MacOS X.
 
4416
dnl Does *not* test for __visibility__("internal") - which has processor
 
4417
dnl dependent semantics.
 
4418
dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
 
4419
dnl "really only recommended for legacy code".
 
4420
dnl Set the variable CFLAG_VISIBILITY.
 
4421
dnl Defines and sets the variable HAVE_VISIBILITY.
 
4422
 
 
4423
AC_DEFUN([gl_VISIBILITY],
 
4424
[
 
4425
  AC_REQUIRE([AC_PROG_CC])
 
4426
  CFLAG_VISIBILITY=
 
4427
  HAVE_VISIBILITY=0
 
4428
  if test -n "$GCC"; then
 
4429
    AC_MSG_CHECKING([for simple visibility declarations])
 
4430
    AC_CACHE_VAL(gl_cv_cc_visibility, [
 
4431
      gl_save_CFLAGS="$CFLAGS"
 
4432
      CFLAGS="$CFLAGS -fvisibility=hidden"
 
4433
      AC_TRY_COMPILE(
 
4434
        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
 
4435
         extern __attribute__((__visibility__("default"))) int exportedvar;
 
4436
         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
 
4437
         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
 
4438
        [],
 
4439
        gl_cv_cc_visibility=yes,
 
4440
        gl_cv_cc_visibility=no)
 
4441
      CFLAGS="$gl_save_CFLAGS"])
 
4442
    AC_MSG_RESULT([$gl_cv_cc_visibility])
 
4443
    if test $gl_cv_cc_visibility = yes; then
 
4444
      CFLAG_VISIBILITY="-fvisibility=hidden"
 
4445
      HAVE_VISIBILITY=1
 
4446
    fi
 
4447
  fi
 
4448
  AC_SUBST([CFLAG_VISIBILITY])
 
4449
  AC_SUBST([HAVE_VISIBILITY])
 
4450
  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
 
4451
    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
 
4452
])
1041
4453
# Configure paths for libvorbis
1042
4454
# Jack Moffitt <jack@icecast.org> 10-21-2000
1043
4455
# Shamelessly stolen from Owen Taylor and Manish Singh
1138
4550
  AC_SUBST(VORBISENC_LIBS)
1139
4551
  rm -f conf.vorbistest
1140
4552
])
 
4553
# wchar_t.m4 serial 1 (gettext-0.12)
 
4554
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 
4555
dnl This file is free software; the Free Software Foundation
 
4556
dnl gives unlimited permission to copy and/or distribute it,
 
4557
dnl with or without modifications, as long as this notice is preserved.
 
4558
 
 
4559
dnl From Bruno Haible.
 
4560
dnl Test whether <stddef.h> has the 'wchar_t' type.
 
4561
dnl Prerequisite: AC_PROG_CC
 
4562
 
 
4563
AC_DEFUN([gt_TYPE_WCHAR_T],
 
4564
[
 
4565
  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
 
4566
    [AC_TRY_COMPILE([#include <stddef.h>
 
4567
       wchar_t foo = (wchar_t)'\0';], ,
 
4568
       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
 
4569
  if test $gt_cv_c_wchar_t = yes; then
 
4570
    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
 
4571
  fi
 
4572
])
 
4573
# wint_t.m4 serial 1 (gettext-0.12)
 
4574
dnl Copyright (C) 2003 Free Software Foundation, Inc.
 
4575
dnl This file is free software; the Free Software Foundation
 
4576
dnl gives unlimited permission to copy and/or distribute it,
 
4577
dnl with or without modifications, as long as this notice is preserved.
 
4578
 
 
4579
dnl From Bruno Haible.
 
4580
dnl Test whether <wchar.h> has the 'wint_t' type.
 
4581
dnl Prerequisite: AC_PROG_CC
 
4582
 
 
4583
AC_DEFUN([gt_TYPE_WINT_T],
 
4584
[
 
4585
  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
 
4586
    [AC_TRY_COMPILE([#include <wchar.h>
 
4587
       wint_t foo = (wchar_t)'\0';], ,
 
4588
       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
 
4589
  if test $gt_cv_c_wint_t = yes; then
 
4590
    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
 
4591
  fi
 
4592
])
 
4593
# xsize.m4 serial 3
 
4594
dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
 
4595
dnl This file is free software; the Free Software Foundation
 
4596
dnl gives unlimited permission to copy and/or distribute it,
 
4597
dnl with or without modifications, as long as this notice is preserved.
 
4598
 
 
4599
AC_DEFUN([gl_XSIZE],
 
4600
[
 
4601
  dnl Prerequisites of lib/xsize.h.
 
4602
  AC_REQUIRE([gl_SIZE_MAX])
 
4603
  AC_REQUIRE([AC_C_INLINE])
 
4604
  AC_CHECK_HEADERS(stdint.h)
 
4605
])