aclocal.m4 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095
  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. # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
  728. # From Jim Meyering
  729. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  730. #
  731. # This file is free software; the Free Software Foundation
  732. # gives unlimited permission to copy and/or distribute it,
  733. # with or without modifications, as long as this notice is preserved.
  734. # AM_MAINTAINER_MODE([DEFAULT-MODE])
  735. # ----------------------------------
  736. # Control maintainer-specific portions of Makefiles.
  737. # Default is to disable them, unless 'enable' is passed literally.
  738. # For symmetry, 'disable' may be passed as well. Anyway, the user
  739. # can override the default with the --enable/--disable switch.
  740. AC_DEFUN([AM_MAINTAINER_MODE],
  741. [m4_case(m4_default([$1], [disable]),
  742. [enable], [m4_define([am_maintainer_other], [disable])],
  743. [disable], [m4_define([am_maintainer_other], [enable])],
  744. [m4_define([am_maintainer_other], [enable])
  745. m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
  746. AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  747. dnl maintainer-mode's default is 'disable' unless 'enable' is passed
  748. AC_ARG_ENABLE([maintainer-mode],
  749. [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
  750. am_maintainer_other[ make rules and dependencies not useful
  751. (and sometimes confusing) to the casual installer])],
  752. [USE_MAINTAINER_MODE=$enableval],
  753. [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
  754. AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  755. AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
  756. MAINT=$MAINTAINER_MODE_TRUE
  757. AC_SUBST([MAINT])dnl
  758. ]
  759. )
  760. AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
  761. # Check to see how 'make' treats includes. -*- Autoconf -*-
  762. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  763. #
  764. # This file is free software; the Free Software Foundation
  765. # gives unlimited permission to copy and/or distribute it,
  766. # with or without modifications, as long as this notice is preserved.
  767. # AM_MAKE_INCLUDE()
  768. # -----------------
  769. # Check to see how make treats includes.
  770. AC_DEFUN([AM_MAKE_INCLUDE],
  771. [am_make=${MAKE-make}
  772. cat > confinc << 'END'
  773. am__doit:
  774. @echo this is the am__doit target
  775. .PHONY: am__doit
  776. END
  777. # If we don't find an include directive, just comment out the code.
  778. AC_MSG_CHECKING([for style of include used by $am_make])
  779. am__include="#"
  780. am__quote=
  781. _am_result=none
  782. # First try GNU make style include.
  783. echo "include confinc" > confmf
  784. # Ignore all kinds of additional output from 'make'.
  785. case `$am_make -s -f confmf 2> /dev/null` in #(
  786. *the\ am__doit\ target*)
  787. am__include=include
  788. am__quote=
  789. _am_result=GNU
  790. ;;
  791. esac
  792. # Now try BSD make style include.
  793. if test "$am__include" = "#"; then
  794. echo '.include "confinc"' > confmf
  795. case `$am_make -s -f confmf 2> /dev/null` in #(
  796. *the\ am__doit\ target*)
  797. am__include=.include
  798. am__quote="\""
  799. _am_result=BSD
  800. ;;
  801. esac
  802. fi
  803. AC_SUBST([am__include])
  804. AC_SUBST([am__quote])
  805. AC_MSG_RESULT([$_am_result])
  806. rm -f confinc confmf
  807. ])
  808. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  809. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  810. #
  811. # This file is free software; the Free Software Foundation
  812. # gives unlimited permission to copy and/or distribute it,
  813. # with or without modifications, as long as this notice is preserved.
  814. # AM_MISSING_PROG(NAME, PROGRAM)
  815. # ------------------------------
  816. AC_DEFUN([AM_MISSING_PROG],
  817. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  818. $1=${$1-"${am_missing_run}$2"}
  819. AC_SUBST($1)])
  820. # AM_MISSING_HAS_RUN
  821. # ------------------
  822. # Define MISSING if not defined so far and test if it supports --run.
  823. # If it does, set am_missing_run to use it, otherwise, to nothing.
  824. AC_DEFUN([AM_MISSING_HAS_RUN],
  825. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  826. AC_REQUIRE_AUX_FILE([missing])dnl
  827. if test x"${MISSING+set}" != xset; then
  828. case $am_aux_dir in
  829. *\ * | *\ *)
  830. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  831. *)
  832. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  833. esac
  834. fi
  835. # Use eval to expand $SHELL
  836. if eval "$MISSING --run true"; then
  837. am_missing_run="$MISSING --run "
  838. else
  839. am_missing_run=
  840. AC_MSG_WARN(['missing' script is too old or missing])
  841. fi
  842. ])
  843. # Helper functions for option handling. -*- Autoconf -*-
  844. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  845. #
  846. # This file is free software; the Free Software Foundation
  847. # gives unlimited permission to copy and/or distribute it,
  848. # with or without modifications, as long as this notice is preserved.
  849. # _AM_MANGLE_OPTION(NAME)
  850. # -----------------------
  851. AC_DEFUN([_AM_MANGLE_OPTION],
  852. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  853. # _AM_SET_OPTION(NAME)
  854. # --------------------
  855. # Set option NAME. Presently that only means defining a flag for this option.
  856. AC_DEFUN([_AM_SET_OPTION],
  857. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  858. # _AM_SET_OPTIONS(OPTIONS)
  859. # ------------------------
  860. # OPTIONS is a space-separated list of Automake options.
  861. AC_DEFUN([_AM_SET_OPTIONS],
  862. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  863. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  864. # -------------------------------------------
  865. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  866. AC_DEFUN([_AM_IF_OPTION],
  867. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  868. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  869. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  870. #
  871. # This file is free software; the Free Software Foundation
  872. # gives unlimited permission to copy and/or distribute it,
  873. # with or without modifications, as long as this notice is preserved.
  874. # AM_SANITY_CHECK
  875. # ---------------
  876. AC_DEFUN([AM_SANITY_CHECK],
  877. [AC_MSG_CHECKING([whether build environment is sane])
  878. # Reject unsafe characters in $srcdir or the absolute working directory
  879. # name. Accept space and tab only in the latter.
  880. am_lf='
  881. '
  882. case `pwd` in
  883. *[[\\\"\#\$\&\'\`$am_lf]]*)
  884. AC_MSG_ERROR([unsafe absolute working directory name]);;
  885. esac
  886. case $srcdir in
  887. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  888. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  889. esac
  890. # Do 'set' in a subshell so we don't clobber the current shell's
  891. # arguments. Must try -L first in case configure is actually a
  892. # symlink; some systems play weird games with the mod time of symlinks
  893. # (eg FreeBSD returns the mod time of the symlink's containing
  894. # directory).
  895. if (
  896. am_has_slept=no
  897. for am_try in 1 2; do
  898. echo "timestamp, slept: $am_has_slept" > conftest.file
  899. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  900. if test "$[*]" = "X"; then
  901. # -L didn't work.
  902. set X `ls -t "$srcdir/configure" conftest.file`
  903. fi
  904. if test "$[*]" != "X $srcdir/configure conftest.file" \
  905. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  906. # If neither matched, then we have a broken ls. This can happen
  907. # if, for instance, CONFIG_SHELL is bash and it inherits a
  908. # broken ls alias from the environment. This has actually
  909. # happened. Such a system could not be considered "sane".
  910. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  911. alias in your environment])
  912. fi
  913. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  914. break
  915. fi
  916. # Just in case.
  917. sleep 1
  918. am_has_slept=yes
  919. done
  920. test "$[2]" = conftest.file
  921. )
  922. then
  923. # Ok.
  924. :
  925. else
  926. AC_MSG_ERROR([newly created file is older than distributed files!
  927. Check your system clock])
  928. fi
  929. AC_MSG_RESULT([yes])
  930. # If we didn't sleep, we still need to ensure time stamps of config.status and
  931. # generated files are strictly newer.
  932. am_sleep_pid=
  933. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  934. ( sleep 1 ) &
  935. am_sleep_pid=$!
  936. fi
  937. AC_CONFIG_COMMANDS_PRE(
  938. [AC_MSG_CHECKING([that generated files are newer than configure])
  939. if test -n "$am_sleep_pid"; then
  940. # Hide warnings about reused PIDs.
  941. wait $am_sleep_pid 2>/dev/null
  942. fi
  943. AC_MSG_RESULT([done])])
  944. rm -f conftest.file
  945. ])
  946. # Copyright (C) 2009-2012 Free Software Foundation, Inc.
  947. #
  948. # This file is free software; the Free Software Foundation
  949. # gives unlimited permission to copy and/or distribute it,
  950. # with or without modifications, as long as this notice is preserved.
  951. # AM_SILENT_RULES([DEFAULT])
  952. # --------------------------
  953. # Enable less verbose build rules; with the default set to DEFAULT
  954. # ("yes" being less verbose, "no" or empty being verbose).
  955. AC_DEFUN([AM_SILENT_RULES],
  956. [AC_ARG_ENABLE([silent-rules], [dnl
  957. AS_HELP_STRING(
  958. [--enable-silent-rules],
  959. [less verbose build output (undo: "make V=1")])
  960. AS_HELP_STRING(
  961. [--disable-silent-rules],
  962. [verbose build output (undo: "make V=0")])dnl
  963. ])
  964. case $enable_silent_rules in @%:@ (((
  965. yes) AM_DEFAULT_VERBOSITY=0;;
  966. no) AM_DEFAULT_VERBOSITY=1;;
  967. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  968. esac
  969. dnl
  970. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  971. dnl do not support nested variable expansions.
  972. dnl See automake bug#9928 and bug#10237.
  973. am_make=${MAKE-make}
  974. AC_CACHE_CHECK([whether $am_make supports nested variables],
  975. [am_cv_make_support_nested_variables],
  976. [if AS_ECHO([['TRUE=$(BAR$(V))
  977. BAR0=false
  978. BAR1=true
  979. V=1
  980. am__doit:
  981. @$(TRUE)
  982. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  983. am_cv_make_support_nested_variables=yes
  984. else
  985. am_cv_make_support_nested_variables=no
  986. fi])
  987. if test $am_cv_make_support_nested_variables = yes; then
  988. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  989. AM_V='$(V)'
  990. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  991. else
  992. AM_V=$AM_DEFAULT_VERBOSITY
  993. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  994. fi
  995. AC_SUBST([AM_V])dnl
  996. AM_SUBST_NOTMAKE([AM_V])dnl
  997. AC_SUBST([AM_DEFAULT_V])dnl
  998. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  999. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  1000. AM_BACKSLASH='\'
  1001. AC_SUBST([AM_BACKSLASH])dnl
  1002. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  1003. ])
  1004. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  1005. #
  1006. # This file is free software; the Free Software Foundation
  1007. # gives unlimited permission to copy and/or distribute it,
  1008. # with or without modifications, as long as this notice is preserved.
  1009. # AM_PROG_INSTALL_STRIP
  1010. # ---------------------
  1011. # One issue with vendor 'install' (even GNU) is that you can't
  1012. # specify the program used to strip binaries. This is especially
  1013. # annoying in cross-compiling environments, where the build's strip
  1014. # is unlikely to handle the host's binaries.
  1015. # Fortunately install-sh will honor a STRIPPROG variable, so we
  1016. # always use install-sh in "make install-strip", and initialize
  1017. # STRIPPROG with the value of the STRIP variable (set by the user).
  1018. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  1019. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  1020. # Installed binaries are usually stripped using 'strip' when the user
  1021. # run "make install-strip". However 'strip' might not be the right
  1022. # tool to use in cross-compilation environments, therefore Automake
  1023. # will honor the 'STRIP' environment variable to overrule this program.
  1024. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  1025. if test "$cross_compiling" != no; then
  1026. AC_CHECK_TOOL([STRIP], [strip], :)
  1027. fi
  1028. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  1029. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  1030. # Copyright (C) 2006-2012 Free Software Foundation, Inc.
  1031. #
  1032. # This file is free software; the Free Software Foundation
  1033. # gives unlimited permission to copy and/or distribute it,
  1034. # with or without modifications, as long as this notice is preserved.
  1035. # _AM_SUBST_NOTMAKE(VARIABLE)
  1036. # ---------------------------
  1037. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  1038. # This macro is traced by Automake.
  1039. AC_DEFUN([_AM_SUBST_NOTMAKE])
  1040. # AM_SUBST_NOTMAKE(VARIABLE)
  1041. # --------------------------
  1042. # Public sister of _AM_SUBST_NOTMAKE.
  1043. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  1044. # Check how to create a tarball. -*- Autoconf -*-
  1045. # Copyright (C) 2004-2012 Free Software Foundation, Inc.
  1046. #
  1047. # This file is free software; the Free Software Foundation
  1048. # gives unlimited permission to copy and/or distribute it,
  1049. # with or without modifications, as long as this notice is preserved.
  1050. # _AM_PROG_TAR(FORMAT)
  1051. # --------------------
  1052. # Check how to create a tarball in format FORMAT.
  1053. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  1054. #
  1055. # Substitute a variable $(am__tar) that is a command
  1056. # writing to stdout a FORMAT-tarball containing the directory
  1057. # $tardir.
  1058. # tardir=directory && $(am__tar) > result.tar
  1059. #
  1060. # Substitute a variable $(am__untar) that extract such
  1061. # a tarball read from stdin.
  1062. # $(am__untar) < result.tar
  1063. AC_DEFUN([_AM_PROG_TAR],
  1064. [# Always define AMTAR for backward compatibility. Yes, it's still used
  1065. # in the wild :-( We should find a proper way to deprecate it ...
  1066. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  1067. m4_if([$1], [v7],
  1068. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  1069. [m4_case([$1], [ustar],, [pax],,
  1070. [m4_fatal([Unknown tar format])])
  1071. AC_MSG_CHECKING([how to create a $1 tar archive])
  1072. # Loop over all known methods to create a tar archive until one works.
  1073. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  1074. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  1075. # Do not fold the above two line into one, because Tru64 sh and
  1076. # Solaris sh will not grok spaces in the rhs of '-'.
  1077. for _am_tool in $_am_tools
  1078. do
  1079. case $_am_tool in
  1080. gnutar)
  1081. for _am_tar in tar gnutar gtar;
  1082. do
  1083. AM_RUN_LOG([$_am_tar --version]) && break
  1084. done
  1085. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  1086. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  1087. am__untar="$_am_tar -xf -"
  1088. ;;
  1089. plaintar)
  1090. # Must skip GNU tar: if it does not support --format= it doesn't create
  1091. # ustar tarball either.
  1092. (tar --version) >/dev/null 2>&1 && continue
  1093. am__tar='tar chf - "$$tardir"'
  1094. am__tar_='tar chf - "$tardir"'
  1095. am__untar='tar xf -'
  1096. ;;
  1097. pax)
  1098. am__tar='pax -L -x $1 -w "$$tardir"'
  1099. am__tar_='pax -L -x $1 -w "$tardir"'
  1100. am__untar='pax -r'
  1101. ;;
  1102. cpio)
  1103. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  1104. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  1105. am__untar='cpio -i -H $1 -d'
  1106. ;;
  1107. none)
  1108. am__tar=false
  1109. am__tar_=false
  1110. am__untar=false
  1111. ;;
  1112. esac
  1113. # If the value was cached, stop now. We just wanted to have am__tar
  1114. # and am__untar set.
  1115. test -n "${am_cv_prog_tar_$1}" && break
  1116. # tar/untar a dummy directory, and stop if the command works
  1117. rm -rf conftest.dir
  1118. mkdir conftest.dir
  1119. echo GrepMe > conftest.dir/file
  1120. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  1121. rm -rf conftest.dir
  1122. if test -s conftest.tar; then
  1123. AM_RUN_LOG([$am__untar <conftest.tar])
  1124. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  1125. fi
  1126. done
  1127. rm -rf conftest.dir
  1128. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  1129. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  1130. AC_SUBST([am__tar])
  1131. AC_SUBST([am__untar])
  1132. ]) # _AM_PROG_TAR
  1133. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
  1134. dnl
  1135. dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
  1136. dnl
  1137. dnl Permission is hereby granted, free of charge, to any person obtaining a
  1138. dnl copy of this software and associated documentation files (the "Software"),
  1139. dnl to deal in the Software without restriction, including without limitation
  1140. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  1141. dnl and/or sell copies of the Software, and to permit persons to whom the
  1142. dnl Software is furnished to do so, subject to the following conditions:
  1143. dnl
  1144. dnl The above copyright notice and this permission notice (including the next
  1145. dnl paragraph) shall be included in all copies or substantial portions of the
  1146. dnl Software.
  1147. dnl
  1148. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  1149. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  1150. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  1151. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  1152. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  1153. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  1154. dnl DEALINGS IN THE SOFTWARE.
  1155. # XORG_MACROS_VERSION(required-version)
  1156. # -------------------------------------
  1157. # Minimum version: 1.1.0
  1158. #
  1159. # If you're using a macro added in Version 1.1 or newer, include this in
  1160. # your configure.ac with the minimum required version, such as:
  1161. # XORG_MACROS_VERSION(1.1)
  1162. #
  1163. # To ensure that this macro is defined, also add:
  1164. # m4_ifndef([XORG_MACROS_VERSION],
  1165. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
  1166. #
  1167. #
  1168. # See the "minimum version" comment for each macro you use to see what
  1169. # version you require.
  1170. m4_defun([XORG_MACROS_VERSION],[
  1171. m4_define([vers_have], [1.17.1])
  1172. m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
  1173. m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
  1174. m4_if(m4_cmp(maj_have, maj_needed), 0,,
  1175. [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
  1176. m4_if(m4_version_compare(vers_have, [$1]), -1,
  1177. [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
  1178. m4_undefine([vers_have])
  1179. m4_undefine([maj_have])
  1180. m4_undefine([maj_needed])
  1181. ]) # XORG_MACROS_VERSION
  1182. # XORG_PROG_RAWCPP()
  1183. # ------------------
  1184. # Minimum version: 1.0.0
  1185. #
  1186. # Find cpp program and necessary flags for use in pre-processing text files
  1187. # such as man pages and config files
  1188. AC_DEFUN([XORG_PROG_RAWCPP],[
  1189. AC_REQUIRE([AC_PROG_CPP])
  1190. AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
  1191. [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
  1192. # Check for flag to avoid builtin definitions - assumes unix is predefined,
  1193. # which is not the best choice for supporting other OS'es, but covers most
  1194. # of the ones we need for now.
  1195. AC_MSG_CHECKING([if $RAWCPP requires -undef])
  1196. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
  1197. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1198. AC_MSG_RESULT([no])
  1199. else
  1200. if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1201. RAWCPPFLAGS=-undef
  1202. AC_MSG_RESULT([yes])
  1203. # under Cygwin unix is still defined even with -undef
  1204. elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  1205. RAWCPPFLAGS="-undef -ansi"
  1206. AC_MSG_RESULT([yes, with -ansi])
  1207. else
  1208. AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
  1209. fi
  1210. fi
  1211. rm -f conftest.$ac_ext
  1212. AC_MSG_CHECKING([if $RAWCPP requires -traditional])
  1213. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
  1214. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1215. AC_MSG_RESULT([no])
  1216. else
  1217. if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  1218. RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
  1219. AC_MSG_RESULT([yes])
  1220. else
  1221. AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
  1222. fi
  1223. fi
  1224. rm -f conftest.$ac_ext
  1225. AC_SUBST(RAWCPPFLAGS)
  1226. ]) # XORG_PROG_RAWCPP
  1227. # XORG_MANPAGE_SECTIONS()
  1228. # -----------------------
  1229. # Minimum version: 1.0.0
  1230. #
  1231. # Determine which sections man pages go in for the different man page types
  1232. # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
  1233. # Not sure if there's any better way than just hardcoding by OS name.
  1234. # Override default settings by setting environment variables
  1235. # Added MAN_SUBSTS in version 1.8
  1236. # Added AC_PROG_SED in version 1.8
  1237. AC_DEFUN([XORG_MANPAGE_SECTIONS],[
  1238. AC_REQUIRE([AC_CANONICAL_HOST])
  1239. AC_REQUIRE([AC_PROG_SED])
  1240. if test x$APP_MAN_SUFFIX = x ; then
  1241. APP_MAN_SUFFIX=1
  1242. fi
  1243. if test x$APP_MAN_DIR = x ; then
  1244. APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
  1245. fi
  1246. if test x$LIB_MAN_SUFFIX = x ; then
  1247. LIB_MAN_SUFFIX=3
  1248. fi
  1249. if test x$LIB_MAN_DIR = x ; then
  1250. LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
  1251. fi
  1252. if test x$FILE_MAN_SUFFIX = x ; then
  1253. case $host_os in
  1254. solaris*) FILE_MAN_SUFFIX=4 ;;
  1255. *) FILE_MAN_SUFFIX=5 ;;
  1256. esac
  1257. fi
  1258. if test x$FILE_MAN_DIR = x ; then
  1259. FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
  1260. fi
  1261. if test x$MISC_MAN_SUFFIX = x ; then
  1262. case $host_os in
  1263. solaris*) MISC_MAN_SUFFIX=5 ;;
  1264. *) MISC_MAN_SUFFIX=7 ;;
  1265. esac
  1266. fi
  1267. if test x$MISC_MAN_DIR = x ; then
  1268. MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
  1269. fi
  1270. if test x$DRIVER_MAN_SUFFIX = x ; then
  1271. case $host_os in
  1272. solaris*) DRIVER_MAN_SUFFIX=7 ;;
  1273. *) DRIVER_MAN_SUFFIX=4 ;;
  1274. esac
  1275. fi
  1276. if test x$DRIVER_MAN_DIR = x ; then
  1277. DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
  1278. fi
  1279. if test x$ADMIN_MAN_SUFFIX = x ; then
  1280. case $host_os in
  1281. solaris*) ADMIN_MAN_SUFFIX=1m ;;
  1282. *) ADMIN_MAN_SUFFIX=8 ;;
  1283. esac
  1284. fi
  1285. if test x$ADMIN_MAN_DIR = x ; then
  1286. ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
  1287. fi
  1288. AC_SUBST([APP_MAN_SUFFIX])
  1289. AC_SUBST([LIB_MAN_SUFFIX])
  1290. AC_SUBST([FILE_MAN_SUFFIX])
  1291. AC_SUBST([MISC_MAN_SUFFIX])
  1292. AC_SUBST([DRIVER_MAN_SUFFIX])
  1293. AC_SUBST([ADMIN_MAN_SUFFIX])
  1294. AC_SUBST([APP_MAN_DIR])
  1295. AC_SUBST([LIB_MAN_DIR])
  1296. AC_SUBST([FILE_MAN_DIR])
  1297. AC_SUBST([MISC_MAN_DIR])
  1298. AC_SUBST([DRIVER_MAN_DIR])
  1299. AC_SUBST([ADMIN_MAN_DIR])
  1300. XORG_MAN_PAGE="X Version 11"
  1301. AC_SUBST([XORG_MAN_PAGE])
  1302. MAN_SUBSTS="\
  1303. -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1304. -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  1305. -e 's|__xservername__|Xorg|g' \
  1306. -e 's|__xconfigfile__|xorg.conf|g' \
  1307. -e 's|__projectroot__|\$(prefix)|g' \
  1308. -e 's|__apploaddir__|\$(appdefaultdir)|g' \
  1309. -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
  1310. -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
  1311. -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
  1312. -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
  1313. -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
  1314. -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
  1315. AC_SUBST([MAN_SUBSTS])
  1316. ]) # XORG_MANPAGE_SECTIONS
  1317. # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
  1318. # ------------------------
  1319. # Minimum version: 1.7.0
  1320. #
  1321. # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
  1322. # provided by xorg-sgml-doctools, if installed.
  1323. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
  1324. AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
  1325. XORG_SGML_PATH=
  1326. PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
  1327. [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
  1328. [m4_ifval([$1],[:],
  1329. [if test x"$cross_compiling" != x"yes" ; then
  1330. AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
  1331. [XORG_SGML_PATH=$prefix/share/sgml])
  1332. fi])
  1333. ])
  1334. # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
  1335. # the path and the name of the doc stylesheet
  1336. if test "x$XORG_SGML_PATH" != "x" ; then
  1337. AC_MSG_RESULT([$XORG_SGML_PATH])
  1338. STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
  1339. XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
  1340. else
  1341. AC_MSG_RESULT([no])
  1342. fi
  1343. AC_SUBST(XORG_SGML_PATH)
  1344. AC_SUBST(STYLESHEET_SRCDIR)
  1345. AC_SUBST(XSL_STYLESHEET)
  1346. AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
  1347. ]) # XORG_CHECK_SGML_DOCTOOLS
  1348. # XORG_CHECK_LINUXDOC
  1349. # -------------------
  1350. # Minimum version: 1.0.0
  1351. #
  1352. # Defines the variable MAKE_TEXT if the necessary tools and
  1353. # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
  1354. # Whether or not the necessary tools and files are found can be checked
  1355. # with the AM_CONDITIONAL "BUILD_LINUXDOC"
  1356. AC_DEFUN([XORG_CHECK_LINUXDOC],[
  1357. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1358. AC_REQUIRE([XORG_WITH_PS2PDF])
  1359. AC_PATH_PROG(LINUXDOC, linuxdoc)
  1360. AC_MSG_CHECKING([whether to build documentation])
  1361. if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
  1362. BUILDDOC=yes
  1363. else
  1364. BUILDDOC=no
  1365. fi
  1366. AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
  1367. AC_MSG_RESULT([$BUILDDOC])
  1368. AC_MSG_CHECKING([whether to build pdf documentation])
  1369. if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
  1370. BUILDPDFDOC=yes
  1371. else
  1372. BUILDPDFDOC=no
  1373. fi
  1374. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1375. AC_MSG_RESULT([$BUILDPDFDOC])
  1376. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
  1377. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
  1378. MAKE_PDF="$PS2PDF"
  1379. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
  1380. AC_SUBST(MAKE_TEXT)
  1381. AC_SUBST(MAKE_PS)
  1382. AC_SUBST(MAKE_PDF)
  1383. AC_SUBST(MAKE_HTML)
  1384. ]) # XORG_CHECK_LINUXDOC
  1385. # XORG_CHECK_DOCBOOK
  1386. # -------------------
  1387. # Minimum version: 1.0.0
  1388. #
  1389. # Checks for the ability to build output formats from SGML DocBook source.
  1390. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
  1391. # indicates whether the necessary tools and files are found and, if set,
  1392. # $(MAKE_XXX) blah.sgml will produce blah.xxx.
  1393. AC_DEFUN([XORG_CHECK_DOCBOOK],[
  1394. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  1395. BUILDTXTDOC=no
  1396. BUILDPDFDOC=no
  1397. BUILDPSDOC=no
  1398. BUILDHTMLDOC=no
  1399. AC_PATH_PROG(DOCBOOKPS, docbook2ps)
  1400. AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
  1401. AC_PATH_PROG(DOCBOOKHTML, docbook2html)
  1402. AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
  1403. AC_MSG_CHECKING([whether to build text documentation])
  1404. if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
  1405. test x$BUILD_TXTDOC != xno; then
  1406. BUILDTXTDOC=yes
  1407. fi
  1408. AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
  1409. AC_MSG_RESULT([$BUILDTXTDOC])
  1410. AC_MSG_CHECKING([whether to build PDF documentation])
  1411. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
  1412. test x$BUILD_PDFDOC != xno; then
  1413. BUILDPDFDOC=yes
  1414. fi
  1415. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  1416. AC_MSG_RESULT([$BUILDPDFDOC])
  1417. AC_MSG_CHECKING([whether to build PostScript documentation])
  1418. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
  1419. test x$BUILD_PSDOC != xno; then
  1420. BUILDPSDOC=yes
  1421. fi
  1422. AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
  1423. AC_MSG_RESULT([$BUILDPSDOC])
  1424. AC_MSG_CHECKING([whether to build HTML documentation])
  1425. if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
  1426. test x$BUILD_HTMLDOC != xno; then
  1427. BUILDHTMLDOC=yes
  1428. fi
  1429. AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
  1430. AC_MSG_RESULT([$BUILDHTMLDOC])
  1431. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
  1432. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
  1433. MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
  1434. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
  1435. AC_SUBST(MAKE_TEXT)
  1436. AC_SUBST(MAKE_PS)
  1437. AC_SUBST(MAKE_PDF)
  1438. AC_SUBST(MAKE_HTML)
  1439. ]) # XORG_CHECK_DOCBOOK
  1440. # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
  1441. # ----------------
  1442. # Minimum version: 1.5.0
  1443. # Minimum version for optional DEFAULT argument: 1.11.0
  1444. #
  1445. # Documentation tools are not always available on all platforms and sometimes
  1446. # not at the appropriate level. This macro enables a module to test for the
  1447. # presence of the tool and obtain it's path in separate variables. Coupled with
  1448. # the --with-xmlto option, it allows maximum flexibilty in making decisions
  1449. # as whether or not to use the xmlto package. When DEFAULT is not specified,
  1450. # --with-xmlto assumes 'auto'.
  1451. #
  1452. # Interface to module:
  1453. # HAVE_XMLTO: used in makefiles to conditionally generate documentation
  1454. # XMLTO: returns the path of the xmlto program found
  1455. # returns the path set by the user in the environment
  1456. # --with-xmlto: 'yes' user instructs the module to use xmlto
  1457. # 'no' user instructs the module not to use xmlto
  1458. #
  1459. # Added in version 1.10.0
  1460. # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
  1461. # xmlto for text output requires either lynx, links, or w3m browsers
  1462. #
  1463. # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
  1464. #
  1465. AC_DEFUN([XORG_WITH_XMLTO],[
  1466. AC_ARG_VAR([XMLTO], [Path to xmlto command])
  1467. m4_define([_defopt], m4_default([$2], [auto]))
  1468. AC_ARG_WITH(xmlto,
  1469. AS_HELP_STRING([--with-xmlto],
  1470. [Use xmlto to regenerate documentation (default: ]_defopt[)]),
  1471. [use_xmlto=$withval], [use_xmlto=]_defopt)
  1472. m4_undefine([_defopt])
  1473. if test "x$use_xmlto" = x"auto"; then
  1474. AC_PATH_PROG([XMLTO], [xmlto])
  1475. if test "x$XMLTO" = "x"; then
  1476. AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
  1477. have_xmlto=no
  1478. else
  1479. have_xmlto=yes
  1480. fi
  1481. elif test "x$use_xmlto" = x"yes" ; then
  1482. AC_PATH_PROG([XMLTO], [xmlto])
  1483. if test "x$XMLTO" = "x"; then
  1484. AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
  1485. fi
  1486. have_xmlto=yes
  1487. elif test "x$use_xmlto" = x"no" ; then
  1488. if test "x$XMLTO" != "x"; then
  1489. AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
  1490. fi
  1491. have_xmlto=no
  1492. else
  1493. AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
  1494. fi
  1495. # Test for a minimum version of xmlto, if provided.
  1496. m4_ifval([$1],
  1497. [if test "$have_xmlto" = yes; then
  1498. # scrape the xmlto version
  1499. AC_MSG_CHECKING([the xmlto version])
  1500. xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
  1501. AC_MSG_RESULT([$xmlto_version])
  1502. AS_VERSION_COMPARE([$xmlto_version], [$1],
  1503. [if test "x$use_xmlto" = xauto; then
  1504. AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
  1505. have_xmlto=no
  1506. else
  1507. AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
  1508. fi])
  1509. fi])
  1510. # Test for the ability of xmlto to generate a text target
  1511. have_xmlto_text=no
  1512. cat > conftest.xml << "EOF"
  1513. EOF
  1514. AS_IF([test "$have_xmlto" = yes],
  1515. [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
  1516. [have_xmlto_text=yes],
  1517. [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
  1518. rm -f conftest.xml
  1519. AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
  1520. AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
  1521. ]) # XORG_WITH_XMLTO
  1522. # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
  1523. # --------------------------------------------
  1524. # Minimum version: 1.12.0
  1525. # Minimum version for optional DEFAULT argument: 1.12.0
  1526. #
  1527. # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
  1528. # XML-based language used for the transformation of XML documents.
  1529. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
  1530. # It is used under the cover by xmlto to generate html files from DocBook/XML.
  1531. # The XSLT processor is often used as a standalone tool for transformations.
  1532. # It should not be assumed that this tool is used only to work with documnetation.
  1533. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
  1534. #
  1535. # Interface to module:
  1536. # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
  1537. # XSLTPROC: returns the path of the xsltproc program found
  1538. # returns the path set by the user in the environment
  1539. # --with-xsltproc: 'yes' user instructs the module to use xsltproc
  1540. # 'no' user instructs the module not to use xsltproc
  1541. # have_xsltproc: returns yes if xsltproc found in PATH or no
  1542. #
  1543. # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
  1544. #
  1545. AC_DEFUN([XORG_WITH_XSLTPROC],[
  1546. AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
  1547. # Preserves the interface, should it be implemented later
  1548. m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
  1549. m4_define([_defopt], m4_default([$2], [auto]))
  1550. AC_ARG_WITH(xsltproc,
  1551. AS_HELP_STRING([--with-xsltproc],
  1552. [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
  1553. [use_xsltproc=$withval], [use_xsltproc=]_defopt)
  1554. m4_undefine([_defopt])
  1555. if test "x$use_xsltproc" = x"auto"; then
  1556. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1557. if test "x$XSLTPROC" = "x"; then
  1558. AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
  1559. have_xsltproc=no
  1560. else
  1561. have_xsltproc=yes
  1562. fi
  1563. elif test "x$use_xsltproc" = x"yes" ; then
  1564. AC_PATH_PROG([XSLTPROC], [xsltproc])
  1565. if test "x$XSLTPROC" = "x"; then
  1566. AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
  1567. fi
  1568. have_xsltproc=yes
  1569. elif test "x$use_xsltproc" = x"no" ; then
  1570. if test "x$XSLTPROC" != "x"; then
  1571. AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
  1572. fi
  1573. have_xsltproc=no
  1574. else
  1575. AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
  1576. fi
  1577. AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
  1578. ]) # XORG_WITH_XSLTPROC
  1579. # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
  1580. # ----------------------------------------
  1581. # Minimum version: 1.15.0
  1582. #
  1583. # PERL (Practical Extraction and Report Language) is a language optimized for
  1584. # scanning arbitrary text files, extracting information from those text files,
  1585. # and printing reports based on that information.
  1586. #
  1587. # When DEFAULT is not specified, --with-perl assumes 'auto'.
  1588. #
  1589. # Interface to module:
  1590. # HAVE_PERL: used in makefiles to conditionally scan text files
  1591. # PERL: returns the path of the perl program found
  1592. # returns the path set by the user in the environment
  1593. # --with-perl: 'yes' user instructs the module to use perl
  1594. # 'no' user instructs the module not to use perl
  1595. # have_perl: returns yes if perl found in PATH or no
  1596. #
  1597. # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
  1598. #
  1599. AC_DEFUN([XORG_WITH_PERL],[
  1600. AC_ARG_VAR([PERL], [Path to perl command])
  1601. # Preserves the interface, should it be implemented later
  1602. m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
  1603. m4_define([_defopt], m4_default([$2], [auto]))
  1604. AC_ARG_WITH(perl,
  1605. AS_HELP_STRING([--with-perl],
  1606. [Use perl for extracting information from files (default: ]_defopt[)]),
  1607. [use_perl=$withval], [use_perl=]_defopt)
  1608. m4_undefine([_defopt])
  1609. if test "x$use_perl" = x"auto"; then
  1610. AC_PATH_PROG([PERL], [perl])
  1611. if test "x$PERL" = "x"; then
  1612. AC_MSG_WARN([perl not found - cannot extract information and report])
  1613. have_perl=no
  1614. else
  1615. have_perl=yes
  1616. fi
  1617. elif test "x$use_perl" = x"yes" ; then
  1618. AC_PATH_PROG([PERL], [perl])
  1619. if test "x$PERL" = "x"; then
  1620. AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
  1621. fi
  1622. have_perl=yes
  1623. elif test "x$use_perl" = x"no" ; then
  1624. if test "x$PERL" != "x"; then
  1625. AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
  1626. fi
  1627. have_perl=no
  1628. else
  1629. AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
  1630. fi
  1631. AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
  1632. ]) # XORG_WITH_PERL
  1633. # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
  1634. # ----------------
  1635. # Minimum version: 1.5.0
  1636. # Minimum version for optional DEFAULT argument: 1.11.0
  1637. #
  1638. # Documentation tools are not always available on all platforms and sometimes
  1639. # not at the appropriate level. This macro enables a module to test for the
  1640. # presence of the tool and obtain it's path in separate variables. Coupled with
  1641. # the --with-asciidoc option, it allows maximum flexibilty in making decisions
  1642. # as whether or not to use the asciidoc package. When DEFAULT is not specified,
  1643. # --with-asciidoc assumes 'auto'.
  1644. #
  1645. # Interface to module:
  1646. # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
  1647. # ASCIIDOC: returns the path of the asciidoc program found
  1648. # returns the path set by the user in the environment
  1649. # --with-asciidoc: 'yes' user instructs the module to use asciidoc
  1650. # 'no' user instructs the module not to use asciidoc
  1651. #
  1652. # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
  1653. #
  1654. AC_DEFUN([XORG_WITH_ASCIIDOC],[
  1655. AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
  1656. m4_define([_defopt], m4_default([$2], [auto]))
  1657. AC_ARG_WITH(asciidoc,
  1658. AS_HELP_STRING([--with-asciidoc],
  1659. [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
  1660. [use_asciidoc=$withval], [use_asciidoc=]_defopt)
  1661. m4_undefine([_defopt])
  1662. if test "x$use_asciidoc" = x"auto"; then
  1663. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1664. if test "x$ASCIIDOC" = "x"; then
  1665. AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
  1666. have_asciidoc=no
  1667. else
  1668. have_asciidoc=yes
  1669. fi
  1670. elif test "x$use_asciidoc" = x"yes" ; then
  1671. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  1672. if test "x$ASCIIDOC" = "x"; then
  1673. AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
  1674. fi
  1675. have_asciidoc=yes
  1676. elif test "x$use_asciidoc" = x"no" ; then
  1677. if test "x$ASCIIDOC" != "x"; then
  1678. AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
  1679. fi
  1680. have_asciidoc=no
  1681. else
  1682. AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
  1683. fi
  1684. m4_ifval([$1],
  1685. [if test "$have_asciidoc" = yes; then
  1686. # scrape the asciidoc version
  1687. AC_MSG_CHECKING([the asciidoc version])
  1688. asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
  1689. AC_MSG_RESULT([$asciidoc_version])
  1690. AS_VERSION_COMPARE([$asciidoc_version], [$1],
  1691. [if test "x$use_asciidoc" = xauto; then
  1692. AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
  1693. have_asciidoc=no
  1694. else
  1695. AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
  1696. fi])
  1697. fi])
  1698. AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
  1699. ]) # XORG_WITH_ASCIIDOC
  1700. # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
  1701. # --------------------------------
  1702. # Minimum version: 1.5.0
  1703. # Minimum version for optional DEFAULT argument: 1.11.0
  1704. #
  1705. # Documentation tools are not always available on all platforms and sometimes
  1706. # not at the appropriate level. This macro enables a module to test for the
  1707. # presence of the tool and obtain it's path in separate variables. Coupled with
  1708. # the --with-doxygen option, it allows maximum flexibilty in making decisions
  1709. # as whether or not to use the doxygen package. When DEFAULT is not specified,
  1710. # --with-doxygen assumes 'auto'.
  1711. #
  1712. # Interface to module:
  1713. # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
  1714. # DOXYGEN: returns the path of the doxygen program found
  1715. # returns the path set by the user in the environment
  1716. # --with-doxygen: 'yes' user instructs the module to use doxygen
  1717. # 'no' user instructs the module not to use doxygen
  1718. #
  1719. # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
  1720. #
  1721. AC_DEFUN([XORG_WITH_DOXYGEN],[
  1722. AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
  1723. m4_define([_defopt], m4_default([$2], [auto]))
  1724. AC_ARG_WITH(doxygen,
  1725. AS_HELP_STRING([--with-doxygen],
  1726. [Use doxygen to regenerate documentation (default: ]_defopt[)]),
  1727. [use_doxygen=$withval], [use_doxygen=]_defopt)
  1728. m4_undefine([_defopt])
  1729. if test "x$use_doxygen" = x"auto"; then
  1730. AC_PATH_PROG([DOXYGEN], [doxygen])
  1731. if test "x$DOXYGEN" = "x"; then
  1732. AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
  1733. have_doxygen=no
  1734. else
  1735. have_doxygen=yes
  1736. fi
  1737. elif test "x$use_doxygen" = x"yes" ; then
  1738. AC_PATH_PROG([DOXYGEN], [doxygen])
  1739. if test "x$DOXYGEN" = "x"; then
  1740. AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
  1741. fi
  1742. have_doxygen=yes
  1743. elif test "x$use_doxygen" = x"no" ; then
  1744. if test "x$DOXYGEN" != "x"; then
  1745. AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
  1746. fi
  1747. have_doxygen=no
  1748. else
  1749. AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
  1750. fi
  1751. m4_ifval([$1],
  1752. [if test "$have_doxygen" = yes; then
  1753. # scrape the doxygen version
  1754. AC_MSG_CHECKING([the doxygen version])
  1755. doxygen_version=`$DOXYGEN --version 2>/dev/null`
  1756. AC_MSG_RESULT([$doxygen_version])
  1757. AS_VERSION_COMPARE([$doxygen_version], [$1],
  1758. [if test "x$use_doxygen" = xauto; then
  1759. AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
  1760. have_doxygen=no
  1761. else
  1762. AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
  1763. fi])
  1764. fi])
  1765. AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
  1766. ]) # XORG_WITH_DOXYGEN
  1767. # XORG_WITH_GROFF([DEFAULT])
  1768. # ----------------
  1769. # Minimum version: 1.6.0
  1770. # Minimum version for optional DEFAULT argument: 1.11.0
  1771. #
  1772. # Documentation tools are not always available on all platforms and sometimes
  1773. # not at the appropriate level. This macro enables a module to test for the
  1774. # presence of the tool and obtain it's path in separate variables. Coupled with
  1775. # the --with-groff option, it allows maximum flexibilty in making decisions
  1776. # as whether or not to use the groff package. When DEFAULT is not specified,
  1777. # --with-groff assumes 'auto'.
  1778. #
  1779. # Interface to module:
  1780. # HAVE_GROFF: used in makefiles to conditionally generate documentation
  1781. # HAVE_GROFF_MM: the memorandum macros (-mm) package
  1782. # HAVE_GROFF_MS: the -ms macros package
  1783. # GROFF: returns the path of the groff program found
  1784. # returns the path set by the user in the environment
  1785. # --with-groff: 'yes' user instructs the module to use groff
  1786. # 'no' user instructs the module not to use groff
  1787. #
  1788. # Added in version 1.9.0:
  1789. # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
  1790. # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
  1791. # psselect from the psutils package.
  1792. # the ghostcript package. Refer to the grohtml man pages
  1793. #
  1794. # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
  1795. #
  1796. # OS and distros often splits groff in a basic and full package, the former
  1797. # having the groff program and the later having devices, fonts and macros
  1798. # Checking for the groff executable is not enough.
  1799. #
  1800. # If macros are missing, we cannot assume that groff is useless, so we don't
  1801. # unset HAVE_GROFF or GROFF env variables.
  1802. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
  1803. #
  1804. AC_DEFUN([XORG_WITH_GROFF],[
  1805. AC_ARG_VAR([GROFF], [Path to groff command])
  1806. m4_define([_defopt], m4_default([$1], [auto]))
  1807. AC_ARG_WITH(groff,
  1808. AS_HELP_STRING([--with-groff],
  1809. [Use groff to regenerate documentation (default: ]_defopt[)]),
  1810. [use_groff=$withval], [use_groff=]_defopt)
  1811. m4_undefine([_defopt])
  1812. if test "x$use_groff" = x"auto"; then
  1813. AC_PATH_PROG([GROFF], [groff])
  1814. if test "x$GROFF" = "x"; then
  1815. AC_MSG_WARN([groff not found - documentation targets will be skipped])
  1816. have_groff=no
  1817. else
  1818. have_groff=yes
  1819. fi
  1820. elif test "x$use_groff" = x"yes" ; then
  1821. AC_PATH_PROG([GROFF], [groff])
  1822. if test "x$GROFF" = "x"; then
  1823. AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
  1824. fi
  1825. have_groff=yes
  1826. elif test "x$use_groff" = x"no" ; then
  1827. if test "x$GROFF" != "x"; then
  1828. AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
  1829. fi
  1830. have_groff=no
  1831. else
  1832. AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
  1833. fi
  1834. # We have groff, test for the presence of the macro packages
  1835. if test "x$have_groff" = x"yes"; then
  1836. AC_MSG_CHECKING([for ${GROFF} -ms macros])
  1837. if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
  1838. groff_ms_works=yes
  1839. else
  1840. groff_ms_works=no
  1841. fi
  1842. AC_MSG_RESULT([$groff_ms_works])
  1843. AC_MSG_CHECKING([for ${GROFF} -mm macros])
  1844. if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
  1845. groff_mm_works=yes
  1846. else
  1847. groff_mm_works=no
  1848. fi
  1849. AC_MSG_RESULT([$groff_mm_works])
  1850. fi
  1851. # We have groff, test for HTML dependencies, one command per package
  1852. if test "x$have_groff" = x"yes"; then
  1853. AC_PATH_PROGS(GS_PATH, [gs gswin32c])
  1854. AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
  1855. AC_PATH_PROG(PSSELECT_PATH, [psselect])
  1856. if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
  1857. have_groff_html=yes
  1858. else
  1859. have_groff_html=no
  1860. AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
  1861. fi
  1862. fi
  1863. # Set Automake conditionals for Makefiles
  1864. AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
  1865. AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
  1866. AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
  1867. AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
  1868. ]) # XORG_WITH_GROFF
  1869. # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
  1870. # ---------------------------------------
  1871. # Minimum version: 1.6.0
  1872. # Minimum version for optional DEFAULT argument: 1.11.0
  1873. # Minimum version for optional MIN-VERSION argument: 1.15.0
  1874. #
  1875. # Documentation tools are not always available on all platforms and sometimes
  1876. # not at the appropriate level. This macro enables a module to test for the
  1877. # presence of the tool and obtain it's path in separate variables. Coupled with
  1878. # the --with-fop option, it allows maximum flexibilty in making decisions
  1879. # as whether or not to use the fop package. When DEFAULT is not specified,
  1880. # --with-fop assumes 'auto'.
  1881. #
  1882. # Interface to module:
  1883. # HAVE_FOP: used in makefiles to conditionally generate documentation
  1884. # FOP: returns the path of the fop program found
  1885. # returns the path set by the user in the environment
  1886. # --with-fop: 'yes' user instructs the module to use fop
  1887. # 'no' user instructs the module not to use fop
  1888. #
  1889. # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
  1890. #
  1891. AC_DEFUN([XORG_WITH_FOP],[
  1892. AC_ARG_VAR([FOP], [Path to fop command])
  1893. m4_define([_defopt], m4_default([$2], [auto]))
  1894. AC_ARG_WITH(fop,
  1895. AS_HELP_STRING([--with-fop],
  1896. [Use fop to regenerate documentation (default: ]_defopt[)]),
  1897. [use_fop=$withval], [use_fop=]_defopt)
  1898. m4_undefine([_defopt])
  1899. if test "x$use_fop" = x"auto"; then
  1900. AC_PATH_PROG([FOP], [fop])
  1901. if test "x$FOP" = "x"; then
  1902. AC_MSG_WARN([fop not found - documentation targets will be skipped])
  1903. have_fop=no
  1904. else
  1905. have_fop=yes
  1906. fi
  1907. elif test "x$use_fop" = x"yes" ; then
  1908. AC_PATH_PROG([FOP], [fop])
  1909. if test "x$FOP" = "x"; then
  1910. AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
  1911. fi
  1912. have_fop=yes
  1913. elif test "x$use_fop" = x"no" ; then
  1914. if test "x$FOP" != "x"; then
  1915. AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
  1916. fi
  1917. have_fop=no
  1918. else
  1919. AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
  1920. fi
  1921. # Test for a minimum version of fop, if provided.
  1922. m4_ifval([$1],
  1923. [if test "$have_fop" = yes; then
  1924. # scrape the fop version
  1925. AC_MSG_CHECKING([for fop minimum version])
  1926. fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
  1927. AC_MSG_RESULT([$fop_version])
  1928. AS_VERSION_COMPARE([$fop_version], [$1],
  1929. [if test "x$use_fop" = xauto; then
  1930. AC_MSG_WARN([fop version $fop_version found, but $1 needed])
  1931. have_fop=no
  1932. else
  1933. AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
  1934. fi])
  1935. fi])
  1936. AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
  1937. ]) # XORG_WITH_FOP
  1938. # XORG_WITH_PS2PDF([DEFAULT])
  1939. # ----------------
  1940. # Minimum version: 1.6.0
  1941. # Minimum version for optional DEFAULT argument: 1.11.0
  1942. #
  1943. # Documentation tools are not always available on all platforms and sometimes
  1944. # not at the appropriate level. This macro enables a module to test for the
  1945. # presence of the tool and obtain it's path in separate variables. Coupled with
  1946. # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
  1947. # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
  1948. # --with-ps2pdf assumes 'auto'.
  1949. #
  1950. # Interface to module:
  1951. # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
  1952. # PS2PDF: returns the path of the ps2pdf program found
  1953. # returns the path set by the user in the environment
  1954. # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
  1955. # 'no' user instructs the module not to use ps2pdf
  1956. #
  1957. # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
  1958. #
  1959. AC_DEFUN([XORG_WITH_PS2PDF],[
  1960. AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
  1961. m4_define([_defopt], m4_default([$1], [auto]))
  1962. AC_ARG_WITH(ps2pdf,
  1963. AS_HELP_STRING([--with-ps2pdf],
  1964. [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
  1965. [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
  1966. m4_undefine([_defopt])
  1967. if test "x$use_ps2pdf" = x"auto"; then
  1968. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1969. if test "x$PS2PDF" = "x"; then
  1970. AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
  1971. have_ps2pdf=no
  1972. else
  1973. have_ps2pdf=yes
  1974. fi
  1975. elif test "x$use_ps2pdf" = x"yes" ; then
  1976. AC_PATH_PROG([PS2PDF], [ps2pdf])
  1977. if test "x$PS2PDF" = "x"; then
  1978. AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
  1979. fi
  1980. have_ps2pdf=yes
  1981. elif test "x$use_ps2pdf" = x"no" ; then
  1982. if test "x$PS2PDF" != "x"; then
  1983. AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
  1984. fi
  1985. have_ps2pdf=no
  1986. else
  1987. AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
  1988. fi
  1989. AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
  1990. ]) # XORG_WITH_PS2PDF
  1991. # XORG_ENABLE_DOCS (enable_docs=yes)
  1992. # ----------------
  1993. # Minimum version: 1.6.0
  1994. #
  1995. # Documentation tools are not always available on all platforms and sometimes
  1996. # not at the appropriate level. This macro enables a builder to skip all
  1997. # documentation targets except traditional man pages.
  1998. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  1999. # maximum flexibilty in controlling documentation building.
  2000. # Refer to:
  2001. # XORG_WITH_XMLTO --with-xmlto
  2002. # XORG_WITH_ASCIIDOC --with-asciidoc
  2003. # XORG_WITH_DOXYGEN --with-doxygen
  2004. # XORG_WITH_FOP --with-fop
  2005. # XORG_WITH_GROFF --with-groff
  2006. # XORG_WITH_PS2PDF --with-ps2pdf
  2007. #
  2008. # Interface to module:
  2009. # ENABLE_DOCS: used in makefiles to conditionally generate documentation
  2010. # --enable-docs: 'yes' user instructs the module to generate docs
  2011. # 'no' user instructs the module not to generate docs
  2012. # parm1: specify the default value, yes or no.
  2013. #
  2014. AC_DEFUN([XORG_ENABLE_DOCS],[
  2015. m4_define([docs_default], m4_default([$1], [yes]))
  2016. AC_ARG_ENABLE(docs,
  2017. AS_HELP_STRING([--enable-docs],
  2018. [Enable building the documentation (default: ]docs_default[)]),
  2019. [build_docs=$enableval], [build_docs=]docs_default)
  2020. m4_undefine([docs_default])
  2021. AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
  2022. AC_MSG_CHECKING([whether to build documentation])
  2023. AC_MSG_RESULT([$build_docs])
  2024. ]) # XORG_ENABLE_DOCS
  2025. # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
  2026. # ----------------
  2027. # Minimum version: 1.6.0
  2028. #
  2029. # This macro enables a builder to skip all developer documentation.
  2030. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2031. # maximum flexibilty in controlling documentation building.
  2032. # Refer to:
  2033. # XORG_WITH_XMLTO --with-xmlto
  2034. # XORG_WITH_ASCIIDOC --with-asciidoc
  2035. # XORG_WITH_DOXYGEN --with-doxygen
  2036. # XORG_WITH_FOP --with-fop
  2037. # XORG_WITH_GROFF --with-groff
  2038. # XORG_WITH_PS2PDF --with-ps2pdf
  2039. #
  2040. # Interface to module:
  2041. # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
  2042. # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
  2043. # 'no' user instructs the module not to generate developer docs
  2044. # parm1: specify the default value, yes or no.
  2045. #
  2046. AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
  2047. m4_define([devel_default], m4_default([$1], [yes]))
  2048. AC_ARG_ENABLE(devel-docs,
  2049. AS_HELP_STRING([--enable-devel-docs],
  2050. [Enable building the developer documentation (default: ]devel_default[)]),
  2051. [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
  2052. m4_undefine([devel_default])
  2053. AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
  2054. AC_MSG_CHECKING([whether to build developer documentation])
  2055. AC_MSG_RESULT([$build_devel_docs])
  2056. ]) # XORG_ENABLE_DEVEL_DOCS
  2057. # XORG_ENABLE_SPECS (enable_specs=yes)
  2058. # ----------------
  2059. # Minimum version: 1.6.0
  2060. #
  2061. # This macro enables a builder to skip all functional specification targets.
  2062. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  2063. # maximum flexibilty in controlling documentation building.
  2064. # Refer to:
  2065. # XORG_WITH_XMLTO --with-xmlto
  2066. # XORG_WITH_ASCIIDOC --with-asciidoc
  2067. # XORG_WITH_DOXYGEN --with-doxygen
  2068. # XORG_WITH_FOP --with-fop
  2069. # XORG_WITH_GROFF --with-groff
  2070. # XORG_WITH_PS2PDF --with-ps2pdf
  2071. #
  2072. # Interface to module:
  2073. # ENABLE_SPECS: used in makefiles to conditionally generate specs
  2074. # --enable-specs: 'yes' user instructs the module to generate specs
  2075. # 'no' user instructs the module not to generate specs
  2076. # parm1: specify the default value, yes or no.
  2077. #
  2078. AC_DEFUN([XORG_ENABLE_SPECS],[
  2079. m4_define([spec_default], m4_default([$1], [yes]))
  2080. AC_ARG_ENABLE(specs,
  2081. AS_HELP_STRING([--enable-specs],
  2082. [Enable building the specs (default: ]spec_default[)]),
  2083. [build_specs=$enableval], [build_specs=]spec_default)
  2084. m4_undefine([spec_default])
  2085. AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
  2086. AC_MSG_CHECKING([whether to build functional specifications])
  2087. AC_MSG_RESULT([$build_specs])
  2088. ]) # XORG_ENABLE_SPECS
  2089. # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
  2090. # ----------------------------------------------
  2091. # Minimum version: 1.13.0
  2092. #
  2093. # This macro enables a builder to enable/disable unit testing
  2094. # It makes no assumption about the test cases implementation
  2095. # Test cases may or may not use Automake "Support for test suites"
  2096. # They may or may not use the software utility library GLib
  2097. #
  2098. # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
  2099. # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
  2100. # The variable enable_unit_tests is used by other macros in this file.
  2101. #
  2102. # Interface to module:
  2103. # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
  2104. # enable_unit_tests: used in configure.ac for additional configuration
  2105. # --enable-unit-tests: 'yes' user instructs the module to build tests
  2106. # 'no' user instructs the module not to build tests
  2107. # parm1: specify the default value, yes or no.
  2108. #
  2109. AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
  2110. AC_BEFORE([$0], [XORG_WITH_GLIB])
  2111. AC_BEFORE([$0], [XORG_LD_WRAP])
  2112. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2113. m4_define([_defopt], m4_default([$1], [auto]))
  2114. AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
  2115. [Enable building unit test cases (default: ]_defopt[)]),
  2116. [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
  2117. m4_undefine([_defopt])
  2118. AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
  2119. AC_MSG_CHECKING([whether to build unit test cases])
  2120. AC_MSG_RESULT([$enable_unit_tests])
  2121. ]) # XORG_ENABLE_UNIT_TESTS
  2122. # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
  2123. # ------------------------------------------------------
  2124. # Minimum version: 1.17.0
  2125. #
  2126. # This macro enables a builder to enable/disable integration testing
  2127. # It makes no assumption about the test cases' implementation
  2128. # Test cases may or may not use Automake "Support for test suites"
  2129. #
  2130. # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
  2131. # usually requires less dependencies and may be built and run under less
  2132. # stringent environments than integration tests.
  2133. #
  2134. # Interface to module:
  2135. # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
  2136. # enable_integration_tests: used in configure.ac for additional configuration
  2137. # --enable-integration-tests: 'yes' user instructs the module to build tests
  2138. # 'no' user instructs the module not to build tests
  2139. # parm1: specify the default value, yes or no.
  2140. #
  2141. AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
  2142. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  2143. m4_define([_defopt], m4_default([$1], [auto]))
  2144. AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
  2145. [Enable building integration test cases (default: ]_defopt[)]),
  2146. [enable_integration_tests=$enableval],
  2147. [enable_integration_tests=]_defopt)
  2148. m4_undefine([_defopt])
  2149. AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
  2150. [test "x$enable_integration_tests" != xno])
  2151. AC_MSG_CHECKING([whether to build unit test cases])
  2152. AC_MSG_RESULT([$enable_integration_tests])
  2153. ]) # XORG_ENABLE_INTEGRATION_TESTS
  2154. # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
  2155. # ----------------------------------------
  2156. # Minimum version: 1.13.0
  2157. #
  2158. # GLib is a library which provides advanced data structures and functions.
  2159. # This macro enables a module to test for the presence of Glib.
  2160. #
  2161. # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
  2162. # Otherwise the value of $enable_unit_tests is blank.
  2163. #
  2164. # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
  2165. # test support usually requires less dependencies and may be built and run under
  2166. # less stringent environments than integration tests.
  2167. #
  2168. # Interface to module:
  2169. # HAVE_GLIB: used in makefiles to conditionally build targets
  2170. # with_glib: used in configure.ac to know if GLib has been found
  2171. # --with-glib: 'yes' user instructs the module to use glib
  2172. # 'no' user instructs the module not to use glib
  2173. #
  2174. AC_DEFUN([XORG_WITH_GLIB],[
  2175. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2176. m4_define([_defopt], m4_default([$2], [auto]))
  2177. AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
  2178. [Use GLib library for unit testing (default: ]_defopt[)]),
  2179. [with_glib=$withval], [with_glib=]_defopt)
  2180. m4_undefine([_defopt])
  2181. have_glib=no
  2182. # Do not probe GLib if user explicitly disabled unit testing
  2183. if test "x$enable_unit_tests" != x"no"; then
  2184. # Do not probe GLib if user explicitly disabled it
  2185. if test "x$with_glib" != x"no"; then
  2186. m4_ifval(
  2187. [$1],
  2188. [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
  2189. [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
  2190. )
  2191. fi
  2192. fi
  2193. # Not having GLib when unit testing has been explicitly requested is an error
  2194. if test "x$enable_unit_tests" = x"yes"; then
  2195. if test "x$have_glib" = x"no"; then
  2196. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2197. fi
  2198. fi
  2199. # Having unit testing disabled when GLib has been explicitly requested is an error
  2200. if test "x$enable_unit_tests" = x"no"; then
  2201. if test "x$with_glib" = x"yes"; then
  2202. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  2203. fi
  2204. fi
  2205. # Not having GLib when it has been explicitly requested is an error
  2206. if test "x$with_glib" = x"yes"; then
  2207. if test "x$have_glib" = x"no"; then
  2208. AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
  2209. fi
  2210. fi
  2211. AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
  2212. ]) # XORG_WITH_GLIB
  2213. # XORG_LD_WRAP([required|optional])
  2214. # ---------------------------------
  2215. # Minimum version: 1.13.0
  2216. #
  2217. # Check if linker supports -wrap, passed via compiler flags
  2218. #
  2219. # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
  2220. # Otherwise the value of $enable_unit_tests is blank.
  2221. #
  2222. # Argument added in 1.16.0 - default is "required", to match existing behavior
  2223. # of returning an error if enable_unit_tests is yes, and ld -wrap is not
  2224. # available, an argument of "optional" allows use when some unit tests require
  2225. # ld -wrap and others do not.
  2226. #
  2227. AC_DEFUN([XORG_LD_WRAP],[
  2228. XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
  2229. [AC_LANG_PROGRAM([#include <stdlib.h>
  2230. void __wrap_exit(int status) { return; }],
  2231. [exit(0);])])
  2232. # Not having ld wrap when unit testing has been explicitly requested is an error
  2233. if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
  2234. if test "x$have_ld_wrap" = x"no"; then
  2235. AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
  2236. fi
  2237. fi
  2238. AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
  2239. #
  2240. ]) # XORG_LD_WRAP
  2241. # XORG_CHECK_LINKER_FLAGS
  2242. # -----------------------
  2243. # SYNOPSIS
  2244. #
  2245. # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
  2246. #
  2247. # DESCRIPTION
  2248. #
  2249. # Check whether the given linker FLAGS work with the current language's
  2250. # linker, or whether they give an error.
  2251. #
  2252. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  2253. # success/failure.
  2254. #
  2255. # PROGRAM-SOURCE is the program source to link with, if needed
  2256. #
  2257. # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
  2258. #
  2259. # LICENSE
  2260. #
  2261. # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
  2262. # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
  2263. # Copyright (c) 2009 Matteo Frigo
  2264. #
  2265. # This program is free software: you can redistribute it and/or modify it
  2266. # under the terms of the GNU General Public License as published by the
  2267. # Free Software Foundation, either version 3 of the License, or (at your
  2268. # option) any later version.
  2269. #
  2270. # This program is distributed in the hope that it will be useful, but
  2271. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2272. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  2273. # Public License for more details.
  2274. #
  2275. # You should have received a copy of the GNU General Public License along
  2276. # with this program. If not, see <http://www.gnu.org/licenses/>.
  2277. #
  2278. # As a special exception, the respective Autoconf Macro's copyright owner
  2279. # gives unlimited permission to copy, distribute and modify the configure
  2280. # scripts that are the output of Autoconf when processing the Macro. You
  2281. # need not follow the terms of the GNU General Public License when using
  2282. # or distributing such scripts, even though portions of the text of the
  2283. # Macro appear in them. The GNU General Public License (GPL) does govern
  2284. # all other use of the material that constitutes the Autoconf Macro.
  2285. #
  2286. # This special exception to the GPL applies to versions of the Autoconf
  2287. # Macro released by the Autoconf Archive. When you make and distribute a
  2288. # modified version of the Autoconf Macro, you may extend this special
  2289. # exception to the GPL to apply to your modified version as well.#
  2290. AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
  2291. [AC_MSG_CHECKING([whether the linker accepts $1])
  2292. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
  2293. AS_LITERAL_IF([$1],
  2294. [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
  2295. ax_save_FLAGS=$LDFLAGS
  2296. LDFLAGS="$1"
  2297. AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
  2298. AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2299. AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2300. LDFLAGS=$ax_save_FLAGS])],
  2301. [ax_save_FLAGS=$LDFLAGS
  2302. LDFLAGS="$1"
  2303. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  2304. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  2305. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  2306. LDFLAGS=$ax_save_FLAGS])
  2307. eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
  2308. AC_MSG_RESULT($xorg_check_linker_flags)
  2309. if test "x$xorg_check_linker_flags" = xyes; then
  2310. m4_default([$2], :)
  2311. else
  2312. m4_default([$3], :)
  2313. fi
  2314. ]) # XORG_CHECK_LINKER_FLAGS
  2315. # XORG_MEMORY_CHECK_FLAGS
  2316. # -----------------------
  2317. # Minimum version: 1.16.0
  2318. #
  2319. # This macro attempts to find appropriate memory checking functionality
  2320. # for various platforms which unit testing code may use to catch various
  2321. # forms of memory allocation and access errors in testing.
  2322. #
  2323. # Interface to module:
  2324. # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
  2325. # Usually added to TESTS_ENVIRONMENT in Makefile.am
  2326. #
  2327. # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
  2328. #
  2329. AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
  2330. AC_REQUIRE([AC_CANONICAL_HOST])
  2331. AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
  2332. [Environment variables to enable memory checking in tests])
  2333. # Check for different types of support on different platforms
  2334. case $host_os in
  2335. solaris*)
  2336. AC_CHECK_LIB([umem], [umem_alloc],
  2337. [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
  2338. ;;
  2339. *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
  2340. # both directly and inverted, so should not be 0 or 255.
  2341. malloc_debug_env='MALLOC_PERTURB_=15'
  2342. ;;
  2343. darwin*)
  2344. malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
  2345. ;;
  2346. *bsd*)
  2347. malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
  2348. ;;
  2349. esac
  2350. # User supplied flags override default flags
  2351. if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
  2352. malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
  2353. fi
  2354. AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
  2355. ]) # XORG_WITH_LINT
  2356. # XORG_CHECK_MALLOC_ZERO
  2357. # ----------------------
  2358. # Minimum version: 1.0.0
  2359. #
  2360. # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
  2361. # malloc(0) returns NULL. Packages should add one of these cflags to
  2362. # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
  2363. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
  2364. AC_ARG_ENABLE(malloc0returnsnull,
  2365. AS_HELP_STRING([--enable-malloc0returnsnull],
  2366. [malloc(0) returns NULL (default: auto)]),
  2367. [MALLOC_ZERO_RETURNS_NULL=$enableval],
  2368. [MALLOC_ZERO_RETURNS_NULL=auto])
  2369. AC_MSG_CHECKING([whether malloc(0) returns NULL])
  2370. if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
  2371. AC_RUN_IFELSE([AC_LANG_PROGRAM([
  2372. #include <stdlib.h>
  2373. ],[
  2374. char *m0, *r0, *c0, *p;
  2375. m0 = malloc(0);
  2376. p = malloc(10);
  2377. r0 = realloc(p,0);
  2378. c0 = calloc(0,10);
  2379. exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
  2380. ])],
  2381. [MALLOC_ZERO_RETURNS_NULL=yes],
  2382. [MALLOC_ZERO_RETURNS_NULL=no],
  2383. [MALLOC_ZERO_RETURNS_NULL=yes])
  2384. fi
  2385. AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
  2386. if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
  2387. MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
  2388. XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
  2389. XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
  2390. else
  2391. MALLOC_ZERO_CFLAGS=""
  2392. XMALLOC_ZERO_CFLAGS=""
  2393. XTMALLOC_ZERO_CFLAGS=""
  2394. fi
  2395. AC_SUBST([MALLOC_ZERO_CFLAGS])
  2396. AC_SUBST([XMALLOC_ZERO_CFLAGS])
  2397. AC_SUBST([XTMALLOC_ZERO_CFLAGS])
  2398. ]) # XORG_CHECK_MALLOC_ZERO
  2399. # XORG_WITH_LINT()
  2400. # ----------------
  2401. # Minimum version: 1.1.0
  2402. #
  2403. # This macro enables the use of a tool that flags some suspicious and
  2404. # non-portable constructs (likely to be bugs) in C language source code.
  2405. # It will attempt to locate the tool and use appropriate options.
  2406. # There are various lint type tools on different platforms.
  2407. #
  2408. # Interface to module:
  2409. # LINT: returns the path to the tool found on the platform
  2410. # or the value set to LINT on the configure cmd line
  2411. # also an Automake conditional
  2412. # LINT_FLAGS: an Automake variable with appropriate flags
  2413. #
  2414. # --with-lint: 'yes' user instructs the module to use lint
  2415. # 'no' user instructs the module not to use lint (default)
  2416. #
  2417. # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
  2418. # If the user sets the value of LINT_FLAGS, they are used verbatim.
  2419. #
  2420. AC_DEFUN([XORG_WITH_LINT],[
  2421. AC_ARG_VAR([LINT], [Path to a lint-style command])
  2422. AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
  2423. AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
  2424. [Use a lint-style source code checker (default: disabled)])],
  2425. [use_lint=$withval], [use_lint=no])
  2426. # Obtain platform specific info like program name and options
  2427. # The lint program on FreeBSD and NetBSD is different from the one on Solaris
  2428. case $host_os in
  2429. *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
  2430. lint_name=splint
  2431. lint_options="-badflag"
  2432. ;;
  2433. *freebsd* | *netbsd*)
  2434. lint_name=lint
  2435. lint_options="-u -b"
  2436. ;;
  2437. *solaris*)
  2438. lint_name=lint
  2439. lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
  2440. ;;
  2441. esac
  2442. # Test for the presence of the program (either guessed by the code or spelled out by the user)
  2443. if test "x$use_lint" = x"yes" ; then
  2444. AC_PATH_PROG([LINT], [$lint_name])
  2445. if test "x$LINT" = "x"; then
  2446. AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
  2447. fi
  2448. elif test "x$use_lint" = x"no" ; then
  2449. if test "x$LINT" != "x"; then
  2450. AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
  2451. fi
  2452. else
  2453. AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
  2454. fi
  2455. # User supplied flags override default flags
  2456. if test "x$LINT_FLAGS" != "x"; then
  2457. lint_options=$LINT_FLAGS
  2458. fi
  2459. AC_SUBST([LINT_FLAGS],[$lint_options])
  2460. AM_CONDITIONAL(LINT, [test "x$LINT" != x])
  2461. ]) # XORG_WITH_LINT
  2462. # XORG_LINT_LIBRARY(LIBNAME)
  2463. # --------------------------
  2464. # Minimum version: 1.1.0
  2465. #
  2466. # Sets up flags for building lint libraries for checking programs that call
  2467. # functions in the library.
  2468. #
  2469. # Interface to module:
  2470. # LINTLIB - Automake variable with the name of lint library file to make
  2471. # MAKE_LINT_LIB - Automake conditional
  2472. #
  2473. # --enable-lint-library: - 'yes' user instructs the module to created a lint library
  2474. # - 'no' user instructs the module not to create a lint library (default)
  2475. AC_DEFUN([XORG_LINT_LIBRARY],[
  2476. AC_REQUIRE([XORG_WITH_LINT])
  2477. AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
  2478. [Create lint library (default: disabled)])],
  2479. [make_lint_lib=$enableval], [make_lint_lib=no])
  2480. if test "x$make_lint_lib" = x"yes" ; then
  2481. LINTLIB=llib-l$1.ln
  2482. if test "x$LINT" = "x"; then
  2483. AC_MSG_ERROR([Cannot make lint library without --with-lint])
  2484. fi
  2485. elif test "x$make_lint_lib" != x"no" ; then
  2486. AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
  2487. fi
  2488. AC_SUBST(LINTLIB)
  2489. AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
  2490. ]) # XORG_LINT_LIBRARY
  2491. # XORG_COMPILER_BRAND
  2492. # -------------------
  2493. # Minimum version: 1.14.0
  2494. #
  2495. # Checks for various brands of compilers and sets flags as appropriate:
  2496. # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
  2497. # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
  2498. # clang compiler - sets CLANGCC to "yes"
  2499. # Intel compiler - sets INTELCC to "yes"
  2500. # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
  2501. #
  2502. AC_DEFUN([XORG_COMPILER_BRAND], [
  2503. AC_LANG_CASE(
  2504. [C], [
  2505. AC_REQUIRE([AC_PROG_CC_C99])
  2506. ],
  2507. [C++], [
  2508. AC_REQUIRE([AC_PROG_CXX])
  2509. ]
  2510. )
  2511. AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
  2512. AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
  2513. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  2514. ]) # XORG_COMPILER_BRAND
  2515. # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
  2516. # ---------------
  2517. # Minimum version: 1.16.0
  2518. #
  2519. # Test if the compiler works when passed the given flag as a command line argument.
  2520. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
  2521. # next flag in the list until there are no more options.
  2522. #
  2523. # Note that this does not guarantee that the compiler supports the flag as some
  2524. # compilers will simply ignore arguments that they do not understand, but we do
  2525. # attempt to weed out false positives by using -Werror=unknown-warning-option and
  2526. # -Werror=unused-command-line-argument
  2527. #
  2528. AC_DEFUN([XORG_TESTSET_CFLAG], [
  2529. m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2530. m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  2531. AC_LANG_COMPILER_REQUIRE
  2532. AC_LANG_CASE(
  2533. [C], [
  2534. AC_REQUIRE([AC_PROG_CC_C99])
  2535. define([PREFIX], [C])
  2536. define([CACHE_PREFIX], [cc])
  2537. define([COMPILER], [$CC])
  2538. ],
  2539. [C++], [
  2540. define([PREFIX], [CXX])
  2541. define([CACHE_PREFIX], [cxx])
  2542. define([COMPILER], [$CXX])
  2543. ]
  2544. )
  2545. [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
  2546. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
  2547. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2548. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
  2549. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
  2550. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2551. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
  2552. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
  2553. [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
  2554. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2555. fi
  2556. if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
  2557. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
  2558. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2559. fi
  2560. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2561. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
  2562. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
  2563. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  2564. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
  2565. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
  2566. [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
  2567. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2568. fi
  2569. found="no"
  2570. m4_foreach([flag], m4_cdr($@), [
  2571. if test $found = "no" ; then
  2572. if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
  2573. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  2574. fi
  2575. if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
  2576. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  2577. fi
  2578. PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
  2579. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
  2580. AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
  2581. cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
  2582. AC_CACHE_VAL($cacheid,
  2583. [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
  2584. [eval $cacheid=yes],
  2585. [eval $cacheid=no])])
  2586. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  2587. eval supported=\$$cacheid
  2588. AC_MSG_RESULT([$supported])
  2589. if test "$supported" = "yes" ; then
  2590. $1="$$1 ]flag["
  2591. found="yes"
  2592. fi
  2593. fi
  2594. ])
  2595. ]) # XORG_TESTSET_CFLAG
  2596. # XORG_COMPILER_FLAGS
  2597. # ---------------
  2598. # Minimum version: 1.16.0
  2599. #
  2600. # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
  2601. # arguments supported by the selected compiler which do NOT alter the generated
  2602. # code. These arguments will cause the compiler to print various warnings
  2603. # during compilation AND turn a conservative set of warnings into errors.
  2604. #
  2605. # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
  2606. # future versions of util-macros as options are added to new compilers.
  2607. #
  2608. AC_DEFUN([XORG_COMPILER_FLAGS], [
  2609. AC_REQUIRE([XORG_COMPILER_BRAND])
  2610. AC_ARG_ENABLE(selective-werror,
  2611. AS_HELP_STRING([--disable-selective-werror],
  2612. [Turn off selective compiler errors. (default: enabled)]),
  2613. [SELECTIVE_WERROR=$enableval],
  2614. [SELECTIVE_WERROR=yes])
  2615. AC_LANG_CASE(
  2616. [C], [
  2617. define([PREFIX], [C])
  2618. ],
  2619. [C++], [
  2620. define([PREFIX], [CXX])
  2621. ]
  2622. )
  2623. # -v is too short to test reliably with XORG_TESTSET_CFLAG
  2624. if test "x$SUNCC" = "xyes"; then
  2625. [BASE_]PREFIX[FLAGS]="-v"
  2626. else
  2627. [BASE_]PREFIX[FLAGS]=""
  2628. fi
  2629. # This chunk of warnings were those that existed in the legacy CWARNFLAGS
  2630. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
  2631. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
  2632. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
  2633. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
  2634. AC_LANG_CASE(
  2635. [C], [
  2636. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
  2637. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
  2638. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
  2639. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
  2640. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
  2641. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
  2642. ]
  2643. )
  2644. # This chunk adds additional warnings that could catch undesired effects.
  2645. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
  2646. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
  2647. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
  2648. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
  2649. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
  2650. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
  2651. # These are currently disabled because they are noisy. They will be enabled
  2652. # in the future once the codebase is sufficiently modernized to silence
  2653. # them. For now, I don't want them to drown out the other warnings.
  2654. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
  2655. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
  2656. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
  2657. # Turn some warnings into errors, so we don't accidently get successful builds
  2658. # when there are problems that should be fixed.
  2659. if test "x$SELECTIVE_WERROR" = "xyes" ; then
  2660. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
  2661. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
  2662. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
  2663. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
  2664. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
  2665. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
  2666. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
  2667. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
  2668. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
  2669. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
  2670. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
  2671. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
  2672. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
  2673. else
  2674. 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])
  2675. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
  2676. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
  2677. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
  2678. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
  2679. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
  2680. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
  2681. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
  2682. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
  2683. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
  2684. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
  2685. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
  2686. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
  2687. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
  2688. fi
  2689. AC_SUBST([BASE_]PREFIX[FLAGS])
  2690. ]) # XORG_COMPILER_FLAGS
  2691. # XORG_CWARNFLAGS
  2692. # ---------------
  2693. # Minimum version: 1.2.0
  2694. # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
  2695. #
  2696. # Defines CWARNFLAGS to enable C compiler warnings.
  2697. #
  2698. # This function is deprecated because it defines -fno-strict-aliasing
  2699. # which alters the code generated by the compiler. If -fno-strict-aliasing
  2700. # is needed, then it should be added explicitly in the module when
  2701. # it is updated to use BASE_CFLAGS.
  2702. #
  2703. AC_DEFUN([XORG_CWARNFLAGS], [
  2704. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2705. AC_REQUIRE([XORG_COMPILER_BRAND])
  2706. AC_LANG_CASE(
  2707. [C], [
  2708. CWARNFLAGS="$BASE_CFLAGS"
  2709. if test "x$GCC" = xyes ; then
  2710. CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
  2711. fi
  2712. AC_SUBST(CWARNFLAGS)
  2713. ]
  2714. )
  2715. ]) # XORG_CWARNFLAGS
  2716. # XORG_STRICT_OPTION
  2717. # -----------------------
  2718. # Minimum version: 1.3.0
  2719. #
  2720. # Add configure option to enable strict compilation flags, such as treating
  2721. # warnings as fatal errors.
  2722. # If --enable-strict-compilation is passed to configure, adds strict flags to
  2723. # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
  2724. #
  2725. # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
  2726. # when strict compilation is unconditionally desired.
  2727. AC_DEFUN([XORG_STRICT_OPTION], [
  2728. AC_REQUIRE([XORG_CWARNFLAGS])
  2729. AC_REQUIRE([XORG_COMPILER_FLAGS])
  2730. AC_ARG_ENABLE(strict-compilation,
  2731. AS_HELP_STRING([--enable-strict-compilation],
  2732. [Enable all warnings from compiler and make them errors (default: disabled)]),
  2733. [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
  2734. AC_LANG_CASE(
  2735. [C], [
  2736. define([PREFIX], [C])
  2737. ],
  2738. [C++], [
  2739. define([PREFIX], [CXX])
  2740. ]
  2741. )
  2742. [STRICT_]PREFIX[FLAGS]=""
  2743. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
  2744. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
  2745. # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
  2746. # activate it with -Werror, so we add it here explicitly.
  2747. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
  2748. if test "x$STRICT_COMPILE" = "xyes"; then
  2749. [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
  2750. AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
  2751. fi
  2752. AC_SUBST([STRICT_]PREFIX[FLAGS])
  2753. AC_SUBST([BASE_]PREFIX[FLAGS])
  2754. AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
  2755. ]) # XORG_STRICT_OPTION
  2756. # XORG_DEFAULT_OPTIONS
  2757. # --------------------
  2758. # Minimum version: 1.3.0
  2759. #
  2760. # Defines default options for X.Org modules.
  2761. #
  2762. AC_DEFUN([XORG_DEFAULT_OPTIONS], [
  2763. AC_REQUIRE([AC_PROG_INSTALL])
  2764. XORG_COMPILER_FLAGS
  2765. XORG_CWARNFLAGS
  2766. XORG_STRICT_OPTION
  2767. XORG_RELEASE_VERSION
  2768. XORG_CHANGELOG
  2769. XORG_INSTALL
  2770. XORG_MANPAGE_SECTIONS
  2771. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  2772. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  2773. ]) # XORG_DEFAULT_OPTIONS
  2774. # XORG_INSTALL()
  2775. # ----------------
  2776. # Minimum version: 1.4.0
  2777. #
  2778. # Defines the variable INSTALL_CMD as the command to copy
  2779. # INSTALL from $prefix/share/util-macros.
  2780. #
  2781. AC_DEFUN([XORG_INSTALL], [
  2782. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  2783. macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
  2784. INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
  2785. mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
  2786. || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
  2787. echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
  2788. AC_SUBST([INSTALL_CMD])
  2789. ]) # XORG_INSTALL
  2790. dnl Copyright 2005 Red Hat, Inc
  2791. dnl
  2792. dnl Permission to use, copy, modify, distribute, and sell this software and its
  2793. dnl documentation for any purpose is hereby granted without fee, provided that
  2794. dnl the above copyright notice appear in all copies and that both that
  2795. dnl copyright notice and this permission notice appear in supporting
  2796. dnl documentation.
  2797. dnl
  2798. dnl The above copyright notice and this permission notice shall be included
  2799. dnl in all copies or substantial portions of the Software.
  2800. dnl
  2801. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  2802. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  2803. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  2804. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  2805. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  2806. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  2807. dnl OTHER DEALINGS IN THE SOFTWARE.
  2808. dnl
  2809. dnl Except as contained in this notice, the name of the copyright holders shall
  2810. dnl not be used in advertising or otherwise to promote the sale, use or
  2811. dnl other dealings in this Software without prior written authorization
  2812. dnl from the copyright holders.
  2813. dnl
  2814. # XORG_RELEASE_VERSION
  2815. # --------------------
  2816. # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
  2817. AC_DEFUN([XORG_RELEASE_VERSION],[
  2818. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
  2819. [`echo $PACKAGE_VERSION | cut -d . -f 1`],
  2820. [Major version of this package])
  2821. PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
  2822. if test "x$PVM" = "x"; then
  2823. PVM="0"
  2824. fi
  2825. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
  2826. [$PVM],
  2827. [Minor version of this package])
  2828. PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
  2829. if test "x$PVP" = "x"; then
  2830. PVP="0"
  2831. fi
  2832. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
  2833. [$PVP],
  2834. [Patch version of this package])
  2835. ])
  2836. # XORG_CHANGELOG()
  2837. # ----------------
  2838. # Minimum version: 1.2.0
  2839. #
  2840. # Defines the variable CHANGELOG_CMD as the command to generate
  2841. # ChangeLog from git.
  2842. #
  2843. #
  2844. AC_DEFUN([XORG_CHANGELOG], [
  2845. CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
  2846. mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
  2847. || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
  2848. echo 'git directory not found: installing possibly empty changelog.' >&2)"
  2849. AC_SUBST([CHANGELOG_CMD])
  2850. ]) # XORG_CHANGELOG