general.m4 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730
  1. # This file is part of Autoconf. -*- Autoconf -*-
  2. # Parameterized macros.
  3. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
  4. # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # 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. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  18. # 02110-1301, USA.
  19. # As a special exception, the Free Software Foundation gives unlimited
  20. # permission to copy, distribute and modify the configure scripts that
  21. # are the output of Autoconf. You need not follow the terms of the GNU
  22. # General Public License when using or distributing such scripts, even
  23. # though portions of the text of Autoconf appear in them. The GNU
  24. # General Public License (GPL) does govern all other use of the material
  25. # that constitutes the Autoconf program.
  26. #
  27. # Certain portions of the Autoconf source text are designed to be copied
  28. # (in certain cases, depending on the input) into the output of
  29. # Autoconf. We call these the "data" portions. The rest of the Autoconf
  30. # source text consists of comments plus executable code that decides which
  31. # of the data portions to output in any given case. We call these
  32. # comments and executable code the "non-data" portions. Autoconf never
  33. # copies any of the non-data portions into its output.
  34. #
  35. # This special exception to the GPL applies to versions of Autoconf
  36. # released by the Free Software Foundation. When you make and
  37. # distribute a modified version of Autoconf, you may extend this special
  38. # exception to the GPL to apply to your modified version as well, *unless*
  39. # your modified version has the potential to copy into its output some
  40. # of the text that was the non-data portion of the version that you started
  41. # with. (In other words, unless your change moves or copies text from
  42. # the non-data portions to the data portions.) If your modification has
  43. # such potential, you must delete any notice of this special exception
  44. # to the GPL from your modified version.
  45. #
  46. # Written by David MacKenzie, with help from
  47. # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
  48. # Roland McGrath, Noah Friedman, david d zuhn, and many others.
  49. ## ---------------- ##
  50. ## The diversions. ##
  51. ## ---------------- ##
  52. # We heavily use m4's diversions both for the initializations and for
  53. # required macros (see AC_REQUIRE), because in both cases we have to
  54. # issue high in `configure' something which is discovered late.
  55. #
  56. # KILL is only used to suppress output.
  57. #
  58. # The layers of `configure'. We let m4 undivert them by itself, when
  59. # it reaches the end of `configure.ac'.
  60. #
  61. # - BINSH
  62. # #! /bin/sh
  63. # - HEADER-REVISION
  64. # Sent by AC_REVISION
  65. # - HEADER-COMMENT
  66. # Purpose of the script.
  67. # - HEADER-COPYRIGHT
  68. # Copyright notice(s)
  69. # - M4SH-INIT
  70. # Initialization of bottom layers.
  71. #
  72. # - DEFAULTS
  73. # early initializations (defaults)
  74. # - PARSE_ARGS
  75. # initialization code, option handling loop.
  76. #
  77. # - HELP_BEGIN
  78. # Handling `configure --help'.
  79. # - HELP_CANON
  80. # Help msg for AC_CANONICAL_*
  81. # - HELP_ENABLE
  82. # Help msg from AC_ARG_ENABLE.
  83. # - HELP_WITH
  84. # Help msg from AC_ARG_WITH.
  85. # - HELP_VAR
  86. # Help msg from AC_ARG_VAR.
  87. # - HELP_VAR_END
  88. # A small paragraph on the use of the variables.
  89. # - HELP_END
  90. # Tail of the handling of --help.
  91. #
  92. # - VERSION_BEGIN
  93. # Head of the handling of --version.
  94. # - VERSION_FSF
  95. # FSF copyright notice for --version.
  96. # - VERSION_USER
  97. # User copyright notice for --version.
  98. # - VERSION_END
  99. # Tail of the handling of --version.
  100. #
  101. # - INIT_PREPARE
  102. # Tail of initialization code.
  103. #
  104. # - BODY
  105. # the tests and output code
  106. #
  107. # _m4_divert(DIVERSION-NAME)
  108. # --------------------------
  109. # Convert a diversion name into its number. Otherwise, return
  110. # DIVERSION-NAME which is supposed to be an actual diversion number.
  111. # Of course it would be nicer to use m4_case here, instead of zillions
  112. # of little macros, but it then takes twice longer to run `autoconf'!
  113. #
  114. # From M4sugar:
  115. # -1. KILL
  116. # 10000. GROW
  117. #
  118. # From M4sh:
  119. # 0. BINSH
  120. # 1. HEADER-REVISION
  121. # 2. HEADER-COMMENT
  122. # 3. HEADER-COPYRIGHT
  123. # 4. M4SH-INIT
  124. # 1000. BODY
  125. m4_define([_m4_divert(DEFAULTS)], 10)
  126. m4_define([_m4_divert(PARSE_ARGS)], 20)
  127. m4_define([_m4_divert(HELP_BEGIN)], 100)
  128. m4_define([_m4_divert(HELP_CANON)], 101)
  129. m4_define([_m4_divert(HELP_ENABLE)], 102)
  130. m4_define([_m4_divert(HELP_WITH)], 103)
  131. m4_define([_m4_divert(HELP_VAR)], 104)
  132. m4_define([_m4_divert(HELP_VAR_END)], 105)
  133. m4_define([_m4_divert(HELP_END)], 106)
  134. m4_define([_m4_divert(VERSION_BEGIN)], 200)
  135. m4_define([_m4_divert(VERSION_FSF)], 201)
  136. m4_define([_m4_divert(VERSION_USER)], 202)
  137. m4_define([_m4_divert(VERSION_END)], 203)
  138. m4_define([_m4_divert(INIT_PREPARE)], 300)
  139. # AC_DIVERT_PUSH(DIVERSION-NAME)
  140. # AC_DIVERT_POP
  141. # ------------------------------
  142. m4_copy([m4_divert_push],[AC_DIVERT_PUSH])
  143. m4_copy([m4_divert_pop], [AC_DIVERT_POP])
  144. ## ------------------------------------ ##
  145. ## Defining/requiring Autoconf macros. ##
  146. ## ------------------------------------ ##
  147. # AC_DEFUN(NAME, EXPANSION)
  148. # AC_DEFUN_ONCE(NAME, EXPANSION)
  149. # AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME)
  150. # AC_REQUIRE(STRING)
  151. # AC_PROVIDE(MACRO-NAME)
  152. # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
  153. # -----------------------------------------------------------
  154. m4_copy([m4_defun], [AC_DEFUN])
  155. m4_copy([m4_defun_once], [AC_DEFUN_ONCE])
  156. m4_copy([m4_before], [AC_BEFORE])
  157. m4_copy([m4_require], [AC_REQUIRE])
  158. m4_copy([m4_provide], [AC_PROVIDE])
  159. m4_copy([m4_provide_if], [AC_PROVIDE_IFELSE])
  160. # AC_OBSOLETE(THIS-MACRO-NAME, [SUGGESTION])
  161. # ------------------------------------------
  162. m4_define([AC_OBSOLETE],
  163. [AC_DIAGNOSE([obsolete], [$1 is obsolete$2])])
  164. ## ----------------------------- ##
  165. ## Implementing Autoconf loops. ##
  166. ## ----------------------------- ##
  167. # AU::AC_FOREACH(VARIABLE, LIST, EXPRESSION)
  168. # ------------------------------------------
  169. AU_DEFUN([AC_FOREACH], [[m4_foreach_w($@)]])
  170. AC_DEFUN([AC_FOREACH], [m4_foreach_w($@)dnl
  171. AC_DIAGNOSE([obsolete], [The macro `AC_FOREACH' is obsolete.
  172. You should run autoupdate.])])
  173. ## ----------------------------------- ##
  174. ## Helping macros to display strings. ##
  175. ## ----------------------------------- ##
  176. # AU::AC_HELP_STRING(LHS, RHS, [COLUMN])
  177. # --------------------------------------
  178. AU_ALIAS([AC_HELP_STRING], [AS_HELP_STRING])
  179. ## ---------------------------------------------- ##
  180. ## Information on the package being Autoconf'ed. ##
  181. ## ---------------------------------------------- ##
  182. # It is suggested that the macros in this section appear before
  183. # AC_INIT in `configure.ac'. Nevertheless, this is just stylistic,
  184. # and from the implementation point of view, AC_INIT *must* be expanded
  185. # beforehand: it puts data in diversions which must appear before the
  186. # data provided by the macros of this section.
  187. # The solution is to require AC_INIT in each of these macros. AC_INIT
  188. # has the needed magic so that it can't be expanded twice.
  189. # _AC_INIT_PACKAGE(PACKAGE-NAME, VERSION, BUG-REPORT, [TARNAME])
  190. # --------------------------------------------------------------
  191. m4_define([_AC_INIT_PACKAGE],
  192. [AS_LITERAL_IF([$1], [], [m4_warn([syntax], [AC_INIT: not a literal: $1])])
  193. AS_LITERAL_IF([$2], [], [m4_warn([syntax], [AC_INIT: not a literal: $2])])
  194. AS_LITERAL_IF([$3], [], [m4_warn([syntax], [AC_INIT: not a literal: $3])])
  195. m4_ifndef([AC_PACKAGE_NAME],
  196. [m4_define([AC_PACKAGE_NAME], [$1])])
  197. m4_ifndef([AC_PACKAGE_TARNAME],
  198. [m4_define([AC_PACKAGE_TARNAME],
  199. m4_default([$4],
  200. [m4_bpatsubst(m4_tolower(m4_bpatsubst([[[$1]]],
  201. [GNU ])),
  202. [[^_abcdefghijklmnopqrstuvwxyz0123456789]],
  203. [-])]))])
  204. m4_ifndef([AC_PACKAGE_VERSION],
  205. [m4_define([AC_PACKAGE_VERSION], [$2])])
  206. m4_ifndef([AC_PACKAGE_STRING],
  207. [m4_define([AC_PACKAGE_STRING], [$1 $2])])
  208. m4_ifndef([AC_PACKAGE_BUGREPORT],
  209. [m4_define([AC_PACKAGE_BUGREPORT], [$3])])
  210. ])
  211. # AC_COPYRIGHT(TEXT, [VERSION-DIVERSION = VERSION_USER])
  212. # ------------------------------------------------------
  213. # Emit TEXT, a copyright notice, in the top of `configure' and in
  214. # --version output. Macros in TEXT are evaluated once.
  215. m4_define([AC_COPYRIGHT],
  216. [AS_COPYRIGHT([$1])[]dnl
  217. m4_divert_text(m4_default([$2], [VERSION_USER]),
  218. [
  219. $1])dnl
  220. ])# AC_COPYRIGHT
  221. # AC_REVISION(REVISION-INFO)
  222. # --------------------------
  223. # The second quote in the translit is just to cope with font-lock-mode
  224. # which sees the opening of a string.
  225. m4_define([AC_REVISION],
  226. [m4_divert_text([HEADER-REVISION],
  227. [@%:@ From __file__ m4_translit([$1], [$""]).])dnl
  228. ])
  229. ## ---------------------------------------- ##
  230. ## Requirements over the Autoconf version. ##
  231. ## ---------------------------------------- ##
  232. # AU::AC_PREREQ(VERSION)
  233. # ----------------------
  234. # Update this `AC_PREREQ' statement to require the current version of
  235. # Autoconf. But fail if ever this autoupdate is too old.
  236. #
  237. # Note that `m4_defn([m4_PACKAGE_VERSION])' below are expanded before
  238. # calling `AU_DEFUN', i.e., it is hard coded. Otherwise it would be
  239. # quite complex for autoupdate to import the value of
  240. # `m4_PACKAGE_VERSION'. We could `AU_DEFUN' `m4_PACKAGE_VERSION', but
  241. # this would replace all its occurrences with the current version of
  242. # Autoconf, which is certainly not what the user intended.
  243. AU_DEFUN([AC_PREREQ],
  244. [m4_version_prereq([$1])[]dnl
  245. [AC_PREREQ(]]m4_defn([m4_PACKAGE_VERSION])[[)]])
  246. # AC_PREREQ(VERSION)
  247. # ------------------
  248. # Complain and exit if the Autoconf version is less than VERSION.
  249. m4_copy([m4_version_prereq], [AC_PREREQ])
  250. ## ---------------- ##
  251. ## Initialization. ##
  252. ## ---------------- ##
  253. # All the following macros are used by AC_INIT. Ideally, they should
  254. # be presented in the order in which they are output. Please, help us
  255. # sorting it, or at least, don't augment the entropy.
  256. # _AC_INIT_NOTICE
  257. # ---------------
  258. m4_define([_AC_INIT_NOTICE],
  259. [m4_divert_text([HEADER-COMMENT],
  260. [@%:@ Guess values for system-dependent variables and create Makefiles.
  261. @%:@ Generated by m4_PACKAGE_STRING[]dnl
  262. m4_ifset([AC_PACKAGE_STRING], [ for AC_PACKAGE_STRING]).])
  263. m4_ifset([AC_PACKAGE_BUGREPORT],
  264. [m4_divert_text([HEADER-COMMENT],
  265. [@%:@
  266. @%:@ Report bugs to <AC_PACKAGE_BUGREPORT>.])])
  267. ])
  268. # _AC_INIT_COPYRIGHT
  269. # ------------------
  270. # We dump to VERSION_FSF to make sure we are inserted before the
  271. # user copyrights, and after the setup of the --version handling.
  272. m4_define([_AC_INIT_COPYRIGHT],
  273. [AC_COPYRIGHT(
  274. [Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
  275. 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
  276. This configure script is free software; the Free Software Foundation
  277. gives unlimited permission to copy, distribute and modify it.],
  278. [VERSION_FSF])dnl
  279. ])
  280. # File Descriptors
  281. # ----------------
  282. # Set up the file descriptors used by `configure'.
  283. # File descriptor usage:
  284. # 0 standard input (/dev/null)
  285. # 1 file creation
  286. # 2 errors and warnings
  287. # AS_MESSAGE_LOG_FD compiler messages saved in config.log
  288. # AS_MESSAGE_FD checking for... messages and results
  289. # AS_ORIGINAL_STDIN_FD original standard input (still open)
  290. #
  291. # stdin is /dev/null because checks that run programs may
  292. # inadvertently run interactive ones, which would stop configuration
  293. # until someone typed an EOF.
  294. m4_define([AS_MESSAGE_FD], 6)
  295. m4_define([AS_ORIGINAL_STDIN_FD], 7)
  296. # That's how they used to be named.
  297. AU_ALIAS([AC_FD_CC], [AS_MESSAGE_LOG_FD])
  298. AU_ALIAS([AC_FD_MSG], [AS_MESSAGE_FD])
  299. # _AC_INIT_DEFAULTS
  300. # -----------------
  301. # Values which defaults can be set from `configure.ac'.
  302. # `/bin/machine' is used in `glibcbug'. The others are used in config.*
  303. m4_define([_AC_INIT_DEFAULTS],
  304. [m4_divert_push([DEFAULTS])dnl
  305. exec AS_ORIGINAL_STDIN_FD<&0 </dev/null AS_MESSAGE_FD>&1
  306. # Name of the host.
  307. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
  308. # so uname gets run too.
  309. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
  310. #
  311. # Initializations.
  312. #
  313. ac_default_prefix=/usr/local
  314. ac_clean_files=
  315. ac_config_libobj_dir=.
  316. LIB@&t@OBJS=
  317. cross_compiling=no
  318. subdirs=
  319. MFLAGS=
  320. MAKEFLAGS=
  321. AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}])dnl
  322. AC_SUBST([PATH_SEPARATOR])dnl
  323. # Identity of this package.
  324. AC_SUBST([PACKAGE_NAME],
  325. [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])dnl
  326. AC_SUBST([PACKAGE_TARNAME],
  327. [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])dnl
  328. AC_SUBST([PACKAGE_VERSION],
  329. [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])dnl
  330. AC_SUBST([PACKAGE_STRING],
  331. [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])dnl
  332. AC_SUBST([PACKAGE_BUGREPORT],
  333. [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])dnl
  334. m4_divert_pop([DEFAULTS])dnl
  335. m4_wrap([m4_divert_text([DEFAULTS],
  336. [ac_subst_vars='m4_ifdef([_AC_SUBST_VARS], [m4_defn([_AC_SUBST_VARS])])'
  337. ac_subst_files='m4_ifdef([_AC_SUBST_FILES], [m4_defn([_AC_SUBST_FILES])])'
  338. m4_ifdef([_AC_PRECIOUS_VARS],
  339. [_AC_ARG_VAR_STORE[]dnl
  340. _AC_ARG_VAR_VALIDATE[]dnl
  341. ac_precious_vars='m4_defn([_AC_PRECIOUS_VARS])'])
  342. m4_ifdef([_AC_LIST_SUBDIRS],
  343. [ac_subdirs_all='m4_defn([_AC_LIST_SUBDIRS])'])dnl
  344. ])])dnl
  345. ])# _AC_INIT_DEFAULTS
  346. # AC_PREFIX_DEFAULT(PREFIX)
  347. # -------------------------
  348. AC_DEFUN([AC_PREFIX_DEFAULT],
  349. [m4_divert_text([DEFAULTS], [ac_default_prefix=$1])])
  350. # AC_PREFIX_PROGRAM(PROGRAM)
  351. # --------------------------
  352. # Guess the value for the `prefix' variable by looking for
  353. # the argument program along PATH and taking its parent.
  354. # Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
  355. # set `prefix' to /usr/local/gnu.
  356. # This comes too late to find a site file based on the prefix,
  357. # and it might use a cached value for the path.
  358. # No big loss, I think, since most configures don't use this macro anyway.
  359. AC_DEFUN([AC_PREFIX_PROGRAM],
  360. [if test "x$prefix" = xNONE; then
  361. dnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle.
  362. _AS_ECHO_N([checking for prefix by ])
  363. AC_PATH_PROG(ac_prefix_program, [$1])
  364. if test -n "$ac_prefix_program"; then
  365. prefix=`AS_DIRNAME(["$ac_prefix_program"])`
  366. prefix=`AS_DIRNAME(["$prefix"])`
  367. fi
  368. fi
  369. ])# AC_PREFIX_PROGRAM
  370. # AC_CONFIG_SRCDIR([UNIQUE-FILE-IN-SOURCE-DIR])
  371. # ---------------------------------------------
  372. # UNIQUE-FILE-IN-SOURCE-DIR is a file name unique to this package,
  373. # relative to the directory that configure is in, which we can look
  374. # for to find out if srcdir is correct.
  375. AC_DEFUN([AC_CONFIG_SRCDIR],
  376. [m4_divert_text([DEFAULTS], [ac_unique_file="$1"])])
  377. # _AC_INIT_DIRCHECK
  378. # -----------------
  379. # Set ac_pwd, and sanity-check it and the source and installation directories.
  380. #
  381. # (This macro is AC_REQUIREd by _AC_INIT_SRCDIR, so it has to be AC_DEFUNed.)
  382. #
  383. AC_DEFUN([_AC_INIT_DIRCHECK],
  384. [m4_divert_push([PARSE_ARGS])dnl
  385. ac_pwd=`pwd` && test -n "$ac_pwd" &&
  386. ac_ls_di=`ls -di .` &&
  387. ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
  388. AC_MSG_ERROR([Working directory cannot be determined])
  389. test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
  390. AC_MSG_ERROR([pwd does not report name of working directory])
  391. m4_divert_pop([PARSE_ARGS])dnl
  392. ])# _AC_INIT_DIRCHECK
  393. # _AC_INIT_SRCDIR
  394. # ---------------
  395. # Compute `srcdir' based on `$ac_unique_file'.
  396. #
  397. # (We have to AC_DEFUN it, since we use AC_REQUIRE.)
  398. #
  399. AC_DEFUN([_AC_INIT_SRCDIR],
  400. [AC_REQUIRE([_AC_INIT_DIRCHECK])dnl
  401. m4_divert_push([PARSE_ARGS])dnl
  402. # Find the source files, if location was not specified.
  403. if test -z "$srcdir"; then
  404. ac_srcdir_defaulted=yes
  405. # Try the directory containing this script, then the parent directory.
  406. ac_confdir=`AS_DIRNAME(["$[0]"])`
  407. srcdir=$ac_confdir
  408. if test ! -r "$srcdir/$ac_unique_file"; then
  409. srcdir=..
  410. fi
  411. else
  412. ac_srcdir_defaulted=no
  413. fi
  414. if test ! -r "$srcdir/$ac_unique_file"; then
  415. test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
  416. AC_MSG_ERROR([cannot find sources ($ac_unique_file) in $srcdir])
  417. fi
  418. ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
  419. ac_abs_confdir=`(
  420. cd "$srcdir" && test -r "./$ac_unique_file" || AC_MSG_ERROR([$ac_msg])
  421. pwd)`
  422. # When building in place, set srcdir=.
  423. if test "$ac_abs_confdir" = "$ac_pwd"; then
  424. srcdir=.
  425. fi
  426. # Remove unnecessary trailing slashes from srcdir.
  427. # Double slashes in file names in object file debugging info
  428. # mess up M-x gdb in Emacs.
  429. case $srcdir in
  430. */) srcdir=`expr "X$srcdir" : 'X\(.*[[^/]]\)' \| "X$srcdir" : 'X\(.*\)'`;;
  431. esac
  432. m4_divert_pop([PARSE_ARGS])dnl
  433. ])# _AC_INIT_SRCDIR
  434. # _AC_INIT_PARSE_ARGS
  435. # -------------------
  436. m4_define([_AC_INIT_PARSE_ARGS],
  437. [m4_divert_push([PARSE_ARGS])dnl
  438. # Initialize some variables set by options.
  439. ac_init_help=
  440. ac_init_version=false
  441. # The variables have the same names as the options, with
  442. # dashes changed to underlines.
  443. cache_file=/dev/null
  444. AC_SUBST(exec_prefix, NONE)dnl
  445. no_create=
  446. no_recursion=
  447. AC_SUBST(prefix, NONE)dnl
  448. program_prefix=NONE
  449. program_suffix=NONE
  450. AC_SUBST(program_transform_name, [s,x,x,])dnl
  451. silent=
  452. site=
  453. srcdir=
  454. verbose=
  455. x_includes=NONE
  456. x_libraries=NONE
  457. # Installation directory options.
  458. # These are left unexpanded so users can "make install exec_prefix=/foo"
  459. # and all the variables that are supposed to be based on exec_prefix
  460. # by default will actually change.
  461. # Use braces instead of parens because sh, perl, etc. also accept them.
  462. # (The list follows the same order as the GNU Coding Standards.)
  463. AC_SUBST([bindir], ['${exec_prefix}/bin'])dnl
  464. AC_SUBST([sbindir], ['${exec_prefix}/sbin'])dnl
  465. AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])dnl
  466. AC_SUBST([datarootdir], ['${prefix}/share'])dnl
  467. AC_SUBST([datadir], ['${datarootdir}'])dnl
  468. AC_SUBST([sysconfdir], ['${prefix}/etc'])dnl
  469. AC_SUBST([sharedstatedir], ['${prefix}/com'])dnl
  470. AC_SUBST([localstatedir], ['${prefix}/var'])dnl
  471. AC_SUBST([includedir], ['${prefix}/include'])dnl
  472. AC_SUBST([oldincludedir], ['/usr/include'])dnl
  473. AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
  474. ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
  475. ['${datarootdir}/doc/${PACKAGE}'])])dnl
  476. AC_SUBST([infodir], ['${datarootdir}/info'])dnl
  477. AC_SUBST([htmldir], ['${docdir}'])dnl
  478. AC_SUBST([dvidir], ['${docdir}'])dnl
  479. AC_SUBST([pdfdir], ['${docdir}'])dnl
  480. AC_SUBST([psdir], ['${docdir}'])dnl
  481. AC_SUBST([libdir], ['${exec_prefix}/lib'])dnl
  482. AC_SUBST([localedir], ['${datarootdir}/locale'])dnl
  483. AC_SUBST([mandir], ['${datarootdir}/man'])dnl
  484. ac_prev=
  485. ac_dashdash=
  486. for ac_option
  487. do
  488. # If the previous option needs an argument, assign it.
  489. if test -n "$ac_prev"; then
  490. eval $ac_prev=\$ac_option
  491. ac_prev=
  492. continue
  493. fi
  494. case $ac_option in
  495. *=*) ac_optarg=`expr "X$ac_option" : '[[^=]]*=\(.*\)'` ;;
  496. *) ac_optarg=yes ;;
  497. esac
  498. # Accept the important Cygnus configure options, so we can diagnose typos.
  499. case $ac_dashdash$ac_option in
  500. --)
  501. ac_dashdash=yes ;;
  502. -bindir | --bindir | --bindi | --bind | --bin | --bi)
  503. ac_prev=bindir ;;
  504. -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
  505. bindir=$ac_optarg ;;
  506. -build | --build | --buil | --bui | --bu)
  507. ac_prev=build_alias ;;
  508. -build=* | --build=* | --buil=* | --bui=* | --bu=*)
  509. build_alias=$ac_optarg ;;
  510. -cache-file | --cache-file | --cache-fil | --cache-fi \
  511. | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  512. ac_prev=cache_file ;;
  513. -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  514. | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  515. cache_file=$ac_optarg ;;
  516. --config-cache | -C)
  517. cache_file=config.cache ;;
  518. -datadir | --datadir | --datadi | --datad)
  519. ac_prev=datadir ;;
  520. -datadir=* | --datadir=* | --datadi=* | --datad=*)
  521. datadir=$ac_optarg ;;
  522. -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
  523. | --dataroo | --dataro | --datar)
  524. ac_prev=datarootdir ;;
  525. -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
  526. | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
  527. datarootdir=$ac_optarg ;;
  528. _AC_INIT_PARSE_ENABLE([disable], [feature], [no])
  529. -docdir | --docdir | --docdi | --doc | --do)
  530. ac_prev=docdir ;;
  531. -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
  532. docdir=$ac_optarg ;;
  533. -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
  534. ac_prev=dvidir ;;
  535. -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
  536. dvidir=$ac_optarg ;;
  537. _AC_INIT_PARSE_ENABLE([enable], [feature], [\$ac_optarg])
  538. -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  539. | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  540. | --exec | --exe | --ex)
  541. ac_prev=exec_prefix ;;
  542. -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  543. | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  544. | --exec=* | --exe=* | --ex=*)
  545. exec_prefix=$ac_optarg ;;
  546. -gas | --gas | --ga | --g)
  547. # Obsolete; use --with-gas.
  548. with_gas=yes ;;
  549. -help | --help | --hel | --he | -h)
  550. ac_init_help=long ;;
  551. -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
  552. ac_init_help=recursive ;;
  553. -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
  554. ac_init_help=short ;;
  555. -host | --host | --hos | --ho)
  556. ac_prev=host_alias ;;
  557. -host=* | --host=* | --hos=* | --ho=*)
  558. host_alias=$ac_optarg ;;
  559. -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
  560. ac_prev=htmldir ;;
  561. -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
  562. | --ht=*)
  563. htmldir=$ac_optarg ;;
  564. -includedir | --includedir | --includedi | --included | --include \
  565. | --includ | --inclu | --incl | --inc)
  566. ac_prev=includedir ;;
  567. -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  568. | --includ=* | --inclu=* | --incl=* | --inc=*)
  569. includedir=$ac_optarg ;;
  570. -infodir | --infodir | --infodi | --infod | --info | --inf)
  571. ac_prev=infodir ;;
  572. -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
  573. infodir=$ac_optarg ;;
  574. -libdir | --libdir | --libdi | --libd)
  575. ac_prev=libdir ;;
  576. -libdir=* | --libdir=* | --libdi=* | --libd=*)
  577. libdir=$ac_optarg ;;
  578. -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  579. | --libexe | --libex | --libe)
  580. ac_prev=libexecdir ;;
  581. -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  582. | --libexe=* | --libex=* | --libe=*)
  583. libexecdir=$ac_optarg ;;
  584. -localedir | --localedir | --localedi | --localed | --locale)
  585. ac_prev=localedir ;;
  586. -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
  587. localedir=$ac_optarg ;;
  588. -localstatedir | --localstatedir | --localstatedi | --localstated \
  589. | --localstate | --localstat | --localsta | --localst | --locals)
  590. ac_prev=localstatedir ;;
  591. -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  592. | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
  593. localstatedir=$ac_optarg ;;
  594. -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
  595. ac_prev=mandir ;;
  596. -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
  597. mandir=$ac_optarg ;;
  598. -nfp | --nfp | --nf)
  599. # Obsolete; use --without-fp.
  600. with_fp=no ;;
  601. -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  602. | --no-cr | --no-c | -n)
  603. no_create=yes ;;
  604. -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  605. | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  606. no_recursion=yes ;;
  607. -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  608. | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  609. | --oldin | --oldi | --old | --ol | --o)
  610. ac_prev=oldincludedir ;;
  611. -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  612. | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  613. | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
  614. oldincludedir=$ac_optarg ;;
  615. -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  616. ac_prev=prefix ;;
  617. -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  618. prefix=$ac_optarg ;;
  619. -program-prefix | --program-prefix | --program-prefi | --program-pref \
  620. | --program-pre | --program-pr | --program-p)
  621. ac_prev=program_prefix ;;
  622. -program-prefix=* | --program-prefix=* | --program-prefi=* \
  623. | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  624. program_prefix=$ac_optarg ;;
  625. -program-suffix | --program-suffix | --program-suffi | --program-suff \
  626. | --program-suf | --program-su | --program-s)
  627. ac_prev=program_suffix ;;
  628. -program-suffix=* | --program-suffix=* | --program-suffi=* \
  629. | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  630. program_suffix=$ac_optarg ;;
  631. -program-transform-name | --program-transform-name \
  632. | --program-transform-nam | --program-transform-na \
  633. | --program-transform-n | --program-transform- \
  634. | --program-transform | --program-transfor \
  635. | --program-transfo | --program-transf \
  636. | --program-trans | --program-tran \
  637. | --progr-tra | --program-tr | --program-t)
  638. ac_prev=program_transform_name ;;
  639. -program-transform-name=* | --program-transform-name=* \
  640. | --program-transform-nam=* | --program-transform-na=* \
  641. | --program-transform-n=* | --program-transform-=* \
  642. | --program-transform=* | --program-transfor=* \
  643. | --program-transfo=* | --program-transf=* \
  644. | --program-trans=* | --program-tran=* \
  645. | --progr-tra=* | --program-tr=* | --program-t=*)
  646. program_transform_name=$ac_optarg ;;
  647. -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
  648. ac_prev=pdfdir ;;
  649. -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
  650. pdfdir=$ac_optarg ;;
  651. -psdir | --psdir | --psdi | --psd | --ps)
  652. ac_prev=psdir ;;
  653. -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
  654. psdir=$ac_optarg ;;
  655. -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  656. | -silent | --silent | --silen | --sile | --sil)
  657. silent=yes ;;
  658. -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  659. ac_prev=sbindir ;;
  660. -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  661. | --sbi=* | --sb=*)
  662. sbindir=$ac_optarg ;;
  663. -sharedstatedir | --sharedstatedir | --sharedstatedi \
  664. | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  665. | --sharedst | --shareds | --shared | --share | --shar \
  666. | --sha | --sh)
  667. ac_prev=sharedstatedir ;;
  668. -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  669. | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  670. | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  671. | --sha=* | --sh=*)
  672. sharedstatedir=$ac_optarg ;;
  673. -site | --site | --sit)
  674. ac_prev=site ;;
  675. -site=* | --site=* | --sit=*)
  676. site=$ac_optarg ;;
  677. -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  678. ac_prev=srcdir ;;
  679. -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  680. srcdir=$ac_optarg ;;
  681. -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  682. | --syscon | --sysco | --sysc | --sys | --sy)
  683. ac_prev=sysconfdir ;;
  684. -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  685. | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
  686. sysconfdir=$ac_optarg ;;
  687. -target | --target | --targe | --targ | --tar | --ta | --t)
  688. ac_prev=target_alias ;;
  689. -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  690. target_alias=$ac_optarg ;;
  691. -v | -verbose | --verbose | --verbos | --verbo | --verb)
  692. verbose=yes ;;
  693. -version | --version | --versio | --versi | --vers | -V)
  694. ac_init_version=: ;;
  695. _AC_INIT_PARSE_ENABLE([with], [package], [\$ac_optarg])
  696. _AC_INIT_PARSE_ENABLE([without], [package], [no])
  697. --x)
  698. # Obsolete; use --with-x.
  699. with_x=yes ;;
  700. -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  701. | --x-incl | --x-inc | --x-in | --x-i)
  702. ac_prev=x_includes ;;
  703. -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  704. | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  705. x_includes=$ac_optarg ;;
  706. -x-libraries | --x-libraries | --x-librarie | --x-librari \
  707. | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  708. ac_prev=x_libraries ;;
  709. -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  710. | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  711. x_libraries=$ac_optarg ;;
  712. -*) AC_MSG_ERROR([unrecognized option: $ac_option
  713. Try `$[0] --help' for more information.])
  714. ;;
  715. *=*)
  716. ac_envvar=`expr "x$ac_option" : 'x\([[^=]]*\)='`
  717. # Reject names that are not valid shell variable names.
  718. expr "x$ac_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
  719. AC_MSG_ERROR([invalid variable name: $ac_envvar])
  720. eval $ac_envvar=\$ac_optarg
  721. export $ac_envvar ;;
  722. *)
  723. # FIXME: should be removed in autoconf 3.0.
  724. AC_MSG_WARN([you should use --build, --host, --target])
  725. expr "x$ac_option" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
  726. AC_MSG_WARN([invalid host type: $ac_option])
  727. : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
  728. ;;
  729. esac
  730. done
  731. if test -n "$ac_prev"; then
  732. ac_option=--`echo $ac_prev | sed 's/_/-/g'`
  733. AC_MSG_ERROR([missing argument to $ac_option])
  734. fi
  735. # Be sure to have absolute directory names.
  736. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
  737. datadir sysconfdir sharedstatedir localstatedir includedir \
  738. oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
  739. libdir localedir mandir
  740. do
  741. eval ac_val=\$$ac_var
  742. case $ac_val in
  743. [[\\/$]]* | ?:[[\\/]]* ) continue;;
  744. NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
  745. esac
  746. AC_MSG_ERROR([expected an absolute directory name for --$ac_var: $ac_val])
  747. done
  748. # There might be people who depend on the old broken behavior: `$host'
  749. # used to hold the argument of --host etc.
  750. # FIXME: To remove some day.
  751. build=$build_alias
  752. host=$host_alias
  753. target=$target_alias
  754. # FIXME: To remove some day.
  755. if test "x$host_alias" != x; then
  756. if test "x$build_alias" = x; then
  757. cross_compiling=maybe
  758. AC_MSG_WARN([If you wanted to set the --build type, don't use --host.
  759. If a cross compiler is detected then cross compile mode will be used.])
  760. elif test "x$build_alias" != "x$host_alias"; then
  761. cross_compiling=yes
  762. fi
  763. fi
  764. ac_tool_prefix=
  765. test -n "$host_alias" && ac_tool_prefix=$host_alias-
  766. test "$silent" = yes && exec AS_MESSAGE_FD>/dev/null
  767. m4_divert_pop([PARSE_ARGS])dnl
  768. ])# _AC_INIT_PARSE_ARGS
  769. # _AC_INIT_PARSE_ENABLE(OPTION-NAME, FEATURE, VALUE)
  770. # --------------------------------------------------
  771. # Handle an `--enable' or a `--with' option.
  772. #
  773. m4_define([_AC_INIT_PARSE_ENABLE],
  774. [-$1-* | --$1-*)
  775. ac_$2=`expr "x$ac_option" : 'x-*$1-\(m4_bmatch([$1], [^\(enable\|with\)$], [[[^=]]], [.])*\)'`
  776. # Reject names that are not valid shell variable names.
  777. expr "x$ac_$2" : "[.*[^-._$as_cr_alnum]]" >/dev/null &&
  778. AC_MSG_ERROR([invalid $2 name: $ac_$2])
  779. [ac_$2=`echo $ac_$2 | sed 's/[-.]/_/g'`]
  780. eval m4_bmatch([$1], [^\(enable\|disable\)$], [enable], [with])_$ac_$2=$3 ;;dnl
  781. ])
  782. # _AC_INIT_HELP
  783. # -------------
  784. # Handle the `configure --help' message.
  785. m4_define([_AC_INIT_HELP],
  786. [m4_divert_push([HELP_BEGIN])dnl
  787. #
  788. # Report the --help message.
  789. #
  790. if test "$ac_init_help" = "long"; then
  791. # Omit some internal or obsolete options to make the list less imposing.
  792. # This message is too long to be a string in the A/UX 3.1 sh.
  793. cat <<_ACEOF
  794. \`configure' configures m4_ifset([AC_PACKAGE_STRING],
  795. [AC_PACKAGE_STRING],
  796. [this package]) to adapt to many kinds of systems.
  797. Usage: $[0] [[OPTION]]... [[VAR=VALUE]]...
  798. [To assign environment variables (e.g., CC, CFLAGS...), specify them as
  799. VAR=VALUE. See below for descriptions of some of the useful variables.
  800. Defaults for the options are specified in brackets.
  801. Configuration:
  802. -h, --help display this help and exit
  803. --help=short display options specific to this package
  804. --help=recursive display the short help of all the included packages
  805. -V, --version display version information and exit
  806. -q, --quiet, --silent do not print \`checking...' messages
  807. --cache-file=FILE cache test results in FILE [disabled]
  808. -C, --config-cache alias for \`--cache-file=config.cache'
  809. -n, --no-create do not create output files
  810. --srcdir=DIR find the sources in DIR [configure dir or \`..']
  811. Installation directories:
  812. --prefix=PREFIX install architecture-independent files in PREFIX
  813. [$ac_default_prefix]
  814. --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
  815. [PREFIX]
  816. By default, \`make install' will install all the files in
  817. \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
  818. an installation prefix other than \`$ac_default_prefix' using \`--prefix',
  819. for instance \`--prefix=\$HOME'.
  820. For better control, use the options below.
  821. Fine tuning of the installation directories:
  822. --bindir=DIR user executables [EPREFIX/bin]
  823. --sbindir=DIR system admin executables [EPREFIX/sbin]
  824. --libexecdir=DIR program executables [EPREFIX/libexec]
  825. --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
  826. --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
  827. --localstatedir=DIR modifiable single-machine data [PREFIX/var]
  828. --libdir=DIR object code libraries [EPREFIX/lib]
  829. --includedir=DIR C header files [PREFIX/include]
  830. --oldincludedir=DIR C header files for non-gcc [/usr/include]
  831. --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
  832. --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
  833. --infodir=DIR info documentation [DATAROOTDIR/info]
  834. --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
  835. --mandir=DIR man documentation [DATAROOTDIR/man]
  836. --docdir=DIR documentation root ]@<:@DATAROOTDIR/doc/m4_ifset([AC_PACKAGE_TARNAME], [AC_PACKAGE_TARNAME], [PACKAGE])@:>@[
  837. --htmldir=DIR html documentation [DOCDIR]
  838. --dvidir=DIR dvi documentation [DOCDIR]
  839. --pdfdir=DIR pdf documentation [DOCDIR]
  840. --psdir=DIR ps documentation [DOCDIR]
  841. _ACEOF
  842. cat <<\_ACEOF]
  843. m4_divert_pop([HELP_BEGIN])dnl
  844. dnl The order of the diversions here is
  845. dnl - HELP_BEGIN
  846. dnl which may be extended by extra generic options such as with X or
  847. dnl AC_ARG_PROGRAM. Displayed only in long --help.
  848. dnl
  849. dnl - HELP_CANON
  850. dnl Support for cross compilation (--build, --host and --target).
  851. dnl Display only in long --help.
  852. dnl
  853. dnl - HELP_ENABLE
  854. dnl which starts with the trailer of the HELP_BEGIN, HELP_CANON section,
  855. dnl then implements the header of the non generic options.
  856. dnl
  857. dnl - HELP_WITH
  858. dnl
  859. dnl - HELP_VAR
  860. dnl
  861. dnl - HELP_VAR_END
  862. dnl
  863. dnl - HELP_END
  864. dnl initialized below, in which we dump the trailer (handling of the
  865. dnl recursion for instance).
  866. m4_divert_push([HELP_ENABLE])dnl
  867. _ACEOF
  868. fi
  869. if test -n "$ac_init_help"; then
  870. m4_ifset([AC_PACKAGE_STRING],
  871. [ case $ac_init_help in
  872. short | recursive ) echo "Configuration of AC_PACKAGE_STRING:";;
  873. esac])
  874. cat <<\_ACEOF
  875. m4_divert_pop([HELP_ENABLE])dnl
  876. m4_divert_push([HELP_END])dnl
  877. m4_ifset([AC_PACKAGE_BUGREPORT], [
  878. Report bugs to <AC_PACKAGE_BUGREPORT>.])
  879. _ACEOF
  880. ac_status=$?
  881. fi
  882. if test "$ac_init_help" = "recursive"; then
  883. # If there are subdirs, report their specific --help.
  884. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
  885. test -d "$ac_dir" || continue
  886. _AC_SRCDIRS(["$ac_dir"])
  887. cd "$ac_dir" || { ac_status=$?; continue; }
  888. # Check for guested configure.
  889. if test -f "$ac_srcdir/configure.gnu"; then
  890. echo &&
  891. $SHELL "$ac_srcdir/configure.gnu" --help=recursive
  892. elif test -f "$ac_srcdir/configure"; then
  893. echo &&
  894. $SHELL "$ac_srcdir/configure" --help=recursive
  895. else
  896. AC_MSG_WARN([no configuration information is in $ac_dir])
  897. fi || ac_status=$?
  898. cd "$ac_pwd" || { ac_status=$?; break; }
  899. done
  900. fi
  901. test -n "$ac_init_help" && exit $ac_status
  902. m4_divert_pop([HELP_END])dnl
  903. ])# _AC_INIT_HELP
  904. # _AC_INIT_VERSION
  905. # ----------------
  906. # Handle the `configure --version' message.
  907. m4_define([_AC_INIT_VERSION],
  908. [m4_divert_text([VERSION_BEGIN],
  909. [if $ac_init_version; then
  910. cat <<\_ACEOF
  911. m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])configure[]dnl
  912. m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
  913. generated by m4_PACKAGE_STRING])
  914. m4_divert_text([VERSION_END],
  915. [_ACEOF
  916. exit
  917. fi])dnl
  918. ])# _AC_INIT_VERSION
  919. # _AC_INIT_CONFIG_LOG
  920. # -------------------
  921. # Initialize the config.log file descriptor and write header to it.
  922. m4_define([_AC_INIT_CONFIG_LOG],
  923. [m4_divert_text([INIT_PREPARE],
  924. [m4_define([AS_MESSAGE_LOG_FD], 5)dnl
  925. cat >config.log <<_ACEOF
  926. This file contains any messages produced by compilers while
  927. running configure, to aid debugging if configure makes a mistake.
  928. It was created by m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])dnl
  929. $as_me[]m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]), which was
  930. generated by m4_PACKAGE_STRING. Invocation command line was
  931. $ $[0] $[@]
  932. _ACEOF
  933. exec AS_MESSAGE_LOG_FD>>config.log
  934. AS_UNAME >&AS_MESSAGE_LOG_FD
  935. cat >&AS_MESSAGE_LOG_FD <<_ACEOF
  936. m4_text_box([Core tests.])
  937. _ACEOF
  938. ])])# _AC_INIT_CONFIG_LOG
  939. # _AC_INIT_PREPARE
  940. # ----------------
  941. # Called by AC_INIT to build the preamble of the `configure' scripts.
  942. # 1. Trap and clean up various tmp files.
  943. # 2. Set up the fd and output files
  944. # 3. Remember the options given to `configure' for `config.status --recheck'.
  945. # 4. Initiates confdefs.h
  946. # 5. Loads site and cache files
  947. m4_define([_AC_INIT_PREPARE],
  948. [m4_divert_push([INIT_PREPARE])dnl
  949. # Keep a trace of the command line.
  950. # Strip out --no-create and --no-recursion so they do not pile up.
  951. # Strip out --silent because we don't want to record it for future runs.
  952. # Also quote any args containing shell meta-characters.
  953. # Make two passes to allow for proper duplicate-argument suppression.
  954. ac_configure_args=
  955. ac_configure_args0=
  956. ac_configure_args1=
  957. ac_must_keep_next=false
  958. for ac_pass in 1 2
  959. do
  960. for ac_arg
  961. do
  962. case $ac_arg in
  963. -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
  964. -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  965. | -silent | --silent | --silen | --sile | --sil)
  966. continue ;;
  967. *\'*)
  968. ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
  969. esac
  970. case $ac_pass in
  971. 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
  972. 2)
  973. ac_configure_args1="$ac_configure_args1 '$ac_arg'"
  974. dnl If trying to remove duplicates, be sure to (i) keep the *last*
  975. dnl value (e.g. --prefix=1 --prefix=2 --prefix=1 might keep 2 only),
  976. dnl and (ii) not to strip long options (--prefix foo --prefix bar might
  977. dnl give --prefix foo bar).
  978. if test $ac_must_keep_next = true; then
  979. ac_must_keep_next=false # Got value, back to normal.
  980. else
  981. case $ac_arg in
  982. dnl Use broad patterns, as arguments that would have already made configure
  983. dnl exit don't matter.
  984. *=* | --config-cache | -C | -disable-* | --disable-* \
  985. | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
  986. | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
  987. | -with-* | --with-* | -without-* | --without-* | --x)
  988. case "$ac_configure_args0 " in
  989. "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
  990. esac
  991. ;;
  992. -* ) ac_must_keep_next=true ;;
  993. esac
  994. fi
  995. ac_configure_args="$ac_configure_args '$ac_arg'"
  996. ;;
  997. esac
  998. done
  999. done
  1000. AS_UNSET(ac_configure_args0)
  1001. AS_UNSET(ac_configure_args1)
  1002. # When interrupted or exit'd, cleanup temporary files, and complete
  1003. # config.log. We remove comments because anyway the quotes in there
  1004. # would cause problems or look ugly.
  1005. # WARNING: Use '\'' to represent an apostrophe within the trap.
  1006. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
  1007. trap 'exit_status=$?
  1008. # Save into config.log some information that might help in debugging.
  1009. {
  1010. echo
  1011. AS_BOX([Cache variables.])
  1012. echo
  1013. m4_bpatsubsts(m4_defn([_AC_CACHE_DUMP]),
  1014. [^ *\(#.*\)?
  1015. ], [],
  1016. ['], ['\\''])
  1017. echo
  1018. AS_BOX([Output variables.])
  1019. echo
  1020. for ac_var in $ac_subst_vars
  1021. do
  1022. eval ac_val=\$$ac_var
  1023. case $ac_val in
  1024. *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
  1025. esac
  1026. echo "$ac_var='\''$ac_val'\''"
  1027. done | sort
  1028. echo
  1029. if test -n "$ac_subst_files"; then
  1030. AS_BOX([File substitutions.])
  1031. echo
  1032. for ac_var in $ac_subst_files
  1033. do
  1034. eval ac_val=\$$ac_var
  1035. case $ac_val in
  1036. *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
  1037. esac
  1038. echo "$ac_var='\''$ac_val'\''"
  1039. done | sort
  1040. echo
  1041. fi
  1042. if test -s confdefs.h; then
  1043. AS_BOX([confdefs.h.])
  1044. echo
  1045. cat confdefs.h
  1046. echo
  1047. fi
  1048. test "$ac_signal" != 0 &&
  1049. echo "$as_me: caught signal $ac_signal"
  1050. echo "$as_me: exit $exit_status"
  1051. } >&AS_MESSAGE_LOG_FD
  1052. rm -f core *.core core.conftest.* &&
  1053. rm -f -r conftest* confdefs* conf$[$]* $ac_clean_files &&
  1054. exit $exit_status
  1055. ' 0
  1056. for ac_signal in 1 2 13 15; do
  1057. trap 'ac_signal='$ac_signal'; AS_EXIT([1])' $ac_signal
  1058. done
  1059. ac_signal=0
  1060. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  1061. rm -f -r conftest* confdefs.h
  1062. dnl AIX cpp loses on an empty file, NextStep 3.3 (patch 3) loses on a file
  1063. dnl containing less than 14 bytes (including the newline).
  1064. dnl But the defines below solve this problem.
  1065. # Predefined preprocessor variables.
  1066. AC_DEFINE_UNQUOTED([PACKAGE_NAME], ["$PACKAGE_NAME"],
  1067. [Define to the full name of this package.])
  1068. AC_DEFINE_UNQUOTED([PACKAGE_TARNAME], ["$PACKAGE_TARNAME"],
  1069. [Define to the one symbol short name of this package.])
  1070. AC_DEFINE_UNQUOTED([PACKAGE_VERSION], ["$PACKAGE_VERSION"],
  1071. [Define to the version of this package.])
  1072. AC_DEFINE_UNQUOTED([PACKAGE_STRING], ["$PACKAGE_STRING"],
  1073. [Define to the full name and version of this package.])
  1074. AC_DEFINE_UNQUOTED([PACKAGE_BUGREPORT], ["$PACKAGE_BUGREPORT"],
  1075. [Define to the address where bug reports for this package
  1076. should be sent.])
  1077. # Let the site file select an alternate cache file if it wants to.
  1078. AC_SITE_LOAD
  1079. AC_CACHE_LOAD
  1080. m4_divert_pop([INIT_PREPARE])dnl
  1081. ])# _AC_INIT_PREPARE
  1082. # AU::AC_INIT([UNIQUE-FILE-IN-SOURCE-DIR])
  1083. # ----------------------------------------
  1084. # This macro is used only for Autoupdate.
  1085. AU_DEFUN([AC_INIT],
  1086. [m4_ifval([$2], [[AC_INIT($@)]],
  1087. [m4_ifval([$1],
  1088. [[AC_INIT]
  1089. AC_CONFIG_SRCDIR([$1])], [[AC_INIT]])])[]dnl
  1090. ])
  1091. # AC_INIT([PACKAGE, VERSION, [BUG-REPORT])
  1092. # ----------------------------------------
  1093. # Include the user macro files, prepare the diversions, and output the
  1094. # preamble of the `configure' script.
  1095. # Note that the order is important: first initialize, then set the
  1096. # AC_CONFIG_SRCDIR.
  1097. m4_define([AC_INIT],
  1098. [# Forbidden tokens and exceptions.
  1099. m4_pattern_forbid([^_?A[CHUM]_])
  1100. m4_pattern_forbid([_AC_])
  1101. m4_pattern_forbid([^LIBOBJS$],
  1102. [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
  1103. # Actually reserved by M4sh.
  1104. m4_pattern_allow([^AS_FLAGS$])
  1105. AS_INIT
  1106. AS_PREPARE
  1107. m4_ifval([$2], [_AC_INIT_PACKAGE($@)])
  1108. _AC_INIT_DEFAULTS
  1109. _AC_INIT_PARSE_ARGS
  1110. _AC_INIT_DIRCHECK
  1111. _AC_INIT_SRCDIR
  1112. _AC_INIT_HELP
  1113. _AC_INIT_VERSION
  1114. _AC_INIT_CONFIG_LOG
  1115. _AC_INIT_PREPARE
  1116. _AC_INIT_NOTICE
  1117. _AC_INIT_COPYRIGHT
  1118. m4_ifval([$2], , [m4_ifval([$1], [AC_CONFIG_SRCDIR([$1])])])dnl
  1119. dnl
  1120. dnl Substitute for predefined variables.
  1121. AC_SUBST([DEFS])dnl
  1122. AC_SUBST([ECHO_C])dnl
  1123. AC_SUBST([ECHO_N])dnl
  1124. AC_SUBST([ECHO_T])dnl
  1125. AC_SUBST([LIBS])dnl
  1126. _AC_ARG_VAR_PRECIOUS([build_alias])AC_SUBST([build_alias])dnl
  1127. _AC_ARG_VAR_PRECIOUS([host_alias])AC_SUBST([host_alias])dnl
  1128. _AC_ARG_VAR_PRECIOUS([target_alias])AC_SUBST([target_alias])dnl
  1129. dnl
  1130. AC_LANG_PUSH(C)
  1131. ])
  1132. ## ------------------------------------------------------------- ##
  1133. ## Selecting optional features, working with optional software. ##
  1134. ## ------------------------------------------------------------- ##
  1135. # AC_PRESERVE_HELP_ORDER
  1136. # ----------------------
  1137. # Emit help strings in the order given, rather than grouping all --enable-FOO
  1138. # and all --with-BAR.
  1139. AC_DEFUN([AC_PRESERVE_HELP_ORDER],
  1140. [m4_divert_once([HELP_ENABLE], [[
  1141. Optional Features and Packages:
  1142. --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
  1143. --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
  1144. --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
  1145. --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])
  1146. m4_define([_m4_divert(HELP_ENABLE)], _m4_divert(HELP_WITH))
  1147. ])# AC_PRESERVE_HELP_ORDER
  1148. # _AC_ENABLE_IF(OPTION, FEATURE, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1149. # -------------------------------------------------------------------
  1150. # Common code for AC_ARG_ENABLE and AC_ARG_WITH.
  1151. # OPTION is either "enable" or "with".
  1152. #
  1153. m4_define([_AC_ENABLE_IF],
  1154. [# Check whether --$1-$2 was given.
  1155. _AC_ENABLE_IF_ACTION([$1], m4_translit([$2], [-.], [__]), [$3], [$4])[]dnl
  1156. ])
  1157. m4_define([_AC_ENABLE_IF_ACTION],
  1158. [AS_IF([test "${$1_$2+set}" = set], [$1val=$$1_$2; $3], [$4])dnl
  1159. ])
  1160. # AC_ARG_ENABLE(FEATURE, HELP-STRING, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1161. # ------------------------------------------------------------------------
  1162. AC_DEFUN([AC_ARG_ENABLE],
  1163. [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
  1164. [],
  1165. [m4_divert_once([HELP_ENABLE], [[
  1166. Optional Features:
  1167. --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
  1168. --enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])])dnl
  1169. m4_divert_once([HELP_ENABLE], [$2])dnl
  1170. _AC_ENABLE_IF([enable], [$1], [$3], [$4])dnl
  1171. ])# AC_ARG_ENABLE
  1172. AU_DEFUN([AC_ENABLE],
  1173. [AC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])])
  1174. # AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE, [ACTION-IF-FALSE])
  1175. # --------------------------------------------------------------------
  1176. AC_DEFUN([AC_ARG_WITH],
  1177. [AC_PROVIDE_IFELSE([AC_PRESERVE_HELP_ORDER],
  1178. [],
  1179. [m4_divert_once([HELP_WITH], [[
  1180. Optional Packages:
  1181. --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
  1182. --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])])
  1183. m4_divert_once([HELP_WITH], [$2])dnl
  1184. _AC_ENABLE_IF([with], [$1], [$3], [$4])dnl
  1185. ])# AC_ARG_WITH
  1186. AU_DEFUN([AC_WITH],
  1187. [AC_ARG_WITH([$1], [ --with-$1], [$2], [$3])])
  1188. ## ----------------------------------------- ##
  1189. ## Remembering variables for reconfiguring. ##
  1190. ## ----------------------------------------- ##
  1191. # AC_ARG_VAR(VARNAME, DOCUMENTATION)
  1192. # ----------------------------------
  1193. # Register VARNAME as a precious variable, and document it in
  1194. # `configure --help' (but only once).
  1195. AC_DEFUN([AC_ARG_VAR],
  1196. [m4_divert_once([HELP_VAR], [[
  1197. Some influential environment variables:]])dnl
  1198. m4_divert_once([HELP_VAR_END], [[
  1199. Use these variables to override the choices made by `configure' or to help
  1200. it to find libraries and programs with nonstandard names/locations.]])dnl
  1201. m4_expand_once([m4_divert_text([HELP_VAR],
  1202. [AS_HELP_STRING([$1], [$2], [ ])])],
  1203. [$0($1)])dnl
  1204. AC_SUBST([$1])dnl
  1205. _AC_ARG_VAR_PRECIOUS([$1])dnl
  1206. ])# AC_ARG_VAR
  1207. # _AC_ARG_VAR_PRECIOUS(VARNAME)
  1208. # -----------------------------
  1209. # Declare VARNAME is precious.
  1210. m4_define([_AC_ARG_VAR_PRECIOUS],
  1211. [m4_append_uniq([_AC_PRECIOUS_VARS], [$1], [
  1212. ])dnl
  1213. ])
  1214. # _AC_ARG_VAR_STORE
  1215. # -----------------
  1216. # We try to diagnose when precious variables have changed. To do this,
  1217. # make two early snapshots (after the option processing to take
  1218. # explicit variables into account) of those variables: one (ac_env_)
  1219. # which represents the current run, and a second (ac_cv_env_) which,
  1220. # at the first run, will be saved in the cache. As an exception to
  1221. # the cache mechanism, its loading will override these variables (non
  1222. # `ac_cv_env_' cache value are only set when unset).
  1223. #
  1224. # In subsequent runs, after having loaded the cache, compare
  1225. # ac_cv_env_foo against ac_env_foo. See _AC_ARG_VAR_VALIDATE.
  1226. m4_define([_AC_ARG_VAR_STORE],
  1227. [m4_divert_text([PARSE_ARGS],
  1228. [for ac_var in $ac_precious_vars; do
  1229. eval ac_env_${ac_var}_set=\${${ac_var}+set}
  1230. eval ac_env_${ac_var}_value=\$${ac_var}
  1231. eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
  1232. eval ac_cv_env_${ac_var}_value=\$${ac_var}
  1233. done])dnl
  1234. ])
  1235. # _AC_ARG_VAR_VALIDATE
  1236. # --------------------
  1237. # The precious variables are saved twice at the beginning of
  1238. # configure. E.g., PRECIOUS is saved as `ac_env_PRECIOUS_set' and
  1239. # `ac_env_PRECIOUS_value' on the one hand and `ac_cv_env_PRECIOUS_set'
  1240. # and `ac_cv_env_PRECIOUS_value' on the other hand.
  1241. #
  1242. # Now the cache has just been loaded, so `ac_cv_env_' represents the
  1243. # content of the cached values, while `ac_env_' represents that of the
  1244. # current values.
  1245. #
  1246. # So we check that `ac_env_' and `ac_cv_env_' are consistent. If
  1247. # they aren't, die.
  1248. m4_define([_AC_ARG_VAR_VALIDATE],
  1249. [m4_divert_text([INIT_PREPARE],
  1250. [# Check that the precious variables saved in the cache have kept the same
  1251. # value.
  1252. ac_cache_corrupted=false
  1253. for ac_var in $ac_precious_vars; do
  1254. eval ac_old_set=\$ac_cv_env_${ac_var}_set
  1255. eval ac_new_set=\$ac_env_${ac_var}_set
  1256. eval ac_old_val=\$ac_cv_env_${ac_var}_value
  1257. eval ac_new_val=\$ac_env_${ac_var}_value
  1258. case $ac_old_set,$ac_new_set in
  1259. set,)
  1260. AS_MESSAGE([error: `$ac_var' was set to `$ac_old_val' in the previous run], 2)
  1261. ac_cache_corrupted=: ;;
  1262. ,set)
  1263. AS_MESSAGE([error: `$ac_var' was not set in the previous run], 2)
  1264. ac_cache_corrupted=: ;;
  1265. ,);;
  1266. *)
  1267. if test "x$ac_old_val" != "x$ac_new_val"; then
  1268. AS_MESSAGE([error: `$ac_var' has changed since the previous run:], 2)
  1269. AS_MESSAGE([ former value: $ac_old_val], 2)
  1270. AS_MESSAGE([ current value: $ac_new_val], 2)
  1271. ac_cache_corrupted=:
  1272. fi;;
  1273. esac
  1274. # Pass precious variables to config.status.
  1275. if test "$ac_new_set" = set; then
  1276. case $ac_new_val in
  1277. *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
  1278. *) ac_arg=$ac_var=$ac_new_val ;;
  1279. esac
  1280. case " $ac_configure_args " in
  1281. *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
  1282. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  1283. esac
  1284. fi
  1285. done
  1286. if $ac_cache_corrupted; then
  1287. AS_MESSAGE([error: changes in the environment can compromise the build], 2)
  1288. AS_ERROR([run `make distclean' and/or `rm $cache_file' and start over])
  1289. fi])dnl
  1290. ])# _AC_ARG_VAR_VALIDATE
  1291. ## ---------------------------- ##
  1292. ## Transforming program names. ##
  1293. ## ---------------------------- ##
  1294. # AC_ARG_PROGRAM
  1295. # --------------
  1296. # This macro is expanded only once, to avoid that `foo' ends up being
  1297. # installed as `ggfoo'.
  1298. AC_DEFUN_ONCE([AC_ARG_PROGRAM],
  1299. [dnl Document the options.
  1300. m4_divert_push([HELP_BEGIN])dnl
  1301. Program names:
  1302. --program-prefix=PREFIX prepend PREFIX to installed program names
  1303. --program-suffix=SUFFIX append SUFFIX to installed program names
  1304. --program-transform-name=PROGRAM run sed PROGRAM on installed program names
  1305. m4_divert_pop([HELP_BEGIN])dnl
  1306. test "$program_prefix" != NONE &&
  1307. program_transform_name="s&^&$program_prefix&;$program_transform_name"
  1308. # Use a double $ so make ignores it.
  1309. test "$program_suffix" != NONE &&
  1310. program_transform_name="s&\$&$program_suffix&;$program_transform_name"
  1311. # Double any \ or $. echo might interpret backslashes.
  1312. # By default was `s,x,x', remove it if useless.
  1313. cat <<\_ACEOF >conftest.sed
  1314. [s/[\\$]/&&/g;s/;s,x,x,$//]
  1315. _ACEOF
  1316. program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
  1317. rm -f conftest.sed
  1318. ])# AC_ARG_PROGRAM
  1319. ## ------------------------- ##
  1320. ## Finding auxiliary files. ##
  1321. ## ------------------------- ##
  1322. # AC_CONFIG_AUX_DIR(DIR)
  1323. # ----------------------
  1324. # Find install-sh, config.sub, config.guess, and Cygnus configure
  1325. # in directory DIR. These are auxiliary files used in configuration.
  1326. # DIR can be either absolute or relative to $srcdir.
  1327. AC_DEFUN([AC_CONFIG_AUX_DIR],
  1328. [AC_CONFIG_AUX_DIRS($1 "$srcdir"/$1)])
  1329. # AC_CONFIG_AUX_DIR_DEFAULT
  1330. # -------------------------
  1331. # The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'.
  1332. # There's no need to call this macro explicitly; just AC_REQUIRE it.
  1333. AC_DEFUN([AC_CONFIG_AUX_DIR_DEFAULT],
  1334. [AC_CONFIG_AUX_DIRS("$srcdir" "$srcdir/.." "$srcdir/../..")])
  1335. # AC_CONFIG_AUX_DIRS(DIR ...)
  1336. # ---------------------------
  1337. # Internal subroutine.
  1338. # Search for the configuration auxiliary files in directory list $1.
  1339. # We look only for install-sh, so users of AC_PROG_INSTALL
  1340. # do not automatically need to distribute the other auxiliary files.
  1341. AC_DEFUN([AC_CONFIG_AUX_DIRS],
  1342. [ac_aux_dir=
  1343. for ac_dir in $1; do
  1344. if test -f "$ac_dir/install-sh"; then
  1345. ac_aux_dir=$ac_dir
  1346. ac_install_sh="$ac_aux_dir/install-sh -c"
  1347. break
  1348. elif test -f "$ac_dir/install.sh"; then
  1349. ac_aux_dir=$ac_dir
  1350. ac_install_sh="$ac_aux_dir/install.sh -c"
  1351. break
  1352. elif test -f "$ac_dir/shtool"; then
  1353. ac_aux_dir=$ac_dir
  1354. ac_install_sh="$ac_aux_dir/shtool install -c"
  1355. break
  1356. fi
  1357. done
  1358. if test -z "$ac_aux_dir"; then
  1359. AC_MSG_ERROR([cannot find install-sh or install.sh in $1])
  1360. fi
  1361. # These three variables are undocumented and unsupported,
  1362. # and are intended to be withdrawn in a future Autoconf release.
  1363. # They can cause serious problems if a builder's source tree is in a directory
  1364. # whose full name contains unusual characters.
  1365. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
  1366. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
  1367. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
  1368. AC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  1369. ])# AC_CONFIG_AUX_DIRS
  1370. ## ------------------------ ##
  1371. ## Finding aclocal macros. ##
  1372. ## ------------------------ ##
  1373. # AC_CONFIG_MACRO_DIR(DIR)
  1374. # ------------------------
  1375. # Declare directory containing additional macros for aclocal.
  1376. AC_DEFUN([AC_CONFIG_MACRO_DIR], [])
  1377. ## --------------------- ##
  1378. ## Requiring aux files. ##
  1379. ## --------------------- ##
  1380. # AC_REQUIRE_AUX_FILE(FILE)
  1381. # -------------------------
  1382. # This macro does nothing, it's a hook to be read with `autoconf --trace'.
  1383. # It announces FILE is required in the auxdir.
  1384. m4_define([AC_REQUIRE_AUX_FILE],
  1385. [AS_LITERAL_IF([$1], [],
  1386. [AC_FATAL([$0: requires a literal argument])])])
  1387. ## ----------------------------------- ##
  1388. ## Getting the canonical system type. ##
  1389. ## ----------------------------------- ##
  1390. # The inputs are:
  1391. # configure --host=HOST --target=TARGET --build=BUILD
  1392. #
  1393. # The rules are:
  1394. # 1. Build defaults to the current platform, as determined by config.guess.
  1395. # 2. Host defaults to build.
  1396. # 3. Target defaults to host.
  1397. # _AC_CANONICAL_SPLIT(THING)
  1398. # --------------------------
  1399. # Generate the variables THING, THING_{alias cpu vendor os}.
  1400. m4_define([_AC_CANONICAL_SPLIT],
  1401. [case $ac_cv_$1 in
  1402. *-*-*) ;;
  1403. *) AC_MSG_ERROR([invalid value of canonical $1]);;
  1404. esac
  1405. AC_SUBST([$1], [$ac_cv_$1])dnl
  1406. ac_save_IFS=$IFS; IFS='-'
  1407. set x $ac_cv_$1
  1408. shift
  1409. AC_SUBST([$1_cpu], [$[1]])dnl
  1410. AC_SUBST([$1_vendor], [$[2]])dnl
  1411. shift; shift
  1412. [# Remember, the first character of IFS is used to create $]*,
  1413. # except with old shells:
  1414. $1_os=$[*]
  1415. IFS=$ac_save_IFS
  1416. case $$1_os in *\ *) $1_os=`echo "$$1_os" | sed 's/ /-/g'`;; esac
  1417. AC_SUBST([$1_os])dnl
  1418. ])# _AC_CANONICAL_SPLIT
  1419. # AC_CANONICAL_BUILD
  1420. # ------------------
  1421. AC_DEFUN([AC_CANONICAL_BUILD],
  1422. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  1423. AC_REQUIRE_AUX_FILE([config.sub])dnl
  1424. AC_REQUIRE_AUX_FILE([config.guess])dnl
  1425. m4_divert_once([HELP_CANON],
  1426. [[
  1427. System types:
  1428. --build=BUILD configure for building on BUILD [guessed]]])dnl
  1429. # Make sure we can run config.sub.
  1430. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
  1431. AC_MSG_ERROR([cannot run $SHELL $ac_aux_dir/config.sub])
  1432. AC_CACHE_CHECK([build system type], [ac_cv_build],
  1433. [ac_build_alias=$build_alias
  1434. test "x$ac_build_alias" = x &&
  1435. ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
  1436. test "x$ac_build_alias" = x &&
  1437. AC_MSG_ERROR([cannot guess build type; you must specify one])
  1438. ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
  1439. AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $ac_build_alias failed])
  1440. ])
  1441. _AC_CANONICAL_SPLIT(build)
  1442. ])# AC_CANONICAL_BUILD
  1443. # AC_CANONICAL_HOST
  1444. # -----------------
  1445. AC_DEFUN([AC_CANONICAL_HOST],
  1446. [AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  1447. m4_divert_once([HELP_CANON],
  1448. [[ --host=HOST cross-compile to build programs to run on HOST [BUILD]]])dnl
  1449. AC_CACHE_CHECK([host system type], [ac_cv_host],
  1450. [if test "x$host_alias" = x; then
  1451. ac_cv_host=$ac_cv_build
  1452. else
  1453. ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
  1454. AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $host_alias failed])
  1455. fi
  1456. ])
  1457. _AC_CANONICAL_SPLIT([host])
  1458. ])# AC_CANONICAL_HOST
  1459. # AC_CANONICAL_TARGET
  1460. # -------------------
  1461. AC_DEFUN([AC_CANONICAL_TARGET],
  1462. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  1463. AC_BEFORE([$0], [AC_ARG_PROGRAM])dnl
  1464. m4_divert_once([HELP_CANON],
  1465. [[ --target=TARGET configure for building compilers for TARGET [HOST]]])dnl
  1466. AC_CACHE_CHECK([target system type], [ac_cv_target],
  1467. [if test "x$target_alias" = x; then
  1468. ac_cv_target=$ac_cv_host
  1469. else
  1470. ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
  1471. AC_MSG_ERROR([$SHELL $ac_aux_dir/config.sub $target_alias failed])
  1472. fi
  1473. ])
  1474. _AC_CANONICAL_SPLIT([target])
  1475. # The aliases save the names the user supplied, while $host etc.
  1476. # will get canonicalized.
  1477. test -n "$target_alias" &&
  1478. test "$program_prefix$program_suffix$program_transform_name" = \
  1479. NONENONEs,x,x, &&
  1480. program_prefix=${target_alias}-[]dnl
  1481. ])# AC_CANONICAL_TARGET
  1482. AU_ALIAS([AC_CANONICAL_SYSTEM], [AC_CANONICAL_TARGET])
  1483. # AU::AC_VALIDATE_CACHED_SYSTEM_TUPLE([CMD])
  1484. # ------------------------------------------
  1485. # If the cache file is inconsistent with the current host,
  1486. # target and build system types, execute CMD or print a default
  1487. # error message. Now handled via _AC_ARG_VAR_PRECIOUS.
  1488. AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPLE], [])
  1489. ## ---------------------- ##
  1490. ## Caching test results. ##
  1491. ## ---------------------- ##
  1492. # AC_SITE_LOAD
  1493. # ------------
  1494. # Look for site or system specific initialization scripts.
  1495. m4_define([AC_SITE_LOAD],
  1496. [# Prefer explicitly selected file to automatically selected ones.
  1497. if test -n "$CONFIG_SITE"; then
  1498. set x "$CONFIG_SITE"
  1499. elif test "x$prefix" != xNONE; then
  1500. set x "$prefix/share/config.site" "$prefix/etc/config.site"
  1501. else
  1502. set x "$ac_default_prefix/share/config.site" \
  1503. "$ac_default_prefix/etc/config.site"
  1504. fi
  1505. shift
  1506. for ac_site_file
  1507. do
  1508. if test -r "$ac_site_file"; then
  1509. AC_MSG_NOTICE([loading site script $ac_site_file])
  1510. sed 's/^/| /' "$ac_site_file" >&AS_MESSAGE_LOG_FD
  1511. . "$ac_site_file"
  1512. fi
  1513. done
  1514. ])
  1515. # AC_CACHE_LOAD
  1516. # -------------
  1517. m4_define([AC_CACHE_LOAD],
  1518. [if test -r "$cache_file"; then
  1519. # Some versions of bash will fail to source /dev/null (special
  1520. # files actually), so we avoid doing that.
  1521. if test -f "$cache_file"; then
  1522. AC_MSG_NOTICE([loading cache $cache_file])
  1523. case $cache_file in
  1524. [[\\/]]* | ?:[[\\/]]* ) . "$cache_file";;
  1525. *) . "./$cache_file";;
  1526. esac
  1527. fi
  1528. else
  1529. AC_MSG_NOTICE([creating cache $cache_file])
  1530. >$cache_file
  1531. fi
  1532. ])# AC_CACHE_LOAD
  1533. # _AC_CACHE_DUMP
  1534. # --------------
  1535. # Dump the cache to stdout. It can be in a pipe (this is a requirement).
  1536. m4_define([_AC_CACHE_DUMP],
  1537. [# The following way of writing the cache mishandles newlines in values,
  1538. # but we know of no workaround that is simple, portable, and efficient.
  1539. # So, we kill variables containing newlines.
  1540. # Ultrix sh set writes to stderr and can't be redirected directly,
  1541. # and sets the high bit in the cache file unless we assign to the vars.
  1542. (
  1543. for ac_var in `(set) 2>&1 | sed -n ['s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p']`; do
  1544. eval ac_val=\$$ac_var
  1545. case $ac_val in #(
  1546. *${as_nl}*)
  1547. case $ac_var in #(
  1548. *_cv_*) AC_MSG_WARN([Cache variable $ac_var contains a newline.]) ;;
  1549. esac
  1550. case $ac_var in #(
  1551. _ | IFS | as_nl) ;; #(
  1552. *) $as_unset $ac_var ;;
  1553. esac ;;
  1554. esac
  1555. done
  1556. (set) 2>&1 |
  1557. case $as_nl`(ac_space=' '; set) 2>&1` in #(
  1558. *${as_nl}ac_space=\ *)
  1559. # `set' does not quote correctly, so add quotes (double-quote
  1560. # substitution turns \\\\ into \\, and sed turns \\ into \).
  1561. sed -n \
  1562. ["s/'/'\\\\''/g;
  1563. s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"]
  1564. ;; #(
  1565. *)
  1566. # `set' quotes correctly as required by POSIX, so do not add quotes.
  1567. sed -n ["/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"]
  1568. ;;
  1569. esac |
  1570. sort
  1571. )dnl
  1572. ])# _AC_CACHE_DUMP
  1573. # AC_CACHE_SAVE
  1574. # -------------
  1575. # Save the cache.
  1576. # Allow a site initialization script to override cache values.
  1577. m4_define([AC_CACHE_SAVE],
  1578. [cat >confcache <<\_ACEOF
  1579. # This file is a shell script that caches the results of configure
  1580. # tests run on this system so they can be shared between configure
  1581. # scripts and configure runs, see configure's option --config-cache.
  1582. # It is not useful on other systems. If it contains results you don't
  1583. # want to keep, you may remove or edit it.
  1584. #
  1585. # config.status only pays attention to the cache file if you give it
  1586. # the --recheck option to rerun configure.
  1587. #
  1588. # `ac_cv_env_foo' variables (set or unset) will be overridden when
  1589. # loading this file, other *unset* `ac_cv_foo' will be assigned the
  1590. # following values.
  1591. _ACEOF
  1592. _AC_CACHE_DUMP() |
  1593. sed ['
  1594. /^ac_cv_env_/b end
  1595. t clear
  1596. :clear
  1597. s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
  1598. t end
  1599. s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
  1600. :end'] >>confcache
  1601. if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
  1602. if test -w "$cache_file"; then
  1603. test "x$cache_file" != "x/dev/null" &&
  1604. AC_MSG_NOTICE([updating cache $cache_file])
  1605. cat confcache >$cache_file
  1606. else
  1607. AC_MSG_NOTICE([not updating unwritable cache $cache_file])
  1608. fi
  1609. fi
  1610. rm -f confcache[]dnl
  1611. ])# AC_CACHE_SAVE
  1612. # AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT)
  1613. # ------------------------------------------
  1614. # The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
  1615. # Should be dnl'ed. Try to catch common mistakes.
  1616. m4_defun([AC_CACHE_VAL],
  1617. [m4_bmatch([$2], [AC_DEFINE],
  1618. [AC_DIAGNOSE([syntax],
  1619. [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
  1620. [where no actions should be taken])])dnl
  1621. AS_VAR_SET_IF([$1],
  1622. [_AS_ECHO_N([(cached) ])],
  1623. [$2])])
  1624. # AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS)
  1625. # -------------------------------------------
  1626. # Do not call this macro with a dnl right behind.
  1627. m4_defun([AC_CACHE_CHECK],
  1628. [AC_MSG_CHECKING([$1])
  1629. AC_CACHE_VAL([$2], [$3])dnl
  1630. AS_LITERAL_IF([$2],
  1631. [AC_MSG_RESULT([$$2])],
  1632. [ac_res=AS_VAR_GET([$2])
  1633. AC_MSG_RESULT([$ac_res])])dnl
  1634. ])
  1635. # _AC_CACHE_CHECK_INT(MESSAGE, CACHE-ID, EXPRESSION,
  1636. # [PROLOGUE = DEFAULT-INCLUDES], [IF-FAILS])
  1637. # -------------------------------------------------------------
  1638. AC_DEFUN([_AC_CACHE_CHECK_INT],
  1639. [AC_CACHE_CHECK([$1], [$2],
  1640. [AC_COMPUTE_INT([$2], [$3], [$4], [$5])])
  1641. ])# _AC_CACHE_CHECK_INT
  1642. ## ---------------------- ##
  1643. ## Defining CPP symbols. ##
  1644. ## ---------------------- ##
  1645. # AC_DEFINE_TRACE_LITERAL(LITERAL-CPP-SYMBOL)
  1646. # -------------------------------------------
  1647. # Used by --trace to collect the list of AC_DEFINEd macros.
  1648. m4_define([AC_DEFINE_TRACE_LITERAL],
  1649. [m4_pattern_allow([^$1$])])
  1650. # AC_DEFINE_TRACE(CPP-SYMBOL)
  1651. # ---------------------------
  1652. # This macro is a wrapper around AC_DEFINE_TRACE_LITERAL which filters
  1653. # out non literal symbols.
  1654. m4_define([AC_DEFINE_TRACE],
  1655. [AS_LITERAL_IF([$1], [AC_DEFINE_TRACE_LITERAL([$1])])])
  1656. # AC_DEFINE(VARIABLE, [VALUE], [DESCRIPTION])
  1657. # -------------------------------------------
  1658. # Set VARIABLE to VALUE, verbatim, or 1. Remember the value
  1659. # and if VARIABLE is affected the same VALUE, do nothing, else
  1660. # die. The third argument is used by autoheader.
  1661. m4_define([AC_DEFINE], [_AC_DEFINE_Q([\], $@)])
  1662. # AC_DEFINE_UNQUOTED(VARIABLE, [VALUE], [DESCRIPTION])
  1663. # ----------------------------------------------------
  1664. # Similar, but perform shell substitutions $ ` \ once on VALUE.
  1665. m4_define([AC_DEFINE_UNQUOTED], [_AC_DEFINE_Q([], $@)])
  1666. # _AC_DEFINE_Q(QUOTE, VARIABLE, [VALUE], [DESCRIPTION])
  1667. # -----------------------------------------------------
  1668. m4_define([_AC_DEFINE_Q],
  1669. [AC_DEFINE_TRACE([$2])dnl
  1670. m4_ifval([$4], [AH_TEMPLATE(m4_bpatsubst([[$2]], [(.*)]), [$4])])dnl
  1671. cat >>confdefs.h <<$1_ACEOF
  1672. [@%:@define] $2 m4_if($#, 2, 1, [$3])
  1673. _ACEOF
  1674. ])
  1675. ## -------------------------- ##
  1676. ## Setting output variables. ##
  1677. ## -------------------------- ##
  1678. # AC_SUBST_TRACE(VARIABLE)
  1679. # ------------------------
  1680. # This macro is used with --trace to collect the list of substituted variables.
  1681. m4_define([AC_SUBST_TRACE])
  1682. # AC_SUBST(VARIABLE, [VALUE])
  1683. # ---------------------------
  1684. # Create an output variable from a shell VARIABLE. If VALUE is given
  1685. # assign it to VARIABLE. Use `""' is you want to set VARIABLE to an
  1686. # empty value, not an empty second argument.
  1687. #
  1688. m4_define([AC_SUBST],
  1689. [AC_SUBST_TRACE([$1])dnl
  1690. m4_pattern_allow([^$1$])dnl
  1691. m4_ifvaln([$2], [$1=$2])[]dnl
  1692. m4_append_uniq([_AC_SUBST_VARS], [$1], [
  1693. ])dnl
  1694. ])# AC_SUBST
  1695. # AC_SUBST_FILE(VARIABLE)
  1696. # -----------------------
  1697. # Read the comments of the preceding macro.
  1698. m4_define([AC_SUBST_FILE],
  1699. [m4_pattern_allow([^$1$])dnl
  1700. m4_append_uniq([_AC_SUBST_FILES], [$1], [
  1701. ])])
  1702. ## --------------------------------------- ##
  1703. ## Printing messages at autoconf runtime. ##
  1704. ## --------------------------------------- ##
  1705. # In fact, I think we should promote the use of m4_warn and m4_fatal
  1706. # directly. This will also avoid to some people to get it wrong
  1707. # between AC_FATAL and AC_MSG_ERROR.
  1708. # AC_DIAGNOSE(CATEGORY, MESSAGE)
  1709. # AC_FATAL(MESSAGE, [EXIT-STATUS])
  1710. # --------------------------------
  1711. m4_define([AC_DIAGNOSE], [m4_warn($@)])
  1712. m4_define([AC_FATAL], [m4_fatal($@)])
  1713. # AC_WARNING(MESSAGE)
  1714. # -------------------
  1715. # Report a MESSAGE to the user of autoconf if `-W' or `-W all' was
  1716. # specified.
  1717. m4_define([AC_WARNING],
  1718. [AC_DIAGNOSE([syntax], [$1])])
  1719. ## ---------------------------------------- ##
  1720. ## Printing messages at configure runtime. ##
  1721. ## ---------------------------------------- ##
  1722. # AC_MSG_CHECKING(FEATURE)
  1723. # ------------------------
  1724. m4_define([AC_MSG_CHECKING],
  1725. [{ _AS_ECHO_LOG([checking $1])
  1726. _AS_ECHO_N([checking $1... ]); }dnl
  1727. ])
  1728. # AC_MSG_RESULT(RESULT)
  1729. # ---------------------
  1730. m4_define([AC_MSG_RESULT],
  1731. [{ _AS_ECHO_LOG([result: $1])
  1732. _AS_ECHO([${ECHO_T}$1]); }dnl
  1733. ])
  1734. # AC_MSG_WARN(PROBLEM)
  1735. # AC_MSG_NOTICE(STRING)
  1736. # AC_MSG_ERROR(ERROR, [EXIT-STATUS = 1])
  1737. # AC_MSG_FAILURE(ERROR, [EXIT-STATUS = 1])
  1738. # ----------------------------------------
  1739. m4_copy([AS_WARN], [AC_MSG_WARN])
  1740. m4_copy([AS_MESSAGE], [AC_MSG_NOTICE])
  1741. m4_copy([AS_ERROR], [AC_MSG_ERROR])
  1742. m4_define([AC_MSG_FAILURE],
  1743. [AC_MSG_ERROR([$1
  1744. See `config.log' for more details.], [$2])])
  1745. # _AC_MSG_LOG_CONFTEST
  1746. # --------------------
  1747. m4_define([_AC_MSG_LOG_CONFTEST],
  1748. [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD
  1749. sed 's/^/| /' conftest.$ac_ext >&AS_MESSAGE_LOG_FD
  1750. ])
  1751. # AU::AC_CHECKING(FEATURE)
  1752. # ------------------------
  1753. AU_DEFUN([AC_CHECKING],
  1754. [AS_MESSAGE([checking $1...])])
  1755. # AU::AC_MSG_RESULT_UNQUOTED(RESULT)
  1756. # ----------------------------------
  1757. # No escaping, so it performed also backtick substitution.
  1758. AU_DEFUN([AC_MSG_RESULT_UNQUOTED],
  1759. [_AS_ECHO_UNQUOTED([$as_me:$LINENO: result: $1], AS_MESSAGE_LOG_FD)
  1760. _AS_ECHO_UNQUOTED([${ECHO_T}$1])[]dnl
  1761. ])
  1762. # AU::AC_VERBOSE(STRING)
  1763. # ----------------------
  1764. AU_ALIAS([AC_VERBOSE], [AC_MSG_RESULT])
  1765. ## ---------------------------- ##
  1766. ## Compiler-running mechanics. ##
  1767. ## ---------------------------- ##
  1768. # _AC_RUN_LOG(COMMAND, LOG-COMMANDS)
  1769. # ----------------------------------
  1770. # Eval COMMAND, save the exit status in ac_status, and log it.
  1771. AC_DEFUN([_AC_RUN_LOG],
  1772. [{ ($2) >&AS_MESSAGE_LOG_FD
  1773. ($1) 2>&AS_MESSAGE_LOG_FD
  1774. ac_status=$?
  1775. _AS_ECHO_LOG([\$? = $ac_status])
  1776. (exit $ac_status); }])
  1777. # _AC_RUN_LOG_STDERR(COMMAND, LOG-COMMANDS)
  1778. # -----------------------------------------
  1779. # Run COMMAND, save its stderr into conftest.err, save the exit status
  1780. # in ac_status, and log it. Don't forget to clean up conftest.err after
  1781. # use.
  1782. # Note that when tracing, most shells will leave the traces in stderr
  1783. # starting with "+": that's what this macro tries to address.
  1784. AC_DEFUN([_AC_RUN_LOG_STDERR],
  1785. [{ ($2) >&AS_MESSAGE_LOG_FD
  1786. ($1) 2>conftest.er1
  1787. ac_status=$?
  1788. grep -v '^ *+' conftest.er1 >conftest.err
  1789. rm -f conftest.er1
  1790. cat conftest.err >&AS_MESSAGE_LOG_FD
  1791. _AS_ECHO_LOG([\$? = $ac_status])
  1792. (exit $ac_status); }])
  1793. # _AC_DO_ECHO(COMMAND)
  1794. # --------------------
  1795. # Echo COMMAND. This is designed to be used just before evaluating COMMAND.
  1796. AC_DEFUN([_AC_DO_ECHO],
  1797. [m4_if([$1], [$ac_try], [], [ac_try="$1"
  1798. ])dnl
  1799. dnl If the string contains '"', '`', or '\', then just echo it rather
  1800. dnl than expanding it. This is a hack, but it is safer, while also
  1801. dnl typically expanding simple substrings like '$CC', which is what we want.
  1802. dnl
  1803. dnl The rest of this macro body is quoted, to work around misuses like
  1804. dnl `AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))',
  1805. dnl which underquotes the 3rd arg and would misbehave if we didn't quote here.
  1806. dnl The "(($ac_try" instead of $ac_try avoids problems with even-worse
  1807. dnl underquoting misuses, such as
  1808. dnl `AC_CHECK_FUNC(foo, , AC_CHECK_LIB(a, foo, , AC_CHECK_LIB(b, foo)))'.
  1809. dnl We normally wouldn't bother with this kind of workaround for invalid code
  1810. dnl but this change was put in just before Autoconf 2.60 and we wanted to
  1811. dnl minimize the integration hassle.
  1812. [case "(($ac_try" in
  1813. *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
  1814. *) ac_try_echo=$ac_try;;
  1815. esac
  1816. eval "echo \"\$as_me:$LINENO: $ac_try_echo\""]])
  1817. # _AC_DO(COMMAND)
  1818. # ---------------
  1819. # Eval COMMAND, save the exit status in ac_status, and log it.
  1820. # For internal use only.
  1821. AC_DEFUN([_AC_DO],
  1822. [_AC_RUN_LOG([eval "$1"],
  1823. [_AC_DO_ECHO([$1])])])
  1824. # _AC_DO_STDERR(COMMAND)
  1825. # ----------------------
  1826. # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
  1827. AC_DEFUN([_AC_DO_STDERR],
  1828. [_AC_RUN_LOG_STDERR([eval "$1"],
  1829. [_AC_DO_ECHO([$1])])])
  1830. # _AC_DO_VAR(VARIABLE)
  1831. # --------------------
  1832. # Evaluate "$VARIABLE", which should be a valid shell command.
  1833. # The purpose of this macro is to write "configure:123: command line"
  1834. # into config.log for every test run.
  1835. AC_DEFUN([_AC_DO_VAR],
  1836. [_AC_DO([$$1])])
  1837. # _AC_DO_TOKENS(COMMAND)
  1838. # ----------------------
  1839. # Like _AC_DO_VAR, but execute COMMAND instead, where COMMAND is a series of
  1840. # tokens of the shell command language.
  1841. AC_DEFUN([_AC_DO_TOKENS],
  1842. [{ ac_try='$1'
  1843. _AC_DO([$ac_try]); }])
  1844. # _AC_EVAL(COMMAND)
  1845. # -----------------
  1846. # Eval COMMAND, save the exit status in ac_status, and log it.
  1847. # Unlike _AC_DO, this macro mishandles quoted arguments in some cases.
  1848. # It is present only for backward compatibility with previous Autoconf versions.
  1849. AC_DEFUN([_AC_EVAL],
  1850. [_AC_RUN_LOG([eval $1],
  1851. [eval echo "$as_me:$LINENO: \"$1\""])])
  1852. # _AC_EVAL_STDERR(COMMAND)
  1853. # ------------------------
  1854. # Like _AC_RUN_LOG_STDERR, but eval (instead of running) COMMAND.
  1855. # Unlike _AC_DO_STDERR, this macro mishandles quoted arguments in some cases.
  1856. # It is present only for backward compatibility with previous Autoconf versions.
  1857. AC_DEFUN([_AC_EVAL_STDERR],
  1858. [_AC_RUN_LOG_STDERR([eval $1],
  1859. [eval echo "$as_me:$LINENO: \"$1\""])])
  1860. # AC_TRY_EVAL(VARIABLE)
  1861. # ---------------------
  1862. # Evaluate $VARIABLE, which should be a valid shell command.
  1863. # The purpose of this macro is to write "configure:123: command line"
  1864. # into config.log for every test run.
  1865. #
  1866. # The AC_TRY_EVAL and AC_TRY_COMMAND macros are dangerous and
  1867. # undocumented, and should not be used.
  1868. # They may be removed or their API changed in a future release.
  1869. # Autoconf itself no longer uses these two macros; they are present
  1870. # only for backward compatibility with previous versions of Autoconf.
  1871. # Not every shell command will work due to problems with eval
  1872. # and quoting, and the rules for exactly what does work are tricky.
  1873. # Worse, due to double-expansion during evaluation, arbitrary unintended
  1874. # shell commands could be executed in some situations.
  1875. AC_DEFUN([AC_TRY_EVAL],
  1876. [_AC_EVAL([$$1])])
  1877. # AC_TRY_COMMAND(COMMAND)
  1878. # -----------------------
  1879. # Like AC_TRY_EVAL, but execute COMMAND instead, where COMMAND is a series of
  1880. # tokens of the shell command language.
  1881. # This macro should not be used; see the comments under AC_TRY_EVAL for why.
  1882. AC_DEFUN([AC_TRY_COMMAND],
  1883. [{ ac_try='$1'
  1884. _AC_EVAL([$ac_try]); }])
  1885. # AC_RUN_LOG(COMMAND)
  1886. # -------------------
  1887. AC_DEFUN([AC_RUN_LOG],
  1888. [_AC_RUN_LOG([$1],
  1889. [echo "$as_me:$LINENO: AS_ESCAPE([$1])"])])
  1890. ## ------------------------ ##
  1891. ## Examining declarations. ##
  1892. ## ------------------------ ##
  1893. # _AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1894. # ----------------------------------------------------------------
  1895. # Try to preprocess PROGRAM.
  1896. #
  1897. # This macro can be used during the selection of a preprocessor.
  1898. # eval is necessary to expand ac_cpp.
  1899. AC_DEFUN([_AC_PREPROC_IFELSE],
  1900. [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
  1901. AS_IF([_AC_DO_STDERR([$ac_cpp conftest.$ac_ext]) >/dev/null && {
  1902. test -z "$ac_[]_AC_LANG_ABBREV[]_preproc_warn_flag$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
  1903. test ! -s conftest.err
  1904. }],
  1905. [$2],
  1906. [_AC_MSG_LOG_CONFTEST
  1907. $3])
  1908. rm -f conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl
  1909. ])# _AC_PREPROC_IFELSE
  1910. # AC_PREPROC_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1911. # ---------------------------------------------------------------
  1912. # Try to preprocess PROGRAM. Requires that the preprocessor for the
  1913. # current language was checked for, hence do not use this macro in macros
  1914. # looking for a preprocessor.
  1915. AC_DEFUN([AC_PREPROC_IFELSE],
  1916. [AC_LANG_PREPROC_REQUIRE()dnl
  1917. _AC_PREPROC_IFELSE($@)])
  1918. # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1919. # ---------------------------------------------------------
  1920. # AC_TRY_CPP is used to check whether particular header files exist.
  1921. # (But it actually tests whether INCLUDES produces no CPP errors.)
  1922. #
  1923. # INCLUDES are not defaulted and are double quoted.
  1924. AU_DEFUN([AC_TRY_CPP],
  1925. [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3])])
  1926. # AC_EGREP_CPP(PATTERN, PROGRAM,
  1927. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  1928. # ------------------------------------------------------
  1929. # Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must
  1930. # come early, it is not included in AC_BEFORE checks.
  1931. AC_DEFUN([AC_EGREP_CPP],
  1932. [AC_LANG_PREPROC_REQUIRE()dnl
  1933. AC_REQUIRE([AC_PROG_EGREP])dnl
  1934. AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
  1935. AS_IF([dnl eval is necessary to expand ac_cpp.
  1936. dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
  1937. (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
  1938. dnl Quote $1 to prevent m4 from eating character classes
  1939. $EGREP "[$1]" >/dev/null 2>&1],
  1940. [$3],
  1941. [$4])dnl
  1942. rm -f conftest*
  1943. ])# AC_EGREP_CPP
  1944. # AC_EGREP_HEADER(PATTERN, HEADER-FILE,
  1945. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  1946. # ---------------------------------------------------------
  1947. AC_DEFUN([AC_EGREP_HEADER],
  1948. [AC_EGREP_CPP([$1],
  1949. [#include <$2>
  1950. ], [$3], [$4])])
  1951. ## ------------------ ##
  1952. ## Examining syntax. ##
  1953. ## ------------------ ##
  1954. # _AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1955. # ----------------------------------------------------------------
  1956. # Try to compile PROGRAM.
  1957. # This macro can be used during the selection of a compiler.
  1958. m4_define([_AC_COMPILE_IFELSE],
  1959. [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
  1960. rm -f conftest.$ac_objext
  1961. AS_IF([_AC_DO_STDERR($ac_compile) && {
  1962. test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
  1963. test ! -s conftest.err
  1964. } && test -s conftest.$ac_objext],
  1965. [$2],
  1966. [_AC_MSG_LOG_CONFTEST
  1967. $3])
  1968. rm -f core conftest.err conftest.$ac_objext m4_ifval([$1], [conftest.$ac_ext])[]dnl
  1969. ])# _AC_COMPILE_IFELSE
  1970. # AC_COMPILE_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1971. # ---------------------------------------------------------------
  1972. # Try to compile PROGRAM. Requires that the compiler for the current
  1973. # language was checked for, hence do not use this macro in macros looking
  1974. # for a compiler.
  1975. AC_DEFUN([AC_COMPILE_IFELSE],
  1976. [AC_LANG_COMPILER_REQUIRE()dnl
  1977. _AC_COMPILE_IFELSE($@)])
  1978. # AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY,
  1979. # [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1980. # ---------------------------------------------------
  1981. AU_DEFUN([AC_TRY_COMPILE],
  1982. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
  1983. ## --------------------- ##
  1984. ## Examining libraries. ##
  1985. ## --------------------- ##
  1986. # _AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  1987. # -------------------------------------------------------------
  1988. # Try to link PROGRAM.
  1989. # This macro can be used during the selection of a compiler.
  1990. m4_define([_AC_LINK_IFELSE],
  1991. [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
  1992. rm -f conftest.$ac_objext conftest$ac_exeext
  1993. AS_IF([_AC_DO_STDERR($ac_link) && {
  1994. test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
  1995. test ! -s conftest.err
  1996. } && test -s conftest$ac_exeext &&
  1997. AS_TEST_X([conftest$ac_exeext])],
  1998. [$2],
  1999. [_AC_MSG_LOG_CONFTEST
  2000. $3])
  2001. dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
  2002. dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
  2003. dnl as it would interfere with the next link command.
  2004. rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
  2005. conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
  2006. ])# _AC_LINK_IFELSE
  2007. # AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  2008. # ------------------------------------------------------------
  2009. # Try to link PROGRAM. Requires that the compiler for the current
  2010. # language was checked for, hence do not use this macro in macros looking
  2011. # for a compiler.
  2012. AC_DEFUN([AC_LINK_IFELSE],
  2013. [AC_LANG_COMPILER_REQUIRE()dnl
  2014. _AC_LINK_IFELSE($@)])
  2015. # AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
  2016. # [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  2017. # ------------------------------------------------
  2018. # Contrarily to AC_LINK_IFELSE, this macro double quote its first two args.
  2019. AU_DEFUN([AC_TRY_LINK],
  2020. [AC_LINK_IFELSE([AC_LANG_PROGRAM([[$1]], [[$2]])], [$3], [$4])])
  2021. # AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY,
  2022. # ACTION-IF-TRUE, [ACTION-IF-FALSE])
  2023. # ---------------------------------------------------
  2024. AU_DEFUN([AC_COMPILE_CHECK],
  2025. [m4_ifvaln([$1], [AC_MSG_CHECKING([for $1])])dnl
  2026. AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5])])
  2027. ## ------------------------------- ##
  2028. ## Checking for runtime features. ##
  2029. ## ------------------------------- ##
  2030. # _AC_RUN_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  2031. # ------------------------------------------------------------
  2032. # Compile, link, and run.
  2033. # This macro can be used during the selection of a compiler.
  2034. # We also remove conftest.o as if the compilation fails, some compilers
  2035. # don't remove it. We remove gmon.out and bb.out, which may be
  2036. # created during the run if the program is built with profiling support.
  2037. m4_define([_AC_RUN_IFELSE],
  2038. [m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
  2039. rm -f conftest$ac_exeext
  2040. AS_IF([_AC_DO_VAR(ac_link) && _AC_DO_TOKENS(./conftest$ac_exeext)],
  2041. [$2],
  2042. [echo "$as_me: program exited with status $ac_status" >&AS_MESSAGE_LOG_FD
  2043. _AC_MSG_LOG_CONFTEST
  2044. m4_ifvaln([$3],
  2045. [( exit $ac_status )
  2046. $3])dnl])[]dnl
  2047. rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext m4_ifval([$1],
  2048. [conftest.$ac_ext])[]dnl
  2049. ])# _AC_RUN_IFELSE
  2050. # AC_RUN_IFELSE(PROGRAM,
  2051. # [ACTION-IF-TRUE], [ACTION-IF-FALSE],
  2052. # [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
  2053. # ----------------------------------------------------------
  2054. # Compile, link, and run. Requires that the compiler for the current
  2055. # language was checked for, hence do not use this macro in macros looking
  2056. # for a compiler.
  2057. AC_DEFUN([AC_RUN_IFELSE],
  2058. [AC_LANG_COMPILER_REQUIRE()dnl
  2059. m4_ifval([$4], [],
  2060. [AC_DIAGNOSE([cross],
  2061. [$0 called without default to allow cross compiling])])dnl
  2062. AS_IF([test "$cross_compiling" = yes],
  2063. [m4_default([$4],
  2064. [AC_MSG_FAILURE([cannot run test program while cross compiling])])],
  2065. [_AC_RUN_IFELSE($@)])
  2066. ])
  2067. # AC_TRY_RUN(PROGRAM,
  2068. # [ACTION-IF-TRUE], [ACTION-IF-FALSE],
  2069. # [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
  2070. # --------------------------------------------------------
  2071. AU_DEFUN([AC_TRY_RUN],
  2072. [AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])])
  2073. ## ------------------------------------- ##
  2074. ## Checking for the existence of files. ##
  2075. ## ------------------------------------- ##
  2076. # AC_CHECK_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  2077. # -------------------------------------------------------------
  2078. #
  2079. # Check for the existence of FILE.
  2080. AC_DEFUN([AC_CHECK_FILE],
  2081. [AC_DIAGNOSE([cross],
  2082. [cannot check for file existence when cross compiling])dnl
  2083. AS_VAR_PUSHDEF([ac_File], [ac_cv_file_$1])dnl
  2084. AC_CACHE_CHECK([for $1], [ac_File],
  2085. [test "$cross_compiling" = yes &&
  2086. AC_MSG_ERROR([cannot check for file existence when cross compiling])
  2087. if test -r "$1"; then
  2088. AS_VAR_SET([ac_File], [yes])
  2089. else
  2090. AS_VAR_SET([ac_File], [no])
  2091. fi])
  2092. AS_IF([test AS_VAR_GET([ac_File]) = yes], [$2], [$3])[]dnl
  2093. AS_VAR_POPDEF([ac_File])dnl
  2094. ])# AC_CHECK_FILE
  2095. # AC_CHECK_FILES(FILE..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  2096. # -----------------------------------------------------------------
  2097. AC_DEFUN([AC_CHECK_FILES],
  2098. [m4_foreach_w([AC_FILE_NAME], [$1],
  2099. [AC_CHECK_FILE(AC_FILE_NAME,
  2100. [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_FILE_NAME), 1,
  2101. [Define to 1 if you have the
  2102. file `]AC_File['.])
  2103. $2],
  2104. [$3])])])
  2105. ## ------------------------------- ##
  2106. ## Checking for declared symbols. ##
  2107. ## ------------------------------- ##
  2108. # AC_CHECK_DECL(SYMBOL,
  2109. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
  2110. # [INCLUDES = DEFAULT-INCLUDES])
  2111. # -------------------------------------------------------
  2112. # Check whether SYMBOL (a function, variable, or constant) is declared.
  2113. AC_DEFUN([AC_CHECK_DECL],
  2114. [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])dnl
  2115. AC_CACHE_CHECK([whether $1 is declared], [ac_Symbol],
  2116. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
  2117. [#ifndef $1
  2118. (void) $1;
  2119. #endif
  2120. ])],
  2121. [AS_VAR_SET([ac_Symbol], [yes])],
  2122. [AS_VAR_SET([ac_Symbol], [no])])])
  2123. AS_IF([test AS_VAR_GET([ac_Symbol]) = yes], [$2], [$3])[]dnl
  2124. AS_VAR_POPDEF([ac_Symbol])dnl
  2125. ])# AC_CHECK_DECL
  2126. # AC_CHECK_DECLS(SYMBOLS,
  2127. # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
  2128. # [INCLUDES = DEFAULT-INCLUDES])
  2129. # --------------------------------------------------------
  2130. # Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise. See the
  2131. # documentation for a detailed explanation of this difference with
  2132. # other AC_CHECK_*S macros. SYMBOLS is an m4 list.
  2133. AC_DEFUN([AC_CHECK_DECLS],
  2134. [m4_foreach([AC_Symbol], [$1],
  2135. [AC_CHECK_DECL(AC_Symbol,
  2136. [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 1,
  2137. [Define to 1 if you have the declaration
  2138. of `]AC_Symbol[', and to 0 if you don't.])
  2139. $2],
  2140. [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_]AC_Symbol), 0)
  2141. $3],
  2142. [$4])])
  2143. ])# AC_CHECK_DECLS
  2144. # AC_CHECK_DECLS_ONCE(SYMBOLS)
  2145. # ----------------------------
  2146. # Like AC_CHECK_DECLS(SYMBOLS), but do it at most once.
  2147. AC_DEFUN([AC_CHECK_DECLS_ONCE],
  2148. [
  2149. m4_foreach([AC_Symbol], [$1],
  2150. [AC_DEFUN([_AC_Check_Decl_]m4_defn([AC_Symbol]),
  2151. [AC_CHECK_DECLS(m4_defn([AC_Symbol]))])
  2152. AC_REQUIRE([_AC_Check_Decl_]m4_defn([AC_Symbol]))])
  2153. ])
  2154. ## ---------------------------------- ##
  2155. ## Replacement of library functions. ##
  2156. ## ---------------------------------- ##
  2157. # AC_CONFIG_LIBOBJ_DIR(DIRNAME)
  2158. # -----------------------------
  2159. # Announce LIBOBJ replacement files are in $top_srcdir/DIRNAME.
  2160. AC_DEFUN_ONCE([AC_CONFIG_LIBOBJ_DIR],
  2161. [m4_divert_text([DEFAULTS], [ac_config_libobj_dir=$1])])
  2162. # AC_LIBSOURCE(FILE-NAME)
  2163. # -----------------------
  2164. # Announce we might need the file `FILE-NAME'.
  2165. m4_define([AC_LIBSOURCE], [])
  2166. # AC_LIBSOURCES([FILE-NAME1, ...])
  2167. # -------------------------------
  2168. # Announce we might need these files.
  2169. m4_define([AC_LIBSOURCES],
  2170. [m4_foreach([_AC_FILE_NAME], [$1],
  2171. [AC_LIBSOURCE(_AC_FILE_NAME)])])
  2172. # _AC_LIBOBJ(FILE-NAME-NOEXT, ACTION-IF-INDIR)
  2173. # --------------------------------------------
  2174. # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
  2175. m4_define([_AC_LIBOBJ],
  2176. [AS_LITERAL_IF([$1],
  2177. [AC_LIBSOURCE([$1.c])],
  2178. [$2])dnl
  2179. case " $LIB@&t@OBJS " in
  2180. *" $1.$ac_objext "* ) ;;
  2181. *) AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS $1.$ac_objext"]) ;;
  2182. esac
  2183. ])
  2184. # AC_LIBOBJ(FILE-NAME-NOEXT)
  2185. # -------------------------
  2186. # We need `FILE-NAME-NOEXT.o', save this into `LIBOBJS'.
  2187. m4_define([AC_LIBOBJ],
  2188. [_AC_LIBOBJ([$1],
  2189. [AC_DIAGNOSE(syntax,
  2190. [$0($1): you should use literals])])dnl
  2191. ])
  2192. # _AC_LIBOBJS_NORMALIZE
  2193. # ---------------------
  2194. # Clean up LIBOBJS and LTLIBOBJS so that they work with 1. ac_objext,
  2195. # 2. Automake's ANSI2KNR, 3. Libtool, 4. combination of the three.
  2196. # Used with AC_CONFIG_COMMANDS_PRE.
  2197. AC_DEFUN([_AC_LIBOBJS_NORMALIZE],
  2198. [ac_libobjs=
  2199. ac_ltlibobjs=
  2200. for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue
  2201. # 1. Remove the extension, and $U if already installed.
  2202. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
  2203. ac_i=`echo "$ac_i" | sed "$ac_script"`
  2204. # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
  2205. # will be set to the directory where LIBOBJS objects are built.
  2206. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
  2207. ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
  2208. done
  2209. AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
  2210. AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
  2211. ])
  2212. ## ----------------------------------- ##
  2213. ## Checking compiler characteristics. ##
  2214. ## ----------------------------------- ##
  2215. # _AC_COMPUTE_INT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
  2216. # -------------------------------------------------------------------
  2217. # Compute the integer EXPRESSION and store the result in the VARIABLE.
  2218. # Works OK if cross compiling, but assumes twos-complement arithmetic.
  2219. m4_define([_AC_COMPUTE_INT_COMPILE],
  2220. [# Depending upon the size, compute the lo and hi bounds.
  2221. _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= 0])],
  2222. [ac_lo=0 ac_mid=0
  2223. while :; do
  2224. _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
  2225. [ac_hi=$ac_mid; break],
  2226. [ac_lo=`expr $ac_mid + 1`
  2227. if test $ac_lo -le $ac_mid; then
  2228. ac_lo= ac_hi=
  2229. break
  2230. fi
  2231. ac_mid=`expr 2 '*' $ac_mid + 1`])
  2232. done],
  2233. [AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) < 0])],
  2234. [ac_hi=-1 ac_mid=-1
  2235. while :; do
  2236. _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) >= $ac_mid])],
  2237. [ac_lo=$ac_mid; break],
  2238. [ac_hi=`expr '(' $ac_mid ')' - 1`
  2239. if test $ac_mid -le $ac_hi; then
  2240. ac_lo= ac_hi=
  2241. break
  2242. fi
  2243. ac_mid=`expr 2 '*' $ac_mid`])
  2244. done],
  2245. [ac_lo= ac_hi=])])
  2246. # Binary search between lo and hi bounds.
  2247. while test "x$ac_lo" != "x$ac_hi"; do
  2248. ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
  2249. _AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([$3], [($1) <= $ac_mid])],
  2250. [ac_hi=$ac_mid], [ac_lo=`expr '(' $ac_mid ')' + 1`])
  2251. done
  2252. case $ac_lo in
  2253. ?*) $2=$ac_lo;;
  2254. '') $4 ;;
  2255. esac[]dnl
  2256. ])# _AC_COMPUTE_INT_COMPILE
  2257. # _AC_COMPUTE_INT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
  2258. # ---------------------------------------------------------------
  2259. # Store the evaluation of the integer EXPRESSION in VARIABLE.
  2260. m4_define([_AC_COMPUTE_INT_RUN],
  2261. [_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
  2262. [$2=`cat conftest.val`], [$4])])
  2263. # AC_COMPUTE_INT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
  2264. # ----------------------------------------------------------
  2265. AC_DEFUN([AC_COMPUTE_INT],
  2266. [AC_LANG_COMPILER_REQUIRE()dnl
  2267. if test "$cross_compiling" = yes; then
  2268. _AC_COMPUTE_INT_COMPILE([$2], [$1], [$3], [$4])
  2269. else
  2270. _AC_COMPUTE_INT_RUN([$2], [$1], [$3], [$4])
  2271. fi
  2272. rm -f conftest.val[]dnl
  2273. ])# _AC_COMPUTE_INT
  2274. # _AC_COMPUTE_INT(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
  2275. # -----------------------------------------------------------
  2276. # FIXME: this private interface was used by several packages.
  2277. # Give them time to transition to AC_COMPUTE_INT and then delete this one.
  2278. AC_DEFUN([_AC_COMPUTE_INT],
  2279. [AC_COMPUTE_INT([$2], [$1], [$3], [$4])
  2280. AC_DIAGNOSE([obsolete],
  2281. [The macro `_AC_COMPUTE_INT' is obsolete and will be deleted in a
  2282. future version or Autoconf. Hence, it is suggested that you use
  2283. instead the public AC_COMPUTE_INT macro. Note that the arguments are
  2284. slightly different between the two.])dnl
  2285. ])# _AC_COMPUTE_INT