aclocal.m4 133 KB

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