Tizen 2.1 base
[framework/base/fuse.git] / aclocal.m4
1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE.
13
14 m4_ifndef([AC_AUTOCONF_VERSION],
15   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16 m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
17 [m4_warning([this file was generated for autoconf 2.68.
18 You have another version of autoconf.  It may work, but is not guaranteed to.
19 If you have problems, you may need to regenerate the build system entirely.
20 To do so, use the procedure documented by the package, typically `autoreconf'.])])
21
22 # iconv.m4 serial 11 (gettext-0.18.1)
23 dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
24 dnl This file is free software; the Free Software Foundation
25 dnl gives unlimited permission to copy and/or distribute it,
26 dnl with or without modifications, as long as this notice is preserved.
27
28 dnl From Bruno Haible.
29
30 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
31 [
32   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
33   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
34   AC_REQUIRE([AC_LIB_RPATH])
35
36   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
37   dnl accordingly.
38   AC_LIB_LINKFLAGS_BODY([iconv])
39 ])
40
41 AC_DEFUN([AM_ICONV_LINK],
42 [
43   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
44   dnl those with the standalone portable GNU libiconv installed).
45   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
46
47   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
48   dnl accordingly.
49   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
50
51   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
52   dnl because if the user has installed libiconv and not disabled its use
53   dnl via --without-libiconv-prefix, he wants to use it. The first
54   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
55   am_save_CPPFLAGS="$CPPFLAGS"
56   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
57
58   AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
59     am_cv_func_iconv="no, consider installing GNU libiconv"
60     am_cv_lib_iconv=no
61     AC_TRY_LINK([#include <stdlib.h>
62 #include <iconv.h>],
63       [iconv_t cd = iconv_open("","");
64        iconv(cd,NULL,NULL,NULL,NULL);
65        iconv_close(cd);],
66       [am_cv_func_iconv=yes])
67     if test "$am_cv_func_iconv" != yes; then
68       am_save_LIBS="$LIBS"
69       LIBS="$LIBS $LIBICONV"
70       AC_TRY_LINK([#include <stdlib.h>
71 #include <iconv.h>],
72         [iconv_t cd = iconv_open("","");
73          iconv(cd,NULL,NULL,NULL,NULL);
74          iconv_close(cd);],
75         [am_cv_lib_iconv=yes]
76         [am_cv_func_iconv=yes])
77       LIBS="$am_save_LIBS"
78     fi
79   ])
80   if test "$am_cv_func_iconv" = yes; then
81     AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
82       dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
83       am_save_LIBS="$LIBS"
84       if test $am_cv_lib_iconv = yes; then
85         LIBS="$LIBS $LIBICONV"
86       fi
87       AC_TRY_RUN([
88 #include <iconv.h>
89 #include <string.h>
90 int main ()
91 {
92   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
93      returns.  */
94   {
95     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
96     if (cd_utf8_to_88591 != (iconv_t)(-1))
97       {
98         static const char input[] = "\342\202\254"; /* EURO SIGN */
99         char buf[10];
100         const char *inptr = input;
101         size_t inbytesleft = strlen (input);
102         char *outptr = buf;
103         size_t outbytesleft = sizeof (buf);
104         size_t res = iconv (cd_utf8_to_88591,
105                             (char **) &inptr, &inbytesleft,
106                             &outptr, &outbytesleft);
107         if (res == 0)
108           return 1;
109       }
110   }
111   /* Test against Solaris 10 bug: Failures are not distinguishable from
112      successful returns.  */
113   {
114     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
115     if (cd_ascii_to_88591 != (iconv_t)(-1))
116       {
117         static const char input[] = "\263";
118         char buf[10];
119         const char *inptr = input;
120         size_t inbytesleft = strlen (input);
121         char *outptr = buf;
122         size_t outbytesleft = sizeof (buf);
123         size_t res = iconv (cd_ascii_to_88591,
124                             (char **) &inptr, &inbytesleft,
125                             &outptr, &outbytesleft);
126         if (res == 0)
127           return 1;
128       }
129   }
130 #if 0 /* This bug could be worked around by the caller.  */
131   /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
132   {
133     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
134     if (cd_88591_to_utf8 != (iconv_t)(-1))
135       {
136         static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
137         char buf[50];
138         const char *inptr = input;
139         size_t inbytesleft = strlen (input);
140         char *outptr = buf;
141         size_t outbytesleft = sizeof (buf);
142         size_t res = iconv (cd_88591_to_utf8,
143                             (char **) &inptr, &inbytesleft,
144                             &outptr, &outbytesleft);
145         if ((int)res > 0)
146           return 1;
147       }
148   }
149 #endif
150   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
151      provided.  */
152   if (/* Try standardized names.  */
153       iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
154       /* Try IRIX, OSF/1 names.  */
155       && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
156       /* Try AIX names.  */
157       && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
158       /* Try HP-UX names.  */
159       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
160     return 1;
161   return 0;
162 }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
163         [case "$host_os" in
164            aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
165            *)            am_cv_func_iconv_works="guessing yes" ;;
166          esac])
167       LIBS="$am_save_LIBS"
168     ])
169     case "$am_cv_func_iconv_works" in
170       *no) am_func_iconv=no am_cv_lib_iconv=no ;;
171       *)   am_func_iconv=yes ;;
172     esac
173   else
174     am_func_iconv=no am_cv_lib_iconv=no
175   fi
176   if test "$am_func_iconv" = yes; then
177     AC_DEFINE([HAVE_ICONV], [1],
178       [Define if you have the iconv() function and it works.])
179   fi
180   if test "$am_cv_lib_iconv" = yes; then
181     AC_MSG_CHECKING([how to link with libiconv])
182     AC_MSG_RESULT([$LIBICONV])
183   else
184     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
185     dnl either.
186     CPPFLAGS="$am_save_CPPFLAGS"
187     LIBICONV=
188     LTLIBICONV=
189   fi
190   AC_SUBST([LIBICONV])
191   AC_SUBST([LTLIBICONV])
192 ])
193
194 dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
195 dnl avoid warnings like
196 dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
197 dnl This is tricky because of the way 'aclocal' is implemented:
198 dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
199 dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
200 dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
201 dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
202 dnl   warnings.
203 m4_define([gl_iconv_AC_DEFUN],
204   m4_version_prereq([2.64],
205     [[AC_DEFUN_ONCE(
206         [$1], [$2])]],
207     [[AC_DEFUN(
208         [$1], [$2])]]))
209 gl_iconv_AC_DEFUN([AM_ICONV],
210 [
211   AM_ICONV_LINK
212   if test "$am_cv_func_iconv" = yes; then
213     AC_MSG_CHECKING([for iconv declaration])
214     AC_CACHE_VAL([am_cv_proto_iconv], [
215       AC_TRY_COMPILE([
216 #include <stdlib.h>
217 #include <iconv.h>
218 extern
219 #ifdef __cplusplus
220 "C"
221 #endif
222 #if defined(__STDC__) || defined(__cplusplus)
223 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
224 #else
225 size_t iconv();
226 #endif
227 ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"])
228       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);"])
229     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
230     AC_MSG_RESULT([
231          $am_cv_proto_iconv])
232     AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
233       [Define as const if the declaration of iconv() needs const.])
234   fi
235 ])
236
237 # lib-ld.m4 serial 4 (gettext-0.18)
238 dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
239 dnl This file is free software; the Free Software Foundation
240 dnl gives unlimited permission to copy and/or distribute it,
241 dnl with or without modifications, as long as this notice is preserved.
242
243 dnl Subroutines of libtool.m4,
244 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
245 dnl with libtool.m4.
246
247 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
248 AC_DEFUN([AC_LIB_PROG_LD_GNU],
249 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
250 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
251 case `$LD -v 2>&1 </dev/null` in
252 *GNU* | *'with BFD'*)
253   acl_cv_prog_gnu_ld=yes ;;
254 *)
255   acl_cv_prog_gnu_ld=no ;;
256 esac])
257 with_gnu_ld=$acl_cv_prog_gnu_ld
258 ])
259
260 dnl From libtool-1.4. Sets the variable LD.
261 AC_DEFUN([AC_LIB_PROG_LD],
262 [AC_ARG_WITH([gnu-ld],
263 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
264 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
265 AC_REQUIRE([AC_PROG_CC])dnl
266 AC_REQUIRE([AC_CANONICAL_HOST])dnl
267 # Prepare PATH_SEPARATOR.
268 # The user is always right.
269 if test "${PATH_SEPARATOR+set}" != set; then
270   echo "#! /bin/sh" >conf$$.sh
271   echo  "exit 0"   >>conf$$.sh
272   chmod +x conf$$.sh
273   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
274     PATH_SEPARATOR=';'
275   else
276     PATH_SEPARATOR=:
277   fi
278   rm -f conf$$.sh
279 fi
280 ac_prog=ld
281 if test "$GCC" = yes; then
282   # Check if gcc -print-prog-name=ld gives a path.
283   AC_MSG_CHECKING([for ld used by GCC])
284   case $host in
285   *-*-mingw*)
286     # gcc leaves a trailing carriage return which upsets mingw
287     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
288   *)
289     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
290   esac
291   case $ac_prog in
292     # Accept absolute paths.
293     [[\\/]* | [A-Za-z]:[\\/]*)]
294       [re_direlt='/[^/][^/]*/\.\./']
295       # Canonicalize the path of ld
296       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
297       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
298         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
299       done
300       test -z "$LD" && LD="$ac_prog"
301       ;;
302   "")
303     # If it fails, then pretend we aren't using GCC.
304     ac_prog=ld
305     ;;
306   *)
307     # If it is relative, then search for the first ld in PATH.
308     with_gnu_ld=unknown
309     ;;
310   esac
311 elif test "$with_gnu_ld" = yes; then
312   AC_MSG_CHECKING([for GNU ld])
313 else
314   AC_MSG_CHECKING([for non-GNU ld])
315 fi
316 AC_CACHE_VAL([acl_cv_path_LD],
317 [if test -z "$LD"; then
318   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
319   for ac_dir in $PATH; do
320     test -z "$ac_dir" && ac_dir=.
321     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
322       acl_cv_path_LD="$ac_dir/$ac_prog"
323       # Check to see if the program is GNU ld.  I'd rather use --version,
324       # but apparently some GNU ld's only accept -v.
325       # Break only if it was the GNU/non-GNU ld that we prefer.
326       case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
327       *GNU* | *'with BFD'*)
328         test "$with_gnu_ld" != no && break ;;
329       *)
330         test "$with_gnu_ld" != yes && break ;;
331       esac
332     fi
333   done
334   IFS="$ac_save_ifs"
335 else
336   acl_cv_path_LD="$LD" # Let the user override the test with a path.
337 fi])
338 LD="$acl_cv_path_LD"
339 if test -n "$LD"; then
340   AC_MSG_RESULT([$LD])
341 else
342   AC_MSG_RESULT([no])
343 fi
344 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
345 AC_LIB_PROG_LD_GNU
346 ])
347
348 # lib-link.m4 serial 21 (gettext-0.18)
349 dnl Copyright (C) 2001-2010 Free Software Foundation, Inc.
350 dnl This file is free software; the Free Software Foundation
351 dnl gives unlimited permission to copy and/or distribute it,
352 dnl with or without modifications, as long as this notice is preserved.
353
354 dnl From Bruno Haible.
355
356 AC_PREREQ([2.54])
357
358 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
359 dnl the libraries corresponding to explicit and implicit dependencies.
360 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
361 dnl augments the CPPFLAGS variable.
362 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
363 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
364 AC_DEFUN([AC_LIB_LINKFLAGS],
365 [
366   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
367   AC_REQUIRE([AC_LIB_RPATH])
368   pushdef([Name],[translit([$1],[./-], [___])])
369   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
370                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
371   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
372     AC_LIB_LINKFLAGS_BODY([$1], [$2])
373     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
374     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
375     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
376     ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
377   ])
378   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
379   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
380   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
381   LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
382   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
383   AC_SUBST([LIB]NAME)
384   AC_SUBST([LTLIB]NAME)
385   AC_SUBST([LIB]NAME[_PREFIX])
386   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
387   dnl results of this search when this library appears as a dependency.
388   HAVE_LIB[]NAME=yes
389   popdef([NAME])
390   popdef([Name])
391 ])
392
393 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
394 dnl searches for libname and the libraries corresponding to explicit and
395 dnl implicit dependencies, together with the specified include files and
396 dnl the ability to compile and link the specified testcode. The missing-message
397 dnl defaults to 'no' and may contain additional hints for the user.
398 dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
399 dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
400 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
401 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
402 dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
403 dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
404 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
405 [
406   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
407   AC_REQUIRE([AC_LIB_RPATH])
408   pushdef([Name],[translit([$1],[./-], [___])])
409   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
410                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
411
412   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
413   dnl accordingly.
414   AC_LIB_LINKFLAGS_BODY([$1], [$2])
415
416   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
417   dnl because if the user has installed lib[]Name and not disabled its use
418   dnl via --without-lib[]Name-prefix, he wants to use it.
419   ac_save_CPPFLAGS="$CPPFLAGS"
420   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
421
422   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
423     ac_save_LIBS="$LIBS"
424     dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
425     dnl because these -l options might require -L options that are present in
426     dnl LIBS. -l options benefit only from the -L options listed before it.
427     dnl Otherwise, add it to the front of LIBS, because it may be a static
428     dnl library that depends on another static library that is present in LIBS.
429     dnl Static libraries benefit only from the static libraries listed after
430     dnl it.
431     case " $LIB[]NAME" in
432       *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
433       *)       LIBS="$LIB[]NAME $LIBS" ;;
434     esac
435     AC_TRY_LINK([$3], [$4],
436       [ac_cv_lib[]Name=yes],
437       [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
438     LIBS="$ac_save_LIBS"
439   ])
440   if test "$ac_cv_lib[]Name" = yes; then
441     HAVE_LIB[]NAME=yes
442     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
443     AC_MSG_CHECKING([how to link with lib[]$1])
444     AC_MSG_RESULT([$LIB[]NAME])
445   else
446     HAVE_LIB[]NAME=no
447     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
448     dnl $INC[]NAME either.
449     CPPFLAGS="$ac_save_CPPFLAGS"
450     LIB[]NAME=
451     LTLIB[]NAME=
452     LIB[]NAME[]_PREFIX=
453   fi
454   AC_SUBST([HAVE_LIB]NAME)
455   AC_SUBST([LIB]NAME)
456   AC_SUBST([LTLIB]NAME)
457   AC_SUBST([LIB]NAME[_PREFIX])
458   popdef([NAME])
459   popdef([Name])
460 ])
461
462 dnl Determine the platform dependent parameters needed to use rpath:
463 dnl   acl_libext,
464 dnl   acl_shlibext,
465 dnl   acl_hardcode_libdir_flag_spec,
466 dnl   acl_hardcode_libdir_separator,
467 dnl   acl_hardcode_direct,
468 dnl   acl_hardcode_minus_L.
469 AC_DEFUN([AC_LIB_RPATH],
470 [
471   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
472   m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
473   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
474   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
475   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
476   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
477   AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
478     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
479     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
480     . ./conftest.sh
481     rm -f ./conftest.sh
482     acl_cv_rpath=done
483   ])
484   wl="$acl_cv_wl"
485   acl_libext="$acl_cv_libext"
486   acl_shlibext="$acl_cv_shlibext"
487   acl_libname_spec="$acl_cv_libname_spec"
488   acl_library_names_spec="$acl_cv_library_names_spec"
489   acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
490   acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
491   acl_hardcode_direct="$acl_cv_hardcode_direct"
492   acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
493   dnl Determine whether the user wants rpath handling at all.
494   AC_ARG_ENABLE([rpath],
495     [  --disable-rpath         do not hardcode runtime library paths],
496     :, enable_rpath=yes)
497 ])
498
499 dnl AC_LIB_FROMPACKAGE(name, package)
500 dnl declares that libname comes from the given package. The configure file
501 dnl will then not have a --with-libname-prefix option but a
502 dnl --with-package-prefix option. Several libraries can come from the same
503 dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
504 dnl macro call that searches for libname.
505 AC_DEFUN([AC_LIB_FROMPACKAGE],
506 [
507   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
508                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
509   define([acl_frompackage_]NAME, [$2])
510   popdef([NAME])
511   pushdef([PACK],[$2])
512   pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
513                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
514   define([acl_libsinpackage_]PACKUP,
515     m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1])
516   popdef([PACKUP])
517   popdef([PACK])
518 ])
519
520 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
521 dnl the libraries corresponding to explicit and implicit dependencies.
522 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
523 dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
524 dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
525 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
526 [
527   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
528   pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
529                                 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
530   pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
531   pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-],
532                                   [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
533   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
534   dnl Autoconf >= 2.61 supports dots in --with options.
535   pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)])
536   dnl By default, look in $includedir and $libdir.
537   use_additional=yes
538   AC_LIB_WITH_FINAL_PREFIX([
539     eval additional_includedir=\"$includedir\"
540     eval additional_libdir=\"$libdir\"
541   ])
542   AC_ARG_WITH(P_A_C_K[-prefix],
543 [[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
544   --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
545 [
546     if test "X$withval" = "Xno"; then
547       use_additional=no
548     else
549       if test "X$withval" = "X"; then
550         AC_LIB_WITH_FINAL_PREFIX([
551           eval additional_includedir=\"$includedir\"
552           eval additional_libdir=\"$libdir\"
553         ])
554       else
555         additional_includedir="$withval/include"
556         additional_libdir="$withval/$acl_libdirstem"
557         if test "$acl_libdirstem2" != "$acl_libdirstem" \
558            && ! test -d "$withval/$acl_libdirstem"; then
559           additional_libdir="$withval/$acl_libdirstem2"
560         fi
561       fi
562     fi
563 ])
564   dnl Search the library and its dependencies in $additional_libdir and
565   dnl $LDFLAGS. Using breadth-first-seach.
566   LIB[]NAME=
567   LTLIB[]NAME=
568   INC[]NAME=
569   LIB[]NAME[]_PREFIX=
570   dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
571   dnl computed. So it has to be reset here.
572   HAVE_LIB[]NAME=
573   rpathdirs=
574   ltrpathdirs=
575   names_already_handled=
576   names_next_round='$1 $2'
577   while test -n "$names_next_round"; do
578     names_this_round="$names_next_round"
579     names_next_round=
580     for name in $names_this_round; do
581       already_handled=
582       for n in $names_already_handled; do
583         if test "$n" = "$name"; then
584           already_handled=yes
585           break
586         fi
587       done
588       if test -z "$already_handled"; then
589         names_already_handled="$names_already_handled $name"
590         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
591         dnl or AC_LIB_HAVE_LINKFLAGS call.
592         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
593         eval value=\"\$HAVE_LIB$uppername\"
594         if test -n "$value"; then
595           if test "$value" = yes; then
596             eval value=\"\$LIB$uppername\"
597             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
598             eval value=\"\$LTLIB$uppername\"
599             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
600           else
601             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
602             dnl that this library doesn't exist. So just drop it.
603             :
604           fi
605         else
606           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
607           dnl and the already constructed $LIBNAME/$LTLIBNAME.
608           found_dir=
609           found_la=
610           found_so=
611           found_a=
612           eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
613           if test -n "$acl_shlibext"; then
614             shrext=".$acl_shlibext"             # typically: shrext=.so
615           else
616             shrext=
617           fi
618           if test $use_additional = yes; then
619             dir="$additional_libdir"
620             dnl The same code as in the loop below:
621             dnl First look for a shared library.
622             if test -n "$acl_shlibext"; then
623               if test -f "$dir/$libname$shrext"; then
624                 found_dir="$dir"
625                 found_so="$dir/$libname$shrext"
626               else
627                 if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
628                   ver=`(cd "$dir" && \
629                         for f in "$libname$shrext".*; do echo "$f"; done \
630                         | sed -e "s,^$libname$shrext\\\\.,," \
631                         | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
632                         | sed 1q ) 2>/dev/null`
633                   if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
634                     found_dir="$dir"
635                     found_so="$dir/$libname$shrext.$ver"
636                   fi
637                 else
638                   eval library_names=\"$acl_library_names_spec\"
639                   for f in $library_names; do
640                     if test -f "$dir/$f"; then
641                       found_dir="$dir"
642                       found_so="$dir/$f"
643                       break
644                     fi
645                   done
646                 fi
647               fi
648             fi
649             dnl Then look for a static library.
650             if test "X$found_dir" = "X"; then
651               if test -f "$dir/$libname.$acl_libext"; then
652                 found_dir="$dir"
653                 found_a="$dir/$libname.$acl_libext"
654               fi
655             fi
656             if test "X$found_dir" != "X"; then
657               if test -f "$dir/$libname.la"; then
658                 found_la="$dir/$libname.la"
659               fi
660             fi
661           fi
662           if test "X$found_dir" = "X"; then
663             for x in $LDFLAGS $LTLIB[]NAME; do
664               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
665               case "$x" in
666                 -L*)
667                   dir=`echo "X$x" | sed -e 's/^X-L//'`
668                   dnl First look for a shared library.
669                   if test -n "$acl_shlibext"; then
670                     if test -f "$dir/$libname$shrext"; then
671                       found_dir="$dir"
672                       found_so="$dir/$libname$shrext"
673                     else
674                       if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
675                         ver=`(cd "$dir" && \
676                               for f in "$libname$shrext".*; do echo "$f"; done \
677                               | sed -e "s,^$libname$shrext\\\\.,," \
678                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
679                               | sed 1q ) 2>/dev/null`
680                         if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
681                           found_dir="$dir"
682                           found_so="$dir/$libname$shrext.$ver"
683                         fi
684                       else
685                         eval library_names=\"$acl_library_names_spec\"
686                         for f in $library_names; do
687                           if test -f "$dir/$f"; then
688                             found_dir="$dir"
689                             found_so="$dir/$f"
690                             break
691                           fi
692                         done
693                       fi
694                     fi
695                   fi
696                   dnl Then look for a static library.
697                   if test "X$found_dir" = "X"; then
698                     if test -f "$dir/$libname.$acl_libext"; then
699                       found_dir="$dir"
700                       found_a="$dir/$libname.$acl_libext"
701                     fi
702                   fi
703                   if test "X$found_dir" != "X"; then
704                     if test -f "$dir/$libname.la"; then
705                       found_la="$dir/$libname.la"
706                     fi
707                   fi
708                   ;;
709               esac
710               if test "X$found_dir" != "X"; then
711                 break
712               fi
713             done
714           fi
715           if test "X$found_dir" != "X"; then
716             dnl Found the library.
717             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
718             if test "X$found_so" != "X"; then
719               dnl Linking with a shared library. We attempt to hardcode its
720               dnl directory into the executable's runpath, unless it's the
721               dnl standard /usr/lib.
722               if test "$enable_rpath" = no \
723                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
724                  || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
725                 dnl No hardcoding is needed.
726                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
727               else
728                 dnl Use an explicit option to hardcode DIR into the resulting
729                 dnl binary.
730                 dnl Potentially add DIR to ltrpathdirs.
731                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
732                 haveit=
733                 for x in $ltrpathdirs; do
734                   if test "X$x" = "X$found_dir"; then
735                     haveit=yes
736                     break
737                   fi
738                 done
739                 if test -z "$haveit"; then
740                   ltrpathdirs="$ltrpathdirs $found_dir"
741                 fi
742                 dnl The hardcoding into $LIBNAME is system dependent.
743                 if test "$acl_hardcode_direct" = yes; then
744                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
745                   dnl resulting binary.
746                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
747                 else
748                   if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
749                     dnl Use an explicit option to hardcode DIR into the resulting
750                     dnl binary.
751                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
752                     dnl Potentially add DIR to rpathdirs.
753                     dnl The rpathdirs will be appended to $LIBNAME at the end.
754                     haveit=
755                     for x in $rpathdirs; do
756                       if test "X$x" = "X$found_dir"; then
757                         haveit=yes
758                         break
759                       fi
760                     done
761                     if test -z "$haveit"; then
762                       rpathdirs="$rpathdirs $found_dir"
763                     fi
764                   else
765                     dnl Rely on "-L$found_dir".
766                     dnl But don't add it if it's already contained in the LDFLAGS
767                     dnl or the already constructed $LIBNAME
768                     haveit=
769                     for x in $LDFLAGS $LIB[]NAME; do
770                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
771                       if test "X$x" = "X-L$found_dir"; then
772                         haveit=yes
773                         break
774                       fi
775                     done
776                     if test -z "$haveit"; then
777                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
778                     fi
779                     if test "$acl_hardcode_minus_L" != no; then
780                       dnl FIXME: Not sure whether we should use
781                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
782                       dnl here.
783                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
784                     else
785                       dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
786                       dnl here, because this doesn't fit in flags passed to the
787                       dnl compiler. So give up. No hardcoding. This affects only
788                       dnl very old systems.
789                       dnl FIXME: Not sure whether we should use
790                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
791                       dnl here.
792                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
793                     fi
794                   fi
795                 fi
796               fi
797             else
798               if test "X$found_a" != "X"; then
799                 dnl Linking with a static library.
800                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
801               else
802                 dnl We shouldn't come here, but anyway it's good to have a
803                 dnl fallback.
804                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
805               fi
806             fi
807             dnl Assume the include files are nearby.
808             additional_includedir=
809             case "$found_dir" in
810               */$acl_libdirstem | */$acl_libdirstem/)
811                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
812                 if test "$name" = '$1'; then
813                   LIB[]NAME[]_PREFIX="$basedir"
814                 fi
815                 additional_includedir="$basedir/include"
816                 ;;
817               */$acl_libdirstem2 | */$acl_libdirstem2/)
818                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
819                 if test "$name" = '$1'; then
820                   LIB[]NAME[]_PREFIX="$basedir"
821                 fi
822                 additional_includedir="$basedir/include"
823                 ;;
824             esac
825             if test "X$additional_includedir" != "X"; then
826               dnl Potentially add $additional_includedir to $INCNAME.
827               dnl But don't add it
828               dnl   1. if it's the standard /usr/include,
829               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
830               dnl   3. if it's already present in $CPPFLAGS or the already
831               dnl      constructed $INCNAME,
832               dnl   4. if it doesn't exist as a directory.
833               if test "X$additional_includedir" != "X/usr/include"; then
834                 haveit=
835                 if test "X$additional_includedir" = "X/usr/local/include"; then
836                   if test -n "$GCC"; then
837                     case $host_os in
838                       linux* | gnu* | k*bsd*-gnu) haveit=yes;;
839                     esac
840                   fi
841                 fi
842                 if test -z "$haveit"; then
843                   for x in $CPPFLAGS $INC[]NAME; do
844                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
845                     if test "X$x" = "X-I$additional_includedir"; then
846                       haveit=yes
847                       break
848                     fi
849                   done
850                   if test -z "$haveit"; then
851                     if test -d "$additional_includedir"; then
852                       dnl Really add $additional_includedir to $INCNAME.
853                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
854                     fi
855                   fi
856                 fi
857               fi
858             fi
859             dnl Look for dependencies.
860             if test -n "$found_la"; then
861               dnl Read the .la file. It defines the variables
862               dnl dlname, library_names, old_library, dependency_libs, current,
863               dnl age, revision, installed, dlopen, dlpreopen, libdir.
864               save_libdir="$libdir"
865               case "$found_la" in
866                 */* | *\\*) . "$found_la" ;;
867                 *) . "./$found_la" ;;
868               esac
869               libdir="$save_libdir"
870               dnl We use only dependency_libs.
871               for dep in $dependency_libs; do
872                 case "$dep" in
873                   -L*)
874                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
875                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
876                     dnl But don't add it
877                     dnl   1. if it's the standard /usr/lib,
878                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
879                     dnl   3. if it's already present in $LDFLAGS or the already
880                     dnl      constructed $LIBNAME,
881                     dnl   4. if it doesn't exist as a directory.
882                     if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
883                        && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
884                       haveit=
885                       if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
886                          || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
887                         if test -n "$GCC"; then
888                           case $host_os in
889                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
890                           esac
891                         fi
892                       fi
893                       if test -z "$haveit"; then
894                         haveit=
895                         for x in $LDFLAGS $LIB[]NAME; do
896                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
897                           if test "X$x" = "X-L$additional_libdir"; then
898                             haveit=yes
899                             break
900                           fi
901                         done
902                         if test -z "$haveit"; then
903                           if test -d "$additional_libdir"; then
904                             dnl Really add $additional_libdir to $LIBNAME.
905                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
906                           fi
907                         fi
908                         haveit=
909                         for x in $LDFLAGS $LTLIB[]NAME; do
910                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
911                           if test "X$x" = "X-L$additional_libdir"; then
912                             haveit=yes
913                             break
914                           fi
915                         done
916                         if test -z "$haveit"; then
917                           if test -d "$additional_libdir"; then
918                             dnl Really add $additional_libdir to $LTLIBNAME.
919                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
920                           fi
921                         fi
922                       fi
923                     fi
924                     ;;
925                   -R*)
926                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
927                     if test "$enable_rpath" != no; then
928                       dnl Potentially add DIR to rpathdirs.
929                       dnl The rpathdirs will be appended to $LIBNAME at the end.
930                       haveit=
931                       for x in $rpathdirs; do
932                         if test "X$x" = "X$dir"; then
933                           haveit=yes
934                           break
935                         fi
936                       done
937                       if test -z "$haveit"; then
938                         rpathdirs="$rpathdirs $dir"
939                       fi
940                       dnl Potentially add DIR to ltrpathdirs.
941                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
942                       haveit=
943                       for x in $ltrpathdirs; do
944                         if test "X$x" = "X$dir"; then
945                           haveit=yes
946                           break
947                         fi
948                       done
949                       if test -z "$haveit"; then
950                         ltrpathdirs="$ltrpathdirs $dir"
951                       fi
952                     fi
953                     ;;
954                   -l*)
955                     dnl Handle this in the next round.
956                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
957                     ;;
958                   *.la)
959                     dnl Handle this in the next round. Throw away the .la's
960                     dnl directory; it is already contained in a preceding -L
961                     dnl option.
962                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
963                     ;;
964                   *)
965                     dnl Most likely an immediate library name.
966                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
967                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
968                     ;;
969                 esac
970               done
971             fi
972           else
973             dnl Didn't find the library; assume it is in the system directories
974             dnl known to the linker and runtime loader. (All the system
975             dnl directories known to the linker should also be known to the
976             dnl runtime loader, otherwise the system is severely misconfigured.)
977             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
978             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
979           fi
980         fi
981       fi
982     done
983   done
984   if test "X$rpathdirs" != "X"; then
985     if test -n "$acl_hardcode_libdir_separator"; then
986       dnl Weird platform: only the last -rpath option counts, the user must
987       dnl pass all path elements in one option. We can arrange that for a
988       dnl single library, but not when more than one $LIBNAMEs are used.
989       alldirs=
990       for found_dir in $rpathdirs; do
991         alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
992       done
993       dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
994       acl_save_libdir="$libdir"
995       libdir="$alldirs"
996       eval flag=\"$acl_hardcode_libdir_flag_spec\"
997       libdir="$acl_save_libdir"
998       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
999     else
1000       dnl The -rpath options are cumulative.
1001       for found_dir in $rpathdirs; do
1002         acl_save_libdir="$libdir"
1003         libdir="$found_dir"
1004         eval flag=\"$acl_hardcode_libdir_flag_spec\"
1005         libdir="$acl_save_libdir"
1006         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
1007       done
1008     fi
1009   fi
1010   if test "X$ltrpathdirs" != "X"; then
1011     dnl When using libtool, the option that works for both libraries and
1012     dnl executables is -R. The -R options are cumulative.
1013     for found_dir in $ltrpathdirs; do
1014       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
1015     done
1016   fi
1017   popdef([P_A_C_K])
1018   popdef([PACKLIBS])
1019   popdef([PACKUP])
1020   popdef([PACK])
1021   popdef([NAME])
1022 ])
1023
1024 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
1025 dnl unless already present in VAR.
1026 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
1027 dnl contains two or three consecutive elements that belong together.
1028 AC_DEFUN([AC_LIB_APPENDTOVAR],
1029 [
1030   for element in [$2]; do
1031     haveit=
1032     for x in $[$1]; do
1033       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1034       if test "X$x" = "X$element"; then
1035         haveit=yes
1036         break
1037       fi
1038     done
1039     if test -z "$haveit"; then
1040       [$1]="${[$1]}${[$1]:+ }$element"
1041     fi
1042   done
1043 ])
1044
1045 dnl For those cases where a variable contains several -L and -l options
1046 dnl referring to unknown libraries and directories, this macro determines the
1047 dnl necessary additional linker options for the runtime path.
1048 dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
1049 dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
1050 dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
1051 dnl otherwise linking without libtool is assumed.
1052 AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
1053 [
1054   AC_REQUIRE([AC_LIB_RPATH])
1055   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1056   $1=
1057   if test "$enable_rpath" != no; then
1058     if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
1059       dnl Use an explicit option to hardcode directories into the resulting
1060       dnl binary.
1061       rpathdirs=
1062       next=
1063       for opt in $2; do
1064         if test -n "$next"; then
1065           dir="$next"
1066           dnl No need to hardcode the standard /usr/lib.
1067           if test "X$dir" != "X/usr/$acl_libdirstem" \
1068              && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1069             rpathdirs="$rpathdirs $dir"
1070           fi
1071           next=
1072         else
1073           case $opt in
1074             -L) next=yes ;;
1075             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
1076                  dnl No need to hardcode the standard /usr/lib.
1077                  if test "X$dir" != "X/usr/$acl_libdirstem" \
1078                     && test "X$dir" != "X/usr/$acl_libdirstem2"; then
1079                    rpathdirs="$rpathdirs $dir"
1080                  fi
1081                  next= ;;
1082             *) next= ;;
1083           esac
1084         fi
1085       done
1086       if test "X$rpathdirs" != "X"; then
1087         if test -n ""$3""; then
1088           dnl libtool is used for linking. Use -R options.
1089           for dir in $rpathdirs; do
1090             $1="${$1}${$1:+ }-R$dir"
1091           done
1092         else
1093           dnl The linker is used for linking directly.
1094           if test -n "$acl_hardcode_libdir_separator"; then
1095             dnl Weird platform: only the last -rpath option counts, the user
1096             dnl must pass all path elements in one option.
1097             alldirs=
1098             for dir in $rpathdirs; do
1099               alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
1100             done
1101             acl_save_libdir="$libdir"
1102             libdir="$alldirs"
1103             eval flag=\"$acl_hardcode_libdir_flag_spec\"
1104             libdir="$acl_save_libdir"
1105             $1="$flag"
1106           else
1107             dnl The -rpath options are cumulative.
1108             for dir in $rpathdirs; do
1109               acl_save_libdir="$libdir"
1110               libdir="$dir"
1111               eval flag=\"$acl_hardcode_libdir_flag_spec\"
1112               libdir="$acl_save_libdir"
1113               $1="${$1}${$1:+ }$flag"
1114             done
1115           fi
1116         fi
1117       fi
1118     fi
1119   fi
1120   AC_SUBST([$1])
1121 ])
1122
1123 # lib-prefix.m4 serial 7 (gettext-0.18)
1124 dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc.
1125 dnl This file is free software; the Free Software Foundation
1126 dnl gives unlimited permission to copy and/or distribute it,
1127 dnl with or without modifications, as long as this notice is preserved.
1128
1129 dnl From Bruno Haible.
1130
1131 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1132 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1133 dnl require excessive bracketing.
1134 ifdef([AC_HELP_STRING],
1135 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1136 [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1137
1138 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1139 dnl to access previously installed libraries. The basic assumption is that
1140 dnl a user will want packages to use other packages he previously installed
1141 dnl with the same --prefix option.
1142 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1143 dnl libraries, but is otherwise very convenient.
1144 AC_DEFUN([AC_LIB_PREFIX],
1145 [
1146   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1147   AC_REQUIRE([AC_PROG_CC])
1148   AC_REQUIRE([AC_CANONICAL_HOST])
1149   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
1150   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1151   dnl By default, look in $includedir and $libdir.
1152   use_additional=yes
1153   AC_LIB_WITH_FINAL_PREFIX([
1154     eval additional_includedir=\"$includedir\"
1155     eval additional_libdir=\"$libdir\"
1156   ])
1157   AC_LIB_ARG_WITH([lib-prefix],
1158 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1159   --without-lib-prefix    don't search for libraries in includedir and libdir],
1160 [
1161     if test "X$withval" = "Xno"; then
1162       use_additional=no
1163     else
1164       if test "X$withval" = "X"; then
1165         AC_LIB_WITH_FINAL_PREFIX([
1166           eval additional_includedir=\"$includedir\"
1167           eval additional_libdir=\"$libdir\"
1168         ])
1169       else
1170         additional_includedir="$withval/include"
1171         additional_libdir="$withval/$acl_libdirstem"
1172       fi
1173     fi
1174 ])
1175   if test $use_additional = yes; then
1176     dnl Potentially add $additional_includedir to $CPPFLAGS.
1177     dnl But don't add it
1178     dnl   1. if it's the standard /usr/include,
1179     dnl   2. if it's already present in $CPPFLAGS,
1180     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1181     dnl   4. if it doesn't exist as a directory.
1182     if test "X$additional_includedir" != "X/usr/include"; then
1183       haveit=
1184       for x in $CPPFLAGS; do
1185         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1186         if test "X$x" = "X-I$additional_includedir"; then
1187           haveit=yes
1188           break
1189         fi
1190       done
1191       if test -z "$haveit"; then
1192         if test "X$additional_includedir" = "X/usr/local/include"; then
1193           if test -n "$GCC"; then
1194             case $host_os in
1195               linux* | gnu* | k*bsd*-gnu) haveit=yes;;
1196             esac
1197           fi
1198         fi
1199         if test -z "$haveit"; then
1200           if test -d "$additional_includedir"; then
1201             dnl Really add $additional_includedir to $CPPFLAGS.
1202             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1203           fi
1204         fi
1205       fi
1206     fi
1207     dnl Potentially add $additional_libdir to $LDFLAGS.
1208     dnl But don't add it
1209     dnl   1. if it's the standard /usr/lib,
1210     dnl   2. if it's already present in $LDFLAGS,
1211     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1212     dnl   4. if it doesn't exist as a directory.
1213     if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
1214       haveit=
1215       for x in $LDFLAGS; do
1216         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1217         if test "X$x" = "X-L$additional_libdir"; then
1218           haveit=yes
1219           break
1220         fi
1221       done
1222       if test -z "$haveit"; then
1223         if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
1224           if test -n "$GCC"; then
1225             case $host_os in
1226               linux*) haveit=yes;;
1227             esac
1228           fi
1229         fi
1230         if test -z "$haveit"; then
1231           if test -d "$additional_libdir"; then
1232             dnl Really add $additional_libdir to $LDFLAGS.
1233             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1234           fi
1235         fi
1236       fi
1237     fi
1238   fi
1239 ])
1240
1241 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1242 dnl acl_final_exec_prefix, containing the values to which $prefix and
1243 dnl $exec_prefix will expand at the end of the configure script.
1244 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1245 [
1246   dnl Unfortunately, prefix and exec_prefix get only finally determined
1247   dnl at the end of configure.
1248   if test "X$prefix" = "XNONE"; then
1249     acl_final_prefix="$ac_default_prefix"
1250   else
1251     acl_final_prefix="$prefix"
1252   fi
1253   if test "X$exec_prefix" = "XNONE"; then
1254     acl_final_exec_prefix='${prefix}'
1255   else
1256     acl_final_exec_prefix="$exec_prefix"
1257   fi
1258   acl_save_prefix="$prefix"
1259   prefix="$acl_final_prefix"
1260   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1261   prefix="$acl_save_prefix"
1262 ])
1263
1264 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1265 dnl variables prefix and exec_prefix bound to the values they will have
1266 dnl at the end of the configure script.
1267 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1268 [
1269   acl_save_prefix="$prefix"
1270   prefix="$acl_final_prefix"
1271   acl_save_exec_prefix="$exec_prefix"
1272   exec_prefix="$acl_final_exec_prefix"
1273   $1
1274   exec_prefix="$acl_save_exec_prefix"
1275   prefix="$acl_save_prefix"
1276 ])
1277
1278 dnl AC_LIB_PREPARE_MULTILIB creates
1279 dnl - a variable acl_libdirstem, containing the basename of the libdir, either
1280 dnl   "lib" or "lib64" or "lib/64",
1281 dnl - a variable acl_libdirstem2, as a secondary possible value for
1282 dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
1283 dnl   "lib/amd64".
1284 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
1285 [
1286   dnl There is no formal standard regarding lib and lib64.
1287   dnl On glibc systems, the current practice is that on a system supporting
1288   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1289   dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
1290   dnl the compiler's default mode by looking at the compiler's library search
1291   dnl path. If at least one of its elements ends in /lib64 or points to a
1292   dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
1293   dnl Otherwise we use the default, namely "lib".
1294   dnl On Solaris systems, the current practice is that on a system supporting
1295   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
1296   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
1297   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
1298   AC_REQUIRE([AC_CANONICAL_HOST])
1299   acl_libdirstem=lib
1300   acl_libdirstem2=
1301   case "$host_os" in
1302     solaris*)
1303       dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
1304       dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
1305       dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
1306       dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
1307       dnl symlink is missing, so we set acl_libdirstem2 too.
1308       AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
1309         [AC_EGREP_CPP([sixtyfour bits], [
1310 #ifdef _LP64
1311 sixtyfour bits
1312 #endif
1313            ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
1314         ])
1315       if test $gl_cv_solaris_64bit = yes; then
1316         acl_libdirstem=lib/64
1317         case "$host_cpu" in
1318           sparc*)        acl_libdirstem2=lib/sparcv9 ;;
1319           i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
1320         esac
1321       fi
1322       ;;
1323     *)
1324       searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
1325       if test -n "$searchpath"; then
1326         acl_save_IFS="${IFS=    }"; IFS=":"
1327         for searchdir in $searchpath; do
1328           if test -d "$searchdir"; then
1329             case "$searchdir" in
1330               */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
1331               */../ | */.. )
1332                 # Better ignore directories of this form. They are misleading.
1333                 ;;
1334               *) searchdir=`cd "$searchdir" && pwd`
1335                  case "$searchdir" in
1336                    */lib64 ) acl_libdirstem=lib64 ;;
1337                  esac ;;
1338             esac
1339           fi
1340         done
1341         IFS="$acl_save_IFS"
1342       fi
1343       ;;
1344   esac
1345   test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
1346 ])
1347
1348 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
1349 #
1350 # This file is free software; the Free Software Foundation
1351 # gives unlimited permission to copy and/or distribute it,
1352 # with or without modifications, as long as this notice is preserved.
1353
1354 # AM_AUTOMAKE_VERSION(VERSION)
1355 # ----------------------------
1356 # Automake X.Y traces this macro to ensure aclocal.m4 has been
1357 # generated from the m4 files accompanying Automake X.Y.
1358 # (This private macro should not be called outside this file.)
1359 AC_DEFUN([AM_AUTOMAKE_VERSION],
1360 [am__api_version='1.11'
1361 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
1362 dnl require some minimum version.  Point them to the right macro.
1363 m4_if([$1], [1.11.1], [],
1364       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
1365 ])
1366
1367 # _AM_AUTOCONF_VERSION(VERSION)
1368 # -----------------------------
1369 # aclocal traces this macro to find the Autoconf version.
1370 # This is a private macro too.  Using m4_define simplifies
1371 # the logic in aclocal, which can simply ignore this definition.
1372 m4_define([_AM_AUTOCONF_VERSION], [])
1373
1374 # AM_SET_CURRENT_AUTOMAKE_VERSION
1375 # -------------------------------
1376 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
1377 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
1378 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1379 [AM_AUTOMAKE_VERSION([1.11.1])dnl
1380 m4_ifndef([AC_AUTOCONF_VERSION],
1381   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
1382 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
1383
1384 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
1385
1386 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
1387 #
1388 # This file is free software; the Free Software Foundation
1389 # gives unlimited permission to copy and/or distribute it,
1390 # with or without modifications, as long as this notice is preserved.
1391
1392 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
1393 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
1394 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
1395 #
1396 # Of course, Automake must honor this variable whenever it calls a
1397 # tool from the auxiliary directory.  The problem is that $srcdir (and
1398 # therefore $ac_aux_dir as well) can be either absolute or relative,
1399 # depending on how configure is run.  This is pretty annoying, since
1400 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
1401 # source directory, any form will work fine, but in subdirectories a
1402 # relative path needs to be adjusted first.
1403 #
1404 # $ac_aux_dir/missing
1405 #    fails when called from a subdirectory if $ac_aux_dir is relative
1406 # $top_srcdir/$ac_aux_dir/missing
1407 #    fails if $ac_aux_dir is absolute,
1408 #    fails when called from a subdirectory in a VPATH build with
1409 #          a relative $ac_aux_dir
1410 #
1411 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
1412 # are both prefixed by $srcdir.  In an in-source build this is usually
1413 # harmless because $srcdir is `.', but things will broke when you
1414 # start a VPATH build or use an absolute $srcdir.
1415 #
1416 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
1417 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
1418 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
1419 # and then we would define $MISSING as
1420 #   MISSING="\${SHELL} $am_aux_dir/missing"
1421 # This will work as long as MISSING is not called from configure, because
1422 # unfortunately $(top_srcdir) has no meaning in configure.
1423 # However there are other variables, like CC, which are often used in
1424 # configure, and could therefore not use this "fixed" $ac_aux_dir.
1425 #
1426 # Another solution, used here, is to always expand $ac_aux_dir to an
1427 # absolute PATH.  The drawback is that using absolute paths prevent a
1428 # configured tree to be moved without reconfiguration.
1429
1430 AC_DEFUN([AM_AUX_DIR_EXPAND],
1431 [dnl Rely on autoconf to set up CDPATH properly.
1432 AC_PREREQ([2.50])dnl
1433 # expand $ac_aux_dir to an absolute path
1434 am_aux_dir=`cd $ac_aux_dir && pwd`
1435 ])
1436
1437 # AM_CONDITIONAL                                            -*- Autoconf -*-
1438
1439 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
1440 # Free Software Foundation, Inc.
1441 #
1442 # This file is free software; the Free Software Foundation
1443 # gives unlimited permission to copy and/or distribute it,
1444 # with or without modifications, as long as this notice is preserved.
1445
1446 # serial 9
1447
1448 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
1449 # -------------------------------------
1450 # Define a conditional.
1451 AC_DEFUN([AM_CONDITIONAL],
1452 [AC_PREREQ(2.52)dnl
1453  ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
1454         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
1455 AC_SUBST([$1_TRUE])dnl
1456 AC_SUBST([$1_FALSE])dnl
1457 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
1458 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
1459 m4_define([_AM_COND_VALUE_$1], [$2])dnl
1460 if $2; then
1461   $1_TRUE=
1462   $1_FALSE='#'
1463 else
1464   $1_TRUE='#'
1465   $1_FALSE=
1466 fi
1467 AC_CONFIG_COMMANDS_PRE(
1468 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
1469   AC_MSG_ERROR([[conditional "$1" was never defined.
1470 Usually this means the macro was only invoked conditionally.]])
1471 fi])])
1472
1473 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
1474 # Free Software Foundation, Inc.
1475 #
1476 # This file is free software; the Free Software Foundation
1477 # gives unlimited permission to copy and/or distribute it,
1478 # with or without modifications, as long as this notice is preserved.
1479
1480 # serial 10
1481
1482 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
1483 # written in clear, in which case automake, when reading aclocal.m4,
1484 # will think it sees a *use*, and therefore will trigger all it's
1485 # C support machinery.  Also note that it means that autoscan, seeing
1486 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
1487
1488
1489 # _AM_DEPENDENCIES(NAME)
1490 # ----------------------
1491 # See how the compiler implements dependency checking.
1492 # NAME is "CC", "CXX", "GCJ", or "OBJC".
1493 # We try a few techniques and use that to set a single cache variable.
1494 #
1495 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
1496 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
1497 # dependency, and given that the user is not expected to run this macro,
1498 # just rely on AC_PROG_CC.
1499 AC_DEFUN([_AM_DEPENDENCIES],
1500 [AC_REQUIRE([AM_SET_DEPDIR])dnl
1501 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
1502 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
1503 AC_REQUIRE([AM_DEP_TRACK])dnl
1504
1505 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
1506        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
1507        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
1508        [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
1509        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
1510                    [depcc="$$1"   am_compiler_list=])
1511
1512 AC_CACHE_CHECK([dependency style of $depcc],
1513                [am_cv_$1_dependencies_compiler_type],
1514 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
1515   # We make a subdir and do the tests there.  Otherwise we can end up
1516   # making bogus files that we don't know about and never remove.  For
1517   # instance it was reported that on HP-UX the gcc test will end up
1518   # making a dummy file named `D' -- because `-MD' means `put the output
1519   # in D'.
1520   mkdir conftest.dir
1521   # Copy depcomp to subdir because otherwise we won't find it if we're
1522   # using a relative directory.
1523   cp "$am_depcomp" conftest.dir
1524   cd conftest.dir
1525   # We will build objects and dependencies in a subdirectory because
1526   # it helps to detect inapplicable dependency modes.  For instance
1527   # both Tru64's cc and ICC support -MD to output dependencies as a
1528   # side effect of compilation, but ICC will put the dependencies in
1529   # the current directory while Tru64 will put them in the object
1530   # directory.
1531   mkdir sub
1532
1533   am_cv_$1_dependencies_compiler_type=none
1534   if test "$am_compiler_list" = ""; then
1535      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
1536   fi
1537   am__universal=false
1538   m4_case([$1], [CC],
1539     [case " $depcc " in #(
1540      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1541      esac],
1542     [CXX],
1543     [case " $depcc " in #(
1544      *\ -arch\ *\ -arch\ *) am__universal=true ;;
1545      esac])
1546
1547   for depmode in $am_compiler_list; do
1548     # Setup a source with many dependencies, because some compilers
1549     # like to wrap large dependency lists on column 80 (with \), and
1550     # we should not choose a depcomp mode which is confused by this.
1551     #
1552     # We need to recreate these files for each test, as the compiler may
1553     # overwrite some of them when testing with obscure command lines.
1554     # This happens at least with the AIX C compiler.
1555     : > sub/conftest.c
1556     for i in 1 2 3 4 5 6; do
1557       echo '#include "conftst'$i'.h"' >> sub/conftest.c
1558       # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
1559       # Solaris 8's {/usr,}/bin/sh.
1560       touch sub/conftst$i.h
1561     done
1562     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
1563
1564     # We check with `-c' and `-o' for the sake of the "dashmstdout"
1565     # mode.  It turns out that the SunPro C++ compiler does not properly
1566     # handle `-M -o', and we need to detect this.  Also, some Intel
1567     # versions had trouble with output in subdirs
1568     am__obj=sub/conftest.${OBJEXT-o}
1569     am__minus_obj="-o $am__obj"
1570     case $depmode in
1571     gcc)
1572       # This depmode causes a compiler race in universal mode.
1573       test "$am__universal" = false || continue
1574       ;;
1575     nosideeffect)
1576       # after this tag, mechanisms are not by side-effect, so they'll
1577       # only be used when explicitly requested
1578       if test "x$enable_dependency_tracking" = xyes; then
1579         continue
1580       else
1581         break
1582       fi
1583       ;;
1584     msvisualcpp | msvcmsys)
1585       # This compiler won't grok `-c -o', but also, the minuso test has
1586       # not run yet.  These depmodes are late enough in the game, and
1587       # so weak that their functioning should not be impacted.
1588       am__obj=conftest.${OBJEXT-o}
1589       am__minus_obj=
1590       ;;
1591     none) break ;;
1592     esac
1593     if depmode=$depmode \
1594        source=sub/conftest.c object=$am__obj \
1595        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
1596        $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
1597          >/dev/null 2>conftest.err &&
1598        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
1599        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
1600        grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
1601        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
1602       # icc doesn't choke on unknown options, it will just issue warnings
1603       # or remarks (even with -Werror).  So we grep stderr for any message
1604       # that says an option was ignored or not supported.
1605       # When given -MP, icc 7.0 and 7.1 complain thusly:
1606       #   icc: Command line warning: ignoring option '-M'; no argument required
1607       # The diagnosis changed in icc 8.0:
1608       #   icc: Command line remark: option '-MP' not supported
1609       if (grep 'ignoring option' conftest.err ||
1610           grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
1611         am_cv_$1_dependencies_compiler_type=$depmode
1612         break
1613       fi
1614     fi
1615   done
1616
1617   cd ..
1618   rm -rf conftest.dir
1619 else
1620   am_cv_$1_dependencies_compiler_type=none
1621 fi
1622 ])
1623 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
1624 AM_CONDITIONAL([am__fastdep$1], [
1625   test "x$enable_dependency_tracking" != xno \
1626   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
1627 ])
1628
1629
1630 # AM_SET_DEPDIR
1631 # -------------
1632 # Choose a directory name for dependency files.
1633 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
1634 AC_DEFUN([AM_SET_DEPDIR],
1635 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1636 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
1637 ])
1638
1639
1640 # AM_DEP_TRACK
1641 # ------------
1642 AC_DEFUN([AM_DEP_TRACK],
1643 [AC_ARG_ENABLE(dependency-tracking,
1644 [  --disable-dependency-tracking  speeds up one-time build
1645   --enable-dependency-tracking   do not reject slow dependency extractors])
1646 if test "x$enable_dependency_tracking" != xno; then
1647   am_depcomp="$ac_aux_dir/depcomp"
1648   AMDEPBACKSLASH='\'
1649 fi
1650 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
1651 AC_SUBST([AMDEPBACKSLASH])dnl
1652 _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
1653 ])
1654
1655 # Generate code to set up dependency tracking.              -*- Autoconf -*-
1656
1657 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
1658 # Free Software Foundation, Inc.
1659 #
1660 # This file is free software; the Free Software Foundation
1661 # gives unlimited permission to copy and/or distribute it,
1662 # with or without modifications, as long as this notice is preserved.
1663
1664 #serial 5
1665
1666 # _AM_OUTPUT_DEPENDENCY_COMMANDS
1667 # ------------------------------
1668 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
1669 [{
1670   # Autoconf 2.62 quotes --file arguments for eval, but not when files
1671   # are listed without --file.  Let's play safe and only enable the eval
1672   # if we detect the quoting.
1673   case $CONFIG_FILES in
1674   *\'*) eval set x "$CONFIG_FILES" ;;
1675   *)   set x $CONFIG_FILES ;;
1676   esac
1677   shift
1678   for mf
1679   do
1680     # Strip MF so we end up with the name of the file.
1681     mf=`echo "$mf" | sed -e 's/:.*$//'`
1682     # Check whether this is an Automake generated Makefile or not.
1683     # We used to match only the files named `Makefile.in', but
1684     # some people rename them; so instead we look at the file content.
1685     # Grep'ing the first line is not enough: some people post-process
1686     # each Makefile.in and add a new line on top of each file to say so.
1687     # Grep'ing the whole file is not good either: AIX grep has a line
1688     # limit of 2048, but all sed's we know have understand at least 4000.
1689     if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1690       dirpart=`AS_DIRNAME("$mf")`
1691     else
1692       continue
1693     fi
1694     # Extract the definition of DEPDIR, am__include, and am__quote
1695     # from the Makefile without running `make'.
1696     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1697     test -z "$DEPDIR" && continue
1698     am__include=`sed -n 's/^am__include = //p' < "$mf"`
1699     test -z "am__include" && continue
1700     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1701     # When using ansi2knr, U may be empty or an underscore; expand it
1702     U=`sed -n 's/^U = //p' < "$mf"`
1703     # Find all dependency output files, they are included files with
1704     # $(DEPDIR) in their names.  We invoke sed twice because it is the
1705     # simplest approach to changing $(DEPDIR) to its actual value in the
1706     # expansion.
1707     for file in `sed -n "
1708       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1709          sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
1710       # Make sure the directory exists.
1711       test -f "$dirpart/$file" && continue
1712       fdir=`AS_DIRNAME(["$file"])`
1713       AS_MKDIR_P([$dirpart/$fdir])
1714       # echo "creating $dirpart/$file"
1715       echo '# dummy' > "$dirpart/$file"
1716     done
1717   done
1718 }
1719 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1720
1721
1722 # AM_OUTPUT_DEPENDENCY_COMMANDS
1723 # -----------------------------
1724 # This macro should only be invoked once -- use via AC_REQUIRE.
1725 #
1726 # This code is only required when automatic dependency tracking
1727 # is enabled.  FIXME.  This creates each `.P' file that we will
1728 # need in order to bootstrap the dependency handling code.
1729 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
1730 [AC_CONFIG_COMMANDS([depfiles],
1731      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
1732      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
1733 ])
1734
1735 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
1736 # Free Software Foundation, Inc.
1737 #
1738 # This file is free software; the Free Software Foundation
1739 # gives unlimited permission to copy and/or distribute it,
1740 # with or without modifications, as long as this notice is preserved.
1741
1742 # serial 8
1743
1744 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
1745 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
1746
1747 # Do all the work for Automake.                             -*- Autoconf -*-
1748
1749 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
1750 # 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
1751 #
1752 # This file is free software; the Free Software Foundation
1753 # gives unlimited permission to copy and/or distribute it,
1754 # with or without modifications, as long as this notice is preserved.
1755
1756 # serial 16
1757
1758 # This macro actually does too much.  Some checks are only needed if
1759 # your package does certain things.  But this isn't really a big deal.
1760
1761 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
1762 # AM_INIT_AUTOMAKE([OPTIONS])
1763 # -----------------------------------------------
1764 # The call with PACKAGE and VERSION arguments is the old style
1765 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
1766 # and VERSION should now be passed to AC_INIT and removed from
1767 # the call to AM_INIT_AUTOMAKE.
1768 # We support both call styles for the transition.  After
1769 # the next Automake release, Autoconf can make the AC_INIT
1770 # arguments mandatory, and then we can depend on a new Autoconf
1771 # release and drop the old call support.
1772 AC_DEFUN([AM_INIT_AUTOMAKE],
1773 [AC_PREREQ([2.62])dnl
1774 dnl Autoconf wants to disallow AM_ names.  We explicitly allow
1775 dnl the ones we care about.
1776 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
1777 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
1778 AC_REQUIRE([AC_PROG_INSTALL])dnl
1779 if test "`cd $srcdir && pwd`" != "`pwd`"; then
1780   # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
1781   # is not polluted with repeated "-I."
1782   AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
1783   # test to see if srcdir already configured
1784   if test -f $srcdir/config.status; then
1785     AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
1786   fi
1787 fi
1788
1789 # test whether we have cygpath
1790 if test -z "$CYGPATH_W"; then
1791   if (cygpath --version) >/dev/null 2>/dev/null; then
1792     CYGPATH_W='cygpath -w'
1793   else
1794     CYGPATH_W=echo
1795   fi
1796 fi
1797 AC_SUBST([CYGPATH_W])
1798
1799 # Define the identity of the package.
1800 dnl Distinguish between old-style and new-style calls.
1801 m4_ifval([$2],
1802 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
1803  AC_SUBST([PACKAGE], [$1])dnl
1804  AC_SUBST([VERSION], [$2])],
1805 [_AM_SET_OPTIONS([$1])dnl
1806 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
1807 m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
1808   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
1809  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
1810  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1811
1812 _AM_IF_OPTION([no-define],,
1813 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
1814  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
1815
1816 # Some tools Automake needs.
1817 AC_REQUIRE([AM_SANITY_CHECK])dnl
1818 AC_REQUIRE([AC_ARG_PROGRAM])dnl
1819 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
1820 AM_MISSING_PROG(AUTOCONF, autoconf)
1821 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
1822 AM_MISSING_PROG(AUTOHEADER, autoheader)
1823 AM_MISSING_PROG(MAKEINFO, makeinfo)
1824 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
1825 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
1826 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
1827 # We need awk for the "check" target.  The system "awk" is bad on
1828 # some platforms.
1829 AC_REQUIRE([AC_PROG_AWK])dnl
1830 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1831 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
1832 _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
1833               [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
1834                              [_AM_PROG_TAR([v7])])])
1835 _AM_IF_OPTION([no-dependencies],,
1836 [AC_PROVIDE_IFELSE([AC_PROG_CC],
1837                   [_AM_DEPENDENCIES(CC)],
1838                   [define([AC_PROG_CC],
1839                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
1840 AC_PROVIDE_IFELSE([AC_PROG_CXX],
1841                   [_AM_DEPENDENCIES(CXX)],
1842                   [define([AC_PROG_CXX],
1843                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
1844 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
1845                   [_AM_DEPENDENCIES(OBJC)],
1846                   [define([AC_PROG_OBJC],
1847                           defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
1848 ])
1849 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
1850 dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
1851 dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
1852 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
1853 AC_CONFIG_COMMANDS_PRE(dnl
1854 [m4_provide_if([_AM_COMPILER_EXEEXT],
1855   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1856 ])
1857
1858 dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
1859 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
1860 dnl mangled by Autoconf and run in a shell conditional statement.
1861 m4_define([_AC_COMPILER_EXEEXT],
1862 m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1863
1864
1865 # When config.status generates a header, we must update the stamp-h file.
1866 # This file resides in the same directory as the config header
1867 # that is generated.  The stamp files are numbered to have different names.
1868
1869 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
1870 # loop where config.status creates the headers, so we can generate
1871 # our stamp files there.
1872 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
1873 [# Compute $1's index in $config_headers.
1874 _am_arg=$1
1875 _am_stamp_count=1
1876 for _am_header in $config_headers :; do
1877   case $_am_header in
1878     $_am_arg | $_am_arg:* )
1879       break ;;
1880     * )
1881       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
1882   esac
1883 done
1884 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
1885
1886 # Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
1887 #
1888 # This file is free software; the Free Software Foundation
1889 # gives unlimited permission to copy and/or distribute it,
1890 # with or without modifications, as long as this notice is preserved.
1891
1892 # AM_PROG_INSTALL_SH
1893 # ------------------
1894 # Define $install_sh.
1895 AC_DEFUN([AM_PROG_INSTALL_SH],
1896 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1897 if test x"${install_sh}" != xset; then
1898   case $am_aux_dir in
1899   *\ * | *\     *)
1900     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
1901   *)
1902     install_sh="\${SHELL} $am_aux_dir/install-sh"
1903   esac
1904 fi
1905 AC_SUBST(install_sh)])
1906
1907 # Copyright (C) 2003, 2005  Free Software Foundation, Inc.
1908 #
1909 # This file is free software; the Free Software Foundation
1910 # gives unlimited permission to copy and/or distribute it,
1911 # with or without modifications, as long as this notice is preserved.
1912
1913 # serial 2
1914
1915 # Check whether the underlying file-system supports filenames
1916 # with a leading dot.  For instance MS-DOS doesn't.
1917 AC_DEFUN([AM_SET_LEADING_DOT],
1918 [rm -rf .tst 2>/dev/null
1919 mkdir .tst 2>/dev/null
1920 if test -d .tst; then
1921   am__leading_dot=.
1922 else
1923   am__leading_dot=_
1924 fi
1925 rmdir .tst 2>/dev/null
1926 AC_SUBST([am__leading_dot])])
1927
1928 # Check to see how 'make' treats includes.                  -*- Autoconf -*-
1929
1930 # Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
1931 #
1932 # This file is free software; the Free Software Foundation
1933 # gives unlimited permission to copy and/or distribute it,
1934 # with or without modifications, as long as this notice is preserved.
1935
1936 # serial 4
1937
1938 # AM_MAKE_INCLUDE()
1939 # -----------------
1940 # Check to see how make treats includes.
1941 AC_DEFUN([AM_MAKE_INCLUDE],
1942 [am_make=${MAKE-make}
1943 cat > confinc << 'END'
1944 am__doit:
1945         @echo this is the am__doit target
1946 .PHONY: am__doit
1947 END
1948 # If we don't find an include directive, just comment out the code.
1949 AC_MSG_CHECKING([for style of include used by $am_make])
1950 am__include="#"
1951 am__quote=
1952 _am_result=none
1953 # First try GNU make style include.
1954 echo "include confinc" > confmf
1955 # Ignore all kinds of additional output from `make'.
1956 case `$am_make -s -f confmf 2> /dev/null` in #(
1957 *the\ am__doit\ target*)
1958   am__include=include
1959   am__quote=
1960   _am_result=GNU
1961   ;;
1962 esac
1963 # Now try BSD make style include.
1964 if test "$am__include" = "#"; then
1965    echo '.include "confinc"' > confmf
1966    case `$am_make -s -f confmf 2> /dev/null` in #(
1967    *the\ am__doit\ target*)
1968      am__include=.include
1969      am__quote="\""
1970      _am_result=BSD
1971      ;;
1972    esac
1973 fi
1974 AC_SUBST([am__include])
1975 AC_SUBST([am__quote])
1976 AC_MSG_RESULT([$_am_result])
1977 rm -f confinc confmf
1978 ])
1979
1980 # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
1981 # Free Software Foundation, Inc.
1982 #
1983 # This file is free software; the Free Software Foundation
1984 # gives unlimited permission to copy and/or distribute it,
1985 # with or without modifications, as long as this notice is preserved.
1986
1987 # serial 6
1988
1989 # AM_PROG_CC_C_O
1990 # --------------
1991 # Like AC_PROG_CC_C_O, but changed for automake.
1992 AC_DEFUN([AM_PROG_CC_C_O],
1993 [AC_REQUIRE([AC_PROG_CC_C_O])dnl
1994 AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1995 AC_REQUIRE_AUX_FILE([compile])dnl
1996 # FIXME: we rely on the cache variable name because
1997 # there is no other way.
1998 set dummy $CC
1999 am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
2000 eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
2001 if test "$am_t" != yes; then
2002    # Losing compiler, so override with the script.
2003    # FIXME: It is wrong to rewrite CC.
2004    # But if we don't then we get into trouble of one sort or another.
2005    # A longer-term fix would be to have automake use am__CC in this case,
2006    # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2007    CC="$am_aux_dir/compile $CC"
2008 fi
2009 dnl Make sure AC_PROG_CC is never called again, or it will override our
2010 dnl setting of CC.
2011 m4_define([AC_PROG_CC],
2012           [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
2013 ])
2014
2015 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
2016
2017 # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
2018 # Free Software Foundation, Inc.
2019 #
2020 # This file is free software; the Free Software Foundation
2021 # gives unlimited permission to copy and/or distribute it,
2022 # with or without modifications, as long as this notice is preserved.
2023
2024 # serial 6
2025
2026 # AM_MISSING_PROG(NAME, PROGRAM)
2027 # ------------------------------
2028 AC_DEFUN([AM_MISSING_PROG],
2029 [AC_REQUIRE([AM_MISSING_HAS_RUN])
2030 $1=${$1-"${am_missing_run}$2"}
2031 AC_SUBST($1)])
2032
2033
2034 # AM_MISSING_HAS_RUN
2035 # ------------------
2036 # Define MISSING if not defined so far and test if it supports --run.
2037 # If it does, set am_missing_run to use it, otherwise, to nothing.
2038 AC_DEFUN([AM_MISSING_HAS_RUN],
2039 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2040 AC_REQUIRE_AUX_FILE([missing])dnl
2041 if test x"${MISSING+set}" != xset; then
2042   case $am_aux_dir in
2043   *\ * | *\     *)
2044     MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2045   *)
2046     MISSING="\${SHELL} $am_aux_dir/missing" ;;
2047   esac
2048 fi
2049 # Use eval to expand $SHELL
2050 if eval "$MISSING --run true"; then
2051   am_missing_run="$MISSING --run "
2052 else
2053   am_missing_run=
2054   AC_MSG_WARN([`missing' script is too old or missing])
2055 fi
2056 ])
2057
2058 # Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
2059 #
2060 # This file is free software; the Free Software Foundation
2061 # gives unlimited permission to copy and/or distribute it,
2062 # with or without modifications, as long as this notice is preserved.
2063
2064 # AM_PROG_MKDIR_P
2065 # ---------------
2066 # Check for `mkdir -p'.
2067 AC_DEFUN([AM_PROG_MKDIR_P],
2068 [AC_PREREQ([2.60])dnl
2069 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
2070 dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
2071 dnl while keeping a definition of mkdir_p for backward compatibility.
2072 dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
2073 dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
2074 dnl Makefile.ins that do not define MKDIR_P, so we do our own
2075 dnl adjustment using top_builddir (which is defined more often than
2076 dnl MKDIR_P).
2077 AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
2078 case $mkdir_p in
2079   [[\\/$]]* | ?:[[\\/]]*) ;;
2080   */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
2081 esac
2082 ])
2083
2084 # Helper functions for option handling.                     -*- Autoconf -*-
2085
2086 # Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
2087 #
2088 # This file is free software; the Free Software Foundation
2089 # gives unlimited permission to copy and/or distribute it,
2090 # with or without modifications, as long as this notice is preserved.
2091
2092 # serial 4
2093
2094 # _AM_MANGLE_OPTION(NAME)
2095 # -----------------------
2096 AC_DEFUN([_AM_MANGLE_OPTION],
2097 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
2098
2099 # _AM_SET_OPTION(NAME)
2100 # ------------------------------
2101 # Set option NAME.  Presently that only means defining a flag for this option.
2102 AC_DEFUN([_AM_SET_OPTION],
2103 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
2104
2105 # _AM_SET_OPTIONS(OPTIONS)
2106 # ----------------------------------
2107 # OPTIONS is a space-separated list of Automake options.
2108 AC_DEFUN([_AM_SET_OPTIONS],
2109 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
2110
2111 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
2112 # -------------------------------------------
2113 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
2114 AC_DEFUN([_AM_IF_OPTION],
2115 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2116
2117 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
2118
2119 # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
2120 # Free Software Foundation, Inc.
2121 #
2122 # This file is free software; the Free Software Foundation
2123 # gives unlimited permission to copy and/or distribute it,
2124 # with or without modifications, as long as this notice is preserved.
2125
2126 # serial 5
2127
2128 # AM_SANITY_CHECK
2129 # ---------------
2130 AC_DEFUN([AM_SANITY_CHECK],
2131 [AC_MSG_CHECKING([whether build environment is sane])
2132 # Just in case
2133 sleep 1
2134 echo timestamp > conftest.file
2135 # Reject unsafe characters in $srcdir or the absolute working directory
2136 # name.  Accept space and tab only in the latter.
2137 am_lf='
2138 '
2139 case `pwd` in
2140   *[[\\\"\#\$\&\'\`$am_lf]]*)
2141     AC_MSG_ERROR([unsafe absolute working directory name]);;
2142 esac
2143 case $srcdir in
2144   *[[\\\"\#\$\&\'\`$am_lf\ \    ]]*)
2145     AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
2146 esac
2147
2148 # Do `set' in a subshell so we don't clobber the current shell's
2149 # arguments.  Must try -L first in case configure is actually a
2150 # symlink; some systems play weird games with the mod time of symlinks
2151 # (eg FreeBSD returns the mod time of the symlink's containing
2152 # directory).
2153 if (
2154    set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2155    if test "$[*]" = "X"; then
2156       # -L didn't work.
2157       set X `ls -t "$srcdir/configure" conftest.file`
2158    fi
2159    rm -f conftest.file
2160    if test "$[*]" != "X $srcdir/configure conftest.file" \
2161       && test "$[*]" != "X conftest.file $srcdir/configure"; then
2162
2163       # If neither matched, then we have a broken ls.  This can happen
2164       # if, for instance, CONFIG_SHELL is bash and it inherits a
2165       # broken ls alias from the environment.  This has actually
2166       # happened.  Such a system could not be considered "sane".
2167       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
2168 alias in your environment])
2169    fi
2170
2171    test "$[2]" = conftest.file
2172    )
2173 then
2174    # Ok.
2175    :
2176 else
2177    AC_MSG_ERROR([newly created file is older than distributed files!
2178 Check your system clock])
2179 fi
2180 AC_MSG_RESULT(yes)])
2181
2182 # Copyright (C) 2009  Free Software Foundation, Inc.
2183 #
2184 # This file is free software; the Free Software Foundation
2185 # gives unlimited permission to copy and/or distribute it,
2186 # with or without modifications, as long as this notice is preserved.
2187
2188 # serial 1
2189
2190 # AM_SILENT_RULES([DEFAULT])
2191 # --------------------------
2192 # Enable less verbose build rules; with the default set to DEFAULT
2193 # (`yes' being less verbose, `no' or empty being verbose).
2194 AC_DEFUN([AM_SILENT_RULES],
2195 [AC_ARG_ENABLE([silent-rules],
2196 [  --enable-silent-rules          less verbose build output (undo: `make V=1')
2197   --disable-silent-rules         verbose build output (undo: `make V=0')])
2198 case $enable_silent_rules in
2199 yes) AM_DEFAULT_VERBOSITY=0;;
2200 no)  AM_DEFAULT_VERBOSITY=1;;
2201 *)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
2202 esac
2203 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
2204 AM_BACKSLASH='\'
2205 AC_SUBST([AM_BACKSLASH])dnl
2206 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
2207 ])
2208
2209 # Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
2210 #
2211 # This file is free software; the Free Software Foundation
2212 # gives unlimited permission to copy and/or distribute it,
2213 # with or without modifications, as long as this notice is preserved.
2214
2215 # AM_PROG_INSTALL_STRIP
2216 # ---------------------
2217 # One issue with vendor `install' (even GNU) is that you can't
2218 # specify the program used to strip binaries.  This is especially
2219 # annoying in cross-compiling environments, where the build's strip
2220 # is unlikely to handle the host's binaries.
2221 # Fortunately install-sh will honor a STRIPPROG variable, so we
2222 # always use install-sh in `make install-strip', and initialize
2223 # STRIPPROG with the value of the STRIP variable (set by the user).
2224 AC_DEFUN([AM_PROG_INSTALL_STRIP],
2225 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
2226 # Installed binaries are usually stripped using `strip' when the user
2227 # run `make install-strip'.  However `strip' might not be the right
2228 # tool to use in cross-compilation environments, therefore Automake
2229 # will honor the `STRIP' environment variable to overrule this program.
2230 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
2231 if test "$cross_compiling" != no; then
2232   AC_CHECK_TOOL([STRIP], [strip], :)
2233 fi
2234 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
2235 AC_SUBST([INSTALL_STRIP_PROGRAM])])
2236
2237 # Copyright (C) 2006, 2008  Free Software Foundation, Inc.
2238 #
2239 # This file is free software; the Free Software Foundation
2240 # gives unlimited permission to copy and/or distribute it,
2241 # with or without modifications, as long as this notice is preserved.
2242
2243 # serial 2
2244
2245 # _AM_SUBST_NOTMAKE(VARIABLE)
2246 # ---------------------------
2247 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
2248 # This macro is traced by Automake.
2249 AC_DEFUN([_AM_SUBST_NOTMAKE])
2250
2251 # AM_SUBST_NOTMAKE(VARIABLE)
2252 # ---------------------------
2253 # Public sister of _AM_SUBST_NOTMAKE.
2254 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
2255
2256 # Check how to create a tarball.                            -*- Autoconf -*-
2257
2258 # Copyright (C) 2004, 2005  Free Software Foundation, Inc.
2259 #
2260 # This file is free software; the Free Software Foundation
2261 # gives unlimited permission to copy and/or distribute it,
2262 # with or without modifications, as long as this notice is preserved.
2263
2264 # serial 2
2265
2266 # _AM_PROG_TAR(FORMAT)
2267 # --------------------
2268 # Check how to create a tarball in format FORMAT.
2269 # FORMAT should be one of `v7', `ustar', or `pax'.
2270 #
2271 # Substitute a variable $(am__tar) that is a command
2272 # writing to stdout a FORMAT-tarball containing the directory
2273 # $tardir.
2274 #     tardir=directory && $(am__tar) > result.tar
2275 #
2276 # Substitute a variable $(am__untar) that extract such
2277 # a tarball read from stdin.
2278 #     $(am__untar) < result.tar
2279 AC_DEFUN([_AM_PROG_TAR],
2280 [# Always define AMTAR for backward compatibility.
2281 AM_MISSING_PROG([AMTAR], [tar])
2282 m4_if([$1], [v7],
2283      [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
2284      [m4_case([$1], [ustar],, [pax],,
2285               [m4_fatal([Unknown tar format])])
2286 AC_MSG_CHECKING([how to create a $1 tar archive])
2287 # Loop over all known methods to create a tar archive until one works.
2288 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
2289 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
2290 # Do not fold the above two line into one, because Tru64 sh and
2291 # Solaris sh will not grok spaces in the rhs of `-'.
2292 for _am_tool in $_am_tools
2293 do
2294   case $_am_tool in
2295   gnutar)
2296     for _am_tar in tar gnutar gtar;
2297     do
2298       AM_RUN_LOG([$_am_tar --version]) && break
2299     done
2300     am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
2301     am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
2302     am__untar="$_am_tar -xf -"
2303     ;;
2304   plaintar)
2305     # Must skip GNU tar: if it does not support --format= it doesn't create
2306     # ustar tarball either.
2307     (tar --version) >/dev/null 2>&1 && continue
2308     am__tar='tar chf - "$$tardir"'
2309     am__tar_='tar chf - "$tardir"'
2310     am__untar='tar xf -'
2311     ;;
2312   pax)
2313     am__tar='pax -L -x $1 -w "$$tardir"'
2314     am__tar_='pax -L -x $1 -w "$tardir"'
2315     am__untar='pax -r'
2316     ;;
2317   cpio)
2318     am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
2319     am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
2320     am__untar='cpio -i -H $1 -d'
2321     ;;
2322   none)
2323     am__tar=false
2324     am__tar_=false
2325     am__untar=false
2326     ;;
2327   esac
2328
2329   # If the value was cached, stop now.  We just wanted to have am__tar
2330   # and am__untar set.
2331   test -n "${am_cv_prog_tar_$1}" && break
2332
2333   # tar/untar a dummy directory, and stop if the command works
2334   rm -rf conftest.dir
2335   mkdir conftest.dir
2336   echo GrepMe > conftest.dir/file
2337   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
2338   rm -rf conftest.dir
2339   if test -s conftest.tar; then
2340     AM_RUN_LOG([$am__untar <conftest.tar])
2341     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
2342   fi
2343 done
2344 rm -rf conftest.dir
2345
2346 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
2347 AC_MSG_RESULT([$am_cv_prog_tar_$1])])
2348 AC_SUBST([am__tar])
2349 AC_SUBST([am__untar])
2350 ]) # _AM_PROG_TAR
2351
2352 m4_include([m4/libtool.m4])
2353 m4_include([m4/ltoptions.m4])
2354 m4_include([m4/ltsugar.m4])
2355 m4_include([m4/ltversion.m4])
2356 m4_include([m4/lt~obsolete.m4])