~ubuntu-branches/ubuntu/feisty/basilisk2/feisty

« back to all changes in this revision

Viewing changes to src/Unix/aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2005-07-30 20:42:20 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050730204220-1nl1cg2jkjvy63ry
Tags: 0.9.20050730-1
* New upstream CVS snapshot.
* Build-depend on virtual libsdl-dev (not libsdl1.2-dev).
* Invoke init rules also on clean (to separate better from official
  builds).
* Update URL of upstream source in debian/copyright.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
 
 
3
 
dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
 
1
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
 
2
 
 
3
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 
4
# 2005  Free Software Foundation, Inc.
 
5
# This file is free software; the Free Software Foundation
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
 
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
 
11
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 
12
# PARTICULAR PURPOSE.
 
13
 
 
14
# codeset.m4 serial AM1 (gettext-0.10.40)
 
15
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4
16
dnl This file is free software; the Free Software Foundation
5
17
dnl gives unlimited permission to copy and/or distribute it,
6
18
dnl with or without modifications, as long as this notice is preserved.
7
19
 
8
 
dnl This program is distributed in the hope that it will be useful,
9
 
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10
 
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11
 
dnl PARTICULAR PURPOSE.
12
 
 
13
 
dnl Additional macros for Basilisk II
14
 
 
15
 
 
16
 
dnl Check for libgnomeui
17
 
