aclocal.m4 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496
  1. # generated automatically by aclocal 1.15.1 -*- Autoconf -*-
  2. # Copyright (C) 1996-2017 Free Software Foundation, Inc.
  3. # This file is free software; the Free Software Foundation
  4. # gives unlimited permission to copy and/or distribute it,
  5. # with or without modifications, as long as this notice is preserved.
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. # PARTICULAR PURPOSE.
  10. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
  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.69],,
  14. [m4_warning([this file was generated for autoconf 2.69.
  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. # serial 11 (pkg-config-0.29.1)
  20. dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  21. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
  22. dnl
  23. dnl This program is free software; you can redistribute it and/or modify
  24. dnl it under the terms of the GNU General Public License as published by
  25. dnl the Free Software Foundation; either version 2 of the License, or
  26. dnl (at your option) any later version.
  27. dnl
  28. dnl This program is distributed in the hope that it will be useful, but
  29. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  30. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  31. dnl General Public License for more details.
  32. dnl
  33. dnl You should have received a copy of the GNU General Public License
  34. dnl along with this program; if not, write to the Free Software
  35. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  36. dnl 02111-1307, USA.
  37. dnl
  38. dnl As a special exception to the GNU General Public License, if you
  39. dnl distribute this file as part of a program that contains a
  40. dnl configuration script generated by Autoconf, you may include it under
  41. dnl the same distribution terms that you use for the rest of that
  42. dnl program.
  43. dnl PKG_PREREQ(MIN-VERSION)
  44. dnl -----------------------
  45. dnl Since: 0.29
  46. dnl
  47. dnl Verify that the version of the pkg-config macros are at least
  48. dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
  49. dnl installed version of pkg-config, this checks the developer's version
  50. dnl of pkg.m4 when generating configure.
  51. dnl
  52. dnl To ensure that this macro is defined, also add:
  53. dnl m4_ifndef([PKG_PREREQ],
  54. dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
  55. dnl
  56. dnl See the "Since" comment for each macro you use to see what version
  57. dnl of the macros you require.
  58. m4_defun([PKG_PREREQ],
  59. [m4_define([PKG_MACROS_VERSION], [0.29.1])
  60. m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
  61. [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
  62. ])dnl PKG_PREREQ
  63. dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
  64. dnl ----------------------------------
  65. dnl Since: 0.16
  66. dnl
  67. dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
  68. dnl first found in the path. Checks that the version of pkg-config found
  69. dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
  70. dnl used since that's the first version where most current features of
  71. dnl pkg-config existed.
  72. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  73. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  74. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  75. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  76. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  77. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  78. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  79. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  80. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  81. fi
  82. if test -n "$PKG_CONFIG"; then
  83. _pkg_min_version=m4_default([$1], [0.9.0])
  84. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  85. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  86. AC_MSG_RESULT([yes])
  87. else
  88. AC_MSG_RESULT([no])
  89. PKG_CONFIG=""
  90. fi
  91. fi[]dnl
  92. ])dnl PKG_PROG_PKG_CONFIG
  93. dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  94. dnl -------------------------------------------------------------------
  95. dnl Since: 0.18
  96. dnl
  97. dnl Check to see whether a particular set of modules exists. Similar to
  98. dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
  99. dnl
  100. dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  101. dnl only at the first occurence in configure.ac, so if the first place
  102. dnl it's called might be skipped (such as if it is within an "if", you
  103. dnl have to call PKG_CHECK_EXISTS manually
  104. AC_DEFUN([PKG_CHECK_EXISTS],
  105. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  106. if test -n "$PKG_CONFIG" && \
  107. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  108. m4_default([$2], [:])
  109. m4_ifvaln([$3], [else
  110. $3])dnl
  111. fi])
  112. dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  113. dnl ---------------------------------------------
  114. dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
  115. dnl pkg_failed based on the result.
  116. m4_define([_PKG_CONFIG],
  117. [if test -n "$$1"; then
  118. pkg_cv_[]$1="$$1"
  119. elif test -n "$PKG_CONFIG"; then
  120. PKG_CHECK_EXISTS([$3],
  121. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  122. test "x$?" != "x0" && pkg_failed=yes ],
  123. [pkg_failed=yes])
  124. else
  125. pkg_failed=untried
  126. fi[]dnl
  127. ])dnl _PKG_CONFIG
  128. dnl _PKG_SHORT_ERRORS_SUPPORTED
  129. dnl ---------------------------
  130. dnl Internal check to see if pkg-config supports short errors.
  131. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  132. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  133. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  134. _pkg_short_errors_supported=yes
  135. else
  136. _pkg_short_errors_supported=no
  137. fi[]dnl
  138. ])dnl _PKG_SHORT_ERRORS_SUPPORTED
  139. dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  140. dnl [ACTION-IF-NOT-FOUND])
  141. dnl --------------------------------------------------------------
  142. dnl Since: 0.4.0
  143. dnl
  144. dnl Note that if there is a possibility the first call to
  145. dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
  146. dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  147. AC_DEFUN([PKG_CHECK_MODULES],
  148. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  149. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  150. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  151. pkg_failed=no
  152. AC_MSG_CHECKING([for $1])
  153. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  154. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  155. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  156. and $1[]_LIBS to avoid the need to call pkg-config.
  157. See the pkg-config man page for more details.])
  158. if test $pkg_failed = yes; then
  159. AC_MSG_RESULT([no])
  160. _PKG_SHORT_ERRORS_SUPPORTED
  161. if test $_pkg_short_errors_supported = yes; then
  162. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  163. else
  164. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  165. fi
  166. # Put the nasty error message in config.log where it belongs
  167. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  168. m4_default([$4], [AC_MSG_ERROR(
  169. [Package requirements ($2) were not met:
  170. $$1_PKG_ERRORS
  171. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  172. installed software in a non-standard prefix.
  173. _PKG_TEXT])[]dnl
  174. ])
  175. elif test $pkg_failed = untried; then
  176. AC_MSG_RESULT([no])
  177. m4_default([$4], [AC_MSG_FAILURE(
  178. [The pkg-config script could not be found or is too old. Make sure it
  179. is in your PATH or set the PKG_CONFIG environment variable to the full
  180. path to pkg-config.
  181. _PKG_TEXT
  182. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  183. ])
  184. else
  185. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  186. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  187. AC_MSG_RESULT([yes])
  188. $3
  189. fi[]dnl
  190. ])dnl PKG_CHECK_MODULES
  191. dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  192. dnl [ACTION-IF-NOT-FOUND])
  193. dnl ---------------------------------------------------------------------
  194. dnl Since: 0.29
  195. dnl
  196. dnl Checks for existence of MODULES and gathers its build flags with
  197. dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
  198. dnl and VARIABLE-PREFIX_LIBS from --libs.
  199. dnl
  200. dnl Note that if there is a possibility the first call to
  201. dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
  202. dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
  203. dnl configure.ac.
  204. AC_DEFUN([PKG_CHECK_MODULES_STATIC],
  205. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  206. _save_PKG_CONFIG=$PKG_CONFIG
  207. PKG_CONFIG="$PKG_CONFIG --static"
  208. PKG_CHECK_MODULES($@)
  209. PKG_CONFIG=$_save_PKG_CONFIG[]dnl
  210. ])dnl PKG_CHECK_MODULES_STATIC
  211. dnl PKG_INSTALLDIR([DIRECTORY])
  212. dnl -------------------------
  213. dnl Since: 0.27
  214. dnl
  215. dnl Substitutes the variable pkgconfigdir as the location where a module
  216. dnl should install pkg-config .pc files. By default the directory is
  217. dnl $libdir/pkgconfig, but the default can be changed by passing
  218. dnl DIRECTORY. The user can override through the --with-pkgconfigdir
  219. dnl parameter.
  220. AC_DEFUN([PKG_INSTALLDIR],
  221. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  222. m4_pushdef([pkg_description],
  223. [pkg-config installation directory @<:@]pkg_default[@:>@])
  224. AC_ARG_WITH([pkgconfigdir],
  225. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  226. [with_pkgconfigdir=]pkg_default)
  227. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  228. m4_popdef([pkg_default])
  229. m4_popdef([pkg_description])
  230. ])dnl PKG_INSTALLDIR
  231. dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
  232. dnl --------------------------------
  233. dnl Since: 0.27
  234. dnl
  235. dnl Substitutes the variable noarch_pkgconfigdir as the location where a
  236. dnl module should install arch-independent pkg-config .pc files. By
  237. dnl default the directory is $datadir/pkgconfig, but the default can be
  238. dnl changed by passing DIRECTORY. The user can override through the
  239. dnl --with-noarch-pkgconfigdir parameter.
  240. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  241. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  242. m4_pushdef([pkg_description],
  243. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  244. AC_ARG_WITH([noarch-pkgconfigdir],
  245. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  246. [with_noarch_pkgconfigdir=]pkg_default)
  247. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  248. m4_popdef([pkg_default])
  249. m4_popdef([pkg_description])
  250. ])dnl PKG_NOARCH_INSTALLDIR
  251. dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
  252. dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  253. dnl -------------------------------------------
  254. dnl Since: 0.28
  255. dnl
  256. dnl Retrieves the value of the pkg-config variable for the given module.
  257. AC_DEFUN([PKG_CHECK_VAR],
  258. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  259. AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
  260. _PKG_CONFIG([$1], [variable="][$3]["], [$2])
  261. AS_VAR_COPY([$1], [pkg_cv_][$1])
  262. AS_VAR_IF([$1], [""], [$5], [$4])dnl
  263. ])dnl PKG_CHECK_VAR
  264. dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  265. dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
  266. dnl [DESCRIPTION], [DEFAULT])
  267. dnl ------------------------------------------
  268. dnl
  269. dnl Prepare a "--with-" configure option using the lowercase
  270. dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
  271. dnl PKG_CHECK_MODULES in a single macro.
  272. AC_DEFUN([PKG_WITH_MODULES],
  273. [
  274. m4_pushdef([with_arg], m4_tolower([$1]))
  275. m4_pushdef([description],
  276. [m4_default([$5], [build with ]with_arg[ support])])
  277. m4_pushdef([def_arg], [m4_default([$6], [auto])])
  278. m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
  279. m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
  280. m4_case(def_arg,
  281. [yes],[m4_pushdef([with_without], [--without-]with_arg)],
  282. [m4_pushdef([with_without],[--with-]with_arg)])
  283. AC_ARG_WITH(with_arg,
  284. AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
  285. [AS_TR_SH([with_]with_arg)=def_arg])
  286. AS_CASE([$AS_TR_SH([with_]with_arg)],
  287. [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
  288. [auto],[PKG_CHECK_MODULES([$1],[$2],
  289. [m4_n([def_action_if_found]) $3],
  290. [m4_n([def_action_if_not_found]) $4])])
  291. m4_popdef([with_arg])
  292. m4_popdef([description])
  293. m4_popdef([def_arg])
  294. ])dnl PKG_WITH_MODULES
  295. dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  296. dnl [DESCRIPTION], [DEFAULT])
  297. dnl -----------------------------------------------
  298. dnl
  299. dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
  300. dnl check._[VARIABLE-PREFIX] is exported as make variable.
  301. AC_DEFUN([PKG_HAVE_WITH_MODULES],
  302. [
  303. PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
  304. AM_CONDITIONAL([HAVE_][$1],
  305. [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
  306. ])dnl PKG_HAVE_WITH_MODULES
  307. dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  308. dnl [DESCRIPTION], [DEFAULT])
  309. dnl ------------------------------------------------------
  310. dnl
  311. dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
  312. dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
  313. dnl and preprocessor variable.
  314. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
  315. [
  316. PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
  317. AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
  318. [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
  319. ])dnl PKG_HAVE_DEFINE_WITH_MODULES
  320. # Copyright (C) 2002-2017 Free Software Foundation, Inc.
  321. #
  322. # This file is free software; the Free Software Foundation
  323. # gives unlimited permission to copy and/or distribute it,
  324. # with or without modifications, as long as this notice is preserved.
  325. # AM_AUTOMAKE_VERSION(VERSION)
  326. # ----------------------------
  327. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  328. # generated from the m4 files accompanying Automake X.Y.
  329. # (This private macro should not be called outside this file.)
  330. AC_DEFUN([AM_AUTOMAKE_VERSION],
  331. [am__api_version='1.15'
  332. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  333. dnl require some minimum version. Point them to the right macro.
  334. m4_if([$1], [1.15.1], [],
  335. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  336. ])
  337. # _AM_AUTOCONF_VERSION(VERSION)
  338. # -----------------------------
  339. # aclocal traces this macro to find the Autoconf version.
  340. # This is a private macro too. Using m4_define simplifies
  341. # the logic in aclocal, which can simply ignore this definition.
  342. m4_define([_AM_AUTOCONF_VERSION], [])
  343. # AM_SET_CURRENT_AUTOMAKE_VERSION
  344. # -------------------------------
  345. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  346. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  347. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  348. [AM_AUTOMAKE_VERSION([1.15.1])dnl
  349. m4_ifndef([AC_AUTOCONF_VERSION],
  350. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  351. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  352. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  353. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  354. #
  355. # This file is free software; the Free Software Foundation
  356. # gives unlimited permission to copy and/or distribute it,
  357. # with or without modifications, as long as this notice is preserved.
  358. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  359. # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
  360. # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
  361. #
  362. # Of course, Automake must honor this variable whenever it calls a
  363. # tool from the auxiliary directory. The problem is that $srcdir (and
  364. # therefore $ac_aux_dir as well) can be either absolute or relative,
  365. # depending on how configure is run. This is pretty annoying, since
  366. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  367. # source directory, any form will work fine, but in subdirectories a
  368. # relative path needs to be adjusted first.
  369. #
  370. # $ac_aux_dir/missing
  371. # fails when called from a subdirectory if $ac_aux_dir is relative
  372. # $top_srcdir/$ac_aux_dir/missing
  373. # fails if $ac_aux_dir is absolute,
  374. # fails when called from a subdirectory in a VPATH build with
  375. # a relative $ac_aux_dir
  376. #
  377. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  378. # are both prefixed by $srcdir. In an in-source build this is usually
  379. # harmless because $srcdir is '.', but things will broke when you
  380. # start a VPATH build or use an absolute $srcdir.
  381. #
  382. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  383. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  384. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  385. # and then we would define $MISSING as
  386. # MISSING="\${SHELL} $am_aux_dir/missing"
  387. # This will work as long as MISSING is not called from configure, because
  388. # unfortunately $(top_srcdir) has no meaning in configure.
  389. # However there are other variables, like CC, which are often used in
  390. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  391. #
  392. # Another solution, used here, is to always expand $ac_aux_dir to an
  393. # absolute PATH. The drawback is that using absolute paths prevent a
  394. # configured tree to be moved without reconfiguration.
  395. AC_DEFUN([AM_AUX_DIR_EXPAND],
  396. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  397. # Expand $ac_aux_dir to an absolute path.
  398. am_aux_dir=`cd "$ac_aux_dir" && pwd`
  399. ])
  400. # AM_CONDITIONAL -*- Autoconf -*-
  401. # Copyright (C) 1997-2017 Free Software Foundation, Inc.
  402. #
  403. # This file is free software; the Free Software Foundation
  404. # gives unlimited permission to copy and/or distribute it,
  405. # with or without modifications, as long as this notice is preserved.
  406. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  407. # -------------------------------------
  408. # Define a conditional.
  409. AC_DEFUN([AM_CONDITIONAL],
  410. [AC_PREREQ([2.52])dnl
  411. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  412. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  413. AC_SUBST([$1_TRUE])dnl
  414. AC_SUBST([$1_FALSE])dnl
  415. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  416. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  417. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  418. if $2; then
  419. $1_TRUE=
  420. $1_FALSE='#'
  421. else
  422. $1_TRUE='#'
  423. $1_FALSE=
  424. fi
  425. AC_CONFIG_COMMANDS_PRE(
  426. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  427. AC_MSG_ERROR([[conditional "$1" was never defined.
  428. Usually this means the macro was only invoked conditionally.]])
  429. fi])])
  430. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  431. #
  432. # This file is free software; the Free Software Foundation
  433. # gives unlimited permission to copy and/or distribute it,
  434. # with or without modifications, as long as this notice is preserved.
  435. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
  436. # written in clear, in which case automake, when reading aclocal.m4,
  437. # will think it sees a *use*, and therefore will trigger all it's
  438. # C support machinery. Also note that it means that autoscan, seeing
  439. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  440. # _AM_DEPENDENCIES(NAME)
  441. # ----------------------
  442. # See how the compiler implements dependency checking.
  443. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
  444. # We try a few techniques and use that to set a single cache variable.
  445. #
  446. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  447. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  448. # dependency, and given that the user is not expected to run this macro,
  449. # just rely on AC_PROG_CC.
  450. AC_DEFUN([_AM_DEPENDENCIES],
  451. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  452. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  453. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  454. AC_REQUIRE([AM_DEP_TRACK])dnl
  455. m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
  456. [$1], [CXX], [depcc="$CXX" am_compiler_list=],
  457. [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  458. [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
  459. [$1], [UPC], [depcc="$UPC" am_compiler_list=],
  460. [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  461. [depcc="$$1" am_compiler_list=])
  462. AC_CACHE_CHECK([dependency style of $depcc],
  463. [am_cv_$1_dependencies_compiler_type],
  464. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  465. # We make a subdir and do the tests there. Otherwise we can end up
  466. # making bogus files that we don't know about and never remove. For
  467. # instance it was reported that on HP-UX the gcc test will end up
  468. # making a dummy file named 'D' -- because '-MD' means "put the output
  469. # in D".
  470. rm -rf conftest.dir
  471. mkdir conftest.dir
  472. # Copy depcomp to subdir because otherwise we won't find it if we're
  473. # using a relative directory.
  474. cp "$am_depcomp" conftest.dir
  475. cd conftest.dir
  476. # We will build objects and dependencies in a subdirectory because
  477. # it helps to detect inapplicable dependency modes. For instance
  478. # both Tru64's cc and ICC support -MD to output dependencies as a
  479. # side effect of compilation, but ICC will put the dependencies in
  480. # the current directory while Tru64 will put them in the object
  481. # directory.
  482. mkdir sub
  483. am_cv_$1_dependencies_compiler_type=none
  484. if test "$am_compiler_list" = ""; then
  485. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  486. fi
  487. am__universal=false
  488. m4_case([$1], [CC],
  489. [case " $depcc " in #(
  490. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  491. esac],
  492. [CXX],
  493. [case " $depcc " in #(
  494. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  495. esac])
  496. for depmode in $am_compiler_list; do
  497. # Setup a source with many dependencies, because some compilers
  498. # like to wrap large dependency lists on column 80 (with \), and
  499. # we should not choose a depcomp mode which is confused by this.
  500. #
  501. # We need to recreate these files for each test, as the compiler may
  502. # overwrite some of them when testing with obscure command lines.
  503. # This happens at least with the AIX C compiler.
  504. : > sub/conftest.c
  505. for i in 1 2 3 4 5 6; do
  506. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  507. # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
  508. # Solaris 10 /bin/sh.
  509. echo '/* dummy */' > sub/conftst$i.h
  510. done
  511. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  512. # We check with '-c' and '-o' for the sake of the "dashmstdout"
  513. # mode. It turns out that the SunPro C++ compiler does not properly
  514. # handle '-M -o', and we need to detect this. Also, some Intel
  515. # versions had trouble with output in subdirs.
  516. am__obj=sub/conftest.${OBJEXT-o}
  517. am__minus_obj="-o $am__obj"
  518. case $depmode in
  519. gcc)
  520. # This depmode causes a compiler race in universal mode.
  521. test "$am__universal" = false || continue
  522. ;;
  523. nosideeffect)
  524. # After this tag, mechanisms are not by side-effect, so they'll
  525. # only be used when explicitly requested.
  526. if test "x$enable_dependency_tracking" = xyes; then
  527. continue
  528. else
  529. break
  530. fi
  531. ;;
  532. msvc7 | msvc7msys | msvisualcpp | msvcmsys)
  533. # This compiler won't grok '-c -o', but also, the minuso test has
  534. # not run yet. These depmodes are late enough in the game, and
  535. # so weak that their functioning should not be impacted.
  536. am__obj=conftest.${OBJEXT-o}
  537. am__minus_obj=
  538. ;;
  539. none) break ;;
  540. esac
  541. if depmode=$depmode \
  542. source=sub/conftest.c object=$am__obj \
  543. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  544. $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
  545. >/dev/null 2>conftest.err &&
  546. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  547. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  548. grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
  549. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  550. # icc doesn't choke on unknown options, it will just issue warnings
  551. # or remarks (even with -Werror). So we grep stderr for any message
  552. # that says an option was ignored or not supported.
  553. # When given -MP, icc 7.0 and 7.1 complain thusly:
  554. # icc: Command line warning: ignoring option '-M'; no argument required
  555. # The diagnosis changed in icc 8.0:
  556. # icc: Command line remark: option '-MP' not supported
  557. if (grep 'ignoring option' conftest.err ||
  558. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  559. am_cv_$1_dependencies_compiler_type=$depmode
  560. break
  561. fi
  562. fi
  563. done
  564. cd ..
  565. rm -rf conftest.dir
  566. else
  567. am_cv_$1_dependencies_compiler_type=none
  568. fi
  569. ])
  570. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  571. AM_CONDITIONAL([am__fastdep$1], [
  572. test "x$enable_dependency_tracking" != xno \
  573. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  574. ])
  575. # AM_SET_DEPDIR
  576. # -------------
  577. # Choose a directory name for dependency files.
  578. # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
  579. AC_DEFUN([AM_SET_DEPDIR],
  580. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  581. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  582. ])
  583. # AM_DEP_TRACK
  584. # ------------
  585. AC_DEFUN([AM_DEP_TRACK],
  586. [AC_ARG_ENABLE([dependency-tracking], [dnl
  587. AS_HELP_STRING(
  588. [--enable-dependency-tracking],
  589. [do not reject slow dependency extractors])
  590. AS_HELP_STRING(
  591. [--disable-dependency-tracking],
  592. [speeds up one-time build])])
  593. if test "x$enable_dependency_tracking" != xno; then
  594. am_depcomp="$ac_aux_dir/depcomp"
  595. AMDEPBACKSLASH='\'
  596. am__nodep='_no'
  597. fi
  598. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  599. AC_SUBST([AMDEPBACKSLASH])dnl
  600. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  601. AC_SUBST([am__nodep])dnl
  602. _AM_SUBST_NOTMAKE([am__nodep])dnl
  603. ])
  604. # Generate code to set up dependency tracking. -*- Autoconf -*-
  605. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  606. #
  607. # This file is free software; the Free Software Foundation
  608. # gives unlimited permission to copy and/or distribute it,
  609. # with or without modifications, as long as this notice is preserved.
  610. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  611. # ------------------------------
  612. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  613. [{
  614. # Older Autoconf quotes --file arguments for eval, but not when files
  615. # are listed without --file. Let's play safe and only enable the eval
  616. # if we detect the quoting.
  617. case $CONFIG_FILES in
  618. *\'*) eval set x "$CONFIG_FILES" ;;
  619. *) set x $CONFIG_FILES ;;
  620. esac
  621. shift
  622. for mf
  623. do
  624. # Strip MF so we end up with the name of the file.
  625. mf=`echo "$mf" | sed -e 's/:.*$//'`
  626. # Check whether this is an Automake generated Makefile or not.
  627. # We used to match only the files named 'Makefile.in', but
  628. # some people rename them; so instead we look at the file content.
  629. # Grep'ing the first line is not enough: some people post-process
  630. # each Makefile.in and add a new line on top of each file to say so.
  631. # Grep'ing the whole file is not good either: AIX grep has a line
  632. # limit of 2048, but all sed's we know have understand at least 4000.
  633. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  634. dirpart=`AS_DIRNAME("$mf")`
  635. else
  636. continue
  637. fi
  638. # Extract the definition of DEPDIR, am__include, and am__quote
  639. # from the Makefile without running 'make'.
  640. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  641. test -z "$DEPDIR" && continue
  642. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  643. test -z "$am__include" && continue
  644. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  645. # Find all dependency output files, they are included files with
  646. # $(DEPDIR) in their names. We invoke sed twice because it is the
  647. # simplest approach to changing $(DEPDIR) to its actual value in the
  648. # expansion.
  649. for file in `sed -n "
  650. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  651. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
  652. # Make sure the directory exists.
  653. test -f "$dirpart/$file" && continue
  654. fdir=`AS_DIRNAME(["$file"])`
  655. AS_MKDIR_P([$dirpart/$fdir])
  656. # echo "creating $dirpart/$file"
  657. echo '# dummy' > "$dirpart/$file"
  658. done
  659. done
  660. }
  661. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  662. # AM_OUTPUT_DEPENDENCY_COMMANDS
  663. # -----------------------------
  664. # This macro should only be invoked once -- use via AC_REQUIRE.
  665. #
  666. # This code is only required when automatic dependency tracking
  667. # is enabled. FIXME. This creates each '.P' file that we will
  668. # need in order to bootstrap the dependency handling code.
  669. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  670. [AC_CONFIG_COMMANDS([depfiles],
  671. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  672. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  673. ])
  674. # Do all the work for Automake. -*- Autoconf -*-
  675. # Copyright (C) 1996-2017 Free Software Foundation, Inc.
  676. #
  677. # This file is free software; the Free Software Foundation
  678. # gives unlimited permission to copy and/or distribute it,
  679. # with or without modifications, as long as this notice is preserved.
  680. # This macro actually does too much. Some checks are only needed if
  681. # your package does certain things. But this isn't really a big deal.
  682. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
  683. m4_define([AC_PROG_CC],
  684. m4_defn([AC_PROG_CC])
  685. [_AM_PROG_CC_C_O
  686. ])
  687. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  688. # AM_INIT_AUTOMAKE([OPTIONS])
  689. # -----------------------------------------------
  690. # The call with PACKAGE and VERSION arguments is the old style
  691. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  692. # and VERSION should now be passed to AC_INIT and removed from
  693. # the call to AM_INIT_AUTOMAKE.
  694. # We support both call styles for the transition. After
  695. # the next Automake release, Autoconf can make the AC_INIT
  696. # arguments mandatory, and then we can depend on a new Autoconf
  697. # release and drop the old call support.
  698. AC_DEFUN([AM_INIT_AUTOMAKE],
  699. [AC_PREREQ([2.65])dnl
  700. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  701. dnl the ones we care about.
  702. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  703. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  704. AC_REQUIRE([AC_PROG_INSTALL])dnl
  705. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  706. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  707. # is not polluted with repeated "-I."
  708. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  709. # test to see if srcdir already configured
  710. if test -f $srcdir/config.status; then
  711. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  712. fi
  713. fi
  714. # test whether we have cygpath
  715. if test -z "$CYGPATH_W"; then
  716. if (cygpath --version) >/dev/null 2>/dev/null; then
  717. CYGPATH_W='cygpath -w'
  718. else
  719. CYGPATH_W=echo
  720. fi
  721. fi
  722. AC_SUBST([CYGPATH_W])
  723. # Define the identity of the package.
  724. dnl Distinguish between old-style and new-style calls.
  725. m4_ifval([$2],
  726. [AC_DIAGNOSE([obsolete],
  727. [$0: two- and three-arguments forms are deprecated.])
  728. m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  729. AC_SUBST([PACKAGE], [$1])dnl
  730. AC_SUBST([VERSION], [$2])],
  731. [_AM_SET_OPTIONS([$1])dnl
  732. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  733. m4_if(
  734. m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
  735. [ok:ok],,
  736. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  737. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  738. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  739. _AM_IF_OPTION([no-define],,
  740. [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
  741. AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
  742. # Some tools Automake needs.
  743. AC_REQUIRE([AM_SANITY_CHECK])dnl
  744. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  745. AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
  746. AM_MISSING_PROG([AUTOCONF], [autoconf])
  747. AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
  748. AM_MISSING_PROG([AUTOHEADER], [autoheader])
  749. AM_MISSING_PROG([MAKEINFO], [makeinfo])
  750. AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  751. AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
  752. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  753. # For better backward compatibility. To be removed once Automake 1.9.x
  754. # dies out for good. For more background, see:
  755. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
  756. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  757. AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
  758. # We need awk for the "check" target (and possibly the TAP driver). The
  759. # system "awk" is bad on some platforms.
  760. AC_REQUIRE([AC_PROG_AWK])dnl
  761. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  762. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  763. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  764. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  765. [_AM_PROG_TAR([v7])])])
  766. _AM_IF_OPTION([no-dependencies],,
  767. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  768. [_AM_DEPENDENCIES([CC])],
  769. [m4_define([AC_PROG_CC],
  770. m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
  771. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  772. [_AM_DEPENDENCIES([CXX])],
  773. [m4_define([AC_PROG_CXX],
  774. m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
  775. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  776. [_AM_DEPENDENCIES([OBJC])],
  777. [m4_define([AC_PROG_OBJC],
  778. m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
  779. AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
  780. [_AM_DEPENDENCIES([OBJCXX])],
  781. [m4_define([AC_PROG_OBJCXX],
  782. m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
  783. ])
  784. AC_REQUIRE([AM_SILENT_RULES])dnl
  785. dnl The testsuite driver may need to know about EXEEXT, so add the
  786. dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
  787. dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
  788. AC_CONFIG_COMMANDS_PRE(dnl
  789. [m4_provide_if([_AM_COMPILER_EXEEXT],
  790. [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  791. # POSIX will say in a future version that running "rm -f" with no argument
  792. # is OK; and we want to be able to make that assumption in our Makefile
  793. # recipes. So use an aggressive probe to check that the usage we want is
  794. # actually supported "in the wild" to an acceptable degree.
  795. # See automake bug#10828.
  796. # To make any issue more visible, cause the running configure to be aborted
  797. # by default if the 'rm' program in use doesn't match our expectations; the
  798. # user can still override this though.
  799. if rm -f && rm -fr && rm -rf; then : OK; else
  800. cat >&2 <<'END'
  801. Oops!
  802. Your 'rm' program seems unable to run without file operands specified
  803. on the command line, even when the '-f' option is present. This is contrary
  804. to the behaviour of most rm programs out there, and not conforming with
  805. the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
  806. Please tell bug-automake@gnu.org about your system, including the value
  807. of your $PATH and any error possibly output before this message. This
  808. can help us improve future automake versions.
  809. END
  810. if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
  811. echo 'Configuration will proceed anyway, since you have set the' >&2
  812. echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
  813. echo >&2
  814. else
  815. cat >&2 <<'END'
  816. Aborting the configuration process, to ensure you take notice of the issue.
  817. You can download and install GNU coreutils to get an 'rm' implementation
  818. that behaves properly: <http://www.gnu.org/software/coreutils/>.
  819. If you want to complete the configuration process using your problematic
  820. 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
  821. to "yes", and re-run configure.
  822. END
  823. AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
  824. fi
  825. fi
  826. dnl The trailing newline in this macro's definition is deliberate, for
  827. dnl backward compatibility and to allow trailing 'dnl'-style comments
  828. dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
  829. ])
  830. dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
  831. dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  832. dnl mangled by Autoconf and run in a shell conditional statement.
  833. m4_define([_AC_COMPILER_EXEEXT],
  834. m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  835. # When config.status generates a header, we must update the stamp-h file.
  836. # This file resides in the same directory as the config header
  837. # that is generated. The stamp files are numbered to have different names.
  838. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  839. # loop where config.status creates the headers, so we can generate
  840. # our stamp files there.
  841. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  842. [# Compute $1's index in $config_headers.
  843. _am_arg=$1
  844. _am_stamp_count=1
  845. for _am_header in $config_headers :; do
  846. case $_am_header in
  847. $_am_arg | $_am_arg:* )
  848. break ;;
  849. * )
  850. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  851. esac
  852. done
  853. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  854. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  855. #
  856. # This file is free software; the Free Software Foundation
  857. # gives unlimited permission to copy and/or distribute it,
  858. # with or without modifications, as long as this notice is preserved.
  859. # AM_PROG_INSTALL_SH
  860. # ------------------
  861. # Define $install_sh.
  862. AC_DEFUN([AM_PROG_INSTALL_SH],
  863. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  864. if test x"${install_sh+set}" != xset; then
  865. case $am_aux_dir in
  866. *\ * | *\ *)
  867. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  868. *)
  869. install_sh="\${SHELL} $am_aux_dir/install-sh"
  870. esac
  871. fi
  872. AC_SUBST([install_sh])])
  873. # Copyright (C) 2003-2017 Free Software Foundation, Inc.
  874. #
  875. # This file is free software; the Free Software Foundation
  876. # gives unlimited permission to copy and/or distribute it,
  877. # with or without modifications, as long as this notice is preserved.
  878. # Check whether the underlying file-system supports filenames
  879. # with a leading dot. For instance MS-DOS doesn't.
  880. AC_DEFUN([AM_SET_LEADING_DOT],
  881. [rm -rf .tst 2>/dev/null
  882. mkdir .tst 2>/dev/null
  883. if test -d .tst; then
  884. am__leading_dot=.
  885. else
  886. am__leading_dot=_
  887. fi
  888. rmdir .tst 2>/dev/null
  889. AC_SUBST([am__leading_dot])])
  890. # Check to see how 'make' treats includes. -*- Autoconf -*-
  891. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  892. #
  893. # This file is free software; the Free Software Foundation
  894. # gives unlimited permission to copy and/or distribute it,
  895. # with or without modifications, as long as this notice is preserved.
  896. # AM_MAKE_INCLUDE()
  897. # -----------------
  898. # Check to see how make treats includes.
  899. AC_DEFUN([AM_MAKE_INCLUDE],
  900. [am_make=${MAKE-make}
  901. cat > confinc << 'END'
  902. am__doit:
  903. @echo this is the am__doit target
  904. .PHONY: am__doit
  905. END
  906. # If we don't find an include directive, just comment out the code.
  907. AC_MSG_CHECKING([for style of include used by $am_make])
  908. am__include="#"
  909. am__quote=
  910. _am_result=none
  911. # First try GNU make style include.
  912. echo "include confinc" > confmf
  913. # Ignore all kinds of additional output from 'make'.
  914. case `$am_make -s -f confmf 2> /dev/null` in #(
  915. *the\ am__doit\ target*)
  916. am__include=include
  917. am__quote=
  918. _am_result=GNU
  919. ;;
  920. esac
  921. # Now try BSD make style include.
  922. if test "$am__include" = "#"; then
  923. echo '.include "confinc"' > confmf
  924. case `$am_make -s -f confmf 2> /dev/null` in #(
  925. *the\ am__doit\ target*)
  926. am__include=.include
  927. am__quote="\""
  928. _am_result=BSD
  929. ;;
  930. esac
  931. fi
  932. AC_SUBST([am__include])
  933. AC_SUBST([am__quote])
  934. AC_MSG_RESULT([$_am_result])
  935. rm -f confinc confmf
  936. ])
  937. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  938. # Copyright (C) 1997-2017 Free Software Foundation, Inc.
  939. #
  940. # This file is free software; the Free Software Foundation
  941. # gives unlimited permission to copy and/or distribute it,
  942. # with or without modifications, as long as this notice is preserved.
  943. # AM_MISSING_PROG(NAME, PROGRAM)
  944. # ------------------------------
  945. AC_DEFUN([AM_MISSING_PROG],
  946. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  947. $1=${$1-"${am_missing_run}$2"}
  948. AC_SUBST($1)])
  949. # AM_MISSING_HAS_RUN
  950. # ------------------
  951. # Define MISSING if not defined so far and test if it is modern enough.
  952. # If it is, set am_missing_run to use it, otherwise, to nothing.
  953. AC_DEFUN([AM_MISSING_HAS_RUN],
  954. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  955. AC_REQUIRE_AUX_FILE([missing])dnl
  956. if test x"${MISSING+set}" != xset; then
  957. case $am_aux_dir in
  958. *\ * | *\ *)
  959. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  960. *)
  961. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  962. esac
  963. fi
  964. # Use eval to expand $SHELL
  965. if eval "$MISSING --is-lightweight"; then
  966. am_missing_run="$MISSING "
  967. else
  968. am_missing_run=
  969. AC_MSG_WARN(['missing' script is too old or missing])
  970. fi
  971. ])
  972. # Helper functions for option handling. -*- Autoconf -*-
  973. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  974. #
  975. # This file is free software; the Free Software Foundation
  976. # gives unlimited permission to copy and/or distribute it,
  977. # with or without modifications, as long as this notice is preserved.
  978. # _AM_MANGLE_OPTION(NAME)
  979. # -----------------------
  980. AC_DEFUN([_AM_MANGLE_OPTION],
  981. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  982. # _AM_SET_OPTION(NAME)
  983. # --------------------
  984. # Set option NAME. Presently that only means defining a flag for this option.
  985. AC_DEFUN([_AM_SET_OPTION],
  986. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  987. # _AM_SET_OPTIONS(OPTIONS)
  988. # ------------------------
  989. # OPTIONS is a space-separated list of Automake options.
  990. AC_DEFUN([_AM_SET_OPTIONS],
  991. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  992. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  993. # -------------------------------------------
  994. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  995. AC_DEFUN([_AM_IF_OPTION],
  996. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  997. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  998. #
  999. # This file is free software; the Free Software Foundation
  1000. # gives unlimited permission to copy and/or distribute it,
  1001. # with or without modifications, as long as this notice is preserved.
  1002. # _AM_PROG_CC_C_O
  1003. # ---------------
  1004. # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
  1005. # to automatically call this.
  1006. AC_DEFUN([_AM_PROG_CC_C_O],
  1007. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  1008. AC_REQUIRE_AUX_FILE([compile])dnl
  1009. AC_LANG_PUSH([C])dnl
  1010. AC_CACHE_CHECK(
  1011. [whether $CC understands -c and -o together],
  1012. [am_cv_prog_cc_c_o],
  1013. [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
  1014. # Make sure it works both with $CC and with simple cc.
  1015. # Following AC_PROG_CC_C_O, we do the test twice because some
  1016. # compilers refuse to overwrite an existing .o file with -o,
  1017. # though they will create one.
  1018. am_cv_prog_cc_c_o=yes
  1019. for am_i in 1 2; do
  1020. if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
  1021. && test -f conftest2.$ac_objext; then
  1022. : OK
  1023. else
  1024. am_cv_prog_cc_c_o=no
  1025. break
  1026. fi
  1027. done
  1028. rm -f core conftest*
  1029. unset am_i])
  1030. if test "$am_cv_prog_cc_c_o" != yes; then
  1031. # Losing compiler, so override with the script.
  1032. # FIXME: It is wrong to rewrite CC.
  1033. # But if we don't then we get into trouble of one sort or another.
  1034. # A longer-term fix would be to have automake use am__CC in this case,
  1035. # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
  1036. CC="$am_aux_dir/compile $CC"
  1037. fi
  1038. AC_LANG_POP([C])])
  1039. # For backward compatibility.
  1040. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
  1041. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1042. #
  1043. # This file is free software; the Free Software Foundation
  1044. # gives unlimited permission to copy and/or distribute it,
  1045. # with or without modifications, as long as this notice is preserved.
  1046. # AM_RUN_LOG(COMMAND)
  1047. # -------------------
  1048. # Run COMMAND, save the exit status in ac_status, and log it.
  1049. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
  1050. AC_DEFUN([AM_RUN_LOG],
  1051. [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
  1052. ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
  1053. ac_status=$?
  1054. echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  1055. (exit $ac_status); }])
  1056. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  1057. # Copyright (C) 1996-2017 Free Software Foundation, Inc.
  1058. #
  1059. # This file is free software; the Free Software Foundation
  1060. # gives unlimited permission to copy and/or distribute it,
  1061. # with or without modifications, as long as this notice is preserved.
  1062. # AM_SANITY_CHECK
  1063. # ---------------
  1064. AC_DEFUN([AM_SANITY_CHECK],
  1065. [AC_MSG_CHECKING([whether build environment is sane])
  1066. # Reject unsafe characters in $srcdir or the absolute working directory
  1067. # name. Accept space and tab only in the latter.
  1068. am_lf='
  1069. '
  1070. case `pwd` in
  1071. *[[\\\"\#\$\&\'\`$am_lf]]*)
  1072. AC_MSG_ERROR([unsafe absolute working directory name]);;
  1073. esac
  1074. case $srcdir in
  1075. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  1076. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  1077. esac
  1078. # Do 'set' in a subshell so we don't clobber the current shell's
  1079. # arguments. Must try -L first in case configure is actually a
  1080. # symlink; some systems play weird games with the mod time of symlinks
  1081. # (eg FreeBSD returns the mod time of the symlink's containing
  1082. # directory).
  1083. if (
  1084. am_has_slept=no
  1085. for am_try in 1 2; do
  1086. echo "timestamp, slept: $am_has_slept" > conftest.file
  1087. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  1088. if test "$[*]" = "X"; then
  1089. # -L didn't work.
  1090. set X `ls -t "$srcdir/configure" conftest.file`
  1091. fi
  1092. if test "$[*]" != "X $srcdir/configure conftest.file" \
  1093. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  1094. # If neither matched, then we have a broken ls. This can happen
  1095. # if, for instance, CONFIG_SHELL is bash and it inherits a
  1096. # broken ls alias from the environment. This has actually
  1097. # happened. Such a system could not be considered "sane".
  1098. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  1099. alias in your environment])
  1100. fi
  1101. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  1102. break
  1103. fi
  1104. # Just in case.
  1105. sleep 1
  1106. am_has_slept=yes
  1107. done
  1108. test "$[2]" = conftest.file
  1109. )
  1110. then
  1111. # Ok.
  1112. :
  1113. else
  1114. AC_MSG_ERROR([newly created file is older than distributed files!
  1115. Check your system clock])
  1116. fi
  1117. AC_MSG_RESULT([yes])
  1118. # If we didn't sleep, we still need to ensure time stamps of config.status and
  1119. # generated files are strictly newer.
  1120. am_sleep_pid=
  1121. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  1122. ( sleep 1 ) &
  1123. am_sleep_pid=$!
  1124. fi
  1125. AC_CONFIG_COMMANDS_PRE(
  1126. [AC_MSG_CHECKING([that generated files are newer than configure])
  1127. if test -n "$am_sleep_pid"; then
  1128. # Hide warnings about reused PIDs.
  1129. wait $am_sleep_pid 2>/dev/null
  1130. fi
  1131. AC_MSG_RESULT([done])])
  1132. rm -f conftest.file
  1133. ])
  1134. # Copyright (C) 2009-2017 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. # AM_SILENT_RULES([DEFAULT])
  1140. # --------------------------
  1141. # Enable less verbose build rules; with the default set to DEFAULT
  1142. # ("yes" being less verbose, "no" or empty being verbose).
  1143. AC_DEFUN([AM_SILENT_RULES],
  1144. [AC_ARG_ENABLE([silent-rules], [dnl
  1145. AS_HELP_STRING(
  1146. [--enable-silent-rules],
  1147. [less verbose build output (undo: "make V=1")])
  1148. AS_HELP_STRING(
  1149. [--disable-silent-rules],
  1150. [verbose build output (undo: "make V=0")])dnl
  1151. ])
  1152. case $enable_silent_rules in @%:@ (((
  1153. yes) AM_DEFAULT_VERBOSITY=0;;
  1154. no) AM_DEFAULT_VERBOSITY=1;;
  1155. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  1156. esac
  1157. dnl
  1158. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  1159. dnl do not support nested variable expansions.
  1160. dnl See automake bug#9928 and bug#10237.
  1161. am_make=${MAKE-make}
  1162. AC_CACHE_CHECK([whether $am_make supports nested variables],
  1163. [am_cv_make_support_nested_variables],
  1164. [if AS_ECHO([['TRUE=$(BAR$(V))
  1165. BAR0=false
  1166. BAR1=true
  1167. V=1
  1168. am__doit:
  1169. @$(TRUE)
  1170. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  1171. am_cv_make_support_nested_variables=yes
  1172. else
  1173. am_cv_make_support_nested_variables=no
  1174. fi])
  1175. if test $am_cv_make_support_nested_variables = yes; then
  1176. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  1177. AM_V='$(V)'
  1178. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  1179. else
  1180. AM_V=$AM_DEFAULT_VERBOSITY
  1181. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  1182. fi
  1183. AC_SUBST([AM_V])dnl
  1184. AM_SUBST_NOTMAKE([AM_V])dnl
  1185. AC_SUBST([AM_DEFAULT_V])dnl
  1186. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  1187. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  1188. AM_BACKSLASH='\'
  1189. AC_SUBST([AM_BACKSLASH])dnl
  1190. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  1191. ])
  1192. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1193. #
  1194. # This file is free software; the Free Software Foundation
  1195. # gives unlimited permission to copy and/or distribute it,
  1196. # with or without modifications, as long as this notice is preserved.
  1197. # AM_PROG_INSTALL_STRIP
  1198. # ---------------------
  1199. # One issue with vendor 'install' (even GNU) is that you can't
  1200. # specify the program used to strip binaries. This is especially
  1201. # annoying in cross-compiling environments, where the build's strip
  1202. # is unlikely to handle the host's binaries.
  1203. # Fortunately install-sh will honor a STRIPPROG variable, so we
  1204. # always use install-sh in "make install-strip", and initialize
  1205. # STRIPPROG with the value of the STRIP variable (set by the user).
  1206. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  1207. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  1208. # Installed binaries are usually stripped using 'strip' when the user
  1209. # run "make install-strip". However 'strip' might not be the right
  1210. # tool to use in cross-compilation environments, therefore Automake
  1211. # will honor the 'STRIP' environment variable to overrule this program.
  1212. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  1213. if test "$cross_compiling" != no; then
  1214. AC_CHECK_TOOL([STRIP], [strip], :)
  1215. fi
  1216. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  1217. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  1218. # Copyright (C) 2006-2017 Free Software Foundation, Inc.
  1219. #
  1220. # This file is free software; the Free Software Foundation
  1221. # gives unlimited permission to copy and/or distribute it,
  1222. # with or without modifications, as long as this notice is preserved.
  1223. # _AM_SUBST_NOTMAKE(VARIABLE)
  1224. # ---------------------------
  1225. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1226. # This macro is traced by Automake.
  1227. AC_DEFUN([_AM_SUBST_NOTMAKE])
  1228. # AM_SUBST_NOTMAKE(VARIABLE)
  1229. # --------------------------
  1230. # Public sister of _AM_SUBST_NOTMAKE.
  1231. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1232. # Check how to create a tarball. -*- Autoconf -*-
  1233. # Copyright (C) 2004-2017 Free Software Foundation, Inc.
  1234. #
  1235. # This file is free software; the Free Software Foundation
  1236. # gives unlimited permission to copy and/or distribute it,
  1237. # with or without modifications, as long as this notice is preserved.
  1238. # _AM_PROG_TAR(FORMAT)
  1239. # --------------------
  1240. # Check how to create a tarball in format FORMAT.
  1241. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  1242. #
  1243. # Substitute a variable $(am__tar) that is a command
  1244. # writing to stdout a FORMAT-tarball containing the directory
  1245. # $tardir.
  1246. # tardir=directory && $(am__tar) > result.tar
  1247. #
  1248. # Substitute a variable $(am__untar) that extract such
  1249. # a tarball read from stdin.
  1250. # $(am__untar) < result.tar
  1251. #
  1252. AC_DEFUN([_AM_PROG_TAR],
  1253. [# Always define AMTAR for backward compatibility. Yes, it's still used
  1254. # in the wild :-( We should find a proper way to deprecate it ...
  1255. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  1256. # We'll loop over all known methods to create a tar archive until one works.
  1257. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1258. m4_if([$1], [v7],
  1259. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  1260. [m4_case([$1],
  1261. [ustar],
  1262. [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
  1263. # There is notably a 21 bits limit for the UID and the GID. In fact,
  1264. # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
  1265. # and bug#13588).
  1266. am_max_uid=2097151 # 2^21 - 1
  1267. am_max_gid=$am_max_uid
  1268. # The $UID and $GID variables are not portable, so we need to resort
  1269. # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
  1270. # below are definitely unexpected, so allow the users to see them
  1271. # (that is, avoid stderr redirection).
  1272. am_uid=`id -u || echo unknown`
  1273. am_gid=`id -g || echo unknown`
  1274. AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
  1275. if test $am_uid -le $am_max_uid; then
  1276. AC_MSG_RESULT([yes])
  1277. else
  1278. AC_MSG_RESULT([no])
  1279. _am_tools=none
  1280. fi
  1281. AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
  1282. if test $am_gid -le $am_max_gid; then
  1283. AC_MSG_RESULT([yes])
  1284. else
  1285. AC_MSG_RESULT([no])
  1286. _am_tools=none
  1287. fi],
  1288. [pax],
  1289. [],
  1290. [m4_fatal([Unknown tar format])])
  1291. AC_MSG_CHECKING([how to create a $1 tar archive])
  1292. # Go ahead even if we have the value already cached. We do so because we
  1293. # need to set the values for the 'am__tar' and 'am__untar' variables.
  1294. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1295. for _am_tool in $_am_tools; do
  1296. case $_am_tool in
  1297. gnutar)
  1298. for _am_tar in tar gnutar gtar; do
  1299. AM_RUN_LOG([$_am_tar --version]) && break
  1300. done
  1301. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  1302. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  1303. am__untar="$_am_tar -xf -"
  1304. ;;
  1305. plaintar)
  1306. # Must skip GNU tar: if it does not support --format= it doesn't create
  1307. # ustar tarball either.
  1308. (tar --version) >/dev/null 2>&1 && continue
  1309. am__tar='tar chf - "$$tardir"'
  1310. am__tar_='tar chf - "$tardir"'
  1311. am__untar='tar xf -'
  1312. ;;
  1313. pax)
  1314. am__tar='pax -L -x $1 -w "$$tardir"'
  1315. am__tar_='pax -L -x $1 -w "$tardir"'
  1316. am__untar='pax -r'
  1317. ;;
  1318. cpio)
  1319. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  1320. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  1321. am__untar='cpio -i -H $1 -d'
  1322. ;;
  1323. none)
  1324. am__tar=false
  1325. am__tar_=false
  1326. am__untar=false
  1327. ;;
  1328. esac
  1329. # If the value was cached, stop now. We just wanted to have am__tar
  1330. # and am__untar set.
  1331. test -n "${am_cv_prog_tar_$1}" && break
  1332. # tar/untar a dummy directory, and stop if the command works.
  1333. rm -rf conftest.dir
  1334. mkdir conftest.dir
  1335. echo GrepMe > conftest.dir/file
  1336. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  1337. rm -rf conftest.dir
  1338. if test -s conftest.tar; then
  1339. AM_RUN_LOG([$am__untar <conftest.tar])
  1340. AM_RUN_LOG([cat conftest.dir/file])
  1341. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  1342. fi
  1343. done
  1344. rm -rf conftest.dir
  1345. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1346. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1347. AC_SUBST([am__tar])
  1348. AC_SUBST([am__untar])
  1349. ]) # _AM_PROG_TAR