aclocal.m4 114 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156
  1. # generated automatically by aclocal 1.12.6 -*- Autoconf -*-
  2. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  3. # This file is free software; the Free Software Foundation
  4. # gives unlimited permission to copy and/or distribute it,
  5. # with or without modifications, as long as this notice is preserved.
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. # PARTICULAR PURPOSE.
  10. m4_ifndef([AC_AUTOCONF_VERSION],
  11. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  12. m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
  13. [m4_warning([this file was generated for autoconf 2.69.
  14. You have another version of autoconf. It may work, but is not guaranteed to.
  15. If you have problems, you may need to regenerate the build system entirely.
  16. To do so, use the procedure documented by the package, typically 'autoreconf'.])])
  17. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  18. # serial 1 (pkg-config-0.24)
  19. #
  20. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  21. #
  22. # This program is free software; you can redistribute it and/or modify
  23. # it under the terms of the GNU General Public License as published by
  24. # the Free Software Foundation; either version 2 of the License, or
  25. # (at your option) any later version.
  26. #
  27. # This program is distributed in the hope that it will be useful, but
  28. # WITHOUT ANY WARRANTY; without even the implied warranty of
  29. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  30. # General Public License for more details.
  31. #
  32. # You should have received a copy of the GNU General Public License
  33. # along with this program; if not, write to the Free Software
  34. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  35. #
  36. # As a special exception to the GNU General Public License, if you
  37. # distribute this file as part of a program that contains a
  38. # configuration script generated by Autoconf, you may include it under
  39. # the same distribution terms that you use for the rest of that program.
  40. # PKG_PROG_PKG_CONFIG([MIN-VERSION])
  41. # ----------------------------------
  42. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  43. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  44. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  45. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  46. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  47. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  48. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  49. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  50. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  51. fi
  52. if test -n "$PKG_CONFIG"; then
  53. _pkg_min_version=m4_default([$1], [0.9.0])
  54. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  55. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  56. AC_MSG_RESULT([yes])
  57. else
  58. AC_MSG_RESULT([no])
  59. PKG_CONFIG=""
  60. fi
  61. fi[]dnl
  62. ])# PKG_PROG_PKG_CONFIG
  63. # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  64. #
  65. # Check to see whether a particular set of modules exists. Similar
  66. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
  67. #
  68. # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  69. # only at the first occurence in configure.ac, so if the first place
  70. # it's called might be skipped (such as if it is within an "if", you
  71. # have to call PKG_CHECK_EXISTS manually
  72. # --------------------------------------------------------------
  73. AC_DEFUN([PKG_CHECK_EXISTS],
  74. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  75. if test -n "$PKG_CONFIG" && \
  76. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  77. m4_default([$2], [:])
  78. m4_ifvaln([$3], [else
  79. $3])dnl
  80. fi])
  81. # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  82. # ---------------------------------------------
  83. m4_define([_PKG_CONFIG],
  84. [if test -n "$$1"; then
  85. pkg_cv_[]$1="$$1"
  86. elif test -n "$PKG_CONFIG"; then
  87. PKG_CHECK_EXISTS([$3],
  88. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  89. test "x$?" != "x0" && pkg_failed=yes ],
  90. [pkg_failed=yes])
  91. else
  92. pkg_failed=untried
  93. fi[]dnl
  94. ])# _PKG_CONFIG
  95. # _PKG_SHORT_ERRORS_SUPPORTED
  96. # -----------------------------
  97. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  98. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  99. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  100. _pkg_short_errors_supported=yes
  101. else
  102. _pkg_short_errors_supported=no
  103. fi[]dnl
  104. ])# _PKG_SHORT_ERRORS_SUPPORTED
  105. # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  106. # [ACTION-IF-NOT-FOUND])
  107. #
  108. #
  109. # Note that if there is a possibility the first call to
  110. # PKG_CHECK_MODULES might not happen, you should be sure to include an
  111. # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  112. #
  113. #
  114. # --------------------------------------------------------------
  115. AC_DEFUN([PKG_CHECK_MODULES],
  116. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  117. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  118. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  119. pkg_failed=no
  120. AC_MSG_CHECKING([for $1])
  121. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  122. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  123. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  124. and $1[]_LIBS to avoid the need to call pkg-config.
  125. See the pkg-config man page for more details.])
  126. if test $pkg_failed = yes; then
  127. AC_MSG_RESULT([no])
  128. _PKG_SHORT_ERRORS_SUPPORTED
  129. if test $_pkg_short_errors_supported = yes; then
  130. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  131. else
  132. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  133. fi
  134. # Put the nasty error message in config.log where it belongs
  135. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  136. m4_default([$4], [AC_MSG_ERROR(
  137. [Package requirements ($2) were not met:
  138. $$1_PKG_ERRORS
  139. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  140. installed software in a non-standard prefix.
  141. _PKG_TEXT])[]dnl
  142. ])
  143. elif test $pkg_failed = untried; then
  144. AC_MSG_RESULT([no])
  145. m4_default([$4], [AC_MSG_FAILURE(
  146. [The pkg-config script could not be found or is too old. Make sure it
  147. is in your PATH or set the PKG_CONFIG environment variable to the full
  148. path to pkg-config.
  149. _PKG_TEXT
  150. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  151. ])
  152. else
  153. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  154. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  155. AC_MSG_RESULT([yes])
  156. $3
  157. fi[]dnl
  158. ])# PKG_CHECK_MODULES
  159. # PKG_INSTALLDIR(DIRECTORY)
  160. # -------------------------
  161. # Substitutes the variable pkgconfigdir as the location where a module
  162. # should install pkg-config .pc files. By default the directory is
  163. # $libdir/pkgconfig, but the default can be changed by passing
  164. # DIRECTORY. The user can override through the --with-pkgconfigdir
  165. # parameter.
  166. AC_DEFUN([PKG_INSTALLDIR],
  167. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  168. m4_pushdef([pkg_description],
  169. [pkg-config installation directory @<:@]pkg_default[@:>@])
  170. AC_ARG_WITH([pkgconfigdir],
  171. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  172. [with_pkgconfigdir=]pkg_default)
  173. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  174. m4_popdef([pkg_default])
  175. m4_popdef([pkg_description])
  176. ]) dnl PKG_INSTALLDIR
  177. # PKG_NOARCH_INSTALLDIR(DIRECTORY)
  178. # -------------------------
  179. # Substitutes the variable noarch_pkgconfigdir as the location where a
  180. # module should install arch-independent pkg-config .pc files. By
  181. # default the directory is $datadir/pkgconfig, but the default can be
  182. # changed by passing DIRECTORY. The user can override through the
  183. # --with-noarch-pkgconfigdir parameter.
  184. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  185. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  186. m4_pushdef([pkg_description],
  187. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  188. AC_ARG_WITH([noarch-pkgconfigdir],
  189. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  190. [with_noarch_pkgconfigdir=]pkg_default)
  191. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  192. m4_popdef([pkg_default])
  193. m4_popdef([pkg_description])
  194. ]) dnl PKG_NOARCH_INSTALLDIR
  195. # Copyright (C) 2002-2012 Free Software Foundation, Inc.
  196. #
  197. # This file is free software; the Free Software Foundation
  198. # gives unlimited permission to copy and/or distribute it,
  199. # with or without modifications, as long as this notice is preserved.
  200. # AM_AUTOMAKE_VERSION(VERSION)
  201. # ----------------------------
  202. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  203. # generated from the m4 files accompanying Automake X.Y.
  204. # (This private macro should not be called outside this file.)
  205. AC_DEFUN([AM_AUTOMAKE_VERSION],
  206. [am__api_version='1.12'
  207. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  208. dnl require some minimum version. Point them to the right macro.
  209. m4_if([$1], [1.12.6], [],
  210. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  211. ])
  212. # _AM_AUTOCONF_VERSION(VERSION)
  213. # -----------------------------
  214. # aclocal traces this macro to find the Autoconf version.
  215. # This is a private macro too. Using m4_define simplifies
  216. # the logic in aclocal, which can simply ignore this definition.
  217. m4_define([_AM_AUTOCONF_VERSION], [])
  218. # AM_SET_CURRENT_AUTOMAKE_VERSION
  219. # -------------------------------
  220. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  221. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  222. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  223. [AM_AUTOMAKE_VERSION([1.12.6])dnl
  224. m4_ifndef([AC_AUTOCONF_VERSION],
  225. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  226. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  227. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  228. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  229. #
  230. # This file is free software; the Free Software Foundation
  231. # gives unlimited permission to copy and/or distribute it,
  232. # with or without modifications, as long as this notice is preserved.
  233. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  234. # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
  235. # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
  236. #
  237. # Of course, Automake must honor this variable whenever it calls a
  238. # tool from the auxiliary directory. The problem is that $srcdir (and
  239. # therefore $ac_aux_dir as well) can be either absolute or relative,
  240. # depending on how configure is run. This is pretty annoying, since
  241. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  242. # source directory, any form will work fine, but in subdirectories a
  243. # relative path needs to be adjusted first.
  244. #
  245. # $ac_aux_dir/missing
  246. # fails when called from a subdirectory if $ac_aux_dir is relative
  247. # $top_srcdir/$ac_aux_dir/missing
  248. # fails if $ac_aux_dir is absolute,
  249. # fails when called from a subdirectory in a VPATH build with
  250. # a relative $ac_aux_dir
  251. #
  252. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  253. # are both prefixed by $srcdir. In an in-source build this is usually
  254. # harmless because $srcdir is '.', but things will broke when you
  255. # start a VPATH build or use an absolute $srcdir.
  256. #
  257. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  258. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  259. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  260. # and then we would define $MISSING as
  261. # MISSING="\${SHELL} $am_aux_dir/missing"
  262. # This will work as long as MISSING is not called from configure, because
  263. # unfortunately $(top_srcdir) has no meaning in configure.
  264. # However there are other variables, like CC, which are often used in
  265. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  266. #
  267. # Another solution, used here, is to always expand $ac_aux_dir to an
  268. # absolute PATH. The drawback is that using absolute paths prevent a
  269. # configured tree to be moved without reconfiguration.
  270. AC_DEFUN([AM_AUX_DIR_EXPAND],
  271. [dnl Rely on autoconf to set up CDPATH properly.
  272. AC_PREREQ([2.50])dnl
  273. # expand $ac_aux_dir to an absolute path
  274. am_aux_dir=`cd $ac_aux_dir && pwd`
  275. ])
  276. # AM_CONDITIONAL -*- Autoconf -*-
  277. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  278. #
  279. # This file is free software; the Free Software Foundation
  280. # gives unlimited permission to copy and/or distribute it,
  281. # with or without modifications, as long as this notice is preserved.
  282. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  283. # -------------------------------------
  284. # Define a conditional.
  285. AC_DEFUN([AM_CONDITIONAL],
  286. [AC_PREREQ([2.52])dnl
  287. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  288. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  289. AC_SUBST([$1_TRUE])dnl
  290. AC_SUBST([$1_FALSE])dnl
  291. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  292. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  293. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  294. if $2; then
  295. $1_TRUE=
  296. $1_FALSE='#'
  297. else
  298. $1_TRUE='#'
  299. $1_FALSE=
  300. fi
  301. AC_CONFIG_COMMANDS_PRE(
  302. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  303. AC_MSG_ERROR([[conditional "$1" was never defined.
  304. Usually this means the macro was only invoked conditionally.]])
  305. fi])])
  306. # Copyright (C) 1999-2012 Free Software Foundation, Inc.
  307. #
  308. # This file is free software; the Free Software Foundation
  309. # gives unlimited permission to copy and/or distribute it,
  310. # with or without modifications, as long as this notice is preserved.
  311. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
  312. # written in clear, in which case automake, when reading aclocal.m4,
  313. # will think it sees a *use*, and therefore will trigger all it's
  314. # C support machinery. Also note that it means that autoscan, seeing
  315. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  316. # _AM_DEPENDENCIES(NAME)
  317. # ----------------------
  318. # See how the compiler implements dependency checking.
  319. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
  320. # We try a few techniques and use that to set a single cache variable.
  321. #
  322. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  323. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  324. # dependency, and given that the user is not expected to run this macro,
  325. # just rely on AC_PROG_CC.
  326. AC_DEFUN([_AM_DEPENDENCIES],
  327. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  328. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  329. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  330. AC_REQUIRE([AM_DEP_TRACK])dnl
  331. m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
  332. [$1], [CXX], [depcc="$CXX" am_compiler_list=],
  333. [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  334. [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
  335. [$1], [UPC], [depcc="$UPC" am_compiler_list=],
  336. [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  337. [depcc="$$1" am_compiler_list=])
  338. AC_CACHE_CHECK([dependency style of $depcc],
  339. [am_cv_$1_dependencies_compiler_type],
  340. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  341. # We make a subdir and do the tests there. Otherwise we can end up
  342. # making bogus files that we don't know about and never remove. For
  343. # instance it was reported that on HP-UX the gcc test will end up
  344. # making a dummy file named 'D' -- because '-MD' means "put the output
  345. # in D".
  346. rm -rf conftest.dir
  347. mkdir conftest.dir
  348. # Copy depcomp to subdir because otherwise we won't find it if we're
  349. # using a relative directory.
  350. cp "$am_depcomp" conftest.dir
  351. cd conftest.dir
  352. # We will build objects and dependencies in a subdirectory because
  353. # it helps to detect inapplicable dependency modes. For instance
  354. # both Tru64's cc and ICC support -MD to output dependencies as a
  355. # side effect of compilation, but ICC will put the dependencies in
  356. # the current directory while Tru64 will put them in the object
  357. # directory.
  358. mkdir sub
  359. am_cv_$1_dependencies_compiler_type=none
  360. if test "$am_compiler_list" = ""; then
  361. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  362. fi
  363. am__universal=false
  364. m4_case([$1], [CC],
  365. [case " $depcc " in #(
  366. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  367. esac],
  368. [CXX],
  369. [case " $depcc " in #(
  370. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  371. esac])
  372. for depmode in $am_compiler_list; do
  373. # Setup a source with many dependencies, because some compilers
  374. # like to wrap large dependency lists on column 80 (with \), and
  375. # we should not choose a depcomp mode which is confused by this.
  376. #
  377. # We need to recreate these files for each test, as the compiler may
  378. # overwrite some of them when testing with obscure command lines.
  379. # This happens at least with the AIX C compiler.
  380. : > sub/conftest.c
  381. for i in 1 2 3 4 5 6; do
  382. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  383. # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
  384. # Solaris 10 /bin/sh.
  385. echo '/* dummy */' > sub/conftst$i.h
  386. done
  387. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  388. # We check with '-c' and '-o' for the sake of the "dashmstdout"
  389. # mode. It turns out that the SunPro C++ compiler does not properly
  390. # handle '-M -o', and we need to detect this. Also, some Intel
  391. # versions had trouble with output in subdirs.
  392. am__obj=sub/conftest.${OBJEXT-o}
  393. am__minus_obj="-o $am__obj"
  394. case $depmode in
  395. gcc)
  396. # This depmode causes a compiler race in universal mode.
  397. test "$am__universal" = false || continue
  398. ;;
  399. nosideeffect)
  400. # After this tag, mechanisms are not by side-effect, so they'll
  401. # only be used when explicitly requested.
  402. if test "x$enable_dependency_tracking" = xyes; then
  403. continue
  404. else
  405. break
  406. fi
  407. ;;
  408. msvc7 | msvc7msys | msvisualcpp | msvcmsys)
  409. # This compiler won't grok '-c -o', but also, the minuso test has
  410. # not run yet. These depmodes are late enough in the game, and
  411. # so weak that their functioning should not be impacted.
  412. am__obj=conftest.${OBJEXT-o}
  413. am__minus_obj=
  414. ;;
  415. none) break ;;
  416. esac
  417. if depmode=$depmode \
  418. source=sub/conftest.c object=$am__obj \
  419. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  420. $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
  421. >/dev/null 2>conftest.err &&
  422. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  423. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  424. grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
  425. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  426. # icc doesn't choke on unknown options, it will just issue warnings
  427. # or remarks (even with -Werror). So we grep stderr for any message
  428. # that says an option was ignored or not supported.
  429. # When given -MP, icc 7.0 and 7.1 complain thusly:
  430. # icc: Command line warning: ignoring option '-M'; no argument required
  431. # The diagnosis changed in icc 8.0:
  432. # icc: Command line remark: option '-MP' not supported
  433. if (grep 'ignoring option' conftest.err ||
  434. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  435. am_cv_$1_dependencies_compiler_type=$depmode
  436. break
  437. fi
  438. fi
  439. done
  440. cd ..
  441. rm -rf conftest.dir
  442. else
  443. am_cv_$1_dependencies_compiler_type=none
  444. fi
  445. ])
  446. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  447. AM_CONDITIONAL([am__fastdep$1], [
  448. test "x$enable_dependency_tracking" != xno \
  449. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  450. ])
  451. # AM_SET_DEPDIR
  452. # -------------
  453. # Choose a directory name for dependency files.
  454. # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
  455. AC_DEFUN([AM_SET_DEPDIR],
  456. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  457. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  458. ])
  459. # AM_DEP_TRACK
  460. # ------------
  461. AC_DEFUN([AM_DEP_TRACK],
  462. [AC_ARG_ENABLE([dependency-tracking], [dnl
  463. AS_HELP_STRING(
  464. [--enable-dependency-tracking],
  465. [do not reject slow dependency extractors])
  466. AS_HELP_STRING(
  467. [--disable-dependency-tracking],
  468. [speeds up one-time build])])
  469. if test "x$enable_dependency_tracking" != xno; then
  470. am_depcomp="$ac_aux_dir/depcomp"
  471. AMDEPBACKSLASH='\'
  472. am__nodep='_no'
  473. fi
  474. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  475. AC_SUBST([AMDEPBACKSLASH])dnl
  476. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  477. AC_SUBST([am__nodep])dnl
  478. _AM_SUBST_NOTMAKE([am__nodep])dnl
  479. ])
  480. # Generate code to set up dependency tracking. -*- Autoconf -*-
  481. # Copyright (C) 1999-2012 Free Software Foundation, Inc.
  482. #
  483. # This file is free software; the Free Software Foundation
  484. # gives unlimited permission to copy and/or distribute it,
  485. # with or without modifications, as long as this notice is preserved.
  486. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  487. # ------------------------------
  488. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  489. [{
  490. # Autoconf 2.62 quotes --file arguments for eval, but not when files
  491. # are listed without --file. Let's play safe and only enable the eval
  492. # if we detect the quoting.
  493. case $CONFIG_FILES in
  494. *\'*) eval set x "$CONFIG_FILES" ;;
  495. *) set x $CONFIG_FILES ;;
  496. esac
  497. shift
  498. for mf
  499. do
  500. # Strip MF so we end up with the name of the file.
  501. mf=`echo "$mf" | sed -e 's/:.*$//'`
  502. # Check whether this is an Automake generated Makefile or not.
  503. # We used to match only the files named 'Makefile.in', but
  504. # some people rename them; so instead we look at the file content.
  505. # Grep'ing the first line is not enough: some people post-process
  506. # each Makefile.in and add a new line on top of each file to say so.
  507. # Grep'ing the whole file is not good either: AIX grep has a line
  508. # limit of 2048, but all sed's we know have understand at least 4000.
  509. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  510. dirpart=`AS_DIRNAME("$mf")`
  511. else
  512. continue
  513. fi
  514. # Extract the definition of DEPDIR, am__include, and am__quote
  515. # from the Makefile without running 'make'.
  516. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  517. test -z "$DEPDIR" && continue
  518. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  519. test -z "am__include" && continue
  520. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  521. # Find all dependency output files, they are included files with
  522. # $(DEPDIR) in their names. We invoke sed twice because it is the
  523. # simplest approach to changing $(DEPDIR) to its actual value in the
  524. # expansion.
  525. for file in `sed -n "
  526. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  527. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
  528. # Make sure the directory exists.
  529. test -f "$dirpart/$file" && continue
  530. fdir=`AS_DIRNAME(["$file"])`
  531. AS_MKDIR_P([$dirpart/$fdir])
  532. # echo "creating $dirpart/$file"
  533. echo '# dummy' > "$dirpart/$file"
  534. done
  535. done
  536. }
  537. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  538. # AM_OUTPUT_DEPENDENCY_COMMANDS
  539. # -----------------------------
  540. # This macro should only be invoked once -- use via AC_REQUIRE.
  541. #
  542. # This code is only required when automatic dependency tracking
  543. # is enabled. FIXME. This creates each '.P' file that we will
  544. # need in order to bootstrap the dependency handling code.
  545. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  546. [AC_CONFIG_COMMANDS([depfiles],
  547. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  548. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  549. ])
  550. # Do all the work for Automake. -*- Autoconf -*-
  551. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  552. #
  553. # This file is free software; the Free Software Foundation
  554. # gives unlimited permission to copy and/or distribute it,
  555. # with or without modifications, as long as this notice is preserved.
  556. # This macro actually does too much. Some checks are only needed if
  557. # your package does certain things. But this isn't really a big deal.
  558. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  559. # AM_INIT_AUTOMAKE([OPTIONS])
  560. # -----------------------------------------------
  561. # The call with PACKAGE and VERSION arguments is the old style
  562. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  563. # and VERSION should now be passed to AC_INIT and removed from
  564. # the call to AM_INIT_AUTOMAKE.
  565. # We support both call styles for the transition. After
  566. # the next Automake release, Autoconf can make the AC_INIT
  567. # arguments mandatory, and then we can depend on a new Autoconf
  568. # release and drop the old call support.
  569. AC_DEFUN([AM_INIT_AUTOMAKE],
  570. [AC_PREREQ([2.62])dnl
  571. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  572. dnl the ones we care about.
  573. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  574. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  575. AC_REQUIRE([AC_PROG_INSTALL])dnl
  576. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  577. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  578. # is not polluted with repeated "-I."
  579. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  580. # test to see if srcdir already configured
  581. if test -f $srcdir/config.status; then
  582. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  583. fi
  584. fi
  585. # test whether we have cygpath
  586. if test -z "$CYGPATH_W"; then
  587. if (cygpath --version) >/dev/null 2>/dev/null; then
  588. CYGPATH_W='cygpath -w'
  589. else
  590. CYGPATH_W=echo
  591. fi
  592. fi
  593. AC_SUBST([CYGPATH_W])
  594. # Define the identity of the package.
  595. dnl Distinguish between old-style and new-style calls.
  596. m4_ifval([$2],
  597. [AC_DIAGNOSE([obsolete],
  598. [$0: two- and three-arguments forms are deprecated. For more info, see:
  599. http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
  600. m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  601. AC_SUBST([PACKAGE], [$1])dnl
  602. AC_SUBST([VERSION], [$2])],
  603. [_AM_SET_OPTIONS([$1])dnl
  604. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  605. m4_if(
  606. m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
  607. [ok:ok],,
  608. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  609. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  610. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  611. _AM_IF_OPTION([no-define],,
  612. [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
  613. AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
  614. # Some tools Automake needs.
  615. AC_REQUIRE([AM_SANITY_CHECK])dnl
  616. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  617. AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
  618. AM_MISSING_PROG([AUTOCONF], [autoconf])
  619. AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
  620. AM_MISSING_PROG([AUTOHEADER], [autoheader])
  621. AM_MISSING_PROG([MAKEINFO], [makeinfo])
  622. AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  623. AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
  624. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  625. # For better backward compatibility. To be removed once Automake 1.9.x
  626. # dies out for good. For more background, see:
  627. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
  628. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  629. AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
  630. # We need awk for the "check" target. The system "awk" is bad on
  631. # some platforms.
  632. AC_REQUIRE([AC_PROG_AWK])dnl
  633. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  634. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  635. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  636. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  637. [_AM_PROG_TAR([v7])])])
  638. _AM_IF_OPTION([no-dependencies],,
  639. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  640. [_AM_DEPENDENCIES([CC])],
  641. [m4_define([AC_PROG_CC],
  642. m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
  643. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  644. [_AM_DEPENDENCIES([CXX])],
  645. [m4_define([AC_PROG_CXX],
  646. m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
  647. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  648. [_AM_DEPENDENCIES([OBJC])],
  649. [m4_define([AC_PROG_OBJC],
  650. m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
  651. dnl Support for Objective C++ was only introduced in Autoconf 2.65,
  652. dnl but we still cater to Autoconf 2.62.
  653. m4_ifdef([AC_PROG_OBJCXX],
  654. [AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
  655. [_AM_DEPENDENCIES([OBJCXX])],
  656. [m4_define([AC_PROG_OBJCXX],
  657. m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
  658. ])
  659. _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
  660. dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
  661. dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
  662. dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
  663. AC_CONFIG_COMMANDS_PRE(dnl
  664. [m4_provide_if([_AM_COMPILER_EXEEXT],
  665. [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  666. ])
  667. dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
  668. dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  669. dnl mangled by Autoconf and run in a shell conditional statement.
  670. m4_define([_AC_COMPILER_EXEEXT],
  671. m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  672. # When config.status generates a header, we must update the stamp-h file.
  673. # This file resides in the same directory as the config header
  674. # that is generated. The stamp files are numbered to have different names.
  675. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  676. # loop where config.status creates the headers, so we can generate
  677. # our stamp files there.
  678. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  679. [# Compute $1's index in $config_headers.
  680. _am_arg=$1
  681. _am_stamp_count=1
  682. for _am_header in $config_headers :; do
  683. case $_am_header in
  684. $_am_arg | $_am_arg:* )
  685. break ;;
  686. * )
  687. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  688. esac
  689. done
  690. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  691. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  692. #
  693. # This file is free software; the Free Software Foundation
  694. # gives unlimited permission to copy and/or distribute it,
  695. # with or without modifications, as long as this notice is preserved.
  696. # AM_PROG_INSTALL_SH
  697. # ------------------
  698. # Define $install_sh.
  699. AC_DEFUN([AM_PROG_INSTALL_SH],
  700. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  701. if test x"${install_sh}" != xset; then
  702. case $am_aux_dir in
  703. *\ * | *\ *)
  704. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  705. *)
  706. install_sh="\${SHELL} $am_aux_dir/install-sh"
  707. esac
  708. fi
  709. AC_SUBST([install_sh])])
  710. # Copyright (C) 2003-2012 Free Software Foundation, Inc.
  711. #
  712. # This file is free software; the Free Software Foundation
  713. # gives unlimited permission to copy and/or distribute it,
  714. # with or without modifications, as long as this notice is preserved.
  715. # Check whether the underlying file-system supports filenames
  716. # with a leading dot. For instance MS-DOS doesn't.
  717. AC_DEFUN([AM_SET_LEADING_DOT],
  718. [rm -rf .tst 2>/dev/null
  719. mkdir .tst 2>/dev/null
  720. if test -d .tst; then
  721. am__leading_dot=.
  722. else
  723. am__leading_dot=_
  724. fi
  725. rmdir .tst 2>/dev/null
  726. AC_SUBST([am__leading_dot])])
  727. # Check to see how 'make' treats includes. -*- Autoconf -*-
  728. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  729. #
  730. # This file is free software; the Free Software Foundation
  731. # gives unlimited permission to copy and/or distribute it,
  732. # with or without modifications, as long as this notice is preserved.
  733. # AM_MAKE_INCLUDE()
  734. # -----------------
  735. # Check to see how make treats includes.
  736. AC_DEFUN([AM_MAKE_INCLUDE],
  737. [am_make=${MAKE-make}
  738. cat > confinc << 'END'
  739. am__doit:
  740. @echo this is the am__doit target
  741. .PHONY: am__doit
  742. END
  743. # If we don't find an include directive, just comment out the code.
  744. AC_MSG_CHECKING([for style of include used by $am_make])
  745. am__include="#"
  746. am__quote=
  747. _am_result=none
  748. # First try GNU make style include.
  749. echo "include confinc" > confmf
  750. # Ignore all kinds of additional output from 'make'.
  751. case `$am_make -s -f confmf 2> /dev/null` in #(
  752. *the\ am__doit\ target*)
  753. am__include=include
  754. am__quote=
  755. _am_result=GNU
  756. ;;
  757. esac
  758. # Now try BSD make style include.
  759. if test "$am__include" = "#"; then
  760. echo '.include "confinc"' > confmf
  761. case `$am_make -s -f confmf 2> /dev/null` in #(
  762. *the\ am__doit\ target*)
  763. am__include=.include
  764. am__quote="\""
  765. _am_result=BSD
  766. ;;
  767. esac
  768. fi
  769. AC_SUBST([am__include])
  770. AC_SUBST([am__quote])
  771. AC_MSG_RESULT([$_am_result])
  772. rm -f confinc confmf
  773. ])
  774. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  775. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  776. #
  777. # This file is free software; the Free Software Foundation
  778. # gives unlimited permission to copy and/or distribute it,
  779. # with or without modifications, as long as this notice is preserved.
  780. # AM_MISSING_PROG(NAME, PROGRAM)
  781. # ------------------------------
  782. AC_DEFUN([AM_MISSING_PROG],
  783. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  784. $1=${$1-"${am_missing_run}$2"}
  785. AC_SUBST($1)])
  786. # AM_MISSING_HAS_RUN
  787. # ------------------
  788. # Define MISSING if not defined so far and test if it supports --run.
  789. # If it does, set am_missing_run to use it, otherwise, to nothing.
  790. AC_DEFUN([AM_MISSING_HAS_RUN],
  791. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  792. AC_REQUIRE_AUX_FILE([missing])dnl
  793. if test x"${MISSING+set}" != xset; then
  794. case $am_aux_dir in
  795. *\ * | *\ *)
  796. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  797. *)
  798. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  799. esac
  800. fi
  801. # Use eval to expand $SHELL
  802. if eval "$MISSING --run true"; then
  803. am_missing_run="$MISSING --run "
  804. else
  805. am_missing_run=
  806. AC_MSG_WARN(['missing' script is too old or missing])
  807. fi
  808. ])
  809. # Helper functions for option handling. -*- Autoconf -*-
  810. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  811. #
  812. # This file is free software; the Free Software Foundation
  813. # gives unlimited permission to copy and/or distribute it,
  814. # with or without modifications, as long as this notice is preserved.
  815. # _AM_MANGLE_OPTION(NAME)
  816. # -----------------------
  817. AC_DEFUN([_AM_MANGLE_OPTION],
  818. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  819. # _AM_SET_OPTION(NAME)
  820. # --------------------
  821. # Set option NAME. Presently that only means defining a flag for this option.
  822. AC_DEFUN([_AM_SET_OPTION],
  823. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  824. # _AM_SET_OPTIONS(OPTIONS)
  825. # ------------------------
  826. # OPTIONS is a space-separated list of Automake options.
  827. AC_DEFUN([_AM_SET_OPTIONS],
  828. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  829. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  830. # -------------------------------------------
  831. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  832. AC_DEFUN([_AM_IF_OPTION],
  833. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  834. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  835. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  836. #
  837. # This file is free software; the Free Software Foundation
  838. # gives unlimited permission to copy and/or distribute it,
  839. # with or without modifications, as long as this notice is preserved.
  840. # AM_SANITY_CHECK
  841. # ---------------
  842. AC_DEFUN([AM_SANITY_CHECK],
  843. [AC_MSG_CHECKING([whether build environment is sane])
  844. # Reject unsafe characters in $srcdir or the absolute working directory
  845. # name. Accept space and tab only in the latter.
  846. am_lf='
  847. '
  848. case `pwd` in
  849. *[[\\\"\#\$\&\'\`$am_lf]]*)
  850. AC_MSG_ERROR([unsafe absolute working directory name]);;
  851. esac
  852. case $srcdir in
  853. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  854. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  855. esac
  856. # Do 'set' in a subshell so we don't clobber the current shell's
  857. # arguments. Must try -L first in case configure is actually a
  858. # symlink; some systems play weird games with the mod time of symlinks
  859. # (eg FreeBSD returns the mod time of the symlink's containing
  860. # directory).
  861. if (
  862. am_has_slept=no
  863. for am_try in 1 2; do
  864. echo "timestamp, slept: $am_has_slept" > conftest.file
  865. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  866. if test "$[*]" = "X"; then
  867. # -L didn't work.
  868. set X `ls -t "$srcdir/configure" conftest.file`
  869. fi
  870. if test "$[*]" != "X $srcdir/configure conftest.file" \
  871. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  872. # If neither matched, then we have a broken ls. This can happen
  873. # if, for instance, CONFIG_SHELL is bash and it inherits a
  874. # broken ls alias from the environment. This has actually
  875. # happened. Such a system could not be considered "sane".
  876. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  877. alias in your environment])
  878. fi
  879. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  880. break
  881. fi
  882. # Just in case.
  883. sleep 1
  884. am_has_slept=yes
  885. done
  886. test "$[2]" = conftest.file
  887. )
  888. then
  889. # Ok.
  890. :
  891. else
  892. AC_MSG_ERROR([newly created file is older than distributed files!
  893. Check your system clock])
  894. fi
  895. AC_MSG_RESULT([yes])
  896. # If we didn't sleep, we still need to ensure time stamps of config.status and
  897. # generated files are strictly newer.
  898. am_sleep_pid=
  899. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  900. ( sleep 1 ) &
  901. am_sleep_pid=$!
  902. fi
  903. AC_CONFIG_COMMANDS_PRE(
  904. [AC_MSG_CHECKING([that generated files are newer than configure])
  905. if test -n "$am_sleep_pid"; then
  906. # Hide warnings about reused PIDs.
  907. wait $am_sleep_pid 2>/dev/null
  908. fi
  909. AC_MSG_RESULT([done])])
  910. rm -f conftest.file
  911. ])
  912. # Copyright (C) 2009-2012 Free Software Foundation, Inc.
  913. #
  914. # This file is free software; the Free Software Foundation
  915. # gives unlimited permission to copy and/or distribute it,
  916. # with or without modifications, as long as this notice is preserved.
  917. # AM_SILENT_RULES([DEFAULT])
  918. # --------------------------
  919. # Enable less verbose build rules; with the default set to DEFAULT
  920. # ("yes" being less verbose, "no" or empty being verbose).
  921. AC_DEFUN([AM_SILENT_RULES],
  922. [AC_ARG_ENABLE([silent-rules], [dnl
  923. AS_HELP_STRING(
  924. [--enable-silent-rules],
  925. [less verbose build output (undo: "make V=1")])
  926. AS_HELP_STRING(
  927. [--disable-silent-rules],
  928. [verbose build output (undo: "make V=0")])dnl
  929. ])
  930. case $enable_silent_rules in @%:@ (((
  931. yes) AM_DEFAULT_VERBOSITY=0;;
  932. no) AM_DEFAULT_VERBOSITY=1;;
  933. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  934. esac
  935. dnl
  936. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  937. dnl do not support nested variable expansions.
  938. dnl See automake bug#9928 and bug#10237.
  939. am_make=${MAKE-make}
  940. AC_CACHE_CHECK([whether $am_make supports nested variables],
  941. [am_cv_make_support_nested_variables],
  942. [if AS_ECHO([['TRUE=$(BAR$(V))
  943. BAR0=false
  944. BAR1=true
  945. V=1
  946. am__doit:
  947. @$(TRUE)
  948. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  949. am_cv_make_support_nested_variables=yes
  950. else
  951. am_cv_make_support_nested_variables=no
  952. fi])
  953. if test $am_cv_make_support_nested_variables = yes; then
  954. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  955. AM_V='$(V)'
  956. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  957. else
  958. AM_V=$AM_DEFAULT_VERBOSITY
  959. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  960. fi
  961. AC_SUBST([AM_V])dnl
  962. AM_SUBST_NOTMAKE([AM_V])dnl
  963. AC_SUBST([AM_DEFAULT_V])dnl
  964. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  965. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  966. AM_BACKSLASH='\'
  967. AC_SUBST([AM_BACKSLASH])dnl
  968. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  969. ])
  970. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  971. #
  972. # This file is free software; the Free Software Foundation
  973. # gives unlimited permission to copy and/or distribute it,
  974. # with or without modifications, as long as this notice is preserved.
  975. # AM_PROG_INSTALL_STRIP
  976. # ---------------------
  977. # One issue with vendor 'install' (even GNU) is that you can't
  978. # specify the program used to strip binaries. This is especially
  979. # annoying in cross-compiling environments, where the build's strip
  980. # is unlikely to handle the host's binaries.
  981. # Fortunately install-sh will honor a STRIPPROG variable, so we
  982. # always use install-sh in "make install-strip", and initialize
  983. # STRIPPROG with the value of the STRIP variable (set by the user).
  984. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  985. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  986. # Installed binaries are usually stripped using 'strip' when the user
  987. # run "make install-strip". However 'strip' might not be the right
  988. # tool to use in cross-compilation environments, therefore Automake
  989. # will honor the 'STRIP' environment variable to overrule this program.
  990. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  991. if test "$cross_compiling" != no; then
  992. AC_CHECK_TOOL([STRIP], [strip], :)
  993. fi
  994. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  995. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  996. # Copyright (C) 2006-2012 Free Software Foundation, Inc.
  997. #
  998. # This file is free software; the Free Software Foundation
  999. # gives unlimited permission to copy and/or distribute it,
  1000. # with or without modifications, as long as this notice is preserved.
  1001. # _AM_SUBST_NOTMAKE(VARIABLE)
  1002. # ---------------------------
  1003. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1004. # This macro is traced by Automake.
  1005. AC_DEFUN([_AM_SUBST_NOTMAKE])
  1006. # AM_SUBST_NOTMAKE(VARIABLE)
  1007. # --------------------------
  1008. # Public sister of _AM_SUBST_NOTMAKE.
  1009. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1010. # Check how to create a tarball. -*- Autoconf -*-
  1011. # Copyright (C) 2004-2012 Free Software Foundation, Inc.
  1012. #
  1013. # This file is free software; the Free Software Foundation
  1014. # gives unlimited permission to copy and/or distribute it,
  1015. # with or without modifications, as long as this notice is preserved.
  1016. # _AM_PROG_TAR(FORMAT)
  1017. # --------------------
  1018. # Check how to create a tarball in format FORMAT.
  1019. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  1020. #
  1021. # Substitute a variable $(am__tar) that is a command
  1022. # writing to stdout a FORMAT-tarball containing the directory
  1023. # $tardir.
  1024. # tardir=directory && $(am__tar) > result.tar
  1025. #
  1026. # Substitute a variable $(am__untar) that extract such
  1027. # a tarball read from stdin.
  1028. # $(am__untar) < result.tar
  1029. AC_DEFUN([_AM_PROG_TAR],
  1030. [# Always define AMTAR for backward compatibility. Yes, it's still used
  1031. # in the wild :-( We should find a proper way to deprecate it ...
  1032. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  1033. m4_if([$1], [v7],
  1034. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  1035. [m4_case([$1], [ustar],, [pax],,
  1036. [m4_fatal([Unknown tar format])])
  1037. AC_MSG_CHECKING([how to create a $1 tar archive])
  1038. # Loop over all known methods to create a tar archive until one works.
  1039. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1040. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1041. # Do not fold the above two line into one, because Tru64 sh and
  1042. # Solaris sh will not grok spaces in the rhs of '-'.
  1043. for _am_tool in $_am_tools
  1044. do
  1045. case $_am_tool in
  1046. gnutar)
  1047. for _am_tar in tar gnutar gtar;
  1048. do
  1049. AM_RUN_LOG([$_am_tar --version]) && break
  1050. done
  1051. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  1052. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  1053. am__untar="$_am_tar -xf -"
  1054. ;;
  1055. plaintar)
  1056. # Must skip GNU tar: if it does not support --format= it doesn't create
  1057. # ustar tarball either.
  1058. (tar --version) >/dev/null 2>&1 && continue
  1059. am__tar='tar chf - "$$tardir"'
  1060. am__tar_='tar chf - "$tardir"'
  1061. am__untar='tar xf -'
  1062. ;;
  1063. pax)
  1064. am__tar='pax -L -x $1 -w "$$tardir"'
  1065. am__tar_='pax -L -x $1 -w "$tardir"'
  1066. am__untar='pax -r'
  1067. ;;
  1068. cpio)
  1069. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  1070. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  1071. am__untar='cpio -i -H $1 -d'
  1072. ;;
  1073. none)
  1074. am__tar=false
  1075. am__tar_=false
  1076. am__untar=false
  1077. ;;
  1078. esac
  1079. # If the value was cached, stop now. We just wanted to have am__tar
  1080. # and am__untar set.
  1081. test -n "${am_cv_prog_tar_$1}" && break
  1082. # tar/untar a dummy directory, and stop if the command works
  1083. rm -rf conftest.dir
  1084. mkdir conftest.dir
  1085. echo GrepMe > conftest.dir/file
  1086. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  1087. rm -rf conftest.dir
  1088. if test -s conftest.tar; then
  1089. AM_RUN_LOG([$am__untar <conftest.tar])
  1090. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  1091. fi
  1092. done
  1093. rm -rf conftest.dir
  1094. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1095. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1096. AC_SUBST([am__tar])
  1097. AC_SUBST([am__untar])
  1098. ]) # _AM_PROG_TAR
  1099. m4_include([m4/ac_define_dir.m4])
  1100. m4_include([m4/libtool.m4])
  1101. m4_include([m4/ltoptions.m4])
  1102. m4_include([m4/ltsugar.m4])
  1103. m4_include([m4/ltversion.m4])
  1104. m4_include([m4/lt~obsolete.m4])
  1105. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
  1106. dnl
  1107. dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
  1108. dnl
  1109. dnl Permission is hereby granted, free of charge, to any person obtaining a
  1110. dnl copy of this software and associated documentation files (the "Software"),
  1111. dnl to deal in the Software without restriction, including without limitation
  1112. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  1113. dnl and/or sell copies of the Software, and to permit persons to whom the
  1114. dnl Software is furnished to do so, subject to the following conditions:
  1115. dnl
  1116. dnl The above copyright notice and this permission notice (including the next
  1117. dnl paragraph) shall be included in all copies or substantial portions of the
  1118. dnl Software.
  1119. dnl
  1120. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1121. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1122. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  1123. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1124. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  1125. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  1126. dnl DEALINGS IN THE SOFTWARE.
  1127. # XORG_MACROS_VERSION(required-version)
  1128. # -------------------------------------
  1129. # Minimum version: 1.1.0
  1130. #
  1131. # If you're using a macro added in Version 1.1 or newer, include this in
  1132. # your configure.ac with the minimum required version, such as:
  1133. # XORG_MACROS_VERSION(1.1)
  1134. #
  1135. # To ensure that this macro is defined, also add:
  1136. # m4_ifndef([XORG_MACROS_VERSION],
  1137. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
  1138. #
  1139. #
  1140. # See the "minimum version" comment for each macro you use to see what
  1141. # version you require.
  1142. m4_defun([XORG_MACROS_VERSION],[
  1143. m4_define([vers_have], [1.19.0])
  1144. m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
  1145. m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
  1146. m4_if(m4_cmp(maj_have, maj_needed), 0,,
  1147. [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
  1148. m4_if(m4_version_compare(vers_have, [$1]), -1,
  1149. [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
  1150. m4_undefine([vers_have])
  1151. m4_undefine([maj_have])
  1152. m4_undefine([maj_needed])
  1153. ]) # XORG_MACROS_VERSION
  1154. # XORG_PROG_RAWCPP()
  1155. # ------------------
  1156. # Minimum version: 1.0.0
  1157. #
  1158. # Find cpp program and necessary flags for use in pre-processing text files
  1159. # such as man pages and config files
  1160. AC_DEFUN([XORG_PROG_RAWCPP],[
  1161. AC_REQUIRE([AC_PROG_CPP])
  1162. AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
  1163. [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
  1164. # Check for flag to avoid builtin definitions - assumes unix is predefined,
  1165. # which is not the best choice for supporting other OS'es, but covers most
  1166. # of the ones we need for now.
  1167. AC_MSG_CHECKING([if $RAWCPP requires -undef])
  1168. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
  1169. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1170. AC_MSG_RESULT([no])
  1171. else
  1172. if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1173. RAWCPPFLAGS=-undef
  1174. AC_MSG_RESULT([yes])
  1175. # under Cygwin unix is still defined even with -undef
  1176. elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1177. RAWCPPFLAGS="-undef -ansi"
  1178. AC_MSG_RESULT([yes, with -ansi])
  1179. else
  1180. AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
  1181. fi
  1182. fi
  1183. rm -f conftest.$ac_ext
  1184. AC_MSG_CHECKING([if $RAWCPP requires -traditional])
  1185. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
  1186. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1187. AC_MSG_RESULT([no])
  1188. else
  1189. if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1190. TRADITIONALCPPFLAGS="-traditional"
  1191. RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
  1192. AC_MSG_RESULT([yes])
  1193. else
  1194. AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
  1195. fi
  1196. fi
  1197. rm -f conftest.$ac_ext
  1198. AC_SUBST(RAWCPPFLAGS)
  1199. AC_SUBST(TRADITIONALCPPFLAGS)
  1200. ]) # XORG_PROG_RAWCPP
  1201. # XORG_MANPAGE_SECTIONS()
  1202. # -----------------------
  1203. # Minimum version: 1.0.0
  1204. #
  1205. # Determine which sections man pages go in for the different man page types
  1206. # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
  1207. # Not sure if there's any better way than just hardcoding by OS name.
  1208. # Override default settings by setting environment variables
  1209. # Added MAN_SUBSTS in version 1.8
  1210. # Added AC_PROG_SED in version 1.8
  1211. AC_DEFUN([XORG_MANPAGE_SECTIONS],[
  1212. AC_REQUIRE([AC_CANONICAL_HOST])
  1213. AC_REQUIRE([AC_PROG_SED])
  1214. if test x$APP_MAN_SUFFIX = x ; then
  1215. APP_MAN_SUFFIX=1
  1216. fi
  1217. if test x$APP_MAN_DIR = x ; then
  1218. APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
  1219. fi
  1220. if test x$LIB_MAN_SUFFIX = x ; then
  1221. LIB_MAN_SUFFIX=3
  1222. fi
  1223. if test x$LIB_MAN_DIR = x ; then
  1224. LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
  1225. fi
  1226. if test x$FILE_MAN_SUFFIX = x ; then
  1227. case $host_os in
  1228. solaris*) FILE_MAN_SUFFIX=4 ;;
  1229. *) FILE_MAN_SUFFIX=5 ;;
  1230. esac
  1231. fi
  1232. if test x$FILE_MAN_DIR = x ; then
  1233. FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
  1234. fi
  1235. if test x$MISC_MAN_SUFFIX = x ; then
  1236. case $host_os in
  1237. solaris*) MISC_MAN_SUFFIX=5 ;;
  1238. *) MISC_MAN_SUFFIX=7 ;;
  1239. esac
  1240. fi
  1241. if test x$MISC_MAN_DIR = x ; then
  1242. MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
  1243. fi
  1244. if test x$DRIVER_MAN_SUFFIX = x ; then
  1245. case $host_os in
  1246. solaris*) DRIVER_MAN_SUFFIX=7 ;;
  1247. *) DRIVER_MAN_SUFFIX=4 ;;
  1248. esac
  1249. fi
  1250. if test x$DRIVER_MAN_DIR = x ; then
  1251. DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
  1252. fi
  1253. if test x$ADMIN_MAN_SUFFIX = x ; then
  1254. case $host_os in
  1255. solaris*) ADMIN_MAN_SUFFIX=1m ;;
  1256. *) ADMIN_MAN_SUFFIX=8 ;;
  1257. esac
  1258. fi
  1259. if test x$ADMIN_MAN_DIR = x ; then
  1260. ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
  1261. fi
  1262. AC_SUBST([APP_MAN_SUFFIX])
  1263. AC_SUBST([LIB_MAN_SUFFIX])
  1264. AC_SUBST([FILE_MAN_SUFFIX])
  1265. AC_SUBST([MISC_MAN_SUFFIX])
  1266. AC_SUBST([DRIVER_MAN_SUFFIX])
  1267. AC_SUBST([ADMIN_MAN_SUFFIX])
  1268. AC_SUBST([APP_MAN_DIR])
  1269. AC_SUBST([LIB_MAN_DIR])
  1270. AC_SUBST([FILE_MAN_DIR])
  1271. AC_SUBST([MISC_MAN_DIR])
  1272. AC_SUBST([DRIVER_MAN_DIR])
  1273. AC_SUBST([ADMIN_MAN_DIR])
  1274. XORG_MAN_PAGE="X Version 11"
  1275. AC_SUBST([XORG_MAN_PAGE])
  1276. MAN_SUBSTS="\
  1277. -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1278. -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1279. -e 's|__xservername__|Xorg|g' \
  1280. -e 's|__xconfigfile__|xorg.conf|g' \
  1281. -e 's|__projectroot__|\$(prefix)|g' \
  1282. -e 's|__apploaddir__|\$(appdefaultdir)|g' \
  1283. -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
  1284. -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
  1285. -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
  1286. -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
  1287. -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
  1288. -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
  1289. AC_SUBST([MAN_SUBSTS])
  1290. ]) # XORG_MANPAGE_SECTIONS
  1291. # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
  1292. # ------------------------
  1293. # Minimum version: 1.7.0
  1294. #
  1295. # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
  1296. # provided by xorg-sgml-doctools, if installed.
  1297. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
  1298. AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
  1299. XORG_SGML_PATH=
  1300. PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
  1301. [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
  1302. [m4_ifval([$1],[:],
  1303. [if test x"$cross_compiling" != x"yes" ; then
  1304. AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
  1305. [XORG_SGML_PATH=$prefix/share/sgml])
  1306. fi])
  1307. ])
  1308. # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
  1309. # the path and the name of the doc stylesheet
  1310. if test "x$XORG_SGML_PATH" != "x" ; then
  1311. AC_MSG_RESULT([$XORG_SGML_PATH])
  1312. STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
  1313. XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
  1314. else
  1315. AC_MSG_RESULT([no])
  1316. fi
  1317. AC_SUBST(XORG_SGML_PATH)
  1318. AC_SUBST(STYLESHEET_SRCDIR)
  1319. AC_SUBST(XSL_STYLESHEET)
  1320. AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
  1321. ]) # XORG_CHECK_SGML_DOCTOOLS
  1322. # XORG_CHECK_LINUXDOC
  1323. # -------------------
  1324. # Minimum version: 1.0.0
  1325. #
  1326. # Defines the variable MAKE_TEXT if the necessary tools and
  1327. # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
  1328. # Whether or not the necessary tools and files are found can be checked
  1329. # with the AM_CONDITIONAL "BUILD_LINUXDOC"
  1330. AC_DEFUN([XORG_CHECK_LINUXDOC],[
  1331. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1332. AC_REQUIRE([XORG_WITH_PS2PDF])
  1333. AC_PATH_PROG(LINUXDOC, linuxdoc)
  1334. AC_MSG_CHECKING([whether to build documentation])
  1335. if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
  1336. BUILDDOC=yes
  1337. else
  1338. BUILDDOC=no
  1339. fi
  1340. AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
  1341. AC_MSG_RESULT([$BUILDDOC])
  1342. AC_MSG_CHECKING([whether to build pdf documentation])
  1343. if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
  1344. BUILDPDFDOC=yes
  1345. else
  1346. BUILDPDFDOC=no
  1347. fi
  1348. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1349. AC_MSG_RESULT([$BUILDPDFDOC])
  1350. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
  1351. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
  1352. MAKE_PDF="$PS2PDF"
  1353. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
  1354. AC_SUBST(MAKE_TEXT)
  1355. AC_SUBST(MAKE_PS)
  1356. AC_SUBST(MAKE_PDF)
  1357. AC_SUBST(MAKE_HTML)
  1358. ]) # XORG_CHECK_LINUXDOC
  1359. # XORG_CHECK_DOCBOOK
  1360. # -------------------
  1361. # Minimum version: 1.0.0
  1362. #
  1363. # Checks for the ability to build output formats from SGML DocBook source.
  1364. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
  1365. # indicates whether the necessary tools and files are found and, if set,
  1366. # $(MAKE_XXX) blah.sgml will produce blah.xxx.
  1367. AC_DEFUN([XORG_CHECK_DOCBOOK],[
  1368. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1369. BUILDTXTDOC=no
  1370. BUILDPDFDOC=no
  1371. BUILDPSDOC=no
  1372. BUILDHTMLDOC=no
  1373. AC_PATH_PROG(DOCBOOKPS, docbook2ps)
  1374. AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
  1375. AC_PATH_PROG(DOCBOOKHTML, docbook2html)
  1376. AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
  1377. AC_MSG_CHECKING([whether to build text documentation])
  1378. if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
  1379. test x$BUILD_TXTDOC != xno; then
  1380. BUILDTXTDOC=yes
  1381. fi
  1382. AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
  1383. AC_MSG_RESULT([$BUILDTXTDOC])
  1384. AC_MSG_CHECKING([whether to build PDF documentation])
  1385. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
  1386. test x$BUILD_PDFDOC != xno; then
  1387. BUILDPDFDOC=yes
  1388. fi
  1389. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1390. AC_MSG_RESULT([$BUILDPDFDOC])
  1391. AC_MSG_CHECKING([whether to build PostScript documentation])
  1392. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
  1393. test x$BUILD_PSDOC != xno; then
  1394. BUILDPSDOC=yes
  1395. fi
  1396. AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
  1397. AC_MSG_RESULT([$BUILDPSDOC])
  1398. AC_MSG_CHECKING([whether to build HTML documentation])
  1399. if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
  1400. test x$BUILD_HTMLDOC != xno; then
  1401. BUILDHTMLDOC=yes
  1402. fi
  1403. AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
  1404. AC_MSG_RESULT([$BUILDHTMLDOC])
  1405. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
  1406. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
  1407. MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
  1408. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
  1409. AC_SUBST(MAKE_TEXT)
  1410. AC_SUBST(MAKE_PS)
  1411. AC_SUBST(MAKE_PDF)
  1412. AC_SUBST(MAKE_HTML)
  1413. ]) # XORG_CHECK_DOCBOOK
  1414. # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
  1415. # ----------------
  1416. # Minimum version: 1.5.0
  1417. # Minimum version for optional DEFAULT argument: 1.11.0
  1418. #
  1419. # Documentation tools are not always available on all platforms and sometimes
  1420. # not at the appropriate level. This macro enables a module to test for the
  1421. # presence of the tool and obtain it's path in separate variables. Coupled with
  1422. # the --with-xmlto option, it allows maximum flexibilty in making decisions
  1423. # as whether or not to use the xmlto package. When DEFAULT is not specified,
  1424. # --with-xmlto assumes 'auto'.
  1425. #
  1426. # Interface to module:
  1427. # HAVE_XMLTO: used in makefiles to conditionally generate documentation
  1428. # XMLTO: returns the path of the xmlto program found
  1429. # returns the path set by the user in the environment
  1430. # --with-xmlto: 'yes' user instructs the module to use xmlto
  1431. # 'no' user instructs the module not to use xmlto
  1432. #
  1433. # Added in version 1.10.0
  1434. # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
  1435. # xmlto for text output requires either lynx, links, or w3m browsers
  1436. #
  1437. # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
  1438. #
  1439. AC_DEFUN([XORG_WITH_XMLTO],[
  1440. AC_ARG_VAR([XMLTO], [Path to xmlto command])
  1441. m4_define([_defopt], m4_default([$2], [auto]))
  1442. AC_ARG_WITH(xmlto,
  1443. AS_HELP_STRING([--with-xmlto],
  1444. [Use xmlto to regenerate documentation (default: ]_defopt[)]),
  1445. [use_xmlto=$withval], [use_xmlto=]_defopt)
  1446. m4_undefine([_defopt])
  1447. if test "x$use_xmlto" = x"auto"; then
  1448. AC_PATH_PROG([XMLTO], [xmlto])
  1449. if test "x$XMLTO" = "x"; then
  1450. AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
  1451. have_xmlto=no
  1452. else
  1453. have_xmlto=yes
  1454. fi
  1455. elif test "x$use_xmlto" = x"yes" ; then
  1456. AC_PATH_PROG([XMLTO], [xmlto])
  1457. if test "x$XMLTO" = "x"; then
  1458. AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
  1459. fi
  1460. have_xmlto=yes
  1461. elif test "x$use_xmlto" = x"no" ; then
  1462. if test "x$XMLTO" != "x"; then
  1463. AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
  1464. fi
  1465. have_xmlto=no
  1466. else
  1467. AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
  1468. fi
  1469. # Test for a minimum version of xmlto, if provided.
  1470. m4_ifval([$1],
  1471. [if test "$have_xmlto" = yes; then
  1472. # scrape the xmlto version
  1473. AC_MSG_CHECKING([the xmlto version])
  1474. xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
  1475. AC_MSG_RESULT([$xmlto_version])
  1476. AS_VERSION_COMPARE([$xmlto_version], [$1],
  1477. [if test "x$use_xmlto" = xauto; then
  1478. AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
  1479. have_xmlto=no
  1480. else
  1481. AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
  1482. fi])
  1483. fi])
  1484. # Test for the ability of xmlto to generate a text target
  1485. have_xmlto_text=no
  1486. cat > conftest.xml << "EOF"
  1487. EOF
  1488. AS_IF([test "$have_xmlto" = yes],
  1489. [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
  1490. [have_xmlto_text=yes],
  1491. [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
  1492. rm -f conftest.xml
  1493. AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
  1494. AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
  1495. ]) # XORG_WITH_XMLTO
  1496. # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
  1497. # --------------------------------------------
  1498. # Minimum version: 1.12.0
  1499. # Minimum version for optional DEFAULT argument: 1.12.0
  1500. #
  1501. # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
  1502. # XML-based language used for the transformation of XML documents.
  1503. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
  1504. # It is used under the cover by xmlto to generate html files from DocBook/XML.
  1505. # The XSLT processor is often used as a standalone tool for transformations.
  1506. # It should not be assumed that this tool is used only to work with documnetation.
  1507. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
  1508. #
  1509. # Interface to module:
  1510. # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
  1511. # XSLTPROC: returns the path of the xsltproc program found
  1512. # returns the path set by the user in the environment
  1513. # --with-xsltproc: 'yes' user instructs the module to use xsltproc
  1514. # 'no' user instructs the module not to use xsltproc
  1515. # have_xsltproc: returns yes if xsltproc found in PATH or no
  1516. #
  1517. # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
  1518. #
  1519. AC_DEFUN([XORG_WITH_XSLTPROC],[
  1520. AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
  1521. # Preserves the interface, should it be implemented later
  1522. m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
  1523. m4_define([_defopt], m4_default([$2], [auto]))
  1524. AC_ARG_WITH(xsltproc,
  1525. AS_HELP_STRING([--with-xsltproc],
  1526. [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
  1527. [use_xsltproc=$withval], [use_xsltproc=]_defopt)
  1528. m4_undefine([_defopt])
  1529. if test "x$use_xsltproc" = x"auto"; then
  1530. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1531. if test "x$XSLTPROC" = "x"; then
  1532. AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
  1533. have_xsltproc=no
  1534. else
  1535. have_xsltproc=yes
  1536. fi
  1537. elif test "x$use_xsltproc" = x"yes" ; then
  1538. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1539. if test "x$XSLTPROC" = "x"; then
  1540. AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
  1541. fi
  1542. have_xsltproc=yes
  1543. elif test "x$use_xsltproc" = x"no" ; then
  1544. if test "x$XSLTPROC" != "x"; then
  1545. AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
  1546. fi
  1547. have_xsltproc=no
  1548. else
  1549. AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
  1550. fi
  1551. AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
  1552. ]) # XORG_WITH_XSLTPROC
  1553. # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
  1554. # ----------------------------------------
  1555. # Minimum version: 1.15.0
  1556. #
  1557. # PERL (Practical Extraction and Report Language) is a language optimized for
  1558. # scanning arbitrary text files, extracting information from those text files,
  1559. # and printing reports based on that information.
  1560. #
  1561. # When DEFAULT is not specified, --with-perl assumes 'auto'.
  1562. #
  1563. # Interface to module:
  1564. # HAVE_PERL: used in makefiles to conditionally scan text files
  1565. # PERL: returns the path of the perl program found
  1566. # returns the path set by the user in the environment
  1567. # --with-perl: 'yes' user instructs the module to use perl
  1568. # 'no' user instructs the module not to use perl
  1569. # have_perl: returns yes if perl found in PATH or no
  1570. #
  1571. # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
  1572. #
  1573. AC_DEFUN([XORG_WITH_PERL],[
  1574. AC_ARG_VAR([PERL], [Path to perl command])
  1575. # Preserves the interface, should it be implemented later
  1576. m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
  1577. m4_define([_defopt], m4_default([$2], [auto]))
  1578. AC_ARG_WITH(perl,
  1579. AS_HELP_STRING([--with-perl],
  1580. [Use perl for extracting information from files (default: ]_defopt[)]),
  1581. [use_perl=$withval], [use_perl=]_defopt)
  1582. m4_undefine([_defopt])
  1583. if test "x$use_perl" = x"auto"; then
  1584. AC_PATH_PROG([PERL], [perl])
  1585. if test "x$PERL" = "x"; then
  1586. AC_MSG_WARN([perl not found - cannot extract information and report])
  1587. have_perl=no
  1588. else
  1589. have_perl=yes
  1590. fi
  1591. elif test "x$use_perl" = x"yes" ; then
  1592. AC_PATH_PROG([PERL], [perl])
  1593. if test "x$PERL" = "x"; then
  1594. AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
  1595. fi
  1596. have_perl=yes
  1597. elif test "x$use_perl" = x"no" ; then
  1598. if test "x$PERL" != "x"; then
  1599. AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
  1600. fi
  1601. have_perl=no
  1602. else
  1603. AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
  1604. fi
  1605. AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
  1606. ]) # XORG_WITH_PERL
  1607. # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
  1608. # ----------------
  1609. # Minimum version: 1.5.0
  1610. # Minimum version for optional DEFAULT argument: 1.11.0
  1611. #
  1612. # Documentation tools are not always available on all platforms and sometimes
  1613. # not at the appropriate level. This macro enables a module to test for the
  1614. # presence of the tool and obtain it's path in separate variables. Coupled with
  1615. # the --with-asciidoc option, it allows maximum flexibilty in making decisions
  1616. # as whether or not to use the asciidoc package. When DEFAULT is not specified,
  1617. # --with-asciidoc assumes 'auto'.
  1618. #
  1619. # Interface to module:
  1620. # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
  1621. # ASCIIDOC: returns the path of the asciidoc program found
  1622. # returns the path set by the user in the environment
  1623. # --with-asciidoc: 'yes' user instructs the module to use asciidoc
  1624. # 'no' user instructs the module not to use asciidoc
  1625. #
  1626. # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
  1627. #
  1628. AC_DEFUN([XORG_WITH_ASCIIDOC],[
  1629. AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
  1630. m4_define([_defopt], m4_default([$2], [auto]))
  1631. AC_ARG_WITH(asciidoc,
  1632. AS_HELP_STRING([--with-asciidoc],
  1633. [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
  1634. [use_asciidoc=$withval], [use_asciidoc=]_defopt)
  1635. m4_undefine([_defopt])
  1636. if test "x$use_asciidoc" = x"auto"; then
  1637. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1638. if test "x$ASCIIDOC" = "x"; then
  1639. AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
  1640. have_asciidoc=no
  1641. else
  1642. have_asciidoc=yes
  1643. fi
  1644. elif test "x$use_asciidoc" = x"yes" ; then
  1645. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1646. if test "x$ASCIIDOC" = "x"; then
  1647. AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
  1648. fi
  1649. have_asciidoc=yes
  1650. elif test "x$use_asciidoc" = x"no" ; then
  1651. if test "x$ASCIIDOC" != "x"; then
  1652. AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
  1653. fi
  1654. have_asciidoc=no
  1655. else
  1656. AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
  1657. fi
  1658. m4_ifval([$1],
  1659. [if test "$have_asciidoc" = yes; then
  1660. # scrape the asciidoc version
  1661. AC_MSG_CHECKING([the asciidoc version])
  1662. asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
  1663. AC_MSG_RESULT([$asciidoc_version])
  1664. AS_VERSION_COMPARE([$asciidoc_version], [$1],
  1665. [if test "x$use_asciidoc" = xauto; then
  1666. AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
  1667. have_asciidoc=no
  1668. else
  1669. AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
  1670. fi])
  1671. fi])
  1672. AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
  1673. ]) # XORG_WITH_ASCIIDOC
  1674. # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
  1675. # -------------------------------------------
  1676. # Minimum version: 1.5.0
  1677. # Minimum version for optional DEFAULT argument: 1.11.0
  1678. # Minimum version for optional DOT checking: 1.18.0
  1679. #
  1680. # Documentation tools are not always available on all platforms and sometimes
  1681. # not at the appropriate level. This macro enables a module to test for the
  1682. # presence of the tool and obtain it's path in separate variables. Coupled with
  1683. # the --with-doxygen option, it allows maximum flexibilty in making decisions
  1684. # as whether or not to use the doxygen package. When DEFAULT is not specified,
  1685. # --with-doxygen assumes 'auto'.
  1686. #
  1687. # Interface to module:
  1688. # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
  1689. # DOXYGEN: returns the path of the doxygen program found
  1690. # returns the path set by the user in the environment
  1691. # --with-doxygen: 'yes' user instructs the module to use doxygen
  1692. # 'no' user instructs the module not to use doxygen
  1693. #
  1694. # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
  1695. #
  1696. AC_DEFUN([XORG_WITH_DOXYGEN],[
  1697. AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
  1698. AC_ARG_VAR([DOT], [Path to the dot graphics utility])
  1699. m4_define([_defopt], m4_default([$2], [auto]))
  1700. AC_ARG_WITH(doxygen,
  1701. AS_HELP_STRING([--with-doxygen],
  1702. [Use doxygen to regenerate documentation (default: ]_defopt[)]),
  1703. [use_doxygen=$withval], [use_doxygen=]_defopt)
  1704. m4_undefine([_defopt])
  1705. if test "x$use_doxygen" = x"auto"; then
  1706. AC_PATH_PROG([DOXYGEN], [doxygen])
  1707. if test "x$DOXYGEN" = "x"; then
  1708. AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
  1709. have_doxygen=no
  1710. else
  1711. have_doxygen=yes
  1712. fi
  1713. elif test "x$use_doxygen" = x"yes" ; then
  1714. AC_PATH_PROG([DOXYGEN], [doxygen])
  1715. if test "x$DOXYGEN" = "x"; then
  1716. AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
  1717. fi
  1718. have_doxygen=yes
  1719. elif test "x$use_doxygen" = x"no" ; then
  1720. if test "x$DOXYGEN" != "x"; then
  1721. AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
  1722. fi
  1723. have_doxygen=no
  1724. else
  1725. AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
  1726. fi
  1727. m4_ifval([$1],
  1728. [if test "$have_doxygen" = yes; then
  1729. # scrape the doxygen version
  1730. AC_MSG_CHECKING([the doxygen version])
  1731. doxygen_version=`$DOXYGEN --version 2>/dev/null`
  1732. AC_MSG_RESULT([$doxygen_version])
  1733. AS_VERSION_COMPARE([$doxygen_version], [$1],
  1734. [if test "x$use_doxygen" = xauto; then
  1735. AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
  1736. have_doxygen=no
  1737. else
  1738. AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
  1739. fi])
  1740. fi])
  1741. dnl Check for DOT if we have doxygen. The caller decides if it is mandatory
  1742. dnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
  1743. dnl HAVE_DOT = @HAVE_DOT@
  1744. HAVE_DOT=no
  1745. if test "x$have_doxygen" = "xyes"; then
  1746. AC_PATH_PROG([DOT], [dot])
  1747. if test "x$DOT" != "x"; then
  1748. HAVE_DOT=yes
  1749. fi
  1750. fi
  1751. AC_SUBST([HAVE_DOT])
  1752. AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
  1753. AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
  1754. ]) # XORG_WITH_DOXYGEN
  1755. # XORG_WITH_GROFF([DEFAULT])
  1756. # ----------------
  1757. # Minimum version: 1.6.0
  1758. # Minimum version for optional DEFAULT argument: 1.11.0
  1759. #
  1760. # Documentation tools are not always available on all platforms and sometimes
  1761. # not at the appropriate level. This macro enables a module to test for the
  1762. # presence of the tool and obtain it's path in separate variables. Coupled with
  1763. # the --with-groff option, it allows maximum flexibilty in making decisions
  1764. # as whether or not to use the groff package. When DEFAULT is not specified,
  1765. # --with-groff assumes 'auto'.
  1766. #
  1767. # Interface to module:
  1768. # HAVE_GROFF: used in makefiles to conditionally generate documentation
  1769. # HAVE_GROFF_MM: the memorandum macros (-mm) package
  1770. # HAVE_GROFF_MS: the -ms macros package
  1771. # GROFF: returns the path of the groff program found
  1772. # returns the path set by the user in the environment
  1773. # --with-groff: 'yes' user instructs the module to use groff
  1774. # 'no' user instructs the module not to use groff
  1775. #
  1776. # Added in version 1.9.0:
  1777. # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
  1778. # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
  1779. # psselect from the psutils package.
  1780. # the ghostcript package. Refer to the grohtml man pages
  1781. #
  1782. # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
  1783. #
  1784. # OS and distros often splits groff in a basic and full package, the former
  1785. # having the groff program and the later having devices, fonts and macros
  1786. # Checking for the groff executable is not enough.
  1787. #
  1788. # If macros are missing, we cannot assume that groff is useless, so we don't
  1789. # unset HAVE_GROFF or GROFF env variables.
  1790. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
  1791. #
  1792. AC_DEFUN([XORG_WITH_GROFF],[
  1793. AC_ARG_VAR([GROFF], [Path to groff command])
  1794. m4_define([_defopt], m4_default([$1], [auto]))
  1795. AC_ARG_WITH(groff,
  1796. AS_HELP_STRING([--with-groff],
  1797. [Use groff to regenerate documentation (default: ]_defopt[)]),
  1798. [use_groff=$withval], [use_groff=]_defopt)
  1799. m4_undefine([_defopt])
  1800. if test "x$use_groff" = x"auto"; then
  1801. AC_PATH_PROG([GROFF], [groff])
  1802. if test "x$GROFF" = "x"; then
  1803. AC_MSG_WARN([groff not found - documentation targets will be skipped])
  1804. have_groff=no
  1805. else
  1806. have_groff=yes
  1807. fi
  1808. elif test "x$use_groff" = x"yes" ; then
  1809. AC_PATH_PROG([GROFF], [groff])
  1810. if test "x$GROFF" = "x"; then
  1811. AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
  1812. fi
  1813. have_groff=yes
  1814. elif test "x$use_groff" = x"no" ; then
  1815. if test "x$GROFF" != "x"; then
  1816. AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
  1817. fi
  1818. have_groff=no
  1819. else
  1820. AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
  1821. fi
  1822. # We have groff, test for the presence of the macro packages
  1823. if test "x$have_groff" = x"yes"; then
  1824. AC_MSG_CHECKING([for ${GROFF} -ms macros])
  1825. if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
  1826. groff_ms_works=yes
  1827. else
  1828. groff_ms_works=no
  1829. fi
  1830. AC_MSG_RESULT([$groff_ms_works])
  1831. AC_MSG_CHECKING([for ${GROFF} -mm macros])
  1832. if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
  1833. groff_mm_works=yes
  1834. else
  1835. groff_mm_works=no
  1836. fi
  1837. AC_MSG_RESULT([$groff_mm_works])
  1838. fi
  1839. # We have groff, test for HTML dependencies, one command per package
  1840. if test "x$have_groff" = x"yes"; then
  1841. AC_PATH_PROGS(GS_PATH, [gs gswin32c])
  1842. AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
  1843. AC_PATH_PROG(PSSELECT_PATH, [psselect])
  1844. if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
  1845. have_groff_html=yes
  1846. else
  1847. have_groff_html=no
  1848. AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
  1849. fi
  1850. fi
  1851. # Set Automake conditionals for Makefiles
  1852. AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
  1853. AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
  1854. AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
  1855. AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
  1856. ]) # XORG_WITH_GROFF
  1857. # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
  1858. # ---------------------------------------
  1859. # Minimum version: 1.6.0
  1860. # Minimum version for optional DEFAULT argument: 1.11.0
  1861. # Minimum version for optional MIN-VERSION argument: 1.15.0
  1862. #
  1863. # Documentation tools are not always available on all platforms and sometimes
  1864. # not at the appropriate level. This macro enables a module to test for the
  1865. # presence of the tool and obtain it's path in separate variables. Coupled with
  1866. # the --with-fop option, it allows maximum flexibilty in making decisions
  1867. # as whether or not to use the fop package. When DEFAULT is not specified,
  1868. # --with-fop assumes 'auto'.
  1869. #
  1870. # Interface to module:
  1871. # HAVE_FOP: used in makefiles to conditionally generate documentation
  1872. # FOP: returns the path of the fop program found
  1873. # returns the path set by the user in the environment
  1874. # --with-fop: 'yes' user instructs the module to use fop
  1875. # 'no' user instructs the module not to use fop
  1876. #
  1877. # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
  1878. #
  1879. AC_DEFUN([XORG_WITH_FOP],[
  1880. AC_ARG_VAR([FOP], [Path to fop command])
  1881. m4_define([_defopt], m4_default([$2], [auto]))
  1882. AC_ARG_WITH(fop,
  1883. AS_HELP_STRING([--with-fop],
  1884. [Use fop to regenerate documentation (default: ]_defopt[)]),
  1885. [use_fop=$withval], [use_fop=]_defopt)
  1886. m4_undefine([_defopt])
  1887. if test "x$use_fop" = x"auto"; then
  1888. AC_PATH_PROG([FOP], [fop])
  1889. if test "x$FOP" = "x"; then
  1890. AC_MSG_WARN([fop not found - documentation targets will be skipped])
  1891. have_fop=no
  1892. else
  1893. have_fop=yes
  1894. fi
  1895. elif test "x$use_fop" = x"yes" ; then
  1896. AC_PATH_PROG([FOP], [fop])
  1897. if test "x$FOP" = "x"; then
  1898. AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
  1899. fi
  1900. have_fop=yes
  1901. elif test "x$use_fop" = x"no" ; then
  1902. if test "x$FOP" != "x"; then
  1903. AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
  1904. fi
  1905. have_fop=no
  1906. else
  1907. AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
  1908. fi
  1909. # Test for a minimum version of fop, if provided.
  1910. m4_ifval([$1],
  1911. [if test "$have_fop" = yes; then
  1912. # scrape the fop version
  1913. AC_MSG_CHECKING([for fop minimum version])
  1914. fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
  1915. AC_MSG_RESULT([$fop_version])
  1916. AS_VERSION_COMPARE([$fop_version], [$1],
  1917. [if test "x$use_fop" = xauto; then
  1918. AC_MSG_WARN([fop version $fop_version found, but $1 needed])
  1919. have_fop=no
  1920. else
  1921. AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
  1922. fi])
  1923. fi])
  1924. AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
  1925. ]) # XORG_WITH_FOP
  1926. # XORG_WITH_M4([MIN-VERSION])
  1927. # ---------------------------
  1928. # Minimum version: 1.19.0
  1929. #
  1930. # This macro attempts to locate an m4 macro processor which supports
  1931. # -I option and is only useful for modules relying on M4 in order to
  1932. # expand macros in source code files.
  1933. #
  1934. # Interface to module:
  1935. # M4: returns the path of the m4 program found
  1936. # returns the path set by the user in the environment
  1937. #
  1938. AC_DEFUN([XORG_WITH_M4], [
  1939. AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
  1940. [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
  1941. [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
  1942. ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
  1943. [AC_MSG_ERROR([could not find m4 that supports -I option])],
  1944. [$PATH:/usr/gnu/bin])])
  1945. AC_SUBST([M4], [$ac_cv_path_M4])
  1946. ]) # XORG_WITH_M4
  1947. # XORG_WITH_PS2PDF([DEFAULT])
  1948. # ----------------
  1949. # Minimum version: 1.6.0
  1950. # Minimum version for optional DEFAULT argument: 1.11.0
  1951. #
  1952. # Documentation tools are not always available on all platforms and sometimes
  1953. # not at the appropriate level. This macro enables a module to test for the
  1954. # presence of the tool and obtain it's path in separate variables. Coupled with
  1955. # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
  1956. # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
  1957. # --with-ps2pdf assumes 'auto'.
  1958. #
  1959. # Interface to module:
  1960. # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
  1961. # PS2PDF: returns the path of the ps2pdf program found
  1962. # returns the path set by the user in the environment
  1963. # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
  1964. # 'no' user instructs the module not to use ps2pdf
  1965. #
  1966. # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
  1967. #
  1968. AC_DEFUN([XORG_WITH_PS2PDF],[
  1969. AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
  1970. m4_define([_defopt], m4_default([$1], [auto]))
  1971. AC_ARG_WITH(ps2pdf,
  1972. AS_HELP_STRING([--with-ps2pdf],
  1973. [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
  1974. [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
  1975. m4_undefine([_defopt])
  1976. if test "x$use_ps2pdf" = x"auto"; then
  1977. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1978. if test "x$PS2PDF" = "x"; then
  1979. AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
  1980. have_ps2pdf=no
  1981. else
  1982. have_ps2pdf=yes
  1983. fi
  1984. elif test "x$use_ps2pdf" = x"yes" ; then
  1985. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1986. if test "x$PS2PDF" = "x"; then
  1987. AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
  1988. fi
  1989. have_ps2pdf=yes
  1990. elif test "x$use_ps2pdf" = x"no" ; then
  1991. if test "x$PS2PDF" != "x"; then
  1992. AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
  1993. fi
  1994. have_ps2pdf=no
  1995. else
  1996. AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
  1997. fi
  1998. AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
  1999. ]) # XORG_WITH_PS2PDF
  2000. # XORG_ENABLE_DOCS (enable_docs=yes)
  2001. # ----------------
  2002. # Minimum version: 1.6.0
  2003. #
  2004. # Documentation tools are not always available on all platforms and sometimes
  2005. # not at the appropriate level. This macro enables a builder to skip all
  2006. # documentation targets except traditional man pages.
  2007. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2008. # maximum flexibilty in controlling documentation building.
  2009. # Refer to:
  2010. # XORG_WITH_XMLTO --with-xmlto
  2011. # XORG_WITH_ASCIIDOC --with-asciidoc
  2012. # XORG_WITH_DOXYGEN --with-doxygen
  2013. # XORG_WITH_FOP --with-fop
  2014. # XORG_WITH_GROFF --with-groff
  2015. # XORG_WITH_PS2PDF --with-ps2pdf
  2016. #
  2017. # Interface to module:
  2018. # ENABLE_DOCS: used in makefiles to conditionally generate documentation
  2019. # --enable-docs: 'yes' user instructs the module to generate docs
  2020. # 'no' user instructs the module not to generate docs
  2021. # parm1: specify the default value, yes or no.
  2022. #
  2023. AC_DEFUN([XORG_ENABLE_DOCS],[
  2024. m4_define([docs_default], m4_default([$1], [yes]))
  2025. AC_ARG_ENABLE(docs,
  2026. AS_HELP_STRING([--enable-docs],
  2027. [Enable building the documentation (default: ]docs_default[)]),
  2028. [build_docs=$enableval], [build_docs=]docs_default)
  2029. m4_undefine([docs_default])
  2030. AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
  2031. AC_MSG_CHECKING([whether to build documentation])
  2032. AC_MSG_RESULT([$build_docs])
  2033. ]) # XORG_ENABLE_DOCS
  2034. # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
  2035. # ----------------
  2036. # Minimum version: 1.6.0
  2037. #
  2038. # This macro enables a builder to skip all developer documentation.
  2039. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2040. # maximum flexibilty in controlling documentation building.
  2041. # Refer to:
  2042. # XORG_WITH_XMLTO --with-xmlto
  2043. # XORG_WITH_ASCIIDOC --with-asciidoc
  2044. # XORG_WITH_DOXYGEN --with-doxygen
  2045. # XORG_WITH_FOP --with-fop
  2046. # XORG_WITH_GROFF --with-groff
  2047. # XORG_WITH_PS2PDF --with-ps2pdf
  2048. #
  2049. # Interface to module:
  2050. # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
  2051. # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
  2052. # 'no' user instructs the module not to generate developer docs
  2053. # parm1: specify the default value, yes or no.
  2054. #
  2055. AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
  2056. m4_define([devel_default], m4_default([$1], [yes]))
  2057. AC_ARG_ENABLE(devel-docs,
  2058. AS_HELP_STRING([--enable-devel-docs],
  2059. [Enable building the developer documentation (default: ]devel_default[)]),
  2060. [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
  2061. m4_undefine([devel_default])
  2062. AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
  2063. AC_MSG_CHECKING([whether to build developer documentation])
  2064. AC_MSG_RESULT([$build_devel_docs])
  2065. ]) # XORG_ENABLE_DEVEL_DOCS
  2066. # XORG_ENABLE_SPECS (enable_specs=yes)
  2067. # ----------------
  2068. # Minimum version: 1.6.0
  2069. #
  2070. # This macro enables a builder to skip all functional specification targets.
  2071. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2072. # maximum flexibilty in controlling documentation building.
  2073. # Refer to:
  2074. # XORG_WITH_XMLTO --with-xmlto
  2075. # XORG_WITH_ASCIIDOC --with-asciidoc
  2076. # XORG_WITH_DOXYGEN --with-doxygen
  2077. # XORG_WITH_FOP --with-fop
  2078. # XORG_WITH_GROFF --with-groff
  2079. # XORG_WITH_PS2PDF --with-ps2pdf
  2080. #
  2081. # Interface to module:
  2082. # ENABLE_SPECS: used in makefiles to conditionally generate specs
  2083. # --enable-specs: 'yes' user instructs the module to generate specs
  2084. # 'no' user instructs the module not to generate specs
  2085. # parm1: specify the default value, yes or no.
  2086. #
  2087. AC_DEFUN([XORG_ENABLE_SPECS],[
  2088. m4_define([spec_default], m4_default([$1], [yes]))
  2089. AC_ARG_ENABLE(specs,
  2090. AS_HELP_STRING([--enable-specs],
  2091. [Enable building the specs (default: ]spec_default[)]),
  2092. [build_specs=$enableval], [build_specs=]spec_default)
  2093. m4_undefine([spec_default])
  2094. AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
  2095. AC_MSG_CHECKING([whether to build functional specifications])
  2096. AC_MSG_RESULT([$build_specs])
  2097. ]) # XORG_ENABLE_SPECS
  2098. # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
  2099. # ----------------------------------------------
  2100. # Minimum version: 1.13.0
  2101. #
  2102. # This macro enables a builder to enable/disable unit testing
  2103. # It makes no assumption about the test cases implementation
  2104. # Test cases may or may not use Automake "Support for test suites"
  2105. # They may or may not use the software utility library GLib
  2106. #
  2107. # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
  2108. # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
  2109. # The variable enable_unit_tests is used by other macros in this file.
  2110. #
  2111. # Interface to module:
  2112. # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
  2113. # enable_unit_tests: used in configure.ac for additional configuration
  2114. # --enable-unit-tests: 'yes' user instructs the module to build tests
  2115. # 'no' user instructs the module not to build tests
  2116. # parm1: specify the default value, yes or no.
  2117. #
  2118. AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
  2119. AC_BEFORE([$0], [XORG_WITH_GLIB])
  2120. AC_BEFORE([$0], [XORG_LD_WRAP])
  2121. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2122. m4_define([_defopt], m4_default([$1], [auto]))
  2123. AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
  2124. [Enable building unit test cases (default: ]_defopt[)]),
  2125. [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
  2126. m4_undefine([_defopt])
  2127. AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
  2128. AC_MSG_CHECKING([whether to build unit test cases])
  2129. AC_MSG_RESULT([$enable_unit_tests])
  2130. ]) # XORG_ENABLE_UNIT_TESTS
  2131. # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
  2132. # ------------------------------------------------------
  2133. # Minimum version: 1.17.0
  2134. #
  2135. # This macro enables a builder to enable/disable integration testing
  2136. # It makes no assumption about the test cases' implementation
  2137. # Test cases may or may not use Automake "Support for test suites"
  2138. #
  2139. # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
  2140. # usually requires less dependencies and may be built and run under less
  2141. # stringent environments than integration tests.
  2142. #
  2143. # Interface to module:
  2144. # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
  2145. # enable_integration_tests: used in configure.ac for additional configuration
  2146. # --enable-integration-tests: 'yes' user instructs the module to build tests
  2147. # 'no' user instructs the module not to build tests
  2148. # parm1: specify the default value, yes or no.
  2149. #
  2150. AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
  2151. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2152. m4_define([_defopt], m4_default([$1], [auto]))
  2153. AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
  2154. [Enable building integration test cases (default: ]_defopt[)]),
  2155. [enable_integration_tests=$enableval],
  2156. [enable_integration_tests=]_defopt)
  2157. m4_undefine([_defopt])
  2158. AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
  2159. [test "x$enable_integration_tests" != xno])
  2160. AC_MSG_CHECKING([whether to build unit test cases])
  2161. AC_MSG_RESULT([$enable_integration_tests])
  2162. ]) # XORG_ENABLE_INTEGRATION_TESTS
  2163. # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
  2164. # ----------------------------------------
  2165. # Minimum version: 1.13.0
  2166. #
  2167. # GLib is a library which provides advanced data structures and functions.
  2168. # This macro enables a module to test for the presence of Glib.
  2169. #
  2170. # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
  2171. # Otherwise the value of $enable_unit_tests is blank.
  2172. #
  2173. # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
  2174. # test support usually requires less dependencies and may be built and run under
  2175. # less stringent environments than integration tests.
  2176. #
  2177. # Interface to module:
  2178. # HAVE_GLIB: used in makefiles to conditionally build targets
  2179. # with_glib: used in configure.ac to know if GLib has been found
  2180. # --with-glib: 'yes' user instructs the module to use glib
  2181. # 'no' user instructs the module not to use glib
  2182. #
  2183. AC_DEFUN([XORG_WITH_GLIB],[
  2184. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2185. m4_define([_defopt], m4_default([$2], [auto]))
  2186. AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
  2187. [Use GLib library for unit testing (default: ]_defopt[)]),
  2188. [with_glib=$withval], [with_glib=]_defopt)
  2189. m4_undefine([_defopt])
  2190. have_glib=no
  2191. # Do not probe GLib if user explicitly disabled unit testing
  2192. if test "x$enable_unit_tests" != x"no"; then
  2193. # Do not probe GLib if user explicitly disabled it
  2194. if test "x$with_glib" != x"no"; then
  2195. m4_ifval(
  2196. [$1],
  2197. [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
  2198. [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
  2199. )
  2200. fi
  2201. fi
  2202. # Not having GLib when unit testing has been explicitly requested is an error
  2203. if test "x$enable_unit_tests" = x"yes"; then
  2204. if test "x$have_glib" = x"no"; then
  2205. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2206. fi
  2207. fi
  2208. # Having unit testing disabled when GLib has been explicitly requested is an error
  2209. if test "x$enable_unit_tests" = x"no"; then
  2210. if test "x$with_glib" = x"yes"; then
  2211. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2212. fi
  2213. fi
  2214. # Not having GLib when it has been explicitly requested is an error
  2215. if test "x$with_glib" = x"yes"; then
  2216. if test "x$have_glib" = x"no"; then
  2217. AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
  2218. fi
  2219. fi
  2220. AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
  2221. ]) # XORG_WITH_GLIB
  2222. # XORG_LD_WRAP([required|optional])
  2223. # ---------------------------------
  2224. # Minimum version: 1.13.0
  2225. #
  2226. # Check if linker supports -wrap, passed via compiler flags
  2227. #
  2228. # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
  2229. # Otherwise the value of $enable_unit_tests is blank.
  2230. #
  2231. # Argument added in 1.16.0 - default is "required", to match existing behavior
  2232. # of returning an error if enable_unit_tests is yes, and ld -wrap is not
  2233. # available, an argument of "optional" allows use when some unit tests require
  2234. # ld -wrap and others do not.
  2235. #
  2236. AC_DEFUN([XORG_LD_WRAP],[
  2237. XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
  2238. [AC_LANG_PROGRAM([#include <stdlib.h>
  2239. void __wrap_exit(int status) { return; }],
  2240. [exit(0);])])
  2241. # Not having ld wrap when unit testing has been explicitly requested is an error
  2242. if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
  2243. if test "x$have_ld_wrap" = x"no"; then
  2244. AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
  2245. fi
  2246. fi
  2247. AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
  2248. #
  2249. ]) # XORG_LD_WRAP
  2250. # XORG_CHECK_LINKER_FLAGS
  2251. # -----------------------
  2252. # SYNOPSIS
  2253. #
  2254. # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
  2255. #
  2256. # DESCRIPTION
  2257. #
  2258. # Check whether the given linker FLAGS work with the current language's
  2259. # linker, or whether they give an error.
  2260. #
  2261. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  2262. # success/failure.
  2263. #
  2264. # PROGRAM-SOURCE is the program source to link with, if needed
  2265. #
  2266. # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
  2267. #
  2268. # LICENSE
  2269. #
  2270. # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
  2271. # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
  2272. # Copyright (c) 2009 Matteo Frigo
  2273. #
  2274. # This program is free software: you can redistribute it and/or modify it
  2275. # under the terms of the GNU General Public License as published by the
  2276. # Free Software Foundation, either version 3 of the License, or (at your
  2277. # option) any later version.
  2278. #
  2279. # This program is distributed in the hope that it will be useful, but
  2280. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2281. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  2282. # Public License for more details.
  2283. #
  2284. # You should have received a copy of the GNU General Public License along
  2285. # with this program. If not, see <http://www.gnu.org/licenses/>.
  2286. #
  2287. # As a special exception, the respective Autoconf Macro's copyright owner
  2288. # gives unlimited permission to copy, distribute and modify the configure
  2289. # scripts that are the output of Autoconf when processing the Macro. You
  2290. # need not follow the terms of the GNU General Public License when using
  2291. # or distributing such scripts, even though portions of the text of the
  2292. # Macro appear in them. The GNU General Public License (GPL) does govern
  2293. # all other use of the material that constitutes the Autoconf Macro.
  2294. #
  2295. # This special exception to the GPL applies to versions of the Autoconf
  2296. # Macro released by the Autoconf Archive. When you make and distribute a
  2297. # modified version of the Autoconf Macro, you may extend this special
  2298. # exception to the GPL to apply to your modified version as well.#
  2299. AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
  2300. [AC_MSG_CHECKING([whether the linker accepts $1])
  2301. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
  2302. AS_LITERAL_IF([$1],
  2303. [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
  2304. ax_save_FLAGS=$LDFLAGS
  2305. LDFLAGS="$1"
  2306. AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
  2307. AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2308. AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2309. LDFLAGS=$ax_save_FLAGS])],
  2310. [ax_save_FLAGS=$LDFLAGS
  2311. LDFLAGS="$1"
  2312. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  2313. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2314. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2315. LDFLAGS=$ax_save_FLAGS])
  2316. eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
  2317. AC_MSG_RESULT($xorg_check_linker_flags)
  2318. if test "x$xorg_check_linker_flags" = xyes; then
  2319. m4_default([$2], :)
  2320. else
  2321. m4_default([$3], :)
  2322. fi
  2323. ]) # XORG_CHECK_LINKER_FLAGS
  2324. # XORG_MEMORY_CHECK_FLAGS
  2325. # -----------------------
  2326. # Minimum version: 1.16.0
  2327. #
  2328. # This macro attempts to find appropriate memory checking functionality
  2329. # for various platforms which unit testing code may use to catch various
  2330. # forms of memory allocation and access errors in testing.
  2331. #
  2332. # Interface to module:
  2333. # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
  2334. # Usually added to TESTS_ENVIRONMENT in Makefile.am
  2335. #
  2336. # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
  2337. #
  2338. AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
  2339. AC_REQUIRE([AC_CANONICAL_HOST])
  2340. AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
  2341. [Environment variables to enable memory checking in tests])
  2342. # Check for different types of support on different platforms
  2343. case $host_os in
  2344. solaris*)
  2345. AC_CHECK_LIB([umem], [umem_alloc],
  2346. [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
  2347. ;;
  2348. *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
  2349. # both directly and inverted, so should not be 0 or 255.
  2350. malloc_debug_env='MALLOC_PERTURB_=15'
  2351. ;;
  2352. darwin*)
  2353. malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
  2354. ;;
  2355. *bsd*)
  2356. malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
  2357. ;;
  2358. esac
  2359. # User supplied flags override default flags
  2360. if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
  2361. malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
  2362. fi
  2363. AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
  2364. ]) # XORG_WITH_LINT
  2365. # XORG_CHECK_MALLOC_ZERO
  2366. # ----------------------
  2367. # Minimum version: 1.0.0
  2368. #
  2369. # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
  2370. # malloc(0) returns NULL. Packages should add one of these cflags to
  2371. # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
  2372. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
  2373. AC_ARG_ENABLE(malloc0returnsnull,
  2374. AS_HELP_STRING([--enable-malloc0returnsnull],
  2375. [malloc(0) returns NULL (default: auto)]),
  2376. [MALLOC_ZERO_RETURNS_NULL=$enableval],
  2377. [MALLOC_ZERO_RETURNS_NULL=auto])
  2378. AC_MSG_CHECKING([whether malloc(0) returns NULL])
  2379. if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
  2380. AC_CACHE_VAL([xorg_cv_malloc0_returns_null],
  2381. [AC_RUN_IFELSE([AC_LANG_PROGRAM([
  2382. #include <stdlib.h>
  2383. ],[
  2384. char *m0, *r0, *c0, *p;
  2385. m0 = malloc(0);
  2386. p = malloc(10);
  2387. r0 = realloc(p,0);
  2388. c0 = calloc(0,10);
  2389. exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
  2390. ])],
  2391. [xorg_cv_malloc0_returns_null=yes],
  2392. [xorg_cv_malloc0_returns_null=no])])
  2393. MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
  2394. fi
  2395. AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
  2396. if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
  2397. MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
  2398. XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
  2399. XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
  2400. else
  2401. MALLOC_ZERO_CFLAGS=""
  2402. XMALLOC_ZERO_CFLAGS=""
  2403. XTMALLOC_ZERO_CFLAGS=""
  2404. fi
  2405. AC_SUBST([MALLOC_ZERO_CFLAGS])
  2406. AC_SUBST([XMALLOC_ZERO_CFLAGS])
  2407. AC_SUBST([XTMALLOC_ZERO_CFLAGS])
  2408. ]) # XORG_CHECK_MALLOC_ZERO
  2409. # XORG_WITH_LINT()
  2410. # ----------------
  2411. # Minimum version: 1.1.0
  2412. #
  2413. # This macro enables the use of a tool that flags some suspicious and
  2414. # non-portable constructs (likely to be bugs) in C language source code.
  2415. # It will attempt to locate the tool and use appropriate options.
  2416. # There are various lint type tools on different platforms.
  2417. #
  2418. # Interface to module:
  2419. # LINT: returns the path to the tool found on the platform
  2420. # or the value set to LINT on the configure cmd line
  2421. # also an Automake conditional
  2422. # LINT_FLAGS: an Automake variable with appropriate flags
  2423. #
  2424. # --with-lint: 'yes' user instructs the module to use lint
  2425. # 'no' user instructs the module not to use lint (default)
  2426. #
  2427. # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
  2428. # If the user sets the value of LINT_FLAGS, they are used verbatim.
  2429. #
  2430. AC_DEFUN([XORG_WITH_LINT],[
  2431. AC_ARG_VAR([LINT], [Path to a lint-style command])
  2432. AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
  2433. AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
  2434. [Use a lint-style source code checker (default: disabled)])],
  2435. [use_lint=$withval], [use_lint=no])
  2436. # Obtain platform specific info like program name and options
  2437. # The lint program on FreeBSD and NetBSD is different from the one on Solaris
  2438. case $host_os in
  2439. *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
  2440. lint_name=splint
  2441. lint_options="-badflag"
  2442. ;;
  2443. *freebsd* | *netbsd*)
  2444. lint_name=lint
  2445. lint_options="-u -b"
  2446. ;;
  2447. *solaris*)
  2448. lint_name=lint
  2449. lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
  2450. ;;
  2451. esac
  2452. # Test for the presence of the program (either guessed by the code or spelled out by the user)
  2453. if test "x$use_lint" = x"yes" ; then
  2454. AC_PATH_PROG([LINT], [$lint_name])
  2455. if test "x$LINT" = "x"; then
  2456. AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
  2457. fi
  2458. elif test "x$use_lint" = x"no" ; then
  2459. if test "x$LINT" != "x"; then
  2460. AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
  2461. fi
  2462. else
  2463. AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
  2464. fi
  2465. # User supplied flags override default flags
  2466. if test "x$LINT_FLAGS" != "x"; then
  2467. lint_options=$LINT_FLAGS
  2468. fi
  2469. AC_SUBST([LINT_FLAGS],[$lint_options])
  2470. AM_CONDITIONAL(LINT, [test "x$LINT" != x])
  2471. ]) # XORG_WITH_LINT
  2472. # XORG_LINT_LIBRARY(LIBNAME)
  2473. # --------------------------
  2474. # Minimum version: 1.1.0
  2475. #
  2476. # Sets up flags for building lint libraries for checking programs that call
  2477. # functions in the library.
  2478. #
  2479. # Interface to module:
  2480. # LINTLIB - Automake variable with the name of lint library file to make
  2481. # MAKE_LINT_LIB - Automake conditional
  2482. #
  2483. # --enable-lint-library: - 'yes' user instructs the module to created a lint library
  2484. # - 'no' user instructs the module not to create a lint library (default)
  2485. AC_DEFUN([XORG_LINT_LIBRARY],[
  2486. AC_REQUIRE([XORG_WITH_LINT])
  2487. AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
  2488. [Create lint library (default: disabled)])],
  2489. [make_lint_lib=$enableval], [make_lint_lib=no])
  2490. if test "x$make_lint_lib" = x"yes" ; then
  2491. LINTLIB=llib-l$1.ln
  2492. if test "x$LINT" = "x"; then
  2493. AC_MSG_ERROR([Cannot make lint library without --with-lint])
  2494. fi
  2495. elif test "x$make_lint_lib" != x"no" ; then
  2496. AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
  2497. fi
  2498. AC_SUBST(LINTLIB)
  2499. AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
  2500. ]) # XORG_LINT_LIBRARY
  2501. # XORG_COMPILER_BRAND
  2502. # -------------------
  2503. # Minimum version: 1.14.0
  2504. #
  2505. # Checks for various brands of compilers and sets flags as appropriate:
  2506. # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
  2507. # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
  2508. # clang compiler - sets CLANGCC to "yes"
  2509. # Intel compiler - sets INTELCC to "yes"
  2510. # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
  2511. #
  2512. AC_DEFUN([XORG_COMPILER_BRAND], [
  2513. AC_LANG_CASE(
  2514. [C], [
  2515. AC_REQUIRE([AC_PROG_CC_C99])
  2516. ],
  2517. [C++], [
  2518. AC_REQUIRE([AC_PROG_CXX])
  2519. ]
  2520. )
  2521. AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
  2522. AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
  2523. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  2524. ]) # XORG_COMPILER_BRAND
  2525. # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
  2526. # ---------------
  2527. # Minimum version: 1.16.0
  2528. #
  2529. # Test if the compiler works when passed the given flag as a command line argument.
  2530. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
  2531. # next flag in the list until there are no more options.
  2532. #
  2533. # Note that this does not guarantee that the compiler supports the flag as some
  2534. # compilers will simply ignore arguments that they do not understand, but we do
  2535. # attempt to weed out false positives by using -Werror=unknown-warning-option and
  2536. # -Werror=unused-command-line-argument
  2537. #
  2538. AC_DEFUN([XORG_TESTSET_CFLAG], [
  2539. m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2540. m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2541. AC_LANG_COMPILER_REQUIRE
  2542. AC_LANG_CASE(
  2543. [C], [
  2544. AC_REQUIRE([AC_PROG_CC_C99])
  2545. define([PREFIX], [C])
  2546. define([CACHE_PREFIX], [cc])
  2547. define([COMPILER], [$CC])
  2548. ],
  2549. [C++], [
  2550. define([PREFIX], [CXX])
  2551. define([CACHE_PREFIX], [cxx])
  2552. define([COMPILER], [$CXX])
  2553. ]
  2554. )
  2555. [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
  2556. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
  2557. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2558. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
  2559. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
  2560. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2561. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
  2562. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
  2563. [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
  2564. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2565. fi
  2566. if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
  2567. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
  2568. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2569. fi
  2570. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2571. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
  2572. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
  2573. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2574. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
  2575. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
  2576. [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
  2577. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2578. fi
  2579. found="no"
  2580. m4_foreach([flag], m4_cdr($@), [
  2581. if test $found = "no" ; then
  2582. if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
  2583. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2584. fi
  2585. if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
  2586. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2587. fi
  2588. PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
  2589. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
  2590. AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
  2591. cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
  2592. AC_CACHE_VAL($cacheid,
  2593. [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
  2594. [eval $cacheid=yes],
  2595. [eval $cacheid=no])])
  2596. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2597. eval supported=\$$cacheid
  2598. AC_MSG_RESULT([$supported])
  2599. if test "$supported" = "yes" ; then
  2600. $1="$$1 ]flag["
  2601. found="yes"
  2602. fi
  2603. fi
  2604. ])
  2605. ]) # XORG_TESTSET_CFLAG
  2606. # XORG_COMPILER_FLAGS
  2607. # ---------------
  2608. # Minimum version: 1.16.0
  2609. #
  2610. # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
  2611. # arguments supported by the selected compiler which do NOT alter the generated
  2612. # code. These arguments will cause the compiler to print various warnings
  2613. # during compilation AND turn a conservative set of warnings into errors.
  2614. #
  2615. # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
  2616. # future versions of util-macros as options are added to new compilers.
  2617. #
  2618. AC_DEFUN([XORG_COMPILER_FLAGS], [
  2619. AC_REQUIRE([XORG_COMPILER_BRAND])
  2620. AC_ARG_ENABLE(selective-werror,
  2621. AS_HELP_STRING([--disable-selective-werror],
  2622. [Turn off selective compiler errors. (default: enabled)]),
  2623. [SELECTIVE_WERROR=$enableval],
  2624. [SELECTIVE_WERROR=yes])
  2625. AC_LANG_CASE(
  2626. [C], [
  2627. define([PREFIX], [C])
  2628. ],
  2629. [C++], [
  2630. define([PREFIX], [CXX])
  2631. ]
  2632. )
  2633. # -v is too short to test reliably with XORG_TESTSET_CFLAG
  2634. if test "x$SUNCC" = "xyes"; then
  2635. [BASE_]PREFIX[FLAGS]="-v"
  2636. else
  2637. [BASE_]PREFIX[FLAGS]=""
  2638. fi
  2639. # This chunk of warnings were those that existed in the legacy CWARNFLAGS
  2640. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
  2641. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
  2642. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
  2643. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
  2644. AC_LANG_CASE(
  2645. [C], [
  2646. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
  2647. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
  2648. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
  2649. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
  2650. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
  2651. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
  2652. ]
  2653. )
  2654. # This chunk adds additional warnings that could catch undesired effects.
  2655. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
  2656. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
  2657. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
  2658. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
  2659. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
  2660. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
  2661. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
  2662. # These are currently disabled because they are noisy. They will be enabled
  2663. # in the future once the codebase is sufficiently modernized to silence
  2664. # them. For now, I don't want them to drown out the other warnings.
  2665. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
  2666. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
  2667. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
  2668. # Turn some warnings into errors, so we don't accidently get successful builds
  2669. # when there are problems that should be fixed.
  2670. if test "x$SELECTIVE_WERROR" = "xyes" ; then
  2671. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
  2672. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
  2673. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
  2674. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
  2675. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
  2676. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
  2677. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
  2678. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
  2679. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
  2680. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
  2681. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
  2682. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
  2683. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
  2684. else
  2685. AC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors. This should not be necessary. Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
  2686. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
  2687. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
  2688. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
  2689. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
  2690. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
  2691. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
  2692. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
  2693. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
  2694. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
  2695. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
  2696. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
  2697. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
  2698. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
  2699. fi
  2700. AC_SUBST([BASE_]PREFIX[FLAGS])
  2701. ]) # XORG_COMPILER_FLAGS
  2702. # XORG_CWARNFLAGS
  2703. # ---------------
  2704. # Minimum version: 1.2.0
  2705. # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
  2706. #
  2707. # Defines CWARNFLAGS to enable C compiler warnings.
  2708. #
  2709. # This function is deprecated because it defines -fno-strict-aliasing
  2710. # which alters the code generated by the compiler. If -fno-strict-aliasing
  2711. # is needed, then it should be added explicitly in the module when
  2712. # it is updated to use BASE_CFLAGS.
  2713. #
  2714. AC_DEFUN([XORG_CWARNFLAGS], [
  2715. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2716. AC_REQUIRE([XORG_COMPILER_BRAND])
  2717. AC_LANG_CASE(
  2718. [C], [
  2719. CWARNFLAGS="$BASE_CFLAGS"
  2720. if test "x$GCC" = xyes ; then
  2721. CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
  2722. fi
  2723. AC_SUBST(CWARNFLAGS)
  2724. ]
  2725. )
  2726. ]) # XORG_CWARNFLAGS
  2727. # XORG_STRICT_OPTION
  2728. # -----------------------
  2729. # Minimum version: 1.3.0
  2730. #
  2731. # Add configure option to enable strict compilation flags, such as treating
  2732. # warnings as fatal errors.
  2733. # If --enable-strict-compilation is passed to configure, adds strict flags to
  2734. # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
  2735. #
  2736. # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
  2737. # when strict compilation is unconditionally desired.
  2738. AC_DEFUN([XORG_STRICT_OPTION], [
  2739. AC_REQUIRE([XORG_CWARNFLAGS])
  2740. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2741. AC_ARG_ENABLE(strict-compilation,
  2742. AS_HELP_STRING([--enable-strict-compilation],
  2743. [Enable all warnings from compiler and make them errors (default: disabled)]),
  2744. [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
  2745. AC_LANG_CASE(
  2746. [C], [
  2747. define([PREFIX], [C])
  2748. ],
  2749. [C++], [
  2750. define([PREFIX], [CXX])
  2751. ]
  2752. )
  2753. [STRICT_]PREFIX[FLAGS]=""
  2754. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
  2755. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
  2756. # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
  2757. # activate it with -Werror, so we add it here explicitly.
  2758. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
  2759. if test "x$STRICT_COMPILE" = "xyes"; then
  2760. [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
  2761. AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
  2762. fi
  2763. AC_SUBST([STRICT_]PREFIX[FLAGS])
  2764. AC_SUBST([BASE_]PREFIX[FLAGS])
  2765. AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
  2766. ]) # XORG_STRICT_OPTION
  2767. # XORG_DEFAULT_OPTIONS
  2768. # --------------------
  2769. # Minimum version: 1.3.0
  2770. #
  2771. # Defines default options for X.Org modules.
  2772. #
  2773. AC_DEFUN([XORG_DEFAULT_OPTIONS], [
  2774. AC_REQUIRE([AC_PROG_INSTALL])
  2775. XORG_COMPILER_FLAGS
  2776. XORG_CWARNFLAGS
  2777. XORG_STRICT_OPTION
  2778. XORG_RELEASE_VERSION
  2779. XORG_CHANGELOG
  2780. XORG_INSTALL
  2781. XORG_MANPAGE_SECTIONS
  2782. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  2783. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  2784. ]) # XORG_DEFAULT_OPTIONS
  2785. # XORG_INSTALL()
  2786. # ----------------
  2787. # Minimum version: 1.4.0
  2788. #
  2789. # Defines the variable INSTALL_CMD as the command to copy
  2790. # INSTALL from $prefix/share/util-macros.
  2791. #
  2792. AC_DEFUN([XORG_INSTALL], [
  2793. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2794. macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
  2795. INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
  2796. mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
  2797. || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
  2798. echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
  2799. AC_SUBST([INSTALL_CMD])
  2800. ]) # XORG_INSTALL
  2801. dnl Copyright 2005 Red Hat, Inc
  2802. dnl
  2803. dnl Permission to use, copy, modify, distribute, and sell this software and its
  2804. dnl documentation for any purpose is hereby granted without fee, provided that
  2805. dnl the above copyright notice appear in all copies and that both that
  2806. dnl copyright notice and this permission notice appear in supporting
  2807. dnl documentation.
  2808. dnl
  2809. dnl The above copyright notice and this permission notice shall be included
  2810. dnl in all copies or substantial portions of the Software.
  2811. dnl
  2812. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2813. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2814. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2815. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  2816. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  2817. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  2818. dnl OTHER DEALINGS IN THE SOFTWARE.
  2819. dnl
  2820. dnl Except as contained in this notice, the name of the copyright holders shall
  2821. dnl not be used in advertising or otherwise to promote the sale, use or
  2822. dnl other dealings in this Software without prior written authorization
  2823. dnl from the copyright holders.
  2824. dnl
  2825. # XORG_RELEASE_VERSION
  2826. # --------------------
  2827. # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
  2828. AC_DEFUN([XORG_RELEASE_VERSION],[
  2829. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
  2830. [`echo $PACKAGE_VERSION | cut -d . -f 1`],
  2831. [Major version of this package])
  2832. PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
  2833. if test "x$PVM" = "x"; then
  2834. PVM="0"
  2835. fi
  2836. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
  2837. [$PVM],
  2838. [Minor version of this package])
  2839. PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
  2840. if test "x$PVP" = "x"; then
  2841. PVP="0"
  2842. fi
  2843. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
  2844. [$PVP],
  2845. [Patch version of this package])
  2846. ])
  2847. # XORG_CHANGELOG()
  2848. # ----------------
  2849. # Minimum version: 1.2.0
  2850. #
  2851. # Defines the variable CHANGELOG_CMD as the command to generate
  2852. # ChangeLog from git.
  2853. #
  2854. #
  2855. AC_DEFUN([XORG_CHANGELOG], [
  2856. CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
  2857. mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
  2858. || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
  2859. echo 'git directory not found: installing possibly empty changelog.' >&2)"
  2860. AC_SUBST([CHANGELOG_CMD])
  2861. ]) # XORG_CHANGELOG
  2862. dnl Copyright 2005 Red Hat, Inc
  2863. dnl
  2864. dnl Permission to use, copy, modify, distribute, and sell this software and its
  2865. dnl documentation for any purpose is hereby granted without fee, provided that
  2866. dnl the above copyright notice appear in all copies and that both that
  2867. dnl copyright notice and this permission notice appear in supporting
  2868. dnl documentation.
  2869. dnl
  2870. dnl The above copyright notice and this permission notice shall be included
  2871. dnl in all copies or substantial portions of the Software.
  2872. dnl
  2873. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2874. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2875. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2876. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  2877. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  2878. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  2879. dnl OTHER DEALINGS IN THE SOFTWARE.
  2880. dnl
  2881. dnl Except as contained in this notice, the name of the copyright holders shall
  2882. dnl not be used in advertising or otherwise to promote the sale, use or
  2883. dnl other dealings in this Software without prior written authorization
  2884. dnl from the copyright holders.
  2885. dnl
  2886. # XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
  2887. # --------------------------
  2888. # Checks for the MACRO define in xorg-server.h (from the sdk). If it
  2889. # is defined, then add the given PROTO to $REQUIRED_MODULES.
  2890. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
  2891. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2892. SAVE_CFLAGS="$CFLAGS"
  2893. CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
  2894. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  2895. #include "xorg-server.h"
  2896. #if !defined $1
  2897. #error $1 not defined
  2898. #endif
  2899. ]])],
  2900. [_EXT_CHECK=yes],
  2901. [_EXT_CHECK=no])
  2902. CFLAGS="$SAVE_CFLAGS"
  2903. AC_MSG_CHECKING([if $1 is defined])
  2904. AC_MSG_RESULT([$_EXT_CHECK])
  2905. if test "$_EXT_CHECK" != no; then
  2906. REQUIRED_MODULES="$REQUIRED_MODULES $2"
  2907. fi
  2908. ])