dnl B2_PATH_GNOMEUI([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
18
 
dnl Test to see if libgnomeui is installed, and define GNOMEUI_CFLAGS, LIBS
19
 
AC_DEFUN(B2_PATH_GNOMEUI,
 
20
dnl From Bruno Haible.
 
21
 
 
22
AC_DEFUN([AM_LANGINFO_CODESET],
 
23
[
 
24
  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
 
25
    [AC_TRY_LINK([#include <langinfo.h>],
 
26
      [char* cs = nl_langinfo(CODESET);],
 
27
      am_cv_langinfo_codeset=yes,
 
28
      am_cv_langinfo_codeset=no)
 
29
    ])
 
30
  if test $am_cv_langinfo_codeset = yes; then
 
31
    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
 
32
      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
 
33
  fi
 
34
])
 
35
 
 
36
# Configure paths for ESD
 
37
# Manish Singh    98-9-30
 
38
# stolen back from Frank Belew
 
39
# stolen from Manish Singh
 
40
# Shamelessly stolen from Owen Taylor
 
41
 
 
42
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 
43
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
 
44
dnl
 
45
AC_DEFUN([AM_PATH_ESD],
 
46
[dnl 
 
47
dnl Get the cflags and libraries from the esd-config script
 
48
dnl
 
49
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
 
50
            esd_prefix="$withval", esd_prefix="")
 
51
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
 
52
            esd_exec_prefix="$withval", esd_exec_prefix="")
 
53
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
 
54
                    , enable_esdtest=yes)
 
55
 
 
56
  if test x$esd_exec_prefix != x ; then
 
57
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
 
58
     if test x${ESD_CONFIG+set} != xset ; then
 
59
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
 
60
     fi
 
61
  fi
 
62
  if test x$esd_prefix != x ; then
 
63
     esd_args="$esd_args --prefix=$esd_prefix"
 
64
     if test x${ESD_CONFIG+set} != xset ; then
 
65
        ESD_CONFIG=$esd_prefix/bin/esd-config
 
66
     fi
 
67
  fi
 
68
 
 
69
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
 
70
  min_esd_version=ifelse([$1], ,0.2.7,$1)
 
71
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
 
72
  no_esd=""
 
73
  if test "$ESD_CONFIG" = "no" ; then
 
74
    no_esd=yes
 
75
  else
 
76
    AC_LANG_SAVE
 
77
    AC_LANG_C
 
78
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
 
79
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
 
80
 
 
81
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
 
82
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
83
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
 
84
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
85
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
 
86
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
87
    if test "x$enable_esdtest" = "xyes" ; then
 
88
      ac_save_CFLAGS="$CFLAGS"
 
89
      ac_save_LIBS="$LIBS"
 
90
      CFLAGS="$CFLAGS $ESD_CFLAGS"
 
91
      LIBS="$LIBS $ESD_LIBS"
 
92
dnl
 
93
dnl Now check if the installed ESD is sufficiently new. (Also sanity
 
94
dnl checks the results of esd-config to some extent
 
95
dnl
 
96
      rm -f conf.esdtest
 
97
      AC_TRY_RUN([
 
98
#include <stdio.h>
 
99
#include <stdlib.h>
 
100
#include <string.h>
 
101
#include <esd.h>
 
102
 
 
103
char*
 
104
my_strdup (char *str)
 
105
{
 
106
  char *new_str;
 
107
  
 
108
  if (str)
 
109
    {
 
110
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
 
111
      strcpy (new_str, str);
 
112
    }
 
113
  else
 
114
    new_str = NULL;
 
115
  
 
116
  return new_str;
 
117
}
 
118
 
 
119
int main ()
 
120
{
 
121
  int major, minor, micro;
 
122
  char *tmp_version;
 
123
 
 
124
  system ("touch conf.esdtest");
 
125
 
 
126
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
127
  tmp_version = my_strdup("$min_esd_version");
 
128
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
129
     printf("%s, bad version string\n", "$min_esd_version");
 
130
     exit(1);
 
131
   }
 
132
 
 
133
   if (($esd_major_version > major) ||
 
134
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
 
135
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
 
136
    {
 
137
      return 0;
 
138
    }
 
139
  else
 
140
    {
 
141
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
 
142
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
 
143
      printf("*** best to upgrade to the required version.\n");
 
144
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
 
145
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
 
146
      printf("*** config.cache before re-running configure\n");
 
147
      return 1;
 
148
    }
 
149
}
 
150
 
 
151
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
152
       CFLAGS="$ac_save_CFLAGS"
 
153
       LIBS="$ac_save_LIBS"
 
154
       AC_LANG_RESTORE
 
155
     fi
 
156
  fi
 
157
  if test "x$no_esd" = x ; then
 
158
     AC_MSG_RESULT(yes)
 
159
     ifelse([$2], , :, [$2])     
 
160
  else
 
161
     AC_MSG_RESULT(no)
 
162
     if test "$ESD_CONFIG" = "no" ; then
 
163
       echo "*** The esd-config script installed by ESD could not be found"
 
164
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
 
165
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
 
166
       echo "*** full path to esd-config."
 
167
     else
 
168
       if test -f conf.esdtest ; then
 
169
        :
 
170
       else
 
171
          echo "*** Could not run ESD test program, checking why..."
 
172
          CFLAGS="$CFLAGS $ESD_CFLAGS"
 
173
          LIBS="$LIBS $ESD_LIBS"
 
174
          AC_LANG_SAVE
 
175
          AC_LANG_C
 
176
          AC_TRY_LINK([
 
177
#include <stdio.h>
 
178
#include <esd.h>
 
179
],      [ return 0; ],
 
180
        [ echo "*** The test program compiled, but did not run. This usually means"
 
181
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
 
182
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
 
183
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
184
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
185
          echo "*** is required on your system"
 
186
          echo "***"
 
187
          echo "*** If you have an old version installed, it is best to remove it, although"
 
188
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
 
189
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
190
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
 
191
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
 
192
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
 
193
          CFLAGS="$ac_save_CFLAGS"
 
194
          LIBS="$ac_save_LIBS"
 
195
          AC_LANG_RESTORE
 
196
       fi
 
197
     fi
 
198
     ESD_CFLAGS=""
 
199
     ESD_LIBS=""
 
200
     ifelse([$3], , :, [$3])
 
201
  fi
 
202
  AC_SUBST(ESD_CFLAGS)
 
203
  AC_SUBST(ESD_LIBS)
 
204
  rm -f conf.esdtest
 
205
])
 
206
 
 
207
dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
 
208
dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
 
209
dnl
 
210
AC_DEFUN([AM_ESD_SUPPORTS_MULTIPLE_RECORD],
20
211
[dnl
21
 
dnl Get the cflags and libraries from the gnome-config script
22
 
dnl
23
 
AC_ARG_WITH(gnome-config,
24
 
[  --with-gnome-config=GNOME_CONFIG  Location of gnome-config],
25
 
GNOME_CONFIG="$withval")
26
 
 
27
 
AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
28
 
AC_MSG_CHECKING(for libgnomeui)
29
 
if test "$GNOME_CONFIG" = "no"; then
 
212
  AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
 
213
  ac_save_ESD_CFLAGS="$ESD_CFLAGS"
 
214
  ac_save_ESD_LIBS="$ESD_LIBS"
 
215
  AM_PATH_ESD(0.2.21,
 
216
    ifelse([$1], , [
 
217
      AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
 
218
      AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
 
219
        [Define if you have esound with support of multiple recording clients.])],
 
220
    [$1]),
 
221
    ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
 
222
    if test "x$ac_save_ESD_CFLAGS" != x ; then
 
223
       ESD_CFLAGS="$ac_save_ESD_CFLAGS"
 
224
    fi
 
225
    if test "x$ac_save_ESD_LIBS" != x ; then
 
226
       ESD_LIBS="$ac_save_ESD_LIBS"
 
227
    fi
 
228
  )
 
229
])
 
230
 
 
231
# gettext.m4 serial 37 (gettext-0.14.4)
 
232
dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
 
233
dnl This file is free software; the Free Software Foundation
 
234
dnl gives unlimited permission to copy and/or distribute it,
 
235
dnl with or without modifications, as long as this notice is preserved.
 
236
dnl
 
237
dnl This file can can be used in projects which are not available under
 
238
dnl the GNU General Public License or the GNU Library General Public
 
239
dnl License but which still want to provide support for the GNU gettext
 
240
dnl functionality.
 
241
dnl Please note that the actual code of the GNU gettext library is covered
 
242
dnl by the GNU Library General Public License, and the rest of the GNU
 
243
dnl gettext package package is covered by the GNU General Public License.
 
244
dnl They are *not* in the public domain.
 
245
 
 
246
dnl Authors:
 
247
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
248
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
249
 
 
250
dnl Macro to add for using GNU gettext.
 
251
 
 
252
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
 
253
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
 
254
dnl    default (if it is not specified or empty) is 'no-libtool'.
 
255
dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
 
256
dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
 
257
dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
 
258
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
 
259
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
 
260
dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
 
261
dnl    $(top_builddir)/intl/libintl.a will be created.
 
262
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
 
263
dnl    implementations (in libc or libintl) without the ngettext() function
 
264
dnl    will be ignored.  If NEEDSYMBOL is specified and is
 
265
dnl    'need-formatstring-macros', then GNU gettext implementations that don't
 
266
dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
 
267
dnl INTLDIR is used to find the intl libraries.  If empty,
 
268
dnl    the value `$(top_builddir)/intl/' is used.
 
269
dnl
 
270
dnl The result of the configuration is one of three cases:
 
271
dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
 
272
dnl    and used.
 
273
dnl    Catalog format: GNU --> install in $(datadir)
 
274
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
275
dnl 2) GNU gettext has been found in the system's C library.
 
276
dnl    Catalog format: GNU --> install in $(datadir)
 
277
dnl    Catalog extension: .mo after installation, .gmo in source tree
 
278
dnl 3) No internationalization, always use English msgid.
 
279
dnl    Catalog format: none
 
280
dnl    Catalog extension: none
 
281
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
 
282
dnl The use of .gmo is historical (it was needed to avoid overwriting the
 
283
dnl GNU format catalogs when building on a platform with an X/Open gettext),
 
284
dnl but we keep it in order not to force irrelevant filename changes on the
 
285
dnl maintainers.
 
286
dnl
 
287
AC_DEFUN([AM_GNU_GETTEXT],
 
288
[
 
289
  dnl Argument checking.
 
290
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
 
291
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
 
292
])])])])])
 
293
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
 
294
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 
295
])])])])
 
296
  define([gt_included_intl], ifelse([$1], [external], [no], [yes]))
 
297
  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
 
298
 
 
299
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
 
300
  ifelse(gt_included_intl, yes, [
 
301
    AC_REQUIRE([AM_INTL_SUBDIR])dnl
 
302
  ])
 
303
 
 
304
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
305
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
306
  AC_REQUIRE([AC_LIB_RPATH])
 
307
 
 
308
  dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
309
  dnl Ideally we would do this search only after the
 
310
  dnl      if test "$USE_NLS" = "yes"; then
 
311
  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
312
  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
 
313
  dnl the configure script would need to contain the same shell code
 
314
  dnl again, outside any 'if'. There are two solutions:
 
315
  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
 
316
  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
 
317
  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
 
318
  dnl documented, we avoid it.
 
319
  ifelse(gt_included_intl, yes, , [
 
320
    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
321
  ])
 
322
 
 
323
  dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
 
324
  gt_INTL_MACOSX
 
325
 
 
326
  dnl Set USE_NLS.
 
327
  AM_NLS
 
328
 
 
329
  ifelse(gt_included_intl, yes, [
 
330
    BUILD_INCLUDED_LIBINTL=no
 
331
    USE_INCLUDED_LIBINTL=no
 
332
  ])
 
333
  LIBINTL=
 
334
  LTLIBINTL=
 
335
  POSUB=
 
336
 
 
337
  dnl If we use NLS figure out what method
 
338
  if test "$USE_NLS" = "yes"; then
 
339
    gt_use_preinstalled_gnugettext=no
 
340
    ifelse(gt_included_intl, yes, [
 
341
      AC_MSG_CHECKING([whether included gettext is requested])
 
342
      AC_ARG_WITH(included-gettext,
 
343
        [  --with-included-gettext use the GNU gettext library included here],
 
344
        nls_cv_force_use_gnu_gettext=$withval,
 
345
        nls_cv_force_use_gnu_gettext=no)
 
346
      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
 
347
 
 
348
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
 
349
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 
350
    ])
 
351
        dnl User does not insist on using GNU NLS library.  Figure out what
 
352
        dnl to use.  If GNU gettext is available we use this.  Else we have
 
353
        dnl to fall back to GNU NLS library.
 
354
 
 
355
        dnl Add a version number to the cache macros.
 
356
        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
 
357
        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
 
358
        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
 
359
 
 
360
        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
 
361
         [AC_TRY_LINK([#include <libintl.h>
 
362
]ifelse([$2], [need-formatstring-macros],
 
363
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
364
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 
365
#endif
 
366
changequote(,)dnl
 
367
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 
368
changequote([,])dnl
 
369
], [])[extern int _nl_msg_cat_cntr;
 
370
extern int *_nl_domain_bindings;],
 
371
            [bindtextdomain ("", "");
 
372
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
 
373
            gt_cv_func_gnugettext_libc=yes,
 
374
            gt_cv_func_gnugettext_libc=no)])
 
375
 
 
376
        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
377
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
378
          ifelse(gt_included_intl, yes, , [
 
379
            AM_ICONV_LINK
 
380
          ])
 
381
          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
 
382
          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
 
383
          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
 
384
          dnl even if libiconv doesn't exist.
 
385
          AC_LIB_LINKFLAGS_BODY([intl])
 
386
          AC_CACHE_CHECK([for GNU gettext in libintl],
 
387
            gt_cv_func_gnugettext_libintl,
 
388
           [gt_save_CPPFLAGS="$CPPFLAGS"
 
389
            CPPFLAGS="$CPPFLAGS $INCINTL"
 
390
            gt_save_LIBS="$LIBS"
 
391
            LIBS="$LIBS $LIBINTL"
 
392
            dnl Now see whether libintl exists and does not depend on libiconv.
 
393
            AC_TRY_LINK([#include <libintl.h>
 
394
]ifelse([$2], [need-formatstring-macros],
 
395
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
396
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 
397
#endif
 
398
changequote(,)dnl
 
399
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 
400
changequote([,])dnl
 
401
], [])[extern int _nl_msg_cat_cntr;
 
402
extern
 
403
#ifdef __cplusplus
 
404
"C"
 
405
#endif
 
406
const char *_nl_expand_alias (const char *);],
 
407
              [bindtextdomain ("", "");
 
408
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
409
              gt_cv_func_gnugettext_libintl=yes,
 
410
              gt_cv_func_gnugettext_libintl=no)
 
411
            dnl Now see whether libintl exists and depends on libiconv.
 
412
            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
 
413
              LIBS="$LIBS $LIBICONV"
 
414
              AC_TRY_LINK([#include <libintl.h>
 
415
]ifelse([$2], [need-formatstring-macros],
 
416
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
 
417
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
 
418
#endif
 
419
changequote(,)dnl
 
420
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
 
421
changequote([,])dnl
 
422
], [])[extern int _nl_msg_cat_cntr;
 
423
extern
 
424
#ifdef __cplusplus
 
425
"C"
 
426
#endif
 
427
const char *_nl_expand_alias (const char *);],
 
428
                [bindtextdomain ("", "");
 
429
return * gettext ("")]ifelse([$2], [need-ngettext], [ + * ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
 
430
               [LIBINTL="$LIBINTL $LIBICONV"
 
431
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
 
432
                gt_cv_func_gnugettext_libintl=yes
 
433
               ])
 
434
            fi
 
435
            CPPFLAGS="$gt_save_CPPFLAGS"
 
436
            LIBS="$gt_save_LIBS"])
 
437
        fi
 
438
 
 
439
        dnl If an already present or preinstalled GNU gettext() is found,
 
440
        dnl use it.  But if this macro is used in GNU gettext, and GNU
 
441
        dnl gettext is already preinstalled in libintl, we update this
 
442
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
 
443
        if test "$gt_cv_func_gnugettext_libc" = "yes" \
 
444
           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
 
445
                && test "$PACKAGE" != gettext-runtime \
 
446
                && test "$PACKAGE" != gettext-tools; }; then
 
447
          gt_use_preinstalled_gnugettext=yes
 
448
        else
 
449
          dnl Reset the values set by searching for libintl.
 
450
          LIBINTL=
 
451
          LTLIBINTL=
 
452
          INCINTL=
 
453
        fi
 
454
 
 
455
    ifelse(gt_included_intl, yes, [
 
456
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
 
457
          dnl GNU gettext is not found in the C library.
 
458
          dnl Fall back on included GNU gettext library.
 
459
          nls_cv_use_gnu_gettext=yes
 
460
        fi
 
461
      fi
 
462
 
 
463
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
 
464
        dnl Mark actions used to generate GNU NLS library.
 
465
        BUILD_INCLUDED_LIBINTL=yes
 
466
        USE_INCLUDED_LIBINTL=yes
 
467
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
 
468
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
 
469
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
 
470
      fi
 
471
 
 
472
      CATOBJEXT=
 
473
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
474
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
475
        dnl Mark actions to use GNU gettext tools.
 
476
        CATOBJEXT=.gmo
 
477
      fi
 
478
    ])
 
479
 
 
480
    if test -n "$INTL_MACOSX_LIBS"; then
 
481
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
482
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
483
        dnl Some extra flags are needed during linking.
 
484
        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
 
485
        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
 
486
      fi
 
487
    fi
 
488
 
 
489
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
490
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
491
      AC_DEFINE(ENABLE_NLS, 1,
 
492
        [Define to 1 if translation of program messages to the user's native language
 
493
   is requested.])
 
494
    else
 
495
      USE_NLS=no
 
496
    fi
 
497
  fi
 
498
 
 
499
  AC_MSG_CHECKING([whether to use NLS])
 
500
  AC_MSG_RESULT([$USE_NLS])
 
501
  if test "$USE_NLS" = "yes"; then
 
502
    AC_MSG_CHECKING([where the gettext function comes from])
 
503
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
504
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
505
        gt_source="external libintl"
 
506
      else
 
507
        gt_source="libc"
 
508
      fi
 
509
    else
 
510
      gt_source="included intl directory"
 
511
    fi
 
512
    AC_MSG_RESULT([$gt_source])
 
513
  fi
 
514
 
 
515
  if test "$USE_NLS" = "yes"; then
 
516
 
 
517
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
518
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
519
        AC_MSG_CHECKING([how to link with libintl])
 
520
        AC_MSG_RESULT([$LIBINTL])
 
521
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
 
522
      fi
 
523
 
 
524
      dnl For backward compatibility. Some packages may be using this.
 
525
      AC_DEFINE(HAVE_GETTEXT, 1,
 
526
       [Define if the GNU gettext() function is already present or preinstalled.])
 
527
      AC_DEFINE(HAVE_DCGETTEXT, 1,
 
528
       [Define if the GNU dcgettext() function is already present or preinstalled.])
 
529
    fi
 
530
 
 
531
    dnl We need to process the po/ directory.
 
532
    POSUB=po
 
533
  fi
 
534
 
 
535
  ifelse(gt_included_intl, yes, [
 
536
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
 
537
    dnl to 'yes' because some of the testsuite requires it.
 
538
    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
 
539
      BUILD_INCLUDED_LIBINTL=yes
 
540
    fi
 
541
 
 
542
    dnl Make all variables we use known to autoconf.
 
543
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
 
544
    AC_SUBST(USE_INCLUDED_LIBINTL)
 
545
    AC_SUBST(CATOBJEXT)
 
546
 
 
547
    dnl For backward compatibility. Some configure.ins may be using this.
 
548
    nls_cv_header_intl=
 
549
    nls_cv_header_libgt=
 
550
 
 
551
    dnl For backward compatibility. Some Makefiles may be using this.
 
552
    DATADIRNAME=share
 
553
    AC_SUBST(DATADIRNAME)
 
554
 
 
555
    dnl For backward compatibility. Some Makefiles may be using this.
 
556
    INSTOBJEXT=.mo
 
557
    AC_SUBST(INSTOBJEXT)
 
558
 
 
559
    dnl For backward compatibility. Some Makefiles may be using this.
 
560
    GENCAT=gencat
 
561
    AC_SUBST(GENCAT)
 
562
 
 
563
    dnl For backward compatibility. Some Makefiles may be using this.
 
564
    INTLOBJS=
 
565
    if test "$USE_INCLUDED_LIBINTL" = yes; then
 
566
      INTLOBJS="\$(GETTOBJS)"
 
567
    fi
 
568
    AC_SUBST(INTLOBJS)
 
569
 
 
570
    dnl Enable libtool support if the surrounding package wishes it.
 
571
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
 
572
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
 
573
  ])
 
574
 
 
575
  dnl For backward compatibility. Some Makefiles may be using this.
 
576
  INTLLIBS="$LIBINTL"
 
577
  AC_SUBST(INTLLIBS)
 
578
 
 
579
  dnl Make all documented variables known to autoconf.
 
580
  AC_SUBST(LIBINTL)
 
581
  AC_SUBST(LTLIBINTL)
 
582
  AC_SUBST(POSUB)
 
583
])
 
584
 
 
585
 
 
586
dnl Checks for all prerequisites of the intl subdirectory,
 
587
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
 
588
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
 
589
AC_DEFUN([AM_INTL_SUBDIR],
 
590
[
 
591
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
592
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
 
593
  AC_REQUIRE([AC_PROG_CC])dnl
 
594
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
595
  AC_REQUIRE([gt_GLIBC2])dnl
 
596
  AC_REQUIRE([AC_PROG_RANLIB])dnl
 
597
  AC_REQUIRE([AC_ISC_POSIX])dnl
 
598
  AC_REQUIRE([AC_HEADER_STDC])dnl
 
599
  AC_REQUIRE([AC_C_CONST])dnl
 
600
  AC_REQUIRE([bh_C_SIGNED])dnl
 
601
  AC_REQUIRE([AC_C_INLINE])dnl
 
602
  AC_REQUIRE([AC_TYPE_OFF_T])dnl
 
603
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
604
  AC_REQUIRE([gl_AC_TYPE_LONG_LONG])dnl
 
605
  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
 
606
  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
 
607
  AC_REQUIRE([gt_TYPE_WINT_T])dnl
 
608
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
609
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
610
  AC_REQUIRE([gt_TYPE_INTMAX_T])
 
611
  AC_REQUIRE([gt_PRINTF_POSIX])
 
612
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
613
  AC_REQUIRE([AC_FUNC_MMAP])dnl
 
614
  AC_REQUIRE([gl_GLIBC21])dnl
 
615
  AC_REQUIRE([gt_INTDIV0])dnl
 
616
  AC_REQUIRE([gl_AC_TYPE_UINTMAX_T])dnl
 
617
  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
 
618
  AC_REQUIRE([gt_INTTYPES_PRI])dnl
 
619
  AC_REQUIRE([gl_XSIZE])dnl
 
620
  AC_REQUIRE([gt_INTL_MACOSX])dnl
 
621
 
 
622
  AC_CHECK_TYPE([ptrdiff_t], ,
 
623
    [AC_DEFINE([ptrdiff_t], [long],
 
624
       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
 
625
    ])
 
626
  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
 
627
stdlib.h string.h unistd.h sys/param.h])
 
628
  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
 
629
mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
 
630
strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
 
631
__fsetlocking])
 
632
 
 
633
  dnl Use the _snprintf function only if it is declared (because on NetBSD it
 
634
  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
 
635
  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
 
636
  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
 
637
 
 
638
  dnl Use the *_unlocked functions only if they are declared.
 
639
  dnl (because some of them were defined without being declared in Solaris
 
640
  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
 
641
  dnl on Solaris 2.5.1 to run on Solaris 2.6).
 
642
  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
 
643
  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
 
644
  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
 
645
  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
 
646
 
 
647
  case $gt_cv_func_printf_posix in
 
648
    *yes) HAVE_POSIX_PRINTF=1 ;;
 
649
    *) HAVE_POSIX_PRINTF=0 ;;
 
650
  esac
 
651
  AC_SUBST([HAVE_POSIX_PRINTF])
 
652
  if test "$ac_cv_func_asprintf" = yes; then
 
653
    HAVE_ASPRINTF=1
 
654
  else
 
655
    HAVE_ASPRINTF=0
 
656
  fi
 
657
  AC_SUBST([HAVE_ASPRINTF])
 
658
  if test "$ac_cv_func_snprintf" = yes; then
 
659
    HAVE_SNPRINTF=1
 
660
  else
 
661
    HAVE_SNPRINTF=0
 
662
  fi
 
663
  AC_SUBST([HAVE_SNPRINTF])
 
664
  if test "$ac_cv_func_wprintf" = yes; then
 
665
    HAVE_WPRINTF=1
 
666
  else
 
667
    HAVE_WPRINTF=0
 
668
  fi
 
669
  AC_SUBST([HAVE_WPRINTF])
 
670
 
 
671
  AM_ICONV
 
672
  AM_LANGINFO_CODESET
 
673
  if test $ac_cv_header_locale_h = yes; then
 
674
    gt_LC_MESSAGES
 
675
  fi
 
676
 
 
677
  if test -n "$INTL_MACOSX_LIBS"; then
 
678
    CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
 
679
  fi
 
680
 
 
681
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
 
682
  dnl because plural.y uses bison specific features. It requires at least
 
683
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
 
684
  dnl compile.
 
685
  dnl bison is only needed for the maintainer (who touches plural.y). But in
 
686
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
 
687
  dnl the rule in general Makefile. Now, some people carelessly touch the
 
688
  dnl files or have a broken "make" program, hence the plural.c rule will
 
689
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
 
690
  dnl present or too old.
 
691
  AC_CHECK_PROGS([INTLBISON], [bison])
 
692
  if test -z "$INTLBISON"; then
 
693
    ac_verc_fail=yes
 
694
  else
 
695
    dnl Found it, now check the version.
 
696
    AC_MSG_CHECKING([version of bison])
 
697
changequote(<<,>>)dnl
 
698
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
 
699
    case $ac_prog_version in
 
700
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
 
701
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
 
702
changequote([,])dnl
 
703
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
 
704
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
705
    esac
 
706
    AC_MSG_RESULT([$ac_prog_version])
 
707
  fi
 
708
  if test $ac_verc_fail = yes; then
 
709
    INTLBISON=:
 
710
  fi
 
711
])
 
712
 
 
713
 
 
714
dnl Checks for special options needed on MacOS X.
 
715
dnl Defines INTL_MACOSX_LIBS.
 
716
AC_DEFUN([gt_INTL_MACOSX],
 
717
[
 
718
  dnl Check for API introduced in MacOS X 10.2.
 
719
  AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
 
720
    gt_cv_func_CFPreferencesCopyAppValue,
 
721
    [gt_save_CPPFLAGS="$CPPFLAGS"
 
722
     CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
 
723
     gt_save_LIBS="$LIBS"
 
724
     LIBS="$LIBS -framework CoreFoundation"
 
725
     AC_TRY_LINK([#include <CFPreferences.h>],
 
726
       [CFPreferencesCopyAppValue(NULL, NULL)],
 
727
       [gt_cv_func_CFPreferencesCopyAppValue=yes],
 
728
       [gt_cv_func_CFPreferencesCopyAppValue=no])
 
729
     CPPFLAGS="$gt_save_CPPFLAGS"
 
730
     LIBS="$gt_save_LIBS"])
 
731
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
732
    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
 
733
      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
 
734
  fi
 
735
  dnl Check for API introduced in MacOS X 10.3.
 
736
  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
 
737
    [gt_save_CPPFLAGS="$CPPFLAGS"
 
738
     CPPFLAGS="$CPPFLAGS -I/System/Library/Frameworks/CoreFoundation.framework/Headers"
 
739
     gt_save_LIBS="$LIBS"
 
740
     LIBS="$LIBS -framework CoreFoundation"
 
741
     AC_TRY_LINK([#include <CFLocale.h>], [CFLocaleCopyCurrent();],
 
742
       [gt_cv_func_CFLocaleCopyCurrent=yes],
 
743
       [gt_cv_func_CFLocaleCopyCurrent=no])
 
744
     CPPFLAGS="$gt_save_CPPFLAGS"
 
745
     LIBS="$gt_save_LIBS"])
 
746
  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
747
    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
 
748
      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
 
749
  fi
 
750
  INTL_MACOSX_LIBS=
 
751
  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
 
752
    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
 
753
  fi
 
754
  AC_SUBST([INTL_MACOSX_LIBS])
 
755
])
 
756
 
 
757
 
 
758
dnl gt_CHECK_DECL(FUNC, INCLUDES)
 
759
dnl Check whether a function is declared.
 
760
AC_DEFUN([gt_CHECK_DECL],
 
761
[
 
762
  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
 
763
    [AC_TRY_COMPILE([$2], [
 
764
#ifndef $1
 
765
  char *p = (char *) $1;
 
766
#endif
 
767
], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
 
768
  if test $ac_cv_have_decl_$1 = yes; then
 
769
    gt_value=1
 
770
  else
 
771
    gt_value=0
 
772
  fi
 
773
  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
 
774
    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
 
775
])
 
776
 
 
777
 
 
778
dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 
779
AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
 
780
 
 
781
# glibc2.m4 serial 1
 
782
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
 
783
dnl This file is free software; the Free Software Foundation
 
784
dnl gives unlimited permission to copy and/or distribute it,
 
785
dnl with or without modifications, as long as this notice is preserved.
 
786
 
 
787
# Test for the GNU C Library, version 2.0 or newer.
 
788
# From Bruno Haible.
 
789
 
 
790
AC_DEFUN([gt_GLIBC2],
 
791
  [
 
792
    AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
 
793
      ac_cv_gnu_library_2,
 
794
      [AC_EGREP_CPP([Lucky GNU user],
 
795
        [
 
796
#include <features.h>
 
797
#ifdef __GNU_LIBRARY__
 
798
 #if (__GLIBC__ >= 2)
 
799
  Lucky GNU user
 
800
 #endif
 
801
#endif
 
802
        ],
 
803
        ac_cv_gnu_library_2=yes,
 
804
        ac_cv_gnu_library_2=no)
 
805
      ]
 
806
    )
 
807
    AC_SUBST(GLIBC2)
 
808
    GLIBC2="$ac_cv_gnu_library_2"
 
809
  ]
 
810
)
 
811
 
 
812
# glibc21.m4 serial 3
 
813
dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
 
814
dnl This file is free software; the Free Software Foundation
 
815
dnl gives unlimited permission to copy and/or distribute it,
 
816
dnl with or without modifications, as long as this notice is preserved.
 
817
 
 
818
# Test for the GNU C Library, version 2.1 or newer.
 
819
# From Bruno Haible.
 
820
 
 
821
AC_DEFUN([gl_GLIBC21],
 
822
  [
 
823
    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
 
824
      ac_cv_gnu_library_2_1,
 
825
      [AC_EGREP_CPP([Lucky GNU user],
 
826
        [
 
827
#include <features.h>
 
828
#ifdef __GNU_LIBRARY__
 
829
 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
 
830
  Lucky GNU user
 
831
 #endif
 
832
#endif
 
833
        ],
 
834
        ac_cv_gnu_library_2_1=yes,
 
835
        ac_cv_gnu_library_2_1=no)
 
836
      ]
 
837
    )
 
838
    AC_SUBST(GLIBC21)
 
839
    GLIBC21="$ac_cv_gnu_library_2_1"
 
840
  ]
 
841
)
 
842
 
 
843
# Configure paths for GTK+
 
844
# Owen Taylor     1997-2001
 
845
 
 
846
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
847
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
 
848
dnl pass to pkg-config
 
849
dnl
 
850
AC_DEFUN([AM_PATH_GTK_2_0],
 
851
[dnl 
 
852
dnl Get the cflags and libraries from pkg-config
 
853
dnl
 
854
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
 
855
                    , enable_gtktest=yes)
 
856
 
 
857
  pkg_config_args=gtk+-2.0
 
858
  for module in . $4
 
859
  do
 
860
      case "$module" in
 
861
         gthread) 
 
862
             pkg_config_args="$pkg_config_args gthread-2.0"
 
863
         ;;
 
864
      esac
 
865
  done
 
866
 
 
867
  no_gtk=""
 
868
 
 
869
  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
870
 
 
871
  if test x$PKG_CONFIG != xno ; then
 
872
    if pkg-config --atleast-pkgconfig-version 0.7 ; then
 
873
      :
 
874
    else
 
875
      echo "*** pkg-config too old; version 0.7 or better required."
 
876
      no_gtk=yes
 
877
      PKG_CONFIG=no
 
878
    fi
 
879
  else
 
880
    no_gtk=yes
 
881
  fi
 
882
 
 
883
  min_gtk_version=ifelse([$1], ,2.0.0,$1)
 
884
  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
 
885
 
 
886
  if test x$PKG_CONFIG != xno ; then
 
887
    ## don't try to run the test against uninstalled libtool libs
 
888
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
889
          echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
 
890
          enable_gtktest=no
 
891
    fi
 
892
 
 
893
    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
 
894
          :
 
895
    else
 
896
          no_gtk=yes
 
897
    fi
 
898
  fi
 
899
 
 
900
  if test x"$no_gtk" = x ; then
 
901
    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
 
902
    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
 
903
    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
904
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
905
    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
906
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
907
    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
908
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
909
    if test "x$enable_gtktest" = "xyes" ; then
 
910
      ac_save_CFLAGS="$CFLAGS"
 
911
      ac_save_LIBS="$LIBS"
 
912
      CFLAGS="$CFLAGS $GTK_CFLAGS"
 
913
      LIBS="$GTK_LIBS $LIBS"
 
914
dnl
 
915
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
 
916
dnl checks the results of pkg-config to some extent)
 
917
dnl
 
918
      rm -f conf.gtktest
 
919
      AC_TRY_RUN([
 
920
#include <gtk/gtk.h>
 
921
#include <stdio.h>
 
922
#include <stdlib.h>
 
923
 
 
924
int 
 
925
main ()
 
926
{
 
927
  int major, minor, micro;
 
928
  char *tmp_version;
 
929
 
 
930
  system ("touch conf.gtktest");
 
931
 
 
932
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
933
  tmp_version = g_strdup("$min_gtk_version");
 
934
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
935
     printf("%s, bad version string\n", "$min_gtk_version");
 
936
     exit(1);
 
937
   }
 
938
 
 
939
  if ((gtk_major_version != $gtk_config_major_version) ||
 
940
      (gtk_minor_version != $gtk_config_minor_version) ||
 
941
      (gtk_micro_version != $gtk_config_micro_version))
 
942
    {
 
943
      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
 
944
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
 
945
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
946
      printf ("*** was found! If pkg-config was correct, then it is best\n");
 
947
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
 
948
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
949
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
950
      printf("*** required on your system.\n");
 
951
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
952
      printf("*** to point to the correct configuration files\n");
 
953
    } 
 
954
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
 
955
           (gtk_minor_version != GTK_MINOR_VERSION) ||
 
956
           (gtk_micro_version != GTK_MICRO_VERSION))
 
957
    {
 
958
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
 
959
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
 
960
      printf("*** library (version %d.%d.%d)\n",
 
961
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
962
    }
 
963
  else
 
964
    {
 
965
      if ((gtk_major_version > major) ||
 
966
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
 
967
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
 
968
      {
 
969
        return 0;
 
970
       }
 
971
     else
 
972
      {
 
973
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
 
974
               gtk_major_version, gtk_minor_version, gtk_micro_version);
 
975
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
 
976
               major, minor, micro);
 
977
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
 
978
        printf("***\n");
 
979
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
980
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
 
981
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
982
        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
 
983
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
 
984
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
985
        printf("*** so that the correct libraries are found at run-time))\n");
 
986
      }
 
987
    }
 
988
  return 1;
 
989
}
 
990
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
991
       CFLAGS="$ac_save_CFLAGS"
 
992
       LIBS="$ac_save_LIBS"
 
993
     fi
 
994
  fi
 
995
  if test "x$no_gtk" = x ; then
 
996
     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
 
997
     ifelse([$2], , :, [$2])     
 
998
  else
 
999
     AC_MSG_RESULT(no)
 
1000
     if test "$PKG_CONFIG" = "no" ; then
 
1001
       echo "*** A new enough version of pkg-config was not found."
 
1002
       echo "*** See http://pkgconfig.sourceforge.net"
 
1003
     else
 
1004
       if test -f conf.gtktest ; then
 
1005
        :
 
1006
       else
 
1007
          echo "*** Could not run GTK+ test program, checking why..."
 
1008
          ac_save_CFLAGS="$CFLAGS"
 
1009
          ac_save_LIBS="$LIBS"
 
1010
          CFLAGS="$CFLAGS $GTK_CFLAGS"
 
1011
          LIBS="$LIBS $GTK_LIBS"
 
1012
          AC_TRY_LINK([
 
1013
#include <gtk/gtk.h>
 
1014
#include <stdio.h>
 
1015
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
 
1016
        [ echo "*** The test program compiled, but did not run. This usually means"
 
1017
          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
 
1018
          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
 
1019
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
1020
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
1021
          echo "*** is required on your system"
 
1022
          echo "***"
 
1023
          echo "*** If you have an old version installed, it is best to remove it, although"
 
1024
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
 
1025
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
1026
          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
 
1027
          CFLAGS="$ac_save_CFLAGS"
 
1028
          LIBS="$ac_save_LIBS"
 
1029
       fi
 
1030
     fi
 
1031
     GTK_CFLAGS=""
 
1032
     GTK_LIBS=""
 
1033
     ifelse([$3], , :, [$3])
 
1034
  fi
 
1035
  AC_SUBST(GTK_CFLAGS)
 
1036
  AC_SUBST(GTK_LIBS)
 
1037
  rm -f conf.gtktest
 
1038
])
 
1039
 
 
1040
# Configure paths for GTK+
 
1041
# Owen Taylor     97-11-3
 
1042
 
 
1043
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
1044
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
 
1045
dnl
 
1046
AC_DEFUN(AM_PATH_GTK,
 
1047
[dnl 
 
1048
dnl Get the cflags and libraries from the gtk-config script
 
1049
dnl
 
1050
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
 
1051
            gtk_config_prefix="$withval", gtk_config_prefix="")
 
1052
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
 
1053
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
 
1054
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
 
1055
                    , enable_gtktest=yes)
 
1056
 
 
1057
  for module in . $4
 
1058
  do
 
1059
      case "$module" in
 
1060
         gthread) 
 
1061
             gtk_config_args="$gtk_config_args gthread"
 
1062
         ;;
 
1063
      esac
 
1064
  done
 
1065
 
 
1066
  if test x$gtk_config_exec_prefix != x ; then
 
1067
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
 
1068
     if test x${GTK_CONFIG+set} != xset ; then
 
1069
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
 
1070
     fi
 
1071
  fi
 
1072
  if test x$gtk_config_prefix != x ; then
 
1073
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
 
1074
     if test x${GTK_CONFIG+set} != xset ; then
 
1075
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
 
1076
     fi
 
1077
  fi
 
1078
 
 
1079
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
 
1080
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
 
1081
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
 
1082
  no_gtk=""
 
1083
  if test "$GTK_CONFIG" = "no" ; then
 
1084
    no_gtk=yes
 
1085
  else
 
1086
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
 
1087
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
 
1088
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
 
1089
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
1090
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
 
1091
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
1092
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
 
1093
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
1094
    if test "x$enable_gtktest" = "xyes" ; then
 
1095
      ac_save_CFLAGS="$CFLAGS"
 
1096
      ac_save_LIBS="$LIBS"
 
1097
      CFLAGS="$CFLAGS $GTK_CFLAGS"
 
1098
      LIBS="$GTK_LIBS $LIBS"
 
1099
dnl
 
1100
dnl Now check if the installed GTK is sufficiently new. (Also sanity
 
1101
dnl checks the results of gtk-config to some extent
 
1102
dnl
 
1103
      rm -f conf.gtktest
 
1104
      AC_TRY_RUN([
 
1105
#include <gtk/gtk.h>
 
1106
#include <stdio.h>
 
1107
#include <stdlib.h>
 
1108
 
 
1109
int 
 
1110
main ()
 
1111
{
 
1112
  int major, minor, micro;
 
1113
  char *tmp_version;
 
1114
 
 
1115
  system ("touch conf.gtktest");
 
1116
 
 
1117
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
1118
  tmp_version = g_strdup("$min_gtk_version");
 
1119
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
1120
     printf("%s, bad version string\n", "$min_gtk_version");
 
1121
     exit(1);
 
1122
   }
 
1123
 
 
1124
  if ((gtk_major_version != $gtk_config_major_version) ||
 
1125
      (gtk_minor_version != $gtk_config_minor_version) ||
 
1126
      (gtk_micro_version != $gtk_config_micro_version))
 
1127
    {
 
1128
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
 
1129
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
 
1130
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
1131
      printf ("*** was found! If gtk-config was correct, then it is best\n");
 
1132
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
 
1133
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
1134
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
1135
      printf("*** required on your system.\n");
 
1136
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
 
1137
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
 
1138
      printf("*** before re-running configure\n");
 
1139
    } 
 
1140
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
 
1141
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
 
1142
           (gtk_minor_version != GTK_MINOR_VERSION) ||
 
1143
           (gtk_micro_version != GTK_MICRO_VERSION))
 
1144
    {
 
1145
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
 
1146
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
 
1147
      printf("*** library (version %d.%d.%d)\n",
 
1148
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
1149
    }
 
1150
#endif /* defined (GTK_MAJOR_VERSION) ... */
 
1151
  else
 
1152
    {
 
1153
      if ((gtk_major_version > major) ||
 
1154
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
 
1155
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
 
1156
      {
 
1157
        return 0;
 
1158
       }
 
1159
     else
 
1160
      {
 
1161
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
 
1162
               gtk_major_version, gtk_minor_version, gtk_micro_version);
 
1163
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
 
1164
               major, minor, micro);
 
1165
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
 
1166
        printf("***\n");
 
1167
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
1168
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
 
1169
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
1170
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
 
1171
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
 
1172
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
1173
        printf("*** so that the correct libraries are found at run-time))\n");
 
1174
      }
 
1175
    }
 
1176
  return 1;
 
1177
}
 
1178
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
1179
       CFLAGS="$ac_save_CFLAGS"
 
1180
       LIBS="$ac_save_LIBS"
 
1181
     fi
 
1182
  fi
 
1183
  if test "x$no_gtk" = x ; then
 
1184
     AC_MSG_RESULT(yes)
 
1185
     ifelse([$2], , :, [$2])     
 
1186
  else
 
1187
     AC_MSG_RESULT(no)
 
1188
     if test "$GTK_CONFIG" = "no" ; then
 
1189
       echo "*** The gtk-config script installed by GTK could not be found"
 
1190
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
 
1191
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
 
1192
       echo "*** full path to gtk-config."
 
1193
     else
 
1194
       if test -f conf.gtktest ; then
 
1195
        :
 
1196
       else
 
1197
          echo "*** Could not run GTK test program, checking why..."
 
1198
          CFLAGS="$CFLAGS $GTK_CFLAGS"
 
1199
          LIBS="$LIBS $GTK_LIBS"
 
1200
          AC_TRY_LINK([
 
1201
#include <gtk/gtk.h>
 
1202
#include <stdio.h>
 
1203
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
 
1204
        [ echo "*** The test program compiled, but did not run. This usually means"
 
1205
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
 
1206
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
 
1207
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
1208
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
1209
          echo "*** is required on your system"
 
1210
          echo "***"
 
1211
          echo "*** If you have an old version installed, it is best to remove it, although"
 
1212
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
 
1213
          echo "***"
 
1214
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
 
1215
          echo "*** came with the system with the command"
 
1216
          echo "***"
 
1217
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
 
1218
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
1219
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
 
1220
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
 
1221
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
 
1222
          CFLAGS="$ac_save_CFLAGS"
 
1223
          LIBS="$ac_save_LIBS"
 
1224
       fi
 
1225
     fi
 
1226
     GTK_CFLAGS=""
 
1227
     GTK_LIBS=""
 
1228
     ifelse([$3], , :, [$3])
 
1229
  fi
 
1230
  AC_SUBST(GTK_CFLAGS)
 
1231
  AC_SUBST(GTK_LIBS)
 
1232
  rm -f conf.gtktest
 
1233
])
 
1234
 
 
1235
# iconv.m4 serial AM4 (gettext-0.11.3)
 
1236
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
 
1237
dnl This file is free software; the Free Software Foundation
 
1238
dnl gives unlimited permission to copy and/or distribute it,
 
1239
dnl with or without modifications, as long as this notice is preserved.
 
1240
 
 
1241
dnl From Bruno Haible.
 
1242
 
 
1243
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
 
1244
[
 
1245
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
1246
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1247
  AC_REQUIRE([AC_LIB_RPATH])
 
1248
 
 
1249
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
1250
  dnl accordingly.
 
1251
  AC_LIB_LINKFLAGS_BODY([iconv])
 
1252
])
 
1253
 
 
1254
AC_DEFUN([AM_ICONV_LINK],
 
1255
[
 
1256
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
 
1257
  dnl those with the standalone portable GNU libiconv installed).
 
1258
 
 
1259
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
1260
  dnl accordingly.
 
1261
  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
 
1262
 
 
1263
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
 
1264
  dnl because if the user has installed libiconv and not disabled its use
 
1265
  dnl via --without-libiconv-prefix, he wants to use it. The first
 
1266
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
 
1267
  am_save_CPPFLAGS="$CPPFLAGS"
 
1268
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
1269
 
 
1270
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
 
1271
    am_cv_func_iconv="no, consider installing GNU libiconv"
 
1272
    am_cv_lib_iconv=no
 
1273
    AC_TRY_LINK([#include <stdlib.h>
 
1274
#include <iconv.h>],
 
1275
      [iconv_t cd = iconv_open("","");
 
1276
       iconv(cd,NULL,NULL,NULL,NULL);
 
1277
       iconv_close(cd);],
 
1278
      am_cv_func_iconv=yes)
 
1279
    if test "$am_cv_func_iconv" != yes; then
 
1280
      am_save_LIBS="$LIBS"
 
1281
      LIBS="$LIBS $LIBICONV"
 
1282
      AC_TRY_LINK([#include <stdlib.h>
 
1283
#include <iconv.h>],
 
1284
        [iconv_t cd = iconv_open("","");
 
1285
         iconv(cd,NULL,NULL,NULL,NULL);
 
1286
         iconv_close(cd);],
 
1287
        am_cv_lib_iconv=yes
 
1288
        am_cv_func_iconv=yes)
 
1289
      LIBS="$am_save_LIBS"
 
1290
    fi
 
1291
  ])
 
1292
  if test "$am_cv_func_iconv" = yes; then
 
1293
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
 
1294
  fi
 
1295
  if test "$am_cv_lib_iconv" = yes; then
 
1296
    AC_MSG_CHECKING([how to link with libiconv])
 
1297
    AC_MSG_RESULT([$LIBICONV])
 
1298
  else
 
1299
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
 
1300
    dnl either.
 
1301
    CPPFLAGS="$am_save_CPPFLAGS"
 
1302
    LIBICONV=
 
1303
    LTLIBICONV=
 
1304
  fi
 
1305
  AC_SUBST(LIBICONV)
 
1306
  AC_SUBST(LTLIBICONV)
 
1307
])
 
1308
 
 
1309
AC_DEFUN([AM_ICONV],
 
1310
[
 
1311
  AM_ICONV_LINK
 
1312
  if test "$am_cv_func_iconv" = yes; then
 
1313
    AC_MSG_CHECKING([for iconv declaration])
 
1314
    AC_CACHE_VAL(am_cv_proto_iconv, [
 
1315
      AC_TRY_COMPILE([
 
1316
#include <stdlib.h>
 
1317
#include <iconv.h>
 
1318
extern
 
1319
#ifdef __cplusplus
 
1320
"C"
 
1321
#endif
 
1322
#if defined(__STDC__) || defined(__cplusplus)
 
1323
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 
1324
#else
 
1325
size_t iconv();
 
1326
#endif
 
1327
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
 
1328
      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);"])
 
1329
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
 
1330
    AC_MSG_RESULT([$]{ac_t:-
 
1331
         }[$]am_cv_proto_iconv)
 
1332
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
 
1333
      [Define as const if the declaration of iconv() needs const.])
 
1334
  fi
 
1335
])
 
1336
 
 
1337
# intdiv0.m4 serial 1 (gettext-0.11.3)
 
1338
dnl Copyright (C) 2002 Free Software Foundation, Inc.
 
1339
dnl This file is free software; the Free Software Foundation
 
1340
dnl gives unlimited permission to copy and/or distribute it,
 
1341
dnl with or without modifications, as long as this notice is preserved.
 
1342
 
 
1343
dnl From Bruno Haible.
 
1344
 
 
1345
AC_DEFUN([gt_INTDIV0],
 
1346
[
 
1347
  AC_REQUIRE([AC_PROG_CC])dnl
 
1348
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1349
 
 
1350
  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
 
1351
    gt_cv_int_divbyzero_sigfpe,
 
1352
    [
 
1353
      AC_TRY_RUN([
 
1354
#include <stdlib.h>
 
1355
#include <signal.h>
 
1356
 
 
1357
static void
 
1358
#ifdef __cplusplus
 
1359
sigfpe_handler (int sig)
 
1360
#else
 
1361
sigfpe_handler (sig) int sig;
 
1362
#endif
 
1363
{
 
1364
  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
 
1365
  exit (sig != SIGFPE);
 
1366
}
 
1367
 
 
1368
int x = 1;
 
1369
int y = 0;
 
1370
int z;
 
1371
int nan;
 
1372
 
 
1373
int main ()
 
1374
{
 
1375
  signal (SIGFPE, sigfpe_handler);
 
1376
/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
 
1377
#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
 
1378
  signal (SIGTRAP, sigfpe_handler);
 
1379
#endif
 
1380
/* Linux/SPARC yields signal SIGILL.  */
 
1381
#if defined (__sparc__) && defined (__linux__)
 
1382
  signal (SIGILL, sigfpe_handler);
 
1383
#endif
 
1384
 
 
1385
  z = x / y;
 
1386
  nan = y / y;
 
1387
  exit (1);
 
1388
}
 
1389
], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
 
1390
        [
 
1391
          # Guess based on the CPU.
 
1392
          case "$host_cpu" in
 
1393
            alpha* | i[34567]86 | m68k | s390*)
 
1394
              gt_cv_int_divbyzero_sigfpe="guessing yes";;
 
1395
            *)
 
1396
              gt_cv_int_divbyzero_sigfpe="guessing no";;
 
1397
          esac
 
1398
        ])
 
1399
    ])
 
1400
  case "$gt_cv_int_divbyzero_sigfpe" in
 
1401
    *yes) value=1;;
 
1402
    *) value=0;;
 
1403
  esac
 
1404
  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
 
1405
    [Define if integer division by zero raises signal SIGFPE.])
 
1406
])
 
1407
 
 
1408
# intmax.m4 serial 2 (gettext-0.14.2)
 
1409
dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
 
1410
dnl This file is free software; the Free Software Foundation
 
1411
dnl gives unlimited permission to copy and/or distribute it,
 
1412
dnl with or without modifications, as long as this notice is preserved.
 
1413
 
 
1414
dnl From Bruno Haible.
 
1415
dnl Test whether the system has the 'intmax_t' type, but don't attempt to
 
1416
dnl find a replacement if it is lacking.
 
1417
 
 
1418
AC_DEFUN([gt_TYPE_INTMAX_T],
 
1419
[
 
1420
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
1421
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
1422
  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
 
1423
    [AC_TRY_COMPILE([
 
1424
#include <stddef.h>
 
1425
#include <stdlib.h>
 
1426
#if HAVE_STDINT_H_WITH_UINTMAX
 
1427
#include <stdint.h>
 
1428
#endif
 
1429
#if HAVE_INTTYPES_H_WITH_UINTMAX
 
1430
#include <inttypes.h>
 
1431
#endif
 
1432
], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
 
1433
  if test $gt_cv_c_intmax_t = yes; then
 
1434
    AC_DEFINE(HAVE_INTMAX_T, 1,
 
1435
      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
 
1436
  fi
 
1437
])
 
1438
 
 
1439
# inttypes-pri.m4 serial 1 (gettext-0.11.4)
 
1440
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
 
1441
dnl This file is free software; the Free Software Foundation
 
1442
dnl gives unlimited permission to copy and/or distribute it,
 
1443
dnl with or without modifications, as long as this notice is preserved.
 
1444
 
 
1445
dnl From Bruno Haible.
 
1446
 
 
1447
# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
 
1448
# macros to non-string values.  This is the case on AIX 4.3.3.
 
1449
 
 
1450
AC_DEFUN([gt_INTTYPES_PRI],
 
1451
[
 
1452
  AC_REQUIRE([gt_HEADER_INTTYPES_H])
 
1453
  if test $gt_cv_header_inttypes_h = yes; then
 
1454
    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
 
1455
      gt_cv_inttypes_pri_broken,
 
1456
      [
 
1457
        AC_TRY_COMPILE([#include <inttypes.h>
 
1458
#ifdef PRId32
 
1459
char *p = PRId32;
 
1460
#endif
 
1461
], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
 
1462
      ])
 
1463
  fi
 
1464
  if test "$gt_cv_inttypes_pri_broken" = yes; then
 
1465
    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
 
1466
      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
 
1467
  fi
 
1468
])
 
1469
 
 
1470
# inttypes.m4 serial 1 (gettext-0.11.4)
 
1471
dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
 
1472
dnl This file is free software; the Free Software Foundation
 
1473
dnl gives unlimited permission to copy and/or distribute it,
 
1474
dnl with or without modifications, as long as this notice is preserved.
 
1475
 
 
1476
dnl From Paul Eggert.
 
1477
 
 
1478
# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
 
1479
# <sys/types.h>.
 
1480
 
 
1481
AC_DEFUN([gt_HEADER_INTTYPES_H],
 
1482
[
 
1483
  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
 
1484
  [
 
1485
    AC_TRY_COMPILE(
 
1486
      [#include <sys/types.h>
 
1487
#include <inttypes.h>],
 
1488
      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
 
1489
  ])
 
1490
  if test $gt_cv_header_inttypes_h = yes; then
 
1491
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
 
1492
      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
 
1493
  fi
 
1494
])
 
1495
 
 
1496
# inttypes_h.m4 serial 6
 
1497
dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
 
1498
dnl This file is free software; the Free Software Foundation
 
1499
dnl gives unlimited permission to copy and/or distribute it,
 
1500
dnl with or without modifications, as long as this notice is preserved.
 
1501
 
 
1502
dnl From Paul Eggert.
 
1503
 
 
1504
# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
 
1505
# doesn't clash with <sys/types.h>, and declares uintmax_t.
 
1506
 
 
1507
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 
1508
[
 
1509
  AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
 
1510
  [AC_TRY_COMPILE(
 
1511
    [#include <sys/types.h>
 
1512
#include <inttypes.h>],
 
1513
    [uintmax_t i = (uintmax_t) -1;],
 
1514
    gl_cv_header_inttypes_h=yes,
 
1515
    gl_cv_header_inttypes_h=no)])
 
1516
  if test $gl_cv_header_inttypes_h = yes; then
 
1517
    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
 
1518
      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
 
1519
       and declares uintmax_t. ])
 
1520
  fi
 
1521
])
 
1522
 
 
1523
# lcmessage.m4 serial 4 (gettext-0.14.2)
 
1524
dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
 
1525
dnl This file is free software; the Free Software Foundation
 
1526
dnl gives unlimited permission to copy and/or distribute it,
 
1527
dnl with or without modifications, as long as this notice is preserved.
 
1528
dnl
 
1529
dnl This file can can be used in projects which are not available under
 
1530
dnl the GNU General Public License or the GNU Library General Public
 
1531
dnl License but which still want to provide support for the GNU gettext
 
1532
dnl functionality.
 
1533
dnl Please note that the actual code of the GNU gettext library is covered
 
1534
dnl by the GNU Library General Public License, and the rest of the GNU
 
1535
dnl gettext package package is covered by the GNU General Public License.
 
1536
dnl They are *not* in the public domain.
 
1537
 
 
1538
dnl Authors:
 
1539
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
 
1540
 
 
1541
# Check whether LC_MESSAGES is available in <locale.h>.
 
1542
 
 
1543
AC_DEFUN([gt_LC_MESSAGES],
 
1544
[
 
1545
  AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
 
1546
    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
 
1547
       gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
 
1548
  if test $gt_cv_val_LC_MESSAGES = yes; then
 
1549
    AC_DEFINE(HAVE_LC_MESSAGES, 1,
 
1550
      [Define if your <locale.h> file defines LC_MESSAGES.])
 
1551
  fi
 
1552
])
 
1553
 
 
1554
# lib-ld.m4 serial 3 (gettext-0.13)
 
1555
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
 
1556
dnl This file is free software; the Free Software Foundation
 
1557
dnl gives unlimited permission to copy and/or distribute it,
 
1558
dnl with or without modifications, as long as this notice is preserved.
 
1559
 
 
1560
dnl Subroutines of libtool.m4,
 
1561
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
 
1562
dnl with libtool.m4.
 
1563
 
 
1564
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
1565
AC_DEFUN([AC_LIB_PROG_LD_GNU],
 
1566
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 
1567
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
1568
case `$LD -v 2>&1 </dev/null` in
 
1569
*GNU* | *'with BFD'*)
 
1570
  acl_cv_prog_gnu_ld=yes ;;
 
1571
*)
 
1572
  acl_cv_prog_gnu_ld=no ;;
 
1573
esac])
 
1574
with_gnu_ld=$acl_cv_prog_gnu_ld
 
1575
])
 
1576
 
 
1577
dnl From libtool-1.4. Sets the variable LD.
 
1578
AC_DEFUN([AC_LIB_PROG_LD],
 
1579
[AC_ARG_WITH(gnu-ld,
 
1580
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
1581
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
1582
AC_REQUIRE([AC_PROG_CC])dnl
 
1583
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1584
# Prepare PATH_SEPARATOR.
 
1585
# The user is always right.
 
1586
if test "${PATH_SEPARATOR+set}" != set; then
 
1587
  echo "#! /bin/sh" >conf$$.sh
 
1588
  echo  "exit 0"   >>conf$$.sh
 
1589
  chmod +x conf$$.sh
 
1590
  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
 
1591
    PATH_SEPARATOR=';'
 
1592
  else
 
1593
    PATH_SEPARATOR=:
 
1594
  fi
 
1595
  rm -f conf$$.sh
 
1596
fi
 
1597
ac_prog=ld
 
1598
if test "$GCC" = yes; then
 
1599
  # Check if gcc -print-prog-name=ld gives a path.
 
1600
  AC_MSG_CHECKING([for ld used by GCC])
 
1601
  case $host in
 
1602
  *-*-mingw*)
 
1603
    # gcc leaves a trailing carriage return which upsets mingw
 
1604
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
1605
  *)
 
1606
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
1607
  esac
 
1608
  case $ac_prog in
 
1609
    # Accept absolute paths.
 
1610
    [[\\/]* | [A-Za-z]:[\\/]*)]
 
1611
      [re_direlt='/[^/][^/]*/\.\./']
 
1612
      # Canonicalize the path of ld
 
1613
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
1614
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
1615
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
1616
      done
 
1617
      test -z "$LD" && LD="$ac_prog"
 
1618
      ;;
 
1619
  "")
 
1620
    # If it fails, then pretend we aren't using GCC.
 
1621
    ac_prog=ld
 
1622
    ;;
 
1623
  *)
 
1624
    # If it is relative, then search for the first ld in PATH.
 
1625
    with_gnu_ld=unknown
 
1626
    ;;
 
1627
  esac
 
1628
elif test "$with_gnu_ld" = yes; then
 
1629
  AC_MSG_CHECKING([for GNU ld])
 
1630
else
 
1631
  AC_MSG_CHECKING([for non-GNU ld])
 
1632
fi
 
1633
AC_CACHE_VAL(acl_cv_path_LD,
 
1634
[if test -z "$LD"; then
 
1635
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
1636
  for ac_dir in $PATH; do
 
1637
    test -z "$ac_dir" && ac_dir=.
 
1638
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
1639
      acl_cv_path_LD="$ac_dir/$ac_prog"
 
1640
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
1641
      # but apparently some GNU ld's only accept -v.
 
1642
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
1643
      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
 
1644
      *GNU* | *'with BFD'*)
 
1645
        test "$with_gnu_ld" != no && break ;;
 
1646
      *)
 
1647
        test "$with_gnu_ld" != yes && break ;;
 
1648
      esac
 
1649
    fi
 
1650
  done
 
1651
  IFS="$ac_save_ifs"
 
1652
else
 
1653
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
 
1654
fi])
 
1655
LD="$acl_cv_path_LD"
 
1656
if test -n "$LD"; then
 
1657
  AC_MSG_RESULT($LD)
 
1658
else
30
1659
  AC_MSG_RESULT(no)
31
 
  ifelse([$2], , :, [$2])
32
 
else
33
 
  AC_MSG_RESULT(yes)
34
 
  GNOMEUI_CFLAGS=`$GNOME_CONFIG --cflags gnomeui`
35
 
  GNOMEUI_LIBS=`$GNOME_CONFIG --libs gnomeui`
36
 
  ifelse([$1], , :, [$1])
37
 
fi  
38
 
AC_SUBST(GNOMEUI_CFLAGS)
39
 
AC_SUBST(GNOMEUI_LIBS)  
40
 
AC_SUBST(EXTRACFLAGS)
41
 
AC_SUBST(EXTRACXXFLAGS)
42
 
])
43
 
 
44
 
# lib-prefix.m4 serial 3 (gettext-0.12.2)
45
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
46
 
dnl This file is free software, distributed under the terms of the GNU
47
 
dnl General Public License.  As a special exception to the GNU General
48
 
dnl Public License, this file may be distributed as part of a program
49
 
dnl that contains a configuration script generated by Autoconf, under
50
 
dnl the same distribution terms as the rest of that program.
51
 
 
52
 
dnl From Bruno Haible.
53
 
 
54
 
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
55
 
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
56
 
dnl require excessive bracketing.
57
 
ifdef([AC_HELP_STRING],
58
 
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
59
 
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
60
 
 
61
 
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
62
 
dnl to access previously installed libraries. The basic assumption is that
63
 
dnl a user will want packages to use other packages he previously installed
64
 
dnl with the same --prefix option.
65
 
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
66
 
dnl libraries, but is otherwise very convenient.
67
 
AC_DEFUN([AC_LIB_PREFIX],
68
 
[
69
 
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
70
 
  AC_REQUIRE([AC_PROG_CC])
71
 
  AC_REQUIRE([AC_CANONICAL_HOST])
72
 
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
73
 
  dnl By default, look in $includedir and $libdir.
74
 
  use_additional=yes
75
 
  AC_LIB_WITH_FINAL_PREFIX([
76
 
    eval additional_includedir=\"$includedir\"
77
 
    eval additional_libdir=\"$libdir\"
78
 
  ])
79
 
  AC_LIB_ARG_WITH([lib-prefix],
80
 
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
81
 
  --without-lib-prefix    don't search for libraries in includedir and libdir],
82
 
[
83
 
    if test "X$withval" = "Xno"; then
84
 
      use_additional=no
85
 
    else
86
 
      if test "X$withval" = "X"; then
87
 
        AC_LIB_WITH_FINAL_PREFIX([
88
 
          eval additional_includedir=\"$includedir\"
89
 
          eval additional_libdir=\"$libdir\"
90
 
        ])
91
 
      else
92
 
        additional_includedir="$withval/include"
93
 
        additional_libdir="$withval/lib"
94
 
      fi
95
 
    fi
96
 
])
97
 
  if test $use_additional = yes; then
98
 
    dnl Potentially add $additional_includedir to $CPPFLAGS.
99
 
    dnl But don't add it
100
 
    dnl   1. if it's the standard /usr/include,
101
 
    dnl   2. if it's already present in $CPPFLAGS,
102
 
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
103
 
    dnl   4. if it doesn't exist as a directory.
104
 
    if test "X$additional_includedir" != "X/usr/include"; then
105
 
      haveit=
106
 
      for x in $CPPFLAGS; do
107
 
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
108
 
        if test "X$x" = "X-I$additional_includedir"; then
109
 
          haveit=yes
110
 
          break
111
 
        fi
112
 
      done
113
 
      if test -z "$haveit"; then
114
 
        if test "X$additional_includedir" = "X/usr/local/include"; then
115
 
          if test -n "$GCC"; then
116
 
            case $host_os in
117
 
              linux*) haveit=yes;;
118
 
            esac
119
 
          fi
120
 
        fi
121
 
        if test -z "$haveit"; then
122
 
          if test -d "$additional_includedir"; then
123
 
            dnl Really add $additional_includedir to $CPPFLAGS.
124
 
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
125
 
          fi
126
 
        fi
127
 
      fi
128
 
    fi
129
 
    dnl Potentially add $additional_libdir to $LDFLAGS.
130
 
    dnl But don't add it
131
 
    dnl   1. if it's the standard /usr/lib,
132
 
    dnl   2. if it's already present in $LDFLAGS,
133
 
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
134
 
    dnl   4. if it doesn't exist as a directory.
135
 
    if test "X$additional_libdir" != "X/usr/lib"; then
136
 
      haveit=
137
 
      for x in $LDFLAGS; do
138
 
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
139
 
        if test "X$x" = "X-L$additional_libdir"; then
140
 
          haveit=yes
141
 
          break
142
 
        fi
143
 
      done
144
 
      if test -z "$haveit"; then
145
 
        if test "X$additional_libdir" = "X/usr/local/lib"; then
146
 
          if test -n "$GCC"; then
147
 
            case $host_os in
148
 
              linux*) haveit=yes;;
149
 
            esac
150
 
          fi
151
 
        fi
152
 
        if test -z "$haveit"; then
153
 
          if test -d "$additional_libdir"; then
154
 
            dnl Really add $additional_libdir to $LDFLAGS.
155
 
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
156
 
          fi
157
 
        fi
158
 
      fi
159
 
    fi
160
 
  fi
161
 
])
162
 
 
163
 
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
164
 
dnl acl_final_exec_prefix, containing the values to which $prefix and
165
 
dnl $exec_prefix will expand at the end of the configure script.
166
 
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
167
 
[
168
 
  dnl Unfortunately, prefix and exec_prefix get only finally determined
169
 
  dnl at the end of configure.
170
 
  if test "X$prefix" = "XNONE"; then
171
 
    acl_final_prefix="$ac_default_prefix"
172
 
  else
173
 
    acl_final_prefix="$prefix"
174
 
  fi
175
 
  if test "X$exec_prefix" = "XNONE"; then
176
 
    acl_final_exec_prefix='${prefix}'
177
 
  else
178
 
    acl_final_exec_prefix="$exec_prefix"
179
 
  fi
180
 
  acl_save_prefix="$prefix"
181
 
  prefix="$acl_final_prefix"
182
 
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
183
 
  prefix="$acl_save_prefix"
184
 
])
185
 
 
186
 
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
187
 
dnl variables prefix and exec_prefix bound to the values they will have
188
 
dnl at the end of the configure script.
189
 
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
190
 
[
191
 
  acl_save_prefix="$prefix"
192
 
  prefix="$acl_final_prefix"
193
 
  acl_save_exec_prefix="$exec_prefix"
194
 
  exec_prefix="$acl_final_exec_prefix"
195
 
  $1
196
 
  exec_prefix="$acl_save_exec_prefix"
197
 
  prefix="$acl_save_prefix"
198
 
])
199
 
 
200
 
# lib-link.m4 serial 4 (gettext-0.12)
201
 
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
202
 
dnl This file is free software, distributed under the terms of the GNU
203
 
dnl General Public License.  As a special exception to the GNU General
204
 
dnl Public License, this file may be distributed as part of a program
205
 
dnl that contains a configuration script generated by Autoconf, under
206
 
dnl the same distribution terms as the rest of that program.
207
 
 
208
 
dnl From Bruno Haible.
 
1660
fi
 
1661
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
1662
AC_LIB_PROG_LD_GNU
 
1663
])
 
1664
 
 
1665
# lib-link.m4 serial 6 (gettext-0.14.3)
 
1666
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
 
1667
dnl This file is free software; the Free Software Foundation
 
1668
dnl gives unlimited permission to copy and/or distribute it,
 
1669
dnl with or without modifications, as long as this notice is preserved.
 
1670
 
 
1671
dnl From Bruno Haible.
 
1672
 
 
1673
AC_PREREQ(2.50)
209
1674
 
210
1675
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
211
1676
dnl the libraries corresponding to explicit and implicit dependencies.
294
1759
dnl hardcode_direct, hardcode_minus_L.
295
1760
AC_DEFUN([AC_LIB_RPATH],
296
1761
[
 
1762
  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
 
1763
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
297
1764
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
298
1765
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
299
1766
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
549
2016
                if test "X$additional_includedir" = "X/usr/local/include"; then
550
2017
                  if test -n "$GCC"; then
551
2018
                    case $host_os in
552
 
                      linux*) haveit=yes;;
 
2019
                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
553
2020
                    esac
554
2021
                  fi
555
2022
                fi
598
2065
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
599
2066
                        if test -n "$GCC"; then
600
2067
                          case $host_os in
601
 
                            linux*) haveit=yes;;
 
2068
                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
602
2069
                          esac
603
2070
                        fi
604
2071
                      fi
749
2216
  done
750
2217
])
751
2218
 
752
 
# lib-ld.m4 serial 2 (gettext-0.12)
753
 
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
754
 
dnl This file is free software, distributed under the terms of the GNU
755
 
dnl General Public License.  As a special exception to the GNU General
756
 
dnl Public License, this file may be distributed as part of a program
757
 
dnl that contains a configuration script generated by Autoconf, under
758
 
dnl the same distribution terms as the rest of that program.
759
 
 
760
 
dnl Subroutines of libtool.m4,
761
 
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
762
 
dnl with libtool.m4.
763
 
 
764
 
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
765
 
AC_DEFUN([AC_LIB_PROG_LD_GNU],
766
 
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
767
 
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
768
 
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
769
 
  acl_cv_prog_gnu_ld=yes
770
 
else
771
 
  acl_cv_prog_gnu_ld=no
772
 
fi])
773
 
with_gnu_ld=$acl_cv_prog_gnu_ld
774
 
])
775
 
 
776
 
dnl From libtool-1.4. Sets the variable LD.
777
 
AC_DEFUN([AC_LIB_PROG_LD],
778
 
[AC_ARG_WITH(gnu-ld,
779
 
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
780
 
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
781
 
AC_REQUIRE([AC_PROG_CC])dnl
782
 
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
2219
# lib-prefix.m4 serial 4 (gettext-0.14.2)
 
2220
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
 
2221
dnl This file is free software; the Free Software Foundation
 
2222
dnl gives unlimited permission to copy and/or distribute it,
 
2223
dnl with or without modifications, as long as this notice is preserved.
 
2224
 
 
2225
dnl From Bruno Haible.
 
2226
 
 
2227
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
 
2228
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
 
2229
dnl require excessive bracketing.
 
2230
ifdef([AC_HELP_STRING],
 
2231
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
 
2232
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
 
2233
 
 
2234
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 
2235
dnl to access previously installed libraries. The basic assumption is that
 
2236
dnl a user will want packages to use other packages he previously installed
 
2237
dnl with the same --prefix option.
 
2238
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
 
2239
dnl libraries, but is otherwise very convenient.
 
2240
AC_DEFUN([AC_LIB_PREFIX],
 
2241
[
 
2242
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
 
2243
  AC_REQUIRE([AC_PROG_CC])
 
2244
  AC_REQUIRE([AC_CANONICAL_HOST])
 
2245
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
2246
  dnl By default, look in $includedir and $libdir.
 
2247
  use_additional=yes
 
2248
  AC_LIB_WITH_FINAL_PREFIX([
 
2249
    eval additional_includedir=\"$includedir\"
 
2250
    eval additional_libdir=\"$libdir\"
 
2251
  ])
 
2252
  AC_LIB_ARG_WITH([lib-prefix],
 
2253
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
 
2254
  --without-lib-prefix    don't search for libraries in includedir and libdir],
 
2255
[
 
2256
    if test "X$withval" = "Xno"; then
 
2257
      use_additional=no
 
2258
    else
 
2259
      if test "X$withval" = "X"; then
 
2260
        AC_LIB_WITH_FINAL_PREFIX([
 
2261
          eval additional_includedir=\"$includedir\"
 
2262
          eval additional_libdir=\"$libdir\"
 
2263
        ])
 
2264
      else
 
2265
        additional_includedir="$withval/include"
 
2266
        additional_libdir="$withval/lib"
 
2267
      fi
 
2268
    fi
 
2269
])
 
2270
  if test $use_additional = yes; then
 
2271
    dnl Potentially add $additional_includedir to $CPPFLAGS.
 
2272
    dnl But don't add it
 
2273
    dnl   1. if it's the standard /usr/include,
 
2274
    dnl   2. if it's already present in $CPPFLAGS,
 
2275
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
 
2276
    dnl   4. if it doesn't exist as a directory.
 
2277
    if test "X$additional_includedir" != "X/usr/include"; then
 
2278
      haveit=
 
2279
      for x in $CPPFLAGS; do
 
2280
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2281
        if test "X$x" = "X-I$additional_includedir"; then
 
2282
          haveit=yes
 
2283
          break
 
2284
        fi
 
2285
      done
 
2286
      if test -z "$haveit"; then
 
2287
        if test "X$additional_includedir" = "X/usr/local/include"; then
 
2288
          if test -n "$GCC"; then
 
2289
            case $host_os in
 
2290
              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
 
2291
            esac
 
2292
          fi
 
2293
        fi
 
2294
        if test -z "$haveit"; then
 
2295
          if test -d "$additional_includedir"; then
 
2296
            dnl Really add $additional_includedir to $CPPFLAGS.
 
2297
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
 
2298
          fi
 
2299
        fi
 
2300
      fi
 
2301
    fi
 
2302
    dnl Potentially add $additional_libdir to $LDFLAGS.
 
2303
    dnl But don't add it
 
2304
    dnl   1. if it's the standard /usr/lib,
 
2305
    dnl   2. if it's already present in $LDFLAGS,
 
2306
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
 
2307
    dnl   4. if it doesn't exist as a directory.
 
2308
    if test "X$additional_libdir" != "X/usr/lib"; then
 
2309
      haveit=
 
2310
      for x in $LDFLAGS; do
 
2311
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2312
        if test "X$x" = "X-L$additional_libdir"; then
 
2313
          haveit=yes
 
2314
          break
 
2315
        fi
 
2316
      done
 
2317
      if test -z "$haveit"; then
 
2318
        if test "X$additional_libdir" = "X/usr/local/lib"; then
 
2319
          if test -n "$GCC"; then
 
2320
            case $host_os in
 
2321
              linux*) haveit=yes;;
 
2322
            esac
 
2323
          fi
 
2324
        fi
 
2325
        if test -z "$haveit"; then
 
2326
          if test -d "$additional_libdir"; then
 
2327
            dnl Really add $additional_libdir to $LDFLAGS.
 
2328
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
 
2329
          fi
 
2330
        fi
 
2331
      fi
 
2332
    fi
 
2333
  fi
 
2334
])
 
2335
 
 
2336
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
 
2337
dnl acl_final_exec_prefix, containing the values to which $prefix and
 
2338
dnl $exec_prefix will expand at the end of the configure script.
 
2339
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
 
2340
[
 
2341
  dnl Unfortunately, prefix and exec_prefix get only finally determined
 
2342
  dnl at the end of configure.
 
2343
  if test "X$prefix" = "XNONE"; then
 
2344
    acl_final_prefix="$ac_default_prefix"
 
2345
  else
 
2346
    acl_final_prefix="$prefix"
 
2347
  fi
 
2348
  if test "X$exec_prefix" = "XNONE"; then
 
2349
    acl_final_exec_prefix='${prefix}'
 
2350
  else
 
2351
    acl_final_exec_prefix="$exec_prefix"
 
2352
  fi
 
2353
  acl_save_prefix="$prefix"
 
2354
  prefix="$acl_final_prefix"
 
2355
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
 
2356
  prefix="$acl_save_prefix"
 
2357
])
 
2358
 
 
2359
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
 
2360
dnl variables prefix and exec_prefix bound to the values they will have
 
2361
dnl at the end of the configure script.
 
2362
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 
2363
[
 
2364
  acl_save_prefix="$prefix"
 
2365
  prefix="$acl_final_prefix"
 
2366
  acl_save_exec_prefix="$exec_prefix"
 
2367
  exec_prefix="$acl_final_exec_prefix"
 
2368
  $1
 
2369
  exec_prefix="$acl_save_exec_prefix"
 
2370
  prefix="$acl_save_prefix"
 
2371
])
 
2372
 
 
2373
# longdouble.m4 serial 1 (gettext-0.12)
 
2374
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 
2375
dnl This file is free software; the Free Software Foundation
 
2376
dnl gives unlimited permission to copy and/or distribute it,
 
2377
dnl with or without modifications, as long as this notice is preserved.
 
2378
 
 
2379
dnl From Bruno Haible.
 
2380
dnl Test whether the compiler supports the 'long double' type.
 
2381
dnl Prerequisite: AC_PROG_CC
 
2382
 
 
2383
AC_DEFUN([gt_TYPE_LONGDOUBLE],
 
2384
[
 
2385
  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
 
2386
    [if test "$GCC" = yes; then
 
2387
       gt_cv_c_long_double=yes
 
2388
     else
 
2389
       AC_TRY_COMPILE([
 
2390
         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
 
2391
         long double foo = 0.0;
 
2392
         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
 
2393
         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
 
2394
         ], ,
 
2395
         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
 
2396
     fi])
 
2397
  if test $gt_cv_c_long_double = yes; then
 
2398
    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
 
2399
  fi
 
2400
])
 
2401
 
 
2402
# longlong.m4 serial 5
 
2403
dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
 
2404
dnl This file is free software; the Free Software Foundation
 
2405
dnl gives unlimited permission to copy and/or distribute it,
 
2406
dnl with or without modifications, as long as this notice is preserved.
 
2407
 
 
2408
dnl From Paul Eggert.
 
2409
 
 
2410
# Define HAVE_LONG_LONG if 'long long' works.
 
2411
 
 
2412
AC_DEFUN([gl_AC_TYPE_LONG_LONG],
 
2413
[
 
2414
  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
 
2415
  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
 
2416
    [long long llmax = (long long) -1;
 
2417
     return ll << i | ll >> i | llmax / ll | llmax % ll;],
 
2418
    ac_cv_type_long_long=yes,
 
2419
    ac_cv_type_long_long=no)])
 
2420
  if test $ac_cv_type_long_long = yes; then
 
2421
    AC_DEFINE(HAVE_LONG_LONG, 1,
 
2422
      [Define if you have the 'long long' type.])
 
2423
  fi
 
2424
])
 
2425
 
 
2426
# nls.m4 serial 2 (gettext-0.14.3)
 
2427
dnl Copyright (C) 1995-2003, 2005 Free Software Foundation, Inc.
 
2428
dnl This file is free software; the Free Software Foundation
 
2429
dnl gives unlimited permission to copy and/or distribute it,
 
2430
dnl with or without modifications, as long as this notice is preserved.
 
2431
dnl
 
2432
dnl This file can can be used in projects which are not available under
 
2433
dnl the GNU General Public License or the GNU Library General Public
 
2434
dnl License but which still want to provide support for the GNU gettext
 
2435
dnl functionality.
 
2436
dnl Please note that the actual code of the GNU gettext library is covered
 
2437
dnl by the GNU Library General Public License, and the rest of the GNU
 
2438
dnl gettext package package is covered by the GNU General Public License.
 
2439
dnl They are *not* in the public domain.
 
2440
 
 
2441
dnl Authors:
 
2442
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
2443
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
2444
 
 
2445
AC_PREREQ(2.50)
 
2446
 
 
2447
AC_DEFUN([AM_NLS],
 
2448
[
 
2449
  AC_MSG_CHECKING([whether NLS is requested])
 
2450
  dnl Default is enabled NLS
 
2451
  AC_ARG_ENABLE(nls,
 
2452
    [  --disable-nls           do not use Native Language Support],
 
2453
    USE_NLS=$enableval, USE_NLS=yes)
 
2454
  AC_MSG_RESULT($USE_NLS)
 
2455
  AC_SUBST(USE_NLS)
 
2456
])
 
2457
 
 
2458
AC_DEFUN([AM_MKINSTALLDIRS],
 
2459
[
 
2460
  dnl Tell automake >= 1.10 to complain if mkinstalldirs is missing.
 
2461
  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([mkinstalldirs])])
 
2462
  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
2463
  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
 
2464
  dnl Try to locate it.
 
2465
  MKINSTALLDIRS=
 
2466
  if test -n "$ac_aux_dir"; then
 
2467
    case "$ac_aux_dir" in
 
2468
      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
 
2469
      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
 
2470
    esac
 
2471
  fi
 
2472
  if test -z "$MKINSTALLDIRS"; then
 
2473
    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
2474
  fi
 
2475
  AC_SUBST(MKINSTALLDIRS)
 
2476
])
 
2477
 
 
2478
# po.m4 serial 7 (gettext-0.14.3)
 
2479
dnl Copyright (C) 1995-2005 Free Software Foundation, Inc.
 
2480
dnl This file is free software; the Free Software Foundation
 
2481
dnl gives unlimited permission to copy and/or distribute it,
 
2482
dnl with or without modifications, as long as this notice is preserved.
 
2483
dnl
 
2484
dnl This file can can be used in projects which are not available under
 
2485
dnl the GNU General Public License or the GNU Library General Public
 
2486
dnl License but which still want to provide support for the GNU gettext
 
2487
dnl functionality.
 
2488
dnl Please note that the actual code of the GNU gettext library is covered
 
2489
dnl by the GNU Library General Public License, and the rest of the GNU
 
2490
dnl gettext package package is covered by the GNU General Public License.
 
2491
dnl They are *not* in the public domain.
 
2492
 
 
2493
dnl Authors:
 
2494
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
2495
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
 
2496
 
 
2497
AC_PREREQ(2.50)
 
2498
 
 
2499
dnl Checks for all prerequisites of the po subdirectory.
 
2500
AC_DEFUN([AM_PO_SUBDIRS],
 
2501
[
 
2502
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
2503
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
2504
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
 
2505
  AC_REQUIRE([AM_NLS])dnl
 
2506
 
 
2507
  dnl Perform the following tests also if --disable-nls has been given,
 
2508
  dnl because they are needed for "make dist" to work.
 
2509
 
 
2510
  dnl Search for GNU msgfmt in the PATH.
 
2511
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
 
2512
  dnl The second test excludes FreeBSD msgfmt.
 
2513
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
2514
    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
2515
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
2516
    :)
 
2517
  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
2518
 
 
2519
  dnl Search for GNU xgettext 0.12 or newer in the PATH.
 
2520
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
 
2521
  dnl The second test excludes FreeBSD xgettext.
 
2522
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
2523
    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
 
2524
     (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)],
 
2525
    :)
 
2526
  dnl Remove leftover from FreeBSD xgettext call.
 
2527
  rm -f messages.po
 
2528
 
 
2529
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
 
2530
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
 
2531
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
2532
 
 
2533
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
 
2534
  dnl Test whether we really found GNU msgfmt.
 
2535
  if test "$GMSGFMT" != ":"; then
 
2536
    dnl If it is no GNU msgfmt we define it as : so that the
 
2537
    dnl Makefiles still can work.
 
2538
    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
 
2539
       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
 
2540
      : ;
 
2541
    else
 
2542
      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
 
2543
      AC_MSG_RESULT(
 
2544
        [found $GMSGFMT program is not GNU msgfmt; ignore it])
 
2545
      GMSGFMT=":"
 
2546
    fi
 
2547
  fi
 
2548
 
 
2549
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
 
2550
  dnl Test whether we really found GNU xgettext.
 
2551
  if test "$XGETTEXT" != ":"; then
 
2552
    dnl If it is no GNU xgettext we define it as : so that the
 
2553
    dnl Makefiles still can work.
 
2554
    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
 
2555
       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
 
2556
      : ;
 
2557
    else
 
2558
      AC_MSG_RESULT(
 
2559
        [found xgettext program is not GNU xgettext; ignore it])
 
2560
      XGETTEXT=":"
 
2561
    fi
 
2562
    dnl Remove leftover from FreeBSD xgettext call.
 
2563
    rm -f messages.po
 
2564
  fi
 
2565
 
 
2566
  AC_OUTPUT_COMMANDS([
 
2567
    for ac_file in $CONFIG_FILES; do
 
2568
      # Support "outfile[:infile[:infile...]]"
 
2569
      case "$ac_file" in
 
2570
        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
 
2571
      esac
 
2572
      # PO directories have a Makefile.in generated from Makefile.in.in.
 
2573
      case "$ac_file" in */Makefile.in)
 
2574
        # Adjust a relative srcdir.
 
2575
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
2576
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
2577
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
2578
        # In autoconf-2.13 it is called $ac_given_srcdir.
 
2579
        # In autoconf-2.50 it is called $srcdir.
 
2580
        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
2581
        case "$ac_given_srcdir" in
 
2582
          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
2583
          /*) top_srcdir="$ac_given_srcdir" ;;
 
2584
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
2585
        esac
 
2586
        # Treat a directory as a PO directory if and only if it has a
 
2587
        # POTFILES.in file. This allows packages to have multiple PO
 
2588
        # directories under different names or in different locations.
 
2589
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
 
2590
          rm -f "$ac_dir/POTFILES"
 
2591
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
 
2592
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
 
2593
          POMAKEFILEDEPS="POTFILES.in"
 
2594
          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
 
2595
          # on $ac_dir but don't depend on user-specified configuration
 
2596
          # parameters.
 
2597
          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
2598
            # The LINGUAS file contains the set of available languages.
 
2599
            if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
2600
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
2601
            fi
 
2602
            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
2603
            # Hide the ALL_LINGUAS assigment from automake.
 
2604
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
2605
            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
2606
          else
 
2607
            # The set of available languages was given in configure.in.
 
2608
            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
 
2609
          fi
 
2610
          # Compute POFILES
 
2611
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
2612
          # Compute UPDATEPOFILES
 
2613
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
2614
          # Compute DUMMYPOFILES
 
2615
          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
2616
          # Compute GMOFILES
 
2617
          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
2618
          case "$ac_given_srcdir" in
 
2619
            .) srcdirpre= ;;
 
2620
            *) srcdirpre='$(srcdir)/' ;;
 
2621
          esac
 
2622
          POFILES=
 
2623
          UPDATEPOFILES=
 
2624
          DUMMYPOFILES=
 
2625
          GMOFILES=
 
2626
          for lang in $ALL_LINGUAS; do
 
2627
            POFILES="$POFILES $srcdirpre$lang.po"
 
2628
            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
2629
            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
2630
            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
2631
          done
 
2632
          # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
2633
          # environment variable.
 
2634
          INST_LINGUAS=
 
2635
          if test -n "$ALL_LINGUAS"; then
 
2636
            for presentlang in $ALL_LINGUAS; do
 
2637
              useit=no
 
2638
              if test "%UNSET%" != "$LINGUAS"; then
 
2639
                desiredlanguages="$LINGUAS"
 
2640
              else
 
2641
                desiredlanguages="$ALL_LINGUAS"
 
2642
              fi
 
2643
              for desiredlang in $desiredlanguages; do
 
2644
                # Use the presentlang catalog if desiredlang is
 
2645
                #   a. equal to presentlang, or
 
2646
                #   b. a variant of presentlang (because in this case,
 
2647
                #      presentlang can be used as a fallback for messages
 
2648
                #      which are not translated in the desiredlang catalog).
 
2649
                case "$desiredlang" in
 
2650
                  "$presentlang"*) useit=yes;;
 
2651
                esac
 
2652
              done
 
2653
              if test $useit = yes; then
 
2654
                INST_LINGUAS="$INST_LINGUAS $presentlang"
 
2655
              fi
 
2656
            done
 
2657
          fi
 
2658
          CATALOGS=
 
2659
          if test -n "$INST_LINGUAS"; then
 
2660
            for lang in $INST_LINGUAS; do
 
2661
              CATALOGS="$CATALOGS $lang.gmo"
 
2662
            done
 
2663
          fi
 
2664
          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
 
2665
          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"
 
2666
          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
 
2667
            if test -f "$f"; then
 
2668
              case "$f" in
 
2669
                *.orig | *.bak | *~) ;;
 
2670
                *) cat "$f" >> "$ac_dir/Makefile" ;;
 
2671
              esac
 
2672
            fi
 
2673
          done
 
2674
        fi
 
2675
        ;;
 
2676
      esac
 
2677
    done],
 
2678
   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
 
2679
    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
 
2680
    # from automake.
 
2681
    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
 
2682
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
 
2683
    LINGUAS="${LINGUAS-%UNSET%}"
 
2684
   ])
 
2685
])
 
2686
 
 
2687
dnl Postprocesses a Makefile in a directory containing PO files.
 
2688
AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
 
2689
[
 
2690
  # When this code is run, in config.status, two variables have already been
 
2691
  # set:
 
2692
  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
 
2693
  # - LINGUAS is the value of the environment variable LINGUAS at configure
 
2694
  #   time.
 
2695
 
 
2696
changequote(,)dnl
 
2697
  # Adjust a relative srcdir.
 
2698
  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
2699
  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
2700
  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
2701
  # In autoconf-2.13 it is called $ac_given_srcdir.
 
2702
  # In autoconf-2.50 it is called $srcdir.
 
2703
  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
2704
  case "$ac_given_srcdir" in
 
2705
    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
2706
    /*) top_srcdir="$ac_given_srcdir" ;;
 
2707
    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
2708
  esac
 
2709
 
 
2710
  # Find a way to echo strings without interpreting backslash.
 
2711
  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
 
2712
    gt_echo='echo'
 
2713
  else
 
2714
    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
 
2715
      gt_echo='printf %s\n'
 
2716
    else
 
2717
      echo_func () {
 
2718
        cat <<EOT
 
2719
$*
 
2720
EOT
 
2721
      }
 
2722
      gt_echo='echo_func'
 
2723
    fi
 
2724
  fi
 
2725
 
 
2726
  # A sed script that extracts the value of VARIABLE from a Makefile.
 
2727
  sed_x_variable='
 
2728
# Test if the hold space is empty.
 
2729
x
 
2730
s/P/P/
 
2731
x
 
2732
ta
 
2733
# Yes it was empty. Look if we have the expected variable definition.
 
2734
/^[      ]*VARIABLE[     ]*=/{
 
2735
  # Seen the first line of the variable definition.
 
2736
  s/^[   ]*VARIABLE[     ]*=//
 
2737
  ba
 
2738
}
 
2739
bd
 
2740
:a
 
2741
# Here we are processing a line from the variable definition.
 
2742
# Remove comment, more precisely replace it with a space.
 
2743
s/#.*$/ /
 
2744
# See if the line ends in a backslash.
 
2745
tb
 
2746
:b
 
2747
s/\\$//
 
2748
# Print the line, without the trailing backslash.
 
2749
p
 
2750
tc
 
2751
# There was no trailing backslash. The end of the variable definition is
 
2752
# reached. Clear the hold space.
 
2753
s/^.*$//
 
2754
x
 
2755
bd
 
2756
:c
 
2757
# A trailing backslash means that the variable definition continues in the
 
2758
# next line. Put a nonempty string into the hold space to indicate this.
 
2759
s/^.*$/P/
 
2760
x
 
2761
:d
 
2762
'
 
2763
changequote([,])dnl
 
2764
 
 
2765
  # Set POTFILES to the value of the Makefile variable POTFILES.
 
2766
  sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
 
2767
  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
 
2768
  # Compute POTFILES_DEPS as
 
2769
  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
 
2770
  POTFILES_DEPS=
 
2771
  for file in $POTFILES; do
 
2772
    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
 
2773
  done
 
2774
  POMAKEFILEDEPS=""
 
2775
 
 
2776
  if test -n "$OBSOLETE_ALL_LINGUAS"; then
 
2777
    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
2778
  fi
 
2779
  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
2780
    # The LINGUAS file contains the set of available languages.
 
2781
    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
2782
    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
 
2783
  else
 
2784
    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
 
2785
    sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
 
2786
    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
 
2787
  fi
 
2788
  # Hide the ALL_LINGUAS assigment from automake.
 
2789
  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
2790
  # Compute POFILES
 
2791
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
 
2792
  # Compute UPDATEPOFILES
 
2793
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
 
2794
  # Compute DUMMYPOFILES
 
2795
  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
 
2796
  # Compute GMOFILES
 
2797
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
 
2798
  # Compute PROPERTIESFILES
 
2799
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
 
2800
  # Compute CLASSFILES
 
2801
  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
 
2802
  # Compute QMFILES
 
2803
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
 
2804
  # Compute MSGFILES
 
2805
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
 
2806
  # Compute RESOURCESDLLFILES
 
2807
  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
 
2808
  case "$ac_given_srcdir" in
 
2809
    .) srcdirpre= ;;
 
2810
    *) srcdirpre='$(srcdir)/' ;;
 
2811
  esac
 
2812
  POFILES=
 
2813
  UPDATEPOFILES=
 
2814
  DUMMYPOFILES=
 
2815
  GMOFILES=
 
2816
  PROPERTIESFILES=
 
2817
  CLASSFILES=
 
2818
  QMFILES=
 
2819
  MSGFILES=
 
2820
  RESOURCESDLLFILES=
 
2821
  for lang in $ALL_LINGUAS; do
 
2822
    POFILES="$POFILES $srcdirpre$lang.po"
 
2823
    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
2824
    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
2825
    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
2826
    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
 
2827
    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
 
2828
    QMFILES="$QMFILES $srcdirpre$lang.qm"
 
2829
    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
2830
    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
 
2831
    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/'`
 
2832
    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
 
2833
  done
 
2834
  # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
2835
  # environment variable.
 
2836
  INST_LINGUAS=
 
2837
  if test -n "$ALL_LINGUAS"; then
 
2838
    for presentlang in $ALL_LINGUAS; do
 
2839
      useit=no
 
2840
      if test "%UNSET%" != "$LINGUAS"; then
 
2841
        desiredlanguages="$LINGUAS"
 
2842
      else
 
2843
        desiredlanguages="$ALL_LINGUAS"
 
2844
      fi
 
2845
      for desiredlang in $desiredlanguages; do
 
2846
        # Use the presentlang catalog if desiredlang is
 
2847
        #   a. equal to presentlang, or
 
2848
        #   b. a variant of presentlang (because in this case,
 
2849
        #      presentlang can be used as a fallback for messages
 
2850
        #      which are not translated in the desiredlang catalog).
 
2851
        case "$desiredlang" in
 
2852
          "$presentlang"*) useit=yes;;
 
2853
        esac
 
2854
      done
 
2855
      if test $useit = yes; then
 
2856
        INST_LINGUAS="$INST_LINGUAS $presentlang"
 
2857
      fi
 
2858
    done
 
2859
  fi
 
2860
  CATALOGS=
 
2861
  JAVACATALOGS=
 
2862
  QTCATALOGS=
 
2863
  TCLCATALOGS=
 
2864
  CSHARPCATALOGS=
 
2865
  if test -n "$INST_LINGUAS"; then
 
2866
    for lang in $INST_LINGUAS; do
 
2867
      CATALOGS="$CATALOGS $lang.gmo"
 
2868
      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
 
2869
      QTCATALOGS="$QTCATALOGS $lang.qm"
 
2870
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
2871
      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
 
2872
      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/'`
 
2873
      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
 
2874
    done
 
2875
  fi
 
2876
 
 
2877
  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"
 
2878
  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
 
2879
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
2880
    for lang in $ALL_LINGUAS; do
 
2881
      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
 
2882
      cat >> "$ac_file.tmp" <<EOF
 
2883
$frobbedlang.msg: $lang.po
 
2884
        @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
 
2885
        \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
2886
EOF
 
2887
    done
 
2888
  fi
 
2889
  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
 
2890
    # Add dependencies that cannot be formulated as a simple suffix rule.
 
2891
    for lang in $ALL_LINGUAS; do
 
2892
      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/'`
 
2893
      cat >> "$ac_file.tmp" <<EOF
 
2894
$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
 
2895
        @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
 
2896
        \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
 
2897
EOF
 
2898
    done
 
2899
  fi
 
2900
  if test -n "$POMAKEFILEDEPS"; then
 
2901
    cat >> "$ac_file.tmp" <<EOF
 
2902
Makefile: $POMAKEFILEDEPS
 
2903
EOF
 
2904
  fi
 
2905
  mv "$ac_file.tmp" "$ac_file"
 
2906
])
 
2907
 
 
2908
# printf-posix.m4 serial 2 (gettext-0.13.1)
 
2909
dnl Copyright (C) 2003 Free Software Foundation, Inc.
 
2910
dnl This file is free software; the Free Software Foundation
 
2911
dnl gives unlimited permission to copy and/or distribute it,
 
2912
dnl with or without modifications, as long as this notice is preserved.
 
2913
 
 
2914
dnl From Bruno Haible.
 
2915
dnl Test whether the printf() function supports POSIX/XSI format strings with
 
2916
dnl positions.
 
2917
 
 
2918
AC_DEFUN([gt_PRINTF_POSIX],
 
2919
[
 
2920
  AC_REQUIRE([AC_PROG_CC])
 
2921
  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
 
2922
    gt_cv_func_printf_posix,
 
2923
    [
 
2924
      AC_TRY_RUN([
 
2925
#include <stdio.h>
 
2926
#include <string.h>
 
2927
/* The string "%2$d %1$d", with dollar characters protected from the shell's
 
2928
   dollar expansion (possibly an autoconf bug).  */
 
2929
static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
 
2930
static char buf[100];
 
2931
int main ()
 
2932
{
 
2933
  sprintf (buf, format, 33, 55);
 
2934
  return (strcmp (buf, "55 33") != 0);
 
2935
}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
 
2936
      [
 
2937
        AC_EGREP_CPP(notposix, [
 
2938
#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
 
2939
  notposix
 
2940
#endif
 
2941
        ], gt_cv_func_printf_posix="guessing no",
 
2942
           gt_cv_func_printf_posix="guessing yes")
 
2943
      ])
 
2944
    ])
 
2945
  case $gt_cv_func_printf_posix in
 
2946
    *yes)
 
2947
      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
 
2948
        [Define if your printf() function supports format strings with positions.])
 
2949
      ;;
 
2950
  esac
 
2951
])
 
