~ubuntu-branches/ubuntu/oneiric/groundhog/oneiric

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2004-08-20 23:12:32 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040820231232-18s0op2f9g21ag1z
Tags: 1.4-6
Update Policy Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl aclocal.m4 generated automatically by aclocal 1.4-p4
 
1
# aclocal.m4 generated automatically by aclocal 1.6.1 -*- Autoconf -*-
 
2
 
 
3
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
 
4
# 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
dnl aclocal.m4 generated automatically by aclocal 1.4-p1
2
15
 
3
16
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4
17
dnl This file is free software; the Free Software Foundation
19
32
dnl Usage:
20
33
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
34
 
22
 
AC_DEFUN(AM_INIT_AUTOMAKE,
23
 
[AC_REQUIRE([AC_PROG_INSTALL])
24
 
PACKAGE=[$1]
25
 
AC_SUBST(PACKAGE)
26
 
VERSION=[$2]
27
 
AC_SUBST(VERSION)
28
 
dnl test to see if srcdir already configured
29
 
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
 
35
# Configure paths for GLIB
 
36
# Owen Taylor     1997-2001
 
37
 
 
38
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
39
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or 
 
40
dnl gthread is specified in MODULES, pass to pkg-config
 
41
dnl
 
42
AC_DEFUN(AM_PATH_GLIB_2_0,
 
43
[dnl 
 
44
dnl Get the cflags and libraries from pkg-config
 
45
dnl
 
46
AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
 
47
                    , enable_glibtest=yes)
 
48
 
 
49
  pkg_config_args=glib-2.0
 
50
  for module in . $4
 
51
  do
 
52
      case "$module" in
 
53
         gmodule) 
 
54
             pkg_config_args="$pkg_config_args gmodule-2.0"
 
55
         ;;
 
56
         gobject) 
 
57
             pkg_config_args="$pkg_config_args gobject-2.0"
 
58
         ;;
 
59
         gthread) 
 
60
             pkg_config_args="$pkg_config_args gthread-2.0"
 
61
         ;;
 
62
      esac
 
63
  done
 
64
 
 
65
  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
66
 
 
67
  no_glib=""
 
68
 
 
69
  if test x$PKG_CONFIG != xno ; then
 
70
    if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
 
71
      :
 
72
    else
 
73
      echo *** pkg-config too old; version 0.7 or better required.
 
74
      no_glib=yes
 
75
      PKG_CONFIG=no
 
76
    fi
 
77
  else
 
78
    no_glib=yes
 
79
  fi
 
80
 
 
81
  min_glib_version=ifelse([$1], ,2.0.0,$1)
 
82
  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
 
83
 
 
84
  if test x$PKG_CONFIG != xno ; then
 
85
    ## don't try to run the test against uninstalled libtool libs
 
86
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
87
          echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
 
88
          enable_glibtest=no
 
89
    fi
 
90
 
 
91
    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
 
92
          :
 
93
    else
 
94
          no_glib=yes
 
95
    fi
 
96
  fi
 
97
 
 
98
  if test x"$no_glib" = x ; then
 
99
    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
 
100
    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
 
101
    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
 
102
 
 
103
    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
 
104
    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
 
105
    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
106
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
107
    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
108
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
109
    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
 
110
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
111
    if test "x$enable_glibtest" = "xyes" ; then
 
112
      ac_save_CFLAGS="$CFLAGS"
 
113
      ac_save_LIBS="$LIBS"
 
114
      CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
115
      LIBS="$GLIB_LIBS $LIBS"
 
116
dnl
 
117
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
 
118
dnl checks the results of pkg-config to some extent)
 
119
dnl
 
120
      rm -f conf.glibtest
 
121
      AC_TRY_RUN([
 
122
#include <glib.h>
 
123
#include <stdio.h>
 
124
#include <stdlib.h>
 
125
 
 
126
int 
 
127
main ()
 
128
{
 
129
  int major, minor, micro;
 
130
  char *tmp_version;
 
131
 
 
132
  system ("touch conf.glibtest");
 
133
 
 
134
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
135
  tmp_version = g_strdup("$min_glib_version");
 
136
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
137
     printf("%s, bad version string\n", "$min_glib_version");
 
138
     exit(1);
 
139
   }
 
140
 
 
141
  if ((glib_major_version != $glib_config_major_version) ||
 
142
      (glib_minor_version != $glib_config_minor_version) ||
 
143
      (glib_micro_version != $glib_config_micro_version))
 
144
    {
 
145
      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
 
146
             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
 
147
             glib_major_version, glib_minor_version, glib_micro_version);
 
148
      printf ("*** was found! If pkg-config was correct, then it is best\n");
 
149
      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
 
150
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
151
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
152
      printf("*** required on your system.\n");
 
153
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
154
      printf("*** to point to the correct configuration files\n");
 
155
    } 
 
156
  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
 
157
           (glib_minor_version != GLIB_MINOR_VERSION) ||
 
158
           (glib_micro_version != GLIB_MICRO_VERSION))
 
159
    {
 
160
      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
 
161
             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
 
162
      printf("*** library (version %d.%d.%d)\n",
 
163
             glib_major_version, glib_minor_version, glib_micro_version);
 
164
    }
 
165
  else
 
166
    {
 
167
      if ((glib_major_version > major) ||
 
168
        ((glib_major_version == major) && (glib_minor_version > minor)) ||
 
169
        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
 
170
      {
 
171
        return 0;
 
172
       }
 
173
     else
 
174
      {
 
175
        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
 
176
               glib_major_version, glib_minor_version, glib_micro_version);
 
177
        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
 
178
               major, minor, micro);
 
179
        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
 
180
        printf("***\n");
 
181
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
182
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
 
183
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
184
        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
 
185
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
 
186
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
187
        printf("*** so that the correct libraries are found at run-time))\n");
 
188
      }
 
189
    }
 
190
  return 1;
 
191
}
 
192
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
193
       CFLAGS="$ac_save_CFLAGS"
 
194
       LIBS="$ac_save_LIBS"
 
195
     fi
 
196
  fi
 
197
  if test "x$no_glib" = x ; then
 
198
     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
 
199
     ifelse([$2], , :, [$2])     
 
200
  else
 
201
     AC_MSG_RESULT(no)
 
202
     if test "$PKG_CONFIG" = "no" ; then
 
203
       echo "*** A new enough version of pkg-config was not found."
 
204
       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
 
205
     else
 
206
       if test -f conf.glibtest ; then
 
207
        :
 
208
       else
 
209
          echo "*** Could not run GLIB test program, checking why..."
 
210
          CFLAGS="$CFLAGS $GLIB_CFLAGS"
 
211
          LIBS="$LIBS $GLIB_LIBS"
 
212
          AC_TRY_LINK([
 
213
#include <glib.h>
 
214
#include <stdio.h>
 
215
],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
 
216
        [ echo "*** The test program compiled, but did not run. This usually means"
 
217
          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
 
218
          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
 
219
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
220
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
221
          echo "*** is required on your system"
 
222
          echo "***"
 
223
          echo "*** If you have an old version installed, it is best to remove it, although"
 
224
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
 
225
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
226
          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
 
227
          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
 
228
          echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
 
229
          CFLAGS="$ac_save_CFLAGS"
 
230
          LIBS="$ac_save_LIBS"
 
231
       fi
 
232
     fi
 
233
     GLIB_CFLAGS=""
 
234
     GLIB_LIBS=""
 
235
     GLIB_GENMARSHAL=""
 
236
     GOBJECT_QUERY=""
 
237
     GLIB_MKENUMS=""
 
238
     ifelse([$3], , :, [$3])
 
239
  fi
 
240
  AC_SUBST(GLIB_CFLAGS)
 
241
  AC_SUBST(GLIB_LIBS)
 
242
  AC_SUBST(GLIB_GENMARSHAL)
 
243
  AC_SUBST(GOBJECT_QUERY)
 
244
  AC_SUBST(GLIB_MKENUMS)
 
245
  rm -f conf.glibtest
 
246
])
 
247
 
 
248
# Configure paths for GTK+
 
249
# Owen Taylor     1997-2001
 
250
 
 
251
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
 
252
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
 
253
dnl pass to pkg-config
 
254
dnl
 
255
AC_DEFUN(AM_PATH_GTK_2_0,
 
256
[dnl 
 
257
dnl Get the cflags and libraries from pkg-config
 
258
dnl
 
259
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
 
260
                    , enable_gtktest=yes)
 
261
 
 
262
  pkg_config_args=gtk+-2.0
 
263
  for module in . $4
 
264
  do
 
265
      case "$module" in
 
266
         gthread) 
 
267
             pkg_config_args="$pkg_config_args gthread-2.0"
 
268
         ;;
 
269
      esac
 
270
  done
 
271
 
 
272
  no_gtk=""
 
273
 
 
274
  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
275
 
 
276
  if test x$PKG_CONFIG != xno ; then
 
277
    if pkg-config --atleast-pkgconfig-version 0.7 ; then
 
278
      :
 
279
    else
 
280
      echo *** pkg-config too old; version 0.7 or better required.
 
281
      no_gtk=yes
 
282
      PKG_CONFIG=no
 
283
    fi
 
284
  else
 
285
    no_gtk=yes
 
286
  fi
 
287
 
 
288
  min_gtk_version=ifelse([$1], ,2.0.0,$1)
 
289
  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
 
290
 
 
291
  if test x$PKG_CONFIG != xno ; then
 
292
    ## don't try to run the test against uninstalled libtool libs
 
293
    if $PKG_CONFIG --uninstalled $pkg_config_args; then
 
294
          echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
 
295
          enable_gtktest=no
 
296
    fi
 
297
 
 
298
    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
 
299
          :
 
300
    else
 
301
          no_gtk=yes
 
302
    fi
 
303
  fi
 
304
 
 
305
  if test x"$no_gtk" = x ; then
 
306
    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
 
307
    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
 
308
    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
309
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
 
310
    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
311
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
 
312
    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
 
313
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
314
    if test "x$enable_gtktest" = "xyes" ; then
 
315
      ac_save_CFLAGS="$CFLAGS"
 
316
      ac_save_LIBS="$LIBS"
 
317
      CFLAGS="$CFLAGS $GTK_CFLAGS"
 
318
      LIBS="$GTK_LIBS $LIBS"
 
319
dnl
 
320
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
 
321
dnl checks the results of pkg-config to some extent)
 
322
dnl
 
323
      rm -f conf.gtktest
 
324
      AC_TRY_RUN([
 
325
#include <gtk/gtk.h>
 
326
#include <stdio.h>
 
327
#include <stdlib.h>
 
328
 
 
329
int 
 
330
main ()
 
331
{
 
332
  int major, minor, micro;
 
333
  char *tmp_version;
 
334
 
 
335
  system ("touch conf.gtktest");
 
336
 
 
337
  /* HP/UX 9 (%@#!) writes to sscanf strings */
 
338
  tmp_version = g_strdup("$min_gtk_version");
 
339
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
 
340
     printf("%s, bad version string\n", "$min_gtk_version");
 
341
     exit(1);
 
342
   }
 
343
 
 
344
  if ((gtk_major_version != $gtk_config_major_version) ||
 
345
      (gtk_minor_version != $gtk_config_minor_version) ||
 
346
      (gtk_micro_version != $gtk_config_micro_version))
 
347
    {
 
348
      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
 
349
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
 
350
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
351
      printf ("*** was found! If pkg-config was correct, then it is best\n");
 
352
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
 
353
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
 
354
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
 
355
      printf("*** required on your system.\n");
 
356
      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
 
357
      printf("*** to point to the correct configuration files\n");
 
358
    } 
 
359
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
 
360
           (gtk_minor_version != GTK_MINOR_VERSION) ||
 
361
           (gtk_micro_version != GTK_MICRO_VERSION))
 
362
    {
 
363
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
 
364
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
 
365
      printf("*** library (version %d.%d.%d)\n",
 
366
             gtk_major_version, gtk_minor_version, gtk_micro_version);
 
367
    }
 
368
  else
 
369
    {
 
370
      if ((gtk_major_version > major) ||
 
371
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
 
372
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
 
373
      {
 
374
        return 0;
 
375
       }
 
376
     else
 
377
      {
 
378
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
 
379
               gtk_major_version, gtk_minor_version, gtk_micro_version);
 
380
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
 
381
               major, minor, micro);
 
382
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
 
383
        printf("***\n");
 
384
        printf("*** If you have already installed a sufficiently new version, this error\n");
 
385
        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
 
386
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
 
387
        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
 
388
        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
 
389
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
 
390
        printf("*** so that the correct libraries are found at run-time))\n");
 
391
      }
 
392
    }
 
393
  return 1;
 
394
}
 
395
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
 
396
       CFLAGS="$ac_save_CFLAGS"
 
397
       LIBS="$ac_save_LIBS"
 
398
     fi
 
399
  fi
 
400
  if test "x$no_gtk" = x ; then
 
401
     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
 
402
     ifelse([$2], , :, [$2])     
 
403
  else
 
404
     AC_MSG_RESULT(no)
 
405
     if test "$PKG_CONFIG" = "no" ; then
 
406
       echo "*** A new enough version of pkg-config was not found."
 
407
       echo "*** See http://pkgconfig.sourceforge.net"
 
408
     else
 
409
       if test -f conf.gtktest ; then
 
410
        :
 
411
       else
 
412
          echo "*** Could not run GTK+ test program, checking why..."
 
413
          CFLAGS="$CFLAGS $GTK_CFLAGS"
 
414
          LIBS="$LIBS $GTK_LIBS"
 
415
          AC_TRY_LINK([
 
416
#include <gtk/gtk.h>
 
417
#include <stdio.h>
 
418
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
 
419
        [ echo "*** The test program compiled, but did not run. This usually means"
 
420
          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
 
421
          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
 
422
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
 
423
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
 
424
          echo "*** is required on your system"
 
425
          echo "***"
 
426
          echo "*** If you have an old version installed, it is best to remove it, although"
 
427
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
 
428
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
 
429
          echo "*** exact error that occured. This usually means GTK+ was incorrectly installed"
 
430
          echo "*** or that you have moved GTK+ since it was installed. In the latter case, you"
 
431
          echo "*** may want to edit the pkg-config script: $PKG_CONFIG" ])
 
432
          CFLAGS="$ac_save_CFLAGS"
 
433
          LIBS="$ac_save_LIBS"
 
434
       fi
 
435
     fi
 
436
     GTK_CFLAGS=""
 
437
     GTK_LIBS=""
 
438
     ifelse([$3], , :, [$3])
 
439
  fi
 
440
  AC_SUBST(GTK_CFLAGS)
 
441
  AC_SUBST(GTK_LIBS)
 
442
  rm -f conf.gtktest
 
443
])
 
444
 
 
445
 
 
446
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
 
447
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
 
448
dnl also defines GSTUFF_PKG_ERRORS on error
 
449
AC_DEFUN(PKG_CHECK_MODULES, [
 
450
  succeeded=no
 
451
 
 
452
  if test -z "$PKG_CONFIG"; then
 
453
    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
454
  fi
 
455
 
 
456
  if test "$PKG_CONFIG" = "no" ; then
 
457
     echo "*** The pkg-config script could not be found. Make sure it is"
 
458
     echo "*** in your path, or set the PKG_CONFIG environment variable"
 
459
     echo "*** to the full path to pkg-config."
 
460
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
 
461
  else
 
462
     PKG_CONFIG_MIN_VERSION=0.9.0
 
463
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
 
464
        AC_MSG_CHECKING(for $2)
 
465
 
 
466
        if $PKG_CONFIG --exists "$2" ; then
 
467
            AC_MSG_RESULT(yes)
 
468
            succeeded=yes
 
469
 
 
470
            AC_MSG_CHECKING($1_CFLAGS)
 
471
            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
 
472
            AC_MSG_RESULT($$1_CFLAGS)
 
473
 
 
474
            AC_MSG_CHECKING($1_LIBS)
 
475
            $1_LIBS=`$PKG_CONFIG --libs "$2"`
 
476
            AC_MSG_RESULT($$1_LIBS)
 
477
        else
 
478
            $1_CFLAGS=""
 
479
            $1_LIBS=""
 
480
            ## If we have a custom action on failure, don't print errors, but 
 
481
            ## do set a variable so people can do so.
 
482
            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
483
            ifelse([$4], ,echo $$1_PKG_ERRORS,)
 
484
        fi
 
485
 
 
486
        AC_SUBST($1_CFLAGS)
 
487
        AC_SUBST($1_LIBS)
 
488
     else
 
489
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
 
490
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
 
491
     fi
 
492
  fi
 
493
 
 
494
  if test $succeeded = yes; then
 
495
     ifelse([$3], , :, [$3])
 
496
  else
 
497
     ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
 
498
  fi
 
499
])
 
500
 
 
501
 
 
502
# Do all the work for Automake.                            -*- Autoconf -*-
 
503
 
 
504
# This macro actually does too much some checks are only needed if
 
505
# your package does certain things.  But this isn't really a big deal.
 
