aclocal.m4 163 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445
  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. # iconv.m4 serial 18 (gettext-0.18.2)
  18. dnl Copyright (C) 2000-2002, 2007-2012 Free Software Foundation, Inc.
  19. dnl This file is free software; the Free Software Foundation
  20. dnl gives unlimited permission to copy and/or distribute it,
  21. dnl with or without modifications, as long as this notice is preserved.
  22. dnl From Bruno Haible.
  23. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
  24. [
  25. dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  26. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  27. AC_REQUIRE([AC_LIB_RPATH])
  28. dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  29. dnl accordingly.
  30. AC_LIB_LINKFLAGS_BODY([iconv])
  31. ])
  32. AC_DEFUN([AM_ICONV_LINK],
  33. [
  34. dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  35. dnl those with the standalone portable GNU libiconv installed).
  36. AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
  37. dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  38. dnl accordingly.
  39. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  40. dnl Add $INCICONV to CPPFLAGS before performing the following checks,
  41. dnl because if the user has installed libiconv and not disabled its use
  42. dnl via --without-libiconv-prefix, he wants to use it. The first
  43. dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
  44. am_save_CPPFLAGS="$CPPFLAGS"
  45. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
  46. AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
  47. am_cv_func_iconv="no, consider installing GNU libiconv"
  48. am_cv_lib_iconv=no
  49. AC_LINK_IFELSE(
  50. [AC_LANG_PROGRAM(
  51. [[
  52. #include <stdlib.h>
  53. #include <iconv.h>
  54. ]],
  55. [[iconv_t cd = iconv_open("","");
  56. iconv(cd,NULL,NULL,NULL,NULL);
  57. iconv_close(cd);]])],
  58. [am_cv_func_iconv=yes])
  59. if test "$am_cv_func_iconv" != yes; then
  60. am_save_LIBS="$LIBS"
  61. LIBS="$LIBS $LIBICONV"
  62. AC_LINK_IFELSE(
  63. [AC_LANG_PROGRAM(
  64. [[
  65. #include <stdlib.h>
  66. #include <iconv.h>
  67. ]],
  68. [[iconv_t cd = iconv_open("","");
  69. iconv(cd,NULL,NULL,NULL,NULL);
  70. iconv_close(cd);]])],
  71. [am_cv_lib_iconv=yes]
  72. [am_cv_func_iconv=yes])
  73. LIBS="$am_save_LIBS"
  74. fi
  75. ])
  76. if test "$am_cv_func_iconv" = yes; then
  77. AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
  78. dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
  79. dnl Solaris 10.
  80. am_save_LIBS="$LIBS"
  81. if test $am_cv_lib_iconv = yes; then
  82. LIBS="$LIBS $LIBICONV"
  83. fi
  84. AC_RUN_IFELSE(
  85. [AC_LANG_SOURCE([[
  86. #include <iconv.h>
  87. #include <string.h>
  88. int main ()
  89. {
  90. int result = 0;
  91. /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
  92. returns. */
  93. {
  94. iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
  95. if (cd_utf8_to_88591 != (iconv_t)(-1))
  96. {
  97. static const char input[] = "\342\202\254"; /* EURO SIGN */
  98. char buf[10];
  99. const char *inptr = input;
  100. size_t inbytesleft = strlen (input);
  101. char *outptr = buf;
  102. size_t outbytesleft = sizeof (buf);
  103. size_t res = iconv (cd_utf8_to_88591,
  104. (char **) &inptr, &inbytesleft,
  105. &outptr, &outbytesleft);
  106. if (res == 0)
  107. result |= 1;
  108. iconv_close (cd_utf8_to_88591);
  109. }
  110. }
  111. /* Test against Solaris 10 bug: Failures are not distinguishable from
  112. successful returns. */
  113. {
  114. iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
  115. if (cd_ascii_to_88591 != (iconv_t)(-1))
  116. {
  117. static const char input[] = "\263";
  118. char buf[10];
  119. const char *inptr = input;
  120. size_t inbytesleft = strlen (input);
  121. char *outptr = buf;
  122. size_t outbytesleft = sizeof (buf);
  123. size_t res = iconv (cd_ascii_to_88591,
  124. (char **) &inptr, &inbytesleft,
  125. &outptr, &outbytesleft);
  126. if (res == 0)
  127. result |= 2;
  128. iconv_close (cd_ascii_to_88591);
  129. }
  130. }
  131. /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
  132. {
  133. iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
  134. if (cd_88591_to_utf8 != (iconv_t)(-1))
  135. {
  136. static const char input[] = "\304";
  137. static char buf[2] = { (char)0xDE, (char)0xAD };
  138. const char *inptr = input;
  139. size_t inbytesleft = 1;
  140. char *outptr = buf;
  141. size_t outbytesleft = 1;
  142. size_t res = iconv (cd_88591_to_utf8,
  143. (char **) &inptr, &inbytesleft,
  144. &outptr, &outbytesleft);
  145. if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
  146. result |= 4;
  147. iconv_close (cd_88591_to_utf8);
  148. }
  149. }
  150. #if 0 /* This bug could be worked around by the caller. */
  151. /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
  152. {
  153. iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
  154. if (cd_88591_to_utf8 != (iconv_t)(-1))
  155. {
  156. static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
  157. char buf[50];
  158. const char *inptr = input;
  159. size_t inbytesleft = strlen (input);
  160. char *outptr = buf;
  161. size_t outbytesleft = sizeof (buf);
  162. size_t res = iconv (cd_88591_to_utf8,
  163. (char **) &inptr, &inbytesleft,
  164. &outptr, &outbytesleft);
  165. if ((int)res > 0)
  166. result |= 8;
  167. iconv_close (cd_88591_to_utf8);
  168. }
  169. }
  170. #endif
  171. /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
  172. provided. */
  173. if (/* Try standardized names. */
  174. iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
  175. /* Try IRIX, OSF/1 names. */
  176. && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
  177. /* Try AIX names. */
  178. && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
  179. /* Try HP-UX names. */
  180. && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
  181. result |= 16;
  182. return result;
  183. }]])],
  184. [am_cv_func_iconv_works=yes],
  185. [am_cv_func_iconv_works=no],
  186. [
  187. changequote(,)dnl
  188. case "$host_os" in
  189. aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
  190. *) am_cv_func_iconv_works="guessing yes" ;;
  191. esac
  192. changequote([,])dnl
  193. ])
  194. LIBS="$am_save_LIBS"
  195. ])
  196. case "$am_cv_func_iconv_works" in
  197. *no) am_func_iconv=no am_cv_lib_iconv=no ;;
  198. *) am_func_iconv=yes ;;
  199. esac
  200. else
  201. am_func_iconv=no am_cv_lib_iconv=no
  202. fi
  203. if test "$am_func_iconv" = yes; then
  204. AC_DEFINE([HAVE_ICONV], [1],
  205. [Define if you have the iconv() function and it works.])
  206. fi
  207. if test "$am_cv_lib_iconv" = yes; then
  208. AC_MSG_CHECKING([how to link with libiconv])
  209. AC_MSG_RESULT([$LIBICONV])
  210. else
  211. dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
  212. dnl either.
  213. CPPFLAGS="$am_save_CPPFLAGS"
  214. LIBICONV=
  215. LTLIBICONV=
  216. fi
  217. AC_SUBST([LIBICONV])
  218. AC_SUBST([LTLIBICONV])
  219. ])
  220. dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
  221. dnl avoid warnings like
  222. dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
  223. dnl This is tricky because of the way 'aclocal' is implemented:
  224. dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
  225. dnl Otherwise aclocal's initial scan pass would miss the macro definition.
  226. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
  227. dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
  228. dnl warnings.
  229. m4_define([gl_iconv_AC_DEFUN],
  230. m4_version_prereq([2.64],
  231. [[AC_DEFUN_ONCE(
  232. [$1], [$2])]],
  233. [m4_ifdef([gl_00GNULIB],
  234. [[AC_DEFUN_ONCE(
  235. [$1], [$2])]],
  236. [[AC_DEFUN(
  237. [$1], [$2])]])]))
  238. gl_iconv_AC_DEFUN([AM_ICONV],
  239. [
  240. AM_ICONV_LINK
  241. if test "$am_cv_func_iconv" = yes; then
  242. AC_MSG_CHECKING([for iconv declaration])
  243. AC_CACHE_VAL([am_cv_proto_iconv], [
  244. AC_COMPILE_IFELSE(
  245. [AC_LANG_PROGRAM(
  246. [[
  247. #include <stdlib.h>
  248. #include <iconv.h>
  249. extern
  250. #ifdef __cplusplus
  251. "C"
  252. #endif
  253. #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
  254. size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  255. #else
  256. size_t iconv();
  257. #endif
  258. ]],
  259. [[]])],
  260. [am_cv_proto_iconv_arg1=""],
  261. [am_cv_proto_iconv_arg1="const"])
  262. am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
  263. am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
  264. AC_MSG_RESULT([
  265. $am_cv_proto_iconv])
  266. AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
  267. [Define as const if the declaration of iconv() needs const.])
  268. dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
  269. m4_ifdef([gl_ICONV_H_DEFAULTS],
  270. [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
  271. if test -n "$am_cv_proto_iconv_arg1"; then
  272. ICONV_CONST="const"
  273. fi
  274. ])
  275. fi
  276. ])
  277. # lib-ld.m4 serial 6
  278. dnl Copyright (C) 1996-2003, 2009-2012 Free Software Foundation, Inc.
  279. dnl This file is free software; the Free Software Foundation
  280. dnl gives unlimited permission to copy and/or distribute it,
  281. dnl with or without modifications, as long as this notice is preserved.
  282. dnl Subroutines of libtool.m4,
  283. dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
  284. dnl collision with libtool.m4.
  285. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
  286. AC_DEFUN([AC_LIB_PROG_LD_GNU],
  287. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
  288. [# I'd rather use --version here, but apparently some GNU lds only accept -v.
  289. case `$LD -v 2>&1 </dev/null` in
  290. *GNU* | *'with BFD'*)
  291. acl_cv_prog_gnu_ld=yes
  292. ;;
  293. *)
  294. acl_cv_prog_gnu_ld=no
  295. ;;
  296. esac])
  297. with_gnu_ld=$acl_cv_prog_gnu_ld
  298. ])
  299. dnl From libtool-2.4. Sets the variable LD.
  300. AC_DEFUN([AC_LIB_PROG_LD],
  301. [AC_REQUIRE([AC_PROG_CC])dnl
  302. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  303. AC_ARG_WITH([gnu-ld],
  304. [AS_HELP_STRING([--with-gnu-ld],
  305. [assume the C compiler uses GNU ld [default=no]])],
  306. [test "$withval" = no || with_gnu_ld=yes],
  307. [with_gnu_ld=no])dnl
  308. # Prepare PATH_SEPARATOR.
  309. # The user is always right.
  310. if test "${PATH_SEPARATOR+set}" != set; then
  311. # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
  312. # contains only /bin. Note that ksh looks also at the FPATH variable,
  313. # so we have to set that as well for the test.
  314. PATH_SEPARATOR=:
  315. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  316. && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  317. || PATH_SEPARATOR=';'
  318. }
  319. fi
  320. ac_prog=ld
  321. if test "$GCC" = yes; then
  322. # Check if gcc -print-prog-name=ld gives a path.
  323. AC_MSG_CHECKING([for ld used by $CC])
  324. case $host in
  325. *-*-mingw*)
  326. # gcc leaves a trailing carriage return which upsets mingw
  327. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  328. *)
  329. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  330. esac
  331. case $ac_prog in
  332. # Accept absolute paths.
  333. [[\\/]]* | ?:[[\\/]]*)
  334. re_direlt='/[[^/]][[^/]]*/\.\./'
  335. # Canonicalize the pathname of ld
  336. ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
  337. while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
  338. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  339. done
  340. test -z "$LD" && LD="$ac_prog"
  341. ;;
  342. "")
  343. # If it fails, then pretend we aren't using GCC.
  344. ac_prog=ld
  345. ;;
  346. *)
  347. # If it is relative, then search for the first ld in PATH.
  348. with_gnu_ld=unknown
  349. ;;
  350. esac
  351. elif test "$with_gnu_ld" = yes; then
  352. AC_MSG_CHECKING([for GNU ld])
  353. else
  354. AC_MSG_CHECKING([for non-GNU ld])
  355. fi
  356. AC_CACHE_VAL([acl_cv_path_LD],
  357. [if test -z "$LD"; then
  358. acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  359. for ac_dir in $PATH; do
  360. IFS="$acl_save_ifs"
  361. test -z "$ac_dir" && ac_dir=.
  362. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  363. acl_cv_path_LD="$ac_dir/$ac_prog"
  364. # Check to see if the program is GNU ld. I'd rather use --version,
  365. # but apparently some variants of GNU ld only accept -v.
  366. # Break only if it was the GNU/non-GNU ld that we prefer.
  367. case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
  368. *GNU* | *'with BFD'*)
  369. test "$with_gnu_ld" != no && break
  370. ;;
  371. *)
  372. test "$with_gnu_ld" != yes && break
  373. ;;
  374. esac
  375. fi
  376. done
  377. IFS="$acl_save_ifs"
  378. else
  379. acl_cv_path_LD="$LD" # Let the user override the test with a path.
  380. fi])
  381. LD="$acl_cv_path_LD"
  382. if test -n "$LD"; then
  383. AC_MSG_RESULT([$LD])
  384. else
  385. AC_MSG_RESULT([no])
  386. fi
  387. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  388. AC_LIB_PROG_LD_GNU
  389. ])
  390. # lib-link.m4 serial 26 (gettext-0.18.2)
  391. dnl Copyright (C) 2001-2012 Free Software Foundation, Inc.
  392. dnl This file is free software; the Free Software Foundation
  393. dnl gives unlimited permission to copy and/or distribute it,
  394. dnl with or without modifications, as long as this notice is preserved.
  395. dnl From Bruno Haible.
  396. AC_PREREQ([2.54])
  397. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
  398. dnl the libraries corresponding to explicit and implicit dependencies.
  399. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
  400. dnl augments the CPPFLAGS variable.
  401. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
  402. dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  403. AC_DEFUN([AC_LIB_LINKFLAGS],
  404. [
  405. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  406. AC_REQUIRE([AC_LIB_RPATH])
  407. pushdef([Name],[m4_translit([$1],[./+-], [____])])
  408. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  409. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  410. AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
  411. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  412. ac_cv_lib[]Name[]_libs="$LIB[]NAME"
  413. ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
  414. ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
  415. ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
  416. ])
  417. LIB[]NAME="$ac_cv_lib[]Name[]_libs"
  418. LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
  419. INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
  420. LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
  421. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  422. AC_SUBST([LIB]NAME)
  423. AC_SUBST([LTLIB]NAME)
  424. AC_SUBST([LIB]NAME[_PREFIX])
  425. dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
  426. dnl results of this search when this library appears as a dependency.
  427. HAVE_LIB[]NAME=yes
  428. popdef([NAME])
  429. popdef([Name])
  430. ])
  431. dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
  432. dnl searches for libname and the libraries corresponding to explicit and
  433. dnl implicit dependencies, together with the specified include files and
  434. dnl the ability to compile and link the specified testcode. The missing-message
  435. dnl defaults to 'no' and may contain additional hints for the user.
  436. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
  437. dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
  438. dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
  439. dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
  440. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
  441. dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  442. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
  443. [
  444. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  445. AC_REQUIRE([AC_LIB_RPATH])
  446. pushdef([Name],[m4_translit([$1],[./+-], [____])])
  447. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  448. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  449. dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
  450. dnl accordingly.
  451. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  452. dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
  453. dnl because if the user has installed lib[]Name and not disabled its use
  454. dnl via --without-lib[]Name-prefix, he wants to use it.
  455. ac_save_CPPFLAGS="$CPPFLAGS"
  456. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  457. AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
  458. ac_save_LIBS="$LIBS"
  459. dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
  460. dnl because these -l options might require -L options that are present in
  461. dnl LIBS. -l options benefit only from the -L options listed before it.
  462. dnl Otherwise, add it to the front of LIBS, because it may be a static
  463. dnl library that depends on another static library that is present in LIBS.
  464. dnl Static libraries benefit only from the static libraries listed after
  465. dnl it.
  466. case " $LIB[]NAME" in
  467. *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
  468. *) LIBS="$LIB[]NAME $LIBS" ;;
  469. esac
  470. AC_LINK_IFELSE(
  471. [AC_LANG_PROGRAM([[$3]], [[$4]])],
  472. [ac_cv_lib[]Name=yes],
  473. [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
  474. LIBS="$ac_save_LIBS"
  475. ])
  476. if test "$ac_cv_lib[]Name" = yes; then
  477. HAVE_LIB[]NAME=yes
  478. AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
  479. AC_MSG_CHECKING([how to link with lib[]$1])
  480. AC_MSG_RESULT([$LIB[]NAME])
  481. else
  482. HAVE_LIB[]NAME=no
  483. dnl If $LIB[]NAME didn't lead to a usable library, we don't need
  484. dnl $INC[]NAME either.
  485. CPPFLAGS="$ac_save_CPPFLAGS"
  486. LIB[]NAME=
  487. LTLIB[]NAME=
  488. LIB[]NAME[]_PREFIX=
  489. fi
  490. AC_SUBST([HAVE_LIB]NAME)
  491. AC_SUBST([LIB]NAME)
  492. AC_SUBST([LTLIB]NAME)
  493. AC_SUBST([LIB]NAME[_PREFIX])
  494. popdef([NAME])
  495. popdef([Name])
  496. ])
  497. dnl Determine the platform dependent parameters needed to use rpath:
  498. dnl acl_libext,
  499. dnl acl_shlibext,
  500. dnl acl_libname_spec,
  501. dnl acl_library_names_spec,
  502. dnl acl_hardcode_libdir_flag_spec,
  503. dnl acl_hardcode_libdir_separator,
  504. dnl acl_hardcode_direct,
  505. dnl acl_hardcode_minus_L.
  506. AC_DEFUN([AC_LIB_RPATH],
  507. [
  508. dnl Tell automake >= 1.10 to complain if config.rpath is missing.
  509. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
  510. AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
  511. AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
  512. AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
  513. AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
  514. AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
  515. CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
  516. ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
  517. . ./conftest.sh
  518. rm -f ./conftest.sh
  519. acl_cv_rpath=done
  520. ])
  521. wl="$acl_cv_wl"
  522. acl_libext="$acl_cv_libext"
  523. acl_shlibext="$acl_cv_shlibext"
  524. acl_libname_spec="$acl_cv_libname_spec"
  525. acl_library_names_spec="$acl_cv_library_names_spec"
  526. acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
  527. acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
  528. acl_hardcode_direct="$acl_cv_hardcode_direct"
  529. acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
  530. dnl Determine whether the user wants rpath handling at all.
  531. AC_ARG_ENABLE([rpath],
  532. [ --disable-rpath do not hardcode runtime library paths],
  533. :, enable_rpath=yes)
  534. ])
  535. dnl AC_LIB_FROMPACKAGE(name, package)
  536. dnl declares that libname comes from the given package. The configure file
  537. dnl will then not have a --with-libname-prefix option but a
  538. dnl --with-package-prefix option. Several libraries can come from the same
  539. dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
  540. dnl macro call that searches for libname.
  541. AC_DEFUN([AC_LIB_FROMPACKAGE],
  542. [
  543. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  544. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  545. define([acl_frompackage_]NAME, [$2])
  546. popdef([NAME])
  547. pushdef([PACK],[$2])
  548. pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
  549. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  550. define([acl_libsinpackage_]PACKUP,
  551. m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
  552. popdef([PACKUP])
  553. popdef([PACK])
  554. ])
  555. dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
  556. dnl the libraries corresponding to explicit and implicit dependencies.
  557. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
  558. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
  559. dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  560. AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  561. [
  562. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  563. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  564. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  565. pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
  566. pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
  567. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  568. pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
  569. dnl Autoconf >= 2.61 supports dots in --with options.
  570. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
  571. dnl By default, look in $includedir and $libdir.
  572. use_additional=yes
  573. AC_LIB_WITH_FINAL_PREFIX([
  574. eval additional_includedir=\"$includedir\"
  575. eval additional_libdir=\"$libdir\"
  576. ])
  577. AC_ARG_WITH(P_A_C_K[-prefix],
  578. [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
  579. --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
  580. [
  581. if test "X$withval" = "Xno"; then
  582. use_additional=no
  583. else
  584. if test "X$withval" = "X"; then
  585. AC_LIB_WITH_FINAL_PREFIX([
  586. eval additional_includedir=\"$includedir\"
  587. eval additional_libdir=\"$libdir\"
  588. ])
  589. else
  590. additional_includedir="$withval/include"
  591. additional_libdir="$withval/$acl_libdirstem"
  592. if test "$acl_libdirstem2" != "$acl_libdirstem" \
  593. && ! test -d "$withval/$acl_libdirstem"; then
  594. additional_libdir="$withval/$acl_libdirstem2"
  595. fi
  596. fi
  597. fi
  598. ])
  599. dnl Search the library and its dependencies in $additional_libdir and
  600. dnl $LDFLAGS. Using breadth-first-seach.
  601. LIB[]NAME=
  602. LTLIB[]NAME=
  603. INC[]NAME=
  604. LIB[]NAME[]_PREFIX=
  605. dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
  606. dnl computed. So it has to be reset here.
  607. HAVE_LIB[]NAME=
  608. rpathdirs=
  609. ltrpathdirs=
  610. names_already_handled=
  611. names_next_round='$1 $2'
  612. while test -n "$names_next_round"; do
  613. names_this_round="$names_next_round"
  614. names_next_round=
  615. for name in $names_this_round; do
  616. already_handled=
  617. for n in $names_already_handled; do
  618. if test "$n" = "$name"; then
  619. already_handled=yes
  620. break
  621. fi
  622. done
  623. if test -z "$already_handled"; then
  624. names_already_handled="$names_already_handled $name"
  625. dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
  626. dnl or AC_LIB_HAVE_LINKFLAGS call.
  627. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
  628. eval value=\"\$HAVE_LIB$uppername\"
  629. if test -n "$value"; then
  630. if test "$value" = yes; then
  631. eval value=\"\$LIB$uppername\"
  632. test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
  633. eval value=\"\$LTLIB$uppername\"
  634. test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
  635. else
  636. dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
  637. dnl that this library doesn't exist. So just drop it.
  638. :
  639. fi
  640. else
  641. dnl Search the library lib$name in $additional_libdir and $LDFLAGS
  642. dnl and the already constructed $LIBNAME/$LTLIBNAME.
  643. found_dir=
  644. found_la=
  645. found_so=
  646. found_a=
  647. eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
  648. if test -n "$acl_shlibext"; then
  649. shrext=".$acl_shlibext" # typically: shrext=.so
  650. else
  651. shrext=
  652. fi
  653. if test $use_additional = yes; then
  654. dir="$additional_libdir"
  655. dnl The same code as in the loop below:
  656. dnl First look for a shared library.
  657. if test -n "$acl_shlibext"; then
  658. if test -f "$dir/$libname$shrext"; then
  659. found_dir="$dir"
  660. found_so="$dir/$libname$shrext"
  661. else
  662. if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
  663. ver=`(cd "$dir" && \
  664. for f in "$libname$shrext".*; do echo "$f"; done \
  665. | sed -e "s,^$libname$shrext\\\\.,," \
  666. | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
  667. | sed 1q ) 2>/dev/null`
  668. if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
  669. found_dir="$dir"
  670. found_so="$dir/$libname$shrext.$ver"
  671. fi
  672. else
  673. eval library_names=\"$acl_library_names_spec\"
  674. for f in $library_names; do
  675. if test -f "$dir/$f"; then
  676. found_dir="$dir"
  677. found_so="$dir/$f"
  678. break
  679. fi
  680. done
  681. fi
  682. fi
  683. fi
  684. dnl Then look for a static library.
  685. if test "X$found_dir" = "X"; then
  686. if test -f "$dir/$libname.$acl_libext"; then
  687. found_dir="$dir"
  688. found_a="$dir/$libname.$acl_libext"
  689. fi
  690. fi
  691. if test "X$found_dir" != "X"; then
  692. if test -f "$dir/$libname.la"; then
  693. found_la="$dir/$libname.la"
  694. fi
  695. fi
  696. fi
  697. if test "X$found_dir" = "X"; then
  698. for x in $LDFLAGS $LTLIB[]NAME; do
  699. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  700. case "$x" in
  701. -L*)
  702. dir=`echo "X$x" | sed -e 's/^X-L//'`
  703. dnl First look for a shared library.
  704. if test -n "$acl_shlibext"; then
  705. if test -f "$dir/$libname$shrext"; then
  706. found_dir="$dir"
  707. found_so="$dir/$libname$shrext"
  708. else
  709. if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
  710. ver=`(cd "$dir" && \
  711. for f in "$libname$shrext".*; do echo "$f"; done \
  712. | sed -e "s,^$libname$shrext\\\\.,," \
  713. | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
  714. | sed 1q ) 2>/dev/null`
  715. if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
  716. found_dir="$dir"
  717. found_so="$dir/$libname$shrext.$ver"
  718. fi
  719. else
  720. eval library_names=\"$acl_library_names_spec\"
  721. for f in $library_names; do
  722. if test -f "$dir/$f"; then
  723. found_dir="$dir"
  724. found_so="$dir/$f"
  725. break
  726. fi
  727. done
  728. fi
  729. fi
  730. fi
  731. dnl Then look for a static library.
  732. if test "X$found_dir" = "X"; then
  733. if test -f "$dir/$libname.$acl_libext"; then
  734. found_dir="$dir"
  735. found_a="$dir/$libname.$acl_libext"
  736. fi
  737. fi
  738. if test "X$found_dir" != "X"; then
  739. if test -f "$dir/$libname.la"; then
  740. found_la="$dir/$libname.la"
  741. fi
  742. fi
  743. ;;
  744. esac
  745. if test "X$found_dir" != "X"; then
  746. break
  747. fi
  748. done
  749. fi
  750. if test "X$found_dir" != "X"; then
  751. dnl Found the library.
  752. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
  753. if test "X$found_so" != "X"; then
  754. dnl Linking with a shared library. We attempt to hardcode its
  755. dnl directory into the executable's runpath, unless it's the
  756. dnl standard /usr/lib.
  757. if test "$enable_rpath" = no \
  758. || test "X$found_dir" = "X/usr/$acl_libdirstem" \
  759. || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
  760. dnl No hardcoding is needed.
  761. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  762. else
  763. dnl Use an explicit option to hardcode DIR into the resulting
  764. dnl binary.
  765. dnl Potentially add DIR to ltrpathdirs.
  766. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  767. haveit=
  768. for x in $ltrpathdirs; do
  769. if test "X$x" = "X$found_dir"; then
  770. haveit=yes
  771. break
  772. fi
  773. done
  774. if test -z "$haveit"; then
  775. ltrpathdirs="$ltrpathdirs $found_dir"
  776. fi
  777. dnl The hardcoding into $LIBNAME is system dependent.
  778. if test "$acl_hardcode_direct" = yes; then
  779. dnl Using DIR/libNAME.so during linking hardcodes DIR into the
  780. dnl resulting binary.
  781. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  782. else
  783. if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
  784. dnl Use an explicit option to hardcode DIR into the resulting
  785. dnl binary.
  786. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  787. dnl Potentially add DIR to rpathdirs.
  788. dnl The rpathdirs will be appended to $LIBNAME at the end.
  789. haveit=
  790. for x in $rpathdirs; do
  791. if test "X$x" = "X$found_dir"; then
  792. haveit=yes
  793. break
  794. fi
  795. done
  796. if test -z "$haveit"; then
  797. rpathdirs="$rpathdirs $found_dir"
  798. fi
  799. else
  800. dnl Rely on "-L$found_dir".
  801. dnl But don't add it if it's already contained in the LDFLAGS
  802. dnl or the already constructed $LIBNAME
  803. haveit=
  804. for x in $LDFLAGS $LIB[]NAME; do
  805. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  806. if test "X$x" = "X-L$found_dir"; then
  807. haveit=yes
  808. break
  809. fi
  810. done
  811. if test -z "$haveit"; then
  812. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
  813. fi
  814. if test "$acl_hardcode_minus_L" != no; then
  815. dnl FIXME: Not sure whether we should use
  816. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  817. dnl here.
  818. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  819. else
  820. dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
  821. dnl here, because this doesn't fit in flags passed to the
  822. dnl compiler. So give up. No hardcoding. This affects only
  823. dnl very old systems.
  824. dnl FIXME: Not sure whether we should use
  825. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  826. dnl here.
  827. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  828. fi
  829. fi
  830. fi
  831. fi
  832. else
  833. if test "X$found_a" != "X"; then
  834. dnl Linking with a static library.
  835. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
  836. else
  837. dnl We shouldn't come here, but anyway it's good to have a
  838. dnl fallback.
  839. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
  840. fi
  841. fi
  842. dnl Assume the include files are nearby.
  843. additional_includedir=
  844. case "$found_dir" in
  845. */$acl_libdirstem | */$acl_libdirstem/)
  846. basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
  847. if test "$name" = '$1'; then
  848. LIB[]NAME[]_PREFIX="$basedir"
  849. fi
  850. additional_includedir="$basedir/include"
  851. ;;
  852. */$acl_libdirstem2 | */$acl_libdirstem2/)
  853. basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
  854. if test "$name" = '$1'; then
  855. LIB[]NAME[]_PREFIX="$basedir"
  856. fi
  857. additional_includedir="$basedir/include"
  858. ;;
  859. esac
  860. if test "X$additional_includedir" != "X"; then
  861. dnl Potentially add $additional_includedir to $INCNAME.
  862. dnl But don't add it
  863. dnl 1. if it's the standard /usr/include,
  864. dnl 2. if it's /usr/local/include and we are using GCC on Linux,
  865. dnl 3. if it's already present in $CPPFLAGS or the already
  866. dnl constructed $INCNAME,
  867. dnl 4. if it doesn't exist as a directory.
  868. if test "X$additional_includedir" != "X/usr/include"; then
  869. haveit=
  870. if test "X$additional_includedir" = "X/usr/local/include"; then
  871. if test -n "$GCC"; then
  872. case $host_os in
  873. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  874. esac
  875. fi
  876. fi
  877. if test -z "$haveit"; then
  878. for x in $CPPFLAGS $INC[]NAME; do
  879. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  880. if test "X$x" = "X-I$additional_includedir"; then
  881. haveit=yes
  882. break
  883. fi
  884. done
  885. if test -z "$haveit"; then
  886. if test -d "$additional_includedir"; then
  887. dnl Really add $additional_includedir to $INCNAME.
  888. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
  889. fi
  890. fi
  891. fi
  892. fi
  893. fi
  894. dnl Look for dependencies.
  895. if test -n "$found_la"; then
  896. dnl Read the .la file. It defines the variables
  897. dnl dlname, library_names, old_library, dependency_libs, current,
  898. dnl age, revision, installed, dlopen, dlpreopen, libdir.
  899. save_libdir="$libdir"
  900. case "$found_la" in
  901. */* | *\\*) . "$found_la" ;;
  902. *) . "./$found_la" ;;
  903. esac
  904. libdir="$save_libdir"
  905. dnl We use only dependency_libs.
  906. for dep in $dependency_libs; do
  907. case "$dep" in
  908. -L*)
  909. additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
  910. dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
  911. dnl But don't add it
  912. dnl 1. if it's the standard /usr/lib,
  913. dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
  914. dnl 3. if it's already present in $LDFLAGS or the already
  915. dnl constructed $LIBNAME,
  916. dnl 4. if it doesn't exist as a directory.
  917. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
  918. && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
  919. haveit=
  920. if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
  921. || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
  922. if test -n "$GCC"; then
  923. case $host_os in
  924. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  925. esac
  926. fi
  927. fi
  928. if test -z "$haveit"; then
  929. haveit=
  930. for x in $LDFLAGS $LIB[]NAME; do
  931. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  932. if test "X$x" = "X-L$additional_libdir"; then
  933. haveit=yes
  934. break
  935. fi
  936. done
  937. if test -z "$haveit"; then
  938. if test -d "$additional_libdir"; then
  939. dnl Really add $additional_libdir to $LIBNAME.
  940. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
  941. fi
  942. fi
  943. haveit=
  944. for x in $LDFLAGS $LTLIB[]NAME; do
  945. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  946. if test "X$x" = "X-L$additional_libdir"; then
  947. haveit=yes
  948. break
  949. fi
  950. done
  951. if test -z "$haveit"; then
  952. if test -d "$additional_libdir"; then
  953. dnl Really add $additional_libdir to $LTLIBNAME.
  954. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
  955. fi
  956. fi
  957. fi
  958. fi
  959. ;;
  960. -R*)
  961. dir=`echo "X$dep" | sed -e 's/^X-R//'`
  962. if test "$enable_rpath" != no; then
  963. dnl Potentially add DIR to rpathdirs.
  964. dnl The rpathdirs will be appended to $LIBNAME at the end.
  965. haveit=
  966. for x in $rpathdirs; do
  967. if test "X$x" = "X$dir"; then
  968. haveit=yes
  969. break
  970. fi
  971. done
  972. if test -z "$haveit"; then
  973. rpathdirs="$rpathdirs $dir"
  974. fi
  975. dnl Potentially add DIR to ltrpathdirs.
  976. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  977. haveit=
  978. for x in $ltrpathdirs; do
  979. if test "X$x" = "X$dir"; then
  980. haveit=yes
  981. break
  982. fi
  983. done
  984. if test -z "$haveit"; then
  985. ltrpathdirs="$ltrpathdirs $dir"
  986. fi
  987. fi
  988. ;;
  989. -l*)
  990. dnl Handle this in the next round.
  991. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
  992. ;;
  993. *.la)
  994. dnl Handle this in the next round. Throw away the .la's
  995. dnl directory; it is already contained in a preceding -L
  996. dnl option.
  997. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
  998. ;;
  999. *)
  1000. dnl Most likely an immediate library name.
  1001. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
  1002. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
  1003. ;;
  1004. esac
  1005. done
  1006. fi
  1007. else
  1008. dnl Didn't find the library; assume it is in the system directories
  1009. dnl known to the linker and runtime loader. (All the system
  1010. dnl directories known to the linker should also be known to the
  1011. dnl runtime loader, otherwise the system is severely misconfigured.)
  1012. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  1013. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
  1014. fi
  1015. fi
  1016. fi
  1017. done
  1018. done
  1019. if test "X$rpathdirs" != "X"; then
  1020. if test -n "$acl_hardcode_libdir_separator"; then
  1021. dnl Weird platform: only the last -rpath option counts, the user must
  1022. dnl pass all path elements in one option. We can arrange that for a
  1023. dnl single library, but not when more than one $LIBNAMEs are used.
  1024. alldirs=
  1025. for found_dir in $rpathdirs; do
  1026. alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
  1027. done
  1028. dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
  1029. acl_save_libdir="$libdir"
  1030. libdir="$alldirs"
  1031. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  1032. libdir="$acl_save_libdir"
  1033. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  1034. else
  1035. dnl The -rpath options are cumulative.
  1036. for found_dir in $rpathdirs; do
  1037. acl_save_libdir="$libdir"
  1038. libdir="$found_dir"
  1039. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  1040. libdir="$acl_save_libdir"
  1041. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  1042. done
  1043. fi
  1044. fi
  1045. if test "X$ltrpathdirs" != "X"; then
  1046. dnl When using libtool, the option that works for both libraries and
  1047. dnl executables is -R. The -R options are cumulative.
  1048. for found_dir in $ltrpathdirs; do
  1049. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
  1050. done
  1051. fi
  1052. popdef([P_A_C_K])
  1053. popdef([PACKLIBS])
  1054. popdef([PACKUP])
  1055. popdef([PACK])
  1056. popdef([NAME])
  1057. ])
  1058. dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
  1059. dnl unless already present in VAR.
  1060. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
  1061. dnl contains two or three consecutive elements that belong together.
  1062. AC_DEFUN([AC_LIB_APPENDTOVAR],
  1063. [
  1064. for element in [$2]; do
  1065. haveit=
  1066. for x in $[$1]; do
  1067. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1068. if test "X$x" = "X$element"; then
  1069. haveit=yes
  1070. break
  1071. fi
  1072. done
  1073. if test -z "$haveit"; then
  1074. [$1]="${[$1]}${[$1]:+ }$element"
  1075. fi
  1076. done
  1077. ])
  1078. dnl For those cases where a variable contains several -L and -l options
  1079. dnl referring to unknown libraries and directories, this macro determines the
  1080. dnl necessary additional linker options for the runtime path.
  1081. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
  1082. dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
  1083. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
  1084. dnl otherwise linking without libtool is assumed.
  1085. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
  1086. [
  1087. AC_REQUIRE([AC_LIB_RPATH])
  1088. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  1089. $1=
  1090. if test "$enable_rpath" != no; then
  1091. if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
  1092. dnl Use an explicit option to hardcode directories into the resulting
  1093. dnl binary.
  1094. rpathdirs=
  1095. next=
  1096. for opt in $2; do
  1097. if test -n "$next"; then
  1098. dir="$next"
  1099. dnl No need to hardcode the standard /usr/lib.
  1100. if test "X$dir" != "X/usr/$acl_libdirstem" \
  1101. && test "X$dir" != "X/usr/$acl_libdirstem2"; then
  1102. rpathdirs="$rpathdirs $dir"
  1103. fi
  1104. next=
  1105. else
  1106. case $opt in
  1107. -L) next=yes ;;
  1108. -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
  1109. dnl No need to hardcode the standard /usr/lib.
  1110. if test "X$dir" != "X/usr/$acl_libdirstem" \
  1111. && test "X$dir" != "X/usr/$acl_libdirstem2"; then
  1112. rpathdirs="$rpathdirs $dir"
  1113. fi
  1114. next= ;;
  1115. *) next= ;;
  1116. esac
  1117. fi
  1118. done
  1119. if test "X$rpathdirs" != "X"; then
  1120. if test -n ""$3""; then
  1121. dnl libtool is used for linking. Use -R options.
  1122. for dir in $rpathdirs; do
  1123. $1="${$1}${$1:+ }-R$dir"
  1124. done
  1125. else
  1126. dnl The linker is used for linking directly.
  1127. if test -n "$acl_hardcode_libdir_separator"; then
  1128. dnl Weird platform: only the last -rpath option counts, the user
  1129. dnl must pass all path elements in one option.
  1130. alldirs=
  1131. for dir in $rpathdirs; do
  1132. alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
  1133. done
  1134. acl_save_libdir="$libdir"
  1135. libdir="$alldirs"
  1136. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  1137. libdir="$acl_save_libdir"
  1138. $1="$flag"
  1139. else
  1140. dnl The -rpath options are cumulative.
  1141. for dir in $rpathdirs; do
  1142. acl_save_libdir="$libdir"
  1143. libdir="$dir"
  1144. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  1145. libdir="$acl_save_libdir"
  1146. $1="${$1}${$1:+ }$flag"
  1147. done
  1148. fi
  1149. fi
  1150. fi
  1151. fi
  1152. fi
  1153. AC_SUBST([$1])
  1154. ])
  1155. # lib-prefix.m4 serial 7 (gettext-0.18)
  1156. dnl Copyright (C) 2001-2005, 2008-2012 Free Software Foundation, Inc.
  1157. dnl This file is free software; the Free Software Foundation
  1158. dnl gives unlimited permission to copy and/or distribute it,
  1159. dnl with or without modifications, as long as this notice is preserved.
  1160. dnl From Bruno Haible.
  1161. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  1162. dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  1163. dnl require excessive bracketing.
  1164. ifdef([AC_HELP_STRING],
  1165. [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  1166. [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  1167. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  1168. dnl to access previously installed libraries. The basic assumption is that
  1169. dnl a user will want packages to use other packages he previously installed
  1170. dnl with the same --prefix option.
  1171. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  1172. dnl libraries, but is otherwise very convenient.
  1173. AC_DEFUN([AC_LIB_PREFIX],
  1174. [
  1175. AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  1176. AC_REQUIRE([AC_PROG_CC])
  1177. AC_REQUIRE([AC_CANONICAL_HOST])
  1178. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  1179. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  1180. dnl By default, look in $includedir and $libdir.
  1181. use_additional=yes
  1182. AC_LIB_WITH_FINAL_PREFIX([
  1183. eval additional_includedir=\"$includedir\"
  1184. eval additional_libdir=\"$libdir\"
  1185. ])
  1186. AC_LIB_ARG_WITH([lib-prefix],
  1187. [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  1188. --without-lib-prefix don't search for libraries in includedir and libdir],
  1189. [
  1190. if test "X$withval" = "Xno"; then
  1191. use_additional=no
  1192. else
  1193. if test "X$withval" = "X"; then
  1194. AC_LIB_WITH_FINAL_PREFIX([
  1195. eval additional_includedir=\"$includedir\"
  1196. eval additional_libdir=\"$libdir\"
  1197. ])
  1198. else
  1199. additional_includedir="$withval/include"
  1200. additional_libdir="$withval/$acl_libdirstem"
  1201. fi
  1202. fi
  1203. ])
  1204. if test $use_additional = yes; then
  1205. dnl Potentially add $additional_includedir to $CPPFLAGS.
  1206. dnl But don't add it
  1207. dnl 1. if it's the standard /usr/include,
  1208. dnl 2. if it's already present in $CPPFLAGS,
  1209. dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  1210. dnl 4. if it doesn't exist as a directory.
  1211. if test "X$additional_includedir" != "X/usr/include"; then
  1212. haveit=
  1213. for x in $CPPFLAGS; do
  1214. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1215. if test "X$x" = "X-I$additional_includedir"; then
  1216. haveit=yes
  1217. break
  1218. fi
  1219. done
  1220. if test -z "$haveit"; then
  1221. if test "X$additional_includedir" = "X/usr/local/include"; then
  1222. if test -n "$GCC"; then
  1223. case $host_os in
  1224. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  1225. esac
  1226. fi
  1227. fi
  1228. if test -z "$haveit"; then
  1229. if test -d "$additional_includedir"; then
  1230. dnl Really add $additional_includedir to $CPPFLAGS.
  1231. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  1232. fi
  1233. fi
  1234. fi
  1235. fi
  1236. dnl Potentially add $additional_libdir to $LDFLAGS.
  1237. dnl But don't add it
  1238. dnl 1. if it's the standard /usr/lib,
  1239. dnl 2. if it's already present in $LDFLAGS,
  1240. dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  1241. dnl 4. if it doesn't exist as a directory.
  1242. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
  1243. haveit=
  1244. for x in $LDFLAGS; do
  1245. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  1246. if test "X$x" = "X-L$additional_libdir"; then
  1247. haveit=yes
  1248. break
  1249. fi
  1250. done
  1251. if test -z "$haveit"; then
  1252. if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
  1253. if test -n "$GCC"; then
  1254. case $host_os in
  1255. linux*) haveit=yes;;
  1256. esac
  1257. fi
  1258. fi
  1259. if test -z "$haveit"; then
  1260. if test -d "$additional_libdir"; then
  1261. dnl Really add $additional_libdir to $LDFLAGS.
  1262. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  1263. fi
  1264. fi
  1265. fi
  1266. fi
  1267. fi
  1268. ])
  1269. dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  1270. dnl acl_final_exec_prefix, containing the values to which $prefix and
  1271. dnl $exec_prefix will expand at the end of the configure script.
  1272. AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  1273. [
  1274. dnl Unfortunately, prefix and exec_prefix get only finally determined
  1275. dnl at the end of configure.
  1276. if test "X$prefix" = "XNONE"; then
  1277. acl_final_prefix="$ac_default_prefix"
  1278. else
  1279. acl_final_prefix="$prefix"
  1280. fi
  1281. if test "X$exec_prefix" = "XNONE"; then
  1282. acl_final_exec_prefix='${prefix}'
  1283. else
  1284. acl_final_exec_prefix="$exec_prefix"
  1285. fi
  1286. acl_save_prefix="$prefix"
  1287. prefix="$acl_final_prefix"
  1288. eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  1289. prefix="$acl_save_prefix"
  1290. ])
  1291. dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  1292. dnl variables prefix and exec_prefix bound to the values they will have
  1293. dnl at the end of the configure script.
  1294. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  1295. [
  1296. acl_save_prefix="$prefix"
  1297. prefix="$acl_final_prefix"
  1298. acl_save_exec_prefix="$exec_prefix"
  1299. exec_prefix="$acl_final_exec_prefix"
  1300. $1
  1301. exec_prefix="$acl_save_exec_prefix"
  1302. prefix="$acl_save_prefix"
  1303. ])
  1304. dnl AC_LIB_PREPARE_MULTILIB creates
  1305. dnl - a variable acl_libdirstem, containing the basename of the libdir, either
  1306. dnl "lib" or "lib64" or "lib/64",
  1307. dnl - a variable acl_libdirstem2, as a secondary possible value for
  1308. dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
  1309. dnl "lib/amd64".
  1310. AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
  1311. [
  1312. dnl There is no formal standard regarding lib and lib64.
  1313. dnl On glibc systems, the current practice is that on a system supporting
  1314. dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  1315. dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
  1316. dnl the compiler's default mode by looking at the compiler's library search
  1317. dnl path. If at least one of its elements ends in /lib64 or points to a
  1318. dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
  1319. dnl Otherwise we use the default, namely "lib".
  1320. dnl On Solaris systems, the current practice is that on a system supporting
  1321. dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  1322. dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
  1323. dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
  1324. AC_REQUIRE([AC_CANONICAL_HOST])
  1325. acl_libdirstem=lib
  1326. acl_libdirstem2=
  1327. case "$host_os" in
  1328. solaris*)
  1329. dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
  1330. dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
  1331. dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
  1332. dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
  1333. dnl symlink is missing, so we set acl_libdirstem2 too.
  1334. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
  1335. [AC_EGREP_CPP([sixtyfour bits], [
  1336. #ifdef _LP64
  1337. sixtyfour bits
  1338. #endif
  1339. ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
  1340. ])
  1341. if test $gl_cv_solaris_64bit = yes; then
  1342. acl_libdirstem=lib/64
  1343. case "$host_cpu" in
  1344. sparc*) acl_libdirstem2=lib/sparcv9 ;;
  1345. i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
  1346. esac
  1347. fi
  1348. ;;
  1349. *)
  1350. searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  1351. if test -n "$searchpath"; then
  1352. acl_save_IFS="${IFS= }"; IFS=":"
  1353. for searchdir in $searchpath; do
  1354. if test -d "$searchdir"; then
  1355. case "$searchdir" in
  1356. */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  1357. */../ | */.. )
  1358. # Better ignore directories of this form. They are misleading.
  1359. ;;
  1360. *) searchdir=`cd "$searchdir" && pwd`
  1361. case "$searchdir" in
  1362. */lib64 ) acl_libdirstem=lib64 ;;
  1363. esac ;;
  1364. esac
  1365. fi
  1366. done
  1367. IFS="$acl_save_IFS"
  1368. fi
  1369. ;;
  1370. esac
  1371. test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
  1372. ])
  1373. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  1374. #
  1375. # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  1376. #
  1377. # This program is free software; you can redistribute it and/or modify
  1378. # it under the terms of the GNU General Public License as published by
  1379. # the Free Software Foundation; either version 2 of the License, or
  1380. # (at your option) any later version.
  1381. #
  1382. # This program is distributed in the hope that it will be useful, but
  1383. # WITHOUT ANY WARRANTY; without even the implied warranty of
  1384. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  1385. # General Public License for more details.
  1386. #
  1387. # You should have received a copy of the GNU General Public License
  1388. # along with this program; if not, write to the Free Software
  1389. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  1390. #
  1391. # As a special exception to the GNU General Public License, if you
  1392. # distribute this file as part of a program that contains a
  1393. # configuration script generated by Autoconf, you may include it under
  1394. # the same distribution terms that you use for the rest of that program.
  1395. # PKG_PROG_PKG_CONFIG([MIN-VERSION])
  1396. # ----------------------------------
  1397. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  1398. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  1399. m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
  1400. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
  1401. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  1402. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  1403. fi
  1404. if test -n "$PKG_CONFIG"; then
  1405. _pkg_min_version=m4_default([$1], [0.9.0])
  1406. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  1407. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  1408. AC_MSG_RESULT([yes])
  1409. else
  1410. AC_MSG_RESULT([no])
  1411. PKG_CONFIG=""
  1412. fi
  1413. fi[]dnl
  1414. ])# PKG_PROG_PKG_CONFIG
  1415. # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  1416. #
  1417. # Check to see whether a particular set of modules exists. Similar
  1418. # to PKG_CHECK_MODULES(), but does not set variables or print errors.
  1419. #
  1420. #
  1421. # Similar to PKG_CHECK_MODULES, make sure that the first instance of
  1422. # this or PKG_CHECK_MODULES is called, or make sure to call
  1423. # PKG_CHECK_EXISTS manually
  1424. # --------------------------------------------------------------
  1425. AC_DEFUN([PKG_CHECK_EXISTS],
  1426. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  1427. if test -n "$PKG_CONFIG" && \
  1428. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  1429. m4_ifval([$2], [$2], [:])
  1430. m4_ifvaln([$3], [else
  1431. $3])dnl
  1432. fi])
  1433. # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  1434. # ---------------------------------------------
  1435. m4_define([_PKG_CONFIG],
  1436. [if test -n "$PKG_CONFIG"; then
  1437. if test -n "$$1"; then
  1438. pkg_cv_[]$1="$$1"
  1439. else
  1440. PKG_CHECK_EXISTS([$3],
  1441. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
  1442. [pkg_failed=yes])
  1443. fi
  1444. else
  1445. pkg_failed=untried
  1446. fi[]dnl
  1447. ])# _PKG_CONFIG
  1448. # _PKG_SHORT_ERRORS_SUPPORTED
  1449. # -----------------------------
  1450. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  1451. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  1452. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  1453. _pkg_short_errors_supported=yes
  1454. else
  1455. _pkg_short_errors_supported=no
  1456. fi[]dnl
  1457. ])# _PKG_SHORT_ERRORS_SUPPORTED
  1458. # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  1459. # [ACTION-IF-NOT-FOUND])
  1460. #
  1461. #
  1462. # Note that if there is a possibility the first call to
  1463. # PKG_CHECK_MODULES might not happen, you should be sure to include an
  1464. # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  1465. #
  1466. #
  1467. # --------------------------------------------------------------
  1468. AC_DEFUN([PKG_CHECK_MODULES],
  1469. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  1470. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  1471. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  1472. pkg_failed=no
  1473. AC_MSG_CHECKING([for $1])
  1474. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  1475. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  1476. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  1477. and $1[]_LIBS to avoid the need to call pkg-config.
  1478. See the pkg-config man page for more details.])
  1479. if test $pkg_failed = yes; then
  1480. _PKG_SHORT_ERRORS_SUPPORTED
  1481. if test $_pkg_short_errors_supported = yes; then
  1482. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
  1483. else
  1484. $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
  1485. fi
  1486. # Put the nasty error message in config.log where it belongs
  1487. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  1488. ifelse([$4], , [AC_MSG_ERROR(dnl
  1489. [Package requirements ($2) were not met:
  1490. $$1_PKG_ERRORS
  1491. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  1492. installed software in a non-standard prefix.
  1493. _PKG_TEXT
  1494. ])],
  1495. [AC_MSG_RESULT([no])
  1496. $4])
  1497. elif test $pkg_failed = untried; then
  1498. ifelse([$4], , [AC_MSG_FAILURE(dnl
  1499. [The pkg-config script could not be found or is too old. Make sure it
  1500. is in your PATH or set the PKG_CONFIG environment variable to the full
  1501. path to pkg-config.
  1502. _PKG_TEXT
  1503. To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
  1504. [$4])
  1505. else
  1506. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  1507. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  1508. AC_MSG_RESULT([yes])
  1509. ifelse([$3], , :, [$3])
  1510. fi[]dnl
  1511. ])# PKG_CHECK_MODULES
  1512. # Copyright (C) 2002-2012 Free Software Foundation, Inc.
  1513. #
  1514. # This file is free software; the Free Software Foundation
  1515. # gives unlimited permission to copy and/or distribute it,
  1516. # with or without modifications, as long as this notice is preserved.
  1517. # AM_AUTOMAKE_VERSION(VERSION)
  1518. # ----------------------------
  1519. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  1520. # generated from the m4 files accompanying Automake X.Y.
  1521. # (This private macro should not be called outside this file.)
  1522. AC_DEFUN([AM_AUTOMAKE_VERSION],
  1523. [am__api_version='1.12'
  1524. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  1525. dnl require some minimum version. Point them to the right macro.
  1526. m4_if([$1], [1.12.6], [],
  1527. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  1528. ])
  1529. # _AM_AUTOCONF_VERSION(VERSION)
  1530. # -----------------------------
  1531. # aclocal traces this macro to find the Autoconf version.
  1532. # This is a private macro too. Using m4_define simplifies
  1533. # the logic in aclocal, which can simply ignore this definition.
  1534. m4_define([_AM_AUTOCONF_VERSION], [])
  1535. # AM_SET_CURRENT_AUTOMAKE_VERSION
  1536. # -------------------------------
  1537. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  1538. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  1539. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  1540. [AM_AUTOMAKE_VERSION([1.12.6])dnl
  1541. m4_ifndef([AC_AUTOCONF_VERSION],
  1542. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  1543. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  1544. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  1545. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  1546. #
  1547. # This file is free software; the Free Software Foundation
  1548. # gives unlimited permission to copy and/or distribute it,
  1549. # with or without modifications, as long as this notice is preserved.
  1550. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  1551. # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
  1552. # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
  1553. #
  1554. # Of course, Automake must honor this variable whenever it calls a
  1555. # tool from the auxiliary directory. The problem is that $srcdir (and
  1556. # therefore $ac_aux_dir as well) can be either absolute or relative,
  1557. # depending on how configure is run. This is pretty annoying, since
  1558. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  1559. # source directory, any form will work fine, but in subdirectories a
  1560. # relative path needs to be adjusted first.
  1561. #
  1562. # $ac_aux_dir/missing
  1563. # fails when called from a subdirectory if $ac_aux_dir is relative
  1564. # $top_srcdir/$ac_aux_dir/missing
  1565. # fails if $ac_aux_dir is absolute,
  1566. # fails when called from a subdirectory in a VPATH build with
  1567. # a relative $ac_aux_dir
  1568. #
  1569. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  1570. # are both prefixed by $srcdir. In an in-source build this is usually
  1571. # harmless because $srcdir is '.', but things will broke when you
  1572. # start a VPATH build or use an absolute $srcdir.
  1573. #
  1574. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  1575. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  1576. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  1577. # and then we would define $MISSING as
  1578. # MISSING="\${SHELL} $am_aux_dir/missing"
  1579. # This will work as long as MISSING is not called from configure, because
  1580. # unfortunately $(top_srcdir) has no meaning in configure.
  1581. # However there are other variables, like CC, which are often used in
  1582. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  1583. #
  1584. # Another solution, used here, is to always expand $ac_aux_dir to an
  1585. # absolute PATH. The drawback is that using absolute paths prevent a
  1586. # configured tree to be moved without reconfiguration.
  1587. AC_DEFUN([AM_AUX_DIR_EXPAND],
  1588. [dnl Rely on autoconf to set up CDPATH properly.
  1589. AC_PREREQ([2.50])dnl
  1590. # expand $ac_aux_dir to an absolute path
  1591. am_aux_dir=`cd $ac_aux_dir && pwd`
  1592. ])
  1593. # AM_CONDITIONAL -*- Autoconf -*-
  1594. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  1595. #
  1596. # This file is free software; the Free Software Foundation
  1597. # gives unlimited permission to copy and/or distribute it,
  1598. # with or without modifications, as long as this notice is preserved.
  1599. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  1600. # -------------------------------------
  1601. # Define a conditional.
  1602. AC_DEFUN([AM_CONDITIONAL],
  1603. [AC_PREREQ([2.52])dnl
  1604. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  1605. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  1606. AC_SUBST([$1_TRUE])dnl
  1607. AC_SUBST([$1_FALSE])dnl
  1608. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  1609. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  1610. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  1611. if $2; then
  1612. $1_TRUE=
  1613. $1_FALSE='#'
  1614. else
  1615. $1_TRUE='#'
  1616. $1_FALSE=
  1617. fi
  1618. AC_CONFIG_COMMANDS_PRE(
  1619. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  1620. AC_MSG_ERROR([[conditional "$1" was never defined.
  1621. Usually this means the macro was only invoked conditionally.]])
  1622. fi])])
  1623. # Copyright (C) 1999-2012 Free Software Foundation, Inc.
  1624. #
  1625. # This file is free software; the Free Software Foundation
  1626. # gives unlimited permission to copy and/or distribute it,
  1627. # with or without modifications, as long as this notice is preserved.
  1628. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
  1629. # written in clear, in which case automake, when reading aclocal.m4,
  1630. # will think it sees a *use*, and therefore will trigger all it's
  1631. # C support machinery. Also note that it means that autoscan, seeing
  1632. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  1633. # _AM_DEPENDENCIES(NAME)
  1634. # ----------------------
  1635. # See how the compiler implements dependency checking.
  1636. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
  1637. # We try a few techniques and use that to set a single cache variable.
  1638. #
  1639. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  1640. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  1641. # dependency, and given that the user is not expected to run this macro,
  1642. # just rely on AC_PROG_CC.
  1643. AC_DEFUN([_AM_DEPENDENCIES],
  1644. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  1645. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  1646. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  1647. AC_REQUIRE([AM_DEP_TRACK])dnl
  1648. m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
  1649. [$1], [CXX], [depcc="$CXX" am_compiler_list=],
  1650. [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  1651. [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
  1652. [$1], [UPC], [depcc="$UPC" am_compiler_list=],
  1653. [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  1654. [depcc="$$1" am_compiler_list=])
  1655. AC_CACHE_CHECK([dependency style of $depcc],
  1656. [am_cv_$1_dependencies_compiler_type],
  1657. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  1658. # We make a subdir and do the tests there. Otherwise we can end up
  1659. # making bogus files that we don't know about and never remove. For
  1660. # instance it was reported that on HP-UX the gcc test will end up
  1661. # making a dummy file named 'D' -- because '-MD' means "put the output
  1662. # in D".
  1663. rm -rf conftest.dir
  1664. mkdir conftest.dir
  1665. # Copy depcomp to subdir because otherwise we won't find it if we're
  1666. # using a relative directory.
  1667. cp "$am_depcomp" conftest.dir
  1668. cd conftest.dir
  1669. # We will build objects and dependencies in a subdirectory because
  1670. # it helps to detect inapplicable dependency modes. For instance
  1671. # both Tru64's cc and ICC support -MD to output dependencies as a
  1672. # side effect of compilation, but ICC will put the dependencies in
  1673. # the current directory while Tru64 will put them in the object
  1674. # directory.
  1675. mkdir sub
  1676. am_cv_$1_dependencies_compiler_type=none
  1677. if test "$am_compiler_list" = ""; then
  1678. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  1679. fi
  1680. am__universal=false
  1681. m4_case([$1], [CC],
  1682. [case " $depcc " in #(
  1683. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  1684. esac],
  1685. [CXX],
  1686. [case " $depcc " in #(
  1687. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  1688. esac])
  1689. for depmode in $am_compiler_list; do
  1690. # Setup a source with many dependencies, because some compilers
  1691. # like to wrap large dependency lists on column 80 (with \), and
  1692. # we should not choose a depcomp mode which is confused by this.
  1693. #
  1694. # We need to recreate these files for each test, as the compiler may
  1695. # overwrite some of them when testing with obscure command lines.
  1696. # This happens at least with the AIX C compiler.
  1697. : > sub/conftest.c
  1698. for i in 1 2 3 4 5 6; do
  1699. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  1700. # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
  1701. # Solaris 10 /bin/sh.
  1702. echo '/* dummy */' > sub/conftst$i.h
  1703. done
  1704. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  1705. # We check with '-c' and '-o' for the sake of the "dashmstdout"
  1706. # mode. It turns out that the SunPro C++ compiler does not properly
  1707. # handle '-M -o', and we need to detect this. Also, some Intel
  1708. # versions had trouble with output in subdirs.
  1709. am__obj=sub/conftest.${OBJEXT-o}
  1710. am__minus_obj="-o $am__obj"
  1711. case $depmode in
  1712. gcc)
  1713. # This depmode causes a compiler race in universal mode.
  1714. test "$am__universal" = false || continue
  1715. ;;
  1716. nosideeffect)
  1717. # After this tag, mechanisms are not by side-effect, so they'll
  1718. # only be used when explicitly requested.
  1719. if test "x$enable_dependency_tracking" = xyes; then
  1720. continue
  1721. else
  1722. break
  1723. fi
  1724. ;;
  1725. msvc7 | msvc7msys | msvisualcpp | msvcmsys)
  1726. # This compiler won't grok '-c -o', but also, the minuso test has
  1727. # not run yet. These depmodes are late enough in the game, and
  1728. # so weak that their functioning should not be impacted.
  1729. am__obj=conftest.${OBJEXT-o}
  1730. am__minus_obj=
  1731. ;;
  1732. none) break ;;
  1733. esac
  1734. if depmode=$depmode \
  1735. source=sub/conftest.c object=$am__obj \
  1736. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  1737. $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
  1738. >/dev/null 2>conftest.err &&
  1739. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  1740. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  1741. grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
  1742. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  1743. # icc doesn't choke on unknown options, it will just issue warnings
  1744. # or remarks (even with -Werror). So we grep stderr for any message
  1745. # that says an option was ignored or not supported.
  1746. # When given -MP, icc 7.0 and 7.1 complain thusly:
  1747. # icc: Command line warning: ignoring option '-M'; no argument required
  1748. # The diagnosis changed in icc 8.0:
  1749. # icc: Command line remark: option '-MP' not supported
  1750. if (grep 'ignoring option' conftest.err ||
  1751. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  1752. am_cv_$1_dependencies_compiler_type=$depmode
  1753. break
  1754. fi
  1755. fi
  1756. done
  1757. cd ..
  1758. rm -rf conftest.dir
  1759. else
  1760. am_cv_$1_dependencies_compiler_type=none
  1761. fi
  1762. ])
  1763. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  1764. AM_CONDITIONAL([am__fastdep$1], [
  1765. test "x$enable_dependency_tracking" != xno \
  1766. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  1767. ])
  1768. # AM_SET_DEPDIR
  1769. # -------------
  1770. # Choose a directory name for dependency files.
  1771. # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
  1772. AC_DEFUN([AM_SET_DEPDIR],
  1773. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  1774. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  1775. ])
  1776. # AM_DEP_TRACK
  1777. # ------------
  1778. AC_DEFUN([AM_DEP_TRACK],
  1779. [AC_ARG_ENABLE([dependency-tracking], [dnl
  1780. AS_HELP_STRING(
  1781. [--enable-dependency-tracking],
  1782. [do not reject slow dependency extractors])
  1783. AS_HELP_STRING(
  1784. [--disable-dependency-tracking],
  1785. [speeds up one-time build])])
  1786. if test "x$enable_dependency_tracking" != xno; then
  1787. am_depcomp="$ac_aux_dir/depcomp"
  1788. AMDEPBACKSLASH='\'
  1789. am__nodep='_no'
  1790. fi
  1791. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  1792. AC_SUBST([AMDEPBACKSLASH])dnl
  1793. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  1794. AC_SUBST([am__nodep])dnl
  1795. _AM_SUBST_NOTMAKE([am__nodep])dnl
  1796. ])
  1797. # Generate code to set up dependency tracking. -*- Autoconf -*-
  1798. # Copyright (C) 1999-2012 Free Software Foundation, Inc.
  1799. #
  1800. # This file is free software; the Free Software Foundation
  1801. # gives unlimited permission to copy and/or distribute it,
  1802. # with or without modifications, as long as this notice is preserved.
  1803. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  1804. # ------------------------------
  1805. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  1806. [{
  1807. # Autoconf 2.62 quotes --file arguments for eval, but not when files
  1808. # are listed without --file. Let's play safe and only enable the eval
  1809. # if we detect the quoting.
  1810. case $CONFIG_FILES in
  1811. *\'*) eval set x "$CONFIG_FILES" ;;
  1812. *) set x $CONFIG_FILES ;;
  1813. esac
  1814. shift
  1815. for mf
  1816. do
  1817. # Strip MF so we end up with the name of the file.
  1818. mf=`echo "$mf" | sed -e 's/:.*$//'`
  1819. # Check whether this is an Automake generated Makefile or not.
  1820. # We used to match only the files named 'Makefile.in', but
  1821. # some people rename them; so instead we look at the file content.
  1822. # Grep'ing the first line is not enough: some people post-process
  1823. # each Makefile.in and add a new line on top of each file to say so.
  1824. # Grep'ing the whole file is not good either: AIX grep has a line
  1825. # limit of 2048, but all sed's we know have understand at least 4000.
  1826. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
  1827. dirpart=`AS_DIRNAME("$mf")`
  1828. else
  1829. continue
  1830. fi
  1831. # Extract the definition of DEPDIR, am__include, and am__quote
  1832. # from the Makefile without running 'make'.
  1833. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
  1834. test -z "$DEPDIR" && continue
  1835. am__include=`sed -n 's/^am__include = //p' < "$mf"`
  1836. test -z "am__include" && continue
  1837. am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
  1838. # Find all dependency output files, they are included files with
  1839. # $(DEPDIR) in their names. We invoke sed twice because it is the
  1840. # simplest approach to changing $(DEPDIR) to its actual value in the
  1841. # expansion.
  1842. for file in `sed -n "
  1843. s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
  1844. sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
  1845. # Make sure the directory exists.
  1846. test -f "$dirpart/$file" && continue
  1847. fdir=`AS_DIRNAME(["$file"])`
  1848. AS_MKDIR_P([$dirpart/$fdir])
  1849. # echo "creating $dirpart/$file"
  1850. echo '# dummy' > "$dirpart/$file"
  1851. done
  1852. done
  1853. }
  1854. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  1855. # AM_OUTPUT_DEPENDENCY_COMMANDS
  1856. # -----------------------------
  1857. # This macro should only be invoked once -- use via AC_REQUIRE.
  1858. #
  1859. # This code is only required when automatic dependency tracking
  1860. # is enabled. FIXME. This creates each '.P' file that we will
  1861. # need in order to bootstrap the dependency handling code.
  1862. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  1863. [AC_CONFIG_COMMANDS([depfiles],
  1864. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  1865. [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
  1866. ])
  1867. # Do all the work for Automake. -*- Autoconf -*-
  1868. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  1869. #
  1870. # This file is free software; the Free Software Foundation
  1871. # gives unlimited permission to copy and/or distribute it,
  1872. # with or without modifications, as long as this notice is preserved.
  1873. # This macro actually does too much. Some checks are only needed if
  1874. # your package does certain things. But this isn't really a big deal.
  1875. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  1876. # AM_INIT_AUTOMAKE([OPTIONS])
  1877. # -----------------------------------------------
  1878. # The call with PACKAGE and VERSION arguments is the old style
  1879. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  1880. # and VERSION should now be passed to AC_INIT and removed from
  1881. # the call to AM_INIT_AUTOMAKE.
  1882. # We support both call styles for the transition. After
  1883. # the next Automake release, Autoconf can make the AC_INIT
  1884. # arguments mandatory, and then we can depend on a new Autoconf
  1885. # release and drop the old call support.
  1886. AC_DEFUN([AM_INIT_AUTOMAKE],
  1887. [AC_PREREQ([2.62])dnl
  1888. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  1889. dnl the ones we care about.
  1890. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  1891. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  1892. AC_REQUIRE([AC_PROG_INSTALL])dnl
  1893. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  1894. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  1895. # is not polluted with repeated "-I."
  1896. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  1897. # test to see if srcdir already configured
  1898. if test -f $srcdir/config.status; then
  1899. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  1900. fi
  1901. fi
  1902. # test whether we have cygpath
  1903. if test -z "$CYGPATH_W"; then
  1904. if (cygpath --version) >/dev/null 2>/dev/null; then
  1905. CYGPATH_W='cygpath -w'
  1906. else
  1907. CYGPATH_W=echo
  1908. fi
  1909. fi
  1910. AC_SUBST([CYGPATH_W])
  1911. # Define the identity of the package.
  1912. dnl Distinguish between old-style and new-style calls.
  1913. m4_ifval([$2],
  1914. [AC_DIAGNOSE([obsolete],
  1915. [$0: two- and three-arguments forms are deprecated. For more info, see:
  1916. http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
  1917. m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  1918. AC_SUBST([PACKAGE], [$1])dnl
  1919. AC_SUBST([VERSION], [$2])],
  1920. [_AM_SET_OPTIONS([$1])dnl
  1921. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  1922. m4_if(
  1923. m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
  1924. [ok:ok],,
  1925. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  1926. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  1927. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  1928. _AM_IF_OPTION([no-define],,
  1929. [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
  1930. AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
  1931. # Some tools Automake needs.
  1932. AC_REQUIRE([AM_SANITY_CHECK])dnl
  1933. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  1934. AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
  1935. AM_MISSING_PROG([AUTOCONF], [autoconf])
  1936. AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
  1937. AM_MISSING_PROG([AUTOHEADER], [autoheader])
  1938. AM_MISSING_PROG([MAKEINFO], [makeinfo])
  1939. AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  1940. AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
  1941. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  1942. # For better backward compatibility. To be removed once Automake 1.9.x
  1943. # dies out for good. For more background, see:
  1944. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
  1945. # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  1946. AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
  1947. # We need awk for the "check" target. The system "awk" is bad on
  1948. # some platforms.
  1949. AC_REQUIRE([AC_PROG_AWK])dnl
  1950. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  1951. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  1952. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  1953. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  1954. [_AM_PROG_TAR([v7])])])
  1955. _AM_IF_OPTION([no-dependencies],,
  1956. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  1957. [_AM_DEPENDENCIES([CC])],
  1958. [m4_define([AC_PROG_CC],
  1959. m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
  1960. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  1961. [_AM_DEPENDENCIES([CXX])],
  1962. [m4_define([AC_PROG_CXX],
  1963. m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
  1964. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  1965. [_AM_DEPENDENCIES([OBJC])],
  1966. [m4_define([AC_PROG_OBJC],
  1967. m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
  1968. dnl Support for Objective C++ was only introduced in Autoconf 2.65,
  1969. dnl but we still cater to Autoconf 2.62.
  1970. m4_ifdef([AC_PROG_OBJCXX],
  1971. [AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
  1972. [_AM_DEPENDENCIES([OBJCXX])],
  1973. [m4_define([AC_PROG_OBJCXX],
  1974. m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl
  1975. ])
  1976. _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
  1977. dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
  1978. dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
  1979. dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
  1980. AC_CONFIG_COMMANDS_PRE(dnl
  1981. [m4_provide_if([_AM_COMPILER_EXEEXT],
  1982. [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  1983. ])
  1984. dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
  1985. dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  1986. dnl mangled by Autoconf and run in a shell conditional statement.
  1987. m4_define([_AC_COMPILER_EXEEXT],
  1988. m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  1989. # When config.status generates a header, we must update the stamp-h file.
  1990. # This file resides in the same directory as the config header
  1991. # that is generated. The stamp files are numbered to have different names.
  1992. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  1993. # loop where config.status creates the headers, so we can generate
  1994. # our stamp files there.
  1995. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  1996. [# Compute $1's index in $config_headers.
  1997. _am_arg=$1
  1998. _am_stamp_count=1
  1999. for _am_header in $config_headers :; do
  2000. case $_am_header in
  2001. $_am_arg | $_am_arg:* )
  2002. break ;;
  2003. * )
  2004. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  2005. esac
  2006. done
  2007. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  2008. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  2009. #
  2010. # This file is free software; the Free Software Foundation
  2011. # gives unlimited permission to copy and/or distribute it,
  2012. # with or without modifications, as long as this notice is preserved.
  2013. # AM_PROG_INSTALL_SH
  2014. # ------------------
  2015. # Define $install_sh.
  2016. AC_DEFUN([AM_PROG_INSTALL_SH],
  2017. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  2018. if test x"${install_sh}" != xset; then
  2019. case $am_aux_dir in
  2020. *\ * | *\ *)
  2021. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  2022. *)
  2023. install_sh="\${SHELL} $am_aux_dir/install-sh"
  2024. esac
  2025. fi
  2026. AC_SUBST([install_sh])])
  2027. # Copyright (C) 2003-2012 Free Software Foundation, Inc.
  2028. #
  2029. # This file is free software; the Free Software Foundation
  2030. # gives unlimited permission to copy and/or distribute it,
  2031. # with or without modifications, as long as this notice is preserved.
  2032. # Check whether the underlying file-system supports filenames
  2033. # with a leading dot. For instance MS-DOS doesn't.
  2034. AC_DEFUN([AM_SET_LEADING_DOT],
  2035. [rm -rf .tst 2>/dev/null
  2036. mkdir .tst 2>/dev/null
  2037. if test -d .tst; then
  2038. am__leading_dot=.
  2039. else
  2040. am__leading_dot=_
  2041. fi
  2042. rmdir .tst 2>/dev/null
  2043. AC_SUBST([am__leading_dot])])
  2044. # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
  2045. # From Jim Meyering
  2046. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  2047. #
  2048. # This file is free software; the Free Software Foundation
  2049. # gives unlimited permission to copy and/or distribute it,
  2050. # with or without modifications, as long as this notice is preserved.
  2051. # AM_MAINTAINER_MODE([DEFAULT-MODE])
  2052. # ----------------------------------
  2053. # Control maintainer-specific portions of Makefiles.
  2054. # Default is to disable them, unless 'enable' is passed literally.
  2055. # For symmetry, 'disable' may be passed as well. Anyway, the user
  2056. # can override the default with the --enable/--disable switch.
  2057. AC_DEFUN([AM_MAINTAINER_MODE],
  2058. [m4_case(m4_default([$1], [disable]),
  2059. [enable], [m4_define([am_maintainer_other], [disable])],
  2060. [disable], [m4_define([am_maintainer_other], [enable])],
  2061. [m4_define([am_maintainer_other], [enable])
  2062. m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
  2063. AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  2064. dnl maintainer-mode's default is 'disable' unless 'enable' is passed
  2065. AC_ARG_ENABLE([maintainer-mode],
  2066. [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
  2067. am_maintainer_other[ make rules and dependencies not useful
  2068. (and sometimes confusing) to the casual installer])],
  2069. [USE_MAINTAINER_MODE=$enableval],
  2070. [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
  2071. AC_MSG_RESULT([$USE_MAINTAINER_MODE])
  2072. AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
  2073. MAINT=$MAINTAINER_MODE_TRUE
  2074. AC_SUBST([MAINT])dnl
  2075. ]
  2076. )
  2077. AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
  2078. # Check to see how 'make' treats includes. -*- Autoconf -*-
  2079. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  2080. #
  2081. # This file is free software; the Free Software Foundation
  2082. # gives unlimited permission to copy and/or distribute it,
  2083. # with or without modifications, as long as this notice is preserved.
  2084. # AM_MAKE_INCLUDE()
  2085. # -----------------
  2086. # Check to see how make treats includes.
  2087. AC_DEFUN([AM_MAKE_INCLUDE],
  2088. [am_make=${MAKE-make}
  2089. cat > confinc << 'END'
  2090. am__doit:
  2091. @echo this is the am__doit target
  2092. .PHONY: am__doit
  2093. END
  2094. # If we don't find an include directive, just comment out the code.
  2095. AC_MSG_CHECKING([for style of include used by $am_make])
  2096. am__include="#"
  2097. am__quote=
  2098. _am_result=none
  2099. # First try GNU make style include.
  2100. echo "include confinc" > confmf
  2101. # Ignore all kinds of additional output from 'make'.
  2102. case `$am_make -s -f confmf 2> /dev/null` in #(
  2103. *the\ am__doit\ target*)
  2104. am__include=include
  2105. am__quote=
  2106. _am_result=GNU
  2107. ;;
  2108. esac
  2109. # Now try BSD make style include.
  2110. if test "$am__include" = "#"; then
  2111. echo '.include "confinc"' > confmf
  2112. case `$am_make -s -f confmf 2> /dev/null` in #(
  2113. *the\ am__doit\ target*)
  2114. am__include=.include
  2115. am__quote="\""
  2116. _am_result=BSD
  2117. ;;
  2118. esac
  2119. fi
  2120. AC_SUBST([am__include])
  2121. AC_SUBST([am__quote])
  2122. AC_MSG_RESULT([$_am_result])
  2123. rm -f confinc confmf
  2124. ])
  2125. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  2126. # Copyright (C) 1997-2012 Free Software Foundation, Inc.
  2127. #
  2128. # This file is free software; the Free Software Foundation
  2129. # gives unlimited permission to copy and/or distribute it,
  2130. # with or without modifications, as long as this notice is preserved.
  2131. # AM_MISSING_PROG(NAME, PROGRAM)
  2132. # ------------------------------
  2133. AC_DEFUN([AM_MISSING_PROG],
  2134. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  2135. $1=${$1-"${am_missing_run}$2"}
  2136. AC_SUBST($1)])
  2137. # AM_MISSING_HAS_RUN
  2138. # ------------------
  2139. # Define MISSING if not defined so far and test if it supports --run.
  2140. # If it does, set am_missing_run to use it, otherwise, to nothing.
  2141. AC_DEFUN([AM_MISSING_HAS_RUN],
  2142. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  2143. AC_REQUIRE_AUX_FILE([missing])dnl
  2144. if test x"${MISSING+set}" != xset; then
  2145. case $am_aux_dir in
  2146. *\ * | *\ *)
  2147. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  2148. *)
  2149. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  2150. esac
  2151. fi
  2152. # Use eval to expand $SHELL
  2153. if eval "$MISSING --run true"; then
  2154. am_missing_run="$MISSING --run "
  2155. else
  2156. am_missing_run=
  2157. AC_MSG_WARN(['missing' script is too old or missing])
  2158. fi
  2159. ])
  2160. # Helper functions for option handling. -*- Autoconf -*-
  2161. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  2162. #
  2163. # This file is free software; the Free Software Foundation
  2164. # gives unlimited permission to copy and/or distribute it,
  2165. # with or without modifications, as long as this notice is preserved.
  2166. # _AM_MANGLE_OPTION(NAME)
  2167. # -----------------------
  2168. AC_DEFUN([_AM_MANGLE_OPTION],
  2169. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  2170. # _AM_SET_OPTION(NAME)
  2171. # --------------------
  2172. # Set option NAME. Presently that only means defining a flag for this option.
  2173. AC_DEFUN([_AM_SET_OPTION],
  2174. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  2175. # _AM_SET_OPTIONS(OPTIONS)
  2176. # ------------------------
  2177. # OPTIONS is a space-separated list of Automake options.
  2178. AC_DEFUN([_AM_SET_OPTIONS],
  2179. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  2180. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  2181. # -------------------------------------------
  2182. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  2183. AC_DEFUN([_AM_IF_OPTION],
  2184. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  2185. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  2186. # Copyright (C) 1996-2012 Free Software Foundation, Inc.
  2187. #
  2188. # This file is free software; the Free Software Foundation
  2189. # gives unlimited permission to copy and/or distribute it,
  2190. # with or without modifications, as long as this notice is preserved.
  2191. # AM_SANITY_CHECK
  2192. # ---------------
  2193. AC_DEFUN([AM_SANITY_CHECK],
  2194. [AC_MSG_CHECKING([whether build environment is sane])
  2195. # Reject unsafe characters in $srcdir or the absolute working directory
  2196. # name. Accept space and tab only in the latter.
  2197. am_lf='
  2198. '
  2199. case `pwd` in
  2200. *[[\\\"\#\$\&\'\`$am_lf]]*)
  2201. AC_MSG_ERROR([unsafe absolute working directory name]);;
  2202. esac
  2203. case $srcdir in
  2204. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  2205. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  2206. esac
  2207. # Do 'set' in a subshell so we don't clobber the current shell's
  2208. # arguments. Must try -L first in case configure is actually a
  2209. # symlink; some systems play weird games with the mod time of symlinks
  2210. # (eg FreeBSD returns the mod time of the symlink's containing
  2211. # directory).
  2212. if (
  2213. am_has_slept=no
  2214. for am_try in 1 2; do
  2215. echo "timestamp, slept: $am_has_slept" > conftest.file
  2216. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  2217. if test "$[*]" = "X"; then
  2218. # -L didn't work.
  2219. set X `ls -t "$srcdir/configure" conftest.file`
  2220. fi
  2221. if test "$[*]" != "X $srcdir/configure conftest.file" \
  2222. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  2223. # If neither matched, then we have a broken ls. This can happen
  2224. # if, for instance, CONFIG_SHELL is bash and it inherits a
  2225. # broken ls alias from the environment. This has actually
  2226. # happened. Such a system could not be considered "sane".
  2227. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  2228. alias in your environment])
  2229. fi
  2230. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  2231. break
  2232. fi
  2233. # Just in case.
  2234. sleep 1
  2235. am_has_slept=yes
  2236. done
  2237. test "$[2]" = conftest.file
  2238. )
  2239. then
  2240. # Ok.
  2241. :
  2242. else
  2243. AC_MSG_ERROR([newly created file is older than distributed files!
  2244. Check your system clock])
  2245. fi
  2246. AC_MSG_RESULT([yes])
  2247. # If we didn't sleep, we still need to ensure time stamps of config.status and
  2248. # generated files are strictly newer.
  2249. am_sleep_pid=
  2250. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  2251. ( sleep 1 ) &
  2252. am_sleep_pid=$!
  2253. fi
  2254. AC_CONFIG_COMMANDS_PRE(
  2255. [AC_MSG_CHECKING([that generated files are newer than configure])
  2256. if test -n "$am_sleep_pid"; then
  2257. # Hide warnings about reused PIDs.
  2258. wait $am_sleep_pid 2>/dev/null
  2259. fi
  2260. AC_MSG_RESULT([done])])
  2261. rm -f conftest.file
  2262. ])
  2263. # Copyright (C) 2009-2012 Free Software Foundation, Inc.
  2264. #
  2265. # This file is free software; the Free Software Foundation
  2266. # gives unlimited permission to copy and/or distribute it,
  2267. # with or without modifications, as long as this notice is preserved.
  2268. # AM_SILENT_RULES([DEFAULT])
  2269. # --------------------------
  2270. # Enable less verbose build rules; with the default set to DEFAULT
  2271. # ("yes" being less verbose, "no" or empty being verbose).
  2272. AC_DEFUN([AM_SILENT_RULES],
  2273. [AC_ARG_ENABLE([silent-rules], [dnl
  2274. AS_HELP_STRING(
  2275. [--enable-silent-rules],
  2276. [less verbose build output (undo: "make V=1")])
  2277. AS_HELP_STRING(
  2278. [--disable-silent-rules],
  2279. [verbose build output (undo: "make V=0")])dnl
  2280. ])
  2281. case $enable_silent_rules in @%:@ (((
  2282. yes) AM_DEFAULT_VERBOSITY=0;;
  2283. no) AM_DEFAULT_VERBOSITY=1;;
  2284. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  2285. esac
  2286. dnl
  2287. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  2288. dnl do not support nested variable expansions.
  2289. dnl See automake bug#9928 and bug#10237.
  2290. am_make=${MAKE-make}
  2291. AC_CACHE_CHECK([whether $am_make supports nested variables],
  2292. [am_cv_make_support_nested_variables],
  2293. [if AS_ECHO([['TRUE=$(BAR$(V))
  2294. BAR0=false
  2295. BAR1=true
  2296. V=1
  2297. am__doit:
  2298. @$(TRUE)
  2299. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  2300. am_cv_make_support_nested_variables=yes
  2301. else
  2302. am_cv_make_support_nested_variables=no
  2303. fi])
  2304. if test $am_cv_make_support_nested_variables = yes; then
  2305. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  2306. AM_V='$(V)'
  2307. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  2308. else
  2309. AM_V=$AM_DEFAULT_VERBOSITY
  2310. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  2311. fi
  2312. AC_SUBST([AM_V])dnl
  2313. AM_SUBST_NOTMAKE([AM_V])dnl
  2314. AC_SUBST([AM_DEFAULT_V])dnl
  2315. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  2316. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  2317. AM_BACKSLASH='\'
  2318. AC_SUBST([AM_BACKSLASH])dnl
  2319. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  2320. ])
  2321. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
  2322. #
  2323. # This file is free software; the Free Software Foundation
  2324. # gives unlimited permission to copy and/or distribute it,
  2325. # with or without modifications, as long as this notice is preserved.
  2326. # AM_PROG_INSTALL_STRIP
  2327. # ---------------------
  2328. # One issue with vendor 'install' (even GNU) is that you can't
  2329. # specify the program used to strip binaries. This is especially
  2330. # annoying in cross-compiling environments, where the build's strip
  2331. # is unlikely to handle the host's binaries.
  2332. # Fortunately install-sh will honor a STRIPPROG variable, so we
  2333. # always use install-sh in "make install-strip", and initialize
  2334. # STRIPPROG with the value of the STRIP variable (set by the user).
  2335. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  2336. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  2337. # Installed binaries are usually stripped using 'strip' when the user
  2338. # run "make install-strip". However 'strip' might not be the right
  2339. # tool to use in cross-compilation environments, therefore Automake
  2340. # will honor the 'STRIP' environment variable to overrule this program.
  2341. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  2342. if test "$cross_compiling" != no; then
  2343. AC_CHECK_TOOL([STRIP], [strip], :)
  2344. fi
  2345. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  2346. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  2347. # Copyright (C) 2006-2012 Free Software Foundation, Inc.
  2348. #
  2349. # This file is free software; the Free Software Foundation
  2350. # gives unlimited permission to copy and/or distribute it,
  2351. # with or without modifications, as long as this notice is preserved.
  2352. # _AM_SUBST_NOTMAKE(VARIABLE)
  2353. # ---------------------------
  2354. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  2355. # This macro is traced by Automake.
  2356. AC_DEFUN([_AM_SUBST_NOTMAKE])
  2357. # AM_SUBST_NOTMAKE(VARIABLE)
  2358. # --------------------------
  2359. # Public sister of _AM_SUBST_NOTMAKE.
  2360. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  2361. # Check how to create a tarball. -*- Autoconf -*-
  2362. # Copyright (C) 2004-2012 Free Software Foundation, Inc.
  2363. #
  2364. # This file is free software; the Free Software Foundation
  2365. # gives unlimited permission to copy and/or distribute it,
  2366. # with or without modifications, as long as this notice is preserved.
  2367. # _AM_PROG_TAR(FORMAT)
  2368. # --------------------
  2369. # Check how to create a tarball in format FORMAT.
  2370. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  2371. #
  2372. # Substitute a variable $(am__tar) that is a command
  2373. # writing to stdout a FORMAT-tarball containing the directory
  2374. # $tardir.
  2375. # tardir=directory && $(am__tar) > result.tar
  2376. #
  2377. # Substitute a variable $(am__untar) that extract such
  2378. # a tarball read from stdin.
  2379. # $(am__untar) < result.tar
  2380. AC_DEFUN([_AM_PROG_TAR],
  2381. [# Always define AMTAR for backward compatibility. Yes, it's still used
  2382. # in the wild :-( We should find a proper way to deprecate it ...
  2383. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  2384. m4_if([$1], [v7],
  2385. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  2386. [m4_case([$1], [ustar],, [pax],,
  2387. [m4_fatal([Unknown tar format])])
  2388. AC_MSG_CHECKING([how to create a $1 tar archive])
  2389. # Loop over all known methods to create a tar archive until one works.
  2390. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  2391. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  2392. # Do not fold the above two line into one, because Tru64 sh and
  2393. # Solaris sh will not grok spaces in the rhs of '-'.
  2394. for _am_tool in $_am_tools
  2395. do
  2396. case $_am_tool in
  2397. gnutar)
  2398. for _am_tar in tar gnutar gtar;
  2399. do
  2400. AM_RUN_LOG([$_am_tar --version]) && break
  2401. done
  2402. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  2403. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  2404. am__untar="$_am_tar -xf -"
  2405. ;;
  2406. plaintar)
  2407. # Must skip GNU tar: if it does not support --format= it doesn't create
  2408. # ustar tarball either.
  2409. (tar --version) >/dev/null 2>&1 && continue
  2410. am__tar='tar chf - "$$tardir"'
  2411. am__tar_='tar chf - "$tardir"'
  2412. am__untar='tar xf -'
  2413. ;;
  2414. pax)
  2415. am__tar='pax -L -x $1 -w "$$tardir"'
  2416. am__tar_='pax -L -x $1 -w "$tardir"'
  2417. am__untar='pax -r'
  2418. ;;
  2419. cpio)
  2420. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  2421. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  2422. am__untar='cpio -i -H $1 -d'
  2423. ;;
  2424. none)
  2425. am__tar=false
  2426. am__tar_=false
  2427. am__untar=false
  2428. ;;
  2429. esac
  2430. # If the value was cached, stop now. We just wanted to have am__tar
  2431. # and am__untar set.
  2432. test -n "${am_cv_prog_tar_$1}" && break
  2433. # tar/untar a dummy directory, and stop if the command works
  2434. rm -rf conftest.dir
  2435. mkdir conftest.dir
  2436. echo GrepMe > conftest.dir/file
  2437. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  2438. rm -rf conftest.dir
  2439. if test -s conftest.tar; then
  2440. AM_RUN_LOG([$am__untar <conftest.tar])
  2441. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  2442. fi
  2443. done
  2444. rm -rf conftest.dir
  2445. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  2446. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  2447. AC_SUBST([am__tar])
  2448. AC_SUBST([am__untar])
  2449. ]) # _AM_PROG_TAR
  2450. dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
  2451. dnl
  2452. dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
  2453. dnl
  2454. dnl Permission is hereby granted, free of charge, to any person obtaining a
  2455. dnl copy of this software and associated documentation files (the "Software"),
  2456. dnl to deal in the Software without restriction, including without limitation
  2457. dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
  2458. dnl and/or sell copies of the Software, and to permit persons to whom the
  2459. dnl Software is furnished to do so, subject to the following conditions:
  2460. dnl
  2461. dnl The above copyright notice and this permission notice (including the next
  2462. dnl paragraph) shall be included in all copies or substantial portions of the
  2463. dnl Software.
  2464. dnl
  2465. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  2466. dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  2467. dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  2468. dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  2469. dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  2470. dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  2471. dnl DEALINGS IN THE SOFTWARE.
  2472. # XORG_MACROS_VERSION(required-version)
  2473. # -------------------------------------
  2474. # Minimum version: 1.1.0
  2475. #
  2476. # If you're using a macro added in Version 1.1 or newer, include this in
  2477. # your configure.ac with the minimum required version, such as:
  2478. # XORG_MACROS_VERSION(1.1)
  2479. #
  2480. # To ensure that this macro is defined, also add:
  2481. # m4_ifndef([XORG_MACROS_VERSION],
  2482. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
  2483. #
  2484. #
  2485. # See the "minimum version" comment for each macro you use to see what
  2486. # version you require.
  2487. m4_defun([XORG_MACROS_VERSION],[
  2488. m4_define([vers_have], [1.16.2])
  2489. m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
  2490. m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
  2491. m4_if(m4_cmp(maj_have, maj_needed), 0,,
  2492. [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
  2493. m4_if(m4_version_compare(vers_have, [$1]), -1,
  2494. [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
  2495. m4_undefine([vers_have])
  2496. m4_undefine([maj_have])
  2497. m4_undefine([maj_needed])
  2498. ]) # XORG_MACROS_VERSION
  2499. # XORG_PROG_RAWCPP()
  2500. # ------------------
  2501. # Minimum version: 1.0.0
  2502. #
  2503. # Find cpp program and necessary flags for use in pre-processing text files
  2504. # such as man pages and config files
  2505. AC_DEFUN([XORG_PROG_RAWCPP],[
  2506. AC_REQUIRE([AC_PROG_CPP])
  2507. AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
  2508. [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
  2509. # Check for flag to avoid builtin definitions - assumes unix is predefined,
  2510. # which is not the best choice for supporting other OS'es, but covers most
  2511. # of the ones we need for now.
  2512. AC_MSG_CHECKING([if $RAWCPP requires -undef])
  2513. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
  2514. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  2515. AC_MSG_RESULT([no])
  2516. else
  2517. if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  2518. RAWCPPFLAGS=-undef
  2519. AC_MSG_RESULT([yes])
  2520. # under Cygwin unix is still defined even with -undef
  2521. elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
  2522. RAWCPPFLAGS="-undef -ansi"
  2523. AC_MSG_RESULT([yes, with -ansi])
  2524. else
  2525. AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
  2526. fi
  2527. fi
  2528. rm -f conftest.$ac_ext
  2529. AC_MSG_CHECKING([if $RAWCPP requires -traditional])
  2530. AC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve "whitespace"?]])])
  2531. if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  2532. AC_MSG_RESULT([no])
  2533. else
  2534. if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
  2535. RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
  2536. AC_MSG_RESULT([yes])
  2537. else
  2538. AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
  2539. fi
  2540. fi
  2541. rm -f conftest.$ac_ext
  2542. AC_SUBST(RAWCPPFLAGS)
  2543. ]) # XORG_PROG_RAWCPP
  2544. # XORG_MANPAGE_SECTIONS()
  2545. # -----------------------
  2546. # Minimum version: 1.0.0
  2547. #
  2548. # Determine which sections man pages go in for the different man page types
  2549. # on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
  2550. # Not sure if there's any better way than just hardcoding by OS name.
  2551. # Override default settings by setting environment variables
  2552. # Added MAN_SUBSTS in version 1.8
  2553. # Added AC_PROG_SED in version 1.8
  2554. AC_DEFUN([XORG_MANPAGE_SECTIONS],[
  2555. AC_REQUIRE([AC_CANONICAL_HOST])
  2556. AC_REQUIRE([AC_PROG_SED])
  2557. if test x$APP_MAN_SUFFIX = x ; then
  2558. APP_MAN_SUFFIX=1
  2559. fi
  2560. if test x$APP_MAN_DIR = x ; then
  2561. APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
  2562. fi
  2563. if test x$LIB_MAN_SUFFIX = x ; then
  2564. LIB_MAN_SUFFIX=3
  2565. fi
  2566. if test x$LIB_MAN_DIR = x ; then
  2567. LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
  2568. fi
  2569. if test x$FILE_MAN_SUFFIX = x ; then
  2570. case $host_os in
  2571. solaris*) FILE_MAN_SUFFIX=4 ;;
  2572. *) FILE_MAN_SUFFIX=5 ;;
  2573. esac
  2574. fi
  2575. if test x$FILE_MAN_DIR = x ; then
  2576. FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
  2577. fi
  2578. if test x$MISC_MAN_SUFFIX = x ; then
  2579. case $host_os in
  2580. solaris*) MISC_MAN_SUFFIX=5 ;;
  2581. *) MISC_MAN_SUFFIX=7 ;;
  2582. esac
  2583. fi
  2584. if test x$MISC_MAN_DIR = x ; then
  2585. MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
  2586. fi
  2587. if test x$DRIVER_MAN_SUFFIX = x ; then
  2588. case $host_os in
  2589. solaris*) DRIVER_MAN_SUFFIX=7 ;;
  2590. *) DRIVER_MAN_SUFFIX=4 ;;
  2591. esac
  2592. fi
  2593. if test x$DRIVER_MAN_DIR = x ; then
  2594. DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
  2595. fi
  2596. if test x$ADMIN_MAN_SUFFIX = x ; then
  2597. case $host_os in
  2598. solaris*) ADMIN_MAN_SUFFIX=1m ;;
  2599. *) ADMIN_MAN_SUFFIX=8 ;;
  2600. esac
  2601. fi
  2602. if test x$ADMIN_MAN_DIR = x ; then
  2603. ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
  2604. fi
  2605. AC_SUBST([APP_MAN_SUFFIX])
  2606. AC_SUBST([LIB_MAN_SUFFIX])
  2607. AC_SUBST([FILE_MAN_SUFFIX])
  2608. AC_SUBST([MISC_MAN_SUFFIX])
  2609. AC_SUBST([DRIVER_MAN_SUFFIX])
  2610. AC_SUBST([ADMIN_MAN_SUFFIX])
  2611. AC_SUBST([APP_MAN_DIR])
  2612. AC_SUBST([LIB_MAN_DIR])
  2613. AC_SUBST([FILE_MAN_DIR])
  2614. AC_SUBST([MISC_MAN_DIR])
  2615. AC_SUBST([DRIVER_MAN_DIR])
  2616. AC_SUBST([ADMIN_MAN_DIR])
  2617. XORG_MAN_PAGE="X Version 11"
  2618. AC_SUBST([XORG_MAN_PAGE])
  2619. MAN_SUBSTS="\
  2620. -e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  2621. -e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
  2622. -e 's|__xservername__|Xorg|g' \
  2623. -e 's|__xconfigfile__|xorg.conf|g' \
  2624. -e 's|__projectroot__|\$(prefix)|g' \
  2625. -e 's|__apploaddir__|\$(appdefaultdir)|g' \
  2626. -e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
  2627. -e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
  2628. -e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
  2629. -e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
  2630. -e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
  2631. -e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
  2632. AC_SUBST([MAN_SUBSTS])
  2633. ]) # XORG_MANPAGE_SECTIONS
  2634. # XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
  2635. # ------------------------
  2636. # Minimum version: 1.7.0
  2637. #
  2638. # Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
  2639. # provided by xorg-sgml-doctools, if installed.
  2640. AC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
  2641. AC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
  2642. XORG_SGML_PATH=
  2643. PKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
  2644. [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
  2645. [m4_ifval([$1],[:],
  2646. [if test x"$cross_compiling" != x"yes" ; then
  2647. AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
  2648. [XORG_SGML_PATH=$prefix/share/sgml])
  2649. fi])
  2650. ])
  2651. # Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
  2652. # the path and the name of the doc stylesheet
  2653. if test "x$XORG_SGML_PATH" != "x" ; then
  2654. AC_MSG_RESULT([$XORG_SGML_PATH])
  2655. STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
  2656. XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
  2657. else
  2658. AC_MSG_RESULT([no])
  2659. fi
  2660. AC_SUBST(XORG_SGML_PATH)
  2661. AC_SUBST(STYLESHEET_SRCDIR)
  2662. AC_SUBST(XSL_STYLESHEET)
  2663. AM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
  2664. ]) # XORG_CHECK_SGML_DOCTOOLS
  2665. # XORG_CHECK_LINUXDOC
  2666. # -------------------
  2667. # Minimum version: 1.0.0
  2668. #
  2669. # Defines the variable MAKE_TEXT if the necessary tools and
  2670. # files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
  2671. # Whether or not the necessary tools and files are found can be checked
  2672. # with the AM_CONDITIONAL "BUILD_LINUXDOC"
  2673. AC_DEFUN([XORG_CHECK_LINUXDOC],[
  2674. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  2675. AC_REQUIRE([XORG_WITH_PS2PDF])
  2676. AC_PATH_PROG(LINUXDOC, linuxdoc)
  2677. AC_MSG_CHECKING([whether to build documentation])
  2678. if test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
  2679. BUILDDOC=yes
  2680. else
  2681. BUILDDOC=no
  2682. fi
  2683. AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
  2684. AC_MSG_RESULT([$BUILDDOC])
  2685. AC_MSG_CHECKING([whether to build pdf documentation])
  2686. if test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
  2687. BUILDPDFDOC=yes
  2688. else
  2689. BUILDPDFDOC=no
  2690. fi
  2691. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  2692. AC_MSG_RESULT([$BUILDPDFDOC])
  2693. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
  2694. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
  2695. MAKE_PDF="$PS2PDF"
  2696. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
  2697. AC_SUBST(MAKE_TEXT)
  2698. AC_SUBST(MAKE_PS)
  2699. AC_SUBST(MAKE_PDF)
  2700. AC_SUBST(MAKE_HTML)
  2701. ]) # XORG_CHECK_LINUXDOC
  2702. # XORG_CHECK_DOCBOOK
  2703. # -------------------
  2704. # Minimum version: 1.0.0
  2705. #
  2706. # Checks for the ability to build output formats from SGML DocBook source.
  2707. # For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
  2708. # indicates whether the necessary tools and files are found and, if set,
  2709. # $(MAKE_XXX) blah.sgml will produce blah.xxx.
  2710. AC_DEFUN([XORG_CHECK_DOCBOOK],[
  2711. AC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
  2712. BUILDTXTDOC=no
  2713. BUILDPDFDOC=no
  2714. BUILDPSDOC=no
  2715. BUILDHTMLDOC=no
  2716. AC_PATH_PROG(DOCBOOKPS, docbook2ps)
  2717. AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
  2718. AC_PATH_PROG(DOCBOOKHTML, docbook2html)
  2719. AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
  2720. AC_MSG_CHECKING([whether to build text documentation])
  2721. if test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
  2722. test x$BUILD_TXTDOC != xno; then
  2723. BUILDTXTDOC=yes
  2724. fi
  2725. AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
  2726. AC_MSG_RESULT([$BUILDTXTDOC])
  2727. AC_MSG_CHECKING([whether to build PDF documentation])
  2728. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
  2729. test x$BUILD_PDFDOC != xno; then
  2730. BUILDPDFDOC=yes
  2731. fi
  2732. AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
  2733. AC_MSG_RESULT([$BUILDPDFDOC])
  2734. AC_MSG_CHECKING([whether to build PostScript documentation])
  2735. if test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
  2736. test x$BUILD_PSDOC != xno; then
  2737. BUILDPSDOC=yes
  2738. fi
  2739. AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
  2740. AC_MSG_RESULT([$BUILDPSDOC])
  2741. AC_MSG_CHECKING([whether to build HTML documentation])
  2742. if test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
  2743. test x$BUILD_HTMLDOC != xno; then
  2744. BUILDHTMLDOC=yes
  2745. fi
  2746. AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
  2747. AC_MSG_RESULT([$BUILDHTMLDOC])
  2748. MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
  2749. MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
  2750. MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
  2751. MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
  2752. AC_SUBST(MAKE_TEXT)
  2753. AC_SUBST(MAKE_PS)
  2754. AC_SUBST(MAKE_PDF)
  2755. AC_SUBST(MAKE_HTML)
  2756. ]) # XORG_CHECK_DOCBOOK
  2757. # XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
  2758. # ----------------
  2759. # Minimum version: 1.5.0
  2760. # Minimum version for optional DEFAULT argument: 1.11.0
  2761. #
  2762. # Documentation tools are not always available on all platforms and sometimes
  2763. # not at the appropriate level. This macro enables a module to test for the
  2764. # presence of the tool and obtain it's path in separate variables. Coupled with
  2765. # the --with-xmlto option, it allows maximum flexibilty in making decisions
  2766. # as whether or not to use the xmlto package. When DEFAULT is not specified,
  2767. # --with-xmlto assumes 'auto'.
  2768. #
  2769. # Interface to module:
  2770. # HAVE_XMLTO: used in makefiles to conditionally generate documentation
  2771. # XMLTO: returns the path of the xmlto program found
  2772. # returns the path set by the user in the environment
  2773. # --with-xmlto: 'yes' user instructs the module to use xmlto
  2774. # 'no' user instructs the module not to use xmlto
  2775. #
  2776. # Added in version 1.10.0
  2777. # HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
  2778. # xmlto for text output requires either lynx, links, or w3m browsers
  2779. #
  2780. # If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
  2781. #
  2782. AC_DEFUN([XORG_WITH_XMLTO],[
  2783. AC_ARG_VAR([XMLTO], [Path to xmlto command])
  2784. m4_define([_defopt], m4_default([$2], [auto]))
  2785. AC_ARG_WITH(xmlto,
  2786. AS_HELP_STRING([--with-xmlto],
  2787. [Use xmlto to regenerate documentation (default: ]_defopt[)]),
  2788. [use_xmlto=$withval], [use_xmlto=]_defopt)
  2789. m4_undefine([_defopt])
  2790. if test "x$use_xmlto" = x"auto"; then
  2791. AC_PATH_PROG([XMLTO], [xmlto])
  2792. if test "x$XMLTO" = "x"; then
  2793. AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
  2794. have_xmlto=no
  2795. else
  2796. have_xmlto=yes
  2797. fi
  2798. elif test "x$use_xmlto" = x"yes" ; then
  2799. AC_PATH_PROG([XMLTO], [xmlto])
  2800. if test "x$XMLTO" = "x"; then
  2801. AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
  2802. fi
  2803. have_xmlto=yes
  2804. elif test "x$use_xmlto" = x"no" ; then
  2805. if test "x$XMLTO" != "x"; then
  2806. AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
  2807. fi
  2808. have_xmlto=no
  2809. else
  2810. AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
  2811. fi
  2812. # Test for a minimum version of xmlto, if provided.
  2813. m4_ifval([$1],
  2814. [if test "$have_xmlto" = yes; then
  2815. # scrape the xmlto version
  2816. AC_MSG_CHECKING([the xmlto version])
  2817. xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
  2818. AC_MSG_RESULT([$xmlto_version])
  2819. AS_VERSION_COMPARE([$xmlto_version], [$1],
  2820. [if test "x$use_xmlto" = xauto; then
  2821. AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
  2822. have_xmlto=no
  2823. else
  2824. AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
  2825. fi])
  2826. fi])
  2827. # Test for the ability of xmlto to generate a text target
  2828. have_xmlto_text=no
  2829. cat > conftest.xml << "EOF"
  2830. EOF
  2831. AS_IF([test "$have_xmlto" = yes],
  2832. [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
  2833. [have_xmlto_text=yes],
  2834. [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
  2835. rm -f conftest.xml
  2836. AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
  2837. AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
  2838. ]) # XORG_WITH_XMLTO
  2839. # XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
  2840. # --------------------------------------------
  2841. # Minimum version: 1.12.0
  2842. # Minimum version for optional DEFAULT argument: 1.12.0
  2843. #
  2844. # XSLT (Extensible Stylesheet Language Transformations) is a declarative,
  2845. # XML-based language used for the transformation of XML documents.
  2846. # The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
  2847. # It is used under the cover by xmlto to generate html files from DocBook/XML.
  2848. # The XSLT processor is often used as a standalone tool for transformations.
  2849. # It should not be assumed that this tool is used only to work with documnetation.
  2850. # When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
  2851. #
  2852. # Interface to module:
  2853. # HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
  2854. # XSLTPROC: returns the path of the xsltproc program found
  2855. # returns the path set by the user in the environment
  2856. # --with-xsltproc: 'yes' user instructs the module to use xsltproc
  2857. # 'no' user instructs the module not to use xsltproc
  2858. # have_xsltproc: returns yes if xsltproc found in PATH or no
  2859. #
  2860. # If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
  2861. #
  2862. AC_DEFUN([XORG_WITH_XSLTPROC],[
  2863. AC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
  2864. # Preserves the interface, should it be implemented later
  2865. m4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
  2866. m4_define([_defopt], m4_default([$2], [auto]))
  2867. AC_ARG_WITH(xsltproc,
  2868. AS_HELP_STRING([--with-xsltproc],
  2869. [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
  2870. [use_xsltproc=$withval], [use_xsltproc=]_defopt)
  2871. m4_undefine([_defopt])
  2872. if test "x$use_xsltproc" = x"auto"; then
  2873. AC_PATH_PROG([XSLTPROC], [xsltproc])
  2874. if test "x$XSLTPROC" = "x"; then
  2875. AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
  2876. have_xsltproc=no
  2877. else
  2878. have_xsltproc=yes
  2879. fi
  2880. elif test "x$use_xsltproc" = x"yes" ; then
  2881. AC_PATH_PROG([XSLTPROC], [xsltproc])
  2882. if test "x$XSLTPROC" = "x"; then
  2883. AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
  2884. fi
  2885. have_xsltproc=yes
  2886. elif test "x$use_xsltproc" = x"no" ; then
  2887. if test "x$XSLTPROC" != "x"; then
  2888. AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
  2889. fi
  2890. have_xsltproc=no
  2891. else
  2892. AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
  2893. fi
  2894. AM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
  2895. ]) # XORG_WITH_XSLTPROC
  2896. # XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
  2897. # ----------------------------------------
  2898. # Minimum version: 1.15.0
  2899. #
  2900. # PERL (Practical Extraction and Report Language) is a language optimized for
  2901. # scanning arbitrary text files, extracting information from those text files,
  2902. # and printing reports based on that information.
  2903. #
  2904. # When DEFAULT is not specified, --with-perl assumes 'auto'.
  2905. #
  2906. # Interface to module:
  2907. # HAVE_PERL: used in makefiles to conditionally scan text files
  2908. # PERL: returns the path of the perl program found
  2909. # returns the path set by the user in the environment
  2910. # --with-perl: 'yes' user instructs the module to use perl
  2911. # 'no' user instructs the module not to use perl
  2912. # have_perl: returns yes if perl found in PATH or no
  2913. #
  2914. # If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
  2915. #
  2916. AC_DEFUN([XORG_WITH_PERL],[
  2917. AC_ARG_VAR([PERL], [Path to perl command])
  2918. # Preserves the interface, should it be implemented later
  2919. m4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
  2920. m4_define([_defopt], m4_default([$2], [auto]))
  2921. AC_ARG_WITH(perl,
  2922. AS_HELP_STRING([--with-perl],
  2923. [Use perl for extracting information from files (default: ]_defopt[)]),
  2924. [use_perl=$withval], [use_perl=]_defopt)
  2925. m4_undefine([_defopt])
  2926. if test "x$use_perl" = x"auto"; then
  2927. AC_PATH_PROG([PERL], [perl])
  2928. if test "x$PERL" = "x"; then
  2929. AC_MSG_WARN([perl not found - cannot extract information and report])
  2930. have_perl=no
  2931. else
  2932. have_perl=yes
  2933. fi
  2934. elif test "x$use_perl" = x"yes" ; then
  2935. AC_PATH_PROG([PERL], [perl])
  2936. if test "x$PERL" = "x"; then
  2937. AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
  2938. fi
  2939. have_perl=yes
  2940. elif test "x$use_perl" = x"no" ; then
  2941. if test "x$PERL" != "x"; then
  2942. AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
  2943. fi
  2944. have_perl=no
  2945. else
  2946. AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
  2947. fi
  2948. AM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
  2949. ]) # XORG_WITH_PERL
  2950. # XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
  2951. # ----------------
  2952. # Minimum version: 1.5.0
  2953. # Minimum version for optional DEFAULT argument: 1.11.0
  2954. #
  2955. # Documentation tools are not always available on all platforms and sometimes
  2956. # not at the appropriate level. This macro enables a module to test for the
  2957. # presence of the tool and obtain it's path in separate variables. Coupled with
  2958. # the --with-asciidoc option, it allows maximum flexibilty in making decisions
  2959. # as whether or not to use the asciidoc package. When DEFAULT is not specified,
  2960. # --with-asciidoc assumes 'auto'.
  2961. #
  2962. # Interface to module:
  2963. # HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
  2964. # ASCIIDOC: returns the path of the asciidoc program found
  2965. # returns the path set by the user in the environment
  2966. # --with-asciidoc: 'yes' user instructs the module to use asciidoc
  2967. # 'no' user instructs the module not to use asciidoc
  2968. #
  2969. # If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
  2970. #
  2971. AC_DEFUN([XORG_WITH_ASCIIDOC],[
  2972. AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
  2973. m4_define([_defopt], m4_default([$2], [auto]))
  2974. AC_ARG_WITH(asciidoc,
  2975. AS_HELP_STRING([--with-asciidoc],
  2976. [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
  2977. [use_asciidoc=$withval], [use_asciidoc=]_defopt)
  2978. m4_undefine([_defopt])
  2979. if test "x$use_asciidoc" = x"auto"; then
  2980. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  2981. if test "x$ASCIIDOC" = "x"; then
  2982. AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
  2983. have_asciidoc=no
  2984. else
  2985. have_asciidoc=yes
  2986. fi
  2987. elif test "x$use_asciidoc" = x"yes" ; then
  2988. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  2989. if test "x$ASCIIDOC" = "x"; then
  2990. AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
  2991. fi
  2992. have_asciidoc=yes
  2993. elif test "x$use_asciidoc" = x"no" ; then
  2994. if test "x$ASCIIDOC" != "x"; then
  2995. AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
  2996. fi
  2997. have_asciidoc=no
  2998. else
  2999. AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
  3000. fi
  3001. m4_ifval([$1],
  3002. [if test "$have_asciidoc" = yes; then
  3003. # scrape the asciidoc version
  3004. AC_MSG_CHECKING([the asciidoc version])
  3005. asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
  3006. AC_MSG_RESULT([$asciidoc_version])
  3007. AS_VERSION_COMPARE([$asciidoc_version], [$1],
  3008. [if test "x$use_asciidoc" = xauto; then
  3009. AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
  3010. have_asciidoc=no
  3011. else
  3012. AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
  3013. fi])
  3014. fi])
  3015. AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
  3016. ]) # XORG_WITH_ASCIIDOC
  3017. # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
  3018. # --------------------------------
  3019. # Minimum version: 1.5.0
  3020. # Minimum version for optional DEFAULT argument: 1.11.0
  3021. #
  3022. # Documentation tools are not always available on all platforms and sometimes
  3023. # not at the appropriate level. This macro enables a module to test for the
  3024. # presence of the tool and obtain it's path in separate variables. Coupled with
  3025. # the --with-doxygen option, it allows maximum flexibilty in making decisions
  3026. # as whether or not to use the doxygen package. When DEFAULT is not specified,
  3027. # --with-doxygen assumes 'auto'.
  3028. #
  3029. # Interface to module:
  3030. # HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
  3031. # DOXYGEN: returns the path of the doxygen program found
  3032. # returns the path set by the user in the environment
  3033. # --with-doxygen: 'yes' user instructs the module to use doxygen
  3034. # 'no' user instructs the module not to use doxygen
  3035. #
  3036. # If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
  3037. #
  3038. AC_DEFUN([XORG_WITH_DOXYGEN],[
  3039. AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
  3040. m4_define([_defopt], m4_default([$2], [auto]))
  3041. AC_ARG_WITH(doxygen,
  3042. AS_HELP_STRING([--with-doxygen],
  3043. [Use doxygen to regenerate documentation (default: ]_defopt[)]),
  3044. [use_doxygen=$withval], [use_doxygen=]_defopt)
  3045. m4_undefine([_defopt])
  3046. if test "x$use_doxygen" = x"auto"; then
  3047. AC_PATH_PROG([DOXYGEN], [doxygen])
  3048. if test "x$DOXYGEN" = "x"; then
  3049. AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
  3050. have_doxygen=no
  3051. else
  3052. have_doxygen=yes
  3053. fi
  3054. elif test "x$use_doxygen" = x"yes" ; then
  3055. AC_PATH_PROG([DOXYGEN], [doxygen])
  3056. if test "x$DOXYGEN" = "x"; then
  3057. AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
  3058. fi
  3059. have_doxygen=yes
  3060. elif test "x$use_doxygen" = x"no" ; then
  3061. if test "x$DOXYGEN" != "x"; then
  3062. AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
  3063. fi
  3064. have_doxygen=no
  3065. else
  3066. AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
  3067. fi
  3068. m4_ifval([$1],
  3069. [if test "$have_doxygen" = yes; then
  3070. # scrape the doxygen version
  3071. AC_MSG_CHECKING([the doxygen version])
  3072. doxygen_version=`$DOXYGEN --version 2>/dev/null`
  3073. AC_MSG_RESULT([$doxygen_version])
  3074. AS_VERSION_COMPARE([$doxygen_version], [$1],
  3075. [if test "x$use_doxygen" = xauto; then
  3076. AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
  3077. have_doxygen=no
  3078. else
  3079. AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
  3080. fi])
  3081. fi])
  3082. AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
  3083. ]) # XORG_WITH_DOXYGEN
  3084. # XORG_WITH_GROFF([DEFAULT])
  3085. # ----------------
  3086. # Minimum version: 1.6.0
  3087. # Minimum version for optional DEFAULT argument: 1.11.0
  3088. #
  3089. # Documentation tools are not always available on all platforms and sometimes
  3090. # not at the appropriate level. This macro enables a module to test for the
  3091. # presence of the tool and obtain it's path in separate variables. Coupled with
  3092. # the --with-groff option, it allows maximum flexibilty in making decisions
  3093. # as whether or not to use the groff package. When DEFAULT is not specified,
  3094. # --with-groff assumes 'auto'.
  3095. #
  3096. # Interface to module:
  3097. # HAVE_GROFF: used in makefiles to conditionally generate documentation
  3098. # HAVE_GROFF_MM: the memorandum macros (-mm) package
  3099. # HAVE_GROFF_MS: the -ms macros package
  3100. # GROFF: returns the path of the groff program found
  3101. # returns the path set by the user in the environment
  3102. # --with-groff: 'yes' user instructs the module to use groff
  3103. # 'no' user instructs the module not to use groff
  3104. #
  3105. # Added in version 1.9.0:
  3106. # HAVE_GROFF_HTML: groff has dependencies to output HTML format:
  3107. # pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
  3108. # psselect from the psutils package.
  3109. # the ghostcript package. Refer to the grohtml man pages
  3110. #
  3111. # If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
  3112. #
  3113. # OS and distros often splits groff in a basic and full package, the former
  3114. # having the groff program and the later having devices, fonts and macros
  3115. # Checking for the groff executable is not enough.
  3116. #
  3117. # If macros are missing, we cannot assume that groff is useless, so we don't
  3118. # unset HAVE_GROFF or GROFF env variables.
  3119. # HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
  3120. #
  3121. AC_DEFUN([XORG_WITH_GROFF],[
  3122. AC_ARG_VAR([GROFF], [Path to groff command])
  3123. m4_define([_defopt], m4_default([$1], [auto]))
  3124. AC_ARG_WITH(groff,
  3125. AS_HELP_STRING([--with-groff],
  3126. [Use groff to regenerate documentation (default: ]_defopt[)]),
  3127. [use_groff=$withval], [use_groff=]_defopt)
  3128. m4_undefine([_defopt])
  3129. if test "x$use_groff" = x"auto"; then
  3130. AC_PATH_PROG([GROFF], [groff])
  3131. if test "x$GROFF" = "x"; then
  3132. AC_MSG_WARN([groff not found - documentation targets will be skipped])
  3133. have_groff=no
  3134. else
  3135. have_groff=yes
  3136. fi
  3137. elif test "x$use_groff" = x"yes" ; then
  3138. AC_PATH_PROG([GROFF], [groff])
  3139. if test "x$GROFF" = "x"; then
  3140. AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
  3141. fi
  3142. have_groff=yes
  3143. elif test "x$use_groff" = x"no" ; then
  3144. if test "x$GROFF" != "x"; then
  3145. AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
  3146. fi
  3147. have_groff=no
  3148. else
  3149. AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
  3150. fi
  3151. # We have groff, test for the presence of the macro packages
  3152. if test "x$have_groff" = x"yes"; then
  3153. AC_MSG_CHECKING([for ${GROFF} -ms macros])
  3154. if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
  3155. groff_ms_works=yes
  3156. else
  3157. groff_ms_works=no
  3158. fi
  3159. AC_MSG_RESULT([$groff_ms_works])
  3160. AC_MSG_CHECKING([for ${GROFF} -mm macros])
  3161. if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
  3162. groff_mm_works=yes
  3163. else
  3164. groff_mm_works=no
  3165. fi
  3166. AC_MSG_RESULT([$groff_mm_works])
  3167. fi
  3168. # We have groff, test for HTML dependencies, one command per package
  3169. if test "x$have_groff" = x"yes"; then
  3170. AC_PATH_PROGS(GS_PATH, [gs gswin32c])
  3171. AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
  3172. AC_PATH_PROG(PSSELECT_PATH, [psselect])
  3173. if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
  3174. have_groff_html=yes
  3175. else
  3176. have_groff_html=no
  3177. AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
  3178. fi
  3179. fi
  3180. # Set Automake conditionals for Makefiles
  3181. AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
  3182. AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
  3183. AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
  3184. AM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
  3185. ]) # XORG_WITH_GROFF
  3186. # XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
  3187. # ---------------------------------------
  3188. # Minimum version: 1.6.0
  3189. # Minimum version for optional DEFAULT argument: 1.11.0
  3190. # Minimum version for optional MIN-VERSION argument: 1.15.0
  3191. #
  3192. # Documentation tools are not always available on all platforms and sometimes
  3193. # not at the appropriate level. This macro enables a module to test for the
  3194. # presence of the tool and obtain it's path in separate variables. Coupled with
  3195. # the --with-fop option, it allows maximum flexibilty in making decisions
  3196. # as whether or not to use the fop package. When DEFAULT is not specified,
  3197. # --with-fop assumes 'auto'.
  3198. #
  3199. # Interface to module:
  3200. # HAVE_FOP: used in makefiles to conditionally generate documentation
  3201. # FOP: returns the path of the fop program found
  3202. # returns the path set by the user in the environment
  3203. # --with-fop: 'yes' user instructs the module to use fop
  3204. # 'no' user instructs the module not to use fop
  3205. #
  3206. # If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
  3207. #
  3208. AC_DEFUN([XORG_WITH_FOP],[
  3209. AC_ARG_VAR([FOP], [Path to fop command])
  3210. m4_define([_defopt], m4_default([$2], [auto]))
  3211. AC_ARG_WITH(fop,
  3212. AS_HELP_STRING([--with-fop],
  3213. [Use fop to regenerate documentation (default: ]_defopt[)]),
  3214. [use_fop=$withval], [use_fop=]_defopt)
  3215. m4_undefine([_defopt])
  3216. if test "x$use_fop" = x"auto"; then
  3217. AC_PATH_PROG([FOP], [fop])
  3218. if test "x$FOP" = "x"; then
  3219. AC_MSG_WARN([fop not found - documentation targets will be skipped])
  3220. have_fop=no
  3221. else
  3222. have_fop=yes
  3223. fi
  3224. elif test "x$use_fop" = x"yes" ; then
  3225. AC_PATH_PROG([FOP], [fop])
  3226. if test "x$FOP" = "x"; then
  3227. AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
  3228. fi
  3229. have_fop=yes
  3230. elif test "x$use_fop" = x"no" ; then
  3231. if test "x$FOP" != "x"; then
  3232. AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
  3233. fi
  3234. have_fop=no
  3235. else
  3236. AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
  3237. fi
  3238. # Test for a minimum version of fop, if provided.
  3239. m4_ifval([$1],
  3240. [if test "$have_fop" = yes; then
  3241. # scrape the fop version
  3242. AC_MSG_CHECKING([for fop minimum version])
  3243. fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
  3244. AC_MSG_RESULT([$fop_version])
  3245. AS_VERSION_COMPARE([$fop_version], [$1],
  3246. [if test "x$use_fop" = xauto; then
  3247. AC_MSG_WARN([fop version $fop_version found, but $1 needed])
  3248. have_fop=no
  3249. else
  3250. AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
  3251. fi])
  3252. fi])
  3253. AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
  3254. ]) # XORG_WITH_FOP
  3255. # XORG_WITH_PS2PDF([DEFAULT])
  3256. # ----------------
  3257. # Minimum version: 1.6.0
  3258. # Minimum version for optional DEFAULT argument: 1.11.0
  3259. #
  3260. # Documentation tools are not always available on all platforms and sometimes
  3261. # not at the appropriate level. This macro enables a module to test for the
  3262. # presence of the tool and obtain it's path in separate variables. Coupled with
  3263. # the --with-ps2pdf option, it allows maximum flexibilty in making decisions
  3264. # as whether or not to use the ps2pdf package. When DEFAULT is not specified,
  3265. # --with-ps2pdf assumes 'auto'.
  3266. #
  3267. # Interface to module:
  3268. # HAVE_PS2PDF: used in makefiles to conditionally generate documentation
  3269. # PS2PDF: returns the path of the ps2pdf program found
  3270. # returns the path set by the user in the environment
  3271. # --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
  3272. # 'no' user instructs the module not to use ps2pdf
  3273. #
  3274. # If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
  3275. #
  3276. AC_DEFUN([XORG_WITH_PS2PDF],[
  3277. AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
  3278. m4_define([_defopt], m4_default([$1], [auto]))
  3279. AC_ARG_WITH(ps2pdf,
  3280. AS_HELP_STRING([--with-ps2pdf],
  3281. [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
  3282. [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
  3283. m4_undefine([_defopt])
  3284. if test "x$use_ps2pdf" = x"auto"; then
  3285. AC_PATH_PROG([PS2PDF], [ps2pdf])
  3286. if test "x$PS2PDF" = "x"; then
  3287. AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
  3288. have_ps2pdf=no
  3289. else
  3290. have_ps2pdf=yes
  3291. fi
  3292. elif test "x$use_ps2pdf" = x"yes" ; then
  3293. AC_PATH_PROG([PS2PDF], [ps2pdf])
  3294. if test "x$PS2PDF" = "x"; then
  3295. AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
  3296. fi
  3297. have_ps2pdf=yes
  3298. elif test "x$use_ps2pdf" = x"no" ; then
  3299. if test "x$PS2PDF" != "x"; then
  3300. AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
  3301. fi
  3302. have_ps2pdf=no
  3303. else
  3304. AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
  3305. fi
  3306. AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
  3307. ]) # XORG_WITH_PS2PDF
  3308. # XORG_ENABLE_DOCS (enable_docs=yes)
  3309. # ----------------
  3310. # Minimum version: 1.6.0
  3311. #
  3312. # Documentation tools are not always available on all platforms and sometimes
  3313. # not at the appropriate level. This macro enables a builder to skip all
  3314. # documentation targets except traditional man pages.
  3315. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  3316. # maximum flexibilty in controlling documentation building.
  3317. # Refer to:
  3318. # XORG_WITH_XMLTO --with-xmlto
  3319. # XORG_WITH_ASCIIDOC --with-asciidoc
  3320. # XORG_WITH_DOXYGEN --with-doxygen
  3321. # XORG_WITH_FOP --with-fop
  3322. # XORG_WITH_GROFF --with-groff
  3323. # XORG_WITH_PS2PDF --with-ps2pdf
  3324. #
  3325. # Interface to module:
  3326. # ENABLE_DOCS: used in makefiles to conditionally generate documentation
  3327. # --enable-docs: 'yes' user instructs the module to generate docs
  3328. # 'no' user instructs the module not to generate docs
  3329. # parm1: specify the default value, yes or no.
  3330. #
  3331. AC_DEFUN([XORG_ENABLE_DOCS],[
  3332. m4_define([docs_default], m4_default([$1], [yes]))
  3333. AC_ARG_ENABLE(docs,
  3334. AS_HELP_STRING([--enable-docs],
  3335. [Enable building the documentation (default: ]docs_default[)]),
  3336. [build_docs=$enableval], [build_docs=]docs_default)
  3337. m4_undefine([docs_default])
  3338. AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
  3339. AC_MSG_CHECKING([whether to build documentation])
  3340. AC_MSG_RESULT([$build_docs])
  3341. ]) # XORG_ENABLE_DOCS
  3342. # XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
  3343. # ----------------
  3344. # Minimum version: 1.6.0
  3345. #
  3346. # This macro enables a builder to skip all developer documentation.
  3347. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  3348. # maximum flexibilty in controlling documentation building.
  3349. # Refer to:
  3350. # XORG_WITH_XMLTO --with-xmlto
  3351. # XORG_WITH_ASCIIDOC --with-asciidoc
  3352. # XORG_WITH_DOXYGEN --with-doxygen
  3353. # XORG_WITH_FOP --with-fop
  3354. # XORG_WITH_GROFF --with-groff
  3355. # XORG_WITH_PS2PDF --with-ps2pdf
  3356. #
  3357. # Interface to module:
  3358. # ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
  3359. # --enable-devel-docs: 'yes' user instructs the module to generate developer docs
  3360. # 'no' user instructs the module not to generate developer docs
  3361. # parm1: specify the default value, yes or no.
  3362. #
  3363. AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
  3364. m4_define([devel_default], m4_default([$1], [yes]))
  3365. AC_ARG_ENABLE(devel-docs,
  3366. AS_HELP_STRING([--enable-devel-docs],
  3367. [Enable building the developer documentation (default: ]devel_default[)]),
  3368. [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
  3369. m4_undefine([devel_default])
  3370. AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
  3371. AC_MSG_CHECKING([whether to build developer documentation])
  3372. AC_MSG_RESULT([$build_devel_docs])
  3373. ]) # XORG_ENABLE_DEVEL_DOCS
  3374. # XORG_ENABLE_SPECS (enable_specs=yes)
  3375. # ----------------
  3376. # Minimum version: 1.6.0
  3377. #
  3378. # This macro enables a builder to skip all functional specification targets.
  3379. # Combined with the specific tool checking macros XORG_WITH_*, it provides
  3380. # maximum flexibilty in controlling documentation building.
  3381. # Refer to:
  3382. # XORG_WITH_XMLTO --with-xmlto
  3383. # XORG_WITH_ASCIIDOC --with-asciidoc
  3384. # XORG_WITH_DOXYGEN --with-doxygen
  3385. # XORG_WITH_FOP --with-fop
  3386. # XORG_WITH_GROFF --with-groff
  3387. # XORG_WITH_PS2PDF --with-ps2pdf
  3388. #
  3389. # Interface to module:
  3390. # ENABLE_SPECS: used in makefiles to conditionally generate specs
  3391. # --enable-specs: 'yes' user instructs the module to generate specs
  3392. # 'no' user instructs the module not to generate specs
  3393. # parm1: specify the default value, yes or no.
  3394. #
  3395. AC_DEFUN([XORG_ENABLE_SPECS],[
  3396. m4_define([spec_default], m4_default([$1], [yes]))
  3397. AC_ARG_ENABLE(specs,
  3398. AS_HELP_STRING([--enable-specs],
  3399. [Enable building the specs (default: ]spec_default[)]),
  3400. [build_specs=$enableval], [build_specs=]spec_default)
  3401. m4_undefine([spec_default])
  3402. AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
  3403. AC_MSG_CHECKING([whether to build functional specifications])
  3404. AC_MSG_RESULT([$build_specs])
  3405. ]) # XORG_ENABLE_SPECS
  3406. # XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
  3407. # ----------------------------------------------
  3408. # Minimum version: 1.13.0
  3409. #
  3410. # This macro enables a builder to enable/disable unit testing
  3411. # It makes no assumption about the test cases implementation
  3412. # Test cases may or may not use Automake "Support for test suites"
  3413. # They may or may not use the software utility library GLib
  3414. #
  3415. # When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
  3416. # ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
  3417. # The variable enable_unit_tests is used by other macros in this file.
  3418. #
  3419. # Interface to module:
  3420. # ENABLE_UNIT_TESTS: used in makefiles to conditionally build tests
  3421. # enable_unit_tests: used in configure.ac for additional configuration
  3422. # --enable-unit-tests: 'yes' user instructs the module to build tests
  3423. # 'no' user instructs the module not to build tests
  3424. # parm1: specify the default value, yes or no.
  3425. #
  3426. AC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
  3427. AC_BEFORE([$0], [XORG_WITH_GLIB])
  3428. AC_BEFORE([$0], [XORG_LD_WRAP])
  3429. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  3430. m4_define([_defopt], m4_default([$1], [auto]))
  3431. AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
  3432. [Enable building unit test cases (default: ]_defopt[)]),
  3433. [enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
  3434. m4_undefine([_defopt])
  3435. AM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
  3436. AC_MSG_CHECKING([whether to build unit test cases])
  3437. AC_MSG_RESULT([$enable_unit_tests])
  3438. ]) # XORG_ENABLE_UNIT_TESTS
  3439. # XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
  3440. # ------------------------------------------------------
  3441. # Minimum version: 1.17.0
  3442. #
  3443. # This macro enables a builder to enable/disable integration testing
  3444. # It makes no assumption about the test cases' implementation
  3445. # Test cases may or may not use Automake "Support for test suites"
  3446. #
  3447. # Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
  3448. # usually requires less dependencies and may be built and run under less
  3449. # stringent environments than integration tests.
  3450. #
  3451. # Interface to module:
  3452. # ENABLE_INTEGRATION_TESTS: used in makefiles to conditionally build tests
  3453. # enable_integration_tests: used in configure.ac for additional configuration
  3454. # --enable-integration-tests: 'yes' user instructs the module to build tests
  3455. # 'no' user instructs the module not to build tests
  3456. # parm1: specify the default value, yes or no.
  3457. #
  3458. AC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
  3459. AC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
  3460. m4_define([_defopt], m4_default([$1], [auto]))
  3461. AC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
  3462. [Enable building integration test cases (default: ]_defopt[)]),
  3463. [enable_integration_tests=$enableval],
  3464. [enable_integration_tests=]_defopt)
  3465. m4_undefine([_defopt])
  3466. AM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
  3467. [test "x$enable_integration_tests" != xno])
  3468. AC_MSG_CHECKING([whether to build unit test cases])
  3469. AC_MSG_RESULT([$enable_integration_tests])
  3470. ]) # XORG_ENABLE_INTEGRATION_TESTS
  3471. # XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
  3472. # ----------------------------------------
  3473. # Minimum version: 1.13.0
  3474. #
  3475. # GLib is a library which provides advanced data structures and functions.
  3476. # This macro enables a module to test for the presence of Glib.
  3477. #
  3478. # When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
  3479. # Otherwise the value of $enable_unit_tests is blank.
  3480. #
  3481. # Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
  3482. # test support usually requires less dependencies and may be built and run under
  3483. # less stringent environments than integration tests.
  3484. #
  3485. # Interface to module:
  3486. # HAVE_GLIB: used in makefiles to conditionally build targets
  3487. # with_glib: used in configure.ac to know if GLib has been found
  3488. # --with-glib: 'yes' user instructs the module to use glib
  3489. # 'no' user instructs the module not to use glib
  3490. #
  3491. AC_DEFUN([XORG_WITH_GLIB],[
  3492. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  3493. m4_define([_defopt], m4_default([$2], [auto]))
  3494. AC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
  3495. [Use GLib library for unit testing (default: ]_defopt[)]),
  3496. [with_glib=$withval], [with_glib=]_defopt)
  3497. m4_undefine([_defopt])
  3498. have_glib=no
  3499. # Do not probe GLib if user explicitly disabled unit testing
  3500. if test "x$enable_unit_tests" != x"no"; then
  3501. # Do not probe GLib if user explicitly disabled it
  3502. if test "x$with_glib" != x"no"; then
  3503. m4_ifval(
  3504. [$1],
  3505. [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
  3506. [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
  3507. )
  3508. fi
  3509. fi
  3510. # Not having GLib when unit testing has been explicitly requested is an error
  3511. if test "x$enable_unit_tests" = x"yes"; then
  3512. if test "x$have_glib" = x"no"; then
  3513. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  3514. fi
  3515. fi
  3516. # Having unit testing disabled when GLib has been explicitly requested is an error
  3517. if test "x$enable_unit_tests" = x"no"; then
  3518. if test "x$with_glib" = x"yes"; then
  3519. AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
  3520. fi
  3521. fi
  3522. # Not having GLib when it has been explicitly requested is an error
  3523. if test "x$with_glib" = x"yes"; then
  3524. if test "x$have_glib" = x"no"; then
  3525. AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
  3526. fi
  3527. fi
  3528. AM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
  3529. ]) # XORG_WITH_GLIB
  3530. # XORG_LD_WRAP([required|optional])
  3531. # ---------------------------------
  3532. # Minimum version: 1.13.0
  3533. #
  3534. # Check if linker supports -wrap, passed via compiler flags
  3535. #
  3536. # When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
  3537. # Otherwise the value of $enable_unit_tests is blank.
  3538. #
  3539. # Argument added in 1.16.0 - default is "required", to match existing behavior
  3540. # of returning an error if enable_unit_tests is yes, and ld -wrap is not
  3541. # available, an argument of "optional" allows use when some unit tests require
  3542. # ld -wrap and others do not.
  3543. #
  3544. AC_DEFUN([XORG_LD_WRAP],[
  3545. XORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
  3546. [AC_LANG_PROGRAM([#include <stdlib.h>
  3547. void __wrap_exit(int status) { return; }],
  3548. [exit(0);])])
  3549. # Not having ld wrap when unit testing has been explicitly requested is an error
  3550. if test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
  3551. if test "x$have_ld_wrap" = x"no"; then
  3552. AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
  3553. fi
  3554. fi
  3555. AM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
  3556. #
  3557. ]) # XORG_LD_WRAP
  3558. # XORG_CHECK_LINKER_FLAGS
  3559. # -----------------------
  3560. # SYNOPSIS
  3561. #
  3562. # XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
  3563. #
  3564. # DESCRIPTION
  3565. #
  3566. # Check whether the given linker FLAGS work with the current language's
  3567. # linker, or whether they give an error.
  3568. #
  3569. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  3570. # success/failure.
  3571. #
  3572. # PROGRAM-SOURCE is the program source to link with, if needed
  3573. #
  3574. # NOTE: Based on AX_CHECK_COMPILER_FLAGS.
  3575. #
  3576. # LICENSE
  3577. #
  3578. # Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
  3579. # Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
  3580. # Copyright (c) 2009 Matteo Frigo
  3581. #
  3582. # This program is free software: you can redistribute it and/or modify it
  3583. # under the terms of the GNU General Public License as published by the
  3584. # Free Software Foundation, either version 3 of the License, or (at your
  3585. # option) any later version.
  3586. #
  3587. # This program is distributed in the hope that it will be useful, but
  3588. # WITHOUT ANY WARRANTY; without even the implied warranty of
  3589. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  3590. # Public License for more details.
  3591. #
  3592. # You should have received a copy of the GNU General Public License along
  3593. # with this program. If not, see <http://www.gnu.org/licenses/>.
  3594. #
  3595. # As a special exception, the respective Autoconf Macro's copyright owner
  3596. # gives unlimited permission to copy, distribute and modify the configure
  3597. # scripts that are the output of Autoconf when processing the Macro. You
  3598. # need not follow the terms of the GNU General Public License when using
  3599. # or distributing such scripts, even though portions of the text of the
  3600. # Macro appear in them. The GNU General Public License (GPL) does govern
  3601. # all other use of the material that constitutes the Autoconf Macro.
  3602. #
  3603. # This special exception to the GPL applies to versions of the Autoconf
  3604. # Macro released by the Autoconf Archive. When you make and distribute a
  3605. # modified version of the Autoconf Macro, you may extend this special
  3606. # exception to the GPL to apply to your modified version as well.#
  3607. AC_DEFUN([XORG_CHECK_LINKER_FLAGS],
  3608. [AC_MSG_CHECKING([whether the linker accepts $1])
  3609. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
  3610. AS_LITERAL_IF([$1],
  3611. [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
  3612. ax_save_FLAGS=$LDFLAGS
  3613. LDFLAGS="$1"
  3614. AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
  3615. AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  3616. AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  3617. LDFLAGS=$ax_save_FLAGS])],
  3618. [ax_save_FLAGS=$LDFLAGS
  3619. LDFLAGS="$1"
  3620. AC_LINK_IFELSE([AC_LANG_PROGRAM()],
  3621. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
  3622. eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
  3623. LDFLAGS=$ax_save_FLAGS])
  3624. eval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
  3625. AC_MSG_RESULT($xorg_check_linker_flags)
  3626. if test "x$xorg_check_linker_flags" = xyes; then
  3627. m4_default([$2], :)
  3628. else
  3629. m4_default([$3], :)
  3630. fi
  3631. ]) # XORG_CHECK_LINKER_FLAGS
  3632. # XORG_MEMORY_CHECK_FLAGS
  3633. # -----------------------
  3634. # Minimum version: 1.16.0
  3635. #
  3636. # This macro attempts to find appropriate memory checking functionality
  3637. # for various platforms which unit testing code may use to catch various
  3638. # forms of memory allocation and access errors in testing.
  3639. #
  3640. # Interface to module:
  3641. # XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
  3642. # Usually added to TESTS_ENVIRONMENT in Makefile.am
  3643. #
  3644. # If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
  3645. #
  3646. AC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
  3647. AC_REQUIRE([AC_CANONICAL_HOST])
  3648. AC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
  3649. [Environment variables to enable memory checking in tests])
  3650. # Check for different types of support on different platforms
  3651. case $host_os in
  3652. solaris*)
  3653. AC_CHECK_LIB([umem], [umem_alloc],
  3654. [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
  3655. ;;
  3656. *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
  3657. # both directly and inverted, so should not be 0 or 255.
  3658. malloc_debug_env='MALLOC_PERTURB_=15'
  3659. ;;
  3660. darwin*)
  3661. malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
  3662. ;;
  3663. *bsd*)
  3664. malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
  3665. ;;
  3666. esac
  3667. # User supplied flags override default flags
  3668. if test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
  3669. malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
  3670. fi
  3671. AC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
  3672. ]) # XORG_WITH_LINT
  3673. # XORG_CHECK_MALLOC_ZERO
  3674. # ----------------------
  3675. # Minimum version: 1.0.0
  3676. #
  3677. # Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
  3678. # malloc(0) returns NULL. Packages should add one of these cflags to
  3679. # their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
  3680. AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
  3681. AC_ARG_ENABLE(malloc0returnsnull,
  3682. AS_HELP_STRING([--enable-malloc0returnsnull],
  3683. [malloc(0) returns NULL (default: auto)]),
  3684. [MALLOC_ZERO_RETURNS_NULL=$enableval],
  3685. [MALLOC_ZERO_RETURNS_NULL=auto])
  3686. AC_MSG_CHECKING([whether malloc(0) returns NULL])
  3687. if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
  3688. AC_RUN_IFELSE([AC_LANG_PROGRAM([
  3689. #include <stdlib.h>
  3690. ],[
  3691. char *m0, *r0, *c0, *p;
  3692. m0 = malloc(0);
  3693. p = malloc(10);
  3694. r0 = realloc(p,0);
  3695. c0 = calloc(0,10);
  3696. exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
  3697. ])],
  3698. [MALLOC_ZERO_RETURNS_NULL=yes],
  3699. [MALLOC_ZERO_RETURNS_NULL=no],
  3700. [MALLOC_ZERO_RETURNS_NULL=yes])
  3701. fi
  3702. AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
  3703. if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
  3704. MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
  3705. XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
  3706. XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
  3707. else
  3708. MALLOC_ZERO_CFLAGS=""
  3709. XMALLOC_ZERO_CFLAGS=""
  3710. XTMALLOC_ZERO_CFLAGS=""
  3711. fi
  3712. AC_SUBST([MALLOC_ZERO_CFLAGS])
  3713. AC_SUBST([XMALLOC_ZERO_CFLAGS])
  3714. AC_SUBST([XTMALLOC_ZERO_CFLAGS])
  3715. ]) # XORG_CHECK_MALLOC_ZERO
  3716. # XORG_WITH_LINT()
  3717. # ----------------
  3718. # Minimum version: 1.1.0
  3719. #
  3720. # This macro enables the use of a tool that flags some suspicious and
  3721. # non-portable constructs (likely to be bugs) in C language source code.
  3722. # It will attempt to locate the tool and use appropriate options.
  3723. # There are various lint type tools on different platforms.
  3724. #
  3725. # Interface to module:
  3726. # LINT: returns the path to the tool found on the platform
  3727. # or the value set to LINT on the configure cmd line
  3728. # also an Automake conditional
  3729. # LINT_FLAGS: an Automake variable with appropriate flags
  3730. #
  3731. # --with-lint: 'yes' user instructs the module to use lint
  3732. # 'no' user instructs the module not to use lint (default)
  3733. #
  3734. # If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
  3735. # If the user sets the value of LINT_FLAGS, they are used verbatim.
  3736. #
  3737. AC_DEFUN([XORG_WITH_LINT],[
  3738. AC_ARG_VAR([LINT], [Path to a lint-style command])
  3739. AC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
  3740. AC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
  3741. [Use a lint-style source code checker (default: disabled)])],
  3742. [use_lint=$withval], [use_lint=no])
  3743. # Obtain platform specific info like program name and options
  3744. # The lint program on FreeBSD and NetBSD is different from the one on Solaris
  3745. case $host_os in
  3746. *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
  3747. lint_name=splint
  3748. lint_options="-badflag"
  3749. ;;
  3750. *freebsd* | *netbsd*)
  3751. lint_name=lint
  3752. lint_options="-u -b"
  3753. ;;
  3754. *solaris*)
  3755. lint_name=lint
  3756. lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
  3757. ;;
  3758. esac
  3759. # Test for the presence of the program (either guessed by the code or spelled out by the user)
  3760. if test "x$use_lint" = x"yes" ; then
  3761. AC_PATH_PROG([LINT], [$lint_name])
  3762. if test "x$LINT" = "x"; then
  3763. AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
  3764. fi
  3765. elif test "x$use_lint" = x"no" ; then
  3766. if test "x$LINT" != "x"; then
  3767. AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
  3768. fi
  3769. else
  3770. AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
  3771. fi
  3772. # User supplied flags override default flags
  3773. if test "x$LINT_FLAGS" != "x"; then
  3774. lint_options=$LINT_FLAGS
  3775. fi
  3776. AC_SUBST([LINT_FLAGS],[$lint_options])
  3777. AM_CONDITIONAL(LINT, [test "x$LINT" != x])
  3778. ]) # XORG_WITH_LINT
  3779. # XORG_LINT_LIBRARY(LIBNAME)
  3780. # --------------------------
  3781. # Minimum version: 1.1.0
  3782. #
  3783. # Sets up flags for building lint libraries for checking programs that call
  3784. # functions in the library.
  3785. #
  3786. # Interface to module:
  3787. # LINTLIB - Automake variable with the name of lint library file to make
  3788. # MAKE_LINT_LIB - Automake conditional
  3789. #
  3790. # --enable-lint-library: - 'yes' user instructs the module to created a lint library
  3791. # - 'no' user instructs the module not to create a lint library (default)
  3792. AC_DEFUN([XORG_LINT_LIBRARY],[
  3793. AC_REQUIRE([XORG_WITH_LINT])
  3794. AC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
  3795. [Create lint library (default: disabled)])],
  3796. [make_lint_lib=$enableval], [make_lint_lib=no])
  3797. if test "x$make_lint_lib" = x"yes" ; then
  3798. LINTLIB=llib-l$1.ln
  3799. if test "x$LINT" = "x"; then
  3800. AC_MSG_ERROR([Cannot make lint library without --with-lint])
  3801. fi
  3802. elif test "x$make_lint_lib" != x"no" ; then
  3803. AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
  3804. fi
  3805. AC_SUBST(LINTLIB)
  3806. AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
  3807. ]) # XORG_LINT_LIBRARY
  3808. # XORG_COMPILER_BRAND
  3809. # -------------------
  3810. # Minimum version: 1.14.0
  3811. #
  3812. # Checks for various brands of compilers and sets flags as appropriate:
  3813. # GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
  3814. # GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
  3815. # clang compiler - sets CLANGCC to "yes"
  3816. # Intel compiler - sets INTELCC to "yes"
  3817. # Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
  3818. #
  3819. AC_DEFUN([XORG_COMPILER_BRAND], [
  3820. AC_LANG_CASE(
  3821. [C], [
  3822. AC_REQUIRE([AC_PROG_CC_C99])
  3823. ],
  3824. [C++], [
  3825. AC_REQUIRE([AC_PROG_CXX])
  3826. ]
  3827. )
  3828. AC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
  3829. AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
  3830. AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
  3831. ]) # XORG_COMPILER_BRAND
  3832. # XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
  3833. # ---------------
  3834. # Minimum version: 1.16.0
  3835. #
  3836. # Test if the compiler works when passed the given flag as a command line argument.
  3837. # If it succeeds, the flag is appeneded to the given variable. If not, it tries the
  3838. # next flag in the list until there are no more options.
  3839. #
  3840. # Note that this does not guarantee that the compiler supports the flag as some
  3841. # compilers will simply ignore arguments that they do not understand, but we do
  3842. # attempt to weed out false positives by using -Werror=unknown-warning-option and
  3843. # -Werror=unused-command-line-argument
  3844. #
  3845. AC_DEFUN([XORG_TESTSET_CFLAG], [
  3846. m4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  3847. m4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
  3848. AC_LANG_COMPILER_REQUIRE
  3849. AC_LANG_CASE(
  3850. [C], [
  3851. AC_REQUIRE([AC_PROG_CC_C99])
  3852. define([PREFIX], [C])
  3853. define([CACHE_PREFIX], [cc])
  3854. define([COMPILER], [$CC])
  3855. ],
  3856. [C++], [
  3857. define([PREFIX], [CXX])
  3858. define([CACHE_PREFIX], [cxx])
  3859. define([COMPILER], [$CXX])
  3860. ]
  3861. )
  3862. [xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
  3863. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
  3864. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  3865. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
  3866. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
  3867. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  3868. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
  3869. [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
  3870. [xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
  3871. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  3872. fi
  3873. if test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
  3874. if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
  3875. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  3876. fi
  3877. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  3878. AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
  3879. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
  3880. AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
  3881. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
  3882. [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
  3883. [xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
  3884. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  3885. fi
  3886. found="no"
  3887. m4_foreach([flag], m4_cdr($@), [
  3888. if test $found = "no" ; then
  3889. if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
  3890. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
  3891. fi
  3892. if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
  3893. PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
  3894. fi
  3895. PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
  3896. dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
  3897. AC_MSG_CHECKING([if ]COMPILER[ supports]flag[])
  3898. cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
  3899. AC_CACHE_VAL($cacheid,
  3900. [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
  3901. [eval $cacheid=yes],
  3902. [eval $cacheid=no])])
  3903. PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
  3904. eval supported=\$$cacheid
  3905. AC_MSG_RESULT([$supported])
  3906. if test "$supported" = "yes" ; then
  3907. $1="$$1 ]flag["
  3908. found="yes"
  3909. fi
  3910. fi
  3911. ])
  3912. ]) # XORG_TESTSET_CFLAG
  3913. # XORG_COMPILER_FLAGS
  3914. # ---------------
  3915. # Minimum version: 1.16.0
  3916. #
  3917. # Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
  3918. # arguments supported by the selected compiler which do NOT alter the generated
  3919. # code. These arguments will cause the compiler to print various warnings
  3920. # during compilation AND turn a conservative set of warnings into errors.
  3921. #
  3922. # The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
  3923. # future versions of util-macros as options are added to new compilers.
  3924. #
  3925. AC_DEFUN([XORG_COMPILER_FLAGS], [
  3926. AC_REQUIRE([XORG_COMPILER_BRAND])
  3927. AC_ARG_ENABLE(selective-werror,
  3928. AS_HELP_STRING([--disable-selective-werror],
  3929. [Turn off selective compiler errors. (default: enabled)]),
  3930. [SELECTIVE_WERROR=$enableval],
  3931. [SELECTIVE_WERROR=yes])
  3932. AC_LANG_CASE(
  3933. [C], [
  3934. define([PREFIX], [C])
  3935. ],
  3936. [C++], [
  3937. define([PREFIX], [CXX])
  3938. ]
  3939. )
  3940. # -v is too short to test reliably with XORG_TESTSET_CFLAG
  3941. if test "x$SUNCC" = "xyes"; then
  3942. [BASE_]PREFIX[FLAGS]="-v"
  3943. else
  3944. [BASE_]PREFIX[FLAGS]=""
  3945. fi
  3946. # This chunk of warnings were those that existed in the legacy CWARNFLAGS
  3947. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
  3948. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
  3949. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
  3950. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
  3951. AC_LANG_CASE(
  3952. [C], [
  3953. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
  3954. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
  3955. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
  3956. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
  3957. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
  3958. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
  3959. ]
  3960. )
  3961. # This chunk adds additional warnings that could catch undesired effects.
  3962. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
  3963. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
  3964. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
  3965. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
  3966. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
  3967. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
  3968. # These are currently disabled because they are noisy. They will be enabled
  3969. # in the future once the codebase is sufficiently modernized to silence
  3970. # them. For now, I don't want them to drown out the other warnings.
  3971. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
  3972. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
  3973. # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
  3974. # Turn some warnings into errors, so we don't accidently get successful builds
  3975. # when there are problems that should be fixed.
  3976. if test "x$SELECTIVE_WERROR" = "xyes" ; then
  3977. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
  3978. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
  3979. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
  3980. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
  3981. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
  3982. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
  3983. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
  3984. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
  3985. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
  3986. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
  3987. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
  3988. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
  3989. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
  3990. else
  3991. 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])
  3992. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
  3993. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
  3994. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
  3995. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
  3996. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
  3997. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
  3998. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
  3999. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
  4000. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
  4001. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
  4002. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
  4003. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
  4004. XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
  4005. fi
  4006. AC_SUBST([BASE_]PREFIX[FLAGS])
  4007. ]) # XORG_COMPILER_FLAGS
  4008. # XORG_CWARNFLAGS
  4009. # ---------------
  4010. # Minimum version: 1.2.0
  4011. # Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
  4012. #
  4013. # Defines CWARNFLAGS to enable C compiler warnings.
  4014. #
  4015. # This function is deprecated because it defines -fno-strict-aliasing
  4016. # which alters the code generated by the compiler. If -fno-strict-aliasing
  4017. # is needed, then it should be added explicitly in the module when
  4018. # it is updated to use BASE_CFLAGS.
  4019. #
  4020. AC_DEFUN([XORG_CWARNFLAGS], [
  4021. AC_REQUIRE([XORG_COMPILER_FLAGS])
  4022. AC_REQUIRE([XORG_COMPILER_BRAND])
  4023. AC_LANG_CASE(
  4024. [C], [
  4025. CWARNFLAGS="$BASE_CFLAGS"
  4026. if test "x$GCC" = xyes ; then
  4027. CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
  4028. fi
  4029. AC_SUBST(CWARNFLAGS)
  4030. ]
  4031. )
  4032. ]) # XORG_CWARNFLAGS
  4033. # XORG_STRICT_OPTION
  4034. # -----------------------
  4035. # Minimum version: 1.3.0
  4036. #
  4037. # Add configure option to enable strict compilation flags, such as treating
  4038. # warnings as fatal errors.
  4039. # If --enable-strict-compilation is passed to configure, adds strict flags to
  4040. # $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
  4041. #
  4042. # Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
  4043. # when strict compilation is unconditionally desired.
  4044. AC_DEFUN([XORG_STRICT_OPTION], [
  4045. AC_REQUIRE([XORG_CWARNFLAGS])
  4046. AC_REQUIRE([XORG_COMPILER_FLAGS])
  4047. AC_ARG_ENABLE(strict-compilation,
  4048. AS_HELP_STRING([--enable-strict-compilation],
  4049. [Enable all warnings from compiler and make them errors (default: disabled)]),
  4050. [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
  4051. AC_LANG_CASE(
  4052. [C], [
  4053. define([PREFIX], [C])
  4054. ],
  4055. [C++], [
  4056. define([PREFIX], [CXX])
  4057. ]
  4058. )
  4059. [STRICT_]PREFIX[FLAGS]=""
  4060. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
  4061. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
  4062. # Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
  4063. # activate it with -Werror, so we add it here explicitly.
  4064. XORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
  4065. if test "x$STRICT_COMPILE" = "xyes"; then
  4066. [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
  4067. AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
  4068. fi
  4069. AC_SUBST([STRICT_]PREFIX[FLAGS])
  4070. AC_SUBST([BASE_]PREFIX[FLAGS])
  4071. AC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
  4072. ]) # XORG_STRICT_OPTION
  4073. # XORG_DEFAULT_OPTIONS
  4074. # --------------------
  4075. # Minimum version: 1.3.0
  4076. #
  4077. # Defines default options for X.Org modules.
  4078. #
  4079. AC_DEFUN([XORG_DEFAULT_OPTIONS], [
  4080. AC_REQUIRE([AC_PROG_INSTALL])
  4081. XORG_COMPILER_FLAGS
  4082. XORG_CWARNFLAGS
  4083. XORG_STRICT_OPTION
  4084. XORG_RELEASE_VERSION
  4085. XORG_CHANGELOG
  4086. XORG_INSTALL
  4087. XORG_MANPAGE_SECTIONS
  4088. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
  4089. [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
  4090. ]) # XORG_DEFAULT_OPTIONS
  4091. # XORG_INSTALL()
  4092. # ----------------
  4093. # Minimum version: 1.4.0
  4094. #
  4095. # Defines the variable INSTALL_CMD as the command to copy
  4096. # INSTALL from $prefix/share/util-macros.
  4097. #
  4098. AC_DEFUN([XORG_INSTALL], [
  4099. AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  4100. macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
  4101. INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
  4102. mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
  4103. || (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
  4104. echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
  4105. AC_SUBST([INSTALL_CMD])
  4106. ]) # XORG_INSTALL
  4107. dnl Copyright 2005 Red Hat, Inc
  4108. dnl
  4109. dnl Permission to use, copy, modify, distribute, and sell this software and its
  4110. dnl documentation for any purpose is hereby granted without fee, provided that
  4111. dnl the above copyright notice appear in all copies and that both that
  4112. dnl copyright notice and this permission notice appear in supporting
  4113. dnl documentation.
  4114. dnl
  4115. dnl The above copyright notice and this permission notice shall be included
  4116. dnl in all copies or substantial portions of the Software.
  4117. dnl
  4118. dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  4119. dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  4120. dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  4121. dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
  4122. dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  4123. dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  4124. dnl OTHER DEALINGS IN THE SOFTWARE.
  4125. dnl
  4126. dnl Except as contained in this notice, the name of the copyright holders shall
  4127. dnl not be used in advertising or otherwise to promote the sale, use or
  4128. dnl other dealings in this Software without prior written authorization
  4129. dnl from the copyright holders.
  4130. dnl
  4131. # XORG_RELEASE_VERSION
  4132. # --------------------
  4133. # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
  4134. AC_DEFUN([XORG_RELEASE_VERSION],[
  4135. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
  4136. [`echo $PACKAGE_VERSION | cut -d . -f 1`],
  4137. [Major version of this package])
  4138. PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
  4139. if test "x$PVM" = "x"; then
  4140. PVM="0"
  4141. fi
  4142. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
  4143. [$PVM],
  4144. [Minor version of this package])
  4145. PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
  4146. if test "x$PVP" = "x"; then
  4147. PVP="0"
  4148. fi
  4149. AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
  4150. [$PVP],
  4151. [Patch version of this package])
  4152. ])
  4153. # XORG_CHANGELOG()
  4154. # ----------------
  4155. # Minimum version: 1.2.0
  4156. #
  4157. # Defines the variable CHANGELOG_CMD as the command to generate
  4158. # ChangeLog from git.
  4159. #
  4160. #
  4161. AC_DEFUN([XORG_CHANGELOG], [
  4162. CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
  4163. mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
  4164. || (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
  4165. echo 'git directory not found: installing possibly empty changelog.' >&2)"
  4166. AC_SUBST([CHANGELOG_CMD])
  4167. ]) # XORG_CHANGELOG