2952
 
 
2953
# progtest.m4 serial 4 (gettext-0.14.2)
 
2954
dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
 
2955
dnl This file is free software; the Free Software Foundation
 
2956
dnl gives unlimited permission to copy and/or distribute it,
 
2957
dnl with or without modifications, as long as this notice is preserved.
 
2958
dnl
 
2959
dnl This file can can be used in projects which are not available under
 
2960
dnl the GNU General Public License or the GNU Library General Public
 
2961
dnl License but which still want to provide support for the GNU gettext
 
2962
dnl functionality.
 
2963
dnl Please note that the actual code of the GNU gettext library is covered
 
2964
dnl by the GNU Library General Public License, and the rest of the GNU
 
2965
dnl gettext package package is covered by the GNU General Public License.
 
2966
dnl They are *not* in the public domain.
 
2967
 
 
2968
dnl Authors:
 
2969
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
 
2970
 
 
2971
AC_PREREQ(2.50)
 
2972
 
 
2973
# Search path for a program which passes the given test.
 
2974
 
 
2975
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
 
2976
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
 
2977
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
 
2978
[
783
2979
# Prepare PATH_SEPARATOR.
784
2980
# The user is always right.
785
2981
if test "${PATH_SEPARATOR+set}" != set; then
793
2989
  fi
794
2990
  rm -f conf$$.sh
795
2991
fi
796
 
ac_prog=ld
797
 
if test "$GCC" = yes; then
798
 
  # Check if gcc -print-prog-name=ld gives a path.
799
 
  AC_MSG_CHECKING([for ld used by GCC])
800
 
  case $host in
801
 
  *-*-mingw*)
