~ubuntu-branches/debian/sid/vorbis-tools/sid

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jesus Climent
  • Date: 2005-04-10 09:22:24 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050410092224-xtukpa3qghghhjje
Tags: 1.0.1-1.3
* Authorized NMU.
* Modified alsa to mention alsa09 (although the device might be nowadays
  alsa, back, since alsa1.0 has been already released). (Closes: #258286)
* Modified the manpage/help message for vorbiscomment to make it a bit more
  userfiendly: Closes: #252531.
* Added oggdec to the long description field, so that it triggers apt-cache
  searches: Closes: #274894.
* Typos in manpages: Closes: #302150.
* Escaped dashes in manpage: Closes: #264365.
* Quiet option is actually with -Q, not -q (Closes: #211289) Reported
  upstream but patched for Debian.
* Change input.wav with inputfile, since we accept flac-formated files:
  Closes: #262509.
* Translation bits:
  * Updated translation hu.po: Closes: #272037.
  * French translation correction: Encodage -> Codage (Closes: #248431).
  * debian/rules: remove .gmo's to avoid clash with uploaded tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# Jack Moffitt <jack@icecast.org> 10-21-2000
3
3
# Shamelessly stolen from Owen Taylor and Manish Singh
4
4
 
5
 
dnl AM_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
5
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
6
6
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
7
7
dnl
8
 
AC_DEFUN(AM_PATH_OGG,
 
8
AC_DEFUN(XIPH_PATH_OGG,
9
9
[dnl 
10
10
dnl Get the cflags and libraries
11
11
dnl
106
106
# Jack Moffitt <jack@icecast.org> 10-21-2000
107
107
# Shamelessly stolen from Owen Taylor and Manish Singh
108
108
 
109
 
dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
109
dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
110
110
dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
111
111
dnl
112
 
AC_DEFUN(AM_PATH_VORBIS,
 
112
AC_DEFUN(XIPH_PATH_VORBIS,
113
113
[dnl 
114
114
dnl Get the cflags and libraries
115
115
dnl
128
128
 
129
129
  VORBISFILE_LIBS="$VORBIS_LIBS -lvorbisfile"
130
130
  VORBISENC_LIBS="$VORBIS_LIBS -lvorbisenc"
131
 
  VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
 
131
  VORBIS_LIBS="$VORBIS_LIBS -lvorbis"
132
132
 
133
133
  if test "x$vorbis_includes" != "x" ; then
134
134
    VORBIS_CFLAGS="-I$vorbis_includes"
138
138
    VORBIS_CFLAGS="-I$prefix/include"
139
139
  fi
140
140
 
 
141
  xiph_saved_LIBS="$LIBS"
 
142
  LIBS=""
 
143
  AC_SEARCH_LIBS(cos, m, [VORBIS_LIBS="$VORBIS_LIBS $LIBS"], [
 
144
    AC_MSG_WARN([cos() not found in math library, vorbis installation may not work])
 
145
  ])
 
146
  LIBS="$xiph_saved_LIBS"
141
147
 
142
148
  AC_MSG_CHECKING(for Vorbis)
143
149
  no_vorbis=""
217
223
# Jack Moffitt <jack@icecast.org> 10-21-2000
218
224
# Shamelessly stolen from Owen Taylor and Manish Singh
219
225
 
220
 
dnl AM_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
 
226
dnl XIPH_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
221
227
dnl Test for libao, and define AO_CFLAGS and AO_LIBS
222
228
dnl
223
 
AC_DEFUN(AM_PATH_AO,
 
229
AC_DEFUN(XIPH_PATH_AO,
224
230
[dnl 
225
231
dnl Get the cflags and libraries
226
232
dnl
229
235
AC_ARG_WITH(ao-includes,[  --with-ao-includes=DIR   Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="")
230
236
AC_ARG_ENABLE(aotest, [  --disable-aotest       Do not try to compile and run a test ao program],, enable_aotest=yes)
231
237
 
232
 
 
233
 
  if test "x$ao_libraries" != "x" ; then
234
 
    AO_LIBS="-L$ao_libraries"
235
 
  elif test "x$ao_prefix" != "x"; then
236
 
    AO_LIBS="-L$ao_prefix/lib"
237
 
  elif test "x$prefix" != "xNONE"; then
238
 
    AO_LIBS="-L$prefix/lib"
239
 
  fi
240
 
 
241
 
  if test "x$ao_includes" != "x" ; then
242
 
    AO_CFLAGS="-I$ao_includes"
243
 
  elif test "x$ao_prefix" != "x"; then
244
 
    AO_CFLAGS="-I$ao_prefix/include"
245
 
  elif test "x$prefix" != "xNONE"; then
246
 
    AO_CFLAGS="-I$prefix/include"
247
 
  fi
248
 
 
249
 
  # see where dl* and friends live
250
 
  AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
251
 
    AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
252
 
      AC_MSG_ERROR([could not find dlopen() needed by libao sound drivers
253
 
      your system may not be supported.])
 
238
  if test "x$ao_prefix" != "xno"
 
239
  then
 
240
    if test "x$ao_libraries" != "x" ; then
 
241
      AO_LIBS="-L$ao_libraries"
 
242
    elif test "x$ao_prefix" != "x" -a "x$ao_prefix" != "xyes"; then
 
243
      AO_LIBS="-L$ao_prefix/lib"
 
244
    elif test "x$prefix" != "xNONE"; then
 
245
      AO_LIBS="-L$prefix/lib"
 
246
    fi
 
247
 
 
248
    if test "x$ao_includes" != "x" ; then
 
249
      AO_CFLAGS="-I$ao_includes"
 
250
    elif test "x$ao_prefix" != "x" -a "x$ao_prefix" != "xyes"; then
 
251
      AO_CFLAGS="-I$ao_prefix/include"
 
252
    elif test "x$prefix" != "xNONE"; then
 
253
      AO_CFLAGS="-I$prefix/include"
 
254
    fi
 
255
 
 
256
    # see where dl* and friends live
 
257
    AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
 
258
      AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
 
259
        AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
 
260
        your system may not be supported.])
 
261
      ])
254
262
    ])
255
 
  ])
256
 
 
257
 
  AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
258
 
 
259
 
  AC_MSG_CHECKING(for ao)
260
 
  no_ao=""
261
 
 
262
 
 
263
 
  if test "x$enable_aotest" = "xyes" ; then
264
 
    ac_save_CFLAGS="$CFLAGS"
265
 
    ac_save_LIBS="$LIBS"
266
 
    CFLAGS="$CFLAGS $AO_CFLAGS"
267
 
    LIBS="$LIBS $AO_LIBS"
 
263
 
 
264
    AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
 
265
 
 
266
    AC_MSG_CHECKING(for ao)
 
267
    no_ao=""
 
268
 
 
269
 
 
270
    if test "x$enable_aotest" = "xyes" ; then
 
271
      ac_save_CFLAGS="$CFLAGS"
 
272
      ac_save_LIBS="$LIBS"
 
273
      CFLAGS="$CFLAGS $AO_CFLAGS"
 
274
      LIBS="$LIBS $AO_LIBS"
268
275
dnl
269
276
dnl Now check if the installed ao is sufficiently new.
270
277
dnl
284
291
],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
285
292
       CFLAGS="$ac_save_CFLAGS"
286
293
       LIBS="$ac_save_LIBS"
287
 
  fi
 
294
    fi
288
295
 
289
 
  if test "x$no_ao" = "x" ; then
290
 
     AC_MSG_RESULT(yes)
291
 
     ifelse([$1], , :, [$1])     
292
 
  else
293
 
     AC_MSG_RESULT(no)
294
 
     if test -f conf.aotest ; then
295
 
       :
296
 
     else
297
 
       echo "*** Could not run ao test program, checking why..."
298
 
       CFLAGS="$CFLAGS $AO_CFLAGS"
299
 
       LIBS="$LIBS $AO_LIBS"
 
296
    if test "x$no_ao" = "x" ; then
 
297
       AC_MSG_RESULT(yes)
 
298
       ifelse([$1], , :, [$1])     
 
299
    else
 
300
       AC_MSG_RESULT(no)
 
301
       if test -f conf.aotest ; then
 
302
         :
 
303
       else
 
304
         echo "*** Could not run ao test program, checking why..."
 
305
         CFLAGS="$CFLAGS $AO_CFLAGS"
 
306
         LIBS="$LIBS $AO_LIBS"
300
307
       AC_TRY_LINK([
301
308
#include <stdio.h>
302
309
#include <ao/ao.h>
303
 
],     [ return 0; ],
304
 
       [ echo "*** The test program compiled, but did not run. This usually means"
305
 
       echo "*** that the run-time linker is not finding ao or finding the wrong"
306
 
       echo "*** version of ao. If it is not finding ao, you'll need to set your"
307
 
       echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
308
 
       echo "*** to the installed location  Also, make sure you have run ldconfig if that"
309
 
       echo "*** is required on your system"
310
 
       echo "***"
311
 
       echo "*** If you have an old version installed, it is best to remove it, although"
312
 
       echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
313
 
       [ echo "*** The test program failed to compile or link. See the file config.log for the"
314
 
       echo "*** exact error that occured. This usually means ao was incorrectly installed"
315
 
       echo "*** or that you have moved ao since it was installed." ])
316
 
       CFLAGS="$ac_save_CFLAGS"
317
 
       LIBS="$ac_save_LIBS"
318
 
     fi
319
 
     AO_CFLAGS=""
320
 
     AO_LIBS=""
321
 
     ifelse([$2], , :, [$2])
 
310
],       [ return 0; ],
 
311
         [ echo "*** The test program compiled, but did not run. This usually means"
 
312
         echo "*** that the run-time linker is not finding ao or finding the wrong"
 
313
         echo "*** version of ao. If it is not finding ao, you'll need to set your"
 
314
         echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
315
         echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
316
         echo "*** is required on your system"
 
317
         echo "***"
 
318
         echo "*** If you have an old version installed, it is best to remove it, although"
 
319
         echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
 
320
         [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
321
         echo "*** exact error that occured. This usually means ao was incorrectly installed"
 
322
         echo "*** or that you have moved ao since it was installed." ])
 
323
         CFLAGS="$ac_save_CFLAGS"
 
324
         LIBS="$ac_save_LIBS"
 
325
       fi
 
326
       AO_CFLAGS=""
 
327
       AO_LIBS=""
 
328
       ifelse([$2], , :, [$2])
 
329
    fi
 
330
    AC_SUBST(AO_CFLAGS)
 
331
    AC_SUBST(AO_LIBS)
 
332
    rm -f conf.aotest
322
333
  fi
323
 
  AC_SUBST(AO_CFLAGS)
324
 
  AC_SUBST(AO_LIBS)
325
 
  rm -f conf.aotest
326
334
])
327
335
 
328
336
dnl This macros shamelessly stolen from
423
431
AC_ARG_WITH(curl-includes,[  --with-curl-includes=DIR   Directory where libcurl header files are installed (optional)], curl_includes="$withval", curl_includes="")
424
432
AC_ARG_ENABLE(curltest, [  --disable-curltest       Do not try to compile and run a test libcurl program],, enable_curltest=yes)
425
433
 
 
434
if test "x$curl_prefix" != "xno" ; then
 
435
 
426
436
  if test "x$curl_libraries" != "x" ; then
427
437
    CURL_LIBS="-L$curl_libraries"
428
438
  elif test "x$curl_prefix" != "x" ; then
505
515
     CURL_LIBS=""
506
516
     ifelse([$2], , :, [$2])
507
517
  fi
 
518
  AC_DEFINE(HAVE_CURL, 1, [Define if you have libcurl.])
 
519
else
 
520
  CURL_CFLAGS=""
 
521
  CURL_LIBS=""
 
522
fi
508
523
  AC_SUBST(CURL_CFLAGS)
509
524
  AC_SUBST(CURL_LIBS)
510
525
  rm -f conf.curltest
700
715
fi
701
716
 
702
717
])
 
