aclocal.m4 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931
  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. # lib-prefix.m4 serial 7 (gettext-0.18)
  19. dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
  20. dnl This file is free software; the Free Software Foundation
  21. dnl gives unlimited permission to copy and/or distribute it,
  22. dnl with or without modifications, as long as this notice is preserved.
  23. dnl From Bruno Haible.
  24. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  25. dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  26. dnl require excessive bracketing.
  27. ifdef([AC_HELP_STRING],
  28. [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  29. [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  30. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  31. dnl to access previously installed libraries. The basic assumption is that
  32. dnl a user will want packages to use other packages he previously installed
  33. dnl with the same --prefix option.
  34. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  35. dnl libraries, but is otherwise very convenient.
  36. AC_DEFUN([AC_LIB_PREFIX],
  37. [
  38. AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  39. AC_REQUIRE([AC_PROG_CC])
  40. AC_REQUIRE([AC_CANONICAL_HOST])
  41. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  42. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  43. dnl By default, look in $includedir and $libdir.
  44. use_additional=yes
  45. AC_LIB_WITH_FINAL_PREFIX([
  46. eval additional_includedir=\"$includedir\"
  47. eval additional_libdir=\"$libdir\"
  48. ])
  49. AC_LIB_ARG_WITH([lib-prefix],
  50. [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  51. --without-lib-prefix don't search for libraries in includedir and libdir],
  52. [
  53. if test "X$withval" = "Xno"; then
  54. use_additional=no
  55. else
  56. if test "X$withval" = "X"; then
  57. AC_LIB_WITH_FINAL_PREFIX([
  58. eval additional_includedir=\"$includedir\"
  59. eval additional_libdir=\"$libdir\"
  60. ])
  61. else
  62. additional_includedir="$withval/include"
  63. additional_libdir="$withval/$acl_libdirstem"
  64. fi
  65. fi
  66. ])
  67. if test $use_additional = yes; then
  68. dnl Potentially add $additional_includedir to $CPPFLAGS.
  69. dnl But don't add it
  70. dnl 1. if it's the standard /usr/include,
  71. dnl 2. if it's already present in $CPPFLAGS,
  72. dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  73. dnl 4. if it doesn't exist as a directory.
  74. if test "X$additional_includedir" != "X/usr/include"; then
  75. haveit=
  76. for x in $CPPFLAGS; do
  77. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  78. if test "X$x" = "X-I$additional_includedir"; then
  79. haveit=yes
  80. break
  81. fi
  82. done
  83. if test -z "$haveit"; then
  84. if test "X$additional_includedir" = "X/usr/local/include"; then
  85. if test -n "$GCC"; then
  86. case $host_os in
  87. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  88. esac
  89. fi
  90. fi
  91. if test -z "$haveit"; then
  92. if test -d "$additional_includedir"; then
  93. dnl Really add $additional_includedir to $CPPFLAGS.
  94. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  95. fi
  96. fi
  97. fi
  98. fi
  99. dnl Potentially add $additional_libdir to $LDFLAGS.
  100. dnl But don't add it
  101. dnl 1. if it's the standard /usr/lib,
  102. dnl 2. if it's already present in $LDFLAGS,
  103. dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  104. dnl 4. if it doesn't exist as a directory.
  105. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
  106. haveit=
  107. for x in $LDFLAGS; do
  108. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  109. if test "X$x" = "X-L$additional_libdir"; then
  110. haveit=yes
  111. break
  112. fi
  113. done
  114. if test -z "$haveit"; then
  115. if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
  116. if test -n "$GCC"; then
  117. case $host_os in
  118. linux*) haveit=yes;;
  119. esac
  120. fi
  121. fi
  122. if test -z "$haveit"; then
  123. if test -d "$additional_libdir"; then
  124. dnl Really add $additional_libdir to $LDFLAGS.
  125. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  126. fi
  127. fi
  128. fi
  129. fi
  130. fi
  131. ])
  132. dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  133. dnl acl_final_exec_prefix, containing the values to which $prefix and
  134. dnl $exec_prefix will expand at the end of the configure script.
  135. AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  136. [
  137. dnl Unfortunately, prefix and exec_prefix get only finally determined
  138. dnl at the end of configure.
  139. if test "X$prefix" = "XNONE"; then
  140. acl_final_prefix="$ac_default_prefix"
  141. else
  142. acl_final_prefix="$prefix"
  143. fi
  144. if test "X$exec_prefix" = "XNONE"; then
  145. acl_final_exec_prefix='${prefix}'
  146. else
  147. acl_final_exec_prefix="$exec_prefix"
  148. fi
  149. acl_save_prefix="$prefix"
  150. prefix="$acl_final_prefix"
  151. eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  152. prefix="$acl_save_prefix"
  153. ])
  154. dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  155. dnl variables prefix and exec_prefix bound to the values they will have
  156. dnl at the end of the configure script.
  157. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  158. [
  159. acl_save_prefix="$prefix"
  160. prefix="$acl_final_prefix"
  161. acl_save_exec_prefix="$exec_prefix"
  162. exec_prefix="$acl_final_exec_prefix"
  163. $1
  164. exec_prefix="$acl_save_exec_prefix"
  165. prefix="$acl_save_prefix"
  166. ])
  167. dnl AC_LIB_PREPARE_MULTILIB creates
  168. dnl - a variable acl_libdirstem, containing the basename of the libdir, either
  169. dnl "lib" or "lib64" or "lib/64",
  170. dnl - a variable acl_libdirstem2, as a secondary possible value for
  171. dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
  172. dnl "lib/amd64".
  173. AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
  174. [
  175. dnl There is no formal standard regarding lib and lib64.
  176. dnl On glibc systems, the current practice is that on a system supporting
  177. dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  178. dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
  179. dnl the compiler's default mode by looking at the compiler's library search
  180. dnl path. If at least one of its elements ends in /lib64 or points to a
  181. dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
  182. dnl Otherwise we use the default, namely "lib".
  183. dnl On Solaris systems, the current practice is that on a system supporting
  184. dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  185. dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
  186. dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
  187. AC_REQUIRE([AC_CANONICAL_HOST])
  188. acl_libdirstem=lib
  189. acl_libdirstem2=
  190. case "$host_os" in
  191. solaris*)
  192. dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
  193. dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
  194. dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
  195. dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
  196. dnl symlink is missing, so we set acl_libdirstem2 too.
  197. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
  198. [AC_EGREP_CPP([sixtyfour bits], [
  199. #ifdef _LP64
  200. sixtyfour bits
  201. #endif
  202. ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
  203. ])
  204. if test $gl_cv_solaris_64bit = yes; then
  205. acl_libdirstem=lib/64
  206. case "$host_cpu" in
  207. sparc*) acl_libdirstem2=lib/sparcv9 ;;
  208. i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
  209. esac
  210. fi
  211. ;;
  212. *)
  213. searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  214. if test -n "$searchpath"; then
  215. acl_save_IFS="${IFS= }"; IFS=":"
  216. for searchdir in $searchpath; do
  217. if test -d "$searchdir"; then
  218. case "$searchdir" in
  219. */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  220. */../ | */.. )
  221. # Better ignore directories of this form. They are misleading.
  222. ;;
  223. *) searchdir=`cd "$searchdir" && pwd`
  224. case "$searchdir" in
  225. */lib64 ) acl_libdirstem=lib64 ;;
  226. esac ;;
  227. esac
  228. fi
  229. done
  230. IFS="$acl_save_IFS"
  231. fi
  232. ;;
  233. esac
  234. test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
  235. ])
  236. dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  237. dnl serial 11 (pkg-config-0.29.1)
  238. dnl
  239. dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  240. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
  241. dnl
  242. dnl This program is free software; you can redistribute it and/or modify
  243. dnl it under the terms of the GNU General Public License as published by
  244. dnl the Free Software Foundation; either version 2 of the License, or
  245. dnl (at your option) any later version.
  246. dnl
  247. dnl This program is distributed in the hope that it will be useful, but
  248. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  249. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  250. dnl General Public License for more details.
  251. dnl
  252. dnl You should have received a copy of the GNU General Public License
  253. dnl along with this program; if not, write to the Free Software
  254. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  255. dnl 02111-1307, USA.
  256. dnl
  257. dnl As a special exception to the GNU General Public License, if you
  258. dnl distribute this file as part of a program that contains a
  259. dnl configuration script generated by Autoconf, you may include it under
  260. dnl the same distribution terms that you use for the rest of that
  261. dnl program.
  262. dnl PKG_PREREQ(MIN-VERSION)
  263. dnl -----------------------
  264. dnl Since: 0.29
  265. dnl
  266. dnl Verify that the version of the pkg-config macros are at least
  267. dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
  268. dnl installed version of pkg-config, this checks the developer's version
  269. dnl of pkg.m4 when generating configure.
  270. dnl
  271. dnl To ensure that this macro is defined, also add:
  272. dnl m4_ifndef([PKG_PREREQ],
  273. dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
  274. dnl
  275. dnl See the "Since" comment for each macro you use to see what version
  276. dnl of the macros you require.
  277. m4_defun([PKG_PREREQ],
  278. [m4_define([PKG_MACROS_VERSION], [0.29.1])
  279. m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
  280. [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
  281. ])dnl PKG_PREREQ
  282. dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
  283. dnl ----------------------------------
  284. dnl Since: 0.16
  285. dnl
  286. dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
  287. dnl first found in the path. Checks that the version of pkg-config found
  288. dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
  289. dnl used since that's the first version where most current features of
  290. dnl pkg-config existed.
  291. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  292. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  293. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  294. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  295. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  296. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  297. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  298. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  299. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  300. fi
  301. if test -n "$PKG_CONFIG"; then
  302. _pkg_min_version=m4_default([$1], [0.9.0])
  303. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  304. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  305. AC_MSG_RESULT([yes])
  306. else
  307. AC_MSG_RESULT([no])
  308. PKG_CONFIG=""
  309. fi
  310. fi[]dnl
  311. ])dnl PKG_PROG_PKG_CONFIG
  312. dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  313. dnl -------------------------------------------------------------------
  314. dnl Since: 0.18
  315. dnl
  316. dnl Check to see whether a particular set of modules exists. Similar to
  317. dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
  318. dnl
  319. dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  320. dnl only at the first occurence in configure.ac, so if the first place
  321. dnl it's called might be skipped (such as if it is within an "if", you
  322. dnl have to call PKG_CHECK_EXISTS manually
  323. AC_DEFUN([PKG_CHECK_EXISTS],
  324. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  325. if test -n "$PKG_CONFIG" && \
  326. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  327. m4_default([$2], [:])
  328. m4_ifvaln([$3], [else
  329. $3])dnl
  330. fi])
  331. dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  332. dnl ---------------------------------------------
  333. dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
  334. dnl pkg_failed based on the result.
  335. m4_define([_PKG_CONFIG],
  336. [if test -n "$$1"; then
  337. pkg_cv_[]$1="$$1"
  338. elif test -n "$PKG_CONFIG"; then
  339. PKG_CHECK_EXISTS([$3],
  340. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  341. test "x$?" != "x0" && pkg_failed=yes ],
  342. [pkg_failed=yes])
  343. else
  344. pkg_failed=untried
  345. fi[]dnl
  346. ])dnl _PKG_CONFIG
  347. dnl _PKG_SHORT_ERRORS_SUPPORTED
  348. dnl ---------------------------
  349. dnl Internal check to see if pkg-config supports short errors.
  350. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  351. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  352. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  353. _pkg_short_errors_supported=yes
  354. else
  355. _pkg_short_errors_supported=no
  356. fi[]dnl
  357. ])dnl _PKG_SHORT_ERRORS_SUPPORTED
  358. dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  359. dnl [ACTION-IF-NOT-FOUND])
  360. dnl --------------------------------------------------------------
  361. dnl Since: 0.4.0
  362. dnl
  363. dnl Note that if there is a possibility the first call to
  364. dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
  365. dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  366. AC_DEFUN([PKG_CHECK_MODULES],
  367. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  368. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  369. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  370. pkg_failed=no
  371. AC_MSG_CHECKING([for $1])
  372. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  373. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  374. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  375. and $1[]_LIBS to avoid the need to call pkg-config.
  376. See the pkg-config man page for more details.])
  377. if test $pkg_failed = yes; then
  378. AC_MSG_RESULT([no])
  379. _PKG_SHORT_ERRORS_SUPPORTED
  380. if test $_pkg_short_errors_supported = yes; then
  381. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  382. else
  383. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  384. fi
  385. # Put the nasty error message in config.log where it belongs
  386. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  387. m4_default([$4], [AC_MSG_ERROR(
  388. [Package requirements ($2) were not met:
  389. $$1_PKG_ERRORS
  390. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  391. installed software in a non-standard prefix.
  392. _PKG_TEXT])[]dnl
  393. ])
  394. elif test $pkg_failed = untried; then
  395. AC_MSG_RESULT([no])
  396. m4_default([$4], [AC_MSG_FAILURE(
  397. [The pkg-config script could not be found or is too old. Make sure it
  398. is in your PATH or set the PKG_CONFIG environment variable to the full
  399. path to pkg-config.
  400. _PKG_TEXT
  401. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  402. ])
  403. else
  404. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  405. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  406. AC_MSG_RESULT([yes])
  407. $3
  408. fi[]dnl
  409. ])dnl PKG_CHECK_MODULES
  410. dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  411. dnl [ACTION-IF-NOT-FOUND])
  412. dnl ---------------------------------------------------------------------
  413. dnl Since: 0.29
  414. dnl
  415. dnl Checks for existence of MODULES and gathers its build flags with
  416. dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
  417. dnl and VARIABLE-PREFIX_LIBS from --libs.
  418. dnl
  419. dnl Note that if there is a possibility the first call to
  420. dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
  421. dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
  422. dnl configure.ac.
  423. AC_DEFUN([PKG_CHECK_MODULES_STATIC],
  424. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  425. _save_PKG_CONFIG=$PKG_CONFIG
  426. PKG_CONFIG="$PKG_CONFIG --static"
  427. PKG_CHECK_MODULES($@)
  428. PKG_CONFIG=$_save_PKG_CONFIG[]dnl
  429. ])dnl PKG_CHECK_MODULES_STATIC
  430. dnl PKG_INSTALLDIR([DIRECTORY])
  431. dnl -------------------------
  432. dnl Since: 0.27
  433. dnl
  434. dnl Substitutes the variable pkgconfigdir as the location where a module
  435. dnl should install pkg-config .pc files. By default the directory is
  436. dnl $libdir/pkgconfig, but the default can be changed by passing
  437. dnl DIRECTORY. The user can override through the --with-pkgconfigdir
  438. dnl parameter.
  439. AC_DEFUN([PKG_INSTALLDIR],
  440. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  441. m4_pushdef([pkg_description],
  442. [pkg-config installation directory @<:@]pkg_default[@:>@])
  443. AC_ARG_WITH([pkgconfigdir],
  444. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  445. [with_pkgconfigdir=]pkg_default)
  446. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  447. m4_popdef([pkg_default])
  448. m4_popdef([pkg_description])
  449. ])dnl PKG_INSTALLDIR
  450. dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
  451. dnl --------------------------------
  452. dnl Since: 0.27
  453. dnl
  454. dnl Substitutes the variable noarch_pkgconfigdir as the location where a
  455. dnl module should install arch-independent pkg-config .pc files. By
  456. dnl default the directory is $datadir/pkgconfig, but the default can be
  457. dnl changed by passing DIRECTORY. The user can override through the
  458. dnl --with-noarch-pkgconfigdir parameter.
  459. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  460. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  461. m4_pushdef([pkg_description],
  462. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  463. AC_ARG_WITH([noarch-pkgconfigdir],
  464. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  465. [with_noarch_pkgconfigdir=]pkg_default)
  466. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  467. m4_popdef([pkg_default])
  468. m4_popdef([pkg_description])
  469. ])dnl PKG_NOARCH_INSTALLDIR
  470. dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
  471. dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  472. dnl -------------------------------------------
  473. dnl Since: 0.28
  474. dnl
  475. dnl Retrieves the value of the pkg-config variable for the given module.
  476. AC_DEFUN([PKG_CHECK_VAR],
  477. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  478. AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
  479. _PKG_CONFIG([$1], [variable="][$3]["], [$2])
  480. AS_VAR_COPY([$1], [pkg_cv_][$1])
  481. AS_VAR_IF([$1], [""], [$5], [$4])dnl
  482. ])dnl PKG_CHECK_VAR
  483. # Copyright (C) 2002-2017 Free Software Foundation, Inc.
  484. #
  485. # This file is free software; the Free Software Foundation
  486. # gives unlimited permission to copy and/or distribute it,
  487. # with or without modifications, as long as this notice is preserved.
  488. # AM_AUTOMAKE_VERSION(VERSION)
  489. # ----------------------------
  490. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  491. # generated from the m4 files accompanying Automake X.Y.
  492. # (This private macro should not be called outside this file.)
  493. AC_DEFUN([AM_AUTOMAKE_VERSION],
  494. [am__api_version='1.15'
  495. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  496. dnl require some minimum version. Point them to the right macro.
  497. m4_if([$1], [1.15.1], [],
  498. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  499. ])
  500. # _AM_AUTOCONF_VERSION(VERSION)
  501. # -----------------------------
  502. # aclocal traces this macro to find the Autoconf version.
  503. # This is a private macro too. Using m4_define simplifies
  504. # the logic in aclocal, which can simply ignore this definition.
  505. m4_define([_AM_AUTOCONF_VERSION], [])
  506. # AM_SET_CURRENT_AUTOMAKE_VERSION
  507. # -------------------------------
  508. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  509. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  510. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  511. [AM_AUTOMAKE_VERSION([1.15.1])dnl
  512. m4_ifndef([AC_AUTOCONF_VERSION],
  513. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  514. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  515. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  516. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  517. #
  518. # This file is free software; the Free Software Foundation
  519. # gives unlimited permission to copy and/or distribute it,
  520. # with or without modifications, as long as this notice is preserved.
  521. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  522. # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
  523. # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
  524. #
  525. # Of course, Automake must honor this variable whenever it calls a
  526. # tool from the auxiliary directory. The problem is that $srcdir (and
  527. # therefore $ac_aux_dir as well) can be either absolute or relative,
  528. # depending on how configure is run. This is pretty annoying, since
  529. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  530. # source directory, any form will work fine, but in subdirectories a
  531. # relative path needs to be adjusted first.
  532. #
  533. # $ac_aux_dir/missing
  534. # fails when called from a subdirectory if $ac_aux_dir is relative
  535. # $top_srcdir/$ac_aux_dir/missing
  536. # fails if $ac_aux_dir is absolute,
  537. # fails when called from a subdirectory in a VPATH build with
  538. # a relative $ac_aux_dir
  539. #
  540. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  541. # are both prefixed by $srcdir. In an in-source build this is usually
  542. # harmless because $srcdir is '.', but things will broke when you
  543. # start a VPATH build or use an absolute $srcdir.
  544. #
  545. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  546. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  547. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  548. # and then we would define $MISSING as
  549. # MISSING="\${SHELL} $am_aux_dir/missing"
  550. # This will work as long as MISSING is not called from configure, because
  551. # unfortunately $(top_srcdir) has no meaning in configure.
  552. # However there are other variables, like CC, which are often used in
  553. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  554. #
  555. # Another solution, used here, is to always expand $ac_aux_dir to an
  556. # absolute PATH. The drawback is that using absolute paths prevent a
  557. # configured tree to be moved without reconfiguration.
  558. AC_DEFUN([AM_AUX_DIR_EXPAND],
  559. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  560. # Expand $ac_aux_dir to an absolute path.
  561. am_aux_dir=`cd "$ac_aux_dir" && pwd`
  562. ])
  563. # AM_COND_IF -*- Autoconf -*-
  564. # Copyright (C) 2008-2017 Free Software Foundation, Inc.
  565. #
  566. # This file is free software; the Free Software Foundation
  567. # gives unlimited permission to copy and/or distribute it,
  568. # with or without modifications, as long as this notice is preserved.
  569. # _AM_COND_IF
  570. # _AM_COND_ELSE
  571. # _AM_COND_ENDIF
  572. # --------------
  573. # These macros are only used for tracing.
  574. m4_define([_AM_COND_IF])
  575. m4_define([_AM_COND_ELSE])
  576. m4_define([_AM_COND_ENDIF])
  577. # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
  578. # ---------------------------------------
  579. # If the shell condition COND is true, execute IF-TRUE, otherwise execute
  580. # IF-FALSE. Allow automake to learn about conditional instantiating macros
  581. # (the AC_CONFIG_FOOS).
  582. AC_DEFUN([AM_COND_IF],
  583. [m4_ifndef([_AM_COND_VALUE_$1],
  584. [m4_fatal([$0: no such condition "$1"])])dnl
  585. _AM_COND_IF([$1])dnl
  586. if test -z "$$1_TRUE"; then :
  587. m4_n([$2])[]dnl
  588. m4_ifval([$3],
  589. [_AM_COND_ELSE([$1])dnl
  590. else
  591. $3
  592. ])dnl
  593. _AM_COND_ENDIF([$1])dnl
  594. fi[]dnl
  595. ])
  596. # AM_CONDITIONAL -*- Autoconf -*-
  597. # Copyright (C) 1997-2017 Free Software Foundation, Inc.
  598. #
  599. # This file is free software; the Free Software Foundation
  600. # gives unlimited permission to copy and/or distribute it,
  601. # with or without modifications, as long as this notice is preserved.
  602. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  603. # -------------------------------------
  604. # Define a conditional.
  605. AC_DEFUN([AM_CONDITIONAL],
  606. [AC_PREREQ([2.52])dnl
  607. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  608. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  609. AC_SUBST([$1_TRUE])dnl
  610. AC_SUBST([$1_FALSE])dnl
  611. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  612. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  613. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  614. if $2; then
  615. $1_TRUE=
  616. $1_FALSE='#'
  617. else
  618. $1_TRUE='#'
  619. $1_FALSE=
  620. fi
  621. AC_CONFIG_COMMANDS_PRE(
  622. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  623. AC_MSG_ERROR([[conditional "$1" was never defined.
  624. Usually this means the macro was only invoked conditionally.]])
  625. fi])])
  626. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  627. #
  628. # This file is free software; the Free Software Foundation
  629. # gives unlimited permission to copy and/or distribute it,
  630. # with or without modifications, as long as this notice is preserved.
  631. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
  632. # written in clear, in which case automake, when reading aclocal.m4,
  633. # will think it sees a *use*, and therefore will trigger all it's
  634. # C support machinery. Also note that it means that autoscan, seeing
  635. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  636. # _AM_DEPENDENCIES(NAME)
  637. # ----------------------
  638. # See how the compiler implements dependency checking.
  639. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
  640. # We try a few techniques and use that to set a single cache variable.
  641. #
  642. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  643. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  644. # dependency, and given that the user is not expected to run this macro,
  645. # just rely on AC_PROG_CC.
  646. AC_DEFUN([_AM_DEPENDENCIES],
  647. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  648. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  649. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  650. AC_REQUIRE([AM_DEP_TRACK])dnl
  651. m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
  652. [$1], [CXX], [depcc="$CXX" am_compiler_list=],
  653. [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  654. [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
  655. [$1], [UPC], [depcc="$UPC" am_compiler_list=],
  656. [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  657. [depcc="$$1" am_compiler_list=])
  658. AC_CACHE_CHECK([dependency style of $depcc],
  659. [am_cv_$1_dependencies_compiler_type],
  660. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  661. # We make a subdir and do the tests there. Otherwise we can end up
  662. # making bogus files that we don't know about and never remove. For
  663. # instance it was reported that on HP-UX the gcc test will end up
  664. # making a dummy file named 'D' -- because '-MD' means "put the output
  665. # in D".
  666. rm -rf conftest.dir
  667. mkdir conftest.dir
  668. # Copy depcomp to subdir because otherwise we won't find it if we're
  669. # using a relative directory.
  670. cp "$am_depcomp" conftest.dir
  671. cd conftest.dir
  672. # We will build objects and dependencies in a subdirectory because
  673. # it helps to detect inapplicable dependency modes. For instance
  674. # both Tru64's cc and ICC support -MD to output dependencies as a
  675. # side effect of compilation, but ICC will put the dependencies in
  676. # the current directory while Tru64 will put them in the object
  677. # directory.
  678. mkdir sub
  679. am_cv_$1_dependencies_compiler_type=none
  680. if test "$am_compiler_list" = ""; then
  681. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  682. fi
  683. am__universal=false
  684. m4_case([$1], [CC],
  685. [case " $depcc " in #(
  686. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  687. esac],
  688. [CXX],
  689. [case " $depcc " in #(
  690. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  691. esac])
  692. for depmode in $am_compiler_list; do
  693. # Setup a source with many dependencies, because some compilers
  694. # like to wrap large dependency lists on column 80 (with \), and
  695. # we should not choose a depcomp mode which is confused by this.
  696. #
  697. # We need to recreate these files for each test, as the compiler may
  698. # overwrite some of them when testing with obscure command lines.
  699. # This happens at least with the AIX C compiler.
  700. : > sub/conftest.c
  701. for i in 1 2 3 4 5 6; do
  702. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  703. # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
  704. # Solaris 10 /bin/sh.
  705. echo '/* dummy */' > sub/conftst$i.h
  706. done
  707. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  708. # We check with '-c' and '-o' for the sake of the "dashmstdout"
  709. # mode. It turns out that the SunPro C++ compiler does not properly
  710. # handle '-M -o', and we need to detect this. Also, some Intel
  711. # versions had trouble with output in subdirs.
  712. am__obj=sub/conftest.${OBJEXT-o}
  713. am__minus_obj="-o $am__obj"
  714. case $depmode in
  715. gcc)
  716. # This depmode causes a compiler race in universal mode.
  717. test "$am__universal" = false || continue
  718. ;;
  719. nosideeffect)
  720. # After this tag, mechanisms are not by side-effect, so they'll
  721. # only be used when explicitly requested.
  722. if test "x$enable_dependency_tracking" = xyes; then
  723. continue
  724. else
  725. break
  726. fi
  727. ;;
  728. msvc7 | msvc7msys | msvisualcpp | msvcmsys)
  729. # This compiler won't grok '-c -o', but also, the minuso test has
  730. # not run yet. These depmodes are late enough in the game, and
  731. # so weak that their functioning should not be impacted.
  732. am__obj=conftest.${OBJEXT-o}
  733. am__minus_obj=
  734. ;;
  735. none) break ;;
  736. esac
  737. if depmode=$depmode \
  738. source=sub/conftest.c object=$am__obj \
  739. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  740. $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
  741. >/dev/null 2>conftest.err &&
  742. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  743. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  744. grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
  745. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  746. # icc doesn't choke on unknown options, it will just issue warnings
  747. # or remarks (even with -Werror). So we grep stderr for any message
  748. # that says an option was ignored or not supported.
  749. # When given -MP, icc 7.0 and 7.1 complain thusly:
  750. # icc: Command line warning: ignoring option '-M'; no argument required
  751. # The diagnosis changed in icc 8.0:
  752. # icc: Command line remark: option '-MP' not supported
  753. if (grep 'ignoring option' conftest.err ||
  754. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  755. am_cv_$1_dependencies_compiler_type=$depmode
  756. break
  757. fi
  758. fi
  759. done
  760. cd ..
  761. rm -rf conftest.dir
  762. else
  763. am_cv_$1_dependencies_compiler_type=none
  764. fi
  765. ])
  766. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  767. AM_CONDITIONAL([am__fastdep$1], [
  768. test "x$enable_dependency_tracking" != xno \
  769. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  770. ])
  771. # AM_SET_DEPDIR
  772. # -------------
  773. # Choose a directory name for dependency files.
  774. # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
  775. AC_DEFUN([AM_SET_DEPDIR],
  776. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  777. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  778. ])
  779. # AM_DEP_TRACK
  780. # ------------
  781. AC_DEFUN([AM_DEP_TRACK],
  782. [AC_ARG_ENABLE([dependency-tracking], [dnl
  783. AS_HELP_STRING(
  784. [--enable-dependency-tracking],
  785. [do not reject slow dependency extractors])
  786. AS_HELP_STRING(
  787. [--disable-dependency-tracking],
  788. [speeds up one-time build])])
  789. if test "x$enable_dependency_tracking" != xno; then
  790. am_depcomp="$ac_aux_dir/depcomp"
  791. AMDEPBACKSLASH='\'
  792. am__nodep='_no'
  793. fi
  794. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  795. AC_SUBST([AMDEPBACKSLASH])dnl
  796. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  797. AC_SUBST([am__nodep])dnl
  798. _AM_SUBST_NOTMAKE([am__nodep])dnl
  799. ])
  800. # Generate code to set up dependency tracking. -*- Autoconf -*-
  801. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  802. #
  803. # This file is free software; the Free Software Foundation
  804. # gives unlimited permission to copy and/or distribute it,
  805. # with or without modifications, as long as this notice is preserved.
  806. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  807. # ------------------------------
  808. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  809. [{
  810. # Older Autoconf quotes --file arguments for eval, but not when files
  811. # are listed without --file. Let's play safe and only enable the eval
  812. # if we detect the quoting.
  813. case $CONFIG_FILES in
  814. *\'*) eval set x "$CONFIG_FILES" ;;
  815. *) set x $CONFIG_FILES ;;
  816. esac
  817. shift
  818. for mf
  819. do
  820. # Strip MF so we end up with the name of the file.
  821. mf=`echo "$mf" | sed -e 's/:.*$//'`
  822. # Check whether this is an Automake generated Makefile or not.
  823. # We used to match only the files named 'Makefile.in', but
  824. # some people rename them; so instead we look at the file content.
  825. # Grep'ing the first line is not enough: some people post-process
  826. # each Makefile.in and add a new line on top of each file to say so.
  827. # Grep'ing the whole file is not good either: AIX grep has a line
  828. # limit of 2048, but all sed's we know have understand at least 4000.
  829. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  830. dirpart=`AS_DIRNAME("$mf")`
  831. else
  832. continue
  833. fi
  834. # Extract the definition of DEPDIR, am__include, and am__quote
  835. # from the Makefile without running 'make'.
  836. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  837. test -z "$DEPDIR" && continue
  838. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  839. test -z "$am__include" && continue
  840. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  841. # Find all dependency output files, they are included files with
  842. # $(DEPDIR) in their names. We invoke sed twice because it is the
  843. # simplest approach to changing $(DEPDIR) to its actual value in the
  844. # expansion.
  845. for file in `sed -n "
  846. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  847. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
  848. # Make sure the directory exists.
  849. test -f "$dirpart/$file" && continue
  850. fdir=`AS_DIRNAME(["$file"])`
  851. AS_MKDIR_P([$dirpart/$fdir])
  852. # echo "creating $dirpart/$file"
  853. echo '# dummy' > "$dirpart/$file"
  854. done
  855. done
  856. }
  857. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  858. # AM_OUTPUT_DEPENDENCY_COMMANDS
  859. # -----------------------------
  860. # This macro should only be invoked once -- use via AC_REQUIRE.
  861. #
  862. # This code is only required when automatic dependency tracking
  863. # is enabled. FIXME. This creates each '.P' file that we will
  864. # need in order to bootstrap the dependency handling code.
  865. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  866. [AC_CONFIG_COMMANDS([depfiles],
  867. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  868. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  869. ])
  870. # Do all the work for Automake. -*- Autoconf -*-
  871. # Copyright (C) 1996-2017 Free Software Foundation, Inc.
  872. #
  873. # This file is free software; the Free Software Foundation
  874. # gives unlimited permission to copy and/or distribute it,
  875. # with or without modifications, as long as this notice is preserved.
  876. # This macro actually does too much. Some checks are only needed if
  877. # your package does certain things. But this isn't really a big deal.
  878. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
  879. m4_define([AC_PROG_CC],
  880. m4_defn([AC_PROG_CC])
  881. [_AM_PROG_CC_C_O
  882. ])
  883. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  884. # AM_INIT_AUTOMAKE([OPTIONS])
  885. # -----------------------------------------------
  886. # The call with PACKAGE and VERSION arguments is the old style
  887. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  888. # and VERSION should now be passed to AC_INIT and removed from
  889. # the call to AM_INIT_AUTOMAKE.
  890. # We support both call styles for the transition. After
  891. # the next Automake release, Autoconf can make the AC_INIT
  892. # arguments mandatory, and then we can depend on a new Autoconf
  893. # release and drop the old call support.
  894. AC_DEFUN([AM_INIT_AUTOMAKE],
  895. [AC_PREREQ([2.65])dnl
  896. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  897. dnl the ones we care about.
  898. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  899. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  900. AC_REQUIRE([AC_PROG_INSTALL])dnl
  901. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  902. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  903. # is not polluted with repeated "-I."
  904. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  905. # test to see if srcdir already configured
  906. if test -f $srcdir/config.status; then
  907. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  908. fi
  909. fi
  910. # test whether we have cygpath
  911. if test -z "$CYGPATH_W"; then
  912. if (cygpath --version) >/dev/null 2>/dev/null; then
  913. CYGPATH_W='cygpath -w'
  914. else
  915. CYGPATH_W=echo
  916. fi
  917. fi
  918. AC_SUBST([CYGPATH_W])
  919. # Define the identity of the package.
  920. dnl Distinguish between old-style and new-style calls.
  921. m4_ifval([$2],
  922. [AC_DIAGNOSE([obsolete],
  923. [$0: two- and three-arguments forms are deprecated.])
  924. m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  925. AC_SUBST([PACKAGE], [$1])dnl
  926. AC_SUBST([VERSION], [$2])],
  927. [_AM_SET_OPTIONS([$1])dnl
  928. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  929. m4_if(
  930. m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
  931. [ok:ok],,
  932. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  933. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  934. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  935. _AM_IF_OPTION([no-define],,
  936. [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
  937. AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
  938. # Some tools Automake needs.
  939. AC_REQUIRE([AM_SANITY_CHECK])dnl
  940. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  941. AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
  942. AM_MISSING_PROG([AUTOCONF], [autoconf])
  943. AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
  944. AM_MISSING_PROG([AUTOHEADER], [autoheader])
  945. AM_MISSING_PROG([MAKEINFO], [makeinfo])
  946. AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  947. AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
  948. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  949. # For better backward compatibility. To be removed once Automake 1.9.x
  950. # dies out for good. For more background, see:
  951. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
  952. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  953. AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
  954. # We need awk for the "check" target (and possibly the TAP driver). The
  955. # system "awk" is bad on some platforms.
  956. AC_REQUIRE([AC_PROG_AWK])dnl
  957. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  958. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  959. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  960. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  961. [_AM_PROG_TAR([v7])])])
  962. _AM_IF_OPTION([no-dependencies],,
  963. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  964. [_AM_DEPENDENCIES([CC])],
  965. [m4_define([AC_PROG_CC],
  966. m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
  967. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  968. [_AM_DEPENDENCIES([CXX])],
  969. [m4_define([AC_PROG_CXX],
  970. m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
  971. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  972. [_AM_DEPENDENCIES([OBJC])],
  973. [m4_define([AC_PROG_OBJC],
  974. m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
  975. AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
  976. [_AM_DEPENDENCIES([OBJCXX])],
  977. [m4_define([AC_PROG_OBJCXX],
  978. m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
  979. ])
  980. AC_REQUIRE([AM_SILENT_RULES])dnl
  981. dnl The testsuite driver may need to know about EXEEXT, so add the
  982. dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
  983. dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
  984. AC_CONFIG_COMMANDS_PRE(dnl
  985. [m4_provide_if([_AM_COMPILER_EXEEXT],
  986. [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  987. # POSIX will say in a future version that running "rm -f" with no argument
  988. # is OK; and we want to be able to make that assumption in our Makefile
  989. # recipes. So use an aggressive probe to check that the usage we want is
  990. # actually supported "in the wild" to an acceptable degree.
  991. # See automake bug#10828.
  992. # To make any issue more visible, cause the running configure to be aborted
  993. # by default if the 'rm' program in use doesn't match our expectations; the
  994. # user can still override this though.
  995. if rm -f && rm -fr && rm -rf; then : OK; else
  996. cat >&2 <<'END'
  997. Oops!
  998. Your 'rm' program seems unable to run without file operands specified
  999. on the command line, even when the '-f' option is present. This is contrary
  1000. to the behaviour of most rm programs out there, and not conforming with
  1001. the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
  1002. Please tell bug-automake@gnu.org about your system, including the value
  1003. of your $PATH and any error possibly output before this message. This
  1004. can help us improve future automake versions.
  1005. END
  1006. if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
  1007. echo 'Configuration will proceed anyway, since you have set the' >&2
  1008. echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
  1009. echo >&2
  1010. else
  1011. cat >&2 <<'END'
  1012. Aborting the configuration process, to ensure you take notice of the issue.
  1013. You can download and install GNU coreutils to get an 'rm' implementation
  1014. that behaves properly: <http://www.gnu.org/software/coreutils/>.
  1015. If you want to complete the configuration process using your problematic
  1016. 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
  1017. to "yes", and re-run configure.
  1018. END
  1019. AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
  1020. fi
  1021. fi
  1022. dnl The trailing newline in this macro's definition is deliberate, for
  1023. dnl backward compatibility and to allow trailing 'dnl'-style comments
  1024. dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
  1025. ])
  1026. dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
  1027. dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  1028. dnl mangled by Autoconf and run in a shell conditional statement.
  1029. m4_define([_AC_COMPILER_EXEEXT],
  1030. m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  1031. # When config.status generates a header, we must update the stamp-h file.
  1032. # This file resides in the same directory as the config header
  1033. # that is generated. The stamp files are numbered to have different names.
  1034. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  1035. # loop where config.status creates the headers, so we can generate
  1036. # our stamp files there.
  1037. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  1038. [# Compute $1's index in $config_headers.
  1039. _am_arg=$1
  1040. _am_stamp_count=1
  1041. for _am_header in $config_headers :; do
  1042. case $_am_header in
  1043. $_am_arg | $_am_arg:* )
  1044. break ;;
  1045. * )
  1046. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  1047. esac
  1048. done
  1049. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  1050. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1051. #
  1052. # This file is free software; the Free Software Foundation
  1053. # gives unlimited permission to copy and/or distribute it,
  1054. # with or without modifications, as long as this notice is preserved.
  1055. # AM_PROG_INSTALL_SH
  1056. # ------------------
  1057. # Define $install_sh.
  1058. AC_DEFUN([AM_PROG_INSTALL_SH],
  1059. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  1060. if test x"${install_sh+set}" != xset; then
  1061. case $am_aux_dir in
  1062. *\ * | *\ *)
  1063. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  1064. *)
  1065. install_sh="\${SHELL} $am_aux_dir/install-sh"
  1066. esac
  1067. fi
  1068. AC_SUBST([install_sh])])
  1069. # Copyright (C) 2003-2017 Free Software Foundation, Inc.
  1070. #
  1071. # This file is free software; the Free Software Foundation
  1072. # gives unlimited permission to copy and/or distribute it,
  1073. # with or without modifications, as long as this notice is preserved.
  1074. # Check whether the underlying file-system supports filenames
  1075. # with a leading dot. For instance MS-DOS doesn't.
  1076. AC_DEFUN([AM_SET_LEADING_DOT],
  1077. [rm -rf .tst 2>/dev/null
  1078. mkdir .tst 2>/dev/null
  1079. if test -d .tst; then
  1080. am__leading_dot=.
  1081. else
  1082. am__leading_dot=_
  1083. fi
  1084. rmdir .tst 2>/dev/null
  1085. AC_SUBST([am__leading_dot])])
  1086. # Check to see how 'make' treats includes. -*- Autoconf -*-
  1087. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1088. #
  1089. # This file is free software; the Free Software Foundation
  1090. # gives unlimited permission to copy and/or distribute it,
  1091. # with or without modifications, as long as this notice is preserved.
  1092. # AM_MAKE_INCLUDE()
  1093. # -----------------
  1094. # Check to see how make treats includes.
  1095. AC_DEFUN([AM_MAKE_INCLUDE],
  1096. [am_make=${MAKE-make}
  1097. cat > confinc << 'END'
  1098. am__doit:
  1099. @echo this is the am__doit target
  1100. .PHONY: am__doit
  1101. END
  1102. # If we don't find an include directive, just comment out the code.
  1103. AC_MSG_CHECKING([for style of include used by $am_make])
  1104. am__include="#"
  1105. am__quote=
  1106. _am_result=none
  1107. # First try GNU make style include.
  1108. echo "include confinc" > confmf
  1109. # Ignore all kinds of additional output from 'make'.
  1110. case `$am_make -s -f confmf 2> /dev/null` in #(
  1111. *the\ am__doit\ target*)
  1112. am__include=include
  1113. am__quote=
  1114. _am_result=GNU
  1115. ;;
  1116. esac
  1117. # Now try BSD make style include.
  1118. if test "$am__include" = "#"; then
  1119. echo '.include "confinc"' > confmf
  1120. case `$am_make -s -f confmf 2> /dev/null` in #(
  1121. *the\ am__doit\ target*)
  1122. am__include=.include
  1123. am__quote="\""
  1124. _am_result=BSD
  1125. ;;
  1126. esac
  1127. fi
  1128. AC_SUBST([am__include])
  1129. AC_SUBST([am__quote])
  1130. AC_MSG_RESULT([$_am_result])
  1131. rm -f confinc confmf
  1132. ])
  1133. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  1134. # Copyright (C) 1997-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_MISSING_PROG(NAME, PROGRAM)
  1140. # ------------------------------
  1141. AC_DEFUN([AM_MISSING_PROG],
  1142. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  1143. $1=${$1-"${am_missing_run}$2"}
  1144. AC_SUBST($1)])
  1145. # AM_MISSING_HAS_RUN
  1146. # ------------------
  1147. # Define MISSING if not defined so far and test if it is modern enough.
  1148. # If it is, set am_missing_run to use it, otherwise, to nothing.
  1149. AC_DEFUN([AM_MISSING_HAS_RUN],
  1150. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  1151. AC_REQUIRE_AUX_FILE([missing])dnl
  1152. if test x"${MISSING+set}" != xset; then
  1153. case $am_aux_dir in
  1154. *\ * | *\ *)
  1155. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  1156. *)
  1157. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  1158. esac
  1159. fi
  1160. # Use eval to expand $SHELL
  1161. if eval "$MISSING --is-lightweight"; then
  1162. am_missing_run="$MISSING "
  1163. else
  1164. am_missing_run=
  1165. AC_MSG_WARN(['missing' script is too old or missing])
  1166. fi
  1167. ])
  1168. # Helper functions for option handling. -*- Autoconf -*-
  1169. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1170. #
  1171. # This file is free software; the Free Software Foundation
  1172. # gives unlimited permission to copy and/or distribute it,
  1173. # with or without modifications, as long as this notice is preserved.
  1174. # _AM_MANGLE_OPTION(NAME)
  1175. # -----------------------
  1176. AC_DEFUN([_AM_MANGLE_OPTION],
  1177. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  1178. # _AM_SET_OPTION(NAME)
  1179. # --------------------
  1180. # Set option NAME. Presently that only means defining a flag for this option.
  1181. AC_DEFUN([_AM_SET_OPTION],
  1182. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  1183. # _AM_SET_OPTIONS(OPTIONS)
  1184. # ------------------------
  1185. # OPTIONS is a space-separated list of Automake options.
  1186. AC_DEFUN([_AM_SET_OPTIONS],
  1187. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  1188. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  1189. # -------------------------------------------
  1190. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  1191. AC_DEFUN([_AM_IF_OPTION],
  1192. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  1193. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  1194. #
  1195. # This file is free software; the Free Software Foundation
  1196. # gives unlimited permission to copy and/or distribute it,
  1197. # with or without modifications, as long as this notice is preserved.
  1198. # _AM_PROG_CC_C_O
  1199. # ---------------
  1200. # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
  1201. # to automatically call this.
  1202. AC_DEFUN([_AM_PROG_CC_C_O],
  1203. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  1204. AC_REQUIRE_AUX_FILE([compile])dnl
  1205. AC_LANG_PUSH([C])dnl
  1206. AC_CACHE_CHECK(
  1207. [whether $CC understands -c and -o together],
  1208. [am_cv_prog_cc_c_o],
  1209. [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
  1210. # Make sure it works both with $CC and with simple cc.
  1211. # Following AC_PROG_CC_C_O, we do the test twice because some
  1212. # compilers refuse to overwrite an existing .o file with -o,
  1213. # though they will create one.
  1214. am_cv_prog_cc_c_o=yes
  1215. for am_i in 1 2; do
  1216. if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
  1217. && test -f conftest2.$ac_objext; then
  1218. : OK
  1219. else
  1220. am_cv_prog_cc_c_o=no
  1221. break
  1222. fi
  1223. done
  1224. rm -f core conftest*
  1225. unset am_i])
  1226. if test "$am_cv_prog_cc_c_o" != yes; then
  1227. # Losing compiler, so override with the script.
  1228. # FIXME: It is wrong to rewrite CC.
  1229. # But if we don't then we get into trouble of one sort or another.
  1230. # A longer-term fix would be to have automake use am__CC in this case,
  1231. # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
  1232. CC="$am_aux_dir/compile $CC"
  1233. fi
  1234. AC_LANG_POP([C])])
  1235. # For backward compatibility.
  1236. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
  1237. # Copyright (C) 1999-2017 Free Software Foundation, Inc.
  1238. #
  1239. # This file is free software; the Free Software Foundation
  1240. # gives unlimited permission to copy and/or distribute it,
  1241. # with or without modifications, as long as this notice is preserved.
  1242. # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  1243. # ---------------------------------------------------------------------------
  1244. # Adds support for distributing Python modules and packages. To
  1245. # install modules, copy them to $(pythondir), using the python_PYTHON
  1246. # automake variable. To install a package with the same name as the
  1247. # automake package, install to $(pkgpythondir), or use the
  1248. # pkgpython_PYTHON automake variable.
  1249. #
  1250. # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
  1251. # locations to install python extension modules (shared libraries).
  1252. # Another macro is required to find the appropriate flags to compile
  1253. # extension modules.
  1254. #
  1255. # If your package is configured with a different prefix to python,
  1256. # users will have to add the install directory to the PYTHONPATH
  1257. # environment variable, or create a .pth file (see the python
  1258. # documentation for details).
  1259. #
  1260. # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
  1261. # cause an error if the version of python installed on the system
  1262. # doesn't meet the requirement. MINIMUM-VERSION should consist of
  1263. # numbers and dots only.
  1264. AC_DEFUN([AM_PATH_PYTHON],
  1265. [
  1266. dnl Find a Python interpreter. Python versions prior to 2.0 are not
  1267. dnl supported. (2.0 was released on October 16, 2000).
  1268. dnl FIXME: Remove the need to hard-code Python versions here.
  1269. m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
  1270. [python python2 python3 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 dnl
  1271. python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
  1272. AC_ARG_VAR([PYTHON], [the Python interpreter])
  1273. m4_if([$1],[],[
  1274. dnl No version check is needed.
  1275. # Find any Python interpreter.
  1276. if test -z "$PYTHON"; then
  1277. AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
  1278. fi
  1279. am_display_PYTHON=python
  1280. ], [
  1281. dnl A version check is needed.
  1282. if test -n "$PYTHON"; then
  1283. # If the user set $PYTHON, use it and don't search something else.
  1284. AC_MSG_CHECKING([whether $PYTHON version is >= $1])
  1285. AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
  1286. [AC_MSG_RESULT([yes])],
  1287. [AC_MSG_RESULT([no])
  1288. AC_MSG_ERROR([Python interpreter is too old])])
  1289. am_display_PYTHON=$PYTHON
  1290. else
  1291. # Otherwise, try each interpreter until we find one that satisfies
  1292. # VERSION.
  1293. AC_CACHE_CHECK([for a Python interpreter with version >= $1],
  1294. [am_cv_pathless_PYTHON],[
  1295. for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
  1296. test "$am_cv_pathless_PYTHON" = none && break
  1297. AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
  1298. done])
  1299. # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
  1300. if test "$am_cv_pathless_PYTHON" = none; then
  1301. PYTHON=:
  1302. else
  1303. AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
  1304. fi
  1305. am_display_PYTHON=$am_cv_pathless_PYTHON
  1306. fi
  1307. ])
  1308. if test "$PYTHON" = :; then
  1309. dnl Run any user-specified action, or abort.
  1310. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
  1311. else
  1312. dnl Query Python for its version number. Getting [:3] seems to be
  1313. dnl the best way to do this; it's what "site.py" does in the standard
  1314. dnl library.
  1315. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
  1316. [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
  1317. AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
  1318. dnl Use the values of $prefix and $exec_prefix for the corresponding
  1319. dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
  1320. dnl distinct variables so they can be overridden if need be. However,
  1321. dnl general consensus is that you shouldn't need this ability.
  1322. AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
  1323. AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
  1324. dnl At times (like when building shared libraries) you may want
  1325. dnl to know which OS platform Python thinks this is.
  1326. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
  1327. [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
  1328. AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
  1329. # Just factor out some code duplication.
  1330. am_python_setup_sysconfig="\
  1331. import sys
  1332. # Prefer sysconfig over distutils.sysconfig, for better compatibility
  1333. # with python 3.x. See automake bug#10227.
  1334. try:
  1335. import sysconfig
  1336. except ImportError:
  1337. can_use_sysconfig = 0
  1338. else:
  1339. can_use_sysconfig = 1
  1340. # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
  1341. # <https://github.com/pypa/virtualenv/issues/118>
  1342. try:
  1343. from platform import python_implementation
  1344. if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
  1345. can_use_sysconfig = 0
  1346. except ImportError:
  1347. pass"
  1348. dnl Set up 4 directories:
  1349. dnl pythondir -- where to install python scripts. This is the
  1350. dnl site-packages directory, not the python standard library
  1351. dnl directory like in previous automake betas. This behavior
  1352. dnl is more consistent with lispdir.m4 for example.
  1353. dnl Query distutils for this directory.
  1354. AC_CACHE_CHECK([for $am_display_PYTHON script directory],
  1355. [am_cv_python_pythondir],
  1356. [if test "x$prefix" = xNONE
  1357. then
  1358. am_py_prefix=$ac_default_prefix
  1359. else
  1360. am_py_prefix=$prefix
  1361. fi
  1362. am_cv_python_pythondir=`$PYTHON -c "
  1363. $am_python_setup_sysconfig
  1364. if can_use_sysconfig:
  1365. sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
  1366. else:
  1367. from distutils import sysconfig
  1368. sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
  1369. sys.stdout.write(sitedir)"`
  1370. case $am_cv_python_pythondir in
  1371. $am_py_prefix*)
  1372. am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
  1373. am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
  1374. ;;
  1375. *)
  1376. case $am_py_prefix in
  1377. /usr|/System*) ;;
  1378. *)
  1379. am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
  1380. ;;
  1381. esac
  1382. ;;
  1383. esac
  1384. ])
  1385. AC_SUBST([pythondir], [$am_cv_python_pythondir])
  1386. dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
  1387. dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
  1388. dnl more consistent with the rest of automake.
  1389. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
  1390. dnl pyexecdir -- directory for installing python extension modules
  1391. dnl (shared libraries)
  1392. dnl Query distutils for this directory.
  1393. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
  1394. [am_cv_python_pyexecdir],
  1395. [if test "x$exec_prefix" = xNONE
  1396. then
  1397. am_py_exec_prefix=$am_py_prefix
  1398. else
  1399. am_py_exec_prefix=$exec_prefix
  1400. fi
  1401. am_cv_python_pyexecdir=`$PYTHON -c "
  1402. $am_python_setup_sysconfig
  1403. if can_use_sysconfig:
  1404. sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
  1405. else:
  1406. from distutils import sysconfig
  1407. sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
  1408. sys.stdout.write(sitedir)"`
  1409. case $am_cv_python_pyexecdir in
  1410. $am_py_exec_prefix*)
  1411. am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
  1412. am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
  1413. ;;
  1414. *)
  1415. case $am_py_exec_prefix in
  1416. /usr|/System*) ;;
  1417. *)
  1418. am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
  1419. ;;
  1420. esac
  1421. ;;
  1422. esac
  1423. ])
  1424. AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
  1425. dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
  1426. AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
  1427. dnl Run any user-specified action.
  1428. $2
  1429. fi
  1430. ])
  1431. # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1432. # ---------------------------------------------------------------------------
  1433. # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
  1434. # Run ACTION-IF-FALSE otherwise.
  1435. # This test uses sys.hexversion instead of the string equivalent (first
  1436. # word of sys.version), in order to cope with versions such as 2.2c1.
  1437. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
  1438. AC_DEFUN([AM_PYTHON_CHECK_VERSION],
  1439. [prog="import sys
  1440. # split strings by '.' and convert to numeric. Append some zeros
  1441. # because we need at least 4 digits for the hex conversion.
  1442. # map returns an iterator in Python 3.0 and a list in 2.x
  1443. minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
  1444. minverhex = 0
  1445. # xrange is not present in Python 3.0 and range returns an iterator
  1446. for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
  1447. sys.exit(sys.hexversion < minverhex)"
  1448. AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
  1449. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1450. #
  1451. # This file is free software; the Free Software Foundation
  1452. # gives unlimited permission to copy and/or distribute it,
  1453. # with or without modifications, as long as this notice is preserved.
  1454. # AM_RUN_LOG(COMMAND)
  1455. # -------------------
  1456. # Run COMMAND, save the exit status in ac_status, and log it.
  1457. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
  1458. AC_DEFUN([AM_RUN_LOG],
  1459. [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
  1460. ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
  1461. ac_status=$?
  1462. echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  1463. (exit $ac_status); }])
  1464. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  1465. # Copyright (C) 1996-2017 Free Software Foundation, Inc.
  1466. #
  1467. # This file is free software; the Free Software Foundation
  1468. # gives unlimited permission to copy and/or distribute it,
  1469. # with or without modifications, as long as this notice is preserved.
  1470. # AM_SANITY_CHECK
  1471. # ---------------
  1472. AC_DEFUN([AM_SANITY_CHECK],
  1473. [AC_MSG_CHECKING([whether build environment is sane])
  1474. # Reject unsafe characters in $srcdir or the absolute working directory
  1475. # name. Accept space and tab only in the latter.
  1476. am_lf='
  1477. '
  1478. case `pwd` in
  1479. *[[\\\"\#\$\&\'\`$am_lf]]*)
  1480. AC_MSG_ERROR([unsafe absolute working directory name]);;
  1481. esac
  1482. case $srcdir in
  1483. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  1484. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  1485. esac
  1486. # Do 'set' in a subshell so we don't clobber the current shell's
  1487. # arguments. Must try -L first in case configure is actually a
  1488. # symlink; some systems play weird games with the mod time of symlinks
  1489. # (eg FreeBSD returns the mod time of the symlink's containing
  1490. # directory).
  1491. if (
  1492. am_has_slept=no
  1493. for am_try in 1 2; do
  1494. echo "timestamp, slept: $am_has_slept" > conftest.file
  1495. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  1496. if test "$[*]" = "X"; then
  1497. # -L didn't work.
  1498. set X `ls -t "$srcdir/configure" conftest.file`
  1499. fi
  1500. if test "$[*]" != "X $srcdir/configure conftest.file" \
  1501. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  1502. # If neither matched, then we have a broken ls. This can happen
  1503. # if, for instance, CONFIG_SHELL is bash and it inherits a
  1504. # broken ls alias from the environment. This has actually
  1505. # happened. Such a system could not be considered "sane".
  1506. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  1507. alias in your environment])
  1508. fi
  1509. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  1510. break
  1511. fi
  1512. # Just in case.
  1513. sleep 1
  1514. am_has_slept=yes
  1515. done
  1516. test "$[2]" = conftest.file
  1517. )
  1518. then
  1519. # Ok.
  1520. :
  1521. else
  1522. AC_MSG_ERROR([newly created file is older than distributed files!
  1523. Check your system clock])
  1524. fi
  1525. AC_MSG_RESULT([yes])
  1526. # If we didn't sleep, we still need to ensure time stamps of config.status and
  1527. # generated files are strictly newer.
  1528. am_sleep_pid=
  1529. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  1530. ( sleep 1 ) &
  1531. am_sleep_pid=$!
  1532. fi
  1533. AC_CONFIG_COMMANDS_PRE(
  1534. [AC_MSG_CHECKING([that generated files are newer than configure])
  1535. if test -n "$am_sleep_pid"; then
  1536. # Hide warnings about reused PIDs.
  1537. wait $am_sleep_pid 2>/dev/null
  1538. fi
  1539. AC_MSG_RESULT([done])])
  1540. rm -f conftest.file
  1541. ])
  1542. # Copyright (C) 2009-2017 Free Software Foundation, Inc.
  1543. #
  1544. # This file is free software; the Free Software Foundation
  1545. # gives unlimited permission to copy and/or distribute it,
  1546. # with or without modifications, as long as this notice is preserved.
  1547. # AM_SILENT_RULES([DEFAULT])
  1548. # --------------------------
  1549. # Enable less verbose build rules; with the default set to DEFAULT
  1550. # ("yes" being less verbose, "no" or empty being verbose).
  1551. AC_DEFUN([AM_SILENT_RULES],
  1552. [AC_ARG_ENABLE([silent-rules], [dnl
  1553. AS_HELP_STRING(
  1554. [--enable-silent-rules],
  1555. [less verbose build output (undo: "make V=1")])
  1556. AS_HELP_STRING(
  1557. [--disable-silent-rules],
  1558. [verbose build output (undo: "make V=0")])dnl
  1559. ])
  1560. case $enable_silent_rules in @%:@ (((
  1561. yes) AM_DEFAULT_VERBOSITY=0;;
  1562. no) AM_DEFAULT_VERBOSITY=1;;
  1563. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  1564. esac
  1565. dnl
  1566. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  1567. dnl do not support nested variable expansions.
  1568. dnl See automake bug#9928 and bug#10237.
  1569. am_make=${MAKE-make}
  1570. AC_CACHE_CHECK([whether $am_make supports nested variables],
  1571. [am_cv_make_support_nested_variables],
  1572. [if AS_ECHO([['TRUE=$(BAR$(V))
  1573. BAR0=false
  1574. BAR1=true
  1575. V=1
  1576. am__doit:
  1577. @$(TRUE)
  1578. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  1579. am_cv_make_support_nested_variables=yes
  1580. else
  1581. am_cv_make_support_nested_variables=no
  1582. fi])
  1583. if test $am_cv_make_support_nested_variables = yes; then
  1584. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  1585. AM_V='$(V)'
  1586. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  1587. else
  1588. AM_V=$AM_DEFAULT_VERBOSITY
  1589. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  1590. fi
  1591. AC_SUBST([AM_V])dnl
  1592. AM_SUBST_NOTMAKE([AM_V])dnl
  1593. AC_SUBST([AM_DEFAULT_V])dnl
  1594. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  1595. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  1596. AM_BACKSLASH='\'
  1597. AC_SUBST([AM_BACKSLASH])dnl
  1598. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  1599. ])
  1600. # Copyright (C) 2001-2017 Free Software Foundation, Inc.
  1601. #
  1602. # This file is free software; the Free Software Foundation
  1603. # gives unlimited permission to copy and/or distribute it,
  1604. # with or without modifications, as long as this notice is preserved.
  1605. # AM_PROG_INSTALL_STRIP
  1606. # ---------------------
  1607. # One issue with vendor 'install' (even GNU) is that you can't
  1608. # specify the program used to strip binaries. This is especially
  1609. # annoying in cross-compiling environments, where the build's strip
  1610. # is unlikely to handle the host's binaries.
  1611. # Fortunately install-sh will honor a STRIPPROG variable, so we
  1612. # always use install-sh in "make install-strip", and initialize
  1613. # STRIPPROG with the value of the STRIP variable (set by the user).
  1614. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  1615. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  1616. # Installed binaries are usually stripped using 'strip' when the user
  1617. # run "make install-strip". However 'strip' might not be the right
  1618. # tool to use in cross-compilation environments, therefore Automake
  1619. # will honor the 'STRIP' environment variable to overrule this program.
  1620. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  1621. if test "$cross_compiling" != no; then
  1622. AC_CHECK_TOOL([STRIP], [strip], :)
  1623. fi
  1624. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  1625. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  1626. # Copyright (C) 2006-2017 Free Software Foundation, Inc.
  1627. #
  1628. # This file is free software; the Free Software Foundation
  1629. # gives unlimited permission to copy and/or distribute it,
  1630. # with or without modifications, as long as this notice is preserved.
  1631. # _AM_SUBST_NOTMAKE(VARIABLE)
  1632. # ---------------------------
  1633. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1634. # This macro is traced by Automake.
  1635. AC_DEFUN([_AM_SUBST_NOTMAKE])
  1636. # AM_SUBST_NOTMAKE(VARIABLE)
  1637. # --------------------------
  1638. # Public sister of _AM_SUBST_NOTMAKE.
  1639. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1640. # Check how to create a tarball. -*- Autoconf -*-
  1641. # Copyright (C) 2004-2017 Free Software Foundation, Inc.
  1642. #
  1643. # This file is free software; the Free Software Foundation
  1644. # gives unlimited permission to copy and/or distribute it,
  1645. # with or without modifications, as long as this notice is preserved.
  1646. # _AM_PROG_TAR(FORMAT)
  1647. # --------------------
  1648. # Check how to create a tarball in format FORMAT.
  1649. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  1650. #
  1651. # Substitute a variable $(am__tar) that is a command
  1652. # writing to stdout a FORMAT-tarball containing the directory
  1653. # $tardir.
  1654. # tardir=directory && $(am__tar) > result.tar
  1655. #
  1656. # Substitute a variable $(am__untar) that extract such
  1657. # a tarball read from stdin.
  1658. # $(am__untar) < result.tar
  1659. #
  1660. AC_DEFUN([_AM_PROG_TAR],
  1661. [# Always define AMTAR for backward compatibility. Yes, it's still used
  1662. # in the wild :-( We should find a proper way to deprecate it ...
  1663. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  1664. # We'll loop over all known methods to create a tar archive until one works.
  1665. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1666. m4_if([$1], [v7],
  1667. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  1668. [m4_case([$1],
  1669. [ustar],
  1670. [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
  1671. # There is notably a 21 bits limit for the UID and the GID. In fact,
  1672. # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
  1673. # and bug#13588).
  1674. am_max_uid=2097151 # 2^21 - 1
  1675. am_max_gid=$am_max_uid
  1676. # The $UID and $GID variables are not portable, so we need to resort
  1677. # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
  1678. # below are definitely unexpected, so allow the users to see them
  1679. # (that is, avoid stderr redirection).
  1680. am_uid=`id -u || echo unknown`
  1681. am_gid=`id -g || echo unknown`
  1682. AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
  1683. if test $am_uid -le $am_max_uid; then
  1684. AC_MSG_RESULT([yes])
  1685. else
  1686. AC_MSG_RESULT([no])
  1687. _am_tools=none
  1688. fi
  1689. AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
  1690. if test $am_gid -le $am_max_gid; then
  1691. AC_MSG_RESULT([yes])
  1692. else
  1693. AC_MSG_RESULT([no])
  1694. _am_tools=none
  1695. fi],
  1696. [pax],
  1697. [],
  1698. [m4_fatal([Unknown tar format])])
  1699. AC_MSG_CHECKING([how to create a $1 tar archive])
  1700. # Go ahead even if we have the value already cached. We do so because we
  1701. # need to set the values for the 'am__tar' and 'am__untar' variables.
  1702. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1703. for _am_tool in $_am_tools; do
  1704. case $_am_tool in
  1705. gnutar)
  1706. for _am_tar in tar gnutar gtar; do
  1707. AM_RUN_LOG([$_am_tar --version]) && break
  1708. done
  1709. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  1710. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  1711. am__untar="$_am_tar -xf -"
  1712. ;;
  1713. plaintar)
  1714. # Must skip GNU tar: if it does not support --format= it doesn't create
  1715. # ustar tarball either.
  1716. (tar --version) >/dev/null 2>&1 && continue
  1717. am__tar='tar chf - "$$tardir"'
  1718. am__tar_='tar chf - "$tardir"'
  1719. am__untar='tar xf -'
  1720. ;;
  1721. pax)
  1722. am__tar='pax -L -x $1 -w "$$tardir"'
  1723. am__tar_='pax -L -x $1 -w "$tardir"'
  1724. am__untar='pax -r'
  1725. ;;
  1726. cpio)
  1727. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  1728. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  1729. am__untar='cpio -i -H $1 -d'
  1730. ;;
  1731. none)
  1732. am__tar=false
  1733. am__tar_=false
  1734. am__untar=false
  1735. ;;
  1736. esac
  1737. # If the value was cached, stop now. We just wanted to have am__tar
  1738. # and am__untar set.
  1739. test -n "${am_cv_prog_tar_$1}" && break
  1740. # tar/untar a dummy directory, and stop if the command works.
  1741. rm -rf conftest.dir
  1742. mkdir conftest.dir
  1743. echo GrepMe > conftest.dir/file
  1744. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  1745. rm -rf conftest.dir
  1746. if test -s conftest.tar; then
  1747. AM_RUN_LOG([$am__untar <conftest.tar])
  1748. AM_RUN_LOG([cat conftest.dir/file])
  1749. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  1750. fi
  1751. done
  1752. rm -rf conftest.dir
  1753. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1754. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1755. AC_SUBST([am__tar])
  1756. AC_SUBST([am__untar])
  1757. ]) # _AM_PROG_TAR
  1758. m4_include([m4/config/libtool.m4])
  1759. m4_include([m4/config/ltoptions.m4])
  1760. m4_include([m4/config/ltsugar.m4])
  1761. m4_include([m4/config/ltversion.m4])
  1762. m4_include([m4/config/lt~obsolete.m4])