506
 
 
507
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
 
508
# Free Software Foundation, Inc.
 
509
 
 
510
# This program is free software; you can redistribute it and/or modify
 
511
# it under the terms of the GNU General Public License as published by
 
512
# the Free Software Foundation; either version 2, or (at your option)
 
513
# any later version.
 
514
 
 
515
# This program is distributed in the hope that it will be useful,
 
516
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
517
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
518
# GNU General Public License for more details.
 
519
 
 
520
# You should have received a copy of the GNU General Public License
 
521
# along with this program; if not, write to the Free Software
 
522
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
523
# 02111-1307, USA.
 
524
 
 
525
# serial 8
 
526
 
 
527
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 
528
# written in clear, in which case automake, when reading aclocal.m4,
 
529
# will think it sees a *use*, and therefore will trigger all it's
 
530
# C support machinery.  Also note that it means that autoscan, seeing
 
531
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
 
532
 
 
533
 
 
534
AC_PREREQ([2.52])
 
535
 
 
536
# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
 
537
# the ones we care about.
 
538
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
 
539
 
 
540
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 
541
# AM_INIT_AUTOMAKE([OPTIONS])
 
542
# -----------------------------------------------
 
543
# The call with PACKAGE and VERSION arguments is the old style
 
544
# call (pre autoconf-2.50), which is being phased out.  PACKAGE
 
545
# and VERSION should now be passed to AC_INIT and removed from
 
546
# the call to AM_INIT_AUTOMAKE.
 
547
# We support both call styles for the transition.  After
 
548
# the next Automake release, Autoconf can make the AC_INIT
 
549
# arguments mandatory, and then we can depend on a new Autoconf
 
550
# release and drop the old call support.
 
