OSDN Git Service

~/.eb123 config directory moved to ~/.config/.eb123
[eb123/eb123.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.6 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
5 # Inc.
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 # PARTICULAR PURPOSE.
14
15 m4_ifndef([AC_AUTOCONF_VERSION],
16   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18 [m4_warning([this file was generated for autoconf 2.69.
19 You have another version of autoconf.  It may work, but is not guaranteed to.
20 If you have problems, you may need to regenerate the build system entirely.
21 To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
23 dnl *
24 dnl * Make ready to link EB Library 3.x or 4.x.
25 dnl *
26 dnl * Copyright (c) 2000-2006  Motoyuki Kasahara
27 dnl *
28 dnl * Redistribution and use in source and binary forms, with or without
29 dnl * modification, are permitted provided that the following conditions
30 dnl * are met:
31 dnl * 1. Redistributions of source code must retain the above copyright
32 dnl *    notice, this list of conditions and the following disclaimer.
33 dnl * 2. Redistributions in binary form must reproduce the above copyright
34 dnl *    notice, this list of conditions and the following disclaimer in the
35 dnl *    documentation and/or other materials provided with the distribution.
36 dnl * 3. Neither the name of the project nor the names of its contributors
37 dnl *    may be used to endorse or promote products derived from this software
38 dnl *    without specific prior written permission.
39 dnl * 
40 dnl * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
41 dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 dnl * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
44 dnl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45 dnl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46 dnl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 dnl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48 dnl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49 dnl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 dnl * SUCH DAMAGE.
51 dnl *
52
53 AC_DEFUN([eb_LIB_EB4],
54 [dnl
55 dnl *
56 dnl * Requirements.
57 dnl *
58 AC_REQUIRE([AC_PROG_CC])
59 AC_REQUIRE([AC_PROG_LIBTOOL])
60 AC_REQUIRE([AC_TYPE_OFF_T])
61 AC_REQUIRE([AC_TYPE_SIZE_T])
62
63 AC_CHECK_HEADERS(limits.h)
64 AC_CHECK_TYPE(ssize_t, int)
65
66 dnl *
67 dnl * --with-eb-conf option.
68 dnl *
69 AC_ARG_WITH(eb-conf,
70 AC_HELP_STRING([--with-eb-conf=FILE],
71     [eb.conf file is FILE [[SYSCONFDIR/eb.conf]]]),
72 [ebconf="${withval}"], [ebconf=$sysconfdir/eb.conf])
73 if test X$prefix = XNONE; then
74    PREFIX=$ac_default_prefix
75 else
76    PREFIX=$prefix
77 fi
78 ebconf=`echo X$ebconf | sed -e 's/^X//' -e 's;\${prefix};'"$PREFIX;g" \
79    -e 's;\$(prefix);'"$PREFIX;g"`
80
81 dnl *
82 dnl * Read eb.conf
83 dnl *
84 AC_MSG_CHECKING(for eb.conf)
85 AC_MSG_RESULT($ebconf)
86 if test -f ${ebconf}; then
87    . ${ebconf}
88 else
89    AC_MSG_ERROR($ebconf not found)
90 fi
91
92 if test X$EBCONF_ENABLE_PTHREAD = Xyes; then
93    AC_DEFINE(EBCONF_ENABLE_PTHREAD, 1,
94       [Define if EB Library supports pthread.])
95 fi
96 if test X$EBCONF_ENABLE_NLS = Xyes; then
97    AC_DEFINE(EBCONF_ENABLE_NLS, 1,
98       [Define if EB Library supports native language.])
99 fi
100 if test X$EBCONF_ENABLE_EBNET = Xyes; then
101    AC_DEFINE(EBCONF_ENABLE_EBNET, 1,
102       [Define if EB Library supports remote access.])
103 fi
104
105 AC_SUBST(EBCONF_EBINCS)
106 AC_SUBST(EBCONF_EBLIBS)
107 AC_SUBST(EBCONF_ZLIBINCS)
108 AC_SUBST(EBCONF_ZLIBLIBS)
109 AC_SUBST(EBCONF_PTHREAD_CPPFLAGS)
110 AC_SUBST(EBCONF_PTHREAD_CFLAGS)
111 AC_SUBST(EBCONF_PTHREAD_LDFLAGS)
112 AC_SUBST(EBCONF_INTLINCS)
113 AC_SUBST(EBCONF_INTLLIBS)
114
115 dnl *
116 dnl * Check for EB Library.
117 dnl *
118 AC_MSG_CHECKING(for EB Library)
119 save_CPPFLAGS=$CPPFLAGS
120 save_CFLAGS=$CFLAGS
121 save_LDFLAGS=$LDFLAGS
122 save_LIBS=$LIBS
123 CPPFLAGS="$CPPFLAGS $EBCONF_PTHREAD_CPPFLAGS $EBCONF_EBINCS $EBCONF_ZLIBINCS $EBCONF_INTLINCS"
124 CFLAGS="$CFLAGS $EBCONF_PTHREAD_CFLAGS"
125 LDFLAGS="$LDFAGS $EBCONF_PTHREAD_LDFLAGS"
126 LIBS="$LIBS $EBCONF_EBLIBS $EBCONF_ZLIBLIBS $EBCONF_INTLLIBS"
127 AC_TRY_LINK([#include <eb/eb.h>],
128 [eb_initialize_library(); return 0;],
129 try_eb=yes, try_eb=no)
130 CPPFLAGS=$save_CPPFLAGS
131 CFLAGS=$save_CFLAGS
132 LDFLAGS=$save_LDFLAGS
133 LIBS=$save_LIBS
134 AC_MSG_RESULT($try_eb)
135 if test ${try_eb} != yes; then
136    AC_MSG_ERROR(EB Library not available)
137 fi
138 ])
139
140 # Configure paths for GTK+
141 # Owen Taylor     1997-2001
142
143 dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
144 dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES, 
145 dnl pass to pkg-config
146 dnl
147 AC_DEFUN([AM_PATH_GTK_3_0],
148 [dnl 
149 dnl Get the cflags and libraries from pkg-config
150 dnl
151 AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
152                     , enable_gtktest=yes)
153
154   pkg_config_args=gtk+-3.0
155   for module in . $4
156   do
157       case "$module" in
158          gthread)
159              pkg_config_args="$pkg_config_args gthread-2.0"
160          ;;
161       esac
162   done
163
164   no_gtk=""
165
166   AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
167
168   if test x$PKG_CONFIG != xno ; then
169     if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
170       :
171     else
172       echo "*** pkg-config too old; version 0.7 or better required."
173       no_gtk=yes
174       PKG_CONFIG=no
175     fi
176   else
177     no_gtk=yes
178   fi
179
180   min_gtk_version=ifelse([$1], ,3.0.0,$1)
181   AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
182
183   if test x$PKG_CONFIG != xno ; then
184     ## don't try to run the test against uninstalled libtool libs
185     if $PKG_CONFIG --uninstalled $pkg_config_args; then
186           echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
187           enable_gtktest=no
188     fi
189
190     if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
191           :
192     else
193           no_gtk=yes
194     fi
195   fi
196
197   if test x"$no_gtk" = x ; then
198     GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
199     GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
200     gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
201            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
202     gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
203            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
204     gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
205            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
206     if test "x$enable_gtktest" = "xyes" ; then
207       ac_save_CFLAGS="$CFLAGS"
208       ac_save_LIBS="$LIBS"
209       CFLAGS="$CFLAGS $GTK_CFLAGS"
210       LIBS="$GTK_LIBS $LIBS"
211 dnl
212 dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
213 dnl checks the results of pkg-config to some extent)
214 dnl
215       rm -f conf.gtktest
216       AC_TRY_RUN([
217 #include <gtk/gtk.h>
218 #include <stdio.h>
219 #include <stdlib.h>
220
221 int 
222 main ()
223 {
224   int major, minor, micro;
225   char *tmp_version;
226
227   fclose (fopen ("conf.gtktest", "w"));
228
229   /* HP/UX 9 (%@#!) writes to sscanf strings */
230   tmp_version = g_strdup("$min_gtk_version");
231   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
232      printf("%s, bad version string\n", "$min_gtk_version");
233      exit(1);
234    }
235
236   if ((gtk_major_version != $gtk_config_major_version) ||
237       (gtk_minor_version != $gtk_config_minor_version) ||
238       (gtk_micro_version != $gtk_config_micro_version))
239     {
240       printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", 
241              $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
242              gtk_major_version, gtk_minor_version, gtk_micro_version);
243       printf ("*** was found! If pkg-config was correct, then it is best\n");
244       printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
245       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
246       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
247       printf("*** required on your system.\n");
248       printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
249       printf("*** to point to the correct configuration files\n");
250     } 
251   else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
252            (gtk_minor_version != GTK_MINOR_VERSION) ||
253            (gtk_micro_version != GTK_MICRO_VERSION))
254     {
255       printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
256              GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
257       printf("*** library (version %d.%d.%d)\n",
258              gtk_major_version, gtk_minor_version, gtk_micro_version);
259     }
260   else
261     {
262       if ((gtk_major_version > major) ||
263         ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
264         ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
265       {
266         return 0;
267        }
268      else
269       {
270         printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
271                gtk_major_version, gtk_minor_version, gtk_micro_version);
272         printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
273                major, minor, micro);
274         printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
275         printf("***\n");
276         printf("*** If you have already installed a sufficiently new version, this error\n");
277         printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
278         printf("*** being found. The easiest way to fix this is to remove the old version\n");
279         printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
280         printf("*** correct copy of pkg-config. (In this case, you will have to\n");
281         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
282         printf("*** so that the correct libraries are found at run-time))\n");
283       }
284     }
285   return 1;
286 }
287 ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
288        CFLAGS="$ac_save_CFLAGS"
289        LIBS="$ac_save_LIBS"
290      fi
291   fi
292   if test "x$no_gtk" = x ; then
293      AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
294      ifelse([$2], , :, [$2])
295   else
296      AC_MSG_RESULT(no)
297      if test "$PKG_CONFIG" = "no" ; then
298        echo "*** A new enough version of pkg-config was not found."
299        echo "*** See http://pkgconfig.sourceforge.net"
300      else
301        if test -f conf.gtktest ; then
302         :
303        else
304           echo "*** Could not run GTK+ test program, checking why..."
305           ac_save_CFLAGS="$CFLAGS"
306           ac_save_LIBS="$LIBS"
307           CFLAGS="$CFLAGS $GTK_CFLAGS"
308           LIBS="$LIBS $GTK_LIBS"
309           AC_TRY_LINK([
310 #include <gtk/gtk.h>
311 #include <stdio.h>
312 ],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
313         [ echo "*** The test program compiled, but did not run. This usually means"
314           echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
315           echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
316           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
317           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
318           echo "*** is required on your system"
319           echo "***"
320           echo "*** If you have an old version installed, it is best to remove it, although"
321           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
322         [ echo "*** The test program failed to compile or link. See the file config.log for the"
323           echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
324           CFLAGS="$ac_save_CFLAGS"
325           LIBS="$ac_save_LIBS"
326        fi
327      fi
328      GTK_CFLAGS=""
329      GTK_LIBS=""
330      ifelse([$3], , :, [$3])
331   fi
332   AC_SUBST(GTK_CFLAGS)
333   AC_SUBST(GTK_LIBS)
334   rm -f conf.gtktest
335 ])
336
337 dnl GTK_CHECK_BACKEND(BACKEND-NAME [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
338 dnl   Tests for BACKEND-NAME in the GTK targets list
339 dnl
340 AC_DEFUN([GTK_CHECK_BACKEND],
341 [
342   pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0)
343   min_gtk_version=ifelse([$2],,3.0.0,$2)
344
345   AC_PATH_PROG(PKG_CONFIG, [pkg-config], [AC_MSG_ERROR([No pkg-config found])])
346
347   if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args ; then
348     target_found=yes
349   else
350     target_found=no
351   fi
352
353   if test "x$target_found" = "xno"; then
354     ifelse([$4],,[AC_MSG_ERROR([Backend $backend not found.])],[$4])
355   else
356     ifelse([$3],,[:],[$3])
357   fi
358 ])
359
360 # Configure paths for LIBXML2
361 # Mike Hommey 2004-06-19
362 # use CPPFLAGS instead of CFLAGS
363 # Toshio Kuratomi 2001-04-21
364 # Adapted from:
365 # Configure paths for GLIB
366 # Owen Taylor     97-11-3
367
368 dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
369 dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
370 dnl
371 AC_DEFUN([AM_PATH_XML2],[ 
372 AC_ARG_WITH(xml-prefix,
373             [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
374             xml_config_prefix="$withval", xml_config_prefix="")
375 AC_ARG_WITH(xml-exec-prefix,
376             [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
377             xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
378 AC_ARG_ENABLE(xmltest,
379               [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
380               enable_xmltest=yes)
381
382   if test x$xml_config_exec_prefix != x ; then
383      xml_config_args="$xml_config_args"
384      if test x${XML2_CONFIG+set} != xset ; then
385         XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
386      fi
387   fi
388   if test x$xml_config_prefix != x ; then
389      xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
390      if test x${XML2_CONFIG+set} != xset ; then
391         XML2_CONFIG=$xml_config_prefix/bin/xml2-config
392      fi
393   fi
394
395   AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
396   min_xml_version=ifelse([$1], ,2.0.0,[$1])
397   AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
398   no_xml=""
399   if test "$XML2_CONFIG" = "no" ; then
400     no_xml=yes
401   else
402     XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
403     XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
404     xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
405            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
406     xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
407            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
408     xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
409            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
410     if test "x$enable_xmltest" = "xyes" ; then
411       ac_save_CPPFLAGS="$CPPFLAGS"
412       ac_save_LIBS="$LIBS"
413       CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
414       LIBS="$XML_LIBS $LIBS"
415 dnl
416 dnl Now check if the installed libxml is sufficiently new.
417 dnl (Also sanity checks the results of xml2-config to some extent)
418 dnl
419       rm -f conf.xmltest
420       AC_TRY_RUN([
421 #include <stdlib.h>
422 #include <stdio.h>
423 #include <string.h>
424 #include <libxml/xmlversion.h>
425
426 int 
427 main()
428 {
429   int xml_major_version, xml_minor_version, xml_micro_version;
430   int major, minor, micro;
431   char *tmp_version;
432
433   system("touch conf.xmltest");
434
435   /* Capture xml2-config output via autoconf/configure variables */
436   /* HP/UX 9 (%@#!) writes to sscanf strings */
437   tmp_version = (char *)strdup("$min_xml_version");
438   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
439      printf("%s, bad version string from xml2-config\n", "$min_xml_version");
440      exit(1);
441    }
442    free(tmp_version);
443
444    /* Capture the version information from the header files */
445    tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
446    if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
447      printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
448      exit(1);
449    }
450    free(tmp_version);
451
452  /* Compare xml2-config output to the libxml headers */
453   if ((xml_major_version != $xml_config_major_version) ||
454       (xml_minor_version != $xml_config_minor_version) ||
455       (xml_micro_version != $xml_config_micro_version))
456     {
457       printf("*** libxml header files (version %d.%d.%d) do not match\n",
458          xml_major_version, xml_minor_version, xml_micro_version);
459       printf("*** xml2-config (version %d.%d.%d)\n",
460          $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
461       return 1;
462     } 
463 /* Compare the headers to the library to make sure we match */
464   /* Less than ideal -- doesn't provide us with return value feedback, 
465    * only exits if there's a serious mismatch between header and library.
466    */
467     LIBXML_TEST_VERSION;
468
469     /* Test that the library is greater than our minimum version */
470     if ((xml_major_version > major) ||
471         ((xml_major_version == major) && (xml_minor_version > minor)) ||
472         ((xml_major_version == major) && (xml_minor_version == minor) &&
473         (xml_micro_version >= micro)))
474       {
475         return 0;
476        }
477      else
478       {
479         printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
480                xml_major_version, xml_minor_version, xml_micro_version);
481         printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
482            major, minor, micro);
483         printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
484         printf("***\n");
485         printf("*** If you have already installed a sufficiently new version, this error\n");
486         printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
487         printf("*** being found. The easiest way to fix this is to remove the old version\n");
488         printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
489         printf("*** correct copy of xml2-config. (In this case, you will have to\n");
490         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
491         printf("*** so that the correct libraries are found at run-time))\n");
492     }
493   return 1;
494 }
495 ],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
496        CPPFLAGS="$ac_save_CPPFLAGS"
497        LIBS="$ac_save_LIBS"
498      fi
499   fi
500
501   if test "x$no_xml" = x ; then
502      AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
503      ifelse([$2], , :, [$2])     
504   else
505      AC_MSG_RESULT(no)
506      if test "$XML2_CONFIG" = "no" ; then
507        echo "*** The xml2-config script installed by LIBXML could not be found"
508        echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
509        echo "*** your path, or set the XML2_CONFIG environment variable to the"
510        echo "*** full path to xml2-config."
511      else
512        if test -f conf.xmltest ; then
513         :
514        else
515           echo "*** Could not run libxml test program, checking why..."
516           CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
517           LIBS="$LIBS $XML_LIBS"
518           AC_TRY_LINK([
519 #include <libxml/xmlversion.h>
520 #include <stdio.h>
521 ],      [ LIBXML_TEST_VERSION; return 0;],
522         [ echo "*** The test program compiled, but did not run. This usually means"
523           echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
524           echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
525           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
526           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
527           echo "*** is required on your system"
528           echo "***"
529           echo "*** If you have an old version installed, it is best to remove it, although"
530           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
531         [ echo "*** The test program failed to compile or link. See the file config.log for the"
532           echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
533           echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
534           echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
535           CPPFLAGS="$ac_save_CPPFLAGS"
536           LIBS="$ac_save_LIBS"
537        fi
538      fi
539
540      XML_CPPFLAGS=""
541      XML_LIBS=""
542      ifelse([$3], , :, [$3])
543   fi
544   AC_SUBST(XML_CPPFLAGS)
545   AC_SUBST(XML_LIBS)
546   rm -f conf.xmltest
547 ])
548
549 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
550 # serial 1 (pkg-config-0.24)
551
552 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
553 #
554 # This program is free software; you can redistribute it and/or modify
555 # it under the terms of the GNU General Public License as published by
556 # the Free Software Foundation; either version 2 of the License, or
557 # (at your option) any later version.
558 #
559 # This program is distributed in the hope that it will be useful, but
560 # WITHOUT ANY WARRANTY; without even the implied warranty of
561 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
562 # General Public License for more details.
563 #
564 # You should have received a copy of the GNU General Public License
565 # along with this program; if not, write to the Free Software
566 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
567 #
568 # As a special exception to the GNU General Public License, if you
569 # distribute this file as part of a program that contains a
570 # configuration script generated by Autoconf, you may include it under
571 # the same distribution terms that you use for the rest of that program.
572
573 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
574 # ----------------------------------
575 AC_DEFUN([PKG_PROG_PKG_CONFIG],
576 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
577 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
578 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
579 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
580 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
581 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
582
583 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
584         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
585 fi
586 if test -n "$PKG_CONFIG"; then
587         _pkg_min_version=m4_default([$1], [0.9.0])
588         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
589         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
590                 AC_MSG_RESULT([yes])
591         else
592                 AC_MSG_RESULT([no])
593                 PKG_CONFIG=""
594         fi
595 fi[]dnl
596 ])# PKG_PROG_PKG_CONFIG
597
598 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
599 #
600 # Check to see whether a particular set of modules exists.  Similar
601 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
602 #
603 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
604 # only at the first occurence in configure.ac, so if the first place
605 # it's called might be skipped (such as if it is within an "if", you
606 # have to call PKG_CHECK_EXISTS manually
607 # --------------------------------------------------------------
608 AC_DEFUN([PKG_CHECK_EXISTS],
609 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
610 if test -n "$PKG_CONFIG" && \
611     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
612   m4_default([$2], [:])
613 m4_ifvaln([$3], [else
614   $3])dnl
615 fi])
616
617 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
618 # ---------------------------------------------
619 m4_define([_PKG_CONFIG],
620 [if test -n "$$1"; then
621     pkg_cv_[]$1="$$1"
622  elif test -n "$PKG_CONFIG"; then
623     PKG_CHECK_EXISTS([$3],
624                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
625                       test "x$?" != "x0" && pkg_failed=yes ],
626                      [pkg_failed=yes])
627  else
628     pkg_failed=untried
629 fi[]dnl
630 ])# _PKG_CONFIG
631
632 # _PKG_SHORT_ERRORS_SUPPORTED
633 # -----------------------------
634 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
635 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
636 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
637         _pkg_short_errors_supported=yes
638 else
639         _pkg_short_errors_supported=no
640 fi[]dnl
641 ])# _PKG_SHORT_ERRORS_SUPPORTED
642
643
644 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
645 # [ACTION-IF-NOT-FOUND])
646 #
647 #
648 # Note that if there is a possibility the first call to
649 # PKG_CHECK_MODULES might not happen, you should be sure to include an
650 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
651 #
652 #
653 # --------------------------------------------------------------
654 AC_DEFUN([PKG_CHECK_MODULES],
655 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
656 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
657 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
658
659 pkg_failed=no
660 AC_MSG_CHECKING([for $1])
661
662 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
663 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
664
665 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
666 and $1[]_LIBS to avoid the need to call pkg-config.
667 See the pkg-config man page for more details.])
668
669 if test $pkg_failed = yes; then
670         AC_MSG_RESULT([no])
671         _PKG_SHORT_ERRORS_SUPPORTED
672         if test $_pkg_short_errors_supported = yes; then
673                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
674         else 
675                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
676         fi
677         # Put the nasty error message in config.log where it belongs
678         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
679
680         m4_default([$4], [AC_MSG_ERROR(
681 [Package requirements ($2) were not met:
682
683 $$1_PKG_ERRORS
684
685 Consider adjusting the PKG_CONFIG_PATH environment variable if you
686 installed software in a non-standard prefix.
687
688 _PKG_TEXT])[]dnl
689         ])
690 elif test $pkg_failed = untried; then
691         AC_MSG_RESULT([no])
692         m4_default([$4], [AC_MSG_FAILURE(
693 [The pkg-config script could not be found or is too old.  Make sure it
694 is in your PATH or set the PKG_CONFIG environment variable to the full
695 path to pkg-config.
696
697 _PKG_TEXT
698
699 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
700         ])
701 else
702         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
703         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
704         AC_MSG_RESULT([yes])
705         $3
706 fi[]dnl
707 ])# PKG_CHECK_MODULES
708
709
710 # PKG_INSTALLDIR(DIRECTORY)
711 # -------------------------
712 # Substitutes the variable pkgconfigdir as the location where a module
713 # should install pkg-config .pc files. By default the directory is
714 # $libdir/pkgconfig, but the default can be changed by passing
715 # DIRECTORY. The user can override through the --with-pkgconfigdir
716 # parameter.
717 AC_DEFUN([PKG_INSTALLDIR],
718 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
719 m4_pushdef([pkg_description],
720     [pkg-config installation directory @<:@]pkg_default[@:>@])
721 AC_ARG_WITH([pkgconfigdir],
722     [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
723     [with_pkgconfigdir=]pkg_default)
724 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
725 m4_popdef([pkg_default])
726 m4_popdef([pkg_description])
727 ]) dnl PKG_INSTALLDIR
728
729
730 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
731 # -------------------------
732 # Substitutes the variable noarch_pkgconfigdir as the location where a
733 # module should install arch-independent pkg-config .pc files. By
734 # default the directory is $datadir/pkgconfig, but the default can be
735 # changed by passing DIRECTORY. The user can override through the
736 # --with-noarch-pkgconfigdir parameter.
737 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
738 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
739 m4_pushdef([pkg_description],
740     [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
741 AC_ARG_WITH([noarch-pkgconfigdir],
742     [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
743     [with_noarch_pkgconfigdir=]pkg_default)
744 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
745 m4_popdef([pkg_default])
746 m4_popdef([pkg_description])
747 ]) dnl PKG_NOARCH_INSTALLDIR
748
749
750 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
751 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
752 # -------------------------------------------
753 # Retrieves the value of the pkg-config variable for the given module.
754 AC_DEFUN([PKG_CHECK_VAR],
755 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
756 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
757
758 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
759 AS_VAR_COPY([$1], [pkg_cv_][$1])
760
761 AS_VAR_IF([$1], [""], [$5], [$4])dnl
762 ])# PKG_CHECK_VAR
763
764 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
765 # Foundation, Inc.
766 #
767 # This file is free software; the Free Software Foundation
768 # gives unlimited permission to copy and/or distribute it,
769 # with or without modifications, as long as this notice is preserved.
770
771 # serial 1
772
773 # AM_AUTOMAKE_VERSION(VERSION)
774 # ----------------------------
775 # Automake X.Y traces this macro to ensure aclocal.m4 has been
776 # generated from the m4 files accompanying Automake X.Y.
777 # (This private macro should not be called outside this file.)
778 AC_DEFUN([AM_AUTOMAKE_VERSION],
779 [am__api_version='1.11'
780 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
781 dnl require some minimum version.  Point them to the right macro.
782 m4_if([$1], [1.11.6], [],
783       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
784 ])
785
786 # _AM_AUTOCONF_VERSION(VERSION)
787 # -----------------------------
788 # aclocal traces this macro to find the Autoconf version.
789 # This is a private macro too.  Using m4_define simplifies
790 # the logic in aclocal, which can simply ignore this definition.
791 m4_define([_AM_AUTOCONF_VERSION], [])
792
793 # AM_SET_CURRENT_AUTOMAKE_VERSION
794 # -------------------------------
795 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
796 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
797 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
798 [AM_AUTOMAKE_VERSION([1.11.6])dnl
799 m4_ifndef([AC_AUTOCONF_VERSION],
800   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
801 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
802
803 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
804
805 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
806 #
807 # This file is free software; the Free Software Foundation
808 # gives unlimited permission to copy and/or distribute it,
809 # with or without modifications, as long as this notice is preserved.
810
811 # serial 1
812
813 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
814 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
815 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
816 #
817 # Of course, Automake must honor this variable whenever it calls a
818 # tool from the auxiliary directory.  The problem is that $srcdir (and
819 # therefore $ac_aux_dir as well) can be either absolute or relative,
820 # depending on how configure is run.  This is pretty annoying, since
821 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
822 # source directory, any form will work fine, but in subdirectories a
823 # relative path needs to be adjusted first.
824 #
825 # $ac_aux_dir/missing
826 #    fails when called from a subdirectory if $ac_aux_dir is relative
827 # $top_srcdir/$ac_aux_dir/missing
828 #    fails if $ac_aux_dir is absolute,
829 #    fails when called from a subdirectory in a VPATH build with
830 #          a relative $ac_aux_dir
831 #
832 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
833 # are both prefixed by $srcdir.  In an in-source build this is usually
834 # harmless because $srcdir is `.', but things will broke when you
835 # start a VPATH build or use an absolute $srcdir.
836 #
837 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
838 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
839 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
840 # and then we would define $MISSING as
841 #   MISSING="\${SHELL} $am_aux_dir/missing"
842 # This will work as long as MISSING is not called from configure, because
843 # unfortunately $(top_srcdir) has no meaning in configure.
844 # However there are other variables, like CC, which are often used in
845 # configure, and could therefore not use this "fixed" $ac_aux_dir.
846 #
847 # Another solution, used here, is to always expand $ac_aux_dir to an
848 # absolute PATH.  The drawback is that using absolute paths prevent a
849 # configured tree to be moved without reconfiguration.
850
851 AC_DEFUN([AM_AUX_DIR_EXPAND],
852 [dnl Rely on autoconf to set up CDPATH properly.
853 AC_PREREQ([2.50])dnl
854 # expand $ac_aux_dir to an absolute path
855 am_aux_dir=`cd $ac_aux_dir && pwd`
856 ])
857
858 # AM_CONDITIONAL                                            -*- Autoconf -*-
859
860 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
861 # Free Software Foundation, Inc.
862 #
863 # This file is free software; the Free Software Foundation
864 # gives unlimited permission to copy and/or distribute it,
865 # with or without modifications, as long as this notice is preserved.
866
867 # serial 9
868
869 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
870 # -------------------------------------
871 # Define a conditional.
872 AC_DEFUN([AM_CONDITIONAL],
873 [AC_PREREQ(2.52)dnl
874  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
875         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
876 AC_SUBST([$1_TRUE])dnl
877 AC_SUBST([$1_FALSE])dnl
878 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
879 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
880 m4_define([_AM_COND_VALUE_$1], [$2])dnl
881 if $2; then
882   $1_TRUE=
883   $1_FALSE='#'
884 else
885   $1_TRUE='#'
886   $1_FALSE=
887 fi
888 AC_CONFIG_COMMANDS_PRE(
889 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
890   AC_MSG_ERROR([[conditional "$1" was never defined.
891 Usually this means the macro was only invoked conditionally.]])
892 fi])])
893
894 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
895 # 2010, 2011 Free Software Foundation, Inc.
896 #
897 # This file is free software; the Free Software Foundation
898 # gives unlimited permission to copy and/or distribute it,
899 # with or without modifications, as long as this notice is preserved.
900
901 # serial 12
902
903 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
904 # written in clear, in which case automake, when reading aclocal.m4,
905 # will think it sees a *use*, and therefore will trigger all it's
906 # C support machinery.  Also note that it means that autoscan, seeing
907 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
908
909
910 # _AM_DEPENDENCIES(NAME)
911 # ----------------------
912 # See how the compiler implements dependency checking.
913 # NAME is "CC", "CXX", "GCJ", or "OBJC".
914 # We try a few techniques and use that to set a single cache variable.
915 #
916 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
917 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
918 # dependency, and given that the user is not expected to run this macro,
919 # just rely on AC_PROG_CC.
920 AC_DEFUN([_AM_DEPENDENCIES],
921 [AC_REQUIRE([AM_SET_DEPDIR])dnl
922 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
923 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
924 AC_REQUIRE([AM_DEP_TRACK])dnl
925
926 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
927        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
928        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
929        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
930        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
931                    [depcc="$$1"   am_compiler_list=])
932
933 AC_CACHE_CHECK([dependency style of $depcc],
934                [am_cv_$1_dependencies_compiler_type],
935 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
936   # We make a subdir and do the tests there.  Otherwise we can end up
937   # making bogus files that we don't know about and never remove.  For
938   # instance it was reported that on HP-UX the gcc test will end up
939   # making a dummy file named `D' -- because `-MD' means `put the output
940   # in D'.
941   rm -rf conftest.dir
942   mkdir conftest.dir
943   # Copy depcomp to subdir because otherwise we won't find it if we're
944   # using a relative directory.
945   cp "$am_depcomp" conftest.dir
946   cd conftest.dir
947   # We will build objects and dependencies in a subdirectory because
948   # it helps to detect inapplicable dependency modes.  For instance
949   # both Tru64's cc and ICC support -MD to output dependencies as a
950   # side effect of compilation, but ICC will put the dependencies in
951   # the current directory while Tru64 will put them in the object
952   # directory.
953   mkdir sub
954
955   am_cv_$1_dependencies_compiler_type=none
956   if test "$am_compiler_list" = ""; then
957      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
958   fi
959   am__universal=false
960   m4_case([$1], [CC],
961     [case " $depcc " in #(
962      *\ -arch\ *\ -arch\ *) am__universal=true ;;
963      esac],
964     [CXX],
965     [case " $depcc " in #(
966      *\ -arch\ *\ -arch\ *) am__universal=true ;;
967      esac])
968
969   for depmode in $am_compiler_list; do
970     # Setup a source with many dependencies, because some compilers
971     # like to wrap large dependency lists on column 80 (with \), and
972     # we should not choose a depcomp mode which is confused by this.
973     #
974     # We need to recreate these files for each test, as the compiler may
975     # overwrite some of them when testing with obscure command lines.
976     # This happens at least with the AIX C compiler.
977     : > sub/conftest.c
978     for i in 1 2 3 4 5 6; do
979       echo '#include "conftst'$i'.h"' >> sub/conftest.c
980       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
981       # Solaris 8's {/usr,}/bin/sh.
982       touch sub/conftst$i.h
983     done
984     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
985
986     # We check with `-c' and `-o' for the sake of the "dashmstdout"
987     # mode.  It turns out that the SunPro C++ compiler does not properly
988     # handle `-M -o', and we need to detect this.  Also, some Intel
989     # versions had trouble with output in subdirs
990     am__obj=sub/conftest.${OBJEXT-o}
991     am__minus_obj="-o $am__obj"
992     case $depmode in
993     gcc)
994       # This depmode causes a compiler race in universal mode.
995       test "$am__universal" = false || continue
996       ;;
997     nosideeffect)
998       # after this tag, mechanisms are not by side-effect, so they'll
999       # only be used when explicitly requested
1000       if test "x$enable_dependency_tracking" = xyes; then
1001         continue
1002       else
1003         break
1004       fi
1005       ;;
1006     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1007       # This compiler won't grok `-c -o', but also, the minuso test has
1008       # not run yet.  These depmodes are late enough in the game, and
1009       # so weak that their functioning should not be impacted.
1010       am__obj=conftest.${OBJEXT-o}
1011       am__minus_obj=
1012       ;;
1013     none) break ;;
1014     esac
1015     if depmode=$depmode \
1016        source=sub/conftest.c object=$am__obj \
1017        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1018        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1019          >/dev/null 2>conftest.err &&
1020        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1021        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1022        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1023        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1024       # icc doesn't choke on unknown options, it will just issue warnings
1025       # or remarks (even with -Werror).  So we grep stderr for any message
1026       # that says an option was ignored or not supported.
1027       # When given -MP, icc 7.0 and 7.1 complain thusly:
1028       #   icc: Command line warning: ignoring option '-M'; no argument required
1029       # The diagnosis changed in icc 8.0:
1030       #   icc: Command line remark: option '-MP' not supported
1031       if (grep 'ignoring option' conftest.err ||
1032           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1033         am_cv_$1_dependencies_compiler_type=$depmode
1034         break
1035       fi
1036     fi
1037   done
1038
1039   cd ..
1040   rm -rf conftest.dir
1041 else
1042   am_cv_$1_dependencies_compiler_type=none
1043 fi
1044 ])
1045 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1046 AM_CONDITIONAL([am__fastdep$1], [
1047   test "x$enable_dependency_tracking" != xno \
1048   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1049 ])
1050
1051
1052 # AM_SET_DEPDIR
1053 # -------------
1054 # Choose a directory name for dependency files.
1055 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1056 AC_DEFUN([AM_SET_DEPDIR],
1057 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1058 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1059 ])
1060
1061
1062 # AM_DEP_TRACK
1063 # ------------
1064 AC_DEFUN([AM_DEP_TRACK],
1065 [AC_ARG_ENABLE(dependency-tracking,
1066 [  --disable-dependency-tracking  speeds up one-time build
1067   --enable-dependency-tracking   do not reject slow dependency extractors])
1068 if test "x$enable_dependency_tracking" != xno; then
1069   am_depcomp="$ac_aux_dir/depcomp"
1070   AMDEPBACKSLASH='\'
1071   am__nodep='_no'
1072 fi
1073 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1074 AC_SUBST([AMDEPBACKSLASH])dnl
1075 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1076 AC_SUBST([am__nodep])dnl
1077 _AM_SUBST_NOTMAKE([am__nodep])dnl
1078 ])
1079
1080 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1081
1082 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1083 # Free Software Foundation, Inc.
1084 #
1085 # This file is free software; the Free Software Foundation
1086 # gives unlimited permission to copy and/or distribute it,
1087 # with or without modifications, as long as this notice is preserved.
1088
1089 #serial 5
1090
1091 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1092 # ------------------------------
1093 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1094 [{
1095   # Autoconf 2.62 quotes --file arguments for eval, but not when files
1096   # are listed without --file.  Let's play safe and only enable the eval
1097   # if we detect the quoting.
1098   case $CONFIG_FILES in
1099   *\'*) eval set x "$CONFIG_FILES" ;;
1100   *)   set x $CONFIG_FILES ;;
1101   esac
1102   shift
1103   for mf
1104   do
1105     # Strip MF so we end up with the name of the file.
1106     mf=`echo "$mf" | sed -e 's/:.*$//'`
1107     # Check whether this is an Automake generated Makefile or not.
1108     # We used to match only the files named `Makefile.in', but
1109     # some people rename them; so instead we look at the file content.
1110     # Grep'ing the first line is not enough: some people post-process
1111     # each Makefile.in and add a new line on top of each file to say so.
1112     # Grep'ing the whole file is not good either: AIX grep has a line
1113     # limit of 2048, but all sed's we know have understand at least 4000.
1114     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1115       dirpart=`AS_DIRNAME("$mf")`
1116     else
1117       continue
1118     fi
1119     # Extract the definition of DEPDIR, am__include, and am__quote
1120     # from the Makefile without running `make'.
1121     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1122     test -z "$DEPDIR" && continue
1123     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1124     test -z "am__include" && continue
1125     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1126     # When using ansi2knr, U may be empty or an underscore; expand it
1127     U=`sed -n 's/^U = //p' < "$mf"`
1128     # Find all dependency output files, they are included files with
1129     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1130     # simplest approach to changing $(DEPDIR) to its actual value in the
1131     # expansion.
1132     for file in `sed -n "
1133       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1134          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1135       # Make sure the directory exists.
1136       test -f "$dirpart/$file" && continue
1137       fdir=`AS_DIRNAME(["$file"])`
1138       AS_MKDIR_P([$dirpart/$fdir])
1139       # echo "creating $dirpart/$file"
1140       echo '# dummy' > "$dirpart/$file"
1141     done
1142   done
1143 }
1144 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1145
1146
1147 # AM_OUTPUT_DEPENDENCY_COMMANDS
1148 # -----------------------------
1149 # This macro should only be invoked once -- use via AC_REQUIRE.
1150 #
1151 # This code is only required when automatic dependency tracking
1152 # is enabled.  FIXME.  This creates each `.P' file that we will
1153 # need in order to bootstrap the dependency handling code.
1154 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1155 [AC_CONFIG_COMMANDS([depfiles],
1156      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1157      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1158 ])
1159
1160 # Do all the work for Automake.                             -*- Autoconf -*-
1161
1162 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1163 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1164 #
1165 # This file is free software; the Free Software Foundation
1166 # gives unlimited permission to copy and/or distribute it,
1167 # with or without modifications, as long as this notice is preserved.
1168
1169 # serial 16
1170
1171 # This macro actually does too much.  Some checks are only needed if
1172 # your package does certain things.  But this isn't really a big deal.
1173
1174 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1175 # AM_INIT_AUTOMAKE([OPTIONS])
1176 # -----------------------------------------------
1177 # The call with PACKAGE and VERSION arguments is the old style
1178 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1179 # and VERSION should now be passed to AC_INIT and removed from
1180 # the call to AM_INIT_AUTOMAKE.
1181 # We support both call styles for the transition.  After
1182 # the next Automake release, Autoconf can make the AC_INIT
1183 # arguments mandatory, and then we can depend on a new Autoconf
1184 # release and drop the old call support.
1185 AC_DEFUN([AM_INIT_AUTOMAKE],
1186 [AC_PREREQ([2.62])dnl
1187 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1188 dnl the ones we care about.
1189 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1190 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1191 AC_REQUIRE([AC_PROG_INSTALL])dnl
1192 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1193   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1194   # is not polluted with repeated "-I."
1195   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1196   # test to see if srcdir already configured
1197   if test -f $srcdir/config.status; then
1198     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1199   fi
1200 fi
1201
1202 # test whether we have cygpath
1203 if test -z "$CYGPATH_W"; then
1204   if (cygpath --version) >/dev/null 2>/dev/null; then
1205     CYGPATH_W='cygpath -w'
1206   else
1207     CYGPATH_W=echo
1208   fi
1209 fi
1210 AC_SUBST([CYGPATH_W])
1211
1212 # Define the identity of the package.
1213 dnl Distinguish between old-style and new-style calls.
1214 m4_ifval([$2],
1215 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1216  AC_SUBST([PACKAGE], [$1])dnl
1217  AC_SUBST([VERSION], [$2])],
1218 [_AM_SET_OPTIONS([$1])dnl
1219 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1220 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1221   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1222  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1223  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1224
1225 _AM_IF_OPTION([no-define],,
1226 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1227  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1228
1229 # Some tools Automake needs.
1230 AC_REQUIRE([AM_SANITY_CHECK])dnl
1231 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1232 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1233 AM_MISSING_PROG(AUTOCONF, autoconf)
1234 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1235 AM_MISSING_PROG(AUTOHEADER, autoheader)
1236 AM_MISSING_PROG(MAKEINFO, makeinfo)
1237 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1238 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1239 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1240 # We need awk for the "check" target.  The system "awk" is bad on
1241 # some platforms.
1242 AC_REQUIRE([AC_PROG_AWK])dnl
1243 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1244 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1245 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1246               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1247                              [_AM_PROG_TAR([v7])])])
1248 _AM_IF_OPTION([no-dependencies],,
1249 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1250                   [_AM_DEPENDENCIES(CC)],
1251                   [define([AC_PROG_CC],
1252                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1253 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1254                   [_AM_DEPENDENCIES(CXX)],
1255                   [define([AC_PROG_CXX],
1256                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1257 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1258                   [_AM_DEPENDENCIES(OBJC)],
1259                   [define([AC_PROG_OBJC],
1260                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1261 ])
1262 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1263 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1264 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1265 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1266 AC_CONFIG_COMMANDS_PRE(dnl
1267 [m4_provide_if([_AM_COMPILER_EXEEXT],
1268   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1269 ])
1270
1271 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1272 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1273 dnl mangled by Autoconf and run in a shell conditional statement.
1274 m4_define([_AC_COMPILER_EXEEXT],
1275 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1276
1277
1278 # When config.status generates a header, we must update the stamp-h file.
1279 # This file resides in the same directory as the config header
1280 # that is generated.  The stamp files are numbered to have different names.
1281
1282 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1283 # loop where config.status creates the headers, so we can generate
1284 # our stamp files there.
1285 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1286 [# Compute $1's index in $config_headers.
1287 _am_arg=$1
1288 _am_stamp_count=1
1289 for _am_header in $config_headers :; do
1290   case $_am_header in
1291     $_am_arg | $_am_arg:* )
1292       break ;;
1293     * )
1294       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1295   esac
1296 done
1297 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1298
1299 # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
1300 # Inc.
1301 #
1302 # This file is free software; the Free Software Foundation
1303 # gives unlimited permission to copy and/or distribute it,
1304 # with or without modifications, as long as this notice is preserved.
1305
1306 # serial 1
1307
1308 # AM_PROG_INSTALL_SH
1309 # ------------------
1310 # Define $install_sh.
1311 AC_DEFUN([AM_PROG_INSTALL_SH],
1312 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1313 if test x"${install_sh}" != xset; then
1314   case $am_aux_dir in
1315   *\ * | *\     *)
1316     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1317   *)
1318     install_sh="\${SHELL} $am_aux_dir/install-sh"
1319   esac
1320 fi
1321 AC_SUBST(install_sh)])
1322
1323 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1324 #
1325 # This file is free software; the Free Software Foundation
1326 # gives unlimited permission to copy and/or distribute it,
1327 # with or without modifications, as long as this notice is preserved.
1328
1329 # serial 2
1330
1331 # Check whether the underlying file-system supports filenames
1332 # with a leading dot.  For instance MS-DOS doesn't.
1333 AC_DEFUN([AM_SET_LEADING_DOT],
1334 [rm -rf .tst 2>/dev/null
1335 mkdir .tst 2>/dev/null
1336 if test -d .tst; then
1337   am__leading_dot=.
1338 else
1339   am__leading_dot=_
1340 fi
1341 rmdir .tst 2>/dev/null
1342 AC_SUBST([am__leading_dot])])
1343
1344 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1345
1346 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1347 #
1348 # This file is free software; the Free Software Foundation
1349 # gives unlimited permission to copy and/or distribute it,
1350 # with or without modifications, as long as this notice is preserved.
1351
1352 # serial 4
1353
1354 # AM_MAKE_INCLUDE()
1355 # -----------------
1356 # Check to see how make treats includes.
1357 AC_DEFUN([AM_MAKE_INCLUDE],
1358 [am_make=${MAKE-make}
1359 cat > confinc << 'END'
1360 am__doit:
1361         @echo this is the am__doit target
1362 .PHONY: am__doit
1363 END
1364 # If we don't find an include directive, just comment out the code.
1365 AC_MSG_CHECKING([for style of include used by $am_make])
1366 am__include="#"
1367 am__quote=
1368 _am_result=none
1369 # First try GNU make style include.
1370 echo "include confinc" > confmf
1371 # Ignore all kinds of additional output from `make'.
1372 case `$am_make -s -f confmf 2> /dev/null` in #(
1373 *the\ am__doit\ target*)
1374   am__include=include
1375   am__quote=
1376   _am_result=GNU
1377   ;;
1378 esac
1379 # Now try BSD make style include.
1380 if test "$am__include" = "#"; then
1381    echo '.include "confinc"' > confmf
1382    case `$am_make -s -f confmf 2> /dev/null` in #(
1383    *the\ am__doit\ target*)
1384      am__include=.include
1385      am__quote="\""
1386      _am_result=BSD
1387      ;;
1388    esac
1389 fi
1390 AC_SUBST([am__include])
1391 AC_SUBST([am__quote])
1392 AC_MSG_RESULT([$_am_result])
1393 rm -f confinc confmf
1394 ])
1395
1396 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1397
1398 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
1399 # Free Software Foundation, Inc.
1400 #
1401 # This file is free software; the Free Software Foundation
1402 # gives unlimited permission to copy and/or distribute it,
1403 # with or without modifications, as long as this notice is preserved.
1404
1405 # serial 6
1406
1407 # AM_MISSING_PROG(NAME, PROGRAM)
1408 # ------------------------------
1409 AC_DEFUN([AM_MISSING_PROG],
1410 [AC_REQUIRE([AM_MISSING_HAS_RUN])
1411 $1=${$1-"${am_missing_run}$2"}
1412 AC_SUBST($1)])
1413
1414
1415 # AM_MISSING_HAS_RUN
1416 # ------------------
1417 # Define MISSING if not defined so far and test if it supports --run.
1418 # If it does, set am_missing_run to use it, otherwise, to nothing.
1419 AC_DEFUN([AM_MISSING_HAS_RUN],
1420 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1421 AC_REQUIRE_AUX_FILE([missing])dnl
1422 if test x"${MISSING+set}" != xset; then
1423   case $am_aux_dir in
1424   *\ * | *\     *)
1425     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
1426   *)
1427     MISSING="\${SHELL} $am_aux_dir/missing" ;;
1428   esac
1429 fi
1430 # Use eval to expand $SHELL
1431 if eval "$MISSING --run true"; then
1432   am_missing_run="$MISSING --run "
1433 else
1434   am_missing_run=
1435   AC_MSG_WARN([`missing' script is too old or missing])
1436 fi
1437 ])
1438
1439 # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
1440 # Inc.
1441 #
1442 # This file is free software; the Free Software Foundation
1443 # gives unlimited permission to copy and/or distribute it,
1444 # with or without modifications, as long as this notice is preserved.
1445
1446 # serial 1
1447
1448 # AM_PROG_MKDIR_P
1449 # ---------------
1450 # Check for `mkdir -p'.
1451 AC_DEFUN([AM_PROG_MKDIR_P],
1452 [AC_PREREQ([2.60])dnl
1453 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1454 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
1455 dnl while keeping a definition of mkdir_p for backward compatibility.
1456 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
1457 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
1458 dnl Makefile.ins that do not define MKDIR_P, so we do our own
1459 dnl adjustment using top_builddir (which is defined more often than
1460 dnl MKDIR_P).
1461 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
1462 case $mkdir_p in
1463   [[\\/$]]* | ?:[[\\/]]*) ;;
1464   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
1465 esac
1466 ])
1467
1468 # Helper functions for option handling.                     -*- Autoconf -*-
1469
1470 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
1471 # Foundation, Inc.
1472 #
1473 # This file is free software; the Free Software Foundation
1474 # gives unlimited permission to copy and/or distribute it,
1475 # with or without modifications, as long as this notice is preserved.
1476
1477 # serial 5
1478
1479 # _AM_MANGLE_OPTION(NAME)
1480 # -----------------------
1481 AC_DEFUN([_AM_MANGLE_OPTION],
1482 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1483
1484 # _AM_SET_OPTION(NAME)
1485 # --------------------
1486 # Set option NAME.  Presently that only means defining a flag for this option.
1487 AC_DEFUN([_AM_SET_OPTION],
1488 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
1489
1490 # _AM_SET_OPTIONS(OPTIONS)
1491 # ------------------------
1492 # OPTIONS is a space-separated list of Automake options.
1493 AC_DEFUN([_AM_SET_OPTIONS],
1494 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1495
1496 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
1497 # -------------------------------------------
1498 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
1499 AC_DEFUN([_AM_IF_OPTION],
1500 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1501
1502 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1503
1504 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
1505 # Free Software Foundation, Inc.
1506 #
1507 # This file is free software; the Free Software Foundation
1508 # gives unlimited permission to copy and/or distribute it,
1509 # with or without modifications, as long as this notice is preserved.
1510
1511 # serial 5
1512
1513 # AM_SANITY_CHECK
1514 # ---------------
1515 AC_DEFUN([AM_SANITY_CHECK],
1516 [AC_MSG_CHECKING([whether build environment is sane])
1517 # Just in case
1518 sleep 1
1519 echo timestamp > conftest.file
1520 # Reject unsafe characters in $srcdir or the absolute working directory
1521 # name.  Accept space and tab only in the latter.
1522 am_lf='
1523 '
1524 case `pwd` in
1525   *[[\\\"\#\$\&\'\`$am_lf]]*)
1526     AC_MSG_ERROR([unsafe absolute working directory name]);;
1527 esac
1528 case $srcdir in
1529   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
1530     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
1531 esac
1532
1533 # Do `set' in a subshell so we don't clobber the current shell's
1534 # arguments.  Must try -L first in case configure is actually a
1535 # symlink; some systems play weird games with the mod time of symlinks
1536 # (eg FreeBSD returns the mod time of the symlink's containing
1537 # directory).
1538 if (
1539    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
1540    if test "$[*]" = "X"; then
1541       # -L didn't work.
1542       set X `ls -t "$srcdir/configure" conftest.file`
1543    fi
1544    rm -f conftest.file
1545    if test "$[*]" != "X $srcdir/configure conftest.file" \
1546       && test "$[*]" != "X conftest.file $srcdir/configure"; then
1547
1548       # If neither matched, then we have a broken ls.  This can happen
1549       # if, for instance, CONFIG_SHELL is bash and it inherits a
1550       # broken ls alias from the environment.  This has actually
1551       # happened.  Such a system could not be considered "sane".
1552       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
1553 alias in your environment])
1554    fi
1555
1556    test "$[2]" = conftest.file
1557    )
1558 then
1559    # Ok.
1560    :
1561 else
1562    AC_MSG_ERROR([newly created file is older than distributed files!
1563 Check your system clock])
1564 fi
1565 AC_MSG_RESULT(yes)])
1566
1567 # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
1568 #
1569 # This file is free software; the Free Software Foundation
1570 # gives unlimited permission to copy and/or distribute it,
1571 # with or without modifications, as long as this notice is preserved.
1572
1573 # serial 1
1574
1575 # AM_PROG_INSTALL_STRIP
1576 # ---------------------
1577 # One issue with vendor `install' (even GNU) is that you can't
1578 # specify the program used to strip binaries.  This is especially
1579 # annoying in cross-compiling environments, where the build's strip
1580 # is unlikely to handle the host's binaries.
1581 # Fortunately install-sh will honor a STRIPPROG variable, so we
1582 # always use install-sh in `make install-strip', and initialize
1583 # STRIPPROG with the value of the STRIP variable (set by the user).
1584 AC_DEFUN([AM_PROG_INSTALL_STRIP],
1585 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1586 # Installed binaries are usually stripped using `strip' when the user
1587 # run `make install-strip'.  However `strip' might not be the right
1588 # tool to use in cross-compilation environments, therefore Automake
1589 # will honor the `STRIP' environment variable to overrule this program.
1590 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
1591 if test "$cross_compiling" != no; then
1592   AC_CHECK_TOOL([STRIP], [strip], :)
1593 fi
1594 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1595 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1596
1597 # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
1598 #
1599 # This file is free software; the Free Software Foundation
1600 # gives unlimited permission to copy and/or distribute it,
1601 # with or without modifications, as long as this notice is preserved.
1602
1603 # serial 3
1604
1605 # _AM_SUBST_NOTMAKE(VARIABLE)
1606 # ---------------------------
1607 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
1608 # This macro is traced by Automake.
1609 AC_DEFUN([_AM_SUBST_NOTMAKE])
1610
1611 # AM_SUBST_NOTMAKE(VARIABLE)
1612 # --------------------------
1613 # Public sister of _AM_SUBST_NOTMAKE.
1614 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1615
1616 # Check how to create a tarball.                            -*- Autoconf -*-
1617
1618 # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
1619 #
1620 # This file is free software; the Free Software Foundation
1621 # gives unlimited permission to copy and/or distribute it,
1622 # with or without modifications, as long as this notice is preserved.
1623
1624 # serial 2
1625
1626 # _AM_PROG_TAR(FORMAT)
1627 # --------------------
1628 # Check how to create a tarball in format FORMAT.
1629 # FORMAT should be one of `v7', `ustar', or `pax'.
1630 #
1631 # Substitute a variable $(am__tar) that is a command
1632 # writing to stdout a FORMAT-tarball containing the directory
1633 # $tardir.
1634 #     tardir=directory && $(am__tar) > result.tar
1635 #
1636 # Substitute a variable $(am__untar) that extract such
1637 # a tarball read from stdin.
1638 #     $(am__untar) < result.tar
1639 AC_DEFUN([_AM_PROG_TAR],
1640 [# Always define AMTAR for backward compatibility.  Yes, it's still used
1641 # in the wild :-(  We should find a proper way to deprecate it ...
1642 AC_SUBST([AMTAR], ['$${TAR-tar}'])
1643 m4_if([$1], [v7],
1644      [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
1645      [m4_case([$1], [ustar],, [pax],,
1646               [m4_fatal([Unknown tar format])])
1647 AC_MSG_CHECKING([how to create a $1 tar archive])
1648 # Loop over all known methods to create a tar archive until one works.
1649 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1650 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
1651 # Do not fold the above two line into one, because Tru64 sh and
1652 # Solaris sh will not grok spaces in the rhs of `-'.
1653 for _am_tool in $_am_tools
1654 do
1655   case $_am_tool in
1656   gnutar)
1657     for _am_tar in tar gnutar gtar;
1658     do
1659       AM_RUN_LOG([$_am_tar --version]) && break
1660     done
1661     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
1662     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
1663     am__untar="$_am_tar -xf -"
1664     ;;
1665   plaintar)
1666     # Must skip GNU tar: if it does not support --format= it doesn't create
1667     # ustar tarball either.
1668     (tar --version) >/dev/null 2>&1 && continue
1669     am__tar='tar chf - "$$tardir"'
1670     am__tar_='tar chf - "$tardir"'
1671     am__untar='tar xf -'
1672     ;;
1673   pax)
1674     am__tar='pax -L -x $1 -w "$$tardir"'
1675     am__tar_='pax -L -x $1 -w "$tardir"'
1676     am__untar='pax -r'
1677     ;;
1678   cpio)
1679     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
1680     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
1681     am__untar='cpio -i -H $1 -d'
1682     ;;
1683   none)
1684     am__tar=false
1685     am__tar_=false
1686     am__untar=false
1687     ;;
1688   esac
1689
1690   # If the value was cached, stop now.  We just wanted to have am__tar
1691   # and am__untar set.
1692   test -n "${am_cv_prog_tar_$1}" && break
1693
1694   # tar/untar a dummy directory, and stop if the command works
1695   rm -rf conftest.dir
1696   mkdir conftest.dir
1697   echo GrepMe > conftest.dir/file
1698   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
1699   rm -rf conftest.dir
1700   if test -s conftest.tar; then
1701     AM_RUN_LOG([$am__untar <conftest.tar])
1702     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
1703   fi
1704 done
1705 rm -rf conftest.dir
1706
1707 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
1708 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
1709 AC_SUBST([am__tar])
1710 AC_SUBST([am__untar])
1711 ]) # _AM_PROG_TAR
1712
1713 m4_include([m4/common.m4])
1714 m4_include([m4/libtool.m4])
1715 m4_include([m4/ltoptions.m4])
1716 m4_include([m4/ltsugar.m4])
1717 m4_include([m4/ltversion.m4])
1718 m4_include([m4/lt~obsolete.m4])