Clarify license declaration for each package
[platform/upstream/fuse.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-2014 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-2014 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-2014 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-2014 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 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
1416 #
1417 # This file is free software; the Free Software Foundation
1418 # gives unlimited permission to copy and/or distribute it,
1419 # with or without modifications, as long as this notice is preserved.
1420
1421 # AM_AUTOMAKE_VERSION(VERSION)
1422 # ----------------------------
1423 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1424 # generated from the m4 files accompanying Automake X.Y.
1425 # (This private macro should not be called outside this file.)
1426 AC_DEFUN([AM_AUTOMAKE_VERSION],
1427 [am__api_version='1.15'
1428 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1429 dnl require some minimum version.  Point them to the right macro.
1430 m4_if([$1], [1.15.1], [],
1431       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1432 ])
1433
1434 # _AM_AUTOCONF_VERSION(VERSION)
1435 # -----------------------------
1436 # aclocal traces this macro to find the Autoconf version.
1437 # This is a private macro too.  Using m4_define simplifies
1438 # the logic in aclocal, which can simply ignore this definition.
1439 m4_define([_AM_AUTOCONF_VERSION], [])
1440
1441 # AM_SET_CURRENT_AUTOMAKE_VERSION
1442 # -------------------------------
1443 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1444 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1445 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1446 [AM_AUTOMAKE_VERSION([1.15.1])dnl
1447 m4_ifndef([AC_AUTOCONF_VERSION],
1448   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1449 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1450
1451 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1452
1453 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1454 #
1455 # This file is free software; the Free Software Foundation
1456 # gives unlimited permission to copy and/or distribute it,
1457 # with or without modifications, as long as this notice is preserved.
1458
1459 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1460 # $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
1461 # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1462 #
1463 # Of course, Automake must honor this variable whenever it calls a
1464 # tool from the auxiliary directory.  The problem is that $srcdir (and
1465 # therefore $ac_aux_dir as well) can be either absolute or relative,
1466 # depending on how configure is run.  This is pretty annoying, since
1467 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1468 # source directory, any form will work fine, but in subdirectories a
1469 # relative path needs to be adjusted first.
1470 #
1471 # $ac_aux_dir/missing
1472 #    fails when called from a subdirectory if $ac_aux_dir is relative
1473 # $top_srcdir/$ac_aux_dir/missing
1474 #    fails if $ac_aux_dir is absolute,
1475 #    fails when called from a subdirectory in a VPATH build with
1476 #          a relative $ac_aux_dir
1477 #
1478 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1479 # are both prefixed by $srcdir.  In an in-source build this is usually
1480 # harmless because $srcdir is '.', but things will broke when you
1481 # start a VPATH build or use an absolute $srcdir.
1482 #
1483 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1484 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1485 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1486 # and then we would define $MISSING as
1487 #   MISSING="\${SHELL} $am_aux_dir/missing"
1488 # This will work as long as MISSING is not called from configure, because
1489 # unfortunately $(top_srcdir) has no meaning in configure.
1490 # However there are other variables, like CC, which are often used in
1491 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1492 #
1493 # Another solution, used here, is to always expand $ac_aux_dir to an
1494 # absolute PATH.  The drawback is that using absolute paths prevent a
1495 # configured tree to be moved without reconfiguration.
1496
1497 AC_DEFUN([AM_AUX_DIR_EXPAND],
1498 [dnl Rely on autoconf to set up CDPATH properly.
1499 AC_PREREQ([2.50])dnl
1500 # expand $ac_aux_dir to an absolute path
1501 am_aux_dir=`cd $ac_aux_dir && pwd`
1502 ])
1503
1504 # AM_CONDITIONAL                                            -*- Autoconf -*-
1505
1506 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
1507 #
1508 # This file is free software; the Free Software Foundation
1509 # gives unlimited permission to copy and/or distribute it,
1510 # with or without modifications, as long as this notice is preserved.
1511
1512 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1513 # -------------------------------------
1514 # Define a conditional.
1515 AC_DEFUN([AM_CONDITIONAL],
1516 [AC_PREREQ([2.52])dnl
1517  m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1518        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1519 AC_SUBST([$1_TRUE])dnl
1520 AC_SUBST([$1_FALSE])dnl
1521 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1522 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1523 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1524 if $2; then
1525   $1_TRUE=
1526   $1_FALSE='#'
1527 else
1528   $1_TRUE='#'
1529   $1_FALSE=
1530 fi
1531 AC_CONFIG_COMMANDS_PRE(
1532 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1533   AC_MSG_ERROR([[conditional "$1" was never defined.
1534 Usually this means the macro was only invoked conditionally.]])
1535 fi])])
1536
1537 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1538 #
1539 # This file is free software; the Free Software Foundation
1540 # gives unlimited permission to copy and/or distribute it,
1541 # with or without modifications, as long as this notice is preserved.
1542
1543
1544 # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
1545 # written in clear, in which case automake, when reading aclocal.m4,
1546 # will think it sees a *use*, and therefore will trigger all it's
1547 # C support machinery.  Also note that it means that autoscan, seeing
1548 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1549
1550
1551 # _AM_DEPENDENCIES(NAME)
1552 # ----------------------
1553 # See how the compiler implements dependency checking.
1554 # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
1555 # We try a few techniques and use that to set a single cache variable.
1556 #
1557 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1558 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1559 # dependency, and given that the user is not expected to run this macro,
1560 # just rely on AC_PROG_CC.
1561 AC_DEFUN([_AM_DEPENDENCIES],
1562 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1563 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1564 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1565 AC_REQUIRE([AM_DEP_TRACK])dnl
1566
1567 m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
1568       [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
1569       [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1570       [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
1571       [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
1572       [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1573                     [depcc="$$1"   am_compiler_list=])
1574
1575 AC_CACHE_CHECK([dependency style of $depcc],
1576                [am_cv_$1_dependencies_compiler_type],
1577 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1578   # We make a subdir and do the tests there.  Otherwise we can end up
1579   # making bogus files that we don't know about and never remove.  For
1580   # instance it was reported that on HP-UX the gcc test will end up
1581   # making a dummy file named 'D' -- because '-MD' means "put the output
1582   # in D".
1583   rm -rf conftest.dir
1584   mkdir conftest.dir
1585   # Copy depcomp to subdir because otherwise we won't find it if we're
1586   # using a relative directory.
1587   cp "$am_depcomp" conftest.dir
1588   cd conftest.dir
1589   # We will build objects and dependencies in a subdirectory because
1590   # it helps to detect inapplicable dependency modes.  For instance
1591   # both Tru64's cc and ICC support -MD to output dependencies as a
1592   # side effect of compilation, but ICC will put the dependencies in
1593   # the current directory while Tru64 will put them in the object
1594   # directory.
1595   mkdir sub
1596
1597   am_cv_$1_dependencies_compiler_type=none
1598   if test "$am_compiler_list" = ""; then
1599      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1600   fi
1601   am__universal=false
1602   m4_case([$1], [CC],
1603     [case " $depcc " in #(
1604      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1605      esac],
1606     [CXX],
1607     [case " $depcc " in #(
1608      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1609      esac])
1610
1611   for depmode in $am_compiler_list; do
1612     # Setup a source with many dependencies, because some compilers
1613     # like to wrap large dependency lists on column 80 (with \), and
1614     # we should not choose a depcomp mode which is confused by this.
1615     #
1616     # We need to recreate these files for each test, as the compiler may
1617     # overwrite some of them when testing with obscure command lines.
1618     # This happens at least with the AIX C compiler.
1619     : > sub/conftest.c
1620     for i in 1 2 3 4 5 6; do
1621       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1622       # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
1623       # Solaris 10 /bin/sh.
1624       echo '/* dummy */' > sub/conftst$i.h
1625     done
1626     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1627
1628     # We check with '-c' and '-o' for the sake of the "dashmstdout"
1629     # mode.  It turns out that the SunPro C++ compiler does not properly
1630     # handle '-M -o', and we need to detect this.  Also, some Intel
1631     # versions had trouble with output in subdirs.
1632     am__obj=sub/conftest.${OBJEXT-o}
1633     am__minus_obj="-o $am__obj"
1634     case $depmode in
1635     gcc)
1636       # This depmode causes a compiler race in universal mode.
1637       test "$am__universal" = false || continue
1638       ;;
1639     nosideeffect)
1640       # After this tag, mechanisms are not by side-effect, so they'll
1641       # only be used when explicitly requested.
1642       if test "x$enable_dependency_tracking" = xyes; then
1643         continue
1644       else
1645         break
1646       fi
1647       ;;
1648     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
1649       # This compiler won't grok '-c -o', but also, the minuso test has
1650       # not run yet.  These depmodes are late enough in the game, and
1651       # so weak that their functioning should not be impacted.
1652       am__obj=conftest.${OBJEXT-o}
1653       am__minus_obj=
1654       ;;
1655     none) break ;;
1656     esac
1657     if depmode=$depmode \
1658        source=sub/conftest.c object=$am__obj \
1659        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1660        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1661          >/dev/null 2>conftest.err &&
1662        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1663        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1664        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1665        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1666       # icc doesn't choke on unknown options, it will just issue warnings
1667       # or remarks (even with -Werror).  So we grep stderr for any message
1668       # that says an option was ignored or not supported.
1669       # When given -MP, icc 7.0 and 7.1 complain thusly:
1670       #   icc: Command line warning: ignoring option '-M'; no argument required
1671       # The diagnosis changed in icc 8.0:
1672       #   icc: Command line remark: option '-MP' not supported
1673       if (grep 'ignoring option' conftest.err ||
1674           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1675         am_cv_$1_dependencies_compiler_type=$depmode
1676         break
1677       fi
1678     fi
1679   done
1680
1681   cd ..
1682   rm -rf conftest.dir
1683 else
1684   am_cv_$1_dependencies_compiler_type=none
1685 fi
1686 ])
1687 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1688 AM_CONDITIONAL([am__fastdep$1], [
1689   test "x$enable_dependency_tracking" != xno \
1690   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1691 ])
1692
1693
1694 # AM_SET_DEPDIR
1695 # -------------
1696 # Choose a directory name for dependency files.
1697 # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
1698 AC_DEFUN([AM_SET_DEPDIR],
1699 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1700 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1701 ])
1702
1703
1704 # AM_DEP_TRACK
1705 # ------------
1706 AC_DEFUN([AM_DEP_TRACK],
1707 [AC_ARG_ENABLE([dependency-tracking], [dnl
1708 AS_HELP_STRING(
1709   [--enable-dependency-tracking],
1710   [do not reject slow dependency extractors])
1711 AS_HELP_STRING(
1712   [--disable-dependency-tracking],
1713   [speeds up one-time build])])
1714 if test "x$enable_dependency_tracking" != xno; then
1715   am_depcomp="$ac_aux_dir/depcomp"
1716   AMDEPBACKSLASH='\'
1717   am__nodep='_no'
1718 fi
1719 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1720 AC_SUBST([AMDEPBACKSLASH])dnl
1721 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1722 AC_SUBST([am__nodep])dnl
1723 _AM_SUBST_NOTMAKE([am__nodep])dnl
1724 ])
1725
1726 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1727
1728 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
1729 #
1730 # This file is free software; the Free Software Foundation
1731 # gives unlimited permission to copy and/or distribute it,
1732 # with or without modifications, as long as this notice is preserved.
1733
1734
1735 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1736 # ------------------------------
1737 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1738 [{
1739   # Older Autoconf quotes --file arguments for eval, but not when files
1740   # are listed without --file.  Let's play safe and only enable the eval
1741   # if we detect the quoting.
1742   case $CONFIG_FILES in
1743   *\'*) eval set x "$CONFIG_FILES" ;;
1744   *)   set x $CONFIG_FILES ;;
1745   esac
1746   shift
1747   for mf
1748   do
1749     # Strip MF so we end up with the name of the file.
1750     mf=`echo "$mf" | sed -e 's/:.*$//'`
1751     # Check whether this is an Automake generated Makefile or not.
1752     # We used to match only the files named 'Makefile.in', but
1753     # some people rename them; so instead we look at the file content.
1754     # Grep'ing the first line is not enough: some people post-process
1755     # each Makefile.in and add a new line on top of each file to say so.
1756     # Grep'ing the whole file is not good either: AIX grep has a line
1757     # limit of 2048, but all sed's we know have understand at least 4000.
1758     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1759       dirpart=`AS_DIRNAME("$mf")`
1760     else
1761       continue
1762     fi
1763     # Extract the definition of DEPDIR, am__include, and am__quote
1764     # from the Makefile without running 'make'.
1765     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1766     test -z "$DEPDIR" && continue
1767     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1768     test -z "$am__include" && continue
1769     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1770     # Find all dependency output files, they are included files with
1771     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1772     # simplest approach to changing $(DEPDIR) to its actual value in the
1773     # expansion.
1774     for file in `sed -n "
1775       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1776          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1777       # Make sure the directory exists.
1778       test -f "$dirpart/$file" && continue
1779       fdir=`AS_DIRNAME(["$file"])`
1780       AS_MKDIR_P([$dirpart/$fdir])
1781       # echo "creating $dirpart/$file"
1782       echo '# dummy' > "$dirpart/$file"
1783     done
1784   done
1785 }
1786 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1787
1788
1789 # AM_OUTPUT_DEPENDENCY_COMMANDS
1790 # -----------------------------
1791 # This macro should only be invoked once -- use via AC_REQUIRE.
1792 #
1793 # This code is only required when automatic dependency tracking
1794 # is enabled.  FIXME.  This creates each '.P' file that we will
1795 # need in order to bootstrap the dependency handling code.
1796 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1797 [AC_CONFIG_COMMANDS([depfiles],
1798      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1799      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1800 ])
1801
1802 # Do all the work for Automake.                             -*- Autoconf -*-
1803
1804 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
1805 #
1806 # This file is free software; the Free Software Foundation
1807 # gives unlimited permission to copy and/or distribute it,
1808 # with or without modifications, as long as this notice is preserved.
1809
1810 # This macro actually does too much.  Some checks are only needed if
1811 # your package does certain things.  But this isn't really a big deal.
1812
1813 dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
1814 m4_define([AC_PROG_CC],
1815 m4_defn([AC_PROG_CC])
1816 [_AM_PROG_CC_C_O
1817 ])
1818
1819 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1820 # AM_INIT_AUTOMAKE([OPTIONS])
1821 # -----------------------------------------------
1822 # The call with PACKAGE and VERSION arguments is the old style
1823 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1824 # and VERSION should now be passed to AC_INIT and removed from
1825 # the call to AM_INIT_AUTOMAKE.
1826 # We support both call styles for the transition.  After
1827 # the next Automake release, Autoconf can make the AC_INIT
1828 # arguments mandatory, and then we can depend on a new Autoconf
1829 # release and drop the old call support.
1830 AC_DEFUN([AM_INIT_AUTOMAKE],
1831 [AC_PREREQ([2.65])dnl
1832 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1833 dnl the ones we care about.
1834 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1835 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1836 AC_REQUIRE([AC_PROG_INSTALL])dnl
1837 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1838   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1839   # is not polluted with repeated "-I."
1840   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1841   # test to see if srcdir already configured
1842   if test -f $srcdir/config.status; then
1843     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1844   fi
1845 fi
1846
1847 # test whether we have cygpath
1848 if test -z "$CYGPATH_W"; then
1849   if (cygpath --version) >/dev/null 2>/dev/null; then
1850     CYGPATH_W='cygpath -w'
1851   else
1852     CYGPATH_W=echo
1853   fi
1854 fi
1855 AC_SUBST([CYGPATH_W])
1856
1857 # Define the identity of the package.
1858 dnl Distinguish between old-style and new-style calls.
1859 m4_ifval([$2],
1860 [AC_DIAGNOSE([obsolete],
1861              [$0: two- and three-arguments forms are deprecated.])
1862 m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1863  AC_SUBST([PACKAGE], [$1])dnl
1864  AC_SUBST([VERSION], [$2])],
1865 [_AM_SET_OPTIONS([$1])dnl
1866 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1867 m4_if(
1868   m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
1869   [ok:ok],,
1870   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1871  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1872  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1873
1874 _AM_IF_OPTION([no-define],,
1875 [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
1876  AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1877
1878 # Some tools Automake needs.
1879 AC_REQUIRE([AM_SANITY_CHECK])dnl
1880 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1881 AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
1882 AM_MISSING_PROG([AUTOCONF], [autoconf])
1883 AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
1884 AM_MISSING_PROG([AUTOHEADER], [autoheader])
1885 AM_MISSING_PROG([MAKEINFO], [makeinfo])
1886 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1887 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1888 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
1889 # For better backward compatibility.  To be removed once Automake 1.9.x
1890 # dies out for good.  For more background, see:
1891 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1892 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1893 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1894 # We need awk for the "check" target.  The system "awk" is bad on
1895 # some platforms.
1896 AC_REQUIRE([AC_PROG_AWK])dnl
1897 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1898 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1899 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1900               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1901                              [_AM_PROG_TAR([v7])])])
1902 _AM_IF_OPTION([no-dependencies],,
1903 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1904                   [_AM_DEPENDENCIES([CC])],
1905                   [m4_define([AC_PROG_CC],
1906                              m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
1907 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1908                   [_AM_DEPENDENCIES([CXX])],
1909                   [m4_define([AC_PROG_CXX],
1910                              m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
1911 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1912                   [_AM_DEPENDENCIES([OBJC])],
1913                   [m4_define([AC_PROG_OBJC],
1914                              m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
1915 AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
1916                   [_AM_DEPENDENCIES([OBJCXX])],
1917                   [m4_define([AC_PROG_OBJCXX],
1918                              m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
1919 ])
1920 AC_REQUIRE([AM_SILENT_RULES])dnl
1921 dnl The testsuite driver may need to know about EXEEXT, so add the
1922 dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
1923 dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
1924 AC_CONFIG_COMMANDS_PRE(dnl
1925 [m4_provide_if([_AM_COMPILER_EXEEXT],
1926   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1927
1928 # POSIX will say in a future version that running "rm -f" with no argument
1929 # is OK; and we want to be able to make that assumption in our Makefile
1930 # recipes.  So use an aggressive probe to check that the usage we want is
1931 # actually supported "in the wild" to an acceptable degree.
1932 # See automake bug#10828.
1933 # To make any issue more visible, cause the running configure to be aborted
1934 # by default if the 'rm' program in use doesn't match our expectations; the
1935 # user can still override this though.
1936 if rm -f && rm -fr && rm -rf; then : OK; else
1937   cat >&2 <<'END'
1938 Oops!
1939
1940 Your 'rm' program seems unable to run without file operands specified
1941 on the command line, even when the '-f' option is present.  This is contrary
1942 to the behaviour of most rm programs out there, and not conforming with
1943 the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
1944
1945 Please tell bug-automake@gnu.org about your system, including the value
1946 of your $PATH and any error possibly output before this message.  This
1947 can help us improve future automake versions.
1948
1949 END
1950   if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
1951     echo 'Configuration will proceed anyway, since you have set the' >&2
1952     echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
1953     echo >&2
1954   else
1955     cat >&2 <<'END'
1956 Aborting the configuration process, to ensure you take notice of the issue.
1957
1958 You can download and install GNU coreutils to get an 'rm' implementation
1959 that behaves properly: <http://www.gnu.org/software/coreutils/>.
1960
1961 If you want to complete the configuration process using your problematic
1962 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
1963 to "yes", and re-run configure.
1964
1965 END
1966     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
1967   fi
1968 fi
1969 ])
1970
1971 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1972 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1973 dnl mangled by Autoconf and run in a shell conditional statement.
1974 m4_define([_AC_COMPILER_EXEEXT],
1975 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1976
1977 # When config.status generates a header, we must update the stamp-h file.
1978 # This file resides in the same directory as the config header
1979 # that is generated.  The stamp files are numbered to have different names.
1980
1981 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1982 # loop where config.status creates the headers, so we can generate
1983 # our stamp files there.
1984 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1985 [# Compute $1's index in $config_headers.
1986 _am_arg=$1
1987 _am_stamp_count=1
1988 for _am_header in $config_headers :; do
1989   case $_am_header in
1990     $_am_arg | $_am_arg:* )
1991       break ;;
1992     * )
1993       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1994   esac
1995 done
1996 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1997
1998 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
1999 #
2000 # This file is free software; the Free Software Foundation
2001 # gives unlimited permission to copy and/or distribute it,
2002 # with or without modifications, as long as this notice is preserved.
2003
2004 # AM_PROG_INSTALL_SH
2005 # ------------------
2006 # Define $install_sh.
2007 AC_DEFUN([AM_PROG_INSTALL_SH],
2008 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2009 if test x"${install_sh}" != xset; then
2010   case $am_aux_dir in
2011   *\ * | *\     *)
2012     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2013   *)
2014     install_sh="\${SHELL} $am_aux_dir/install-sh"
2015   esac
2016 fi
2017 AC_SUBST([install_sh])])
2018
2019 # Copyright (C) 2003-2013 Free Software Foundation, Inc.
2020 #
2021 # This file is free software; the Free Software Foundation
2022 # gives unlimited permission to copy and/or distribute it,
2023 # with or without modifications, as long as this notice is preserved.
2024
2025 # Check whether the underlying file-system supports filenames
2026 # with a leading dot.  For instance MS-DOS doesn't.
2027 AC_DEFUN([AM_SET_LEADING_DOT],
2028 [rm -rf .tst 2>/dev/null
2029 mkdir .tst 2>/dev/null
2030 if test -d .tst; then
2031   am__leading_dot=.
2032 else
2033   am__leading_dot=_
2034 fi
2035 rmdir .tst 2>/dev/null
2036 AC_SUBST([am__leading_dot])])
2037
2038 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
2039
2040 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2041 #
2042 # This file is free software; the Free Software Foundation
2043 # gives unlimited permission to copy and/or distribute it,
2044 # with or without modifications, as long as this notice is preserved.
2045
2046 # AM_MAKE_INCLUDE()
2047 # -----------------
2048 # Check to see how make treats includes.
2049 AC_DEFUN([AM_MAKE_INCLUDE],
2050 [am_make=${MAKE-make}
2051 cat > confinc << 'END'
2052 am__doit:
2053         @echo this is the am__doit target
2054 .PHONY: am__doit
2055 END
2056 # If we don't find an include directive, just comment out the code.
2057 AC_MSG_CHECKING([for style of include used by $am_make])
2058 am__include="#"
2059 am__quote=
2060 _am_result=none
2061 # First try GNU make style include.
2062 echo "include confinc" > confmf
2063 # Ignore all kinds of additional output from 'make'.
2064 case `$am_make -s -f confmf 2> /dev/null` in #(
2065 *the\ am__doit\ target*)
2066   am__include=include
2067   am__quote=
2068   _am_result=GNU
2069   ;;
2070 esac
2071 # Now try BSD make style include.
2072 if test "$am__include" = "#"; then
2073    echo '.include "confinc"' > confmf
2074    case `$am_make -s -f confmf 2> /dev/null` in #(
2075    *the\ am__doit\ target*)
2076      am__include=.include
2077      am__quote="\""
2078      _am_result=BSD
2079      ;;
2080    esac
2081 fi
2082 AC_SUBST([am__include])
2083 AC_SUBST([am__quote])
2084 AC_MSG_RESULT([$_am_result])
2085 rm -f confinc confmf
2086 ])
2087
2088 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2089
2090 # Copyright (C) 1997-2013 Free Software Foundation, Inc.
2091 #
2092 # This file is free software; the Free Software Foundation
2093 # gives unlimited permission to copy and/or distribute it,
2094 # with or without modifications, as long as this notice is preserved.
2095
2096 # AM_MISSING_PROG(NAME, PROGRAM)
2097 # ------------------------------
2098 AC_DEFUN([AM_MISSING_PROG],
2099 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2100 $1=${$1-"${am_missing_run}$2"}
2101 AC_SUBST($1)])
2102
2103 # AM_MISSING_HAS_RUN
2104 # ------------------
2105 # Define MISSING if not defined so far and test if it is modern enough.
2106 # If it is, set am_missing_run to use it, otherwise, to nothing.
2107 AC_DEFUN([AM_MISSING_HAS_RUN],
2108 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2109 AC_REQUIRE_AUX_FILE([missing])dnl
2110 if test x"${MISSING+set}" != xset; then
2111   case $am_aux_dir in
2112   *\ * | *\     *)
2113     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2114   *)
2115     MISSING="\${SHELL} $am_aux_dir/missing" ;;
2116   esac
2117 fi
2118 # Use eval to expand $SHELL
2119 if eval "$MISSING --is-lightweight"; then
2120   am_missing_run="$MISSING "
2121 else
2122   am_missing_run=
2123   AC_MSG_WARN(['missing' script is too old or missing])
2124 fi
2125 ])
2126
2127 # Helper functions for option handling.                     -*- Autoconf -*-
2128
2129 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2130 #
2131 # This file is free software; the Free Software Foundation
2132 # gives unlimited permission to copy and/or distribute it,
2133 # with or without modifications, as long as this notice is preserved.
2134
2135 # _AM_MANGLE_OPTION(NAME)
2136 # -----------------------
2137 AC_DEFUN([_AM_MANGLE_OPTION],
2138 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2139
2140 # _AM_SET_OPTION(NAME)
2141 # --------------------
2142 # Set option NAME.  Presently that only means defining a flag for this option.
2143 AC_DEFUN([_AM_SET_OPTION],
2144 [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
2145
2146 # _AM_SET_OPTIONS(OPTIONS)
2147 # ------------------------
2148 # OPTIONS is a space-separated list of Automake options.
2149 AC_DEFUN([_AM_SET_OPTIONS],
2150 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2151
2152 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2153 # -------------------------------------------
2154 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2155 AC_DEFUN([_AM_IF_OPTION],
2156 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2157
2158 # Copyright (C) 1999-2013 Free Software Foundation, Inc.
2159 #
2160 # This file is free software; the Free Software Foundation
2161 # gives unlimited permission to copy and/or distribute it,
2162 # with or without modifications, as long as this notice is preserved.
2163
2164 # _AM_PROG_CC_C_O
2165 # ---------------
2166 # Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
2167 # to automatically call this.
2168 AC_DEFUN([_AM_PROG_CC_C_O],
2169 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2170 AC_REQUIRE_AUX_FILE([compile])dnl
2171 AC_LANG_PUSH([C])dnl
2172 AC_CACHE_CHECK(
2173   [whether $CC understands -c and -o together],
2174   [am_cv_prog_cc_c_o],
2175   [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
2176   # Make sure it works both with $CC and with simple cc.
2177   # Following AC_PROG_CC_C_O, we do the test twice because some
2178   # compilers refuse to overwrite an existing .o file with -o,
2179   # though they will create one.
2180   am_cv_prog_cc_c_o=yes
2181   for am_i in 1 2; do
2182     if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
2183          && test -f conftest2.$ac_objext; then
2184       : OK
2185     else
2186       am_cv_prog_cc_c_o=no
2187       break
2188     fi
2189   done
2190   rm -f core conftest*
2191   unset am_i])
2192 if test "$am_cv_prog_cc_c_o" != yes; then
2193    # Losing compiler, so override with the script.
2194    # FIXME: It is wrong to rewrite CC.
2195    # But if we don't then we get into trouble of one sort or another.
2196    # A longer-term fix would be to have automake use am__CC in this case,
2197    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2198    CC="$am_aux_dir/compile $CC"
2199 fi
2200 AC_LANG_POP([C])])
2201
2202 # For backward compatibility.
2203 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
2204
2205 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2206 #
2207 # This file is free software; the Free Software Foundation
2208 # gives unlimited permission to copy and/or distribute it,
2209 # with or without modifications, as long as this notice is preserved.
2210
2211 # AM_RUN_LOG(COMMAND)
2212 # -------------------
2213 # Run COMMAND, save the exit status in ac_status, and log it.
2214 # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
2215 AC_DEFUN([AM_RUN_LOG],
2216 [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
2217    ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
2218    ac_status=$?
2219    echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2220    (exit $ac_status); }])
2221
2222 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
2223
2224 # Copyright (C) 1996-2013 Free Software Foundation, Inc.
2225 #
2226 # This file is free software; the Free Software Foundation
2227 # gives unlimited permission to copy and/or distribute it,
2228 # with or without modifications, as long as this notice is preserved.
2229
2230 # AM_SANITY_CHECK
2231 # ---------------
2232 AC_DEFUN([AM_SANITY_CHECK],
2233 [AC_MSG_CHECKING([whether build environment is sane])
2234 # Reject unsafe characters in $srcdir or the absolute working directory
2235 # name.  Accept space and tab only in the latter.
2236 am_lf='
2237 '
2238 case `pwd` in
2239   *[[\\\"\#\$\&\'\`$am_lf]]*)
2240     AC_MSG_ERROR([unsafe absolute working directory name]);;
2241 esac
2242 case $srcdir in
2243   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2244     AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
2245 esac
2246
2247 # Do 'set' in a subshell so we don't clobber the current shell's
2248 # arguments.  Must try -L first in case configure is actually a
2249 # symlink; some systems play weird games with the mod time of symlinks
2250 # (eg FreeBSD returns the mod time of the symlink's containing
2251 # directory).
2252 if (
2253    am_has_slept=no
2254    for am_try in 1 2; do
2255      echo "timestamp, slept: $am_has_slept" > conftest.file
2256      set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2257      if test "$[*]" = "X"; then
2258         # -L didn't work.
2259         set X `ls -t "$srcdir/configure" conftest.file`
2260      fi
2261      if test "$[*]" != "X $srcdir/configure conftest.file" \
2262         && test "$[*]" != "X conftest.file $srcdir/configure"; then
2263
2264         # If neither matched, then we have a broken ls.  This can happen
2265         # if, for instance, CONFIG_SHELL is bash and it inherits a
2266         # broken ls alias from the environment.  This has actually
2267         # happened.  Such a system could not be considered "sane".
2268         AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2269   alias in your environment])
2270      fi
2271      if test "$[2]" = conftest.file || test $am_try -eq 2; then
2272        break
2273      fi
2274      # Just in case.
2275      sleep 1
2276      am_has_slept=yes
2277    done
2278    test "$[2]" = conftest.file
2279    )
2280 then
2281    # Ok.
2282    :
2283 else
2284    AC_MSG_ERROR([newly created file is older than distributed files!
2285 Check your system clock])
2286 fi
2287 AC_MSG_RESULT([yes])
2288 # If we didn't sleep, we still need to ensure time stamps of config.status and
2289 # generated files are strictly newer.
2290 am_sleep_pid=
2291 if grep 'slept: no' conftest.file >/dev/null 2>&1; then
2292   ( sleep 1 ) &
2293   am_sleep_pid=$!
2294 fi
2295 AC_CONFIG_COMMANDS_PRE(
2296   [AC_MSG_CHECKING([that generated files are newer than configure])
2297    if test -n "$am_sleep_pid"; then
2298      # Hide warnings about reused PIDs.
2299      wait $am_sleep_pid 2>/dev/null
2300    fi
2301    AC_MSG_RESULT([done])])
2302 rm -f conftest.file
2303 ])
2304
2305 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
2306 #
2307 # This file is free software; the Free Software Foundation
2308 # gives unlimited permission to copy and/or distribute it,
2309 # with or without modifications, as long as this notice is preserved.
2310
2311 # AM_SILENT_RULES([DEFAULT])
2312 # --------------------------
2313 # Enable less verbose build rules; with the default set to DEFAULT
2314 # ("yes" being less verbose, "no" or empty being verbose).
2315 AC_DEFUN([AM_SILENT_RULES],
2316 [AC_ARG_ENABLE([silent-rules], [dnl
2317 AS_HELP_STRING(
2318   [--enable-silent-rules],
2319   [less verbose build output (undo: "make V=1")])
2320 AS_HELP_STRING(
2321   [--disable-silent-rules],
2322   [verbose build output (undo: "make V=0")])dnl
2323 ])
2324 case $enable_silent_rules in @%:@ (((
2325   yes) AM_DEFAULT_VERBOSITY=0;;
2326    no) AM_DEFAULT_VERBOSITY=1;;
2327     *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2328 esac
2329 dnl
2330 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
2331 dnl do not support nested variable expansions.
2332 dnl See automake bug#9928 and bug#10237.
2333 am_make=${MAKE-make}
2334 AC_CACHE_CHECK([whether $am_make supports nested variables],
2335    [am_cv_make_support_nested_variables],
2336    [if AS_ECHO([['TRUE=$(BAR$(V))
2337 BAR0=false
2338 BAR1=true
2339 V=1
2340 am__doit:
2341         @$(TRUE)
2342 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
2343   am_cv_make_support_nested_variables=yes
2344 else
2345   am_cv_make_support_nested_variables=no
2346 fi])
2347 if test $am_cv_make_support_nested_variables = yes; then
2348   dnl Using '$V' instead of '$(V)' breaks IRIX make.
2349   AM_V='$(V)'
2350   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
2351 else
2352   AM_V=$AM_DEFAULT_VERBOSITY
2353   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
2354 fi
2355 AC_SUBST([AM_V])dnl
2356 AM_SUBST_NOTMAKE([AM_V])dnl
2357 AC_SUBST([AM_DEFAULT_V])dnl
2358 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
2359 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2360 AM_BACKSLASH='\'
2361 AC_SUBST([AM_BACKSLASH])dnl
2362 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2363 ])
2364
2365 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
2366 #
2367 # This file is free software; the Free Software Foundation
2368 # gives unlimited permission to copy and/or distribute it,
2369 # with or without modifications, as long as this notice is preserved.
2370
2371 # AM_PROG_INSTALL_STRIP
2372 # ---------------------
2373 # One issue with vendor 'install' (even GNU) is that you can't
2374 # specify the program used to strip binaries.  This is especially
2375 # annoying in cross-compiling environments, where the build's strip
2376 # is unlikely to handle the host's binaries.
2377 # Fortunately install-sh will honor a STRIPPROG variable, so we
2378 # always use install-sh in "make install-strip", and initialize
2379 # STRIPPROG with the value of the STRIP variable (set by the user).
2380 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2381 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2382 # Installed binaries are usually stripped using 'strip' when the user
2383 # run "make install-strip".  However 'strip' might not be the right
2384 # tool to use in cross-compilation environments, therefore Automake
2385 # will honor the 'STRIP' environment variable to overrule this program.
2386 dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
2387 if test "$cross_compiling" != no; then
2388   AC_CHECK_TOOL([STRIP], [strip], :)
2389 fi
2390 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2391 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2392
2393 # Copyright (C) 2006-2013 Free Software Foundation, Inc.
2394 #
2395 # This file is free software; the Free Software Foundation
2396 # gives unlimited permission to copy and/or distribute it,
2397 # with or without modifications, as long as this notice is preserved.
2398
2399 # _AM_SUBST_NOTMAKE(VARIABLE)
2400 # ---------------------------
2401 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2402 # This macro is traced by Automake.
2403 AC_DEFUN([_AM_SUBST_NOTMAKE])
2404
2405 # AM_SUBST_NOTMAKE(VARIABLE)
2406 # --------------------------
2407 # Public sister of _AM_SUBST_NOTMAKE.
2408 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2409
2410 # Check how to create a tarball.                            -*- Autoconf -*-
2411
2412 # Copyright (C) 2004-2013 Free Software Foundation, Inc.
2413 #
2414 # This file is free software; the Free Software Foundation
2415 # gives unlimited permission to copy and/or distribute it,
2416 # with or without modifications, as long as this notice is preserved.
2417
2418 # _AM_PROG_TAR(FORMAT)
2419 # --------------------
2420 # Check how to create a tarball in format FORMAT.
2421 # FORMAT should be one of 'v7', 'ustar', or 'pax'.
2422 #
2423 # Substitute a variable $(am__tar) that is a command
2424 # writing to stdout a FORMAT-tarball containing the directory
2425 # $tardir.
2426 #     tardir=directory && $(am__tar) > result.tar
2427 #
2428 # Substitute a variable $(am__untar) that extract such
2429 # a tarball read from stdin.
2430 #     $(am__untar) < result.tar
2431 #
2432 AC_DEFUN([_AM_PROG_TAR],
2433 [# Always define AMTAR for backward compatibility.  Yes, it's still used
2434 # in the wild :-(  We should find a proper way to deprecate it ...
2435 AC_SUBST([AMTAR], ['$${TAR-tar}'])
2436
2437 # We'll loop over all known methods to create a tar archive until one works.
2438 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2439
2440 m4_if([$1], [v7],
2441   [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
2442
2443   [m4_case([$1],
2444     [ustar],
2445      [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
2446       # There is notably a 21 bits limit for the UID and the GID.  In fact,
2447       # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
2448       # and bug#13588).
2449       am_max_uid=2097151 # 2^21 - 1
2450       am_max_gid=$am_max_uid
2451       # The $UID and $GID variables are not portable, so we need to resort
2452       # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
2453       # below are definitely unexpected, so allow the users to see them
2454       # (that is, avoid stderr redirection).
2455       am_uid=`id -u || echo unknown`
2456       am_gid=`id -g || echo unknown`
2457       AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
2458       if test $am_uid -le $am_max_uid; then
2459          AC_MSG_RESULT([yes])
2460       else
2461          AC_MSG_RESULT([no])
2462          _am_tools=none
2463       fi
2464       AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
2465       if test $am_gid -le $am_max_gid; then
2466          AC_MSG_RESULT([yes])
2467       else
2468         AC_MSG_RESULT([no])
2469         _am_tools=none
2470       fi],
2471
2472   [pax],
2473     [],
2474
2475   [m4_fatal([Unknown tar format])])
2476
2477   AC_MSG_CHECKING([how to create a $1 tar archive])
2478
2479   # Go ahead even if we have the value already cached.  We do so because we
2480   # need to set the values for the 'am__tar' and 'am__untar' variables.
2481   _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2482
2483   for _am_tool in $_am_tools; do
2484     case $_am_tool in
2485     gnutar)
2486       for _am_tar in tar gnutar gtar; do
2487         AM_RUN_LOG([$_am_tar --version]) && break
2488       done
2489       am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2490       am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2491       am__untar="$_am_tar -xf -"
2492       ;;
2493     plaintar)
2494       # Must skip GNU tar: if it does not support --format= it doesn't create
2495       # ustar tarball either.
2496       (tar --version) >/dev/null 2>&1 && continue
2497       am__tar='tar chf - "$$tardir"'
2498       am__tar_='tar chf - "$tardir"'
2499       am__untar='tar xf -'
2500       ;;
2501     pax)
2502       am__tar='pax -L -x $1 -w "$$tardir"'
2503       am__tar_='pax -L -x $1 -w "$tardir"'
2504       am__untar='pax -r'
2505       ;;
2506     cpio)
2507       am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2508       am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2509       am__untar='cpio -i -H $1 -d'
2510       ;;
2511     none)
2512       am__tar=false
2513       am__tar_=false
2514       am__untar=false
2515       ;;
2516     esac
2517
2518     # If the value was cached, stop now.  We just wanted to have am__tar
2519     # and am__untar set.
2520     test -n "${am_cv_prog_tar_$1}" && break
2521
2522     # tar/untar a dummy directory, and stop if the command works.
2523     rm -rf conftest.dir
2524     mkdir conftest.dir
2525     echo GrepMe > conftest.dir/file
2526     AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2527     rm -rf conftest.dir
2528     if test -s conftest.tar; then
2529       AM_RUN_LOG([$am__untar <conftest.tar])
2530       AM_RUN_LOG([cat conftest.dir/file])
2531       grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2532     fi
2533   done
2534   rm -rf conftest.dir
2535
2536   AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2537   AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2538
2539 AC_SUBST([am__tar])
2540 AC_SUBST([am__untar])
2541 ]) # _AM_PROG_TAR
2542
2543 m4_include([m4/libtool.m4])
2544 m4_include([m4/ltoptions.m4])
2545 m4_include([m4/ltsugar.m4])
2546 m4_include([m4/ltversion.m4])
2547 m4_include([m4/lt~obsolete.m4])