802
 
    # gcc leaves a trailing carriage return which upsets mingw
803
 
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
2992
 
 
2993
# Find out how to test for executable files. Don't use a zero-byte file,
 
2994
# as systems may use methods other than mode bits to determine executability.
 
2995
cat >conf$$.file <<_ASEOF
 
2996
#! /bin/sh
 
2997
exit 0
 
2998
_ASEOF
 
2999
chmod +x conf$$.file
 
3000
if test -x conf$$.file >/dev/null 2>&1; then
 
3001
  ac_executable_p="test -x"
 
3002
else
 
3003
  ac_executable_p="test -f"
 
3004
fi
 
3005
rm -f conf$$.file
 
3006
 
 
3007
# Extract the first word of "$2", so it can be a program name with args.
 
3008
set dummy $2; ac_word=[$]2
 
3009
AC_MSG_CHECKING([for $ac_word])
 
3010
AC_CACHE_VAL(ac_cv_path_$1,
 
3011
[case "[$]$1" in
 
3012
  [[\\/]]* | ?:[[\\/]]*)
 
3013
    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
 
3014
    ;;
804
3015
  *)
805
 
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
806
 
  esac
807
 
  case $ac_prog in
808
 
    # Accept absolute paths.
809
 
    [[\\/]* | [A-Za-z]:[\\/]*)]
