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