1# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005  Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# Configure paths for GLIB
15# Owen Taylor     1997-2001
16
17dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
18dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
19dnl gthread is specified in MODULES, pass to pkg-config
20dnl
21AC_DEFUN([AM_PATH_GLIB_2_0],
22[dnl
23dnl Get the cflags and libraries from pkg-config
24dnl
25AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
26		    , enable_glibtest=yes)
27
28  pkg_config_args=glib-2.0
29  for module in . $4
30  do
31      case "$module" in
32         gmodule)
33             pkg_config_args="$pkg_config_args gmodule-2.0"
34         ;;
35         gmodule-no-export)
36             pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
37         ;;
38         gobject)
39             pkg_config_args="$pkg_config_args gobject-2.0"
40         ;;
41         gthread)
42             pkg_config_args="$pkg_config_args gthread-2.0"
43         ;;
44      esac
45  done
46
47  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
48
49  no_glib=""
50
51  if test x$PKG_CONFIG != xno ; then
52    if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
53      :
54    else
55      echo *** pkg-config too old; version 0.7 or better required.
56      no_glib=yes
57      PKG_CONFIG=no
58    fi
59  else
60    no_glib=yes
61  fi
62
63  min_glib_version=ifelse([$1], ,2.0.0,$1)
64  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
65
66  if test x$PKG_CONFIG != xno ; then
67    ## don't try to run the test against uninstalled libtool libs
68    if $PKG_CONFIG --uninstalled $pkg_config_args; then
69	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
70	  enable_glibtest=no
71    fi
72
73    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
74	  :
75    else
76	  no_glib=yes
77    fi
78  fi
79
80  if test x"$no_glib" = x ; then
81    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
82    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
83    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
84
85    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
86    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
87    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
88           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
89    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
90           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
91    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
92           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
93    if test "x$enable_glibtest" = "xyes" ; then
94      ac_save_CFLAGS="$CFLAGS"
95      ac_save_LIBS="$LIBS"
96      CFLAGS="$CFLAGS $GLIB_CFLAGS"
97      LIBS="$GLIB_LIBS $LIBS"
98dnl
99dnl Now check if the installed GLIB is sufficiently new. (Also sanity
100dnl checks the results of pkg-config to some extent)
101dnl
102      rm -f conf.glibtest
103      AC_TRY_RUN([
104#include <glib.h>
105#include <stdio.h>
106#include <stdlib.h>
107
108int
109main ()
110{
111  int major, minor, micro;
112  char *tmp_version;
113
114  system ("touch conf.glibtest");
115
116  /* HP/UX 9 (%@#!) writes to sscanf strings */
117  tmp_version = g_strdup("$min_glib_version");
118  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
119     printf("%s, bad version string\n", "$min_glib_version");
120     exit(1);
121   }
122
123  if ((glib_major_version != $glib_config_major_version) ||
124      (glib_minor_version != $glib_config_minor_version) ||
125      (glib_micro_version != $glib_config_micro_version))
126    {
127      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
128             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
129             glib_major_version, glib_minor_version, glib_micro_version);
130      printf ("*** was found! If pkg-config was correct, then it is best\n");
131      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
132      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
133      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
134      printf("*** required on your system.\n");
135      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
136      printf("*** to point to the correct configuration files\n");
137    }
138  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
139	   (glib_minor_version != GLIB_MINOR_VERSION) ||
140           (glib_micro_version != GLIB_MICRO_VERSION))
141    {
142      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
143	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
144      printf("*** library (version %d.%d.%d)\n",
145	     glib_major_version, glib_minor_version, glib_micro_version);
146    }
147  else
148    {
149      if ((glib_major_version > major) ||
150        ((glib_major_version == major) && (glib_minor_version > minor)) ||
151        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
152      {
153        return 0;
154       }
155     else
156      {
157        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
158               glib_major_version, glib_minor_version, glib_micro_version);
159        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
160	       major, minor, micro);
161        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
162        printf("***\n");
163        printf("*** If you have already installed a sufficiently new version, this error\n");
164        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
165        printf("*** being found. The easiest way to fix this is to remove the old version\n");
166        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
167        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
168        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
169        printf("*** so that the correct libraries are found at run-time))\n");
170      }
171    }
172  return 1;
173}
174],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
175       CFLAGS="$ac_save_CFLAGS"
176       LIBS="$ac_save_LIBS"
177     fi
178  fi
179  if test "x$no_glib" = x ; then
180     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
181     ifelse([$2], , :, [$2])
182  else
183     AC_MSG_RESULT(no)
184     if test "$PKG_CONFIG" = "no" ; then
185       echo "*** A new enough version of pkg-config was not found."
186       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
187     else
188       if test -f conf.glibtest ; then
189        :
190       else
191          echo "*** Could not run GLIB test program, checking why..."
192          ac_save_CFLAGS="$CFLAGS"
193          ac_save_LIBS="$LIBS"
194          CFLAGS="$CFLAGS $GLIB_CFLAGS"
195          LIBS="$LIBS $GLIB_LIBS"
196          AC_TRY_LINK([
197#include <glib.h>
198#include <stdio.h>
199],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
200        [ echo "*** The test program compiled, but did not run. This usually means"
201          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
202          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
203          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
204          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
205          echo "*** is required on your system"
206	  echo "***"
207          echo "*** If you have an old version installed, it is best to remove it, although"
208          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
209        [ echo "*** The test program failed to compile or link. See the file config.log for the"
210          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
211          CFLAGS="$ac_save_CFLAGS"
212          LIBS="$ac_save_LIBS"
213       fi
214     fi
215     GLIB_CFLAGS=""
216     GLIB_LIBS=""
217     GLIB_GENMARSHAL=""
218     GOBJECT_QUERY=""
219     GLIB_MKENUMS=""
220     ifelse([$3], , :, [$3])
221  fi
222  AC_SUBST(GLIB_CFLAGS)
223  AC_SUBST(GLIB_LIBS)
224  AC_SUBST(GLIB_GENMARSHAL)
225  AC_SUBST(GOBJECT_QUERY)
226  AC_SUBST(GLIB_MKENUMS)
227  rm -f conf.glibtest
228])
229
230# Configure paths for GTK+
231# Owen Taylor     1997-2001
232
233dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
234dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
235dnl pass to pkg-config
236dnl
237AC_DEFUN([AM_PATH_GTK_2_0],
238[dnl
239dnl Get the cflags and libraries from pkg-config
240dnl
241AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
242		    , enable_gtktest=yes)
243
244  pkg_config_args=gtk+-2.0
245  for module in . $4
246  do
247      case "$module" in
248         gthread)
249             pkg_config_args="$pkg_config_args gthread-2.0"
250         ;;
251      esac
252  done
253
254  no_gtk=""
255
256  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
257
258  if test x$PKG_CONFIG != xno ; then
259    if pkg-config --atleast-pkgconfig-version 0.7 ; then
260      :
261    else
262      echo "*** pkg-config too old; version 0.7 or better required."
263      no_gtk=yes
264      PKG_CONFIG=no
265    fi
266  else
267    no_gtk=yes
268  fi
269
270  min_gtk_version=ifelse([$1], ,2.0.0,$1)
271  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
272
273  if test x$PKG_CONFIG != xno ; then
274    ## don't try to run the test against uninstalled libtool libs
275    if $PKG_CONFIG --uninstalled $pkg_config_args; then
276	  echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
277	  enable_gtktest=no
278    fi
279
280    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
281	  :
282    else
283	  no_gtk=yes
284    fi
285  fi
286
287  if test x"$no_gtk" = x ; then
288    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
289    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
290    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
291           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
292    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
293           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
294    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
295           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
296    if test "x$enable_gtktest" = "xyes" ; then
297      ac_save_CFLAGS="$CFLAGS"
298      ac_save_LIBS="$LIBS"
299      CFLAGS="$CFLAGS $GTK_CFLAGS"
300      LIBS="$GTK_LIBS $LIBS"
301dnl
302dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
303dnl checks the results of pkg-config to some extent)
304dnl
305      rm -f conf.gtktest
306      AC_TRY_RUN([
307#include <gtk/gtk.h>
308#include <stdio.h>
309#include <stdlib.h>
310
311int
312main ()
313{
314  int major, minor, micro;
315  char *tmp_version;
316
317  system ("touch conf.gtktest");
318
319  /* HP/UX 9 (%@#!) writes to sscanf strings */
320  tmp_version = g_strdup("$min_gtk_version");
321  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
322     printf("%s, bad version string\n", "$min_gtk_version");
323     exit(1);
324   }
325
326  if ((gtk_major_version != $gtk_config_major_version) ||
327      (gtk_minor_version != $gtk_config_minor_version) ||
328      (gtk_micro_version != $gtk_config_micro_version))
329    {
330      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
331             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
332             gtk_major_version, gtk_minor_version, gtk_micro_version);
333      printf ("*** was found! If pkg-config was correct, then it is best\n");
334      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
335      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
336      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
337      printf("*** required on your system.\n");
338      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
339      printf("*** to point to the correct configuration files\n");
340    }
341  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
342	   (gtk_minor_version != GTK_MINOR_VERSION) ||
343           (gtk_micro_version != GTK_MICRO_VERSION))
344    {
345      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
346	     GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
347      printf("*** library (version %d.%d.%d)\n",
348	     gtk_major_version, gtk_minor_version, gtk_micro_version);
349    }
350  else
351    {
352      if ((gtk_major_version > major) ||
353        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
354        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
355      {
356        return 0;
357       }
358     else
359      {
360        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
361               gtk_major_version, gtk_minor_version, gtk_micro_version);
362        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
363	       major, minor, micro);
364        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
365        printf("***\n");
366        printf("*** If you have already installed a sufficiently new version, this error\n");
367        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
368        printf("*** being found. The easiest way to fix this is to remove the old version\n");
369        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
370        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
371        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
372        printf("*** so that the correct libraries are found at run-time))\n");
373      }
374    }
375  return 1;
376}
377],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
378       CFLAGS="$ac_save_CFLAGS"
379       LIBS="$ac_save_LIBS"
380     fi
381  fi
382  if test "x$no_gtk" = x ; then
383     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
384     ifelse([$2], , :, [$2])
385  else
386     AC_MSG_RESULT(no)
387     if test "$PKG_CONFIG" = "no" ; then
388       echo "*** A new enough version of pkg-config was not found."
389       echo "*** See http://pkgconfig.sourceforge.net"
390     else
391       if test -f conf.gtktest ; then
392        :
393       else
394          echo "*** Could not run GTK+ test program, checking why..."
395	  ac_save_CFLAGS="$CFLAGS"
396	  ac_save_LIBS="$LIBS"
397          CFLAGS="$CFLAGS $GTK_CFLAGS"
398          LIBS="$LIBS $GTK_LIBS"
399          AC_TRY_LINK([
400#include <gtk/gtk.h>
401#include <stdio.h>
402],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
403        [ echo "*** The test program compiled, but did not run. This usually means"
404          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
405          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
406          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
407          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
408          echo "*** is required on your system"
409	  echo "***"
410          echo "*** If you have an old version installed, it is best to remove it, although"
411          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
412        [ echo "*** The test program failed to compile or link. See the file config.log for the"
413          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
414          CFLAGS="$ac_save_CFLAGS"
415          LIBS="$ac_save_LIBS"
416       fi
417     fi
418     GTK_CFLAGS=""
419     GTK_LIBS=""
420     ifelse([$3], , :, [$3])
421  fi
422  AC_SUBST(GTK_CFLAGS)
423  AC_SUBST(GTK_LIBS)
424  rm -f conf.gtktest
425])
426
427dnl @synopsis LIB_SOCKET_NSL
428dnl
429dnl This macro figures out what libraries are required on this platform
430dnl to link sockets programs.
431dnl
432dnl The common cases are not to need any extra libraries, or to need
433dnl -lsocket and -lnsl. We need to avoid linking with libnsl unless we
434dnl need it, though, since on some OSes where it isn't necessary it
435dnl will totally break networking. Unisys also includes gethostbyname()
436dnl in libsocket but needs libnsl for socket().
437dnl
438dnl @category Misc
439dnl @author Russ Allbery <rra@stanford.edu>
440dnl @author Stepan Kasal <kasal@ucw.cz>
441dnl @author Warren Young <warren@etr-usa.com>
442dnl @version 2005-09-06
443
444AC_DEFUN([LIB_SOCKET_NSL],
445[
446	AC_SEARCH_LIBS([gethostbyname], [nsl])
447	AC_SEARCH_LIBS([socket], [socket], [], [
448		AC_CHECK_LIB([socket], [socket], [LIBS="-lsocket -lnsl $LIBS"],
449		[], [-lnsl])])
450])
451
452dnl @synopsis TYPE_SOCKLEN_T
453dnl
454dnl Check whether sys/socket.h defines type socklen_t. Please note that
455dnl some systems require sys/types.h to be included before sys/socket.h
456dnl can be compiled.
457dnl
458dnl @category Misc
459dnl @author Lars Brinkhoff <lars@nocrew.org>
460dnl @version 2005-01-11
461dnl @license GPLWithACException
462
463AC_DEFUN([TYPE_SOCKLEN_T],
464[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
465[
466  AC_TRY_COMPILE(
467  [#include <sys/types.h>
468   #include <sys/socket.h>],
469  [socklen_t len = 42; return 0;],
470  ac_cv_type_socklen_t=yes,
471  ac_cv_type_socklen_t=no)
472])
473  if test $ac_cv_type_socklen_t != yes; then
474    AC_DEFINE(socklen_t, int, [Substitute for socklen_t])
475  fi
476])
477
478# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
479#
480# This file is free software; the Free Software Foundation
481# gives unlimited permission to copy and/or distribute it,
482# with or without modifications, as long as this notice is preserved.
483
484# AM_AUTOMAKE_VERSION(VERSION)
485# ----------------------------
486# Automake X.Y traces this macro to ensure aclocal.m4 has been
487# generated from the m4 files accompanying Automake X.Y.
488AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
489
490# AM_SET_CURRENT_AUTOMAKE_VERSION
491# -------------------------------
492# Call AM_AUTOMAKE_VERSION so it can be traced.
493# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
494AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
495	 [AM_AUTOMAKE_VERSION([1.9.6])])
496
497# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
498
499# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
500#
501# This file is free software; the Free Software Foundation
502# gives unlimited permission to copy and/or distribute it,
503# with or without modifications, as long as this notice is preserved.
504
505# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
506# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
507# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
508#
509# Of course, Automake must honor this variable whenever it calls a
510# tool from the auxiliary directory.  The problem is that $srcdir (and
511# therefore $ac_aux_dir as well) can be either absolute or relative,
512# depending on how configure is run.  This is pretty annoying, since
513# it makes $ac_aux_dir quite unusable in subdirectories: in the top
514# source directory, any form will work fine, but in subdirectories a
515# relative path needs to be adjusted first.
516#
517# $ac_aux_dir/missing
518#    fails when called from a subdirectory if $ac_aux_dir is relative
519# $top_srcdir/$ac_aux_dir/missing
520#    fails if $ac_aux_dir is absolute,
521#    fails when called from a subdirectory in a VPATH build with
522#          a relative $ac_aux_dir
523#
524# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
525# are both prefixed by $srcdir.  In an in-source build this is usually
526# harmless because $srcdir is `.', but things will broke when you
527# start a VPATH build or use an absolute $srcdir.
528#
529# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
530# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
531#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
532# and then we would define $MISSING as
533#   MISSING="\${SHELL} $am_aux_dir/missing"
534# This will work as long as MISSING is not called from configure, because
535# unfortunately $(top_srcdir) has no meaning in configure.
536# However there are other variables, like CC, which are often used in
537# configure, and could therefore not use this "fixed" $ac_aux_dir.
538#
539# Another solution, used here, is to always expand $ac_aux_dir to an
540# absolute PATH.  The drawback is that using absolute paths prevent a
541# configured tree to be moved without reconfiguration.
542
543AC_DEFUN([AM_AUX_DIR_EXPAND],
544[dnl Rely on autoconf to set up CDPATH properly.
545AC_PREREQ([2.50])dnl
546# expand $ac_aux_dir to an absolute path
547am_aux_dir=`cd $ac_aux_dir && pwd`
548])
549
550# AM_CONDITIONAL                                            -*- Autoconf -*-
551
552# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
553# Free Software Foundation, Inc.
554#
555# This file is free software; the Free Software Foundation
556# gives unlimited permission to copy and/or distribute it,
557# with or without modifications, as long as this notice is preserved.
558
559# serial 7
560
561# AM_CONDITIONAL(NAME, SHELL-CONDITION)
562# -------------------------------------
563# Define a conditional.
564AC_DEFUN([AM_CONDITIONAL],
565[AC_PREREQ(2.52)dnl
566 ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
567	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
568AC_SUBST([$1_TRUE])
569AC_SUBST([$1_FALSE])
570if $2; then
571  $1_TRUE=
572  $1_FALSE='#'
573else
574  $1_TRUE='#'
575  $1_FALSE=
576fi
577AC_CONFIG_COMMANDS_PRE(
578[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
579  AC_MSG_ERROR([[conditional "$1" was never defined.
580Usually this means the macro was only invoked conditionally.]])
581fi])])
582
583
584# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
585# Free Software Foundation, Inc.
586#
587# This file is free software; the Free Software Foundation
588# gives unlimited permission to copy and/or distribute it,
589# with or without modifications, as long as this notice is preserved.
590
591# serial 8
592
593# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
594# written in clear, in which case automake, when reading aclocal.m4,
595# will think it sees a *use*, and therefore will trigger all it's
596# C support machinery.  Also note that it means that autoscan, seeing
597# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
598
599
600# _AM_DEPENDENCIES(NAME)
601# ----------------------
602# See how the compiler implements dependency checking.
603# NAME is "CC", "CXX", "GCJ", or "OBJC".
604# We try a few techniques and use that to set a single cache variable.
605#
606# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
607# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
608# dependency, and given that the user is not expected to run this macro,
609# just rely on AC_PROG_CC.
610AC_DEFUN([_AM_DEPENDENCIES],
611[AC_REQUIRE([AM_SET_DEPDIR])dnl
612AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
613AC_REQUIRE([AM_MAKE_INCLUDE])dnl
614AC_REQUIRE([AM_DEP_TRACK])dnl
615
616ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
617       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
618       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
619       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
620                   [depcc="$$1"   am_compiler_list=])
621
622AC_CACHE_CHECK([dependency style of $depcc],
623               [am_cv_$1_dependencies_compiler_type],
624[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
625  # We make a subdir and do the tests there.  Otherwise we can end up
626  # making bogus files that we don't know about and never remove.  For
627  # instance it was reported that on HP-UX the gcc test will end up
628  # making a dummy file named `D' -- because `-MD' means `put the output
629  # in D'.
630  mkdir conftest.dir
631  # Copy depcomp to subdir because otherwise we won't find it if we're
632  # using a relative directory.
633  cp "$am_depcomp" conftest.dir
634  cd conftest.dir
635  # We will build objects and dependencies in a subdirectory because
636  # it helps to detect inapplicable dependency modes.  For instance
637  # both Tru64's cc and ICC support -MD to output dependencies as a
638  # side effect of compilation, but ICC will put the dependencies in
639  # the current directory while Tru64 will put them in the object
640  # directory.
641  mkdir sub
642
643  am_cv_$1_dependencies_compiler_type=none
644  if test "$am_compiler_list" = ""; then
645     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
646  fi
647  for depmode in $am_compiler_list; do
648    # Setup a source with many dependencies, because some compilers
649    # like to wrap large dependency lists on column 80 (with \), and
650    # we should not choose a depcomp mode which is confused by this.
651    #
652    # We need to recreate these files for each test, as the compiler may
653    # overwrite some of them when testing with obscure command lines.
654    # This happens at least with the AIX C compiler.
655    : > sub/conftest.c
656    for i in 1 2 3 4 5 6; do
657      echo '#include "conftst'$i'.h"' >> sub/conftest.c
658      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
659      # Solaris 8's {/usr,}/bin/sh.
660      touch sub/conftst$i.h
661    done
662    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
663
664    case $depmode in
665    nosideeffect)
666      # after this tag, mechanisms are not by side-effect, so they'll
667      # only be used when explicitly requested
668      if test "x$enable_dependency_tracking" = xyes; then
669	continue
670      else
671	break
672      fi
673      ;;
674    none) break ;;
675    esac
676    # We check with `-c' and `-o' for the sake of the "dashmstdout"
677    # mode.  It turns out that the SunPro C++ compiler does not properly
678    # handle `-M -o', and we need to detect this.
679    if depmode=$depmode \
680       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
681       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
682       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
683         >/dev/null 2>conftest.err &&
684       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
685       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
686       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
687      # icc doesn't choke on unknown options, it will just issue warnings
688      # or remarks (even with -Werror).  So we grep stderr for any message
689      # that says an option was ignored or not supported.
690      # When given -MP, icc 7.0 and 7.1 complain thusly:
691      #   icc: Command line warning: ignoring option '-M'; no argument required
692      # The diagnosis changed in icc 8.0:
693      #   icc: Command line remark: option '-MP' not supported
694      if (grep 'ignoring option' conftest.err ||
695          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
696        am_cv_$1_dependencies_compiler_type=$depmode
697        break
698      fi
699    fi
700  done
701
702  cd ..
703  rm -rf conftest.dir
704else
705  am_cv_$1_dependencies_compiler_type=none
706fi
707])
708AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
709AM_CONDITIONAL([am__fastdep$1], [
710  test "x$enable_dependency_tracking" != xno \
711  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
712])
713
714
715# AM_SET_DEPDIR
716# -------------
717# Choose a directory name for dependency files.
718# This macro is AC_REQUIREd in _AM_DEPENDENCIES
719AC_DEFUN([AM_SET_DEPDIR],
720[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
721AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
722])
723
724
725# AM_DEP_TRACK
726# ------------
727AC_DEFUN([AM_DEP_TRACK],
728[AC_ARG_ENABLE(dependency-tracking,
729[  --disable-dependency-tracking  speeds up one-time build
730  --enable-dependency-tracking   do not reject slow dependency extractors])
731if test "x$enable_dependency_tracking" != xno; then
732  am_depcomp="$ac_aux_dir/depcomp"
733  AMDEPBACKSLASH='\'
734fi
735AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
736AC_SUBST([AMDEPBACKSLASH])
737])
738
739# Generate code to set up dependency tracking.              -*- Autoconf -*-
740
741# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
742# Free Software Foundation, Inc.
743#
744# This file is free software; the Free Software Foundation
745# gives unlimited permission to copy and/or distribute it,
746# with or without modifications, as long as this notice is preserved.
747
748#serial 3
749
750# _AM_OUTPUT_DEPENDENCY_COMMANDS
751# ------------------------------
752AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
753[for mf in $CONFIG_FILES; do
754  # Strip MF so we end up with the name of the file.
755  mf=`echo "$mf" | sed -e 's/:.*$//'`
756  # Check whether this is an Automake generated Makefile or not.
757  # We used to match only the files named `Makefile.in', but
758  # some people rename them; so instead we look at the file content.
759  # Grep'ing the first line is not enough: some people post-process
760  # each Makefile.in and add a new line on top of each file to say so.
761  # So let's grep whole file.
762  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
763    dirpart=`AS_DIRNAME("$mf")`
764  else
765    continue
766  fi
767  # Extract the definition of DEPDIR, am__include, and am__quote
768  # from the Makefile without running `make'.
769  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
770  test -z "$DEPDIR" && continue
771  am__include=`sed -n 's/^am__include = //p' < "$mf"`
772  test -z "am__include" && continue
773  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
774  # When using ansi2knr, U may be empty or an underscore; expand it
775  U=`sed -n 's/^U = //p' < "$mf"`
776  # Find all dependency output files, they are included files with
777  # $(DEPDIR) in their names.  We invoke sed twice because it is the
778  # simplest approach to changing $(DEPDIR) to its actual value in the
779  # expansion.
780  for file in `sed -n "
781    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
782       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
783    # Make sure the directory exists.
784    test -f "$dirpart/$file" && continue
785    fdir=`AS_DIRNAME(["$file"])`
786    AS_MKDIR_P([$dirpart/$fdir])
787    # echo "creating $dirpart/$file"
788    echo '# dummy' > "$dirpart/$file"
789  done
790done
791])# _AM_OUTPUT_DEPENDENCY_COMMANDS
792
793
794# AM_OUTPUT_DEPENDENCY_COMMANDS
795# -----------------------------
796# This macro should only be invoked once -- use via AC_REQUIRE.
797#
798# This code is only required when automatic dependency tracking
799# is enabled.  FIXME.  This creates each `.P' file that we will
800# need in order to bootstrap the dependency handling code.
801AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
802[AC_CONFIG_COMMANDS([depfiles],
803     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
804     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
805])
806
807# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
808# Free Software Foundation, Inc.
809#
810# This file is free software; the Free Software Foundation
811# gives unlimited permission to copy and/or distribute it,
812# with or without modifications, as long as this notice is preserved.
813
814# serial 8
815
816# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
817AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
818
819# Do all the work for Automake.                             -*- Autoconf -*-
820
821# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
822# Free Software Foundation, Inc.
823#
824# This file is free software; the Free Software Foundation
825# gives unlimited permission to copy and/or distribute it,
826# with or without modifications, as long as this notice is preserved.
827
828# serial 12
829
830# This macro actually does too much.  Some checks are only needed if
831# your package does certain things.  But this isn't really a big deal.
832
833# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
834# AM_INIT_AUTOMAKE([OPTIONS])
835# -----------------------------------------------
836# The call with PACKAGE and VERSION arguments is the old style
837# call (pre autoconf-2.50), which is being phased out.  PACKAGE
838# and VERSION should now be passed to AC_INIT and removed from
839# the call to AM_INIT_AUTOMAKE.
840# We support both call styles for the transition.  After
841# the next Automake release, Autoconf can make the AC_INIT
842# arguments mandatory, and then we can depend on a new Autoconf
843# release and drop the old call support.
844AC_DEFUN([AM_INIT_AUTOMAKE],
845[AC_PREREQ([2.58])dnl
846dnl Autoconf wants to disallow AM_ names.  We explicitly allow
847dnl the ones we care about.
848m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
849AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
850AC_REQUIRE([AC_PROG_INSTALL])dnl
851# test to see if srcdir already configured
852if test "`cd $srcdir && pwd`" != "`pwd`" &&
853   test -f $srcdir/config.status; then
854  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
855fi
856
857# test whether we have cygpath
858if test -z "$CYGPATH_W"; then
859  if (cygpath --version) >/dev/null 2>/dev/null; then
860    CYGPATH_W='cygpath -w'
861  else
862    CYGPATH_W=echo
863  fi
864fi
865AC_SUBST([CYGPATH_W])
866
867# Define the identity of the package.
868dnl Distinguish between old-style and new-style calls.
869m4_ifval([$2],
870[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
871 AC_SUBST([PACKAGE], [$1])dnl
872 AC_SUBST([VERSION], [$2])],
873[_AM_SET_OPTIONS([$1])dnl
874 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
875 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
876
877_AM_IF_OPTION([no-define],,
878[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
879 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
880
881# Some tools Automake needs.
882AC_REQUIRE([AM_SANITY_CHECK])dnl
883AC_REQUIRE([AC_ARG_PROGRAM])dnl
884AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
885AM_MISSING_PROG(AUTOCONF, autoconf)
886AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
887AM_MISSING_PROG(AUTOHEADER, autoheader)
888AM_MISSING_PROG(MAKEINFO, makeinfo)
889AM_PROG_INSTALL_SH
890AM_PROG_INSTALL_STRIP
891AC_REQUIRE([AM_PROG_MKDIR_P])dnl
892# We need awk for the "check" target.  The system "awk" is bad on
893# some platforms.
894AC_REQUIRE([AC_PROG_AWK])dnl
895AC_REQUIRE([AC_PROG_MAKE_SET])dnl
896AC_REQUIRE([AM_SET_LEADING_DOT])dnl
897_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
898              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
899	      		     [_AM_PROG_TAR([v7])])])
900_AM_IF_OPTION([no-dependencies],,
901[AC_PROVIDE_IFELSE([AC_PROG_CC],
902                  [_AM_DEPENDENCIES(CC)],
903                  [define([AC_PROG_CC],
904                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
905AC_PROVIDE_IFELSE([AC_PROG_CXX],
906                  [_AM_DEPENDENCIES(CXX)],
907                  [define([AC_PROG_CXX],
908                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
909])
910])
911
912
913# When config.status generates a header, we must update the stamp-h file.
914# This file resides in the same directory as the config header
915# that is generated.  The stamp files are numbered to have different names.
916
917# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
918# loop where config.status creates the headers, so we can generate
919# our stamp files there.
920AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
921[# Compute $1's index in $config_headers.
922_am_stamp_count=1
923for _am_header in $config_headers :; do
924  case $_am_header in
925    $1 | $1:* )
926      break ;;
927    * )
928      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
929  esac
930done
931echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
932
933# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
934#
935# This file is free software; the Free Software Foundation
936# gives unlimited permission to copy and/or distribute it,
937# with or without modifications, as long as this notice is preserved.
938
939# AM_PROG_INSTALL_SH
940# ------------------
941# Define $install_sh.
942AC_DEFUN([AM_PROG_INSTALL_SH],
943[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
944install_sh=${install_sh-"$am_aux_dir/install-sh"}
945AC_SUBST(install_sh)])
946
947# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
948#
949# This file is free software; the Free Software Foundation
950# gives unlimited permission to copy and/or distribute it,
951# with or without modifications, as long as this notice is preserved.
952
953# serial 2
954
955# Check whether the underlying file-system supports filenames
956# with a leading dot.  For instance MS-DOS doesn't.
957AC_DEFUN([AM_SET_LEADING_DOT],
958[rm -rf .tst 2>/dev/null
959mkdir .tst 2>/dev/null
960if test -d .tst; then
961  am__leading_dot=.
962else
963  am__leading_dot=_
964fi
965rmdir .tst 2>/dev/null
966AC_SUBST([am__leading_dot])])
967
968# Check to see how 'make' treats includes.	            -*- Autoconf -*-
969
970# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
971#
972# This file is free software; the Free Software Foundation
973# gives unlimited permission to copy and/or distribute it,
974# with or without modifications, as long as this notice is preserved.
975
976# serial 3
977
978# AM_MAKE_INCLUDE()
979# -----------------
980# Check to see how make treats includes.
981AC_DEFUN([AM_MAKE_INCLUDE],
982[am_make=${MAKE-make}
983cat > confinc << 'END'
984am__doit:
985	@echo done
986.PHONY: am__doit
987END
988# If we don't find an include directive, just comment out the code.
989AC_MSG_CHECKING([for style of include used by $am_make])
990am__include="#"
991am__quote=
992_am_result=none
993# First try GNU make style include.
994echo "include confinc" > confmf
995# We grep out `Entering directory' and `Leaving directory'
996# messages which can occur if `w' ends up in MAKEFLAGS.
997# In particular we don't look at `^make:' because GNU make might
998# be invoked under some other name (usually "gmake"), in which
999# case it prints its new name instead of `make'.
1000if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
1001   am__include=include
1002   am__quote=
1003   _am_result=GNU
1004fi
1005# Now try BSD make style include.
1006if test "$am__include" = "#"; then
1007   echo '.include "confinc"' > confmf
1008   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
1009      am__include=.include
1010      am__quote="\""
1011      _am_result=BSD
1012   fi
1013fi
1014AC_SUBST([am__include])
1015AC_SUBST([am__quote])
1016AC_MSG_RESULT([$_am_result])
1017rm -f confinc confmf
1018])
1019
1020# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1021
1022# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
1023# Free Software Foundation, Inc.
1024#
1025# This file is free software; the Free Software Foundation
1026# gives unlimited permission to copy and/or distribute it,
1027# with or without modifications, as long as this notice is preserved.
1028
1029# serial 4
1030
1031# AM_MISSING_PROG(NAME, PROGRAM)
1032# ------------------------------
1033AC_DEFUN([AM_MISSING_PROG],
1034[AC_REQUIRE([AM_MISSING_HAS_RUN])
1035$1=${$1-"${am_missing_run}$2"}
1036AC_SUBST($1)])
1037
1038
1039# AM_MISSING_HAS_RUN
1040# ------------------
1041# Define MISSING if not defined so far and test if it supports --run.
1042# If it does, set am_missing_run to use it, otherwise, to nothing.
1043AC_DEFUN([AM_MISSING_HAS_RUN],
1044[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1045test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
1046# Use eval to expand $SHELL
1047if eval "$MISSING --run true"; then
1048  am_missing_run="$MISSING --run "
1049else
1050  am_missing_run=
1051  AC_MSG_WARN([`missing' script is too old or missing])
1052fi
1053])
1054
1055# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
1056#
1057# This file is free software; the Free Software Foundation
1058# gives unlimited permission to copy and/or distribute it,
1059# with or without modifications, as long as this notice is preserved.
1060
1061# AM_PROG_MKDIR_P
1062# ---------------
1063# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
1064#
1065# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
1066# created by `make install' are always world readable, even if the
1067# installer happens to have an overly restrictive umask (e.g. 077).
1068# This was a mistake.  There are at least two reasons why we must not
1069# use `-m 0755':
1070#   - it causes special bits like SGID to be ignored,
1071#   - it may be too restrictive (some setups expect 775 directories).
1072#
1073# Do not use -m 0755 and let people choose whatever they expect by
1074# setting umask.
1075#
1076# We cannot accept any implementation of `mkdir' that recognizes `-p'.
1077# Some implementations (such as Solaris 8's) are not thread-safe: if a
1078# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
1079# concurrently, both version can detect that a/ is missing, but only
1080# one can create it and the other will error out.  Consequently we
1081# restrict ourselves to GNU make (using the --version option ensures
1082# this.)
1083AC_DEFUN([AM_PROG_MKDIR_P],
1084[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
1085  # We used to keeping the `.' as first argument, in order to
1086  # allow $(mkdir_p) to be used without argument.  As in
1087  #   $(mkdir_p) $(somedir)
1088  # where $(somedir) is conditionally defined.  However this is wrong
1089  # for two reasons:
1090  #  1. if the package is installed by a user who cannot write `.'
1091  #     make install will fail,
1092  #  2. the above comment should most certainly read
1093  #     $(mkdir_p) $(DESTDIR)$(somedir)
1094  #     so it does not work when $(somedir) is undefined and
1095  #     $(DESTDIR) is not.
1096  #  To support the latter case, we have to write
1097  #     test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
1098  #  so the `.' trick is pointless.
1099  mkdir_p='mkdir -p --'
1100else
1101  # On NextStep and OpenStep, the `mkdir' command does not
1102  # recognize any option.  It will interpret all options as
1103  # directories to create, and then abort because `.' already
1104  # exists.
1105  for d in ./-p ./--version;
1106  do
1107    test -d $d && rmdir $d
1108  done
1109  # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
1110  if test -f "$ac_aux_dir/mkinstalldirs"; then
1111    mkdir_p='$(mkinstalldirs)'
1112  else
1113    mkdir_p='$(install_sh) -d'
1114  fi
1115fi
1116AC_SUBST([mkdir_p])])
1117
1118# Helper functions for option handling.                     -*- Autoconf -*-
1119
1120# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
1121#
1122# This file is free software; the Free Software Foundation
1123# gives unlimited permission to copy and/or distribute it,
1124# with or without modifications, as long as this notice is preserved.
1125
1126# serial 3
1127
1128# _AM_MANGLE_OPTION(NAME)
1129# -----------------------
1130AC_DEFUN([_AM_MANGLE_OPTION],
1131[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1132
1133# _AM_SET_OPTION(NAME)
1134# ------------------------------
1135# Set option NAME.  Presently that only means defining a flag for this option.
1136AC_DEFUN([_AM_SET_OPTION],
1137[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1138
1139# _AM_SET_OPTIONS(OPTIONS)
1140# ----------------------------------
1141# OPTIONS is a space-separated list of Automake options.
1142AC_DEFUN([_AM_SET_OPTIONS],
1143[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1144
1145# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1146# -------------------------------------------
1147# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1148AC_DEFUN([_AM_IF_OPTION],
1149[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1150
1151# Check to make sure that the build environment is sane.    -*- Autoconf -*-
1152
1153# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1154# Free Software Foundation, Inc.
1155#
1156# This file is free software; the Free Software Foundation
1157# gives unlimited permission to copy and/or distribute it,
1158# with or without modifications, as long as this notice is preserved.
1159
1160# serial 4
1161
1162# AM_SANITY_CHECK
1163# ---------------
1164AC_DEFUN([AM_SANITY_CHECK],
1165[AC_MSG_CHECKING([whether build environment is sane])
1166# Just in case
1167sleep 1
1168echo timestamp > conftest.file
1169# Do `set' in a subshell so we don't clobber the current shell's
1170# arguments.  Must try -L first in case configure is actually a
1171# symlink; some systems play weird games with the mod time of symlinks
1172# (eg FreeBSD returns the mod time of the symlink's containing
1173# directory).
1174if (
1175   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
1176   if test "$[*]" = "X"; then
1177      # -L didn't work.
1178      set X `ls -t $srcdir/configure conftest.file`
1179   fi
1180   rm -f conftest.file
1181   if test "$[*]" != "X $srcdir/configure conftest.file" \
1182      && test "$[*]" != "X conftest.file $srcdir/configure"; then
1183
1184      # If neither matched, then we have a broken ls.  This can happen
1185      # if, for instance, CONFIG_SHELL is bash and it inherits a
1186      # broken ls alias from the environment.  This has actually
1187      # happened.  Such a system could not be considered "sane".
1188      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1189alias in your environment])
1190   fi
1191
1192   test "$[2]" = conftest.file
1193   )
1194then
1195   # Ok.
1196   :
1197else
1198   AC_MSG_ERROR([newly created file is older than distributed files!
1199Check your system clock])
1200fi
1201AC_MSG_RESULT(yes)])
1202
1203# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1204#
1205# This file is free software; the Free Software Foundation
1206# gives unlimited permission to copy and/or distribute it,
1207# with or without modifications, as long as this notice is preserved.
1208
1209# AM_PROG_INSTALL_STRIP
1210# ---------------------
1211# One issue with vendor `install' (even GNU) is that you can't
1212# specify the program used to strip binaries.  This is especially
1213# annoying in cross-compiling environments, where the build's strip
1214# is unlikely to handle the host's binaries.
1215# Fortunately install-sh will honor a STRIPPROG variable, so we
1216# always use install-sh in `make install-strip', and initialize
1217# STRIPPROG with the value of the STRIP variable (set by the user).
1218AC_DEFUN([AM_PROG_INSTALL_STRIP],
1219[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1220# Installed binaries are usually stripped using `strip' when the user
1221# run `make install-strip'.  However `strip' might not be the right
1222# tool to use in cross-compilation environments, therefore Automake
1223# will honor the `STRIP' environment variable to overrule this program.
1224dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1225if test "$cross_compiling" != no; then
1226  AC_CHECK_TOOL([STRIP], [strip], :)
1227fi
1228INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
1229AC_SUBST([INSTALL_STRIP_PROGRAM])])
1230
1231# Check how to create a tarball.                            -*- Autoconf -*-
1232
1233# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
1234#
1235# This file is free software; the Free Software Foundation
1236# gives unlimited permission to copy and/or distribute it,
1237# with or without modifications, as long as this notice is preserved.
1238
1239# serial 2
1240
1241# _AM_PROG_TAR(FORMAT)
1242# --------------------
1243# Check how to create a tarball in format FORMAT.
1244# FORMAT should be one of `v7', `ustar', or `pax'.
1245#
1246# Substitute a variable $(am__tar) that is a command
1247# writing to stdout a FORMAT-tarball containing the directory
1248# $tardir.
1249#     tardir=directory && $(am__tar) > result.tar
1250#
1251# Substitute a variable $(am__untar) that extract such
1252# a tarball read from stdin.
1253#     $(am__untar) < result.tar
1254AC_DEFUN([_AM_PROG_TAR],
1255[# Always define AMTAR for backward compatibility.
1256AM_MISSING_PROG([AMTAR], [tar])
1257m4_if([$1], [v7],
1258     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
1259     [m4_case([$1], [ustar],, [pax],,
1260              [m4_fatal([Unknown tar format])])
1261AC_MSG_CHECKING([how to create a $1 tar archive])
1262# Loop over all known methods to create a tar archive until one works.
1263_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1264_am_tools=${am_cv_prog_tar_$1-$_am_tools}
1265# Do not fold the above two line into one, because Tru64 sh and
1266# Solaris sh will not grok spaces in the rhs of `-'.
1267for _am_tool in $_am_tools
1268do
1269  case $_am_tool in
1270  gnutar)
1271    for _am_tar in tar gnutar gtar;
1272    do
1273      AM_RUN_LOG([$_am_tar --version]) && break
1274    done
1275    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1276    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1277    am__untar="$_am_tar -xf -"
1278    ;;
1279  plaintar)
1280    # Must skip GNU tar: if it does not support --format= it doesn't create
1281    # ustar tarball either.
1282    (tar --version) >/dev/null 2>&1 && continue
1283    am__tar='tar chf - "$$tardir"'
1284    am__tar_='tar chf - "$tardir"'
1285    am__untar='tar xf -'
1286    ;;
1287  pax)
1288    am__tar='pax -L -x $1 -w "$$tardir"'
1289    am__tar_='pax -L -x $1 -w "$tardir"'
1290    am__untar='pax -r'
1291    ;;
1292  cpio)
1293    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1294    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1295    am__untar='cpio -i -H $1 -d'
1296    ;;
1297  none)
1298    am__tar=false
1299    am__tar_=false
1300    am__untar=false
1301    ;;
1302  esac
1303
1304  # If the value was cached, stop now.  We just wanted to have am__tar
1305  # and am__untar set.
1306  test -n "${am_cv_prog_tar_$1}" && break
1307
1308  # tar/untar a dummy directory, and stop if the command works
1309  rm -rf conftest.dir
1310  mkdir conftest.dir
1311  echo GrepMe > conftest.dir/file
1312  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1313  rm -rf conftest.dir
1314  if test -s conftest.tar; then
1315    AM_RUN_LOG([$am__untar <conftest.tar])
1316    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1317  fi
1318done
1319rm -rf conftest.dir
1320
1321AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1322AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1323AC_SUBST([am__tar])
1324AC_SUBST([am__untar])
1325]) # _AM_PROG_TAR
1326
1327