810
 
      [re_direlt='/[^/][^/]*/\.\./']
811
 
      # Canonicalize the path of ld
812
 
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
813
 
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
814
 
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
3016
    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
 
3017
    for ac_dir in ifelse([$5], , $PATH, [$5]); do
 
3018
      IFS="$ac_save_IFS"
 
3019
      test -z "$ac_dir" && ac_dir=.
 
3020
      for ac_exec_ext in '' $ac_executable_extensions; do
 
3021
        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
 
3022
          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
 
3023
          if [$3]; then
 
3024
            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
 
3025
            break 2
 
3026
          fi
 
3027
        fi
815
3028
      done
816
 
      test -z "$LD" && LD="$ac_prog"
817
 
      ;;
818
 
  "")
819
 
    # If it fails, then pretend we aren't using GCC.
820
 
    ac_prog=ld
821
 
    ;;
822
 
  *)
823
 
    # If it is relative, then search for the first ld in PATH.
824
 
    with_gnu_ld=unknown
825
 
    ;;
826
 
  esac
827
 
elif test "$with_gnu_ld" = yes; then
828
 
  AC_MSG_CHECKING([for GNU ld])
829
 
else
830
 
  AC_MSG_CHECKING([for non-GNU ld])
831
 
fi
832
 
AC_CACHE_VAL(acl_cv_path_LD,
833
 
[if test -z "$LD"; then
834
 
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
835
 
  for ac_dir in $PATH; do
836
 
    test -z "$ac_dir" && ac_dir=.
837
 
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
838
 
      acl_cv_path_LD="$ac_dir/$ac_prog"
839
 
      # Check to see if the program is GNU ld.  I'd rather use --version,
840
 
      # but apparently some GNU ld's only accept -v.
841
 
      # Break only if it was the GNU/non-GNU ld that we prefer.
842
 
      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
843
 
        test "$with_gnu_ld" != no && break
844
 
      else
845
 
        test "$with_gnu_ld" != yes && break
846
 
      fi
847
 
    fi
848
 
  done
849
 
  IFS="$ac_save_ifs"
850
 
else
851
 
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
852
 
fi])
853
 
