aclocal.m4 252 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676
  1. # generated automatically by aclocal 1.16.1 -*- Autoconf -*-
  2. # Copyright (C) 1996-2018 Free Software Foundation, Inc.
  3. # This file is free software; the Free Software Foundation
  4. # gives unlimited permission to copy and/or distribute it,
  5. # with or without modifications, as long as this notice is preserved.
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. # PARTICULAR PURPOSE.
  10. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
  11. m4_ifndef([AC_AUTOCONF_VERSION],
  12. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  13. m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
  14. [m4_warning([this file was generated for autoconf 2.69.
  15. You have another version of autoconf. It may work, but is not guaranteed to.
  16. If you have problems, you may need to regenerate the build system entirely.
  17. To do so, use the procedure documented by the package, typically 'autoreconf'.])])
  18. # ============================================================================
  19. # https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
  20. # ============================================================================
  21. #
  22. # SYNOPSIS
  23. #
  24. # AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
  25. #
  26. # DESCRIPTION
  27. #
  28. # For every FLAG1, FLAG2 it is checked whether the compiler works with the
  29. # flag. If it does, the flag is added FLAGS-VARIABLE
  30. #
  31. # If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
  32. # CFLAGS) is used. During the check the flag is always added to the
  33. # current language's flags.
  34. #
  35. # If EXTRA-FLAGS is defined, it is added to the current language's default
  36. # flags (e.g. CFLAGS) when the check is done. The check is thus made with
  37. # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
  38. # force the compiler to issue an error when a bad flag is given.
  39. #
  40. # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
  41. #
  42. # NOTE: This macro depends on the AX_APPEND_FLAG and
  43. # AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
  44. # AX_APPEND_LINK_FLAGS.
  45. #
  46. # LICENSE
  47. #
  48. # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  49. #
  50. # Copying and distribution of this file, with or without modification, are
  51. # permitted in any medium without royalty provided the copyright notice
  52. # and this notice are preserved. This file is offered as-is, without any
  53. # warranty.
  54. #serial 7
  55. AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
  56. [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
  57. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  58. for flag in $1; do
  59. AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
  60. done
  61. ])dnl AX_APPEND_COMPILE_FLAGS
  62. # ===========================================================================
  63. # https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
  64. # ===========================================================================
  65. #
  66. # SYNOPSIS
  67. #
  68. # AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
  69. #
  70. # DESCRIPTION
  71. #
  72. # FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
  73. # added in between.
  74. #
  75. # If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
  76. # CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
  77. # FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
  78. # FLAG.
  79. #
  80. # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
  81. #
  82. # LICENSE
  83. #
  84. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  85. # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  86. #
  87. # Copying and distribution of this file, with or without modification, are
  88. # permitted in any medium without royalty provided the copyright notice
  89. # and this notice are preserved. This file is offered as-is, without any
  90. # warranty.
  91. #serial 8
  92. AC_DEFUN([AX_APPEND_FLAG],
  93. [dnl
  94. AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
  95. AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
  96. AS_VAR_SET_IF(FLAGS,[
  97. AS_CASE([" AS_VAR_GET(FLAGS) "],
  98. [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
  99. [
  100. AS_VAR_APPEND(FLAGS,[" $1"])
  101. AC_RUN_LOG([: FLAGS="$FLAGS"])
  102. ])
  103. ],
  104. [
  105. AS_VAR_SET(FLAGS,[$1])
  106. AC_RUN_LOG([: FLAGS="$FLAGS"])
  107. ])
  108. AS_VAR_POPDEF([FLAGS])dnl
  109. ])dnl AX_APPEND_FLAG
  110. # ===========================================================================
  111. # https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
  112. # ===========================================================================
  113. #
  114. # SYNOPSIS
  115. #
  116. # AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
  117. #
  118. # DESCRIPTION
  119. #
  120. # For every FLAG1, FLAG2 it is checked whether the linker works with the
  121. # flag. If it does, the flag is added FLAGS-VARIABLE
  122. #
  123. # If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
  124. # used. During the check the flag is always added to the linker's flags.
  125. #
  126. # If EXTRA-FLAGS is defined, it is added to the linker's default flags
  127. # when the check is done. The check is thus made with the flags: "LDFLAGS
  128. # EXTRA-FLAGS FLAG". This can for example be used to force the linker to
  129. # issue an error when a bad flag is given.
  130. #
  131. # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
  132. #
  133. # NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
  134. # Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
  135. #
  136. # LICENSE
  137. #
  138. # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  139. #
  140. # Copying and distribution of this file, with or without modification, are
  141. # permitted in any medium without royalty provided the copyright notice
  142. # and this notice are preserved. This file is offered as-is, without any
  143. # warranty.
  144. #serial 7
  145. AC_DEFUN([AX_APPEND_LINK_FLAGS],
  146. [AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
  147. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  148. for flag in $1; do
  149. AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
  150. done
  151. ])dnl AX_APPEND_LINK_FLAGS
  152. # ===========================================================================
  153. # https://www.gnu.org/software/autoconf-archive/ax_cflags_warn_all.html
  154. # ===========================================================================
  155. #
  156. # SYNOPSIS
  157. #
  158. # AX_CFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
  159. # AX_CXXFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
  160. # AX_FCFLAGS_WARN_ALL [(shellvar [,default, [A/NA]])]
  161. #
  162. # DESCRIPTION
  163. #
  164. # Try to find a compiler option that enables most reasonable warnings.
  165. #
  166. # For the GNU compiler it will be -Wall (and -ansi -pedantic) The result
  167. # is added to the shellvar being CFLAGS, CXXFLAGS, or FCFLAGS by default.
  168. #
  169. # Currently this macro knows about the GCC, Solaris, Digital Unix, AIX,
  170. # HP-UX, IRIX, NEC SX-5 (Super-UX 10), Cray J90 (Unicos 10.0.0.8), and
  171. # Intel compilers. For a given compiler, the Fortran flags are much more
  172. # experimental than their C equivalents.
  173. #
  174. # - $1 shell-variable-to-add-to : CFLAGS, CXXFLAGS, or FCFLAGS
  175. # - $2 add-value-if-not-found : nothing
  176. # - $3 action-if-found : add value to shellvariable
  177. # - $4 action-if-not-found : nothing
  178. #
  179. # NOTE: These macros depend on AX_APPEND_FLAG.
  180. #
  181. # LICENSE
  182. #
  183. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  184. # Copyright (c) 2010 Rhys Ulerich <rhys.ulerich@gmail.com>
  185. #
  186. # This program is free software; you can redistribute it and/or modify it
  187. # under the terms of the GNU General Public License as published by the
  188. # Free Software Foundation; either version 3 of the License, or (at your
  189. # option) any later version.
  190. #
  191. # This program is distributed in the hope that it will be useful, but
  192. # WITHOUT ANY WARRANTY; without even the implied warranty of
  193. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  194. # Public License for more details.
  195. #
  196. # You should have received a copy of the GNU General Public License along
  197. # with this program. If not, see <https://www.gnu.org/licenses/>.
  198. #
  199. # As a special exception, the respective Autoconf Macro's copyright owner
  200. # gives unlimited permission to copy, distribute and modify the configure
  201. # scripts that are the output of Autoconf when processing the Macro. You
  202. # need not follow the terms of the GNU General Public License when using
  203. # or distributing such scripts, even though portions of the text of the
  204. # Macro appear in them. The GNU General Public License (GPL) does govern
  205. # all other use of the material that constitutes the Autoconf Macro.
  206. #
  207. # This special exception to the GPL applies to versions of the Autoconf
  208. # Macro released by the Autoconf Archive. When you make and distribute a
  209. # modified version of the Autoconf Macro, you may extend this special
  210. # exception to the GPL to apply to your modified version as well.
  211. #serial 16
  212. AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl
  213. AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl
  214. AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl
  215. AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings],
  216. VAR,[VAR="no, unknown"
  217. ac_save_[]FLAGS="$[]FLAGS"
  218. for ac_arg dnl
  219. in "-warn all % -warn all" dnl Intel
  220. "-pedantic % -Wall" dnl GCC
  221. "-xstrconst % -v" dnl Solaris C
  222. "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix
  223. "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX
  224. "-ansi -ansiE % -fullwarn" dnl IRIX
  225. "+ESlit % +w1" dnl HP-UX C
  226. "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10)
  227. "-h conform % -h msglevel 2" dnl Cray C (Unicos)
  228. #
  229. do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
  230. AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
  231. [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break])
  232. done
  233. FLAGS="$ac_save_[]FLAGS"
  234. ])
  235. AS_VAR_POPDEF([FLAGS])dnl
  236. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  237. case ".$VAR" in
  238. .ok|.ok,*) m4_ifvaln($3,$3) ;;
  239. .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;;
  240. *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;;
  241. esac
  242. AS_VAR_POPDEF([VAR])dnl
  243. ])dnl AX_FLAGS_WARN_ALL
  244. dnl implementation tactics:
  245. dnl the for-argument contains a list of options. The first part of
  246. dnl these does only exist to detect the compiler - usually it is
  247. dnl a global option to enable -ansi or -extrawarnings. All other
  248. dnl compilers will fail about it. That was needed since a lot of
  249. dnl compilers will give false positives for some option-syntax
  250. dnl like -Woption or -Xoption as they think of it is a pass-through
  251. dnl to later compile stages or something. The "%" is used as a
  252. dnl delimiter. A non-option comment can be given after "%%" marks
  253. dnl which will be shown but not added to the respective C/CXXFLAGS.
  254. AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl
  255. AC_LANG_PUSH([C])
  256. AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
  257. AC_LANG_POP([C])
  258. ])
  259. AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl
  260. AC_LANG_PUSH([C++])
  261. AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
  262. AC_LANG_POP([C++])
  263. ])
  264. AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl
  265. AC_LANG_PUSH([Fortran])
  266. AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4])
  267. AC_LANG_POP([Fortran])
  268. ])
  269. # ===========================================================================
  270. # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
  271. # ===========================================================================
  272. #
  273. # SYNOPSIS
  274. #
  275. # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
  276. #
  277. # DESCRIPTION
  278. #
  279. # Check whether the given FLAG works with the current language's compiler
  280. # or gives an error. (Warnings, however, are ignored)
  281. #
  282. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  283. # success/failure.
  284. #
  285. # If EXTRA-FLAGS is defined, it is added to the current language's default
  286. # flags (e.g. CFLAGS) when the check is done. The check is thus made with
  287. # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
  288. # force the compiler to issue an error when a bad flag is given.
  289. #
  290. # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
  291. #
  292. # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
  293. # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
  294. #
  295. # LICENSE
  296. #
  297. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  298. # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  299. #
  300. # Copying and distribution of this file, with or without modification, are
  301. # permitted in any medium without royalty provided the copyright notice
  302. # and this notice are preserved. This file is offered as-is, without any
  303. # warranty.
  304. #serial 6
  305. AC_DEFUN([AX_CHECK_COMPILE_FLAG],
  306. [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
  307. AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
  308. AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
  309. ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
  310. _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
  311. AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
  312. [AS_VAR_SET(CACHEVAR,[yes])],
  313. [AS_VAR_SET(CACHEVAR,[no])])
  314. _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
  315. AS_VAR_IF(CACHEVAR,yes,
  316. [m4_default([$2], :)],
  317. [m4_default([$3], :)])
  318. AS_VAR_POPDEF([CACHEVAR])dnl
  319. ])dnl AX_CHECK_COMPILE_FLAGS
  320. # ===========================================================================
  321. # https://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html
  322. # ===========================================================================
  323. #
  324. # SYNOPSIS
  325. #
  326. # AX_CHECK_ENABLE_DEBUG([enable by default=yes/info/profile/no], [ENABLE DEBUG VARIABLES ...], [DISABLE DEBUG VARIABLES NDEBUG ...], [IS-RELEASE])
  327. #
  328. # DESCRIPTION
  329. #
  330. # Check for the presence of an --enable-debug option to configure, with
  331. # the specified default value used when the option is not present. Return
  332. # the value in the variable $ax_enable_debug.
  333. #
  334. # Specifying 'yes' adds '-g -O0' to the compilation flags for all
  335. # languages. Specifying 'info' adds '-g' to the compilation flags.
  336. # Specifying 'profile' adds '-g -pg' to the compilation flags and '-pg' to
  337. # the linking flags. Otherwise, nothing is added.
  338. #
  339. # Define the variables listed in the second argument if debug is enabled,
  340. # defaulting to no variables. Defines the variables listed in the third
  341. # argument if debug is disabled, defaulting to NDEBUG. All lists of
  342. # variables should be space-separated.
  343. #
  344. # If debug is not enabled, ensure AC_PROG_* will not add debugging flags.
  345. # Should be invoked prior to any AC_PROG_* compiler checks.
  346. #
  347. # IS-RELEASE can be used to change the default to 'no' when making a
  348. # release. Set IS-RELEASE to 'yes' or 'no' as appropriate. By default, it
  349. # uses the value of $ax_is_release, so if you are using the AX_IS_RELEASE
  350. # macro, there is no need to pass this parameter.
  351. #
  352. # AX_IS_RELEASE([git-directory])
  353. # AX_CHECK_ENABLE_DEBUG()
  354. #
  355. # LICENSE
  356. #
  357. # Copyright (c) 2011 Rhys Ulerich <rhys.ulerich@gmail.com>
  358. # Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
  359. #
  360. # Copying and distribution of this file, with or without modification, are
  361. # permitted in any medium without royalty provided the copyright notice
  362. # and this notice are preserved.
  363. #serial 9
  364. AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[
  365. AC_BEFORE([$0],[AC_PROG_CC])dnl
  366. AC_BEFORE([$0],[AC_PROG_CXX])dnl
  367. AC_BEFORE([$0],[AC_PROG_F77])dnl
  368. AC_BEFORE([$0],[AC_PROG_FC])dnl
  369. AC_MSG_CHECKING(whether to enable debugging)
  370. ax_enable_debug_default=m4_tolower(m4_normalize(ifelse([$1],,[no],[$1])))
  371. ax_enable_debug_is_release=m4_tolower(m4_normalize(ifelse([$4],,
  372. [$ax_is_release],
  373. [$4])))
  374. # If this is a release, override the default.
  375. AS_IF([test "$ax_enable_debug_is_release" = "yes"],
  376. [ax_enable_debug_default="no"])
  377. m4_define(ax_enable_debug_vars,[m4_normalize(ifelse([$2],,,[$2]))])
  378. m4_define(ax_disable_debug_vars,[m4_normalize(ifelse([$3],,[NDEBUG],[$3]))])
  379. AC_ARG_ENABLE(debug,
  380. [AS_HELP_STRING([--enable-debug=]@<:@yes/info/profile/no@:>@,[compile with debugging])],
  381. [],enable_debug=$ax_enable_debug_default)
  382. # empty mean debug yes
  383. AS_IF([test "x$enable_debug" = "x"],
  384. [enable_debug="yes"])
  385. # case of debug
  386. AS_CASE([$enable_debug],
  387. [yes],[
  388. AC_MSG_RESULT(yes)
  389. CFLAGS="${CFLAGS} -g -O0"
  390. CXXFLAGS="${CXXFLAGS} -g -O0"
  391. FFLAGS="${FFLAGS} -g -O0"
  392. FCFLAGS="${FCFLAGS} -g -O0"
  393. OBJCFLAGS="${OBJCFLAGS} -g -O0"
  394. ],
  395. [info],[
  396. AC_MSG_RESULT(info)
  397. CFLAGS="${CFLAGS} -g"
  398. CXXFLAGS="${CXXFLAGS} -g"
  399. FFLAGS="${FFLAGS} -g"
  400. FCFLAGS="${FCFLAGS} -g"
  401. OBJCFLAGS="${OBJCFLAGS} -g"
  402. ],
  403. [profile],[
  404. AC_MSG_RESULT(profile)
  405. CFLAGS="${CFLAGS} -g -pg"
  406. CXXFLAGS="${CXXFLAGS} -g -pg"
  407. FFLAGS="${FFLAGS} -g -pg"
  408. FCFLAGS="${FCFLAGS} -g -pg"
  409. OBJCFLAGS="${OBJCFLAGS} -g -pg"
  410. LDFLAGS="${LDFLAGS} -pg"
  411. ],
  412. [
  413. AC_MSG_RESULT(no)
  414. dnl Ensure AC_PROG_CC/CXX/F77/FC/OBJC will not enable debug flags
  415. dnl by setting any unset environment flag variables
  416. AS_IF([test "x${CFLAGS+set}" != "xset"],
  417. [CFLAGS=""])
  418. AS_IF([test "x${CXXFLAGS+set}" != "xset"],
  419. [CXXFLAGS=""])
  420. AS_IF([test "x${FFLAGS+set}" != "xset"],
  421. [FFLAGS=""])
  422. AS_IF([test "x${FCFLAGS+set}" != "xset"],
  423. [FCFLAGS=""])
  424. AS_IF([test "x${OBJCFLAGS+set}" != "xset"],
  425. [OBJCFLAGS=""])
  426. ])
  427. dnl Define various variables if debugging is disabled.
  428. dnl assert.h is a NOP if NDEBUG is defined, so define it by default.
  429. AS_IF([test "x$enable_debug" = "xyes"],
  430. [m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,[1],[Define if debugging is enabled])])],
  431. [m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,[1],[Define if debugging is disabled])])])
  432. ax_enable_debug=$enable_debug
  433. ])
  434. # ===========================================================================
  435. # https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
  436. # ===========================================================================
  437. #
  438. # SYNOPSIS
  439. #
  440. # AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
  441. #
  442. # DESCRIPTION
  443. #
  444. # Check whether the given FLAG works with the linker or gives an error.
  445. # (Warnings, however, are ignored)
  446. #
  447. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  448. # success/failure.
  449. #
  450. # If EXTRA-FLAGS is defined, it is added to the linker's default flags
  451. # when the check is done. The check is thus made with the flags: "LDFLAGS
  452. # EXTRA-FLAGS FLAG". This can for example be used to force the linker to
  453. # issue an error when a bad flag is given.
  454. #
  455. # INPUT gives an alternative input source to AC_LINK_IFELSE.
  456. #
  457. # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
  458. # macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
  459. #
  460. # LICENSE
  461. #
  462. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  463. # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  464. #
  465. # Copying and distribution of this file, with or without modification, are
  466. # permitted in any medium without royalty provided the copyright notice
  467. # and this notice are preserved. This file is offered as-is, without any
  468. # warranty.
  469. #serial 6
  470. AC_DEFUN([AX_CHECK_LINK_FLAG],
  471. [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
  472. AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
  473. AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
  474. ax_check_save_flags=$LDFLAGS
  475. LDFLAGS="$LDFLAGS $4 $1"
  476. AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
  477. [AS_VAR_SET(CACHEVAR,[yes])],
  478. [AS_VAR_SET(CACHEVAR,[no])])
  479. LDFLAGS=$ax_check_save_flags])
  480. AS_VAR_IF(CACHEVAR,yes,
  481. [m4_default([$2], :)],
  482. [m4_default([$3], :)])
  483. AS_VAR_POPDEF([CACHEVAR])dnl
  484. ])dnl AX_CHECK_LINK_FLAGS
  485. # ===========================================================================
  486. # https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
  487. # ===========================================================================
  488. #
  489. # SYNOPSIS
  490. #
  491. # AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
  492. #
  493. # DESCRIPTION
  494. #
  495. # This macro compares two version strings. Due to the various number of
  496. # minor-version numbers that can exist, and the fact that string
  497. # comparisons are not compatible with numeric comparisons, this is not
  498. # necessarily trivial to do in a autoconf script. This macro makes doing
  499. # these comparisons easy.
  500. #
  501. # The six basic comparisons are available, as well as checking equality
  502. # limited to a certain number of minor-version levels.
  503. #
  504. # The operator OP determines what type of comparison to do, and can be one
  505. # of:
  506. #
  507. # eq - equal (test A == B)
  508. # ne - not equal (test A != B)
  509. # le - less than or equal (test A <= B)
  510. # ge - greater than or equal (test A >= B)
  511. # lt - less than (test A < B)
  512. # gt - greater than (test A > B)
  513. #
  514. # Additionally, the eq and ne operator can have a number after it to limit
  515. # the test to that number of minor versions.
  516. #
  517. # eq0 - equal up to the length of the shorter version
  518. # ne0 - not equal up to the length of the shorter version
  519. # eqN - equal up to N sub-version levels
  520. # neN - not equal up to N sub-version levels
  521. #
  522. # When the condition is true, shell commands ACTION-IF-TRUE are run,
  523. # otherwise shell commands ACTION-IF-FALSE are run. The environment
  524. # variable 'ax_compare_version' is always set to either 'true' or 'false'
  525. # as well.
  526. #
  527. # Examples:
  528. #
  529. # AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
  530. # AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
  531. #
  532. # would both be true.
  533. #
  534. # AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
  535. # AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
  536. #
  537. # would both be false.
  538. #
  539. # AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
  540. #
  541. # would be true because it is only comparing two minor versions.
  542. #
  543. # AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
  544. #
  545. # would be true because it is only comparing the lesser number of minor
  546. # versions of the two values.
  547. #
  548. # Note: The characters that separate the version numbers do not matter. An
  549. # empty string is the same as version 0. OP is evaluated by autoconf, not
  550. # configure, so must be a string, not a variable.
  551. #
  552. # The author would like to acknowledge Guido Draheim whose advice about
  553. # the m4_case and m4_ifvaln functions make this macro only include the
  554. # portions necessary to perform the specific comparison specified by the
  555. # OP argument in the final configure script.
  556. #
  557. # LICENSE
  558. #
  559. # Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
  560. #
  561. # Copying and distribution of this file, with or without modification, are
  562. # permitted in any medium without royalty provided the copyright notice
  563. # and this notice are preserved. This file is offered as-is, without any
  564. # warranty.
  565. #serial 13
  566. dnl #########################################################################
  567. AC_DEFUN([AX_COMPARE_VERSION], [
  568. AC_REQUIRE([AC_PROG_AWK])
  569. # Used to indicate true or false condition
  570. ax_compare_version=false
  571. # Convert the two version strings to be compared into a format that
  572. # allows a simple string comparison. The end result is that a version
  573. # string of the form 1.12.5-r617 will be converted to the form
  574. # 0001001200050617. In other words, each number is zero padded to four
  575. # digits, and non digits are removed.
  576. AS_VAR_PUSHDEF([A],[ax_compare_version_A])
  577. A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
  578. -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
  579. -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  580. -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  581. -e 's/[[^0-9]]//g'`
  582. AS_VAR_PUSHDEF([B],[ax_compare_version_B])
  583. B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
  584. -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
  585. -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  586. -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
  587. -e 's/[[^0-9]]//g'`
  588. dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
  589. dnl # then the first line is used to determine if the condition is true.
  590. dnl # The sed right after the echo is to remove any indented white space.
  591. m4_case(m4_tolower($2),
  592. [lt],[
  593. ax_compare_version=`echo "x$A
  594. x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
  595. ],
  596. [gt],[
  597. ax_compare_version=`echo "x$A
  598. x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
  599. ],
  600. [le],[
  601. ax_compare_version=`echo "x$A
  602. x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
  603. ],
  604. [ge],[
  605. ax_compare_version=`echo "x$A
  606. x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
  607. ],[
  608. dnl Split the operator from the subversion count if present.
  609. m4_bmatch(m4_substr($2,2),
  610. [0],[
  611. # A count of zero means use the length of the shorter version.
  612. # Determine the number of characters in A and B.
  613. ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
  614. ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
  615. # Set A to no more than B's length and B to no more than A's length.
  616. A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
  617. B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
  618. ],
  619. [[0-9]+],[
  620. # A count greater than zero means use only that many subversions
  621. A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
  622. B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
  623. ],
  624. [.+],[
  625. AC_WARNING(
  626. [invalid OP numeric parameter: $2])
  627. ],[])
  628. # Pad zeros at end of numbers to make same length.
  629. ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
  630. B="$B`echo $A | sed 's/./0/g'`"
  631. A="$ax_compare_version_tmp_A"
  632. # Check for equality or inequality as necessary.
  633. m4_case(m4_tolower(m4_substr($2,0,2)),
  634. [eq],[
  635. test "x$A" = "x$B" && ax_compare_version=true
  636. ],
  637. [ne],[
  638. test "x$A" != "x$B" && ax_compare_version=true
  639. ],[
  640. AC_WARNING([invalid OP parameter: $2])
  641. ])
  642. ])
  643. AS_VAR_POPDEF([A])dnl
  644. AS_VAR_POPDEF([B])dnl
  645. dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
  646. if test "$ax_compare_version" = "true" ; then
  647. m4_ifvaln([$4],[$4],[:])dnl
  648. m4_ifvaln([$5],[else $5])dnl
  649. fi
  650. ]) dnl AX_COMPARE_VERSION
  651. # ===========================================================================
  652. # https://www.gnu.org/software/autoconf-archive/ax_compiler_flags.html
  653. # ===========================================================================
  654. #
  655. # SYNOPSIS
  656. #
  657. # AX_COMPILER_FLAGS([CFLAGS-VARIABLE], [LDFLAGS-VARIABLE], [IS-RELEASE], [EXTRA-BASE-CFLAGS], [EXTRA-YES-CFLAGS], [UNUSED], [UNUSED], [UNUSED], [EXTRA-BASE-LDFLAGS], [EXTRA-YES-LDFLAGS], [UNUSED], [UNUSED], [UNUSED])
  658. #
  659. # DESCRIPTION
  660. #
  661. # Check for the presence of an --enable-compile-warnings option to
  662. # configure, defaulting to "error" in normal operation, or "yes" if
  663. # IS-RELEASE is equal to "yes". Return the value in the variable
  664. # $ax_enable_compile_warnings.
  665. #
  666. # Depending on the value of --enable-compile-warnings, different compiler
  667. # warnings are checked to see if they work with the current compiler and,
  668. # if so, are appended to CFLAGS-VARIABLE and LDFLAGS-VARIABLE. This
  669. # allows a consistent set of baseline compiler warnings to be used across
  670. # a code base, irrespective of any warnings enabled locally by individual
  671. # developers. By standardising the warnings used by all developers of a
  672. # project, the project can commit to a zero-warnings policy, using -Werror
  673. # to prevent compilation if new warnings are introduced. This makes
  674. # catching bugs which are flagged by warnings a lot easier.
  675. #
  676. # By providing a consistent --enable-compile-warnings argument across all
  677. # projects using this macro, continuous integration systems can easily be
  678. # configured the same for all projects. Automated systems or build
  679. # systems aimed at beginners may want to pass the --disable-Werror
  680. # argument to unconditionally prevent warnings being fatal.
  681. #
  682. # --enable-compile-warnings can take the values:
  683. #
  684. # * no: Base compiler warnings only; not even -Wall.
  685. # * yes: The above, plus a broad range of useful warnings.
  686. # * error: The above, plus -Werror so that all warnings are fatal.
  687. # Use --disable-Werror to override this and disable fatal
  688. # warnings.
  689. #
  690. # The set of base and enabled flags can be augmented using the
  691. # EXTRA-*-CFLAGS and EXTRA-*-LDFLAGS variables, which are tested and
  692. # appended to the output variable if --enable-compile-warnings is not
  693. # "no". Flags should not be disabled using these arguments, as the entire
  694. # point of AX_COMPILER_FLAGS is to enforce a consistent set of useful
  695. # compiler warnings on code, using warnings which have been chosen for low
  696. # false positive rates. If a compiler emits false positives for a
  697. # warning, a #pragma should be used in the code to disable the warning
  698. # locally. See:
  699. #
  700. # https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
  701. #
  702. # The EXTRA-* variables should only be used to supply extra warning flags,
  703. # and not general purpose compiler flags, as they are controlled by
  704. # configure options such as --disable-Werror.
  705. #
  706. # IS-RELEASE can be used to disable -Werror when making a release, which
  707. # is useful for those hairy moments when you just want to get the release
  708. # done as quickly as possible. Set it to "yes" to disable -Werror. By
  709. # default, it uses the value of $ax_is_release, so if you are using the
  710. # AX_IS_RELEASE macro, there is no need to pass this parameter. For
  711. # example:
  712. #
  713. # AX_IS_RELEASE([git-directory])
  714. # AX_COMPILER_FLAGS()
  715. #
  716. # CFLAGS-VARIABLE defaults to WARN_CFLAGS, and LDFLAGS-VARIABLE defaults
  717. # to WARN_LDFLAGS. Both variables are AC_SUBST-ed by this macro, but must
  718. # be manually added to the CFLAGS and LDFLAGS variables for each target in
  719. # the code base.
  720. #
  721. # If C++ language support is enabled with AC_PROG_CXX, which must occur
  722. # before this macro in configure.ac, warning flags for the C++ compiler
  723. # are AC_SUBST-ed as WARN_CXXFLAGS, and must be manually added to the
  724. # CXXFLAGS variables for each target in the code base. EXTRA-*-CFLAGS can
  725. # be used to augment the base and enabled flags.
  726. #
  727. # Warning flags for g-ir-scanner (from GObject Introspection) are
  728. # AC_SUBST-ed as WARN_SCANNERFLAGS. This variable must be manually added
  729. # to the SCANNERFLAGS variable for each GIR target in the code base. If
  730. # extra g-ir-scanner flags need to be enabled, the AX_COMPILER_FLAGS_GIR
  731. # macro must be invoked manually.
  732. #
  733. # AX_COMPILER_FLAGS may add support for other tools in future, in addition
  734. # to the compiler and linker. No extra EXTRA-* variables will be added
  735. # for those tools, and all extra support will still use the single
  736. # --enable-compile-warnings configure option. For finer grained control
  737. # over the flags for individual tools, use AX_COMPILER_FLAGS_CFLAGS,
  738. # AX_COMPILER_FLAGS_LDFLAGS and AX_COMPILER_FLAGS_* for new tools.
  739. #
  740. # The UNUSED variables date from a previous version of this macro, and are
  741. # automatically appended to the preceding non-UNUSED variable. They should
  742. # be left empty in new uses of the macro.
  743. #
  744. # LICENSE
  745. #
  746. # Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
  747. # Copyright (c) 2015 David King <amigadave@amigadave.com>
  748. #
  749. # Copying and distribution of this file, with or without modification, are
  750. # permitted in any medium without royalty provided the copyright notice
  751. # and this notice are preserved. This file is offered as-is, without any
  752. # warranty.
  753. #serial 14
  754. # _AX_COMPILER_FLAGS_LANG([LANGNAME])
  755. m4_defun([_AX_COMPILER_FLAGS_LANG],
  756. [m4_ifdef([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [],
  757. [m4_define([_AX_COMPILER_FLAGS_LANG_]$1[_enabled], [])dnl
  758. AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_]$1[FLAGS])])dnl
  759. ])
  760. AC_DEFUN([AX_COMPILER_FLAGS],[
  761. # C support is enabled by default.
  762. _AX_COMPILER_FLAGS_LANG([C])
  763. # Only enable C++ support if AC_PROG_CXX is called. The redefinition of
  764. # AC_PROG_CXX is so that a fatal error is emitted if this macro is called
  765. # before AC_PROG_CXX, which would otherwise cause no C++ warnings to be
  766. # checked.
  767. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  768. [_AX_COMPILER_FLAGS_LANG([CXX])],
  769. [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AX_COMPILER_FLAGS_LANG([CXX])])])
  770. AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_LDFLAGS])
  771. # Default value for IS-RELEASE is $ax_is_release
  772. ax_compiler_flags_is_release=m4_tolower(m4_normalize(ifelse([$3],,
  773. [$ax_is_release],
  774. [$3])))
  775. AC_ARG_ENABLE([compile-warnings],
  776. AS_HELP_STRING([--enable-compile-warnings=@<:@no/yes/error@:>@],
  777. [Enable compiler warnings and errors]),,
  778. [AS_IF([test "$ax_compiler_flags_is_release" = "yes"],
  779. [enable_compile_warnings="yes"],
  780. [enable_compile_warnings="error"])])
  781. AC_ARG_ENABLE([Werror],
  782. AS_HELP_STRING([--disable-Werror],
  783. [Unconditionally make all compiler warnings non-fatal]),,
  784. [enable_Werror=maybe])
  785. # Return the user's chosen warning level
  786. AS_IF([test "$enable_Werror" = "no" -a \
  787. "$enable_compile_warnings" = "error"],[
  788. enable_compile_warnings="yes"
  789. ])
  790. ax_enable_compile_warnings=$enable_compile_warnings
  791. AX_COMPILER_FLAGS_CFLAGS([$1],[$ax_compiler_flags_is_release],
  792. [$4],[$5 $6 $7 $8])
  793. m4_ifdef([_AX_COMPILER_FLAGS_LANG_CXX_enabled],
  794. [AX_COMPILER_FLAGS_CXXFLAGS([WARN_CXXFLAGS],
  795. [$ax_compiler_flags_is_release],
  796. [$4],[$5 $6 $7 $8])])
  797. AX_COMPILER_FLAGS_LDFLAGS([$2],[$ax_compiler_flags_is_release],
  798. [$9],[$10 $11 $12 $13])
  799. AX_COMPILER_FLAGS_GIR([WARN_SCANNERFLAGS],[$ax_compiler_flags_is_release])
  800. ])dnl AX_COMPILER_FLAGS
  801. # =============================================================================
  802. # https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_cflags.html
  803. # =============================================================================
  804. #
  805. # SYNOPSIS
  806. #
  807. # AX_COMPILER_FLAGS_CFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
  808. #
  809. # DESCRIPTION
  810. #
  811. # Add warning flags for the C compiler to VARIABLE, which defaults to
  812. # WARN_CFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be
  813. # manually added to the CFLAGS variable for each target in the code base.
  814. #
  815. # This macro depends on the environment set up by AX_COMPILER_FLAGS.
  816. # Specifically, it uses the value of $ax_enable_compile_warnings to decide
  817. # which flags to enable.
  818. #
  819. # LICENSE
  820. #
  821. # Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
  822. # Copyright (c) 2017, 2018 Reini Urban <rurban@cpan.org>
  823. #
  824. # Copying and distribution of this file, with or without modification, are
  825. # permitted in any medium without royalty provided the copyright notice
  826. # and this notice are preserved. This file is offered as-is, without any
  827. # warranty.
  828. #serial 17
  829. AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
  830. AC_REQUIRE([AC_PROG_SED])
  831. AX_REQUIRE_DEFINED([AX_APPEND_COMPILE_FLAGS])
  832. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  833. AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
  834. # Variable names
  835. m4_define([ax_warn_cflags_variable],
  836. [m4_normalize(ifelse([$1],,[WARN_CFLAGS],[$1]))])
  837. AC_LANG_PUSH([C])
  838. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
  839. [#ifndef __cplusplus
  840. #error "no C++"
  841. #endif]])],
  842. [ax_compiler_cxx=yes;],
  843. [ax_compiler_cxx=no;])
  844. # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
  845. # flags, otherwise they are always appended to the warn_cflags variable, and
  846. # Clang warns on them for every compilation unit.
  847. # If this is passed to GCC, it will explode, so the flag must be enabled
  848. # conditionally.
  849. AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
  850. ax_compiler_flags_test="-Werror=unknown-warning-option"
  851. ],[
  852. ax_compiler_flags_test=""
  853. ])
  854. # Check that -Wno-suggest-attribute=format is supported
  855. AX_CHECK_COMPILE_FLAG([-Wno-suggest-attribute=format],[
  856. ax_compiler_no_suggest_attribute_flags="-Wno-suggest-attribute=format"
  857. ],[
  858. ax_compiler_no_suggest_attribute_flags=""
  859. ])
  860. # Base flags
  861. AX_APPEND_COMPILE_FLAGS([ dnl
  862. -fno-strict-aliasing dnl
  863. $3 dnl
  864. ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
  865. AS_IF([test "$ax_enable_compile_warnings" != "no"],[
  866. if test "$ax_compiler_cxx" = "no" ; then
  867. # C-only flags. Warn in C++
  868. AX_APPEND_COMPILE_FLAGS([ dnl
  869. -Wnested-externs dnl
  870. -Wmissing-prototypes dnl
  871. -Wstrict-prototypes dnl
  872. -Wdeclaration-after-statement dnl
  873. -Wimplicit-function-declaration dnl
  874. -Wold-style-definition dnl
  875. -Wjump-misses-init dnl
  876. ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
  877. fi
  878. # "yes" flags
  879. AX_APPEND_COMPILE_FLAGS([ dnl
  880. -Wall dnl
  881. -Wextra dnl
  882. -Wundef dnl
  883. -Wwrite-strings dnl
  884. -Wpointer-arith dnl
  885. -Wmissing-declarations dnl
  886. -Wredundant-decls dnl
  887. -Wno-unused-parameter dnl
  888. -Wno-missing-field-initializers dnl
  889. -Wformat=2 dnl
  890. -Wcast-align dnl
  891. -Wformat-nonliteral dnl
  892. -Wformat-security dnl
  893. -Wsign-compare dnl
  894. -Wstrict-aliasing dnl
  895. -Wshadow dnl
  896. -Winline dnl
  897. -Wpacked dnl
  898. -Wmissing-format-attribute dnl
  899. -Wmissing-noreturn dnl
  900. -Winit-self dnl
  901. -Wredundant-decls dnl
  902. -Wmissing-include-dirs dnl
  903. -Wunused-but-set-variable dnl
  904. -Warray-bounds dnl
  905. -Wreturn-type dnl
  906. -Wswitch-enum dnl
  907. -Wswitch-default dnl
  908. -Wduplicated-cond dnl
  909. -Wduplicated-branches dnl
  910. -Wlogical-op dnl
  911. -Wrestrict dnl
  912. -Wnull-dereference dnl
  913. -Wdouble-promotion dnl
  914. $4 dnl
  915. $5 dnl
  916. $6 dnl
  917. $7 dnl
  918. ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
  919. ])
  920. AS_IF([test "$ax_enable_compile_warnings" = "error"],[
  921. # "error" flags; -Werror has to be appended unconditionally because
  922. # it's not possible to test for
  923. #
  924. # suggest-attribute=format is disabled because it gives too many false
  925. # positives
  926. AX_APPEND_FLAG([-Werror],ax_warn_cflags_variable)
  927. AX_APPEND_COMPILE_FLAGS([ dnl
  928. [$ax_compiler_no_suggest_attribute_flags] dnl
  929. ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
  930. ])
  931. # In the flags below, when disabling specific flags, always add *both*
  932. # -Wno-foo and -Wno-error=foo. This fixes the situation where (for example)
  933. # we enable -Werror, disable a flag, and a build bot passes CFLAGS=-Wall,
  934. # which effectively turns that flag back on again as an error.
  935. for flag in $ax_warn_cflags_variable; do
  936. AS_CASE([$flag],
  937. [-Wno-*=*],[],
  938. [-Wno-*],[
  939. AX_APPEND_COMPILE_FLAGS([-Wno-error=$(AS_ECHO([$flag]) | $SED 's/^-Wno-//')],
  940. ax_warn_cflags_variable,
  941. [$ax_compiler_flags_test])
  942. ])
  943. done
  944. AC_LANG_POP([C])
  945. # Substitute the variables
  946. AC_SUBST(ax_warn_cflags_variable)
  947. ])dnl AX_COMPILER_FLAGS
  948. # ===========================================================================
  949. # https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_gir.html
  950. # ===========================================================================
  951. #
  952. # SYNOPSIS
  953. #
  954. # AX_COMPILER_FLAGS_GIR([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
  955. #
  956. # DESCRIPTION
  957. #
  958. # Add warning flags for the g-ir-scanner (from GObject Introspection) to
  959. # VARIABLE, which defaults to WARN_SCANNERFLAGS. VARIABLE is AC_SUBST-ed
  960. # by this macro, but must be manually added to the SCANNERFLAGS variable
  961. # for each GIR target in the code base.
  962. #
  963. # This macro depends on the environment set up by AX_COMPILER_FLAGS.
  964. # Specifically, it uses the value of $ax_enable_compile_warnings to decide
  965. # which flags to enable.
  966. #
  967. # LICENSE
  968. #
  969. # Copyright (c) 2015 Philip Withnall <philip@tecnocode.co.uk>
  970. #
  971. # Copying and distribution of this file, with or without modification, are
  972. # permitted in any medium without royalty provided the copyright notice
  973. # and this notice are preserved. This file is offered as-is, without any
  974. # warranty.
  975. #serial 6
  976. AC_DEFUN([AX_COMPILER_FLAGS_GIR],[
  977. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  978. # Variable names
  979. m4_define([ax_warn_scannerflags_variable],
  980. [m4_normalize(ifelse([$1],,[WARN_SCANNERFLAGS],[$1]))])
  981. # Base flags
  982. AX_APPEND_FLAG([$3],ax_warn_scannerflags_variable)
  983. AS_IF([test "$ax_enable_compile_warnings" != "no"],[
  984. # "yes" flags
  985. AX_APPEND_FLAG([ dnl
  986. --warn-all dnl
  987. $4 dnl
  988. $5 dnl
  989. $6 dnl
  990. $7 dnl
  991. ],ax_warn_scannerflags_variable)
  992. ])
  993. AS_IF([test "$ax_enable_compile_warnings" = "error"],[
  994. # "error" flags
  995. AX_APPEND_FLAG([ dnl
  996. --warn-error dnl
  997. ],ax_warn_scannerflags_variable)
  998. ])
  999. # Substitute the variables
  1000. AC_SUBST(ax_warn_scannerflags_variable)
  1001. ])dnl AX_COMPILER_FLAGS
  1002. # ==============================================================================
  1003. # https://www.gnu.org/software/autoconf-archive/ax_compiler_flags_ldflags.html
  1004. # ==============================================================================
  1005. #
  1006. # SYNOPSIS
  1007. #
  1008. # AX_COMPILER_FLAGS_LDFLAGS([VARIABLE], [IS-RELEASE], [EXTRA-BASE-FLAGS], [EXTRA-YES-FLAGS])
  1009. #
  1010. # DESCRIPTION
  1011. #
  1012. # Add warning flags for the linker to VARIABLE, which defaults to
  1013. # WARN_LDFLAGS. VARIABLE is AC_SUBST-ed by this macro, but must be
  1014. # manually added to the LDFLAGS variable for each target in the code base.
  1015. #
  1016. # This macro depends on the environment set up by AX_COMPILER_FLAGS.
  1017. # Specifically, it uses the value of $ax_enable_compile_warnings to decide
  1018. # which flags to enable.
  1019. #
  1020. # LICENSE
  1021. #
  1022. # Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
  1023. # Copyright (c) 2017, 2018 Reini Urban <rurban@cpan.org>
  1024. #
  1025. # Copying and distribution of this file, with or without modification, are
  1026. # permitted in any medium without royalty provided the copyright notice
  1027. # and this notice are preserved. This file is offered as-is, without any
  1028. # warranty.
  1029. #serial 9
  1030. AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
  1031. AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
  1032. AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
  1033. AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
  1034. AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
  1035. # Variable names
  1036. m4_define([ax_warn_ldflags_variable],
  1037. [m4_normalize(ifelse([$1],,[WARN_LDFLAGS],[$1]))])
  1038. # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
  1039. # flags, otherwise they are always appended to the warn_ldflags variable,
  1040. # and Clang warns on them for every compilation unit.
  1041. # If this is passed to GCC, it will explode, so the flag must be enabled
  1042. # conditionally.
  1043. AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],[
  1044. ax_compiler_flags_test="-Werror=unknown-warning-option"
  1045. ],[
  1046. ax_compiler_flags_test=""
  1047. ])
  1048. AX_CHECK_LINK_FLAG([-Wl,--as-needed], [
  1049. AX_APPEND_LINK_FLAGS([-Wl,--as-needed],
  1050. [AM_LDFLAGS],[$ax_compiler_flags_test])
  1051. ])
  1052. AX_CHECK_LINK_FLAG([-Wl,-z,relro], [
  1053. AX_APPEND_LINK_FLAGS([-Wl,-z,relro],
  1054. [AM_LDFLAGS],[$ax_compiler_flags_test])
  1055. ])
  1056. AX_CHECK_LINK_FLAG([-Wl,-z,now], [
  1057. AX_APPEND_LINK_FLAGS([-Wl,-z,now],
  1058. [AM_LDFLAGS],[$ax_compiler_flags_test])
  1059. ])
  1060. AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [
  1061. AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack],
  1062. [AM_LDFLAGS],[$ax_compiler_flags_test])
  1063. ])
  1064. # textonly, retpolineplt not yet
  1065. # macOS and cygwin linker do not have --as-needed
  1066. AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [
  1067. ax_compiler_flags_as_needed_option="-Wl,--no-as-needed"
  1068. ], [
  1069. ax_compiler_flags_as_needed_option=""
  1070. ])
  1071. # macOS linker speaks with a different accent
  1072. ax_compiler_flags_fatal_warnings_option=""
  1073. AX_CHECK_LINK_FLAG([-Wl,--fatal-warnings], [
  1074. ax_compiler_flags_fatal_warnings_option="-Wl,--fatal-warnings"
  1075. ])
  1076. AX_CHECK_LINK_FLAG([-Wl,-fatal_warnings], [
  1077. ax_compiler_flags_fatal_warnings_option="-Wl,-fatal_warnings"
  1078. ])
  1079. # Base flags
  1080. AX_APPEND_LINK_FLAGS([ dnl
  1081. $ax_compiler_flags_as_needed_option dnl
  1082. $3 dnl
  1083. ],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
  1084. AS_IF([test "$ax_enable_compile_warnings" != "no"],[
  1085. # "yes" flags
  1086. AX_APPEND_LINK_FLAGS([$4 $5 $6 $7],
  1087. ax_warn_ldflags_variable,
  1088. [$ax_compiler_flags_test])
  1089. ])
  1090. AS_IF([test "$ax_enable_compile_warnings" = "error"],[
  1091. # "error" flags; -Werror has to be appended unconditionally because
  1092. # it's not possible to test for
  1093. #
  1094. # suggest-attribute=format is disabled because it gives too many false
  1095. # positives
  1096. AX_APPEND_LINK_FLAGS([ dnl
  1097. $ax_compiler_flags_fatal_warnings_option dnl
  1098. ],ax_warn_ldflags_variable,[$ax_compiler_flags_test])
  1099. ])
  1100. # Substitute the variables
  1101. AC_SUBST(ax_warn_ldflags_variable)
  1102. ])dnl AX_COMPILER_FLAGS
  1103. # ===========================================================================
  1104. # https://www.gnu.org/software/autoconf-archive/ax_func_mkdir.html
  1105. # ===========================================================================
  1106. #
  1107. # SYNOPSIS
  1108. #
  1109. # AX_FUNC_MKDIR
  1110. #
  1111. # DESCRIPTION
  1112. #
  1113. # Check whether mkdir() is mkdir or _mkdir, and whether it takes one or
  1114. # two arguments.
  1115. #
  1116. # This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG,
  1117. # which are expected to be used as follows:
  1118. #
  1119. # #if HAVE_MKDIR
  1120. # # if MKDIR_TAKES_ONE_ARG
  1121. # /* MinGW32 */
  1122. # # define mkdir(a, b) mkdir(a)
  1123. # # endif
  1124. # #else
  1125. # # if HAVE__MKDIR
  1126. # /* plain Windows 32 */
  1127. # # define mkdir(a, b) _mkdir(a)
  1128. # # else
  1129. # # error "Don't know how to create a directory on this system."
  1130. # # endif
  1131. # #endif
  1132. #
  1133. # LICENSE
  1134. #
  1135. # Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
  1136. #
  1137. # This program is free software; you can redistribute it and/or modify it
  1138. # under the terms of the GNU General Public License as published by the
  1139. # Free Software Foundation; either version 2 of the License, or (at your
  1140. # option) any later version.
  1141. #
  1142. # This program is distributed in the hope that it will be useful, but
  1143. # WITHOUT ANY WARRANTY; without even the implied warranty of
  1144. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  1145. # Public License for more details.
  1146. #
  1147. # You should have received a copy of the GNU General Public License along
  1148. # with this program. If not, see <https://www.gnu.org/licenses/>.
  1149. #
  1150. # As a special exception, the respective Autoconf Macro's copyright owner
  1151. # gives unlimited permission to copy, distribute and modify the configure
  1152. # scripts that are the output of Autoconf when processing the Macro. You
  1153. # need not follow the terms of the GNU General Public License when using
  1154. # or distributing such scripts, even though portions of the text of the
  1155. # Macro appear in them. The GNU General Public License (GPL) does govern
  1156. # all other use of the material that constitutes the Autoconf Macro.
  1157. #
  1158. # This special exception to the GPL applies to versions of the Autoconf
  1159. # Macro released by the Autoconf Archive. When you make and distribute a
  1160. # modified version of the Autoconf Macro, you may extend this special
  1161. # exception to the GPL to apply to your modified version as well.
  1162. #serial 6
  1163. AU_ALIAS([AC_FUNC_MKDIR], [AX_FUNC_MKDIR])
  1164. AC_DEFUN([AX_FUNC_MKDIR],
  1165. [AC_CHECK_FUNCS([mkdir _mkdir])
  1166. AC_CACHE_CHECK([whether mkdir takes one argument],
  1167. [ac_cv_mkdir_takes_one_arg],
  1168. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  1169. #include <sys/stat.h>
  1170. #if HAVE_UNISTD_H
  1171. # include <unistd.h>
  1172. #endif
  1173. ]], [[mkdir (".");]])],
  1174. [ac_cv_mkdir_takes_one_arg=yes], [ac_cv_mkdir_takes_one_arg=no])])
  1175. if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then
  1176. AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
  1177. [Define if mkdir takes only one argument.])
  1178. fi
  1179. ])
  1180. dnl Note:
  1181. dnl =====
  1182. dnl I have not implemented the following suggestion because I don't have
  1183. dnl access to such a broken environment to test the macro. So I'm just
  1184. dnl appending the comments here in case you have, and want to fix
  1185. dnl AX_FUNC_MKDIR that way.
  1186. dnl
  1187. dnl |Thomas E. Dickey (dickey@herndon4.his.com) said:
  1188. dnl | it doesn't cover the problem areas (compilers that mistreat mkdir
  1189. dnl | may prototype it in dir.h and dirent.h, for instance).
  1190. dnl |
  1191. dnl |Alexandre:
  1192. dnl | Would it be sufficient to check for these headers and #include
  1193. dnl | them in the AC_COMPILE_IFELSE block? (and is AC_HEADER_DIRENT
  1194. dnl | suitable for this?)
  1195. dnl |
  1196. dnl |Thomas:
  1197. dnl | I think that might be a good starting point (with the set of recommended
  1198. dnl | ifdef's and includes for AC_HEADER_DIRENT, of course).
  1199. # ===========================================================================
  1200. # https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
  1201. # ===========================================================================
  1202. #
  1203. # SYNOPSIS
  1204. #
  1205. # AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)
  1206. #
  1207. # DESCRIPTION
  1208. #
  1209. # This macro checks if the compiler supports one of GCC's function
  1210. # attributes; many other compilers also provide function attributes with
  1211. # the same syntax. Compiler warnings are used to detect supported
  1212. # attributes as unsupported ones are ignored by default so quieting
  1213. # warnings when using this macro will yield false positives.
  1214. #
  1215. # The ATTRIBUTE parameter holds the name of the attribute to be checked.
  1216. #
  1217. # If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.
  1218. #
  1219. # The macro caches its result in the ax_cv_have_func_attribute_<attribute>
  1220. # variable.
  1221. #
  1222. # The macro currently supports the following function attributes:
  1223. #
  1224. # alias
  1225. # aligned
  1226. # alloc_size
  1227. # always_inline
  1228. # artificial
  1229. # cold
  1230. # const
  1231. # constructor
  1232. # constructor_priority for constructor attribute with priority
  1233. # deprecated
  1234. # destructor
  1235. # dllexport
  1236. # dllimport
  1237. # error
  1238. # externally_visible
  1239. # fallthrough
  1240. # flatten
  1241. # format
  1242. # format_arg
  1243. # gnu_inline
  1244. # hot
  1245. # ifunc
  1246. # leaf
  1247. # malloc
  1248. # noclone
  1249. # noinline
  1250. # nonnull
  1251. # noreturn
  1252. # nothrow
  1253. # optimize
  1254. # pure
  1255. # sentinel
  1256. # sentinel_position
  1257. # unused
  1258. # used
  1259. # visibility
  1260. # warning
  1261. # warn_unused_result
  1262. # weak
  1263. # weakref
  1264. #
  1265. # Unsupported function attributes will be tested with a prototype
  1266. # returning an int and not accepting any arguments and the result of the
  1267. # check might be wrong or meaningless so use with care.
  1268. #
  1269. # LICENSE
  1270. #
  1271. # Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
  1272. #
  1273. # Copying and distribution of this file, with or without modification, are
  1274. # permitted in any medium without royalty provided the copyright notice
  1275. # and this notice are preserved. This file is offered as-is, without any
  1276. # warranty.
  1277. #serial 9
  1278. AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
  1279. AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
  1280. AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
  1281. AC_LINK_IFELSE([AC_LANG_PROGRAM([
  1282. m4_case([$1],
  1283. [alias], [
  1284. int foo( void ) { return 0; }
  1285. int bar( void ) __attribute__(($1("foo")));
  1286. ],
  1287. [aligned], [
  1288. int foo( void ) __attribute__(($1(32)));
  1289. ],
  1290. [alloc_size], [
  1291. void *foo(int a) __attribute__(($1(1)));
  1292. ],
  1293. [always_inline], [
  1294. inline __attribute__(($1)) int foo( void ) { return 0; }
  1295. ],
  1296. [artificial], [
  1297. inline __attribute__(($1)) int foo( void ) { return 0; }
  1298. ],
  1299. [cold], [
  1300. int foo( void ) __attribute__(($1));
  1301. ],
  1302. [const], [
  1303. int foo( void ) __attribute__(($1));
  1304. ],
  1305. [constructor_priority], [
  1306. int foo( void ) __attribute__((__constructor__(65535/2)));
  1307. ],
  1308. [constructor], [
  1309. int foo( void ) __attribute__(($1));
  1310. ],
  1311. [deprecated], [
  1312. int foo( void ) __attribute__(($1("")));
  1313. ],
  1314. [destructor], [
  1315. int foo( void ) __attribute__(($1));
  1316. ],
  1317. [dllexport], [
  1318. __attribute__(($1)) int foo( void ) { return 0; }
  1319. ],
  1320. [dllimport], [
  1321. int foo( void ) __attribute__(($1));
  1322. ],
  1323. [error], [
  1324. int foo( void ) __attribute__(($1("")));
  1325. ],
  1326. [externally_visible], [
  1327. int foo( void ) __attribute__(($1));
  1328. ],
  1329. [fallthrough], [
  1330. int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }};
  1331. ],
  1332. [flatten], [
  1333. int foo( void ) __attribute__(($1));
  1334. ],
  1335. [format], [
  1336. int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
  1337. ],
  1338. [format_arg], [
  1339. char *foo(const char *p) __attribute__(($1(1)));
  1340. ],
  1341. [gnu_inline], [
  1342. inline __attribute__(($1)) int foo( void ) { return 0; }
  1343. ],
  1344. [hot], [
  1345. int foo( void ) __attribute__(($1));
  1346. ],
  1347. [ifunc], [
  1348. int my_foo( void ) { return 0; }
  1349. static int (*resolve_foo(void))(void) { return my_foo; }
  1350. int foo( void ) __attribute__(($1("resolve_foo")));
  1351. ],
  1352. [leaf], [
  1353. __attribute__(($1)) int foo( void ) { return 0; }
  1354. ],
  1355. [malloc], [
  1356. void *foo( void ) __attribute__(($1));
  1357. ],
  1358. [noclone], [
  1359. int foo( void ) __attribute__(($1));
  1360. ],
  1361. [noinline], [
  1362. __attribute__(($1)) int foo( void ) { return 0; }
  1363. ],
  1364. [nonnull], [
  1365. int foo(char *p) __attribute__(($1(1)));
  1366. ],
  1367. [noreturn], [
  1368. void foo( void ) __attribute__(($1));
  1369. ],
  1370. [nothrow], [
  1371. int foo( void ) __attribute__(($1));
  1372. ],
  1373. [optimize], [
  1374. __attribute__(($1(3))) int foo( void ) { return 0; }
  1375. ],
  1376. [pure], [
  1377. int foo( void ) __attribute__(($1));
  1378. ],
  1379. [sentinel], [
  1380. int foo(void *p, ...) __attribute__(($1));
  1381. ],
  1382. [sentinel_position], [
  1383. int foo(void *p, ...) __attribute__(($1(1)));
  1384. ],
  1385. [returns_nonnull], [
  1386. void *foo( void ) __attribute__(($1));
  1387. ],
  1388. [unused], [
  1389. int foo( void ) __attribute__(($1));
  1390. ],
  1391. [used], [
  1392. int foo( void ) __attribute__(($1));
  1393. ],
  1394. [visibility], [
  1395. int foo_def( void ) __attribute__(($1("default")));
  1396. int foo_hid( void ) __attribute__(($1("hidden")));
  1397. int foo_int( void ) __attribute__(($1("internal")));
  1398. int foo_pro( void ) __attribute__(($1("protected")));
  1399. ],
  1400. [warning], [
  1401. int foo( void ) __attribute__(($1("")));
  1402. ],
  1403. [warn_unused_result], [
  1404. int foo( void ) __attribute__(($1));
  1405. ],
  1406. [weak], [
  1407. int foo( void ) __attribute__(($1));
  1408. ],
  1409. [weakref], [
  1410. static int foo( void ) { return 0; }
  1411. static int bar( void ) __attribute__(($1("foo")));
  1412. ],
  1413. [
  1414. m4_warn([syntax], [Unsupported attribute $1, the test may fail])
  1415. int foo( void ) __attribute__(($1));
  1416. ]
  1417. )], [])
  1418. ],
  1419. dnl GCC doesn't exit with an error if an unknown attribute is
  1420. dnl provided but only outputs a warning, so accept the attribute
  1421. dnl only if no warning were issued.
  1422. [AS_IF([test -s conftest.err],
  1423. [AS_VAR_SET([ac_var], [no])],
  1424. [AS_VAR_SET([ac_var], [yes])])],
  1425. [AS_VAR_SET([ac_var], [no])])
  1426. ])
  1427. AS_IF([test yes = AS_VAR_GET([ac_var])],
  1428. [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1,
  1429. [Define to 1 if the system has the `$1' function attribute])], [])
  1430. AS_VAR_POPDEF([ac_var])
  1431. ])
  1432. # ===========================================================================
  1433. # https://www.gnu.org/software/autoconf-archive/ax_lib_curl.html
  1434. # ===========================================================================
  1435. #
  1436. # SYNOPSIS
  1437. #
  1438. # AX_LIB_CURL([VERSION],[ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
  1439. #
  1440. # DESCRIPTION
  1441. #
  1442. # Checks for minimum curl library version VERSION. If successful executes
  1443. # ACTION-IF-SUCCESS otherwise ACTION-IF-FAILURE.
  1444. #
  1445. # Defines CURL_LIBS and CURL_CFLAGS.
  1446. #
  1447. # A simple example:
  1448. #
  1449. # AX_LIB_CURL([7.19.4],,[
  1450. # AC_MSG_ERROR([Your system lacks libcurl >= 7.19.4])
  1451. # ])
  1452. #
  1453. # This macro is a rearranged version of AC_LIB_CURL from Akos Maroy.
  1454. #
  1455. # LICENSE
  1456. #
  1457. # Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
  1458. #
  1459. # Copying and distribution of this file, with or without modification, are
  1460. # permitted in any medium without royalty provided the copyright notice
  1461. # and this notice are preserved. This file is offered as-is, without any
  1462. # warranty.
  1463. #serial 9
  1464. AU_ALIAS([AC_CHECK_CURL], [AX_LIB_CURL])
  1465. AC_DEFUN([AX_LIB_CURL], [
  1466. AX_PATH_GENERIC([curl],[$1],'s/^libcurl\ \+//',[$2],[$3])
  1467. ])
  1468. # ===========================================================================
  1469. # https://www.gnu.org/software/autoconf-archive/ax_lib_sqlite3.html
  1470. # ===========================================================================
  1471. #
  1472. # SYNOPSIS
  1473. #
  1474. # AX_LIB_SQLITE3([MINIMUM-VERSION])
  1475. #
  1476. # DESCRIPTION
  1477. #
  1478. # Test for the SQLite 3 library of a particular version (or newer)
  1479. #
  1480. # This macro takes only one optional argument, required version of SQLite
  1481. # 3 library. If required version is not passed, 3.0.0 is used in the test
  1482. # of existence of SQLite 3.
  1483. #
  1484. # If no installation prefix to the installed SQLite library is given the
  1485. # macro searches under /usr, /usr/local, and /opt.
  1486. #
  1487. # This macro calls:
  1488. #
  1489. # AC_SUBST(SQLITE3_CFLAGS)
  1490. # AC_SUBST(SQLITE3_LDFLAGS)
  1491. # AC_SUBST(SQLITE3_VERSION)
  1492. #
  1493. # And sets:
  1494. #
  1495. # HAVE_SQLITE3
  1496. #
  1497. # LICENSE
  1498. #
  1499. # Copyright (c) 2008 Mateusz Loskot <mateusz@loskot.net>
  1500. #
  1501. # Copying and distribution of this file, with or without modification, are
  1502. # permitted in any medium without royalty provided the copyright notice
  1503. # and this notice are preserved. This file is offered as-is, without any
  1504. # warranty.
  1505. #serial 18
  1506. AC_DEFUN([AX_LIB_SQLITE3],
  1507. [
  1508. AC_ARG_WITH([sqlite3],
  1509. AS_HELP_STRING(
  1510. [--with-sqlite3=@<:@ARG@:>@],
  1511. [use SQLite 3 library @<:@default=yes@:>@, optionally specify the prefix for sqlite3 library]
  1512. ),
  1513. [
  1514. if test "$withval" = "no"; then
  1515. WANT_SQLITE3="no"
  1516. elif test "$withval" = "yes"; then
  1517. WANT_SQLITE3="yes"
  1518. ac_sqlite3_path=""
  1519. else
  1520. WANT_SQLITE3="yes"
  1521. ac_sqlite3_path="$withval"
  1522. fi
  1523. ],
  1524. [WANT_SQLITE3="yes"]
  1525. )
  1526. SQLITE3_CFLAGS=""
  1527. SQLITE3_LDFLAGS=""
  1528. SQLITE3_VERSION=""
  1529. if test "x$WANT_SQLITE3" = "xyes"; then
  1530. ac_sqlite3_header="sqlite3.h"
  1531. sqlite3_version_req=ifelse([$1], [], [3.0.0], [$1])
  1532. sqlite3_version_req_shorten=`expr $sqlite3_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
  1533. sqlite3_version_req_major=`expr $sqlite3_version_req : '\([[0-9]]*\)'`
  1534. sqlite3_version_req_minor=`expr $sqlite3_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
  1535. sqlite3_version_req_micro=`expr $sqlite3_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
  1536. if test "x$sqlite3_version_req_micro" = "x" ; then
  1537. sqlite3_version_req_micro="0"
  1538. fi
  1539. sqlite3_version_req_number=`expr $sqlite3_version_req_major \* 1000000 \
  1540. \+ $sqlite3_version_req_minor \* 1000 \
  1541. \+ $sqlite3_version_req_micro`
  1542. AC_MSG_CHECKING([for SQLite3 library >= $sqlite3_version_req])
  1543. if test "$ac_sqlite3_path" != ""; then
  1544. ac_sqlite3_ldflags="-L$ac_sqlite3_path/lib"
  1545. ac_sqlite3_cppflags="-I$ac_sqlite3_path/include"
  1546. else
  1547. for ac_sqlite3_path_tmp in /usr /usr/local /opt ; do
  1548. if test -f "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header" \
  1549. && test -r "$ac_sqlite3_path_tmp/include/$ac_sqlite3_header"; then
  1550. ac_sqlite3_path=$ac_sqlite3_path_tmp
  1551. ac_sqlite3_cppflags="-I$ac_sqlite3_path_tmp/include"
  1552. ac_sqlite3_ldflags="-L$ac_sqlite3_path_tmp/lib"
  1553. break;
  1554. fi
  1555. done
  1556. fi
  1557. ac_sqlite3_ldflags="$ac_sqlite3_ldflags -lsqlite3"
  1558. saved_CPPFLAGS="$CPPFLAGS"
  1559. CPPFLAGS="$CPPFLAGS $ac_sqlite3_cppflags"
  1560. AC_LANG_PUSH(C)
  1561. AC_COMPILE_IFELSE(
  1562. [
  1563. AC_LANG_PROGRAM([[@%:@include <sqlite3.h>]],
  1564. [[
  1565. #if (SQLITE_VERSION_NUMBER >= $sqlite3_version_req_number)
  1566. /* Everything is okay */
  1567. #else
  1568. # error SQLite version is too old
  1569. #endif
  1570. ]]
  1571. )
  1572. ],
  1573. [
  1574. AC_MSG_RESULT([yes])
  1575. success="yes"
  1576. ],
  1577. [
  1578. AC_MSG_RESULT([not found])
  1579. success="no"
  1580. ]
  1581. )
  1582. AC_LANG_POP(C)
  1583. CPPFLAGS="$saved_CPPFLAGS"
  1584. if test "$success" = "yes"; then
  1585. SQLITE3_CFLAGS="$ac_sqlite3_cppflags"
  1586. SQLITE3_LDFLAGS="$ac_sqlite3_ldflags"
  1587. ac_sqlite3_header_path="$ac_sqlite3_path/include/$ac_sqlite3_header"
  1588. dnl Retrieve SQLite release version
  1589. if test "x$ac_sqlite3_header_path" != "x"; then
  1590. ac_sqlite3_version=`cat $ac_sqlite3_header_path \
  1591. | grep '#define.*SQLITE_VERSION.*\"' | sed -e 's/.* "//' \
  1592. | sed -e 's/"//'`
  1593. if test $ac_sqlite3_version != ""; then
  1594. SQLITE3_VERSION=$ac_sqlite3_version
  1595. else
  1596. AC_MSG_WARN([Cannot find SQLITE_VERSION macro in sqlite3.h header to retrieve SQLite version!])
  1597. fi
  1598. fi
  1599. AC_SUBST(SQLITE3_CFLAGS)
  1600. AC_SUBST(SQLITE3_LDFLAGS)
  1601. AC_SUBST(SQLITE3_VERSION)
  1602. AC_DEFINE([HAVE_SQLITE3], [], [Have the SQLITE3 library])
  1603. fi
  1604. fi
  1605. ])
  1606. # ===========================================================================
  1607. # https://www.gnu.org/software/autoconf-archive/ax_path_generic.html
  1608. # ===========================================================================
  1609. #
  1610. # SYNOPSIS
  1611. #
  1612. # AX_PATH_GENERIC(LIBRARY,[MINIMUM-VERSION,[SED-EXPR-EXTRACTOR]],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[CONFIG-SCRIPTS],[CFLAGS-ARG],[LIBS-ARG])
  1613. #
  1614. # DESCRIPTION
  1615. #
  1616. # Runs the LIBRARY-config script and defines LIBRARY_CFLAGS and
  1617. # LIBRARY_LIBS unless the user had predefined them in the environment.
  1618. #
  1619. # The script must support `--cflags' and `--libs' args. If MINIMUM-VERSION
  1620. # is specified, the script must also support the `--version' arg. If the
  1621. # `--with-library-[exec-]prefix' arguments to ./configure are given, it
  1622. # must also support `--prefix' and `--exec-prefix'. Preferably use
  1623. # CONFIG-SCRIPTS as config script, CFLAGS-ARG instead of `--cflags` and
  1624. # LIBS-ARG instead of `--libs`, if given.
  1625. #
  1626. # The SED-EXPR-EXTRACTOR parameter represents the expression used in sed
  1627. # to extract the version number. Use it if your 'foo-config --version'
  1628. # dumps something like 'Foo library v1.0.0 (alfa)' instead of '1.0.0'.
  1629. #
  1630. # The macro respects LIBRARY_CONFIG, LIBRARY_CFLAGS and LIBRARY_LIBS
  1631. # variables. If the first one is defined, it specifies the name of the
  1632. # config script to use. If the latter two are defined, the script is not
  1633. # ran at all and their values are used instead (if only one of them is
  1634. # defined, the empty value of the remaining one is still used).
  1635. #
  1636. # Example:
  1637. #
  1638. # AX_PATH_GENERIC(Foo, 1.0.0)
  1639. #
  1640. # would run `foo-config --version' and check that it is at least 1.0.0, if
  1641. # successful the following variables would be defined and substituted:
  1642. #
  1643. # FOO_CFLAGS to `foo-config --cflags`
  1644. # FOO_LIBS to `foo-config --libs`
  1645. #
  1646. # Example:
  1647. #
  1648. # AX_PATH_GENERIC([Bar],,,[
  1649. # AC_MSG_ERROR([Cannot find Bar library])
  1650. # ])
  1651. #
  1652. # would check for bar-config program, defining and substituting the
  1653. # following variables:
  1654. #
  1655. # BAR_CFLAGS to `bar-config --cflags`
  1656. # BAR_LIBS to `bar-config --libs`
  1657. #
  1658. # Example:
  1659. #
  1660. # ./configure BAZ_LIBS=/usr/lib/libbaz.a
  1661. #
  1662. # would link with a static version of baz library even if `baz-config
  1663. # --libs` returns just "-lbaz" that would normally result in using the
  1664. # shared library.
  1665. #
  1666. # This macro is a rearranged version of AC_PATH_GENERIC from Angus Lees.
  1667. #
  1668. # LICENSE
  1669. #
  1670. # Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
  1671. #
  1672. # Copying and distribution of this file, with or without modification, are
  1673. # permitted in any medium without royalty provided the copyright notice
  1674. # and this notice are preserved. This file is offered as-is, without any
  1675. # warranty.
  1676. #serial 17
  1677. AU_ALIAS([AC_PATH_GENERIC], [AX_PATH_GENERIC])
  1678. AC_DEFUN([AX_PATH_GENERIC],[
  1679. AC_REQUIRE([AC_PROG_SED])
  1680. dnl we're going to need uppercase and lowercase versions of the
  1681. dnl string `LIBRARY'
  1682. pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
  1683. pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
  1684. AC_ARG_WITH(DOWN-prefix,[AS_HELP_STRING([--with-]DOWN[-prefix=PREFIX], [Prefix where $1 is installed (optional)])],
  1685. DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="")
  1686. AC_ARG_WITH(DOWN-exec-prefix,[AS_HELP_STRING([--with-]DOWN[-exec-prefix=EPREFIX], [Exec prefix where $1 is installed (optional)])],
  1687. DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="")
  1688. AC_ARG_VAR(UP[]_CONFIG, [config script used for $1])
  1689. AC_ARG_VAR(UP[]_CFLAGS, [CFLAGS used for $1])
  1690. AC_ARG_VAR(UP[]_LIBS, [LIBS used for $1])
  1691. AS_IF([test x"$UP[]_CFLAGS" != x -o x"$UP[]_LIBS" != x],[
  1692. dnl Don't run config script at all, use user-provided values instead.
  1693. AC_SUBST(UP[]_CFLAGS)
  1694. AC_SUBST(UP[]_LIBS)
  1695. :
  1696. $4
  1697. ],[
  1698. AS_IF([test x$DOWN[]_config_exec_prefix != x],[
  1699. DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix"
  1700. AS_IF([test x${UP[]_CONFIG+set} != xset],[
  1701. UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config
  1702. ])
  1703. ])
  1704. AS_IF([test x$DOWN[]_config_prefix != x],[
  1705. DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix"
  1706. AS_IF([test x${UP[]_CONFIG+set} != xset],[
  1707. UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config
  1708. ])
  1709. ])
  1710. AC_PATH_PROGS(UP[]_CONFIG,[$6 DOWN-config],[no])
  1711. AS_IF([test "$UP[]_CONFIG" = "no"],[
  1712. :
  1713. $5
  1714. ],[
  1715. dnl Get the CFLAGS from LIBRARY-config script
  1716. AS_IF([test x"$7" = x],[
  1717. UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`"
  1718. ],[
  1719. UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args $7`"
  1720. ])
  1721. dnl Get the LIBS from LIBRARY-config script
  1722. AS_IF([test x"$8" = x],[
  1723. UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`"
  1724. ],[
  1725. UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args $8`"
  1726. ])
  1727. AS_IF([test x"$2" != x],[
  1728. dnl Check for provided library version
  1729. AS_IF([test x"$3" != x],[
  1730. dnl Use provided sed expression
  1731. DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e $3`"
  1732. ],[
  1733. DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e 's/^\ *\(.*\)\ *$/\1/'`"
  1734. ])
  1735. AC_MSG_CHECKING([for $1 ($DOWN[]_version) >= $2])
  1736. AX_COMPARE_VERSION($DOWN[]_version,[ge],[$2],[
  1737. AC_MSG_RESULT([yes])
  1738. AC_SUBST(UP[]_CFLAGS)
  1739. AC_SUBST(UP[]_LIBS)
  1740. :
  1741. $4
  1742. ],[
  1743. AC_MSG_RESULT([no])
  1744. :
  1745. $5
  1746. ])
  1747. ],[
  1748. AC_SUBST(UP[]_CFLAGS)
  1749. AC_SUBST(UP[]_LIBS)
  1750. :
  1751. $4
  1752. ])
  1753. ])
  1754. ])
  1755. popdef([UP])
  1756. popdef([DOWN])
  1757. ])
  1758. # ===========================================================================
  1759. # https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
  1760. # ===========================================================================
  1761. #
  1762. # SYNOPSIS
  1763. #
  1764. # AX_REQUIRE_DEFINED(MACRO)
  1765. #
  1766. # DESCRIPTION
  1767. #
  1768. # AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
  1769. # been defined and thus are available for use. This avoids random issues
  1770. # where a macro isn't expanded. Instead the configure script emits a
  1771. # non-fatal:
  1772. #
  1773. # ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
  1774. #
  1775. # It's like AC_REQUIRE except it doesn't expand the required macro.
  1776. #
  1777. # Here's an example:
  1778. #
  1779. # AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
  1780. #
  1781. # LICENSE
  1782. #
  1783. # Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
  1784. #
  1785. # Copying and distribution of this file, with or without modification, are
  1786. # permitted in any medium without royalty provided the copyright notice
  1787. # and this notice are preserved. This file is offered as-is, without any
  1788. # warranty.
  1789. #serial 2
  1790. AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
  1791. m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
  1792. ])dnl AX_REQUIRE_DEFINED
  1793. # ===========================================================================
  1794. # https://www.gnu.org/software/autoconf-archive/ax_with_curses.html
  1795. # ===========================================================================
  1796. #
  1797. # SYNOPSIS
  1798. #
  1799. # AX_WITH_CURSES
  1800. #
  1801. # DESCRIPTION
  1802. #
  1803. # This macro checks whether a SysV or X/Open-compatible Curses library is
  1804. # present, along with the associated header file. The NcursesW
  1805. # (wide-character) library is searched for first, followed by Ncurses,
  1806. # then the system-default plain Curses. The first library found is the
  1807. # one returned. Finding libraries will first be attempted by using
  1808. # pkg-config, and should the pkg-config files not be available, will
  1809. # fallback to combinations of known flags itself.
  1810. #
  1811. # The following options are understood: --with-ncursesw, --with-ncurses,
  1812. # --without-ncursesw, --without-ncurses. The "--with" options force the
  1813. # macro to use that particular library, terminating with an error if not
  1814. # found. The "--without" options simply skip the check for that library.
  1815. # The effect on the search pattern is:
  1816. #
  1817. # (no options) - NcursesW, Ncurses, Curses
  1818. # --with-ncurses --with-ncursesw - NcursesW only [*]
  1819. # --without-ncurses --with-ncursesw - NcursesW only [*]
  1820. # --with-ncursesw - NcursesW only [*]
  1821. # --with-ncurses --without-ncursesw - Ncurses only [*]
  1822. # --with-ncurses - NcursesW, Ncurses [**]
  1823. # --without-ncurses --without-ncursesw - Curses only
  1824. # --without-ncursesw - Ncurses, Curses
  1825. # --without-ncurses - NcursesW, Curses
  1826. #
  1827. # [*] If the library is not found, abort the configure script.
  1828. #
  1829. # [**] If the second library (Ncurses) is not found, abort configure.
  1830. #
  1831. # The following preprocessor symbols may be defined by this macro if the
  1832. # appropriate conditions are met:
  1833. #
  1834. # HAVE_CURSES - if any SysV or X/Open Curses library found
  1835. # HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions
  1836. # HAVE_CURSES_COLOR - if library supports color (enhanced functions)
  1837. # HAVE_CURSES_OBSOLETE - if library supports certain obsolete features
  1838. # HAVE_NCURSESW - if NcursesW (wide char) library is to be used
  1839. # HAVE_NCURSES - if the Ncurses library is to be used
  1840. #
  1841. # HAVE_CURSES_H - if <curses.h> is present and should be used
  1842. # HAVE_NCURSESW_H - if <ncursesw.h> should be used
  1843. # HAVE_NCURSES_H - if <ncurses.h> should be used
  1844. # HAVE_NCURSESW_CURSES_H - if <ncursesw/curses.h> should be used
  1845. # HAVE_NCURSES_CURSES_H - if <ncurses/curses.h> should be used
  1846. #
  1847. # (These preprocessor symbols are discussed later in this document.)
  1848. #
  1849. # The following output variables are defined by this macro; they are
  1850. # precious and may be overridden on the ./configure command line:
  1851. #
  1852. # CURSES_LIBS - library to add to xxx_LDADD
  1853. # CURSES_CFLAGS - include paths to add to xxx_CPPFLAGS
  1854. #
  1855. # In previous versions of this macro, the flags CURSES_LIB and
  1856. # CURSES_CPPFLAGS were defined. These have been renamed, in keeping with
  1857. # AX_WITH_CURSES's close bigger brother, PKG_CHECK_MODULES, which should
  1858. # eventually supersede the use of AX_WITH_CURSES. Neither the library
  1859. # listed in CURSES_LIBS, nor the flags in CURSES_CFLAGS are added to LIBS,
  1860. # respectively CPPFLAGS, by default. You need to add both to the
  1861. # appropriate xxx_LDADD/xxx_CPPFLAGS line in your Makefile.am. For
  1862. # example:
  1863. #
  1864. # prog_LDADD = @CURSES_LIBS@
  1865. # prog_CPPFLAGS = @CURSES_CFLAGS@
  1866. #
  1867. # If CURSES_LIBS is set on the configure command line (such as by running
  1868. # "./configure CURSES_LIBS=-lmycurses"), then the only header searched for
  1869. # is <curses.h>. If the user needs to specify an alternative path for a
  1870. # library (such as for a non-standard NcurseW), the user should use the
  1871. # LDFLAGS variable.
  1872. #
  1873. # The following shell variables may be defined by this macro:
  1874. #
  1875. # ax_cv_curses - set to "yes" if any Curses library found
  1876. # ax_cv_curses_enhanced - set to "yes" if Enhanced functions present
  1877. # ax_cv_curses_color - set to "yes" if color functions present
  1878. # ax_cv_curses_obsolete - set to "yes" if obsolete features present
  1879. #
  1880. # ax_cv_ncursesw - set to "yes" if NcursesW library found
  1881. # ax_cv_ncurses - set to "yes" if Ncurses library found
  1882. # ax_cv_plaincurses - set to "yes" if plain Curses library found
  1883. # ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no"
  1884. #
  1885. # These variables can be used in your configure.ac to determine the level
  1886. # of support you need from the Curses library. For example, if you must
  1887. # have either Ncurses or NcursesW, you could include:
  1888. #
  1889. # AX_WITH_CURSES
  1890. # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
  1891. # AC_MSG_ERROR([requires either NcursesW or Ncurses library])
  1892. # fi
  1893. #
  1894. # If any Curses library will do (but one must be present and must support
  1895. # color), you could use:
  1896. #
  1897. # AX_WITH_CURSES
  1898. # if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then
  1899. # AC_MSG_ERROR([requires an X/Open-compatible Curses library with color])
  1900. # fi
  1901. #
  1902. # Certain preprocessor symbols and shell variables defined by this macro
  1903. # can be used to determine various features of the Curses library. In
  1904. # particular, HAVE_CURSES and ax_cv_curses are defined if the Curses
  1905. # library found conforms to the traditional SysV and/or X/Open Base Curses
  1906. # definition. Any working Curses library conforms to this level.
  1907. #
  1908. # HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the
  1909. # library supports the X/Open Enhanced Curses definition. In particular,
  1910. # the wide-character types attr_t, cchar_t and wint_t, the functions
  1911. # wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES
  1912. # are checked. The Ncurses library does NOT conform to this definition,
  1913. # although NcursesW does.
  1914. #
  1915. # HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library
  1916. # supports color functions and macros such as COLOR_PAIR, A_COLOR,
  1917. # COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the
  1918. # X/Open Base Curses definition, but are part of the Enhanced set of
  1919. # functions. The Ncurses library DOES support these functions, as does
  1920. # NcursesW.
  1921. #
  1922. # HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the
  1923. # library supports certain features present in SysV and BSD Curses but not
  1924. # defined in the X/Open definition. In particular, the functions
  1925. # getattrs(), getcurx() and getmaxx() are checked.
  1926. #
  1927. # To use the HAVE_xxx_H preprocessor symbols, insert the following into
  1928. # your system.h (or equivalent) header file:
  1929. #
  1930. # #if defined HAVE_NCURSESW_CURSES_H
  1931. # # include <ncursesw/curses.h>
  1932. # #elif defined HAVE_NCURSESW_H
  1933. # # include <ncursesw.h>
  1934. # #elif defined HAVE_NCURSES_CURSES_H
  1935. # # include <ncurses/curses.h>
  1936. # #elif defined HAVE_NCURSES_H
  1937. # # include <ncurses.h>
  1938. # #elif defined HAVE_CURSES_H
  1939. # # include <curses.h>
  1940. # #else
  1941. # # error "SysV or X/Open-compatible Curses header file required"
  1942. # #endif
  1943. #
  1944. # For previous users of this macro: you should not need to change anything
  1945. # in your configure.ac or Makefile.am, as the previous (serial 10)
  1946. # semantics are still valid. However, you should update your system.h (or
  1947. # equivalent) header file to the fragment shown above. You are encouraged
  1948. # also to make use of the extended functionality provided by this version
  1949. # of AX_WITH_CURSES, as well as in the additional macros
  1950. # AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM.
  1951. #
  1952. # LICENSE
  1953. #
  1954. # Copyright (c) 2009 Mark Pulford <mark@kyne.com.au>
  1955. # Copyright (c) 2009 Damian Pietras <daper@daper.net>
  1956. # Copyright (c) 2012 Reuben Thomas <rrt@sc3d.org>
  1957. # Copyright (c) 2011 John Zaitseff <J.Zaitseff@zap.org.au>
  1958. #
  1959. # This program is free software: you can redistribute it and/or modify it
  1960. # under the terms of the GNU General Public License as published by the
  1961. # Free Software Foundation, either version 3 of the License, or (at your
  1962. # option) any later version.
  1963. #
  1964. # This program is distributed in the hope that it will be useful, but
  1965. # WITHOUT ANY WARRANTY; without even the implied warranty of
  1966. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
  1967. # Public License for more details.
  1968. #
  1969. # You should have received a copy of the GNU General Public License along
  1970. # with this program. If not, see <https://www.gnu.org/licenses/>.
  1971. #
  1972. # As a special exception, the respective Autoconf Macro's copyright owner
  1973. # gives unlimited permission to copy, distribute and modify the configure
  1974. # scripts that are the output of Autoconf when processing the Macro. You
  1975. # need not follow the terms of the GNU General Public License when using
  1976. # or distributing such scripts, even though portions of the text of the
  1977. # Macro appear in them. The GNU General Public License (GPL) does govern
  1978. # all other use of the material that constitutes the Autoconf Macro.
  1979. #
  1980. # This special exception to the GPL applies to versions of the Autoconf
  1981. # Macro released by the Autoconf Archive. When you make and distribute a
  1982. # modified version of the Autoconf Macro, you may extend this special
  1983. # exception to the GPL to apply to your modified version as well.
  1984. #serial 18
  1985. # internal function to factorize common code that is used by both ncurses
  1986. # and ncursesw
  1987. AC_DEFUN([_FIND_CURSES_FLAGS], [
  1988. AC_MSG_CHECKING([for $1 via pkg-config])
  1989. AX_REQUIRE_DEFINED([PKG_CHECK_EXISTS])
  1990. _PKG_CONFIG([_ax_cv_$1_libs], [libs], [$1])
  1991. _PKG_CONFIG([_ax_cv_$1_cppflags], [cflags], [$1])
  1992. AS_IF([test "x$pkg_failed" = "xyes" || test "x$pkg_failed" = "xuntried"],[
  1993. AC_MSG_RESULT([no])
  1994. # No suitable .pc file found, have to find flags via fallback
  1995. AC_CACHE_CHECK([for $1 via fallback], [ax_cv_$1], [
  1996. AS_ECHO()
  1997. pkg_cv__ax_cv_$1_libs="-l$1"
  1998. pkg_cv__ax_cv_$1_cppflags="-D_GNU_SOURCE $CURSES_CFLAGS"
  1999. LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
  2000. CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
  2001. AC_MSG_CHECKING([for initscr() with $pkg_cv__ax_cv_$1_libs])
  2002. AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
  2003. [
  2004. AC_MSG_RESULT([yes])
  2005. AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
  2006. AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
  2007. ax_cv_$1=yes
  2008. ],[
  2009. AC_MSG_RESULT([no])
  2010. m4_if(
  2011. [$1],[ncursesw],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfow"],
  2012. [$1],[ncurses],[pkg_cv__ax_cv_$1_libs="$pkg_cv__ax_cv_$1_libs -ltinfo"]
  2013. )
  2014. LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
  2015. AC_MSG_CHECKING([for nodelay() with $pkg_cv__ax_cv_$1_libs])
  2016. AC_LINK_IFELSE([AC_LANG_CALL([], [nodelay])],[
  2017. ax_cv_$1=yes
  2018. ],[
  2019. ax_cv_$1=no
  2020. ])
  2021. ])
  2022. ],[
  2023. ax_cv_$1=no
  2024. ])
  2025. ])
  2026. ],[
  2027. AC_MSG_RESULT([yes])
  2028. # Found .pc file, using its information
  2029. LIBS="$ax_saved_LIBS $pkg_cv__ax_cv_$1_libs"
  2030. CPPFLAGS="$ax_saved_CPPFLAGS $pkg_cv__ax_cv_$1_cppflags"
  2031. ax_cv_$1=yes
  2032. ])
  2033. ])
  2034. AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES])
  2035. AC_DEFUN([AX_WITH_CURSES], [
  2036. AC_ARG_VAR([CURSES_LIBS], [linker library for Curses, e.g. -lcurses])
  2037. AC_ARG_VAR([CURSES_CFLAGS], [preprocessor flags for Curses, e.g. -I/usr/include/ncursesw])
  2038. AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses],
  2039. [force the use of Ncurses or NcursesW])],
  2040. [], [with_ncurses=check])
  2041. AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw],
  2042. [do not use NcursesW (wide character support)])],
  2043. [], [with_ncursesw=check])
  2044. ax_saved_LIBS=$LIBS
  2045. ax_saved_CPPFLAGS=$CPPFLAGS
  2046. AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes],
  2047. [ax_with_plaincurses=no], [ax_with_plaincurses=check])
  2048. ax_cv_curses_which=no
  2049. # Test for NcursesW
  2050. AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncursesw" != xno], [
  2051. _FIND_CURSES_FLAGS([ncursesw])
  2052. AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [
  2053. AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library])
  2054. ])
  2055. AS_IF([test "x$ax_cv_ncursesw" = xyes], [
  2056. ax_cv_curses=yes
  2057. ax_cv_curses_which=ncursesw
  2058. CURSES_LIBS="$pkg_cv__ax_cv_ncursesw_libs"
  2059. CURSES_CFLAGS="$pkg_cv__ax_cv_ncursesw_cppflags"
  2060. AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present])
  2061. AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
  2062. AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [
  2063. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2064. @%:@define _XOPEN_SOURCE_EXTENDED 1
  2065. @%:@include <ncursesw/curses.h>
  2066. ]], [[
  2067. chtype a = A_BOLD;
  2068. int b = KEY_LEFT;
  2069. chtype c = COLOR_PAIR(1) & A_COLOR;
  2070. attr_t d = WA_NORMAL;
  2071. cchar_t e;
  2072. wint_t f;
  2073. int g = getattrs(stdscr);
  2074. int h = getcurx(stdscr) + getmaxx(stdscr);
  2075. initscr();
  2076. init_pair(1, COLOR_WHITE, COLOR_RED);
  2077. wattr_set(stdscr, d, 0, NULL);
  2078. wget_wch(stdscr, &f);
  2079. ]])],
  2080. [ax_cv_header_ncursesw_curses_h=yes],
  2081. [ax_cv_header_ncursesw_curses_h=no])
  2082. ])
  2083. AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [
  2084. ax_cv_curses_enhanced=yes
  2085. ax_cv_curses_color=yes
  2086. ax_cv_curses_obsolete=yes
  2087. AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
  2088. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2089. AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
  2090. AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if <ncursesw/curses.h> is present])
  2091. ])
  2092. AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [
  2093. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2094. @%:@define _XOPEN_SOURCE_EXTENDED 1
  2095. @%:@include <ncursesw.h>
  2096. ]], [[
  2097. chtype a = A_BOLD;
  2098. int b = KEY_LEFT;
  2099. chtype c = COLOR_PAIR(1) & A_COLOR;
  2100. attr_t d = WA_NORMAL;
  2101. cchar_t e;
  2102. wint_t f;
  2103. int g = getattrs(stdscr);
  2104. int h = getcurx(stdscr) + getmaxx(stdscr);
  2105. initscr();
  2106. init_pair(1, COLOR_WHITE, COLOR_RED);
  2107. wattr_set(stdscr, d, 0, NULL);
  2108. wget_wch(stdscr, &f);
  2109. ]])],
  2110. [ax_cv_header_ncursesw_h=yes],
  2111. [ax_cv_header_ncursesw_h=no])
  2112. ])
  2113. AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [
  2114. ax_cv_curses_enhanced=yes
  2115. ax_cv_curses_color=yes
  2116. ax_cv_curses_obsolete=yes
  2117. AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
  2118. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2119. AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
  2120. AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if <ncursesw.h> is present])
  2121. ])
  2122. AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [
  2123. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2124. @%:@define _XOPEN_SOURCE_EXTENDED 1
  2125. @%:@include <ncurses.h>
  2126. ]], [[
  2127. chtype a = A_BOLD;
  2128. int b = KEY_LEFT;
  2129. chtype c = COLOR_PAIR(1) & A_COLOR;
  2130. attr_t d = WA_NORMAL;
  2131. cchar_t e;
  2132. wint_t f;
  2133. int g = getattrs(stdscr);
  2134. int h = getcurx(stdscr) + getmaxx(stdscr);
  2135. initscr();
  2136. init_pair(1, COLOR_WHITE, COLOR_RED);
  2137. wattr_set(stdscr, d, 0, NULL);
  2138. wget_wch(stdscr, &f);
  2139. ]])],
  2140. [ax_cv_header_ncurses_h_with_ncursesw=yes],
  2141. [ax_cv_header_ncurses_h_with_ncursesw=no])
  2142. ])
  2143. AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [
  2144. ax_cv_curses_enhanced=yes
  2145. ax_cv_curses_color=yes
  2146. ax_cv_curses_obsolete=yes
  2147. AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
  2148. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2149. AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
  2150. AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
  2151. ])
  2152. AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [
  2153. AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h])
  2154. ])
  2155. ])
  2156. ])
  2157. unset pkg_cv__ax_cv_ncursesw_libs
  2158. unset pkg_cv__ax_cv_ncursesw_cppflags
  2159. # Test for Ncurses
  2160. AS_IF([test "x$CURSES_LIBS" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [
  2161. _FIND_CURSES_FLAGS([ncurses])
  2162. AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [
  2163. AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library])
  2164. ])
  2165. AS_IF([test "x$ax_cv_ncurses" = xyes], [
  2166. ax_cv_curses=yes
  2167. ax_cv_curses_which=ncurses
  2168. CURSES_LIBS="$pkg_cv__ax_cv_ncurses_libs"
  2169. CURSES_CFLAGS="$pkg_cv__ax_cv_ncurses_cppflags"
  2170. AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present])
  2171. AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
  2172. AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [
  2173. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2174. @%:@include <ncurses/curses.h>
  2175. ]], [[
  2176. chtype a = A_BOLD;
  2177. int b = KEY_LEFT;
  2178. chtype c = COLOR_PAIR(1) & A_COLOR;
  2179. int g = getattrs(stdscr);
  2180. int h = getcurx(stdscr) + getmaxx(stdscr);
  2181. initscr();
  2182. init_pair(1, COLOR_WHITE, COLOR_RED);
  2183. ]])],
  2184. [ax_cv_header_ncurses_curses_h=yes],
  2185. [ax_cv_header_ncurses_curses_h=no])
  2186. ])
  2187. AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [
  2188. ax_cv_curses_color=yes
  2189. ax_cv_curses_obsolete=yes
  2190. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2191. AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
  2192. AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if <ncurses/curses.h> is present])
  2193. ])
  2194. AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [
  2195. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2196. @%:@include <ncurses.h>
  2197. ]], [[
  2198. chtype a = A_BOLD;
  2199. int b = KEY_LEFT;
  2200. chtype c = COLOR_PAIR(1) & A_COLOR;
  2201. int g = getattrs(stdscr);
  2202. int h = getcurx(stdscr) + getmaxx(stdscr);
  2203. initscr();
  2204. init_pair(1, COLOR_WHITE, COLOR_RED);
  2205. ]])],
  2206. [ax_cv_header_ncurses_h=yes],
  2207. [ax_cv_header_ncurses_h=no])
  2208. ])
  2209. AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [
  2210. ax_cv_curses_color=yes
  2211. ax_cv_curses_obsolete=yes
  2212. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2213. AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
  2214. AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if <ncurses.h> is present])
  2215. ])
  2216. AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [
  2217. AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h])
  2218. ])
  2219. ])
  2220. ])
  2221. unset pkg_cv__ax_cv_ncurses_libs
  2222. unset pkg_cv__ax_cv_ncurses_cppflags
  2223. # Test for plain Curses (or if CURSES_LIBS was set by user)
  2224. AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [
  2225. AS_IF([test "x$CURSES_LIBS" != x], [
  2226. LIBS="$ax_saved_LIBS $CURSES_LIBS"
  2227. ], [
  2228. LIBS="$ax_saved_LIBS -lcurses"
  2229. ])
  2230. AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [
  2231. AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])],
  2232. [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no])
  2233. ])
  2234. AS_IF([test "x$ax_cv_plaincurses" = xyes], [
  2235. ax_cv_curses=yes
  2236. ax_cv_curses_which=plaincurses
  2237. AS_IF([test "x$CURSES_LIBS" = x], [
  2238. CURSES_LIBS="-lcurses"
  2239. ])
  2240. AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present])
  2241. # Check for base conformance (and header file)
  2242. AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [
  2243. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2244. @%:@include <curses.h>
  2245. ]], [[
  2246. chtype a = A_BOLD;
  2247. int b = KEY_LEFT;
  2248. initscr();
  2249. ]])],
  2250. [ax_cv_header_curses_h=yes],
  2251. [ax_cv_header_curses_h=no])
  2252. ])
  2253. AS_IF([test "x$ax_cv_header_curses_h" = xyes], [
  2254. AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if <curses.h> is present])
  2255. # Check for X/Open Enhanced conformance
  2256. AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [
  2257. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2258. @%:@define _XOPEN_SOURCE_EXTENDED 1
  2259. @%:@include <curses.h>
  2260. @%:@ifndef _XOPEN_CURSES
  2261. @%:@error "this Curses library is not enhanced"
  2262. "this Curses library is not enhanced"
  2263. @%:@endif
  2264. ]], [[
  2265. chtype a = A_BOLD;
  2266. int b = KEY_LEFT;
  2267. chtype c = COLOR_PAIR(1) & A_COLOR;
  2268. attr_t d = WA_NORMAL;
  2269. cchar_t e;
  2270. wint_t f;
  2271. initscr();
  2272. init_pair(1, COLOR_WHITE, COLOR_RED);
  2273. wattr_set(stdscr, d, 0, NULL);
  2274. wget_wch(stdscr, &f);
  2275. ]])],
  2276. [ax_cv_plaincurses_enhanced=yes],
  2277. [ax_cv_plaincurses_enhanced=no])
  2278. ])
  2279. AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [
  2280. ax_cv_curses_enhanced=yes
  2281. ax_cv_curses_color=yes
  2282. AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions])
  2283. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2284. ])
  2285. # Check for color functions
  2286. AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [
  2287. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2288. @%:@define _XOPEN_SOURCE_EXTENDED 1
  2289. @%:@include <curses.h>
  2290. ]], [[
  2291. chtype a = A_BOLD;
  2292. int b = KEY_LEFT;
  2293. chtype c = COLOR_PAIR(1) & A_COLOR;
  2294. initscr();
  2295. init_pair(1, COLOR_WHITE, COLOR_RED);
  2296. ]])],
  2297. [ax_cv_plaincurses_color=yes],
  2298. [ax_cv_plaincurses_color=no])
  2299. ])
  2300. AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [
  2301. ax_cv_curses_color=yes
  2302. AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)])
  2303. ])
  2304. # Check for obsolete functions
  2305. AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [
  2306. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  2307. @%:@include <curses.h>
  2308. ]], [[
  2309. chtype a = A_BOLD;
  2310. int b = KEY_LEFT;
  2311. int g = getattrs(stdscr);
  2312. int h = getcurx(stdscr) + getmaxx(stdscr);
  2313. initscr();
  2314. ]])],
  2315. [ax_cv_plaincurses_obsolete=yes],
  2316. [ax_cv_plaincurses_obsolete=no])
  2317. ])
  2318. AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [
  2319. ax_cv_curses_obsolete=yes
  2320. AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features])
  2321. ])
  2322. ])
  2323. AS_IF([test "x$ax_cv_header_curses_h" = xno], [
  2324. AC_MSG_WARN([could not find a working curses.h])
  2325. ])
  2326. ])
  2327. ])
  2328. AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no])
  2329. AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no])
  2330. AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no])
  2331. AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no])
  2332. LIBS=$ax_saved_LIBS
  2333. CPPFLAGS=$ax_saved_CPPFLAGS
  2334. unset ax_saved_LIBS
  2335. unset ax_saved_CPPFLAGS
  2336. ])dnl
  2337. # gettext.m4 serial 68 (gettext-0.19.8)
  2338. dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
  2339. dnl This file is free software; the Free Software Foundation
  2340. dnl gives unlimited permission to copy and/or distribute it,
  2341. dnl with or without modifications, as long as this notice is preserved.
  2342. dnl
  2343. dnl This file can be used in projects which are not available under
  2344. dnl the GNU General Public License or the GNU Library General Public
  2345. dnl License but which still want to provide support for the GNU gettext
  2346. dnl functionality.
  2347. dnl Please note that the actual code of the GNU gettext library is covered
  2348. dnl by the GNU Library General Public License, and the rest of the GNU
  2349. dnl gettext package is covered by the GNU General Public License.
  2350. dnl They are *not* in the public domain.
  2351. dnl Authors:
  2352. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
  2353. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
  2354. dnl Macro to add for using GNU gettext.
  2355. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
  2356. dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
  2357. dnl default (if it is not specified or empty) is 'no-libtool'.
  2358. dnl INTLSYMBOL should be 'external' for packages with no intl directory,
  2359. dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
  2360. dnl If INTLSYMBOL is 'use-libtool', then a libtool library
  2361. dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
  2362. dnl depending on --{enable,disable}-{shared,static} and on the presence of
  2363. dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
  2364. dnl $(top_builddir)/intl/libintl.a will be created.
  2365. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
  2366. dnl implementations (in libc or libintl) without the ngettext() function
  2367. dnl will be ignored. If NEEDSYMBOL is specified and is
  2368. dnl 'need-formatstring-macros', then GNU gettext implementations that don't
  2369. dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
  2370. dnl INTLDIR is used to find the intl libraries. If empty,
  2371. dnl the value '$(top_builddir)/intl/' is used.
  2372. dnl
  2373. dnl The result of the configuration is one of three cases:
  2374. dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
  2375. dnl and used.
  2376. dnl Catalog format: GNU --> install in $(datadir)
  2377. dnl Catalog extension: .mo after installation, .gmo in source tree
  2378. dnl 2) GNU gettext has been found in the system's C library.
  2379. dnl Catalog format: GNU --> install in $(datadir)
  2380. dnl Catalog extension: .mo after installation, .gmo in source tree
  2381. dnl 3) No internationalization, always use English msgid.
  2382. dnl Catalog format: none
  2383. dnl Catalog extension: none
  2384. dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
  2385. dnl The use of .gmo is historical (it was needed to avoid overwriting the
  2386. dnl GNU format catalogs when building on a platform with an X/Open gettext),
  2387. dnl but we keep it in order not to force irrelevant filename changes on the
  2388. dnl maintainers.
  2389. dnl
  2390. AC_DEFUN([AM_GNU_GETTEXT],
  2391. [
  2392. dnl Argument checking.
  2393. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
  2394. [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
  2395. ])])])])])
  2396. ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
  2397. [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
  2398. ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
  2399. [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
  2400. ])])])])
  2401. define([gt_included_intl],
  2402. ifelse([$1], [external],
  2403. ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
  2404. [yes]))
  2405. define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
  2406. gt_NEEDS_INIT
  2407. AM_GNU_GETTEXT_NEED([$2])
  2408. AC_REQUIRE([AM_PO_SUBDIRS])dnl
  2409. ifelse(gt_included_intl, yes, [
  2410. AC_REQUIRE([AM_INTL_SUBDIR])dnl
  2411. ])
  2412. dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  2413. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  2414. AC_REQUIRE([AC_LIB_RPATH])
  2415. dnl Sometimes libintl requires libiconv, so first search for libiconv.
  2416. dnl Ideally we would do this search only after the
  2417. dnl if test "$USE_NLS" = "yes"; then
  2418. dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
  2419. dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
  2420. dnl the configure script would need to contain the same shell code
  2421. dnl again, outside any 'if'. There are two solutions:
  2422. dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
  2423. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
  2424. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
  2425. dnl documented, we avoid it.
  2426. ifelse(gt_included_intl, yes, , [
  2427. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  2428. ])
  2429. dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
  2430. gt_INTL_MACOSX
  2431. dnl Set USE_NLS.
  2432. AC_REQUIRE([AM_NLS])
  2433. ifelse(gt_included_intl, yes, [
  2434. BUILD_INCLUDED_LIBINTL=no
  2435. USE_INCLUDED_LIBINTL=no
  2436. ])
  2437. LIBINTL=
  2438. LTLIBINTL=
  2439. POSUB=
  2440. dnl Add a version number to the cache macros.
  2441. case " $gt_needs " in
  2442. *" need-formatstring-macros "*) gt_api_version=3 ;;
  2443. *" need-ngettext "*) gt_api_version=2 ;;
  2444. *) gt_api_version=1 ;;
  2445. esac
  2446. gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
  2447. gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
  2448. dnl If we use NLS figure out what method
  2449. if test "$USE_NLS" = "yes"; then
  2450. gt_use_preinstalled_gnugettext=no
  2451. ifelse(gt_included_intl, yes, [
  2452. AC_MSG_CHECKING([whether included gettext is requested])
  2453. AC_ARG_WITH([included-gettext],
  2454. [ --with-included-gettext use the GNU gettext library included here],
  2455. nls_cv_force_use_gnu_gettext=$withval,
  2456. nls_cv_force_use_gnu_gettext=no)
  2457. AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
  2458. nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  2459. if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  2460. ])
  2461. dnl User does not insist on using GNU NLS library. Figure out what
  2462. dnl to use. If GNU gettext is available we use this. Else we have
  2463. dnl to fall back to GNU NLS library.
  2464. if test $gt_api_version -ge 3; then
  2465. gt_revision_test_code='
  2466. #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  2467. #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
  2468. #endif
  2469. changequote(,)dnl
  2470. typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
  2471. changequote([,])dnl
  2472. '
  2473. else
  2474. gt_revision_test_code=
  2475. fi
  2476. if test $gt_api_version -ge 2; then
  2477. gt_expression_test_code=' + * ngettext ("", "", 0)'
  2478. else
  2479. gt_expression_test_code=
  2480. fi
  2481. AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
  2482. [AC_LINK_IFELSE(
  2483. [AC_LANG_PROGRAM(
  2484. [[
  2485. #include <libintl.h>
  2486. #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  2487. extern int _nl_msg_cat_cntr;
  2488. extern int *_nl_domain_bindings;
  2489. #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
  2490. #else
  2491. #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
  2492. #endif
  2493. $gt_revision_test_code
  2494. ]],
  2495. [[
  2496. bindtextdomain ("", "");
  2497. return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
  2498. ]])],
  2499. [eval "$gt_func_gnugettext_libc=yes"],
  2500. [eval "$gt_func_gnugettext_libc=no"])])
  2501. if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
  2502. dnl Sometimes libintl requires libiconv, so first search for libiconv.
  2503. ifelse(gt_included_intl, yes, , [
  2504. AM_ICONV_LINK
  2505. ])
  2506. dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
  2507. dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
  2508. dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
  2509. dnl even if libiconv doesn't exist.
  2510. AC_LIB_LINKFLAGS_BODY([intl])
  2511. AC_CACHE_CHECK([for GNU gettext in libintl],
  2512. [$gt_func_gnugettext_libintl],
  2513. [gt_save_CPPFLAGS="$CPPFLAGS"
  2514. CPPFLAGS="$CPPFLAGS $INCINTL"
  2515. gt_save_LIBS="$LIBS"
  2516. LIBS="$LIBS $LIBINTL"
  2517. dnl Now see whether libintl exists and does not depend on libiconv.
  2518. AC_LINK_IFELSE(
  2519. [AC_LANG_PROGRAM(
  2520. [[
  2521. #include <libintl.h>
  2522. #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  2523. extern int _nl_msg_cat_cntr;
  2524. extern
  2525. #ifdef __cplusplus
  2526. "C"
  2527. #endif
  2528. const char *_nl_expand_alias (const char *);
  2529. #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
  2530. #else
  2531. #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
  2532. #endif
  2533. $gt_revision_test_code
  2534. ]],
  2535. [[
  2536. bindtextdomain ("", "");
  2537. return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
  2538. ]])],
  2539. [eval "$gt_func_gnugettext_libintl=yes"],
  2540. [eval "$gt_func_gnugettext_libintl=no"])
  2541. dnl Now see whether libintl exists and depends on libiconv.
  2542. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
  2543. LIBS="$LIBS $LIBICONV"
  2544. AC_LINK_IFELSE(
  2545. [AC_LANG_PROGRAM(
  2546. [[
  2547. #include <libintl.h>
  2548. #ifndef __GNU_GETTEXT_SUPPORTED_REVISION
  2549. extern int _nl_msg_cat_cntr;
  2550. extern
  2551. #ifdef __cplusplus
  2552. "C"
  2553. #endif
  2554. const char *_nl_expand_alias (const char *);
  2555. #define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias (""))
  2556. #else
  2557. #define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
  2558. #endif
  2559. $gt_revision_test_code
  2560. ]],
  2561. [[
  2562. bindtextdomain ("", "");
  2563. return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION
  2564. ]])],
  2565. [LIBINTL="$LIBINTL $LIBICONV"
  2566. LTLIBINTL="$LTLIBINTL $LTLIBICONV"
  2567. eval "$gt_func_gnugettext_libintl=yes"
  2568. ])
  2569. fi
  2570. CPPFLAGS="$gt_save_CPPFLAGS"
  2571. LIBS="$gt_save_LIBS"])
  2572. fi
  2573. dnl If an already present or preinstalled GNU gettext() is found,
  2574. dnl use it. But if this macro is used in GNU gettext, and GNU
  2575. dnl gettext is already preinstalled in libintl, we update this
  2576. dnl libintl. (Cf. the install rule in intl/Makefile.in.)
  2577. if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
  2578. || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
  2579. && test "$PACKAGE" != gettext-runtime \
  2580. && test "$PACKAGE" != gettext-tools; }; then
  2581. gt_use_preinstalled_gnugettext=yes
  2582. else
  2583. dnl Reset the values set by searching for libintl.
  2584. LIBINTL=
  2585. LTLIBINTL=
  2586. INCINTL=
  2587. fi
  2588. ifelse(gt_included_intl, yes, [
  2589. if test "$gt_use_preinstalled_gnugettext" != "yes"; then
  2590. dnl GNU gettext is not found in the C library.
  2591. dnl Fall back on included GNU gettext library.
  2592. nls_cv_use_gnu_gettext=yes
  2593. fi
  2594. fi
  2595. if test "$nls_cv_use_gnu_gettext" = "yes"; then
  2596. dnl Mark actions used to generate GNU NLS library.
  2597. BUILD_INCLUDED_LIBINTL=yes
  2598. USE_INCLUDED_LIBINTL=yes
  2599. LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
  2600. LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
  2601. LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
  2602. fi
  2603. CATOBJEXT=
  2604. if test "$gt_use_preinstalled_gnugettext" = "yes" \
  2605. || test "$nls_cv_use_gnu_gettext" = "yes"; then
  2606. dnl Mark actions to use GNU gettext tools.
  2607. CATOBJEXT=.gmo
  2608. fi
  2609. ])
  2610. if test -n "$INTL_MACOSX_LIBS"; then
  2611. if test "$gt_use_preinstalled_gnugettext" = "yes" \
  2612. || test "$nls_cv_use_gnu_gettext" = "yes"; then
  2613. dnl Some extra flags are needed during linking.
  2614. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
  2615. LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
  2616. fi
  2617. fi
  2618. if test "$gt_use_preinstalled_gnugettext" = "yes" \
  2619. || test "$nls_cv_use_gnu_gettext" = "yes"; then
  2620. AC_DEFINE([ENABLE_NLS], [1],
  2621. [Define to 1 if translation of program messages to the user's native language
  2622. is requested.])
  2623. else
  2624. USE_NLS=no
  2625. fi
  2626. fi
  2627. AC_MSG_CHECKING([whether to use NLS])
  2628. AC_MSG_RESULT([$USE_NLS])
  2629. if test "$USE_NLS" = "yes"; then
  2630. AC_MSG_CHECKING([where the gettext function comes from])
  2631. if test "$gt_use_preinstalled_gnugettext" = "yes"; then
  2632. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
  2633. gt_source="external libintl"
  2634. else
  2635. gt_source="libc"
  2636. fi
  2637. else
  2638. gt_source="included intl directory"
  2639. fi
  2640. AC_MSG_RESULT([$gt_source])
  2641. fi
  2642. if test "$USE_NLS" = "yes"; then
  2643. if test "$gt_use_preinstalled_gnugettext" = "yes"; then
  2644. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
  2645. AC_MSG_CHECKING([how to link with libintl])
  2646. AC_MSG_RESULT([$LIBINTL])
  2647. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
  2648. fi
  2649. dnl For backward compatibility. Some packages may be using this.
  2650. AC_DEFINE([HAVE_GETTEXT], [1],
  2651. [Define if the GNU gettext() function is already present or preinstalled.])
  2652. AC_DEFINE([HAVE_DCGETTEXT], [1],
  2653. [Define if the GNU dcgettext() function is already present or preinstalled.])
  2654. fi
  2655. dnl We need to process the po/ directory.
  2656. POSUB=po
  2657. fi
  2658. ifelse(gt_included_intl, yes, [
  2659. dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
  2660. dnl to 'yes' because some of the testsuite requires it.
  2661. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
  2662. BUILD_INCLUDED_LIBINTL=yes
  2663. fi
  2664. dnl Make all variables we use known to autoconf.
  2665. AC_SUBST([BUILD_INCLUDED_LIBINTL])
  2666. AC_SUBST([USE_INCLUDED_LIBINTL])
  2667. AC_SUBST([CATOBJEXT])
  2668. dnl For backward compatibility. Some configure.ins may be using this.
  2669. nls_cv_header_intl=
  2670. nls_cv_header_libgt=
  2671. dnl For backward compatibility. Some Makefiles may be using this.
  2672. DATADIRNAME=share
  2673. AC_SUBST([DATADIRNAME])
  2674. dnl For backward compatibility. Some Makefiles may be using this.
  2675. INSTOBJEXT=.mo
  2676. AC_SUBST([INSTOBJEXT])
  2677. dnl For backward compatibility. Some Makefiles may be using this.
  2678. GENCAT=gencat
  2679. AC_SUBST([GENCAT])
  2680. dnl For backward compatibility. Some Makefiles may be using this.
  2681. INTLOBJS=
  2682. if test "$USE_INCLUDED_LIBINTL" = yes; then
  2683. INTLOBJS="\$(GETTOBJS)"
  2684. fi
  2685. AC_SUBST([INTLOBJS])
  2686. dnl Enable libtool support if the surrounding package wishes it.
  2687. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
  2688. AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
  2689. ])
  2690. dnl For backward compatibility. Some Makefiles may be using this.
  2691. INTLLIBS="$LIBINTL"
  2692. AC_SUBST([INTLLIBS])
  2693. dnl Make all documented variables known to autoconf.
  2694. AC_SUBST([LIBINTL])
  2695. AC_SUBST([LTLIBINTL])
  2696. AC_SUBST([POSUB])
  2697. ])
  2698. dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
  2699. m4_define([gt_NEEDS_INIT],
  2700. [
  2701. m4_divert_text([DEFAULTS], [gt_needs=])
  2702. m4_define([gt_NEEDS_INIT], [])
  2703. ])
  2704. dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
  2705. AC_DEFUN([AM_GNU_GETTEXT_NEED],
  2706. [
  2707. m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
  2708. ])
  2709. dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
  2710. AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
  2711. dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
  2712. AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
  2713. # Configure paths for GTK+
  2714. # Owen Taylor 1997-2001
  2715. # Version number used by aclocal, see `info automake Serials`.
  2716. # Increment on every change.
  2717. #serial 1
  2718. dnl AM_PATH_GTK_3_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  2719. dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
  2720. dnl pass to pkg-config
  2721. dnl
  2722. AC_DEFUN([AM_PATH_GTK_3_0],
  2723. [m4_warn([obsolete], [AM_PATH_GTK_3_0 is deprecated, use PKG_CHECK_MODULES([GTK], [gtk+-3.0]) instead])
  2724. dnl Get the cflags and libraries from pkg-config
  2725. dnl
  2726. AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
  2727. , enable_gtktest=yes)
  2728. min_gtk_version=ifelse([$1], [], [3.0.0], [$1])
  2729. pkg_config_args="gtk+-3.0 >= $min_gtk_version"
  2730. for module in . $4
  2731. do
  2732. case "$module" in
  2733. gthread)
  2734. pkg_config_args="$pkg_config_args gthread-2.0"
  2735. ;;
  2736. esac
  2737. done
  2738. no_gtk=""
  2739. PKG_PROG_PKG_CONFIG([0.16])
  2740. if test -z "$PKG_CONFIG"; then
  2741. no_gtk=yes
  2742. fi
  2743. AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
  2744. if test -n "$PKG_CONFIG"; then
  2745. ## don't try to run the test against uninstalled libtool libs
  2746. if $PKG_CONFIG --uninstalled $pkg_config_args; then
  2747. echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
  2748. enable_gtktest=no
  2749. fi
  2750. if $PKG_CONFIG $pkg_config_args; then
  2751. :
  2752. else
  2753. no_gtk=yes
  2754. fi
  2755. fi
  2756. if test x"$no_gtk" = x ; then
  2757. GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
  2758. GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
  2759. gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
  2760. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  2761. gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
  2762. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  2763. gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
  2764. sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  2765. if test "x$enable_gtktest" = "xyes" ; then
  2766. ac_save_CFLAGS="$CFLAGS"
  2767. ac_save_LIBS="$LIBS"
  2768. CFLAGS="$CFLAGS $GTK_CFLAGS"
  2769. LIBS="$GTK_LIBS $LIBS"
  2770. dnl
  2771. dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
  2772. dnl checks the results of pkg-config to some extent)
  2773. dnl
  2774. rm -f conf.gtktest
  2775. AC_TRY_RUN([
  2776. #include <gtk/gtk.h>
  2777. #include <stdio.h>
  2778. #include <stdlib.h>
  2779. int
  2780. main ()
  2781. {
  2782. unsigned int major, minor, micro;
  2783. fclose (fopen ("conf.gtktest", "w"));
  2784. if (sscanf("$min_gtk_version", "%u.%u.%u", &major, &minor, &micro) != 3) {
  2785. printf("%s, bad version string\n", "$min_gtk_version");
  2786. exit(1);
  2787. }
  2788. if ((gtk_major_version != $gtk_config_major_version) ||
  2789. (gtk_minor_version != $gtk_config_minor_version) ||
  2790. (gtk_micro_version != $gtk_config_micro_version))
  2791. {
  2792. printf("\n*** 'pkg-config --modversion gtk+-3.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
  2793. $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
  2794. gtk_major_version, gtk_minor_version, gtk_micro_version);
  2795. printf ("*** was found! If pkg-config was correct, then it is best\n");
  2796. printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
  2797. printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  2798. printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  2799. printf("*** required on your system.\n");
  2800. printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
  2801. printf("*** to point to the correct configuration files\n");
  2802. }
  2803. else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
  2804. (gtk_minor_version != GTK_MINOR_VERSION) ||
  2805. (gtk_micro_version != GTK_MICRO_VERSION))
  2806. {
  2807. printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
  2808. GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
  2809. printf("*** library (version %d.%d.%d)\n",
  2810. gtk_major_version, gtk_minor_version, gtk_micro_version);
  2811. }
  2812. else
  2813. {
  2814. if ((gtk_major_version > major) ||
  2815. ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
  2816. ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
  2817. {
  2818. return 0;
  2819. }
  2820. else
  2821. {
  2822. printf("\n*** An old version of GTK+ (%u.%u.%u) was found.\n",
  2823. gtk_major_version, gtk_minor_version, gtk_micro_version);
  2824. printf("*** You need a version of GTK+ newer than %u.%u.%u. The latest version of\n",
  2825. major, minor, micro);
  2826. printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
  2827. printf("***\n");
  2828. printf("*** If you have already installed a sufficiently new version, this error\n");
  2829. printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
  2830. printf("*** being found. The easiest way to fix this is to remove the old version\n");
  2831. printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
  2832. printf("*** correct copy of pkg-config. (In this case, you will have to\n");
  2833. printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  2834. printf("*** so that the correct libraries are found at run-time))\n");
  2835. }
  2836. }
  2837. return 1;
  2838. }
  2839. ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  2840. CFLAGS="$ac_save_CFLAGS"
  2841. LIBS="$ac_save_LIBS"
  2842. fi
  2843. fi
  2844. if test "x$no_gtk" = x ; then
  2845. AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
  2846. ifelse([$2], , :, [$2])
  2847. else
  2848. AC_MSG_RESULT(no)
  2849. if test -z "$PKG_CONFIG"; then
  2850. echo "*** A new enough version of pkg-config was not found."
  2851. echo "*** See http://pkgconfig.sourceforge.net"
  2852. else
  2853. if test -f conf.gtktest ; then
  2854. :
  2855. else
  2856. echo "*** Could not run GTK+ test program, checking why..."
  2857. ac_save_CFLAGS="$CFLAGS"
  2858. ac_save_LIBS="$LIBS"
  2859. CFLAGS="$CFLAGS $GTK_CFLAGS"
  2860. LIBS="$LIBS $GTK_LIBS"
  2861. AC_TRY_LINK([
  2862. #include <gtk/gtk.h>
  2863. #include <stdio.h>
  2864. ], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
  2865. [ echo "*** The test program compiled, but did not run. This usually means"
  2866. echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
  2867. echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
  2868. echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  2869. echo "*** to the installed location Also, make sure you have run ldconfig if that"
  2870. echo "*** is required on your system"
  2871. echo "***"
  2872. echo "*** If you have an old version installed, it is best to remove it, although"
  2873. echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
  2874. [ echo "*** The test program failed to compile or link. See the file config.log for the"
  2875. echo "*** exact error that occurred. This usually means GTK+ is incorrectly installed."])
  2876. CFLAGS="$ac_save_CFLAGS"
  2877. LIBS="$ac_save_LIBS"
  2878. fi
  2879. fi
  2880. GTK_CFLAGS=""
  2881. GTK_LIBS=""
  2882. ifelse([$3], , :, [$3])
  2883. fi
  2884. AC_SUBST(GTK_CFLAGS)
  2885. AC_SUBST(GTK_LIBS)
  2886. rm -f conf.gtktest
  2887. ])
  2888. dnl GTK_CHECK_BACKEND(BACKEND-NAME [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
  2889. dnl Tests for BACKEND-NAME in the GTK targets list
  2890. dnl
  2891. AC_DEFUN([GTK_CHECK_BACKEND],
  2892. [m4_warn([obsolete], [GTK_CHECK_BACKEND is deprecated, use PKG_CHECK_MODULES([GTK_X11], [gtk+-x11-3.0]) or similar instead])
  2893. pkg_config_args=ifelse([$1],,gtk+-3.0, gtk+-$1-3.0)
  2894. min_gtk_version=ifelse([$2],,3.0.0,$2)
  2895. pkg_config_args="$pkg_config_args >= $min_gtk_version"
  2896. PKG_PROG_PKG_CONFIG([0.16])
  2897. AS_IF([test -z "$PKG_CONFIG"], [AC_MSG_ERROR([No pkg-config found])])
  2898. if $PKG_CONFIG $pkg_config_args ; then
  2899. target_found=yes
  2900. else
  2901. target_found=no
  2902. fi
  2903. if test "x$target_found" = "xno"; then
  2904. ifelse([$4],,[AC_MSG_ERROR([Backend $backend not found.])],[$4])
  2905. else
  2906. ifelse([$3],,[:],[$3])
  2907. fi
  2908. ])
  2909. # iconv.m4 serial 19 (gettext-0.18.2)
  2910. dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
  2911. dnl This file is free software; the Free Software Foundation
  2912. dnl gives unlimited permission to copy and/or distribute it,
  2913. dnl with or without modifications, as long as this notice is preserved.
  2914. dnl From Bruno Haible.
  2915. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
  2916. [
  2917. dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
  2918. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  2919. AC_REQUIRE([AC_LIB_RPATH])
  2920. dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  2921. dnl accordingly.
  2922. AC_LIB_LINKFLAGS_BODY([iconv])
  2923. ])
  2924. AC_DEFUN([AM_ICONV_LINK],
  2925. [
  2926. dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  2927. dnl those with the standalone portable GNU libiconv installed).
  2928. AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
  2929. dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
  2930. dnl accordingly.
  2931. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
  2932. dnl Add $INCICONV to CPPFLAGS before performing the following checks,
  2933. dnl because if the user has installed libiconv and not disabled its use
  2934. dnl via --without-libiconv-prefix, he wants to use it. The first
  2935. dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
  2936. am_save_CPPFLAGS="$CPPFLAGS"
  2937. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
  2938. AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
  2939. am_cv_func_iconv="no, consider installing GNU libiconv"
  2940. am_cv_lib_iconv=no
  2941. AC_LINK_IFELSE(
  2942. [AC_LANG_PROGRAM(
  2943. [[
  2944. #include <stdlib.h>
  2945. #include <iconv.h>
  2946. ]],
  2947. [[iconv_t cd = iconv_open("","");
  2948. iconv(cd,NULL,NULL,NULL,NULL);
  2949. iconv_close(cd);]])],
  2950. [am_cv_func_iconv=yes])
  2951. if test "$am_cv_func_iconv" != yes; then
  2952. am_save_LIBS="$LIBS"
  2953. LIBS="$LIBS $LIBICONV"
  2954. AC_LINK_IFELSE(
  2955. [AC_LANG_PROGRAM(
  2956. [[
  2957. #include <stdlib.h>
  2958. #include <iconv.h>
  2959. ]],
  2960. [[iconv_t cd = iconv_open("","");
  2961. iconv(cd,NULL,NULL,NULL,NULL);
  2962. iconv_close(cd);]])],
  2963. [am_cv_lib_iconv=yes]
  2964. [am_cv_func_iconv=yes])
  2965. LIBS="$am_save_LIBS"
  2966. fi
  2967. ])
  2968. if test "$am_cv_func_iconv" = yes; then
  2969. AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
  2970. dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
  2971. dnl Solaris 10.
  2972. am_save_LIBS="$LIBS"
  2973. if test $am_cv_lib_iconv = yes; then
  2974. LIBS="$LIBS $LIBICONV"
  2975. fi
  2976. am_cv_func_iconv_works=no
  2977. for ac_iconv_const in '' 'const'; do
  2978. AC_RUN_IFELSE(
  2979. [AC_LANG_PROGRAM(
  2980. [[
  2981. #include <iconv.h>
  2982. #include <string.h>
  2983. #ifndef ICONV_CONST
  2984. # define ICONV_CONST $ac_iconv_const
  2985. #endif
  2986. ]],
  2987. [[int result = 0;
  2988. /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
  2989. returns. */
  2990. {
  2991. iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
  2992. if (cd_utf8_to_88591 != (iconv_t)(-1))
  2993. {
  2994. static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
  2995. char buf[10];
  2996. ICONV_CONST char *inptr = input;
  2997. size_t inbytesleft = strlen (input);
  2998. char *outptr = buf;
  2999. size_t outbytesleft = sizeof (buf);
  3000. size_t res = iconv (cd_utf8_to_88591,
  3001. &inptr, &inbytesleft,
  3002. &outptr, &outbytesleft);
  3003. if (res == 0)
  3004. result |= 1;
  3005. iconv_close (cd_utf8_to_88591);
  3006. }
  3007. }
  3008. /* Test against Solaris 10 bug: Failures are not distinguishable from
  3009. successful returns. */
  3010. {
  3011. iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
  3012. if (cd_ascii_to_88591 != (iconv_t)(-1))
  3013. {
  3014. static ICONV_CONST char input[] = "\263";
  3015. char buf[10];
  3016. ICONV_CONST char *inptr = input;
  3017. size_t inbytesleft = strlen (input);
  3018. char *outptr = buf;
  3019. size_t outbytesleft = sizeof (buf);
  3020. size_t res = iconv (cd_ascii_to_88591,
  3021. &inptr, &inbytesleft,
  3022. &outptr, &outbytesleft);
  3023. if (res == 0)
  3024. result |= 2;
  3025. iconv_close (cd_ascii_to_88591);
  3026. }
  3027. }
  3028. /* Test against AIX 6.1..7.1 bug: Buffer overrun. */
  3029. {
  3030. iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
  3031. if (cd_88591_to_utf8 != (iconv_t)(-1))
  3032. {
  3033. static ICONV_CONST char input[] = "\304";
  3034. static char buf[2] = { (char)0xDE, (char)0xAD };
  3035. ICONV_CONST char *inptr = input;
  3036. size_t inbytesleft = 1;
  3037. char *outptr = buf;
  3038. size_t outbytesleft = 1;
  3039. size_t res = iconv (cd_88591_to_utf8,
  3040. &inptr, &inbytesleft,
  3041. &outptr, &outbytesleft);
  3042. if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
  3043. result |= 4;
  3044. iconv_close (cd_88591_to_utf8);
  3045. }
  3046. }
  3047. #if 0 /* This bug could be worked around by the caller. */
  3048. /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
  3049. {
  3050. iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
  3051. if (cd_88591_to_utf8 != (iconv_t)(-1))
  3052. {
  3053. static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
  3054. char buf[50];
  3055. ICONV_CONST char *inptr = input;
  3056. size_t inbytesleft = strlen (input);
  3057. char *outptr = buf;
  3058. size_t outbytesleft = sizeof (buf);
  3059. size_t res = iconv (cd_88591_to_utf8,
  3060. &inptr, &inbytesleft,
  3061. &outptr, &outbytesleft);
  3062. if ((int)res > 0)
  3063. result |= 8;
  3064. iconv_close (cd_88591_to_utf8);
  3065. }
  3066. }
  3067. #endif
  3068. /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
  3069. provided. */
  3070. if (/* Try standardized names. */
  3071. iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
  3072. /* Try IRIX, OSF/1 names. */
  3073. && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
  3074. /* Try AIX names. */
  3075. && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
  3076. /* Try HP-UX names. */
  3077. && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
  3078. result |= 16;
  3079. return result;
  3080. ]])],
  3081. [am_cv_func_iconv_works=yes], ,
  3082. [case "$host_os" in
  3083. aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
  3084. *) am_cv_func_iconv_works="guessing yes" ;;
  3085. esac])
  3086. test "$am_cv_func_iconv_works" = no || break
  3087. done
  3088. LIBS="$am_save_LIBS"
  3089. ])
  3090. case "$am_cv_func_iconv_works" in
  3091. *no) am_func_iconv=no am_cv_lib_iconv=no ;;
  3092. *) am_func_iconv=yes ;;
  3093. esac
  3094. else
  3095. am_func_iconv=no am_cv_lib_iconv=no
  3096. fi
  3097. if test "$am_func_iconv" = yes; then
  3098. AC_DEFINE([HAVE_ICONV], [1],
  3099. [Define if you have the iconv() function and it works.])
  3100. fi
  3101. if test "$am_cv_lib_iconv" = yes; then
  3102. AC_MSG_CHECKING([how to link with libiconv])
  3103. AC_MSG_RESULT([$LIBICONV])
  3104. else
  3105. dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
  3106. dnl either.
  3107. CPPFLAGS="$am_save_CPPFLAGS"
  3108. LIBICONV=
  3109. LTLIBICONV=
  3110. fi
  3111. AC_SUBST([LIBICONV])
  3112. AC_SUBST([LTLIBICONV])
  3113. ])
  3114. dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
  3115. dnl avoid warnings like
  3116. dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
  3117. dnl This is tricky because of the way 'aclocal' is implemented:
  3118. dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
  3119. dnl Otherwise aclocal's initial scan pass would miss the macro definition.
  3120. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
  3121. dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
  3122. dnl warnings.
  3123. m4_define([gl_iconv_AC_DEFUN],
  3124. m4_version_prereq([2.64],
  3125. [[AC_DEFUN_ONCE(
  3126. [$1], [$2])]],
  3127. [m4_ifdef([gl_00GNULIB],
  3128. [[AC_DEFUN_ONCE(
  3129. [$1], [$2])]],
  3130. [[AC_DEFUN(
  3131. [$1], [$2])]])]))
  3132. gl_iconv_AC_DEFUN([AM_ICONV],
  3133. [
  3134. AM_ICONV_LINK
  3135. if test "$am_cv_func_iconv" = yes; then
  3136. AC_MSG_CHECKING([for iconv declaration])
  3137. AC_CACHE_VAL([am_cv_proto_iconv], [
  3138. AC_COMPILE_IFELSE(
  3139. [AC_LANG_PROGRAM(
  3140. [[
  3141. #include <stdlib.h>
  3142. #include <iconv.h>
  3143. extern
  3144. #ifdef __cplusplus
  3145. "C"
  3146. #endif
  3147. #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
  3148. size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  3149. #else
  3150. size_t iconv();
  3151. #endif
  3152. ]],
  3153. [[]])],
  3154. [am_cv_proto_iconv_arg1=""],
  3155. [am_cv_proto_iconv_arg1="const"])
  3156. 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);"])
  3157. am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
  3158. AC_MSG_RESULT([
  3159. $am_cv_proto_iconv])
  3160. AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
  3161. [Define as const if the declaration of iconv() needs const.])
  3162. dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
  3163. m4_ifdef([gl_ICONV_H_DEFAULTS],
  3164. [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
  3165. if test -n "$am_cv_proto_iconv_arg1"; then
  3166. ICONV_CONST="const"
  3167. fi
  3168. ])
  3169. fi
  3170. ])
  3171. # intlmacosx.m4 serial 5 (gettext-0.18.2)
  3172. dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
  3173. dnl This file is free software; the Free Software Foundation
  3174. dnl gives unlimited permission to copy and/or distribute it,
  3175. dnl with or without modifications, as long as this notice is preserved.
  3176. dnl
  3177. dnl This file can be used in projects which are not available under
  3178. dnl the GNU General Public License or the GNU Library General Public
  3179. dnl License but which still want to provide support for the GNU gettext
  3180. dnl functionality.
  3181. dnl Please note that the actual code of the GNU gettext library is covered
  3182. dnl by the GNU Library General Public License, and the rest of the GNU
  3183. dnl gettext package is covered by the GNU General Public License.
  3184. dnl They are *not* in the public domain.
  3185. dnl Checks for special options needed on Mac OS X.
  3186. dnl Defines INTL_MACOSX_LIBS.
  3187. AC_DEFUN([gt_INTL_MACOSX],
  3188. [
  3189. dnl Check for API introduced in Mac OS X 10.2.
  3190. AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
  3191. [gt_cv_func_CFPreferencesCopyAppValue],
  3192. [gt_save_LIBS="$LIBS"
  3193. LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
  3194. AC_LINK_IFELSE(
  3195. [AC_LANG_PROGRAM(
  3196. [[#include <CoreFoundation/CFPreferences.h>]],
  3197. [[CFPreferencesCopyAppValue(NULL, NULL)]])],
  3198. [gt_cv_func_CFPreferencesCopyAppValue=yes],
  3199. [gt_cv_func_CFPreferencesCopyAppValue=no])
  3200. LIBS="$gt_save_LIBS"])
  3201. if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
  3202. AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
  3203. [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
  3204. fi
  3205. dnl Check for API introduced in Mac OS X 10.3.
  3206. AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
  3207. [gt_save_LIBS="$LIBS"
  3208. LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
  3209. AC_LINK_IFELSE(
  3210. [AC_LANG_PROGRAM(
  3211. [[#include <CoreFoundation/CFLocale.h>]],
  3212. [[CFLocaleCopyCurrent();]])],
  3213. [gt_cv_func_CFLocaleCopyCurrent=yes],
  3214. [gt_cv_func_CFLocaleCopyCurrent=no])
  3215. LIBS="$gt_save_LIBS"])
  3216. if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
  3217. AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
  3218. [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
  3219. fi
  3220. INTL_MACOSX_LIBS=
  3221. if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
  3222. INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
  3223. fi
  3224. AC_SUBST([INTL_MACOSX_LIBS])
  3225. ])
  3226. # lib-ld.m4 serial 6
  3227. dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
  3228. dnl This file is free software; the Free Software Foundation
  3229. dnl gives unlimited permission to copy and/or distribute it,
  3230. dnl with or without modifications, as long as this notice is preserved.
  3231. dnl Subroutines of libtool.m4,
  3232. dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid
  3233. dnl collision with libtool.m4.
  3234. dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no.
  3235. AC_DEFUN([AC_LIB_PROG_LD_GNU],
  3236. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
  3237. [# I'd rather use --version here, but apparently some GNU lds only accept -v.
  3238. case `$LD -v 2>&1 </dev/null` in
  3239. *GNU* | *'with BFD'*)
  3240. acl_cv_prog_gnu_ld=yes
  3241. ;;
  3242. *)
  3243. acl_cv_prog_gnu_ld=no
  3244. ;;
  3245. esac])
  3246. with_gnu_ld=$acl_cv_prog_gnu_ld
  3247. ])
  3248. dnl From libtool-2.4. Sets the variable LD.
  3249. AC_DEFUN([AC_LIB_PROG_LD],
  3250. [AC_REQUIRE([AC_PROG_CC])dnl
  3251. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  3252. AC_ARG_WITH([gnu-ld],
  3253. [AS_HELP_STRING([--with-gnu-ld],
  3254. [assume the C compiler uses GNU ld [default=no]])],
  3255. [test "$withval" = no || with_gnu_ld=yes],
  3256. [with_gnu_ld=no])dnl
  3257. # Prepare PATH_SEPARATOR.
  3258. # The user is always right.
  3259. if test "${PATH_SEPARATOR+set}" != set; then
  3260. # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
  3261. # contains only /bin. Note that ksh looks also at the FPATH variable,
  3262. # so we have to set that as well for the test.
  3263. PATH_SEPARATOR=:
  3264. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  3265. && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  3266. || PATH_SEPARATOR=';'
  3267. }
  3268. fi
  3269. ac_prog=ld
  3270. if test "$GCC" = yes; then
  3271. # Check if gcc -print-prog-name=ld gives a path.
  3272. AC_MSG_CHECKING([for ld used by $CC])
  3273. case $host in
  3274. *-*-mingw*)
  3275. # gcc leaves a trailing carriage return which upsets mingw
  3276. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  3277. *)
  3278. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  3279. esac
  3280. case $ac_prog in
  3281. # Accept absolute paths.
  3282. [[\\/]]* | ?:[[\\/]]*)
  3283. re_direlt='/[[^/]][[^/]]*/\.\./'
  3284. # Canonicalize the pathname of ld
  3285. ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
  3286. while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
  3287. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  3288. done
  3289. test -z "$LD" && LD="$ac_prog"
  3290. ;;
  3291. "")
  3292. # If it fails, then pretend we aren't using GCC.
  3293. ac_prog=ld
  3294. ;;
  3295. *)
  3296. # If it is relative, then search for the first ld in PATH.
  3297. with_gnu_ld=unknown
  3298. ;;
  3299. esac
  3300. elif test "$with_gnu_ld" = yes; then
  3301. AC_MSG_CHECKING([for GNU ld])
  3302. else
  3303. AC_MSG_CHECKING([for non-GNU ld])
  3304. fi
  3305. AC_CACHE_VAL([acl_cv_path_LD],
  3306. [if test -z "$LD"; then
  3307. acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  3308. for ac_dir in $PATH; do
  3309. IFS="$acl_save_ifs"
  3310. test -z "$ac_dir" && ac_dir=.
  3311. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  3312. acl_cv_path_LD="$ac_dir/$ac_prog"
  3313. # Check to see if the program is GNU ld. I'd rather use --version,
  3314. # but apparently some variants of GNU ld only accept -v.
  3315. # Break only if it was the GNU/non-GNU ld that we prefer.
  3316. case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
  3317. *GNU* | *'with BFD'*)
  3318. test "$with_gnu_ld" != no && break
  3319. ;;
  3320. *)
  3321. test "$with_gnu_ld" != yes && break
  3322. ;;
  3323. esac
  3324. fi
  3325. done
  3326. IFS="$acl_save_ifs"
  3327. else
  3328. acl_cv_path_LD="$LD" # Let the user override the test with a path.
  3329. fi])
  3330. LD="$acl_cv_path_LD"
  3331. if test -n "$LD"; then
  3332. AC_MSG_RESULT([$LD])
  3333. else
  3334. AC_MSG_RESULT([no])
  3335. fi
  3336. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  3337. AC_LIB_PROG_LD_GNU
  3338. ])
  3339. # lib-link.m4 serial 26 (gettext-0.18.2)
  3340. dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
  3341. dnl This file is free software; the Free Software Foundation
  3342. dnl gives unlimited permission to copy and/or distribute it,
  3343. dnl with or without modifications, as long as this notice is preserved.
  3344. dnl From Bruno Haible.
  3345. AC_PREREQ([2.54])
  3346. dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
  3347. dnl the libraries corresponding to explicit and implicit dependencies.
  3348. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
  3349. dnl augments the CPPFLAGS variable.
  3350. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
  3351. dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  3352. AC_DEFUN([AC_LIB_LINKFLAGS],
  3353. [
  3354. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  3355. AC_REQUIRE([AC_LIB_RPATH])
  3356. pushdef([Name],[m4_translit([$1],[./+-], [____])])
  3357. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  3358. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  3359. AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
  3360. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  3361. ac_cv_lib[]Name[]_libs="$LIB[]NAME"
  3362. ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
  3363. ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
  3364. ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
  3365. ])
  3366. LIB[]NAME="$ac_cv_lib[]Name[]_libs"
  3367. LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
  3368. INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
  3369. LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
  3370. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  3371. AC_SUBST([LIB]NAME)
  3372. AC_SUBST([LTLIB]NAME)
  3373. AC_SUBST([LIB]NAME[_PREFIX])
  3374. dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
  3375. dnl results of this search when this library appears as a dependency.
  3376. HAVE_LIB[]NAME=yes
  3377. popdef([NAME])
  3378. popdef([Name])
  3379. ])
  3380. dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message])
  3381. dnl searches for libname and the libraries corresponding to explicit and
  3382. dnl implicit dependencies, together with the specified include files and
  3383. dnl the ability to compile and link the specified testcode. The missing-message
  3384. dnl defaults to 'no' and may contain additional hints for the user.
  3385. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
  3386. dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
  3387. dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
  3388. dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
  3389. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
  3390. dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  3391. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
  3392. [
  3393. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  3394. AC_REQUIRE([AC_LIB_RPATH])
  3395. pushdef([Name],[m4_translit([$1],[./+-], [____])])
  3396. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  3397. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  3398. dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
  3399. dnl accordingly.
  3400. AC_LIB_LINKFLAGS_BODY([$1], [$2])
  3401. dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
  3402. dnl because if the user has installed lib[]Name and not disabled its use
  3403. dnl via --without-lib[]Name-prefix, he wants to use it.
  3404. ac_save_CPPFLAGS="$CPPFLAGS"
  3405. AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
  3406. AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
  3407. ac_save_LIBS="$LIBS"
  3408. dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS,
  3409. dnl because these -l options might require -L options that are present in
  3410. dnl LIBS. -l options benefit only from the -L options listed before it.
  3411. dnl Otherwise, add it to the front of LIBS, because it may be a static
  3412. dnl library that depends on another static library that is present in LIBS.
  3413. dnl Static libraries benefit only from the static libraries listed after
  3414. dnl it.
  3415. case " $LIB[]NAME" in
  3416. *" -l"*) LIBS="$LIBS $LIB[]NAME" ;;
  3417. *) LIBS="$LIB[]NAME $LIBS" ;;
  3418. esac
  3419. AC_LINK_IFELSE(
  3420. [AC_LANG_PROGRAM([[$3]], [[$4]])],
  3421. [ac_cv_lib[]Name=yes],
  3422. [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
  3423. LIBS="$ac_save_LIBS"
  3424. ])
  3425. if test "$ac_cv_lib[]Name" = yes; then
  3426. HAVE_LIB[]NAME=yes
  3427. AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
  3428. AC_MSG_CHECKING([how to link with lib[]$1])
  3429. AC_MSG_RESULT([$LIB[]NAME])
  3430. else
  3431. HAVE_LIB[]NAME=no
  3432. dnl If $LIB[]NAME didn't lead to a usable library, we don't need
  3433. dnl $INC[]NAME either.
  3434. CPPFLAGS="$ac_save_CPPFLAGS"
  3435. LIB[]NAME=
  3436. LTLIB[]NAME=
  3437. LIB[]NAME[]_PREFIX=
  3438. fi
  3439. AC_SUBST([HAVE_LIB]NAME)
  3440. AC_SUBST([LIB]NAME)
  3441. AC_SUBST([LTLIB]NAME)
  3442. AC_SUBST([LIB]NAME[_PREFIX])
  3443. popdef([NAME])
  3444. popdef([Name])
  3445. ])
  3446. dnl Determine the platform dependent parameters needed to use rpath:
  3447. dnl acl_libext,
  3448. dnl acl_shlibext,
  3449. dnl acl_libname_spec,
  3450. dnl acl_library_names_spec,
  3451. dnl acl_hardcode_libdir_flag_spec,
  3452. dnl acl_hardcode_libdir_separator,
  3453. dnl acl_hardcode_direct,
  3454. dnl acl_hardcode_minus_L.
  3455. AC_DEFUN([AC_LIB_RPATH],
  3456. [
  3457. dnl Tell automake >= 1.10 to complain if config.rpath is missing.
  3458. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
  3459. AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
  3460. AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
  3461. AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
  3462. AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
  3463. AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [
  3464. CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
  3465. ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
  3466. . ./conftest.sh
  3467. rm -f ./conftest.sh
  3468. acl_cv_rpath=done
  3469. ])
  3470. wl="$acl_cv_wl"
  3471. acl_libext="$acl_cv_libext"
  3472. acl_shlibext="$acl_cv_shlibext"
  3473. acl_libname_spec="$acl_cv_libname_spec"
  3474. acl_library_names_spec="$acl_cv_library_names_spec"
  3475. acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
  3476. acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
  3477. acl_hardcode_direct="$acl_cv_hardcode_direct"
  3478. acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
  3479. dnl Determine whether the user wants rpath handling at all.
  3480. AC_ARG_ENABLE([rpath],
  3481. [ --disable-rpath do not hardcode runtime library paths],
  3482. :, enable_rpath=yes)
  3483. ])
  3484. dnl AC_LIB_FROMPACKAGE(name, package)
  3485. dnl declares that libname comes from the given package. The configure file
  3486. dnl will then not have a --with-libname-prefix option but a
  3487. dnl --with-package-prefix option. Several libraries can come from the same
  3488. dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar
  3489. dnl macro call that searches for libname.
  3490. AC_DEFUN([AC_LIB_FROMPACKAGE],
  3491. [
  3492. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  3493. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  3494. define([acl_frompackage_]NAME, [$2])
  3495. popdef([NAME])
  3496. pushdef([PACK],[$2])
  3497. pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
  3498. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  3499. define([acl_libsinpackage_]PACKUP,
  3500. m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[, ]],)[lib$1])
  3501. popdef([PACKUP])
  3502. popdef([PACK])
  3503. ])
  3504. dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
  3505. dnl the libraries corresponding to explicit and implicit dependencies.
  3506. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
  3507. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
  3508. dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
  3509. AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
  3510. [
  3511. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  3512. pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-],
  3513. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  3514. pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])])
  3515. pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
  3516. [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
  3517. pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
  3518. dnl Autoconf >= 2.61 supports dots in --with options.
  3519. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
  3520. dnl By default, look in $includedir and $libdir.
  3521. use_additional=yes
  3522. AC_LIB_WITH_FINAL_PREFIX([
  3523. eval additional_includedir=\"$includedir\"
  3524. eval additional_libdir=\"$libdir\"
  3525. ])
  3526. AC_ARG_WITH(P_A_C_K[-prefix],
  3527. [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
  3528. --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
  3529. [
  3530. if test "X$withval" = "Xno"; then
  3531. use_additional=no
  3532. else
  3533. if test "X$withval" = "X"; then
  3534. AC_LIB_WITH_FINAL_PREFIX([
  3535. eval additional_includedir=\"$includedir\"
  3536. eval additional_libdir=\"$libdir\"
  3537. ])
  3538. else
  3539. additional_includedir="$withval/include"
  3540. additional_libdir="$withval/$acl_libdirstem"
  3541. if test "$acl_libdirstem2" != "$acl_libdirstem" \
  3542. && ! test -d "$withval/$acl_libdirstem"; then
  3543. additional_libdir="$withval/$acl_libdirstem2"
  3544. fi
  3545. fi
  3546. fi
  3547. ])
  3548. dnl Search the library and its dependencies in $additional_libdir and
  3549. dnl $LDFLAGS. Using breadth-first-seach.
  3550. LIB[]NAME=
  3551. LTLIB[]NAME=
  3552. INC[]NAME=
  3553. LIB[]NAME[]_PREFIX=
  3554. dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
  3555. dnl computed. So it has to be reset here.
  3556. HAVE_LIB[]NAME=
  3557. rpathdirs=
  3558. ltrpathdirs=
  3559. names_already_handled=
  3560. names_next_round='$1 $2'
  3561. while test -n "$names_next_round"; do
  3562. names_this_round="$names_next_round"
  3563. names_next_round=
  3564. for name in $names_this_round; do
  3565. already_handled=
  3566. for n in $names_already_handled; do
  3567. if test "$n" = "$name"; then
  3568. already_handled=yes
  3569. break
  3570. fi
  3571. done
  3572. if test -z "$already_handled"; then
  3573. names_already_handled="$names_already_handled $name"
  3574. dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
  3575. dnl or AC_LIB_HAVE_LINKFLAGS call.
  3576. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
  3577. eval value=\"\$HAVE_LIB$uppername\"
  3578. if test -n "$value"; then
  3579. if test "$value" = yes; then
  3580. eval value=\"\$LIB$uppername\"
  3581. test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
  3582. eval value=\"\$LTLIB$uppername\"
  3583. test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
  3584. else
  3585. dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
  3586. dnl that this library doesn't exist. So just drop it.
  3587. :
  3588. fi
  3589. else
  3590. dnl Search the library lib$name in $additional_libdir and $LDFLAGS
  3591. dnl and the already constructed $LIBNAME/$LTLIBNAME.
  3592. found_dir=
  3593. found_la=
  3594. found_so=
  3595. found_a=
  3596. eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
  3597. if test -n "$acl_shlibext"; then
  3598. shrext=".$acl_shlibext" # typically: shrext=.so
  3599. else
  3600. shrext=
  3601. fi
  3602. if test $use_additional = yes; then
  3603. dir="$additional_libdir"
  3604. dnl The same code as in the loop below:
  3605. dnl First look for a shared library.
  3606. if test -n "$acl_shlibext"; then
  3607. if test -f "$dir/$libname$shrext"; then
  3608. found_dir="$dir"
  3609. found_so="$dir/$libname$shrext"
  3610. else
  3611. if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
  3612. ver=`(cd "$dir" && \
  3613. for f in "$libname$shrext".*; do echo "$f"; done \
  3614. | sed -e "s,^$libname$shrext\\\\.,," \
  3615. | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
  3616. | sed 1q ) 2>/dev/null`
  3617. if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
  3618. found_dir="$dir"
  3619. found_so="$dir/$libname$shrext.$ver"
  3620. fi
  3621. else
  3622. eval library_names=\"$acl_library_names_spec\"
  3623. for f in $library_names; do
  3624. if test -f "$dir/$f"; then
  3625. found_dir="$dir"
  3626. found_so="$dir/$f"
  3627. break
  3628. fi
  3629. done
  3630. fi
  3631. fi
  3632. fi
  3633. dnl Then look for a static library.
  3634. if test "X$found_dir" = "X"; then
  3635. if test -f "$dir/$libname.$acl_libext"; then
  3636. found_dir="$dir"
  3637. found_a="$dir/$libname.$acl_libext"
  3638. fi
  3639. fi
  3640. if test "X$found_dir" != "X"; then
  3641. if test -f "$dir/$libname.la"; then
  3642. found_la="$dir/$libname.la"
  3643. fi
  3644. fi
  3645. fi
  3646. if test "X$found_dir" = "X"; then
  3647. for x in $LDFLAGS $LTLIB[]NAME; do
  3648. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  3649. case "$x" in
  3650. -L*)
  3651. dir=`echo "X$x" | sed -e 's/^X-L//'`
  3652. dnl First look for a shared library.
  3653. if test -n "$acl_shlibext"; then
  3654. if test -f "$dir/$libname$shrext"; then
  3655. found_dir="$dir"
  3656. found_so="$dir/$libname$shrext"
  3657. else
  3658. if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
  3659. ver=`(cd "$dir" && \
  3660. for f in "$libname$shrext".*; do echo "$f"; done \
  3661. | sed -e "s,^$libname$shrext\\\\.,," \
  3662. | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
  3663. | sed 1q ) 2>/dev/null`
  3664. if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
  3665. found_dir="$dir"
  3666. found_so="$dir/$libname$shrext.$ver"
  3667. fi
  3668. else
  3669. eval library_names=\"$acl_library_names_spec\"
  3670. for f in $library_names; do
  3671. if test -f "$dir/$f"; then
  3672. found_dir="$dir"
  3673. found_so="$dir/$f"
  3674. break
  3675. fi
  3676. done
  3677. fi
  3678. fi
  3679. fi
  3680. dnl Then look for a static library.
  3681. if test "X$found_dir" = "X"; then
  3682. if test -f "$dir/$libname.$acl_libext"; then
  3683. found_dir="$dir"
  3684. found_a="$dir/$libname.$acl_libext"
  3685. fi
  3686. fi
  3687. if test "X$found_dir" != "X"; then
  3688. if test -f "$dir/$libname.la"; then
  3689. found_la="$dir/$libname.la"
  3690. fi
  3691. fi
  3692. ;;
  3693. esac
  3694. if test "X$found_dir" != "X"; then
  3695. break
  3696. fi
  3697. done
  3698. fi
  3699. if test "X$found_dir" != "X"; then
  3700. dnl Found the library.
  3701. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
  3702. if test "X$found_so" != "X"; then
  3703. dnl Linking with a shared library. We attempt to hardcode its
  3704. dnl directory into the executable's runpath, unless it's the
  3705. dnl standard /usr/lib.
  3706. if test "$enable_rpath" = no \
  3707. || test "X$found_dir" = "X/usr/$acl_libdirstem" \
  3708. || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
  3709. dnl No hardcoding is needed.
  3710. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  3711. else
  3712. dnl Use an explicit option to hardcode DIR into the resulting
  3713. dnl binary.
  3714. dnl Potentially add DIR to ltrpathdirs.
  3715. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  3716. haveit=
  3717. for x in $ltrpathdirs; do
  3718. if test "X$x" = "X$found_dir"; then
  3719. haveit=yes
  3720. break
  3721. fi
  3722. done
  3723. if test -z "$haveit"; then
  3724. ltrpathdirs="$ltrpathdirs $found_dir"
  3725. fi
  3726. dnl The hardcoding into $LIBNAME is system dependent.
  3727. if test "$acl_hardcode_direct" = yes; then
  3728. dnl Using DIR/libNAME.so during linking hardcodes DIR into the
  3729. dnl resulting binary.
  3730. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  3731. else
  3732. if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
  3733. dnl Use an explicit option to hardcode DIR into the resulting
  3734. dnl binary.
  3735. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  3736. dnl Potentially add DIR to rpathdirs.
  3737. dnl The rpathdirs will be appended to $LIBNAME at the end.
  3738. haveit=
  3739. for x in $rpathdirs; do
  3740. if test "X$x" = "X$found_dir"; then
  3741. haveit=yes
  3742. break
  3743. fi
  3744. done
  3745. if test -z "$haveit"; then
  3746. rpathdirs="$rpathdirs $found_dir"
  3747. fi
  3748. else
  3749. dnl Rely on "-L$found_dir".
  3750. dnl But don't add it if it's already contained in the LDFLAGS
  3751. dnl or the already constructed $LIBNAME
  3752. haveit=
  3753. for x in $LDFLAGS $LIB[]NAME; do
  3754. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  3755. if test "X$x" = "X-L$found_dir"; then
  3756. haveit=yes
  3757. break
  3758. fi
  3759. done
  3760. if test -z "$haveit"; then
  3761. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
  3762. fi
  3763. if test "$acl_hardcode_minus_L" != no; then
  3764. dnl FIXME: Not sure whether we should use
  3765. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  3766. dnl here.
  3767. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
  3768. else
  3769. dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
  3770. dnl here, because this doesn't fit in flags passed to the
  3771. dnl compiler. So give up. No hardcoding. This affects only
  3772. dnl very old systems.
  3773. dnl FIXME: Not sure whether we should use
  3774. dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
  3775. dnl here.
  3776. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  3777. fi
  3778. fi
  3779. fi
  3780. fi
  3781. else
  3782. if test "X$found_a" != "X"; then
  3783. dnl Linking with a static library.
  3784. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
  3785. else
  3786. dnl We shouldn't come here, but anyway it's good to have a
  3787. dnl fallback.
  3788. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
  3789. fi
  3790. fi
  3791. dnl Assume the include files are nearby.
  3792. additional_includedir=
  3793. case "$found_dir" in
  3794. */$acl_libdirstem | */$acl_libdirstem/)
  3795. basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
  3796. if test "$name" = '$1'; then
  3797. LIB[]NAME[]_PREFIX="$basedir"
  3798. fi
  3799. additional_includedir="$basedir/include"
  3800. ;;
  3801. */$acl_libdirstem2 | */$acl_libdirstem2/)
  3802. basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
  3803. if test "$name" = '$1'; then
  3804. LIB[]NAME[]_PREFIX="$basedir"
  3805. fi
  3806. additional_includedir="$basedir/include"
  3807. ;;
  3808. esac
  3809. if test "X$additional_includedir" != "X"; then
  3810. dnl Potentially add $additional_includedir to $INCNAME.
  3811. dnl But don't add it
  3812. dnl 1. if it's the standard /usr/include,
  3813. dnl 2. if it's /usr/local/include and we are using GCC on Linux,
  3814. dnl 3. if it's already present in $CPPFLAGS or the already
  3815. dnl constructed $INCNAME,
  3816. dnl 4. if it doesn't exist as a directory.
  3817. if test "X$additional_includedir" != "X/usr/include"; then
  3818. haveit=
  3819. if test "X$additional_includedir" = "X/usr/local/include"; then
  3820. if test -n "$GCC"; then
  3821. case $host_os in
  3822. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  3823. esac
  3824. fi
  3825. fi
  3826. if test -z "$haveit"; then
  3827. for x in $CPPFLAGS $INC[]NAME; do
  3828. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  3829. if test "X$x" = "X-I$additional_includedir"; then
  3830. haveit=yes
  3831. break
  3832. fi
  3833. done
  3834. if test -z "$haveit"; then
  3835. if test -d "$additional_includedir"; then
  3836. dnl Really add $additional_includedir to $INCNAME.
  3837. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
  3838. fi
  3839. fi
  3840. fi
  3841. fi
  3842. fi
  3843. dnl Look for dependencies.
  3844. if test -n "$found_la"; then
  3845. dnl Read the .la file. It defines the variables
  3846. dnl dlname, library_names, old_library, dependency_libs, current,
  3847. dnl age, revision, installed, dlopen, dlpreopen, libdir.
  3848. save_libdir="$libdir"
  3849. case "$found_la" in
  3850. */* | *\\*) . "$found_la" ;;
  3851. *) . "./$found_la" ;;
  3852. esac
  3853. libdir="$save_libdir"
  3854. dnl We use only dependency_libs.
  3855. for dep in $dependency_libs; do
  3856. case "$dep" in
  3857. -L*)
  3858. additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
  3859. dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
  3860. dnl But don't add it
  3861. dnl 1. if it's the standard /usr/lib,
  3862. dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
  3863. dnl 3. if it's already present in $LDFLAGS or the already
  3864. dnl constructed $LIBNAME,
  3865. dnl 4. if it doesn't exist as a directory.
  3866. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
  3867. && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
  3868. haveit=
  3869. if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
  3870. || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
  3871. if test -n "$GCC"; then
  3872. case $host_os in
  3873. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  3874. esac
  3875. fi
  3876. fi
  3877. if test -z "$haveit"; then
  3878. haveit=
  3879. for x in $LDFLAGS $LIB[]NAME; do
  3880. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  3881. if test "X$x" = "X-L$additional_libdir"; then
  3882. haveit=yes
  3883. break
  3884. fi
  3885. done
  3886. if test -z "$haveit"; then
  3887. if test -d "$additional_libdir"; then
  3888. dnl Really add $additional_libdir to $LIBNAME.
  3889. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
  3890. fi
  3891. fi
  3892. haveit=
  3893. for x in $LDFLAGS $LTLIB[]NAME; do
  3894. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  3895. if test "X$x" = "X-L$additional_libdir"; then
  3896. haveit=yes
  3897. break
  3898. fi
  3899. done
  3900. if test -z "$haveit"; then
  3901. if test -d "$additional_libdir"; then
  3902. dnl Really add $additional_libdir to $LTLIBNAME.
  3903. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
  3904. fi
  3905. fi
  3906. fi
  3907. fi
  3908. ;;
  3909. -R*)
  3910. dir=`echo "X$dep" | sed -e 's/^X-R//'`
  3911. if test "$enable_rpath" != no; then
  3912. dnl Potentially add DIR to rpathdirs.
  3913. dnl The rpathdirs will be appended to $LIBNAME at the end.
  3914. haveit=
  3915. for x in $rpathdirs; do
  3916. if test "X$x" = "X$dir"; then
  3917. haveit=yes
  3918. break
  3919. fi
  3920. done
  3921. if test -z "$haveit"; then
  3922. rpathdirs="$rpathdirs $dir"
  3923. fi
  3924. dnl Potentially add DIR to ltrpathdirs.
  3925. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
  3926. haveit=
  3927. for x in $ltrpathdirs; do
  3928. if test "X$x" = "X$dir"; then
  3929. haveit=yes
  3930. break
  3931. fi
  3932. done
  3933. if test -z "$haveit"; then
  3934. ltrpathdirs="$ltrpathdirs $dir"
  3935. fi
  3936. fi
  3937. ;;
  3938. -l*)
  3939. dnl Handle this in the next round.
  3940. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
  3941. ;;
  3942. *.la)
  3943. dnl Handle this in the next round. Throw away the .la's
  3944. dnl directory; it is already contained in a preceding -L
  3945. dnl option.
  3946. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
  3947. ;;
  3948. *)
  3949. dnl Most likely an immediate library name.
  3950. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
  3951. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
  3952. ;;
  3953. esac
  3954. done
  3955. fi
  3956. else
  3957. dnl Didn't find the library; assume it is in the system directories
  3958. dnl known to the linker and runtime loader. (All the system
  3959. dnl directories known to the linker should also be known to the
  3960. dnl runtime loader, otherwise the system is severely misconfigured.)
  3961. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
  3962. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
  3963. fi
  3964. fi
  3965. fi
  3966. done
  3967. done
  3968. if test "X$rpathdirs" != "X"; then
  3969. if test -n "$acl_hardcode_libdir_separator"; then
  3970. dnl Weird platform: only the last -rpath option counts, the user must
  3971. dnl pass all path elements in one option. We can arrange that for a
  3972. dnl single library, but not when more than one $LIBNAMEs are used.
  3973. alldirs=
  3974. for found_dir in $rpathdirs; do
  3975. alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
  3976. done
  3977. dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
  3978. acl_save_libdir="$libdir"
  3979. libdir="$alldirs"
  3980. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  3981. libdir="$acl_save_libdir"
  3982. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  3983. else
  3984. dnl The -rpath options are cumulative.
  3985. for found_dir in $rpathdirs; do
  3986. acl_save_libdir="$libdir"
  3987. libdir="$found_dir"
  3988. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  3989. libdir="$acl_save_libdir"
  3990. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
  3991. done
  3992. fi
  3993. fi
  3994. if test "X$ltrpathdirs" != "X"; then
  3995. dnl When using libtool, the option that works for both libraries and
  3996. dnl executables is -R. The -R options are cumulative.
  3997. for found_dir in $ltrpathdirs; do
  3998. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
  3999. done
  4000. fi
  4001. popdef([P_A_C_K])
  4002. popdef([PACKLIBS])
  4003. popdef([PACKUP])
  4004. popdef([PACK])
  4005. popdef([NAME])
  4006. ])
  4007. dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
  4008. dnl unless already present in VAR.
  4009. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
  4010. dnl contains two or three consecutive elements that belong together.
  4011. AC_DEFUN([AC_LIB_APPENDTOVAR],
  4012. [
  4013. for element in [$2]; do
  4014. haveit=
  4015. for x in $[$1]; do
  4016. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  4017. if test "X$x" = "X$element"; then
  4018. haveit=yes
  4019. break
  4020. fi
  4021. done
  4022. if test -z "$haveit"; then
  4023. [$1]="${[$1]}${[$1]:+ }$element"
  4024. fi
  4025. done
  4026. ])
  4027. dnl For those cases where a variable contains several -L and -l options
  4028. dnl referring to unknown libraries and directories, this macro determines the
  4029. dnl necessary additional linker options for the runtime path.
  4030. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
  4031. dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
  4032. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
  4033. dnl otherwise linking without libtool is assumed.
  4034. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
  4035. [
  4036. AC_REQUIRE([AC_LIB_RPATH])
  4037. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  4038. $1=
  4039. if test "$enable_rpath" != no; then
  4040. if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
  4041. dnl Use an explicit option to hardcode directories into the resulting
  4042. dnl binary.
  4043. rpathdirs=
  4044. next=
  4045. for opt in $2; do
  4046. if test -n "$next"; then
  4047. dir="$next"
  4048. dnl No need to hardcode the standard /usr/lib.
  4049. if test "X$dir" != "X/usr/$acl_libdirstem" \
  4050. && test "X$dir" != "X/usr/$acl_libdirstem2"; then
  4051. rpathdirs="$rpathdirs $dir"
  4052. fi
  4053. next=
  4054. else
  4055. case $opt in
  4056. -L) next=yes ;;
  4057. -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
  4058. dnl No need to hardcode the standard /usr/lib.
  4059. if test "X$dir" != "X/usr/$acl_libdirstem" \
  4060. && test "X$dir" != "X/usr/$acl_libdirstem2"; then
  4061. rpathdirs="$rpathdirs $dir"
  4062. fi
  4063. next= ;;
  4064. *) next= ;;
  4065. esac
  4066. fi
  4067. done
  4068. if test "X$rpathdirs" != "X"; then
  4069. if test -n ""$3""; then
  4070. dnl libtool is used for linking. Use -R options.
  4071. for dir in $rpathdirs; do
  4072. $1="${$1}${$1:+ }-R$dir"
  4073. done
  4074. else
  4075. dnl The linker is used for linking directly.
  4076. if test -n "$acl_hardcode_libdir_separator"; then
  4077. dnl Weird platform: only the last -rpath option counts, the user
  4078. dnl must pass all path elements in one option.
  4079. alldirs=
  4080. for dir in $rpathdirs; do
  4081. alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
  4082. done
  4083. acl_save_libdir="$libdir"
  4084. libdir="$alldirs"
  4085. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  4086. libdir="$acl_save_libdir"
  4087. $1="$flag"
  4088. else
  4089. dnl The -rpath options are cumulative.
  4090. for dir in $rpathdirs; do
  4091. acl_save_libdir="$libdir"
  4092. libdir="$dir"
  4093. eval flag=\"$acl_hardcode_libdir_flag_spec\"
  4094. libdir="$acl_save_libdir"
  4095. $1="${$1}${$1:+ }$flag"
  4096. done
  4097. fi
  4098. fi
  4099. fi
  4100. fi
  4101. fi
  4102. AC_SUBST([$1])
  4103. ])
  4104. # lib-prefix.m4 serial 7 (gettext-0.18)
  4105. dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
  4106. dnl This file is free software; the Free Software Foundation
  4107. dnl gives unlimited permission to copy and/or distribute it,
  4108. dnl with or without modifications, as long as this notice is preserved.
  4109. dnl From Bruno Haible.
  4110. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
  4111. dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
  4112. dnl require excessive bracketing.
  4113. ifdef([AC_HELP_STRING],
  4114. [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
  4115. [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
  4116. dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
  4117. dnl to access previously installed libraries. The basic assumption is that
  4118. dnl a user will want packages to use other packages he previously installed
  4119. dnl with the same --prefix option.
  4120. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
  4121. dnl libraries, but is otherwise very convenient.
  4122. AC_DEFUN([AC_LIB_PREFIX],
  4123. [
  4124. AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
  4125. AC_REQUIRE([AC_PROG_CC])
  4126. AC_REQUIRE([AC_CANONICAL_HOST])
  4127. AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
  4128. AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
  4129. dnl By default, look in $includedir and $libdir.
  4130. use_additional=yes
  4131. AC_LIB_WITH_FINAL_PREFIX([
  4132. eval additional_includedir=\"$includedir\"
  4133. eval additional_libdir=\"$libdir\"
  4134. ])
  4135. AC_LIB_ARG_WITH([lib-prefix],
  4136. [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
  4137. --without-lib-prefix don't search for libraries in includedir and libdir],
  4138. [
  4139. if test "X$withval" = "Xno"; then
  4140. use_additional=no
  4141. else
  4142. if test "X$withval" = "X"; then
  4143. AC_LIB_WITH_FINAL_PREFIX([
  4144. eval additional_includedir=\"$includedir\"
  4145. eval additional_libdir=\"$libdir\"
  4146. ])
  4147. else
  4148. additional_includedir="$withval/include"
  4149. additional_libdir="$withval/$acl_libdirstem"
  4150. fi
  4151. fi
  4152. ])
  4153. if test $use_additional = yes; then
  4154. dnl Potentially add $additional_includedir to $CPPFLAGS.
  4155. dnl But don't add it
  4156. dnl 1. if it's the standard /usr/include,
  4157. dnl 2. if it's already present in $CPPFLAGS,
  4158. dnl 3. if it's /usr/local/include and we are using GCC on Linux,
  4159. dnl 4. if it doesn't exist as a directory.
  4160. if test "X$additional_includedir" != "X/usr/include"; then
  4161. haveit=
  4162. for x in $CPPFLAGS; do
  4163. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  4164. if test "X$x" = "X-I$additional_includedir"; then
  4165. haveit=yes
  4166. break
  4167. fi
  4168. done
  4169. if test -z "$haveit"; then
  4170. if test "X$additional_includedir" = "X/usr/local/include"; then
  4171. if test -n "$GCC"; then
  4172. case $host_os in
  4173. linux* | gnu* | k*bsd*-gnu) haveit=yes;;
  4174. esac
  4175. fi
  4176. fi
  4177. if test -z "$haveit"; then
  4178. if test -d "$additional_includedir"; then
  4179. dnl Really add $additional_includedir to $CPPFLAGS.
  4180. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
  4181. fi
  4182. fi
  4183. fi
  4184. fi
  4185. dnl Potentially add $additional_libdir to $LDFLAGS.
  4186. dnl But don't add it
  4187. dnl 1. if it's the standard /usr/lib,
  4188. dnl 2. if it's already present in $LDFLAGS,
  4189. dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
  4190. dnl 4. if it doesn't exist as a directory.
  4191. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
  4192. haveit=
  4193. for x in $LDFLAGS; do
  4194. AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
  4195. if test "X$x" = "X-L$additional_libdir"; then
  4196. haveit=yes
  4197. break
  4198. fi
  4199. done
  4200. if test -z "$haveit"; then
  4201. if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
  4202. if test -n "$GCC"; then
  4203. case $host_os in
  4204. linux*) haveit=yes;;
  4205. esac
  4206. fi
  4207. fi
  4208. if test -z "$haveit"; then
  4209. if test -d "$additional_libdir"; then
  4210. dnl Really add $additional_libdir to $LDFLAGS.
  4211. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
  4212. fi
  4213. fi
  4214. fi
  4215. fi
  4216. fi
  4217. ])
  4218. dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
  4219. dnl acl_final_exec_prefix, containing the values to which $prefix and
  4220. dnl $exec_prefix will expand at the end of the configure script.
  4221. AC_DEFUN([AC_LIB_PREPARE_PREFIX],
  4222. [
  4223. dnl Unfortunately, prefix and exec_prefix get only finally determined
  4224. dnl at the end of configure.
  4225. if test "X$prefix" = "XNONE"; then
  4226. acl_final_prefix="$ac_default_prefix"
  4227. else
  4228. acl_final_prefix="$prefix"
  4229. fi
  4230. if test "X$exec_prefix" = "XNONE"; then
  4231. acl_final_exec_prefix='${prefix}'
  4232. else
  4233. acl_final_exec_prefix="$exec_prefix"
  4234. fi
  4235. acl_save_prefix="$prefix"
  4236. prefix="$acl_final_prefix"
  4237. eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
  4238. prefix="$acl_save_prefix"
  4239. ])
  4240. dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
  4241. dnl variables prefix and exec_prefix bound to the values they will have
  4242. dnl at the end of the configure script.
  4243. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
  4244. [
  4245. acl_save_prefix="$prefix"
  4246. prefix="$acl_final_prefix"
  4247. acl_save_exec_prefix="$exec_prefix"
  4248. exec_prefix="$acl_final_exec_prefix"
  4249. $1
  4250. exec_prefix="$acl_save_exec_prefix"
  4251. prefix="$acl_save_prefix"
  4252. ])
  4253. dnl AC_LIB_PREPARE_MULTILIB creates
  4254. dnl - a variable acl_libdirstem, containing the basename of the libdir, either
  4255. dnl "lib" or "lib64" or "lib/64",
  4256. dnl - a variable acl_libdirstem2, as a secondary possible value for
  4257. dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
  4258. dnl "lib/amd64".
  4259. AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
  4260. [
  4261. dnl There is no formal standard regarding lib and lib64.
  4262. dnl On glibc systems, the current practice is that on a system supporting
  4263. dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  4264. dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
  4265. dnl the compiler's default mode by looking at the compiler's library search
  4266. dnl path. If at least one of its elements ends in /lib64 or points to a
  4267. dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
  4268. dnl Otherwise we use the default, namely "lib".
  4269. dnl On Solaris systems, the current practice is that on a system supporting
  4270. dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
  4271. dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
  4272. dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
  4273. AC_REQUIRE([AC_CANONICAL_HOST])
  4274. acl_libdirstem=lib
  4275. acl_libdirstem2=
  4276. case "$host_os" in
  4277. solaris*)
  4278. dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
  4279. dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
  4280. dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
  4281. dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
  4282. dnl symlink is missing, so we set acl_libdirstem2 too.
  4283. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
  4284. [AC_EGREP_CPP([sixtyfour bits], [
  4285. #ifdef _LP64
  4286. sixtyfour bits
  4287. #endif
  4288. ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
  4289. ])
  4290. if test $gl_cv_solaris_64bit = yes; then
  4291. acl_libdirstem=lib/64
  4292. case "$host_cpu" in
  4293. sparc*) acl_libdirstem2=lib/sparcv9 ;;
  4294. i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
  4295. esac
  4296. fi
  4297. ;;
  4298. *)
  4299. searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
  4300. if test -n "$searchpath"; then
  4301. acl_save_IFS="${IFS= }"; IFS=":"
  4302. for searchdir in $searchpath; do
  4303. if test -d "$searchdir"; then
  4304. case "$searchdir" in
  4305. */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
  4306. */../ | */.. )
  4307. # Better ignore directories of this form. They are misleading.
  4308. ;;
  4309. *) searchdir=`cd "$searchdir" && pwd`
  4310. case "$searchdir" in
  4311. */lib64 ) acl_libdirstem=lib64 ;;
  4312. esac ;;
  4313. esac
  4314. fi
  4315. done
  4316. IFS="$acl_save_IFS"
  4317. fi
  4318. ;;
  4319. esac
  4320. test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
  4321. ])
  4322. # nls.m4 serial 5 (gettext-0.18)
  4323. dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software
  4324. dnl Foundation, Inc.
  4325. dnl This file is free software; the Free Software Foundation
  4326. dnl gives unlimited permission to copy and/or distribute it,
  4327. dnl with or without modifications, as long as this notice is preserved.
  4328. dnl
  4329. dnl This file can be used in projects which are not available under
  4330. dnl the GNU General Public License or the GNU Library General Public
  4331. dnl License but which still want to provide support for the GNU gettext
  4332. dnl functionality.
  4333. dnl Please note that the actual code of the GNU gettext library is covered
  4334. dnl by the GNU Library General Public License, and the rest of the GNU
  4335. dnl gettext package is covered by the GNU General Public License.
  4336. dnl They are *not* in the public domain.
  4337. dnl Authors:
  4338. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
  4339. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
  4340. AC_PREREQ([2.50])
  4341. AC_DEFUN([AM_NLS],
  4342. [
  4343. AC_MSG_CHECKING([whether NLS is requested])
  4344. dnl Default is enabled NLS
  4345. AC_ARG_ENABLE([nls],
  4346. [ --disable-nls do not use Native Language Support],
  4347. USE_NLS=$enableval, USE_NLS=yes)
  4348. AC_MSG_RESULT([$USE_NLS])
  4349. AC_SUBST([USE_NLS])
  4350. ])
  4351. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  4352. # serial 11 (pkg-config-0.29.1)
  4353. dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  4354. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
  4355. dnl
  4356. dnl This program is free software; you can redistribute it and/or modify
  4357. dnl it under the terms of the GNU General Public License as published by
  4358. dnl the Free Software Foundation; either version 2 of the License, or
  4359. dnl (at your option) any later version.
  4360. dnl
  4361. dnl This program is distributed in the hope that it will be useful, but
  4362. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  4363. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4364. dnl General Public License for more details.
  4365. dnl
  4366. dnl You should have received a copy of the GNU General Public License
  4367. dnl along with this program; if not, write to the Free Software
  4368. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  4369. dnl 02111-1307, USA.
  4370. dnl
  4371. dnl As a special exception to the GNU General Public License, if you
  4372. dnl distribute this file as part of a program that contains a
  4373. dnl configuration script generated by Autoconf, you may include it under
  4374. dnl the same distribution terms that you use for the rest of that
  4375. dnl program.
  4376. dnl PKG_PREREQ(MIN-VERSION)
  4377. dnl -----------------------
  4378. dnl Since: 0.29
  4379. dnl
  4380. dnl Verify that the version of the pkg-config macros are at least
  4381. dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
  4382. dnl installed version of pkg-config, this checks the developer's version
  4383. dnl of pkg.m4 when generating configure.
  4384. dnl
  4385. dnl To ensure that this macro is defined, also add:
  4386. dnl m4_ifndef([PKG_PREREQ],
  4387. dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
  4388. dnl
  4389. dnl See the "Since" comment for each macro you use to see what version
  4390. dnl of the macros you require.
  4391. m4_defun([PKG_PREREQ],
  4392. [m4_define([PKG_MACROS_VERSION], [0.29.1])
  4393. m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
  4394. [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
  4395. ])dnl PKG_PREREQ
  4396. dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
  4397. dnl ----------------------------------
  4398. dnl Since: 0.16
  4399. dnl
  4400. dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
  4401. dnl first found in the path. Checks that the version of pkg-config found
  4402. dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
  4403. dnl used since that's the first version where most current features of
  4404. dnl pkg-config existed.
  4405. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  4406. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  4407. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  4408. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  4409. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  4410. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  4411. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  4412. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  4413. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  4414. fi
  4415. if test -n "$PKG_CONFIG"; then
  4416. _pkg_min_version=m4_default([$1], [0.9.0])
  4417. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  4418. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  4419. AC_MSG_RESULT([yes])
  4420. else
  4421. AC_MSG_RESULT([no])
  4422. PKG_CONFIG=""
  4423. fi
  4424. fi[]dnl
  4425. ])dnl PKG_PROG_PKG_CONFIG
  4426. dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  4427. dnl -------------------------------------------------------------------
  4428. dnl Since: 0.18
  4429. dnl
  4430. dnl Check to see whether a particular set of modules exists. Similar to
  4431. dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
  4432. dnl
  4433. dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  4434. dnl only at the first occurence in configure.ac, so if the first place
  4435. dnl it's called might be skipped (such as if it is within an "if", you
  4436. dnl have to call PKG_CHECK_EXISTS manually
  4437. AC_DEFUN([PKG_CHECK_EXISTS],
  4438. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  4439. if test -n "$PKG_CONFIG" && \
  4440. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  4441. m4_default([$2], [:])
  4442. m4_ifvaln([$3], [else
  4443. $3])dnl
  4444. fi])
  4445. dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  4446. dnl ---------------------------------------------
  4447. dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
  4448. dnl pkg_failed based on the result.
  4449. m4_define([_PKG_CONFIG],
  4450. [if test -n "$$1"; then
  4451. pkg_cv_[]$1="$$1"
  4452. elif test -n "$PKG_CONFIG"; then
  4453. PKG_CHECK_EXISTS([$3],
  4454. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  4455. test "x$?" != "x0" && pkg_failed=yes ],
  4456. [pkg_failed=yes])
  4457. else
  4458. pkg_failed=untried
  4459. fi[]dnl
  4460. ])dnl _PKG_CONFIG
  4461. dnl _PKG_SHORT_ERRORS_SUPPORTED
  4462. dnl ---------------------------
  4463. dnl Internal check to see if pkg-config supports short errors.
  4464. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  4465. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  4466. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  4467. _pkg_short_errors_supported=yes
  4468. else
  4469. _pkg_short_errors_supported=no
  4470. fi[]dnl
  4471. ])dnl _PKG_SHORT_ERRORS_SUPPORTED
  4472. dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  4473. dnl [ACTION-IF-NOT-FOUND])
  4474. dnl --------------------------------------------------------------
  4475. dnl Since: 0.4.0
  4476. dnl
  4477. dnl Note that if there is a possibility the first call to
  4478. dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
  4479. dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  4480. AC_DEFUN([PKG_CHECK_MODULES],
  4481. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  4482. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  4483. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  4484. pkg_failed=no
  4485. AC_MSG_CHECKING([for $1])
  4486. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  4487. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  4488. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  4489. and $1[]_LIBS to avoid the need to call pkg-config.
  4490. See the pkg-config man page for more details.])
  4491. if test $pkg_failed = yes; then
  4492. AC_MSG_RESULT([no])
  4493. _PKG_SHORT_ERRORS_SUPPORTED
  4494. if test $_pkg_short_errors_supported = yes; then
  4495. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  4496. else
  4497. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  4498. fi
  4499. # Put the nasty error message in config.log where it belongs
  4500. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  4501. m4_default([$4], [AC_MSG_ERROR(
  4502. [Package requirements ($2) were not met:
  4503. $$1_PKG_ERRORS
  4504. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  4505. installed software in a non-standard prefix.
  4506. _PKG_TEXT])[]dnl
  4507. ])
  4508. elif test $pkg_failed = untried; then
  4509. AC_MSG_RESULT([no])
  4510. m4_default([$4], [AC_MSG_FAILURE(
  4511. [The pkg-config script could not be found or is too old. Make sure it
  4512. is in your PATH or set the PKG_CONFIG environment variable to the full
  4513. path to pkg-config.
  4514. _PKG_TEXT
  4515. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  4516. ])
  4517. else
  4518. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  4519. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  4520. AC_MSG_RESULT([yes])
  4521. $3
  4522. fi[]dnl
  4523. ])dnl PKG_CHECK_MODULES
  4524. dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  4525. dnl [ACTION-IF-NOT-FOUND])
  4526. dnl ---------------------------------------------------------------------
  4527. dnl Since: 0.29
  4528. dnl
  4529. dnl Checks for existence of MODULES and gathers its build flags with
  4530. dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
  4531. dnl and VARIABLE-PREFIX_LIBS from --libs.
  4532. dnl
  4533. dnl Note that if there is a possibility the first call to
  4534. dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
  4535. dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
  4536. dnl configure.ac.
  4537. AC_DEFUN([PKG_CHECK_MODULES_STATIC],
  4538. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  4539. _save_PKG_CONFIG=$PKG_CONFIG
  4540. PKG_CONFIG="$PKG_CONFIG --static"
  4541. PKG_CHECK_MODULES($@)
  4542. PKG_CONFIG=$_save_PKG_CONFIG[]dnl
  4543. ])dnl PKG_CHECK_MODULES_STATIC
  4544. dnl PKG_INSTALLDIR([DIRECTORY])
  4545. dnl -------------------------
  4546. dnl Since: 0.27
  4547. dnl
  4548. dnl Substitutes the variable pkgconfigdir as the location where a module
  4549. dnl should install pkg-config .pc files. By default the directory is
  4550. dnl $libdir/pkgconfig, but the default can be changed by passing
  4551. dnl DIRECTORY. The user can override through the --with-pkgconfigdir
  4552. dnl parameter.
  4553. AC_DEFUN([PKG_INSTALLDIR],
  4554. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  4555. m4_pushdef([pkg_description],
  4556. [pkg-config installation directory @<:@]pkg_default[@:>@])
  4557. AC_ARG_WITH([pkgconfigdir],
  4558. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  4559. [with_pkgconfigdir=]pkg_default)
  4560. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  4561. m4_popdef([pkg_default])
  4562. m4_popdef([pkg_description])
  4563. ])dnl PKG_INSTALLDIR
  4564. dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
  4565. dnl --------------------------------
  4566. dnl Since: 0.27
  4567. dnl
  4568. dnl Substitutes the variable noarch_pkgconfigdir as the location where a
  4569. dnl module should install arch-independent pkg-config .pc files. By
  4570. dnl default the directory is $datadir/pkgconfig, but the default can be
  4571. dnl changed by passing DIRECTORY. The user can override through the
  4572. dnl --with-noarch-pkgconfigdir parameter.
  4573. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  4574. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  4575. m4_pushdef([pkg_description],
  4576. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  4577. AC_ARG_WITH([noarch-pkgconfigdir],
  4578. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  4579. [with_noarch_pkgconfigdir=]pkg_default)
  4580. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  4581. m4_popdef([pkg_default])
  4582. m4_popdef([pkg_description])
  4583. ])dnl PKG_NOARCH_INSTALLDIR
  4584. dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
  4585. dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  4586. dnl -------------------------------------------
  4587. dnl Since: 0.28
  4588. dnl
  4589. dnl Retrieves the value of the pkg-config variable for the given module.
  4590. AC_DEFUN([PKG_CHECK_VAR],
  4591. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  4592. AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
  4593. _PKG_CONFIG([$1], [variable="][$3]["], [$2])
  4594. AS_VAR_COPY([$1], [pkg_cv_][$1])
  4595. AS_VAR_IF([$1], [""], [$5], [$4])dnl
  4596. ])dnl PKG_CHECK_VAR
  4597. dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  4598. dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
  4599. dnl [DESCRIPTION], [DEFAULT])
  4600. dnl ------------------------------------------
  4601. dnl
  4602. dnl Prepare a "--with-" configure option using the lowercase
  4603. dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
  4604. dnl PKG_CHECK_MODULES in a single macro.
  4605. AC_DEFUN([PKG_WITH_MODULES],
  4606. [
  4607. m4_pushdef([with_arg], m4_tolower([$1]))
  4608. m4_pushdef([description],
  4609. [m4_default([$5], [build with ]with_arg[ support])])
  4610. m4_pushdef([def_arg], [m4_default([$6], [auto])])
  4611. m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
  4612. m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
  4613. m4_case(def_arg,
  4614. [yes],[m4_pushdef([with_without], [--without-]with_arg)],
  4615. [m4_pushdef([with_without],[--with-]with_arg)])
  4616. AC_ARG_WITH(with_arg,
  4617. AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
  4618. [AS_TR_SH([with_]with_arg)=def_arg])
  4619. AS_CASE([$AS_TR_SH([with_]with_arg)],
  4620. [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
  4621. [auto],[PKG_CHECK_MODULES([$1],[$2],
  4622. [m4_n([def_action_if_found]) $3],
  4623. [m4_n([def_action_if_not_found]) $4])])
  4624. m4_popdef([with_arg])
  4625. m4_popdef([description])
  4626. m4_popdef([def_arg])
  4627. ])dnl PKG_WITH_MODULES
  4628. dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  4629. dnl [DESCRIPTION], [DEFAULT])
  4630. dnl -----------------------------------------------
  4631. dnl
  4632. dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
  4633. dnl check._[VARIABLE-PREFIX] is exported as make variable.
  4634. AC_DEFUN([PKG_HAVE_WITH_MODULES],
  4635. [
  4636. PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
  4637. AM_CONDITIONAL([HAVE_][$1],
  4638. [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
  4639. ])dnl PKG_HAVE_WITH_MODULES
  4640. dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  4641. dnl [DESCRIPTION], [DEFAULT])
  4642. dnl ------------------------------------------------------
  4643. dnl
  4644. dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
  4645. dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
  4646. dnl and preprocessor variable.
  4647. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
  4648. [
  4649. PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
  4650. AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
  4651. [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
  4652. ])dnl PKG_HAVE_DEFINE_WITH_MODULES
  4653. # po.m4 serial 24 (gettext-0.19)
  4654. dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
  4655. dnl This file is free software; the Free Software Foundation
  4656. dnl gives unlimited permission to copy and/or distribute it,
  4657. dnl with or without modifications, as long as this notice is preserved.
  4658. dnl
  4659. dnl This file can be used in projects which are not available under
  4660. dnl the GNU General Public License or the GNU Library General Public
  4661. dnl License but which still want to provide support for the GNU gettext
  4662. dnl functionality.
  4663. dnl Please note that the actual code of the GNU gettext library is covered
  4664. dnl by the GNU Library General Public License, and the rest of the GNU
  4665. dnl gettext package is covered by the GNU General Public License.
  4666. dnl They are *not* in the public domain.
  4667. dnl Authors:
  4668. dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
  4669. dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
  4670. AC_PREREQ([2.60])
  4671. dnl Checks for all prerequisites of the po subdirectory.
  4672. AC_DEFUN([AM_PO_SUBDIRS],
  4673. [
  4674. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  4675. AC_REQUIRE([AC_PROG_INSTALL])dnl
  4676. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  4677. AC_REQUIRE([AC_PROG_SED])dnl
  4678. AC_REQUIRE([AM_NLS])dnl
  4679. dnl Release version of the gettext macros. This is used to ensure that
  4680. dnl the gettext macros and po/Makefile.in.in are in sync.
  4681. AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
  4682. dnl Perform the following tests also if --disable-nls has been given,
  4683. dnl because they are needed for "make dist" to work.
  4684. dnl Search for GNU msgfmt in the PATH.
  4685. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
  4686. dnl The second test excludes FreeBSD msgfmt.
  4687. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  4688. [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
  4689. (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
  4690. :)
  4691. AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
  4692. dnl Test whether it is GNU msgfmt >= 0.15.
  4693. changequote(,)dnl
  4694. case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
  4695. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
  4696. *) MSGFMT_015=$MSGFMT ;;
  4697. esac
  4698. changequote([,])dnl
  4699. AC_SUBST([MSGFMT_015])
  4700. changequote(,)dnl
  4701. case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
  4702. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
  4703. *) GMSGFMT_015=$GMSGFMT ;;
  4704. esac
  4705. changequote([,])dnl
  4706. AC_SUBST([GMSGFMT_015])
  4707. dnl Search for GNU xgettext 0.12 or newer in the PATH.
  4708. dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
  4709. dnl The second test excludes FreeBSD xgettext.
  4710. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  4711. [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
  4712. (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
  4713. :)
  4714. dnl Remove leftover from FreeBSD xgettext call.
  4715. rm -f messages.po
  4716. dnl Test whether it is GNU xgettext >= 0.15.
  4717. changequote(,)dnl
  4718. case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
  4719. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
  4720. *) XGETTEXT_015=$XGETTEXT ;;
  4721. esac
  4722. changequote([,])dnl
  4723. AC_SUBST([XGETTEXT_015])
  4724. dnl Search for GNU msgmerge 0.11 or newer in the PATH.
  4725. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
  4726. [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
  4727. dnl Installation directories.
  4728. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
  4729. dnl have to define it here, so that it can be used in po/Makefile.
  4730. test -n "$localedir" || localedir='${datadir}/locale'
  4731. AC_SUBST([localedir])
  4732. dnl Support for AM_XGETTEXT_OPTION.
  4733. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
  4734. AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
  4735. AC_CONFIG_COMMANDS([po-directories], [[
  4736. for ac_file in $CONFIG_FILES; do
  4737. # Support "outfile[:infile[:infile...]]"
  4738. case "$ac_file" in
  4739. *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  4740. esac
  4741. # PO directories have a Makefile.in generated from Makefile.in.in.
  4742. case "$ac_file" in */Makefile.in)
  4743. # Adjust a relative srcdir.
  4744. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
  4745. ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
  4746. ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
  4747. # In autoconf-2.13 it is called $ac_given_srcdir.
  4748. # In autoconf-2.50 it is called $srcdir.
  4749. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  4750. case "$ac_given_srcdir" in
  4751. .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  4752. /*) top_srcdir="$ac_given_srcdir" ;;
  4753. *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
  4754. esac
  4755. # Treat a directory as a PO directory if and only if it has a
  4756. # POTFILES.in file. This allows packages to have multiple PO
  4757. # directories under different names or in different locations.
  4758. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
  4759. rm -f "$ac_dir/POTFILES"
  4760. test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
  4761. gt_tab=`printf '\t'`
  4762. cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
  4763. POMAKEFILEDEPS="POTFILES.in"
  4764. # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
  4765. # on $ac_dir but don't depend on user-specified configuration
  4766. # parameters.
  4767. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  4768. # The LINGUAS file contains the set of available languages.
  4769. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  4770. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  4771. fi
  4772. ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  4773. # Hide the ALL_LINGUAS assignment from automake < 1.5.
  4774. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  4775. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  4776. else
  4777. # The set of available languages was given in configure.in.
  4778. # Hide the ALL_LINGUAS assignment from automake < 1.5.
  4779. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
  4780. fi
  4781. # Compute POFILES
  4782. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  4783. # Compute UPDATEPOFILES
  4784. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  4785. # Compute DUMMYPOFILES
  4786. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  4787. # Compute GMOFILES
  4788. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  4789. case "$ac_given_srcdir" in
  4790. .) srcdirpre= ;;
  4791. *) srcdirpre='$(srcdir)/' ;;
  4792. esac
  4793. POFILES=
  4794. UPDATEPOFILES=
  4795. DUMMYPOFILES=
  4796. GMOFILES=
  4797. for lang in $ALL_LINGUAS; do
  4798. POFILES="$POFILES $srcdirpre$lang.po"
  4799. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  4800. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  4801. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  4802. done
  4803. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  4804. # environment variable.
  4805. INST_LINGUAS=
  4806. if test -n "$ALL_LINGUAS"; then
  4807. for presentlang in $ALL_LINGUAS; do
  4808. useit=no
  4809. if test "%UNSET%" != "$LINGUAS"; then
  4810. desiredlanguages="$LINGUAS"
  4811. else
  4812. desiredlanguages="$ALL_LINGUAS"
  4813. fi
  4814. for desiredlang in $desiredlanguages; do
  4815. # Use the presentlang catalog if desiredlang is
  4816. # a. equal to presentlang, or
  4817. # b. a variant of presentlang (because in this case,
  4818. # presentlang can be used as a fallback for messages
  4819. # which are not translated in the desiredlang catalog).
  4820. case "$desiredlang" in
  4821. "$presentlang"*) useit=yes;;
  4822. esac
  4823. done
  4824. if test $useit = yes; then
  4825. INST_LINGUAS="$INST_LINGUAS $presentlang"
  4826. fi
  4827. done
  4828. fi
  4829. CATALOGS=
  4830. if test -n "$INST_LINGUAS"; then
  4831. for lang in $INST_LINGUAS; do
  4832. CATALOGS="$CATALOGS $lang.gmo"
  4833. done
  4834. fi
  4835. test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
  4836. sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
  4837. for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
  4838. if test -f "$f"; then
  4839. case "$f" in
  4840. *.orig | *.bak | *~) ;;
  4841. *) cat "$f" >> "$ac_dir/Makefile" ;;
  4842. esac
  4843. fi
  4844. done
  4845. fi
  4846. ;;
  4847. esac
  4848. done]],
  4849. [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
  4850. # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
  4851. # from automake < 1.5.
  4852. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
  4853. # Capture the value of LINGUAS because we need it to compute CATALOGS.
  4854. LINGUAS="${LINGUAS-%UNSET%}"
  4855. ])
  4856. ])
  4857. dnl Postprocesses a Makefile in a directory containing PO files.
  4858. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
  4859. [
  4860. # When this code is run, in config.status, two variables have already been
  4861. # set:
  4862. # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
  4863. # - LINGUAS is the value of the environment variable LINGUAS at configure
  4864. # time.
  4865. changequote(,)dnl
  4866. # Adjust a relative srcdir.
  4867. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
  4868. ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
  4869. ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
  4870. # In autoconf-2.13 it is called $ac_given_srcdir.
  4871. # In autoconf-2.50 it is called $srcdir.
  4872. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  4873. case "$ac_given_srcdir" in
  4874. .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  4875. /*) top_srcdir="$ac_given_srcdir" ;;
  4876. *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
  4877. esac
  4878. # Find a way to echo strings without interpreting backslash.
  4879. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
  4880. gt_echo='echo'
  4881. else
  4882. if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
  4883. gt_echo='printf %s\n'
  4884. else
  4885. echo_func () {
  4886. cat <<EOT
  4887. $*
  4888. EOT
  4889. }
  4890. gt_echo='echo_func'
  4891. fi
  4892. fi
  4893. # A sed script that extracts the value of VARIABLE from a Makefile.
  4894. tab=`printf '\t'`
  4895. sed_x_variable='
  4896. # Test if the hold space is empty.
  4897. x
  4898. s/P/P/
  4899. x
  4900. ta
  4901. # Yes it was empty. Look if we have the expected variable definition.
  4902. /^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
  4903. # Seen the first line of the variable definition.
  4904. s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
  4905. ba
  4906. }
  4907. bd
  4908. :a
  4909. # Here we are processing a line from the variable definition.
  4910. # Remove comment, more precisely replace it with a space.
  4911. s/#.*$/ /
  4912. # See if the line ends in a backslash.
  4913. tb
  4914. :b
  4915. s/\\$//
  4916. # Print the line, without the trailing backslash.
  4917. p
  4918. tc
  4919. # There was no trailing backslash. The end of the variable definition is
  4920. # reached. Clear the hold space.
  4921. s/^.*$//
  4922. x
  4923. bd
  4924. :c
  4925. # A trailing backslash means that the variable definition continues in the
  4926. # next line. Put a nonempty string into the hold space to indicate this.
  4927. s/^.*$/P/
  4928. x
  4929. :d
  4930. '
  4931. changequote([,])dnl
  4932. # Set POTFILES to the value of the Makefile variable POTFILES.
  4933. sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
  4934. POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
  4935. # Compute POTFILES_DEPS as
  4936. # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
  4937. POTFILES_DEPS=
  4938. for file in $POTFILES; do
  4939. POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
  4940. done
  4941. POMAKEFILEDEPS=""
  4942. if test -n "$OBSOLETE_ALL_LINGUAS"; then
  4943. test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
  4944. fi
  4945. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
  4946. # The LINGUAS file contains the set of available languages.
  4947. ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
  4948. POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
  4949. else
  4950. # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
  4951. sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
  4952. ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
  4953. fi
  4954. # Hide the ALL_LINGUAS assignment from automake < 1.5.
  4955. eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
  4956. # Compute POFILES
  4957. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
  4958. # Compute UPDATEPOFILES
  4959. # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
  4960. # Compute DUMMYPOFILES
  4961. # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
  4962. # Compute GMOFILES
  4963. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
  4964. # Compute PROPERTIESFILES
  4965. # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
  4966. # Compute CLASSFILES
  4967. # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
  4968. # Compute QMFILES
  4969. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
  4970. # Compute MSGFILES
  4971. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
  4972. # Compute RESOURCESDLLFILES
  4973. # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
  4974. case "$ac_given_srcdir" in
  4975. .) srcdirpre= ;;
  4976. *) srcdirpre='$(srcdir)/' ;;
  4977. esac
  4978. POFILES=
  4979. UPDATEPOFILES=
  4980. DUMMYPOFILES=
  4981. GMOFILES=
  4982. PROPERTIESFILES=
  4983. CLASSFILES=
  4984. QMFILES=
  4985. MSGFILES=
  4986. RESOURCESDLLFILES=
  4987. for lang in $ALL_LINGUAS; do
  4988. POFILES="$POFILES $srcdirpre$lang.po"
  4989. UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
  4990. DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
  4991. GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
  4992. PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
  4993. CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
  4994. QMFILES="$QMFILES $srcdirpre$lang.qm"
  4995. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  4996. MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
  4997. frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
  4998. RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
  4999. done
  5000. # CATALOGS depends on both $ac_dir and the user's LINGUAS
  5001. # environment variable.
  5002. INST_LINGUAS=
  5003. if test -n "$ALL_LINGUAS"; then
  5004. for presentlang in $ALL_LINGUAS; do
  5005. useit=no
  5006. if test "%UNSET%" != "$LINGUAS"; then
  5007. desiredlanguages="$LINGUAS"
  5008. else
  5009. desiredlanguages="$ALL_LINGUAS"
  5010. fi
  5011. for desiredlang in $desiredlanguages; do
  5012. # Use the presentlang catalog if desiredlang is
  5013. # a. equal to presentlang, or
  5014. # b. a variant of presentlang (because in this case,
  5015. # presentlang can be used as a fallback for messages
  5016. # which are not translated in the desiredlang catalog).
  5017. case "$desiredlang" in
  5018. "$presentlang"*) useit=yes;;
  5019. esac
  5020. done
  5021. if test $useit = yes; then
  5022. INST_LINGUAS="$INST_LINGUAS $presentlang"
  5023. fi
  5024. done
  5025. fi
  5026. CATALOGS=
  5027. JAVACATALOGS=
  5028. QTCATALOGS=
  5029. TCLCATALOGS=
  5030. CSHARPCATALOGS=
  5031. if test -n "$INST_LINGUAS"; then
  5032. for lang in $INST_LINGUAS; do
  5033. CATALOGS="$CATALOGS $lang.gmo"
  5034. JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
  5035. QTCATALOGS="$QTCATALOGS $lang.qm"
  5036. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  5037. TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
  5038. frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
  5039. CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
  5040. done
  5041. fi
  5042. sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
  5043. tab=`printf '\t'`
  5044. if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
  5045. # Add dependencies that cannot be formulated as a simple suffix rule.
  5046. for lang in $ALL_LINGUAS; do
  5047. frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
  5048. cat >> "$ac_file.tmp" <<EOF
  5049. $frobbedlang.msg: $lang.po
  5050. ${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
  5051. ${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  5052. EOF
  5053. done
  5054. fi
  5055. if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
  5056. # Add dependencies that cannot be formulated as a simple suffix rule.
  5057. for lang in $ALL_LINGUAS; do
  5058. frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
  5059. cat >> "$ac_file.tmp" <<EOF
  5060. $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
  5061. ${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
  5062. ${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
  5063. EOF
  5064. done
  5065. fi
  5066. if test -n "$POMAKEFILEDEPS"; then
  5067. cat >> "$ac_file.tmp" <<EOF
  5068. Makefile: $POMAKEFILEDEPS
  5069. EOF
  5070. fi
  5071. mv "$ac_file.tmp" "$ac_file"
  5072. ])
  5073. dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
  5074. AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
  5075. [
  5076. XGETTEXT_EXTRA_OPTIONS=
  5077. ])
  5078. dnl Registers an option to be passed to xgettext in the po subdirectory.
  5079. AC_DEFUN([AM_XGETTEXT_OPTION],
  5080. [
  5081. AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
  5082. XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
  5083. ])
  5084. # progtest.m4 serial 7 (gettext-0.18.2)
  5085. dnl Copyright (C) 1996-2003, 2005, 2008-2016 Free Software Foundation, Inc.
  5086. dnl This file is free software; the Free Software Foundation
  5087. dnl gives unlimited permission to copy and/or distribute it,
  5088. dnl with or without modifications, as long as this notice is preserved.
  5089. dnl
  5090. dnl This file can be used in projects which are not available under
  5091. dnl the GNU General Public License or the GNU Library General Public
  5092. dnl License but which still want to provide support for the GNU gettext
  5093. dnl functionality.
  5094. dnl Please note that the actual code of the GNU gettext library is covered
  5095. dnl by the GNU Library General Public License, and the rest of the GNU
  5096. dnl gettext package is covered by the GNU General Public License.
  5097. dnl They are *not* in the public domain.
  5098. dnl Authors:
  5099. dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
  5100. AC_PREREQ([2.50])
  5101. # Search path for a program which passes the given test.
  5102. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  5103. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  5104. AC_DEFUN([AM_PATH_PROG_WITH_TEST],
  5105. [
  5106. # Prepare PATH_SEPARATOR.
  5107. # The user is always right.
  5108. if test "${PATH_SEPARATOR+set}" != set; then
  5109. # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
  5110. # contains only /bin. Note that ksh looks also at the FPATH variable,
  5111. # so we have to set that as well for the test.
  5112. PATH_SEPARATOR=:
  5113. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  5114. && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
  5115. || PATH_SEPARATOR=';'
  5116. }
  5117. fi
  5118. # Find out how to test for executable files. Don't use a zero-byte file,
  5119. # as systems may use methods other than mode bits to determine executability.
  5120. cat >conf$$.file <<_ASEOF
  5121. #! /bin/sh
  5122. exit 0
  5123. _ASEOF
  5124. chmod +x conf$$.file
  5125. if test -x conf$$.file >/dev/null 2>&1; then
  5126. ac_executable_p="test -x"
  5127. else
  5128. ac_executable_p="test -f"
  5129. fi
  5130. rm -f conf$$.file
  5131. # Extract the first word of "$2", so it can be a program name with args.
  5132. set dummy $2; ac_word=[$]2
  5133. AC_MSG_CHECKING([for $ac_word])
  5134. AC_CACHE_VAL([ac_cv_path_$1],
  5135. [case "[$]$1" in
  5136. [[\\/]]* | ?:[[\\/]]*)
  5137. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  5138. ;;
  5139. *)
  5140. ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
  5141. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  5142. IFS="$ac_save_IFS"
  5143. test -z "$ac_dir" && ac_dir=.
  5144. for ac_exec_ext in '' $ac_executable_extensions; do
  5145. if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
  5146. echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
  5147. if [$3]; then
  5148. ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
  5149. break 2
  5150. fi
  5151. fi
  5152. done
  5153. done
  5154. IFS="$ac_save_IFS"
  5155. dnl If no 4th arg is given, leave the cache variable unset,
  5156. dnl so AC_PATH_PROGS will keep looking.
  5157. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  5158. ])dnl
  5159. ;;
  5160. esac])dnl
  5161. $1="$ac_cv_path_$1"
  5162. if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
  5163. AC_MSG_RESULT([$][$1])
  5164. else
  5165. AC_MSG_RESULT([no])
  5166. fi
  5167. AC_SUBST([$1])dnl
  5168. ])
  5169. # Copyright (C) 2002-2018 Free Software Foundation, Inc.
  5170. #
  5171. # This file is free software; the Free Software Foundation
  5172. # gives unlimited permission to copy and/or distribute it,
  5173. # with or without modifications, as long as this notice is preserved.
  5174. # AM_AUTOMAKE_VERSION(VERSION)
  5175. # ----------------------------
  5176. # Automake X.Y traces this macro to ensure aclocal.m4 has been
  5177. # generated from the m4 files accompanying Automake X.Y.
  5178. # (This private macro should not be called outside this file.)
  5179. AC_DEFUN([AM_AUTOMAKE_VERSION],
  5180. [am__api_version='1.16'
  5181. dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
  5182. dnl require some minimum version. Point them to the right macro.
  5183. m4_if([$1], [1.16.1], [],
  5184. [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
  5185. ])
  5186. # _AM_AUTOCONF_VERSION(VERSION)
  5187. # -----------------------------
  5188. # aclocal traces this macro to find the Autoconf version.
  5189. # This is a private macro too. Using m4_define simplifies
  5190. # the logic in aclocal, which can simply ignore this definition.
  5191. m4_define([_AM_AUTOCONF_VERSION], [])
  5192. # AM_SET_CURRENT_AUTOMAKE_VERSION
  5193. # -------------------------------
  5194. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
  5195. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
  5196. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
  5197. [AM_AUTOMAKE_VERSION([1.16.1])dnl
  5198. m4_ifndef([AC_AUTOCONF_VERSION],
  5199. [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
  5200. _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
  5201. # AM_AUX_DIR_EXPAND -*- Autoconf -*-
  5202. # Copyright (C) 2001-2018 Free Software Foundation, Inc.
  5203. #
  5204. # This file is free software; the Free Software Foundation
  5205. # gives unlimited permission to copy and/or distribute it,
  5206. # with or without modifications, as long as this notice is preserved.
  5207. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
  5208. # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
  5209. # '$srcdir', '$srcdir/..', or '$srcdir/../..'.
  5210. #
  5211. # Of course, Automake must honor this variable whenever it calls a
  5212. # tool from the auxiliary directory. The problem is that $srcdir (and
  5213. # therefore $ac_aux_dir as well) can be either absolute or relative,
  5214. # depending on how configure is run. This is pretty annoying, since
  5215. # it makes $ac_aux_dir quite unusable in subdirectories: in the top
  5216. # source directory, any form will work fine, but in subdirectories a
  5217. # relative path needs to be adjusted first.
  5218. #
  5219. # $ac_aux_dir/missing
  5220. # fails when called from a subdirectory if $ac_aux_dir is relative
  5221. # $top_srcdir/$ac_aux_dir/missing
  5222. # fails if $ac_aux_dir is absolute,
  5223. # fails when called from a subdirectory in a VPATH build with
  5224. # a relative $ac_aux_dir
  5225. #
  5226. # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
  5227. # are both prefixed by $srcdir. In an in-source build this is usually
  5228. # harmless because $srcdir is '.', but things will broke when you
  5229. # start a VPATH build or use an absolute $srcdir.
  5230. #
  5231. # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
  5232. # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
  5233. # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
  5234. # and then we would define $MISSING as
  5235. # MISSING="\${SHELL} $am_aux_dir/missing"
  5236. # This will work as long as MISSING is not called from configure, because
  5237. # unfortunately $(top_srcdir) has no meaning in configure.
  5238. # However there are other variables, like CC, which are often used in
  5239. # configure, and could therefore not use this "fixed" $ac_aux_dir.
  5240. #
  5241. # Another solution, used here, is to always expand $ac_aux_dir to an
  5242. # absolute PATH. The drawback is that using absolute paths prevent a
  5243. # configured tree to be moved without reconfiguration.
  5244. AC_DEFUN([AM_AUX_DIR_EXPAND],
  5245. [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
  5246. # Expand $ac_aux_dir to an absolute path.
  5247. am_aux_dir=`cd "$ac_aux_dir" && pwd`
  5248. ])
  5249. # AM_COND_IF -*- Autoconf -*-
  5250. # Copyright (C) 2008-2018 Free Software Foundation, Inc.
  5251. #
  5252. # This file is free software; the Free Software Foundation
  5253. # gives unlimited permission to copy and/or distribute it,
  5254. # with or without modifications, as long as this notice is preserved.
  5255. # _AM_COND_IF
  5256. # _AM_COND_ELSE
  5257. # _AM_COND_ENDIF
  5258. # --------------
  5259. # These macros are only used for tracing.
  5260. m4_define([_AM_COND_IF])
  5261. m4_define([_AM_COND_ELSE])
  5262. m4_define([_AM_COND_ENDIF])
  5263. # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
  5264. # ---------------------------------------
  5265. # If the shell condition COND is true, execute IF-TRUE, otherwise execute
  5266. # IF-FALSE. Allow automake to learn about conditional instantiating macros
  5267. # (the AC_CONFIG_FOOS).
  5268. AC_DEFUN([AM_COND_IF],
  5269. [m4_ifndef([_AM_COND_VALUE_$1],
  5270. [m4_fatal([$0: no such condition "$1"])])dnl
  5271. _AM_COND_IF([$1])dnl
  5272. if test -z "$$1_TRUE"; then :
  5273. m4_n([$2])[]dnl
  5274. m4_ifval([$3],
  5275. [_AM_COND_ELSE([$1])dnl
  5276. else
  5277. $3
  5278. ])dnl
  5279. _AM_COND_ENDIF([$1])dnl
  5280. fi[]dnl
  5281. ])
  5282. # AM_CONDITIONAL -*- Autoconf -*-
  5283. # Copyright (C) 1997-2018 Free Software Foundation, Inc.
  5284. #
  5285. # This file is free software; the Free Software Foundation
  5286. # gives unlimited permission to copy and/or distribute it,
  5287. # with or without modifications, as long as this notice is preserved.
  5288. # AM_CONDITIONAL(NAME, SHELL-CONDITION)
  5289. # -------------------------------------
  5290. # Define a conditional.
  5291. AC_DEFUN([AM_CONDITIONAL],
  5292. [AC_PREREQ([2.52])dnl
  5293. m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
  5294. [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
  5295. AC_SUBST([$1_TRUE])dnl
  5296. AC_SUBST([$1_FALSE])dnl
  5297. _AM_SUBST_NOTMAKE([$1_TRUE])dnl
  5298. _AM_SUBST_NOTMAKE([$1_FALSE])dnl
  5299. m4_define([_AM_COND_VALUE_$1], [$2])dnl
  5300. if $2; then
  5301. $1_TRUE=
  5302. $1_FALSE='#'
  5303. else
  5304. $1_TRUE='#'
  5305. $1_FALSE=
  5306. fi
  5307. AC_CONFIG_COMMANDS_PRE(
  5308. [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
  5309. AC_MSG_ERROR([[conditional "$1" was never defined.
  5310. Usually this means the macro was only invoked conditionally.]])
  5311. fi])])
  5312. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
  5313. #
  5314. # This file is free software; the Free Software Foundation
  5315. # gives unlimited permission to copy and/or distribute it,
  5316. # with or without modifications, as long as this notice is preserved.
  5317. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
  5318. # written in clear, in which case automake, when reading aclocal.m4,
  5319. # will think it sees a *use*, and therefore will trigger all it's
  5320. # C support machinery. Also note that it means that autoscan, seeing
  5321. # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
  5322. # _AM_DEPENDENCIES(NAME)
  5323. # ----------------------
  5324. # See how the compiler implements dependency checking.
  5325. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
  5326. # We try a few techniques and use that to set a single cache variable.
  5327. #
  5328. # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
  5329. # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
  5330. # dependency, and given that the user is not expected to run this macro,
  5331. # just rely on AC_PROG_CC.
  5332. AC_DEFUN([_AM_DEPENDENCIES],
  5333. [AC_REQUIRE([AM_SET_DEPDIR])dnl
  5334. AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
  5335. AC_REQUIRE([AM_MAKE_INCLUDE])dnl
  5336. AC_REQUIRE([AM_DEP_TRACK])dnl
  5337. m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
  5338. [$1], [CXX], [depcc="$CXX" am_compiler_list=],
  5339. [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
  5340. [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
  5341. [$1], [UPC], [depcc="$UPC" am_compiler_list=],
  5342. [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
  5343. [depcc="$$1" am_compiler_list=])
  5344. AC_CACHE_CHECK([dependency style of $depcc],
  5345. [am_cv_$1_dependencies_compiler_type],
  5346. [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
  5347. # We make a subdir and do the tests there. Otherwise we can end up
  5348. # making bogus files that we don't know about and never remove. For
  5349. # instance it was reported that on HP-UX the gcc test will end up
  5350. # making a dummy file named 'D' -- because '-MD' means "put the output
  5351. # in D".
  5352. rm -rf conftest.dir
  5353. mkdir conftest.dir
  5354. # Copy depcomp to subdir because otherwise we won't find it if we're
  5355. # using a relative directory.
  5356. cp "$am_depcomp" conftest.dir
  5357. cd conftest.dir
  5358. # We will build objects and dependencies in a subdirectory because
  5359. # it helps to detect inapplicable dependency modes. For instance
  5360. # both Tru64's cc and ICC support -MD to output dependencies as a
  5361. # side effect of compilation, but ICC will put the dependencies in
  5362. # the current directory while Tru64 will put them in the object
  5363. # directory.
  5364. mkdir sub
  5365. am_cv_$1_dependencies_compiler_type=none
  5366. if test "$am_compiler_list" = ""; then
  5367. am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
  5368. fi
  5369. am__universal=false
  5370. m4_case([$1], [CC],
  5371. [case " $depcc " in #(
  5372. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  5373. esac],
  5374. [CXX],
  5375. [case " $depcc " in #(
  5376. *\ -arch\ *\ -arch\ *) am__universal=true ;;
  5377. esac])
  5378. for depmode in $am_compiler_list; do
  5379. # Setup a source with many dependencies, because some compilers
  5380. # like to wrap large dependency lists on column 80 (with \), and
  5381. # we should not choose a depcomp mode which is confused by this.
  5382. #
  5383. # We need to recreate these files for each test, as the compiler may
  5384. # overwrite some of them when testing with obscure command lines.
  5385. # This happens at least with the AIX C compiler.
  5386. : > sub/conftest.c
  5387. for i in 1 2 3 4 5 6; do
  5388. echo '#include "conftst'$i'.h"' >> sub/conftest.c
  5389. # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
  5390. # Solaris 10 /bin/sh.
  5391. echo '/* dummy */' > sub/conftst$i.h
  5392. done
  5393. echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
  5394. # We check with '-c' and '-o' for the sake of the "dashmstdout"
  5395. # mode. It turns out that the SunPro C++ compiler does not properly
  5396. # handle '-M -o', and we need to detect this. Also, some Intel
  5397. # versions had trouble with output in subdirs.
  5398. am__obj=sub/conftest.${OBJEXT-o}
  5399. am__minus_obj="-o $am__obj"
  5400. case $depmode in
  5401. gcc)
  5402. # This depmode causes a compiler race in universal mode.
  5403. test "$am__universal" = false || continue
  5404. ;;
  5405. nosideeffect)
  5406. # After this tag, mechanisms are not by side-effect, so they'll
  5407. # only be used when explicitly requested.
  5408. if test "x$enable_dependency_tracking" = xyes; then
  5409. continue
  5410. else
  5411. break
  5412. fi
  5413. ;;
  5414. msvc7 | msvc7msys | msvisualcpp | msvcmsys)
  5415. # This compiler won't grok '-c -o', but also, the minuso test has
  5416. # not run yet. These depmodes are late enough in the game, and
  5417. # so weak that their functioning should not be impacted.
  5418. am__obj=conftest.${OBJEXT-o}
  5419. am__minus_obj=
  5420. ;;
  5421. none) break ;;
  5422. esac
  5423. if depmode=$depmode \
  5424. source=sub/conftest.c object=$am__obj \
  5425. depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
  5426. $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
  5427. >/dev/null 2>conftest.err &&
  5428. grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
  5429. grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
  5430. grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
  5431. ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
  5432. # icc doesn't choke on unknown options, it will just issue warnings
  5433. # or remarks (even with -Werror). So we grep stderr for any message
  5434. # that says an option was ignored or not supported.
  5435. # When given -MP, icc 7.0 and 7.1 complain thusly:
  5436. # icc: Command line warning: ignoring option '-M'; no argument required
  5437. # The diagnosis changed in icc 8.0:
  5438. # icc: Command line remark: option '-MP' not supported
  5439. if (grep 'ignoring option' conftest.err ||
  5440. grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
  5441. am_cv_$1_dependencies_compiler_type=$depmode
  5442. break
  5443. fi
  5444. fi
  5445. done
  5446. cd ..
  5447. rm -rf conftest.dir
  5448. else
  5449. am_cv_$1_dependencies_compiler_type=none
  5450. fi
  5451. ])
  5452. AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
  5453. AM_CONDITIONAL([am__fastdep$1], [
  5454. test "x$enable_dependency_tracking" != xno \
  5455. && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
  5456. ])
  5457. # AM_SET_DEPDIR
  5458. # -------------
  5459. # Choose a directory name for dependency files.
  5460. # This macro is AC_REQUIREd in _AM_DEPENDENCIES.
  5461. AC_DEFUN([AM_SET_DEPDIR],
  5462. [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  5463. AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
  5464. ])
  5465. # AM_DEP_TRACK
  5466. # ------------
  5467. AC_DEFUN([AM_DEP_TRACK],
  5468. [AC_ARG_ENABLE([dependency-tracking], [dnl
  5469. AS_HELP_STRING(
  5470. [--enable-dependency-tracking],
  5471. [do not reject slow dependency extractors])
  5472. AS_HELP_STRING(
  5473. [--disable-dependency-tracking],
  5474. [speeds up one-time build])])
  5475. if test "x$enable_dependency_tracking" != xno; then
  5476. am_depcomp="$ac_aux_dir/depcomp"
  5477. AMDEPBACKSLASH='\'
  5478. am__nodep='_no'
  5479. fi
  5480. AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
  5481. AC_SUBST([AMDEPBACKSLASH])dnl
  5482. _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
  5483. AC_SUBST([am__nodep])dnl
  5484. _AM_SUBST_NOTMAKE([am__nodep])dnl
  5485. ])
  5486. # Generate code to set up dependency tracking. -*- Autoconf -*-
  5487. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
  5488. #
  5489. # This file is free software; the Free Software Foundation
  5490. # gives unlimited permission to copy and/or distribute it,
  5491. # with or without modifications, as long as this notice is preserved.
  5492. # _AM_OUTPUT_DEPENDENCY_COMMANDS
  5493. # ------------------------------
  5494. AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
  5495. [{
  5496. # Older Autoconf quotes --file arguments for eval, but not when files
  5497. # are listed without --file. Let's play safe and only enable the eval
  5498. # if we detect the quoting.
  5499. # TODO: see whether this extra hack can be removed once we start
  5500. # requiring Autoconf 2.70 or later.
  5501. AS_CASE([$CONFIG_FILES],
  5502. [*\'*], [eval set x "$CONFIG_FILES"],
  5503. [*], [set x $CONFIG_FILES])
  5504. shift
  5505. # Used to flag and report bootstrapping failures.
  5506. am_rc=0
  5507. for am_mf
  5508. do
  5509. # Strip MF so we end up with the name of the file.
  5510. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
  5511. # Check whether this is an Automake generated Makefile which includes
  5512. # dependency-tracking related rules and includes.
  5513. # Grep'ing the whole file directly is not great: AIX grep has a line
  5514. # limit of 2048, but all sed's we know have understand at least 4000.
  5515. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
  5516. || continue
  5517. am_dirpart=`AS_DIRNAME(["$am_mf"])`
  5518. am_filepart=`AS_BASENAME(["$am_mf"])`
  5519. AM_RUN_LOG([cd "$am_dirpart" \
  5520. && sed -e '/# am--include-marker/d' "$am_filepart" \
  5521. | $MAKE -f - am--depfiles]) || am_rc=$?
  5522. done
  5523. if test $am_rc -ne 0; then
  5524. AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
  5525. for automatic dependency tracking. Try re-running configure with the
  5526. '--disable-dependency-tracking' option to at least be able to build
  5527. the package (albeit without support for automatic dependency tracking).])
  5528. fi
  5529. AS_UNSET([am_dirpart])
  5530. AS_UNSET([am_filepart])
  5531. AS_UNSET([am_mf])
  5532. AS_UNSET([am_rc])
  5533. rm -f conftest-deps.mk
  5534. }
  5535. ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
  5536. # AM_OUTPUT_DEPENDENCY_COMMANDS
  5537. # -----------------------------
  5538. # This macro should only be invoked once -- use via AC_REQUIRE.
  5539. #
  5540. # This code is only required when automatic dependency tracking is enabled.
  5541. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in
  5542. # order to bootstrap the dependency handling code.
  5543. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
  5544. [AC_CONFIG_COMMANDS([depfiles],
  5545. [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
  5546. [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
  5547. # Do all the work for Automake. -*- Autoconf -*-
  5548. # Copyright (C) 1996-2018 Free Software Foundation, Inc.
  5549. #
  5550. # This file is free software; the Free Software Foundation
  5551. # gives unlimited permission to copy and/or distribute it,
  5552. # with or without modifications, as long as this notice is preserved.
  5553. # This macro actually does too much. Some checks are only needed if
  5554. # your package does certain things. But this isn't really a big deal.
  5555. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
  5556. m4_define([AC_PROG_CC],
  5557. m4_defn([AC_PROG_CC])
  5558. [_AM_PROG_CC_C_O
  5559. ])
  5560. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
  5561. # AM_INIT_AUTOMAKE([OPTIONS])
  5562. # -----------------------------------------------
  5563. # The call with PACKAGE and VERSION arguments is the old style
  5564. # call (pre autoconf-2.50), which is being phased out. PACKAGE
  5565. # and VERSION should now be passed to AC_INIT and removed from
  5566. # the call to AM_INIT_AUTOMAKE.
  5567. # We support both call styles for the transition. After
  5568. # the next Automake release, Autoconf can make the AC_INIT
  5569. # arguments mandatory, and then we can depend on a new Autoconf
  5570. # release and drop the old call support.
  5571. AC_DEFUN([AM_INIT_AUTOMAKE],
  5572. [AC_PREREQ([2.65])dnl
  5573. dnl Autoconf wants to disallow AM_ names. We explicitly allow
  5574. dnl the ones we care about.
  5575. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
  5576. AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
  5577. AC_REQUIRE([AC_PROG_INSTALL])dnl
  5578. if test "`cd $srcdir && pwd`" != "`pwd`"; then
  5579. # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
  5580. # is not polluted with repeated "-I."
  5581. AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
  5582. # test to see if srcdir already configured
  5583. if test -f $srcdir/config.status; then
  5584. AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
  5585. fi
  5586. fi
  5587. # test whether we have cygpath
  5588. if test -z "$CYGPATH_W"; then
  5589. if (cygpath --version) >/dev/null 2>/dev/null; then
  5590. CYGPATH_W='cygpath -w'
  5591. else
  5592. CYGPATH_W=echo
  5593. fi
  5594. fi
  5595. AC_SUBST([CYGPATH_W])
  5596. # Define the identity of the package.
  5597. dnl Distinguish between old-style and new-style calls.
  5598. m4_ifval([$2],
  5599. [AC_DIAGNOSE([obsolete],
  5600. [$0: two- and three-arguments forms are deprecated.])
  5601. m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
  5602. AC_SUBST([PACKAGE], [$1])dnl
  5603. AC_SUBST([VERSION], [$2])],
  5604. [_AM_SET_OPTIONS([$1])dnl
  5605. dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
  5606. m4_if(
  5607. m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
  5608. [ok:ok],,
  5609. [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  5610. AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  5611. AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
  5612. _AM_IF_OPTION([no-define],,
  5613. [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
  5614. AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
  5615. # Some tools Automake needs.
  5616. AC_REQUIRE([AM_SANITY_CHECK])dnl
  5617. AC_REQUIRE([AC_ARG_PROGRAM])dnl
  5618. AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
  5619. AM_MISSING_PROG([AUTOCONF], [autoconf])
  5620. AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
  5621. AM_MISSING_PROG([AUTOHEADER], [autoheader])
  5622. AM_MISSING_PROG([MAKEINFO], [makeinfo])
  5623. AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  5624. AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
  5625. AC_REQUIRE([AC_PROG_MKDIR_P])dnl
  5626. # For better backward compatibility. To be removed once Automake 1.9.x
  5627. # dies out for good. For more background, see:
  5628. # <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
  5629. # <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
  5630. AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
  5631. # We need awk for the "check" target (and possibly the TAP driver). The
  5632. # system "awk" is bad on some platforms.
  5633. AC_REQUIRE([AC_PROG_AWK])dnl
  5634. AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  5635. AC_REQUIRE([AM_SET_LEADING_DOT])dnl
  5636. _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
  5637. [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
  5638. [_AM_PROG_TAR([v7])])])
  5639. _AM_IF_OPTION([no-dependencies],,
  5640. [AC_PROVIDE_IFELSE([AC_PROG_CC],
  5641. [_AM_DEPENDENCIES([CC])],
  5642. [m4_define([AC_PROG_CC],
  5643. m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
  5644. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  5645. [_AM_DEPENDENCIES([CXX])],
  5646. [m4_define([AC_PROG_CXX],
  5647. m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
  5648. AC_PROVIDE_IFELSE([AC_PROG_OBJC],
  5649. [_AM_DEPENDENCIES([OBJC])],
  5650. [m4_define([AC_PROG_OBJC],
  5651. m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
  5652. AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
  5653. [_AM_DEPENDENCIES([OBJCXX])],
  5654. [m4_define([AC_PROG_OBJCXX],
  5655. m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
  5656. ])
  5657. AC_REQUIRE([AM_SILENT_RULES])dnl
  5658. dnl The testsuite driver may need to know about EXEEXT, so add the
  5659. dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
  5660. dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
  5661. AC_CONFIG_COMMANDS_PRE(dnl
  5662. [m4_provide_if([_AM_COMPILER_EXEEXT],
  5663. [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
  5664. # POSIX will say in a future version that running "rm -f" with no argument
  5665. # is OK; and we want to be able to make that assumption in our Makefile
  5666. # recipes. So use an aggressive probe to check that the usage we want is
  5667. # actually supported "in the wild" to an acceptable degree.
  5668. # See automake bug#10828.
  5669. # To make any issue more visible, cause the running configure to be aborted
  5670. # by default if the 'rm' program in use doesn't match our expectations; the
  5671. # user can still override this though.
  5672. if rm -f && rm -fr && rm -rf; then : OK; else
  5673. cat >&2 <<'END'
  5674. Oops!
  5675. Your 'rm' program seems unable to run without file operands specified
  5676. on the command line, even when the '-f' option is present. This is contrary
  5677. to the behaviour of most rm programs out there, and not conforming with
  5678. the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
  5679. Please tell bug-automake@gnu.org about your system, including the value
  5680. of your $PATH and any error possibly output before this message. This
  5681. can help us improve future automake versions.
  5682. END
  5683. if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
  5684. echo 'Configuration will proceed anyway, since you have set the' >&2
  5685. echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
  5686. echo >&2
  5687. else
  5688. cat >&2 <<'END'
  5689. Aborting the configuration process, to ensure you take notice of the issue.
  5690. You can download and install GNU coreutils to get an 'rm' implementation
  5691. that behaves properly: <https://www.gnu.org/software/coreutils/>.
  5692. If you want to complete the configuration process using your problematic
  5693. 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
  5694. to "yes", and re-run configure.
  5695. END
  5696. AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
  5697. fi
  5698. fi
  5699. dnl The trailing newline in this macro's definition is deliberate, for
  5700. dnl backward compatibility and to allow trailing 'dnl'-style comments
  5701. dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
  5702. ])
  5703. dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
  5704. dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
  5705. dnl mangled by Autoconf and run in a shell conditional statement.
  5706. m4_define([_AC_COMPILER_EXEEXT],
  5707. m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
  5708. # When config.status generates a header, we must update the stamp-h file.
  5709. # This file resides in the same directory as the config header
  5710. # that is generated. The stamp files are numbered to have different names.
  5711. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
  5712. # loop where config.status creates the headers, so we can generate
  5713. # our stamp files there.
  5714. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
  5715. [# Compute $1's index in $config_headers.
  5716. _am_arg=$1
  5717. _am_stamp_count=1
  5718. for _am_header in $config_headers :; do
  5719. case $_am_header in
  5720. $_am_arg | $_am_arg:* )
  5721. break ;;
  5722. * )
  5723. _am_stamp_count=`expr $_am_stamp_count + 1` ;;
  5724. esac
  5725. done
  5726. echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
  5727. # Copyright (C) 2001-2018 Free Software Foundation, Inc.
  5728. #
  5729. # This file is free software; the Free Software Foundation
  5730. # gives unlimited permission to copy and/or distribute it,
  5731. # with or without modifications, as long as this notice is preserved.
  5732. # AM_PROG_INSTALL_SH
  5733. # ------------------
  5734. # Define $install_sh.
  5735. AC_DEFUN([AM_PROG_INSTALL_SH],
  5736. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  5737. if test x"${install_sh+set}" != xset; then
  5738. case $am_aux_dir in
  5739. *\ * | *\ *)
  5740. install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
  5741. *)
  5742. install_sh="\${SHELL} $am_aux_dir/install-sh"
  5743. esac
  5744. fi
  5745. AC_SUBST([install_sh])])
  5746. # Copyright (C) 2003-2018 Free Software Foundation, Inc.
  5747. #
  5748. # This file is free software; the Free Software Foundation
  5749. # gives unlimited permission to copy and/or distribute it,
  5750. # with or without modifications, as long as this notice is preserved.
  5751. # Check whether the underlying file-system supports filenames
  5752. # with a leading dot. For instance MS-DOS doesn't.
  5753. AC_DEFUN([AM_SET_LEADING_DOT],
  5754. [rm -rf .tst 2>/dev/null
  5755. mkdir .tst 2>/dev/null
  5756. if test -d .tst; then
  5757. am__leading_dot=.
  5758. else
  5759. am__leading_dot=_
  5760. fi
  5761. rmdir .tst 2>/dev/null
  5762. AC_SUBST([am__leading_dot])])
  5763. # Check to see how 'make' treats includes. -*- Autoconf -*-
  5764. # Copyright (C) 2001-2018 Free Software Foundation, Inc.
  5765. #
  5766. # This file is free software; the Free Software Foundation
  5767. # gives unlimited permission to copy and/or distribute it,
  5768. # with or without modifications, as long as this notice is preserved.
  5769. # AM_MAKE_INCLUDE()
  5770. # -----------------
  5771. # Check whether make has an 'include' directive that can support all
  5772. # the idioms we need for our automatic dependency tracking code.
  5773. AC_DEFUN([AM_MAKE_INCLUDE],
  5774. [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
  5775. cat > confinc.mk << 'END'
  5776. am__doit:
  5777. @echo this is the am__doit target >confinc.out
  5778. .PHONY: am__doit
  5779. END
  5780. am__include="#"
  5781. am__quote=
  5782. # BSD make does it like this.
  5783. echo '.include "confinc.mk" # ignored' > confmf.BSD
  5784. # Other make implementations (GNU, Solaris 10, AIX) do it like this.
  5785. echo 'include confinc.mk # ignored' > confmf.GNU
  5786. _am_result=no
  5787. for s in GNU BSD; do
  5788. AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
  5789. AS_CASE([$?:`cat confinc.out 2>/dev/null`],
  5790. ['0:this is the am__doit target'],
  5791. [AS_CASE([$s],
  5792. [BSD], [am__include='.include' am__quote='"'],
  5793. [am__include='include' am__quote=''])])
  5794. if test "$am__include" != "#"; then
  5795. _am_result="yes ($s style)"
  5796. break
  5797. fi
  5798. done
  5799. rm -f confinc.* confmf.*
  5800. AC_MSG_RESULT([${_am_result}])
  5801. AC_SUBST([am__include])])
  5802. AC_SUBST([am__quote])])
  5803. # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
  5804. # Copyright (C) 1997-2018 Free Software Foundation, Inc.
  5805. #
  5806. # This file is free software; the Free Software Foundation
  5807. # gives unlimited permission to copy and/or distribute it,
  5808. # with or without modifications, as long as this notice is preserved.
  5809. # AM_MISSING_PROG(NAME, PROGRAM)
  5810. # ------------------------------
  5811. AC_DEFUN([AM_MISSING_PROG],
  5812. [AC_REQUIRE([AM_MISSING_HAS_RUN])
  5813. $1=${$1-"${am_missing_run}$2"}
  5814. AC_SUBST($1)])
  5815. # AM_MISSING_HAS_RUN
  5816. # ------------------
  5817. # Define MISSING if not defined so far and test if it is modern enough.
  5818. # If it is, set am_missing_run to use it, otherwise, to nothing.
  5819. AC_DEFUN([AM_MISSING_HAS_RUN],
  5820. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  5821. AC_REQUIRE_AUX_FILE([missing])dnl
  5822. if test x"${MISSING+set}" != xset; then
  5823. case $am_aux_dir in
  5824. *\ * | *\ *)
  5825. MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
  5826. *)
  5827. MISSING="\${SHELL} $am_aux_dir/missing" ;;
  5828. esac
  5829. fi
  5830. # Use eval to expand $SHELL
  5831. if eval "$MISSING --is-lightweight"; then
  5832. am_missing_run="$MISSING "
  5833. else
  5834. am_missing_run=
  5835. AC_MSG_WARN(['missing' script is too old or missing])
  5836. fi
  5837. ])
  5838. # Helper functions for option handling. -*- Autoconf -*-
  5839. # Copyright (C) 2001-2018 Free Software Foundation, Inc.
  5840. #
  5841. # This file is free software; the Free Software Foundation
  5842. # gives unlimited permission to copy and/or distribute it,
  5843. # with or without modifications, as long as this notice is preserved.
  5844. # _AM_MANGLE_OPTION(NAME)
  5845. # -----------------------
  5846. AC_DEFUN([_AM_MANGLE_OPTION],
  5847. [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
  5848. # _AM_SET_OPTION(NAME)
  5849. # --------------------
  5850. # Set option NAME. Presently that only means defining a flag for this option.
  5851. AC_DEFUN([_AM_SET_OPTION],
  5852. [m4_define(_AM_MANGLE_OPTION([$1]), [1])])
  5853. # _AM_SET_OPTIONS(OPTIONS)
  5854. # ------------------------
  5855. # OPTIONS is a space-separated list of Automake options.
  5856. AC_DEFUN([_AM_SET_OPTIONS],
  5857. [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
  5858. # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
  5859. # -------------------------------------------
  5860. # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
  5861. AC_DEFUN([_AM_IF_OPTION],
  5862. [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
  5863. # Copyright (C) 1999-2018 Free Software Foundation, Inc.
  5864. #
  5865. # This file is free software; the Free Software Foundation
  5866. # gives unlimited permission to copy and/or distribute it,
  5867. # with or without modifications, as long as this notice is preserved.
  5868. # _AM_PROG_CC_C_O
  5869. # ---------------
  5870. # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
  5871. # to automatically call this.
  5872. AC_DEFUN([_AM_PROG_CC_C_O],
  5873. [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
  5874. AC_REQUIRE_AUX_FILE([compile])dnl
  5875. AC_LANG_PUSH([C])dnl
  5876. AC_CACHE_CHECK(
  5877. [whether $CC understands -c and -o together],
  5878. [am_cv_prog_cc_c_o],
  5879. [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
  5880. # Make sure it works both with $CC and with simple cc.
  5881. # Following AC_PROG_CC_C_O, we do the test twice because some
  5882. # compilers refuse to overwrite an existing .o file with -o,
  5883. # though they will create one.
  5884. am_cv_prog_cc_c_o=yes
  5885. for am_i in 1 2; do
  5886. if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
  5887. && test -f conftest2.$ac_objext; then
  5888. : OK
  5889. else
  5890. am_cv_prog_cc_c_o=no
  5891. break
  5892. fi
  5893. done
  5894. rm -f core conftest*
  5895. unset am_i])
  5896. if test "$am_cv_prog_cc_c_o" != yes; then
  5897. # Losing compiler, so override with the script.
  5898. # FIXME: It is wrong to rewrite CC.
  5899. # But if we don't then we get into trouble of one sort or another.
  5900. # A longer-term fix would be to have automake use am__CC in this case,
  5901. # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
  5902. CC="$am_aux_dir/compile $CC"
  5903. fi
  5904. AC_LANG_POP([C])])
  5905. # For backward compatibility.
  5906. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
  5907. # Copyright (C) 2001-2018 Free Software Foundation, Inc.
  5908. #
  5909. # This file is free software; the Free Software Foundation
  5910. # gives unlimited permission to copy and/or distribute it,
  5911. # with or without modifications, as long as this notice is preserved.
  5912. # AM_RUN_LOG(COMMAND)
  5913. # -------------------
  5914. # Run COMMAND, save the exit status in ac_status, and log it.
  5915. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
  5916. AC_DEFUN([AM_RUN_LOG],
  5917. [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
  5918. ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
  5919. ac_status=$?
  5920. echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  5921. (exit $ac_status); }])
  5922. # Check to make sure that the build environment is sane. -*- Autoconf -*-
  5923. # Copyright (C) 1996-2018 Free Software Foundation, Inc.
  5924. #
  5925. # This file is free software; the Free Software Foundation
  5926. # gives unlimited permission to copy and/or distribute it,
  5927. # with or without modifications, as long as this notice is preserved.
  5928. # AM_SANITY_CHECK
  5929. # ---------------
  5930. AC_DEFUN([AM_SANITY_CHECK],
  5931. [AC_MSG_CHECKING([whether build environment is sane])
  5932. # Reject unsafe characters in $srcdir or the absolute working directory
  5933. # name. Accept space and tab only in the latter.
  5934. am_lf='
  5935. '
  5936. case `pwd` in
  5937. *[[\\\"\#\$\&\'\`$am_lf]]*)
  5938. AC_MSG_ERROR([unsafe absolute working directory name]);;
  5939. esac
  5940. case $srcdir in
  5941. *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
  5942. AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
  5943. esac
  5944. # Do 'set' in a subshell so we don't clobber the current shell's
  5945. # arguments. Must try -L first in case configure is actually a
  5946. # symlink; some systems play weird games with the mod time of symlinks
  5947. # (eg FreeBSD returns the mod time of the symlink's containing
  5948. # directory).
  5949. if (
  5950. am_has_slept=no
  5951. for am_try in 1 2; do
  5952. echo "timestamp, slept: $am_has_slept" > conftest.file
  5953. set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
  5954. if test "$[*]" = "X"; then
  5955. # -L didn't work.
  5956. set X `ls -t "$srcdir/configure" conftest.file`
  5957. fi
  5958. if test "$[*]" != "X $srcdir/configure conftest.file" \
  5959. && test "$[*]" != "X conftest.file $srcdir/configure"; then
  5960. # If neither matched, then we have a broken ls. This can happen
  5961. # if, for instance, CONFIG_SHELL is bash and it inherits a
  5962. # broken ls alias from the environment. This has actually
  5963. # happened. Such a system could not be considered "sane".
  5964. AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
  5965. alias in your environment])
  5966. fi
  5967. if test "$[2]" = conftest.file || test $am_try -eq 2; then
  5968. break
  5969. fi
  5970. # Just in case.
  5971. sleep 1
  5972. am_has_slept=yes
  5973. done
  5974. test "$[2]" = conftest.file
  5975. )
  5976. then
  5977. # Ok.
  5978. :
  5979. else
  5980. AC_MSG_ERROR([newly created file is older than distributed files!
  5981. Check your system clock])
  5982. fi
  5983. AC_MSG_RESULT([yes])
  5984. # If we didn't sleep, we still need to ensure time stamps of config.status and
  5985. # generated files are strictly newer.
  5986. am_sleep_pid=
  5987. if grep 'slept: no' conftest.file >/dev/null 2>&1; then
  5988. ( sleep 1 ) &
  5989. am_sleep_pid=$!
  5990. fi
  5991. AC_CONFIG_COMMANDS_PRE(
  5992. [AC_MSG_CHECKING([that generated files are newer than configure])
  5993. if test -n "$am_sleep_pid"; then
  5994. # Hide warnings about reused PIDs.
  5995. wait $am_sleep_pid 2>/dev/null
  5996. fi
  5997. AC_MSG_RESULT([done])])
  5998. rm -f conftest.file
  5999. ])
  6000. # Copyright (C) 2009-2018 Free Software Foundation, Inc.
  6001. #
  6002. # This file is free software; the Free Software Foundation
  6003. # gives unlimited permission to copy and/or distribute it,
  6004. # with or without modifications, as long as this notice is preserved.
  6005. # AM_SILENT_RULES([DEFAULT])
  6006. # --------------------------
  6007. # Enable less verbose build rules; with the default set to DEFAULT
  6008. # ("yes" being less verbose, "no" or empty being verbose).
  6009. AC_DEFUN([AM_SILENT_RULES],
  6010. [AC_ARG_ENABLE([silent-rules], [dnl
  6011. AS_HELP_STRING(
  6012. [--enable-silent-rules],
  6013. [less verbose build output (undo: "make V=1")])
  6014. AS_HELP_STRING(
  6015. [--disable-silent-rules],
  6016. [verbose build output (undo: "make V=0")])dnl
  6017. ])
  6018. case $enable_silent_rules in @%:@ (((
  6019. yes) AM_DEFAULT_VERBOSITY=0;;
  6020. no) AM_DEFAULT_VERBOSITY=1;;
  6021. *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
  6022. esac
  6023. dnl
  6024. dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
  6025. dnl do not support nested variable expansions.
  6026. dnl See automake bug#9928 and bug#10237.
  6027. am_make=${MAKE-make}
  6028. AC_CACHE_CHECK([whether $am_make supports nested variables],
  6029. [am_cv_make_support_nested_variables],
  6030. [if AS_ECHO([['TRUE=$(BAR$(V))
  6031. BAR0=false
  6032. BAR1=true
  6033. V=1
  6034. am__doit:
  6035. @$(TRUE)
  6036. .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
  6037. am_cv_make_support_nested_variables=yes
  6038. else
  6039. am_cv_make_support_nested_variables=no
  6040. fi])
  6041. if test $am_cv_make_support_nested_variables = yes; then
  6042. dnl Using '$V' instead of '$(V)' breaks IRIX make.
  6043. AM_V='$(V)'
  6044. AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
  6045. else
  6046. AM_V=$AM_DEFAULT_VERBOSITY
  6047. AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
  6048. fi
  6049. AC_SUBST([AM_V])dnl
  6050. AM_SUBST_NOTMAKE([AM_V])dnl
  6051. AC_SUBST([AM_DEFAULT_V])dnl
  6052. AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
  6053. AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
  6054. AM_BACKSLASH='\'
  6055. AC_SUBST([AM_BACKSLASH])dnl
  6056. _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
  6057. ])
  6058. # Copyright (C) 2001-2018 Free Software Foundation, Inc.
  6059. #
  6060. # This file is free software; the Free Software Foundation
  6061. # gives unlimited permission to copy and/or distribute it,
  6062. # with or without modifications, as long as this notice is preserved.
  6063. # AM_PROG_INSTALL_STRIP
  6064. # ---------------------
  6065. # One issue with vendor 'install' (even GNU) is that you can't
  6066. # specify the program used to strip binaries. This is especially
  6067. # annoying in cross-compiling environments, where the build's strip
  6068. # is unlikely to handle the host's binaries.
  6069. # Fortunately install-sh will honor a STRIPPROG variable, so we
  6070. # always use install-sh in "make install-strip", and initialize
  6071. # STRIPPROG with the value of the STRIP variable (set by the user).
  6072. AC_DEFUN([AM_PROG_INSTALL_STRIP],
  6073. [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
  6074. # Installed binaries are usually stripped using 'strip' when the user
  6075. # run "make install-strip". However 'strip' might not be the right
  6076. # tool to use in cross-compilation environments, therefore Automake
  6077. # will honor the 'STRIP' environment variable to overrule this program.
  6078. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
  6079. if test "$cross_compiling" != no; then
  6080. AC_CHECK_TOOL([STRIP], [strip], :)
  6081. fi
  6082. INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
  6083. AC_SUBST([INSTALL_STRIP_PROGRAM])])
  6084. # Copyright (C) 2006-2018 Free Software Foundation, Inc.
  6085. #
  6086. # This file is free software; the Free Software Foundation
  6087. # gives unlimited permission to copy and/or distribute it,
  6088. # with or without modifications, as long as this notice is preserved.
  6089. # _AM_SUBST_NOTMAKE(VARIABLE)
  6090. # ---------------------------
  6091. # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
  6092. # This macro is traced by Automake.
  6093. AC_DEFUN([_AM_SUBST_NOTMAKE])
  6094. # AM_SUBST_NOTMAKE(VARIABLE)
  6095. # --------------------------
  6096. # Public sister of _AM_SUBST_NOTMAKE.
  6097. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
  6098. # Check how to create a tarball. -*- Autoconf -*-
  6099. # Copyright (C) 2004-2018 Free Software Foundation, Inc.
  6100. #
  6101. # This file is free software; the Free Software Foundation
  6102. # gives unlimited permission to copy and/or distribute it,
  6103. # with or without modifications, as long as this notice is preserved.
  6104. # _AM_PROG_TAR(FORMAT)
  6105. # --------------------
  6106. # Check how to create a tarball in format FORMAT.
  6107. # FORMAT should be one of 'v7', 'ustar', or 'pax'.
  6108. #
  6109. # Substitute a variable $(am__tar) that is a command
  6110. # writing to stdout a FORMAT-tarball containing the directory
  6111. # $tardir.
  6112. # tardir=directory && $(am__tar) > result.tar
  6113. #
  6114. # Substitute a variable $(am__untar) that extract such
  6115. # a tarball read from stdin.
  6116. # $(am__untar) < result.tar
  6117. #
  6118. AC_DEFUN([_AM_PROG_TAR],
  6119. [# Always define AMTAR for backward compatibility. Yes, it's still used
  6120. # in the wild :-( We should find a proper way to deprecate it ...
  6121. AC_SUBST([AMTAR], ['$${TAR-tar}'])
  6122. # We'll loop over all known methods to create a tar archive until one works.
  6123. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
  6124. m4_if([$1], [v7],
  6125. [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
  6126. [m4_case([$1],
  6127. [ustar],
  6128. [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
  6129. # There is notably a 21 bits limit for the UID and the GID. In fact,
  6130. # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
  6131. # and bug#13588).
  6132. am_max_uid=2097151 # 2^21 - 1
  6133. am_max_gid=$am_max_uid
  6134. # The $UID and $GID variables are not portable, so we need to resort
  6135. # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
  6136. # below are definitely unexpected, so allow the users to see them
  6137. # (that is, avoid stderr redirection).
  6138. am_uid=`id -u || echo unknown`
  6139. am_gid=`id -g || echo unknown`
  6140. AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
  6141. if test $am_uid -le $am_max_uid; then
  6142. AC_MSG_RESULT([yes])
  6143. else
  6144. AC_MSG_RESULT([no])
  6145. _am_tools=none
  6146. fi
  6147. AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
  6148. if test $am_gid -le $am_max_gid; then
  6149. AC_MSG_RESULT([yes])
  6150. else
  6151. AC_MSG_RESULT([no])
  6152. _am_tools=none
  6153. fi],
  6154. [pax],
  6155. [],
  6156. [m4_fatal([Unknown tar format])])
  6157. AC_MSG_CHECKING([how to create a $1 tar archive])
  6158. # Go ahead even if we have the value already cached. We do so because we
  6159. # need to set the values for the 'am__tar' and 'am__untar' variables.
  6160. _am_tools=${am_cv_prog_tar_$1-$_am_tools}
  6161. for _am_tool in $_am_tools; do
  6162. case $_am_tool in
  6163. gnutar)
  6164. for _am_tar in tar gnutar gtar; do
  6165. AM_RUN_LOG([$_am_tar --version]) && break
  6166. done
  6167. am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
  6168. am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
  6169. am__untar="$_am_tar -xf -"
  6170. ;;
  6171. plaintar)
  6172. # Must skip GNU tar: if it does not support --format= it doesn't create
  6173. # ustar tarball either.
  6174. (tar --version) >/dev/null 2>&1 && continue
  6175. am__tar='tar chf - "$$tardir"'
  6176. am__tar_='tar chf - "$tardir"'
  6177. am__untar='tar xf -'
  6178. ;;
  6179. pax)
  6180. am__tar='pax -L -x $1 -w "$$tardir"'
  6181. am__tar_='pax -L -x $1 -w "$tardir"'
  6182. am__untar='pax -r'
  6183. ;;
  6184. cpio)
  6185. am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
  6186. am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
  6187. am__untar='cpio -i -H $1 -d'
  6188. ;;
  6189. none)
  6190. am__tar=false
  6191. am__tar_=false
  6192. am__untar=false
  6193. ;;
  6194. esac
  6195. # If the value was cached, stop now. We just wanted to have am__tar
  6196. # and am__untar set.
  6197. test -n "${am_cv_prog_tar_$1}" && break
  6198. # tar/untar a dummy directory, and stop if the command works.
  6199. rm -rf conftest.dir
  6200. mkdir conftest.dir
  6201. echo GrepMe > conftest.dir/file
  6202. AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
  6203. rm -rf conftest.dir
  6204. if test -s conftest.tar; then
  6205. AM_RUN_LOG([$am__untar <conftest.tar])
  6206. AM_RUN_LOG([cat conftest.dir/file])
  6207. grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
  6208. fi
  6209. done
  6210. rm -rf conftest.dir
  6211. AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
  6212. AC_MSG_RESULT([$am_cv_prog_tar_$1])])
  6213. AC_SUBST([am__tar])
  6214. AC_SUBST([am__untar])
  6215. ]) # _AM_PROG_TAR