551
AC_DEFUN([AM_INIT_AUTOMAKE],
 
552
[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
 
553
 AC_REQUIRE([AC_PROG_INSTALL])dnl
 
554
# test to see if srcdir already configured
 
555
if test "`cd $srcdir && pwd`" != "`pwd`" &&
 
556
   test -f $srcdir/config.status; then
30
557
  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31
558
fi
32
 
ifelse([$3],,
33
 
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34
 
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35
 
AC_REQUIRE([AM_SANITY_CHECK])
36
 
AC_REQUIRE([AC_ARG_PROGRAM])
37
 
dnl FIXME This is truly gross.
38
 
missing_dir=`cd $ac_aux_dir && pwd`
39
 
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40
 
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41
 
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42
 
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43
 
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44
 
AC_REQUIRE([AC_PROG_MAKE_SET])])
 
559
 
 
560
# Define the identity of the package.
 
561
dnl Distinguish between old-style and new-style calls.
 
562
m4_ifval([$2],
 
563
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
 
564
 AC_SUBST([PACKAGE], [$1])dnl
 
565
 AC_SUBST([VERSION], [$2])],
 
566
[_AM_SET_OPTIONS([$1])dnl
 
567
 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
 
568
 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
 
569
 
 
570
_AM_IF_OPTION([no-define],,
 
571
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
 
572
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
 
573
 
 
574
# Some tools Automake needs.
 
575
AC_REQUIRE([AM_SANITY_CHECK])dnl
 
576
AC_REQUIRE([AC_ARG_PROGRAM])dnl
 
577
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
 
578
AM_MISSING_PROG(AUTOCONF, autoconf)
 
579
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
 
580
AM_MISSING_PROG(AUTOHEADER, autoheader)
 
581
AM_MISSING_PROG(MAKEINFO, makeinfo)
 
582
AM_MISSING_PROG(AMTAR, tar)
 
583
AM_PROG_INSTALL_SH
 
584
AM_PROG_INSTALL_STRIP
 
585
# We need awk for the "check" target.  The system "awk" is bad on
 
586
# some platforms.
 
587
AC_REQUIRE([AC_PROG_AWK])dnl
 
588
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
589
 
 
590
_AM_IF_OPTION([no-dependencies],,
 
591
[AC_PROVIDE_IFELSE([AC_PROG_][CC],
 
592
                  [_AM_DEPENDENCIES(CC)],
 
593
                  [define([AC_PROG_][CC],
 
594
                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
 
595
AC_PROVIDE_IFELSE([AC_PROG_][CXX],
 
596
                  [_AM_DEPENDENCIES(CXX)],
 
597
                  [define([AC_PROG_][CXX],
 
598
                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
 
599
])
 
600
])
 
601
 
 
602
# Copyright 2002  Free Software Foundation, Inc.
 
603
 
 
604
# This program is free software; you can redistribute it and/or modify
 
605
# it under the terms of the GNU General Public License as published by
 
606
# the Free Software Foundation; either version 2, or (at your option)
 
607
# any later version.
 
608
 
 
609
# This program is distributed in the hope that it will be useful,
 
610
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
611
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
612
# GNU General Public License for more details.
 
613
 
 
614
# You should have received a copy of the GNU General Public License
 
615
# along with this program; if not, write to the Free Software
 
616
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
617
 
 
618
# AM_AUTOMAKE_VERSION(VERSION)
 
619
# ----------------------------
 
620
# Automake X.Y traces this macro to ensure aclocal.m4 has been
 
621
# generated from the m4 files accompanying Automake X.Y.
 
622
AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"])
 
623
 
 
624
# AM_SET_CURRENT_AUTOMAKE_VERSION
 
625
# -------------------------------
 
626
# Call AM_AUTOMAKE_VERSION so it can be traced.
 
627
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 
628
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
 
629
         [AM_AUTOMAKE_VERSION([1.6.1])])
 
630
 
 
631
# Helper functions for option handling.                    -*- Autoconf -*-
 
632
 
 
633
# Copyright 2001, 2002  Free Software Foundation, Inc.
 
634
 
 
635
# This program is free software; you can redistribute it and/or modify
 
636
# it under the terms of the GNU General Public License as published by
 
637
# the Free Software Foundation; either version 2, or (at your option)
 
638
# any later version.
 
639
 
 
640
# This program is distributed in the hope that it will be useful,
 
641
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
642
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
643
# GNU General Public License for more details.
 
644
 
 
645
# You should have received a copy of the GNU General Public License
 
646
# along with this program; if not, write to the Free Software
 
647
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
648
# 02111-1307, USA.
 
649
 
 
650
# serial 2
 
651
 
 
652
# _AM_MANGLE_OPTION(NAME)
 
653
# -----------------------
 
654
AC_DEFUN([_AM_MANGLE_OPTION],
 
655
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
 
656
 
 
657
# _AM_SET_OPTION(NAME)
 
658
# ------------------------------
 
659
# Set option NAME.  Presently that only means defining a flag for this option.
 
660
AC_DEFUN([_AM_SET_OPTION],
 
661
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
 
662
 
 
663
# _AM_SET_OPTIONS(OPTIONS)
 
664
# ----------------------------------
 
665
# OPTIONS is a space-separated list of Automake options.
 
666
AC_DEFUN([_AM_SET_OPTIONS],
 
667
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
 
668
 
 
669
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
 
670
# -------------------------------------------
 
671
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
 
672
AC_DEFUN([_AM_IF_OPTION],
 
673
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
45
674
 
46
675
#
47
676
# Check to make sure that the build environment is sane.
48
677
#
49
678
 
50
 
AC_DEFUN(AM_SANITY_CHECK,
 
679
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
 
680
 
 
681
# This program is free software; you can redistribute it and/or modify
 
682
# it under the terms of the GNU General Public License as published by
 
683
# the Free Software Foundation; either version 2, or (at your option)
 
684
# any later version.
 
685
 
 
686
# This program is distributed in the hope that it will be useful,
 
687
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
688
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
689
# GNU General Public License for more details.
 
690
 
 
691
# You should have received a copy of the GNU General Public License
 
692
# along with this program; if not, write to the Free Software
 
693
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
694
# 02111-1307, USA.
 
695
 
 
696
# serial 3
 
697
 
 
698
# AM_SANITY_CHECK
 
699
# ---------------
 
700
AC_DEFUN([AM_SANITY_CHECK],
51
701
[AC_MSG_CHECKING([whether build environment is sane])
52
702
# Just in case
53
703
sleep 1
54
 
echo timestamp > conftestfile
 
704
echo timestamp > conftest.file
55
705
# Do `set' in a subshell so we don't clobber the current shell's
56
706
# arguments.  Must try -L first in case configure is actually a
57
707
# symlink; some systems play weird games with the mod time of symlinks
58
708
# (eg FreeBSD returns the mod time of the symlink's containing
59
709
# directory).
60
710
if (
61
 
   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62
 
   if test "[$]*" = "X"; then
 
711
   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
 
712
   if test "$[*]" = "X"; then
63
713
      # -L didn't work.
64
 
      set X `ls -t $srcdir/configure conftestfile`
 
714
      set X `ls -t $srcdir/configure conftest.file`
65
715
   fi
66
 
   if test "[$]*" != "X $srcdir/configure conftestfile" \
67
 
      && test "[$]*" != "X conftestfile $srcdir/configure"; then
 
716
   rm -f conftest.file
 
717
   if test "$[*]" != "X $srcdir/configure conftest.file" \
 
718
      && test "$[*]" != "X conftest.file $srcdir/configure"; then
68
719
 
69
720
      # If neither matched, then we have a broken ls.  This can happen
70
721
      # if, for instance, CONFIG_SHELL is bash and it inherits a
74
725
alias in your environment])
75
726
   fi
76
727
 
77
 
   test "[$]2" = conftestfile
 
728
   test "$[2]" = conftest.file
78
729
   )
79
730
then
80
731
   # Ok.
83
734
   AC_MSG_ERROR([newly created file is older than distributed files!
84
735
Check your system clock])
85
736
fi
86
 
rm -f conftest*
87
737
AC_MSG_RESULT(yes)])
88
738
 
89
 
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90
 
dnl The program must properly implement --version.
91
 
AC_DEFUN(AM_MISSING_PROG,
92
 
[AC_MSG_CHECKING(for working $2)
93
 
# Run test in a subshell; some versions of sh will print an error if
94
 
# an executable is not found, even if stderr is redirected.
95
 
# Redirect stdin to placate older versions of autoconf.  Sigh.
96
 
if ($2 --version) < /dev/null > /dev/null 2>&1; then
97
 
   $1=$2
98
 
   AC_MSG_RESULT(found)
99
 
else
100
 
   $1="$3/missing $2"
101
 
   AC_MSG_RESULT(missing)
102
 
fi
 
739
#  -*- Autoconf -*-
 
740
 
 
741
 
 
742
# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
 
743
 
 
744
# This program is free software; you can redistribute it and/or modify
 
745
# it under the terms of the GNU General Public License as published by
 
746
# the Free Software Foundation; either version 2, or (at your option)
 
747
# any later version.
 
748
 
 
749
# This program is distributed in the hope that it will be useful,
 
750
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
751
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
752
# GNU General Public License for more details.
 
753
 
 
754
# You should have received a copy of the GNU General Public License
 
755
# along with this program; if not, write to the Free Software
 
756
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
757
# 02111-1307, USA.
 
758
 
 
759
# serial 3
 
760
 
 
761
# AM_MISSING_PROG(NAME, PROGRAM)
 
762
# ------------------------------
 
763
AC_DEFUN([AM_MISSING_PROG],
 
764
[AC_REQUIRE([AM_MISSING_HAS_RUN])
 
765
$1=${$1-"${am_missing_run}$2"}
103
766
AC_SUBST($1)])
104
767
 
105
 
# Like AC_CONFIG_HEADER, but automatically create stamp file.
106
 
 
107
 
AC_DEFUN(AM_CONFIG_HEADER,
108
 
[AC_PREREQ([2.12])
109
 
AC_CONFIG_HEADER([$1])
110
 
dnl When config.status generates a header, we must update the stamp-h file.
111
 
dnl This file resides in the same directory as the config header
112
 
dnl that is generated.  We must strip everything past the first ":",
113
 
dnl and everything past the last "/".
114
 
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115
 
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116
 
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
117
 
<<am_indx=1
118
 
for am_file in <<$1>>; do
119
 
  case " <<$>>CONFIG_HEADERS " in
120
 
  *" <<$>>am_file "*<<)>>
121
 
    echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
122
 
    ;;
123
 
  esac
124
 
  am_indx=`expr "<<$>>am_indx" + 1`
125
 
done<<>>dnl>>)
126
 
changequote([,]))])
127
 
 
128
 
# Macro to add for using GNU gettext.
129
 
# Ulrich Drepper <drepper@cygnus.com>, 1995.
130
 
#
131
 
# This file can be copied and used freely without restrictions.  It can
132
 
# be used in projects which are not available under the GNU General Public
133
 
# License or the GNU Library General Public License but which still want
134
 
# to provide support for the GNU gettext functionality.
135
 
# Please note that the actual code of the GNU gettext library is covered
136
 
# by the GNU Library General Public License, and the rest of the GNU
137
 
# gettext package package is covered by the GNU General Public License.
138
 
# They are *not* in the public domain.
139
 
 
140
 
# serial 10
141
 
 
142
 
dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
143
 
dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
 
768
 
 
769
# AM_MISSING_HAS_RUN
 
770
# ------------------
 
771
# Define MISSING if not defined so far and test if it supports --run.
 
772
# If it does, set am_missing_run to use it, otherwise, to nothing.
 
773
AC_DEFUN([AM_MISSING_HAS_RUN],
 
774
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
775
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
 
776
# Use eval to expand $SHELL
 
777
if eval "$MISSING --run true"; then
 
778
  am_missing_run="$MISSING --run "
 
779
else
 
780
  am_missing_run=
 
781
  AC_MSG_WARN([`missing' script is too old or missing])
 
782
fi
 
783
])
 
784
 
 
785
# AM_AUX_DIR_EXPAND
 
786
 
 
787
# Copyright 2001 Free Software Foundation, Inc.
 
788
 
 
789
# This program is free software; you can redistribute it and/or modify
 
790
# it under the terms of the GNU General Public License as published by
 
791
# the Free Software Foundation; either version 2, or (at your option)
 
792
# any later version.
 
793
 
 
794
# This program is distributed in the hope that it will be useful,
 
795
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
796
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
797
# GNU General Public License for more details.
 
798
 
 
799
# You should have received a copy of the GNU General Public License
 
800
# along with this program; if not, write to the Free Software
 
801
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
802
# 02111-1307, USA.
 
803
 
 
804
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 
805
# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
 
806
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
 
807
#
 
808
# Of course, Automake must honor this variable whenever it calls a
 
809
# tool from the auxiliary directory.  The problem is that $srcdir (and
 
810
# therefore $ac_aux_dir as well) can be either absolute or relative,
 
811
# depending on how configure is run.  This is pretty annoying, since
 
812
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
 
813
# source directory, any form will work fine, but in subdirectories a
 
814
# relative path needs to be adjusted first.
 
815
#
 
816
# $ac_aux_dir/missing
 
817
#    fails when called from a subdirectory if $ac_aux_dir is relative
 
818
# $top_srcdir/$ac_aux_dir/missing
 
819
#    fails if $ac_aux_dir is absolute,
 
820
#    fails when called from a subdirectory in a VPATH build with
 
821
#          a relative $ac_aux_dir
 
822
#
 
823
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 
824
# are both prefixed by $srcdir.  In an in-source build this is usually
 
825
# harmless because $srcdir is `.', but things will broke when you
 
826
# start a VPATH build or use an absolute $srcdir.
 
827
#
 
828
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
 
829
# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
 
830
#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
 
831
# and then we would define $MISSING as
 
832
#   MISSING="\${SHELL} $am_aux_dir/missing"
 
833
# This will work as long as MISSING is not called from configure, because
 
834
# unfortunately $(top_srcdir) has no meaning in configure.
 
835
# However there are other variables, like CC, which are often used in
 
836
# configure, and could therefore not use this "fixed" $ac_aux_dir.
 
837
#
 
838
# Another solution, used here, is to always expand $ac_aux_dir to an
 
839
# absolute PATH.  The drawback is that using absolute paths prevent a
 
840
# configured tree to be moved without reconfiguration.
 
841
 
 
842
# Rely on autoconf to set up CDPATH properly.
 
843
AC_PREREQ([2.50])
 
844
 
 
845
AC_DEFUN([AM_AUX_DIR_EXPAND], [
 
846
# expand $ac_aux_dir to an absolute path
 
847
am_aux_dir=`cd $ac_aux_dir && pwd`
 
848
])
 
849
 
 
850
# AM_PROG_INSTALL_SH
 
851
# ------------------
 
852
# Define $install_sh.
 
853
 
 
854
# Copyright 2001 Free Software Foundation, Inc.
 
855
 
 
856
# This program is free software; you can redistribute it and/or modify
 
857
# it under the terms of the GNU General Public License as published by
 
858
# the Free Software Foundation; either version 2, or (at your option)
 
859
# any later version.
 
860
 
 
861
# This program is distributed in the hope that it will be useful,
 
862
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
863
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
864
# GNU General Public License for more details.
 
865
 
 
866
# You should have received a copy of the GNU General Public License
 
867
# along with this program; if not, write to the Free Software
 
868
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
869
# 02111-1307, USA.
 
870
 
 
871
AC_DEFUN([AM_PROG_INSTALL_SH],
 
872
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 
873
install_sh=${install_sh-"$am_aux_dir/install-sh"}
 
874
AC_SUBST(install_sh)])
 
875
 
 
876
# AM_PROG_INSTALL_STRIP
 
877
 
 
878
# Copyright 2001 Free Software Foundation, Inc.
 
879
 
 
880
# This program is free software; you can redistribute it and/or modify
 
881
# it under the terms of the GNU General Public License as published by
 
882
# the Free Software Foundation; either version 2, or (at your option)
 
883
# any later version.
 
884
 
 
885
# This program is distributed in the hope that it will be useful,
 
886
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
887
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
888
# GNU General Public License for more details.
 
889
 
 
890
# You should have received a copy of the GNU General Public License
 
891
# along with this program; if not, write to the Free Software
 
892
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
893
# 02111-1307, USA.
 
894
 
 
895
# One issue with vendor `install' (even GNU) is that you can't
 
896
# specify the program used to strip binaries.  This is especially
 
897
# annoying in cross-compiling environments, where the build's strip
 
898
# is unlikely to handle the host's binaries.
 
899
# Fortunately install-sh will honor a STRIPPROG variable, so we
 
900
# always use install-sh in `make install-strip', and initialize
 
901
# STRIPPROG with the value of the STRIP variable (set by the user).
 
902
AC_DEFUN([AM_PROG_INSTALL_STRIP],
 
903
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 
904
# Installed binaries are usually stripped using `strip' when the user
 
905
# run `make install-strip'.  However `strip' might not be the right
 
906
# tool to use in cross-compilation environments, therefore Automake
 
907
# will honor the `STRIP' environment variable to overrule this program.
 
908
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
 
909
if test "$cross_compiling" != no; then
 
910
  AC_CHECK_TOOL([STRIP], [strip], :)
 
911
fi
 
912
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
 
913
AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
914
 
 
915
# serial 4                                              -*- Autoconf -*-
 
916
 
 
917
# Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
 
918
 
 
919
# This program is free software; you can redistribute it and/or modify
 
920
# it under the terms of the GNU General Public License as published by
 
921
# the Free Software Foundation; either version 2, or (at your option)
 
922
# any later version.
 
923
 
 
924
# This program is distributed in the hope that it will be useful,
 
925
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
926
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
927
# GNU General Public License for more details.
 
928
 
 
929
# You should have received a copy of the GNU General Public License
 
930
# along with this program; if not, write to the Free Software
 
931
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
932
# 02111-1307, USA.
 
933
 
 
934
 
 
935
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 
936
# written in clear, in which case automake, when reading aclocal.m4,
 
937
# will think it sees a *use*, and therefore will trigger all it's
 
938
# C support machinery.  Also note that it means that autoscan, seeing
 
939
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
 
940
 
 
941
 
 
942
 
 
943
# _AM_DEPENDENCIES(NAME)
 
944
# ----------------------
 
945
# See how the compiler implements dependency checking.
 
946
# NAME is "CC", "CXX", "GCJ", or "OBJC".
 
947
# We try a few techniques and use that to set a single cache variable.
 
948
#
 
949
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
 
950
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
 
951
# dependency, and given that the user is not expected to run this macro,
 
952
# just rely on AC_PROG_CC.
 
953
AC_DEFUN([_AM_DEPENDENCIES],
 
954
[AC_REQUIRE([AM_SET_DEPDIR])dnl
 
955
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 
956
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 
957
AC_REQUIRE([AM_DEP_TRACK])dnl
 
958
 
 
959
ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
 
960
       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
 
961
       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
 
962
       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
 
963
                   [depcc="$$1"   am_compiler_list=])
 
964
 
 
965
AC_CACHE_CHECK([dependency style of $depcc],
 
966
               [am_cv_$1_dependencies_compiler_type],
 
967
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
 
968
  # We make a subdir and do the tests there.  Otherwise we can end up
 
969
  # making bogus files that we don't know about and never remove.  For
 
970
  # instance it was reported that on HP-UX the gcc test will end up
 
971
  # making a dummy file named `D' -- because `-MD' means `put the output
 
972
  # in D'.
 
973
  mkdir conftest.dir
 
974
  # Copy depcomp to subdir because otherwise we won't find it if we're
 
975
  # using a relative directory.
 
976
  cp "$am_depcomp" conftest.dir
 
977
  cd conftest.dir
 
978
 
 
979
  am_cv_$1_dependencies_compiler_type=none
 
980
  if test "$am_compiler_list" = ""; then
 
981
     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
 
982
  fi
 
983
  for depmode in $am_compiler_list; do
 
984
    # We need to recreate these files for each test, as the compiler may
 
985
    # overwrite some of them when testing with obscure command lines.
 
986
    # This happens at least with the AIX C compiler.
 
987
    echo '#include "conftest.h"' > conftest.c
 
988
    echo 'int i;' > conftest.h
 
989
    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
 
990
 
 
991
    case $depmode in
 
992
    nosideeffect)
 
993
      # after this tag, mechanisms are not by side-effect, so they'll
 
994
      # only be used when explicitly requested
 
995
      if test "x$enable_dependency_tracking" = xyes; then
 
996
        continue
 
997
      else
 
998
        break
 
999
      fi
 
1000
      ;;
 
1001
    none) break ;;
 
1002
    esac
 
1003
    # We check with `-c' and `-o' for the sake of the "dashmstdout"
 
1004
    # mode.  It turns out that the SunPro C++ compiler does not properly
 
1005
    # handle `-M -o', and we need to detect this.
 
1006
    if depmode=$depmode \
 
1007
       source=conftest.c object=conftest.o \
 
1008
       depfile=conftest.Po tmpdepfile=conftest.TPo \
 
1009
       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
 
1010
       grep conftest.h conftest.Po > /dev/null 2>&1 &&
 
1011
       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
 
1012
      am_cv_$1_dependencies_compiler_type=$depmode
 
1013
      break
 
1014
    fi
 
1015
  done
 
1016
 
 
1017
  cd ..
 
1018
  rm -rf conftest.dir
 
1019
else
 
1020
  am_cv_$1_dependencies_compiler_type=none
 
1021
fi
 
1022
])
 
1023
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
 
1024
])
 
1025
 
 
1026
 
 
1027
# AM_SET_DEPDIR
 
1028
# -------------
 
1029
# Choose a directory name for dependency files.
 
1030
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
 
1031
AC_DEFUN([AM_SET_DEPDIR],
 
1032
[rm -f .deps 2>/dev/null
 
1033
mkdir .deps 2>/dev/null
 
1034
if test -d .deps; then
 
1035
  DEPDIR=.deps
 
1036
else
 
1037
  # MS-DOS does not allow filenames that begin with a dot.
 
1038
  DEPDIR=_deps
 
1039
fi
 
1040
rmdir .deps 2>/dev/null
 
1041
AC_SUBST([DEPDIR])
 
1042
])
 
1043
 
 
1044
 
 
1045
# AM_DEP_TRACK
 
1046
# ------------
 
1047
AC_DEFUN([AM_DEP_TRACK],
 
1048
[AC_ARG_ENABLE(dependency-tracking,
 
1049
[  --disable-dependency-tracking Speeds up one-time builds
 
1050
  --enable-dependency-tracking  Do not reject slow dependency extractors])
 
1051
if test "x$enable_dependency_tracking" != xno; then
 
1052
  am_depcomp="$ac_aux_dir/depcomp"
 
1053
  AMDEPBACKSLASH='\'
 
1054
fi
 
1055
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 
1056
AC_SUBST([AMDEPBACKSLASH])
 
1057
])
 
1058
 
 
1059
# Generate code to set up dependency tracking.   -*- Autoconf -*-
 
1060
 
 
1061
# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
1062
 
 
1063
# This program is free software; you can redistribute it and/or modify
 
1064
# it under the terms of the GNU General Public License as published by
 
1065
# the Free Software Foundation; either version 2, or (at your option)
 
1066
# any later version.
 
1067
 
 
1068
# This program is distributed in the hope that it will be useful,
 
1069
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1070
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1071
# GNU General Public License for more details.
 
1072
 
 
1073
# You should have received a copy of the GNU General Public License
 
1074
# along with this program; if not, write to the Free Software
 
1075
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1076
# 02111-1307, USA.
 
1077
 
 
1078
#serial 2
 
1079
 
 
1080
# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
1081
# ------------------------------
 
1082
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 
1083
[for mf in $CONFIG_FILES; do
 
1084
  # Strip MF so we end up with the name of the file.
 
1085
  mf=`echo "$mf" | sed -e 's/:.*$//'`
 
1086
  if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then
 
1087
    dirpart=`AS_DIRNAME("$mf")`
 
1088
  else
 
1089
    continue
 
1090
  fi
 
1091
  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
 
1092
  # Extract the definition of DEP_FILES from the Makefile without
 
1093
  # running `make'.
 
1094
  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
 
1095
  test -z "$DEPDIR" && continue
 
1096
  # When using ansi2knr, U may be empty or an underscore; expand it
 
1097
  U=`sed -n -e '/^U = / s///p' < "$mf"`
 
1098
  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
 
1099
  # We invoke sed twice because it is the simplest approach to
 
1100
  # changing $(DEPDIR) to its actual value in the expansion.
 
1101
  for file in `sed -n -e '
 
1102
    /^DEP_FILES = .*\\\\$/ {
 
1103
      s/^DEP_FILES = //
 
1104
      :loop
 
1105
        s/\\\\$//
 
1106
        p
 
1107
        n
 
1108
        /\\\\$/ b loop
 
1109
      p
 
1110
    }
 
1111
    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
 
1112
       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
 
1113
    # Make sure the directory exists.
 
1114
    test -f "$dirpart/$file" && continue
 
1115
    fdir=`AS_DIRNAME(["$file"])`
 
1116
    AS_MKDIR_P([$dirpart/$fdir])
 
1117
    # echo "creating $dirpart/$file"
 
1118
    echo '# dummy' > "$dirpart/$file"
 
1119
  done
 
1120
done
 
1121
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
1122
 
 
1123
 
 
1124
# AM_OUTPUT_DEPENDENCY_COMMANDS
 
1125
# -----------------------------
 
1126
# This macro should only be invoked once -- use via AC_REQUIRE.
 
1127
#
 
1128
# This code is only required when automatic dependency tracking
 
1129
# is enabled.  FIXME.  This creates each `.P' file that we will
 
1130
# need in order to bootstrap the dependency handling code.
 
1131
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
1132
[AC_CONFIG_COMMANDS([depfiles],
 
1133
     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
 
1134
     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 
1135
])
 
1136
 
 
1137
# Copyright 2001 Free Software Foundation, Inc.             -*- Autoconf -*-
 
1138
 
 
1139
# This program is free software; you can redistribute it and/or modify
 
1140
# it under the terms of the GNU General Public License as published by
 
1141
# the Free Software Foundation; either version 2, or (at your option)
 
1142
# any later version.
 
1143
 
 
1144
# This program is distributed in the hope that it will be useful,
 
1145
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1146
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1147
# GNU General Public License for more details.
 
1148
 
 
1149
# You should have received a copy of the GNU General Public License
 
1150
# along with this program; if not, write to the Free Software
 
1151
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1152
# 02111-1307, USA.
 
1153
 
 
1154
# serial 2
 
1155
 
 
1156
# AM_MAKE_INCLUDE()
 
1157
# -----------------
 
1158
# Check to see how make treats includes.
 
1159
AC_DEFUN([AM_MAKE_INCLUDE],
 
1160
[am_make=${MAKE-make}
 
1161
cat > confinc << 'END'
 
1162
doit:
 
1163
        @echo done
 
1164
END
 
1165
# If we don't find an include directive, just comment out the code.
 
1166
AC_MSG_CHECKING([for style of include used by $am_make])
 
1167
am__include="#"
 
1168
am__quote=
 
1169
_am_result=none
 
1170
# First try GNU make style include.
 
1171
echo "include confinc" > confmf
 
1172
# We grep out `Entering directory' and `Leaving directory'
 
1173
# messages which can occur if `w' ends up in MAKEFLAGS.
 
1174
# In particular we don't look at `^make:' because GNU make might
 
1175
# be invoked under some other name (usually "gmake"), in which
 
1176
# case it prints its new name instead of `make'.
 
1177
if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
 
1178
   am__include=include
 
1179
   am__quote=
 
1180
   _am_result=GNU
 
1181
fi
 
1182
# Now try BSD make style include.
 
1183
if test "$am__include" = "#"; then
 
1184
   echo '.include "confinc"' > confmf
 
1185
   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
 
1186
      am__include=.include
 
1187
      am__quote="\""
 
1188
      _am_result=BSD
 
1189
   fi
 
1190
fi
 
1191
AC_SUBST(am__include)
 
1192
AC_SUBST(am__quote)
 
1193
AC_MSG_RESULT($_am_result)
 
1194
rm -f confinc confmf
 
1195
])
 
1196
 
 
1197
# AM_CONDITIONAL                                              -*- Autoconf -*-
 
1198
 
 
1199
# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
 
1200
 
 
1201
# This program is free software; you can redistribute it and/or modify
 
1202
# it under the terms of the GNU General Public License as published by
 
1203
# the Free Software Foundation; either version 2, or (at your option)
 
1204
# any later version.
 
1205
 
 
1206
# This program is distributed in the hope that it will be useful,
 
1207
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1208
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1209
# GNU General Public License for more details.
 
1210
 
 
1211
# You should have received a copy of the GNU General Public License
 
1212
# along with this program; if not, write to the Free Software
 
1213
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1214
# 02111-1307, USA.
 
1215
 
 
1216
# serial 5
 
1217
 
 
1218
AC_PREREQ(2.52)
 
1219
 
 
1220
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
 
1221
# -------------------------------------
 
1222
# Define a conditional.
 
1223
AC_DEFUN([AM_CONDITIONAL],
 
1224
[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
 
1225
        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 
1226
AC_SUBST([$1_TRUE])
 
1227
AC_SUBST([$1_FALSE])
 
1228
if $2; then
 
1229
  $1_TRUE=
 
1230
  $1_FALSE='#'
 
1231
else
 
1232
  $1_TRUE='#'
 
1233
  $1_FALSE=
 
1234
fi
 
1235
AC_CONFIG_COMMANDS_PRE(
 
1236
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
 
1237
  AC_MSG_ERROR([conditional \"$1\" was never defined.
 
1238
Usually this means the macro was only invoked conditionally.])
 
1239
fi])])
 
1240
 
 
1241
# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
 
1242
 
 
1243
# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
 
1244
 
 
1245
# This program is free software; you can redistribute it and/or modify
 
1246
# it under the terms of the GNU General Public License as published by
 
1247
# the Free Software Foundation; either version 2, or (at your option)
 
1248
# any later version.
 
1249
 
 
1250
# This program is distributed in the hope that it will be useful,
 
1251
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
1252
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
1253
# GNU General Public License for more details.
 
1254
 
 
1255
# You should have received a copy of the GNU General Public License
 
1256
# along with this program; if not, write to the Free Software
 
1257
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
1258
# 02111-1307, USA.
 
1259
 
 
1260
AC_PREREQ([2.52])
 
1261
 
 
1262
# serial 6
 
1263
 
 
1264
# When config.status generates a header, we must update the stamp-h file.
 
1265
# This file resides in the same directory as the config header
 
1266
# that is generated.  We must strip everything past the first ":",
 
1267
# and everything past the last "/".
 
1268
 
 
1269
# _AM_DIRNAME(PATH)
 
1270
# -----------------
 
1271
# Like AS_DIRNAME, only do it during macro expansion
 
1272
AC_DEFUN([_AM_DIRNAME],
 
1273
       [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
 
1274
              m4_if(regexp([$1], [^//\([^/]\|$\)]), -1,
 
1275
                    m4_if(regexp([$1], [^/.*]), -1,
 
1276
                          [.],
 
1277
                          patsubst([$1], [^\(/\).*], [\1])),
 
1278
                    patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
 
1279
              patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
 
1280
])# _AM_DIRNAME
 
1281
 
 
1282
 
 
1283
# The stamp files are numbered to have different names.
 
1284
# We could number them on a directory basis, but that's additional
 
1285
# complications, let's have a unique counter.
 
1286
m4_define([_AM_STAMP_Count], [0])
 
1287
 
 
1288
 
 
1289
# _AM_STAMP(HEADER)
 
1290
# -----------------
 
1291
# The name of the stamp file for HEADER.
 
1292
AC_DEFUN([_AM_STAMP],
 
1293
[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl
 
1294
AS_ESCAPE(_AM_DIRNAME(patsubst([$1],
 
1295
                               [:.*])))/stamp-h[]_AM_STAMP_Count])
 
1296
 
 
1297
 
 
1298
# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS)
 
1299
# ------------------------------------------------------------
 
1300
# We used to try to get a real timestamp in stamp-h.  But the fear is that
 
1301
# that will cause unnecessary cvs conflicts.
 
1302
AC_DEFUN([_AM_CONFIG_HEADER],
 
1303
[# Add the stamp file to the list of files AC keeps track of,
 
1304
# along with our hook.
 
1305
AC_CONFIG_HEADERS([$1],
 
1306
                  [# update the timestamp
 
1307
echo 'timestamp for $1' >"_AM_STAMP([$1])"
 
1308
$2],
 
1309
                  [$3])
 
1310
])# _AM_CONFIG_HEADER
 
1311
 
 
1312
 
 
1313
# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS)
 
1314
# --------------------------------------------------------------
 
1315
AC_DEFUN([AM_CONFIG_HEADER],
 
1316
[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])])
 
1317
])# AM_CONFIG_HEADER
 
1318
 
 
1319
# gettext.m4 serial 14 (gettext-0.11.2)
 
1320
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
1321
dnl This file is free software, distributed under the terms of the GNU
 
1322
dnl General Public License.  As a special exception to the GNU General
 
1323
dnl Public License, this file may be distributed as part of a program
 
1324
dnl that contains a configuration script generated by Autoconf, under
 
1325
dnl the same distribution terms as the rest of that program.
 
1326
dnl
 
1327
dnl This file can can be used in projects which are not available under
 
1328
dnl the GNU General Public License or the GNU Library General Public
 
1329
dnl License but which still want to provide support for the GNU gettext
 
1330
dnl functionality.
 
1331
dnl Please note that the actual code of the GNU gettext library is covered
 
1332
dnl by the GNU Library General Public License, and the rest of the GNU
 
1333
dnl gettext package package is covered by the GNU General Public License.
 
1334
dnl They are *not* in the public domain.
 
1335
 
 
1336
dnl Authors:
 
1337
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
 
1338
dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
 
1339
 
 
1340
dnl Macro to add for using GNU gettext.
 
1341
 
 
1342
dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
 
1343
dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
 
1344
dnl    default (if it is not specified or empty) is 'no-libtool'.
 
1345
dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
 
1346
dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
 
1347
dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
144
1348
dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
145
1349
dnl    depending on --{enable,disable}-{shared,static} and on the presence of
146
 
dnl    AM-DISABLE-SHARED). Otherwise, a static library
 
1350
dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
147
1351
dnl    $(top_builddir)/intl/libintl.a will be created.
148
1352
dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
149
1353
dnl    implementations (in libc or libintl) without the ngettext() function
150
1354
dnl    will be ignored.
151
 
dnl LIBDIR is used to find the intl libraries.  If empty,
 
1355
dnl INTLDIR is used to find the intl libraries.  If empty,
152
1356
dnl    the value `$(top_builddir)/intl/' is used.
153
1357
dnl
154
1358
dnl The result of the configuration is one of three cases:
162
1366
dnl 3) No internationalization, always use English msgid.
163
1367
dnl    Catalog format: none
164
1368
dnl    Catalog extension: none
 
1369
dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
165
1370
dnl The use of .gmo is historical (it was needed to avoid overwriting the
166
1371
dnl GNU format catalogs when building on a platform with an X/Open gettext),
167
1372
dnl but we keep it in order not to force irrelevant filename changes on the
168
1373
dnl maintainers.
169
1374
dnl
170
 
AC_DEFUN([AM_WITH_NLS],
171
 
  [AC_MSG_CHECKING([whether NLS is requested])
172
 
    dnl Default is enabled NLS
173
 
    AC_ARG_ENABLE(nls,
174
 
      [  --disable-nls           do not use Native Language Support],
175
 
      USE_NLS=$enableval, USE_NLS=yes)
176
 
    AC_MSG_RESULT($USE_NLS)
177
 
    AC_SUBST(USE_NLS)
178
 
 
 
1375
AC_DEFUN([AM_GNU_GETTEXT],
 
1376
[
 
1377
  dnl Argument checking.
 
1378
  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
 
1379
    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
 
1380
])])])])])
 
1381
  ifelse([$2], [], , [ifelse([$2], [need-ngettext], ,
 
1382
    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
 
1383
])])])
 
1384
  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
 
1385
  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
 
1386
 
 
1387
  AC_REQUIRE([AM_PO_SUBDIRS])dnl
 
1388
  ifelse(gt_included_intl, yes, [
 
1389
    AC_REQUIRE([AM_INTL_SUBDIR])dnl
 
1390
  ])
 
1391
 
 
1392
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
1393
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1394
  AC_REQUIRE([AC_LIB_RPATH])
 
1395
 
 
1396
  AC_MSG_CHECKING([whether NLS is requested])
 
1397
  dnl Default is enabled NLS
 
1398
  AC_ARG_ENABLE(nls,
 
1399
    [  --disable-nls           do not use Native Language Support],
 
1400
    USE_NLS=$enableval, USE_NLS=yes)
 
1401
  AC_MSG_RESULT($USE_NLS)
 
1402
  AC_SUBST(USE_NLS)
 
1403
 
 
1404
  ifelse(gt_included_intl, yes, [
179
1405
    BUILD_INCLUDED_LIBINTL=no
180
1406
    USE_INCLUDED_LIBINTL=no
181
 
    INTLLIBS=
 
1407
  ])
 
1408
  LIBINTL=
 
1409
  LTLIBINTL=
 
1410
  POSUB=
182
1411
 
183
 
    dnl If we use NLS figure out what method
184
 
    if test "$USE_NLS" = "yes"; then
185
 
      AC_DEFINE(ENABLE_NLS, 1,
186
 
        [Define to 1 if translation of program messages to the user's native language
187
 
   is requested.])
 
1412
  dnl If we use NLS figure out what method
 
1413
  if test "$USE_NLS" = "yes"; then
 
1414
    gt_use_preinstalled_gnugettext=no
 
1415
    ifelse(gt_included_intl, yes, [
188
1416
      AC_MSG_CHECKING([whether included gettext is requested])
189
1417
      AC_ARG_WITH(included-gettext,
190
1418
        [  --with-included-gettext use the GNU gettext library included here],
194
1422
 
195
1423
      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
196
1424
      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
 
1425
    ])
197
1426
        dnl User does not insist on using GNU NLS library.  Figure out what
198
1427
        dnl to use.  If GNU gettext is available we use this.  Else we have
199
1428
        dnl to fall back to GNU NLS library.
200
 
        CATOBJEXT=NONE
201
1429
 
202
1430
        dnl Add a version number to the cache macros.
203
 
        define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
204
 
        define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
205
 
 
206
 
        AC_CHECK_HEADER(libintl.h,
207
 
          [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
208
 
            [AC_TRY_LINK([#include <libintl.h>
209
 
extern int _nl_msg_cat_cntr;],
210
 
               [bindtextdomain ("", "");
211
 
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
212
 
               gt_cv_func_gnugettext_libc=yes,
213
 
               gt_cv_func_gnugettext_libc=no)])
214
 
 
215
 
           if test "$gt_cv_func_gnugettext_libc" != "yes"; then
216
 
             AC_CACHE_CHECK([for GNU gettext in libintl],
217
 
               gt_cv_func_gnugettext_libintl,
218
 
               [gt_save_LIBS="$LIBS"
219
 
                LIBS="$LIBS -lintl $LIBICONV"
220
 
                AC_TRY_LINK([#include <libintl.h>
221
 
extern int _nl_msg_cat_cntr;],
222
 
                  [bindtextdomain ("", "");
223
 
return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
224
 
                  gt_cv_func_gnugettext_libintl=yes,
225
 
                  gt_cv_func_gnugettext_libintl=no)
226
 
                LIBS="$gt_save_LIBS"])
227
 
           fi
228
 
 
229
 
           dnl If an already present or preinstalled GNU gettext() is found,
230
 
           dnl use it.  But if this macro is used in GNU gettext, and GNU
231
 
           dnl gettext is already preinstalled in libintl, we update this
232
 
           dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
233
 
           if test "$gt_cv_func_gnugettext_libc" = "yes" \
234
 
              || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
235
 
                   && test "$PACKAGE" != gettext; }; then
236
 
             AC_DEFINE(HAVE_GETTEXT, 1,
237
 
               [Define if the GNU gettext() function is already present or preinstalled.])
238
 
 
239
 
             if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
240
 
               dnl If iconv() is in a separate libiconv library, then anyone
241
 
               dnl linking with libintl{.a,.so} also needs to link with
242
 
               dnl libiconv.
243
 
               INTLLIBS="-lintl $LIBICONV"
244
 
             fi
245
 
 
246
 
             gt_save_LIBS="$LIBS"
247
 
             LIBS="$LIBS $INTLLIBS"
248
 
             AC_CHECK_FUNCS(dcgettext)
249
 
             LIBS="$gt_save_LIBS"
250
 
 
251
 
             dnl Search for GNU msgfmt in the PATH.
252
 
             AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
253
 
               [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
254
 
             AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
255
 
 
256
 
             dnl Search for GNU xgettext in the PATH.
257
 
             AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
258
 
               [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
259
 
 
260
 
             CATOBJEXT=.gmo
261
 
           fi
262
 
        ])
263
 
 
264
 
        if test "$CATOBJEXT" = "NONE"; then
265
 
          dnl GNU gettext is not found in the C library.
266
 
          dnl Fall back on GNU gettext library.
267
 
          nls_cv_use_gnu_gettext=yes
 
1431
        define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
 
1432
        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
 
1433
        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
 
1434
 
 
1435
        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
 
1436
         [AC_TRY_LINK([#include <libintl.h>
 
1437
extern int _nl_msg_cat_cntr;
 
1438
extern int *_nl_domain_bindings;],
 
1439
            [bindtextdomain ("", "");
 
1440
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
 
1441
            gt_cv_func_gnugettext_libc=yes,
 
1442
            gt_cv_func_gnugettext_libc=no)])
 
1443
 
 
1444
        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
 
1445
          dnl Sometimes libintl requires libiconv, so first search for libiconv.
 
1446
          ifelse(gt_included_intl, yes, , [
 
1447
            AM_ICONV_LINK
 
1448
          ])
 
1449
          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
 
1450
          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
 
1451
          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
 
1452
          dnl even if libiconv doesn't exist.
 
1453
          AC_LIB_LINKFLAGS_BODY([intl])
 
1454
          AC_CACHE_CHECK([for GNU gettext in libintl],
 
1455
            gt_cv_func_gnugettext_libintl,
 
1456
           [gt_save_CPPFLAGS="$CPPFLAGS"
 
1457
            CPPFLAGS="$CPPFLAGS $INCINTL"
 
1458
            gt_save_LIBS="$LIBS"
 
1459
            LIBS="$LIBS $LIBINTL"
 
1460
            dnl Now see whether libintl exists and does not depend on libiconv.
 
1461
            AC_TRY_LINK([#include <libintl.h>
 
1462
extern int _nl_msg_cat_cntr;
 
1463
extern
 
1464
#ifdef __cplusplus
 
1465
"C"
 
1466
#endif
 
1467
const char *_nl_expand_alias ();],
 
1468
              [bindtextdomain ("", "");
 
1469
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
 
1470
              gt_cv_func_gnugettext_libintl=yes,
 
1471
              gt_cv_func_gnugettext_libintl=no)
 
1472
            dnl Now see whether libintl exists and depends on libiconv.
 
1473
            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
 
1474
              LIBS="$LIBS $LIBICONV"
 
1475
              AC_TRY_LINK([#include <libintl.h>
 
1476
extern int _nl_msg_cat_cntr;
 
1477
extern
 
1478
#ifdef __cplusplus
 
1479
"C"
 
1480
#endif
 
1481
const char *_nl_expand_alias ();],
 
1482
                [bindtextdomain ("", "");
 
1483
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
 
1484
               [LIBINTL="$LIBINTL $LIBICONV"
 
1485
                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
 
1486
                gt_cv_func_gnugettext_libintl=yes
 
1487
               ])
 
1488
            fi
 
1489
            CPPFLAGS="$gt_save_CPPFLAGS"
 
1490
            LIBS="$gt_save_LIBS"])
 
1491
        fi
 
1492
 
 
1493
        dnl If an already present or preinstalled GNU gettext() is found,
 
1494
        dnl use it.  But if this macro is used in GNU gettext, and GNU
 
1495
        dnl gettext is already preinstalled in libintl, we update this
 
1496
        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
 
1497
        if test "$gt_cv_func_gnugettext_libc" = "yes" \
 
1498
           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
 
1499
                && test "$PACKAGE" != gettext; }; then
 
1500
          gt_use_preinstalled_gnugettext=yes
 
1501
        else
 
1502
          dnl Reset the values set by searching for libintl.
 
1503
          LIBINTL=
 
1504
          LTLIBINTL=
 
1505
          INCINTL=
 
1506
        fi
 
1507
 
 
1508
    ifelse(gt_included_intl, yes, [
 
1509
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
 
1510
          dnl GNU gettext is not found in the C library.
 
1511
          dnl Fall back on included GNU gettext library.
 
1512
          nls_cv_use_gnu_gettext=yes
268
1513
        fi
269
1514
      fi
270
1515
 
271
1516
      if test "$nls_cv_use_gnu_gettext" = "yes"; then
272
1517
        dnl Mark actions used to generate GNU NLS library.
273
1518
        INTLOBJS="\$(GETTOBJS)"
274
 
        AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
275
 
          [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
276
 
        AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
277
 
        AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
278
 
          [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
279
 
        AC_SUBST(MSGFMT)
280
 
        BUILD_INCLUDED_LIBINTL=yes
281
 
        USE_INCLUDED_LIBINTL=yes
 
1519
        BUILD_INCLUDED_LIBINTL=yes
 
1520
        USE_INCLUDED_LIBINTL=yes
 
1521
        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
 
1522
        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
 
1523
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
 
1524
      fi
 
1525
 
 
1526
      if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
1527
         || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
1528
        dnl Mark actions to use GNU gettext tools.
282
1529
        CATOBJEXT=.gmo
283
 
        INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
284
 
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
285
 
      fi
286
 
 
287
 
      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
288
 
      dnl Test whether we really found GNU msgfmt.
289
 
      if test "$GMSGFMT" != ":"; then
290
 
        dnl If it is no GNU msgfmt we define it as : so that the
291
 
        dnl Makefiles still can work.
292
 
        if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
293
 
          : ;
294
 
        else
295
 
          AC_MSG_RESULT(
296
 
            [found msgfmt program is not GNU msgfmt; ignore it])
297
 
          GMSGFMT=":"
298
 
        fi
299
 
      fi
300
 
 
301
 
      dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
302
 
      dnl Test whether we really found GNU xgettext.
303
 
      if test "$XGETTEXT" != ":"; then
304
 
        dnl If it is no GNU xgettext we define it as : so that the
305
 
        dnl Makefiles still can work.
306
 
        if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
307
 
          : ;
308
 
        else
309
 
          AC_MSG_RESULT(
310
 
            [found xgettext program is not GNU xgettext; ignore it])
311
 
          XGETTEXT=":"
312
 
        fi
313
 
      fi
314
 
 
315
 
      dnl We need to process the po/ directory.
316
 
      POSUB=po
317
 
    fi
318
 
    AC_OUTPUT_COMMANDS(
319
 
     [for ac_file in $CONFIG_FILES; do
320
 
        # Support "outfile[:infile[:infile...]]"
321
 
        case "$ac_file" in
322
 
          *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
323
 
        esac
324
 
        # PO directories have a Makefile.in generated from Makefile.in.in.
325
 
        case "$ac_file" in */Makefile.in)
326
 
          # Adjust a relative srcdir.
327
 
          ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
328
 
          ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
329
 
          ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
330
 
          # In autoconf-2.13 it is called $ac_given_srcdir.
331
 
          # In autoconf-2.50 it is called $srcdir.
332
 
          test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
333
 
          case "$ac_given_srcdir" in
334
 
            .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
335
 
            /*) top_srcdir="$ac_given_srcdir" ;;
336
 
            *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
337
 
          esac
338
 
          if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
339
 
            rm -f "$ac_dir/POTFILES"
340
 
            test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
341
 
            sed -e "/^#/d" -e "/^[      ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
342
 
            test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
343
 
            sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
344
 
          fi
345
 
          ;;
346
 
        esac
347
 
      done])
348
 
 
349
 
 
 
1530
      fi
 
1531
    ])
 
1532
 
 
1533
    if test "$gt_use_preinstalled_gnugettext" = "yes" \
 
1534
       || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
1535
      AC_DEFINE(ENABLE_NLS, 1,
 
1536
        [Define to 1 if translation of program messages to the user's native language
 
1537
   is requested.])
 
1538
    else
 
1539
      USE_NLS=no
 
1540
    fi
 
1541
  fi
 
1542
 
 
1543
  if test "$USE_NLS" = "yes"; then
 
1544
 
 
1545
    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
 
1546
      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
 
1547
        AC_MSG_CHECKING([how to link with libintl])
 
1548
        AC_MSG_RESULT([$LIBINTL])
 
1549
        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
 
1550
      fi
 
1551
 
 
1552
      dnl For backward compatibility. Some packages may be using this.
 
1553
      AC_DEFINE(HAVE_GETTEXT, 1,
 
1554
       [Define if the GNU gettext() function is already present or preinstalled.])
 
1555
      AC_DEFINE(HAVE_DCGETTEXT, 1,
 
1556
       [Define if the GNU dcgettext() function is already present or preinstalled.])
 
1557
    fi
 
1558
 
 
1559
    dnl We need to process the po/ directory.
 
1560
    POSUB=po
 
1561
  fi
 
1562
 
 
1563
  ifelse(gt_included_intl, yes, [
350
1564
    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
351
1565
    dnl to 'yes' because some of the testsuite requires it.
352
1566
    if test "$PACKAGE" = gettext; then
353
1567
      BUILD_INCLUDED_LIBINTL=yes
354
1568
    fi
355
1569
 
356
 
    dnl intl/plural.c is generated from intl/plural.y. It requires bison,
357
 
    dnl because plural.y uses bison specific features. It requires at least
358
 
    dnl bison-1.26 because earlier versions generate a plural.c that doesn't
359
 
    dnl compile.
360
 
    dnl bison is only needed for the maintainer (who touches plural.y). But in
361
 
    dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
362
 
    dnl the rule in general Makefile. Now, some people carelessly touch the
363
 
    dnl files or have a broken "make" program, hence the plural.c rule will
364
 
    dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
365
 
    dnl present or too old.
366
 
    AC_CHECK_PROGS([INTLBISON], [bison])
367
 
    if test -z "$INTLBISON"; then
368
 
      ac_verc_fail=yes
369
 
    else
370
 
      dnl Found it, now check the version.
371
 
      AC_MSG_CHECKING([version of bison])
372
 
changequote(<<,>>)dnl
373
 
      ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
374
 
      case $ac_prog_version in
375
 
        '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
376
 
        1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
377
 
changequote([,])dnl
378
 
           ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
379
 
        *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
380
 
      esac
381
 
      AC_MSG_RESULT([$ac_prog_version])
382
 
    fi
383
 
    if test $ac_verc_fail = yes; then
384
 
      INTLBISON=:
385
 
    fi
386
 
 
387
 
    dnl These rules are solely for the distribution goal.  While doing this
388
 
    dnl we only have to keep exactly one list of the available catalogs
389
 
    dnl in configure.in.
390
 
    for lang in $ALL_LINGUAS; do
391
 
      GMOFILES="$GMOFILES $lang.gmo"
392
 
      POFILES="$POFILES $lang.po"
393
 
    done
394
 
 
395
1570
    dnl Make all variables we use known to autoconf.
396
1571
    AC_SUBST(BUILD_INCLUDED_LIBINTL)
397
1572
    AC_SUBST(USE_INCLUDED_LIBINTL)
398
 
    AC_SUBST(CATALOGS)
399
1573
    AC_SUBST(CATOBJEXT)
400
 
    AC_SUBST(GMOFILES)
401
 
    AC_SUBST(INTLLIBS)
402
1574
    AC_SUBST(INTLOBJS)
403
 
    AC_SUBST(POFILES)
404
 
    AC_SUBST(POSUB)
405
1575
 
406
1576
    dnl For backward compatibility. Some configure.ins may be using this.
407
1577
    nls_cv_header_intl=
418
1588
    dnl For backward compatibility. Some Makefiles may be using this.
419
1589
    GENCAT=gencat
420
1590
    AC_SUBST(GENCAT)
 
1591
 
 
1592
    dnl Enable libtool support if the surrounding package wishes it.
 
1593
    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
 
1594
    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
421
1595
  ])
422
1596
 
423
 
dnl Usage: Just like AM_WITH_NLS, which see.
424
 
AC_DEFUN([AM_GNU_GETTEXT],
425
 
  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
426
 
   AC_REQUIRE([AC_PROG_CC])dnl
427
 
   AC_REQUIRE([AC_CANONICAL_HOST])dnl
428
 
   AC_REQUIRE([AC_PROG_RANLIB])dnl
429
 
   AC_REQUIRE([AC_ISC_POSIX])dnl
430
 
   AC_REQUIRE([AC_HEADER_STDC])dnl
431
 
   AC_REQUIRE([AC_C_CONST])dnl
432
 
   AC_REQUIRE([AC_C_INLINE])dnl
433
 
   AC_REQUIRE([AC_TYPE_OFF_T])dnl
434
 
   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
435
 
   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
436
 
   AC_REQUIRE([AC_FUNC_MMAP])dnl
437
 
   AC_REQUIRE([jm_GLIBC21])dnl
438
 
 
439
 
   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
 
1597
  dnl For backward compatibility. Some Makefiles may be using this.
 
1598
  INTLLIBS="$LIBINTL"
 
1599
  AC_SUBST(INTLLIBS)
 
1600
 
 
1601
  dnl Make all documented variables known to autoconf.
 
1602
  AC_SUBST(LIBINTL)
 
1603
  AC_SUBST(LTLIBINTL)
 
1604
  AC_SUBST(POSUB)
 
1605
])
 
1606
 
 
1607
 
 
1608
dnl Checks for all prerequisites of the po subdirectory,
 
1609
dnl except for USE_NLS.
 
1610
AC_DEFUN([AM_PO_SUBDIRS],
 
1611
[
 
1612
  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 
1613
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
1614
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
 
1615
 
 
1616
  dnl Perform the following tests also if --disable-nls has been given,
 
1617
  dnl because they are needed for "make dist" to work.
 
1618
 
 
1619
  dnl Search for GNU msgfmt in the PATH.
 
1620
  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
 
1621
  dnl The second test excludes FreeBSD msgfmt.
 
1622
  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 
1623
    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
 
1624
     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
1625
    :)
 
1626
  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
 
1627
 
 
1628
  dnl Search for GNU xgettext 0.11 or newer in the PATH.
 
1629
  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
 
1630
  dnl The second test excludes FreeBSD xgettext.
 
1631
  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
 
1632
    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
 
1633
     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
 
1634
    :)
 
1635
  dnl Remove leftover from FreeBSD xgettext call.
 
1636
  rm -f messages.po
 
1637
 
 
1638
  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
 
1639
  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
 
1640
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
 
1641
 
 
1642
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
 
1643
  dnl Test whether we really found GNU msgfmt.
 
1644
  if test "$GMSGFMT" != ":"; then
 
1645
    dnl If it is no GNU msgfmt we define it as : so that the
 
1646
    dnl Makefiles still can work.
 
1647
    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
 
1648
       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
 
1649
      : ;
 
1650
    else
 
1651
      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
 
1652
      AC_MSG_RESULT(
 
1653
        [found $GMSGFMT program is not GNU msgfmt; ignore it])
 
1654
      GMSGFMT=":"
 
1655
    fi
 
1656
  fi
 
1657
 
 
1658
  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
 
1659
  dnl Test whether we really found GNU xgettext.
 
1660
  if test "$XGETTEXT" != ":"; then
 
1661
    dnl If it is no GNU xgettext we define it as : so that the
 
1662
    dnl Makefiles still can work.
 
1663
    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
 
1664
       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
 
1665
      : ;
 
1666
    else
 
1667
      AC_MSG_RESULT(
 
1668
        [found xgettext program is not GNU xgettext; ignore it])
 
1669
      XGETTEXT=":"
 
1670
    fi
 
1671
    dnl Remove leftover from FreeBSD xgettext call.
 
1672
    rm -f messages.po
 
1673
  fi
 
1674
 
 
1675
  AC_OUTPUT_COMMANDS([
 
1676
    for ac_file in $CONFIG_FILES; do
 
1677
      # Support "outfile[:infile[:infile...]]"
 
1678
      case "$ac_file" in
 
1679
        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
 
1680
      esac
 
1681
      # PO directories have a Makefile.in generated from Makefile.in.in.
 
1682
      case "$ac_file" in */Makefile.in)
 
1683
        # Adjust a relative srcdir.
 
1684
        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
 
1685
        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
 
1686
        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
 
1687
        # In autoconf-2.13 it is called $ac_given_srcdir.
 
1688
        # In autoconf-2.50 it is called $srcdir.
 
1689
        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
 
1690
        case "$ac_given_srcdir" in
 
1691
          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
 
1692
          /*) top_srcdir="$ac_given_srcdir" ;;
 
1693
          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
 
1694
        esac
 
1695
        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
 
1696
          rm -f "$ac_dir/POTFILES"
 
1697
          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
 
1698
          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
 
1699
          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
 
1700
          # on $ac_dir but don't depend on user-specified configuration
 
1701
          # parameters.
 
1702
          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
 
1703
            # The LINGUAS file contains the set of available languages.
 
1704
            if test -n "$ALL_LINGUAS"; then
 
1705
              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
 
1706
            fi
 
1707
            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
 
1708
            # Hide the ALL_LINGUAS assigment from automake.
 
1709
            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
 
1710
          fi
 
1711
          case "$ac_given_srcdir" in
 
1712
            .) srcdirpre= ;;
 
1713
            *) srcdirpre='$(srcdir)/' ;;
 
1714
          esac
 
1715
          POFILES=
 
1716
          GMOFILES=
 
1717
          UPDATEPOFILES=
 
1718
          DUMMYPOFILES=
 
1719
          for lang in $ALL_LINGUAS; do
 
1720
            POFILES="$POFILES $srcdirpre$lang.po"
 
1721
            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
 
1722
            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
 
1723
            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
 
1724
          done
 
1725
          # CATALOGS depends on both $ac_dir and the user's LINGUAS
 
1726
          # environment variable.
 
1727
          INST_LINGUAS=
 
1728
          if test -n "$ALL_LINGUAS"; then
 
1729
            for presentlang in $ALL_LINGUAS; do
 
1730
              useit=no
 
1731
              if test "%UNSET%" != "$LINGUAS"; then
 
1732
                desiredlanguages="$LINGUAS"
 
1733
              else
 
1734
                desiredlanguages="$ALL_LINGUAS"
 
1735
              fi
 
1736
              for desiredlang in $desiredlanguages; do
 
1737
                # Use the presentlang catalog if desiredlang is
 
1738
                #   a. equal to presentlang, or
 
1739
                #   b. a variant of presentlang (because in this case,
 
1740
                #      presentlang can be used as a fallback for messages
 
1741
                #      which are not translated in the desiredlang catalog).
 
1742
                case "$desiredlang" in
 
1743
                  "$presentlang"*) useit=yes;;
 
1744
                esac
 
1745
              done
 
1746
              if test $useit = yes; then
 
1747
                INST_LINGUAS="$INST_LINGUAS $presentlang"
 
1748
              fi
 
1749
            done
 
1750
          fi
 
1751
          CATALOGS=
 
1752
          if test -n "$INST_LINGUAS"; then
 
1753
            for lang in $INST_LINGUAS; do
 
1754
              CATALOGS="$CATALOGS $lang.gmo"
 
1755
            done
 
1756
          fi
 
1757
          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
 
1758
          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
 
1759
          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
 
1760
            if test -f "$f"; then
 
1761
              case "$f" in
 
1762
                *.orig | *.bak | *~) ;;
 
1763
                *) cat "$f" >> "$ac_dir/Makefile" ;;
 
1764
              esac
 
1765
            fi
 
1766
          done
 
1767
        fi
 
1768
        ;;
 
1769
      esac
 
1770
    done],
 
1771
   [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
 
1772
    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
 
1773
    # from automake.
 
1774
    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
 
1775
    # Capture the value of LINGUAS because we need it to compute CATALOGS.
 
1776
    LINGUAS="${LINGUAS-%UNSET%}"
 
1777
   ])
 
1778
])
 
1779
 
 
1780
 
 
1781
dnl Checks for all prerequisites of the intl subdirectory,
 
1782
dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
 
1783
dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
 
1784
AC_DEFUN([AM_INTL_SUBDIR],
 
1785
[
 
1786
  AC_REQUIRE([AC_PROG_INSTALL])dnl
 
1787
  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
 
1788
  AC_REQUIRE([AC_PROG_CC])dnl
 
1789
  AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
1790
  AC_REQUIRE([AC_PROG_RANLIB])dnl
 
1791
  AC_REQUIRE([AC_ISC_POSIX])dnl
 
1792
  AC_REQUIRE([AC_HEADER_STDC])dnl
 
1793
  AC_REQUIRE([AC_C_CONST])dnl
 
1794
  AC_REQUIRE([AC_C_INLINE])dnl
 
1795
  AC_REQUIRE([AC_TYPE_OFF_T])dnl
 
1796
  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
 
1797
  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
 
1798
  AC_REQUIRE([AC_FUNC_MMAP])dnl
 
1799
  AC_REQUIRE([jm_GLIBC21])dnl
 
1800
 
 
1801
  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
440
1802
stdlib.h string.h unistd.h sys/param.h])
441
 
   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
442
 
getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
443
 
strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
444
 
 
445
 
   AM_ICONV
446
 
   AM_LANGINFO_CODESET
447
 
   AM_LC_MESSAGES
448
 
   AM_WITH_NLS([$1],[$2],[$3])
449
 
 
450
 
   if test "x$CATOBJEXT" != "x"; then
451
 
     if test "x$ALL_LINGUAS" = "x"; then
452
 
       LINGUAS=
453
 
     else
454
 
       AC_MSG_CHECKING(for catalogs to be installed)
455
 
       NEW_LINGUAS=
456
 
       for presentlang in $ALL_LINGUAS; do
457
 
         useit=no
458
 
         for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
459
 
           # Use the presentlang catalog if desiredlang is
460
 
           #   a. equal to presentlang, or
461
 
           #   b. a variant of presentlang (because in this case,
462
 
           #      presentlang can be used as a fallback for messages
463
 
           #      which are not translated in the desiredlang catalog).
464
 
           case "$desiredlang" in
465
 
             "$presentlang"*) useit=yes;;
466
 
           esac
467
 
         done
468
 
         if test $useit = yes; then
469
 
           NEW_LINGUAS="$NEW_LINGUAS $presentlang"
470
 
         fi
471
 
       done
472
 
       LINGUAS=$NEW_LINGUAS
473
 
       AC_MSG_RESULT($LINGUAS)
474
 
     fi
475
 
 
476
 
     dnl Construct list of names of catalog files to be constructed.
477
 
     if test -n "$LINGUAS"; then
478
 
       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
479
 
     fi
480
 
   fi
481
 
 
482
 
   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
483
 
   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
484
 
   dnl Try to locate is.
485
 
   MKINSTALLDIRS=
486
 
   if test -n "$ac_aux_dir"; then
487
 
     MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
488
 
   fi
489
 
   if test -z "$MKINSTALLDIRS"; then
490
 
     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
491
 
   fi
492
 
   AC_SUBST(MKINSTALLDIRS)
493
 
 
494
 
   dnl Enable libtool support if the surrounding package wishes it.
495
 
   INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
496
 
   AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
497
 
  ])
 
1803
  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
 
1804
geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
 
1805
strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
 
1806
 
 
1807
  AM_ICONV
 
1808
  AM_LANGINFO_CODESET
 
1809
  AM_LC_MESSAGES
 
1810
 
 
1811
  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
 
1812
  dnl because plural.y uses bison specific features. It requires at least
 
1813
  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
 
1814
  dnl compile.
 
1815
  dnl bison is only needed for the maintainer (who touches plural.y). But in
 
1816
  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
 
1817
  dnl the rule in general Makefile. Now, some people carelessly touch the
 
1818
  dnl files or have a broken "make" program, hence the plural.c rule will
 
1819
  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
 
1820
  dnl present or too old.
 
1821
  AC_CHECK_PROGS([INTLBISON], [bison])
 
1822
  if test -z "$INTLBISON"; then
 
1823
    ac_verc_fail=yes
 
1824
  else
 
1825
    dnl Found it, now check the version.
 
1826
    AC_MSG_CHECKING([version of bison])
 
1827
changequote(<<,>>)dnl
 
1828
    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
 
1829
    case $ac_prog_version in
 
1830
      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
 
1831
      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
 
1832
changequote([,])dnl
 
1833
         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
 
1834
      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
1835
    esac
 
1836
    AC_MSG_RESULT([$ac_prog_version])
 
1837
  fi
 
1838
  if test $ac_verc_fail = yes; then
 
1839
    INTLBISON=:
 
1840
  fi
 
1841
])
 
1842
 
 
1843
 
 
1844
AC_DEFUN([AM_MKINSTALLDIRS],
 
1845
[
 
1846
  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
 
1847
  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
 
1848
  dnl Try to locate is.
 
1849
  MKINSTALLDIRS=
 
1850
  if test -n "$ac_aux_dir"; then
 
1851
    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
 
1852
  fi
 
1853
  if test -z "$MKINSTALLDIRS"; then
 
1854
    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
 
1855
  fi
 
1856
  AC_SUBST(MKINSTALLDIRS)
 
1857
])
 
1858
 
 
1859
# lib-prefix.m4 serial 1 (gettext-0.11)
 
1860
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
 
1861
dnl This file is free software, distributed under the terms of the GNU
 
1862
dnl General Public License.  As a special exception to the GNU General
 
1863
dnl Public License, this file may be distributed as part of a program
 
1864
dnl that contains a configuration script generated by Autoconf, under
 
1865
dnl the same distribution terms as the rest of that program.
 
1866
 
 
1867
dnl From Bruno Haible.
 
1868
 
 
1869
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 
1870
dnl to access previously installed libraries. The basic assumption is that
 
1871
dnl a user will want packages to use other packages he previously installed
 
1872
dnl with the same --prefix option.
 
1873
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
 
1874
dnl libraries, but is otherwise very convenient.
 
1875
AC_DEFUN([AC_LIB_PREFIX],
 
1876
[
 
1877
  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
 
1878
  AC_REQUIRE([AC_PROG_CC])
 
1879
  AC_REQUIRE([AC_CANONICAL_HOST])
 
1880
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
1881
  dnl By default, look in $includedir and $libdir.
 
1882
  use_additional=yes
 
1883
  AC_LIB_WITH_FINAL_PREFIX([
 
1884
    eval additional_includedir=\"$includedir\"
 
1885
    eval additional_libdir=\"$libdir\"
 
1886
  ])
 
1887
  AC_ARG_WITH([lib-prefix],
 
1888
[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
 
1889
  --without-lib-prefix    don't search for libraries in includedir and libdir],
 
1890
[
 
1891
    if test "X$withval" = "Xno"; then
 
1892
      use_additional=no
 
1893
    else
 
1894
      if test "X$withval" = "X"; then
 
1895
        AC_LIB_WITH_FINAL_PREFIX([
 
1896
          eval additional_includedir=\"$includedir\"
 
1897
          eval additional_libdir=\"$libdir\"
 
1898
        ])
 
1899
      else
 
1900
        additional_includedir="$withval/include"
 
1901
        additional_libdir="$withval/lib"
 
1902
      fi
 
1903
    fi
 
1904
])
 
1905
  if test $use_additional = yes; then
 
1906
    dnl Potentially add $additional_includedir to $CPPFLAGS.
 
1907
    dnl But don't add it
 
1908
    dnl   1. if it's the standard /usr/include,
 
1909
    dnl   2. if it's already present in $CPPFLAGS,
 
1910
    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
 
1911
    dnl   4. if it doesn't exist as a directory.
 
1912
    if test "X$additional_includedir" != "X/usr/include"; then
 
1913
      haveit=
 
1914
      for x in $CPPFLAGS; do
 
1915
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1916
        if test "X$x" = "X-I$additional_includedir"; then
 
1917
          haveit=yes
 
1918
          break
 
1919
        fi
 
1920
      done
 
1921
      if test -z "$haveit"; then
 
1922
        if test "X$additional_includedir" = "X/usr/local/include"; then
 
1923
          if test -n "$GCC"; then
 
1924
            case $host_os in
 
1925
              linux*) haveit=yes;;
 
1926
            esac
 
1927
          fi
 
1928
        fi
 
1929
        if test -z "$haveit"; then
 
1930
          if test -d "$additional_includedir"; then
 
1931
            dnl Really add $additional_includedir to $CPPFLAGS.
 
1932
            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
 
1933
          fi
 
1934
        fi
 
1935
      fi
 
1936
    fi
 
1937
    dnl Potentially add $additional_libdir to $LDFLAGS.
 
1938
    dnl But don't add it
 
1939
    dnl   1. if it's the standard /usr/lib,
 
1940
    dnl   2. if it's already present in $LDFLAGS,
 
1941
    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
 
1942
    dnl   4. if it doesn't exist as a directory.
 
1943
    if test "X$additional_libdir" != "X/usr/lib"; then
 
1944
      haveit=
 
1945
      for x in $LDFLAGS; do
 
1946
        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
1947
        if test "X$x" = "X-L$additional_libdir"; then
 
1948
          haveit=yes
 
1949
          break
 
1950
        fi
 
1951
      done
 
1952
      if test -z "$haveit"; then
 
1953
        if test "X$additional_libdir" = "X/usr/local/lib"; then
 
1954
          if test -n "$GCC"; then
 
1955
            case $host_os in
 
1956
              linux*) haveit=yes;;
 
1957
            esac
 
1958
          fi
 
1959
        fi
 
1960
        if test -z "$haveit"; then
 
1961
          if test -d "$additional_libdir"; then
 
1962
            dnl Really add $additional_libdir to $LDFLAGS.
 
1963
            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
 
1964
          fi
 
1965
        fi
 
1966
      fi
 
1967
    fi
 
1968
  fi
 
1969
])
 
1970
 
 
1971
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
 
1972
dnl acl_final_exec_prefix, containing the values to which $prefix and
 
1973
dnl $exec_prefix will expand at the end of the configure script.
 
1974
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
 
1975
[
 
1976
  dnl Unfortunately, prefix and exec_prefix get only finally determined
 
1977
  dnl at the end of configure.
 
1978
  if test "X$prefix" = "XNONE"; then
 
1979
    acl_final_prefix="$ac_default_prefix"
 
1980
  else
 
1981
    acl_final_prefix="$prefix"
 
1982
  fi
 
1983
  if test "X$exec_prefix" = "XNONE"; then
 
1984
    acl_final_exec_prefix='${prefix}'
 
1985
  else
 
1986
    acl_final_exec_prefix="$exec_prefix"
 
1987
  fi
 
1988
  acl_save_prefix="$prefix"
 
1989
  prefix="$acl_final_prefix"
 
1990
  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
 
1991
  prefix="$acl_save_prefix"
 
1992
])
 
1993
 
 
1994
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
 
1995
dnl variables prefix and exec_prefix bound to the values they will have
 
1996
dnl at the end of the configure script.
 
1997
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 
1998
[
 
1999
  acl_save_prefix="$prefix"
 
2000
  prefix="$acl_final_prefix"
 
2001
  acl_save_exec_prefix="$exec_prefix"
 
2002
  exec_prefix="$acl_final_exec_prefix"
 
2003
  $1
 
2004
  exec_prefix="$acl_save_exec_prefix"
 
2005
  prefix="$acl_save_prefix"
 
2006
])
 
2007
 
 
2008
# lib-link.m4 serial 2 (gettext-0.11.2)
 
2009
dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
 
2010
dnl This file is free software, distributed under the terms of the GNU
 
2011
dnl General Public License.  As a special exception to the GNU General
 
2012
dnl Public License, this file may be distributed as part of a program
 
2013
dnl that contains a configuration script generated by Autoconf, under
 
2014
dnl the same distribution terms as the rest of that program.
 
2015
 
 
2016
dnl From Bruno Haible.
 
2017
 
 
2018
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 
2019
dnl the libraries corresponding to explicit and implicit dependencies.
 
2020
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
 
2021
dnl augments the CPPFLAGS variable.
 
2022
AC_DEFUN([AC_LIB_LINKFLAGS],
 
2023
[
 
2024
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
2025
  AC_REQUIRE([AC_LIB_RPATH])
 
2026
  define([Name],[translit([$1],[./-], [___])])
 
2027
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
2028
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
2029
  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
 
2030
    AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
2031
    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
 
2032
    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
 
2033
    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
 
2034
  ])
 
2035
  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
 
2036
  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
 
2037
  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
 
2038
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
2039
  AC_SUBST([LIB]NAME)
 
2040
  AC_SUBST([LTLIB]NAME)
 
2041
  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
 
2042
  dnl results of this search when this library appears as a dependency.
 
2043
  HAVE_LIB[]NAME=yes
 
2044
  undefine([Name])
 
2045
  undefine([NAME])
 
2046
])
 
2047
 
 
2048
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 
2049
dnl searches for libname and the libraries corresponding to explicit and
 
2050
dnl implicit dependencies, together with the specified include files and
 
2051
dnl the ability to compile and link the specified testcode. If found, it
 
2052
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
 
2053
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
 
2054
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
 
2055
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 
2056
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 
2057
[
 
2058
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
2059
  AC_REQUIRE([AC_LIB_RPATH])
 
2060
  define([Name],[translit([$1],[./-], [___])])
 
2061
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
2062
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
2063
 
 
2064
  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
 
2065
  dnl accordingly.
 
2066
  AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
2067
 
 
2068
  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
 
2069
  dnl because if the user has installed lib[]Name and not disabled its use
 
2070
  dnl via --without-lib[]Name-prefix, he wants to use it.
 
2071
  ac_save_CPPFLAGS="$CPPFLAGS"
 
2072
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
 
2073
 
 
2074
  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
 
2075
    ac_save_LIBS="$LIBS"
 
2076
    LIBS="$LIBS $LIB[]NAME"
 
2077
    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
 
2078
    LIBS="$ac_save_LIBS"
 
2079
  ])
 
2080
  if test "$ac_cv_lib[]Name" = yes; then
 
2081
    HAVE_LIB[]NAME=yes
 
2082
    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
 
2083
    AC_MSG_CHECKING([how to link with lib[]$1])
 
2084
    AC_MSG_RESULT([$LIB[]NAME])
 
2085
  else
 
2086
    HAVE_LIB[]NAME=no
 
2087
    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
 
2088
    dnl $INC[]NAME either.
 
2089
    CPPFLAGS="$ac_save_CPPFLAGS"
 
2090
    LIB[]NAME=
 
2091
    LTLIB[]NAME=
 
2092
  fi
 
2093
  AC_SUBST([HAVE_LIB]NAME)
 
2094
  AC_SUBST([LIB]NAME)
 
2095
  AC_SUBST([LTLIB]NAME)
 
2096
  undefine([Name])
 
2097
  undefine([NAME])
 
2098
])
 
2099
 
 
2100
dnl Determine the platform dependent parameters needed to use rpath:
 
2101
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
 
2102
dnl hardcode_direct, hardcode_minus_L,
 
2103
dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
 
2104
AC_DEFUN([AC_LIB_RPATH],
 
2105
[
 
2106
  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
 
2107
  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
 
2108
  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
 
2109
  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
 
2110
  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
 
2111
    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
 
2112
    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
 
2113
    . ./conftest.sh
 
2114
    rm -f ./conftest.sh
 
2115
    acl_cv_rpath=done
 
2116
  ])
 
2117
  wl="$acl_cv_wl"
 
2118
  libext="$acl_cv_libext"
 
2119
  shlibext="$acl_cv_shlibext"
 
2120
  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
 
2121
  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
 
2122
  hardcode_direct="$acl_cv_hardcode_direct"
 
2123
  hardcode_minus_L="$acl_cv_hardcode_minus_L"
 
2124
  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
 
2125
  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
 
2126
])
 
2127
 
 
2128
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 
2129
dnl the libraries corresponding to explicit and implicit dependencies.
 
2130
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 
2131
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 
2132
[
 
2133
  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
 
2134
                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
2135
  dnl By default, look in $includedir and $libdir.
 
2136
  use_additional=yes
 
2137
  AC_LIB_WITH_FINAL_PREFIX([
 
2138
    eval additional_includedir=\"$includedir\"
 
2139
    eval additional_libdir=\"$libdir\"
 
2140
  ])
 
2141
  AC_ARG_WITH([lib$1-prefix],
 
2142
[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
 
2143
  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
 
2144
[
 
2145
    if test "X$withval" = "Xno"; then
 
2146
      use_additional=no
 
2147
    else
 
2148
      if test "X$withval" = "X"; then
 
2149
        AC_LIB_WITH_FINAL_PREFIX([
 
2150
          eval additional_includedir=\"$includedir\"
 
2151
          eval additional_libdir=\"$libdir\"
 
2152
        ])
 
2153
      else
 
2154
        additional_includedir="$withval/include"
 
2155
        additional_libdir="$withval/lib"
 
2156
      fi
 
2157
    fi
 
2158
])
 
2159
  dnl Search the library and its dependencies in $additional_libdir and
 
2160
  dnl $LDFLAGS. Using breadth-first-seach.
 
2161
  LIB[]NAME=
 
2162
  LTLIB[]NAME=
 
2163
  INC[]NAME=
 
2164
  rpathdirs=
 
2165
  ltrpathdirs=
 
2166
  names_already_handled=
 
2167
  names_next_round='$1 $2'
 
2168
  while test -n "$names_next_round"; do
 
2169
    names_this_round="$names_next_round"
 
2170
    names_next_round=
 
2171
    for name in $names_this_round; do
 
2172
      already_handled=
 
2173
      for n in $names_already_handled; do
 
2174
        if test "$n" = "$name"; then
 
2175
          already_handled=yes
 
2176
          break
 
2177
        fi
 
2178
      done
 
2179
      if test -z "$already_handled"; then
 
2180
        names_already_handled="$names_already_handled $name"
 
2181
        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
 
2182
        dnl or AC_LIB_HAVE_LINKFLAGS call.
 
2183
        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
 
2184
        eval value=\"\$HAVE_LIB$uppername\"
 
2185
        if test -n "$value"; then
 
2186
          if test "$value" = yes; then
 
2187
            eval value=\"\$LIB$uppername\"
 
2188
            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
 
2189
            eval value=\"\$LTLIB$uppername\"
 
2190
            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
 
2191
          else
 
2192
            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
 
2193
            dnl that this library doesn't exist. So just drop it.
 
2194
            :
 
2195
          fi
 
2196
        else
 
2197
          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
 
2198
          dnl and the already constructed $LIBNAME/$LTLIBNAME.
 
2199
          found_dir=
 
2200
          found_la=
 
2201
          found_so=
 
2202
          found_a=
 
2203
          if test $use_additional = yes; then
 
2204
            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
 
2205
              found_dir="$additional_libdir"
 
2206
              found_so="$additional_libdir/lib$name.$shlibext"
 
2207
              if test -f "$additional_libdir/lib$name.la"; then
 
2208
                found_la="$additional_libdir/lib$name.la"
 
2209
              fi
 
2210
            else
 
2211
              if test -f "$additional_libdir/lib$name.$libext"; then
 
2212
                found_dir="$additional_libdir"
 
2213
                found_a="$additional_libdir/lib$name.$libext"
 
2214
                if test -f "$additional_libdir/lib$name.la"; then
 
2215
                  found_la="$additional_libdir/lib$name.la"
 
2216
                fi
 
2217
              fi
 
2218
            fi
 
2219
          fi
 
2220
          if test "X$found_dir" = "X"; then
 
2221
            for x in $LDFLAGS $LTLIB[]NAME; do
 
2222
              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2223
              case "$x" in
 
2224
                -L*)
 
2225
                  dir=`echo "X$x" | sed -e 's/^X-L//'`
 
2226
                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
 
2227
                    found_dir="$dir"
 
2228
                    found_so="$dir/lib$name.$shlibext"
 
2229
                    if test -f "$dir/lib$name.la"; then
 
2230
                      found_la="$dir/lib$name.la"
 
2231
                    fi
 
2232
                  else
 
2233
                    if test -f "$dir/lib$name.$libext"; then
 
2234
                      found_dir="$dir"
 
2235
                      found_a="$dir/lib$name.$libext"
 
2236
                      if test -f "$dir/lib$name.la"; then
 
2237
                        found_la="$dir/lib$name.la"
 
2238
                      fi
 
2239
                    fi
 
2240
                  fi
 
2241
                  ;;
 
2242
              esac
 
2243
              if test "X$found_dir" != "X"; then
 
2244
                break
 
2245
              fi
 
2246
            done
 
2247
          fi
 
2248
          if test "X$found_dir" != "X"; then
 
2249
            dnl Found the library.
 
2250
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
 
2251
            if test "X$found_so" != "X"; then
 
2252
              dnl Linking with a shared library. We attempt to hardcode its
 
2253
              dnl directory into the executable's runpath, unless it's the
 
2254
              dnl standard /usr/lib.
 
2255
              if test "X$found_dir" = "X/usr/lib"; then
 
2256
                dnl No hardcoding is needed.
 
2257
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2258
              else
 
2259
                dnl Use an explicit option to hardcode DIR into the resulting
 
2260
                dnl binary.
 
2261
                dnl Potentially add DIR to ltrpathdirs.
 
2262
                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
2263
                haveit=
 
2264
                for x in $ltrpathdirs; do
 
2265
                  if test "X$x" = "X$found_dir"; then
 
2266
                    haveit=yes
 
2267
                    break
 
2268
                  fi
 
2269
                done
 
2270
                if test -z "$haveit"; then
 
2271
                  ltrpathdirs="$ltrpathdirs $found_dir"
 
2272
                fi
 
2273
                dnl The hardcoding into $LIBNAME is system dependent.
 
2274
                if test "$hardcode_direct" = yes; then
 
2275
                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
 
2276
                  dnl resulting binary.
 
2277
                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2278
                else
 
2279
                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
 
2280
                    dnl Use an explicit option to hardcode DIR into the resulting
 
2281
                    dnl binary.
 
2282
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2283
                    dnl Potentially add DIR to rpathdirs.
 
2284
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
 
2285
                    haveit=
 
2286
                    for x in $rpathdirs; do
 
2287
                      if test "X$x" = "X$found_dir"; then
 
2288
                        haveit=yes
 
2289
                        break
 
2290
                      fi
 
2291
                    done
 
2292
                    if test -z "$haveit"; then
 
2293
                      rpathdirs="$rpathdirs $found_dir"
 
2294
                    fi
 
2295
                  else
 
2296
                    dnl Rely on "-L$found_dir".
 
2297
                    dnl But don't add it if it's already contained in the LDFLAGS
 
2298
                    dnl or the already constructed $LIBNAME
 
2299
                    haveit=
 
2300
                    for x in $LDFLAGS $LIB[]NAME; do
 
2301
                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2302
                      if test "X$x" = "X-L$found_dir"; then
 
2303
                        haveit=yes
 
2304
                        break
 
2305
                      fi
 
2306
                    done
 
2307
                    if test -z "$haveit"; then
 
2308
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
 
2309
                    fi
 
2310
                    if test "$hardcode_minus_L" != no; then
 
2311
                      dnl FIXME: Not sure whether we should use
 
2312
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
2313
                      dnl here.
 
2314
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
 
2315
                    else
 
2316
                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
 
2317
                      dnl here, because this doesn't fit in flags passed to the
 
2318
                      dnl compiler. So give up. No hardcoding. This affects only
 
2319
                      dnl very old systems.
 
2320
                      dnl FIXME: Not sure whether we should use
 
2321
                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
 
2322
                      dnl here.
 
2323
                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
2324
                    fi
 
2325
                  fi
 
2326
                fi
 
2327
              fi
 
2328
            else
 
2329
              if test "X$found_a" != "X"; then
 
2330
                dnl Linking with a static library.
 
2331
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
 
2332
              else
 
2333
                dnl We shouldn't come here, but anyway it's good to have a
 
2334
                dnl fallback.
 
2335
                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
 
2336
              fi
 
2337
            fi
 
2338
            dnl Assume the include files are nearby.
 
2339
            additional_includedir=
 
2340
            case "$found_dir" in
 
2341
              */lib | */lib/)
 
2342
                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
 
2343
                additional_includedir="$basedir/include"
 
2344
                ;;
 
2345
            esac
 
2346
            if test "X$additional_includedir" != "X"; then
 
2347
              dnl Potentially add $additional_includedir to $INCNAME.
 
2348
              dnl But don't add it
 
2349
              dnl   1. if it's the standard /usr/include,
 
2350
              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
 
2351
              dnl   3. if it's already present in $CPPFLAGS or the already
 
2352
              dnl      constructed $INCNAME,
 
2353
              dnl   4. if it doesn't exist as a directory.
 
2354
              if test "X$additional_includedir" != "X/usr/include"; then
 
2355
                haveit=
 
2356
                if test "X$additional_includedir" = "X/usr/local/include"; then
 
2357
                  if test -n "$GCC"; then
 
2358
                    case $host_os in
 
2359
                      linux*) haveit=yes;;
 
2360
                    esac
 
2361
                  fi
 
2362
                fi
 
2363
                if test -z "$haveit"; then
 
2364
                  for x in $CPPFLAGS $INC[]NAME; do
 
2365
                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2366
                    if test "X$x" = "X-I$additional_includedir"; then
 
2367
                      haveit=yes
 
2368
                      break
 
2369
                    fi
 
2370
                  done
 
2371
                  if test -z "$haveit"; then
 
2372
                    if test -d "$additional_includedir"; then
 
2373
                      dnl Really add $additional_includedir to $INCNAME.
 
2374
                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
 
2375
                    fi
 
2376
                  fi
 
2377
                fi
 
2378
              fi
 
2379
            fi
 
2380
            dnl Look for dependencies.
 
2381
            if test -n "$found_la"; then
 
2382
              dnl Read the .la file. It defines the variables
 
2383
              dnl dlname, library_names, old_library, dependency_libs, current,
 
2384
              dnl age, revision, installed, dlopen, dlpreopen, libdir.
 
2385
              save_libdir="$libdir"
 
2386
              case "$found_la" in
 
2387
                */* | *\\*) . "$found_la" ;;
 
2388
                *) . "./$found_la" ;;
 
2389
              esac
 
2390
              libdir="$save_libdir"
 
2391
              dnl We use only dependency_libs.
 
2392
              for dep in $dependency_libs; do
 
2393
                case "$dep" in
 
2394
                  -L*)
 
2395
                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
 
2396
                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
 
2397
                    dnl But don't add it
 
2398
                    dnl   1. if it's the standard /usr/lib,
 
2399
                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
 
2400
                    dnl   3. if it's already present in $LDFLAGS or the already
 
2401
                    dnl      constructed $LIBNAME,
 
2402
                    dnl   4. if it doesn't exist as a directory.
 
2403
                    if test "X$additional_libdir" != "X/usr/lib"; then
 
2404
                      haveit=
 
2405
                      if test "X$additional_libdir" = "X/usr/local/lib"; then
 
2406
                        if test -n "$GCC"; then
 
2407
                          case $host_os in
 
2408
                            linux*) haveit=yes;;
 
2409
                          esac
 
2410
                        fi
 
2411
                      fi
 
2412
                      if test -z "$haveit"; then
 
2413
                        haveit=
 
2414
                        for x in $LDFLAGS $LIB[]NAME; do
 
2415
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2416
                          if test "X$x" = "X-L$additional_libdir"; then
 
2417
                            haveit=yes
 
2418
                            break
 
2419
                          fi
 
2420
                        done
 
2421
                        if test -z "$haveit"; then
 
2422
                          if test -d "$additional_libdir"; then
 
2423
                            dnl Really add $additional_libdir to $LIBNAME.
 
2424
                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
 
2425
                          fi
 
2426
                        fi
 
2427
                        haveit=
 
2428
                        for x in $LDFLAGS $LTLIB[]NAME; do
 
2429
                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2430
                          if test "X$x" = "X-L$additional_libdir"; then
 
2431
                            haveit=yes
 
2432
                            break
 
2433
                          fi
 
2434
                        done
 
2435
                        if test -z "$haveit"; then
 
2436
                          if test -d "$additional_libdir"; then
 
2437
                            dnl Really add $additional_libdir to $LTLIBNAME.
 
2438
                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
 
2439
                          fi
 
2440
                        fi
 
2441
                      fi
 
2442
                    fi
 
2443
                    ;;
 
2444
                  -R*)
 
2445
                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
 
2446
                    dnl Potentially add DIR to rpathdirs.
 
2447
                    dnl The rpathdirs will be appended to $LIBNAME at the end.
 
2448
                    haveit=
 
2449
                    for x in $rpathdirs; do
 
2450
                      if test "X$x" = "X$dir"; then
 
2451
                        haveit=yes
 
2452
                        break
 
2453
                      fi
 
2454
                    done
 
2455
                    if test -z "$haveit"; then
 
2456
                      rpathdirs="$rpathdirs $dir"
 
2457
                    fi
 
2458
                    dnl Potentially add DIR to ltrpathdirs.
 
2459
                    dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
 
2460
                    haveit=
 
2461
                    for x in $ltrpathdirs; do
 
2462
                      if test "X$x" = "X$dir"; then
 
2463
                        haveit=yes
 
2464
                        break
 
2465
                      fi
 
2466
                    done
 
2467
                    if test -z "$haveit"; then
 
2468
                      ltrpathdirs="$ltrpathdirs $dir"
 
2469
                    fi
 
2470
                    ;;
 
2471
                  -l*)
 
2472
                    dnl Handle this in the next round.
 
2473
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
 
2474
                    ;;
 
2475
                  *.la)
 
2476
                    dnl Handle this in the next round. Throw away the .la's
 
2477
                    dnl directory; it is already contained in a preceding -L
 
2478
                    dnl option.
 
2479
                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
 
2480
                    ;;
 
2481
                  *)
 
2482
                    dnl Most likely an immediate library name.
 
2483
                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
 
2484
                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
 
2485
                    ;;
 
2486
                esac
 
2487
              done
 
2488
            fi
 
2489
          else
 
2490
            dnl Didn't find the library; assume it is in the system directories
 
2491
            dnl known to the linker and runtime loader. (All the system
 
2492
            dnl directories known to the linker should also be known to the
 
2493
            dnl runtime loader, otherwise the system is severely misconfigured.)
 
2494
            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
 
2495
            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
 
2496
          fi
 
2497
        fi
 
2498
      fi
 
2499
    done
 
2500
  done
 
2501
  if test "X$rpathdirs" != "X"; then
 
2502
    if test -n "$hardcode_libdir_separator"; then
 
2503
      dnl Weird platform: only the last -rpath option counts, the user must
 
2504
      dnl pass all path elements in one option. We can arrange that for a
 
2505
      dnl single library, but not when more than one $LIBNAMEs are used.
 
2506
      alldirs=
 
2507
      for found_dir in $rpathdirs; do
 
2508
        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
 
2509
      done
 
2510
      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
 
2511
      acl_save_libdir="$libdir"
 
2512
      libdir="$alldirs"
 
2513
      eval flag=\"$hardcode_libdir_flag_spec\"
 
2514
      libdir="$acl_save_libdir"
 
2515
      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
2516
    else
 
2517
      dnl The -rpath options are cumulative.
 
2518
      for found_dir in $rpathdirs; do
 
2519
        acl_save_libdir="$libdir"
 
2520
        libdir="$found_dir"
 
2521
        eval flag=\"$hardcode_libdir_flag_spec\"
 
2522
        libdir="$acl_save_libdir"
 
2523
        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
 
2524
      done
 
2525
    fi
 
2526
  fi
 
2527
  if test "X$ltrpathdirs" != "X"; then
 
2528
    dnl When using libtool, the option that works for both libraries and
 
2529
    dnl executables is -R. The -R options are cumulative.
 
2530
    for found_dir in $ltrpathdirs; do
 
2531
      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
 
2532
    done
 
2533
  fi
 
2534
])
 
2535
 
 
2536
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
 
2537
dnl unless already present in VAR.
 
2538
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
 
2539
dnl contains two or three consecutive elements that belong together.
 
2540
AC_DEFUN([AC_LIB_APPENDTOVAR],
 
2541
[
 
2542
  for element in [$2]; do
 
2543
    haveit=
 
2544
    for x in $[$1]; do
 
2545
      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
 
2546
      if test "X$x" = "X$element"; then
 
2547
        haveit=yes
 
2548
        break
 
2549
      fi
 
2550
    done
 
2551
    if test -z "$haveit"; then
 
2552
      [$1]="${[$1]}${[$1]:+ }$element"
 
2553
    fi
 
2554
  done
 
2555
])
 
2556
 
 
2557
# lib-ld.m4 serial 1 (gettext-0.11)
 
2558
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
 
2559
dnl This file is free software, distributed under the terms of the GNU
 
2560
dnl General Public License.  As a special exception to the GNU General
 
2561
dnl Public License, this file may be distributed as part of a program
 
2562
dnl that contains a configuration script generated by Autoconf, under
 
2563
dnl the same distribution terms as the rest of that program.
 
2564
 
 
2565
dnl Subroutines of libtool.m4,
 
2566
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
 
2567
dnl with libtool.m4.
 
2568
 
 
2569
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
 
2570
AC_DEFUN([AC_LIB_PROG_LD_GNU],
 
2571
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
 
2572
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
 
2573
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
 
2574
  acl_cv_prog_gnu_ld=yes
 
2575
else
 
2576
  acl_cv_prog_gnu_ld=no
 
2577
fi])
 
2578
with_gnu_ld=$acl_cv_prog_gnu_ld
 
2579
])
 
2580
 
 
2581
dnl From libtool-1.4. Sets the variable LD.
 
2582
AC_DEFUN([AC_LIB_PROG_LD],
 
2583
[AC_ARG_WITH(gnu-ld,
 
2584
[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
 
2585
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
 
2586
AC_REQUIRE([AC_PROG_CC])dnl
 
2587
AC_REQUIRE([AC_CANONICAL_HOST])dnl
 
2588
ac_prog=ld
 
2589
if test "$GCC" = yes; then
 
2590
  # Check if gcc -print-prog-name=ld gives a path.
 
2591
  AC_MSG_CHECKING([for ld used by GCC])
 
2592
  case $host in
 
2593
  *-*-mingw*)
 
2594
    # gcc leaves a trailing carriage return which upsets mingw
 
2595
    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
 
2596
  *)
 
2597
    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
 
2598
  esac
 
2599
  case $ac_prog in
 
2600
    # Accept absolute paths.
 
2601
    [[\\/]* | [A-Za-z]:[\\/]*)]
 
2602
      [re_direlt='/[^/][^/]*/\.\./']
 
2603
      # Canonicalize the path of ld
 
2604
      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
 
2605
      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
 
2606
        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
 
2607
      done
 
2608
      test -z "$LD" && LD="$ac_prog"
 
2609
      ;;
 
2610
  "")
 
2611
    # If it fails, then pretend we aren't using GCC.
 
2612
    ac_prog=ld
 
2613
    ;;
 
2614
  *)
 
2615
    # If it is relative, then search for the first ld in PATH.
 
2616
    with_gnu_ld=unknown
 
2617
    ;;
 
2618
  esac
 
2619
elif test "$with_gnu_ld" = yes; then
 
2620
  AC_MSG_CHECKING([for GNU ld])
 
2621
else
 
2622
  AC_MSG_CHECKING([for non-GNU ld])
 
2623
fi
 
2624
AC_CACHE_VAL(acl_cv_path_LD,
 
2625
[if test -z "$LD"; then
 
2626
  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
 
2627
  for ac_dir in $PATH; do
 
2628
    test -z "$ac_dir" && ac_dir=.
 
2629
    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
 
2630
      acl_cv_path_LD="$ac_dir/$ac_prog"
 
2631
      # Check to see if the program is GNU ld.  I'd rather use --version,
 
2632
      # but apparently some GNU ld's only accept -v.
 
2633
      # Break only if it was the GNU/non-GNU ld that we prefer.
 
2634
      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
 
2635
        test "$with_gnu_ld" != no && break
 
2636
      else
 
2637
        test "$with_gnu_ld" != yes && break
 
2638
      fi
 
2639
    fi
 
2640
  done
 
2641
  IFS="$ac_save_ifs"
 
2642
else
 
2643
  acl_cv_path_LD="$LD" # Let the user override the test with a path.
 
2644
fi])
 
2645
LD="$acl_cv_path_LD"
 
2646
if test -n "$LD"; then
 
2647
  AC_MSG_RESULT($LD)
 
2648
else
 
2649
  AC_MSG_RESULT(no)
 
2650
fi
 
2651
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 
2652
AC_LIB_PROG_LD_GNU
 
2653
])
 
2654
 
 
2655
# iconv.m4 serial AM3 (gettext-0.11)
 
2656
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
 
2657
dnl This file is free software, distributed under the terms of the GNU
 
2658
dnl General Public License.  As a special exception to the GNU General
 
2659
dnl Public License, this file may be distributed as part of a program
 
2660
dnl that contains a configuration script generated by Autoconf, under
 
2661
dnl the same distribution terms as the rest of that program.
 
2662
 
 
2663
dnl From Bruno Haible.
 
2664
 
 
2665
AC_DEFUN([AM_ICONV_LINK],
 
2666
[
 
2667
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
 
2668
  dnl those with the standalone portable GNU libiconv installed).
 
2669
 
 
2670
  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
 
2671
  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
 
2672
  AC_REQUIRE([AC_LIB_RPATH])
 
2673
 
 
2674
  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
 
2675
  dnl accordingly.
 
2676
  AC_LIB_LINKFLAGS_BODY([iconv])
 
2677
 
 
2678
  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
 
2679
  dnl because if the user has installed libiconv and not disabled its use
 
2680
  dnl via --without-libiconv-prefix, he wants to use it. The first
 
2681
  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
 
2682
  am_save_CPPFLAGS="$CPPFLAGS"
 
2683
  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
 
2684
 
 
2685
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
 
2686
    am_cv_func_iconv="no, consider installing GNU libiconv"
 
2687
    am_cv_lib_iconv=no
 
2688
    AC_TRY_LINK([#include <stdlib.h>
 
2689
#include <iconv.h>],
 
2690
      [iconv_t cd = iconv_open("","");
 
2691
       iconv(cd,NULL,NULL,NULL,NULL);
 
2692
       iconv_close(cd);],
 
2693
      am_cv_func_iconv=yes)
 
2694
    if test "$am_cv_func_iconv" != yes; then
 
2695
      am_save_LIBS="$LIBS"
 
2696
      LIBS="$LIBS $LIBICONV"
 
2697
      AC_TRY_LINK([#include <stdlib.h>
 
2698
#include <iconv.h>],
 
2699
        [iconv_t cd = iconv_open("","");
 
2700
         iconv(cd,NULL,NULL,NULL,NULL);
 
2701
         iconv_close(cd);],
 
2702
        am_cv_lib_iconv=yes
 
2703
        am_cv_func_iconv=yes)
 
2704
      LIBS="$am_save_LIBS"
 
2705
    fi
 
2706
  ])
 
2707
  if test "$am_cv_func_iconv" = yes; then
 
2708
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
 
2709
  fi
 
2710
  if test "$am_cv_lib_iconv" = yes; then
 
2711
    AC_MSG_CHECKING([how to link with libiconv])
 
2712
    AC_MSG_RESULT([$LIBICONV])
 
2713
  else
 
2714
    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
 
2715
    dnl either.
 
2716
    CPPFLAGS="$am_save_CPPFLAGS"
 
2717
    LIBICONV=
 
2718
    LTLIBICONV=
 
2719
  fi
 
2720
  AC_SUBST(LIBICONV)
 
2721
  AC_SUBST(LTLIBICONV)
 
2722
])
 
2723
 
 
2724
AC_DEFUN([AM_ICONV],
 
2725
[
 
2726
  AC_REQUIRE([AM_ICONV_LINK])
 
2727
  if test "$am_cv_func_iconv" = yes; then
 
2728
    AC_MSG_CHECKING([for iconv declaration])
 
2729
    AC_CACHE_VAL(am_cv_proto_iconv, [
 
2730
      AC_TRY_COMPILE([
 
2731
#include <stdlib.h>
 
2732
#include <iconv.h>
 
2733
extern
 
2734
#ifdef __cplusplus
 
2735
"C"
 
2736
#endif
 
2737
#if defined(__STDC__) || defined(__cplusplus)
 
2738
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
 
2739
#else
 
2740
size_t iconv();
 
2741
#endif
 
2742
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
 
2743
      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);"])
 
2744
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
 
2745
    AC_MSG_RESULT([$]{ac_t:-
 
2746
         }[$]am_cv_proto_iconv)
 
2747
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
 
2748
      [Define as const if the declaration of iconv() needs const.])
 
2749
  fi
 
2750
])
 
2751
 
 
2752
# progtest.m4 serial 2 (gettext-0.10.40)
 
2753
dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
 
2754
dnl This file is free software, distributed under the terms of the GNU
 
2755
dnl General Public License.  As a special exception to the GNU General
 
2756
dnl Public License, this file may be distributed as part of a program
 
2757
dnl that contains a configuration script generated by Autoconf, under
 
2758
dnl the same distribution terms as the rest of that program.
 
2759
dnl
 
2760
dnl This file can can be used in projects which are not available under
 
2761
dnl the GNU General Public License or the GNU Library General Public
 
2762
dnl License but which still want to provide support for the GNU gettext
 
2763
dnl functionality.
 
2764
dnl Please note that the actual code of the GNU gettext library is covered
 
2765
dnl by the GNU Library General Public License, and the rest of the GNU
 
2766
dnl gettext package package is covered by the GNU General Public License.
 
2767
dnl They are *not* in the public domain.
 
2768
 
 
2769
dnl Authors:
 
2770
dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
498
2771
 
499
2772
# Search path for a program which passes the given test.
500
 
# Ulrich Drepper <drepper@cygnus.com>, 1996.
501
 
#
502
 
# This file can be copied and used freely without restrictions.  It can
503
 
# be used in projects which are not available under the GNU General Public
504
 
# License or the GNU Library General Public License but which still want
505
 
# to provide support for the GNU gettext functionality.
506
 
# Please note that the actual code of the GNU gettext library is covered
507
 
# by the GNU Library General Public License, and the rest of the GNU
508
 
# gettext package package is covered by the GNU General Public License.
509
 
# They are *not* in the public domain.
510
 
 
511
 
# serial 2
512
2773
 
513
2774
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
514
2775
dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
548
2809
AC_SUBST($1)dnl
549
2810
])
550
2811
 
551
 
#serial 1
 
2812
# isc-posix.m4 serial 2 (gettext-0.11.2)
 
2813
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
2814
dnl This file is free software, distributed under the terms of the GNU
 
2815
dnl General Public License.  As a special exception to the GNU General
 
2816
dnl Public License, this file may be distributed as part of a program
 
2817
dnl that contains a configuration script generated by Autoconf, under
 
2818
dnl the same distribution terms as the rest of that program.
 
2819
 
 
2820
# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
 
2821
 
552
2822
# This test replaces the one in autoconf.
553
2823
# Currently this macro should have the same name as the autoconf macro
554
2824
# because gettext's gettext.m4 (distributed in the automake package)
566
2836
  ]
567
2837
)
568
2838
 
569
 
#serial 2
 
2839
# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
 
2840
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
 
2841
dnl This file is free software, distributed under the terms of the GNU
 
2842
dnl General Public License.  As a special exception to the GNU General
 
2843
dnl Public License, this file may be distributed as part of a program
 
2844
dnl that contains a configuration script generated by Autoconf, under
 
2845
dnl the same distribution terms as the rest of that program.
570
2846
 
571
2847
# Test for the GNU C Library, version 2.1 or newer.
572
2848
# From Bruno Haible.
593
2869
  ]
594
2870
)
595
2871
 
596
 
#serial AM2
597
 
 
598
 
dnl From Bruno Haible.
599
 
 
600
 
AC_DEFUN([AM_ICONV],
601
 
[
602
 
  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
603
 
  dnl those with the standalone portable GNU libiconv installed).
604
 
 
605
 
  AC_ARG_WITH([libiconv-prefix],
606
 
[  --with-libiconv-prefix=DIR  search for libiconv in DIR/include and DIR/lib], [
607
 
    for dir in `echo "$withval" | tr : ' '`; do
608
 
      if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
609
 
      if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
610
 
    done
611
 
   ])
612
 
 
613
 
  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
614
 
    am_cv_func_iconv="no, consider installing GNU libiconv"
615
 
    am_cv_lib_iconv=no
616
 
    AC_TRY_LINK([#include <stdlib.h>
617
 
#include <iconv.h>],
618
 
      [iconv_t cd = iconv_open("","");
619
 
       iconv(cd,NULL,NULL,NULL,NULL);
620
 
       iconv_close(cd);],
621
 
      am_cv_func_iconv=yes)
622
 
    if test "$am_cv_func_iconv" != yes; then
623
 
      am_save_LIBS="$LIBS"
624
 
      LIBS="$LIBS -liconv"
625
 
      AC_TRY_LINK([#include <stdlib.h>
626
 
#include <iconv.h>],
627
 
        [iconv_t cd = iconv_open("","");
628
 
         iconv(cd,NULL,NULL,NULL,NULL);
629
 
         iconv_close(cd);],
630
 
        am_cv_lib_iconv=yes
631
 
        am_cv_func_iconv=yes)
632
 
      LIBS="$am_save_LIBS"
633
 
    fi
634
 
  ])
635
 
  if test "$am_cv_func_iconv" = yes; then
636
 
    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
637
 
    AC_MSG_CHECKING([for iconv declaration])
638
 
    AC_CACHE_VAL(am_cv_proto_iconv, [
639
 
      AC_TRY_COMPILE([
640
 
#include <stdlib.h>
641
 
#include <iconv.h>
642
 
extern
643
 
#ifdef __cplusplus
644
 
"C"
645
 
#endif
646
 
#if defined(__STDC__) || defined(__cplusplus)
647
 
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
648
 
#else
649
 
size_t iconv();
650
 
#endif
651
 
], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
652
 
      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);"])
653
 
    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
654
 
    AC_MSG_RESULT([$]{ac_t:-
655
 
         }[$]am_cv_proto_iconv)
656
 
    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
657
 
      [Define as const if the declaration of iconv() needs const.])
658
 
  fi
659
 
  LIBICONV=
660
 
  if test "$am_cv_lib_iconv" = yes; then
661
 
    LIBICONV="-liconv"
662
 
  fi
663
 
  AC_SUBST(LIBICONV)
664
 
])
665
 
 
666
 
#serial AM1
 
2872
# codeset.m4 serial AM1 (gettext-0.10.40)
 
2873
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
 
2874
dnl This file is free software, distributed under the terms of the GNU
 
2875
dnl General Public License.  As a special exception to the GNU General
 
2876
dnl Public License, this file may be distributed as part of a program
 
2877
dnl that contains a configuration script generated by Autoconf, under
 
2878
dnl the same distribution terms as the rest of that program.
667
2879
 
668
2880
dnl From Bruno Haible.
669
2881
 
681
2893
  fi
682
2894
])
683
2895
 
 
2896
# lcmessage.m4 serial 2 (gettext-0.10.40)
 
2897
dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
 
2898
dnl This file is free software, distributed under the terms of the GNU
 
2899
dnl General Public License.  As a special exception to the GNU General
 
2900
dnl Public License, this file may be distributed as part of a program
 
2901
dnl that contains a configuration script generated by Autoconf, under
 
2902
dnl the same distribution terms as the rest of that program.
 
2903
dnl
 
2904
dnl This file can can be used in projects which are not available under
 
2905
dnl the GNU General Public License or the GNU Library General Public
 
2906
dnl License but which still want to provide support for the GNU gettext
 
2907
dnl functionality.
 
2908
dnl Please note that the actual code of the GNU gettext library is covered
 
2909
dnl by the GNU Library General Public License, and the rest of the GNU
 
2910
dnl gettext package package is covered by the GNU General Public License.
 
2911
dnl They are *not* in the public domain.
 
2912
 
 
2913
dnl Authors:
 
2914
dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
 
2915
 
684
2916
# Check whether LC_MESSAGES is available in <locale.h>.
685
 
# Ulrich Drepper <drepper@cygnus.com>, 1995.
686
 
#
687
 
# This file can be copied and used freely without restrictions.  It can
688
 
# be used in projects which are not available under the GNU General Public
689
 
# License or the GNU Library General Public License but which still want
690
 
# to provide support for the GNU gettext functionality.
691
 
# Please note that the actual code of the GNU gettext library is covered
692
 
# by the GNU Library General Public License, and the rest of the GNU
693
 
# gettext package package is covered by the GNU General Public License.
694
 
# They are *not* in the public domain.
695
 
 
696
 
# serial 2
697
2917
 
698
2918
AC_DEFUN([AM_LC_MESSAGES],
699
2919
  [if test $ac_cv_header_locale_h = yes; then
706
2926
    fi
707
2927
  fi])
708
2928
 
709
 
# Configure paths for GTK+
710
 
# Owen Taylor     97-11-3
711
 
 
712
 
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
713
 
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
714
 
dnl
715
 
AC_DEFUN(AM_PATH_GTK,
716
 
[dnl 
717
 
dnl Get the cflags and libraries from the gtk-config script
718
 
dnl
719
 
AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
720
 
            gtk_config_prefix="$withval", gtk_config_prefix="")
721
 
AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
722
 
            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
723
 
AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
724
 
                    , enable_gtktest=yes)
725
 
 
726
 
  for module in . $4
727
 
  do
728
 
      case "$module" in
729
 
         gthread) 
730
 
             gtk_config_args="$gtk_config_args gthread"
731
 
         ;;
732
 
      esac
733
 
  done
734
 
 
735
 
  if test x$gtk_config_exec_prefix != x ; then
736
 
     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
737
 
     if test x${GTK_CONFIG+set} != xset ; then
738
 
        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
739
 
     fi
740
 
  fi
741
 
  if test x$gtk_config_prefix != x ; then
742
 
     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
743
 
     if test x${GTK_CONFIG+set} != xset ; then
744
 
        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
745
 
     fi
746
 
  fi
747
 
 
748
 
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
749
 
  min_gtk_version=ifelse([$1], ,0.99.7,$1)
750
 
  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
751
 
  no_gtk=""
752
 
  if test "$GTK_CONFIG" = "no" ; then
753
 
    no_gtk=yes
754
 
  else
755
 
    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
756
 
    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
757
 
    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
758
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
759
 
    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
760
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
761
 
    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
762
 
           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
763
 
    if test "x$enable_gtktest" = "xyes" ; then
764
 
      ac_save_CFLAGS="$CFLAGS"
765
 
      ac_save_LIBS="$LIBS"
766
 
      CFLAGS="$CFLAGS $GTK_CFLAGS"
767
 
      LIBS="$GTK_LIBS $LIBS"
768
 
dnl
769
 
dnl Now check if the installed GTK is sufficiently new. (Also sanity
770
 
dnl checks the results of gtk-config to some extent
771
 
dnl
772
 
      rm -f conf.gtktest
773
 
      AC_TRY_RUN([
774
 
#include <gtk/gtk.h>
775
 
#include <stdio.h>
776
 
#include <stdlib.h>
777
 
 
778
 
int 
779
 
main ()
780
 
{
781
 
  int major, minor, micro;
782
 
  char *tmp_version;
783
 
 
784
 
  system ("touch conf.gtktest");
785
 
 
786
 
  /* HP/UX 9 (%@#!) writes to sscanf strings */
787
 
  tmp_version = g_strdup("$min_gtk_version");
788
 
  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
789
 
     printf("%s, bad version string\n", "$min_gtk_version");
790
 
     exit(1);
791
 
   }
792
 
 
793
 
  if ((gtk_major_version != $gtk_config_major_version) ||
794
 
      (gtk_minor_version != $gtk_config_minor_version) ||
795
 
      (gtk_micro_version != $gtk_config_micro_version))
796
 
    {
797
 
      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
798
 
             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
799
 
             gtk_major_version, gtk_minor_version, gtk_micro_version);
800
 
      printf ("*** was found! If gtk-config was correct, then it is best\n");
801
 
      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
802
 
      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
803
 
      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
804
 
      printf("*** required on your system.\n");
805
 
      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
806
 
      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
807
 
      printf("*** before re-running configure\n");
808
 
    } 
809
 
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
810
 
  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
811
 
           (gtk_minor_version != GTK_MINOR_VERSION) ||
812
 
           (gtk_micro_version != GTK_MICRO_VERSION))
813
 
    {
814
 
      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
815
 
             GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
816
 
      printf("*** library (version %d.%d.%d)\n",
817
 
             gtk_major_version, gtk_minor_version, gtk_micro_version);
818
 
    }
819
 
#endif /* defined (GTK_MAJOR_VERSION) ... */
820
 
  else
821
 
    {
822
 
      if ((gtk_major_version > major) ||
823
 
        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
824
 
        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
825
 
      {
826
 
        return 0;
827
 
       }
828
 
     else
829
 
      {
830
 
        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
831
 
               gtk_major_version, gtk_minor_version, gtk_micro_version);
832
 
        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
833
 
               major, minor, micro);
834
 
        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
835
 
        printf("***\n");
836
 
        printf("*** If you have already installed a sufficiently new version, this error\n");
837
 
        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
838
 
        printf("*** being found. The easiest way to fix this is to remove the old version\n");
839
 
        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
840
 
        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
841
 
        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
842
 
        printf("*** so that the correct libraries are found at run-time))\n");
843
 
      }
844
 
    }
845
 
  return 1;
846
 
}
847
 
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
848
 
       CFLAGS="$ac_save_CFLAGS"
849
 
       LIBS="$ac_save_LIBS"
850
 
     fi
851
 
  fi
852
 
  if test "x$no_gtk" = x ; then
853
 
     AC_MSG_RESULT(yes)
854
 
     ifelse([$2], , :, [$2])     
855
 
  else
856
 
     AC_MSG_RESULT(no)
857
 
     if test "$GTK_CONFIG" = "no" ; then
858
 
       echo "*** The gtk-config script installed by GTK could not be found"
859
 
       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
860
 
       echo "*** your path, or set the GTK_CONFIG environment variable to the"
861
 
       echo "*** full path to gtk-config."
862
 
     else
863
 
       if test -f conf.gtktest ; then
864
 
        :
865
 
       else
866
 
          echo "*** Could not run GTK test program, checking why..."
867
 
          CFLAGS="$CFLAGS $GTK_CFLAGS"
868
 
          LIBS="$LIBS $GTK_LIBS"
869
 
          AC_TRY_LINK([
870
 
#include <gtk/gtk.h>
871
 
#include <stdio.h>
872
 
],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
873
 
        [ echo "*** The test program compiled, but did not run. This usually means"
874
 
          echo "*** that the run-time linker is not finding GTK or finding the wrong"
875
 
          echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
876
 
          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
877
 
          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
878
 
          echo "*** is required on your system"
879
 
          echo "***"
880
 
          echo "*** If you have an old version installed, it is best to remove it, although"
881
 
          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
882
 
          echo "***"
883
 
          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
884
 
          echo "*** came with the system with the command"
885
 
          echo "***"
886
 
          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
887
 
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
888
 
          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
889
 
          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
890
 
          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
891
 
          CFLAGS="$ac_save_CFLAGS"
892
 
          LIBS="$ac_save_LIBS"
893
 
       fi
894
 
     fi
895
 
     GTK_CFLAGS=""
896
 
     GTK_LIBS=""
897
 
     ifelse([$3], , :, [$3])
898
 
  fi
899
 
  AC_SUBST(GTK_CFLAGS)
900
 
  AC_SUBST(GTK_LIBS)
901
 
  rm -f conf.gtktest
902
 
])
903