aclocal.m4 111 KB

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