718
 
 
719
# Macro to add for using GNU gettext.
 
720
# Ulrich Drepper <drepper@cygnus.com>, 1995.
 
721
#
 
722
# This file can be copied and used freely without restrictions.  It can
 
723
# be used in projects which are not available under the GNU General Public
 
724
# License or the GNU Library General Public License but which still want
 
725
# to provide support for the GNU gettext functionality.
 
726
# Please note that the actual code of the GNU gettext library is covered
 
727
# by the GNU Library General Public License, and the rest of the GNU
 
728
# gettext package package is covered by the GNU General Public License.
 
729
# They are *not* in the public domain.
 
730
 
 
731
# serial 10
 
732
 
 
733
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
 
734
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
 
735
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 
736
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
 
737
dnl    AM-DISABLE-SHARED). Otherwise, a static library
 
738
dnl    $(top_builddir)/intl/libintl.a will be created.
 
739
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 
740
dnl    implementations (in libc or libintl) without the ngettext() function
 
741
dnl    will be ignored.
 
742
dnl LIBDIR is used to find the intl libraries.  If empty,
 
743
dnl    the value `$(top_builddir)/intl/' is used.
 
744
dnl
 
745
dnl The result of the configuration is one of three cases:
 
746
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
 
747
dnl    and used.
 
748
dnl    Catalog format: GNU --> install in $(datadir)
 
749
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
750
dnl 2) GNU gettext has been found in the system's C library.
 
751
dnl    Catalog format: GNU --> install in $(datadir)
 
752
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
753
dnl 3) No internationalization, always use English msgid.
 
754
dnl    Catalog format: none
 
755
dnl    Catalog extension: none
 
756
dnl The use of .gmo is historical (it was needed to avoid overwriting the
 
757
dnl GNU format catalogs when building on a platform with an X/Open gettext),
 
758
dnl but we keep it in order not to force irrelevant filename changes on the
 
759
dnl maintainers.
 
760
dnl
 
761
AC_DEFUN([AM_WITH_NLS],
 
762
  [AC_MSG_CHECKING([whether NLS is requested])
 
763
    dnl Default is enabled NLS
 
764
    AC_ARG_ENABLE(nls,
 
765
      [  --disable-nls           do not use Native Language Support],
 
766
      USE_NLS=$enableval, USE_NLS=yes)
 
767
    AC_MSG_RESULT($USE_NLS)
 
768
    AC_SUBST(USE_NLS)
 
769
 
 
770
    BUILD_INCLUDED_LIBINTL=no
 
771
    USE_INCLUDED_LIBINTL=no
 
772
    INTLLIBS=
 
773
 
 
774
    dnl If we use NLS figure out what method
 
775
    if test "$USE_NLS" = "yes"; then
 
776
      AC_DEFINE(ENABLE_NLS, 1,
 
777
        [Define to 1 if translation of program messages to the user's native language
 
778
   is requested.])
 
779
      AC_MSG_CHECKING([whether included gettext is requested])
 
780
      AC_ARG_WITH(included-gettext,
 
781
        [  --with-included-gettext use the GNU gettext library included here],
 
782
        nls_cv_force_use_gnu_gettext=$withval,
 
783
        nls_cv_force_use_gnu_gettext=no)
 
784
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 
785
 
 
786
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
 
787
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 
788
        dnl User does not insist on using GNU NLS library.  Figure out what
 
789
        dnl to use.  If GNU gettext is available we use this.  Else we have
 
790
        dnl to fall back to GNU NLS library.
 
791
        CATOBJEXT=NONE
 
792
 
 
793
        dnl Add a version number to the cache macros.
 
794
        define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
 
795
        define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
 
796
 
 
797
        AC_CHECK_HEADER(libintl.h,
 
798
          [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
 
799
            [AC_TRY_LINK([#include <libintl.h>
 
800
extern int _nl_msg_cat_cntr;],
 
801
               [bindtextdomain ("", "");
 
802
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
 
803
               gt_cv_func_gnugettext_libc=yes,
 
804
               gt_cv_func_gnugettext_libc=no)])
 
805
 
 
806
           if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
807
             AC_CACHE_CHECK([for GNU gettext in libintl],
 
808
               gt_cv_func_gnugettext_libintl,
 
809
               [gt_save_LIBS="$LIBS"
 
810
                LIBS="$LIBS -lintl $LIBICONV"
 
811
                AC_TRY_LINK([#include <libintl.h>
 
812
extern int _nl_msg_cat_cntr;],
 
813
                  [bindtextdomain ("", "");
 
814
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
 
815
                  gt_cv_func_gnugettext_libintl=yes,
 
816
                  gt_cv_func_gnugettext_libintl=no)
 
817
                LIBS="$gt_save_LIBS"])
 
818
           fi
 
819
 
 
820
           dnl If an already present or preinstalled GNU gettext() is found,
 
821
           dnl use it.  But if this macro is used in GNU gettext, and GNU
 
822
           dnl gettext is already preinstalled in libintl, we update this
 
823
           dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
 
824
           if test "$gt_cv_func_gnugettext_libc" = "yes" \
 
825
              || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
 
826
                   && test "$PACKAGE" != gettext; }; then
 
827
             AC_DEFINE(HAVE_GETTEXT, 1,
 
828
               [Define if the GNU gettext() function is already present or preinstalled.])
 
829
 
 
830
             if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
831
               dnl If iconv() is in a separate libiconv library, then anyone
 
832
               dnl linking with libintl{.a,.so} also needs to link with
 
833
               dnl libiconv.
 
834
               INTLLIBS="-lintl $LIBICONV"
 
835
             fi
 
836
 
 
837
             gt_save_LIBS="$LIBS"
 
838
             LIBS="$LIBS $INTLLIBS"
 
839
             AC_CHECK_FUNCS(dcgettext)
 
840
             LIBS="$gt_save_LIBS"
 
841
 
 
842
             dnl Search for GNU msgfmt in the PATH.
 
843
             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
844
               [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
 
845
             AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
846
 
 
847
             dnl Search for GNU xgettext in the PATH.
 
848
             AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
849
               [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
 
850
 
 
851
             CATOBJEXT=.gmo
 
852
           fi
 
853
        ])
 
854
 
 
855
        if test "$CATOBJEXT" = "NONE"; then
 
856
          dnl GNU gettext is not found in the C library.
 
857
          dnl Fall back on GNU gettext library.
 
858
          nls_cv_use_gnu_gettext=yes
 
859
        fi
 
860
      fi
 
861
 
 
862
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
 
863
        dnl Mark actions used to generate GNU NLS library.
 
864
        INTLOBJS="\$(GETTOBJS)"
 
865
        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
866
          [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
 
867
        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
868
        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
869
          [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
 
870
        AC_SUBST(MSGFMT)
 
871
        BUILD_INCLUDED_LIBINTL=yes
 
872
        USE_INCLUDED_LIBINTL=yes
 
873
        CATOBJEXT=.gmo
 
874
        INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
 
875
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
 
876
      fi
 
877
 
 
878
      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
 
879
      dnl Test whether we really found GNU msgfmt.
 
880
      if test "$GMSGFMT" != ":"; then
 
881
        dnl If it is no GNU msgfmt we define it as : so that the
 
882
        dnl Makefiles still can work.
 
883
        if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
 
884
          : ;
 
885
        else
 
886
          AC_MSG_RESULT(
 
887
            [found msgfmt program is not GNU msgfmt; ignore it])
 
888
          GMSGFMT=":"
 
889
        fi
 
890
      fi
 
891
 
 
892
      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
 
893
      dnl Test whether we really found GNU xgettext.
 
894
      if test "$XGETTEXT" != ":"; then
 
895
        dnl If it is no GNU xgettext we define it as : so that the
 
896
        dnl Makefiles still can work.
 
897
        if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
 
898
          : ;
 
899
        else
 
900
          AC_MSG_RESULT(
 
901
            [found xgettext program is not GNU xgettext; ignore it])
 
902
          XGETTEXT=":"
 
903
        fi
 
904
      fi
 
905
 
 
906
      dnl We need to process the po/ directory.
 
907
      POSUB=po
 
908
    fi
 
909
    AC_OUTPUT_COMMANDS(
 
910
     [for ac_file in $CONFIG_FILES; do
 
911
        # Support "outfile[:infile[:infile...]]"
 
912
        case "$ac_file" in
 
913
          *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
 
914
        esac
 
915
        # PO directories have a Makefile.in generated from Makefile.in.in.
 
916
        case "$ac_file" in */Makefile.in)
 
917
          # Adjust a relative srcdir.
 
918
          ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
919
          ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
920
          ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
921
          # In autoconf-2.13 it is called $ac_given_srcdir.
 
922
          # In autoconf-2.50 it is called $srcdir.
 
923
          test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
924
          case "$ac_given_srcdir" in
 
925
            .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
926
            /*) top_srcdir="$ac_given_srcdir" ;;
 
927
            *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
928
          esac
 
929
          if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
 
930
            rm -f "$ac_dir/POTFILES"
 
931
            test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
 
932
            sed -e "/^#/d" -e "/^[      ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
 
933
            test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
 
934
            sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
 
935
          fi
 
936
          ;;
 
937
        esac
 
938
      done])
 
939
 
 
940
 
 
941
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
 
942
    dnl to 'yes' because some of the testsuite requires it.
 
943
    if test "$PACKAGE" = gettext; then
 
944
      BUILD_INCLUDED_LIBINTL=yes
 
945
    fi
 
946
 
 
947
    dnl intl/plural.c is generated from intl/plural.y. It requires bison,
 
948
    dnl because plural.y uses bison specific features. It requires at least
 
949
    dnl bison-1.26 because earlier versions generate a plural.c that doesn't
 
950
    dnl compile.
 
951
    dnl bison is only needed for the maintainer (who touches plural.y). But in
 
952
    dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
 
953
    dnl the rule in general Makefile. Now, some people carelessly touch the
 
954
    dnl files or have a broken "make" program, hence the plural.c rule will
 
955
    dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
 
956
    dnl present or too old.
 
957
    AC_CHECK_PROGS([INTLBISON], [bison])
 
958
    if test -z "$INTLBISON"; then
 
959
      ac_verc_fail=yes
 
960
    else
 
961
      dnl Found it, now check the version.
 
962
      AC_MSG_CHECKING([version of bison])
 
963
changequote(<<,>>)dnl
 
964
      ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
 
965
      case $ac_prog_version in
 
966
        '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
 
967
        1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
 
968
changequote([,])dnl
 
969
           ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
 
970
        *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
971
      esac
 
972
      AC_MSG_RESULT([$ac_prog_version])
 
973
    fi
 
974
    if test $ac_verc_fail = yes; then
 
975
      INTLBISON=:
 
976
    fi
 
977
 
 
978
    dnl These rules are solely for the distribution goal.  While doing this
 
979
    dnl we only have to keep exactly one list of the available catalogs
 
980
    dnl in configure.in.
 
981
    for lang in $ALL_LINGUAS; do
 
982
      GMOFILES="$GMOFILES $lang.gmo"
 
983
      POFILES="$POFILES $lang.po"
 
984
    done
 
985
 
 
986
    dnl Make all variables we use known to autoconf.
 
987
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
988
    AC_SUBST(USE_INCLUDED_LIBINTL)
 
989
    AC_SUBST(CATALOGS)
 
990
    AC_SUBST(CATOBJEXT)
 
991
    AC_SUBST(GMOFILES)
 
992
    AC_SUBST(INTLLIBS)
 
993
    AC_SUBST(INTLOBJS)
 
994
    AC_SUBST(POFILES)
 
995
    AC_SUBST(POSUB)
 
996
 
 
997
    dnl For backward compatibility. Some configure.ins may be using this.
 
998
    nls_cv_header_intl=
 
999
    nls_cv_header_libgt=
 
1000
 
 
1001
    dnl For backward compatibility. Some Makefiles may be using this.
 
1002
    DATADIRNAME=share
 
1003
    AC_SUBST(DATADIRNAME)
 
1004
 
 
1005
    dnl For backward compatibility. Some Makefiles may be using this.
 
1006
    INSTOBJEXT=.mo
 
1007
    AC_SUBST(INSTOBJEXT)
 
1008
 
 
1009
    dnl For backward compatibility. Some Makefiles may be using this.
 
1010
    GENCAT=gencat
 
1011
    AC_SUBST(GENCAT)
 
1012
  ])
 
1013
 
 
1014
dnl Usage: Just like AM_WITH_NLS, which see.
 
1015
AC_DEFUN([AM_GNU_GETTEXT],
 
1016
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
1017
   AC_REQUIRE([AC_PROG_CC])dnl
 
1018
   AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1019
   AC_REQUIRE([AC_PROG_RANLIB])dnl
 
1020
   AC_REQUIRE([AC_ISC_POSIX])dnl
 
1021
   AC_REQUIRE([AC_HEADER_STDC])dnl
 
1022
   AC_REQUIRE([AC_C_CONST])dnl
 
1023
   AC_REQUIRE([AC_C_INLINE])dnl
 
1024
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
 
1025
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
1026
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
1027
   AC_REQUIRE([AC_FUNC_MMAP])dnl
 
1028
   AC_REQUIRE([jm_GLIBC21])dnl
 
1029
 
 
1030
   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
 
1031
stdlib.h string.h unistd.h sys/param.h])
 
1032
   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
 
1033
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
 
1034
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
 
1035
 
 
1036
   AM_ICONV
 
1037
   AM_LANGINFO_CODESET
 
1038
   AM_LC_MESSAGES
 
1039
   AM_WITH_NLS([$1],[$2],[$3])
 
1040
 
 
1041
   if test "x$CATOBJEXT" != "x"; then
 
1042
     if test "x$ALL_LINGUAS" = "x"; then
 
1043
       LINGUAS=
 
1044
     else
 
1045
       AC_MSG_CHECKING(for catalogs to be installed)
 
1046
       NEW_LINGUAS=
 
1047
       for presentlang in $ALL_LINGUAS; do
 
1048
         useit=no
 
1049
         for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
 
1050
           # Use the presentlang catalog if desiredlang is
 
1051
           #   a. equal to presentlang, or
 
1052
           #   b. a variant of presentlang (because in this case,
 
1053
           #      presentlang can be used as a fallback for messages
 
1054
           #      which are not translated in the desiredlang catalog).
 
1055
           case "$desiredlang" in
 
1056
             "$presentlang"*) useit=yes;;
 
1057
           esac
 
1058
         done
 
1059
         if test $useit = yes; then
 
1060
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
 
1061
         fi
 
1062
       done
 
1063
       LINGUAS=$NEW_LINGUAS
 
1064
       AC_MSG_RESULT($LINGUAS)
 
1065
     fi
 
1066
 
 
1067
     dnl Construct list of names of catalog files to be constructed.
 
1068
     if test -n "$LINGUAS"; then
 
1069
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
 
1070
     fi
 
1071
   fi
 
1072
 
 
1073
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
1074
   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
 
1075
   dnl Try to locate is.
 
1076
   MKINSTALLDIRS=
 
1077
   if test -n "$ac_aux_dir"; then
 
1078
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
1079
   fi
 
1080
   if test -z "$MKINSTALLDIRS"; then
 
1081
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
1082
   fi
 
1083
   AC_SUBST(MKINSTALLDIRS)
 
1084
 
 
1085
   dnl Enable libtool support if the surrounding package wishes it.
 
1086
   INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
 
1087
   AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
 
1088
  ])
 
1089
 
 
1090
dnl this check it required by the gettext macro
 
1091
#serial 2
 
1092
 
 
1093
# Test for the GNU C Library, version 2.1 or newer.
 
1094
# From Bruno Haible.
 
1095
 
 
1096
AC_DEFUN([jm_GLIBC21],
 
1097
  [
 
1098
    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
 
1099
      ac_cv_gnu_library_2_1,
 
1100
      [AC_EGREP_CPP([Lucky GNU user],
 
1101
        [
 
1102
#include <features.h>
 
1103
#ifdef __GNU_LIBRARY__
 
1104
 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
 
1105
  Lucky GNU user
 
1106
 #endif
 
1107
#endif
 
1108
        ],
 
1109
        ac_cv_gnu_library_2_1=yes,
 
1110
        ac_cv_gnu_library_2_1=no)
 
1111
      ]
 
1112
    )
 
1113
    AC_SUBST(GLIBC21)
 
1114
    GLIBC21="$ac_cv_gnu_library_2_1"
 
1115
  ]
 
1116
)
 
1117