LD="$acl_cv_path_LD"
854
 
if test -n "$LD"; then
855
 
  AC_MSG_RESULT($LD)
 
3029
    done
 
3030
    IFS="$ac_save_IFS"
 
3031
dnl If no 4th arg is given, leave the cache variable unset,
 
3032
dnl so AC_PATH_PROGS will keep looking.
 
3033
ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
 
3034
])dnl
 
3035
    ;;
 
3036
esac])dnl
 
3037
$1="$ac_cv_path_$1"
 
3038
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
 
3039
  AC_MSG_RESULT([$]$1)
856
3040
else
857
3041
  AC_MSG_RESULT(no)
858
3042
fi
859
 
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
860
 
AC_LIB_PROG_LD_GNU
861
 
])
862
 
 
863
 
# Configure paths for GTK+
864
 
# Owen Taylor     97-11-3
865
 
 
866
 
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
867
 
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
868
 
dnl
869
 
AC_DEFUN(AM_PATH_GTK,
870
 
[dnl 
871
 
dnl Get the cflags and libraries from the gtk-config script
872
 
dnl
873
 
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
874
 
            gtk_config_prefix="$withval", gtk_config_prefix="")
875
 
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
876
 
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
877
 
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
878
 
                    , enable_gtktest=yes)
879
 
 
880
 
  for module in . $4
