aclocal.m4 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047
  1. # generated automatically by aclocal 1.10.2 -*- Autoconf -*-
  2. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  3. # 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
  4. # This file is free software; the Free Software Foundation
  5. # gives unlimited permission to copy and/or distribute it,
  6. # with or without modifications, as long as this notice is preserved.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  9. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  10. # PARTICULAR PURPOSE.
  11. m4_ifndef([AC_AUTOCONF_VERSION],
  12. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  13. m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
  14. [m4_warning([this file was generated for autoconf 2.64.
  15. You have another version of autoconf. It may work, but is not guaranteed to.
  16. If you have problems, you may need to regenerate the build system entirely.
  17. To do so, use the procedure documented by the package, typically `autoreconf'.])])
  18. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  19. #
  20. # Copyright © 2004 Scott James Remnant <[email protected]>.
  21. #
  22. # This program is free software; you can redistribute it and/or modify
  23. # it under the terms of the GNU General Public License as published by
  24. # the Free Software Foundation; either version 2 of the License, or
  25. # (at your option) any later version.
  26. #
  27. # This program is distributed in the hope that it will be useful, but
  28. # WITHOUT ANY WARRANTY; without even the implied warranty of
  29. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  30. # General Public License for more details.
  31. #
  32. # You should have received a copy of the GNU General Public License
  33. # along with this program; if not, write to the Free Software
  34. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  35. #
  36. # As a special exception to the GNU General Public License, if you
  37. # distribute this file as part of a program that contains a
  38. # configuration script generated by Autoconf, you may include it under
  39. # the same distribution terms that you use for the rest of that program.
  40. # PKG_PROG_PKG_CONFIG([MIN-VERSION])
  41. # ----------------------------------
  42. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  43. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  44. m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
  45. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
  46. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  47. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  48. fi
  49. if test -n "$PKG_CONFIG"; then
  50. _pkg_min_version=m4_default([$1], [0.9.0])
  51. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  52. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  53. AC_MSG_RESULT([yes])
  54. else
  55. AC_MSG_RESULT([no])
  56. PKG_CONFIG=""
  57. fi
  58. fi[]dnl
  59. ])# PKG_PROG_PKG_CONFIG
  60. # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  61. #
  62. # Check to see whether a particular set of modules exists. Similar
  63. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
  64. #
  65. #
  66. # Similar to PKG_CHECK_MODULES, make sure that the first instance of
  67. # this or PKG_CHECK_MODULES is called, or make sure to call
  68. # PKG_CHECK_EXISTS manually
  69. # --------------------------------------------------------------
  70. AC_DEFUN([PKG_CHECK_EXISTS],
  71. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  72. if test -n "$PKG_CONFIG" && \
  73. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  74. m4_ifval([$2], [$2], [:])
  75. m4_ifvaln([$3], [else
  76. $3])dnl
  77. fi])
  78. # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  79. # ---------------------------------------------
  80. m4_define([_PKG_CONFIG],
  81. [if test -n "$PKG_CONFIG"; then
  82. if test -n "$$1"; then
  83. pkg_cv_[]$1="$$1"
  84. else
  85. PKG_CHECK_EXISTS([$3],
  86. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
  87. [pkg_failed=yes])
  88. fi
  89. else
  90. pkg_failed=untried
  91. fi[]dnl
  92. ])# _PKG_CONFIG
  93. # _PKG_SHORT_ERRORS_SUPPORTED
  94. # -----------------------------
  95. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  96. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  97. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  98. _pkg_short_errors_supported=yes
  99. else
  100. _pkg_short_errors_supported=no
  101. fi[]dnl
  102. ])# _PKG_SHORT_ERRORS_SUPPORTED
  103. # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  104. # [ACTION-IF-NOT-FOUND])
  105. #
  106. #
  107. # Note that if there is a possibility the first call to
  108. # PKG_CHECK_MODULES might not happen, you should be sure to include an
  109. # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  110. #
  111. #
  112. # --------------------------------------------------------------
  113. AC_DEFUN([PKG_CHECK_MODULES],
  114. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  115. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  116. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  117. pkg_failed=no
  118. AC_MSG_CHECKING([for $1])
  119. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  120. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  121. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  122. and $1[]_LIBS to avoid the need to call pkg-config.
  123. See the pkg-config man page for more details.])
  124. if test $pkg_failed = yes; then
  125. _PKG_SHORT_ERRORS_SUPPORTED
  126. if test $_pkg_short_errors_supported = yes; then
  127. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
  128. else
  129. $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
  130. fi
  131. # Put the nasty error message in config.log where it belongs
  132. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  133. ifelse([$4], , [AC_MSG_ERROR(dnl
  134. [Package requirements ($2) were not met:
  135. $$1_PKG_ERRORS
  136. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  137. installed software in a non-standard prefix.
  138. _PKG_TEXT
  139. ])],
  140. [AC_MSG_RESULT([no])
  141. $4])
  142. elif test $pkg_failed = untried; then
  143. ifelse([$4], , [AC_MSG_FAILURE(dnl
  144. [The pkg-config script could not be found or is too old. Make sure it
  145. is in your PATH or set the PKG_CONFIG environment variable to the full
  146. path to pkg-config.
  147. _PKG_TEXT
  148. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
  149. [$4])
  150. else
  151. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  152. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  153. AC_MSG_RESULT([yes])
  154. ifelse([$3], , :, [$3])
  155. fi[]dnl
  156. ])# PKG_CHECK_MODULES
  157. # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
  158. #
  159. # This file is free software; the Free Software Foundation
  160. # gives unlimited permission to copy and/or distribute it,
  161. # with or without modifications, as long as this notice is preserved.
  162. # AM_AUTOMAKE_VERSION(VERSION)
  163. # ----------------------------
  164. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  165. # generated from the m4 files accompanying Automake X.Y.
  166. # (This private macro should not be called outside this file.)
  167. AC_DEFUN([AM_AUTOMAKE_VERSION],
  168. [am__api_version='1.10'
  169. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  170. dnl require some minimum version. Point them to the right macro.
  171. m4_if([$1], [1.10.2], [],
  172. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  173. ])
  174. # _AM_AUTOCONF_VERSION(VERSION)
  175. # -----------------------------
  176. # aclocal traces this macro to find the Autoconf version.
  177. # This is a private macro too. Using m4_define simplifies
  178. # the logic in aclocal, which can simply ignore this definition.
  179. m4_define([_AM_AUTOCONF_VERSION], [])
  180. # AM_SET_CURRENT_AUTOMAKE_VERSION
  181. # -------------------------------
  182. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  183. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  184. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  185. [AM_AUTOMAKE_VERSION([1.10.2])dnl
  186. m4_ifndef([AC_AUTOCONF_VERSION],
  187. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  188. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  189. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  190. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
  191. #
  192. # This file is free software; the Free Software Foundation
  193. # gives unlimited permission to copy and/or distribute it,
  194. # with or without modifications, as long as this notice is preserved.
  195. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  196. # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
  197. # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
  198. #
  199. # Of course, Automake must honor this variable whenever it calls a
  200. # tool from the auxiliary directory. The problem is that $srcdir (and
  201. # therefore $ac_aux_dir as well) can be either absolute or relative,
  202. # depending on how configure is run. This is pretty annoying, since
  203. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  204. # source directory, any form will work fine, but in subdirectories a
  205. # relative path needs to be adjusted first.
  206. #
  207. # $ac_aux_dir/missing
  208. # fails when called from a subdirectory if $ac_aux_dir is relative
  209. # $top_srcdir/$ac_aux_dir/missing
  210. # fails if $ac_aux_dir is absolute,
  211. # fails when called from a subdirectory in a VPATH build with
  212. # a relative $ac_aux_dir
  213. #
  214. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  215. # are both prefixed by $srcdir. In an in-source build this is usually
  216. # harmless because $srcdir is `.', but things will broke when you
  217. # start a VPATH build or use an absolute $srcdir.
  218. #
  219. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  220. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  221. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  222. # and then we would define $MISSING as
  223. # MISSING="\${SHELL} $am_aux_dir/missing"
  224. # This will work as long as MISSING is not called from configure, because
  225. # unfortunately $(top_srcdir) has no meaning in configure.
  226. # However there are other variables, like CC, which are often used in
  227. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  228. #
  229. # Another solution, used here, is to always expand $ac_aux_dir to an
  230. # absolute PATH. The drawback is that using absolute paths prevent a
  231. # configured tree to be moved without reconfiguration.
  232. AC_DEFUN([AM_AUX_DIR_EXPAND],
  233. [dnl Rely on autoconf to set up CDPATH properly.
  234. AC_PREREQ([2.50])dnl
  235. # expand $ac_aux_dir to an absolute path
  236. am_aux_dir=`cd $ac_aux_dir && pwd`
  237. ])
  238. # AM_CONDITIONAL -*- Autoconf -*-
  239. # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
  240. # Free Software Foundation, Inc.
  241. #
  242. # This file is free software; the Free Software Foundation
  243. # gives unlimited permission to copy and/or distribute it,
  244. # with or without modifications, as long as this notice is preserved.
  245. # serial 8
  246. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  247. # -------------------------------------
  248. # Define a conditional.
  249. AC_DEFUN([AM_CONDITIONAL],
  250. [AC_PREREQ(2.52)dnl
  251. ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  252. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  253. AC_SUBST([$1_TRUE])dnl
  254. AC_SUBST([$1_FALSE])dnl
  255. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  256. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  257. if $2; then
  258. $1_TRUE=
  259. $1_FALSE='#'
  260. else
  261. $1_TRUE='#'
  262. $1_FALSE=
  263. fi
  264. AC_CONFIG_COMMANDS_PRE(
  265. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  266. AC_MSG_ERROR([[conditional "$1" was never defined.
  267. Usually this means the macro was only invoked conditionally.]])
  268. fi])])
  269. # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  270. # Free Software Foundation, Inc.
  271. #
  272. # This file is free software; the Free Software Foundation
  273. # gives unlimited permission to copy and/or distribute it,
  274. # with or without modifications, as long as this notice is preserved.
  275. # serial 9
  276. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
  277. # written in clear, in which case automake, when reading aclocal.m4,
  278. # will think it sees a *use*, and therefore will trigger all it's
  279. # C support machinery. Also note that it means that autoscan, seeing
  280. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  281. # _AM_DEPENDENCIES(NAME)
  282. # ----------------------
  283. # See how the compiler implements dependency checking.
  284. # NAME is "CC", "CXX", "GCJ", or "OBJC".
  285. # We try a few techniques and use that to set a single cache variable.
  286. #
  287. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  288. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  289. # dependency, and given that the user is not expected to run this macro,
  290. # just rely on AC_PROG_CC.
  291. AC_DEFUN([_AM_DEPENDENCIES],
  292. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  293. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  294. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  295. AC_REQUIRE([AM_DEP_TRACK])dnl
  296. ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
  297. [$1], CXX, [depcc="$CXX" am_compiler_list=],
  298. [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  299. [$1], UPC, [depcc="$UPC" am_compiler_list=],
  300. [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  301. [depcc="$$1" am_compiler_list=])
  302. AC_CACHE_CHECK([dependency style of $depcc],
  303. [am_cv_$1_dependencies_compiler_type],
  304. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  305. # We make a subdir and do the tests there. Otherwise we can end up
  306. # making bogus files that we don't know about and never remove. For
  307. # instance it was reported that on HP-UX the gcc test will end up
  308. # making a dummy file named `D' -- because `-MD' means `put the output
  309. # in D'.
  310. mkdir conftest.dir
  311. # Copy depcomp to subdir because otherwise we won't find it if we're
  312. # using a relative directory.
  313. cp "$am_depcomp" conftest.dir
  314. cd conftest.dir
  315. # We will build objects and dependencies in a subdirectory because
  316. # it helps to detect inapplicable dependency modes. For instance
  317. # both Tru64's cc and ICC support -MD to output dependencies as a
  318. # side effect of compilation, but ICC will put the dependencies in
  319. # the current directory while Tru64 will put them in the object
  320. # directory.
  321. mkdir sub
  322. am_cv_$1_dependencies_compiler_type=none
  323. if test "$am_compiler_list" = ""; then
  324. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  325. fi
  326. for depmode in $am_compiler_list; do
  327. # Setup a source with many dependencies, because some compilers
  328. # like to wrap large dependency lists on column 80 (with \), and
  329. # we should not choose a depcomp mode which is confused by this.
  330. #
  331. # We need to recreate these files for each test, as the compiler may
  332. # overwrite some of them when testing with obscure command lines.
  333. # This happens at least with the AIX C compiler.
  334. : > sub/conftest.c
  335. for i in 1 2 3 4 5 6; do
  336. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  337. # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
  338. # Solaris 8's {/usr,}/bin/sh.
  339. touch sub/conftst$i.h
  340. done
  341. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  342. case $depmode in
  343. nosideeffect)
  344. # after this tag, mechanisms are not by side-effect, so they'll
  345. # only be used when explicitly requested
  346. if test "x$enable_dependency_tracking" = xyes; then
  347. continue
  348. else
  349. break
  350. fi
  351. ;;
  352. none) break ;;
  353. esac
  354. # We check with `-c' and `-o' for the sake of the "dashmstdout"
  355. # mode. It turns out that the SunPro C++ compiler does not properly
  356. # handle `-M -o', and we need to detect this.
  357. if depmode=$depmode \
  358. source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
  359. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  360. $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
  361. >/dev/null 2>conftest.err &&
  362. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  363. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  364. grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
  365. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  366. # icc doesn't choke on unknown options, it will just issue warnings
  367. # or remarks (even with -Werror). So we grep stderr for any message
  368. # that says an option was ignored or not supported.
  369. # When given -MP, icc 7.0 and 7.1 complain thusly:
  370. # icc: Command line warning: ignoring option '-M'; no argument required
  371. # The diagnosis changed in icc 8.0:
  372. # icc: Command line remark: option '-MP' not supported
  373. if (grep 'ignoring option' conftest.err ||
  374. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  375. am_cv_$1_dependencies_compiler_type=$depmode
  376. break
  377. fi
  378. fi
  379. done
  380. cd ..
  381. rm -rf conftest.dir
  382. else
  383. am_cv_$1_dependencies_compiler_type=none
  384. fi
  385. ])
  386. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  387. AM_CONDITIONAL([am__fastdep$1], [
  388. test "x$enable_dependency_tracking" != xno \
  389. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  390. ])
  391. # AM_SET_DEPDIR
  392. # -------------
  393. # Choose a directory name for dependency files.
  394. # This macro is AC_REQUIREd in _AM_DEPENDENCIES
  395. AC_DEFUN([AM_SET_DEPDIR],
  396. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  397. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  398. ])
  399. # AM_DEP_TRACK
  400. # ------------
  401. AC_DEFUN([AM_DEP_TRACK],
  402. [AC_ARG_ENABLE(dependency-tracking,
  403. [ --disable-dependency-tracking speeds up one-time build
  404. --enable-dependency-tracking do not reject slow dependency extractors])
  405. if test "x$enable_dependency_tracking" != xno; then
  406. am_depcomp="$ac_aux_dir/depcomp"
  407. AMDEPBACKSLASH='\'
  408. fi
  409. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  410. AC_SUBST([AMDEPBACKSLASH])dnl
  411. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  412. ])
  413. # Generate code to set up dependency tracking. -*- Autoconf -*-
  414. # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
  415. # Free Software Foundation, Inc.
  416. #
  417. # This file is free software; the Free Software Foundation
  418. # gives unlimited permission to copy and/or distribute it,
  419. # with or without modifications, as long as this notice is preserved.
  420. #serial 4
  421. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  422. # ------------------------------
  423. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  424. [# Autoconf 2.62 quotes --file arguments for eval, but not when files
  425. # are listed without --file. Let's play safe and only enable the eval
  426. # if we detect the quoting.
  427. case $CONFIG_FILES in
  428. *\'*) eval set x "$CONFIG_FILES" ;;
  429. *) set x $CONFIG_FILES ;;
  430. esac
  431. shift
  432. for mf
  433. do
  434. # Strip MF so we end up with the name of the file.
  435. mf=`echo "$mf" | sed -e 's/:.*$//'`
  436. # Check whether this is an Automake generated Makefile or not.
  437. # We used to match only the files named `Makefile.in', but
  438. # some people rename them; so instead we look at the file content.
  439. # Grep'ing the first line is not enough: some people post-process
  440. # each Makefile.in and add a new line on top of each file to say so.
  441. # Grep'ing the whole file is not good either: AIX grep has a line
  442. # limit of 2048, but all sed's we know have understand at least 4000.
  443. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  444. dirpart=`AS_DIRNAME("$mf")`
  445. else
  446. continue
  447. fi
  448. # Extract the definition of DEPDIR, am__include, and am__quote
  449. # from the Makefile without running `make'.
  450. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  451. test -z "$DEPDIR" && continue
  452. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  453. test -z "am__include" && continue
  454. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  455. # When using ansi2knr, U may be empty or an underscore; expand it
  456. U=`sed -n 's/^U = //p' < "$mf"`
  457. # Find all dependency output files, they are included files with
  458. # $(DEPDIR) in their names. We invoke sed twice because it is the
  459. # simplest approach to changing $(DEPDIR) to its actual value in the
  460. # expansion.
  461. for file in `sed -n "
  462. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  463. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
  464. # Make sure the directory exists.
  465. test -f "$dirpart/$file" && continue
  466. fdir=`AS_DIRNAME(["$file"])`
  467. AS_MKDIR_P([$dirpart/$fdir])
  468. # echo "creating $dirpart/$file"
  469. echo '# dummy' > "$dirpart/$file"
  470. done
  471. done
  472. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  473. # AM_OUTPUT_DEPENDENCY_COMMANDS
  474. # -----------------------------
  475. # This macro should only be invoked once -- use via AC_REQUIRE.
  476. #
  477. # This code is only required when automatic dependency tracking
  478. # is enabled. FIXME. This creates each `.P' file that we will
  479. # need in order to bootstrap the dependency handling code.
  480. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  481. [AC_CONFIG_COMMANDS([depfiles],
  482. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  483. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  484. ])
  485. # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
  486. # Free Software Foundation, Inc.
  487. #
  488. # This file is free software; the Free Software Foundation
  489. # gives unlimited permission to copy and/or distribute it,
  490. # with or without modifications, as long as this notice is preserved.
  491. # serial 8
  492. # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
  493. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
  494. # Do all the work for Automake. -*- Autoconf -*-
  495. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  496. # 2005, 2006, 2008 Free Software Foundation, Inc.
  497. #
  498. # This file is free software; the Free Software Foundation
  499. # gives unlimited permission to copy and/or distribute it,
  500. # with or without modifications, as long as this notice is preserved.
  501. # serial 13
  502. # This macro actually does too much. Some checks are only needed if
  503. # your package does certain things. But this isn't really a big deal.
  504. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  505. # AM_INIT_AUTOMAKE([OPTIONS])
  506. # -----------------------------------------------
  507. # The call with PACKAGE and VERSION arguments is the old style
  508. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  509. # and VERSION should now be passed to AC_INIT and removed from
  510. # the call to AM_INIT_AUTOMAKE.
  511. # We support both call styles for the transition. After
  512. # the next Automake release, Autoconf can make the AC_INIT
  513. # arguments mandatory, and then we can depend on a new Autoconf
  514. # release and drop the old call support.
  515. AC_DEFUN([AM_INIT_AUTOMAKE],
  516. [AC_PREREQ([2.60])dnl
  517. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  518. dnl the ones we care about.
  519. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  520. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  521. AC_REQUIRE([AC_PROG_INSTALL])dnl
  522. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  523. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  524. # is not polluted with repeated "-I."
  525. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  526. # test to see if srcdir already configured
  527. if test -f $srcdir/config.status; then
  528. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  529. fi
  530. fi
  531. # test whether we have cygpath
  532. if test -z "$CYGPATH_W"; then
  533. if (cygpath --version) >/dev/null 2>/dev/null; then
  534. CYGPATH_W='cygpath -w'
  535. else
  536. CYGPATH_W=echo
  537. fi
  538. fi
  539. AC_SUBST([CYGPATH_W])
  540. # Define the identity of the package.
  541. dnl Distinguish between old-style and new-style calls.
  542. m4_ifval([$2],
  543. [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  544. AC_SUBST([PACKAGE], [$1])dnl
  545. AC_SUBST([VERSION], [$2])],
  546. [_AM_SET_OPTIONS([$1])dnl
  547. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  548. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
  549. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  550. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  551. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  552. _AM_IF_OPTION([no-define],,
  553. [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
  554. AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
  555. # Some tools Automake needs.
  556. AC_REQUIRE([AM_SANITY_CHECK])dnl
  557. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  558. AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
  559. AM_MISSING_PROG(AUTOCONF, autoconf)
  560. AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
  561. AM_MISSING_PROG(AUTOHEADER, autoheader)
  562. AM_MISSING_PROG(MAKEINFO, makeinfo)
  563. AM_PROG_INSTALL_SH
  564. AM_PROG_INSTALL_STRIP
  565. AC_REQUIRE([AM_PROG_MKDIR_P])dnl
  566. # We need awk for the "check" target. The system "awk" is bad on
  567. # some platforms.
  568. AC_REQUIRE([AC_PROG_AWK])dnl
  569. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  570. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  571. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  572. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  573. [_AM_PROG_TAR([v7])])])
  574. _AM_IF_OPTION([no-dependencies],,
  575. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  576. [_AM_DEPENDENCIES(CC)],
  577. [define([AC_PROG_CC],
  578. defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
  579. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  580. [_AM_DEPENDENCIES(CXX)],
  581. [define([AC_PROG_CXX],
  582. defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
  583. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  584. [_AM_DEPENDENCIES(OBJC)],
  585. [define([AC_PROG_OBJC],
  586. defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
  587. ])
  588. ])
  589. # When config.status generates a header, we must update the stamp-h file.
  590. # This file resides in the same directory as the config header
  591. # that is generated. The stamp files are numbered to have different names.
  592. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  593. # loop where config.status creates the headers, so we can generate
  594. # our stamp files there.
  595. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  596. [# Compute $1's index in $config_headers.
  597. _am_arg=$1
  598. _am_stamp_count=1
  599. for _am_header in $config_headers :; do
  600. case $_am_header in
  601. $_am_arg | $_am_arg:* )
  602. break ;;
  603. * )
  604. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  605. esac
  606. done
  607. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  608. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
  609. #
  610. # This file is free software; the Free Software Foundation
  611. # gives unlimited permission to copy and/or distribute it,
  612. # with or without modifications, as long as this notice is preserved.
  613. # AM_PROG_INSTALL_SH
  614. # ------------------
  615. # Define $install_sh.
  616. AC_DEFUN([AM_PROG_INSTALL_SH],
  617. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  618. install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
  619. AC_SUBST(install_sh)])
  620. # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
  621. #
  622. # This file is free software; the Free Software Foundation
  623. # gives unlimited permission to copy and/or distribute it,
  624. # with or without modifications, as long as this notice is preserved.
  625. # serial 2
  626. # Check whether the underlying file-system supports filenames
  627. # with a leading dot. For instance MS-DOS doesn't.
  628. AC_DEFUN([AM_SET_LEADING_DOT],
  629. [rm -rf .tst 2>/dev/null
  630. mkdir .tst 2>/dev/null
  631. if test -d .tst; then
  632. am__leading_dot=.
  633. else
  634. am__leading_dot=_
  635. fi
  636. rmdir .tst 2>/dev/null
  637. AC_SUBST([am__leading_dot])])
  638. # Check to see how 'make' treats includes. -*- Autoconf -*-
  639. # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
  640. #
  641. # This file is free software; the Free Software Foundation
  642. # gives unlimited permission to copy and/or distribute it,
  643. # with or without modifications, as long as this notice is preserved.
  644. # serial 3
  645. # AM_MAKE_INCLUDE()
  646. # -----------------
  647. # Check to see how make treats includes.
  648. AC_DEFUN([AM_MAKE_INCLUDE],
  649. [am_make=${MAKE-make}
  650. cat > confinc << 'END'
  651. am__doit:
  652. @echo done
  653. .PHONY: am__doit
  654. END
  655. # If we don't find an include directive, just comment out the code.
  656. AC_MSG_CHECKING([for style of include used by $am_make])
  657. am__include="#"
  658. am__quote=
  659. _am_result=none
  660. # First try GNU make style include.
  661. echo "include confinc" > confmf
  662. # We grep out `Entering directory' and `Leaving directory'
  663. # messages which can occur if `w' ends up in MAKEFLAGS.
  664. # In particular we don't look at `^make:' because GNU make might
  665. # be invoked under some other name (usually "gmake"), in which
  666. # case it prints its new name instead of `make'.
  667. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
  668. am__include=include
  669. am__quote=
  670. _am_result=GNU
  671. fi
  672. # Now try BSD make style include.
  673. if test "$am__include" = "#"; then
  674. echo '.include "confinc"' > confmf
  675. if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
  676. am__include=.include
  677. am__quote="\""
  678. _am_result=BSD
  679. fi
  680. fi
  681. AC_SUBST([am__include])
  682. AC_SUBST([am__quote])
  683. AC_MSG_RESULT([$_am_result])
  684. rm -f confinc confmf
  685. ])
  686. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  687. # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
  688. # Free Software Foundation, Inc.
  689. #
  690. # This file is free software; the Free Software Foundation
  691. # gives unlimited permission to copy and/or distribute it,
  692. # with or without modifications, as long as this notice is preserved.
  693. # serial 5
  694. # AM_MISSING_PROG(NAME, PROGRAM)
  695. # ------------------------------
  696. AC_DEFUN([AM_MISSING_PROG],
  697. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  698. $1=${$1-"${am_missing_run}$2"}
  699. AC_SUBST($1)])
  700. # AM_MISSING_HAS_RUN
  701. # ------------------
  702. # Define MISSING if not defined so far and test if it supports --run.
  703. # If it does, set am_missing_run to use it, otherwise, to nothing.
  704. AC_DEFUN([AM_MISSING_HAS_RUN],
  705. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  706. AC_REQUIRE_AUX_FILE([missing])dnl
  707. test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
  708. # Use eval to expand $SHELL
  709. if eval "$MISSING --run true"; then
  710. am_missing_run="$MISSING --run "
  711. else
  712. am_missing_run=
  713. AC_MSG_WARN([`missing' script is too old or missing])
  714. fi
  715. ])
  716. # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
  717. #
  718. # This file is free software; the Free Software Foundation
  719. # gives unlimited permission to copy and/or distribute it,
  720. # with or without modifications, as long as this notice is preserved.
  721. # AM_PROG_MKDIR_P
  722. # ---------------
  723. # Check for `mkdir -p'.
  724. AC_DEFUN([AM_PROG_MKDIR_P],
  725. [AC_PREREQ([2.60])dnl
  726. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  727. dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
  728. dnl while keeping a definition of mkdir_p for backward compatibility.
  729. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
  730. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
  731. dnl Makefile.ins that do not define MKDIR_P, so we do our own
  732. dnl adjustment using top_builddir (which is defined more often than
  733. dnl MKDIR_P).
  734. AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
  735. case $mkdir_p in
  736. [[\\/$]]* | ?:[[\\/]]*) ;;
  737. */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
  738. esac
  739. ])
  740. # Helper functions for option handling. -*- Autoconf -*-
  741. # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
  742. #
  743. # This file is free software; the Free Software Foundation
  744. # gives unlimited permission to copy and/or distribute it,
  745. # with or without modifications, as long as this notice is preserved.
  746. # serial 4
  747. # _AM_MANGLE_OPTION(NAME)
  748. # -----------------------
  749. AC_DEFUN([_AM_MANGLE_OPTION],
  750. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  751. # _AM_SET_OPTION(NAME)
  752. # ------------------------------
  753. # Set option NAME. Presently that only means defining a flag for this option.
  754. AC_DEFUN([_AM_SET_OPTION],
  755. [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
  756. # _AM_SET_OPTIONS(OPTIONS)
  757. # ----------------------------------
  758. # OPTIONS is a space-separated list of Automake options.
  759. AC_DEFUN([_AM_SET_OPTIONS],
  760. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  761. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  762. # -------------------------------------------
  763. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  764. AC_DEFUN([_AM_IF_OPTION],
  765. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  766. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  767. # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
  768. # Free Software Foundation, Inc.
  769. #
  770. # This file is free software; the Free Software Foundation
  771. # gives unlimited permission to copy and/or distribute it,
  772. # with or without modifications, as long as this notice is preserved.
  773. # serial 4
  774. # AM_SANITY_CHECK
  775. # ---------------
  776. AC_DEFUN([AM_SANITY_CHECK],
  777. [AC_MSG_CHECKING([whether build environment is sane])
  778. # Just in case
  779. sleep 1
  780. echo timestamp > conftest.file
  781. # Do `set' in a subshell so we don't clobber the current shell's
  782. # arguments. Must try -L first in case configure is actually a
  783. # symlink; some systems play weird games with the mod time of symlinks
  784. # (eg FreeBSD returns the mod time of the symlink's containing
  785. # directory).
  786. if (
  787. set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
  788. if test "$[*]" = "X"; then
  789. # -L didn't work.
  790. set X `ls -t $srcdir/configure conftest.file`
  791. fi
  792. rm -f conftest.file
  793. if test "$[*]" != "X $srcdir/configure conftest.file" \
  794. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  795. # If neither matched, then we have a broken ls. This can happen
  796. # if, for instance, CONFIG_SHELL is bash and it inherits a
  797. # broken ls alias from the environment. This has actually
  798. # happened. Such a system could not be considered "sane".
  799. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  800. alias in your environment])
  801. fi
  802. test "$[2]" = conftest.file
  803. )
  804. then
  805. # Ok.
  806. :
  807. else
  808. AC_MSG_ERROR([newly created file is older than distributed files!
  809. Check your system clock])
  810. fi
  811. AC_MSG_RESULT(yes)])
  812. # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
  813. #
  814. # This file is free software; the Free Software Foundation
  815. # gives unlimited permission to copy and/or distribute it,
  816. # with or without modifications, as long as this notice is preserved.
  817. # AM_PROG_INSTALL_STRIP
  818. # ---------------------
  819. # One issue with vendor `install' (even GNU) is that you can't
  820. # specify the program used to strip binaries. This is especially
  821. # annoying in cross-compiling environments, where the build's strip
  822. # is unlikely to handle the host's binaries.
  823. # Fortunately install-sh will honor a STRIPPROG variable, so we
  824. # always use install-sh in `make install-strip', and initialize
  825. # STRIPPROG with the value of the STRIP variable (set by the user).
  826. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  827. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  828. # Installed binaries are usually stripped using `strip' when the user
  829. # run `make install-strip'. However `strip' might not be the right
  830. # tool to use in cross-compilation environments, therefore Automake
  831. # will honor the `STRIP' environment variable to overrule this program.
  832. dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
  833. if test "$cross_compiling" != no; then
  834. AC_CHECK_TOOL([STRIP], [strip], :)
  835. fi
  836. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  837. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  838. # Copyright (C) 2006 Free Software Foundation, Inc.
  839. #
  840. # This file is free software; the Free Software Foundation
  841. # gives unlimited permission to copy and/or distribute it,
  842. # with or without modifications, as long as this notice is preserved.
  843. # _AM_SUBST_NOTMAKE(VARIABLE)
  844. # ---------------------------
  845. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  846. # This macro is traced by Automake.
  847. AC_DEFUN([_AM_SUBST_NOTMAKE])
  848. # Check how to create a tarball. -*- Autoconf -*-
  849. # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
  850. #
  851. # This file is free software; the Free Software Foundation
  852. # gives unlimited permission to copy and/or distribute it,
  853. # with or without modifications, as long as this notice is preserved.
  854. # serial 2
  855. # _AM_PROG_TAR(FORMAT)
  856. # --------------------
  857. # Check how to create a tarball in format FORMAT.
  858. # FORMAT should be one of `v7', `ustar', or `pax'.
  859. #
  860. # Substitute a variable $(am__tar) that is a command
  861. # writing to stdout a FORMAT-tarball containing the directory
  862. # $tardir.
  863. # tardir=directory && $(am__tar) > result.tar
  864. #
  865. # Substitute a variable $(am__untar) that extract such
  866. # a tarball read from stdin.
  867. # $(am__untar) < result.tar
  868. AC_DEFUN([_AM_PROG_TAR],
  869. [# Always define AMTAR for backward compatibility.
  870. AM_MISSING_PROG([AMTAR], [tar])
  871. m4_if([$1], [v7],
  872. [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
  873. [m4_case([$1], [ustar],, [pax],,
  874. [m4_fatal([Unknown tar format])])
  875. AC_MSG_CHECKING([how to create a $1 tar archive])
  876. # Loop over all known methods to create a tar archive until one works.
  877. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  878. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  879. # Do not fold the above two line into one, because Tru64 sh and
  880. # Solaris sh will not grok spaces in the rhs of `-'.
  881. for _am_tool in $_am_tools
  882. do
  883. case $_am_tool in
  884. gnutar)
  885. for _am_tar in tar gnutar gtar;
  886. do
  887. AM_RUN_LOG([$_am_tar --version]) && break
  888. done
  889. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  890. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  891. am__untar="$_am_tar -xf -"
  892. ;;
  893. plaintar)
  894. # Must skip GNU tar: if it does not support --format= it doesn't create
  895. # ustar tarball either.
  896. (tar --version) >/dev/null 2>&1 && continue
  897. am__tar='tar chf - "$$tardir"'
  898. am__tar_='tar chf - "$tardir"'
  899. am__untar='tar xf -'
  900. ;;
  901. pax)
  902. am__tar='pax -L -x $1 -w "$$tardir"'
  903. am__tar_='pax -L -x $1 -w "$tardir"'
  904. am__untar='pax -r'
  905. ;;
  906. cpio)
  907. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  908. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  909. am__untar='cpio -i -H $1 -d'
  910. ;;
  911. none)
  912. am__tar=false
  913. am__tar_=false
  914. am__untar=false
  915. ;;
  916. esac
  917. # If the value was cached, stop now. We just wanted to have am__tar
  918. # and am__untar set.
  919. test -n "${am_cv_prog_tar_$1}" && break
  920. # tar/untar a dummy directory, and stop if the command works
  921. rm -rf conftest.dir
  922. mkdir conftest.dir
  923. echo GrepMe > conftest.dir/file
  924. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  925. rm -rf conftest.dir
  926. if test -s conftest.tar; then
  927. AM_RUN_LOG([$am__untar <conftest.tar])
  928. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  929. fi
  930. done
  931. rm -rf conftest.dir
  932. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  933. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  934. AC_SUBST([am__tar])
  935. AC_SUBST([am__untar])
  936. ]) # _AM_PROG_TAR