1dnl aclocal.m4 generated automatically by aclocal 1.3
2
3dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
4dnl This Makefile.in is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl aclocal.m4 generated automatically by aclocal 1.3
14
15dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
16dnl This Makefile.in is free software; the Free Software Foundation
17dnl gives unlimited permission to copy and/or distribute it,
18dnl with or without modifications, as long as this notice is preserved.
19
20dnl This program is distributed in the hope that it will be useful,
21dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
22dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
23dnl PARTICULAR PURPOSE.
24
25dnl aclocal.m4 generated automatically by aclocal 1.3
26
27dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
28dnl This Makefile.in is free software; the Free Software Foundation
29dnl gives unlimited permission to copy and/or distribute it,
30dnl with or without modifications, as long as this notice is preserved.
31
32dnl This program is distributed in the hope that it will be useful,
33dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
34dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
35dnl PARTICULAR PURPOSE.
36
37dnl aclocal.m4 generated automatically by aclocal 1.3
38
39dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
40dnl This Makefile.in is free software; the Free Software Foundation
41dnl gives unlimited permission to copy and/or distribute it,
42dnl with or without modifications, as long as this notice is preserved.
43
44dnl This program is distributed in the hope that it will be useful,
45dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
46dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
47dnl PARTICULAR PURPOSE.
48
49# Do all the work for Automake.  This macro actually does too much --
50# some checks are only needed if your package does certain things.
51# But this isn't really a big deal.
52
53# serial 1
54
55dnl Usage:
56dnl AM_INIT_AUTOMAKE(package,version, [no-define])
57
58AC_DEFUN(AM_INIT_AUTOMAKE,
59[AC_REQUIRE([AM_PROG_INSTALL])
60PACKAGE=[$1]
61AC_SUBST(PACKAGE)
62VERSION=[$2]
63AC_SUBST(VERSION)
64dnl test to see if srcdir already configured
65if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
66  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
67fi
68ifelse([$3],,
69AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Package name])
70AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version]))
71AC_REQUIRE([AM_SANITY_CHECK])
72AC_REQUIRE([AC_ARG_PROGRAM])
73dnl FIXME This is truly gross.
74missing_dir=`cd $ac_aux_dir && pwd`
75AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
76AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
77AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
78AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
79AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
80AC_REQUIRE([AC_PROG_MAKE_SET])])
81
82#
83# Check to make sure that the build environment is sane.
84#
85
86AC_DEFUN(AM_SANITY_CHECK,
87[AC_MSG_CHECKING([whether build environment is sane])
88# Just in case
89sleep 1
90echo timestamp > conftestfile
91# Do `set' in a subshell so we don't clobber the current shell's
92# arguments.  Must try -L first in case configure is actually a
93# symlink; some systems play weird games with the mod time of symlinks
94# (eg FreeBSD returns the mod time of the symlink's containing
95# directory).
96if (
97   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
98   if test "[$]*" = "X"; then
99      # -L didn't work.
100      set X `ls -t $srcdir/configure conftestfile`
101   fi
102   if test "[$]*" != "X $srcdir/configure conftestfile" \
103      && test "[$]*" != "X conftestfile $srcdir/configure"; then
104
105      # If neither matched, then we have a broken ls.  This can happen
106      # if, for instance, CONFIG_SHELL is bash and it inherits a
107      # broken ls alias from the environment.  This has actually
108      # happened.  Such a system could not be considered "sane".
109      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
110alias in your environment])
111   fi
112
113   test "[$]2" = conftestfile
114   )
115then
116   # Ok.
117   :
118else
119   AC_MSG_ERROR([newly created file is older than distributed files!
120Check your system clock])
121fi
122rm -f conftest*
123AC_MSG_RESULT(yes)])
124
125dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
126dnl The program must properly implement --version.
127AC_DEFUN(AM_MISSING_PROG,
128[AC_MSG_CHECKING(for working $2)
129# Run test in a subshell; some versions of sh will print an error if
130# an executable is not found, even if stderr is redirected.
131# Redirect stdin to placate older versions of autoconf.  Sigh.
132if ($2 --version) < /dev/null > /dev/null 2>&1; then
133   $1=$2
134   AC_MSG_RESULT(found)
135else
136   $1="$3/missing $2"
137   AC_MSG_RESULT(missing)
138fi
139AC_SUBST($1)])
140
141# Add --enable-maintainer-mode option to configure.
142# From Jim Meyering
143
144# serial 1
145
146AC_DEFUN(AM_MAINTAINER_MODE,
147[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
148  dnl maintainer-mode is disabled by default
149  AC_ARG_ENABLE(maintainer-mode,
150[  --enable-maintainer-mode enable make rules and dependencies not useful
151                          (and sometimes confusing) to the casual installer],
152      USE_MAINTAINER_MODE=$enableval,
153      USE_MAINTAINER_MODE=no)
154  AC_MSG_RESULT($USE_MAINTAINER_MODE)
155  if test $USE_MAINTAINER_MODE = yes; then
156    MAINT=
157  else
158    MAINT='#M#'
159  fi
160  AC_SUBST(MAINT)dnl
161]
162)
163
164
165# serial 1
166
167# @defmac AC_PROG_CC_STDC
168# @maindex PROG_CC_STDC
169# @ovindex CC
170# If the C compiler in not in ANSI C mode by default, try to add an option
171# to output variable @code{CC} to make it so.  This macro tries various
172# options that select ANSI C on some system or another.  It considers the
173# compiler to be in ANSI C mode if it handles function prototypes correctly.
174#
175# If you use this macro, you should check after calling it whether the C
176# compiler has been set to accept ANSI C; if not, the shell variable
177# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
178# code in ANSI C, you can make an un-ANSIfied copy of it by using the
179# program @code{ansi2knr}, which comes with Ghostscript.
180# @end defmac
181
182AC_DEFUN(AM_PROG_CC_STDC,
183[AC_REQUIRE([AC_PROG_CC])
184AC_BEFORE([$0], [AC_C_INLINE])
185AC_BEFORE([$0], [AC_C_CONST])
186dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
187dnl a magic option to avoid problems with ANSI preprocessor commands
188dnl like #elif.
189dnl FIXME: can't do this because then AC_AIX won't work due to a
190dnl circular dependency.
191dnl AC_BEFORE([$0], [AC_PROG_CPP])
192AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
193AC_CACHE_VAL(am_cv_prog_cc_stdc,
194[am_cv_prog_cc_stdc=no
195ac_save_CC="$CC"
196# Don't try gcc -ansi; that turns off useful extensions and
197# breaks some systems' header files.
198# AIX			-qlanglvl=ansi
199# Ultrix and OSF/1	-std1
200# HP-UX			-Aa -D_HPUX_SOURCE
201# SVR4			-Xc -D__EXTENSIONS__
202for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
203do
204  CC="$ac_save_CC $ac_arg"
205  AC_TRY_COMPILE(
206[#include <stdarg.h>
207#include <stdio.h>
208#include <sys/types.h>
209#include <sys/stat.h>
210/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
211struct buf { int x; };
212FILE * (*rcsopen) (struct buf *, struct stat *, int);
213static char *e (p, i)
214     char **p;
215     int i;
216{
217  return p[i];
218}
219static char *f (char * (*g) (char **, int), char **p, ...)
220{
221  char *s;
222  va_list v;
223  va_start (v,p);
224  s = g (p, va_arg (v,int));
225  va_end (v);
226  return s;
227}
228int test (int i, double x);
229struct s1 {int (*f) (int a);};
230struct s2 {int (*f) (double a);};
231int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
232int argc;
233char **argv;
234], [
235return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
236],
237[am_cv_prog_cc_stdc="$ac_arg"; break])
238done
239CC="$ac_save_CC"
240])
241if test -z "$am_cv_prog_cc_stdc"; then
242  AC_MSG_RESULT([none needed])
243else
244  AC_MSG_RESULT($am_cv_prog_cc_stdc)
245fi
246case "x$am_cv_prog_cc_stdc" in
247  x|xno) ;;
248  *) CC="$CC $am_cv_prog_cc_stdc" ;;
249esac
250])
251
252dnl AC_LANG_C()
253dnl became obsolete. uncommented. 03/21/2002, eg
254dnl AC_DEFUN(AC_LANG_C,
255dnl [define([AC_LANG], [C])dnl
256dnl ac_ext=c
257dnl # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
258dnl ac_cpp='$CPP $CPPFLAGS'
259dnl ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC'
260dnl ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
261dnl cross_compiling=$ac_cv_prog_cc_cross
262dnl ])
263
264
265dnl AC_LANG_C_AND_F77()
266AC_DEFUN(AC_LANG_C_AND_F77,
267[define([AC_LANG], [C])dnl
268ac_ext=c
269# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
270ac_cpp='$CPP $CPPFLAGS'
271ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC'
272ac_link='${F77-f77} -o conftest${ac_exeext} $CFLAGS $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
273cross_compiling=$ac_cv_prog_cc_cross
274])
275
276# Configure paths for GTK+
277# Owen Taylor     97-11-3
278
279dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
280dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
281dnl
282AC_DEFUN(AM_PATH_GTK,
283[dnl
284dnl Get the cflags and libraries from the gtk-config script
285dnl
286AC_ARG_WITH(gtk-prefix,[  --with-gtk-prefix=PFX   Prefix where GTK is installed (optional)],
287            gtk_config_prefix="$withval", gtk_config_prefix="")
288AC_ARG_WITH(gtk-exec-prefix,[  --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
289            gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
290AC_ARG_ENABLE(gtktest, [  --disable-gtktest       Do not try to compile and run a test GTK program],
291		    , enable_gtktest=yes)
292
293  if test x$gtk_config_exec_prefix != x ; then
294     gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
295     if test x${GTK_CONFIG+set} != xset ; then
296        GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
297     fi
298  fi
299  if test x$gtk_config_prefix != x ; then
300     gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
301     if test x${GTK_CONFIG+set} != xset ; then
302        GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
303     fi
304  fi
305
306  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
307  min_gtk_version=ifelse([$1], ,0.99.7,$1)
308  AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
309  no_gtk=""
310  if test "$GTK_CONFIG" = "no" ; then
311    no_gtk=yes
312  else
313    GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
314    GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
315    gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
316           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
317    gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
318           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
319    gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
320           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
321    if test "x$enable_gtktest" = "xyes" ; then
322      ac_save_CFLAGS="$CFLAGS"
323      ac_save_LIBS="$LIBS"
324      CFLAGS="$CFLAGS $GTK_CFLAGS"
325      LIBS="$LIBS $GTK_LIBS"
326dnl
327dnl Now check if the installed GTK is sufficiently new. (Also sanity
328dnl checks the results of gtk-config to some extent
329dnl
330      rm -f conf.gtktest
331      AC_TRY_RUN([
332#include <gtk/gtk.h>
333#include <stdio.h>
334
335int
336main ()
337{
338  int major, minor, micro;
339  char *tmp_version;
340
341  system ("touch conf.gtktest");
342
343  /* HP/UX 9 (%@#!) writes to sscanf strings */
344  tmp_version = g_strdup("$min_gtk_version");
345  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
346     printf("%s, bad version string\n", "$min_gtk_version");
347     exit(1);
348   }
349
350  if ((gtk_major_version != $gtk_config_major_version) ||
351      (gtk_minor_version != $gtk_config_minor_version) ||
352      (gtk_micro_version != $gtk_config_micro_version))
353    {
354      printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
355             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
356             gtk_major_version, gtk_minor_version, gtk_micro_version);
357      printf ("*** was found! If gtk-config was correct, then it is best\n");
358      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
359      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
360      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
361      printf("*** required on your system.\n");
362      printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
363      printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
364      printf("*** before re-running configure\n");
365    }
366  else
367    {
368      if ((gtk_major_version > major) ||
369        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
370        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
371      {
372        return 0;
373       }
374     else
375      {
376        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
377               gtk_major_version, gtk_minor_version, gtk_micro_version);
378        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
379	       major, minor, micro);
380        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
381        printf("***\n");
382        printf("*** If you have already installed a sufficiently new version, this error\n");
383        printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
384        printf("*** being found. The easiest way to fix this is to remove the old version\n");
385        printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
386        printf("*** correct copy of gtk-config. (In this case, you will have to\n");
387        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
388        printf("*** so that the correct libraries are found at run-time))\n");
389      }
390    }
391  return 1;
392}
393],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
394       CFLAGS="$ac_save_CFLAGS"
395       LIBS="$ac_save_LIBS"
396     fi
397  fi
398  if test "x$no_gtk" = x ; then
399     AC_MSG_RESULT(yes)
400     ifelse([$2], , :, [$2])
401  else
402     AC_MSG_RESULT(no)
403     if test "$GTK_CONFIG" = "no" ; then
404       echo "*** The gtk-config script installed by GTK could not be found"
405       echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
406       echo "*** your path, or set the GTK_CONFIG environment variable to the"
407       echo "*** full path to gtk-config."
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 "***"
429          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
430          echo "*** came with the system with the command"
431          echo "***"
432          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
433        [ echo "*** The test program failed to compile or link. See the file config.log for the"
434          echo "*** exact error that occured. This usually means GTK was incorrectly installed"
435          echo "*** or that you have moved GTK since it was installed. In the latter case, you"
436          echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
437          CFLAGS="$ac_save_CFLAGS"
438          LIBS="$ac_save_LIBS"
439       fi
440     fi
441     GTK_CFLAGS=""
442     GTK_LIBS=""
443     ifelse([$3], , :, [$3])
444  fi
445  AC_SUBST(GTK_CFLAGS)
446  AC_SUBST(GTK_LIBS)
447  rm -f conf.gtktest
448])
449
450# Define a conditional.
451
452AC_DEFUN(AM_CONDITIONAL,
453[AC_SUBST($1_TRUE)
454AC_SUBST($1_FALSE)
455if $2; then
456  $1_TRUE=
457  $1_FALSE='#'
458else
459  $1_TRUE='#'
460  $1_FALSE=
461fi])
462
463
464dnl GNOME_INIT_HOOK (script-if-gnome-enabled, failflag)
465dnl
466dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh
467dnl is not found.
468dnl
469dnl modified to define GNOME_DATADIR  Rainer Wichmann, Apr 7, 1999
470
471AC_DEFUN([GNOME_INIT_HOOK],
472[
473        AC_SUBST(GNOME_LIBS)
474        AC_SUBST(GNOMEUI_LIBS)
475        AC_SUBST(GNOMEGNORBA_LIBS)
476        AC_SUBST(GTKXMHTML_LIBS)
477        AC_SUBST(ZVT_LIBS)
478        AC_SUBST(GNOME_APPLET_LIBS)
479        AC_SUBST(GNOME_LIBDIR)
480        AC_SUBST(GNOME_INCLUDEDIR)
481	AC_SUBST(GNOME_DATADIR)
482
483        AC_ARG_WITH(gnome-includes,
484        [  --with-gnome-includes   Specify location of GNOME headers],[
485        CFLAGS="$CFLAGS -I$withval"
486        ])
487
488        AC_ARG_WITH(gnome-libs,
489        [  --with-gnome-libs       Specify location of GNOME libs],[
490        LDFLAGS="$LDFLAGS -L$withval"
491        gnome_prefix=$withval
492        ])
493
494        AC_ARG_WITH(gnome,
495        [  --with-gnome            Specify prefix for GNOME files],
496                if test x$withval = xyes; then
497                        want_gnome=yes
498                        dnl Note that an empty true branch is not
499                        dnl valid sh syntax.
500                        ifelse([$1], [], :, [$1])
501                else
502                        if test "x$withval" = xno; then
503                                want_gnome=no
504                        else
505                                want_gnome=yes
506                                LDFLAGS="$LDFLAGS -L$withval/lib"
507                                CFLAGS="$CFLAGS -I$withval/include"
508                                gnome_prefix=$withval/lib
509                        fi
510                fi,
511                want_gnome=yes)
512
513        if test "x$want_gnome" = xyes; then
514
515            AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
516            if test "$GNOME_CONFIG" = "no"; then
517              no_gnome_config="yes"
518            else
519              AC_MSG_CHECKING(if $GNOME_CONFIG works)
520              if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then
521                AC_MSG_RESULT(yes)
522                GNOME_GNORBA_HOOK([],$2)
523                GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`"
524                GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`"
525                GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`"
526                GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`"
527                ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`"
528                GNOME_APPLET_LIBS="`$GNOME_CONFIG --libs-only-l applets`"
529                GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`"
530                GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`"
531		GNOME_DATADIR="`gnome-config --datadir`"
532                $1
533              else
534                AC_MSG_RESULT(no)
535                no_gnome_config="yes"
536              fi
537            fi
538
539            if test x$exec_prefix = xNONE; then
540                if test x$prefix = xNONE; then
541                    gnome_prefix=$ac_default_prefix/lib
542                else
543                    gnome_prefix=$prefix/lib
544                fi
545            else
546                gnome_prefix=`eval echo \`echo $libdir\``
547            fi
548
549
550            if test "$no_gnome_config" = "yes"; then
551              AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix)
552              if test -f $gnome_prefix/gnomeConf.sh; then
553                AC_MSG_RESULT(found)
554                echo "loading gnome configuration from" \
555                     "$gnome_prefix/gnomeConf.sh"
556                . $gnome_prefix/gnomeConf.sh
557		ac_step1=`echo $GNOME_LIBDIR | sed 's%-L%%'`
558		ac_step2=`echo $ac_step1 | sed 's%\([^/]\)/*$%\1%'`
559		ac_step3=`echo $ac_step2 | sed 's%/[^/][^/]*$%%'`
560		GNOME_DATADIR=`echo $ac_step3`/share
561                $1
562              else
563                AC_MSG_RESULT(not found)
564                if test x$2 = xfail; then
565                  AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install)
566                fi
567              fi
568            fi
569        fi
570])
571
572AC_DEFUN([GNOME_INIT],[
573        GNOME_INIT_HOOK([],fail)
574])
575
576
577dnl
578dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag)
579dnl
580dnl if failflag is "failure" it aborts if gnorba is not found.
581dnl
582
583AC_DEFUN([GNOME_GNORBA_HOOK],[
584        GNOME_ORBIT_HOOK([],$2)
585        AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[
586                gnome_cv_gnorba_found=no
587                if test x$gnome_cv_orbit_found = xyes; then
588                        GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
589                        GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
590                        if test -n "$GNORBA_LIBS"; then
591                                gnome_cv_gnorba_found=yes
592                        fi
593                fi
594        ])
595	AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes)
596        if test x$gnome_cv_orbit_found = xyes; then
597                $1
598                GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`"
599                GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`"
600                AC_SUBST(GNORBA_CFLAGS)
601                AC_SUBST(GNORBA_LIBS)
602        else
603                if test x$2 = xfailure; then
604                        AC_MSG_ERROR(gnorba library not installed or installation problem)
605                fi
606        fi
607])
608
609AC_DEFUN([GNOME_GNORBA_CHECK], [
610        GNOME_GNORBA_HOOK([],failure)
611])
612
613dnl
614dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag)
615dnl
616dnl if failflag is "failure" it aborts if orbit is not found.
617dnl
618
619AC_DEFUN([GNOME_ORBIT_HOOK],[
620        AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no)
621        AC_PATH_PROG(ORBIT_IDL,orbit-idl,no)
622        AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[
623                if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then
624                        gnome_cv_orbit_found=no
625                else
626                        gnome_cv_orbit_found=yes
627                fi
628        ])
629        AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes)
630        if test x$gnome_cv_orbit_found = xyes; then
631                $1
632                ORBIT_CFLAGS=`orbit-config --cflags client server`
633                ORBIT_LIBS=`orbit-config --use-service=name --libs client server`
634                AC_SUBST(ORBIT_CFLAGS)
635                AC_SUBST(ORBIT_LIBS)
636        else
637                if test x$2 = xfailure; then
638                        AC_MSG_ERROR(ORBit not installed or installation problem)
639                fi
640        fi
641])
642
643AC_DEFUN([GNOME_ORBIT_CHECK], [
644        GNOME_ORBIT_HOOK([],failure)
645])
646
647
648dnl Check NLS options
649
650AC_DEFUN(md_PATH_PROG,
651  [AC_PATH_PROG($1,$2,$3)dnl
652   if echo $$1 | grep openwin > /dev/null; then
653     echo "WARNING: Do not use OpenWin's $2.  (Better remove it.) >&AC_FD_MSG"
654     ac_cv_path_$1=$2
655     $1=$2
656   fi
657])
658
659# codeset.m4 serial AM1 (gettext-0.10.40)
660dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
661dnl This file is free software, distributed under the terms of the GNU
662dnl General Public License.  As a special exception to the GNU General
663dnl Public License, this file may be distributed as part of a program
664dnl that contains a configuration script generated by Autoconf, under
665dnl the same distribution terms as the rest of that program.
666
667dnl From Bruno Haible.
668
669AC_DEFUN([AM_LANGINFO_CODESET],
670[
671  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
672    [AC_TRY_LINK([#include <langinfo.h>],
673      [char* cs = nl_langinfo(CODESET);],
674      am_cv_langinfo_codeset=yes,
675      am_cv_langinfo_codeset=no)
676    ])
677  if test $am_cv_langinfo_codeset = yes; then
678    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
679      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
680  fi
681])
682# gettext.m4 serial 17 (gettext-0.11.5)
683dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
684dnl This file is free software, distributed under the terms of the GNU
685dnl General Public License.  As a special exception to the GNU General
686dnl Public License, this file may be distributed as part of a program
687dnl that contains a configuration script generated by Autoconf, under
688dnl the same distribution terms as the rest of that program.
689dnl
690dnl This file can can be used in projects which are not available under
691dnl the GNU General Public License or the GNU Library General Public
692dnl License but which still want to provide support for the GNU gettext
693dnl functionality.
694dnl Please note that the actual code of the GNU gettext library is covered
695dnl by the GNU Library General Public License, and the rest of the GNU
696dnl gettext package package is covered by the GNU General Public License.
697dnl They are *not* in the public domain.
698
699dnl Authors:
700dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
701dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
702
703dnl Macro to add for using GNU gettext.
704
705dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
706dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
707dnl    default (if it is not specified or empty) is 'no-libtool'.
708dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
709dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
710dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
711dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
712dnl    depending on --{enable,disable}-{shared,static} and on the presence of
713dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
714dnl    $(top_builddir)/intl/libintl.a will be created.
715dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
716dnl    implementations (in libc or libintl) without the ngettext() function
717dnl    will be ignored.  If NEEDSYMBOL is specified and is
718dnl    'need-formatstring-macros', then GNU gettext implementations that don't
719dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
720dnl INTLDIR is used to find the intl libraries.  If empty,
721dnl    the value `$(top_builddir)/intl/' is used.
722dnl
723dnl The result of the configuration is one of three cases:
724dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
725dnl    and used.
726dnl    Catalog format: GNU --> install in $(datadir)
727dnl    Catalog extension: .mo after installation, .gmo in source tree
728dnl 2) GNU gettext has been found in the system's C library.
729dnl    Catalog format: GNU --> install in $(datadir)
730dnl    Catalog extension: .mo after installation, .gmo in source tree
731dnl 3) No internationalization, always use English msgid.
732dnl    Catalog format: none
733dnl    Catalog extension: none
734dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
735dnl The use of .gmo is historical (it was needed to avoid overwriting the
736dnl GNU format catalogs when building on a platform with an X/Open gettext),
737dnl but we keep it in order not to force irrelevant filename changes on the
738dnl maintainers.
739dnl
740AC_DEFUN([AM_GNU_GETTEXT],
741[
742  dnl Argument checking.
743  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
744    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
745])])])])])
746  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
747    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
748])])])])
749  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
750  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
751
752  AC_REQUIRE([AM_PO_SUBDIRS])dnl
753  ifelse(gt_included_intl, yes, [
754    AC_REQUIRE([AM_INTL_SUBDIR])dnl
755  ])
756
757  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
758  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
759  AC_REQUIRE([AC_LIB_RPATH])
760
761  dnl Sometimes libintl requires libiconv, so first search for libiconv.
762  dnl Ideally we would do this search only after the
763  dnl      if test "$USE_NLS" = "yes"; then
764  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
765  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
766  dnl the configure script would need to contain the same shell code
767  dnl again, outside any 'if'. There are two solutions:
768  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
769  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
770  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
771  dnl documented, we avoid it.
772  ifelse(gt_included_intl, yes, , [
773    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
774  ])
775
776  AC_MSG_CHECKING([whether NLS is requested])
777  dnl Default is enabled NLS
778  AC_ARG_ENABLE(nls,
779    [  --disable-nls           do not use Native Language Support],
780    USE_NLS=$enableval, USE_NLS=yes)
781  AC_MSG_RESULT($USE_NLS)
782  AC_SUBST(USE_NLS)
783
784  ifelse(gt_included_intl, yes, [
785    BUILD_INCLUDED_LIBINTL=no
786    USE_INCLUDED_LIBINTL=no
787  ])
788  LIBINTL=
789  LTLIBINTL=
790  POSUB=
791
792  dnl If we use NLS figure out what method
793  if test "$USE_NLS" = "yes"; then
794    gt_use_preinstalled_gnugettext=no
795    ifelse(gt_included_intl, yes, [
796      AC_MSG_CHECKING([whether included gettext is requested])
797      AC_ARG_WITH(included-gettext,
798        [  --with-included-gettext use the GNU gettext library included here],
799        nls_cv_force_use_gnu_gettext=$withval,
800        nls_cv_force_use_gnu_gettext=no)
801      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
802
803      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
804      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
805    ])
806        dnl User does not insist on using GNU NLS library.  Figure out what
807        dnl to use.  If GNU gettext is available we use this.  Else we have
808        dnl to fall back to GNU NLS library.
809
810        dnl Add a version number to the cache macros.
811        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
812        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
813        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
814
815        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
816         [AC_TRY_LINK([#include <libintl.h>
817]ifelse([$2], [need-formatstring-macros],
818[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
819#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
820#endif
821changequote(,)dnl
822typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
823changequote([,])dnl
824], [])[extern int _nl_msg_cat_cntr;
825extern int *_nl_domain_bindings;],
826            [bindtextdomain ("", "");
827return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
828            gt_cv_func_gnugettext_libc=yes,
829            gt_cv_func_gnugettext_libc=no)])
830
831        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
832          dnl Sometimes libintl requires libiconv, so first search for libiconv.
833          ifelse(gt_included_intl, yes, , [
834            AM_ICONV_LINK
835          ])
836          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
837          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
838          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
839          dnl even if libiconv doesn't exist.
840          AC_LIB_LINKFLAGS_BODY([intl])
841          AC_CACHE_CHECK([for GNU gettext in libintl],
842            gt_cv_func_gnugettext_libintl,
843           [gt_save_CPPFLAGS="$CPPFLAGS"
844            CPPFLAGS="$CPPFLAGS $INCINTL"
845            gt_save_LIBS="$LIBS"
846            LIBS="$LIBS $LIBINTL"
847            dnl Now see whether libintl exists and does not depend on libiconv.
848            AC_TRY_LINK([#include <libintl.h>
849]ifelse([$2], [need-formatstring-macros],
850[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
851#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
852#endif
853changequote(,)dnl
854typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
855changequote([,])dnl
856], [])[extern int _nl_msg_cat_cntr;
857extern
858#ifdef __cplusplus
859"C"
860#endif
861const char *_nl_expand_alias ();],
862              [bindtextdomain ("", "");
863return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
864              gt_cv_func_gnugettext_libintl=yes,
865              gt_cv_func_gnugettext_libintl=no)
866            dnl Now see whether libintl exists and depends on libiconv.
867            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
868              LIBS="$LIBS $LIBICONV"
869              AC_TRY_LINK([#include <libintl.h>
870]ifelse([$2], [need-formatstring-macros],
871[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
872#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
873#endif
874changequote(,)dnl
875typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
876changequote([,])dnl
877], [])[extern int _nl_msg_cat_cntr;
878extern
879#ifdef __cplusplus
880"C"
881#endif
882const char *_nl_expand_alias ();],
883                [bindtextdomain ("", "");
884return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
885               [LIBINTL="$LIBINTL $LIBICONV"
886                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
887                gt_cv_func_gnugettext_libintl=yes
888               ])
889            fi
890            CPPFLAGS="$gt_save_CPPFLAGS"
891            LIBS="$gt_save_LIBS"])
892        fi
893
894        dnl If an already present or preinstalled GNU gettext() is found,
895        dnl use it.  But if this macro is used in GNU gettext, and GNU
896        dnl gettext is already preinstalled in libintl, we update this
897        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
898        if test "$gt_cv_func_gnugettext_libc" = "yes" \
899           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
900                && test "$PACKAGE" != gettext; }; then
901          gt_use_preinstalled_gnugettext=yes
902        else
903          dnl Reset the values set by searching for libintl.
904          LIBINTL=
905          LTLIBINTL=
906          INCINTL=
907        fi
908
909    ifelse(gt_included_intl, yes, [
910        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
911          dnl GNU gettext is not found in the C library.
912          dnl Fall back on included GNU gettext library.
913          nls_cv_use_gnu_gettext=yes
914        fi
915      fi
916
917      if test "$nls_cv_use_gnu_gettext" = "yes"; then
918        dnl Mark actions used to generate GNU NLS library.
919        INTLOBJS="\$(GETTOBJS)"
920        BUILD_INCLUDED_LIBINTL=yes
921        USE_INCLUDED_LIBINTL=yes
922        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
923        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
924        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
925      fi
926
927      if test "$gt_use_preinstalled_gnugettext" = "yes" \
928         || test "$nls_cv_use_gnu_gettext" = "yes"; then
929        dnl Mark actions to use GNU gettext tools.
930        CATOBJEXT=.gmo
931      fi
932    ])
933
934    if test "$gt_use_preinstalled_gnugettext" = "yes" \
935       || test "$nls_cv_use_gnu_gettext" = "yes"; then
936      AC_DEFINE(ENABLE_NLS, 1,
937        [Define to 1 if translation of program messages to the user's native language
938   is requested.])
939    else
940      USE_NLS=no
941    fi
942  fi
943
944  if test "$USE_NLS" = "yes"; then
945
946    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
947      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
948        AC_MSG_CHECKING([how to link with libintl])
949        AC_MSG_RESULT([$LIBINTL])
950        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
951      fi
952
953      dnl For backward compatibility. Some packages may be using this.
954      AC_DEFINE(HAVE_GETTEXT, 1,
955       [Define if the GNU gettext() function is already present or preinstalled.])
956      AC_DEFINE(HAVE_DCGETTEXT, 1,
957       [Define if the GNU dcgettext() function is already present or preinstalled.])
958    fi
959
960    dnl We need to process the po/ directory.
961    POSUB=po
962  fi
963
964  ifelse(gt_included_intl, yes, [
965    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
966    dnl to 'yes' because some of the testsuite requires it.
967    if test "$PACKAGE" = gettext; then
968      BUILD_INCLUDED_LIBINTL=yes
969    fi
970
971    dnl Make all variables we use known to autoconf.
972    AC_SUBST(BUILD_INCLUDED_LIBINTL)
973    AC_SUBST(USE_INCLUDED_LIBINTL)
974    AC_SUBST(CATOBJEXT)
975    AC_SUBST(INTLOBJS)
976
977    dnl For backward compatibility. Some configure.ins may be using this.
978    nls_cv_header_intl=
979    nls_cv_header_libgt=
980
981    dnl For backward compatibility. Some Makefiles may be using this.
982    DATADIRNAME=share
983    AC_SUBST(DATADIRNAME)
984
985    dnl For backward compatibility. Some Makefiles may be using this.
986    INSTOBJEXT=.mo
987    AC_SUBST(INSTOBJEXT)
988
989    dnl For backward compatibility. Some Makefiles may be using this.
990    GENCAT=gencat
991    AC_SUBST(GENCAT)
992
993    dnl Enable libtool support if the surrounding package wishes it.
994    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
995    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
996  ])
997
998  dnl For backward compatibility. Some Makefiles may be using this.
999  INTLLIBS="$LIBINTL"
1000  AC_SUBST(INTLLIBS)
1001
1002  dnl Make all documented variables known to autoconf.
1003  AC_SUBST(LIBINTL)
1004  AC_SUBST(LTLIBINTL)
1005  AC_SUBST(POSUB)
1006])
1007
1008
1009dnl Checks for all prerequisites of the po subdirectory,
1010dnl except for USE_NLS.
1011AC_DEFUN([AM_PO_SUBDIRS],
1012[
1013  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1014  AC_REQUIRE([AC_PROG_INSTALL])dnl
1015  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1016
1017  dnl Perform the following tests also if --disable-nls has been given,
1018  dnl because they are needed for "make dist" to work.
1019
1020  dnl Search for GNU msgfmt in the PATH.
1021  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1022  dnl The second test excludes FreeBSD msgfmt.
1023  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1024    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1025     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1026    :)
1027  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1028
1029  dnl Search for GNU xgettext 0.11 or newer in the PATH.
1030  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1031  dnl The second test excludes FreeBSD xgettext.
1032  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1033    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1034     (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)],
1035    :)
1036  dnl Remove leftover from FreeBSD xgettext call.
1037  rm -f messages.po
1038
1039  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1040  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1041    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1042
1043  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1044  dnl Test whether we really found GNU msgfmt.
1045  if test "$GMSGFMT" != ":"; then
1046    dnl If it is no GNU msgfmt we define it as : so that the
1047    dnl Makefiles still can work.
1048    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1049       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1050      : ;
1051    else
1052      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1053      AC_MSG_RESULT(
1054        [found $GMSGFMT program is not GNU msgfmt; ignore it])
1055      GMSGFMT=":"
1056    fi
1057  fi
1058
1059  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1060  dnl Test whether we really found GNU xgettext.
1061  if test "$XGETTEXT" != ":"; then
1062    dnl If it is no GNU xgettext we define it as : so that the
1063    dnl Makefiles still can work.
1064    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1065       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1066      : ;
1067    else
1068      AC_MSG_RESULT(
1069        [found xgettext program is not GNU xgettext; ignore it])
1070      XGETTEXT=":"
1071    fi
1072    dnl Remove leftover from FreeBSD xgettext call.
1073    rm -f messages.po
1074  fi
1075
1076  AC_OUTPUT_COMMANDS([
1077    for ac_file in $CONFIG_FILES; do
1078      # Support "outfile[:infile[:infile...]]"
1079      case "$ac_file" in
1080        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1081      esac
1082      # PO directories have a Makefile.in generated from Makefile.in.in.
1083      case "$ac_file" in */Makefile.in)
1084        # Adjust a relative srcdir.
1085        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1086        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1087        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1088        # In autoconf-2.13 it is called $ac_given_srcdir.
1089        # In autoconf-2.50 it is called $srcdir.
1090        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1091        case "$ac_given_srcdir" in
1092          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1093          /*) top_srcdir="$ac_given_srcdir" ;;
1094          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1095        esac
1096        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1097          rm -f "$ac_dir/POTFILES"
1098          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1099          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1100          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1101          # on $ac_dir but don't depend on user-specified configuration
1102          # parameters.
1103          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1104            # The LINGUAS file contains the set of available languages.
1105            if test -n "$ALL_LINGUAS"; then
1106              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1107            fi
1108            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1109            # Hide the ALL_LINGUAS assigment from automake.
1110            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1111          fi
1112          case "$ac_given_srcdir" in
1113            .) srcdirpre= ;;
1114            *) srcdirpre='$(srcdir)/' ;;
1115          esac
1116          POFILES=
1117          GMOFILES=
1118          UPDATEPOFILES=
1119          DUMMYPOFILES=
1120          for lang in $ALL_LINGUAS; do
1121            POFILES="$POFILES $srcdirpre$lang.po"
1122            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1123            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1124            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1125          done
1126          # CATALOGS depends on both $ac_dir and the user's LINGUAS
1127          # environment variable.
1128          INST_LINGUAS=
1129          if test -n "$ALL_LINGUAS"; then
1130            for presentlang in $ALL_LINGUAS; do
1131              useit=no
1132              if test "%UNSET%" != "$LINGUAS"; then
1133                desiredlanguages="$LINGUAS"
1134              else
1135                desiredlanguages="$ALL_LINGUAS"
1136              fi
1137              for desiredlang in $desiredlanguages; do
1138                # Use the presentlang catalog if desiredlang is
1139                #   a. equal to presentlang, or
1140                #   b. a variant of presentlang (because in this case,
1141                #      presentlang can be used as a fallback for messages
1142                #      which are not translated in the desiredlang catalog).
1143                case "$desiredlang" in
1144                  "$presentlang"*) useit=yes;;
1145                esac
1146              done
1147              if test $useit = yes; then
1148                INST_LINGUAS="$INST_LINGUAS $presentlang"
1149              fi
1150            done
1151          fi
1152          CATALOGS=
1153          if test -n "$INST_LINGUAS"; then
1154            for lang in $INST_LINGUAS; do
1155              CATALOGS="$CATALOGS $lang.gmo"
1156            done
1157          fi
1158          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1159          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"
1160          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1161            if test -f "$f"; then
1162              case "$f" in
1163                *.orig | *.bak | *~) ;;
1164                *) cat "$f" >> "$ac_dir/Makefile" ;;
1165              esac
1166            fi
1167          done
1168        fi
1169        ;;
1170      esac
1171    done],
1172   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1173    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1174    # from automake.
1175    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1176    # Capture the value of LINGUAS because we need it to compute CATALOGS.
1177    LINGUAS="${LINGUAS-%UNSET%}"
1178   ])
1179])
1180
1181
1182dnl Checks for all prerequisites of the intl subdirectory,
1183dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1184dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1185AC_DEFUN([AM_INTL_SUBDIR],
1186[
1187  AC_REQUIRE([AC_PROG_INSTALL])dnl
1188  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1189  AC_REQUIRE([AC_PROG_CC])dnl
1190  AC_REQUIRE([AC_CANONICAL_HOST])dnl
1191  AC_REQUIRE([AC_PROG_RANLIB])dnl
1192  AC_REQUIRE([AC_ISC_POSIX])dnl
1193  AC_REQUIRE([AC_HEADER_STDC])dnl
1194  AC_REQUIRE([AC_C_CONST])dnl
1195  AC_REQUIRE([AC_C_INLINE])dnl
1196  AC_REQUIRE([AC_TYPE_OFF_T])dnl
1197  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1198  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1199  AC_REQUIRE([AC_FUNC_MMAP])dnl
1200  AC_REQUIRE([jm_GLIBC21])dnl
1201  AC_REQUIRE([gt_INTDIV0])dnl
1202  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1203  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1204  AC_REQUIRE([gt_INTTYPES_PRI])dnl
1205
1206  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1207stdlib.h string.h unistd.h sys/param.h])
1208  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1209geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1210strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1211
1212  AM_ICONV
1213  AM_LANGINFO_CODESET
1214  if test $ac_cv_header_locale_h = yes; then
1215    AM_LC_MESSAGES
1216  fi
1217
1218  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1219  dnl because plural.y uses bison specific features. It requires at least
1220  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1221  dnl compile.
1222  dnl bison is only needed for the maintainer (who touches plural.y). But in
1223  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1224  dnl the rule in general Makefile. Now, some people carelessly touch the
1225  dnl files or have a broken "make" program, hence the plural.c rule will
1226  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1227  dnl present or too old.
1228  AC_CHECK_PROGS([INTLBISON], [bison])
1229  if test -z "$INTLBISON"; then
1230    ac_verc_fail=yes
1231  else
1232    dnl Found it, now check the version.
1233    AC_MSG_CHECKING([version of bison])
1234changequote(<<,>>)dnl
1235    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1236    case $ac_prog_version in
1237      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1238      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1239changequote([,])dnl
1240         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1241      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1242    esac
1243    AC_MSG_RESULT([$ac_prog_version])
1244  fi
1245  if test $ac_verc_fail = yes; then
1246    INTLBISON=:
1247  fi
1248])
1249
1250
1251AC_DEFUN([AM_MKINSTALLDIRS],
1252[
1253  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1254  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1255  dnl Try to locate is.
1256  MKINSTALLDIRS=
1257  if test -n "$ac_aux_dir"; then
1258    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1259  fi
1260  if test -z "$MKINSTALLDIRS"; then
1261    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1262  fi
1263  AC_SUBST(MKINSTALLDIRS)
1264])
1265
1266
1267dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1268AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1269# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
1270dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1271dnl This file is free software, distributed under the terms of the GNU
1272dnl General Public License.  As a special exception to the GNU General
1273dnl Public License, this file may be distributed as part of a program
1274dnl that contains a configuration script generated by Autoconf, under
1275dnl the same distribution terms as the rest of that program.
1276
1277# Test for the GNU C Library, version 2.1 or newer.
1278# From Bruno Haible.
1279
1280AC_DEFUN([jm_GLIBC21],
1281  [
1282    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1283      ac_cv_gnu_library_2_1,
1284      [AC_EGREP_CPP([Lucky GNU user],
1285	[
1286#include <features.h>
1287#ifdef __GNU_LIBRARY__
1288 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1289  Lucky GNU user
1290 #endif
1291#endif
1292	],
1293	ac_cv_gnu_library_2_1=yes,
1294	ac_cv_gnu_library_2_1=no)
1295      ]
1296    )
1297    AC_SUBST(GLIBC21)
1298    GLIBC21="$ac_cv_gnu_library_2_1"
1299  ]
1300)
1301# iconv.m4 serial AM4 (gettext-0.11.3)
1302dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
1303dnl This file is free software, distributed under the terms of the GNU
1304dnl General Public License.  As a special exception to the GNU General
1305dnl Public License, this file may be distributed as part of a program
1306dnl that contains a configuration script generated by Autoconf, under
1307dnl the same distribution terms as the rest of that program.
1308
1309dnl From Bruno Haible.
1310
1311AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
1312[
1313  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1314  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1315  AC_REQUIRE([AC_LIB_RPATH])
1316
1317  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1318  dnl accordingly.
1319  AC_LIB_LINKFLAGS_BODY([iconv])
1320])
1321
1322AC_DEFUN([AM_ICONV_LINK],
1323[
1324  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1325  dnl those with the standalone portable GNU libiconv installed).
1326
1327  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
1328  dnl accordingly.
1329  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1330
1331  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
1332  dnl because if the user has installed libiconv and not disabled its use
1333  dnl via --without-libiconv-prefix, he wants to use it. The first
1334  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
1335  am_save_CPPFLAGS="$CPPFLAGS"
1336  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
1337
1338  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1339    am_cv_func_iconv="no, consider installing GNU libiconv"
1340    am_cv_lib_iconv=no
1341    AC_TRY_LINK([#include <stdlib.h>
1342#include <iconv.h>],
1343      [iconv_t cd = iconv_open("","");
1344       iconv(cd,NULL,NULL,NULL,NULL);
1345       iconv_close(cd);],
1346      am_cv_func_iconv=yes)
1347    if test "$am_cv_func_iconv" != yes; then
1348      am_save_LIBS="$LIBS"
1349      LIBS="$LIBS $LIBICONV"
1350      AC_TRY_LINK([#include <stdlib.h>
1351#include <iconv.h>],
1352        [iconv_t cd = iconv_open("","");
1353         iconv(cd,NULL,NULL,NULL,NULL);
1354         iconv_close(cd);],
1355        am_cv_lib_iconv=yes
1356        am_cv_func_iconv=yes)
1357      LIBS="$am_save_LIBS"
1358    fi
1359  ])
1360  if test "$am_cv_func_iconv" = yes; then
1361    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1362  fi
1363  if test "$am_cv_lib_iconv" = yes; then
1364    AC_MSG_CHECKING([how to link with libiconv])
1365    AC_MSG_RESULT([$LIBICONV])
1366  else
1367    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
1368    dnl either.
1369    CPPFLAGS="$am_save_CPPFLAGS"
1370    LIBICONV=
1371    LTLIBICONV=
1372  fi
1373  AC_SUBST(LIBICONV)
1374  AC_SUBST(LTLIBICONV)
1375])
1376
1377AC_DEFUN([AM_ICONV],
1378[
1379  AM_ICONV_LINK
1380  if test "$am_cv_func_iconv" = yes; then
1381    AC_MSG_CHECKING([for iconv declaration])
1382    AC_CACHE_VAL(am_cv_proto_iconv, [
1383      AC_TRY_COMPILE([
1384#include <stdlib.h>
1385#include <iconv.h>
1386extern
1387#ifdef __cplusplus
1388"C"
1389#endif
1390#if defined(__STDC__) || defined(__cplusplus)
1391size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1392#else
1393size_t iconv();
1394#endif
1395], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1396      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);"])
1397    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1398    AC_MSG_RESULT([$]{ac_t:-
1399         }[$]am_cv_proto_iconv)
1400    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1401      [Define as const if the declaration of iconv() needs const.])
1402  fi
1403])
1404# intdiv0.m4 serial 1 (gettext-0.11.3)
1405dnl Copyright (C) 2002 Free Software Foundation, Inc.
1406dnl This file is free software, distributed under the terms of the GNU
1407dnl General Public License.  As a special exception to the GNU General
1408dnl Public License, this file may be distributed as part of a program
1409dnl that contains a configuration script generated by Autoconf, under
1410dnl the same distribution terms as the rest of that program.
1411
1412dnl From Bruno Haible.
1413
1414AC_DEFUN([gt_INTDIV0],
1415[
1416  AC_REQUIRE([AC_PROG_CC])dnl
1417  AC_REQUIRE([AC_CANONICAL_HOST])dnl
1418
1419  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
1420    gt_cv_int_divbyzero_sigfpe,
1421    [
1422      AC_TRY_RUN([
1423#include <stdlib.h>
1424#include <signal.h>
1425
1426static void
1427#ifdef __cplusplus
1428sigfpe_handler (int sig)
1429#else
1430sigfpe_handler (sig) int sig;
1431#endif
1432{
1433  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
1434  exit (sig != SIGFPE);
1435}
1436
1437int x = 1;
1438int y = 0;
1439int z;
1440int nan;
1441
1442int main ()
1443{
1444  signal (SIGFPE, sigfpe_handler);
1445/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
1446#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
1447  signal (SIGTRAP, sigfpe_handler);
1448#endif
1449/* Linux/SPARC yields signal SIGILL.  */
1450#if defined (__sparc__) && defined (__linux__)
1451  signal (SIGILL, sigfpe_handler);
1452#endif
1453
1454  z = x / y;
1455  nan = y / y;
1456  exit (1);
1457}
1458], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
1459        [
1460          # Guess based on the CPU.
1461          case "$host_cpu" in
1462            alpha* | i[34567]86 | m68k | s390*)
1463              gt_cv_int_divbyzero_sigfpe="guessing yes";;
1464            *)
1465              gt_cv_int_divbyzero_sigfpe="guessing no";;
1466          esac
1467        ])
1468    ])
1469  case "$gt_cv_int_divbyzero_sigfpe" in
1470    *yes) value=1;;
1471    *) value=0;;
1472  esac
1473  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
1474    [Define if integer division by zero raises signal SIGFPE.])
1475])
1476# inttypes-pri.m4 serial 1 (gettext-0.11.4)
1477dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1478dnl This file is free software, distributed under the terms of the GNU
1479dnl General Public License.  As a special exception to the GNU General
1480dnl Public License, this file may be distributed as part of a program
1481dnl that contains a configuration script generated by Autoconf, under
1482dnl the same distribution terms as the rest of that program.
1483
1484dnl From Bruno Haible.
1485
1486# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
1487# macros to non-string values.  This is the case on AIX 4.3.3.
1488
1489AC_DEFUN([gt_INTTYPES_PRI],
1490[
1491  AC_REQUIRE([gt_HEADER_INTTYPES_H])
1492  if test $gt_cv_header_inttypes_h = yes; then
1493    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
1494      gt_cv_inttypes_pri_broken,
1495      [
1496        AC_TRY_COMPILE([#include <inttypes.h>
1497#ifdef PRId32
1498char *p = PRId32;
1499#endif
1500], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
1501      ])
1502  fi
1503  if test "$gt_cv_inttypes_pri_broken" = yes; then
1504    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
1505      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
1506  fi
1507])
1508# inttypes.m4 serial 1 (gettext-0.11.4)
1509dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1510dnl This file is free software, distributed under the terms of the GNU
1511dnl General Public License.  As a special exception to the GNU General
1512dnl Public License, this file may be distributed as part of a program
1513dnl that contains a configuration script generated by Autoconf, under
1514dnl the same distribution terms as the rest of that program.
1515
1516dnl From Paul Eggert.
1517
1518# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
1519# <sys/types.h>.
1520
1521AC_DEFUN([gt_HEADER_INTTYPES_H],
1522[
1523  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
1524  [
1525    AC_TRY_COMPILE(
1526      [#include <sys/types.h>
1527#include <inttypes.h>],
1528      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
1529  ])
1530  if test $gt_cv_header_inttypes_h = yes; then
1531    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
1532      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
1533  fi
1534])
1535# inttypes_h.m4 serial 4 (gettext-0.11.4)
1536dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
1537dnl This file is free software, distributed under the terms of the GNU
1538dnl General Public License.  As a special exception to the GNU General
1539dnl Public License, this file may be distributed as part of a program
1540dnl that contains a configuration script generated by Autoconf, under
1541dnl the same distribution terms as the rest of that program.
1542
1543dnl From Paul Eggert.
1544
1545# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
1546# doesn't clash with <sys/types.h>, and declares uintmax_t.
1547
1548AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
1549[
1550  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
1551  [AC_TRY_COMPILE(
1552    [#include <sys/types.h>
1553#include <inttypes.h>],
1554    [uintmax_t i = (uintmax_t) -1;],
1555    jm_ac_cv_header_inttypes_h=yes,
1556    jm_ac_cv_header_inttypes_h=no)])
1557  if test $jm_ac_cv_header_inttypes_h = yes; then
1558    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
1559[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
1560   and declares uintmax_t. ])
1561  fi
1562])
1563# isc-posix.m4 serial 2 (gettext-0.11.2)
1564dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1565dnl This file is free software, distributed under the terms of the GNU
1566dnl General Public License.  As a special exception to the GNU General
1567dnl Public License, this file may be distributed as part of a program
1568dnl that contains a configuration script generated by Autoconf, under
1569dnl the same distribution terms as the rest of that program.
1570
1571# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
1572
1573# This test replaces the one in autoconf.
1574# Currently this macro should have the same name as the autoconf macro
1575# because gettext's gettext.m4 (distributed in the automake package)
1576# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
1577# give these diagnostics:
1578#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1579#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1580
1581undefine([AC_ISC_POSIX])
1582
1583AC_DEFUN([AC_ISC_POSIX],
1584  [
1585    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1586    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1587  ]
1588)
1589# lcmessage.m4 serial 3 (gettext-0.11.3)
1590dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1591dnl This file is free software, distributed under the terms of the GNU
1592dnl General Public License.  As a special exception to the GNU General
1593dnl Public License, this file may be distributed as part of a program
1594dnl that contains a configuration script generated by Autoconf, under
1595dnl the same distribution terms as the rest of that program.
1596dnl
1597dnl This file can can be used in projects which are not available under
1598dnl the GNU General Public License or the GNU Library General Public
1599dnl License but which still want to provide support for the GNU gettext
1600dnl functionality.
1601dnl Please note that the actual code of the GNU gettext library is covered
1602dnl by the GNU Library General Public License, and the rest of the GNU
1603dnl gettext package package is covered by the GNU General Public License.
1604dnl They are *not* in the public domain.
1605
1606dnl Authors:
1607dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
1608
1609# Check whether LC_MESSAGES is available in <locale.h>.
1610
1611AC_DEFUN([AM_LC_MESSAGES],
1612[
1613  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1614    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1615       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1616  if test $am_cv_val_LC_MESSAGES = yes; then
1617    AC_DEFINE(HAVE_LC_MESSAGES, 1,
1618      [Define if your <locale.h> file defines LC_MESSAGES.])
1619  fi
1620])
1621# lib-ld.m4 serial 1 (gettext-0.11)
1622dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
1623dnl This file is free software, distributed under the terms of the GNU
1624dnl General Public License.  As a special exception to the GNU General
1625dnl Public License, this file may be distributed as part of a program
1626dnl that contains a configuration script generated by Autoconf, under
1627dnl the same distribution terms as the rest of that program.
1628
1629dnl Subroutines of libtool.m4,
1630dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
1631dnl with libtool.m4.
1632
1633dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
1634AC_DEFUN([AC_LIB_PROG_LD_GNU],
1635[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
1636[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1637if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1638  acl_cv_prog_gnu_ld=yes
1639else
1640  acl_cv_prog_gnu_ld=no
1641fi])
1642with_gnu_ld=$acl_cv_prog_gnu_ld
1643])
1644
1645dnl From libtool-1.4. Sets the variable LD.
1646AC_DEFUN([AC_LIB_PROG_LD],
1647[AC_ARG_WITH(gnu-ld,
1648[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
1649test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
1650AC_REQUIRE([AC_PROG_CC])dnl
1651AC_REQUIRE([AC_CANONICAL_HOST])dnl
1652ac_prog=ld
1653if test "$GCC" = yes; then
1654  # Check if gcc -print-prog-name=ld gives a path.
1655  AC_MSG_CHECKING([for ld used by GCC])
1656  case $host in
1657  *-*-mingw*)
1658    # gcc leaves a trailing carriage return which upsets mingw
1659    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
1660  *)
1661    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
1662  esac
1663  case $ac_prog in
1664    # Accept absolute paths.
1665    [[\\/]* | [A-Za-z]:[\\/]*)]
1666      [re_direlt='/[^/][^/]*/\.\./']
1667      # Canonicalize the path of ld
1668      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
1669      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
1670	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
1671      done
1672      test -z "$LD" && LD="$ac_prog"
1673      ;;
1674  "")
1675    # If it fails, then pretend we aren't using GCC.
1676    ac_prog=ld
1677    ;;
1678  *)
1679    # If it is relative, then search for the first ld in PATH.
1680    with_gnu_ld=unknown
1681    ;;
1682  esac
1683elif test "$with_gnu_ld" = yes; then
1684  AC_MSG_CHECKING([for GNU ld])
1685else
1686  AC_MSG_CHECKING([for non-GNU ld])
1687fi
1688AC_CACHE_VAL(acl_cv_path_LD,
1689[if test -z "$LD"; then
1690  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
1691  for ac_dir in $PATH; do
1692    test -z "$ac_dir" && ac_dir=.
1693    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
1694      acl_cv_path_LD="$ac_dir/$ac_prog"
1695      # Check to see if the program is GNU ld.  I'd rather use --version,
1696      # but apparently some GNU ld's only accept -v.
1697      # Break only if it was the GNU/non-GNU ld that we prefer.
1698      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
1699	test "$with_gnu_ld" != no && break
1700      else
1701	test "$with_gnu_ld" != yes && break
1702      fi
1703    fi
1704  done
1705  IFS="$ac_save_ifs"
1706else
1707  acl_cv_path_LD="$LD" # Let the user override the test with a path.
1708fi])
1709LD="$acl_cv_path_LD"
1710if test -n "$LD"; then
1711  AC_MSG_RESULT($LD)
1712else
1713  AC_MSG_RESULT(no)
1714fi
1715test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
1716AC_LIB_PROG_LD_GNU
1717])
1718# lib-link.m4 serial 3 (gettext-0.11.3)
1719dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1720dnl This file is free software, distributed under the terms of the GNU
1721dnl General Public License.  As a special exception to the GNU General
1722dnl Public License, this file may be distributed as part of a program
1723dnl that contains a configuration script generated by Autoconf, under
1724dnl the same distribution terms as the rest of that program.
1725
1726dnl From Bruno Haible.
1727
1728dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1729dnl the libraries corresponding to explicit and implicit dependencies.
1730dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1731dnl augments the CPPFLAGS variable.
1732AC_DEFUN([AC_LIB_LINKFLAGS],
1733[
1734  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1735  AC_REQUIRE([AC_LIB_RPATH])
1736  define([Name],[translit([$1],[./-], [___])])
1737  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1738                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1739  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1740    AC_LIB_LINKFLAGS_BODY([$1], [$2])
1741    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1742    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1743    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1744  ])
1745  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1746  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1747  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1748  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1749  AC_SUBST([LIB]NAME)
1750  AC_SUBST([LTLIB]NAME)
1751  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1752  dnl results of this search when this library appears as a dependency.
1753  HAVE_LIB[]NAME=yes
1754  undefine([Name])
1755  undefine([NAME])
1756])
1757
1758dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1759dnl searches for libname and the libraries corresponding to explicit and
1760dnl implicit dependencies, together with the specified include files and
1761dnl the ability to compile and link the specified testcode. If found, it
1762dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1763dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1764dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1765dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1766AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1767[
1768  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1769  AC_REQUIRE([AC_LIB_RPATH])
1770  define([Name],[translit([$1],[./-], [___])])
1771  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1772                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1773
1774  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1775  dnl accordingly.
1776  AC_LIB_LINKFLAGS_BODY([$1], [$2])
1777
1778  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1779  dnl because if the user has installed lib[]Name and not disabled its use
1780  dnl via --without-lib[]Name-prefix, he wants to use it.
1781  ac_save_CPPFLAGS="$CPPFLAGS"
1782  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1783
1784  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1785    ac_save_LIBS="$LIBS"
1786    LIBS="$LIBS $LIB[]NAME"
1787    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1788    LIBS="$ac_save_LIBS"
1789  ])
1790  if test "$ac_cv_lib[]Name" = yes; then
1791    HAVE_LIB[]NAME=yes
1792    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1793    AC_MSG_CHECKING([how to link with lib[]$1])
1794    AC_MSG_RESULT([$LIB[]NAME])
1795  else
1796    HAVE_LIB[]NAME=no
1797    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1798    dnl $INC[]NAME either.
1799    CPPFLAGS="$ac_save_CPPFLAGS"
1800    LIB[]NAME=
1801    LTLIB[]NAME=
1802  fi
1803  AC_SUBST([HAVE_LIB]NAME)
1804  AC_SUBST([LIB]NAME)
1805  AC_SUBST([LTLIB]NAME)
1806  undefine([Name])
1807  undefine([NAME])
1808])
1809
1810dnl Determine the platform dependent parameters needed to use rpath:
1811dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1812dnl hardcode_direct, hardcode_minus_L,
1813dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1814AC_DEFUN([AC_LIB_RPATH],
1815[
1816  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1817  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1818  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1819  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1820  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1821    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1822    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1823    . ./conftest.sh
1824    rm -f ./conftest.sh
1825    acl_cv_rpath=done
1826  ])
1827  wl="$acl_cv_wl"
1828  libext="$acl_cv_libext"
1829  shlibext="$acl_cv_shlibext"
1830  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1831  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1832  hardcode_direct="$acl_cv_hardcode_direct"
1833  hardcode_minus_L="$acl_cv_hardcode_minus_L"
1834  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1835  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1836  dnl Determine whether the user wants rpath handling at all.
1837  AC_ARG_ENABLE(rpath,
1838    [  --disable-rpath         do not hardcode runtime library paths],
1839    :, enable_rpath=yes)
1840])
1841
1842dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1843dnl the libraries corresponding to explicit and implicit dependencies.
1844dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1845AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1846[
1847  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1848                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1849  dnl By default, look in $includedir and $libdir.
1850  use_additional=yes
1851  AC_LIB_WITH_FINAL_PREFIX([
1852    eval additional_includedir=\"$includedir\"
1853    eval additional_libdir=\"$libdir\"
1854  ])
1855  AC_ARG_WITH([lib$1-prefix],
1856[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1857  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1858[
1859    if test "X$withval" = "Xno"; then
1860      use_additional=no
1861    else
1862      if test "X$withval" = "X"; then
1863        AC_LIB_WITH_FINAL_PREFIX([
1864          eval additional_includedir=\"$includedir\"
1865          eval additional_libdir=\"$libdir\"
1866        ])
1867      else
1868        additional_includedir="$withval/include"
1869        additional_libdir="$withval/lib"
1870      fi
1871    fi
1872])
1873  dnl Search the library and its dependencies in $additional_libdir and
1874  dnl $LDFLAGS. Using breadth-first-seach.
1875  LIB[]NAME=
1876  LTLIB[]NAME=
1877  INC[]NAME=
1878  rpathdirs=
1879  ltrpathdirs=
1880  names_already_handled=
1881  names_next_round='$1 $2'
1882  while test -n "$names_next_round"; do
1883    names_this_round="$names_next_round"
1884    names_next_round=
1885    for name in $names_this_round; do
1886      already_handled=
1887      for n in $names_already_handled; do
1888        if test "$n" = "$name"; then
1889          already_handled=yes
1890          break
1891        fi
1892      done
1893      if test -z "$already_handled"; then
1894        names_already_handled="$names_already_handled $name"
1895        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1896        dnl or AC_LIB_HAVE_LINKFLAGS call.
1897        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1898        eval value=\"\$HAVE_LIB$uppername\"
1899        if test -n "$value"; then
1900          if test "$value" = yes; then
1901            eval value=\"\$LIB$uppername\"
1902            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1903            eval value=\"\$LTLIB$uppername\"
1904            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1905          else
1906            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1907            dnl that this library doesn't exist. So just drop it.
1908            :
1909          fi
1910        else
1911          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1912          dnl and the already constructed $LIBNAME/$LTLIBNAME.
1913          found_dir=
1914          found_la=
1915          found_so=
1916          found_a=
1917          if test $use_additional = yes; then
1918            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1919              found_dir="$additional_libdir"
1920              found_so="$additional_libdir/lib$name.$shlibext"
1921              if test -f "$additional_libdir/lib$name.la"; then
1922                found_la="$additional_libdir/lib$name.la"
1923              fi
1924            else
1925              if test -f "$additional_libdir/lib$name.$libext"; then
1926                found_dir="$additional_libdir"
1927                found_a="$additional_libdir/lib$name.$libext"
1928                if test -f "$additional_libdir/lib$name.la"; then
1929                  found_la="$additional_libdir/lib$name.la"
1930                fi
1931              fi
1932            fi
1933          fi
1934          if test "X$found_dir" = "X"; then
1935            for x in $LDFLAGS $LTLIB[]NAME; do
1936              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1937              case "$x" in
1938                -L*)
1939                  dir=`echo "X$x" | sed -e 's/^X-L//'`
1940                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1941                    found_dir="$dir"
1942                    found_so="$dir/lib$name.$shlibext"
1943                    if test -f "$dir/lib$name.la"; then
1944                      found_la="$dir/lib$name.la"
1945                    fi
1946                  else
1947                    if test -f "$dir/lib$name.$libext"; then
1948                      found_dir="$dir"
1949                      found_a="$dir/lib$name.$libext"
1950                      if test -f "$dir/lib$name.la"; then
1951                        found_la="$dir/lib$name.la"
1952                      fi
1953                    fi
1954                  fi
1955                  ;;
1956              esac
1957              if test "X$found_dir" != "X"; then
1958                break
1959              fi
1960            done
1961          fi
1962          if test "X$found_dir" != "X"; then
1963            dnl Found the library.
1964            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1965            if test "X$found_so" != "X"; then
1966              dnl Linking with a shared library. We attempt to hardcode its
1967              dnl directory into the executable's runpath, unless it's the
1968              dnl standard /usr/lib.
1969              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1970                dnl No hardcoding is needed.
1971                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1972              else
1973                dnl Use an explicit option to hardcode DIR into the resulting
1974                dnl binary.
1975                dnl Potentially add DIR to ltrpathdirs.
1976                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1977                haveit=
1978                for x in $ltrpathdirs; do
1979                  if test "X$x" = "X$found_dir"; then
1980                    haveit=yes
1981                    break
1982                  fi
1983                done
1984                if test -z "$haveit"; then
1985                  ltrpathdirs="$ltrpathdirs $found_dir"
1986                fi
1987                dnl The hardcoding into $LIBNAME is system dependent.
1988                if test "$hardcode_direct" = yes; then
1989                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1990                  dnl resulting binary.
1991                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1992                else
1993                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1994                    dnl Use an explicit option to hardcode DIR into the resulting
1995                    dnl binary.
1996                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1997                    dnl Potentially add DIR to rpathdirs.
1998                    dnl The rpathdirs will be appended to $LIBNAME at the end.
1999                    haveit=
2000                    for x in $rpathdirs; do
2001                      if test "X$x" = "X$found_dir"; then
2002                        haveit=yes
2003                        break
2004                      fi
2005                    done
2006                    if test -z "$haveit"; then
2007                      rpathdirs="$rpathdirs $found_dir"
2008                    fi
2009                  else
2010                    dnl Rely on "-L$found_dir".
2011                    dnl But don't add it if it's already contained in the LDFLAGS
2012                    dnl or the already constructed $LIBNAME
2013                    haveit=
2014                    for x in $LDFLAGS $LIB[]NAME; do
2015                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2016                      if test "X$x" = "X-L$found_dir"; then
2017                        haveit=yes
2018                        break
2019                      fi
2020                    done
2021                    if test -z "$haveit"; then
2022                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2023                    fi
2024                    if test "$hardcode_minus_L" != no; then
2025                      dnl FIXME: Not sure whether we should use
2026                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2027                      dnl here.
2028                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2029                    else
2030                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2031                      dnl here, because this doesn't fit in flags passed to the
2032                      dnl compiler. So give up. No hardcoding. This affects only
2033                      dnl very old systems.
2034                      dnl FIXME: Not sure whether we should use
2035                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2036                      dnl here.
2037                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2038                    fi
2039                  fi
2040                fi
2041              fi
2042            else
2043              if test "X$found_a" != "X"; then
2044                dnl Linking with a static library.
2045                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2046              else
2047                dnl We shouldn't come here, but anyway it's good to have a
2048                dnl fallback.
2049                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2050              fi
2051            fi
2052            dnl Assume the include files are nearby.
2053            additional_includedir=
2054            case "$found_dir" in
2055              */lib | */lib/)
2056                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2057                additional_includedir="$basedir/include"
2058                ;;
2059            esac
2060            if test "X$additional_includedir" != "X"; then
2061              dnl Potentially add $additional_includedir to $INCNAME.
2062              dnl But don't add it
2063              dnl   1. if it's the standard /usr/include,
2064              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
2065              dnl   3. if it's already present in $CPPFLAGS or the already
2066              dnl      constructed $INCNAME,
2067              dnl   4. if it doesn't exist as a directory.
2068              if test "X$additional_includedir" != "X/usr/include"; then
2069                haveit=
2070                if test "X$additional_includedir" = "X/usr/local/include"; then
2071                  if test -n "$GCC"; then
2072                    case $host_os in
2073                      linux*) haveit=yes;;
2074                    esac
2075                  fi
2076                fi
2077                if test -z "$haveit"; then
2078                  for x in $CPPFLAGS $INC[]NAME; do
2079                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2080                    if test "X$x" = "X-I$additional_includedir"; then
2081                      haveit=yes
2082                      break
2083                    fi
2084                  done
2085                  if test -z "$haveit"; then
2086                    if test -d "$additional_includedir"; then
2087                      dnl Really add $additional_includedir to $INCNAME.
2088                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2089                    fi
2090                  fi
2091                fi
2092              fi
2093            fi
2094            dnl Look for dependencies.
2095            if test -n "$found_la"; then
2096              dnl Read the .la file. It defines the variables
2097              dnl dlname, library_names, old_library, dependency_libs, current,
2098              dnl age, revision, installed, dlopen, dlpreopen, libdir.
2099              save_libdir="$libdir"
2100              case "$found_la" in
2101                */* | *\\*) . "$found_la" ;;
2102                *) . "./$found_la" ;;
2103              esac
2104              libdir="$save_libdir"
2105              dnl We use only dependency_libs.
2106              for dep in $dependency_libs; do
2107                case "$dep" in
2108                  -L*)
2109                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2110                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2111                    dnl But don't add it
2112                    dnl   1. if it's the standard /usr/lib,
2113                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
2114                    dnl   3. if it's already present in $LDFLAGS or the already
2115                    dnl      constructed $LIBNAME,
2116                    dnl   4. if it doesn't exist as a directory.
2117                    if test "X$additional_libdir" != "X/usr/lib"; then
2118                      haveit=
2119                      if test "X$additional_libdir" = "X/usr/local/lib"; then
2120                        if test -n "$GCC"; then
2121                          case $host_os in
2122                            linux*) haveit=yes;;
2123                          esac
2124                        fi
2125                      fi
2126                      if test -z "$haveit"; then
2127                        haveit=
2128                        for x in $LDFLAGS $LIB[]NAME; do
2129                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2130                          if test "X$x" = "X-L$additional_libdir"; then
2131                            haveit=yes
2132                            break
2133                          fi
2134                        done
2135                        if test -z "$haveit"; then
2136                          if test -d "$additional_libdir"; then
2137                            dnl Really add $additional_libdir to $LIBNAME.
2138                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2139                          fi
2140                        fi
2141                        haveit=
2142                        for x in $LDFLAGS $LTLIB[]NAME; do
2143                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2144                          if test "X$x" = "X-L$additional_libdir"; then
2145                            haveit=yes
2146                            break
2147                          fi
2148                        done
2149                        if test -z "$haveit"; then
2150                          if test -d "$additional_libdir"; then
2151                            dnl Really add $additional_libdir to $LTLIBNAME.
2152                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2153                          fi
2154                        fi
2155                      fi
2156                    fi
2157                    ;;
2158                  -R*)
2159                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
2160                    if test "$enable_rpath" != no; then
2161                      dnl Potentially add DIR to rpathdirs.
2162                      dnl The rpathdirs will be appended to $LIBNAME at the end.
2163                      haveit=
2164                      for x in $rpathdirs; do
2165                        if test "X$x" = "X$dir"; then
2166                          haveit=yes
2167                          break
2168                        fi
2169                      done
2170                      if test -z "$haveit"; then
2171                        rpathdirs="$rpathdirs $dir"
2172                      fi
2173                      dnl Potentially add DIR to ltrpathdirs.
2174                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2175                      haveit=
2176                      for x in $ltrpathdirs; do
2177                        if test "X$x" = "X$dir"; then
2178                          haveit=yes
2179                          break
2180                        fi
2181                      done
2182                      if test -z "$haveit"; then
2183                        ltrpathdirs="$ltrpathdirs $dir"
2184                      fi
2185                    fi
2186                    ;;
2187                  -l*)
2188                    dnl Handle this in the next round.
2189                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2190                    ;;
2191                  *.la)
2192                    dnl Handle this in the next round. Throw away the .la's
2193                    dnl directory; it is already contained in a preceding -L
2194                    dnl option.
2195                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2196                    ;;
2197                  *)
2198                    dnl Most likely an immediate library name.
2199                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2200                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2201                    ;;
2202                esac
2203              done
2204            fi
2205          else
2206            dnl Didn't find the library; assume it is in the system directories
2207            dnl known to the linker and runtime loader. (All the system
2208            dnl directories known to the linker should also be known to the
2209            dnl runtime loader, otherwise the system is severely misconfigured.)
2210            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2211            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2212          fi
2213        fi
2214      fi
2215    done
2216  done
2217  if test "X$rpathdirs" != "X"; then
2218    if test -n "$hardcode_libdir_separator"; then
2219      dnl Weird platform: only the last -rpath option counts, the user must
2220      dnl pass all path elements in one option. We can arrange that for a
2221      dnl single library, but not when more than one $LIBNAMEs are used.
2222      alldirs=
2223      for found_dir in $rpathdirs; do
2224        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2225      done
2226      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2227      acl_save_libdir="$libdir"
2228      libdir="$alldirs"
2229      eval flag=\"$hardcode_libdir_flag_spec\"
2230      libdir="$acl_save_libdir"
2231      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2232    else
2233      dnl The -rpath options are cumulative.
2234      for found_dir in $rpathdirs; do
2235        acl_save_libdir="$libdir"
2236        libdir="$found_dir"
2237        eval flag=\"$hardcode_libdir_flag_spec\"
2238        libdir="$acl_save_libdir"
2239        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2240      done
2241    fi
2242  fi
2243  if test "X$ltrpathdirs" != "X"; then
2244    dnl When using libtool, the option that works for both libraries and
2245    dnl executables is -R. The -R options are cumulative.
2246    for found_dir in $ltrpathdirs; do
2247      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2248    done
2249  fi
2250])
2251
2252dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2253dnl unless already present in VAR.
2254dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2255dnl contains two or three consecutive elements that belong together.
2256AC_DEFUN([AC_LIB_APPENDTOVAR],
2257[
2258  for element in [$2]; do
2259    haveit=
2260    for x in $[$1]; do
2261      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2262      if test "X$x" = "X$element"; then
2263        haveit=yes
2264        break
2265      fi
2266    done
2267    if test -z "$haveit"; then
2268      [$1]="${[$1]}${[$1]:+ }$element"
2269    fi
2270  done
2271])
2272# lib-prefix.m4 serial 1 (gettext-0.11)
2273dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2274dnl This file is free software, distributed under the terms of the GNU
2275dnl General Public License.  As a special exception to the GNU General
2276dnl Public License, this file may be distributed as part of a program
2277dnl that contains a configuration script generated by Autoconf, under
2278dnl the same distribution terms as the rest of that program.
2279
2280dnl From Bruno Haible.
2281
2282dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2283dnl to access previously installed libraries. The basic assumption is that
2284dnl a user will want packages to use other packages he previously installed
2285dnl with the same --prefix option.
2286dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2287dnl libraries, but is otherwise very convenient.
2288AC_DEFUN([AC_LIB_PREFIX],
2289[
2290  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2291  AC_REQUIRE([AC_PROG_CC])
2292  AC_REQUIRE([AC_CANONICAL_HOST])
2293  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2294  dnl By default, look in $includedir and $libdir.
2295  use_additional=yes
2296  AC_LIB_WITH_FINAL_PREFIX([
2297    eval additional_includedir=\"$includedir\"
2298    eval additional_libdir=\"$libdir\"
2299  ])
2300  AC_ARG_WITH([lib-prefix],
2301[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2302  --without-lib-prefix    don't search for libraries in includedir and libdir],
2303[
2304    if test "X$withval" = "Xno"; then
2305      use_additional=no
2306    else
2307      if test "X$withval" = "X"; then
2308        AC_LIB_WITH_FINAL_PREFIX([
2309          eval additional_includedir=\"$includedir\"
2310          eval additional_libdir=\"$libdir\"
2311        ])
2312      else
2313        additional_includedir="$withval/include"
2314        additional_libdir="$withval/lib"
2315      fi
2316    fi
2317])
2318  if test $use_additional = yes; then
2319    dnl Potentially add $additional_includedir to $CPPFLAGS.
2320    dnl But don't add it
2321    dnl   1. if it's the standard /usr/include,
2322    dnl   2. if it's already present in $CPPFLAGS,
2323    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
2324    dnl   4. if it doesn't exist as a directory.
2325    if test "X$additional_includedir" != "X/usr/include"; then
2326      haveit=
2327      for x in $CPPFLAGS; do
2328        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2329        if test "X$x" = "X-I$additional_includedir"; then
2330          haveit=yes
2331          break
2332        fi
2333      done
2334      if test -z "$haveit"; then
2335        if test "X$additional_includedir" = "X/usr/local/include"; then
2336          if test -n "$GCC"; then
2337            case $host_os in
2338              linux*) haveit=yes;;
2339            esac
2340          fi
2341        fi
2342        if test -z "$haveit"; then
2343          if test -d "$additional_includedir"; then
2344            dnl Really add $additional_includedir to $CPPFLAGS.
2345            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2346          fi
2347        fi
2348      fi
2349    fi
2350    dnl Potentially add $additional_libdir to $LDFLAGS.
2351    dnl But don't add it
2352    dnl   1. if it's the standard /usr/lib,
2353    dnl   2. if it's already present in $LDFLAGS,
2354    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
2355    dnl   4. if it doesn't exist as a directory.
2356    if test "X$additional_libdir" != "X/usr/lib"; then
2357      haveit=
2358      for x in $LDFLAGS; do
2359        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2360        if test "X$x" = "X-L$additional_libdir"; then
2361          haveit=yes
2362          break
2363        fi
2364      done
2365      if test -z "$haveit"; then
2366        if test "X$additional_libdir" = "X/usr/local/lib"; then
2367          if test -n "$GCC"; then
2368            case $host_os in
2369              linux*) haveit=yes;;
2370            esac
2371          fi
2372        fi
2373        if test -z "$haveit"; then
2374          if test -d "$additional_libdir"; then
2375            dnl Really add $additional_libdir to $LDFLAGS.
2376            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2377          fi
2378        fi
2379      fi
2380    fi
2381  fi
2382])
2383
2384dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2385dnl acl_final_exec_prefix, containing the values to which $prefix and
2386dnl $exec_prefix will expand at the end of the configure script.
2387AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2388[
2389  dnl Unfortunately, prefix and exec_prefix get only finally determined
2390  dnl at the end of configure.
2391  if test "X$prefix" = "XNONE"; then
2392    acl_final_prefix="$ac_default_prefix"
2393  else
2394    acl_final_prefix="$prefix"
2395  fi
2396  if test "X$exec_prefix" = "XNONE"; then
2397    acl_final_exec_prefix='${prefix}'
2398  else
2399    acl_final_exec_prefix="$exec_prefix"
2400  fi
2401  acl_save_prefix="$prefix"
2402  prefix="$acl_final_prefix"
2403  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2404  prefix="$acl_save_prefix"
2405])
2406
2407dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2408dnl variables prefix and exec_prefix bound to the values they will have
2409dnl at the end of the configure script.
2410AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2411[
2412  acl_save_prefix="$prefix"
2413  prefix="$acl_final_prefix"
2414  acl_save_exec_prefix="$exec_prefix"
2415  exec_prefix="$acl_final_exec_prefix"
2416  $1
2417  exec_prefix="$acl_save_exec_prefix"
2418  prefix="$acl_save_prefix"
2419])
2420# progtest.m4 serial 2 (gettext-0.10.40)
2421dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2422dnl This file is free software, distributed under the terms of the GNU
2423dnl General Public License.  As a special exception to the GNU General
2424dnl Public License, this file may be distributed as part of a program
2425dnl that contains a configuration script generated by Autoconf, under
2426dnl the same distribution terms as the rest of that program.
2427dnl
2428dnl This file can can be used in projects which are not available under
2429dnl the GNU General Public License or the GNU Library General Public
2430dnl License but which still want to provide support for the GNU gettext
2431dnl functionality.
2432dnl Please note that the actual code of the GNU gettext library is covered
2433dnl by the GNU Library General Public License, and the rest of the GNU
2434dnl gettext package package is covered by the GNU General Public License.
2435dnl They are *not* in the public domain.
2436
2437dnl Authors:
2438dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2439
2440# Search path for a program which passes the given test.
2441
2442dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2443dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2444AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2445[# Extract the first word of "$2", so it can be a program name with args.
2446set dummy $2; ac_word=[$]2
2447AC_MSG_CHECKING([for $ac_word])
2448AC_CACHE_VAL(ac_cv_path_$1,
2449[case "[$]$1" in
2450  /*)
2451  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2452  ;;
2453  *)
2454  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2455  for ac_dir in ifelse([$5], , $PATH, [$5]); do
2456    test -z "$ac_dir" && ac_dir=.
2457    if test -f $ac_dir/$ac_word; then
2458      if [$3]; then
2459	ac_cv_path_$1="$ac_dir/$ac_word"
2460	break
2461      fi
2462    fi
2463  done
2464  IFS="$ac_save_ifs"
2465dnl If no 4th arg is given, leave the cache variable unset,
2466dnl so AC_PATH_PROGS will keep looking.
2467ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2468])dnl
2469  ;;
2470esac])dnl
2471$1="$ac_cv_path_$1"
2472if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2473  AC_MSG_RESULT([$]$1)
2474else
2475  AC_MSG_RESULT(no)
2476fi
2477AC_SUBST($1)dnl
2478])
2479# stdint_h.m4 serial 2 (gettext-0.11.4)
2480dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2481dnl This file is free software, distributed under the terms of the GNU
2482dnl General Public License.  As a special exception to the GNU General
2483dnl Public License, this file may be distributed as part of a program
2484dnl that contains a configuration script generated by Autoconf, under
2485dnl the same distribution terms as the rest of that program.
2486
2487dnl From Paul Eggert.
2488
2489# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2490# doesn't clash with <sys/types.h>, and declares uintmax_t.
2491
2492AC_DEFUN([jm_AC_HEADER_STDINT_H],
2493[
2494  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2495  [AC_TRY_COMPILE(
2496    [#include <sys/types.h>
2497#include <stdint.h>],
2498    [uintmax_t i = (uintmax_t) -1;],
2499    jm_ac_cv_header_stdint_h=yes,
2500    jm_ac_cv_header_stdint_h=no)])
2501  if test $jm_ac_cv_header_stdint_h = yes; then
2502    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2503[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2504   and declares uintmax_t. ])
2505  fi
2506])
2507# uintmax_t.m4 serial 6 (gettext-0.11)
2508dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2509dnl This file is free software, distributed under the terms of the GNU
2510dnl General Public License.  As a special exception to the GNU General
2511dnl Public License, this file may be distributed as part of a program
2512dnl that contains a configuration script generated by Autoconf, under
2513dnl the same distribution terms as the rest of that program.
2514
2515dnl From Paul Eggert.
2516
2517AC_PREREQ(2.13)
2518
2519# Define uintmax_t to `unsigned long' or `unsigned long long'
2520# if <inttypes.h> does not exist.
2521
2522AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2523[
2524  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2525  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2526  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2527    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2528    test $ac_cv_type_unsigned_long_long = yes \
2529      && ac_type='unsigned long long' \
2530      || ac_type='unsigned long'
2531    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2532  [Define to unsigned long or unsigned long long
2533   if <inttypes.h> and <stdint.h> don't define.])
2534  fi
2535])
2536# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2537dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2538dnl This file is free software, distributed under the terms of the GNU
2539dnl General Public License.  As a special exception to the GNU General
2540dnl Public License, this file may be distributed as part of a program
2541dnl that contains a configuration script generated by Autoconf, under
2542dnl the same distribution terms as the rest of that program.
2543
2544dnl From Paul Eggert.
2545
2546AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2547[
2548  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2549  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2550    [unsigned long long ullmax = (unsigned long long) -1;
2551     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2552    ac_cv_type_unsigned_long_long=yes,
2553    ac_cv_type_unsigned_long_long=no)])
2554  if test $ac_cv_type_unsigned_long_long = yes; then
2555    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2556      [Define if you have the unsigned long long type.])
2557  fi
2558])
2559
2560dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
2561dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
2562dnl also defines GSTUFF_PKG_ERRORS on error
2563AC_DEFUN(PKG_CHECK_MODULES, [
2564  succeeded=no
2565
2566  if test -z "$PKG_CONFIG"; then
2567    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
2568  fi
2569
2570  if test "$PKG_CONFIG" = "no" ; then
2571     echo "*** The pkg-config script could not be found. Make sure it is"
2572     echo "*** in your path, or set the PKG_CONFIG environment variable"
2573     echo "*** to the full path to pkg-config."
2574     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
2575  else
2576     PKG_CONFIG_MIN_VERSION=0.9.0
2577     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
2578        AC_MSG_CHECKING(for $2)
2579
2580        if $PKG_CONFIG --exists "$2" ; then
2581            AC_MSG_RESULT(yes)
2582            succeeded=yes
2583
2584            AC_MSG_CHECKING($1_CFLAGS)
2585            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
2586            AC_MSG_RESULT($$1_CFLAGS)
2587
2588            AC_MSG_CHECKING($1_LIBS)
2589            $1_LIBS=`$PKG_CONFIG --libs "$2"`
2590            AC_MSG_RESULT($$1_LIBS)
2591        else
2592            $1_CFLAGS=""
2593            $1_LIBS=""
2594            ## If we have a custom action on failure, don't print errors, but
2595            ## do set a variable so people can do so.
2596            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
2597            ifelse([$4], ,echo $$1_PKG_ERRORS,)
2598        fi
2599
2600        AC_SUBST($1_CFLAGS)
2601        AC_SUBST($1_LIBS)
2602     else
2603        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
2604        echo "*** See http://www.freedesktop.org/software/pkgconfig"
2605     fi
2606  fi
2607
2608  if test $succeeded = yes; then
2609     ifelse([$3], , :, [$3])
2610  else
2611     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])
2612  fi
2613])
2614
2615