881
 
  do
882
 
      case "$module" in
883
 
         gthread) 
884
 
             gtk_config_args="$gtk_config_args gthread"
885
 
         ;;
886
 
      esac
887
 
  done
888
 
 
889
 
  if test x$gtk_config_exec_prefix != x ; then
890
 
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
891
 
     if test x${GTK_CONFIG+set} != xset ; then
892
 
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
893
 
     fi
894
 
  fi
895
 
  if test x$gtk_config_prefix != x ; then
896
 
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
897
 
     if test x${GTK_CONFIG+set} != xset ; then
898
 
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
899
 
     fi
900
 
  fi
901
 
 
902
 
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
903
 
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
904
 
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
905
 
  no_gtk=""
906
 
  if test "$GTK_CONFIG" = "no" ; then
907
 
    no_gtk=yes
908
 
  else
909
 
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
910
 
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
911
 
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
912
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
913
 
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
914
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
915
 
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
916
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
917
 
    if test "x$enable_gtktest" = "xyes" ; then
918
 
      ac_save_CFLAGS="$CFLAGS"
919
 
      ac_save_LIBS="$LIBS"
920
 
      CFLAGS="$CFLAGS $GTK_CFLAGS"
921
 
      LIBS="$GTK_LIBS $LIBS"
922
 
dnl
923
 
dnl Now check if the installed GTK is sufficiently new. (Also sanity
924
 
dnl checks the results of gtk-config to some extent
925
 
dnl
926
 
      rm -f conf.gtktest
927
 
      AC_TRY_RUN([
928
 
#include <gtk/gtk.h>
929
 
#include <stdio.h>
930
 
#include <stdlib.h>
931
 
 
932
 
int 
933
 
main ()
934
 
{
935
 
  int major, minor, micro;
936
 
  char *tmp_version;
937
 
 
938
 
  system ("touch conf.gtktest");
939
 
 
940
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
941
 
  tmp_version = g_strdup("$min_gtk_version");
942
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
943
 
     printf("%s, bad version string\n", "$min_gtk_version");
944
 
     exit(1);
945
 
   }
946
 
 
947
 
  if ((gtk_major_version != $gtk_config_major_version) ||
948
 
      (gtk_minor_version != $gtk_config_minor_version) ||
949
 
      (gtk_micro_version != $gtk_config_micro_version))
950
 
    {
951
 
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
952
 
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
953
 
             gtk_major_version, gtk_minor_version, gtk_micro_version);
954
 
      printf ("*** was found! If gtk-config was correct, then it is best\n");
955
 
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
956
 
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
957
 
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
958
 
      printf("*** required on your system.\n");
959
 
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
960
 
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
961
 
      printf("*** before re-running configure\n");
962
 
    } 
963
 
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
964
 
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
965
 
           (gtk_minor_version != GTK_MINOR_VERSION) ||
966
 
           (gtk_micro_version != GTK_MICRO_VERSION))
967
 
    {
968
 
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
969
 
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
970
 
      printf("*** library (version %d.%d.%d)\n",
971
 
             gtk_major_version, gtk_minor_version, gtk_micro_version);
972
 
    }
973
 
#endif /* defined (GTK_MAJOR_VERSION) ... */
974
 
  else
975
 
    {
976
 
      if ((gtk_major_version > major) ||
977
 
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
978
 
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
979
 
      {
980
 
        return 0;
981
 
       }
982
 
     else
983
 
      {
984
 
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
985
 
               gtk_major_version, gtk_minor_version, gtk_micro_version);
986
 
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
987
 
               major, minor, micro);
988
 
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
989
 
        printf("***\n");
990
 
        printf("*** If you have already installed a sufficiently new version, this error\n");
991
 
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
992
 
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
993
 
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
994
 
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
995
 
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
996
 
        printf("*** so that the correct libraries are found at run-time))\n");
997
 
      }
998
 
    }
999
 
  return 1;
1000
 
}
1001
 
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1002
 
       CFLAGS="$ac_save_CFLAGS"
1003
 
       LIBS="$ac_save_LIBS"
1004
 
     fi
1005
 
  fi
1006
 
  if test "x$no_gtk" = x ; then
1007
 
     AC_MSG_RESULT(yes)
1008
 
     ifelse([$2], , :, [$2])     
1009
 
  else
1010
 
     AC_MSG_RESULT(no)
1011
 
     if test "$GTK_CONFIG" = "no" ; then
1012
 
       echo "*** The gtk-config script installed by GTK could not be found"
1013
 
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
1014
 
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
1015
 
       echo "*** full path to gtk-config."
1016
 
     else
1017
 
       if test -f conf.gtktest ; then
1018
 
        :
1019
 
       else
1020
 
          echo "*** Could not run GTK test program, checking why..."
1021
 
          CFLAGS="$CFLAGS $GTK_CFLAGS"
1022
 
          LIBS="$LIBS $GTK_LIBS"
