status.m4 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782
  1. # This file is part of Autoconf. -*- Autoconf -*-
  2. # Parameterizing and creating config.status.
  3. # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
  4. # This file is part of Autoconf. This program is free
  5. # software; you can redistribute it and/or modify it under the
  6. # terms of the GNU General Public License as published by the
  7. # Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # Under Section 7 of GPL version 3, you are granted additional
  16. # permissions described in the Autoconf Configure Script Exception,
  17. # version 3.0, as published by the Free Software Foundation.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # and a copy of the Autoconf Configure Script Exception along with
  21. # this program; see the files COPYINGv3 and COPYING.EXCEPTION
  22. # respectively. If not, see <http://www.gnu.org/licenses/>.
  23. # Written by David MacKenzie, with help from
  24. # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
  25. # Roland McGrath, Noah Friedman, david d zuhn, and many others.
  26. # This file handles about all the preparation aspects for
  27. # `config.status': registering the configuration files, the headers,
  28. # the links, and the commands `config.status' will run. There is a
  29. # little mixture though of things actually handled by `configure',
  30. # such as running the `configure' in the sub directories. Minor
  31. # detail.
  32. #
  33. # There are two kinds of commands:
  34. #
  35. # COMMANDS:
  36. #
  37. # They are output into `config.status' via a quoted here doc. These
  38. # commands are always associated to a tag which the user can use to
  39. # tell `config.status' what are the commands she wants to run.
  40. #
  41. # INIT-CMDS:
  42. #
  43. # They are output via an *unquoted* here-doc. As a consequence $var
  44. # will be output as the value of VAR. This is typically used by
  45. # `configure' to give `config.status' some variables it needs to run
  46. # the COMMANDS. At the difference of COMMANDS, the INIT-CMDS are
  47. # always run.
  48. #
  49. #
  50. # Honorable members of this family are AC_CONFIG_FILES,
  51. # AC_CONFIG_HEADERS, AC_CONFIG_LINKS and AC_CONFIG_COMMANDS. Bad boys
  52. # are AC_LINK_FILES, AC_OUTPUT_COMMANDS and AC_OUTPUT when used with
  53. # arguments. False members are AC_CONFIG_SRCDIR, AC_CONFIG_SUBDIRS
  54. # and AC_CONFIG_AUX_DIR. Cousins are AC_CONFIG_COMMANDS_PRE and
  55. # AC_CONFIG_COMMANDS_POST.
  56. ## ------------------ ##
  57. ## Auxiliary macros. ##
  58. ## ------------------ ##
  59. # _AC_SRCDIRS(BUILD-DIR-NAME)
  60. # ---------------------------
  61. # Inputs:
  62. # - BUILD-DIR-NAME is `top-build -> build' and `top-src -> src'
  63. # - `$srcdir' is `top-build -> top-src'
  64. #
  65. # Outputs:
  66. # - `ac_builddir' is `.', for symmetry only.
  67. # - `ac_top_builddir_sub' is `build -> top_build'.
  68. # This is used for @top_builddir@.
  69. # - `ac_top_build_prefix' is `build -> top_build'.
  70. # If not empty, has a trailing slash.
  71. # - `ac_srcdir' is `build -> src'.
  72. # - `ac_top_srcdir' is `build -> top-src'.
  73. # and `ac_abs_builddir' etc., the absolute directory names.
  74. m4_define([_AC_SRCDIRS],
  75. [ac_builddir=.
  76. case $1 in
  77. .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
  78. *)
  79. ac_dir_suffix=/`AS_ECHO([$1]) | sed 's|^\.[[\\/]]||'`
  80. # A ".." for each directory in $ac_dir_suffix.
  81. ac_top_builddir_sub=`AS_ECHO(["$ac_dir_suffix"]) | sed 's|/[[^\\/]]*|/..|g;s|/||'`
  82. case $ac_top_builddir_sub in
  83. "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
  84. *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
  85. esac ;;
  86. esac
  87. ac_abs_top_builddir=$ac_pwd
  88. ac_abs_builddir=$ac_pwd$ac_dir_suffix
  89. # for backward compatibility:
  90. ac_top_builddir=$ac_top_build_prefix
  91. case $srcdir in
  92. .) # We are building in place.
  93. ac_srcdir=.
  94. ac_top_srcdir=$ac_top_builddir_sub
  95. ac_abs_top_srcdir=$ac_pwd ;;
  96. [[\\/]]* | ?:[[\\/]]* ) # Absolute name.
  97. ac_srcdir=$srcdir$ac_dir_suffix;
  98. ac_top_srcdir=$srcdir
  99. ac_abs_top_srcdir=$srcdir ;;
  100. *) # Relative name.
  101. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
  102. ac_top_srcdir=$ac_top_build_prefix$srcdir
  103. ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
  104. esac
  105. ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
  106. ])# _AC_SRCDIRS
  107. # _AC_HAVE_TOP_BUILD_PREFIX
  108. # -------------------------
  109. # Announce to the world (to Libtool) that we substitute @top_build_prefix@.
  110. AC_DEFUN([_AC_HAVE_TOP_BUILD_PREFIX])
  111. ## ---------------------- ##
  112. ## Registering the tags. ##
  113. ## ---------------------- ##
  114. # _AC_CONFIG_COMMANDS_INIT([INIT-COMMANDS])
  115. # -----------------------------------------
  116. #
  117. # Register INIT-COMMANDS as command pasted *unquoted* in
  118. # `config.status'. This is typically used to pass variables from
  119. # `configure' to `config.status'. Note that $[1] is not over quoted as
  120. # was the case in AC_OUTPUT_COMMANDS.
  121. m4_define([_AC_CONFIG_COMMANDS_INIT],
  122. [m4_ifval([$1],
  123. [m4_append([_AC_OUTPUT_COMMANDS_INIT],
  124. [$1
  125. ])])])
  126. # AC_FILE_DEPENDENCY_TRACE(DEST, SOURCE1, [SOURCE2...])
  127. # -----------------------------------------------------
  128. # This macro does nothing, it's a hook to be read with `autoconf --trace'.
  129. #
  130. # It announces DEST depends upon the SOURCE1 etc.
  131. m4_define([AC_FILE_DEPENDENCY_TRACE], [])
  132. # _AC_FILE_DEPENDENCY_TRACE_COLON(DEST:SOURCE1[:SOURCE2...])
  133. # ----------------------------------------------------------
  134. # Declare that DEST depends upon SOURCE1 etc.
  135. #
  136. m4_define([_AC_FILE_DEPENDENCY_TRACE_COLON],
  137. [AC_FILE_DEPENDENCY_TRACE(m4_translit([$1], [:], [,]))])
  138. # _AC_CONFIG_DEPENDENCY(MODE, DEST[:SOURCE1...])
  139. # ----------------------------------------------
  140. # MODE is `FILES', `HEADERS', or `LINKS'.
  141. #
  142. # Be sure that a missing dependency is expressed as a dependency upon
  143. # `DEST.in' (except with config links).
  144. #
  145. m4_define([_AC_CONFIG_DEPENDENCY],
  146. [_AC_FILE_DEPENDENCY_TRACE_COLON([$2]_AC_CONFIG_DEPENDENCY_DEFAULT($@))dnl
  147. ])
  148. # _AC_CONFIG_DEPENDENCY_DEFAULT(MODE, DEST[:SOURCE1...])
  149. # ------------------------------------------------------
  150. # Expand to `:DEST.in' if appropriate, or to empty string otherwise.
  151. #
  152. # More detailed description:
  153. # If the tag contains `:', expand to nothing.
  154. # Otherwise, for a config file or header, add `:DEST.in'.
  155. # For a config link, DEST.in is not appropriate:
  156. # - if the tag is literal, complain.
  157. # - otherwise, just expand to nothing and proceed with fingers crossed.
  158. # (We get to this case from the obsolete AC_LINK_FILES, for example.)
  159. #
  160. m4_define([_AC_CONFIG_DEPENDENCY_DEFAULT],
  161. [m4_if(m4_index([$2], [:]), [-1],
  162. [m4_if([$1], [LINKS],
  163. [AS_LITERAL_IF([$2],
  164. [m4_fatal([Invalid AC_CONFIG_LINKS tag: `$2'])])],
  165. [:$2.in])])])
  166. # _AC_CONFIG_UNIQUE(MODE, DEST)
  167. # -----------------------------
  168. # MODE is `FILES', `HEADERS', `LINKS', `COMMANDS', or `SUBDIRS'.
  169. #
  170. # Verify that there is no double definition of an output file.
  171. #
  172. m4_define([_AC_CONFIG_UNIQUE],
  173. [m4_ifdef([_AC_SEEN_TAG($2)],
  174. [m4_fatal([`$2' is already registered with AC_CONFIG_]m4_defn(
  175. [_AC_SEEN_TAG($2)]).)],
  176. [m4_define([_AC_SEEN_TAG($2)], [$1])])dnl
  177. ])
  178. # _AC_CONFIG_FOOS(MODE, TAGS..., [COMMANDS], [INIT-CMDS])
  179. # -------------------------------------------------------
  180. # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
  181. #
  182. # Associate the COMMANDS to each TAG, i.e., when config.status creates TAG,
  183. # run COMMANDS afterwards. (This is done in _AC_CONFIG_REGISTER_DEST.)
  184. #
  185. # For COMMANDS, do not m4_normalize TAGS before adding it to ac_config_commands.
  186. # This historical difference allows macro calls in TAGS.
  187. #
  188. m4_define([_AC_CONFIG_FOOS],
  189. [m4_map_args_w([$2], [_AC_CONFIG_REGISTER([$1],], [, [$3])])]dnl
  190. [m4_define([_AC_SEEN_CONFIG(ANY)])]dnl
  191. [m4_define([_AC_SEEN_CONFIG($1)])]dnl
  192. [_AC_CONFIG_COMMANDS_INIT([$4])]dnl
  193. [ac_config_[]m4_tolower([$1])="$ac_config_[]m4_tolower([$1]) ]dnl
  194. [m4_if([$1], [COMMANDS], [$2], [m4_normalize([$2])])"
  195. ])
  196. # _AC_CONFIG_COMPUTE_DEST(STRING)
  197. # -------------------------------
  198. # Compute the DEST from STRING by stripping any : and following
  199. # characters. Guarantee a match in m4_index, so as to avoid a bug
  200. # with precision -1 in m4_format in older m4.
  201. m4_define([_AC_CONFIG_COMPUTE_DEST],
  202. [m4_format([[%.*s]], m4_index([$1:], [:]), [$1])])
  203. # _AC_CONFIG_REGISTER(MODE, TAG, [COMMANDS])
  204. # ------------------------------------------
  205. # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
  206. #
  207. m4_define([_AC_CONFIG_REGISTER],
  208. [m4_if([$1], [COMMANDS],
  209. [],
  210. [_AC_CONFIG_DEPENDENCY([$1], [$2])])]dnl
  211. [_AC_CONFIG_REGISTER_DEST([$1], [$2],
  212. _AC_CONFIG_COMPUTE_DEST([$2]), [$3])])
  213. # _AC_CONFIG_REGISTER_DEST(MODE, TAG, DEST, [COMMANDS])
  214. # -----------------------------------------------------
  215. # MODE is `FILES', `HEADERS', `LINKS', or `COMMANDS'.
  216. # TAG is in the form DEST[:SOURCE...].
  217. # Thus parameter $3 is the first part of $2.
  218. #
  219. # With CONFIG_LINKS, reject DEST=., because it is makes it hard for ./config.status
  220. # to guess the links to establish (`./config.status .').
  221. #
  222. # Save the name of the first config header to AH_HEADER.
  223. #
  224. m4_define([_AC_CONFIG_REGISTER_DEST],
  225. [_AC_CONFIG_UNIQUE([$1], [$3])]dnl
  226. [m4_if([$1 $3], [LINKS .],
  227. [m4_fatal([invalid destination of a config link: `.'])],
  228. [$1], [HEADERS],
  229. [m4_define_default([AH_HEADER], [$3])])]dnl
  230. dnl
  231. dnl Recognize TAG as an argument to config.status:
  232. dnl
  233. [m4_append([_AC_LIST_TAGS],
  234. [ "$3") CONFIG_$1="$CONFIG_$1 $2" ;;
  235. ])]dnl
  236. dnl
  237. dnl Register the associated commands, if any:
  238. dnl
  239. [m4_ifval([$4],
  240. [m4_append([_AC_LIST_TAG_COMMANDS],
  241. [ "$3":]m4_format([[%.1s]], [$1])[) $4 ;;
  242. ])])])# _AC_CONFIG_REGISTER_DEST
  243. ## --------------------- ##
  244. ## Configuration files. ##
  245. ## --------------------- ##
  246. # AC_CONFIG_FILES(FILE..., [COMMANDS], [INIT-CMDS])
  247. # -------------------------------------------------
  248. # Specify output files, i.e., files that are configured with AC_SUBST.
  249. #
  250. AC_DEFUN([AC_CONFIG_FILES], [_AC_CONFIG_FOOS([FILES], $@)])
  251. # _AC_SED_CMD_LIMIT
  252. # -----------------
  253. # Evaluate to an m4 number equal to the maximum number of commands to put
  254. # in any single sed program, not counting ":" commands.
  255. #
  256. # Some seds have small command number limits, like on Digital OSF/1 and HP-UX.
  257. m4_define([_AC_SED_CMD_LIMIT],
  258. dnl One cannot portably go further than 99 commands because of HP-UX.
  259. [99])
  260. # _AC_AWK_LITERAL_LIMIT
  261. # ---------------------
  262. # Evaluate to the maximum number of characters to put in an awk
  263. # string literal, not counting escape characters.
  264. #
  265. # Some awk's have small limits, such as Solaris and AIX awk.
  266. m4_define([_AC_AWK_LITERAL_LIMIT],
  267. [148])
  268. # _AC_OUTPUT_FILES_PREPARE
  269. # ------------------------
  270. # Create the awk scripts needed for CONFIG_FILES.
  271. # Support multiline substitutions and make sure that the substitutions are
  272. # not evaluated recursively.
  273. # The intention is to have readable config.status and configure, even
  274. # though this m4 code might be scary.
  275. #
  276. # This code was written by Dan Manthey and rewritten by Ralf Wildenhues.
  277. #
  278. # This macro is expanded inside a here document. If the here document is
  279. # closed, it has to be reopened with
  280. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  281. #
  282. m4_define([_AC_OUTPUT_FILES_PREPARE],
  283. [# Set up the scripts for CONFIG_FILES section.
  284. # No need to generate them if there are no CONFIG_FILES.
  285. # This happens for instance with `./config.status config.h'.
  286. if test -n "$CONFIG_FILES"; then
  287. dnl For AC_SUBST_FILE, check for usable getline support in awk,
  288. dnl at config.status execution time.
  289. dnl Otherwise, do the interpolation in sh, which is slower.
  290. dnl Without any AC_SUBST_FILE, omit all related code.
  291. dnl Note the expansion is double-quoted for readability.
  292. m4_ifdef([_AC_SUBST_FILES],
  293. [[if $AWK 'BEGIN { getline <"/dev/null" }' </dev/null 2>/dev/null; then
  294. ac_cs_awk_getline=:
  295. ac_cs_awk_pipe_init=
  296. ac_cs_awk_read_file='
  297. while ((getline aline < (F[key])) > 0)
  298. print(aline)
  299. close(F[key])'
  300. ac_cs_awk_pipe_fini=
  301. else
  302. ac_cs_awk_getline=false
  303. ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\""
  304. ac_cs_awk_read_file='
  305. print "|#_!!_#|"
  306. print "cat " F[key] " &&"
  307. '$ac_cs_awk_pipe_init
  308. # The final `:' finishes the AND list.
  309. ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }'
  310. fi]])
  311. ac_cr=`echo X | tr X '\015'`
  312. # On cygwin, bash can eat \r inside `` if the user requested igncr.
  313. # But we know of no other shell where ac_cr would be empty at this
  314. # point, so we can use a bashism as a fallback.
  315. if test "x$ac_cr" = x; then
  316. eval ac_cr=\$\'\\r\'
  317. fi
  318. ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
  319. if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
  320. ac_cs_awk_cr='\\r'
  321. else
  322. ac_cs_awk_cr=$ac_cr
  323. fi
  324. dnl
  325. dnl Define the pipe that does the substitution.
  326. m4_ifdef([_AC_SUBST_FILES],
  327. [m4_define([_AC_SUBST_CMDS], [|
  328. if $ac_cs_awk_getline; then
  329. $AWK -f "$ac_tmp/subs.awk"
  330. else
  331. $AWK -f "$ac_tmp/subs.awk" | $SHELL
  332. fi])],
  333. [m4_define([_AC_SUBST_CMDS],
  334. [| $AWK -f "$ac_tmp/subs.awk"])])dnl
  335. echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
  336. _ACEOF
  337. m4_ifdef([_AC_SUBST_FILES],
  338. [# Create commands to substitute file output variables.
  339. {
  340. echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" &&
  341. echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' &&
  342. echo "$ac_subst_files" | sed 's/.*/F@<:@"&"@:>@="$&"/' &&
  343. echo "_ACAWK" &&
  344. echo "_ACEOF"
  345. } >conf$$files.sh &&
  346. . ./conf$$files.sh ||
  347. AC_MSG_ERROR([could not make $CONFIG_STATUS])
  348. rm -f conf$$files.sh
  349. ])dnl
  350. {
  351. echo "cat >conf$$subs.awk <<_ACEOF" &&
  352. echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
  353. echo "_ACEOF"
  354. } >conf$$subs.sh ||
  355. AC_MSG_ERROR([could not make $CONFIG_STATUS])
  356. ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
  357. ac_delim='%!_!# '
  358. for ac_last_try in false false false false false :; do
  359. . ./conf$$subs.sh ||
  360. AC_MSG_ERROR([could not make $CONFIG_STATUS])
  361. dnl Do not use grep on conf$$subs.awk, since AIX grep has a line length limit.
  362. ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
  363. if test $ac_delim_n = $ac_delim_num; then
  364. break
  365. elif $ac_last_try; then
  366. AC_MSG_ERROR([could not make $CONFIG_STATUS])
  367. else
  368. ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  369. fi
  370. done
  371. rm -f conf$$subs.sh
  372. dnl Initialize an awk array of substitutions, keyed by variable name.
  373. dnl
  374. dnl The initial line contains the variable name VAR, then a `!'.
  375. dnl Construct `S["VAR"]=' from it.
  376. dnl The rest of the line, and potentially further lines, contain the
  377. dnl substituted value; the last of those ends with $ac_delim. We split
  378. dnl the output both along those substituted newlines and at intervals of
  379. dnl length _AC_AWK_LITERAL_LIMIT. The latter is done to comply with awk
  380. dnl string literal limitations, the former for simplicity in doing so.
  381. dnl
  382. dnl We deal with one input line at a time to avoid sed pattern space
  383. dnl limitations. We kill the delimiter $ac_delim before splitting the
  384. dnl string (otherwise we risk splitting the delimiter). And we do the
  385. dnl splitting before the quoting of awk special characters (otherwise we
  386. dnl risk splitting an escape sequence).
  387. dnl
  388. dnl Output as separate string literals, joined with backslash-newline.
  389. dnl Eliminate the newline after `=' in a second script, for readability.
  390. dnl
  391. dnl Notes to the main part of the awk script:
  392. dnl - the unusual FS value helps prevent running into the limit of 99 fields,
  393. dnl - we avoid sub/gsub because of the \& quoting issues, see
  394. dnl http://www.gnu.org/software/gawk/manual/html_node/Gory-Details.html
  395. dnl - Writing `$ 0' prevents expansion by both the shell and m4 here.
  396. dnl
  397. dnl m4-double-quote most of the scripting for readability.
  398. [cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  399. cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
  400. _ACEOF
  401. sed -n '
  402. h
  403. s/^/S["/; s/!.*/"]=/
  404. p
  405. g
  406. s/^[^!]*!//
  407. :repl
  408. t repl
  409. s/'"$ac_delim"'$//
  410. t delim
  411. :nl
  412. h
  413. s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\)..*/\1/
  414. t more1
  415. s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
  416. p
  417. n
  418. b repl
  419. :more1
  420. s/["\\]/\\&/g; s/^/"/; s/$/"\\/
  421. p
  422. g
  423. s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
  424. t nl
  425. :delim
  426. h
  427. s/\(.\{]_AC_AWK_LITERAL_LIMIT[\}\)..*/\1/
  428. t more2
  429. s/["\\]/\\&/g; s/^/"/; s/$/"/
  430. p
  431. b
  432. :more2
  433. s/["\\]/\\&/g; s/^/"/; s/$/"\\/
  434. p
  435. g
  436. s/.\{]_AC_AWK_LITERAL_LIMIT[\}//
  437. t delim
  438. ' <conf$$subs.awk | sed '
  439. /^[^""]/{
  440. N
  441. s/\n//
  442. }
  443. ' >>$CONFIG_STATUS || ac_write_fail=1
  444. rm -f conf$$subs.awk
  445. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  446. _ACAWK
  447. cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
  448. for (key in S) S_is_set[key] = 1
  449. FS = ""
  450. ]m4_ifdef([_AC_SUBST_FILES],
  451. [ \$ac_cs_awk_pipe_init])[
  452. }
  453. {
  454. line = $ 0
  455. nfields = split(line, field, "@")
  456. substed = 0
  457. len = length(field[1])
  458. for (i = 2; i < nfields; i++) {
  459. key = field[i]
  460. keylen = length(key)
  461. if (S_is_set[key]) {
  462. value = S[key]
  463. line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
  464. len += length(value) + length(field[++i])
  465. substed = 1
  466. } else
  467. len += 1 + keylen
  468. }
  469. ]m4_ifdef([_AC_SUBST_FILES],
  470. [[ if (nfields == 3 && !substed) {
  471. key = field[2]
  472. if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) {
  473. \$ac_cs_awk_read_file
  474. next
  475. }
  476. }]])[
  477. print line
  478. }
  479. ]dnl end of double-quoted part
  480. m4_ifdef([_AC_SUBST_FILES],
  481. [\$ac_cs_awk_pipe_fini])
  482. _ACAWK
  483. _ACEOF
  484. dnl See if CR is the EOL marker. If not, remove any EOL-related
  485. dnl ^M bytes and escape any remaining ones. If so, just use mv.
  486. dnl In case you're wondering how ^M bytes can make it into subs1.awk,
  487. dnl [from Ralf Wildenhues] one way is if you have e.g.,
  488. dnl AC_SUBST([variable_that_contains_cr], ["
  489. dnl "])
  490. dnl The original aim was that users should be able to substitute any
  491. dnl characters they like (except for \0). And the above is not so
  492. dnl unlikely if the configure script itself happens to be converted
  493. dnl to w32 text mode.
  494. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  495. if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
  496. sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
  497. else
  498. cat
  499. fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
  500. || AC_MSG_ERROR([could not setup config files machinery])
  501. _ACEOF
  502. # VPATH may cause trouble with some makes, so we remove sole $(srcdir),
  503. # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
  504. # trailing colons and then remove the whole line if VPATH becomes empty
  505. # (actually we leave an empty line to preserve line numbers).
  506. if test "x$srcdir" = x.; then
  507. ac_vpsub=['/^[ ]*VPATH[ ]*=[ ]*/{
  508. h
  509. s///
  510. s/^/:/
  511. s/[ ]*$/:/
  512. s/:\$(srcdir):/:/g
  513. s/:\${srcdir}:/:/g
  514. s/:@srcdir@:/:/g
  515. s/^:*//
  516. s/:*$//
  517. x
  518. s/\(=[ ]*\).*/\1/
  519. G
  520. s/\n//
  521. s/^[^=]*=[ ]*$//
  522. }']
  523. fi
  524. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  525. fi # test -n "$CONFIG_FILES"
  526. ])# _AC_OUTPUT_FILES_PREPARE
  527. # _AC_OUTPUT_FILE_ADJUST_DIR(VAR)
  528. # -------------------------------
  529. # Generate the sed snippet needed to output VAR relative to the
  530. # top-level directory.
  531. m4_define([_AC_OUTPUT_FILE_ADJUST_DIR],
  532. [s&@$1@&$ac_$1&;t t[]AC_SUBST_TRACE([$1])])
  533. # _AC_OUTPUT_FILE
  534. # ---------------
  535. # Do the variable substitutions to create the Makefiles or whatever.
  536. #
  537. # This macro is expanded inside a here document. If the here document is
  538. # closed, it has to be reopened with
  539. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  540. #
  541. m4_define([_AC_OUTPUT_FILE],
  542. [
  543. #
  544. # CONFIG_FILE
  545. #
  546. AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
  547. [ case $INSTALL in
  548. [[\\/$]]* | ?:[[\\/]]* ) ac_INSTALL=$INSTALL ;;
  549. *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
  550. esac
  551. ])dnl
  552. AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
  553. [ ac_MKDIR_P=$MKDIR_P
  554. case $MKDIR_P in
  555. [[\\/$]]* | ?:[[\\/]]* ) ;;
  556. */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
  557. esac
  558. ])dnl
  559. _ACEOF
  560. m4_ifndef([AC_DATAROOTDIR_CHECKED],
  561. [cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  562. # If the template does not know about datarootdir, expand it.
  563. # FIXME: This hack should be removed a few years after 2.60.
  564. ac_datarootdir_hack=; ac_datarootdir_seen=
  565. m4_define([_AC_datarootdir_vars],
  566. [datadir, docdir, infodir, localedir, mandir])]dnl
  567. [m4_define([_AC_datarootdir_subst], [ s&@$][1@&$$][1&g])]dnl
  568. [ac_sed_dataroot='
  569. /datarootdir/ {
  570. p
  571. q
  572. }
  573. m4_map_args_sep([/@], [@/p], [
  574. ], _AC_datarootdir_vars)'
  575. case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
  576. *datarootdir*) ac_datarootdir_seen=yes;;
  577. *@[]m4_join([@*|*@], _AC_datarootdir_vars)@*)
  578. AC_MSG_WARN([$ac_file_inputs seems to ignore the --datarootdir setting])
  579. _ACEOF
  580. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  581. ac_datarootdir_hack='
  582. m4_map_args_sep([_AC_datarootdir_subst(], [)], [
  583. ], _AC_datarootdir_vars)
  584. s&\\\${datarootdir}&$datarootdir&g' ;;
  585. esac
  586. _ACEOF
  587. ])dnl
  588. # Neutralize VPATH when `$srcdir' = `.'.
  589. # Shell code in configure.ac might set extrasub.
  590. # FIXME: do we really want to maintain this feature?
  591. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  592. ac_sed_extra="$ac_vpsub
  593. $extrasub
  594. _ACEOF
  595. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  596. :t
  597. [/@[a-zA-Z_][a-zA-Z_0-9]*@/!b]
  598. dnl configure_input is a somewhat special, so we don't call AC_SUBST_TRACE.
  599. dnl Note if you change the s||| delimiter here, don't forget to adjust
  600. dnl ac_sed_conf_input accordingly. Using & is a bad idea if & appears in
  601. dnl the replacement string.
  602. s|@configure_input@|$ac_sed_conf_input|;t t
  603. dnl During the transition period, this is a special case:
  604. s&@top_builddir@&$ac_top_builddir_sub&;t t[]AC_SUBST_TRACE([top_builddir])
  605. dnl For this substitution see the witness macro _AC_HAVE_TOP_BUILD_PREFIX above.
  606. s&@top_build_prefix@&$ac_top_build_prefix&;t t[]AC_SUBST_TRACE([top_build_prefix])
  607. m4_map_args_sep([$0_ADJUST_DIR(], [)], [
  608. ], [srcdir], [abs_srcdir], [top_srcdir], [abs_top_srcdir],
  609. [builddir], [abs_builddir],
  610. [abs_top_builddir]AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
  611. [, [INSTALL]])AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P], [, [MKDIR_P]]))
  612. m4_ifndef([AC_DATAROOTDIR_CHECKED], [$ac_datarootdir_hack
  613. ])dnl
  614. "
  615. eval sed \"\$ac_sed_extra\" "$ac_file_inputs" m4_defn([_AC_SUBST_CMDS]) \
  616. >$ac_tmp/out || AC_MSG_ERROR([could not create $ac_file])
  617. m4_ifndef([AC_DATAROOTDIR_CHECKED],
  618. [test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
  619. { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
  620. { ac_out=`sed -n '/^[[ ]]*datarootdir[[ ]]*:*=/p' \
  621. "$ac_tmp/out"`; test -z "$ac_out"; } &&
  622. AC_MSG_WARN([$ac_file contains a reference to the variable `datarootdir'
  623. which seems to be undefined. Please make sure it is defined])
  624. ])dnl
  625. rm -f "$ac_tmp/stdin"
  626. case $ac_file in
  627. -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
  628. *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
  629. esac \
  630. || AC_MSG_ERROR([could not create $ac_file])
  631. dnl This would break Makefile dependencies:
  632. dnl if diff "$ac_file" "$ac_tmp/out" >/dev/null 2>&1; then
  633. dnl echo "$ac_file is unchanged"
  634. dnl else
  635. dnl rm -f "$ac_file"; mv "$ac_tmp/out" "$ac_file"
  636. dnl fi
  637. ])# _AC_OUTPUT_FILE
  638. ## ----------------------- ##
  639. ## Configuration headers. ##
  640. ## ----------------------- ##
  641. # AC_CONFIG_HEADERS(HEADERS..., [COMMANDS], [INIT-CMDS])
  642. # ------------------------------------------------------
  643. # Specify that the HEADERS are to be created by instantiation of the
  644. # AC_DEFINEs.
  645. #
  646. AC_DEFUN([AC_CONFIG_HEADERS], [_AC_CONFIG_FOOS([HEADERS], $@)])
  647. # AC_CONFIG_HEADER(HEADER-TO-CREATE ...)
  648. # --------------------------------------
  649. # FIXME: Make it obsolete?
  650. AC_DEFUN([AC_CONFIG_HEADER],
  651. [AC_CONFIG_HEADERS([$1])])
  652. # _AC_OUTPUT_HEADERS_PREPARE
  653. # --------------------------
  654. # Create the awk scripts needed for CONFIG_HEADERS.
  655. # Support multiline #defines.
  656. #
  657. # This macro is expanded inside a here document. If the here document is
  658. # closed, it has to be reopened with
  659. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  660. #
  661. m4_define([_AC_OUTPUT_HEADERS_PREPARE],
  662. [# Set up the scripts for CONFIG_HEADERS section.
  663. # No need to generate them if there are no CONFIG_HEADERS.
  664. # This happens for instance with `./config.status Makefile'.
  665. if test -n "$CONFIG_HEADERS"; then
  666. dnl This `||' list is finished at the end of _AC_OUTPUT_HEADERS_PREPARE.
  667. cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
  668. BEGIN {
  669. _ACEOF
  670. # Transform confdefs.h into an awk script `defines.awk', embedded as
  671. # here-document in config.status, that substitutes the proper values into
  672. # config.h.in to produce config.h.
  673. # Create a delimiter string that does not exist in confdefs.h, to ease
  674. # handling of long lines.
  675. ac_delim='%!_!# '
  676. for ac_last_try in false false :; do
  677. ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
  678. if test -z "$ac_tt"; then
  679. break
  680. elif $ac_last_try; then
  681. AC_MSG_ERROR([could not make $CONFIG_HEADERS])
  682. else
  683. ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
  684. fi
  685. done
  686. # For the awk script, D is an array of macro values keyed by name,
  687. # likewise P contains macro parameters if any. Preserve backslash
  688. # newline sequences.
  689. dnl
  690. dnl Structure of the sed script that reads confdefs.h:
  691. dnl rset: main loop, searches for `#define' lines
  692. dnl def: deal with a `#define' line
  693. dnl bsnl: deal with a `#define' line that ends with backslash-newline
  694. dnl cont: handle a continuation line
  695. dnl bsnlc: handle a continuation line that ends with backslash-newline
  696. dnl
  697. dnl Each sub part escapes the awk special characters and outputs a statement
  698. dnl inserting the macro value into the array D, keyed by name. If the macro
  699. dnl uses parameters, they are added in the array P, keyed by name.
  700. dnl
  701. dnl Long values are split into several string literals with help of ac_delim.
  702. dnl Assume nobody uses macro names of nearly 150 bytes length.
  703. dnl
  704. dnl The initial replace for `#define' lines inserts a leading space
  705. dnl in order to ease later matching; otherwise, output lines may be
  706. dnl repeatedly matched.
  707. dnl
  708. dnl m4-double-quote most of this for [, ], define, and substr:
  709. [
  710. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
  711. sed -n '
  712. s/.\{]_AC_AWK_LITERAL_LIMIT[\}/&'"$ac_delim"'/g
  713. t rset
  714. :rset
  715. s/^[ ]*#[ ]*define[ ][ ]*/ /
  716. t def
  717. d
  718. :def
  719. s/\\$//
  720. t bsnl
  721. s/["\\]/\\&/g
  722. s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
  723. D["\1"]=" \3"/p
  724. s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
  725. d
  726. :bsnl
  727. s/["\\]/\\&/g
  728. s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
  729. D["\1"]=" \3\\\\\\n"\\/p
  730. t cont
  731. s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
  732. t cont
  733. d
  734. :cont
  735. n
  736. s/.\{]_AC_AWK_LITERAL_LIMIT[\}/&'"$ac_delim"'/g
  737. t clear
  738. :clear
  739. s/\\$//
  740. t bsnlc
  741. s/["\\]/\\&/g; s/^/"/; s/$/"/p
  742. d
  743. :bsnlc
  744. s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
  745. b cont
  746. ' <confdefs.h | sed '
  747. s/'"$ac_delim"'/"\\\
  748. "/g' >>$CONFIG_STATUS || ac_write_fail=1
  749. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  750. for (key in D) D_is_set[key] = 1
  751. FS = ""
  752. }
  753. /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
  754. line = \$ 0
  755. split(line, arg, " ")
  756. if (arg[1] == "#") {
  757. defundef = arg[2]
  758. mac1 = arg[3]
  759. } else {
  760. defundef = substr(arg[1], 2)
  761. mac1 = arg[2]
  762. }
  763. split(mac1, mac2, "(") #)
  764. macro = mac2[1]
  765. prefix = substr(line, 1, index(line, defundef) - 1)
  766. if (D_is_set[macro]) {
  767. # Preserve the white space surrounding the "#".
  768. print prefix "define", macro P[macro] D[macro]
  769. next
  770. } else {
  771. # Replace #undef with comments. This is necessary, for example,
  772. # in the case of _POSIX_SOURCE, which is predefined and required
  773. # on some systems where configure will not decide to define it.
  774. if (defundef == "undef") {
  775. print "/*", prefix defundef, macro, "*/"
  776. next
  777. }
  778. }
  779. }
  780. { print }
  781. ]dnl End of double-quoted section
  782. _ACAWK
  783. _ACEOF
  784. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  785. dnl finish `||' list indicating write error:
  786. AC_MSG_ERROR([could not setup config headers machinery])
  787. fi # test -n "$CONFIG_HEADERS"
  788. ])# _AC_OUTPUT_HEADERS_PREPARE
  789. # _AC_OUTPUT_HEADER
  790. # -----------------
  791. #
  792. # Output the code which instantiates the `config.h' files from their
  793. # `config.h.in'.
  794. #
  795. # This macro is expanded inside a here document. If the here document is
  796. # closed, it has to be reopened with
  797. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  798. #
  799. m4_define([_AC_OUTPUT_HEADER],
  800. [
  801. #
  802. # CONFIG_HEADER
  803. #
  804. if test x"$ac_file" != x-; then
  805. {
  806. AS_ECHO(["/* $configure_input */"]) \
  807. && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
  808. } >"$ac_tmp/config.h" \
  809. || AC_MSG_ERROR([could not create $ac_file])
  810. if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
  811. AC_MSG_NOTICE([$ac_file is unchanged])
  812. else
  813. rm -f "$ac_file"
  814. mv "$ac_tmp/config.h" "$ac_file" \
  815. || AC_MSG_ERROR([could not create $ac_file])
  816. fi
  817. else
  818. AS_ECHO(["/* $configure_input */"]) \
  819. && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
  820. || AC_MSG_ERROR([could not create -])
  821. fi
  822. dnl If running for Automake, be ready to perform additional
  823. dnl commands to set up the timestamp files.
  824. m4_ifdef([_AC_AM_CONFIG_HEADER_HOOK],
  825. [_AC_AM_CONFIG_HEADER_HOOK(["$ac_file"])
  826. ])dnl
  827. ])# _AC_OUTPUT_HEADER
  828. ## --------------------- ##
  829. ## Configuration links. ##
  830. ## --------------------- ##
  831. # AC_CONFIG_LINKS(DEST:SOURCE..., [COMMANDS], [INIT-CMDS])
  832. # --------------------------------------------------------
  833. # Specify that config.status should establish a (symbolic if possible)
  834. # link from TOP_SRCDIR/SOURCE to TOP_SRCDIR/DEST.
  835. # Reject DEST=., because it is makes it hard for ./config.status
  836. # to guess the links to establish (`./config.status .').
  837. #
  838. AC_DEFUN([AC_CONFIG_LINKS], [_AC_CONFIG_FOOS([LINKS], $@)])
  839. # AC_LINK_FILES(SOURCE..., DEST...)
  840. # ---------------------------------
  841. # Link each of the existing files SOURCE... to the corresponding
  842. # link name in DEST...
  843. #
  844. # Unfortunately we can't provide a very good autoupdate service here,
  845. # since in `AC_LINK_FILES($from, $to)' it is possible that `$from'
  846. # and `$to' are actually lists. It would then be completely wrong to
  847. # replace it with `AC_CONFIG_LINKS($to:$from). It is possible in the
  848. # case of literal values though, but because I don't think there is any
  849. # interest in creating config links with literal values, no special
  850. # mechanism is implemented to handle them.
  851. #
  852. # _AC_LINK_FILES_CNT is used to be robust to multiple calls.
  853. AU_DEFUN([AC_LINK_FILES],
  854. [m4_if($#, 2, ,
  855. [m4_fatal([$0: incorrect number of arguments])])dnl
  856. m4_define_default([_AC_LINK_FILES_CNT], 0)dnl
  857. m4_define([_AC_LINK_FILES_CNT], m4_incr(_AC_LINK_FILES_CNT))dnl
  858. ac_sources="$1"
  859. ac_dests="$2"
  860. while test -n "$ac_sources"; do
  861. set $ac_dests; ac_dest=$[1]; shift; ac_dests=$[*]
  862. set $ac_sources; ac_source=$[1]; shift; ac_sources=$[*]
  863. [ac_config_links_]_AC_LINK_FILES_CNT="$[ac_config_links_]_AC_LINK_FILES_CNT $ac_dest:$ac_source"
  864. done
  865. AC_CONFIG_LINKS($[ac_config_links_]_AC_LINK_FILES_CNT)dnl
  866. ],
  867. [It is technically impossible to `autoupdate' cleanly from AC_LINK_FILES
  868. to AC_CONFIG_LINKS. `autoupdate' provides a functional but inelegant
  869. update, you should probably tune the result yourself.])# AC_LINK_FILES
  870. # _AC_OUTPUT_LINK
  871. # ---------------
  872. # This macro is expanded inside a here document. If the here document is
  873. # closed, it has to be reopened with
  874. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  875. m4_define([_AC_OUTPUT_LINK],
  876. [
  877. #
  878. # CONFIG_LINK
  879. #
  880. if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
  881. :
  882. else
  883. # Prefer the file from the source tree if names are identical.
  884. if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
  885. ac_source=$srcdir/$ac_source
  886. fi
  887. AC_MSG_NOTICE([linking $ac_source to $ac_file])
  888. if test ! -r "$ac_source"; then
  889. AC_MSG_ERROR([$ac_source: file not found])
  890. fi
  891. rm -f "$ac_file"
  892. # Try a relative symlink, then a hard link, then a copy.
  893. case $ac_source in
  894. [[\\/$]]* | ?:[[\\/]]* ) ac_rel_source=$ac_source ;;
  895. *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
  896. esac
  897. ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
  898. ln "$ac_source" "$ac_file" 2>/dev/null ||
  899. cp -p "$ac_source" "$ac_file" ||
  900. AC_MSG_ERROR([cannot link or copy $ac_source to $ac_file])
  901. fi
  902. ])# _AC_OUTPUT_LINK
  903. ## ------------------------ ##
  904. ## Configuration commands. ##
  905. ## ------------------------ ##
  906. # AC_CONFIG_COMMANDS(NAME...,[COMMANDS], [INIT-CMDS])
  907. # ---------------------------------------------------
  908. #
  909. # Specify additional commands to be run by config.status. This
  910. # commands must be associated with a NAME, which should be thought
  911. # as the name of a file the COMMANDS create.
  912. #
  913. AC_DEFUN([AC_CONFIG_COMMANDS], [_AC_CONFIG_FOOS([COMMANDS], $@)])
  914. # AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS)
  915. # -----------------------------------------
  916. #
  917. # Add additional commands for AC_OUTPUT to put into config.status.
  918. #
  919. # This macro is an obsolete version of AC_CONFIG_COMMANDS. The only
  920. # difficulty in mapping AC_OUTPUT_COMMANDS to AC_CONFIG_COMMANDS is
  921. # to give a unique key. The scheme we have chosen is `default-1',
  922. # `default-2' etc. for each call.
  923. #
  924. # Unfortunately this scheme is fragile: bad things might happen
  925. # if you update an included file and configure.ac: you might have
  926. # clashes :( On the other hand, I'd like to avoid weird keys (e.g.,
  927. # depending upon __file__ or the pid).
  928. AU_DEFUN([AC_OUTPUT_COMMANDS],
  929. [m4_define_default([_AC_OUTPUT_COMMANDS_CNT], 0)dnl
  930. m4_define([_AC_OUTPUT_COMMANDS_CNT], m4_incr(_AC_OUTPUT_COMMANDS_CNT))dnl
  931. dnl Double quoted since that was the case in the original macro.
  932. AC_CONFIG_COMMANDS([default-]_AC_OUTPUT_COMMANDS_CNT, [[$1]], [[$2]])dnl
  933. ])
  934. # _AC_OUTPUT_COMMAND
  935. # ------------------
  936. # This macro is expanded inside a here document. If the here document is
  937. # closed, it has to be reopened with
  938. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  939. m4_define([_AC_OUTPUT_COMMAND],
  940. [ AC_MSG_NOTICE([executing $ac_file commands])
  941. ])
  942. ## -------------------------------------- ##
  943. ## Pre- and post-config.status commands. ##
  944. ## -------------------------------------- ##
  945. # AC_CONFIG_COMMANDS_PRE(CMDS)
  946. # ----------------------------
  947. # Commands to run right before config.status is created. Accumulates.
  948. AC_DEFUN([AC_CONFIG_COMMANDS_PRE],
  949. [m4_append([AC_OUTPUT_COMMANDS_PRE], [$1
  950. ])])
  951. # AC_OUTPUT_COMMANDS_PRE
  952. # ----------------------
  953. # A *variable* in which we append all the actions that must be
  954. # performed before *creating* config.status. For a start, clean
  955. # up all the LIBOBJ mess.
  956. m4_define([AC_OUTPUT_COMMANDS_PRE],
  957. [_AC_LIBOBJS_NORMALIZE
  958. ])
  959. # AC_CONFIG_COMMANDS_POST(CMDS)
  960. # -----------------------------
  961. # Commands to run after config.status was created. Accumulates.
  962. AC_DEFUN([AC_CONFIG_COMMANDS_POST],
  963. [m4_append([AC_OUTPUT_COMMANDS_POST], [$1
  964. ])])
  965. # Initialize.
  966. m4_define([AC_OUTPUT_COMMANDS_POST])
  967. ## ----------------------- ##
  968. ## Configuration subdirs. ##
  969. ## ----------------------- ##
  970. # AC_CONFIG_SUBDIRS(DIR ...)
  971. # --------------------------
  972. # We define two variables:
  973. # - _AC_LIST_SUBDIRS
  974. # A statically built list, should contain *all* the arguments of
  975. # AC_CONFIG_SUBDIRS. The final value is assigned to ac_subdirs_all in
  976. # the `default' section, and used for --help=recursive.
  977. # It makes no sense for arguments which are sh variables.
  978. # - subdirs
  979. # Shell variable built at runtime, so some of these dirs might not be
  980. # included, if for instance the user refused a part of the tree.
  981. # This is used in _AC_OUTPUT_SUBDIRS.
  982. AC_DEFUN([AC_CONFIG_SUBDIRS],
  983. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])]dnl
  984. [AC_REQUIRE([AC_DISABLE_OPTION_CHECKING])]dnl
  985. [m4_map_args_w([$1], [_AC_CONFIG_UNIQUE([SUBDIRS],
  986. _AC_CONFIG_COMPUTE_DEST(], [))])]dnl
  987. [m4_append([_AC_LIST_SUBDIRS], [$1], [
  988. ])]dnl
  989. [AS_LITERAL_IF([$1], [],
  990. [AC_DIAGNOSE([syntax], [$0: you should use literals])])]dnl
  991. [AC_SUBST([subdirs], ["$subdirs m4_normalize([$1])"])])
  992. # _AC_OUTPUT_SUBDIRS
  993. # ------------------
  994. # This is a subroutine of AC_OUTPUT, but it does not go into
  995. # config.status, rather, it is called after running config.status.
  996. m4_define([_AC_OUTPUT_SUBDIRS],
  997. [
  998. #
  999. # CONFIG_SUBDIRS section.
  1000. #
  1001. if test "$no_recursion" != yes; then
  1002. # Remove --cache-file, --srcdir, and --disable-option-checking arguments
  1003. # so they do not pile up.
  1004. ac_sub_configure_args=
  1005. ac_prev=
  1006. eval "set x $ac_configure_args"
  1007. shift
  1008. for ac_arg
  1009. do
  1010. if test -n "$ac_prev"; then
  1011. ac_prev=
  1012. continue
  1013. fi
  1014. case $ac_arg in
  1015. -cache-file | --cache-file | --cache-fil | --cache-fi \
  1016. | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  1017. ac_prev=cache_file ;;
  1018. -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  1019. | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
  1020. | --c=*)
  1021. ;;
  1022. --config-cache | -C)
  1023. ;;
  1024. -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  1025. ac_prev=srcdir ;;
  1026. -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  1027. ;;
  1028. -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  1029. ac_prev=prefix ;;
  1030. -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  1031. ;;
  1032. --disable-option-checking)
  1033. ;;
  1034. *)
  1035. case $ac_arg in
  1036. *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
  1037. esac
  1038. AS_VAR_APPEND([ac_sub_configure_args], [" '$ac_arg'"]) ;;
  1039. esac
  1040. done
  1041. # Always prepend --prefix to ensure using the same prefix
  1042. # in subdir configurations.
  1043. ac_arg="--prefix=$prefix"
  1044. case $ac_arg in
  1045. *\'*) ac_arg=`AS_ECHO(["$ac_arg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
  1046. esac
  1047. ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
  1048. # Pass --silent
  1049. if test "$silent" = yes; then
  1050. ac_sub_configure_args="--silent $ac_sub_configure_args"
  1051. fi
  1052. # Always prepend --disable-option-checking to silence warnings, since
  1053. # different subdirs can have different --enable and --with options.
  1054. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
  1055. ac_popdir=`pwd`
  1056. for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
  1057. # Do not complain, so a configure script can configure whichever
  1058. # parts of a large source tree are present.
  1059. test -d "$srcdir/$ac_dir" || continue
  1060. ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
  1061. _AS_ECHO_LOG([$ac_msg])
  1062. _AS_ECHO([$ac_msg])
  1063. AS_MKDIR_P(["$ac_dir"])
  1064. _AC_SRCDIRS(["$ac_dir"])
  1065. cd "$ac_dir"
  1066. # Check for guested configure; otherwise get Cygnus style configure.
  1067. if test -f "$ac_srcdir/configure.gnu"; then
  1068. ac_sub_configure=$ac_srcdir/configure.gnu
  1069. elif test -f "$ac_srcdir/configure"; then
  1070. ac_sub_configure=$ac_srcdir/configure
  1071. elif test -f "$ac_srcdir/configure.in"; then
  1072. # This should be Cygnus configure.
  1073. ac_sub_configure=$ac_aux_dir/configure
  1074. else
  1075. AC_MSG_WARN([no configuration information is in $ac_dir])
  1076. ac_sub_configure=
  1077. fi
  1078. # The recursion is here.
  1079. if test -n "$ac_sub_configure"; then
  1080. # Make the cache file name correct relative to the subdirectory.
  1081. case $cache_file in
  1082. [[\\/]]* | ?:[[\\/]]* ) ac_sub_cache_file=$cache_file ;;
  1083. *) # Relative name.
  1084. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
  1085. esac
  1086. AC_MSG_NOTICE([running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir])
  1087. # The eval makes quoting arguments work.
  1088. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
  1089. --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
  1090. AC_MSG_ERROR([$ac_sub_configure failed for $ac_dir])
  1091. fi
  1092. cd "$ac_popdir"
  1093. done
  1094. fi
  1095. ])# _AC_OUTPUT_SUBDIRS
  1096. ## -------------------------- ##
  1097. ## Outputting config.status. ##
  1098. ## -------------------------- ##
  1099. # AU::AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
  1100. # -----------------------------------------------------------
  1101. #
  1102. # If there are arguments given to AC_OUTPUT, dispatch them to the
  1103. # proper modern macros.
  1104. AU_DEFUN([AC_OUTPUT],
  1105. [m4_ifvaln([$1],
  1106. [AC_CONFIG_FILES([$1])])dnl
  1107. m4_ifvaln([$2$3],
  1108. [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
  1109. [AC_OUTPUT]])
  1110. # AC_OUTPUT([CONFIG_FILES...], [EXTRA-CMDS], [INIT-CMDS])
  1111. # -------------------------------------------------------
  1112. # The big finish.
  1113. # Produce config.status, config.h, and links; and configure subdirs.
  1114. #
  1115. m4_define([AC_OUTPUT],
  1116. [dnl Dispatch the extra arguments to their native macros.
  1117. m4_ifvaln([$1],
  1118. [AC_CONFIG_FILES([$1])])dnl
  1119. m4_ifvaln([$2$3],
  1120. [AC_CONFIG_COMMANDS(default, [$2], [$3])])dnl
  1121. m4_ifval([$1$2$3],
  1122. [AC_DIAGNOSE([obsolete],
  1123. [$0 should be used without arguments.
  1124. You should run autoupdate.])])dnl
  1125. AC_CACHE_SAVE
  1126. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  1127. # Let make expand exec_prefix.
  1128. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  1129. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()])
  1130. dnl Commands to run before creating config.status.
  1131. AC_OUTPUT_COMMANDS_PRE()dnl
  1132. : "${CONFIG_STATUS=./config.status}"
  1133. ac_write_fail=0
  1134. ac_clean_files_save=$ac_clean_files
  1135. ac_clean_files="$ac_clean_files $CONFIG_STATUS"
  1136. _AC_OUTPUT_CONFIG_STATUS()dnl
  1137. ac_clean_files=$ac_clean_files_save
  1138. test $ac_write_fail = 0 ||
  1139. AC_MSG_ERROR([write failure creating $CONFIG_STATUS])
  1140. dnl Commands to run after config.status was created
  1141. AC_OUTPUT_COMMANDS_POST()dnl
  1142. # configure is writing to config.log, and then calls config.status.
  1143. # config.status does its own redirection, appending to config.log.
  1144. # Unfortunately, on DOS this fails, as config.log is still kept open
  1145. # by configure, so config.status won't be able to write to it; its
  1146. # output is simply discarded. So we exec the FD to /dev/null,
  1147. # effectively closing config.log, so it can be properly (re)opened and
  1148. # appended to by config.status. When coming back to configure, we
  1149. # need to make the FD available again.
  1150. if test "$no_create" != yes; then
  1151. ac_cs_success=:
  1152. ac_config_status_args=
  1153. test "$silent" = yes &&
  1154. ac_config_status_args="$ac_config_status_args --quiet"
  1155. exec AS_MESSAGE_LOG_FD>/dev/null
  1156. $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
  1157. exec AS_MESSAGE_LOG_FD>>config.log
  1158. # Use ||, not &&, to avoid exiting from the if with $? = 1, which
  1159. # would make configure fail if this is the last instruction.
  1160. $ac_cs_success || AS_EXIT([1])
  1161. fi
  1162. dnl config.status should not do recursion.
  1163. AC_PROVIDE_IFELSE([AC_CONFIG_SUBDIRS], [_AC_OUTPUT_SUBDIRS()])dnl
  1164. if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
  1165. AC_MSG_WARN([unrecognized options: $ac_unrecognized_opts])
  1166. fi
  1167. ])# AC_OUTPUT
  1168. # _AC_OUTPUT_CONFIG_STATUS
  1169. # ------------------------
  1170. # Produce config.status. Called by AC_OUTPUT.
  1171. # Pay special attention not to have too long here docs: some old
  1172. # shells die. Unfortunately the limit is not known precisely...
  1173. m4_define([_AC_OUTPUT_CONFIG_STATUS],
  1174. [AC_MSG_NOTICE([creating $CONFIG_STATUS])
  1175. dnl AS_MESSAGE_LOG_FD is not available yet:
  1176. m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
  1177. [AS_INIT_GENERATED([$CONFIG_STATUS],
  1178. [# Run this file to recreate the current configuration.
  1179. # Compiler output produced by configure, useful for debugging
  1180. # configure, is in config.log if it exists.
  1181. debug=false
  1182. ac_cs_recheck=false
  1183. ac_cs_silent=false
  1184. ]) || ac_write_fail=1
  1185. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  1186. [#] Save the log message, to keep $[0] and so on meaningful, and to
  1187. # report actual input values of CONFIG_FILES etc. instead of their
  1188. # values after options handling.
  1189. ac_log="
  1190. This file was extended by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
  1191. $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
  1192. generated by m4_PACKAGE_STRING. Invocation command line was
  1193. CONFIG_FILES = $CONFIG_FILES
  1194. CONFIG_HEADERS = $CONFIG_HEADERS
  1195. CONFIG_LINKS = $CONFIG_LINKS
  1196. CONFIG_COMMANDS = $CONFIG_COMMANDS
  1197. $ $[0] $[@]
  1198. on `(hostname || uname -n) 2>/dev/null | sed 1q`
  1199. "
  1200. _ACEOF
  1201. dnl remove any newlines from these variables.
  1202. m4_ifdef([_AC_SEEN_CONFIG(FILES)],
  1203. [case $ac_config_files in *"
  1204. "*) set x $ac_config_files; shift; ac_config_files=$[*];;
  1205. esac
  1206. ])
  1207. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
  1208. [case $ac_config_headers in *"
  1209. "*) set x $ac_config_headers; shift; ac_config_headers=$[*];;
  1210. esac
  1211. ])
  1212. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  1213. # Files that config.status was made for.
  1214. m4_ifdef([_AC_SEEN_CONFIG(FILES)],
  1215. [config_files="$ac_config_files"
  1216. ])dnl
  1217. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
  1218. [config_headers="$ac_config_headers"
  1219. ])dnl
  1220. m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
  1221. [config_links="$ac_config_links"
  1222. ])dnl
  1223. m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
  1224. [config_commands="$ac_config_commands"
  1225. ])dnl
  1226. _ACEOF
  1227. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  1228. ac_cs_usage="\
  1229. \`$as_me' instantiates files and other configuration actions
  1230. from templates according to the current configuration. Unless the files
  1231. and actions are specified as TAGs, all are instantiated by default.
  1232. Usage: $[0] [[OPTION]]... [[TAG]]...
  1233. -h, --help print this help, then exit
  1234. -V, --version print version number and configuration settings, then exit
  1235. --config print configuration, then exit
  1236. -q, --quiet, --silent
  1237. [] do not print progress messages
  1238. -d, --debug don't remove temporary files
  1239. --recheck update $as_me by reconfiguring in the same conditions
  1240. m4_ifdef([_AC_SEEN_CONFIG(FILES)],
  1241. [AS_HELP_STRING([[ --file=FILE[:TEMPLATE]]],
  1242. [instantiate the configuration file FILE], [ ])
  1243. ])dnl
  1244. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
  1245. [AS_HELP_STRING([[ --header=FILE[:TEMPLATE]]],
  1246. [instantiate the configuration header FILE], [ ])
  1247. ])dnl
  1248. m4_ifdef([_AC_SEEN_CONFIG(FILES)],
  1249. [Configuration files:
  1250. $config_files
  1251. ])dnl
  1252. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
  1253. [Configuration headers:
  1254. $config_headers
  1255. ])dnl
  1256. m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
  1257. [Configuration links:
  1258. $config_links
  1259. ])dnl
  1260. m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
  1261. [Configuration commands:
  1262. $config_commands
  1263. ])dnl
  1264. Report bugs to m4_ifset([AC_PACKAGE_BUGREPORT], [<AC_PACKAGE_BUGREPORT>],
  1265. [the package provider]).dnl
  1266. m4_ifdef([AC_PACKAGE_NAME], [m4_ifset([AC_PACKAGE_URL], [
  1267. AC_PACKAGE_NAME home page: <AC_PACKAGE_URL>.])dnl
  1268. m4_if(m4_index(m4_defn([AC_PACKAGE_NAME]), [GNU ]), [0], [
  1269. General help using GNU software: <http://www.gnu.org/gethelp/>.])])"
  1270. _ACEOF
  1271. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  1272. ac_cs_config="`AS_ECHO(["$ac_configure_args"]) | sed 's/^ //; s/[[\\""\`\$]]/\\\\&/g'`"
  1273. ac_cs_version="\\
  1274. m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.status[]dnl
  1275. m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
  1276. configured by $[0], generated by m4_PACKAGE_STRING,
  1277. with options \\"\$ac_cs_config\\"
  1278. Copyright (C) m4_PACKAGE_YEAR Free Software Foundation, Inc.
  1279. This config.status script is free software; the Free Software Foundation
  1280. gives unlimited permission to copy, distribute and modify it."
  1281. ac_pwd='$ac_pwd'
  1282. srcdir='$srcdir'
  1283. AC_PROVIDE_IFELSE([AC_PROG_INSTALL],
  1284. [INSTALL='$INSTALL'
  1285. ])dnl
  1286. AC_PROVIDE_IFELSE([AC_PROG_MKDIR_P],
  1287. [MKDIR_P='$MKDIR_P'
  1288. ])dnl
  1289. AC_PROVIDE_IFELSE([AC_PROG_AWK],
  1290. [AWK='$AWK'
  1291. ])dnl
  1292. test -n "\$AWK" || AWK=awk
  1293. _ACEOF
  1294. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  1295. # The default lists apply if the user does not specify any file.
  1296. ac_need_defaults=:
  1297. while test $[#] != 0
  1298. do
  1299. case $[1] in
  1300. --*=?*)
  1301. ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
  1302. ac_optarg=`expr "X$[1]" : 'X[[^=]]*=\(.*\)'`
  1303. ac_shift=:
  1304. ;;
  1305. --*=)
  1306. ac_option=`expr "X$[1]" : 'X\([[^=]]*\)='`
  1307. ac_optarg=
  1308. ac_shift=:
  1309. ;;
  1310. *)
  1311. ac_option=$[1]
  1312. ac_optarg=$[2]
  1313. ac_shift=shift
  1314. ;;
  1315. esac
  1316. case $ac_option in
  1317. # Handling of the options.
  1318. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1319. ac_cs_recheck=: ;;
  1320. --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
  1321. AS_ECHO(["$ac_cs_version"]); exit ;;
  1322. --config | --confi | --conf | --con | --co | --c )
  1323. AS_ECHO(["$ac_cs_config"]); exit ;;
  1324. --debug | --debu | --deb | --de | --d | -d )
  1325. debug=: ;;
  1326. m4_ifdef([_AC_SEEN_CONFIG(FILES)], [dnl
  1327. --file | --fil | --fi | --f )
  1328. $ac_shift
  1329. case $ac_optarg in
  1330. *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
  1331. '') AC_MSG_ERROR([missing file argument]) ;;
  1332. esac
  1333. AS_VAR_APPEND([CONFIG_FILES], [" '$ac_optarg'"])
  1334. ac_need_defaults=false;;
  1335. ])dnl
  1336. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [dnl
  1337. --header | --heade | --head | --hea )
  1338. $ac_shift
  1339. case $ac_optarg in
  1340. *\'*) ac_optarg=`AS_ECHO(["$ac_optarg"]) | sed "s/'/'\\\\\\\\''/g"` ;;
  1341. esac
  1342. AS_VAR_APPEND([CONFIG_HEADERS], [" '$ac_optarg'"])
  1343. ac_need_defaults=false;;
  1344. --he | --h)
  1345. # Conflict between --help and --header
  1346. AC_MSG_ERROR([ambiguous option: `$[1]'
  1347. Try `$[0] --help' for more information.]);;
  1348. ], [ --he | --h |])dnl
  1349. --help | --hel | -h )
  1350. AS_ECHO(["$ac_cs_usage"]); exit ;;
  1351. -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  1352. | -silent | --silent | --silen | --sile | --sil | --si | --s)
  1353. ac_cs_silent=: ;;
  1354. # This is an error.
  1355. -*) AC_MSG_ERROR([unrecognized option: `$[1]'
  1356. Try `$[0] --help' for more information.]) ;;
  1357. *) AS_VAR_APPEND([ac_config_targets], [" $[1]"])
  1358. ac_need_defaults=false ;;
  1359. esac
  1360. shift
  1361. done
  1362. ac_configure_extra_args=
  1363. if $ac_cs_silent; then
  1364. exec AS_MESSAGE_FD>/dev/null
  1365. ac_configure_extra_args="$ac_configure_extra_args --silent"
  1366. fi
  1367. _ACEOF
  1368. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  1369. dnl Check this before opening the log, to avoid a bug on MinGW,
  1370. dnl which prohibits the recursive instance from truncating an open log.
  1371. if \$ac_cs_recheck; then
  1372. set X $SHELL '$[0]' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
  1373. shift
  1374. \AS_ECHO(["running CONFIG_SHELL=$SHELL \$[*]"]) >&AS_MESSAGE_FD
  1375. CONFIG_SHELL='$SHELL'
  1376. export CONFIG_SHELL
  1377. exec "\$[@]"
  1378. fi
  1379. _ACEOF
  1380. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  1381. dnl Open the log:
  1382. m4_popdef([AS_MESSAGE_LOG_FD])dnl
  1383. exec AS_MESSAGE_LOG_FD>>config.log
  1384. {
  1385. echo
  1386. AS_BOX([Running $as_me.])
  1387. AS_ECHO(["$ac_log"])
  1388. } >&AS_MESSAGE_LOG_FD
  1389. _ACEOF
  1390. cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
  1391. m4_ifdef([_AC_OUTPUT_COMMANDS_INIT],
  1392. [#
  1393. # INIT-COMMANDS
  1394. #
  1395. _AC_OUTPUT_COMMANDS_INIT
  1396. ])dnl
  1397. _ACEOF
  1398. cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
  1399. # Handling of arguments.
  1400. for ac_config_target in $ac_config_targets
  1401. do
  1402. case $ac_config_target in
  1403. m4_ifdef([_AC_LIST_TAGS], [_AC_LIST_TAGS])
  1404. *) AC_MSG_ERROR([invalid argument: `$ac_config_target']);;
  1405. esac
  1406. done
  1407. m4_ifdef([_AC_SEEN_CONFIG(ANY)], [_AC_OUTPUT_MAIN_LOOP])[]dnl
  1408. AS_EXIT(0)
  1409. _ACEOF
  1410. ])# _AC_OUTPUT_CONFIG_STATUS
  1411. # _AC_OUTPUT_MAIN_LOOP
  1412. # --------------------
  1413. # The main loop in $CONFIG_STATUS.
  1414. #
  1415. # This macro is expanded inside a here document. If the here document is
  1416. # closed, it has to be reopened with
  1417. # "cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1".
  1418. #
  1419. AC_DEFUN([_AC_OUTPUT_MAIN_LOOP],
  1420. [
  1421. # If the user did not use the arguments to specify the items to instantiate,
  1422. # then the envvar interface is used. Set only those that are not.
  1423. # We use the long form for the default assignment because of an extremely
  1424. # bizarre bug on SunOS 4.1.3.
  1425. if $ac_need_defaults; then
  1426. m4_ifdef([_AC_SEEN_CONFIG(FILES)],
  1427. [ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
  1428. ])dnl
  1429. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)],
  1430. [ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
  1431. ])dnl
  1432. m4_ifdef([_AC_SEEN_CONFIG(LINKS)],
  1433. [ test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
  1434. ])dnl
  1435. m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)],
  1436. [ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
  1437. ])dnl
  1438. fi
  1439. # Have a temporary directory for convenience. Make it in the build tree
  1440. # simply because there is no reason against having it here, and in addition,
  1441. # creating and moving files from /tmp can sometimes cause problems.
  1442. # Hook for its removal unless debugging.
  1443. # Note that there is a small window in which the directory will not be cleaned:
  1444. # after its creation but before its name has been assigned to `$tmp'.
  1445. dnl For historical reasons, AS_TMPDIR must continue to place the results
  1446. dnl in $tmp; but we swap to the namespace-clean $ac_tmp to avoid issues
  1447. dnl with any CONFIG_COMMANDS playing with the common variable name $tmp.
  1448. $debug ||
  1449. {
  1450. tmp= ac_tmp=
  1451. trap 'exit_status=$?
  1452. : "${ac_tmp:=$tmp}"
  1453. { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
  1454. ' 0
  1455. trap 'AS_EXIT([1])' 1 2 13 15
  1456. }
  1457. dnl The comment above AS_TMPDIR says at most 4 chars are allowed.
  1458. AS_TMPDIR([conf], [.])
  1459. ac_tmp=$tmp
  1460. m4_ifdef([_AC_SEEN_CONFIG(FILES)], [_AC_OUTPUT_FILES_PREPARE])[]dnl
  1461. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [_AC_OUTPUT_HEADERS_PREPARE])[]dnl
  1462. eval set X "dnl
  1463. m4_ifdef([_AC_SEEN_CONFIG(FILES)], [:F $CONFIG_FILES])[]dnl
  1464. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [:H $CONFIG_HEADERS])[]dnl
  1465. m4_ifdef([_AC_SEEN_CONFIG(LINKS)], [:L $CONFIG_LINKS])[]dnl
  1466. m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C $CONFIG_COMMANDS])[]dnl
  1467. "
  1468. shift
  1469. for ac_tag
  1470. do
  1471. case $ac_tag in
  1472. :[[FHLC]]) ac_mode=$ac_tag; continue;;
  1473. esac
  1474. case $ac_mode$ac_tag in
  1475. :[[FHL]]*:*);;
  1476. :L* | :C*:*) AC_MSG_ERROR([invalid tag `$ac_tag']);;
  1477. :[[FH]]-) ac_tag=-:-;;
  1478. :[[FH]]*) ac_tag=$ac_tag:$ac_tag.in;;
  1479. esac
  1480. ac_save_IFS=$IFS
  1481. IFS=:
  1482. set x $ac_tag
  1483. IFS=$ac_save_IFS
  1484. shift
  1485. ac_file=$[1]
  1486. shift
  1487. case $ac_mode in
  1488. :L) ac_source=$[1];;
  1489. :[[FH]])
  1490. ac_file_inputs=
  1491. for ac_f
  1492. do
  1493. case $ac_f in
  1494. -) ac_f="$ac_tmp/stdin";;
  1495. *) # Look for the file first in the build tree, then in the source tree
  1496. # (if the path is not absolute). The absolute path cannot be DOS-style,
  1497. # because $ac_f cannot contain `:'.
  1498. test -f "$ac_f" ||
  1499. case $ac_f in
  1500. [[\\/$]]*) false;;
  1501. *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
  1502. esac ||
  1503. AC_MSG_ERROR([cannot find input file: `$ac_f'], [1]);;
  1504. esac
  1505. case $ac_f in *\'*) ac_f=`AS_ECHO(["$ac_f"]) | sed "s/'/'\\\\\\\\''/g"`;; esac
  1506. AS_VAR_APPEND([ac_file_inputs], [" '$ac_f'"])
  1507. done
  1508. # Let's still pretend it is `configure' which instantiates (i.e., don't
  1509. # use $as_me), people would be surprised to read:
  1510. # /* config.h. Generated by config.status. */
  1511. configure_input='Generated from '`
  1512. AS_ECHO(["$[*]"]) | sed ['s|^[^:]*/||;s|:[^:]*/|, |g']
  1513. `' by configure.'
  1514. if test x"$ac_file" != x-; then
  1515. configure_input="$ac_file. $configure_input"
  1516. AC_MSG_NOTICE([creating $ac_file])
  1517. fi
  1518. # Neutralize special characters interpreted by sed in replacement strings.
  1519. case $configure_input in #(
  1520. *\&* | *\|* | *\\* )
  1521. ac_sed_conf_input=`AS_ECHO(["$configure_input"]) |
  1522. sed 's/[[\\\\&|]]/\\\\&/g'`;; #(
  1523. *) ac_sed_conf_input=$configure_input;;
  1524. esac
  1525. case $ac_tag in
  1526. *:-:* | *:-) cat >"$ac_tmp/stdin" \
  1527. || AC_MSG_ERROR([could not create $ac_file]) ;;
  1528. esac
  1529. ;;
  1530. esac
  1531. ac_dir=`AS_DIRNAME(["$ac_file"])`
  1532. AS_MKDIR_P(["$ac_dir"])
  1533. _AC_SRCDIRS(["$ac_dir"])
  1534. case $ac_mode in
  1535. m4_ifdef([_AC_SEEN_CONFIG(FILES)], [:F)_AC_OUTPUT_FILE ;;])
  1536. m4_ifdef([_AC_SEEN_CONFIG(HEADERS)], [:H)_AC_OUTPUT_HEADER ;;])
  1537. m4_ifdef([_AC_SEEN_CONFIG(LINKS)], [:L)_AC_OUTPUT_LINK ;;])
  1538. m4_ifdef([_AC_SEEN_CONFIG(COMMANDS)], [:C)_AC_OUTPUT_COMMAND ;;])
  1539. esac
  1540. dnl Some shells don't like empty case/esac
  1541. m4_ifdef([_AC_LIST_TAG_COMMANDS], [
  1542. case $ac_file$ac_mode in
  1543. _AC_LIST_TAG_COMMANDS
  1544. esac
  1545. ])dnl
  1546. done # for ac_tag
  1547. ])# _AC_OUTPUT_MAIN_LOOP
  1548. # AC_OUTPUT_MAKE_DEFS
  1549. # -------------------
  1550. # Set the DEFS variable to the -D options determined earlier.
  1551. # This is a subroutine of AC_OUTPUT.
  1552. # It is called inside configure, outside of config.status.
  1553. m4_define([AC_OUTPUT_MAKE_DEFS],
  1554. [[# Transform confdefs.h into DEFS.
  1555. # Protect against shell expansion while executing Makefile rules.
  1556. # Protect against Makefile macro expansion.
  1557. #
  1558. # If the first sed substitution is executed (which looks for macros that
  1559. # take arguments), then branch to the quote section. Otherwise,
  1560. # look for a macro that doesn't take arguments.
  1561. ac_script='
  1562. :mline
  1563. /\\$/{
  1564. N
  1565. s,\\\n,,
  1566. b mline
  1567. }
  1568. t clear
  1569. :clear
  1570. s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
  1571. t quote
  1572. s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
  1573. t quote
  1574. b any
  1575. :quote
  1576. s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
  1577. s/\[/\\&/g
  1578. s/\]/\\&/g
  1579. s/\$/$$/g
  1580. H
  1581. :any
  1582. ${
  1583. g
  1584. s/^\n//
  1585. s/\n/ /g
  1586. p
  1587. }
  1588. '
  1589. DEFS=`sed -n "$ac_script" confdefs.h`
  1590. ]])# AC_OUTPUT_MAKE_DEFS