Merge branch 'tizen' into tizen_3.0
[platform/upstream/libzbar.git] / aclocal.m4
1 # generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2
3 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
4
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 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
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 # iconv.m4 serial 18 (gettext-0.18.2)
24 dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc.
25 dnl This file is free software; the Free Software Foundation
26 dnl gives unlimited permission to copy and/or distribute it,
27 dnl with or without modifications, as long as this notice is preserved.
28
29 dnl From Bruno Haible.
30
31 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
32 [
33   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
34   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
35   AC_REQUIRE([AC_LIB_RPATH])
36
37   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
38   dnl accordingly.
39   AC_LIB_LINKFLAGS_BODY([iconv])
40 ])
41
42 AC_DEFUN([AM_ICONV_LINK],
43 [
44   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
45   dnl those with the standalone portable GNU libiconv installed).
46   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
47
48   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
49   dnl accordingly.
50   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
51
52   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
53   dnl because if the user has installed libiconv and not disabled its use
54   dnl via --without-libiconv-prefix, he wants to use it. The first
55   dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
56   am_save_CPPFLAGS="$CPPFLAGS"
57   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
58
59   AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
60     am_cv_func_iconv="no, consider installing GNU libiconv"
61     am_cv_lib_iconv=no
62     AC_LINK_IFELSE(
63       [AC_LANG_PROGRAM(
64          [[
65 #include <stdlib.h>
66 #include <iconv.h>
67          ]],
68          [[iconv_t cd = iconv_open("","");
69            iconv(cd,NULL,NULL,NULL,NULL);
70            iconv_close(cd);]])],
71       [am_cv_func_iconv=yes])
72     if test "$am_cv_func_iconv" != yes; then
73       am_save_LIBS="$LIBS"
74       LIBS="$LIBS $LIBICONV"
75       AC_LINK_IFELSE(
76         [AC_LANG_PROGRAM(
77            [[
78 #include <stdlib.h>
79 #include <iconv.h>
80            ]],
81            [[iconv_t cd = iconv_open("","");
82              iconv(cd,NULL,NULL,NULL,NULL);
83              iconv_close(cd);]])],
84         [am_cv_lib_iconv=yes]
85         [am_cv_func_iconv=yes])
86       LIBS="$am_save_LIBS"
87     fi
88   ])
89   if test "$am_cv_func_iconv" = yes; then
90     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
91       dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
92       dnl Solaris 10.
93       am_save_LIBS="$LIBS"
94       if test $am_cv_lib_iconv = yes; then
95         LIBS="$LIBS $LIBICONV"
96       fi
97       AC_RUN_IFELSE(
98         [AC_LANG_SOURCE([[
99 #include <iconv.h>
100 #include <string.h>
101 int main ()
102 {
103   int result = 0;
104   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
105      returns.  */
106   {
107     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
108     if (cd_utf8_to_88591 != (iconv_t)(-1))
109       {
110         static const char input[] = "\342\202\254"; /* EURO SIGN */
111         char buf[10];
112         const char *inptr = input;
113         size_t inbytesleft = strlen (input);
114         char *outptr = buf;
115         size_t outbytesleft = sizeof (buf);
116         size_t res = iconv (cd_utf8_to_88591,
117                             (char **) &inptr, &inbytesleft,
118                             &outptr, &outbytesleft);
119         if (res == 0)
120           result |= 1;
121         iconv_close (cd_utf8_to_88591);
122       }
123   }
124   /* Test against Solaris 10 bug: Failures are not distinguishable from
125      successful returns.  */
126   {
127     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
128     if (cd_ascii_to_88591 != (iconv_t)(-1))
129       {
130         static const char input[] = "\263";
131         char buf[10];
132         const char *inptr = input;
133         size_t inbytesleft = strlen (input);
134         char *outptr = buf;
135         size_t outbytesleft = sizeof (buf);
136         size_t res = iconv (cd_ascii_to_88591,
137                             (char **) &inptr, &inbytesleft,
138                             &outptr, &outbytesleft);
139         if (res == 0)
140           result |= 2;
141         iconv_close (cd_ascii_to_88591);
142       }
143   }
144   /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
145   {
146     iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
147     if (cd_88591_to_utf8 != (iconv_t)(-1))
148       {
149         static const char input[] = "\304";
150         static char buf[2] = { (char)0xDE, (char)0xAD };
151         const char *inptr = input;
152         size_t inbytesleft = 1;
153         char *outptr = buf;
154         size_t outbytesleft = 1;
155         size_t res = iconv (cd_88591_to_utf8,
156                             (char **) &inptr, &inbytesleft,
157                             &outptr, &outbytesleft);
158         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
159           result |= 4;
160         iconv_close (cd_88591_to_utf8);
161       }
162   }
163 #if 0 /* This bug could be worked around by the caller.  */
164   /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
165   {
166     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
167     if (cd_88591_to_utf8 != (iconv_t)(-1))
168       {
169         static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
170         char buf[50];
171         const char *inptr = input;
172         size_t inbytesleft = strlen (input);
173         char *outptr = buf;
174         size_t outbytesleft = sizeof (buf);
175         size_t res = iconv (cd_88591_to_utf8,
176                             (char **) &inptr, &inbytesleft,
177                             &outptr, &outbytesleft);
178         if ((int)res > 0)
179           result |= 8;
180         iconv_close (cd_88591_to_utf8);
181       }
182   }
183 #endif
184   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
185      provided.  */
186   if (/* Try standardized names.  */
187       iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
188       /* Try IRIX, OSF/1 names.  */
189       && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
190       /* Try AIX names.  */
191       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
192       /* Try HP-UX names.  */
193       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
194     result |= 16;
195   return result;
196 }]])],
197         [am_cv_func_iconv_works=yes],
198         [am_cv_func_iconv_works=no],
199         [
200 changequote(,)dnl
201          case "$host_os" in
202            aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
203            *)            am_cv_func_iconv_works="guessing yes" ;;
204          esac
205 changequote([,])dnl
206         ])
207       LIBS="$am_save_LIBS"
208     ])
209     case "$am_cv_func_iconv_works" in
210       *no) am_func_iconv=no am_cv_lib_iconv=no ;;
211       *)   am_func_iconv=yes ;;
212     esac
213   else
214     am_func_iconv=no am_cv_lib_iconv=no
215   fi
216   if test "$am_func_iconv" = yes; then
217     AC_DEFINE([HAVE_ICONV], [1],
218       [Define if you have the iconv() function and it works.])
219   fi
220   if test "$am_cv_lib_iconv" = yes; then
221     AC_MSG_CHECKING([how to link with libiconv])
222     AC_MSG_RESULT([$LIBICONV])
223   else
224     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
225     dnl either.
226     CPPFLAGS="$am_save_CPPFLAGS"
227     LIBICONV=
228     LTLIBICONV=
229   fi
230   AC_SUBST([LIBICONV])
231   AC_SUBST([LTLIBICONV])
232 ])
233
234 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
235 dnl avoid warnings like
236 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
237 dnl This is tricky because of the way 'aclocal' is implemented:
238 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
239 dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
240 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
241 dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
242 dnl   warnings.
243 m4_define([gl_iconv_AC_DEFUN],
244   m4_version_prereq([2.64],
245     [[AC_DEFUN_ONCE(
246         [$1], [$2])]],
247     [m4_ifdef([gl_00GNULIB],
248        [[AC_DEFUN_ONCE(
249            [$1], [$2])]],
250        [[AC_DEFUN(
251            [$1], [$2])]])]))
252 gl_iconv_AC_DEFUN([AM_ICONV],
253 [
254   AM_ICONV_LINK
255   if test "$am_cv_func_iconv" = yes; then
256     AC_MSG_CHECKING([for iconv declaration])
257     AC_CACHE_VAL([am_cv_proto_iconv], [
258       AC_COMPILE_IFELSE(
259         [AC_LANG_PROGRAM(
260            [[
261 #include <stdlib.h>
262 #include <iconv.h>
263 extern
264 #ifdef __cplusplus
265 "C"
266 #endif
267 #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
268 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
269 #else
270 size_t iconv();
271 #endif
272            ]],
273            [[]])],
274         [am_cv_proto_iconv_arg1=""],
275         [am_cv_proto_iconv_arg1="const"])
276       am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
277     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
278     AC_MSG_RESULT([
279          $am_cv_proto_iconv])
280     AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
281       [Define as const if the declaration of iconv() needs const.])
282     dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
283     m4_ifdef([gl_ICONV_H_DEFAULTS],
284       [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
285        if test -n "$am_cv_proto_iconv_arg1"; then
286          ICONV_CONST="const"
287        fi
288       ])
289   fi
290 ])
291
292 # lib-ld.m4 serial 6
293 dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc.
294 dnl This file is free software; the Free Software Foundation
295 dnl gives unlimited permission to copy and/or distribute it,
296 dnl with or without modifications, as long as this notice is preserved.
297
298 dnl Subroutines of libtool.m4,
299 dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
300 dnl collision with libtool.m4.
301
302 dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
303 AC_DEFUN([AC_LIB_PROG_LD_GNU],
304 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
305 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
306 case `$LD -v 2>&1 </dev/null` in
307 *GNU* | *'with BFD'*)
308   acl_cv_prog_gnu_ld=yes
309   ;;
310 *)
311   acl_cv_prog_gnu_ld=no
312   ;;
313 esac])
314 with_gnu_ld=$acl_cv_prog_gnu_ld
315 ])
316
317 dnl From libtool-2.4. Sets the variable LD.
318 AC_DEFUN([AC_LIB_PROG_LD],
319 [AC_REQUIRE([AC_PROG_CC])dnl
320 AC_REQUIRE([AC_CANONICAL_HOST])dnl
321
322 AC_ARG_WITH([gnu-ld],
323     [AS_HELP_STRING([--with-gnu-ld],
324         [assume the C compiler uses GNU ld [default=no]])],
325     [test "$withval" = no || with_gnu_ld=yes],
326     [with_gnu_ld=no])dnl
327
328 # Prepare PATH_SEPARATOR.
329 # The user is always right.
330 if test "${PATH_SEPARATOR+set}" != set; then
331   # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
332   # contains only /bin. Note that ksh looks also at the FPATH variable,
333   # so we have to set that as well for the test.
334   PATH_SEPARATOR=:
335   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
336     && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
337            || PATH_SEPARATOR=';'
338        }
339 fi
340
341 ac_prog=ld
342 if test "$GCC" = yes; then
343   # Check if gcc -print-prog-name=ld gives a path.
344   AC_MSG_CHECKING([for ld used by $CC])
345   case $host in
346   *-*-mingw*)
347     # gcc leaves a trailing carriage return which upsets mingw
348     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
349   *)
350     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
351   esac
352   case $ac_prog in
353     # Accept absolute paths.
354     [[\\/]]* | ?:[[\\/]]*)
355       re_direlt='/[[^/]][[^/]]*/\.\./'
356       # Canonicalize the pathname of ld
357       ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
358       while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
359         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
360       done
361       test -z "$LD" && LD="$ac_prog"
362       ;;
363   "")
364     # If it fails, then pretend we aren't using GCC.
365     ac_prog=ld
366     ;;
367   *)
368     # If it is relative, then search for the first ld in PATH.
369     with_gnu_ld=unknown
370     ;;
371   esac
372 elif test "$with_gnu_ld" = yes; then
373   AC_MSG_CHECKING([for GNU ld])
374 else
375   AC_MSG_CHECKING([for non-GNU ld])
376 fi
377 AC_CACHE_VAL([acl_cv_path_LD],
378 [if test -z "$LD"; then
379   acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
380   for ac_dir in $PATH; do
381     IFS="$acl_save_ifs"
382     test -z "$ac_dir" && ac_dir=.
383     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
384       acl_cv_path_LD="$ac_dir/$ac_prog"
385       # Check to see if the program is GNU ld.  I'd rather use --version,
386       # but apparently some variants of GNU ld only accept -v.
387       # Break only if it was the GNU/non-GNU ld that we prefer.
388       case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
389       *GNU* | *'with BFD'*)
390         test "$with_gnu_ld" != no && break
391         ;;
392       *)
393         test "$with_gnu_ld" != yes && break
394         ;;
395       esac
396     fi
397   done
398   IFS="$acl_save_ifs"
399 else
400   acl_cv_path_LD="$LD" # Let the user override the test with a path.
401 fi])
402 LD="$acl_cv_path_LD"
403 if test -n "$LD"; then
404   AC_MSG_RESULT([$LD])
405 else
406   AC_MSG_RESULT([no])
407 fi
408 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
409 AC_LIB_PROG_LD_GNU
410 ])
411
412 # lib-link.m4 serial 26 (gettext-0.18.2)
413 dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
414 dnl This file is free software; the Free Software Foundation
415 dnl gives unlimited permission to copy and/or distribute it,
416 dnl with or without modifications, as long as this notice is preserved.
417
418 dnl From Bruno Haible.
419
420 AC_PREREQ([2.54])
421
422 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
423 dnl the libraries corresponding to explicit and implicit dependencies.
424 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
425 dnl augments the CPPFLAGS variable.
426 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
427 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
428 AC_DEFUN([AC_LIB_LINKFLAGS],
429 [
430   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
431   AC_REQUIRE([AC_LIB_RPATH])
432   pushdef([Name],[m4_translit([$1],[./+-], [____])])
433   pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
434                                    [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
435   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
436     AC_LIB_LINKFLAGS_BODY([$1], [$2])
437     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
438     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
439     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
440     ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
441   ])
442   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
443   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
444   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
445   LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
446   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
447   AC_SUBST([LIB]NAME)
448   AC_SUBST([LTLIB]NAME)
449   AC_SUBST([LIB]NAME[_PREFIX])
450   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
451   dnl results of this search when this library appears as a dependency.
452   HAVE_LIB[]NAME=yes
453   popdef([NAME])
454   popdef([Name])
455 ])
456
457 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
458 dnl searches for libname and the libraries corresponding to explicit and
459 dnl implicit dependencies, together with the specified include files and
460 dnl the ability to compile and link the specified testcode. The missing-message
461 dnl defaults to 'no' and may contain additional hints for the user.
462 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
463 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
464 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
465 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
466 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
467 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
468 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
469 [
470   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
471   AC_REQUIRE([AC_LIB_RPATH])
472   pushdef([Name],[m4_translit([$1],[./+-], [____])])
473   pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
474                                    [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
475
476   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
477   dnl accordingly.
478   AC_LIB_LINKFLAGS_BODY([$1], [$2])
479
480   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
481   dnl because if the user has installed lib[]Name and not disabled its use
482   dnl via --without-lib[]Name-prefix, he wants to use it.
483   ac_save_CPPFLAGS="$CPPFLAGS"
484   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
485
486   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
487     ac_save_LIBS="$LIBS"
488     dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
489     dnl because these -l options might require -L options that are present in
490     dnl LIBS. -l options benefit only from the -L options listed before it.
491     dnl Otherwise, add it to the front of LIBS, because it may be a static
492     dnl library that depends on another static library that is present in LIBS.
493     dnl Static libraries benefit only from the static libraries listed after
494     dnl it.
495     case " $LIB[]NAME" in
496       *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
497       *)       LIBS="$LIB[]NAME $LIBS" ;;
498     esac
499     AC_LINK_IFELSE(
500       [AC_LANG_PROGRAM([[$3]], [[$4]])],
501       [ac_cv_lib[]Name=yes],
502       [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
503     LIBS="$ac_save_LIBS"
504   ])
505   if test "$ac_cv_lib[]Name" = yes; then
506     HAVE_LIB[]NAME=yes
507     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
508     AC_MSG_CHECKING([how to link with lib[]$1])
509     AC_MSG_RESULT([$LIB[]NAME])
510   else
511     HAVE_LIB[]NAME=no
512     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
513     dnl $INC[]NAME either.
514     CPPFLAGS="$ac_save_CPPFLAGS"
515     LIB[]NAME=
516     LTLIB[]NAME=
517     LIB[]NAME[]_PREFIX=
518   fi
519   AC_SUBST([HAVE_LIB]NAME)
520   AC_SUBST([LIB]NAME)
521   AC_SUBST([LTLIB]NAME)
522   AC_SUBST([LIB]NAME[_PREFIX])
523   popdef([NAME])
524   popdef([Name])
525 ])
526
527 dnl Determine the platform dependent parameters needed to use rpath:
528 dnl   acl_libext,
529 dnl   acl_shlibext,
530 dnl   acl_libname_spec,
531 dnl   acl_library_names_spec,
532 dnl   acl_hardcode_libdir_flag_spec,
533 dnl   acl_hardcode_libdir_separator,
534 dnl   acl_hardcode_direct,
535 dnl   acl_hardcode_minus_L.
536 AC_DEFUN([AC_LIB_RPATH],
537 [
538   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
539   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
540   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
541   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
542   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
543   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
544   AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
545     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
546     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
547     . ./conftest.sh
548     rm -f ./conftest.sh
549     acl_cv_rpath=done
550   ])
551   wl="$acl_cv_wl"
552   acl_libext="$acl_cv_libext"
553   acl_shlibext="$acl_cv_shlibext"
554   acl_libname_spec="$acl_cv_libname_spec"
555   acl_library_names_spec="$acl_cv_library_names_spec"
556   acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
557   acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
558   acl_hardcode_direct="$acl_cv_hardcode_direct"
559   acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
560   dnl Determine whether the user wants rpath handling at all.
561   AC_ARG_ENABLE([rpath],
562     [  --disable-rpath         do not hardcode runtime library paths],
563     :, enable_rpath=yes)
564 ])
565
566 dnl AC_LIB_FROMPACKAGE(name, package)
567 dnl declares that libname comes from the given package. The configure file
568 dnl will then not have a --with-libname-prefix option but a
569 dnl --with-package-prefix option. Several libraries can come from the same
570 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
571 dnl macro call that searches for libname.
572 AC_DEFUN([AC_LIB_FROMPACKAGE],
573 [
574   pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
575                                    [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
576   define([acl_frompackage_]NAME, [$2])
577   popdef([NAME])
578   pushdef([PACK],[$2])
579   pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
580                                      [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
581   define([acl_libsinpackage_]PACKUP,
582     m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
583   popdef([PACKUP])
584   popdef([PACK])
585 ])
586
587 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
588 dnl the libraries corresponding to explicit and implicit dependencies.
589 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
590 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
591 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
592 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
593 [
594   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
595   pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
596                                    [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
597   pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
598   pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
599                                      [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
600   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
601   dnl Autoconf >= 2.61 supports dots in --with options.
602   pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
603   dnl By default, look in $includedir and $libdir.
604   use_additional=yes
605   AC_LIB_WITH_FINAL_PREFIX([
606     eval additional_includedir=\"$includedir\"
607     eval additional_libdir=\"$libdir\"
608   ])
609   AC_ARG_WITH(P_A_C_K[-prefix],
610 [[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
611   --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
612 [
613     if test "X$withval" = "Xno"; then
614       use_additional=no
615     else
616       if test "X$withval" = "X"; then
617         AC_LIB_WITH_FINAL_PREFIX([
618           eval additional_includedir=\"$includedir\"
619           eval additional_libdir=\"$libdir\"
620         ])
621       else
622         additional_includedir="$withval/include"
623         additional_libdir="$withval/$acl_libdirstem"
624         if test "$acl_libdirstem2" != "$acl_libdirstem" \
625            && ! test -d "$withval/$acl_libdirstem"; then
626           additional_libdir="$withval/$acl_libdirstem2"
627         fi
628       fi
629     fi
630 ])
631   dnl Search the library and its dependencies in $additional_libdir and
632   dnl $LDFLAGS. Using breadth-first-seach.
633   LIB[]NAME=
634   LTLIB[]NAME=
635   INC[]NAME=
636   LIB[]NAME[]_PREFIX=
637   dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
638   dnl computed. So it has to be reset here.
639   HAVE_LIB[]NAME=
640   rpathdirs=
641   ltrpathdirs=
642   names_already_handled=
643   names_next_round='$1 $2'
644   while test -n "$names_next_round"; do
645     names_this_round="$names_next_round"
646     names_next_round=
647     for name in $names_this_round; do
648       already_handled=
649       for n in $names_already_handled; do
650         if test "$n" = "$name"; then
651           already_handled=yes
652           break
653         fi
654       done
655       if test -z "$already_handled"; then
656         names_already_handled="$names_already_handled $name"
657         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
658         dnl or AC_LIB_HAVE_LINKFLAGS call.
659         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
660         eval value=\"\$HAVE_LIB$uppername\"
661         if test -n "$value"; then
662           if test "$value" = yes; then
663             eval value=\"\$LIB$uppername\"
664             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
665             eval value=\"\$LTLIB$uppername\"
666             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
667           else
668             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
669             dnl that this library doesn't exist. So just drop it.
670             :
671           fi
672         else
673           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
674           dnl and the already constructed $LIBNAME/$LTLIBNAME.
675           found_dir=
676           found_la=
677           found_so=
678           found_a=
679           eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
680           if test -n "$acl_shlibext"; then
681             shrext=".$acl_shlibext"             # typically: shrext=.so
682           else
683             shrext=
684           fi
685           if test $use_additional = yes; then
686             dir="$additional_libdir"
687             dnl The same code as in the loop below:
688             dnl First look for a shared library.
689             if test -n "$acl_shlibext"; then
690               if test -f "$dir/$libname$shrext"; then
691                 found_dir="$dir"
692                 found_so="$dir/$libname$shrext"
693               else
694                 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
695                   ver=`(cd "$dir" && \
696                         for f in "$libname$shrext".*; do echo "$f"; done \
697                         | sed -e "s,^$libname$shrext\\\\.,," \
698                         | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
699                         | sed 1q ) 2>/dev/null`
700                   if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
701                     found_dir="$dir"
702                     found_so="$dir/$libname$shrext.$ver"
703                   fi
704                 else
705                   eval library_names=\"$acl_library_names_spec\"
706                   for f in $library_names; do
707                     if test -f "$dir/$f"; then
708                       found_dir="$dir"
709                       found_so="$dir/$f"
710                       break
711                     fi
712                   done
713                 fi
714               fi
715             fi
716             dnl Then look for a static library.
717             if test "X$found_dir" = "X"; then
718               if test -f "$dir/$libname.$acl_libext"; then
719                 found_dir="$dir"
720                 found_a="$dir/$libname.$acl_libext"
721               fi
722             fi
723             if test "X$found_dir" != "X"; then
724               if test -f "$dir/$libname.la"; then
725                 found_la="$dir/$libname.la"
726               fi
727             fi
728           fi
729           if test "X$found_dir" = "X"; then
730             for x in $LDFLAGS $LTLIB[]NAME; do
731               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
732               case "$x" in
733                 -L*)
734                   dir=`echo "X$x" | sed -e 's/^X-L//'`
735                   dnl First look for a shared library.
736                   if test -n "$acl_shlibext"; then
737                     if test -f "$dir/$libname$shrext"; then
738                       found_dir="$dir"
739                       found_so="$dir/$libname$shrext"
740                     else
741                       if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
742                         ver=`(cd "$dir" && \
743                               for f in "$libname$shrext".*; do echo "$f"; done \
744                               | sed -e "s,^$libname$shrext\\\\.,," \
745                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
746                               | sed 1q ) 2>/dev/null`
747                         if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
748                           found_dir="$dir"
749                           found_so="$dir/$libname$shrext.$ver"
750                         fi
751                       else
752                         eval library_names=\"$acl_library_names_spec\"
753                         for f in $library_names; do
754                           if test -f "$dir/$f"; then
755                             found_dir="$dir"
756                             found_so="$dir/$f"
757                             break
758                           fi
759                         done
760                       fi
761                     fi
762                   fi
763                   dnl Then look for a static library.
764                   if test "X$found_dir" = "X"; then
765                     if test -f "$dir/$libname.$acl_libext"; then
766                       found_dir="$dir"
767                       found_a="$dir/$libname.$acl_libext"
768                     fi
769                   fi
770                   if test "X$found_dir" != "X"; then
771                     if test -f "$dir/$libname.la"; then
772                       found_la="$dir/$libname.la"
773                     fi
774                   fi
775                   ;;
776               esac
777               if test "X$found_dir" != "X"; then
778                 break
779               fi
780             done
781           fi
782           if test "X$found_dir" != "X"; then
783             dnl Found the library.
784             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
785             if test "X$found_so" != "X"; then
786               dnl Linking with a shared library. We attempt to hardcode its
787               dnl directory into the executable's runpath, unless it's the
788               dnl standard /usr/lib.
789               if test "$enable_rpath" = no \
790                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
791                  || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
792                 dnl No hardcoding is needed.
793                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
794               else
795                 dnl Use an explicit option to hardcode DIR into the resulting
796                 dnl binary.
797                 dnl Potentially add DIR to ltrpathdirs.
798                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
799                 haveit=
800                 for x in $ltrpathdirs; do
801                   if test "X$x" = "X$found_dir"; then
802                     haveit=yes
803                     break
804                   fi
805                 done
806                 if test -z "$haveit"; then
807                   ltrpathdirs="$ltrpathdirs $found_dir"
808                 fi
809                 dnl The hardcoding into $LIBNAME is system dependent.
810                 if test "$acl_hardcode_direct" = yes; then
811                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
812                   dnl resulting binary.
813                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
814                 else
815                   if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
816                     dnl Use an explicit option to hardcode DIR into the resulting
817                     dnl binary.
818                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
819                     dnl Potentially add DIR to rpathdirs.
820                     dnl The rpathdirs will be appended to $LIBNAME at the end.
821                     haveit=
822                     for x in $rpathdirs; do
823                       if test "X$x" = "X$found_dir"; then
824                         haveit=yes
825                         break
826                       fi
827                     done
828                     if test -z "$haveit"; then
829                       rpathdirs="$rpathdirs $found_dir"
830                     fi
831                   else
832                     dnl Rely on "-L$found_dir".
833                     dnl But don't add it if it's already contained in the LDFLAGS
834                     dnl or the already constructed $LIBNAME
835                     haveit=
836                     for x in $LDFLAGS $LIB[]NAME; do
837                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
838                       if test "X$x" = "X-L$found_dir"; then
839                         haveit=yes
840                         break
841                       fi
842                     done
843                     if test -z "$haveit"; then
844                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
845                     fi
846                     if test "$acl_hardcode_minus_L" != no; then
847                       dnl FIXME: Not sure whether we should use
848                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
849                       dnl here.
850                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
851                     else
852                       dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
853                       dnl here, because this doesn't fit in flags passed to the
854                       dnl compiler. So give up. No hardcoding. This affects only
855                       dnl very old systems.
856                       dnl FIXME: Not sure whether we should use
857                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
858                       dnl here.
859                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
860                     fi
861                   fi
862                 fi
863               fi
864             else
865               if test "X$found_a" != "X"; then
866                 dnl Linking with a static library.
867                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
868               else
869                 dnl We shouldn't come here, but anyway it's good to have a
870                 dnl fallback.
871                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
872               fi
873             fi
874             dnl Assume the include files are nearby.
875             additional_includedir=
876             case "$found_dir" in
877               */$acl_libdirstem | */$acl_libdirstem/)
878                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
879                 if test "$name" = '$1'; then
880                   LIB[]NAME[]_PREFIX="$basedir"
881                 fi
882                 additional_includedir="$basedir/include"
883                 ;;
884               */$acl_libdirstem2 | */$acl_libdirstem2/)
885                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
886                 if test "$name" = '$1'; then
887                   LIB[]NAME[]_PREFIX="$basedir"
888                 fi
889                 additional_includedir="$basedir/include"
890                 ;;
891             esac
892             if test "X$additional_includedir" != "X"; then
893               dnl Potentially add $additional_includedir to $INCNAME.
894               dnl But don't add it
895               dnl   1. if it's the standard /usr/include,
896               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
897               dnl   3. if it's already present in $CPPFLAGS or the already
898               dnl      constructed $INCNAME,
899               dnl   4. if it doesn't exist as a directory.
900               if test "X$additional_includedir" != "X/usr/include"; then
901                 haveit=
902                 if test "X$additional_includedir" = "X/usr/local/include"; then
903                   if test -n "$GCC"; then
904                     case $host_os in
905                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
906                     esac
907                   fi
908                 fi
909                 if test -z "$haveit"; then
910                   for x in $CPPFLAGS $INC[]NAME; do
911                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
912                     if test "X$x" = "X-I$additional_includedir"; then
913                       haveit=yes
914                       break
915                     fi
916                   done
917                   if test -z "$haveit"; then
918                     if test -d "$additional_includedir"; then
919                       dnl Really add $additional_includedir to $INCNAME.
920                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
921                     fi
922                   fi
923                 fi
924               fi
925             fi
926             dnl Look for dependencies.
927             if test -n "$found_la"; then
928               dnl Read the .la file. It defines the variables
929               dnl dlname, library_names, old_library, dependency_libs, current,
930               dnl age, revision, installed, dlopen, dlpreopen, libdir.
931               save_libdir="$libdir"
932               case "$found_la" in
933                 */* | *\\*) . "$found_la" ;;
934                 *) . "./$found_la" ;;
935               esac
936               libdir="$save_libdir"
937               dnl We use only dependency_libs.
938               for dep in $dependency_libs; do
939                 case "$dep" in
940                   -L*)
941                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
942                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
943                     dnl But don't add it
944                     dnl   1. if it's the standard /usr/lib,
945                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
946                     dnl   3. if it's already present in $LDFLAGS or the already
947                     dnl      constructed $LIBNAME,
948                     dnl   4. if it doesn't exist as a directory.
949                     if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
950                        && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
951                       haveit=
952                       if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
953                          || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
954                         if test -n "$GCC"; then
955                           case $host_os in
956                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
957                           esac
958                         fi
959                       fi
960                       if test -z "$haveit"; then
961                         haveit=
962                         for x in $LDFLAGS $LIB[]NAME; do
963                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
964                           if test "X$x" = "X-L$additional_libdir"; then
965                             haveit=yes
966                             break
967                           fi
968                         done
969                         if test -z "$haveit"; then
970                           if test -d "$additional_libdir"; then
971                             dnl Really add $additional_libdir to $LIBNAME.
972                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
973                           fi
974                         fi
975                         haveit=
976                         for x in $LDFLAGS $LTLIB[]NAME; do
977                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
978                           if test "X$x" = "X-L$additional_libdir"; then
979                             haveit=yes
980                             break
981                           fi
982                         done
983                         if test -z "$haveit"; then
984                           if test -d "$additional_libdir"; then
985                             dnl Really add $additional_libdir to $LTLIBNAME.
986                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
987                           fi
988                         fi
989                       fi
990                     fi
991                     ;;
992                   -R*)
993                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
994                     if test "$enable_rpath" != no; then
995                       dnl Potentially add DIR to rpathdirs.
996                       dnl The rpathdirs will be appended to $LIBNAME at the end.
997                       haveit=
998                       for x in $rpathdirs; do
999                         if test "X$x" = "X$dir"; then
1000                           haveit=yes
1001                           break
1002                         fi
1003                       done
1004                       if test -z "$haveit"; then
1005                         rpathdirs="$rpathdirs $dir"
1006                       fi
1007                       dnl Potentially add DIR to ltrpathdirs.
1008                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1009                       haveit=
1010                       for x in $ltrpathdirs; do
1011                         if test "X$x" = "X$dir"; then
1012                           haveit=yes
1013                           break
1014                         fi
1015                       done
1016                       if test -z "$haveit"; then
1017                         ltrpathdirs="$ltrpathdirs $dir"
1018                       fi
1019                     fi
1020                     ;;
1021                   -l*)
1022                     dnl Handle this in the next round.
1023                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1024                     ;;
1025                   *.la)
1026                     dnl Handle this in the next round. Throw away the .la's
1027                     dnl directory; it is already contained in a preceding -L
1028                     dnl option.
1029                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
1030                     ;;
1031                   *)
1032                     dnl Most likely an immediate library name.
1033                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
1034                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
1035                     ;;
1036                 esac
1037               done
1038             fi
1039           else
1040             dnl Didn't find the library; assume it is in the system directories
1041             dnl known to the linker and runtime loader. (All the system
1042             dnl directories known to the linker should also be known to the
1043             dnl runtime loader, otherwise the system is severely misconfigured.)
1044             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1045             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
1046           fi
1047         fi
1048       fi
1049     done
1050   done
1051   if test "X$rpathdirs" != "X"; then
1052     if test -n "$acl_hardcode_libdir_separator"; then
1053       dnl Weird platform: only the last -rpath option counts, the user must
1054       dnl pass all path elements in one option. We can arrange that for a
1055       dnl single library, but not when more than one $LIBNAMEs are used.
1056       alldirs=
1057       for found_dir in $rpathdirs; do
1058         alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
1059       done
1060       dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
1061       acl_save_libdir="$libdir"
1062       libdir="$alldirs"
1063       eval flag=\"$acl_hardcode_libdir_flag_spec\"
1064       libdir="$acl_save_libdir"
1065       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1066     else
1067       dnl The -rpath options are cumulative.
1068       for found_dir in $rpathdirs; do
1069         acl_save_libdir="$libdir"
1070         libdir="$found_dir"
1071         eval flag=\"$acl_hardcode_libdir_flag_spec\"
1072         libdir="$acl_save_libdir"
1073         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1074       done
1075     fi
1076   fi
1077   if test "X$ltrpathdirs" != "X"; then
1078     dnl When using libtool, the option that works for both libraries and
1079     dnl executables is -R. The -R options are cumulative.
1080     for found_dir in $ltrpathdirs; do
1081       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1082     done
1083   fi
1084   popdef([P_A_C_K])
1085   popdef([PACKLIBS])
1086   popdef([PACKUP])
1087   popdef([PACK])
1088   popdef([NAME])
1089 ])
1090
1091 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1092 dnl unless already present in VAR.
1093 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1094 dnl contains two or three consecutive elements that belong together.
1095 AC_DEFUN([AC_LIB_APPENDTOVAR],
1096 [
1097   for element in [$2]; do
1098     haveit=
1099     for x in $[$1]; do
1100       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1101       if test "X$x" = "X$element"; then
1102         haveit=yes
1103         break
1104       fi
1105     done
1106     if test -z "$haveit"; then
1107       [$1]="${[$1]}${[$1]:+ }$element"
1108     fi
1109   done
1110 ])
1111
1112 dnl For those cases where a variable contains several -L and -l options
1113 dnl referring to unknown libraries and directories, this macro determines the
1114 dnl necessary additional linker options for the runtime path.
1115 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1116 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1117 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1118 dnl otherwise linking without libtool is assumed.
1119 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1120 [
1121   AC_REQUIRE([AC_LIB_RPATH])
1122   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1123   $1=
1124   if test "$enable_rpath" != no; then
1125     if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1126       dnl Use an explicit option to hardcode directories into the resulting
1127       dnl binary.
1128       rpathdirs=
1129       next=
1130       for opt in $2; do
1131         if test -n "$next"; then
1132           dir="$next"
1133           dnl No need to hardcode the standard /usr/lib.
1134           if test "X$dir" != "X/usr/$acl_libdirstem" \
1135              && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1136             rpathdirs="$rpathdirs $dir"
1137           fi
1138           next=
1139         else
1140           case $opt in
1141             -L) next=yes ;;
1142             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1143                  dnl No need to hardcode the standard /usr/lib.
1144                  if test "X$dir" != "X/usr/$acl_libdirstem" \
1145                     && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1146                    rpathdirs="$rpathdirs $dir"
1147                  fi
1148                  next= ;;
1149             *) next= ;;
1150           esac
1151         fi
1152       done
1153       if test "X$rpathdirs" != "X"; then
1154         if test -n ""$3""; then
1155           dnl libtool is used for linking. Use -R options.
1156           for dir in $rpathdirs; do
1157             $1="${$1}${$1:+ }-R$dir"
1158           done
1159         else
1160           dnl The linker is used for linking directly.
1161           if test -n "$acl_hardcode_libdir_separator"; then
1162             dnl Weird platform: only the last -rpath option counts, the user
1163             dnl must pass all path elements in one option.
1164             alldirs=
1165             for dir in $rpathdirs; do
1166               alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1167             done
1168             acl_save_libdir="$libdir"
1169             libdir="$alldirs"
1170             eval flag=\"$acl_hardcode_libdir_flag_spec\"
1171             libdir="$acl_save_libdir"
1172             $1="$flag"
1173           else
1174             dnl The -rpath options are cumulative.
1175             for dir in $rpathdirs; do
1176               acl_save_libdir="$libdir"
1177               libdir="$dir"
1178               eval flag=\"$acl_hardcode_libdir_flag_spec\"
1179               libdir="$acl_save_libdir"
1180               $1="${$1}${$1:+ }$flag"
1181             done
1182           fi
1183         fi
1184       fi
1185     fi
1186   fi
1187   AC_SUBST([$1])
1188 ])
1189
1190 # lib-prefix.m4 serial 7 (gettext-0.18)
1191 dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc.
1192 dnl This file is free software; the Free Software Foundation
1193 dnl gives unlimited permission to copy and/or distribute it,
1194 dnl with or without modifications, as long as this notice is preserved.
1195
1196 dnl From Bruno Haible.
1197
1198 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1199 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1200 dnl require excessive bracketing.
1201 ifdef([AC_HELP_STRING],
1202 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1203 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1204
1205 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1206 dnl to access previously installed libraries. The basic assumption is that
1207 dnl a user will want packages to use other packages he previously installed
1208 dnl with the same --prefix option.
1209 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1210 dnl libraries, but is otherwise very convenient.
1211 AC_DEFUN([AC_LIB_PREFIX],
1212 [
1213   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1214   AC_REQUIRE([AC_PROG_CC])
1215   AC_REQUIRE([AC_CANONICAL_HOST])
1216   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1217   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1218   dnl By default, look in $includedir and $libdir.
1219   use_additional=yes
1220   AC_LIB_WITH_FINAL_PREFIX([
1221     eval additional_includedir=\"$includedir\"
1222     eval additional_libdir=\"$libdir\"
1223   ])
1224   AC_LIB_ARG_WITH([lib-prefix],
1225 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1226   --without-lib-prefix    don't search for libraries in includedir and libdir],
1227 [
1228     if test "X$withval" = "Xno"; then
1229       use_additional=no
1230     else
1231       if test "X$withval" = "X"; then
1232         AC_LIB_WITH_FINAL_PREFIX([
1233           eval additional_includedir=\"$includedir\"
1234           eval additional_libdir=\"$libdir\"
1235         ])
1236       else
1237         additional_includedir="$withval/include"
1238         additional_libdir="$withval/$acl_libdirstem"
1239       fi
1240     fi
1241 ])
1242   if test $use_additional = yes; then
1243     dnl Potentially add $additional_includedir to $CPPFLAGS.
1244     dnl But don't add it
1245     dnl   1. if it's the standard /usr/include,
1246     dnl   2. if it's already present in $CPPFLAGS,
1247     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1248     dnl   4. if it doesn't exist as a directory.
1249     if test "X$additional_includedir" != "X/usr/include"; then
1250       haveit=
1251       for x in $CPPFLAGS; do
1252         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1253         if test "X$x" = "X-I$additional_includedir"; then
1254           haveit=yes
1255           break
1256         fi
1257       done
1258       if test -z "$haveit"; then
1259         if test "X$additional_includedir" = "X/usr/local/include"; then
1260           if test -n "$GCC"; then
1261             case $host_os in
1262               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1263             esac
1264           fi
1265         fi
1266         if test -z "$haveit"; then
1267           if test -d "$additional_includedir"; then
1268             dnl Really add $additional_includedir to $CPPFLAGS.
1269             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1270           fi
1271         fi
1272       fi
1273     fi
1274     dnl Potentially add $additional_libdir to $LDFLAGS.
1275     dnl But don't add it
1276     dnl   1. if it's the standard /usr/lib,
1277     dnl   2. if it's already present in $LDFLAGS,
1278     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1279     dnl   4. if it doesn't exist as a directory.
1280     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1281       haveit=
1282       for x in $LDFLAGS; do
1283         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1284         if test "X$x" = "X-L$additional_libdir"; then
1285           haveit=yes
1286           break
1287         fi
1288       done
1289       if test -z "$haveit"; then
1290         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1291           if test -n "$GCC"; then
1292             case $host_os in
1293               linux*) haveit=yes;;
1294             esac
1295           fi
1296         fi
1297         if test -z "$haveit"; then
1298           if test -d "$additional_libdir"; then
1299             dnl Really add $additional_libdir to $LDFLAGS.
1300             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1301           fi
1302         fi
1303       fi
1304     fi
1305   fi
1306 ])
1307
1308 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1309 dnl acl_final_exec_prefix, containing the values to which $prefix and
1310 dnl $exec_prefix will expand at the end of the configure script.
1311 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1312 [
1313   dnl Unfortunately, prefix and exec_prefix get only finally determined
1314   dnl at the end of configure.
1315   if test "X$prefix" = "XNONE"; then
1316     acl_final_prefix="$ac_default_prefix"
1317   else
1318     acl_final_prefix="$prefix"
1319   fi
1320   if test "X$exec_prefix" = "XNONE"; then
1321     acl_final_exec_prefix='${prefix}'
1322   else
1323     acl_final_exec_prefix="$exec_prefix"
1324   fi
1325   acl_save_prefix="$prefix"
1326   prefix="$acl_final_prefix"
1327   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1328   prefix="$acl_save_prefix"
1329 ])
1330
1331 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1332 dnl variables prefix and exec_prefix bound to the values they will have
1333 dnl at the end of the configure script.
1334 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1335 [
1336   acl_save_prefix="$prefix"
1337   prefix="$acl_final_prefix"
1338   acl_save_exec_prefix="$exec_prefix"
1339   exec_prefix="$acl_final_exec_prefix"
1340   $1
1341   exec_prefix="$acl_save_exec_prefix"
1342   prefix="$acl_save_prefix"
1343 ])
1344
1345 dnl AC_LIB_PREPARE_MULTILIB creates
1346 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1347 dnl   "lib" or "lib64" or "lib/64",
1348 dnl - a variable acl_libdirstem2, as a secondary possible value for
1349 dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1350 dnl   "lib/amd64".
1351 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1352 [
1353   dnl There is no formal standard regarding lib and lib64.
1354   dnl On glibc systems, the current practice is that on a system supporting
1355   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1356   dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1357   dnl the compiler's default mode by looking at the compiler's library search
1358   dnl path. If at least one of its elements ends in /lib64 or points to a
1359   dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1360   dnl Otherwise we use the default, namely "lib".
1361   dnl On Solaris systems, the current practice is that on a system supporting
1362   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1363   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1364   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1365   AC_REQUIRE([AC_CANONICAL_HOST])
1366   acl_libdirstem=lib
1367   acl_libdirstem2=
1368   case "$host_os" in
1369     solaris*)
1370       dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1371       dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1372       dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1373       dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1374       dnl symlink is missing, so we set acl_libdirstem2 too.
1375       AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1376         [AC_EGREP_CPP([sixtyfour bits], [
1377 #ifdef _LP64
1378 sixtyfour bits
1379 #endif
1380            ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1381         ])
1382       if test $gl_cv_solaris_64bit = yes; then
1383         acl_libdirstem=lib/64
1384         case "$host_cpu" in
1385           sparc*)        acl_libdirstem2=lib/sparcv9 ;;
1386           i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1387         esac
1388       fi
1389       ;;
1390     *)
1391       searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1392       if test -n "$searchpath"; then
1393         acl_save_IFS="${IFS=    }"; IFS=":"
1394         for searchdir in $searchpath; do
1395           if test -d "$searchdir"; then
1396             case "$searchdir" in
1397               */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1398               */../ | */.. )
1399                 # Better ignore directories of this form. They are misleading.
1400                 ;;
1401               *) searchdir=`cd "$searchdir" && pwd`
1402                  case "$searchdir" in
1403                    */lib64 ) acl_libdirstem=lib64 ;;
1404                  esac ;;
1405             esac
1406           fi
1407         done
1408         IFS="$acl_save_IFS"
1409       fi
1410       ;;
1411   esac
1412   test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1413 ])
1414
1415 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
1416 # serial 1 (pkg-config-0.24)
1417
1418 # Copyright Â© 2004 Scott James Remnant <scott@netsplit.com>.
1419 #
1420 # This program is free software; you can redistribute it and/or modify
1421 # it under the terms of the GNU General Public License as published by
1422 # the Free Software Foundation; either version 2 of the License, or
1423 # (at your option) any later version.
1424 #
1425 # This program is distributed in the hope that it will be useful, but
1426 # WITHOUT ANY WARRANTY; without even the implied warranty of
1427 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1428 # General Public License for more details.
1429 #
1430 # You should have received a copy of the GNU General Public License
1431 # along with this program; if not, write to the Free Software
1432 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1433 #
1434 # As a special exception to the GNU General Public License, if you
1435 # distribute this file as part of a program that contains a
1436 # configuration script generated by Autoconf, you may include it under
1437 # the same distribution terms that you use for the rest of that program.
1438
1439 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
1440 # ----------------------------------
1441 AC_DEFUN([PKG_PROG_PKG_CONFIG],
1442 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1443 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
1444 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
1445 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1446 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1447 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1448
1449 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1450         AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1451 fi
1452 if test -n "$PKG_CONFIG"; then
1453         _pkg_min_version=m4_default([$1], [0.9.0])
1454         AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1455         if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1456                 AC_MSG_RESULT([yes])
1457         else
1458                 AC_MSG_RESULT([no])
1459                 PKG_CONFIG=""
1460         fi
1461 fi[]dnl
1462 ])# PKG_PROG_PKG_CONFIG
1463
1464 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1465 #
1466 # Check to see whether a particular set of modules exists.  Similar
1467 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
1468 #
1469 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1470 # only at the first occurence in configure.ac, so if the first place
1471 # it's called might be skipped (such as if it is within an "if", you
1472 # have to call PKG_CHECK_EXISTS manually
1473 # --------------------------------------------------------------
1474 AC_DEFUN([PKG_CHECK_EXISTS],
1475 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1476 if test -n "$PKG_CONFIG" && \
1477     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1478   m4_default([$2], [:])
1479 m4_ifvaln([$3], [else
1480   $3])dnl
1481 fi])
1482
1483 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1484 # ---------------------------------------------
1485 m4_define([_PKG_CONFIG],
1486 [if test -n "$$1"; then
1487     pkg_cv_[]$1="$$1"
1488  elif test -n "$PKG_CONFIG"; then
1489     PKG_CHECK_EXISTS([$3],
1490                      [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
1491                       test "x$?" != "x0" && pkg_failed=yes ],
1492                      [pkg_failed=yes])
1493  else
1494     pkg_failed=untried
1495 fi[]dnl
1496 ])# _PKG_CONFIG
1497
1498 # _PKG_SHORT_ERRORS_SUPPORTED
1499 # -----------------------------
1500 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1501 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1502 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1503         _pkg_short_errors_supported=yes
1504 else
1505         _pkg_short_errors_supported=no
1506 fi[]dnl
1507 ])# _PKG_SHORT_ERRORS_SUPPORTED
1508
1509
1510 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1511 # [ACTION-IF-NOT-FOUND])
1512 #
1513 #
1514 # Note that if there is a possibility the first call to
1515 # PKG_CHECK_MODULES might not happen, you should be sure to include an
1516 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1517 #
1518 #
1519 # --------------------------------------------------------------
1520 AC_DEFUN([PKG_CHECK_MODULES],
1521 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1522 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1523 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1524
1525 pkg_failed=no
1526 AC_MSG_CHECKING([for $1])
1527
1528 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1529 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
1530
1531 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1532 and $1[]_LIBS to avoid the need to call pkg-config.
1533 See the pkg-config man page for more details.])
1534
1535 if test $pkg_failed = yes; then
1536         AC_MSG_RESULT([no])
1537         _PKG_SHORT_ERRORS_SUPPORTED
1538         if test $_pkg_short_errors_supported = yes; then
1539                 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
1540         else 
1541                 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
1542         fi
1543         # Put the nasty error message in config.log where it belongs
1544         echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1545
1546         m4_default([$4], [AC_MSG_ERROR(
1547 [Package requirements ($2) were not met:
1548
1549 $$1_PKG_ERRORS
1550
1551 Consider adjusting the PKG_CONFIG_PATH environment variable if you
1552 installed software in a non-standard prefix.
1553
1554 _PKG_TEXT])[]dnl
1555         ])
1556 elif test $pkg_failed = untried; then
1557         AC_MSG_RESULT([no])
1558         m4_default([$4], [AC_MSG_FAILURE(
1559 [The pkg-config script could not be found or is too old.  Make sure it
1560 is in your PATH or set the PKG_CONFIG environment variable to the full
1561 path to pkg-config.
1562
1563 _PKG_TEXT
1564
1565 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
1566         ])
1567 else
1568         $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1569         $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1570         AC_MSG_RESULT([yes])
1571         $3
1572 fi[]dnl
1573 ])# PKG_CHECK_MODULES
1574
1575 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
1576 #
1577 # This file is free software; the Free Software Foundation
1578 # gives unlimited permission to copy and/or distribute it,
1579 # with or without modifications, as long as this notice is preserved.
1580
1581 # AM_AUTOMAKE_VERSION(VERSION)
1582 # ----------------------------
1583 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1584 # generated from the m4 files accompanying Automake X.Y.
1585 # (This private macro should not be called outside this file.)
1586 AC_DEFUN([AM_AUTOMAKE_VERSION],
1587 [am__api_version='1.14'
1588 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1589 dnl require some minimum version.  Point them to the right macro.
1590 m4_if([$1], [1.14.1], [],
1591       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1592 ])
1593
1594 # _AM_AUTOCONF_VERSION(VERSION)
1595 # -----------------------------
1596 # aclocal traces this macro to find the Autoconf version.
1597 # This is a private macro too.  Using m4_define simplifies
1598 # the logic in aclocal, which can simply ignore this definition.
1599 m4_define([_AM_AUTOCONF_VERSION], [])
1600
1601 # AM_SET_CURRENT_AUTOMAKE_VERSION
1602 # -------------------------------
1603 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1604 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1605 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1606 [AM_AUTOMAKE_VERSION([1.14.1])dnl
1607 m4_ifndef([AC_AUTOCONF_VERSION],
1608   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1609 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1610
1611 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1612
1613 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1614 #
1615 # This file is free software; the Free Software Foundation
1616 # gives unlimited permission to copy and/or distribute it,
1617 # with or without modifications, as long as this notice is preserved.
1618
1619 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1620 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
1621 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1622 #
1623 # Of course, Automake must honor this variable whenever it calls a
1624 # tool from the auxiliary directory.  The problem is that $srcdir (and
1625 # therefore $ac_aux_dir as well) can be either absolute or relative,
1626 # depending on how configure is run.  This is pretty annoying, since
1627 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1628 # source directory, any form will work fine, but in subdirectories a
1629 # relative path needs to be adjusted first.
1630 #
1631 # $ac_aux_dir/missing
1632 #    fails when called from a subdirectory if $ac_aux_dir is relative
1633 # $top_srcdir/$ac_aux_dir/missing
1634 #    fails if $ac_aux_dir is absolute,
1635 #    fails when called from a subdirectory in a VPATH build with
1636 #          a relative $ac_aux_dir
1637 #
1638 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1639 # are both prefixed by $srcdir.  In an in-source build this is usually
1640 # harmless because $srcdir is '.', but things will broke when you
1641 # start a VPATH build or use an absolute $srcdir.
1642 #
1643 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1644 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1645 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1646 # and then we would define $MISSING as
1647 #   MISSING="\${SHELL} $am_aux_dir/missing"
1648 # This will work as long as MISSING is not called from configure, because
1649 # unfortunately $(top_srcdir) has no meaning in configure.
1650 # However there are other variables, like CC, which are often used in
1651 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1652 #
1653 # Another solution, used here, is to always expand $ac_aux_dir to an
1654 # absolute PATH.  The drawback is that using absolute paths prevent a
1655 # configured tree to be moved without reconfiguration.
1656
1657 AC_DEFUN([AM_AUX_DIR_EXPAND],
1658 [dnl Rely on autoconf to set up CDPATH properly.
1659 AC_PREREQ([2.50])dnl
1660 # expand $ac_aux_dir to an absolute path
1661 am_aux_dir=`cd $ac_aux_dir && pwd`
1662 ])
1663
1664 # AM_CONDITIONAL                                            -*- Autoconf -*-
1665
1666 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
1667 #
1668 # This file is free software; the Free Software Foundation
1669 # gives unlimited permission to copy and/or distribute it,
1670 # with or without modifications, as long as this notice is preserved.
1671
1672 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1673 # -------------------------------------
1674 # Define a conditional.
1675 AC_DEFUN([AM_CONDITIONAL],
1676 [AC_PREREQ([2.52])dnl
1677  m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1678        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1679 AC_SUBST([$1_TRUE])dnl
1680 AC_SUBST([$1_FALSE])dnl
1681 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1682 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1683 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1684 if $2; then
1685   $1_TRUE=
1686   $1_FALSE='#'
1687 else
1688   $1_TRUE='#'
1689   $1_FALSE=
1690 fi
1691 AC_CONFIG_COMMANDS_PRE(
1692 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1693   AC_MSG_ERROR([[conditional "$1" was never defined.
1694 Usually this means the macro was only invoked conditionally.]])
1695 fi])])
1696
1697 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1698 #
1699 # This file is free software; the Free Software Foundation
1700 # gives unlimited permission to copy and/or distribute it,
1701 # with or without modifications, as long as this notice is preserved.
1702
1703
1704 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1705 # written in clear, in which case automake, when reading aclocal.m4,
1706 # will think it sees a *use*, and therefore will trigger all it's
1707 # C support machinery.  Also note that it means that autoscan, seeing
1708 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1709
1710
1711 # _AM_DEPENDENCIES(NAME)
1712 # ----------------------
1713 # See how the compiler implements dependency checking.
1714 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1715 # We try a few techniques and use that to set a single cache variable.
1716 #
1717 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1718 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1719 # dependency, and given that the user is not expected to run this macro,
1720 # just rely on AC_PROG_CC.
1721 AC_DEFUN([_AM_DEPENDENCIES],
1722 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1723 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1724 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1725 AC_REQUIRE([AM_DEP_TRACK])dnl
1726
1727 m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1728       [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1729       [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1730       [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1731       [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1732       [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1733                     [depcc="$$1"   am_compiler_list=])
1734
1735 AC_CACHE_CHECK([dependency style of $depcc],
1736                [am_cv_$1_dependencies_compiler_type],
1737 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1738   # We make a subdir and do the tests there.  Otherwise we can end up
1739   # making bogus files that we don't know about and never remove.  For
1740   # instance it was reported that on HP-UX the gcc test will end up
1741   # making a dummy file named 'D' -- because '-MD' means "put the output
1742   # in D".
1743   rm -rf conftest.dir
1744   mkdir conftest.dir
1745   # Copy depcomp to subdir because otherwise we won't find it if we're
1746   # using a relative directory.
1747   cp "$am_depcomp" conftest.dir
1748   cd conftest.dir
1749   # We will build objects and dependencies in a subdirectory because
1750   # it helps to detect inapplicable dependency modes.  For instance
1751   # both Tru64's cc and ICC support -MD to output dependencies as a
1752   # side effect of compilation, but ICC will put the dependencies in
1753   # the current directory while Tru64 will put them in the object
1754   # directory.
1755   mkdir sub
1756
1757   am_cv_$1_dependencies_compiler_type=none
1758   if test "$am_compiler_list" = ""; then
1759      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1760   fi
1761   am__universal=false
1762   m4_case([$1], [CC],
1763     [case " $depcc " in #(
1764      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1765      esac],
1766     [CXX],
1767     [case " $depcc " in #(
1768      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1769      esac])
1770
1771   for depmode in $am_compiler_list; do
1772     # Setup a source with many dependencies, because some compilers
1773     # like to wrap large dependency lists on column 80 (with \), and
1774     # we should not choose a depcomp mode which is confused by this.
1775     #
1776     # We need to recreate these files for each test, as the compiler may
1777     # overwrite some of them when testing with obscure command lines.
1778     # This happens at least with the AIX C compiler.
1779     : > sub/conftest.c
1780     for i in 1 2 3 4 5 6; do
1781       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1782       # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1783       # Solaris 10 /bin/sh.
1784       echo '/* dummy */' > sub/conftst$i.h
1785     done
1786     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1787
1788     # We check with '-c' and '-o' for the sake of the "dashmstdout"
1789     # mode.  It turns out that the SunPro C++ compiler does not properly
1790     # handle '-M -o', and we need to detect this.  Also, some Intel
1791     # versions had trouble with output in subdirs.
1792     am__obj=sub/conftest.${OBJEXT-o}
1793     am__minus_obj="-o $am__obj"
1794     case $depmode in
1795     gcc)
1796       # This depmode causes a compiler race in universal mode.
1797       test "$am__universal" = false || continue
1798       ;;
1799     nosideeffect)
1800       # After this tag, mechanisms are not by side-effect, so they'll
1801       # only be used when explicitly requested.
1802       if test "x$enable_dependency_tracking" = xyes; then
1803         continue
1804       else
1805         break
1806       fi
1807       ;;
1808     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1809       # This compiler won't grok '-c -o', but also, the minuso test has
1810       # not run yet.  These depmodes are late enough in the game, and
1811       # so weak that their functioning should not be impacted.
1812       am__obj=conftest.${OBJEXT-o}
1813       am__minus_obj=
1814       ;;
1815     none) break ;;
1816     esac
1817     if depmode=$depmode \
1818        source=sub/conftest.c object=$am__obj \
1819        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1820        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1821          >/dev/null 2>conftest.err &&
1822        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1823        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1824        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1825        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1826       # icc doesn't choke on unknown options, it will just issue warnings
1827       # or remarks (even with -Werror).  So we grep stderr for any message
1828       # that says an option was ignored or not supported.
1829       # When given -MP, icc 7.0 and 7.1 complain thusly:
1830       #   icc: Command line warning: ignoring option '-M'; no argument required
1831       # The diagnosis changed in icc 8.0:
1832       #   icc: Command line remark: option '-MP' not supported
1833       if (grep 'ignoring option' conftest.err ||
1834           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1835         am_cv_$1_dependencies_compiler_type=$depmode
1836         break
1837       fi
1838     fi
1839   done
1840
1841   cd ..
1842   rm -rf conftest.dir
1843 else
1844   am_cv_$1_dependencies_compiler_type=none
1845 fi
1846 ])
1847 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1848 AM_CONDITIONAL([am__fastdep$1], [
1849   test "x$enable_dependency_tracking" != xno \
1850   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1851 ])
1852
1853
1854 # AM_SET_DEPDIR
1855 # -------------
1856 # Choose a directory name for dependency files.
1857 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1858 AC_DEFUN([AM_SET_DEPDIR],
1859 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1860 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1861 ])
1862
1863
1864 # AM_DEP_TRACK
1865 # ------------
1866 AC_DEFUN([AM_DEP_TRACK],
1867 [AC_ARG_ENABLE([dependency-tracking], [dnl
1868 AS_HELP_STRING(
1869   [--enable-dependency-tracking],
1870   [do not reject slow dependency extractors])
1871 AS_HELP_STRING(
1872   [--disable-dependency-tracking],
1873   [speeds up one-time build])])
1874 if test "x$enable_dependency_tracking" != xno; then
1875   am_depcomp="$ac_aux_dir/depcomp"
1876   AMDEPBACKSLASH='\'
1877   am__nodep='_no'
1878 fi
1879 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1880 AC_SUBST([AMDEPBACKSLASH])dnl
1881 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1882 AC_SUBST([am__nodep])dnl
1883 _AM_SUBST_NOTMAKE([am__nodep])dnl
1884 ])
1885
1886 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1887
1888 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1889 #
1890 # This file is free software; the Free Software Foundation
1891 # gives unlimited permission to copy and/or distribute it,
1892 # with or without modifications, as long as this notice is preserved.
1893
1894
1895 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1896 # ------------------------------
1897 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1898 [{
1899   # Older Autoconf quotes --file arguments for eval, but not when files
1900   # are listed without --file.  Let's play safe and only enable the eval
1901   # if we detect the quoting.
1902   case $CONFIG_FILES in
1903   *\'*) eval set x "$CONFIG_FILES" ;;
1904   *)   set x $CONFIG_FILES ;;
1905   esac
1906   shift
1907   for mf
1908   do
1909     # Strip MF so we end up with the name of the file.
1910     mf=`echo "$mf" | sed -e 's/:.*$//'`
1911     # Check whether this is an Automake generated Makefile or not.
1912     # We used to match only the files named 'Makefile.in', but
1913     # some people rename them; so instead we look at the file content.
1914     # Grep'ing the first line is not enough: some people post-process
1915     # each Makefile.in and add a new line on top of each file to say so.
1916     # Grep'ing the whole file is not good either: AIX grep has a line
1917     # limit of 2048, but all sed's we know have understand at least 4000.
1918     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1919       dirpart=`AS_DIRNAME("$mf")`
1920     else
1921       continue
1922     fi
1923     # Extract the definition of DEPDIR, am__include, and am__quote
1924     # from the Makefile without running 'make'.
1925     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1926     test -z "$DEPDIR" && continue
1927     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1928     test -z "$am__include" && continue
1929     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1930     # Find all dependency output files, they are included files with
1931     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1932     # simplest approach to changing $(DEPDIR) to its actual value in the
1933     # expansion.
1934     for file in `sed -n "
1935       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1936          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1937       # Make sure the directory exists.
1938       test -f "$dirpart/$file" && continue
1939       fdir=`AS_DIRNAME(["$file"])`
1940       AS_MKDIR_P([$dirpart/$fdir])
1941       # echo "creating $dirpart/$file"
1942       echo '# dummy' > "$dirpart/$file"
1943     done
1944   done
1945 }
1946 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1947
1948
1949 # AM_OUTPUT_DEPENDENCY_COMMANDS
1950 # -----------------------------
1951 # This macro should only be invoked once -- use via AC_REQUIRE.
1952 #
1953 # This code is only required when automatic dependency tracking
1954 # is enabled.  FIXME.  This creates each '.P' file that we will
1955 # need in order to bootstrap the dependency handling code.
1956 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1957 [AC_CONFIG_COMMANDS([depfiles],
1958      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1959      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1960 ])
1961
1962 # Do all the work for Automake.                             -*- Autoconf -*-
1963
1964 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
1965 #
1966 # This file is free software; the Free Software Foundation
1967 # gives unlimited permission to copy and/or distribute it,
1968 # with or without modifications, as long as this notice is preserved.
1969
1970 # This macro actually does too much.  Some checks are only needed if
1971 # your package does certain things.  But this isn't really a big deal.
1972
1973 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
1974 m4_define([AC_PROG_CC],
1975 m4_defn([AC_PROG_CC])
1976 [_AM_PROG_CC_C_O
1977 ])
1978
1979 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1980 # AM_INIT_AUTOMAKE([OPTIONS])
1981 # -----------------------------------------------
1982 # The call with PACKAGE and VERSION arguments is the old style
1983 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1984 # and VERSION should now be passed to AC_INIT and removed from
1985 # the call to AM_INIT_AUTOMAKE.
1986 # We support both call styles for the transition.  After
1987 # the next Automake release, Autoconf can make the AC_INIT
1988 # arguments mandatory, and then we can depend on a new Autoconf
1989 # release and drop the old call support.
1990 AC_DEFUN([AM_INIT_AUTOMAKE],
1991 [AC_PREREQ([2.65])dnl
1992 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1993 dnl the ones we care about.
1994 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1995 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1996 AC_REQUIRE([AC_PROG_INSTALL])dnl
1997 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1998   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1999   # is not polluted with repeated "-I."
2000   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
2001   # test to see if srcdir already configured
2002   if test -f $srcdir/config.status; then
2003     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
2004   fi
2005 fi
2006
2007 # test whether we have cygpath
2008 if test -z "$CYGPATH_W"; then
2009   if (cygpath --version) >/dev/null 2>/dev/null; then
2010     CYGPATH_W='cygpath -w'
2011   else
2012     CYGPATH_W=echo
2013   fi
2014 fi
2015 AC_SUBST([CYGPATH_W])
2016
2017 # Define the identity of the package.
2018 dnl Distinguish between old-style and new-style calls.
2019 m4_ifval([$2],
2020 [AC_DIAGNOSE([obsolete],
2021              [$0: two- and three-arguments forms are deprecated.])
2022 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
2023  AC_SUBST([PACKAGE], [$1])dnl
2024  AC_SUBST([VERSION], [$2])],
2025 [_AM_SET_OPTIONS([$1])dnl
2026 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
2027 m4_if(
2028   m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
2029   [ok:ok],,
2030   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
2031  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
2032  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
2033
2034 _AM_IF_OPTION([no-define],,
2035 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
2036  AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
2037
2038 # Some tools Automake needs.
2039 AC_REQUIRE([AM_SANITY_CHECK])dnl
2040 AC_REQUIRE([AC_ARG_PROGRAM])dnl
2041 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
2042 AM_MISSING_PROG([AUTOCONF], [autoconf])
2043 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
2044 AM_MISSING_PROG([AUTOHEADER], [autoheader])
2045 AM_MISSING_PROG([MAKEINFO], [makeinfo])
2046 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2047 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
2048 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2049 # For better backward compatibility.  To be removed once Automake 1.9.x
2050 # dies out for good.  For more background, see:
2051 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2052 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2053 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
2054 # We need awk for the "check" target.  The system "awk" is bad on
2055 # some platforms.
2056 AC_REQUIRE([AC_PROG_AWK])dnl
2057 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
2058 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
2059 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
2060               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
2061                              [_AM_PROG_TAR([v7])])])
2062 _AM_IF_OPTION([no-dependencies],,
2063 [AC_PROVIDE_IFELSE([AC_PROG_CC],
2064                   [_AM_DEPENDENCIES([CC])],
2065                   [m4_define([AC_PROG_CC],
2066                              m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
2067 AC_PROVIDE_IFELSE([AC_PROG_CXX],
2068                   [_AM_DEPENDENCIES([CXX])],
2069                   [m4_define([AC_PROG_CXX],
2070                              m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
2071 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
2072                   [_AM_DEPENDENCIES([OBJC])],
2073                   [m4_define([AC_PROG_OBJC],
2074                              m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
2075 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
2076                   [_AM_DEPENDENCIES([OBJCXX])],
2077                   [m4_define([AC_PROG_OBJCXX],
2078                              m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
2079 ])
2080 AC_REQUIRE([AM_SILENT_RULES])dnl
2081 dnl The testsuite driver may need to know about EXEEXT, so add the
2082 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
2083 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
2084 AC_CONFIG_COMMANDS_PRE(dnl
2085 [m4_provide_if([_AM_COMPILER_EXEEXT],
2086   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2087
2088 # POSIX will say in a future version that running "rm -f" with no argument
2089 # is OK; and we want to be able to make that assumption in our Makefile
2090 # recipes.  So use an aggressive probe to check that the usage we want is
2091 # actually supported "in the wild" to an acceptable degree.
2092 # See automake bug#10828.
2093 # To make any issue more visible, cause the running configure to be aborted
2094 # by default if the 'rm' program in use doesn't match our expectations; the
2095 # user can still override this though.
2096 if rm -f && rm -fr && rm -rf; then : OK; else
2097   cat >&2 <<'END'
2098 Oops!
2099
2100 Your 'rm' program seems unable to run without file operands specified
2101 on the command line, even when the '-f' option is present.  This is contrary
2102 to the behaviour of most rm programs out there, and not conforming with
2103 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
2104
2105 Please tell bug-automake@gnu.org about your system, including the value
2106 of your $PATH and any error possibly output before this message.  This
2107 can help us improve future automake versions.
2108
2109 END
2110   if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
2111     echo 'Configuration will proceed anyway, since you have set the' >&2
2112     echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
2113     echo >&2
2114   else
2115     cat >&2 <<'END'
2116 Aborting the configuration process, to ensure you take notice of the issue.
2117
2118 You can download and install GNU coreutils to get an 'rm' implementation
2119 that behaves properly: <http://www.gnu.org/software/coreutils/>.
2120
2121 If you want to complete the configuration process using your problematic
2122 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
2123 to "yes", and re-run configure.
2124
2125 END
2126     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
2127   fi
2128 fi])
2129
2130 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
2131 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
2132 dnl mangled by Autoconf and run in a shell conditional statement.
2133 m4_define([_AC_COMPILER_EXEEXT],
2134 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
2135
2136 # When config.status generates a header, we must update the stamp-h file.
2137 # This file resides in the same directory as the config header
2138 # that is generated.  The stamp files are numbered to have different names.
2139
2140 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
2141 # loop where config.status creates the headers, so we can generate
2142 # our stamp files there.
2143 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
2144 [# Compute $1's index in $config_headers.
2145 _am_arg=$1
2146 _am_stamp_count=1
2147 for _am_header in $config_headers :; do
2148   case $_am_header in
2149     $_am_arg | $_am_arg:* )
2150       break ;;
2151     * )
2152       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
2153   esac
2154 done
2155 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
2156
2157 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2158 #
2159 # This file is free software; the Free Software Foundation
2160 # gives unlimited permission to copy and/or distribute it,
2161 # with or without modifications, as long as this notice is preserved.
2162
2163 # AM_PROG_INSTALL_SH
2164 # ------------------
2165 # Define $install_sh.
2166 AC_DEFUN([AM_PROG_INSTALL_SH],
2167 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2168 if test x"${install_sh}" != xset; then
2169   case $am_aux_dir in
2170   *\ * | *\     *)
2171     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2172   *)
2173     install_sh="\${SHELL} $am_aux_dir/install-sh"
2174   esac
2175 fi
2176 AC_SUBST([install_sh])])
2177
2178 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
2179 #
2180 # This file is free software; the Free Software Foundation
2181 # gives unlimited permission to copy and/or distribute it,
2182 # with or without modifications, as long as this notice is preserved.
2183
2184 # Check whether the underlying file-system supports filenames
2185 # with a leading dot.  For instance MS-DOS doesn't.
2186 AC_DEFUN([AM_SET_LEADING_DOT],
2187 [rm -rf .tst 2>/dev/null
2188 mkdir .tst 2>/dev/null
2189 if test -d .tst; then
2190   am__leading_dot=.
2191 else
2192   am__leading_dot=_
2193 fi
2194 rmdir .tst 2>/dev/null
2195 AC_SUBST([am__leading_dot])])
2196
2197 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
2198
2199 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2200 #
2201 # This file is free software; the Free Software Foundation
2202 # gives unlimited permission to copy and/or distribute it,
2203 # with or without modifications, as long as this notice is preserved.
2204
2205 # AM_MAKE_INCLUDE()
2206 # -----------------
2207 # Check to see how make treats includes.
2208 AC_DEFUN([AM_MAKE_INCLUDE],
2209 [am_make=${MAKE-make}
2210 cat > confinc << 'END'
2211 am__doit:
2212         @echo this is the am__doit target
2213 .PHONY: am__doit
2214 END
2215 # If we don't find an include directive, just comment out the code.
2216 AC_MSG_CHECKING([for style of include used by $am_make])
2217 am__include="#"
2218 am__quote=
2219 _am_result=none
2220 # First try GNU make style include.
2221 echo "include confinc" > confmf
2222 # Ignore all kinds of additional output from 'make'.
2223 case `$am_make -s -f confmf 2> /dev/null` in #(
2224 *the\ am__doit\ target*)
2225   am__include=include
2226   am__quote=
2227   _am_result=GNU
2228   ;;
2229 esac
2230 # Now try BSD make style include.
2231 if test "$am__include" = "#"; then
2232    echo '.include "confinc"' > confmf
2233    case `$am_make -s -f confmf 2> /dev/null` in #(
2234    *the\ am__doit\ target*)
2235      am__include=.include
2236      am__quote="\""
2237      _am_result=BSD
2238      ;;
2239    esac
2240 fi
2241 AC_SUBST([am__include])
2242 AC_SUBST([am__quote])
2243 AC_MSG_RESULT([$_am_result])
2244 rm -f confinc confmf
2245 ])
2246
2247 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2248
2249 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
2250 #
2251 # This file is free software; the Free Software Foundation
2252 # gives unlimited permission to copy and/or distribute it,
2253 # with or without modifications, as long as this notice is preserved.
2254
2255 # AM_MISSING_PROG(NAME, PROGRAM)
2256 # ------------------------------
2257 AC_DEFUN([AM_MISSING_PROG],
2258 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2259 $1=${$1-"${am_missing_run}$2"}
2260 AC_SUBST($1)])
2261
2262 # AM_MISSING_HAS_RUN
2263 # ------------------
2264 # Define MISSING if not defined so far and test if it is modern enough.
2265 # If it is, set am_missing_run to use it, otherwise, to nothing.
2266 AC_DEFUN([AM_MISSING_HAS_RUN],
2267 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2268 AC_REQUIRE_AUX_FILE([missing])dnl
2269 if test x"${MISSING+set}" != xset; then
2270   case $am_aux_dir in
2271   *\ * | *\     *)
2272     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2273   *)
2274     MISSING="\${SHELL} $am_aux_dir/missing" ;;
2275   esac
2276 fi
2277 # Use eval to expand $SHELL
2278 if eval "$MISSING --is-lightweight"; then
2279   am_missing_run="$MISSING "
2280 else
2281   am_missing_run=
2282   AC_MSG_WARN(['missing' script is too old or missing])
2283 fi
2284 ])
2285
2286 # Helper functions for option handling.                     -*- Autoconf -*-
2287
2288 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2289 #
2290 # This file is free software; the Free Software Foundation
2291 # gives unlimited permission to copy and/or distribute it,
2292 # with or without modifications, as long as this notice is preserved.
2293
2294 # _AM_MANGLE_OPTION(NAME)
2295 # -----------------------
2296 AC_DEFUN([_AM_MANGLE_OPTION],
2297 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2298
2299 # _AM_SET_OPTION(NAME)
2300 # --------------------
2301 # Set option NAME.  Presently that only means defining a flag for this option.
2302 AC_DEFUN([_AM_SET_OPTION],
2303 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
2304
2305 # _AM_SET_OPTIONS(OPTIONS)
2306 # ------------------------
2307 # OPTIONS is a space-separated list of Automake options.
2308 AC_DEFUN([_AM_SET_OPTIONS],
2309 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2310
2311 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2312 # -------------------------------------------
2313 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2314 AC_DEFUN([_AM_IF_OPTION],
2315 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2316
2317 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
2318 #
2319 # This file is free software; the Free Software Foundation
2320 # gives unlimited permission to copy and/or distribute it,
2321 # with or without modifications, as long as this notice is preserved.
2322
2323 # _AM_PROG_CC_C_O
2324 # ---------------
2325 # Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
2326 # to automatically call this.
2327 AC_DEFUN([_AM_PROG_CC_C_O],
2328 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2329 AC_REQUIRE_AUX_FILE([compile])dnl
2330 AC_LANG_PUSH([C])dnl
2331 AC_CACHE_CHECK(
2332   [whether $CC understands -c and -o together],
2333   [am_cv_prog_cc_c_o],
2334   [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
2335   # Make sure it works both with $CC and with simple cc.
2336   # Following AC_PROG_CC_C_O, we do the test twice because some
2337   # compilers refuse to overwrite an existing .o file with -o,
2338   # though they will create one.
2339   am_cv_prog_cc_c_o=yes
2340   for am_i in 1 2; do
2341     if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
2342          && test -f conftest2.$ac_objext; then
2343       : OK
2344     else
2345       am_cv_prog_cc_c_o=no
2346       break
2347     fi
2348   done
2349   rm -f core conftest*
2350   unset am_i])
2351 if test "$am_cv_prog_cc_c_o" != yes; then
2352    # Losing compiler, so override with the script.
2353    # FIXME: It is wrong to rewrite CC.
2354    # But if we don't then we get into trouble of one sort or another.
2355    # A longer-term fix would be to have automake use am__CC in this case,
2356    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2357    CC="$am_aux_dir/compile $CC"
2358 fi
2359 AC_LANG_POP([C])])
2360
2361 # For backward compatibility.
2362 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
2363
2364 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
2365 #
2366 # This file is free software; the Free Software Foundation
2367 # gives unlimited permission to copy and/or distribute it,
2368 # with or without modifications, as long as this notice is preserved.
2369
2370
2371 # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2372 # ---------------------------------------------------------------------------
2373 # Adds support for distributing Python modules and packages.  To
2374 # install modules, copy them to $(pythondir), using the python_PYTHON
2375 # automake variable.  To install a package with the same name as the
2376 # automake package, install to $(pkgpythondir), or use the
2377 # pkgpython_PYTHON automake variable.
2378 #
2379 # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
2380 # locations to install python extension modules (shared libraries).
2381 # Another macro is required to find the appropriate flags to compile
2382 # extension modules.
2383 #
2384 # If your package is configured with a different prefix to python,
2385 # users will have to add the install directory to the PYTHONPATH
2386 # environment variable, or create a .pth file (see the python
2387 # documentation for details).
2388 #
2389 # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
2390 # cause an error if the version of python installed on the system
2391 # doesn't meet the requirement.  MINIMUM-VERSION should consist of
2392 # numbers and dots only.
2393 AC_DEFUN([AM_PATH_PYTHON],
2394  [
2395   dnl Find a Python interpreter.  Python versions prior to 2.0 are not
2396   dnl supported. (2.0 was released on October 16, 2000).
2397   m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
2398 [python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
2399  python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
2400
2401   AC_ARG_VAR([PYTHON], [the Python interpreter])
2402
2403   m4_if([$1],[],[
2404     dnl No version check is needed.
2405     # Find any Python interpreter.
2406     if test -z "$PYTHON"; then
2407       AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
2408     fi
2409     am_display_PYTHON=python
2410   ], [
2411     dnl A version check is needed.
2412     if test -n "$PYTHON"; then
2413       # If the user set $PYTHON, use it and don't search something else.
2414       AC_MSG_CHECKING([whether $PYTHON version is >= $1])
2415       AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
2416                               [AC_MSG_RESULT([yes])],
2417                               [AC_MSG_RESULT([no])
2418                                AC_MSG_ERROR([Python interpreter is too old])])
2419       am_display_PYTHON=$PYTHON
2420     else
2421       # Otherwise, try each interpreter until we find one that satisfies
2422       # VERSION.
2423       AC_CACHE_CHECK([for a Python interpreter with version >= $1],
2424         [am_cv_pathless_PYTHON],[
2425         for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
2426           test "$am_cv_pathless_PYTHON" = none && break
2427           AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
2428         done])
2429       # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
2430       if test "$am_cv_pathless_PYTHON" = none; then
2431         PYTHON=:
2432       else
2433         AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
2434       fi
2435       am_display_PYTHON=$am_cv_pathless_PYTHON
2436     fi
2437   ])
2438
2439   if test "$PYTHON" = :; then
2440   dnl Run any user-specified action, or abort.
2441     m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
2442   else
2443
2444   dnl Query Python for its version number.  Getting [:3] seems to be
2445   dnl the best way to do this; it's what "site.py" does in the standard
2446   dnl library.
2447
2448   AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
2449     [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
2450   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
2451
2452   dnl Use the values of $prefix and $exec_prefix for the corresponding
2453   dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
2454   dnl distinct variables so they can be overridden if need be.  However,
2455   dnl general consensus is that you shouldn't need this ability.
2456
2457   AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
2458   AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
2459
2460   dnl At times (like when building shared libraries) you may want
2461   dnl to know which OS platform Python thinks this is.
2462
2463   AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
2464     [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
2465   AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
2466
2467   # Just factor out some code duplication.
2468   am_python_setup_sysconfig="\
2469 import sys
2470 # Prefer sysconfig over distutils.sysconfig, for better compatibility
2471 # with python 3.x.  See automake bug#10227.
2472 try:
2473     import sysconfig
2474 except ImportError:
2475     can_use_sysconfig = 0
2476 else:
2477     can_use_sysconfig = 1
2478 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
2479 # <https://github.com/pypa/virtualenv/issues/118>
2480 try:
2481     from platform import python_implementation
2482     if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
2483         can_use_sysconfig = 0
2484 except ImportError:
2485     pass"
2486
2487   dnl Set up 4 directories:
2488
2489   dnl pythondir -- where to install python scripts.  This is the
2490   dnl   site-packages directory, not the python standard library
2491   dnl   directory like in previous automake betas.  This behavior
2492   dnl   is more consistent with lispdir.m4 for example.
2493   dnl Query distutils for this directory.
2494   AC_CACHE_CHECK([for $am_display_PYTHON script directory],
2495     [am_cv_python_pythondir],
2496     [if test "x$prefix" = xNONE
2497      then
2498        am_py_prefix=$ac_default_prefix
2499      else
2500        am_py_prefix=$prefix
2501      fi
2502      am_cv_python_pythondir=`$PYTHON -c "
2503 $am_python_setup_sysconfig
2504 if can_use_sysconfig:
2505     sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
2506 else:
2507     from distutils import sysconfig
2508     sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
2509 sys.stdout.write(sitedir)"`
2510      case $am_cv_python_pythondir in
2511      $am_py_prefix*)
2512        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
2513        am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
2514        ;;
2515      *)
2516        case $am_py_prefix in
2517          /usr|/System*) ;;
2518          *)
2519           am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
2520           ;;
2521        esac
2522        ;;
2523      esac
2524     ])
2525   AC_SUBST([pythondir], [$am_cv_python_pythondir])
2526
2527   dnl pkgpythondir -- $PACKAGE directory under pythondir.  Was
2528   dnl   PYTHON_SITE_PACKAGE in previous betas, but this naming is
2529   dnl   more consistent with the rest of automake.
2530
2531   AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
2532
2533   dnl pyexecdir -- directory for installing python extension modules
2534   dnl   (shared libraries)
2535   dnl Query distutils for this directory.
2536   AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
2537     [am_cv_python_pyexecdir],
2538     [if test "x$exec_prefix" = xNONE
2539      then
2540        am_py_exec_prefix=$am_py_prefix
2541      else
2542        am_py_exec_prefix=$exec_prefix
2543      fi
2544      am_cv_python_pyexecdir=`$PYTHON -c "
2545 $am_python_setup_sysconfig
2546 if can_use_sysconfig:
2547     sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
2548 else:
2549     from distutils import sysconfig
2550     sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
2551 sys.stdout.write(sitedir)"`
2552      case $am_cv_python_pyexecdir in
2553      $am_py_exec_prefix*)
2554        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
2555        am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
2556        ;;
2557      *)
2558        case $am_py_exec_prefix in
2559          /usr|/System*) ;;
2560          *)
2561            am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
2562            ;;
2563        esac
2564        ;;
2565      esac
2566     ])
2567   AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
2568
2569   dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
2570
2571   AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
2572
2573   dnl Run any user-specified action.
2574   $2
2575   fi
2576
2577 ])
2578
2579
2580 # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
2581 # ---------------------------------------------------------------------------
2582 # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
2583 # Run ACTION-IF-FALSE otherwise.
2584 # This test uses sys.hexversion instead of the string equivalent (first
2585 # word of sys.version), in order to cope with versions such as 2.2c1.
2586 # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
2587 AC_DEFUN([AM_PYTHON_CHECK_VERSION],
2588  [prog="import sys
2589 # split strings by '.' and convert to numeric.  Append some zeros
2590 # because we need at least 4 digits for the hex conversion.
2591 # map returns an iterator in Python 3.0 and a list in 2.x
2592 minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
2593 minverhex = 0
2594 # xrange is not present in Python 3.0 and range returns an iterator
2595 for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
2596 sys.exit(sys.hexversion < minverhex)"
2597   AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
2598
2599 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2600 #
2601 # This file is free software; the Free Software Foundation
2602 # gives unlimited permission to copy and/or distribute it,
2603 # with or without modifications, as long as this notice is preserved.
2604
2605 # AM_RUN_LOG(COMMAND)
2606 # -------------------
2607 # Run COMMAND, save the exit status in ac_status, and log it.
2608 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
2609 AC_DEFUN([AM_RUN_LOG],
2610 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
2611    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
2612    ac_status=$?
2613    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2614    (exit $ac_status); }])
2615
2616 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
2617
2618 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
2619 #
2620 # This file is free software; the Free Software Foundation
2621 # gives unlimited permission to copy and/or distribute it,
2622 # with or without modifications, as long as this notice is preserved.
2623
2624 # AM_SANITY_CHECK
2625 # ---------------
2626 AC_DEFUN([AM_SANITY_CHECK],
2627 [AC_MSG_CHECKING([whether build environment is sane])
2628 # Reject unsafe characters in $srcdir or the absolute working directory
2629 # name.  Accept space and tab only in the latter.
2630 am_lf='
2631 '
2632 case `pwd` in
2633   *[[\\\"\#\$\&\'\`$am_lf]]*)
2634     AC_MSG_ERROR([unsafe absolute working directory name]);;
2635 esac
2636 case $srcdir in
2637   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2638     AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
2639 esac
2640
2641 # Do 'set' in a subshell so we don't clobber the current shell's
2642 # arguments.  Must try -L first in case configure is actually a
2643 # symlink; some systems play weird games with the mod time of symlinks
2644 # (eg FreeBSD returns the mod time of the symlink's containing
2645 # directory).
2646 if (
2647    am_has_slept=no
2648    for am_try in 1 2; do
2649      echo "timestamp, slept: $am_has_slept" > conftest.file
2650      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2651      if test "$[*]" = "X"; then
2652         # -L didn't work.
2653         set X `ls -t "$srcdir/configure" conftest.file`
2654      fi
2655      if test "$[*]" != "X $srcdir/configure conftest.file" \
2656         && test "$[*]" != "X conftest.file $srcdir/configure"; then
2657
2658         # If neither matched, then we have a broken ls.  This can happen
2659         # if, for instance, CONFIG_SHELL is bash and it inherits a
2660         # broken ls alias from the environment.  This has actually
2661         # happened.  Such a system could not be considered "sane".
2662         AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2663   alias in your environment])
2664      fi
2665      if test "$[2]" = conftest.file || test $am_try -eq 2; then
2666        break
2667      fi
2668      # Just in case.
2669      sleep 1
2670      am_has_slept=yes
2671    done
2672    test "$[2]" = conftest.file
2673    )
2674 then
2675    # Ok.
2676    :
2677 else
2678    AC_MSG_ERROR([newly created file is older than distributed files!
2679 Check your system clock])
2680 fi
2681 AC_MSG_RESULT([yes])
2682 # If we didn't sleep, we still need to ensure time stamps of config.status and
2683 # generated files are strictly newer.
2684 am_sleep_pid=
2685 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
2686   ( sleep 1 ) &
2687   am_sleep_pid=$!
2688 fi
2689 AC_CONFIG_COMMANDS_PRE(
2690   [AC_MSG_CHECKING([that generated files are newer than configure])
2691    if test -n "$am_sleep_pid"; then
2692      # Hide warnings about reused PIDs.
2693      wait $am_sleep_pid 2>/dev/null
2694    fi
2695    AC_MSG_RESULT([done])])
2696 rm -f conftest.file
2697 ])
2698
2699 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
2700 #
2701 # This file is free software; the Free Software Foundation
2702 # gives unlimited permission to copy and/or distribute it,
2703 # with or without modifications, as long as this notice is preserved.
2704
2705 # AM_SILENT_RULES([DEFAULT])
2706 # --------------------------
2707 # Enable less verbose build rules; with the default set to DEFAULT
2708 # ("yes" being less verbose, "no" or empty being verbose).
2709 AC_DEFUN([AM_SILENT_RULES],
2710 [AC_ARG_ENABLE([silent-rules], [dnl
2711 AS_HELP_STRING(
2712   [--enable-silent-rules],
2713   [less verbose build output (undo: "make V=1")])
2714 AS_HELP_STRING(
2715   [--disable-silent-rules],
2716   [verbose build output (undo: "make V=0")])dnl
2717 ])
2718 case $enable_silent_rules in @%:@ (((
2719   yes) AM_DEFAULT_VERBOSITY=0;;
2720    no) AM_DEFAULT_VERBOSITY=1;;
2721     *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2722 esac
2723 dnl
2724 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
2725 dnl do not support nested variable expansions.
2726 dnl See automake bug#9928 and bug#10237.
2727 am_make=${MAKE-make}
2728 AC_CACHE_CHECK([whether $am_make supports nested variables],
2729    [am_cv_make_support_nested_variables],
2730    [if AS_ECHO([['TRUE=$(BAR$(V))
2731 BAR0=false
2732 BAR1=true
2733 V=1
2734 am__doit:
2735         @$(TRUE)
2736 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
2737   am_cv_make_support_nested_variables=yes
2738 else
2739   am_cv_make_support_nested_variables=no
2740 fi])
2741 if test $am_cv_make_support_nested_variables = yes; then
2742   dnl Using '$V' instead of '$(V)' breaks IRIX make.
2743   AM_V='$(V)'
2744   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2745 else
2746   AM_V=$AM_DEFAULT_VERBOSITY
2747   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2748 fi
2749 AC_SUBST([AM_V])dnl
2750 AM_SUBST_NOTMAKE([AM_V])dnl
2751 AC_SUBST([AM_DEFAULT_V])dnl
2752 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
2753 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2754 AM_BACKSLASH='\'
2755 AC_SUBST([AM_BACKSLASH])dnl
2756 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2757 ])
2758
2759 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2760 #
2761 # This file is free software; the Free Software Foundation
2762 # gives unlimited permission to copy and/or distribute it,
2763 # with or without modifications, as long as this notice is preserved.
2764
2765 # AM_PROG_INSTALL_STRIP
2766 # ---------------------
2767 # One issue with vendor 'install' (even GNU) is that you can't
2768 # specify the program used to strip binaries.  This is especially
2769 # annoying in cross-compiling environments, where the build's strip
2770 # is unlikely to handle the host's binaries.
2771 # Fortunately install-sh will honor a STRIPPROG variable, so we
2772 # always use install-sh in "make install-strip", and initialize
2773 # STRIPPROG with the value of the STRIP variable (set by the user).
2774 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2775 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2776 # Installed binaries are usually stripped using 'strip' when the user
2777 # run "make install-strip".  However 'strip' might not be the right
2778 # tool to use in cross-compilation environments, therefore Automake
2779 # will honor the 'STRIP' environment variable to overrule this program.
2780 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
2781 if test "$cross_compiling" != no; then
2782   AC_CHECK_TOOL([STRIP], [strip], :)
2783 fi
2784 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2785 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2786
2787 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
2788 #
2789 # This file is free software; the Free Software Foundation
2790 # gives unlimited permission to copy and/or distribute it,
2791 # with or without modifications, as long as this notice is preserved.
2792
2793 # _AM_SUBST_NOTMAKE(VARIABLE)
2794 # ---------------------------
2795 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2796 # This macro is traced by Automake.
2797 AC_DEFUN([_AM_SUBST_NOTMAKE])
2798
2799 # AM_SUBST_NOTMAKE(VARIABLE)
2800 # --------------------------
2801 # Public sister of _AM_SUBST_NOTMAKE.
2802 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2803
2804 # Check how to create a tarball.                            -*- Autoconf -*-
2805
2806 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
2807 #
2808 # This file is free software; the Free Software Foundation
2809 # gives unlimited permission to copy and/or distribute it,
2810 # with or without modifications, as long as this notice is preserved.
2811
2812 # _AM_PROG_TAR(FORMAT)
2813 # --------------------
2814 # Check how to create a tarball in format FORMAT.
2815 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
2816 #
2817 # Substitute a variable $(am__tar) that is a command
2818 # writing to stdout a FORMAT-tarball containing the directory
2819 # $tardir.
2820 #     tardir=directory && $(am__tar) > result.tar
2821 #
2822 # Substitute a variable $(am__untar) that extract such
2823 # a tarball read from stdin.
2824 #     $(am__untar) < result.tar
2825 #
2826 AC_DEFUN([_AM_PROG_TAR],
2827 [# Always define AMTAR for backward compatibility.  Yes, it's still used
2828 # in the wild :-(  We should find a proper way to deprecate it ...
2829 AC_SUBST([AMTAR], ['$${TAR-tar}'])
2830
2831 # We'll loop over all known methods to create a tar archive until one works.
2832 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2833
2834 m4_if([$1], [v7],
2835   [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
2836
2837   [m4_case([$1],
2838     [ustar],
2839      [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
2840       # There is notably a 21 bits limit for the UID and the GID.  In fact,
2841       # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
2842       # and bug#13588).
2843       am_max_uid=2097151 # 2^21 - 1
2844       am_max_gid=$am_max_uid
2845       # The $UID and $GID variables are not portable, so we need to resort
2846       # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
2847       # below are definitely unexpected, so allow the users to see them
2848       # (that is, avoid stderr redirection).
2849       am_uid=`id -u || echo unknown`
2850       am_gid=`id -g || echo unknown`
2851       AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
2852       if test $am_uid -le $am_max_uid; then
2853          AC_MSG_RESULT([yes])
2854       else
2855          AC_MSG_RESULT([no])
2856          _am_tools=none
2857       fi
2858       AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
2859       if test $am_gid -le $am_max_gid; then
2860          AC_MSG_RESULT([yes])
2861       else
2862         AC_MSG_RESULT([no])
2863         _am_tools=none
2864       fi],
2865
2866   [pax],
2867     [],
2868
2869   [m4_fatal([Unknown tar format])])
2870
2871   AC_MSG_CHECKING([how to create a $1 tar archive])
2872
2873   # Go ahead even if we have the value already cached.  We do so because we
2874   # need to set the values for the 'am__tar' and 'am__untar' variables.
2875   _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2876
2877   for _am_tool in $_am_tools; do
2878     case $_am_tool in
2879     gnutar)
2880       for _am_tar in tar gnutar gtar; do
2881         AM_RUN_LOG([$_am_tar --version]) && break
2882       done
2883       am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2884       am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2885       am__untar="$_am_tar -xf -"
2886       ;;
2887     plaintar)
2888       # Must skip GNU tar: if it does not support --format= it doesn't create
2889       # ustar tarball either.
2890       (tar --version) >/dev/null 2>&1 && continue
2891       am__tar='tar chf - "$$tardir"'
2892       am__tar_='tar chf - "$tardir"'
2893       am__untar='tar xf -'
2894       ;;
2895     pax)
2896       am__tar='pax -L -x $1 -w "$$tardir"'
2897       am__tar_='pax -L -x $1 -w "$tardir"'
2898       am__untar='pax -r'
2899       ;;
2900     cpio)
2901       am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2902       am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2903       am__untar='cpio -i -H $1 -d'
2904       ;;
2905     none)
2906       am__tar=false
2907       am__tar_=false
2908       am__untar=false
2909       ;;
2910     esac
2911
2912     # If the value was cached, stop now.  We just wanted to have am__tar
2913     # and am__untar set.
2914     test -n "${am_cv_prog_tar_$1}" && break
2915
2916     # tar/untar a dummy directory, and stop if the command works.
2917     rm -rf conftest.dir
2918     mkdir conftest.dir
2919     echo GrepMe > conftest.dir/file
2920     AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2921     rm -rf conftest.dir
2922     if test -s conftest.tar; then
2923       AM_RUN_LOG([$am__untar <conftest.tar])
2924       AM_RUN_LOG([cat conftest.dir/file])
2925       grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2926     fi
2927   done
2928   rm -rf conftest.dir
2929
2930   AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2931   AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2932
2933 AC_SUBST([am__tar])
2934 AC_SUBST([am__untar])
2935 ]) # _AM_PROG_TAR
2936
2937 m4_include([config/libtool.m4])
2938 m4_include([config/ltoptions.m4])
2939 m4_include([config/ltsugar.m4])
2940 m4_include([config/ltversion.m4])
2941 m4_include([config/lt~obsolete.m4])