1023
 
          AC_TRY_LINK([
1024
 
#include <gtk/gtk.h>
1025
 
#include <stdio.h>
1026
 
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1027
 
        [ echo "*** The test program compiled, but did not run. This usually means"
1028
 
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
1029
 
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
1030
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1031
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1032
 
          echo "*** is required on your system"
1033
 
          echo "***"
1034
 
          echo "*** If you have an old version installed, it is best to remove it, although"
1035
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1036
 
          echo "***"
1037
 
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
1038
 
          echo "*** came with the system with the command"
1039
 
          echo "***"
1040
 
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
1041
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1042
 
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
1043
 
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
1044
 
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
1045
 
          CFLAGS="$ac_save_CFLAGS"
1046
 
          LIBS="$ac_save_LIBS"
1047
 
       fi
1048
 
     fi
1049
 
     GTK_CFLAGS=""
1050
 
     GTK_LIBS=""
1051
 
     ifelse([$3], , :, [$3])
1052
 
  fi
1053
 
  AC_SUBST(GTK_CFLAGS)
1054
 
  AC_SUBST(GTK_LIBS)
1055
 
  rm -f conf.gtktest
1056
 
])
1057
 
 
1058
 
# Configure paths for ESD
1059
 
# Manish Singh    98-9-30
1060
 
# stolen back from Frank Belew
1061
 
# stolen from Manish Singh
1062
 
# Shamelessly stolen from Owen Taylor
1063
 
 
1064
 
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1065
 
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
1066
 
dnl
1067
 
AC_DEFUN(AM_PATH_ESD,
1068
 
[dnl 
1069
 
dnl Get the cflags and libraries from the esd-config script
1070
 
dnl
1071
 
AC_ARG_WITH(esd-prefix,[  --with-esd-prefix=PFX   Prefix where ESD is installed (optional)],
1072
 
            esd_prefix="$withval", esd_prefix="")
1073
 
AC_ARG_WITH(esd-exec-prefix,[  --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
1074
 
            esd_exec_prefix="$withval", esd_exec_prefix="")
1075
 
AC_ARG_ENABLE(esdtest, [  --disable-esdtest       Do not try to compile and run a test ESD program],
1076
 
                    , enable_esdtest=yes)
1077
 
 
1078
 
  if test x$esd_exec_prefix != x ; then
1079
 
     esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
1080
 
     if test x${ESD_CONFIG+set} != xset ; then
1081
 
        ESD_CONFIG=$esd_exec_prefix/bin/esd-config
1082
 
     fi
1083
 
  fi
1084
 
  if test x$esd_prefix != x ; then
1085
 
     esd_args="$esd_args --prefix=$esd_prefix"
1086
 
     if test x${ESD_CONFIG+set} != xset ; then
1087
 
        ESD_CONFIG=$esd_prefix/bin/esd-config
1088
 
     fi
1089
 
  fi
1090
 
 
1091
 
  AC_PATH_PROG(ESD_CONFIG, esd-config, no)
1092
 
  min_esd_version=ifelse([$1], ,0.2.7,$1)
1093
 
  AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
1094
 
  no_esd=""
1095
 
  if test "$ESD_CONFIG" = "no" ; then
1096
 
    no_esd=yes
1097
 
  else
1098
 
    AC_LANG_SAVE
1099
 
    AC_LANG_C
1100
 
    ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
1101
 
    ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
1102
 
 
1103
 
    esd_major_version=`$ESD_CONFIG $esd_args --version | \
1104
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1105
 
    esd_minor_version=`$ESD_CONFIG $esd_args --version | \
1106
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1107
 
    esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
1108
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1109
 
    if test "x$enable_esdtest" = "xyes" ; then
1110
 
      ac_save_CFLAGS="$CFLAGS"
1111
 
      ac_save_LIBS="$LIBS"
1112
 
      CFLAGS="$CFLAGS $ESD_CFLAGS"
1113
 
      LIBS="$LIBS $ESD_LIBS"
1114
 
dnl
1115
 
dnl Now check if the installed ESD is sufficiently new. (Also sanity
1116
 
dnl checks the results of esd-config to some extent
1117
 
dnl
1118
 
      rm -f conf.esdtest
1119
 
      AC_TRY_RUN([
1120
 
#include <stdio.h>
1121
 
#include <stdlib.h>
1122
 
#include <string.h>
1123
 
#include <esd.h>
1124
 
 
1125
 
char*
1126
 
my_strdup (char *str)
1127
 
{
1128
 
  char *new_str;
1129
 
  
1130
 
  if (str)
1131
 
    {
1132
 
      new_str = malloc ((strlen (str) + 1) * sizeof(char));
1133
 
      strcpy (new_str, str);
1134
 
    }
1135
 
  else
1136
 
    new_str = NULL;
1137
 
  
1138
 
  return new_str;
1139
 
}
1140
 
 
1141
 
int main ()
1142
 
{
1143
 
  int major, minor, micro;
1144
 
  char *tmp_version;
1145
 
 
1146
 
  system ("touch conf.esdtest");
1147
 
 
1148
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
1149
 
  tmp_version = my_strdup("$min_esd_version");
1150
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1151
 
     printf("%s, bad version string\n", "$min_esd_version");
1152
 
     exit(1);
1153
 
   }
1154
 
 
1155
 
   if (($esd_major_version > major) ||
1156
 
      (($esd_major_version == major) && ($esd_minor_version > minor)) ||
1157
 
      (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
1158
 
    {
1159
 
      return 0;
1160
 
    }
1161
 
  else
1162
 
    {
1163
 
      printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
1164
 
      printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
1165
 
      printf("*** best to upgrade to the required version.\n");
1166
 
      printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
1167
 
      printf("*** to point to the correct copy of esd-config, and remove the file\n");
1168
 
      printf("*** config.cache before re-running configure\n");
1169
 
      return 1;
1170
 
    }
1171
 
}
1172
 
 
1173
 
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1174
 
       CFLAGS="$ac_save_CFLAGS"
1175
 
       LIBS="$ac_save_LIBS"
1176
 
       AC_LANG_RESTORE
1177
 
     fi
1178
 
  fi
1179
 
  if test "x$no_esd" = x ; then
1180
 
     AC_MSG_RESULT(yes)
1181
 
     ifelse([$2], , :, [$2])     
1182
 
  else
1183
 
     AC_MSG_RESULT(no)
1184
 
     if test "$ESD_CONFIG" = "no" ; then
1185
 
       echo "*** The esd-config script installed by ESD could not be found"
1186
 
       echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
1187
 
       echo "*** your path, or set the ESD_CONFIG environment variable to the"
1188
 
       echo "*** full path to esd-config."
1189
 
     else
1190
 
       if test -f conf.esdtest ; then
1191
 
        :
1192
 
       else
1193
 
          echo "*** Could not run ESD test program, checking why..."
1194
 
          CFLAGS="$CFLAGS $ESD_CFLAGS"
1195
 
          LIBS="$LIBS $ESD_LIBS"
1196
 
          AC_LANG_SAVE
1197
 
          AC_LANG_C
1198
 
          AC_TRY_LINK([
1199
 
#include <stdio.h>
1200
 
#include <esd.h>
1201
 
],      [ return 0; ],
1202
 
        [ echo "*** The test program compiled, but did not run. This usually means"
1203
 
          echo "*** that the run-time linker is not finding ESD or finding the wrong"
1204
 
          echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
1205
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1206
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1207
 
          echo "*** is required on your system"
1208
 
          echo "***"
1209
 
          echo "*** If you have an old version installed, it is best to remove it, although"
1210
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
1211
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1212
 
          echo "*** exact error that occured. This usually means ESD was incorrectly installed"
1213
 
          echo "*** or that you have moved ESD since it was installed. In the latter case, you"
1214
 
          echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
1215
 
          CFLAGS="$ac_save_CFLAGS"
1216
 
          LIBS="$ac_save_LIBS"
1217
 
          AC_LANG_RESTORE
1218
 
       fi
1219
 
     fi
1220
 
     ESD_CFLAGS=""
1221
 
     ESD_LIBS=""
1222
 
     ifelse([$3], , :, [$3])
1223
 
  fi
1224
 
  AC_SUBST(ESD_CFLAGS)
1225
 
  AC_SUBST(ESD_LIBS)
1226
 
  rm -f conf.esdtest
1227
 
])
1228
 
 
1229
 
dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
1230
 
dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
1231
 
dnl
1232
 
AC_DEFUN(AM_ESD_SUPPORTS_MULTIPLE_RECORD,
1233
 
[dnl
1234
 
  AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
1235
 
  ac_save_ESD_CFLAGS="$ESD_CFLAGS"
1236
 
  ac_save_ESD_LIBS="$ESD_LIBS"
1237
 
  AM_PATH_ESD(0.2.21,
1238
 
    ifelse([$1], , [
1239
 
      AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
1240
 
      AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
1241
 
        [Define if you have esound with support of multiple recording clients.])],
1242
 
    [$1]),
1243
 
    ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
1244
 
    if test "x$ac_save_ESD_CFLAGS" != x ; then
1245
 
       ESD_CFLAGS="$ac_save_ESD_CFLAGS"
1246
 
    fi
1247
 
    if test "x$ac_save_ESD_LIBS" != x ; then
1248
 
       ESD_LIBS="$ac_save_ESD_LIBS"
1249
 
    fi
1250
 
  )
1251
 
])
1252
 
 
1253
 
# Define a conditional.
1254
 
 
1255
 
AC_DEFUN([AM_CONDITIONAL],
1256
 
[AC_SUBST($1_TRUE)
1257
 
AC_SUBST($1_FALSE)
1258
 
if $2; then
1259
 
  $1_TRUE=
1260
 
  $1_FALSE='#'
1261
 
else
1262
 
  $1_TRUE='#'
1263
 
  $1_FALSE=
1264
 
fi])
1265
 
 
 
3043
AC_SUBST($1)dnl
 
3044
])
 
3045
 
 
3046
# signed.m4 serial 1 (gettext-0.10.40)
 
3047
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
 
3048
dnl This file is free software; the Free Software Foundation
 
3049
dnl gives unlimited permission to copy and/or distribute it,
 
3050
dnl with or without modifications, as long as this notice is preserved.
 
3051
 
 
3052
dnl From Bruno Haible.
 
3053
 
 
3054
AC_DEFUN([bh_C_SIGNED],
 
3055
[
 
3056
  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
 
3057
   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
 
3058
  if test $bh_cv_c_signed = no; then
 
3059
    AC_DEFINE(signed, ,
 
3060
              [Define to empty if the C compiler doesn't support this keyword.])
 
3061
  fi
 
3062
])
 
3063
 
 
3064
# size_max.m4 serial 2
 
3065
dnl Copyright (C) 2003 Free Software Foundation, Inc.
 
3066
dnl This file is free software; the Free Software Foundation
 
3067
dnl gives unlimited permission to copy and/or distribute it,
 
3068
dnl with or without modifications, as long as this notice is preserved.
 
3069
 
 
3070
dnl From Bruno Haible.
 
3071
 
 
3072
AC_DEFUN([gl_SIZE_MAX],
 
3073
[
 
3074
  AC_CHECK_HEADERS(stdint.h)
 
3075
  dnl First test whether the system already has SIZE_MAX.
 
3076
  AC_MSG_CHECKING([for SIZE_MAX])
 
3077
  result=
 
3078
  AC_EGREP_CPP([Found it], [
 
3079
#include <limits.h>
 
3080
#if HAVE_STDINT_H
 
3081
#include <stdint.h>
 
3082
#endif
 
3083
#ifdef SIZE_MAX
 
3084
Found it
 
3085
#endif
 
3086
], result=yes)
 
3087
  if test -z "$result"; then
 
3088
    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
 
3089
    dnl than the type 'unsigned long'.
 
3090
    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
 
3091
    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
 
3092
    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
 
3093
      [#include <stddef.h>], result=?)
 
3094
    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
 
3095
      [#include <stddef.h>], result=?)
 
3096
    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
 
3097
      [#include <stddef.h>], result=?)
 
3098
    if test "$fits_in_uint" = 1; then
 
3099
      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
 
3100
      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
 
3101
      AC_TRY_COMPILE([#include <stddef.h>
 
3102
        extern size_t foo;
 
3103
        extern unsigned long foo;
 
3104
        ], [], fits_in_uint=0)
 
3105
    fi
 
3106
    if test -z "$result"; then
 
3107
      if test "$fits_in_uint" = 1; then
 
3108
        result="$res_hi$res_lo"U
 
3109
      else
 
3110
        result="$res_hi$res_lo"UL
 
3111
      fi
 
3112
    else
 
3113
      dnl Shouldn't happen, but who knows...
 
3114
      result='~(size_t)0'
 
3115
    fi
 
3116
  fi
 
3117
  AC_MSG_RESULT([$result])
 
3118
  if test "$result" != yes; then
 
3119
    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
 
3120
      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
 
3121
  fi
 
3122
])
 
3123
 
 
3124
# stdint_h.m4 serial 5
 
3125
dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
 
3126
dnl This file is free software; the Free Software Foundation
 
3127
dnl gives unlimited permission to copy and/or distribute it,
 
3128
dnl with or without modifications, as long as this notice is preserved.
 
3129
 
 
3130
dnl From Paul Eggert.
 
3131
 
 
3132
# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
 
3133
# doesn't clash with <sys/types.h>, and declares uintmax_t.
 
3134
 
 
3135
AC_DEFUN([gl_AC_HEADER_STDINT_H],
 
3136
[
 
3137
  AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
 
3138
  [AC_TRY_COMPILE(
 
3139
    [#include <sys/types.h>
 
3140
#include <stdint.h>],
 
3141
    [uintmax_t i = (uintmax_t) -1;],
 
3142
    gl_cv_header_stdint_h=yes,
 
3143
    gl_cv_header_stdint_h=no)])
 
3144
  if test $gl_cv_header_stdint_h = yes; then
 
3145
    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
 
3146
      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
 
3147
       and declares uintmax_t. ])
 
3148
  fi
 
3149
])
 
3150
 
 
3151
# uintmax_t.m4 serial 9
 
3152
dnl Copyright (C) 1997-2004 Free Software Foundation, Inc.
 
3153
dnl This file is free software; the Free Software Foundation
 
3154
dnl gives unlimited permission to copy and/or distribute it,
 
3155
dnl with or without modifications, as long as this notice is preserved.
 
3156
 
 
3157
dnl From Paul Eggert.
 
3158
 
 
3159
AC_PREREQ(2.13)
 
3160
 
 
3161
# Define uintmax_t to 'unsigned long' or 'unsigned long long'
 
3162
# if it is not already defined in <stdint.h> or <inttypes.h>.
 
3163
 
 
3164
AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
 
3165
[
 
3166
  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
 
3167
  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
 
3168
  if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
 
3169
    AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
 
3170
    test $ac_cv_type_unsigned_long_long = yes \
 
3171
      && ac_type='unsigned long long' \
 
3172
      || ac_type='unsigned long'
 
3173
    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
 
3174
      [Define to unsigned long or unsigned long long
 
3175
       if <stdint.h> and <inttypes.h> don't define.])
 
3176
  else
 
3177
    AC_DEFINE(HAVE_UINTMAX_T, 1,
 
3178
      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
 
3179
  fi
 
3180
])
 
3181
 
 
3182
# ulonglong.m4 serial 4
 
3183
dnl Copyright (C) 1999-2004 Free Software Foundation, Inc.
 
3184
dnl This file is free software; the Free Software Foundation
 
3185
dnl gives unlimited permission to copy and/or distribute it,
 
3186
dnl with or without modifications, as long as this notice is preserved.
 
3187
 
 
3188
dnl From Paul Eggert.
 
3189
 
 
3190
# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
 
3191
 
 
3192
AC_DEFUN([gl_AC_TYPE_UNSIGNED_LONG_LONG],
 
3193
[
 
3194
  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
 
3195
  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
 
3196
    [unsigned long long ullmax = (unsigned long long) -1;
 
3197
     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
 
3198
    ac_cv_type_unsigned_long_long=yes,
 
3199
    ac_cv_type_unsigned_long_long=no)])
 
3200
  if test $ac_cv_type_unsigned_long_long = yes; then
 
3201
    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
 
3202
      [Define if you have the 'unsigned long long' type.])
 
3203
  fi
 
3204
])
 
3205
 
 
3206
# wchar_t.m4 serial 1 (gettext-0.12)
 
3207
dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 
3208
dnl This file is free software; the Free Software Foundation
 
3209
dnl gives unlimited permission to copy and/or distribute it,
 
3210
dnl with or without modifications, as long as this notice is preserved.
 
3211
 
 
3212
dnl From Bruno Haible.
 
3213
dnl Test whether <stddef.h> has the 'wchar_t' type.
 
3214
dnl Prerequisite: AC_PROG_CC
 
3215
 
 
3216
AC_DEFUN([gt_TYPE_WCHAR_T],
 
3217
[
 
3218
  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
 
3219
    [AC_TRY_COMPILE([#include <stddef.h>
 
3220
       wchar_t foo = (wchar_t)'\0';], ,
 
3221
       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
 
3222
  if test $gt_cv_c_wchar_t = yes; then
 
3223
    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
 
3224
  fi
 
3225
])
 
3226
 
 
3227
# wint_t.m4 serial 1 (gettext-0.12)
 
3228
dnl Copyright (C) 2003 Free Software Foundation, Inc.
 
3229
dnl This file is free software; the Free Software Foundation
 
3230
dnl gives unlimited permission to copy and/or distribute it,
 
3231
dnl with or without modifications, as long as this notice is preserved.
 
3232
 
 
3233
dnl From Bruno Haible.
 
3234
dnl Test whether <wchar.h> has the 'wint_t' type.
 
3235
dnl Prerequisite: AC_PROG_CC
 
3236
 
 
3237
AC_DEFUN([gt_TYPE_WINT_T],
 
3238
[
 
3239
  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
 
3240
    [AC_TRY_COMPILE([#include <wchar.h>
 
3241
       wint_t foo = (wchar_t)'\0';], ,
 
3242
       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
 
3243
  if test $gt_cv_c_wint_t = yes; then
 
3244
    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
 
3245
  fi
 
3246
])
 
3247
 
 
3248
# xsize.m4 serial 3
 
3249
dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
 
3250
dnl This file is free software; the Free Software Foundation
 
3251
dnl gives unlimited permission to copy and/or distribute it,
 
3252
dnl with or without modifications, as long as this notice is preserved.
 
3253
 
 
3254
AC_DEFUN([gl_XSIZE],
 
3255
[
 
3256
  dnl Prerequisites of lib/xsize.h.
 
3257
  AC_REQUIRE([gl_SIZE_MAX])
 
3258
  AC_REQUIRE([AC_C_INLINE])
 
3259
  AC_CHECK_HEADERS(stdint.h)
 
3260
])
 
3261
 
 
3262
m4_include([acinclude.m4])