KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

acinclude.m4 388KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406
  1. ## -*- autoconf -*-
  2. dnl This file is part of the KDE libraries/packages
  3. dnl Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
  4. dnl (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
  5. dnl This file is free software; you can redistribute it and/or
  6. dnl modify it under the terms of the GNU Library General Public
  7. dnl License as published by the Free Software Foundation; either
  8. dnl version 2 of the License, or (at your option) any later version.
  9. dnl This library is distributed in the hope that it will be useful,
  10. dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. dnl Library General Public License for more details.
  13. dnl You should have received a copy of the GNU Library General Public License
  14. dnl along with this library; see the file COPYING.LIB. If not, write to
  15. dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. dnl Boston, MA 02110-1301, USA.
  17. dnl IMPORTANT NOTE:
  18. dnl Please do not modify this file unless you expect your modifications to be
  19. dnl carried into every other module in the repository.
  20. dnl
  21. dnl Single-module modifications are best placed in configure.in for kdelibs
  22. dnl and kdebase or configure.in.in if present.
  23. # KDE_PATH_X_DIRECT
  24. dnl Internal subroutine of AC_PATH_X.
  25. dnl Set ac_x_includes and/or ac_x_libraries.
  26. AC_DEFUN([KDE_PATH_X_DIRECT],
  27. [
  28. AC_REQUIRE([KDE_CHECK_LIB64])
  29. if test "$ac_x_includes" = NO; then
  30. # Guess where to find include files, by looking for this one X11 .h file.
  31. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  32. # First, try using that file with no special directory specified.
  33. AC_TRY_CPP([#include <$x_direct_test_include>],
  34. [# We can compile using X headers with no special include directory.
  35. ac_x_includes=],
  36. [# Look for the header file in a standard set of common directories.
  37. # Check X11 before X11Rn because it is often a symlink to the current release.
  38. for ac_dir in \
  39. /usr/X11/include \
  40. /usr/X11R6/include \
  41. /usr/X11R5/include \
  42. /usr/X11R4/include \
  43. \
  44. /usr/include/X11 \
  45. /usr/include/X11R6 \
  46. /usr/include/X11R5 \
  47. /usr/include/X11R4 \
  48. \
  49. /usr/local/X11/include \
  50. /usr/local/X11R6/include \
  51. /usr/local/X11R5/include \
  52. /usr/local/X11R4/include \
  53. \
  54. /usr/local/include/X11 \
  55. /usr/local/include/X11R6 \
  56. /usr/local/include/X11R5 \
  57. /usr/local/include/X11R4 \
  58. \
  59. /usr/X386/include \
  60. /usr/x386/include \
  61. /usr/XFree86/include/X11 \
  62. \
  63. /usr/include \
  64. /usr/local/include \
  65. /usr/unsupported/include \
  66. /usr/athena/include \
  67. /usr/local/x11r5/include \
  68. /usr/lpp/Xamples/include \
  69. \
  70. /usr/openwin/include \
  71. /usr/openwin/share/include \
  72. ; \
  73. do
  74. if test -r "$ac_dir/$x_direct_test_include"; then
  75. ac_x_includes=$ac_dir
  76. break
  77. fi
  78. done])
  79. fi # $ac_x_includes = NO
  80. if test "$ac_x_libraries" = NO; then
  81. # Check for the libraries.
  82. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  83. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  84. # See if we find them without any special options.
  85. # Don't add to $LIBS permanently.
  86. ac_save_LIBS="$LIBS"
  87. LIBS="-l$x_direct_test_library $LIBS"
  88. AC_TRY_LINK([#include <X11/Intrinsic.h>], [${x_direct_test_function}(1)],
  89. [LIBS="$ac_save_LIBS"
  90. # We can link X programs with no special library path.
  91. ac_x_libraries=],
  92. [LIBS="$ac_save_LIBS"
  93. # First see if replacing the include by lib works.
  94. # Check X11 before X11Rn because it is often a symlink to the current release.
  95. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${kdelibsuff}/` \
  96. /usr/X11/lib${kdelibsuff} \
  97. /usr/X11R6/lib${kdelibsuff} \
  98. /usr/X11R5/lib${kdelibsuff} \
  99. /usr/X11R4/lib${kdelibsuff} \
  100. \
  101. /usr/lib${kdelibsuff}/X11 \
  102. /usr/lib${kdelibsuff}/X11R6 \
  103. /usr/lib${kdelibsuff}/X11R5 \
  104. /usr/lib${kdelibsuff}/X11R4 \
  105. \
  106. /usr/local/X11/lib${kdelibsuff} \
  107. /usr/local/X11R6/lib${kdelibsuff} \
  108. /usr/local/X11R5/lib${kdelibsuff} \
  109. /usr/local/X11R4/lib${kdelibsuff} \
  110. \
  111. /usr/local/lib${kdelibsuff}/X11 \
  112. /usr/local/lib${kdelibsuff}/X11R6 \
  113. /usr/local/lib${kdelibsuff}/X11R5 \
  114. /usr/local/lib${kdelibsuff}/X11R4 \
  115. \
  116. /usr/X386/lib${kdelibsuff} \
  117. /usr/x386/lib${kdelibsuff} \
  118. /usr/XFree86/lib${kdelibsuff}/X11 \
  119. \
  120. /usr/lib${kdelibsuff} \
  121. /usr/local/lib${kdelibsuff} \
  122. /usr/unsupported/lib${kdelibsuff} \
  123. /usr/athena/lib${kdelibsuff} \
  124. /usr/local/x11r5/lib${kdelibsuff} \
  125. /usr/lpp/Xamples/lib${kdelibsuff} \
  126. /lib/usr/lib${kdelibsuff}/X11 \
  127. \
  128. /usr/openwin/lib${kdelibsuff} \
  129. /usr/openwin/share/lib${kdelibsuff} \
  130. ; \
  131. do
  132. dnl Don't even attempt the hair of trying to link an X program!
  133. for ac_extension in a so sl; do
  134. if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  135. ac_x_libraries=$ac_dir
  136. break 2
  137. fi
  138. done
  139. done])
  140. fi # $ac_x_libraries = NO
  141. ])
  142. dnl ------------------------------------------------------------------------
  143. dnl Find a file (or one of more files in a list of dirs)
  144. dnl ------------------------------------------------------------------------
  145. dnl
  146. AC_DEFUN([AC_FIND_FILE],
  147. [
  148. $3=NO
  149. for i in $2;
  150. do
  151. for j in $1;
  152. do
  153. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  154. if test -r "$i/$j"; then
  155. echo "taking that" >&AC_FD_CC
  156. $3=$i
  157. break 2
  158. fi
  159. done
  160. done
  161. ])
  162. dnl KDE_FIND_PATH(program-name, variable-name, list-of-dirs,
  163. dnl if-not-found, test-parameter, prepend-path)
  164. dnl
  165. dnl Look for program-name in list-of-dirs+$PATH.
  166. dnl If prepend-path is set, look in $PATH+list-of-dirs instead.
  167. dnl If found, $variable-name is set. If not, if-not-found is evaluated.
  168. dnl test-parameter: if set, the program is executed with this arg,
  169. dnl and only a successful exit code is required.
  170. AC_DEFUN([KDE_FIND_PATH],
  171. [
  172. AC_MSG_CHECKING([for $1])
  173. if test -n "$$2"; then
  174. kde_cv_path="$$2";
  175. else
  176. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  177. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  178. [
  179. kde_cv_path="NONE"
  180. kde_save_IFS=$IFS
  181. IFS=':'
  182. dirs=""
  183. for dir in $PATH; do
  184. dirs="$dirs $dir"
  185. done
  186. if test -z "$6"; then dnl Append dirs in PATH (default)
  187. dirs="$3 $dirs"
  188. else dnl Prepend dirs in PATH (if 6th arg is set)
  189. dirs="$dirs $3"
  190. fi
  191. IFS=$kde_save_IFS
  192. for dir in $dirs; do
  193. if test -x "$dir/$1"; then
  194. if test -n "$5"
  195. then
  196. evalstr="$dir/$1 $5 2>&1 "
  197. if eval $evalstr; then
  198. kde_cv_path="$dir/$1"
  199. break
  200. fi
  201. else
  202. kde_cv_path="$dir/$1"
  203. break
  204. fi
  205. fi
  206. done
  207. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  208. ])
  209. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  210. fi
  211. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  212. AC_MSG_RESULT(not found)
  213. $4
  214. else
  215. AC_MSG_RESULT($kde_cv_path)
  216. $2=$kde_cv_path
  217. fi
  218. ])
  219. AC_DEFUN([KDE_MOC_ERROR_MESSAGE],
  220. [
  221. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  222. Please check whether you installed Qt correctly.
  223. You need to have a running moc binary.
  224. configure tried to run $ac_cv_path_moc and the test didn't
  225. succeed. If configure shouldn't have tried this one, set
  226. the environment variable MOC to the right one before running
  227. configure.
  228. ])
  229. ])
  230. AC_DEFUN([KDE_UIC_ERROR_MESSAGE],
  231. [
  232. AC_MSG_WARN([No Qt ui compiler (uic) found!
  233. Please check whether you installed Qt correctly.
  234. You need to have a running uic binary.
  235. configure tried to run $ac_cv_path_uic and the test didn't
  236. succeed. If configure shouldn't have tried this one, set
  237. the environment variable UIC to the right one before running
  238. configure.
  239. ])
  240. ])
  241. AC_DEFUN([KDE_CHECK_UIC_FLAG],
  242. [
  243. AC_MSG_CHECKING([whether uic supports -$1 ])
  244. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  245. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  246. [
  247. cat >conftest.ui <<EOT
  248. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  249. EOT
  250. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  251. if AC_TRY_EVAL(ac_uic_testrun); then
  252. eval "kde_cv_prog_uic_$kde_cache=yes"
  253. else
  254. eval "kde_cv_prog_uic_$kde_cache=no"
  255. fi
  256. rm -f conftest*
  257. ])
  258. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  259. AC_MSG_RESULT([yes])
  260. :
  261. $3
  262. else
  263. AC_MSG_RESULT([no])
  264. :
  265. $4
  266. fi
  267. ])
  268. dnl ------------------------------------------------------------------------
  269. dnl Find the meta object compiler and the ui compiler in the PATH,
  270. dnl in $QTDIR/bin, and some more usual places
  271. dnl ------------------------------------------------------------------------
  272. dnl
  273. AC_DEFUN([AC_PATH_QT_MOC_UIC],
  274. [
  275. AC_REQUIRE([KDE_CHECK_PERL])
  276. qt_bindirs=""
  277. for dir in $kde_qt_dirs; do
  278. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  279. done
  280. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  281. if test ! "$ac_qt_bindir" = "NO"; then
  282. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  283. fi
  284. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  285. if test -z "$UIC_NOT_NEEDED"; then
  286. KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  287. if test -z "$UIC_PATH" ; then
  288. KDE_UIC_ERROR_MESSAGE
  289. exit 1
  290. else
  291. UIC=$UIC_PATH
  292. if test $kde_qtver = 3; then
  293. KDE_CHECK_UIC_FLAG(L,[/nonexistent],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  294. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  295. if test x$ac_uic_supports_libpath = xyes; then
  296. UIC="$UIC -L \$(kde_widgetdir)"
  297. fi
  298. if test x$ac_uic_supports_nounload = xyes; then
  299. UIC="$UIC -nounload"
  300. fi
  301. fi
  302. fi
  303. else
  304. UIC="echo uic not available: "
  305. fi
  306. AC_SUBST(MOC)
  307. AC_SUBST(UIC)
  308. UIC_TR="i18n"
  309. if test $kde_qtver = 3; then
  310. UIC_TR="tr2i18n"
  311. fi
  312. AC_SUBST(UIC_TR)
  313. ])
  314. AC_DEFUN([KDE_1_CHECK_PATHS],
  315. [
  316. KDE_1_CHECK_PATH_HEADERS
  317. KDE_TEST_RPATH=
  318. if test -n "$USE_RPATH"; then
  319. if test -n "$kde_libraries"; then
  320. KDE_TEST_RPATH="-R $kde_libraries"
  321. fi
  322. if test -n "$qt_libraries"; then
  323. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  324. fi
  325. if test -n "$x_libraries"; then
  326. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  327. fi
  328. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  329. fi
  330. AC_MSG_CHECKING([for KDE libraries installed])
  331. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
  332. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  333. AC_MSG_RESULT(yes)
  334. else
  335. AC_MSG_ERROR([your system fails at linking a small KDE application!
  336. Check, if your compiler is installed correctly and if you have used the
  337. same compiler to compile Qt and kdelibs as you did use now.
  338. For more details about this problem, look at the end of config.log.])
  339. fi
  340. if eval `KDEDIR= ./conftest 2>&5`; then
  341. kde_result=done
  342. else
  343. kde_result=problems
  344. fi
  345. KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  346. kde_have_all_paths=yes
  347. KDE_SET_PATHS($kde_result)
  348. ])
  349. AC_DEFUN([KDE_SET_PATHS],
  350. [
  351. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  352. kde_htmldir=\"$kde_htmldir\" \
  353. kde_appsdir=\"$kde_appsdir\" \
  354. kde_icondir=\"$kde_icondir\" \
  355. kde_sounddir=\"$kde_sounddir\" \
  356. kde_datadir=\"$kde_datadir\" \
  357. kde_locale=\"$kde_locale\" \
  358. kde_cgidir=\"$kde_cgidir\" \
  359. kde_confdir=\"$kde_confdir\" \
  360. kde_kcfgdir=\"$kde_kcfgdir\" \
  361. kde_mimedir=\"$kde_mimedir\" \
  362. kde_toolbardir=\"$kde_toolbardir\" \
  363. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  364. kde_templatesdir=\"$kde_templatesdir\" \
  365. kde_bindir=\"$kde_bindir\" \
  366. kde_servicesdir=\"$kde_servicesdir\" \
  367. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  368. kde_moduledir=\"$kde_moduledir\" \
  369. kde_styledir=\"$kde_styledir\" \
  370. kde_widgetdir=\"$kde_widgetdir\" \
  371. xdg_appsdir=\"$xdg_appsdir\" \
  372. xdg_menudir=\"$xdg_menudir\" \
  373. xdg_directorydir=\"$xdg_directorydir\" \
  374. kde_result=$1"
  375. ])
  376. AC_DEFUN([KDE_SET_DEFAULT_PATHS],
  377. [
  378. if test "$1" = "default"; then
  379. if test -z "$kde_htmldir"; then
  380. kde_htmldir='\${datadir}/doc/HTML'
  381. fi
  382. if test -z "$kde_appsdir"; then
  383. kde_appsdir='\${datadir}/applnk'
  384. fi
  385. if test -z "$kde_icondir"; then
  386. kde_icondir='\${datadir}/icons'
  387. fi
  388. if test -z "$kde_sounddir"; then
  389. kde_sounddir='\${datadir}/sounds'
  390. fi
  391. if test -z "$kde_datadir"; then
  392. kde_datadir='\${datadir}/apps'
  393. fi
  394. if test -z "$kde_locale"; then
  395. kde_locale='\${datadir}/locale'
  396. fi
  397. if test -z "$kde_cgidir"; then
  398. kde_cgidir='\${exec_prefix}/cgi-bin'
  399. fi
  400. if test -z "$kde_confdir"; then
  401. kde_confdir='\${datadir}/config'
  402. fi
  403. if test -z "$kde_kcfgdir"; then
  404. kde_kcfgdir='\${datadir}/config.kcfg'
  405. fi
  406. if test -z "$kde_mimedir"; then
  407. kde_mimedir='\${datadir}/mimelnk'
  408. fi
  409. if test -z "$kde_toolbardir"; then
  410. kde_toolbardir='\${datadir}/toolbar'
  411. fi
  412. if test -z "$kde_wallpaperdir"; then
  413. kde_wallpaperdir='\${datadir}/wallpapers'
  414. fi
  415. if test -z "$kde_templatesdir"; then
  416. kde_templatesdir='\${datadir}/templates'
  417. fi
  418. if test -z "$kde_bindir"; then
  419. kde_bindir='\${exec_prefix}/bin'
  420. fi
  421. if test -z "$kde_servicesdir"; then
  422. kde_servicesdir='\${datadir}/services'
  423. fi
  424. if test -z "$kde_servicetypesdir"; then
  425. kde_servicetypesdir='\${datadir}/servicetypes'
  426. fi
  427. if test -z "$kde_moduledir"; then
  428. if test "$kde_qtver" = "2"; then
  429. kde_moduledir='\${libdir}/kde2'
  430. else
  431. kde_moduledir='\${libdir}/trinity'
  432. fi
  433. fi
  434. if test -z "$kde_styledir"; then
  435. kde_styledir='\${libdir}/trinity/plugins/styles'
  436. fi
  437. if test -z "$kde_widgetdir"; then
  438. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  439. fi
  440. if test -z "$xdg_appsdir"; then
  441. xdg_appsdir='\${datadir}/applications/kde'
  442. fi
  443. if test -z "$xdg_menudir"; then
  444. xdg_menudir='\${sysconfdir}/xdg/menus'
  445. fi
  446. if test -z "$xdg_directorydir"; then
  447. xdg_directorydir='\${datadir}/desktop-directories'
  448. fi
  449. KDE_SET_PATHS(defaults)
  450. else
  451. if test $kde_qtver = 1; then
  452. AC_MSG_RESULT([compiling])
  453. KDE_1_CHECK_PATHS
  454. else
  455. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  456. fi
  457. fi
  458. ])
  459. AC_DEFUN([KDE_CHECK_PATHS_FOR_COMPLETENESS],
  460. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  461. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  462. test -z "$kde_datadir" || test -z "$kde_locale" ||
  463. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  464. test -z "$kde_kcfgdir" ||
  465. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  466. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  467. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  468. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  469. test -z "$kde_styledir" || test -z "kde_widgetdir" ||
  470. test -z "$xdg_appsdir" || test -z "$xdg_menudir" || test -z "$xdg_directorydir" ||
  471. test "x$kde_have_all_paths" != "xyes"; then
  472. kde_have_all_paths=no
  473. fi
  474. ])
  475. AC_DEFUN([KDE_MISSING_PROG_ERROR],
  476. [
  477. AC_MSG_ERROR([The important program $1 was not found!
  478. Please check whether you installed KDE correctly.
  479. ])
  480. ])
  481. AC_DEFUN([KDE_MISSING_ARTS_ERROR],
  482. [
  483. AC_MSG_ERROR([The important program $1 was not found!
  484. Please check whether you installed aRts correctly or use
  485. --without-arts to compile without aRts support (this will remove functionality).
  486. ])
  487. ])
  488. AC_DEFUN([KDE_SET_DEFAULT_BINDIRS],
  489. [
  490. kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/trinity/bin /usr/kde/bin /usr/local/kde/bin"
  491. test -n "$KDEDIR" && kde_default_bindirs="$KDEDIR/bin $kde_default_bindirs"
  492. if test -n "$KDEDIRS"; then
  493. kde_save_IFS=$IFS
  494. IFS=:
  495. for dir in $KDEDIRS; do
  496. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  497. done
  498. IFS=$kde_save_IFS
  499. fi
  500. ])
  501. AC_DEFUN([KDE_SUBST_PROGRAMS],
  502. [
  503. AC_ARG_WITH(arts,
  504. AC_HELP_STRING([--without-arts],[build without aRts [default=no]]),
  505. [build_arts=$withval],
  506. [build_arts=yes]
  507. )
  508. AM_CONDITIONAL(include_ARTS, test "$build_arts" '!=' "no")
  509. if test "$build_arts" = "no"; then
  510. AC_DEFINE(WITHOUT_ARTS, 1, [Defined if compiling without arts])
  511. fi
  512. KDE_SET_DEFAULT_BINDIRS
  513. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_libs_prefix/bin $kde_default_bindirs"
  514. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  515. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  516. if test "$build_arts" '!=' "no"; then
  517. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  518. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  519. fi
  520. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  521. trinity2ornewer=1
  522. trinity3ornewer=1
  523. if test -n "$kde_qtver" && test "$kde_qtver" -lt 3; then
  524. trinity2ornewer=
  525. trinity3ornewer=
  526. else
  527. if test "$kde_qtver" = "3"; then
  528. if test "$kde_qtsubver" -le 1; then
  529. trinity2ornewer=
  530. fi
  531. if test "$kde_qtsubver" -le 2; then
  532. trinity3ornewer=
  533. fi
  534. if test "$KDECONFIG" != "compiled"; then
  535. if test `$KDECONFIG --version | grep KDE | sed 's/KDE: \(...\).*/\1/'` = 3.2; then
  536. trinity3ornewer=
  537. fi
  538. fi
  539. fi
  540. fi
  541. if test -n "$trinity2ornewer"; then
  542. KDE_FIND_PATH(kconfig_compiler, KCONFIG_COMPILER, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kconfig_compiler)])
  543. KDE_FIND_PATH(dcopidlng, DCOPIDLNG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidlng)])
  544. fi
  545. if test -n "$trinity3ornewer"; then
  546. KDE_FIND_PATH(makekdewidgets, MAKEKDEWIDGETS, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(makekdewidgets)])
  547. AC_SUBST(MAKEKDEWIDGETS)
  548. fi
  549. KDE_FIND_PATH(xmllint, XMLLINT, [${prefix}/bin ${exec_prefix}/bin], [XMLLINT=""])
  550. if test -n "$MEINPROC" -a "$MEINPROC" != "compiled"; then
  551. kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/trinity/share /opt/kde/share $prefix/share"
  552. test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
  553. AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  554. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  555. KDE_XSL_STYLESHEET=""
  556. else
  557. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
  558. fi
  559. fi
  560. DCOP_DEPENDENCIES='$(DCOPIDL)'
  561. if test -n "$trinity2ornewer"; then
  562. KCFG_DEPENDENCIES='$(KCONFIG_COMPILER)'
  563. DCOP_DEPENDENCIES='$(DCOPIDL) $(DCOPIDLNG)'
  564. AC_SUBST(KCONFIG_COMPILER)
  565. AC_SUBST(KCFG_DEPENDENCIES)
  566. AC_SUBST(DCOPIDLNG)
  567. fi
  568. AC_SUBST(DCOPIDL)
  569. AC_SUBST(DCOPIDL2CPP)
  570. AC_SUBST(DCOP_DEPENDENCIES)
  571. AC_SUBST(MCOPIDL)
  572. AC_SUBST(ARTSCCONFIG)
  573. AC_SUBST(MEINPROC)
  574. AC_SUBST(KDE_XSL_STYLESHEET)
  575. AC_SUBST(XMLLINT)
  576. ])dnl
  577. AC_DEFUN([AC_CREATE_KFSSTND],
  578. [
  579. AC_REQUIRE([AC_CHECK_RPATH])
  580. AC_MSG_CHECKING([for KDE paths])
  581. kde_result=""
  582. kde_cached_paths=yes
  583. AC_CACHE_VAL(kde_cv_all_paths,
  584. [
  585. KDE_SET_DEFAULT_PATHS($1)
  586. kde_cached_paths=no
  587. ])
  588. eval "$kde_cv_all_paths"
  589. KDE_CHECK_PATHS_FOR_COMPLETENESS
  590. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  591. # wrong values were cached, may be, we can set better ones
  592. kde_result=
  593. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  594. kde_datadir= kde_locale= kde_cgidir= kde_confdir= kde_kcfgdir=
  595. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  596. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  597. kde_have_all_paths=
  598. kde_styledir=
  599. kde_widgetdir=
  600. xdg_appsdir = xdg_menudir= xdg_directorydir=
  601. KDE_SET_DEFAULT_PATHS($1)
  602. eval "$kde_cv_all_paths"
  603. KDE_CHECK_PATHS_FOR_COMPLETENESS
  604. kde_result="$kde_result (cache overridden)"
  605. fi
  606. if test "$kde_have_all_paths" = "no"; then
  607. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  608. Since it had compiled and linked before, it must be a strange problem on your system.
  609. Look at config.log for details. If you are not able to fix this, look at
  610. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  611. (If you're using an egcs version on Linux, you may update binutils!)
  612. ])
  613. else
  614. rm -f conftest*
  615. AC_MSG_RESULT($kde_result)
  616. fi
  617. bindir=$kde_bindir
  618. KDE_SUBST_PROGRAMS
  619. ])
  620. AC_DEFUN([AC_SUBST_KFSSTND],
  621. [
  622. AC_SUBST(kde_htmldir)
  623. AC_SUBST(kde_appsdir)
  624. AC_SUBST(kde_icondir)
  625. AC_SUBST(kde_sounddir)
  626. AC_SUBST(kde_datadir)
  627. AC_SUBST(kde_locale)
  628. AC_SUBST(kde_confdir)
  629. AC_SUBST(kde_kcfgdir)
  630. AC_SUBST(kde_mimedir)
  631. AC_SUBST(kde_wallpaperdir)
  632. AC_SUBST(kde_bindir)
  633. dnl X Desktop Group standards
  634. AC_SUBST(xdg_appsdir)
  635. AC_SUBST(xdg_menudir)
  636. AC_SUBST(xdg_directorydir)
  637. dnl for KDE 2
  638. AC_SUBST(kde_templatesdir)
  639. AC_SUBST(kde_servicesdir)
  640. AC_SUBST(kde_servicetypesdir)
  641. AC_SUBST(kde_moduledir)
  642. AC_SUBST(kdeinitdir, '$(kde_moduledir)')
  643. AC_SUBST(kde_styledir)
  644. AC_SUBST(kde_widgetdir)
  645. if test "$kde_qtver" = 1; then
  646. kde_minidir="$kde_icondir/mini"
  647. else
  648. # for KDE 1 - this breaks KDE2 apps using minidir, but
  649. # that's the plan ;-/
  650. kde_minidir="/dev/null"
  651. fi
  652. dnl AC_SUBST(kde_minidir)
  653. dnl AC_SUBST(kde_cgidir)
  654. dnl AC_SUBST(kde_toolbardir)
  655. ])
  656. AC_DEFUN([KDE_MISC_TESTS],
  657. [
  658. dnl Checks for libraries.
  659. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  660. AC_SUBST(LIBUTIL)
  661. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  662. AC_SUBST(LIBCOMPAT)
  663. kde_have_crypt=
  664. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  665. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  666. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  667. You should install libcrypt from another source or configure with PAM
  668. support])
  669. kde_have_crypt=no
  670. ]))
  671. AC_SUBST(LIBCRYPT)
  672. if test $kde_have_crypt = yes; then
  673. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  674. fi
  675. AC_CHECK_SOCKLEN_T
  676. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  677. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  678. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  679. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  680. fi
  681. AC_CHECK_FUNC(inet_ntoa)
  682. if test $ac_cv_func_inet_ntoa = no; then
  683. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  684. fi
  685. AC_CHECK_FUNC(connect)
  686. if test $ac_cv_func_connect = no; then
  687. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  688. $X_EXTRA_LIBS)
  689. fi
  690. AC_CHECK_FUNC(remove)
  691. if test $ac_cv_func_remove = no; then
  692. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  693. fi
  694. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  695. AC_CHECK_FUNC(shmat, ,
  696. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  697. # more headers that need to be explicitly included on darwin
  698. AC_CHECK_HEADERS(sys/types.h stdint.h)
  699. # sys/bitypes.h is needed for uint32_t and friends on Tru64
  700. AC_CHECK_HEADERS(sys/bitypes.h)
  701. # darwin requires a poll emulation library
  702. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  703. # for some image handling on Mac OS X
  704. AC_CHECK_HEADERS(Carbon/Carbon.h)
  705. # CoreAudio framework
  706. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  707. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  708. FRAMEWORK_COREAUDIO="-Wl,-framework,CoreAudio"
  709. ])
  710. AC_CHECK_RES_INIT
  711. AC_SUBST(LIB_POLL)
  712. AC_SUBST(FRAMEWORK_COREAUDIO)
  713. LIBSOCKET="$X_EXTRA_LIBS"
  714. AC_SUBST(LIBSOCKET)
  715. AC_SUBST(X_EXTRA_LIBS)
  716. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  717. AC_SUBST(LIBUCB)
  718. case $host in dnl this *is* LynxOS specific
  719. *-*-lynxos* )
  720. AC_MSG_CHECKING([LynxOS header file wrappers])
  721. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  722. AC_MSG_RESULT(disabled)
  723. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  724. ;;
  725. esac
  726. KDE_CHECK_TYPES
  727. KDE_CHECK_LIBDL
  728. KDE_CHECK_STRLCPY
  729. KDE_CHECK_PIE_SUPPORT
  730. # darwin needs this to initialize the environment
  731. AC_CHECK_HEADERS(crt_externs.h)
  732. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  733. AH_VERBATIM(_DARWIN_ENVIRON,
  734. [
  735. #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
  736. # include <sys/time.h>
  737. # include <crt_externs.h>
  738. # define environ (*_NSGetEnviron())
  739. #endif
  740. ])
  741. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  742. [
  743. /*
  744. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  745. * that defines bzero.
  746. */
  747. #if defined(_AIX)
  748. #include <strings.h>
  749. #endif
  750. ])
  751. AC_CHECK_FUNCS([vsnprintf snprintf])
  752. AH_VERBATIM(_TRU64,[
  753. /*
  754. * On HP-UX, the declaration of vsnprintf() is needed every time !
  755. */
  756. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  757. #if __STDC__
  758. #include <stdarg.h>
  759. #include <stdlib.h>
  760. #else
  761. #include <varargs.h>
  762. #endif
  763. #ifdef __cplusplus
  764. extern "C"
  765. #endif
  766. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  767. #ifdef __cplusplus
  768. extern "C"
  769. #endif
  770. int snprintf(char *str, size_t n, char const *fmt, ...);
  771. #endif
  772. ])
  773. ])
  774. dnl ------------------------------------------------------------------------
  775. dnl Find the header files and libraries for X-Windows. Extended the
  776. dnl macro AC_PATH_X
  777. dnl ------------------------------------------------------------------------
  778. dnl
  779. AC_DEFUN([K_PATH_X],
  780. [
  781. AC_REQUIRE([KDE_MISC_TESTS])dnl
  782. AC_REQUIRE([KDE_CHECK_LIB64])
  783. AC_ARG_ENABLE(
  784. embedded,
  785. AC_HELP_STRING([--enable-embedded],[link to Qt-embedded, don't use X]),
  786. kde_use_qt_emb=$enableval,
  787. kde_use_qt_emb=no
  788. )
  789. AC_ARG_ENABLE(
  790. qtopia,
  791. AC_HELP_STRING([--enable-qtopia],[link to Qt-embedded, link to the Qtopia Environment]),
  792. kde_use_qt_emb_palm=$enableval,
  793. kde_use_qt_emb_palm=no
  794. )
  795. AC_ARG_ENABLE(
  796. mac,
  797. AC_HELP_STRING([--enable-mac],[link to Qt/Mac (don't use X)]),
  798. kde_use_qt_mac=$enableval,
  799. kde_use_qt_mac=no
  800. )
  801. # used to disable x11-specific stuff on special platforms
  802. AM_CONDITIONAL(include_x11, test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no")
  803. if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
  804. AC_MSG_CHECKING(for X)
  805. AC_CACHE_VAL(kde_cv_have_x,
  806. [# One or both of the vars are not set, and there is no cached value.
  807. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  808. kde_x_includes=NO
  809. else
  810. kde_x_includes=$x_includes
  811. fi
  812. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  813. kde_x_libraries=NO
  814. else
  815. kde_x_libraries=$x_libraries
  816. fi
  817. # below we use the standard autoconf calls
  818. ac_x_libraries=$kde_x_libraries
  819. ac_x_includes=$kde_x_includes
  820. KDE_PATH_X_DIRECT
  821. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  822. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  823. dnl location. The correct location is /usr/lib32 or an undefined value
  824. dnl (the linker is smart enough to pick the correct default library).
  825. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  826. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  827. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  828. dnl x_includes should be left alone.
  829. case "$host" in
  830. mips-sgi-irix6*)
  831. ;;
  832. *-*-solaris*)
  833. ;;
  834. *)
  835. _AC_PATH_X_XMKMF
  836. if test -z "$ac_x_includes"; then
  837. ac_x_includes="."
  838. fi
  839. if test -z "$ac_x_libraries"; then
  840. ac_x_libraries="/usr/lib${kdelibsuff}"
  841. fi
  842. esac
  843. #from now on we use our own again
  844. # when the user already gave --x-includes, we ignore
  845. # what the standard autoconf macros told us.
  846. if test "$kde_x_includes" = NO; then
  847. kde_x_includes=$ac_x_includes
  848. fi
  849. # for --x-libraries too
  850. if test "$kde_x_libraries" = NO; then
  851. kde_x_libraries=$ac_x_libraries
  852. fi
  853. if test "$kde_x_includes" = NO; then
  854. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  855. fi
  856. if test "$kde_x_libraries" = NO; then
  857. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  858. fi
  859. # Record where we found X for the cache.
  860. kde_cv_have_x="have_x=yes \
  861. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  862. ])dnl
  863. eval "$kde_cv_have_x"
  864. if test "$have_x" != yes; then
  865. AC_MSG_RESULT($have_x)
  866. no_x=yes
  867. else
  868. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  869. fi
  870. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  871. X_INCLUDES=""
  872. x_includes="."; dnl better than nothing :-
  873. else
  874. x_includes=$kde_x_includes
  875. X_INCLUDES="-I$x_includes"
  876. fi
  877. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE || test "$kde_x_libraries" = "/usr/lib"; then
  878. X_LDFLAGS=""
  879. x_libraries="/usr/lib"; dnl better than nothing :-
  880. else
  881. x_libraries=$kde_x_libraries
  882. X_LDFLAGS="-L$x_libraries"
  883. fi
  884. all_includes="$X_INCLUDES"
  885. all_libraries="$X_LDFLAGS $LDFLAGS_AS_NEEDED $LDFLAGS_NEW_DTAGS"
  886. # Check for libraries that X11R6 Xt/Xaw programs need.
  887. ac_save_LDFLAGS="$LDFLAGS"
  888. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  889. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  890. # check for ICE first), but we must link in the order -lSM -lICE or
  891. # we get undefined symbols. So assume we have SM if we have ICE.
  892. # These have to be linked with before -lX11, unlike the other
  893. # libraries we check for below, so use a different variable.
  894. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  895. AC_CHECK_LIB(ICE, IceConnectionNumber,
  896. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  897. LDFLAGS="$ac_save_LDFLAGS"
  898. LIB_X11='-lX11 $(LIBSOCKET)'
  899. AC_MSG_CHECKING(for libXext)
  900. AC_CACHE_VAL(kde_cv_have_libXext,
  901. [
  902. kde_ldflags_safe="$LDFLAGS"
  903. kde_libs_safe="$LIBS"
  904. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  905. LIBS="-lXext -lX11 $LIBSOCKET"
  906. AC_TRY_LINK([
  907. #include <stdio.h>
  908. #ifdef STDC_HEADERS
  909. # include <stdlib.h>
  910. #endif
  911. ],
  912. [
  913. printf("hello Xext\n");
  914. ],
  915. kde_cv_have_libXext=yes,
  916. kde_cv_have_libXext=no
  917. )
  918. LDFLAGS=$kde_ldflags_safe
  919. LIBS=$kde_libs_safe
  920. ])
  921. AC_MSG_RESULT($kde_cv_have_libXext)
  922. if test "$kde_cv_have_libXext" = "no"; then
  923. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  924. can't find it itself, we stop here assuming that make wouldn't find
  925. them either.])
  926. fi
  927. LIB_XEXT="-lXext"
  928. QTE_NORTTI=""
  929. elif test "$kde_use_qt_emb" = "yes"; then
  930. dnl We're using QT Embedded
  931. CPPFLAGS=-DQWS
  932. CXXFLAGS="$CXXFLAGS -fno-rtti"
  933. QTE_NORTTI="-fno-rtti -DQWS"
  934. X_PRE_LIBS=""
  935. LIB_X11=""
  936. LIB_XEXT=""
  937. LIB_XRENDER=""
  938. LIBSM=""
  939. X_INCLUDES=""
  940. X_LDFLAGS=""
  941. x_includes=""
  942. x_libraries=""
  943. elif test "$kde_use_qt_mac" = "yes"; then
  944. dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
  945. dnl be included to get the information) --Sam
  946. CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
  947. CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
  948. X_PRE_LIBS=""
  949. LIB_X11=""
  950. LIB_XEXT=""
  951. LIB_XRENDER=""
  952. LIBSM=""
  953. X_INCLUDES=""
  954. X_LDFLAGS=""
  955. x_includes=""
  956. x_libraries=""
  957. fi
  958. AC_SUBST(X_PRE_LIBS)
  959. AC_SUBST(LIB_X11)
  960. AC_SUBST(LIB_XRENDER)
  961. AC_SUBST(LIBSM)
  962. AC_SUBST(X_INCLUDES)
  963. AC_SUBST(X_LDFLAGS)
  964. AC_SUBST(x_includes)
  965. AC_SUBST(x_libraries)
  966. AC_SUBST(QTE_NORTTI)
  967. AC_SUBST(LIB_XEXT)
  968. ])
  969. AC_DEFUN([KDE_PRINT_QT_PROGRAM],
  970. [
  971. AC_REQUIRE([KDE_USE_QT])
  972. cat > conftest.$ac_ext <<EOF
  973. #include "confdefs.h"
  974. #include <qglobal.h>
  975. #include <qapplication.h>
  976. EOF
  977. if test "$kde_qtver" = "2"; then
  978. cat >> conftest.$ac_ext <<EOF
  979. #include <qevent.h>
  980. #include <qstring.h>
  981. #include <qstyle.h>
  982. EOF
  983. if test $kde_qtsubver -gt 0; then
  984. cat >> conftest.$ac_ext <<EOF
  985. #if QT_VERSION < 210
  986. #error 1
  987. #endif
  988. EOF
  989. fi
  990. fi
  991. if test "$kde_qtver" = "3"; then
  992. cat >> conftest.$ac_ext <<EOF
  993. #include <qcursor.h>
  994. #include <qstylefactory.h>
  995. #include <private/qucomextra_p.h>
  996. EOF
  997. fi
  998. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  999. cat >> conftest.$ac_ext <<EOF
  1000. #error 1
  1001. #endif
  1002. int main() {
  1003. EOF
  1004. if test "$kde_qtver" = "2"; then
  1005. cat >> conftest.$ac_ext <<EOF
  1006. QStringList *t = new QStringList();
  1007. Q_UNUSED(t);
  1008. EOF
  1009. if test $kde_qtsubver -gt 0; then
  1010. cat >> conftest.$ac_ext <<EOF
  1011. QString s;
  1012. s.setLatin1("Elvis is alive", 14);
  1013. EOF
  1014. fi
  1015. fi
  1016. if test "$kde_qtver" = "3"; then
  1017. cat >> conftest.$ac_ext <<EOF
  1018. (void)QStyleFactory::create(QString::null);
  1019. QCursor c(Qt::WhatsThisCursor);
  1020. EOF
  1021. fi
  1022. cat >> conftest.$ac_ext <<EOF
  1023. return 0;
  1024. }
  1025. EOF
  1026. ])
  1027. AC_DEFUN([KDE_USE_QT],
  1028. [
  1029. if test -z "$1"; then
  1030. # Current default Qt version: 3.3
  1031. kde_qtver=3
  1032. kde_qtsubver=3
  1033. else
  1034. kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  1035. # following is the check if subversion isnt found in passed argument
  1036. if test "$kde_qtsubver" = "$1"; then
  1037. kde_qtsubver=1
  1038. fi
  1039. kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  1040. if test "$kde_qtver" = "1"; then
  1041. kde_qtsubver=42
  1042. fi
  1043. fi
  1044. if test -z "$2"; then
  1045. if test "$kde_qtver" = "2"; then
  1046. if test $kde_qtsubver -gt 0; then
  1047. kde_qt_minversion=">= Qt 2.2.2"
  1048. else
  1049. kde_qt_minversion=">= Qt 2.0.2"
  1050. fi
  1051. fi
  1052. if test "$kde_qtver" = "3"; then
  1053. if test $kde_qtsubver -gt 0; then
  1054. if test $kde_qtsubver -gt 1; then
  1055. if test $kde_qtsubver -gt 2; then
  1056. kde_qt_minversion=">= Qt 3.3 and < 4.0"
  1057. else
  1058. kde_qt_minversion=">= Qt 3.2 and < 4.0"
  1059. fi
  1060. else
  1061. kde_qt_minversion=">= Qt 3.1 (20021021) and < 4.0"
  1062. fi
  1063. else
  1064. kde_qt_minversion=">= Qt 3.0 and < 4.0"
  1065. fi
  1066. fi
  1067. if test "$kde_qtver" = "1"; then
  1068. kde_qt_minversion=">= 1.42 and < 2.0"
  1069. fi
  1070. else
  1071. kde_qt_minversion="$2"
  1072. fi
  1073. if test -z "$3"; then
  1074. if test $kde_qtver = 3; then
  1075. if test $kde_qtsubver -gt 0; then
  1076. kde_qt_verstring="QT_VERSION >= 0x03@VER@00 && QT_VERSION < 0x040000"
  1077. qtsubver=`echo "00$kde_qtsubver" | sed -e 's,.*\(..\)$,\1,'`
  1078. kde_qt_verstring=`echo $kde_qt_verstring | sed -e "s,@VER@,$qtsubver,"`
  1079. else
  1080. kde_qt_verstring="QT_VERSION >= 300 && QT_VERSION < 0x040000"
  1081. fi
  1082. fi
  1083. if test $kde_qtver = 2; then
  1084. if test $kde_qtsubver -gt 0; then
  1085. kde_qt_verstring="QT_VERSION >= 222"
  1086. else
  1087. kde_qt_verstring="QT_VERSION >= 200"
  1088. fi
  1089. fi
  1090. if test $kde_qtver = 1; then
  1091. kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
  1092. fi
  1093. else
  1094. kde_qt_verstring="$3"
  1095. fi
  1096. if test $kde_qtver = 4; then
  1097. kde_qt_dirs="$QTDIR /usr/lib/qt4 /usr/lib/qt /usr/share/qt4"
  1098. fi
  1099. if test $kde_qtver = 3; then
  1100. kde_qt_dirs="$QTDIR /usr/lib/qt3 /usr/lib/qt /usr/share/qt3"
  1101. fi
  1102. if test $kde_qtver = 2; then
  1103. kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
  1104. fi
  1105. if test $kde_qtver = 1; then
  1106. kde_qt_dirs="$QTDIR /usr/lib/qt"
  1107. fi
  1108. ])
  1109. AC_DEFUN([KDE_CHECK_QT_DIRECT],
  1110. [
  1111. AC_REQUIRE([KDE_USE_QT])
  1112. AC_MSG_CHECKING([if Qt compiles without flags])
  1113. AC_CACHE_VAL(kde_cv_qt_direct,
  1114. [
  1115. AC_LANG_SAVE
  1116. AC_LANG_CPLUSPLUS
  1117. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1118. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1119. ac_cxxflags_safe="$CXXFLAGS"
  1120. ac_ldflags_safe="$LDFLAGS"
  1121. ac_libs_safe="$LIBS"
  1122. CXXFLAGS="$CXXFLAGS -I$qt_includes"
  1123. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1124. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1125. LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
  1126. else
  1127. LIBS="$LIBQT $LIBSOCKET"
  1128. fi
  1129. LD_LIBRARY_PATH=
  1130. export LD_LIBRARY_PATH
  1131. LIBRARY_PATH=
  1132. export LIBRARY_PATH
  1133. KDE_PRINT_QT_PROGRAM
  1134. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1135. kde_cv_qt_direct="yes"
  1136. else
  1137. kde_cv_qt_direct="no"
  1138. echo "configure: failed program was:" >&AC_FD_CC
  1139. cat conftest.$ac_ext >&AC_FD_CC
  1140. fi
  1141. rm -f conftest*
  1142. CXXFLAGS="$ac_cxxflags_safe"
  1143. LDFLAGS="$ac_ldflags_safe"
  1144. LIBS="$ac_libs_safe"
  1145. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1146. export LD_LIBRARY_PATH
  1147. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1148. export LIBRARY_PATH
  1149. AC_LANG_RESTORE
  1150. ])
  1151. if test "$kde_cv_qt_direct" = "yes"; then
  1152. AC_MSG_RESULT(yes)
  1153. $1
  1154. else
  1155. AC_MSG_RESULT(no)
  1156. $2
  1157. fi
  1158. ])
  1159. dnl ------------------------------------------------------------------------
  1160. dnl Try to find the Qt headers and libraries.
  1161. dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
  1162. dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
  1163. dnl ------------------------------------------------------------------------
  1164. dnl
  1165. AC_DEFUN([AC_PATH_QT_1_3],
  1166. [
  1167. AC_REQUIRE([K_PATH_X])
  1168. AC_REQUIRE([KDE_USE_QT])
  1169. AC_REQUIRE([KDE_CHECK_LIB64])
  1170. dnl ------------------------------------------------------------------------
  1171. dnl Add configure flag to enable linking to MT version of Qt library.
  1172. dnl ------------------------------------------------------------------------
  1173. AC_ARG_ENABLE(
  1174. mt,
  1175. AC_HELP_STRING([--disable-mt],[link to non-threaded Qt (deprecated)]),
  1176. kde_use_qt_mt=$enableval,
  1177. [
  1178. if test $kde_qtver = 3; then
  1179. kde_use_qt_mt=yes
  1180. else
  1181. kde_use_qt_mt=no
  1182. fi
  1183. ]
  1184. )
  1185. USING_QT_MT=""
  1186. dnl ------------------------------------------------------------------------
  1187. dnl If we not get --disable-qt-mt then adjust some vars for the host.
  1188. dnl ------------------------------------------------------------------------
  1189. KDE_MT_LDFLAGS=
  1190. KDE_MT_LIBS=
  1191. if test "x$kde_use_qt_mt" = "xyes"; then
  1192. KDE_CHECK_THREADING
  1193. if test "x$kde_use_threading" = "xyes"; then
  1194. CPPFLAGS="$USE_THREADS -DQT_THREAD_SUPPORT $CPPFLAGS"
  1195. KDE_MT_LDFLAGS="$USE_THREADS"
  1196. KDE_MT_LIBS="$LIBPTHREAD"
  1197. else
  1198. kde_use_qt_mt=no
  1199. fi
  1200. fi
  1201. AC_SUBST(KDE_MT_LDFLAGS)
  1202. AC_SUBST(KDE_MT_LIBS)
  1203. kde_qt_was_given=yes
  1204. dnl ------------------------------------------------------------------------
  1205. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  1206. dnl ------------------------------------------------------------------------
  1207. if test -z "$LIBQT_GLOB"; then
  1208. if test "x$kde_use_qt_emb" = "xyes"; then
  1209. LIBQT_GLOB="libqte.*"
  1210. else
  1211. LIBQT_GLOB="libqt.*"
  1212. fi
  1213. fi
  1214. dnl ------------------------------------------------------------
  1215. dnl If we got --enable-embedded then adjust the Qt library name.
  1216. dnl ------------------------------------------------------------
  1217. if test "x$kde_use_qt_emb" = "xyes"; then
  1218. qtlib="qte"
  1219. else
  1220. qtlib="qt"
  1221. fi
  1222. kde_int_qt="-l$qtlib"
  1223. if test -z "$LIBQPE"; then
  1224. dnl ------------------------------------------------------------
  1225. dnl If we got --enable-palmtop then add -lqpe to the link line
  1226. dnl ------------------------------------------------------------
  1227. if test "x$kde_use_qt_emb" = "xyes"; then
  1228. if test "x$kde_use_qt_emb_palm" = "xyes"; then
  1229. LIB_QPE="-lqpe"
  1230. else
  1231. LIB_QPE=""
  1232. fi
  1233. else
  1234. LIB_QPE=""
  1235. fi
  1236. fi
  1237. dnl ------------------------------------------------------------------------
  1238. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  1239. dnl ------------------------------------------------------------------------
  1240. if test "x$kde_use_qt_mt" = "xyes"; then
  1241. LIBQT="-l$qtlib-mt"
  1242. kde_int_qt="-l$qtlib-mt"
  1243. LIBQT_GLOB="lib$qtlib-mt.*"
  1244. USING_QT_MT="using -mt"
  1245. else
  1246. LIBQT="-l$qtlib"
  1247. fi
  1248. if test $kde_qtver != 1; then
  1249. AC_REQUIRE([AC_FIND_PNG])
  1250. AC_REQUIRE([AC_FIND_JPEG])
  1251. LIBQT="$LIBQT $LIBPNG $LIBJPEG"
  1252. fi
  1253. if test $kde_qtver = 3; then
  1254. AC_REQUIRE([KDE_CHECK_LIBDL])
  1255. LIBQT="$LIBQT $LIBDL"
  1256. fi
  1257. AC_MSG_CHECKING([for Qt])
  1258. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1259. LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1260. fi
  1261. ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  1262. qt_libraries=""
  1263. qt_includes=""
  1264. AC_ARG_WITH(qt-dir,
  1265. AC_HELP_STRING([--with-qt-dir=DIR],[where the root of Qt is installed ]),
  1266. [ ac_qt_includes="$withval"/include
  1267. ac_qt_libraries="$withval"/lib${kdelibsuff}
  1268. ac_qt_bindir="$withval"/bin
  1269. ])
  1270. AC_ARG_WITH(qt-includes,
  1271. AC_HELP_STRING([--with-qt-includes=DIR],[where the Qt includes are. ]),
  1272. [
  1273. ac_qt_includes="$withval"
  1274. ])
  1275. kde_qt_libs_given=no
  1276. AC_ARG_WITH(qt-libraries,
  1277. AC_HELP_STRING([--with-qt-libraries=DIR],[where the Qt library is installed.]),
  1278. [ ac_qt_libraries="$withval"
  1279. kde_qt_libs_given=yes
  1280. ])
  1281. AC_CACHE_VAL(ac_cv_have_qt,
  1282. [#try to guess Qt locations
  1283. qt_incdirs=""
  1284. for dir in $kde_qt_dirs; do
  1285. qt_incdirs="$qt_incdirs $dir/include $dir"
  1286. done
  1287. qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/X11R6/include/qt2 /usr/include/qt3 $x_includes"
  1288. if test ! "$ac_qt_includes" = "NO"; then
  1289. qt_incdirs="$ac_qt_includes $qt_incdirs"
  1290. fi
  1291. if test "$kde_qtver" != "1"; then
  1292. kde_qt_header=qstyle.h
  1293. else
  1294. kde_qt_header=qglobal.h
  1295. fi
  1296. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  1297. ac_qt_includes="$qt_incdir"
  1298. qt_libdirs=""
  1299. for dir in $kde_qt_dirs; do
  1300. qt_libdirs="$qt_libdirs $dir/lib${kdelibsuff} $dir"
  1301. done
  1302. qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  1303. if test ! "$ac_qt_libraries" = "NO"; then
  1304. qt_libdir=$ac_qt_libraries
  1305. else
  1306. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  1307. # if the Qt was given, the chance is too big that libqt.* doesn't exist
  1308. qt_libdir=NONE
  1309. for dir in $qt_libdirs; do
  1310. try="ls -1 $dir/${LIBQT_GLOB}"
  1311. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1312. done
  1313. fi
  1314. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1315. if test -e "$a"; then
  1316. LIBQT="$LIBQT ${kde_int_qt}_incremental"
  1317. break
  1318. fi
  1319. done
  1320. ac_qt_libraries="$qt_libdir"
  1321. AC_LANG_SAVE
  1322. AC_LANG_CPLUSPLUS
  1323. ac_cxxflags_safe="$CXXFLAGS"
  1324. ac_ldflags_safe="$LDFLAGS"
  1325. ac_libs_safe="$LIBS"
  1326. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  1327. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1328. LIBS="$LIBS $LIBQT $KDE_MT_LIBS"
  1329. KDE_PRINT_QT_PROGRAM
  1330. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1331. rm -f conftest*
  1332. else
  1333. echo "configure: failed program was:" >&AC_FD_CC
  1334. cat conftest.$ac_ext >&AC_FD_CC
  1335. ac_qt_libraries="NO"
  1336. fi
  1337. rm -f conftest*
  1338. CXXFLAGS="$ac_cxxflags_safe"
  1339. LDFLAGS="$ac_ldflags_safe"
  1340. LIBS="$ac_libs_safe"
  1341. AC_LANG_RESTORE
  1342. if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
  1343. ac_cv_have_qt="have_qt=no"
  1344. ac_qt_notfound=""
  1345. missing_qt_mt=""
  1346. if test "$ac_qt_includes" = NO; then
  1347. if test "$ac_qt_libraries" = NO; then
  1348. ac_qt_notfound="(headers and libraries)";
  1349. else
  1350. ac_qt_notfound="(headers)";
  1351. fi
  1352. else
  1353. if test "x$kde_use_qt_mt" = "xyes"; then
  1354. missing_qt_mt="
  1355. Make sure that you have compiled Qt with thread support!"
  1356. ac_qt_notfound="(library $qtlib-mt)";
  1357. else
  1358. ac_qt_notfound="(library $qtlib)";
  1359. fi
  1360. fi
  1361. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  1362. For more details about this problem, look at the end of config.log.$missing_qt_mt])
  1363. else
  1364. have_qt="yes"
  1365. fi
  1366. ])
  1367. eval "$ac_cv_have_qt"
  1368. if test "$have_qt" != yes; then
  1369. AC_MSG_RESULT([$have_qt]);
  1370. else
  1371. ac_cv_have_qt="have_qt=yes \
  1372. ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
  1373. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
  1374. qt_libraries="$ac_qt_libraries"
  1375. qt_includes="$ac_qt_includes"
  1376. fi
  1377. if test ! "$kde_qt_libs_given" = "yes" && test ! "$kde_qtver" = 3; then
  1378. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  1379. fi
  1380. AC_SUBST(qt_libraries)
  1381. AC_SUBST(qt_includes)
  1382. if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
  1383. QT_INCLUDES=""
  1384. else
  1385. QT_INCLUDES="-I$qt_includes"
  1386. all_includes="$QT_INCLUDES $all_includes"
  1387. fi
  1388. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1389. QT_LDFLAGS=""
  1390. else
  1391. QT_LDFLAGS="-L$qt_libraries"
  1392. all_libraries="$QT_LDFLAGS $all_libraries"
  1393. fi
  1394. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1395. AC_SUBST(QT_INCLUDES)
  1396. AC_SUBST(QT_LDFLAGS)
  1397. AC_PATH_QT_MOC_UIC
  1398. KDE_CHECK_QT_JPEG
  1399. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  1400. LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
  1401. else
  1402. LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBZ) $(LIBPNG)'
  1403. fi
  1404. test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
  1405. for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
  1406. if test -e "$a"; then
  1407. LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
  1408. break
  1409. fi
  1410. done
  1411. AC_SUBST(LIB_QT)
  1412. AC_SUBST(LIB_QPE)
  1413. AC_SUBST(kde_qtver)
  1414. ])
  1415. AC_DEFUN([AC_PATH_QT],
  1416. [
  1417. AC_PATH_QT_1_3
  1418. ])
  1419. AC_DEFUN([KDE_CHECK_UIC_PLUGINS],
  1420. [
  1421. AC_REQUIRE([AC_PATH_QT_MOC_UIC])
  1422. if test x$ac_uic_supports_libpath = xyes; then
  1423. AC_MSG_CHECKING([if UIC has KDE plugins available])
  1424. AC_CACHE_VAL(kde_cv_uic_plugins,
  1425. [
  1426. cat > actest.ui << EOF
  1427. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1428. <class>NewConnectionDialog</class>
  1429. <widget class="QDialog">
  1430. <widget class="KLineEdit">
  1431. <property name="name">
  1432. <cstring>testInput</cstring>
  1433. </property>
  1434. </widget>
  1435. </widget>
  1436. </UI>
  1437. EOF
  1438. kde_cv_uic_plugins=no
  1439. kde_line="$UIC_PATH -L $kde_widgetdir"
  1440. if test x$ac_uic_supports_nounload = xyes; then
  1441. kde_line="$kde_line -nounload"
  1442. fi
  1443. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1444. if AC_TRY_EVAL(kde_line); then
  1445. # if you're trying to debug this check and think it's incorrect,
  1446. # better check your installation. The check _is_ correct - your
  1447. # installation is not.
  1448. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1449. kde_cv_uic_plugins=yes
  1450. fi
  1451. fi
  1452. rm -f actest.ui actest.cpp
  1453. ])
  1454. AC_MSG_RESULT([$kde_cv_uic_plugins])
  1455. if test "$kde_cv_uic_plugins" != yes; then
  1456. AC_MSG_ERROR([
  1457. you need to install kdelibs first.
  1458. If you did install kdelibs, then the Qt version that is picked up by
  1459. this configure is not the same version you used to compile kdelibs.
  1460. The Qt Plugin installed by kdelibs is *ONLY* loadable if it is the
  1461. _same Qt version_, compiled with the _same compiler_ and the same Qt
  1462. configuration settings.
  1463. ])
  1464. fi
  1465. fi
  1466. ])
  1467. AC_DEFUN([KDE_CHECK_FINAL],
  1468. [
  1469. AC_ARG_ENABLE(final,
  1470. AC_HELP_STRING([--enable-final],
  1471. [build size optimized apps (experimental - needs lots of memory)]),
  1472. kde_use_final=$enableval, kde_use_final=no)
  1473. if test "x$kde_use_final" = "xyes"; then
  1474. KDE_USE_FINAL_TRUE=""
  1475. KDE_USE_FINAL_FALSE="#"
  1476. else
  1477. KDE_USE_FINAL_TRUE="#"
  1478. KDE_USE_FINAL_FALSE=""
  1479. fi
  1480. AC_SUBST(KDE_USE_FINAL_TRUE)
  1481. AC_SUBST(KDE_USE_FINAL_FALSE)
  1482. ])
  1483. AC_DEFUN([KDE_CHECK_CLOSURE],
  1484. [
  1485. AC_ARG_ENABLE(closure,
  1486. AC_HELP_STRING([--enable-closure],[delay template instantiation]),
  1487. kde_use_closure=$enableval, kde_use_closure=no)
  1488. KDE_NO_UNDEFINED=""
  1489. if test "x$kde_use_closure" = "xyes"; then
  1490. KDE_USE_CLOSURE_TRUE=""
  1491. KDE_USE_CLOSURE_FALSE="#"
  1492. # CXXFLAGS="$CXXFLAGS $REPO"
  1493. else
  1494. KDE_USE_CLOSURE_TRUE="#"
  1495. KDE_USE_CLOSURE_FALSE=""
  1496. KDE_NO_UNDEFINED=""
  1497. fi
  1498. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1499. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1500. AC_SUBST(KDE_NO_UNDEFINED)
  1501. ])
  1502. dnl Check if the linker supports --enable-new-dtags and --as-needed
  1503. AC_DEFUN([KDE_CHECK_NEW_LDFLAGS],
  1504. [
  1505. AC_ARG_ENABLE(new_ldflags,
  1506. AC_HELP_STRING([--enable-new-ldflags],
  1507. [enable the new linker flags]),
  1508. kde_use_new_ldflags=$enableval,
  1509. kde_use_new_ldflags=no)
  1510. LDFLAGS_AS_NEEDED=""
  1511. LDFLAGS_NEW_DTAGS=""
  1512. if test "x$kde_use_new_ldflags" = "xyes"; then
  1513. LDFLAGS_NEW_DTAGS=""
  1514. KDE_CHECK_COMPILER_FLAG([Wl,--enable-new-dtags],
  1515. [LDFLAGS_NEW_DTAGS="-Wl,--enable-new-dtags"],)
  1516. KDE_CHECK_COMPILER_FLAG([Wl,--as-needed],
  1517. [LDFLAGS_AS_NEEDED="-Wl,--as-needed"],)
  1518. fi
  1519. AC_SUBST(LDFLAGS_AS_NEEDED)
  1520. AC_SUBST(LDFLAGS_NEW_DTAGS)
  1521. ])
  1522. AC_DEFUN([KDE_CHECK_NMCHECK],
  1523. [
  1524. AC_ARG_ENABLE(nmcheck,AC_HELP_STRING([--enable-nmcheck],[enable automatic namespace cleanness check]),
  1525. kde_use_nmcheck=$enableval, kde_use_nmcheck=no)
  1526. if test "$kde_use_nmcheck" = "yes"; then
  1527. KDE_USE_NMCHECK_TRUE=""
  1528. KDE_USE_NMCHECK_FALSE="#"
  1529. else
  1530. KDE_USE_NMCHECK_TRUE="#"
  1531. KDE_USE_NMCHECK_FALSE=""
  1532. fi
  1533. AC_SUBST(KDE_USE_NMCHECK_TRUE)
  1534. AC_SUBST(KDE_USE_NMCHECK_FALSE)
  1535. ])
  1536. AC_DEFUN([KDE_EXPAND_MAKEVAR], [
  1537. savex=$exec_prefix
  1538. test "x$exec_prefix" = xNONE && exec_prefix=$prefix
  1539. tmp=$$2
  1540. while $1=`eval echo "$tmp"`; test "x$$1" != "x$tmp"; do tmp=$$1; done
  1541. exec_prefix=$savex
  1542. ])
  1543. dnl ------------------------------------------------------------------------
  1544. dnl Now, the same with KDE
  1545. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1546. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1547. dnl ------------------------------------------------------------------------
  1548. dnl
  1549. AC_DEFUN([AC_BASE_PATH_KDE],
  1550. [
  1551. AC_REQUIRE([KDE_CHECK_STL])
  1552. AC_REQUIRE([AC_PATH_QT])dnl
  1553. AC_REQUIRE([KDE_CHECK_LIB64])
  1554. AC_CHECK_RPATH
  1555. AC_MSG_CHECKING([for KDE])
  1556. if test "${prefix}" != NONE; then
  1557. kde_includes=${includedir}
  1558. KDE_EXPAND_MAKEVAR(ac_kde_includes, includedir)
  1559. kde_libraries=${libdir}
  1560. KDE_EXPAND_MAKEVAR(ac_kde_libraries, libdir)
  1561. else
  1562. ac_kde_includes=
  1563. ac_kde_libraries=
  1564. kde_libraries=""
  1565. kde_includes=""
  1566. fi
  1567. AC_CACHE_VAL(ac_cv_have_kde,
  1568. [#try to guess kde locations
  1569. if test "$kde_qtver" = 1; then
  1570. kde_check_header="ksock.h"
  1571. kde_check_lib="libkdecore.la"
  1572. else
  1573. kde_check_header="ksharedptr.h"
  1574. kde_check_lib="libkio.la"
  1575. fi
  1576. if test -z "$1"; then
  1577. kde_incdirs="$kde_libs_prefix/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/trinity/include /opt/kde/include $x_includes $qt_includes"
  1578. test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
  1579. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1580. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1581. ac_kde_includes="$kde_incdir"
  1582. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1583. AC_MSG_ERROR([
  1584. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1585. So, check this please and use another prefix!])
  1586. fi
  1587. kde_libdirs="$kde_libs_prefix/lib${kdelibsuff} /usr/lib/kde/lib${kdelibsuff} /usr/local/kde/lib${kdelibsuff} /usr/kde/lib${kdelibsuff} /usr/lib${kdelibsuff}/kde /usr/lib${kdelibsuff}/trinity /usr/lib${kdelibsuff} /usr/X11R6/lib${kdelibsuff} /usr/local/lib${kdelibsuff} /opt/trinity/lib${kdelibsuff} /opt/kde/lib${kdelibsuff} /usr/X11R6/kde/lib${kdelibsuff}"
  1588. test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib${kdelibsuff} $KDEDIR $kde_libdirs"
  1589. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1590. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1591. ac_kde_libraries="$kde_libdir"
  1592. kde_widgetdir=NO
  1593. dnl this might be somewhere else
  1594. AC_FIND_FILE("trinity/plugins/designer/kdewidgets.la", $kde_libdirs, kde_widgetdir)
  1595. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1596. AC_MSG_ERROR([
  1597. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1598. So, check this please and use another prefix!])
  1599. fi
  1600. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/kdewidgets.la"; then
  1601. AC_MSG_ERROR([
  1602. I can't find the designer plugins. These are required and should have been installed
  1603. by kdelibs])
  1604. fi
  1605. if test -n "$kde_widgetdir"; then
  1606. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1607. fi
  1608. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1609. ac_cv_have_kde="have_kde=no"
  1610. else
  1611. ac_cv_have_kde="have_kde=yes \
  1612. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1613. fi
  1614. else dnl test -z $1, e.g. from kdelibs
  1615. ac_cv_have_kde="have_kde=no"
  1616. fi
  1617. ])dnl
  1618. eval "$ac_cv_have_kde"
  1619. if test "$have_kde" != "yes"; then
  1620. if test "${prefix}" = NONE; then
  1621. ac_kde_prefix="$ac_default_prefix"
  1622. else
  1623. ac_kde_prefix="$prefix"
  1624. fi
  1625. if test "$exec_prefix" = NONE; then
  1626. ac_kde_exec_prefix="$ac_kde_prefix"
  1627. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1628. else
  1629. ac_kde_exec_prefix="$exec_prefix"
  1630. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1631. fi
  1632. kde_libraries="${libdir}"
  1633. kde_includes="${includedir}"
  1634. else
  1635. ac_cv_have_kde="have_kde=yes \
  1636. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1637. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1638. kde_libraries="$ac_kde_libraries"
  1639. kde_includes="$ac_kde_includes"
  1640. fi
  1641. AC_SUBST(kde_libraries)
  1642. AC_SUBST(kde_includes)
  1643. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" || test "$kde_includes" = "/usr/include"; then
  1644. KDE_INCLUDES=""
  1645. else
  1646. KDE_INCLUDES="-I$kde_includes"
  1647. all_includes="$KDE_INCLUDES $all_includes"
  1648. fi
  1649. KDE_DEFAULT_CXXFLAGS="-DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION"
  1650. KDE_LDFLAGS="-L$kde_libraries"
  1651. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1652. all_libraries="$KDE_LDFLAGS $all_libraries"
  1653. fi
  1654. AC_SUBST(KDE_LDFLAGS)
  1655. AC_SUBST(KDE_INCLUDES)
  1656. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1657. all_libraries="$all_libraries $USER_LDFLAGS"
  1658. all_includes="$all_includes $USER_INCLUDES"
  1659. AC_SUBST(all_includes)
  1660. AC_SUBST(all_libraries)
  1661. if test -z "$1"; then
  1662. KDE_CHECK_UIC_PLUGINS
  1663. fi
  1664. ac_kde_libraries="$kde_libdir"
  1665. AC_SUBST(AUTODIRS)
  1666. ])
  1667. AC_DEFUN([KDE_CHECK_EXTRA_LIBS],
  1668. [
  1669. AC_MSG_CHECKING(for extra includes)
  1670. AC_ARG_WITH(extra-includes,AC_HELP_STRING([--with-extra-includes=DIR],[adds non standard include paths]),
  1671. kde_use_extra_includes="$withval",
  1672. kde_use_extra_includes=NONE
  1673. )
  1674. kde_extra_includes=
  1675. if test -n "$kde_use_extra_includes" && \
  1676. test "$kde_use_extra_includes" != "NONE"; then
  1677. ac_save_ifs=$IFS
  1678. IFS=':'
  1679. for dir in $kde_use_extra_includes; do
  1680. kde_extra_includes="$kde_extra_includes $dir"
  1681. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1682. done
  1683. IFS=$ac_save_ifs
  1684. kde_use_extra_includes="added"
  1685. else
  1686. kde_use_extra_includes="no"
  1687. fi
  1688. AC_SUBST(USER_INCLUDES)
  1689. AC_MSG_RESULT($kde_use_extra_includes)
  1690. kde_extra_libs=
  1691. AC_MSG_CHECKING(for extra libs)
  1692. AC_ARG_WITH(extra-libs,AC_HELP_STRING([--with-extra-libs=DIR],[adds non standard library paths]),
  1693. kde_use_extra_libs=$withval,
  1694. kde_use_extra_libs=NONE
  1695. )
  1696. if test -n "$kde_use_extra_libs" && \
  1697. test "$kde_use_extra_libs" != "NONE"; then
  1698. ac_save_ifs=$IFS
  1699. IFS=':'
  1700. for dir in $kde_use_extra_libs; do
  1701. kde_extra_libs="$kde_extra_libs $dir"
  1702. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1703. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1704. done
  1705. IFS=$ac_save_ifs
  1706. kde_use_extra_libs="added"
  1707. else
  1708. kde_use_extra_libs="no"
  1709. fi
  1710. AC_SUBST(USER_LDFLAGS)
  1711. AC_MSG_RESULT($kde_use_extra_libs)
  1712. ])
  1713. AC_DEFUN([KDE_1_CHECK_PATH_HEADERS],
  1714. [
  1715. AC_MSG_CHECKING([for KDE headers installed])
  1716. AC_LANG_SAVE
  1717. AC_LANG_CPLUSPLUS
  1718. cat > conftest.$ac_ext <<EOF
  1719. #ifdef STDC_HEADERS
  1720. # include <stdlib.h>
  1721. #endif
  1722. #include <stdio.h>
  1723. #include "confdefs.h"
  1724. #include <kapp.h>
  1725. int main() {
  1726. printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
  1727. printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
  1728. printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
  1729. printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
  1730. printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
  1731. printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
  1732. printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
  1733. printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
  1734. printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
  1735. printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
  1736. printf("kde_wallpaperdir=\\"%s\\"\n",
  1737. KApplication::kde_wallpaperdir().data());
  1738. printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
  1739. printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
  1740. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1741. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1742. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1743. printf("kde_styledir=\\"/tmp/dummy\\"\n");
  1744. printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
  1745. printf("xdg_appsdir=\\"/tmp/dummy\\"\n");
  1746. printf("xdg_menudir=\\"/tmp/dummy\\"\n");
  1747. printf("xdg_directorydir=\\"/tmp/dummy\\"\n");
  1748. printf("kde_kcfgdir=\\"/tmp/dummy\\"\n");
  1749. return 0;
  1750. }
  1751. EOF
  1752. ac_save_CPPFLAGS=$CPPFLAGS
  1753. CPPFLAGS="$all_includes $CPPFLAGS"
  1754. if AC_TRY_EVAL(ac_compile); then
  1755. AC_MSG_RESULT(yes)
  1756. else
  1757. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1758. Check, if you installed the KDE header files correctly.
  1759. For more details about this problem, look at the end of config.log.])
  1760. fi
  1761. CPPFLAGS=$ac_save_CPPFLAGS
  1762. AC_LANG_RESTORE
  1763. ])
  1764. AC_DEFUN([KDE_CHECK_KDEQTADDON],
  1765. [
  1766. AC_MSG_CHECKING(for kde-qt-addon)
  1767. AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
  1768. [
  1769. kde_ldflags_safe="$LDFLAGS"
  1770. kde_libs_safe="$LIBS"
  1771. kde_cxxflags_safe="$CXXFLAGS"
  1772. LIBS="-lkde-qt-addon $LIBQT $LIBS"
  1773. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
  1774. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1775. AC_TRY_LINK([
  1776. #include <qdom.h>
  1777. ],
  1778. [
  1779. QDomDocument doc;
  1780. ],
  1781. kde_cv_have_kdeqtaddon=yes,
  1782. kde_cv_have_kdeqtaddon=no
  1783. )
  1784. LDFLAGS=$kde_ldflags_safe
  1785. LIBS=$kde_libs_safe
  1786. CXXFLAGS=$kde_cxxflags_safe
  1787. ])
  1788. AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
  1789. if test "$kde_cv_have_kdeqtaddon" = "no"; then
  1790. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1791. It is a separate package (and CVS module) named kde-qt-addon.])
  1792. fi
  1793. ])
  1794. AC_DEFUN([KDE_CREATE_LIBS_ALIASES],
  1795. [
  1796. AC_REQUIRE([KDE_MISC_TESTS])
  1797. AC_REQUIRE([KDE_CHECK_LIBDL])
  1798. AC_REQUIRE([K_PATH_X])
  1799. if test $kde_qtver = 3; then
  1800. case $host in
  1801. *cygwin*) lib_kded="-lkdeinit_kded" ;;
  1802. *) lib_kded="" ;;
  1803. esac
  1804. AC_SUBST(LIB_KDED, $lib_kded)
  1805. AC_SUBST(LIB_KDECORE, "-lkdecore")
  1806. AC_SUBST(LIB_KDEUI, "-lkdeui")
  1807. AC_SUBST(LIB_KIO, "-lkio")
  1808. AC_SUBST(LIB_KJS, "-lkjs")
  1809. AC_SUBST(LIB_SMB, "-lsmb")
  1810. AC_SUBST(LIB_KAB, "-lkab")
  1811. AC_SUBST(LIB_KABC, "-lkabc")
  1812. AC_SUBST(LIB_KHTML, "-lkhtml")
  1813. AC_SUBST(LIB_KSPELL, "-lkspell")
  1814. AC_SUBST(LIB_KPARTS, "-lkparts")
  1815. AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
  1816. AC_SUBST(LIB_KUTILS, "-lkutils")
  1817. AC_SUBST(LIB_KDEPIM, "-lkdepim")
  1818. AC_SUBST(LIB_KIMPROXY, "-lkimproxy")
  1819. AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff")
  1820. AC_SUBST(LIB_KDNSSD, "-lkdnssd")
  1821. AC_SUBST(LIB_KUNITTEST, "-lkunittest")
  1822. # these are for backward compatibility
  1823. AC_SUBST(LIB_KSYCOCA, "-lkio")
  1824. AC_SUBST(LIB_KFILE, "-lkio")
  1825. elif test $kde_qtver = 2; then
  1826. AC_SUBST(LIB_KDECORE, "-lkdecore")
  1827. AC_SUBST(LIB_KDEUI, "-lkdeui")
  1828. AC_SUBST(LIB_KIO, "-lkio")
  1829. AC_SUBST(LIB_KSYCOCA, "-lksycoca")
  1830. AC_SUBST(LIB_SMB, "-lsmb")
  1831. AC_SUBST(LIB_KFILE, "-lkfile")
  1832. AC_SUBST(LIB_KAB, "-lkab")
  1833. AC_SUBST(LIB_KHTML, "-lkhtml")
  1834. AC_SUBST(LIB_KSPELL, "-lkspell")
  1835. AC_SUBST(LIB_KPARTS, "-lkparts")
  1836. AC_SUBST(LIB_KDEPRINT, "-lkdeprint")
  1837. else
  1838. AC_SUBST(LIB_KDECORE, "-lkdecore -lXext $(LIB_QT)")
  1839. AC_SUBST(LIB_KDEUI, "-lkdeui $(LIB_KDECORE)")
  1840. AC_SUBST(LIB_KFM, "-lkfm $(LIB_KDECORE)")
  1841. AC_SUBST(LIB_KFILE, "-lkfile $(LIB_KFM) $(LIB_KDEUI)")
  1842. AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_KDECORE)")
  1843. fi
  1844. ])
  1845. AC_DEFUN([AC_PATH_KDE],
  1846. [
  1847. AC_BASE_PATH_KDE
  1848. AC_ARG_ENABLE(path-check,AC_HELP_STRING([--disable-path-check],[don't try to find out, where to install]),
  1849. [
  1850. if test "$enableval" = "no";
  1851. then ac_use_path_checking="default"
  1852. else ac_use_path_checking=""
  1853. fi
  1854. ],
  1855. [
  1856. if test "$kde_qtver" = 1;
  1857. then ac_use_path_checking=""
  1858. else ac_use_path_checking="default"
  1859. fi
  1860. ]
  1861. )
  1862. AC_CREATE_KFSSTND($ac_use_path_checking)
  1863. AC_SUBST_KFSSTND
  1864. KDE_CREATE_LIBS_ALIASES
  1865. ])
  1866. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  1867. AC_DEFUN([KDE_CHECK_FUNC_EXT],
  1868. [
  1869. AC_MSG_CHECKING(for $1)
  1870. AC_CACHE_VAL(kde_cv_func_$1,
  1871. [
  1872. AC_LANG_SAVE
  1873. AC_LANG_CPLUSPLUS
  1874. save_CXXFLAGS="$CXXFLAGS"
  1875. kde_safe_LIBS="$LIBS"
  1876. LIBS="$LIBS $X_EXTRA_LIBS"
  1877. AC_TRY_COMPILE([
  1878. $2
  1879. ],
  1880. [
  1881. $3
  1882. ],
  1883. kde_cv_func_$1=yes,
  1884. kde_cv_func_$1=no)
  1885. CXXFLAGS="$save_CXXFLAGS"
  1886. LIBS="$kde_safe_LIBS"
  1887. AC_LANG_RESTORE
  1888. ])
  1889. AC_MSG_RESULT($kde_cv_func_$1)
  1890. AC_MSG_CHECKING([if $1 needs custom prototype])
  1891. AC_CACHE_VAL(kde_cv_proto_$1,
  1892. [
  1893. if test "x$kde_cv_func_$1" = xyes; then
  1894. kde_cv_proto_$1=no
  1895. else
  1896. case "$1" in
  1897. setenv|unsetenv|usleep|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  1898. kde_cv_proto_$1="yes - in libkdefakes"
  1899. ;;
  1900. *)
  1901. kde_cv_proto_$1=unknown
  1902. ;;
  1903. esac
  1904. fi
  1905. if test "x$kde_cv_proto_$1" = xunknown; then
  1906. AC_LANG_SAVE
  1907. AC_LANG_CPLUSPLUS
  1908. kde_safe_libs=$LIBS
  1909. LIBS="$LIBS $X_EXTRA_LIBS"
  1910. AC_TRY_LINK([
  1911. $2
  1912. extern "C" $4;
  1913. ],
  1914. [
  1915. $3
  1916. ],
  1917. [ kde_cv_func_$1=yes
  1918. kde_cv_proto_$1=yes ],
  1919. [kde_cv_proto_$1="$1 unavailable"]
  1920. )
  1921. LIBS=$kde_safe_libs
  1922. AC_LANG_RESTORE
  1923. fi
  1924. ])
  1925. AC_MSG_RESULT($kde_cv_proto_$1)
  1926. if test "x$kde_cv_func_$1" = xyes; then
  1927. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  1928. $6
  1929. fi
  1930. if test "x$kde_cv_proto_$1" = xno; then
  1931. AC_DEFINE(HAVE_$5_PROTO, 1,
  1932. [Define if you have the $1 prototype])
  1933. fi
  1934. AH_VERBATIM([_HAVE_$5_PROTO],
  1935. [
  1936. #if !defined(HAVE_$5_PROTO)
  1937. #ifdef __cplusplus
  1938. extern "C" {
  1939. #endif
  1940. $4;
  1941. #ifdef __cplusplus
  1942. }
  1943. #endif
  1944. #endif
  1945. ])
  1946. ])
  1947. AC_DEFUN([AC_CHECK_SETENV],
  1948. [
  1949. KDE_CHECK_FUNC_EXT(setenv, [
  1950. #include <stdlib.h>
  1951. ],
  1952. [setenv("VAR", "VALUE", 1);],
  1953. [int setenv (const char *, const char *, int)],
  1954. [SETENV])
  1955. ])
  1956. AC_DEFUN([AC_CHECK_UNSETENV],
  1957. [
  1958. KDE_CHECK_FUNC_EXT(unsetenv, [
  1959. #include <stdlib.h>
  1960. ],
  1961. [unsetenv("VAR");],
  1962. [void unsetenv (const char *)],
  1963. [UNSETENV])
  1964. ])
  1965. AC_DEFUN([AC_CHECK_GETDOMAINNAME],
  1966. [
  1967. KDE_CHECK_FUNC_EXT(getdomainname, [
  1968. #include <stdlib.h>
  1969. #include <unistd.h>
  1970. #include <netdb.h>
  1971. ],
  1972. [
  1973. char buffer[200];
  1974. getdomainname(buffer, 200);
  1975. ],
  1976. [#include <sys/types.h>
  1977. int getdomainname (char *, size_t)],
  1978. [GETDOMAINNAME])
  1979. ])
  1980. AC_DEFUN([AC_CHECK_GETHOSTNAME],
  1981. [
  1982. KDE_CHECK_FUNC_EXT(gethostname, [
  1983. #include <stdlib.h>
  1984. #include <unistd.h>
  1985. ],
  1986. [
  1987. char buffer[200];
  1988. gethostname(buffer, 200);
  1989. ],
  1990. [int gethostname (char *, unsigned int)],
  1991. [GETHOSTNAME])
  1992. ])
  1993. AC_DEFUN([AC_CHECK_USLEEP],
  1994. [
  1995. KDE_CHECK_FUNC_EXT(usleep, [
  1996. #include <unistd.h>
  1997. ],
  1998. [
  1999. usleep(200);
  2000. ],
  2001. [int usleep (unsigned int)],
  2002. [USLEEP])
  2003. ])
  2004. AC_DEFUN([AC_CHECK_RANDOM],
  2005. [
  2006. KDE_CHECK_FUNC_EXT(random, [
  2007. #include <stdlib.h>
  2008. ],
  2009. [
  2010. random();
  2011. ],
  2012. [long int random(void)],
  2013. [RANDOM])
  2014. KDE_CHECK_FUNC_EXT(srandom, [
  2015. #include <stdlib.h>
  2016. ],
  2017. [
  2018. srandom(27);
  2019. ],
  2020. [void srandom(unsigned int)],
  2021. [SRANDOM])
  2022. ])
  2023. AC_DEFUN([AC_CHECK_INITGROUPS],
  2024. [
  2025. KDE_CHECK_FUNC_EXT(initgroups, [
  2026. #include <sys/types.h>
  2027. #include <unistd.h>
  2028. #include <grp.h>
  2029. ],
  2030. [
  2031. char buffer[200];
  2032. initgroups(buffer, 27);
  2033. ],
  2034. [int initgroups(const char *, gid_t)],
  2035. [INITGROUPS])
  2036. ])
  2037. AC_DEFUN([AC_CHECK_MKSTEMPS],
  2038. [
  2039. KDE_CHECK_FUNC_EXT(mkstemps, [
  2040. #include <stdlib.h>
  2041. #include <unistd.h>
  2042. ],
  2043. [
  2044. mkstemps("/tmp/aaaXXXXXX", 6);
  2045. ],
  2046. [int mkstemps(char *, int)],
  2047. [MKSTEMPS])
  2048. ])
  2049. AC_DEFUN([AC_CHECK_MKSTEMP],
  2050. [
  2051. KDE_CHECK_FUNC_EXT(mkstemp, [
  2052. #include <stdlib.h>
  2053. #include <unistd.h>
  2054. ],
  2055. [
  2056. mkstemp("/tmp/aaaXXXXXX");
  2057. ],
  2058. [int mkstemp(char *)],
  2059. [MKSTEMP])
  2060. ])
  2061. AC_DEFUN([AC_CHECK_MKDTEMP],
  2062. [
  2063. KDE_CHECK_FUNC_EXT(mkdtemp, [
  2064. #include <stdlib.h>
  2065. #include <unistd.h>
  2066. ],
  2067. [
  2068. mkdtemp("/tmp/aaaXXXXXX");
  2069. ],
  2070. [char *mkdtemp(char *)],
  2071. [MKDTEMP])
  2072. ])
  2073. AC_DEFUN([AC_CHECK_RES_INIT],
  2074. [
  2075. AC_MSG_CHECKING([if res_init needs -lresolv])
  2076. kde_libs_safe="$LIBS"
  2077. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  2078. AC_TRY_LINK(
  2079. [
  2080. #include <sys/types.h>
  2081. #include <netinet/in.h>
  2082. #include <arpa/nameser.h>
  2083. #include <resolv.h>
  2084. ],
  2085. [
  2086. res_init();
  2087. ],
  2088. [
  2089. LIBRESOLV="-lresolv"
  2090. AC_MSG_RESULT(yes)
  2091. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  2092. ],
  2093. [ AC_MSG_RESULT(no) ]
  2094. )
  2095. LIBS=$kde_libs_safe
  2096. AC_SUBST(LIBRESOLV)
  2097. KDE_CHECK_FUNC_EXT(res_init,
  2098. [
  2099. #include <sys/types.h>
  2100. #include <netinet/in.h>
  2101. #include <arpa/nameser.h>
  2102. #include <resolv.h>
  2103. ],
  2104. [res_init()],
  2105. [int res_init(void)],
  2106. [RES_INIT])
  2107. ])
  2108. AC_DEFUN([AC_CHECK_STRLCPY],
  2109. [
  2110. KDE_CHECK_FUNC_EXT(strlcpy, [
  2111. #include <string.h>
  2112. ],
  2113. [ char buf[20];
  2114. strlcpy(buf, "KDE function test", sizeof(buf));
  2115. ],
  2116. [unsigned long strlcpy(char*, const char*, unsigned long)],
  2117. [STRLCPY])
  2118. ])
  2119. AC_DEFUN([AC_CHECK_STRLCAT],
  2120. [
  2121. KDE_CHECK_FUNC_EXT(strlcat, [
  2122. #include <string.h>
  2123. ],
  2124. [ char buf[20];
  2125. buf[0]='\0';
  2126. strlcat(buf, "KDE function test", sizeof(buf));
  2127. ],
  2128. [unsigned long strlcat(char*, const char*, unsigned long)],
  2129. [STRLCAT])
  2130. ])
  2131. AC_DEFUN([AC_CHECK_RES_QUERY],
  2132. [
  2133. KDE_CHECK_FUNC_EXT(res_query, [
  2134. #include <sys/types.h>
  2135. #include <netinet/in.h>
  2136. #include <arpa/nameser.h>
  2137. #include <resolv.h>
  2138. #include <netdb.h>
  2139. ],
  2140. [
  2141. res_query(NULL, 0, 0, NULL, 0);
  2142. ],
  2143. [int res_query(const char *, int, int, unsigned char *, int)],
  2144. [RES_QUERY])
  2145. ])
  2146. AC_DEFUN([AC_CHECK_DN_SKIPNAME],
  2147. [
  2148. KDE_CHECK_FUNC_EXT(dn_skipname, [
  2149. #include <sys/types.h>
  2150. #include <netinet/in.h>
  2151. #include <arpa/nameser.h>
  2152. #include <resolv.h>
  2153. ],
  2154. [
  2155. dn_skipname (NULL, NULL);
  2156. ],
  2157. [int dn_skipname (unsigned char *, unsigned char *)],
  2158. [DN_SKIPNAME])
  2159. ])
  2160. AC_DEFUN([AC_FIND_GIF],
  2161. [AC_MSG_CHECKING([for giflib])
  2162. AC_CACHE_VAL(ac_cv_lib_gif,
  2163. [ac_save_LIBS="$LIBS"
  2164. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2165. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2166. else
  2167. LIBS="$all_libraries -lgif"
  2168. fi
  2169. AC_TRY_LINK(dnl
  2170. [
  2171. #ifdef __cplusplus
  2172. extern "C" {
  2173. #endif
  2174. int GifLastError(void);
  2175. #ifdef __cplusplus
  2176. }
  2177. #endif
  2178. /* We use char because int might match the return type of a gcc2
  2179. builtin and then its argument prototype would still apply. */
  2180. ],
  2181. [return GifLastError();],
  2182. eval "ac_cv_lib_gif=yes",
  2183. eval "ac_cv_lib_gif=no")
  2184. LIBS="$ac_save_LIBS"
  2185. ])dnl
  2186. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2187. AC_MSG_RESULT(yes)
  2188. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2189. else
  2190. AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
  2191. fi
  2192. ])
  2193. AC_DEFUN([KDE_FIND_JPEG_HELPER],
  2194. [
  2195. AC_MSG_CHECKING([for libjpeg$2])
  2196. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2197. [
  2198. ac_save_LIBS="$LIBS"
  2199. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2200. ac_save_CFLAGS="$CFLAGS"
  2201. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2202. AC_TRY_LINK(
  2203. [
  2204. #ifdef __cplusplus
  2205. extern "C" {
  2206. #endif
  2207. void jpeg_CreateDecompress();
  2208. #ifdef __cplusplus
  2209. }
  2210. #endif
  2211. ],
  2212. [jpeg_CreateDecompress();],
  2213. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2214. eval "ac_cv_lib_jpeg_$1=no")
  2215. LIBS="$ac_save_LIBS"
  2216. CFLAGS="$ac_save_CFLAGS"
  2217. ])
  2218. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2219. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2220. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2221. else
  2222. AC_MSG_RESULT(no)
  2223. $3
  2224. fi
  2225. ])
  2226. AC_DEFUN([AC_FIND_JPEG],
  2227. [
  2228. dnl first look for libraries
  2229. KDE_FIND_JPEG_HELPER(6b, 6b,
  2230. KDE_FIND_JPEG_HELPER(normal, [],
  2231. [
  2232. LIBJPEG=
  2233. ]
  2234. )
  2235. )
  2236. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2237. dnl requires system dependent includes loaded before it)
  2238. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2239. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2240. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2241. dnl if headers _and_ libraries are missing, this is no error, and we
  2242. dnl continue with a warning (the user will get no jpeg support in khtml)
  2243. dnl if only one is missing, it means a configuration error, but we still
  2244. dnl only warn
  2245. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2246. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2247. else
  2248. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2249. AC_MSG_WARN([
  2250. There is an installation error in jpeg support. You seem to have only one
  2251. of either the headers _or_ the libraries installed. You may need to either
  2252. provide correct --with-extra-... options, or the development package of
  2253. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2254. Disabling JPEG support.
  2255. ])
  2256. else
  2257. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2258. fi
  2259. jpeg_incdir=
  2260. LIBJPEG=
  2261. fi
  2262. AC_SUBST(LIBJPEG)
  2263. AH_VERBATIM(_AC_CHECK_JPEG,
  2264. [/*
  2265. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2266. * headers and I'm too lazy to write a configure test as long as only
  2267. * unixware is related
  2268. */
  2269. #ifdef _UNIXWARE
  2270. #define HAVE_BOOLEAN
  2271. #endif
  2272. ])
  2273. ])
  2274. AC_DEFUN([KDE_CHECK_QT_JPEG],
  2275. [
  2276. if test -n "$LIBJPEG"; then
  2277. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2278. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2279. [
  2280. AC_LANG_SAVE
  2281. AC_LANG_CPLUSPLUS
  2282. ac_save_LIBS="$LIBS"
  2283. LIBS="$all_libraries $USER_LDFLAGS $LIBQT"
  2284. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2285. ac_save_CXXFLAGS="$CXXFLAGS"
  2286. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2287. AC_TRY_LINK(
  2288. [#include <qapplication.h>],
  2289. [
  2290. int argc;
  2291. char** argv;
  2292. QApplication app(argc, argv);],
  2293. eval "kde_cv_qt_jpeg=no",
  2294. eval "kde_cv_qt_jpeg=yes")
  2295. LIBS="$ac_save_LIBS"
  2296. CXXFLAGS="$ac_save_CXXFLAGS"
  2297. AC_LANG_RESTORE
  2298. fi
  2299. ])
  2300. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2301. AC_MSG_RESULT(yes)
  2302. LIBJPEG_QT='$(LIBJPEG)'
  2303. else
  2304. AC_MSG_RESULT(no)
  2305. LIBJPEG_QT=
  2306. fi
  2307. ])
  2308. AC_DEFUN([AC_FIND_ZLIB],
  2309. [
  2310. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2311. AC_MSG_CHECKING([for libz])
  2312. AC_CACHE_VAL(ac_cv_lib_z,
  2313. [
  2314. kde_save_LIBS="$LIBS"
  2315. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2316. kde_save_CFLAGS="$CFLAGS"
  2317. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2318. AC_TRY_LINK(dnl
  2319. [
  2320. #include<zlib.h>
  2321. ],
  2322. [
  2323. char buf[42];
  2324. gzFile f = (gzFile) 0;
  2325. /* this would segfault.. but we only link, don't run */
  2326. (void) gzgets(f, buf, sizeof(buf));
  2327. return (zlibVersion() == ZLIB_VERSION);
  2328. ],
  2329. eval "ac_cv_lib_z='-lz'",
  2330. eval "ac_cv_lib_z=no")
  2331. LIBS="$kde_save_LIBS"
  2332. CFLAGS="$kde_save_CFLAGS"
  2333. ])dnl
  2334. if test ! "$ac_cv_lib_z" = no; then
  2335. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2336. LIBZ="$ac_cv_lib_z"
  2337. AC_MSG_RESULT($ac_cv_lib_z)
  2338. else
  2339. AC_MSG_ERROR(not found.
  2340. Possibly configure picks up an outdated version
  2341. installed by XFree86. Remove it from your system.
  2342. Check your installation and look into config.log)
  2343. LIBZ=""
  2344. fi
  2345. AC_SUBST(LIBZ)
  2346. ])
  2347. AC_DEFUN([KDE_TRY_TIFFLIB],
  2348. [
  2349. AC_MSG_CHECKING([for libtiff $1])
  2350. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2351. [
  2352. AC_LANG_SAVE
  2353. AC_LANG_CPLUSPLUS
  2354. kde_save_LIBS="$LIBS"
  2355. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2356. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2357. else
  2358. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2359. fi
  2360. kde_save_CXXFLAGS="$CXXFLAGS"
  2361. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2362. AC_TRY_LINK(dnl
  2363. [
  2364. #include<tiffio.h>
  2365. ],
  2366. [return (TIFFOpen( "", "r") == 0); ],
  2367. [
  2368. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2369. ], [
  2370. kde_cv_libtiff_$1=no
  2371. ])
  2372. LIBS="$kde_save_LIBS"
  2373. CXXFLAGS="$kde_save_CXXFLAGS"
  2374. AC_LANG_RESTORE
  2375. ])
  2376. if test "$kde_cv_libtiff_$1" = "no"; then
  2377. AC_MSG_RESULT(no)
  2378. LIBTIFF=""
  2379. $3
  2380. else
  2381. LIBTIFF="$kde_cv_libtiff_$1"
  2382. AC_MSG_RESULT(yes)
  2383. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2384. $2
  2385. fi
  2386. ])
  2387. AC_DEFUN([AC_FIND_TIFF],
  2388. [
  2389. AC_REQUIRE([K_PATH_X])
  2390. AC_REQUIRE([AC_FIND_ZLIB])
  2391. AC_REQUIRE([AC_FIND_JPEG])
  2392. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2393. KDE_TRY_TIFFLIB(tiff, [],
  2394. KDE_TRY_TIFFLIB(tiff34))
  2395. AC_SUBST(LIBTIFF)
  2396. ])
  2397. AC_DEFUN([KDE_FIND_LIBEXR],
  2398. [
  2399. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2400. AC_REQUIRE([AC_FIND_ZLIB])
  2401. AC_CACHE_VAL(ac_cv_libexr,
  2402. [
  2403. if test -z "$PKG_CONFIG"; then
  2404. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  2405. fi
  2406. AC_MSG_CHECKING([for OpenEXR libraries])
  2407. if test "$PKG_CONFIG" = "no" ; then
  2408. AC_MSG_RESULT(no)
  2409. echo "*** The pkg-config script could not be found. Make sure it is"
  2410. echo "*** in your path, or set the PKG_CONFIG environment variable"
  2411. echo "*** to the full path to pkg-config."
  2412. echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
  2413. else
  2414. if !(`$PKG_CONFIG --exists OpenEXR`) ; then
  2415. AC_MSG_RESULT(no)
  2416. EXRSTATUS=no
  2417. else
  2418. if !(`$PKG_CONFIG --atleast-version="1.1.1" OpenEXR`) ; then
  2419. AC_MSG_RESULT(no)
  2420. EXRSTATUS=old
  2421. else
  2422. kde_save_LIBS="$LIBS"
  2423. LIBS="$LIBS $all_libraries $USER_LDFLAGS `pkg-config --libs OpenEXR` $LIBZ"
  2424. AC_LANG_SAVE
  2425. AC_LANG_CPLUSPLUS
  2426. kde_save_CXXFLAGS="$CXXFLAGS"
  2427. EXR_FLAGS=`$PKG_CONFIG --cflags OpenEXR`
  2428. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES $EXR_FLAGS"
  2429. AC_TRY_LINK(dnl
  2430. [
  2431. #include <ImfRgbaFile.h>
  2432. ],
  2433. [
  2434. using namespace Imf;
  2435. RgbaInputFile file ("dummy");
  2436. return 0;
  2437. ],
  2438. eval "ac_cv_libexr='`pkg-config --libs OpenEXR`'",
  2439. eval "ac_cv_libexr=no"
  2440. )
  2441. LIBS="$kde_save_LIBS"
  2442. CXXFLAGS="$kde_save_CXXFLAGS"
  2443. AC_LANG_RESTORE
  2444. ])dnl
  2445. if eval "test ! \"`echo $ac_cv_libexr`\" = no"; then
  2446. AC_DEFINE_UNQUOTED(HAVE_EXR, 1, [Define if you have OpenEXR])
  2447. LIB_EXR="$ac_cv_libexr"
  2448. AC_MSG_RESULT($ac_cv_libexr)
  2449. else
  2450. AC_MSG_RESULT(no)
  2451. LIB_EXR=""
  2452. fi
  2453. fi
  2454. fi
  2455. fi
  2456. AC_SUBST(LIB_EXR)
  2457. AC_SUBST(EXR_FLAGS)
  2458. ])
  2459. AC_DEFUN([AC_FIND_PNG],
  2460. [
  2461. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2462. AC_REQUIRE([AC_FIND_ZLIB])
  2463. AC_MSG_CHECKING([for libpng])
  2464. AC_CACHE_VAL(ac_cv_lib_png,
  2465. [
  2466. kde_save_LIBS="$LIBS"
  2467. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  2468. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2469. else
  2470. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2471. fi
  2472. kde_save_CFLAGS="$CFLAGS"
  2473. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2474. AC_TRY_LINK(dnl
  2475. [
  2476. #include<png.h>
  2477. ],
  2478. [
  2479. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2480. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2481. return( png_ptr != 0 );
  2482. ],
  2483. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2484. eval "ac_cv_lib_png=no"
  2485. )
  2486. LIBS="$kde_save_LIBS"
  2487. CFLAGS="$kde_save_CFLAGS"
  2488. ])dnl
  2489. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2490. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2491. LIBPNG="$ac_cv_lib_png"
  2492. AC_SUBST(LIBPNG)
  2493. AC_MSG_RESULT($ac_cv_lib_png)
  2494. else
  2495. AC_MSG_RESULT(no)
  2496. LIBPNG=""
  2497. AC_SUBST(LIBPNG)
  2498. fi
  2499. ])
  2500. AC_DEFUN([AC_FIND_JASPER],
  2501. [
  2502. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2503. AC_REQUIRE([AC_FIND_JPEG])
  2504. AC_MSG_CHECKING([for jasper])
  2505. AC_CACHE_VAL(ac_cv_jasper,
  2506. [
  2507. kde_save_LIBS="$LIBS"
  2508. LIBS="$LIBS $all_libraries $USER_LDFLAGS -ljasper $LIBJPEG -lm"
  2509. kde_save_CFLAGS="$CFLAGS"
  2510. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2511. AC_TRY_LINK(dnl
  2512. [
  2513. #include<jasper/jasper.h>
  2514. ],
  2515. [
  2516. return( jas_init() );
  2517. ],
  2518. eval "ac_cv_jasper='-ljasper $LIBJPEG -lm'",
  2519. eval "ac_cv_jasper=no"
  2520. )
  2521. LIBS="$kde_save_LIBS"
  2522. CFLAGS="$kde_save_CFLAGS"
  2523. ])dnl
  2524. if eval "test ! \"`echo $ac_cv_jasper`\" = no"; then
  2525. AC_DEFINE_UNQUOTED(HAVE_JASPER, 1, [Define if you have jasper])
  2526. LIB_JASPER="$ac_cv_jasper"
  2527. AC_MSG_RESULT($ac_cv_jasper)
  2528. else
  2529. AC_MSG_RESULT(no)
  2530. LIB_JASPER=""
  2531. fi
  2532. AC_SUBST(LIB_JASPER)
  2533. ])
  2534. AC_DEFUN([AC_CHECK_BOOL],
  2535. [
  2536. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2537. ])
  2538. AC_DEFUN([AC_CHECK_GNU_EXTENSIONS],
  2539. [
  2540. AC_MSG_CHECKING(if you need GNU extensions)
  2541. AC_CACHE_VAL(ac_cv_gnu_extensions,
  2542. [
  2543. cat > conftest.c << EOF
  2544. #include <features.h>
  2545. #ifdef __GNU_LIBRARY__
  2546. yes
  2547. #endif
  2548. EOF
  2549. if (eval "$ac_cpp conftest.c") 2>&5 |
  2550. egrep "yes" >/dev/null 2>&1; then
  2551. rm -rf conftest*
  2552. ac_cv_gnu_extensions=yes
  2553. else
  2554. ac_cv_gnu_extensions=no
  2555. fi
  2556. ])
  2557. AC_MSG_RESULT($ac_cv_gnu_extensions)
  2558. if test "$ac_cv_gnu_extensions" = "yes"; then
  2559. AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
  2560. fi
  2561. ])
  2562. AC_DEFUN([KDE_CHECK_COMPILER_FLAG],
  2563. [
  2564. AC_MSG_CHECKING([whether $CXX supports -$1])
  2565. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2566. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2567. [
  2568. AC_LANG_SAVE
  2569. AC_LANG_CPLUSPLUS
  2570. save_CXXFLAGS="$CXXFLAGS"
  2571. CXXFLAGS="$CXXFLAGS -$1"
  2572. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2573. CXXFLAGS="$save_CXXFLAGS"
  2574. AC_LANG_RESTORE
  2575. ])
  2576. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2577. AC_MSG_RESULT(yes)
  2578. :
  2579. $2
  2580. else
  2581. AC_MSG_RESULT(no)
  2582. :
  2583. $3
  2584. fi
  2585. ])
  2586. AC_DEFUN([KDE_CHECK_C_COMPILER_FLAG],
  2587. [
  2588. AC_MSG_CHECKING([whether $CC supports -$1])
  2589. kde_cache=`echo $1 | sed 'y% .=/+-,%____p__%'`
  2590. AC_CACHE_VAL(kde_cv_prog_cc_$kde_cache,
  2591. [
  2592. AC_LANG_SAVE
  2593. AC_LANG_C
  2594. save_CFLAGS="$CFLAGS"
  2595. CFLAGS="$CFLAGS -$1"
  2596. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cc_$kde_cache=yes"], [])
  2597. CFLAGS="$save_CFLAGS"
  2598. AC_LANG_RESTORE
  2599. ])
  2600. if eval "test \"`echo '$kde_cv_prog_cc_'$kde_cache`\" = yes"; then
  2601. AC_MSG_RESULT(yes)
  2602. :
  2603. $2
  2604. else
  2605. AC_MSG_RESULT(no)
  2606. :
  2607. $3
  2608. fi
  2609. ])
  2610. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2611. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2612. dnl it's all white-space separated
  2613. AC_DEFUN([AC_REMOVE_FORBIDDEN],
  2614. [ __val=$$1
  2615. __forbid=" $2 "
  2616. if test -n "$__val"; then
  2617. __new=""
  2618. ac_save_IFS=$IFS
  2619. IFS=" "
  2620. for i in $__val; do
  2621. case "$__forbid" in
  2622. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2623. *) # Careful to not add spaces, where there were none, because otherwise
  2624. # libtool gets confused, if we change e.g. CXX
  2625. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2626. esac
  2627. done
  2628. IFS=$ac_save_IFS
  2629. $1=$__new
  2630. fi
  2631. ])
  2632. AC_DEFUN([KDE_CHECK_FOR_BAD_COMPILER],
  2633. [
  2634. AC_MSG_CHECKING([whether $CC is blacklisted])
  2635. dnl In theory we have tu run this test against $CC and $CXX
  2636. dnl in C and in C++ mode, because its perfectly legal for
  2637. dnl the user to mix compiler versions, since C has a defined
  2638. dnl ABI.
  2639. dnl
  2640. dnl For now, we assume the user is not on crack.
  2641. AC_TRY_COMPILE([
  2642. #ifdef __GNUC__
  2643. #if __GNUC__ == 4 && __GNUC_MINOR__ == 0 && __GNUC_PATCHLEVEL__ == 0
  2644. choke me
  2645. #endif
  2646. #endif
  2647. ], ,
  2648. kde_bad_compiler=no,
  2649. kde_bad_compiler=yes
  2650. )
  2651. AC_MSG_RESULT($kde_bad_compiler)
  2652. if test "$kde_bad_compiler" = "yes"; then
  2653. AC_MSG_ERROR([
  2654. This particular compiler version is blacklisted because it
  2655. is known to miscompile KDE. Please use a newer version, or
  2656. if that is not yet available, choose an older version.
  2657. Please do not report a bug or bother us reporting this
  2658. configure error. We know about it, and we introduced
  2659. it by intention to avoid untraceable bugs or crashes in KDE.
  2660. ])
  2661. fi
  2662. ])
  2663. AC_DEFUN([KDE_CHECK_FOR_OPT_NOINLINE_MATCH],
  2664. [
  2665. AC_CACHE_CHECK([whether system headers can cope with -O2 -fno-inline],
  2666. kde_cv_opt_noinline_match,
  2667. [
  2668. kde_cv_opt_noinline_match=irrelevant
  2669. dnl if we don't use both -O2 and -fno-inline, this check is moot
  2670. if echo "$CFLAGS" | grep -e -O2 >/dev/null 2>/dev/null \
  2671. && echo "$CFLAGS" | grep -e -fno-inline >/dev/null 2>/dev/null ; then
  2672. ac_cflags_save="$CFLAGS"
  2673. CFLAGS="$CFLAGS -D_USE_GNU"
  2674. AC_TRY_LINK([
  2675. #include <string.h>
  2676. ], [ const char *pt, *et;
  2677. et = __extension__ ({ char __a0, __a1, __a2; (__builtin_constant_p ( ";," ) && ((size_t)(const void *)(( ";," )+ 1) - (size_t)(const void *)( ";," ) == 1) ? ((__a0 =((__const char *) ( ";," ))[0], __a0 == '\0') ? ((void) ( pt ),((void *)0) ) : ((__a1 = ((__const char *) ( ";," ))[1], __a1== '\0') ? (__extension__ (__builtin_constant_p ( __a0 ) && ( __a0 ) == '\0' ? (char *) __rawmemchr ( pt , __a0) : strchr( pt , __a0 ))) : ((__a2 = ((__const char *) ( ";," ))[2], __a2 == '\0') ? __strpbrk_c2 ( pt , __a0, __a1) :(((__const char *) ( ";," ))[3] == '\0' ? __strpbrk_c3 ( pt ,__a0, __a1, __a2): strpbrk ( pt , ";," ))))) : strpbrk ( pt , ";," )); }) ;
  2678. ],
  2679. kde_cv_opt_noinline_match=yes,
  2680. kde_cv_opt_noinline_match=no
  2681. )
  2682. CFLAGS="$ac_cflags_save"
  2683. fi
  2684. ])
  2685. ])
  2686. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2687. AC_DEFUN([AC_VALIDIFY_CXXFLAGS],
  2688. [dnl
  2689. if test "x$kde_use_qt_emb" != "xyes"; then
  2690. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2691. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2692. else
  2693. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2694. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2695. fi
  2696. ])
  2697. AC_DEFUN([AC_CHECK_COMPILERS],
  2698. [
  2699. AC_ARG_ENABLE(debug,
  2700. AC_HELP_STRING([--enable-debug=ARG],[enables debug symbols (yes|no|full) [default=no]]),
  2701. [
  2702. case $enableval in
  2703. yes)
  2704. kde_use_debug_code="yes"
  2705. kde_use_debug_define=no
  2706. ;;
  2707. full)
  2708. kde_use_debug_code="full"
  2709. kde_use_debug_define=no
  2710. ;;
  2711. *)
  2712. kde_use_debug_code="no"
  2713. kde_use_debug_define=yes
  2714. ;;
  2715. esac
  2716. ],
  2717. [kde_use_debug_code="no"
  2718. kde_use_debug_define=no
  2719. ])
  2720. dnl Just for configure --help
  2721. AC_ARG_ENABLE(dummyoption,
  2722. AC_HELP_STRING([--disable-debug],
  2723. [disables debug output and debug symbols [default=no]]),
  2724. [],[])
  2725. AC_ARG_ENABLE(strict,
  2726. AC_HELP_STRING([--enable-strict],
  2727. [compiles with strict compiler options (may not work!)]),
  2728. [
  2729. if test $enableval = "no"; then
  2730. kde_use_strict_options="no"
  2731. else
  2732. kde_use_strict_options="yes"
  2733. fi
  2734. ], [kde_use_strict_options="no"])
  2735. AC_ARG_ENABLE(warnings,AC_HELP_STRING([--disable-warnings],[disables compilation with -Wall and similar]),
  2736. [
  2737. if test $enableval = "no"; then
  2738. kde_use_warnings="no"
  2739. else
  2740. kde_use_warnings="yes"
  2741. fi
  2742. ], [kde_use_warnings="yes"])
  2743. dnl enable warnings for debug build
  2744. if test "$kde_use_debug_code" != "no"; then
  2745. kde_use_warnings=yes
  2746. fi
  2747. AC_ARG_ENABLE(profile,AC_HELP_STRING([--enable-profile],[creates profiling infos [default=no]]),
  2748. [kde_use_profiling=$enableval],
  2749. [kde_use_profiling="no"]
  2750. )
  2751. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2752. CFLAGS=" $CFLAGS"
  2753. AC_PROG_CC
  2754. AC_PROG_CPP
  2755. if test "$GCC" = "yes"; then
  2756. if test "$kde_use_debug_code" != "no"; then
  2757. if test $kde_use_debug_code = "full"; then
  2758. CFLAGS="-g3 -fno-inline $CFLAGS"
  2759. else
  2760. CFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CFLAGS"
  2761. fi
  2762. else
  2763. CFLAGS="-O2 $CFLAGS"
  2764. fi
  2765. fi
  2766. if test "$kde_use_debug_define" = "yes"; then
  2767. CFLAGS="-DNDEBUG $CFLAGS"
  2768. fi
  2769. case "$host" in
  2770. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2771. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2772. esac
  2773. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2774. LDFLAGS=""
  2775. fi
  2776. CXXFLAGS=" $CXXFLAGS"
  2777. AC_PROG_CXX
  2778. KDE_CHECK_FOR_BAD_COMPILER
  2779. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2780. if test "$kde_use_debug_code" != "no"; then
  2781. if test "$CXX" = "KCC"; then
  2782. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wwrite-strings $CXXFLAGS"
  2783. else
  2784. if test "$kde_use_debug_code" = "full"; then
  2785. CXXFLAGS="-g3 -fno-inline $CXXFLAGS"
  2786. else
  2787. CXXFLAGS="-g -O2 -fno-schedule-insns -fno-inline $CXXFLAGS"
  2788. fi
  2789. fi
  2790. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2791. dnl convenience compiler flags
  2792. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2793. AC_SUBST(WOVERLOADED_VIRTUAL)
  2794. else
  2795. if test "$CXX" = "KCC"; then
  2796. CXXFLAGS="+K3 $CXXFLAGS"
  2797. else
  2798. CXXFLAGS="-O2 $CXXFLAGS"
  2799. fi
  2800. fi
  2801. fi
  2802. if test "$kde_use_debug_define" = "yes"; then
  2803. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2804. fi
  2805. if test "$kde_use_profiling" = "yes"; then
  2806. KDE_CHECK_COMPILER_FLAG(pg,
  2807. [
  2808. CFLAGS="-pg $CFLAGS"
  2809. CXXFLAGS="-pg $CXXFLAGS"
  2810. ])
  2811. fi
  2812. if test "$kde_use_warnings" = "yes"; then
  2813. if test "$GCC" = "yes"; then
  2814. CXXFLAGS="-Wall -W -Wpointer-arith $CXXFLAGS"
  2815. case $host in
  2816. *-*-linux-gnu)
  2817. CFLAGS="-std=iso9899:1990 -W -Wall -Wchar-subscripts -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
  2818. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wchar-subscripts $CXXFLAGS"
  2819. KDE_CHECK_COMPILER_FLAG(Wmissing-format-attribute, [CXXFLAGS="$CXXFLAGS -Wformat-security -Wmissing-format-attribute"])
  2820. KDE_CHECK_C_COMPILER_FLAG(Wmissing-format-attribute, [CFLAGS="$CFLAGS -Wformat-security -Wmissing-format-attribute"])
  2821. ;;
  2822. esac
  2823. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2824. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2825. dnl ### FIXME: revert for KDE 4
  2826. KDE_CHECK_COMPILER_FLAG(Wno-non-virtual-dtor,[CXXFLAGS="$CXXFLAGS -Wno-non-virtual-dtor"])
  2827. fi
  2828. fi
  2829. if test "$GXX" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2830. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2831. fi
  2832. AC_ARG_ENABLE(pch,
  2833. AC_HELP_STRING([--enable-pch],
  2834. [enables precompiled header support (currently only KCC or gcc >=3.4+unsermake) [default=no]]),
  2835. [ kde_use_pch=$enableval ],[ kde_use_pch=no ])
  2836. HAVE_GCC_VISIBILITY=0
  2837. AC_SUBST([HAVE_GCC_VISIBILITY])
  2838. if test "$GXX" = "yes"; then
  2839. gcc_no_reorder_blocks=NO
  2840. KDE_CHECK_COMPILER_FLAG(fno-reorder-blocks,[gcc_no_reorder_blocks=YES])
  2841. if test $kde_use_debug_code != "no" && \
  2842. test $kde_use_debug_code != "full" && \
  2843. test "YES" = "$gcc_no_reorder_blocks" ; then
  2844. CXXFLAGS="$CXXFLAGS -fno-reorder-blocks"
  2845. CFLAGS="$CFLAGS -fno-reorder-blocks"
  2846. fi
  2847. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2848. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2849. KDE_CHECK_COMPILER_FLAG(fno-common, [CXXFLAGS="$CXXFLAGS -fno-common"])
  2850. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2851. ENABLE_PERMISSIVE_FLAG="-fpermissive"
  2852. if test "$kde_use_pch" = "yes"; then
  2853. AC_MSG_CHECKING(whether gcc supports precompiling c header files)
  2854. echo >conftest.h
  2855. if $CC -x c-header conftest.h >/dev/null 2>/dev/null; then
  2856. kde_gcc_supports_pch=yes
  2857. AC_MSG_RESULT(yes)
  2858. else
  2859. kde_gcc_supports_pch=no
  2860. AC_MSG_RESULT(no)
  2861. fi
  2862. if test "$kde_gcc_supports_pch" = "yes"; then
  2863. AC_MSG_CHECKING(whether gcc supports precompiling c++ header files)
  2864. if $CXX -x c++-header conftest.h >/dev/null 2>/dev/null; then
  2865. kde_gcc_supports_pch=yes
  2866. AC_MSG_RESULT(yes)
  2867. else
  2868. kde_gcc_supports_pch=no
  2869. AC_MSG_RESULT(no)
  2870. fi
  2871. fi
  2872. rm -f conftest.h conftest.h.gch
  2873. fi
  2874. KDE_CHECK_FOR_OPT_NOINLINE_MATCH
  2875. if test "x$kde_cv_opt_noinline_match" = "xno" ; then
  2876. CFLAGS="`echo "$CFLAGS" | sed "s/ -fno-inline//"`"
  2877. fi
  2878. fi
  2879. AM_CONDITIONAL(unsermake_enable_pch, test "$kde_use_pch" = "yes" && test "$kde_gcc_supports_pch" = "yes")
  2880. if test "$CXX" = "KCC"; then
  2881. dnl unfortunately we currently cannot disable exception support in KCC
  2882. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  2883. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2884. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2885. if test "$kde_use_pch" = "yes"; then
  2886. dnl TODO: support --pch-dir!
  2887. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2888. dnl the below works (but the dir must exist), but it's
  2889. dnl useless for a whole package.
  2890. dnl The are precompiled headers for each source file, so when compiling
  2891. dnl from scratch, it doesn't make a difference, and they take up
  2892. dnl around ~5Mb _per_ sourcefile.
  2893. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2894. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2895. fi
  2896. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2897. dnl all implementations that are defined inside the class {} declaration.
  2898. dnl because of templates-compatibility with broken gcc compilers, this
  2899. dnl can cause excessive inlining. This flag limits it to a sane level
  2900. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2901. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2902. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2903. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2904. dnl Some source files are shared between multiple executables
  2905. dnl (or libraries) and some of those need template instantiations.
  2906. dnl In that case KCC needs to compile those sources with
  2907. dnl --one_instantiation_per_object. To make it easy for us we compile
  2908. dnl _all_ objects with that flag (--one_per is a shorthand).
  2909. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2910. fi
  2911. AC_SUBST(USE_EXCEPTIONS)
  2912. dnl obsolete macro - provided to keep things going
  2913. USE_RTTI=
  2914. AC_SUBST(USE_RTTI)
  2915. case "$host" in
  2916. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2917. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2918. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2919. *-*-solaris*)
  2920. if test "$GXX" = yes; then
  2921. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2922. if test ! -f $libstdcpp; then
  2923. AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
  2924. fi
  2925. fi
  2926. ;;
  2927. esac
  2928. AC_VALIDIFY_CXXFLAGS
  2929. AC_PROG_CXXCPP
  2930. if test "$GCC" = yes; then
  2931. NOOPT_CFLAGS=-O0
  2932. fi
  2933. KDE_CHECK_COMPILER_FLAG(O0,[NOOPT_CXXFLAGS=-O0])
  2934. AC_ARG_ENABLE(coverage,
  2935. AC_HELP_STRING([--enable-coverage],[use gcc coverage testing]), [
  2936. if test "$am_cv_CC_dependencies_compiler_type" = "gcc3"; then
  2937. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2938. ac_coverage_linker="-lgcc"
  2939. elif test "$am_cv_CC_dependencies_compiler_type" = "gcc"; then
  2940. ac_coverage_compiler="-fprofile-arcs -ftest-coverage"
  2941. ac_coverage_linker=""
  2942. else
  2943. AC_MSG_ERROR([coverage with your compiler is not supported])
  2944. fi
  2945. CFLAGS="$CFLAGS $ac_coverage_compiler"
  2946. CXXFLAGS="$CXXFLAGS $ac_coverage_compiler"
  2947. LDFLAGS="$LDFLAGS $ac_coverage_linker"
  2948. ])
  2949. AC_SUBST(NOOPT_CXXFLAGS)
  2950. AC_SUBST(NOOPT_CFLAGS)
  2951. AC_SUBST(ENABLE_PERMISSIVE_FLAG)
  2952. KDE_CHECK_NEW_LDFLAGS
  2953. KDE_CHECK_FINAL
  2954. KDE_CHECK_CLOSURE
  2955. KDE_CHECK_NMCHECK
  2956. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2957. ])
  2958. AC_DEFUN([KDE_CHECK_VISIBILITY_GCC_BUG],
  2959. [
  2960. AC_CACHE_CHECK([for gcc -fvisibility-inlines-hidden bug], kde_cv_val_gcc_visibility_bug,
  2961. [
  2962. AC_LANG_SAVE
  2963. AC_LANG_CPLUSPLUS
  2964. safe_CXXFLAGS=$CXXFLAGS
  2965. safe_LDFLAGS=$LDFLAGS
  2966. CXXFLAGS="$CXXFLAGS -fPIC -fvisibility-inlines-hidden -O0"
  2967. LDFLAGS="$LDFLAGS -shared -fPIC"
  2968. AC_TRY_LINK(
  2969. [
  2970. /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 */
  2971. #include <string>
  2972. int some_function( void ) __attribute__ ((visibility("default")));
  2973. int some_function( void )
  2974. {
  2975. std::string s("blafasel");
  2976. return 0;
  2977. }
  2978. ], [/* elvis is alive */],
  2979. kde_cv_val_gcc_visibility_bug=no, kde_cv_val_gcc_visibility_bug=yes)
  2980. CXXFLAGS=$safe_CXXFLAGS
  2981. LDFLAGS=$safe_LDFLAGS
  2982. AC_LANG_RESTORE
  2983. ]
  2984. )
  2985. if test x$kde_cv_val_gcc_visibility_bug = xno; then
  2986. CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
  2987. fi
  2988. ]
  2989. )
  2990. AC_DEFUN([KDE_ENABLE_HIDDEN_VISIBILITY],
  2991. [
  2992. AC_BEFORE([AC_PATH_QT_1_3], [KDE_ENABLE_HIDDEN_VISIBILITY])
  2993. AC_MSG_CHECKING([grepping for visibility push/pop in headers])
  2994. if test "x$GXX" = "xyes"; then
  2995. AC_LANG_SAVE
  2996. AC_LANG_CPLUSPLUS
  2997. AC_EGREP_CPP(
  2998. [GCC visibility push],
  2999. [ #include <exception>
  3000. ],
  3001. [
  3002. AC_MSG_RESULT(yes)
  3003. kde_stdc_visibility_patched=yes ],
  3004. [
  3005. AC_MSG_RESULT(no)
  3006. AC_MSG_WARN([Your libstdc++ doesn't appear to be patched for
  3007. visibility support. Disabling -fvisibility=hidden])
  3008. kde_stdc_visibility_patched=no ])
  3009. AC_LANG_RESTORE
  3010. kde_have_gcc_visibility=no
  3011. KDE_CHECK_COMPILER_FLAG(fvisibility=hidden,
  3012. [
  3013. kde_have_gcc_visibility=yes
  3014. dnl the whole toolchain is just a mess, gcc is just too buggy
  3015. dnl to handle STL with visibility enabled. Lets reconsider
  3016. dnl when gcc 4.2 is out or when things get fixed in the compiler.
  3017. dnl Contact mueller@kde.org for details.
  3018. AC_ARG_ENABLE(gcc-hidden-visibility,
  3019. AC_HELP_STRING([--enable-gcc-hidden-visibility],[toolchain hidden visibility [default=no]]),
  3020. [kde_have_gcc_visibility=$enableval],
  3021. [kde_have_gcc_visibility=no])
  3022. AC_CACHE_CHECK([if Qt is patched for -fvisibility], kde_cv_val_qt_gcc_visibility_patched,
  3023. [
  3024. AC_LANG_SAVE
  3025. AC_LANG_CPLUSPLUS
  3026. safe_CXXFLAGS=$CXXFLAGS
  3027. CXXFLAGS="$CXXFLAGS $all_includes"
  3028. AC_TRY_COMPILE(
  3029. [
  3030. #include <qglobal.h>
  3031. #if Q_EXPORT - 0 != 0
  3032. /* if this compiles, then Q_EXPORT is undefined */
  3033. /* if Q_EXPORT is nonempty, this will break compilation */
  3034. #endif
  3035. ], [/* elvis is alive */],
  3036. kde_cv_val_qt_gcc_visibility_patched=no, kde_cv_val_qt_gcc_visibility_patched=yes)
  3037. CXXFLAGS=$safe_CXXFLAGS
  3038. AC_LANG_RESTORE
  3039. ]
  3040. )
  3041. if test x$kde_have_gcc_visibility = "xyes" && test x$kde_stdc_visibility_patched = "xyes" && test x$kde_cv_val_qt_gcc_visibility_patched = "xyes"; then
  3042. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  3043. KDE_CHECK_VISIBILITY_GCC_BUG
  3044. HAVE_GCC_VISIBILITY=1
  3045. AC_DEFINE_UNQUOTED(__KDE_HAVE_GCC_VISIBILITY, "$HAVE_GCC_VISIBILITY", [define to 1 if -fvisibility is supported])
  3046. fi
  3047. ])
  3048. fi
  3049. ])
  3050. AC_DEFUN([KDE_ADD_DEPENDENCIES],
  3051. [
  3052. [A]M_DEPENDENCIES(CC)
  3053. [A]M_DEPENDENCIES(CXX)
  3054. ])
  3055. dnl just a wrapper to clean up configure.in
  3056. AC_DEFUN([KDE_PROG_LIBTOOL],
  3057. [
  3058. AC_REQUIRE([AC_CHECK_COMPILERS])
  3059. AC_REQUIRE([AC_ENABLE_SHARED])
  3060. AC_REQUIRE([AC_ENABLE_STATIC])
  3061. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  3062. AC_REQUIRE([KDE_CHECK_LIB64])
  3063. AC_OBJEXT
  3064. AC_EXEEXT
  3065. AM_PROG_LIBTOOL
  3066. AC_LIBTOOL_CXX
  3067. LIBTOOL_SHELL="/bin/sh ./libtool"
  3068. # LIBTOOL="$LIBTOOL --silent"
  3069. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  3070. AC_SUBST(KDE_PLUGIN)
  3071. # This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs.
  3072. KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)"
  3073. AC_SUBST(KDE_CHECK_PLUGIN)
  3074. # we patch configure quite some so we better keep that consistent for incremental runs
  3075. AC_SUBST(AUTOCONF,'$(SHELL) $(top_srcdir)/admin/cvs.sh configure || touch configure')
  3076. ])
  3077. AC_DEFUN([KDE_CHECK_LIB64],
  3078. [
  3079. AC_ARG_ENABLE(libsuffix,
  3080. AC_HELP_STRING([--enable-libsuffix],
  3081. [/lib directory suffix (64,32,none,auto[=default])]),
  3082. kdelibsuff=$enableval, kdelibsuff="auto")
  3083. if test "$kdelibsuff" = "auto"; then
  3084. cat > conftest.c << EOF
  3085. #include <stdio.h>
  3086. int main() {
  3087. return 0;
  3088. }
  3089. EOF
  3090. kdelibsuff=`$CC conftest.c -o conftest.out; ldd conftest.out |sed -ne '/libc.so/{
  3091. s,.*/lib\([[^\/]]*\)/.*,\1,
  3092. p
  3093. }'`
  3094. rm -rf conftest.*
  3095. fi
  3096. if test "$kdelibsuff" = "no" || test "$kdelibsuff" = "none"; then
  3097. kdelibsuff=
  3098. fi
  3099. if test -z "$kdelibsuff"; then
  3100. AC_MSG_RESULT([not using lib directory suffix])
  3101. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  3102. else
  3103. if test "$libdir" = '${exec_prefix}/lib'; then
  3104. libdir="$libdir${kdelibsuff}"
  3105. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  3106. fi
  3107. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["${kdelibsuff}"], Suffix for lib directories)
  3108. AC_MSG_RESULT([using lib directory suffix $kdelibsuff])
  3109. fi
  3110. ])
  3111. AC_DEFUN([KDE_CHECK_TYPES],
  3112. [ AC_CHECK_SIZEOF(int, 4)dnl
  3113. AC_CHECK_SIZEOF(short)dnl
  3114. AC_CHECK_SIZEOF(long, 4)dnl
  3115. AC_CHECK_SIZEOF(char *, 4)dnl
  3116. ])dnl
  3117. dnl Not used - kept for compat only?
  3118. AC_DEFUN([KDE_DO_IT_ALL],
  3119. [
  3120. AC_CANONICAL_SYSTEM
  3121. AC_ARG_PROGRAM
  3122. AM_INIT_AUTOMAKE($1, $2)
  3123. AM_DISABLE_LIBRARIES
  3124. AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
  3125. AC_CHECK_COMPILERS
  3126. KDE_PROG_LIBTOOL
  3127. AM_KDE_WITH_NLS
  3128. AC_PATH_KDE
  3129. ])
  3130. AC_DEFUN([AC_CHECK_RPATH],
  3131. [
  3132. AC_MSG_CHECKING(for rpath)
  3133. AC_ARG_ENABLE(rpath,
  3134. AC_HELP_STRING([--disable-rpath],[do not use the rpath feature of ld]),
  3135. USE_RPATH=$enableval, USE_RPATH=yes)
  3136. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  3137. KDE_RPATH="-R \$(libdir)"
  3138. if test "$kde_libraries" != "$libdir"; then
  3139. KDE_RPATH="$KDE_RPATH -R \$(kde_libraries)"
  3140. fi
  3141. if test -n "$qt_libraries"; then
  3142. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  3143. fi
  3144. dnl $x_libraries is set to /usr/lib in case
  3145. if test -n "$X_LDFLAGS"; then
  3146. X_RPATH="-R \$(x_libraries)"
  3147. KDE_RPATH="$KDE_RPATH $X_RPATH"
  3148. fi
  3149. if test -n "$KDE_EXTRA_RPATH"; then
  3150. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  3151. fi
  3152. fi
  3153. AC_SUBST(KDE_EXTRA_RPATH)
  3154. AC_SUBST(KDE_RPATH)
  3155. AC_SUBST(X_RPATH)
  3156. AC_MSG_RESULT($USE_RPATH)
  3157. ])
  3158. dnl Check for the type of the third argument of getsockname
  3159. AC_DEFUN([AC_CHECK_SOCKLEN_T],
  3160. [
  3161. AC_MSG_CHECKING(for socklen_t)
  3162. AC_CACHE_VAL(kde_cv_socklen_t,
  3163. [
  3164. AC_LANG_PUSH(C++)
  3165. kde_cv_socklen_t=no
  3166. AC_TRY_COMPILE([
  3167. #include <sys/types.h>
  3168. #include <sys/socket.h>
  3169. ],
  3170. [
  3171. socklen_t len;
  3172. getpeername(0,0,&len);
  3173. ],
  3174. [
  3175. kde_cv_socklen_t=yes
  3176. kde_cv_socklen_t_equiv=socklen_t
  3177. ])
  3178. AC_LANG_POP(C++)
  3179. ])
  3180. AC_MSG_RESULT($kde_cv_socklen_t)
  3181. if test $kde_cv_socklen_t = no; then
  3182. AC_MSG_CHECKING([for socklen_t equivalent for socket functions])
  3183. AC_CACHE_VAL(kde_cv_socklen_t_equiv,
  3184. [
  3185. kde_cv_socklen_t_equiv=int
  3186. AC_LANG_PUSH(C++)
  3187. for t in int size_t unsigned long "unsigned long"; do
  3188. AC_TRY_COMPILE([
  3189. #include <sys/types.h>
  3190. #include <sys/socket.h>
  3191. ],
  3192. [
  3193. $t len;
  3194. getpeername(0,0,&len);
  3195. ],
  3196. [
  3197. kde_cv_socklen_t_equiv="$t"
  3198. break
  3199. ])
  3200. done
  3201. AC_LANG_POP(C++)
  3202. ])
  3203. AC_MSG_RESULT($kde_cv_socklen_t_equiv)
  3204. fi
  3205. AC_DEFINE_UNQUOTED(kde_socklen_t, $kde_cv_socklen_t_equiv,
  3206. [type to use in place of socklen_t if not defined])
  3207. AC_DEFINE_UNQUOTED(ksize_t, $kde_cv_socklen_t_equiv,
  3208. [type to use in place of socklen_t if not defined (deprecated, use kde_socklen_t)])
  3209. ])
  3210. dnl This is a merge of some macros out of the gettext aclocal.m4
  3211. dnl since we don't need anything, I took the things we need
  3212. dnl the copyright for them is:
  3213. dnl >
  3214. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  3215. dnl This Makefile.in is free software; the Free Software Foundation
  3216. dnl gives unlimited permission to copy and/or distribute it,
  3217. dnl with or without modifications, as long as this notice is preserved.
  3218. dnl This program is distributed in the hope that it will be useful,
  3219. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  3220. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  3221. dnl PARTICULAR PURPOSE.
  3222. dnl >
  3223. dnl for this file it is relicensed under LGPL
  3224. AC_DEFUN([AM_KDE_WITH_NLS],
  3225. [
  3226. dnl If we use NLS figure out what method
  3227. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  3228. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  3229. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  3230. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  3231. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  3232. GMSGFMT=":"
  3233. fi
  3234. MSGFMT=$GMSGFMT
  3235. AC_SUBST(GMSGFMT)
  3236. AC_SUBST(MSGFMT)
  3237. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  3238. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  3239. dnl Test whether we really found GNU xgettext.
  3240. if test "$XGETTEXT" != ":"; then
  3241. dnl If it is no GNU xgettext we define it as : so that the
  3242. dnl Makefiles still can work.
  3243. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  3244. : ;
  3245. else
  3246. AC_MSG_RESULT(
  3247. [found xgettext programs is not GNU xgettext; ignore it])
  3248. XGETTEXT=":"
  3249. fi
  3250. fi
  3251. AC_SUBST(XGETTEXT)
  3252. ])
  3253. # Search path for a program which passes the given test.
  3254. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  3255. # serial 1
  3256. # Stephan Kulow: I appended a _KDE against name conflicts
  3257. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  3258. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  3259. AC_DEFUN([AM_PATH_PROG_WITH_TEST_KDE],
  3260. [# Extract the first word of "$2", so it can be a program name with args.
  3261. set dummy $2; ac_word=[$]2
  3262. AC_MSG_CHECKING([for $ac_word])
  3263. AC_CACHE_VAL(ac_cv_path_$1,
  3264. [case "[$]$1" in
  3265. /*)
  3266. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  3267. ;;
  3268. *)
  3269. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  3270. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  3271. test -z "$ac_dir" && ac_dir=.
  3272. if test -f $ac_dir/$ac_word; then
  3273. if [$3]; then
  3274. ac_cv_path_$1="$ac_dir/$ac_word"
  3275. break
  3276. fi
  3277. fi
  3278. done
  3279. IFS="$ac_save_ifs"
  3280. dnl If no 4th arg is given, leave the cache variable unset,
  3281. dnl so AC_PATH_PROGS will keep looking.
  3282. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  3283. ])dnl
  3284. ;;
  3285. esac])dnl
  3286. $1="$ac_cv_path_$1"
  3287. if test -n "[$]$1"; then
  3288. AC_MSG_RESULT([$]$1)
  3289. else
  3290. AC_MSG_RESULT(no)
  3291. fi
  3292. AC_SUBST($1)dnl
  3293. ])
  3294. # Check whether LC_MESSAGES is available in <locale.h>.
  3295. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3296. # serial 1
  3297. AC_DEFUN([AM_LC_MESSAGES],
  3298. [if test $ac_cv_header_locale_h = yes; then
  3299. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  3300. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  3301. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  3302. if test $am_cv_val_LC_MESSAGES = yes; then
  3303. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  3304. fi
  3305. fi])
  3306. dnl From Jim Meyering.
  3307. dnl FIXME: migrate into libit.
  3308. AC_DEFUN([AM_FUNC_OBSTACK],
  3309. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  3310. [AC_TRY_LINK([#include "obstack.h"],
  3311. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  3312. am_cv_func_obstack=yes,
  3313. am_cv_func_obstack=no)])
  3314. if test $am_cv_func_obstack = yes; then
  3315. AC_DEFINE(HAVE_OBSTACK)
  3316. else
  3317. LIBOBJS="$LIBOBJS obstack.o"
  3318. fi
  3319. ])
  3320. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  3321. dnl FIXME: Migrate into libit
  3322. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  3323. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  3324. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  3325. am_cv_lib_error_at_line=yes,
  3326. am_cv_lib_error_at_line=no)])
  3327. if test $am_cv_lib_error_at_line = no; then
  3328. LIBOBJS="$LIBOBJS error.o"
  3329. fi
  3330. AC_SUBST(LIBOBJS)dnl
  3331. ])
  3332. # Macro to add for using GNU gettext.
  3333. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  3334. # serial 1
  3335. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  3336. AC_DEFUN([AM_KDE_GNU_GETTEXT],
  3337. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  3338. AC_REQUIRE([AC_PROG_RANLIB])dnl
  3339. AC_REQUIRE([AC_HEADER_STDC])dnl
  3340. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  3341. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  3342. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  3343. AC_REQUIRE([AC_FUNC_MMAP])dnl
  3344. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  3345. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  3346. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  3347. __argz_count __argz_stringify __argz_next])
  3348. AC_MSG_CHECKING(for stpcpy)
  3349. AC_CACHE_VAL(kde_cv_func_stpcpy,
  3350. [
  3351. kde_safe_cxxflags=$CXXFLAGS
  3352. CXXFLAGS="-Werror"
  3353. AC_LANG_SAVE
  3354. AC_LANG_CPLUSPLUS
  3355. AC_TRY_COMPILE([
  3356. #include <string.h>
  3357. ],
  3358. [
  3359. char buffer[200];
  3360. stpcpy(buffer, buffer);
  3361. ],
  3362. kde_cv_func_stpcpy=yes,
  3363. kde_cv_func_stpcpy=no)
  3364. AC_LANG_RESTORE
  3365. CXXFLAGS=$kde_safe_cxxflags
  3366. ])
  3367. AC_MSG_RESULT($kde_cv_func_stpcpy)
  3368. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  3369. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  3370. fi
  3371. AM_LC_MESSAGES
  3372. if test "x$CATOBJEXT" != "x"; then
  3373. if test "x$ALL_LINGUAS" = "x"; then
  3374. LINGUAS=
  3375. else
  3376. AC_MSG_CHECKING(for catalogs to be installed)
  3377. NEW_LINGUAS=
  3378. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  3379. case "$ALL_LINGUAS" in
  3380. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  3381. esac
  3382. done
  3383. LINGUAS=$NEW_LINGUAS
  3384. AC_MSG_RESULT($LINGUAS)
  3385. fi
  3386. dnl Construct list of names of catalog files to be constructed.
  3387. if test -n "$LINGUAS"; then
  3388. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  3389. fi
  3390. fi
  3391. ])
  3392. AC_DEFUN([AC_HAVE_XPM],
  3393. [AC_REQUIRE_CPP()dnl
  3394. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3395. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  3396. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  3397. AC_ARG_WITH(xpm,AC_HELP_STRING([--without-xpm],[disable color pixmap XPM tests]),
  3398. xpm_test=$withval, xpm_test="yes")
  3399. if test "x$xpm_test" = xno; then
  3400. ac_cv_have_xpm=no
  3401. else
  3402. AC_MSG_CHECKING(for XPM)
  3403. AC_CACHE_VAL(ac_cv_have_xpm,
  3404. [
  3405. ac_save_ldflags="$LDFLAGS"
  3406. ac_save_cflags="$CFLAGS"
  3407. if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
  3408. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  3409. else
  3410. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  3411. fi
  3412. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  3413. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  3414. AC_TRY_LINK([#include <X11/xpm.h>],[],
  3415. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  3416. LDFLAGS="$ac_save_ldflags"
  3417. CFLAGS="$ac_save_cflags"
  3418. ])dnl
  3419. if test "$ac_cv_have_xpm" = no; then
  3420. AC_MSG_RESULT(no)
  3421. XPM_LDFLAGS=""
  3422. XPMINC=""
  3423. $2
  3424. else
  3425. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  3426. if test "$XPM_LDFLAGS" = ""; then
  3427. XPMLIB='-lXpm $(LIB_X11)'
  3428. else
  3429. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  3430. fi
  3431. if test "$XPM_INCLUDE" = ""; then
  3432. XPMINC=""
  3433. else
  3434. XPMINC="-I$XPM_INCLUDE"
  3435. fi
  3436. AC_MSG_RESULT(yes)
  3437. $1
  3438. fi
  3439. fi
  3440. AC_SUBST(XPMINC)
  3441. AC_SUBST(XPMLIB)
  3442. ])
  3443. AC_DEFUN([AC_HAVE_DPMS],
  3444. [AC_REQUIRE_CPP()dnl
  3445. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3446. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  3447. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  3448. DPMS_LIB=
  3449. AC_ARG_WITH(dpms,AC_HELP_STRING([--without-dpms],[disable DPMS power saving]),
  3450. dpms_test=$withval, dpms_test="yes")
  3451. if test "x$dpms_test" = xno; then
  3452. ac_cv_have_dpms=no
  3453. else
  3454. AC_MSG_CHECKING(for DPMS)
  3455. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  3456. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  3457. AC_CACHE_VAL(ac_cv_have_dpms,
  3458. [
  3459. if test "x$kde_use_qt_emb" = "xyes" || test "x$kde_use_qt_mac" = "xyes"; then
  3460. AC_MSG_RESULT(no)
  3461. ac_cv_have_dpms="no"
  3462. else
  3463. ac_save_ldflags="$LDFLAGS"
  3464. ac_save_cflags="$CFLAGS"
  3465. ac_save_libs="$LIBS"
  3466. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries"
  3467. LIBS="-lX11 -lXext $LIBSOCKET"
  3468. CFLAGS="$CFLAGS $X_INCLUDES"
  3469. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3470. AC_TRY_LINK([
  3471. #include <X11/Xproto.h>
  3472. #include <X11/X.h>
  3473. #include <X11/Xlib.h>
  3474. #include <X11/extensions/dpms.h>
  3475. int foo_test_dpms()
  3476. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3477. ac_cv_have_dpms="yes", [
  3478. LIBS="-lXdpms $LIBS"
  3479. AC_TRY_LINK([
  3480. #include <X11/Xproto.h>
  3481. #include <X11/X.h>
  3482. #include <X11/Xlib.h>
  3483. #include <X11/extensions/dpms.h>
  3484. int foo_test_dpms()
  3485. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  3486. [
  3487. ac_cv_have_dpms="-lXdpms"
  3488. ],ac_cv_have_dpms="no")
  3489. ])
  3490. LDFLAGS="$ac_save_ldflags"
  3491. CFLAGS="$ac_save_cflags"
  3492. LIBS="$ac_save_libs"
  3493. fi
  3494. ])dnl
  3495. if test "$ac_cv_have_dpms" = no; then
  3496. AC_MSG_RESULT(no)
  3497. DPMS_LDFLAGS=""
  3498. DPMSINC=""
  3499. $2
  3500. else
  3501. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  3502. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  3503. DPMS_LIB="-lXdpms"
  3504. fi
  3505. if test "$DPMS_LDFLAGS" = ""; then
  3506. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  3507. else
  3508. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  3509. fi
  3510. if test "$DPMS_INCLUDE" = ""; then
  3511. DPMSINC=""
  3512. else
  3513. DPMSINC="-I$DPMS_INCLUDE"
  3514. fi
  3515. AC_MSG_RESULT(yes)
  3516. $1
  3517. fi
  3518. fi
  3519. ac_save_cflags="$CFLAGS"
  3520. CFLAGS="$CFLAGS $X_INCLUDES"
  3521. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  3522. AH_TEMPLATE(HAVE_DPMSCAPABLE_PROTO,
  3523. [Define if you have the DPMSCapable prototype in <X11/extensions/dpms.h>])
  3524. AC_CHECK_DECL(DPMSCapable,
  3525. AC_DEFINE(HAVE_DPMSCAPABLE_PROTO),,
  3526. [#include <X11/Xlib.h>
  3527. #include <X11/extensions/dpms.h>])
  3528. AH_TEMPLATE(HAVE_DPMSINFO_PROTO,
  3529. [Define if you have the DPMSInfo prototype in <X11/extensions/dpms.h>])
  3530. AC_CHECK_DECL(DPMSInfo,
  3531. AC_DEFINE(HAVE_DPMSINFO_PROTO),,
  3532. [#include <X11/Xlib.h>
  3533. #include <X11/extensions/dpms.h>])
  3534. CFLAGS="$ac_save_cflags"
  3535. AC_SUBST(DPMSINC)
  3536. AC_SUBST(DPMSLIB)
  3537. ])
  3538. AC_DEFUN([AC_HAVE_GL],
  3539. [AC_REQUIRE_CPP()dnl
  3540. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3541. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3542. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3543. AC_ARG_WITH(gl,AC_HELP_STRING([--without-gl],[disable 3D GL modes]),
  3544. gl_test=$withval, gl_test="yes")
  3545. if test "x$kde_use_qt_emb" = "xyes"; then
  3546. # GL and Qt Embedded is a no-go for now.
  3547. ac_cv_have_gl=no
  3548. elif test "x$gl_test" = xno; then
  3549. ac_cv_have_gl=no
  3550. else
  3551. AC_MSG_CHECKING(for GL)
  3552. AC_CACHE_VAL(ac_cv_have_gl,
  3553. [
  3554. AC_LANG_SAVE
  3555. AC_LANG_CPLUSPLUS
  3556. ac_save_ldflags=$LDFLAGS
  3557. ac_save_cxxflags=$CXXFLAGS
  3558. ac_save_libs=$LIBS
  3559. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries"
  3560. LIBS="$LIBS -lGL -lGLU"
  3561. test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LIBS="$LIBS -lX11"
  3562. LIBS="$LIBS $LIB_XEXT -lm $LIBSOCKET"
  3563. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3564. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3565. AC_TRY_LINK([#include <GL/gl.h>
  3566. #include <GL/glu.h>
  3567. ], [],
  3568. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3569. AC_LANG_RESTORE
  3570. LDFLAGS=$ac_save_ldflags
  3571. CXXFLAGS=$ac_save_cxxflags
  3572. LIBS=$ac_save_libs
  3573. ])dnl
  3574. if test "$ac_cv_have_gl" = "no"; then
  3575. AC_MSG_RESULT(no)
  3576. GL_LDFLAGS=""
  3577. GLINC=""
  3578. $2
  3579. else
  3580. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3581. if test "$GL_LDFLAGS" = ""; then
  3582. GLLIB='-lGLU -lGL $(LIB_X11)'
  3583. else
  3584. GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
  3585. fi
  3586. if test "$GL_INCLUDE" = ""; then
  3587. GLINC=""
  3588. else
  3589. GLINC="-I$GL_INCLUDE"
  3590. fi
  3591. AC_MSG_RESULT($ac_cv_have_gl)
  3592. $1
  3593. fi
  3594. fi
  3595. AC_SUBST(GLINC)
  3596. AC_SUBST(GLLIB)
  3597. ])
  3598. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3599. AC_DEFUN([KDE_PAM], [
  3600. AC_REQUIRE([KDE_CHECK_LIBDL])
  3601. want_pam=
  3602. AC_ARG_WITH(pam,
  3603. AC_HELP_STRING([--with-pam[=ARG]],[enable support for PAM: ARG=[yes|no|service name]]),
  3604. [ if test "x$withval" = "xyes"; then
  3605. want_pam=yes
  3606. pam_service=kde
  3607. elif test "x$withval" = "xno"; then
  3608. want_pam=no
  3609. else
  3610. want_pam=yes
  3611. pam_service=$withval
  3612. fi
  3613. ], [ pam_service=kde ])
  3614. use_pam=
  3615. PAMLIBS=
  3616. if test "x$want_pam" != xno; then
  3617. AC_CHECK_LIB(pam, pam_start, [
  3618. AC_CHECK_HEADER(security/pam_appl.h,
  3619. [ pam_header=security/pam_appl.h ],
  3620. [ AC_CHECK_HEADER(pam/pam_appl.h,
  3621. [ pam_header=pam/pam_appl.h ],
  3622. [
  3623. AC_MSG_WARN([PAM detected, but no headers found!
  3624. Make sure you have the necessary development packages installed.])
  3625. ]
  3626. )
  3627. ]
  3628. )
  3629. ], , $LIBDL)
  3630. if test -z "$pam_header"; then
  3631. if test "x$want_pam" = xyes; then
  3632. AC_MSG_ERROR([--with-pam was specified, but cannot compile with PAM!])
  3633. fi
  3634. else
  3635. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3636. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3637. use_pam=yes
  3638. dnl darwin claims to be something special
  3639. if test "$pam_header" = "pam/pam_appl.h"; then
  3640. AC_DEFINE(HAVE_PAM_PAM_APPL_H, 1, [Define if your PAM headers are in pam/ instead of security/])
  3641. fi
  3642. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3643. AC_MSG_CHECKING(for const pam_message)
  3644. AC_EGREP_HEADER([struct pam_message], $pam_header,
  3645. [ AC_EGREP_HEADER([const struct pam_message], $pam_header,
  3646. [AC_MSG_RESULT([const: Linux-type PAM])],
  3647. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3648. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3649. )],
  3650. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3651. fi
  3652. fi
  3653. AC_SUBST(PAMLIBS)
  3654. ])
  3655. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3656. AC_DEFUN([DEF_PAM_SERVICE], [
  3657. AC_ARG_WITH($1-pam,
  3658. AC_HELP_STRING([--with-$1-pam=[val]],[override PAM service from --with-pam for $2]),
  3659. [ if test "x$use_pam" = xyes; then
  3660. $3_PAM_SERVICE=$withval
  3661. else
  3662. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3663. You may want to enforce it by using --with-pam.])
  3664. fi
  3665. ],
  3666. [ if test "x$use_pam" = xyes; then
  3667. $3_PAM_SERVICE="$pam_service"
  3668. fi
  3669. ])
  3670. if test -n "$$3_PAM_SERVICE"; then
  3671. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3672. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3673. fi
  3674. AC_SUBST($3_PAM_SERVICE)
  3675. ])
  3676. AC_DEFUN([KDE_SHADOWPASSWD], [
  3677. AC_REQUIRE([KDE_PAM])
  3678. AC_CHECK_LIB(shadow, getspent,
  3679. [ LIBSHADOW="-lshadow"
  3680. ac_use_shadow=yes
  3681. ],
  3682. [ dnl for UnixWare
  3683. AC_CHECK_LIB(gen, getspent,
  3684. [ LIBGEN="-lgen"
  3685. ac_use_shadow=yes
  3686. ],
  3687. [ AC_CHECK_FUNC(getspent,
  3688. [ ac_use_shadow=yes ],
  3689. [ ac_use_shadow=no ])
  3690. ])
  3691. ])
  3692. AC_SUBST(LIBSHADOW)
  3693. AC_SUBST(LIBGEN)
  3694. AC_MSG_CHECKING([for shadow passwords])
  3695. AC_ARG_WITH(shadow,
  3696. AC_HELP_STRING([--with-shadow],[If you want shadow password support]),
  3697. [ if test "x$withval" != "xno"; then
  3698. use_shadow=yes
  3699. else
  3700. use_shadow=no
  3701. fi
  3702. ], [
  3703. use_shadow="$ac_use_shadow"
  3704. ])
  3705. if test "x$use_shadow" = xyes; then
  3706. AC_MSG_RESULT(yes)
  3707. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3708. else
  3709. AC_MSG_RESULT(no)
  3710. LIBSHADOW=
  3711. LIBGEN=
  3712. fi
  3713. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3714. dnl this still applies, if we could use it indirectly through pam.
  3715. if test "x$use_shadow" = xyes ||
  3716. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3717. case $host in
  3718. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3719. SETUIDFLAGS="-m 4755 -o root";;
  3720. *)
  3721. SETUIDFLAGS="-m 4755";;
  3722. esac
  3723. fi
  3724. AC_SUBST(SETUIDFLAGS)
  3725. ])
  3726. AC_DEFUN([KDE_PASSWDLIBS], [
  3727. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3728. AC_REQUIRE([KDE_PAM])
  3729. AC_REQUIRE([KDE_SHADOWPASSWD])
  3730. if test "x$use_pam" = "xyes"; then
  3731. PASSWDLIBS="$PAMLIBS"
  3732. else
  3733. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3734. fi
  3735. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3736. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3737. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3738. dnl may need to read /etc/master.passwd).
  3739. case $host in
  3740. *-*-freebsd*)
  3741. SETUIDFLAGS="-m 4755 -o root"
  3742. ;;
  3743. *)
  3744. ;;
  3745. esac
  3746. AC_SUBST(PASSWDLIBS)
  3747. ])
  3748. AC_DEFUN([KDE_CHECK_LIBDL],
  3749. [
  3750. AC_CHECK_LIB(dl, dlopen, [
  3751. LIBDL="-ldl"
  3752. ac_cv_have_dlfcn=yes
  3753. ])
  3754. AC_CHECK_LIB(dld, shl_unload, [
  3755. LIBDL="-ldld"
  3756. ac_cv_have_shload=yes
  3757. ])
  3758. AC_SUBST(LIBDL)
  3759. ])
  3760. AC_DEFUN([KDE_CHECK_DLOPEN],
  3761. [
  3762. KDE_CHECK_LIBDL
  3763. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3764. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3765. ac_cv_have_dlfcn=no
  3766. fi
  3767. if test "$ac_cv_header_dl_h" = "no"; then
  3768. ac_cv_have_shload=no
  3769. fi
  3770. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3771. dnl (MM)
  3772. AC_ARG_ENABLE(dlopen,
  3773. AC_HELP_STRING([--disable-dlopen],[link statically [default=no]]),
  3774. enable_dlopen=$enableval,
  3775. enable_dlopen=yes)
  3776. # override the user's opinion, if we know it better ;)
  3777. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3778. enable_dlopen=no
  3779. fi
  3780. if test "$ac_cv_have_dlfcn" = "yes"; then
  3781. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3782. fi
  3783. if test "$ac_cv_have_shload" = "yes"; then
  3784. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3785. fi
  3786. if test "$enable_dlopen" = no ; then
  3787. test -n "$1" && eval $1
  3788. else
  3789. test -n "$2" && eval $2
  3790. fi
  3791. ])
  3792. AC_DEFUN([KDE_CHECK_DYNAMIC_LOADING],
  3793. [
  3794. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3795. KDE_PROG_LIBTOOL
  3796. AC_MSG_CHECKING([dynamic loading])
  3797. eval "`egrep '^build_libtool_libs=' libtool`"
  3798. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3799. dynamic_loading=yes
  3800. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3801. else
  3802. dynamic_loading=no
  3803. fi
  3804. AC_MSG_RESULT($dynamic_loading)
  3805. if test "$dynamic_loading" = "yes"; then
  3806. $1
  3807. else
  3808. $2
  3809. fi
  3810. ])
  3811. AC_DEFUN([KDE_ADD_INCLUDES],
  3812. [
  3813. if test -z "$1"; then
  3814. test_include="Pix.h"
  3815. else
  3816. test_include="$1"
  3817. fi
  3818. AC_MSG_CHECKING([for libg++ ($test_include)])
  3819. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3820. [
  3821. kde_cv_libgpp_includes=no
  3822. for ac_dir in \
  3823. \
  3824. /usr/include/g++ \
  3825. /usr/include \
  3826. /usr/unsupported/include \
  3827. /opt/include \
  3828. $extra_include \
  3829. ; \
  3830. do
  3831. if test -r "$ac_dir/$test_include"; then
  3832. kde_cv_libgpp_includes=$ac_dir
  3833. break
  3834. fi
  3835. done
  3836. ])
  3837. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3838. if test "$kde_cv_libgpp_includes" != "no"; then
  3839. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3840. fi
  3841. ])
  3842. ])
  3843. AC_DEFUN([KDE_CHECK_LIBPTHREAD],
  3844. [
  3845. dnl This code is here specifically to handle the
  3846. dnl various flavors of threading library on FreeBSD
  3847. dnl 4-, 5-, and 6-, and the (weird) rules around it.
  3848. dnl There may be an environment PTHREAD_LIBS that
  3849. dnl specifies what to use; otherwise, search for it.
  3850. dnl -pthread is special cased and unsets LIBPTHREAD
  3851. dnl below if found.
  3852. LIBPTHREAD=""
  3853. if test -n "$PTHREAD_LIBS"; then
  3854. if test "x$PTHREAD_LIBS" = "x-pthread" ; then
  3855. LIBPTHREAD="PTHREAD"
  3856. else
  3857. PTHREAD_LIBS_save="$PTHREAD_LIBS"
  3858. PTHREAD_LIBS=`echo "$PTHREAD_LIBS_save" | sed -e 's,^-l,,g'`
  3859. AC_MSG_CHECKING([for pthread_create in $PTHREAD_LIBS])
  3860. KDE_CHECK_LIB($PTHREAD_LIBS, pthread_create, [
  3861. LIBPTHREAD="$PTHREAD_LIBS_save"])
  3862. PTHREAD_LIBS="$PTHREAD_LIBS_save"
  3863. fi
  3864. fi
  3865. dnl Is this test really needed, in the face of the Tru64 test below?
  3866. if test -z "$LIBPTHREAD"; then
  3867. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"])
  3868. fi
  3869. dnl This is a special Tru64 check, see BR 76171 issue #18.
  3870. if test -z "$LIBPTHREAD" ; then
  3871. AC_MSG_CHECKING([for pthread_create in -lpthread])
  3872. kde_safe_libs=$LIBS
  3873. LIBS="$LIBS -lpthread"
  3874. AC_TRY_LINK([#include <pthread.h>],[(void)pthread_create(0,0,0,0);],[
  3875. AC_MSG_RESULT(yes)
  3876. LIBPTHREAD="-lpthread"],[
  3877. AC_MSG_RESULT(no)])
  3878. LIBS=$kde_safe_libs
  3879. fi
  3880. dnl Un-special-case for FreeBSD.
  3881. if test "x$LIBPTHREAD" = "xPTHREAD" ; then
  3882. LIBPTHREAD=""
  3883. fi
  3884. AC_SUBST(LIBPTHREAD)
  3885. ])
  3886. AC_DEFUN([KDE_CHECK_PTHREAD_OPTION],
  3887. [
  3888. USE_THREADS=""
  3889. if test -z "$LIBPTHREAD"; then
  3890. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-D_THREAD_SAFE -pthread"])
  3891. fi
  3892. AH_VERBATIM(__svr_define, [
  3893. #if defined(__SVR4) && !defined(__svr4__)
  3894. #define __svr4__ 1
  3895. #endif
  3896. ])
  3897. case $host_os in
  3898. solaris*)
  3899. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3900. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3901. ;;
  3902. freebsd*)
  3903. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE $PTHREAD_CFLAGS"
  3904. ;;
  3905. aix*)
  3906. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3907. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3908. ;;
  3909. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3910. if test "$CXX" = "KCC"; then
  3911. CXXFLAGS="$CXXFLAGS --thread_safe"
  3912. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3913. fi
  3914. ;;
  3915. *)
  3916. ;;
  3917. esac
  3918. AC_SUBST(USE_THREADS)
  3919. AC_SUBST(LIBPTHREAD)
  3920. ])
  3921. AC_DEFUN([KDE_CHECK_THREADING],
  3922. [
  3923. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3924. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3925. dnl default is yes if libpthread is found and no if no libpthread is available
  3926. if test -z "$LIBPTHREAD"; then
  3927. if test -z "$USE_THREADS"; then
  3928. kde_check_threading_default=no
  3929. else
  3930. kde_check_threading_default=yes
  3931. fi
  3932. else
  3933. kde_check_threading_default=yes
  3934. fi
  3935. AC_ARG_ENABLE(threading,AC_HELP_STRING([--disable-threading],[disables threading even if libpthread found]),
  3936. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3937. if test "x$kde_use_threading" = "xyes"; then
  3938. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3939. fi
  3940. ])
  3941. AC_DEFUN([KDE_TRY_LINK_PYTHON],
  3942. [
  3943. if test "$kde_python_link_found" = no; then
  3944. if test "$1" = normal; then
  3945. AC_MSG_CHECKING(if a Python application links)
  3946. else
  3947. AC_MSG_CHECKING(if Python depends on $2)
  3948. fi
  3949. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3950. [
  3951. kde_save_cflags="$CFLAGS"
  3952. CFLAGS="$CFLAGS $PYTHONINC"
  3953. kde_save_libs="$LIBS"
  3954. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3955. kde_save_ldflags="$LDFLAGS"
  3956. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3957. AC_TRY_LINK(
  3958. [
  3959. #include <Python.h>
  3960. ],[
  3961. PySys_SetArgv(1, 0);
  3962. ],
  3963. [kde_cv_try_link_python_$1=yes],
  3964. [kde_cv_try_link_python_$1=no]
  3965. )
  3966. CFLAGS="$kde_save_cflags"
  3967. LIBS="$kde_save_libs"
  3968. LDFLAGS="$kde_save_ldflags"
  3969. ])
  3970. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3971. AC_MSG_RESULT(yes)
  3972. kde_python_link_found=yes
  3973. if test ! "$1" = normal; then
  3974. LIBPYTHON="$LIBPYTHON $2"
  3975. fi
  3976. $3
  3977. else
  3978. AC_MSG_RESULT(no)
  3979. $4
  3980. fi
  3981. fi
  3982. ])
  3983. AC_DEFUN([KDE_CHECK_PYTHON_DIR],
  3984. [
  3985. AC_MSG_CHECKING([for Python directory])
  3986. AC_CACHE_VAL(kde_cv_pythondir,
  3987. [
  3988. if test -z "$PYTHONDIR"; then
  3989. kde_cv_pythondir=/usr/local
  3990. else
  3991. kde_cv_pythondir="$PYTHONDIR"
  3992. fi
  3993. ])
  3994. AC_ARG_WITH(pythondir,
  3995. AC_HELP_STRING([--with-pythondir=pythondir],[use python installed in pythondir]),
  3996. [
  3997. ac_python_dir=$withval
  3998. ], ac_python_dir=$kde_cv_pythondir
  3999. )
  4000. AC_MSG_RESULT($ac_python_dir)
  4001. ])
  4002. AC_DEFUN([KDE_CHECK_PYTHON_INTERN],
  4003. [
  4004. AC_REQUIRE([KDE_CHECK_LIBDL])
  4005. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  4006. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  4007. if test -z "$1"; then
  4008. version="1.5"
  4009. else
  4010. version="$1"
  4011. fi
  4012. AC_MSG_CHECKING([for Python$version])
  4013. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  4014. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  4015. if test ! -r $python_incdir/Python.h; then
  4016. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  4017. python_incdir=$python_incdir/python$version
  4018. if test ! -r $python_incdir/Python.h; then
  4019. python_incdir=no
  4020. fi
  4021. fi
  4022. PYTHONINC=-I$python_incdir
  4023. python_libdirs="$ac_python_dir/lib$kdelibsuff /usr/lib$kdelibsuff /usr/local /usr/lib$kdelibsuff $kde_extra_libs"
  4024. AC_FIND_FILE(libpython$version.so, $python_libdirs, python_libdir)
  4025. if test ! -r $python_libdir/libpython$version.so; then
  4026. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  4027. if test ! -r $python_libdir/libpython$version.a; then
  4028. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  4029. python_libdir=$python_libdir/python$version/config
  4030. if test ! -r $python_libdir/libpython$version.a; then
  4031. python_libdir=no
  4032. fi
  4033. fi
  4034. fi
  4035. PYTHONLIB=-L$python_libdir
  4036. kde_orig_LIBPYTHON=$LIBPYTHON
  4037. if test -z "$LIBPYTHON"; then
  4038. LIBPYTHON=-lpython$version
  4039. fi
  4040. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  4041. python_moddir=$python_moddir/python$version
  4042. if test ! -r $python_moddir/copy.py; then
  4043. python_moddir=no
  4044. fi
  4045. PYTHONMODDIR=$python_moddir
  4046. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  4047. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  4048. LIBPYTHON=$kde_orig_LIBPYTHON
  4049. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  4050. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  4051. $2
  4052. else
  4053. dnl Note: this test is very weak
  4054. kde_python_link_found=no
  4055. KDE_TRY_LINK_PYTHON(normal)
  4056. KDE_TRY_LINK_PYTHON(m, -lm)
  4057. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  4058. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  4059. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  4060. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  4061. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  4062. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  4063. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  4064. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  4065. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  4066. KDE_TRY_LINK_PYTHON(pthread_and_panel_curses, [$LIBPTHREAD $LIBDL -lm -lpanel -lcurses])
  4067. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  4068. [AC_MSG_WARN([it seems, Python depends on another library.
  4069. Please set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  4070. and contact the authors to let them know about this problem])
  4071. ])
  4072. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  4073. AC_SUBST(PYTHONINC)
  4074. AC_SUBST(PYTHONLIB)
  4075. AC_SUBST(LIBPYTHON)
  4076. AC_SUBST(PYTHONMODDIR)
  4077. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  4078. fi
  4079. ])
  4080. AC_DEFUN([KDE_CHECK_PYTHON],
  4081. [
  4082. KDE_CHECK_PYTHON_INTERN("2.5",
  4083. [KDE_CHECK_PYTHON_INTERN("2.4",
  4084. [KDE_CHECK_PYTHON_INTERN("2.3",
  4085. [KDE_CHECK_PYTHON_INTERN("2.2",
  4086. [KDE_CHECK_PYTHON_INTERN("2.1",
  4087. [KDE_CHECK_PYTHON_INTERN("2.0",
  4088. [KDE_CHECK_PYTHON_INTERN($1, $2) ])
  4089. ])
  4090. ])
  4091. ])
  4092. ])
  4093. ])
  4094. ])
  4095. AC_DEFUN([KDE_CHECK_STL],
  4096. [
  4097. AC_LANG_SAVE
  4098. AC_LANG_CPLUSPLUS
  4099. ac_save_CXXFLAGS="$CXXFLAGS"
  4100. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  4101. AC_MSG_CHECKING([if C++ programs can be compiled])
  4102. AC_CACHE_VAL(kde_cv_stl_works,
  4103. [
  4104. AC_TRY_COMPILE([
  4105. #include <string>
  4106. using namespace std;
  4107. ],[
  4108. string astring="Hallo Welt.";
  4109. astring.erase(0, 6); // now astring is "Welt"
  4110. return 0;
  4111. ], kde_cv_stl_works=yes,
  4112. kde_cv_stl_works=no)
  4113. ])
  4114. AC_MSG_RESULT($kde_cv_stl_works)
  4115. if test "$kde_cv_stl_works" = "yes"; then
  4116. # back compatible
  4117. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  4118. else
  4119. AC_MSG_ERROR([Your Installation isn't able to compile simple C++ programs.
  4120. Check config.log for details - if you're using a Linux distribution you might miss
  4121. a package named similar to libstdc++-dev.])
  4122. fi
  4123. CXXFLAGS="$ac_save_CXXFLAGS"
  4124. AC_LANG_RESTORE
  4125. ])
  4126. AC_DEFUN([AC_FIND_QIMGIO],
  4127. [AC_REQUIRE([AC_FIND_JPEG])
  4128. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  4129. AC_MSG_CHECKING([for qimgio])
  4130. AC_CACHE_VAL(ac_cv_lib_qimgio,
  4131. [
  4132. AC_LANG_SAVE
  4133. AC_LANG_CPLUSPLUS
  4134. ac_save_LIBS="$LIBS"
  4135. ac_save_CXXFLAGS="$CXXFLAGS"
  4136. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
  4137. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  4138. AC_TRY_RUN(dnl
  4139. [
  4140. #include <qimageio.h>
  4141. #include <qstring.h>
  4142. int main() {
  4143. QString t = "hallo";
  4144. t.fill('t');
  4145. qInitImageIO();
  4146. }
  4147. ],
  4148. ac_cv_lib_qimgio=yes,
  4149. ac_cv_lib_qimgio=no,
  4150. ac_cv_lib_qimgio=no)
  4151. LIBS="$ac_save_LIBS"
  4152. CXXFLAGS="$ac_save_CXXFLAGS"
  4153. AC_LANG_RESTORE
  4154. ])dnl
  4155. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  4156. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  4157. AC_MSG_RESULT(yes)
  4158. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  4159. AC_SUBST(LIBQIMGIO)
  4160. else
  4161. AC_MSG_RESULT(not found)
  4162. fi
  4163. ])
  4164. AC_DEFUN([AM_DISABLE_LIBRARIES],
  4165. [
  4166. AC_PROVIDE([AM_ENABLE_STATIC])
  4167. AC_PROVIDE([AM_ENABLE_SHARED])
  4168. enable_static=no
  4169. enable_shared=yes
  4170. ])
  4171. AC_DEFUN([AC_CHECK_UTMP_FILE],
  4172. [
  4173. AC_MSG_CHECKING([for utmp file])
  4174. AC_CACHE_VAL(kde_cv_utmp_file,
  4175. [
  4176. kde_cv_utmp_file=no
  4177. for ac_file in \
  4178. \
  4179. /var/run/utmp \
  4180. /var/adm/utmp \
  4181. /etc/utmp \
  4182. ; \
  4183. do
  4184. if test -r "$ac_file"; then
  4185. kde_cv_utmp_file=$ac_file
  4186. break
  4187. fi
  4188. done
  4189. ])
  4190. if test "$kde_cv_utmp_file" != "no"; then
  4191. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  4192. $1
  4193. AC_MSG_RESULT($kde_cv_utmp_file)
  4194. else
  4195. $2
  4196. AC_MSG_RESULT([non found])
  4197. fi
  4198. ])
  4199. AC_DEFUN([KDE_CREATE_SUBDIRSLIST],
  4200. [
  4201. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  4202. TOPSUBDIRS=""
  4203. if test ! -s $srcdir/subdirs; then
  4204. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  4205. files=`cd $srcdir && ls -1`
  4206. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  4207. for i in $dirs; do
  4208. echo $i >> $srcdir/subdirs
  4209. done
  4210. fi
  4211. ac_topsubdirs=
  4212. if test -s $srcdir/inst-apps; then
  4213. ac_topsubdirs="`cat $srcdir/inst-apps`"
  4214. elif test -s $srcdir/subdirs; then
  4215. ac_topsubdirs="`cat $srcdir/subdirs`"
  4216. fi
  4217. for i in $ac_topsubdirs; do
  4218. AC_MSG_CHECKING([if $i should be compiled])
  4219. if test -d $srcdir/$i; then
  4220. install_it="yes"
  4221. for j in $DO_NOT_COMPILE; do
  4222. if test $i = $j; then
  4223. install_it="no"
  4224. fi
  4225. done
  4226. else
  4227. install_it="no"
  4228. fi
  4229. AC_MSG_RESULT($install_it)
  4230. vari=`echo $i | sed -e 's,[[-+.@]],_,g'`
  4231. if test $install_it = "yes"; then
  4232. TOPSUBDIRS="$TOPSUBDIRS $i"
  4233. eval "$vari""_SUBDIR_included=yes"
  4234. else
  4235. eval "$vari""_SUBDIR_included=no"
  4236. fi
  4237. done
  4238. AC_SUBST(TOPSUBDIRS)
  4239. ])
  4240. AC_DEFUN([KDE_CHECK_NAMESPACES],
  4241. [
  4242. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  4243. AC_LANG_SAVE
  4244. AC_LANG_CPLUSPLUS
  4245. AC_TRY_COMPILE([
  4246. ],
  4247. [
  4248. namespace Foo {
  4249. extern int i;
  4250. namespace Bar {
  4251. extern int i;
  4252. }
  4253. }
  4254. int Foo::i = 0;
  4255. int Foo::Bar::i = 1;
  4256. ],[
  4257. AC_MSG_RESULT(yes)
  4258. AC_DEFINE(HAVE_NAMESPACES)
  4259. ], [
  4260. AC_MSG_RESULT(no)
  4261. ])
  4262. AC_LANG_RESTORE
  4263. ])
  4264. dnl ------------------------------------------------------------------------
  4265. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  4266. dnl ------------------------------------------------------------------------
  4267. dnl
  4268. AC_DEFUN([AC_CHECK_S_ISSOCK],
  4269. [
  4270. AC_MSG_CHECKING(for S_ISSOCK)
  4271. AC_CACHE_VAL(ac_cv_have_s_issock,
  4272. [
  4273. AC_TRY_LINK(
  4274. [
  4275. #include <sys/stat.h>
  4276. ],
  4277. [
  4278. struct stat buff;
  4279. int b = S_ISSOCK( buff.st_mode );
  4280. ],
  4281. ac_cv_have_s_issock=yes,
  4282. ac_cv_have_s_issock=no)
  4283. ])
  4284. AC_MSG_RESULT($ac_cv_have_s_issock)
  4285. if test "$ac_cv_have_s_issock" = "yes"; then
  4286. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  4287. fi
  4288. AH_VERBATIM(_ISSOCK,
  4289. [
  4290. #ifndef HAVE_S_ISSOCK
  4291. #define HAVE_S_ISSOCK
  4292. #define S_ISSOCK(mode) (1==0)
  4293. #endif
  4294. ])
  4295. ])
  4296. dnl ------------------------------------------------------------------------
  4297. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  4298. dnl ------------------------------------------------------------------------
  4299. dnl
  4300. AC_DEFUN([AC_CHECK_KDEMAXPATHLEN],
  4301. [
  4302. AC_MSG_CHECKING(for MAXPATHLEN)
  4303. AC_CACHE_VAL(ac_cv_maxpathlen,
  4304. [
  4305. cat > conftest.$ac_ext <<EOF
  4306. #ifdef STDC_HEADERS
  4307. # include <stdlib.h>
  4308. #endif
  4309. #include <stdio.h>
  4310. #include <sys/param.h>
  4311. #ifndef MAXPATHLEN
  4312. #define MAXPATHLEN 1024
  4313. #endif
  4314. KDE_HELLO MAXPATHLEN
  4315. EOF
  4316. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  4317. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  4318. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  4319. else
  4320. ac_cv_maxpathlen=1024
  4321. fi
  4322. rm conftest.*
  4323. ])
  4324. AC_MSG_RESULT($ac_cv_maxpathlen)
  4325. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  4326. ])
  4327. AC_DEFUN([KDE_CHECK_HEADER],
  4328. [
  4329. kde_safe_cppflags=$CPPFLAGS
  4330. CPPFLAGS="$CPPFLAGS $all_includes"
  4331. AC_LANG_SAVE
  4332. AC_LANG_CPLUSPLUS
  4333. AC_CHECK_HEADER([$1], [$2], [$3], [$4])
  4334. AC_LANG_RESTORE
  4335. CPPFLAGS=$kde_safe_cppflags
  4336. ])
  4337. AC_DEFUN([KDE_CHECK_HEADERS],
  4338. [
  4339. AH_CHECK_HEADERS([$1])
  4340. AC_LANG_SAVE
  4341. kde_safe_cppflags=$CPPFLAGS
  4342. CPPFLAGS="$CPPFLAGS $all_includes"
  4343. AC_LANG_CPLUSPLUS
  4344. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  4345. CPPFLAGS=$kde_safe_cppflags
  4346. AC_LANG_RESTORE
  4347. ])
  4348. AC_DEFUN([KDE_FAST_CONFIGURE],
  4349. [
  4350. dnl makes configure fast (needs perl)
  4351. AC_ARG_ENABLE(fast-perl, AC_HELP_STRING([--disable-fast-perl],[disable fast Makefile generation (needs perl)]),
  4352. with_fast_perl=$enableval, with_fast_perl=yes)
  4353. ])
  4354. AC_DEFUN([KDE_CONF_FILES],
  4355. [
  4356. val=
  4357. if test -f $srcdir/configure.files ; then
  4358. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4359. fi
  4360. CONF_FILES=
  4361. if test -n "$val" ; then
  4362. for i in $val ; do
  4363. CONF_FILES="$CONF_FILES $i"
  4364. done
  4365. fi
  4366. AC_SUBST(CONF_FILES)
  4367. ])dnl
  4368. dnl This sets the prefix, for arts and kdelibs
  4369. dnl Do NOT use in any other module.
  4370. dnl It only looks at --prefix, KDEDIR and falls back to /usr/local/kde
  4371. AC_DEFUN([KDE_SET_PREFIX_CORE],
  4372. [
  4373. unset CDPATH
  4374. dnl make $KDEDIR the default for the installation
  4375. AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
  4376. if test "x$prefix" = "xNONE"; then
  4377. prefix=$ac_default_prefix
  4378. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4379. fi
  4380. # And delete superfluous '/' to make compares easier
  4381. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4382. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4383. kde_libs_prefix='$(prefix)'
  4384. kde_libs_htmldir='$(kde_htmldir)'
  4385. AC_SUBST(kde_libs_prefix)
  4386. AC_SUBST(kde_libs_htmldir)
  4387. KDE_FAST_CONFIGURE
  4388. KDE_CONF_FILES
  4389. ])
  4390. AC_DEFUN([KDE_SET_PREFIX],
  4391. [
  4392. unset CDPATH
  4393. dnl We can't give real code to that macro, only a value.
  4394. dnl It only matters for --help, since we set the prefix in this function anyway.
  4395. AC_PREFIX_DEFAULT(${KDEDIR:-the kde prefix})
  4396. KDE_SET_DEFAULT_BINDIRS
  4397. if test "x$prefix" = "xNONE"; then
  4398. dnl no prefix given: look for kde-config in the PATH and deduce the prefix from it
  4399. KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
  4400. else
  4401. dnl prefix given: look for kde-config, preferrably in prefix, otherwise in PATH
  4402. kde_save_PATH="$PATH"
  4403. PATH="$exec_prefix/bin:$prefix/bin:$PATH"
  4404. KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)], [], prepend)
  4405. PATH="$kde_save_PATH"
  4406. fi
  4407. kde_libs_prefix=`$KDECONFIG --prefix`
  4408. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  4409. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
  4410. This means it has been moved since you installed it.
  4411. This won't work. Please recompile kdelibs for the new prefix.
  4412. ])
  4413. fi
  4414. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  4415. AC_MSG_CHECKING([where to install])
  4416. if test "x$prefix" = "xNONE"; then
  4417. prefix=$kde_libs_prefix
  4418. AC_MSG_RESULT([$prefix (as returned by kde-config)])
  4419. else
  4420. dnl --prefix was given. Compare prefixes and warn (in configure.in.bot.end) if different
  4421. given_prefix=$prefix
  4422. AC_MSG_RESULT([$prefix (as requested)])
  4423. fi
  4424. # And delete superfluous '/' to make compares easier
  4425. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4426. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4427. given_prefix=`echo "$given_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4428. AC_SUBST(KDECONFIG)
  4429. AC_SUBST(kde_libs_prefix)
  4430. AC_SUBST(kde_libs_htmldir)
  4431. KDE_FAST_CONFIGURE
  4432. KDE_CONF_FILES
  4433. ])
  4434. pushdef([AC_PROG_INSTALL],
  4435. [
  4436. dnl our own version, testing for a -p flag
  4437. popdef([AC_PROG_INSTALL])
  4438. dnl as AC_PROG_INSTALL works as it works we first have
  4439. dnl to save if the user didn't specify INSTALL, as the
  4440. dnl autoconf one overwrites INSTALL and we have no chance to find
  4441. dnl out afterwards
  4442. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4443. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4444. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4445. AC_PROG_INSTALL
  4446. if test -z "$kde_save_INSTALL_given" ; then
  4447. # OK, user hasn't given any INSTALL, autoconf found one for us
  4448. # now we test, if it supports the -p flag
  4449. AC_MSG_CHECKING(for -p flag to install)
  4450. rm -f confinst.$$.* > /dev/null 2>&1
  4451. echo "Testtest" > confinst.$$.orig
  4452. ac_res=no
  4453. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4454. if test -f confinst.$$.new ; then
  4455. # OK, -p seems to do no harm to install
  4456. INSTALL="${INSTALL} -p"
  4457. ac_res=yes
  4458. fi
  4459. fi
  4460. rm -f confinst.$$.*
  4461. AC_MSG_RESULT($ac_res)
  4462. fi
  4463. dnl the following tries to resolve some signs and wonders coming up
  4464. dnl with different autoconf/automake versions
  4465. dnl e.g.:
  4466. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4467. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4468. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4469. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4470. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4471. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4472. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4473. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4474. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4475. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  4476. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4477. dnl and so does not see the -s flag in automake > 1.4
  4478. dnl to clean up that mess we:
  4479. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4480. dnl which cleans KDE's program with automake > 1.4;
  4481. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4482. dnl with automake<=1.4
  4483. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4484. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4485. dnl
  4486. dnl And to all this comes, that I even can't write in comments variable
  4487. dnl names used by automake, because it is so stupid to think I wanted to
  4488. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4489. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4490. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4491. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4492. fi
  4493. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4494. INSTALL_SCRIPT='${INSTALL}'
  4495. fi
  4496. ])dnl
  4497. AC_DEFUN([KDE_LANG_CPLUSPLUS],
  4498. [AC_LANG_CPLUSPLUS
  4499. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4500. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4501. ])
  4502. pushdef([AC_LANG_CPLUSPLUS],
  4503. [popdef([AC_LANG_CPLUSPLUS])
  4504. KDE_LANG_CPLUSPLUS
  4505. ])
  4506. AC_DEFUN([KDE_CHECK_LONG_LONG],
  4507. [
  4508. AC_MSG_CHECKING(for long long)
  4509. AC_CACHE_VAL(kde_cv_c_long_long,
  4510. [
  4511. AC_LANG_SAVE
  4512. AC_LANG_CPLUSPLUS
  4513. AC_TRY_LINK([], [
  4514. long long foo = 0;
  4515. foo = foo+1;
  4516. ],
  4517. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4518. AC_LANG_RESTORE
  4519. ])
  4520. AC_MSG_RESULT($kde_cv_c_long_long)
  4521. if test "$kde_cv_c_long_long" = yes; then
  4522. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4523. fi
  4524. ])
  4525. AC_DEFUN([KDE_CHECK_LIB],
  4526. [
  4527. kde_save_LDFLAGS="$LDFLAGS"
  4528. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4529. kde_save_LIBS="$LIBS"
  4530. LDFLAGS="$LDFLAGS $all_libraries"
  4531. case $host_os in
  4532. aix*) LDFLAGS="-brtl $LDFLAGS"
  4533. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4534. ;;
  4535. esac
  4536. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4537. LDFLAGS="$kde_save_LDFLAGS"
  4538. LIBS="$kde_save_LIBS"
  4539. ])
  4540. AC_DEFUN([KDE_JAVA_PREFIX],
  4541. [
  4542. dir=`dirname "$1"`
  4543. base=`basename "$1"`
  4544. list=`ls -1 $dir 2> /dev/null`
  4545. for entry in $list; do
  4546. if test -d $dir/$entry/bin; then
  4547. case $entry in
  4548. $base)
  4549. javadirs="$javadirs $dir/$entry/bin"
  4550. ;;
  4551. esac
  4552. elif test -d $dir/$entry/jre/bin; then
  4553. case $entry in
  4554. $base)
  4555. javadirs="$javadirs $dir/$entry/jre/bin"
  4556. ;;
  4557. esac
  4558. fi
  4559. done
  4560. ])
  4561. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4562. AC_DEFUN([KDE_CHECK_JAVA_DIR],
  4563. [
  4564. AC_ARG_WITH(java,
  4565. AC_HELP_STRING([--with-java=javadir],[use java installed in javadir, --without-java disables]),
  4566. [ ac_java_dir=$withval
  4567. ], ac_java_dir=""
  4568. )
  4569. AC_MSG_CHECKING([for Java])
  4570. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4571. if test "x$ac_java_dir" = "xno"; then
  4572. kde_java_bindir=no
  4573. kde_java_includedir=no
  4574. kde_java_libjvmdir=no
  4575. kde_java_libgcjdir=no
  4576. kde_java_libhpidir=no
  4577. else
  4578. if test "x$ac_java_dir" = "x"; then
  4579. dnl No option set -> collect list of candidate paths
  4580. if test -n "$JAVA_HOME"; then
  4581. KDE_JAVA_PREFIX($JAVA_HOME)
  4582. fi
  4583. KDE_JAVA_PREFIX(/usr/j2se)
  4584. KDE_JAVA_PREFIX(/usr/lib/j2se)
  4585. KDE_JAVA_PREFIX(/usr/j*dk*)
  4586. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4587. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4588. KDE_JAVA_PREFIX(/usr/lib/java*)
  4589. KDE_JAVA_PREFIX(/usr/java*)
  4590. KDE_JAVA_PREFIX(/usr/java/j*dk*)
  4591. KDE_JAVA_PREFIX(/usr/java/j*re*)
  4592. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4593. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4594. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4595. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4596. KDE_JAVA_PREFIX(/opt/java*)
  4597. kde_cv_path="NONE"
  4598. kde_save_IFS=$IFS
  4599. IFS=':'
  4600. for dir in $PATH; do
  4601. if test -d "$dir"; then
  4602. javadirs="$javadirs $dir"
  4603. fi
  4604. done
  4605. IFS=$kde_save_IFS
  4606. jredirs=
  4607. dnl Now javadirs contains a list of paths that exist, all ending with bin/
  4608. for dir in $javadirs; do
  4609. dnl Check for the java executable
  4610. if test -x "$dir/java"; then
  4611. sane_path=$(cd $dir; /bin/pwd)
  4612. dnl And also check for a libjvm.so somewhere under there
  4613. dnl Since we have to go to the parent dir, /usr/bin is excluded, /usr is too big.
  4614. if test "$sane_path" != "/usr/bin"; then
  4615. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4616. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4617. jredirs="$jredirs $dir"
  4618. fi
  4619. fi
  4620. done
  4621. dnl Now jredirs contains a reduced list, of paths where both java and ../**/libjvm.so was found
  4622. JAVAC=
  4623. JAVA=
  4624. kde_java_bindir=no
  4625. for dir in $jredirs; do
  4626. JAVA="$dir/java"
  4627. kde_java_bindir=$dir
  4628. if test -x "$dir/javac"; then
  4629. JAVAC="$dir/javac"
  4630. break
  4631. fi
  4632. done
  4633. if test -n "$JAVAC"; then
  4634. dnl this substitution might not work - well, we test for jni.h below
  4635. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4636. else
  4637. kde_java_includedir=no
  4638. fi
  4639. else
  4640. dnl config option set
  4641. kde_java_bindir=$ac_java_dir/bin
  4642. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4643. kde_java_includedir=no
  4644. else
  4645. kde_java_includedir=$ac_java_dir/include
  4646. fi
  4647. fi
  4648. fi
  4649. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4650. if test "x$kde_java_bindir" != "xno"; then
  4651. dnl Look for libjvm.so
  4652. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4653. dnl Look for libgcj.so
  4654. kde_java_libgcjdir=`find $kde_java_bindir/.. -name libgcj.so | sed 's,libgcj.so,,'|head -n 1`
  4655. dnl Look for libhpi.so and avoid green threads
  4656. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4657. dnl Now check everything's fine under there
  4658. dnl the include dir is our flag for having the JDK
  4659. if test -d "$kde_java_includedir"; then
  4660. if test ! -x "$kde_java_bindir/javac"; then
  4661. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4662. fi
  4663. if test ! -x "$kde_java_bindir/javah"; then
  4664. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4665. fi
  4666. if test ! -x "$kde_java_bindir/jar"; then
  4667. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4668. fi
  4669. if test ! -r "$kde_java_includedir/jni.h"; then
  4670. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4671. fi
  4672. jni_includes="-I$kde_java_includedir"
  4673. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4674. dnl and under linux here..
  4675. dnl not needed for gcj
  4676. if test "x$kde_java_libgcjdir" = "x"; then
  4677. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4678. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4679. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4680. fi
  4681. else
  4682. JAVAC=
  4683. jni_includes=
  4684. fi
  4685. if test "x$kde_java_libgcjdir" = "x"; then
  4686. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4687. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4688. fi
  4689. else
  4690. if test ! -r "$kde_java_libgcjdir/libgcj.so"; then
  4691. AC_MSG_ERROR([libgcj.so not found under $kde_java_libgcjdir. Use --without-java.])
  4692. fi
  4693. fi
  4694. if test ! -x "$kde_java_bindir/java"; then
  4695. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4696. fi
  4697. dnl not needed for gcj compile
  4698. if test "x$kde_java_libgcjdir" = "x"; then
  4699. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4700. AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
  4701. fi
  4702. fi
  4703. if test -n "$jni_includes"; then
  4704. dnl Check for JNI version
  4705. AC_LANG_SAVE
  4706. AC_LANG_CPLUSPLUS
  4707. ac_cxxflags_safe="$CXXFLAGS"
  4708. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4709. AC_TRY_COMPILE([
  4710. #include <jni.h>
  4711. ],
  4712. [
  4713. #ifndef JNI_VERSION_1_2
  4714. Syntax Error
  4715. #endif
  4716. ],[ kde_jni_works=yes ],
  4717. [ kde_jni_works=no ])
  4718. if test $kde_jni_works = no; then
  4719. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4720. You need to have Java Development Kit (JDK) version 1.2.
  4721. Use --with-java to specify another location.
  4722. Use --without-java to configure without java support.
  4723. Or download a newer JDK and try again.
  4724. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4725. fi
  4726. CXXFLAGS="$ac_cxxflags_safe"
  4727. AC_LANG_RESTORE
  4728. dnl All tests ok, inform and subst the variables
  4729. JAVAC=$kde_java_bindir/javac
  4730. JAVAH=$kde_java_bindir/javah
  4731. JAR=$kde_java_bindir/jar
  4732. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4733. if test "x$kde_java_libgcjdir" = "x"; then
  4734. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4735. else
  4736. JVMLIBS="-L$kde_java_libgcjdir -lgcj"
  4737. fi
  4738. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4739. else
  4740. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4741. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4742. fi
  4743. elif test -d "/Library/Java/Home"; then
  4744. kde_java_bindir="/Library/Java/Home/bin"
  4745. jni_includes="-I/Library/Java/Home/include"
  4746. JAVAC=$kde_java_bindir/javac
  4747. JAVAH=$kde_java_bindir/javah
  4748. JAR=$kde_java_bindir/jar
  4749. JVMLIBS="-Wl,-framework,JavaVM"
  4750. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4751. AC_MSG_RESULT([Apple Java Framework])
  4752. else
  4753. AC_MSG_RESULT([none found])
  4754. fi
  4755. AC_SUBST(JAVAC)
  4756. AC_SUBST(JAVAH)
  4757. AC_SUBST(JAR)
  4758. AC_SUBST(JVMLIBS)
  4759. AC_SUBST(jni_includes)
  4760. # for backward compat
  4761. kde_cv_java_includedir=$kde_java_includedir
  4762. kde_cv_java_bindir=$kde_java_bindir
  4763. ])
  4764. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4765. dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
  4766. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4767. dnl it. (matz@kde.org)
  4768. m4_define([mm_foreach],
  4769. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4770. m4_define([mm_car], [[$1]])
  4771. m4_define([mm_car2], [[$@]])
  4772. m4_define([_mm_foreach],
  4773. [m4_if(m4_quote($2), [], [],
  4774. [m4_define([$1], mm_car($2))$3[]_mm_foreach([$1],
  4775. mm_car2(m4_shift($2)),
  4776. [$3])])])
  4777. m4_define([AC_FOREACH],
  4778. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4779. AC_DEFUN([KDE_NEED_FLEX],
  4780. [
  4781. kde_libs_safe=$LIBS
  4782. LIBS="$LIBS $USER_LDFLAGS"
  4783. AM_PROG_LEX
  4784. LIBS=$kde_libs_safe
  4785. if test -z "$LEXLIB"; then
  4786. AC_MSG_ERROR([You need to have flex installed.])
  4787. fi
  4788. AC_SUBST(LEXLIB)
  4789. ])
  4790. AC_DEFUN([AC_PATH_QTOPIA],
  4791. [
  4792. dnl TODO: use AC_CACHE_VAL
  4793. if test -z "$1"; then
  4794. qtopia_minver_maj=1
  4795. qtopia_minver_min=5
  4796. qtopia_minver_pat=0
  4797. else
  4798. qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4799. qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4800. qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4801. fi
  4802. qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
  4803. qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
  4804. AC_REQUIRE([AC_PATH_QT])
  4805. AC_MSG_CHECKING([for Qtopia])
  4806. LIB_QTOPIA="-lqpe"
  4807. AC_SUBST(LIB_QTOPIA)
  4808. kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
  4809. ac_qtopia_incdir=NO
  4810. AC_ARG_WITH(qtopia-dir,
  4811. AC_HELP_STRING([--with-qtopia-dir=DIR],[where the root of Qtopia is installed]),
  4812. [ ac_qtopia_incdir="$withval"/include] )
  4813. qtopia_incdirs=""
  4814. for dir in $kde_qtopia_dirs; do
  4815. qtopia_incdirs="$qtopia_incdirs $dir/include"
  4816. done
  4817. if test ! "$ac_qtopia_incdir" = "NO"; then
  4818. qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
  4819. fi
  4820. qtopia_incdir=""
  4821. AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
  4822. ac_qtopia_incdir="$qtopia_incdir"
  4823. if test -z "$qtopia_incdir"; then
  4824. AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
  4825. fi
  4826. qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4827. qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4828. qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4829. qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
  4830. qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
  4831. if test "$qtopia_ver" -lt "$qtopia_minver"; then
  4832. AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
  4833. is required.])
  4834. fi
  4835. AC_LANG_SAVE
  4836. AC_LANG_CPLUSPLUS
  4837. ac_cxxflags_safe="$CXXFLAGS"
  4838. ac_ldflags_safe="$LDFLAGS"
  4839. ac_libs_safe="$LIBS"
  4840. CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
  4841. LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4842. LIBS="$LIBS $LIB_QTOPIA $LIBQT"
  4843. cat > conftest.$ac_ext <<EOF
  4844. #include "confdefs.h"
  4845. #include <qpe/qpeapplication.h>
  4846. #include <qpe/version.h>
  4847. int main( int argc, char **argv )
  4848. {
  4849. QPEApplication app( argc, argv );
  4850. return 0;
  4851. }
  4852. EOF
  4853. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4854. rm -f conftest*
  4855. else
  4856. rm -f conftest*
  4857. AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
  4858. the end of config.log])
  4859. fi
  4860. CXXFLAGS="$ac_cxxflags_safe"
  4861. LDFLAGS="$ac_ldflags_safe"
  4862. LIBS="$ac_libs_safe"
  4863. AC_LANG_RESTORE
  4864. QTOPIA_INCLUDES="-I$qtopia_incdir"
  4865. AC_SUBST(QTOPIA_INCLUDES)
  4866. AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
  4867. ])
  4868. AC_DEFUN([KDE_INIT_DOXYGEN],
  4869. [
  4870. AC_MSG_CHECKING([for Qt docs])
  4871. kde_qtdir=
  4872. if test "${with_qt_dir+set}" = set; then
  4873. kde_qtdir="$with_qt_dir"
  4874. fi
  4875. AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $QTDIR/doc/html /usr/share/doc/packages/qt3/html /usr/lib/qt/doc /usr/lib/qt3/doc /usr/lib/qt3/doc/html /usr/doc/qt3/html /usr/doc/qt3 /usr/share/doc/qt3-doc /usr/share/qt3/doc/html /usr/X11R6/share/doc/qt/html ], QTDOCDIR)
  4876. AC_MSG_RESULT($QTDOCDIR)
  4877. AC_SUBST(QTDOCDIR)
  4878. KDE_FIND_PATH(dot, DOT, [], [])
  4879. if test -n "$DOT"; then
  4880. KDE_HAVE_DOT="YES"
  4881. else
  4882. KDE_HAVE_DOT="NO"
  4883. fi
  4884. AC_SUBST(KDE_HAVE_DOT)
  4885. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4886. AC_SUBST(DOXYGEN)
  4887. DOXYGEN_PROJECT_NAME="$1"
  4888. DOXYGEN_PROJECT_NUMBER="$2"
  4889. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4890. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4891. KDE_HAS_DOXYGEN=no
  4892. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $QTDOCDIR/qsql.html; then
  4893. KDE_HAS_DOXYGEN=yes
  4894. fi
  4895. AC_SUBST(KDE_HAS_DOXYGEN)
  4896. ])
  4897. AC_DEFUN([AC_FIND_BZIP2],
  4898. [
  4899. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4900. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4901. [
  4902. AC_LANG_SAVE
  4903. AC_LANG_CPLUSPLUS
  4904. kde_save_LIBS="$LIBS"
  4905. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4906. kde_save_CXXFLAGS="$CXXFLAGS"
  4907. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  4908. AC_TRY_LINK(dnl
  4909. [
  4910. #define BZ_NO_STDIO
  4911. #include<bzlib.h>
  4912. ],
  4913. [ bz_stream s; (void) bzDecompress(&s); ],
  4914. eval "ac_cv_lib_bzip2='-lbz2'",
  4915. eval "ac_cv_lib_bzip2=no")
  4916. LIBS="$kde_save_LIBS"
  4917. CXXFLAGS="$kde_save_CXXFLAGS"
  4918. AC_LANG_RESTORE
  4919. ])dnl
  4920. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4921. if test ! "$ac_cv_lib_bzip2" = no; then
  4922. BZIP2DIR=bzip2
  4923. LIBBZ2="$ac_cv_lib_bzip2"
  4924. AC_SUBST(LIBBZ2)
  4925. else
  4926. cxx_shared_flag=
  4927. ld_shared_flag=
  4928. KDE_CHECK_COMPILER_FLAG(shared, [
  4929. ld_shared_flag="-shared"
  4930. ])
  4931. KDE_CHECK_COMPILER_FLAG(fPIC, [
  4932. cxx_shared_flag="-fPIC"
  4933. ])
  4934. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4935. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4936. [
  4937. AC_LANG_SAVE
  4938. AC_LANG_CPLUSPLUS
  4939. kde_save_LIBS="$LIBS"
  4940. LIBS="$all_libraries $USER_LDFLAGS $ld_shared_flag -lbz2 $LIBSOCKET"
  4941. kde_save_CXXFLAGS="$CXXFLAGS"
  4942. CXXFLAGS="$CFLAGS $cxx_shared_flag $all_includes $USER_INCLUDES"
  4943. AC_TRY_LINK(dnl
  4944. [
  4945. #define BZ_NO_STDIO
  4946. #include<bzlib.h>
  4947. ],
  4948. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4949. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4950. eval "ac_cv_lib_bzip2_prefix=no")
  4951. LIBS="$kde_save_LIBS"
  4952. CXXFLAGS="$kde_save_CXXFLAGS"
  4953. AC_LANG_RESTORE
  4954. ])dnl
  4955. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4956. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4957. BZIP2DIR=bzip2
  4958. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4959. AC_SUBST(LIBBZ2)
  4960. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4961. dnl else, we just ignore this
  4962. fi
  4963. fi
  4964. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  4965. ])
  4966. dnl ------------------------------------------------------------------------
  4967. dnl Try to find the SSL headers and libraries.
  4968. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  4969. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  4970. dnl ------------------------------------------------------------------------
  4971. dnl
  4972. AC_DEFUN([KDE_CHECK_SSL],
  4973. [
  4974. LIBSSL="-lssl -lcrypto"
  4975. AC_REQUIRE([KDE_CHECK_LIB64])
  4976. ac_ssl_includes=NO ac_ssl_libraries=NO
  4977. ssl_libraries=""
  4978. ssl_includes=""
  4979. AC_ARG_WITH(ssl-dir,
  4980. AC_HELP_STRING([--with-ssl-dir=DIR],[where the root of OpenSSL is installed]),
  4981. [ ac_ssl_includes="$withval"/include
  4982. ac_ssl_libraries="$withval"/lib$kdelibsuff
  4983. ])
  4984. want_ssl=yes
  4985. AC_ARG_WITH(ssl,
  4986. AC_HELP_STRING([--without-ssl],[disable SSL checks]),
  4987. [want_ssl=$withval])
  4988. if test $want_ssl = yes; then
  4989. AC_MSG_CHECKING(for OpenSSL)
  4990. AC_CACHE_VAL(ac_cv_have_ssl,
  4991. [#try to guess OpenSSL locations
  4992. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  4993. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  4994. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  4995. ac_ssl_includes="$ssl_incdir"
  4996. ssl_libdirs="/usr/lib$kdelibsuff /usr/local/lib$kdelibsuff /usr/ssl/lib$kdelibsuff /usr/local/ssl/lib$kdelibsuff $libdir $prefix/lib$kdelibsuff $exec_prefix/lib$kdelibsuff $kde_extra_libs"
  4997. if test ! "$ac_ssl_libraries" = "NO"; then
  4998. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  4999. fi
  5000. test=NONE
  5001. ssl_libdir=NONE
  5002. for dir in $ssl_libdirs; do
  5003. try="ls -1 $dir/libssl*"
  5004. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  5005. done
  5006. ac_ssl_libraries="$ssl_libdir"
  5007. ac_ldflags_safe="$LDFLAGS"
  5008. ac_libs_safe="$LIBS"
  5009. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  5010. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  5011. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  5012. ac_ssl_rsaref="yes"
  5013. ,
  5014. ac_ssl_rsaref="no"
  5015. )
  5016. LDFLAGS="$ac_ldflags_safe"
  5017. LIBS="$ac_libs_safe"
  5018. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  5019. have_ssl=no
  5020. else
  5021. have_ssl=yes;
  5022. fi
  5023. ])
  5024. eval "$ac_cv_have_ssl"
  5025. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  5026. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  5027. AC_MSG_RESULT($ac_ssl_rsaref)
  5028. AC_MSG_CHECKING([for easter eggs])
  5029. AC_MSG_RESULT([none found])
  5030. else
  5031. have_ssl=no
  5032. fi
  5033. if test "$have_ssl" = yes; then
  5034. AC_MSG_CHECKING(for OpenSSL version)
  5035. dnl Check for SSL version
  5036. AC_CACHE_VAL(ac_cv_ssl_version,
  5037. [
  5038. cat >conftest.$ac_ext <<EOF
  5039. #include <openssl/opensslv.h>
  5040. #include <stdio.h>
  5041. int main() {
  5042. #ifndef OPENSSL_VERSION_NUMBER
  5043. printf("ssl_version=\\"error\\"\n");
  5044. #else
  5045. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  5046. printf("ssl_version=\\"old\\"\n");
  5047. else
  5048. printf("ssl_version=\\"ok\\"\n");
  5049. #endif
  5050. return (0);
  5051. }
  5052. EOF
  5053. ac_save_CPPFLAGS=$CPPFLAGS
  5054. if test "$ac_ssl_includes" != "/usr/include"; then
  5055. CPPFLAGS="$CPPFLAGS -I$ac_ssl_includes"
  5056. fi
  5057. if AC_TRY_EVAL(ac_link); then
  5058. if eval `./conftest 2>&5`; then
  5059. if test $ssl_version = error; then
  5060. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  5061. else
  5062. if test $ssl_version = old; then
  5063. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  5064. have_ssl=no
  5065. fi
  5066. fi
  5067. ac_cv_ssl_version="ssl_version=$ssl_version"
  5068. else
  5069. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  5070. Check config.log, and if you can't figure it out, send a mail to
  5071. David Faure <faure@kde.org>, attaching your config.log])
  5072. fi
  5073. else
  5074. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  5075. Check config.log, and if you can't figure it out, send a mail to
  5076. David Faure <faure@kde.org>, attaching your config.log])
  5077. fi
  5078. CPPFLAGS=$ac_save_CPPFLAGS
  5079. ])
  5080. eval "$ac_cv_ssl_version"
  5081. AC_MSG_RESULT($ssl_version)
  5082. fi
  5083. if test "$have_ssl" != yes; then
  5084. LIBSSL="";
  5085. else
  5086. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  5087. ac_cv_have_ssl="have_ssl=yes \
  5088. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  5089. ssl_libraries="$ac_ssl_libraries"
  5090. ssl_includes="$ac_ssl_includes"
  5091. if test "$ac_ssl_rsaref" = yes; then
  5092. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  5093. fi
  5094. if test $ssl_version = "old"; then
  5095. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  5096. fi
  5097. fi
  5098. SSL_INCLUDES=
  5099. if test "$ssl_includes" = "/usr/include"; then
  5100. if test -f /usr/kerberos/include/krb5.h; then
  5101. SSL_INCLUDES="-I/usr/kerberos/include"
  5102. fi
  5103. elif test "$ssl_includes" != "/usr/local/include" && test -n "$ssl_includes"; then
  5104. SSL_INCLUDES="-I$ssl_includes"
  5105. fi
  5106. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries" || test "$ssl_libraries" = "NONE"; then
  5107. SSL_LDFLAGS=""
  5108. else
  5109. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  5110. fi
  5111. AC_SUBST(SSL_INCLUDES)
  5112. AC_SUBST(SSL_LDFLAGS)
  5113. AC_SUBST(LIBSSL)
  5114. ])
  5115. AC_DEFUN([KDE_CHECK_STRLCPY],
  5116. [
  5117. AC_REQUIRE([AC_CHECK_STRLCAT])
  5118. AC_REQUIRE([AC_CHECK_STRLCPY])
  5119. AC_CHECK_SIZEOF(size_t)
  5120. AC_CHECK_SIZEOF(unsigned long)
  5121. AC_MSG_CHECKING([sizeof size_t == sizeof unsigned long])
  5122. AC_TRY_COMPILE(,[
  5123. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  5124. choke me
  5125. #endif
  5126. ],AC_MSG_RESULT([yes]),[
  5127. AC_MSG_RESULT(no)
  5128. AC_MSG_ERROR([
  5129. Apparently on your system our assumption sizeof size_t == sizeof unsigned long
  5130. does not apply. Please mail kde-devel@kde.org with a description of your system!
  5131. ])
  5132. ])
  5133. ])
  5134. AC_DEFUN([KDE_CHECK_BINUTILS],
  5135. [
  5136. AC_MSG_CHECKING([if ld supports unversioned version maps])
  5137. kde_save_LDFLAGS="$LDFLAGS"
  5138. LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
  5139. echo "{ local: extern \"C++\" { foo }; };" > conftest.map
  5140. AC_TRY_LINK([int foo;],
  5141. [
  5142. #ifdef __INTEL_COMPILER
  5143. icc apparently does not support libtools version-info and version-script
  5144. at the same time. Dunno where the bug is, but until somebody figured out,
  5145. better disable the optional version scripts.
  5146. #endif
  5147. foo = 42;
  5148. ], kde_supports_versionmaps=yes, kde_supports_versionmaps=no)
  5149. LDFLAGS="$kde_save_LDFLAGS"
  5150. rm -f conftest.map
  5151. AM_CONDITIONAL(include_VERSION_SCRIPT,
  5152. [test "$kde_supports_versionmaps" = "yes" && test "$kde_use_debug_code" = "no"])
  5153. AC_MSG_RESULT($kde_supports_versionmaps)
  5154. ])
  5155. AC_DEFUN([AM_PROG_OBJC],[
  5156. AC_CHECK_PROGS(OBJC, gcc, gcc)
  5157. test -z "$OBJC" && AC_MSG_ERROR([no acceptable objective-c gcc found in \$PATH])
  5158. if test "x${OBJCFLAGS-unset}" = xunset; then
  5159. OBJCFLAGS="-g -O2"
  5160. fi
  5161. AC_SUBST(OBJCFLAGS)
  5162. _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES(OBJC)])
  5163. ])
  5164. AC_DEFUN([KDE_CHECK_PERL],
  5165. [
  5166. KDE_FIND_PATH(perl, PERL, [$bindir $exec_prefix/bin $prefix/bin], [
  5167. AC_MSG_ERROR([No Perl found in your $PATH.
  5168. We need perl to generate some code.])
  5169. ])
  5170. AC_SUBST(PERL)
  5171. ])
  5172. AC_DEFUN([KDE_CHECK_LARGEFILE],
  5173. [
  5174. AC_SYS_LARGEFILE
  5175. if test "$ac_cv_sys_file_offset_bits" != no; then
  5176. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  5177. fi
  5178. if test "x$ac_cv_sys_large_files" != "xno"; then
  5179. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=1"
  5180. fi
  5181. ])
  5182. dnl A small extension to PKG_CHECK_MODULES (defined in pkg.m4.in)
  5183. dnl which allows to search for libs that get installed into the KDE prefix.
  5184. dnl
  5185. dnl Syntax: KDE_PKG_CHECK_MODULES(KSTUFF, libkexif >= 0.2 glib = 1.3.4, action-if, action-not)
  5186. dnl defines KSTUFF_LIBS, KSTUFF_CFLAGS, see pkg-config man page
  5187. dnl also defines KSTUFF_PKG_ERRORS on error
  5188. AC_DEFUN([KDE_PKG_CHECK_MODULES], [
  5189. PKG_CONFIG_PATH="$prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5190. if test "$prefix" != "$kde_libs_prefix"; then
  5191. PKG_CONFIG_PATH="$kde_libs_prefix/lib${kdelibsuff}/pkgconfig:$PKG_CONFIG_PATH"
  5192. fi
  5193. export PKG_CONFIG_PATH
  5194. PKG_CHECK_MODULES([$1],[$2],[$3],[$4])
  5195. ])
  5196. dnl Check for PIE support in the compiler and linker
  5197. AC_DEFUN([KDE_CHECK_PIE_SUPPORT],
  5198. [
  5199. AC_CACHE_CHECK([for PIE support], kde_cv_val_pie_support,
  5200. [
  5201. AC_LANG_SAVE
  5202. AC_LANG_CPLUSPLUS
  5203. safe_CXXFLAGS=$CXXFLAGS
  5204. safe_LDFLAGS=$LDFLAGS
  5205. CXXFLAGS="$CXXFLAGS -fPIE"
  5206. LDFLAGS="$LDFLAGS -pie"
  5207. AC_TRY_LINK([int foo;], [], [kde_cv_val_pie_support=yes], [kde_cv_val_pie_support=no])
  5208. CXXFLAGS=$safe_CXXFLAGS
  5209. LDFLAGS=$safe_LDFLAGS
  5210. AC_LANG_RESTORE
  5211. ])
  5212. AC_MSG_CHECKING(if enabling -pie/fPIE support)
  5213. AC_ARG_ENABLE(pie,
  5214. AC_HELP_STRING([--enable-pie],[platform supports PIE linking [default=detect]]),
  5215. [kde_has_pie_support=$enableval],
  5216. [kde_has_pie_support=detect])
  5217. if test "$kde_has_pie_support" = "detect"; then
  5218. kde_has_pie_support=$kde_cv_val_pie_support
  5219. fi
  5220. AC_MSG_RESULT([$kde_has_pie_support])
  5221. KDE_USE_FPIE=""
  5222. KDE_USE_PIE=""
  5223. AC_SUBST([KDE_USE_FPIE])
  5224. AC_SUBST([KDE_USE_PIE])
  5225. if test "$kde_has_pie_support" = "yes"; then
  5226. KDE_USE_FPIE="-fPIE"
  5227. KDE_USE_PIE="-pie"
  5228. fi
  5229. ])
  5230. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
  5231. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
  5232. ## Free Software Foundation, Inc.
  5233. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  5234. ##
  5235. ## This file is free software; the Free Software Foundation gives
  5236. ## unlimited permission to copy and/or distribute it, with or without
  5237. ## modifications, as long as this notice is preserved.
  5238. # serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL
  5239. # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
  5240. # -----------------------------------------------------------
  5241. # If this macro is not defined by Autoconf, define it here.
  5242. m4_ifdef([AC_PROVIDE_IFELSE],
  5243. [],
  5244. [m4_define([AC_PROVIDE_IFELSE],
  5245. [m4_ifdef([AC_PROVIDE_$1],
  5246. [$2], [$3])])])
  5247. # AC_PROG_LIBTOOL
  5248. # ---------------
  5249. AC_DEFUN([AC_PROG_LIBTOOL],
  5250. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  5251. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  5252. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  5253. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  5254. [AC_LIBTOOL_CXX],
  5255. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  5256. ])])
  5257. dnl And a similar setup for Fortran 77 support
  5258. AC_PROVIDE_IFELSE([AC_PROG_F77],
  5259. [AC_LIBTOOL_F77],
  5260. [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
  5261. ])])
  5262. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  5263. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  5264. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  5265. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  5266. [AC_LIBTOOL_GCJ],
  5267. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  5268. [AC_LIBTOOL_GCJ],
  5269. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  5270. [AC_LIBTOOL_GCJ],
  5271. [ifdef([AC_PROG_GCJ],
  5272. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5273. ifdef([A][M_PROG_GCJ],
  5274. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  5275. ifdef([LT_AC_PROG_GCJ],
  5276. [define([LT_AC_PROG_GCJ],
  5277. defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
  5278. ])])# AC_PROG_LIBTOOL
  5279. # _AC_PROG_LIBTOOL
  5280. # ----------------
  5281. AC_DEFUN([_AC_PROG_LIBTOOL],
  5282. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  5283. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  5284. AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
  5285. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  5286. # This can be used to rebuild libtool when needed
  5287. LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
  5288. # Always use our own libtool.
  5289. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  5290. AC_SUBST(LIBTOOL)dnl
  5291. # Prevent multiple expansion
  5292. define([AC_PROG_LIBTOOL], [])
  5293. ])# _AC_PROG_LIBTOOL
  5294. # AC_LIBTOOL_SETUP
  5295. # ----------------
  5296. AC_DEFUN([AC_LIBTOOL_SETUP],
  5297. [AC_PREREQ(2.50)dnl
  5298. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  5299. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  5300. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  5301. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  5302. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  5303. AC_REQUIRE([AC_PROG_CC])dnl
  5304. AC_REQUIRE([AC_PROG_LD])dnl
  5305. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  5306. AC_REQUIRE([AC_PROG_NM])dnl
  5307. AC_REQUIRE([AC_PROG_LN_S])dnl
  5308. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  5309. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  5310. AC_REQUIRE([AC_OBJEXT])dnl
  5311. AC_REQUIRE([AC_EXEEXT])dnl
  5312. dnl
  5313. AC_LIBTOOL_SYS_MAX_CMD_LEN
  5314. AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  5315. AC_LIBTOOL_OBJDIR
  5316. AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  5317. _LT_AC_PROG_ECHO_BACKSLASH
  5318. case $host_os in
  5319. aix3*)
  5320. # AIX sometimes has problems with the GCC collect2 program. For some
  5321. # reason, if we set the COLLECT_NAMES environment variable, the problems
  5322. # vanish in a puff of smoke.
  5323. if test "X${COLLECT_NAMES+set}" != Xset; then
  5324. COLLECT_NAMES=
  5325. export COLLECT_NAMES
  5326. fi
  5327. ;;
  5328. esac
  5329. # Sed substitution that helps us do robust quoting. It backslashifies
  5330. # metacharacters that are still active within double-quoted strings.
  5331. Xsed='sed -e 1s/^X//'
  5332. [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
  5333. # Same as above, but do not quote variable references.
  5334. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
  5335. # Sed substitution to delay expansion of an escaped shell variable in a
  5336. # double_quote_subst'ed string.
  5337. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  5338. # Sed substitution to avoid accidental globbing in evaled expressions
  5339. no_glob_subst='s/\*/\\\*/g'
  5340. # Constants:
  5341. rm="rm -f"
  5342. # Global variables:
  5343. default_ofile=libtool
  5344. can_build_shared=yes
  5345. # All known linkers require a `.a' archive for static linking (except MSVC,
  5346. # which needs '.lib').
  5347. libext=a
  5348. ltmain="$ac_aux_dir/ltmain.sh"
  5349. ofile="$default_ofile"
  5350. with_gnu_ld="$lt_cv_prog_gnu_ld"
  5351. AC_CHECK_TOOL(AR, ar, false)
  5352. AC_CHECK_TOOL(RANLIB, ranlib, :)
  5353. AC_CHECK_TOOL(STRIP, strip, :)
  5354. old_CC="$CC"
  5355. old_CFLAGS="$CFLAGS"
  5356. # Set sane defaults for various variables
  5357. test -z "$AR" && AR=ar
  5358. test -z "$AR_FLAGS" && AR_FLAGS=cru
  5359. test -z "$AS" && AS=as
  5360. test -z "$CC" && CC=cc
  5361. test -z "$LTCC" && LTCC=$CC
  5362. test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
  5363. test -z "$DLLTOOL" && DLLTOOL=dlltool
  5364. test -z "$LD" && LD=ld
  5365. test -z "$LN_S" && LN_S="ln -s"
  5366. test -z "$MAGIC_CMD" && MAGIC_CMD=file
  5367. test -z "$NM" && NM=nm
  5368. test -z "$SED" && SED=sed
  5369. test -z "$OBJDUMP" && OBJDUMP=objdump
  5370. test -z "$RANLIB" && RANLIB=:
  5371. test -z "$STRIP" && STRIP=:
  5372. test -z "$ac_objext" && ac_objext=o
  5373. # Determine commands to create old-style static archives.
  5374. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
  5375. old_postinstall_cmds='chmod 644 $oldlib'
  5376. old_postuninstall_cmds=
  5377. if test -n "$RANLIB"; then
  5378. case $host_os in
  5379. openbsd*)
  5380. old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
  5381. ;;
  5382. *)
  5383. old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
  5384. ;;
  5385. esac
  5386. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  5387. fi
  5388. _LT_CC_BASENAME([$compiler])
  5389. # Only perform the check for file, if the check method requires it
  5390. case $deplibs_check_method in
  5391. file_magic*)
  5392. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  5393. AC_PATH_MAGIC
  5394. fi
  5395. ;;
  5396. esac
  5397. AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
  5398. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5399. enable_win32_dll=yes, enable_win32_dll=no)
  5400. AC_ARG_ENABLE([libtool-lock],
  5401. [AC_HELP_STRING([--disable-libtool-lock],
  5402. [avoid locking (might break parallel builds)])])
  5403. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5404. AC_ARG_WITH([pic],
  5405. [AC_HELP_STRING([--with-pic],
  5406. [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
  5407. [pic_mode="$withval"],
  5408. [pic_mode=default])
  5409. test -z "$pic_mode" && pic_mode=default
  5410. # Use C for the default configuration in the libtool script
  5411. tagname=
  5412. AC_LIBTOOL_LANG_C_CONFIG
  5413. _LT_AC_TAGCONFIG
  5414. ])# AC_LIBTOOL_SETUP
  5415. # _LT_AC_SYS_COMPILER
  5416. # -------------------
  5417. AC_DEFUN([_LT_AC_SYS_COMPILER],
  5418. [AC_REQUIRE([AC_PROG_CC])dnl
  5419. # If no C compiler was specified, use CC.
  5420. LTCC=${LTCC-"$CC"}
  5421. # If no C compiler flags were specified, use CFLAGS.
  5422. LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
  5423. # Allow CC to be a program name with arguments.
  5424. compiler=$CC
  5425. ])# _LT_AC_SYS_COMPILER
  5426. # _LT_CC_BASENAME(CC)
  5427. # -------------------
  5428. # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
  5429. AC_DEFUN([_LT_CC_BASENAME],
  5430. [for cc_temp in $1""; do
  5431. case $cc_temp in
  5432. compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
  5433. distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
  5434. \-*) ;;
  5435. *) break;;
  5436. esac
  5437. done
  5438. cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
  5439. ])
  5440. # _LT_COMPILER_BOILERPLATE
  5441. # ------------------------
  5442. # Check for compiler boilerplate output or warnings with
  5443. # the simple compiler test code.
  5444. AC_DEFUN([_LT_COMPILER_BOILERPLATE],
  5445. [ac_outfile=conftest.$ac_objext
  5446. printf "$lt_simple_compile_test_code" >conftest.$ac_ext
  5447. eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
  5448. _lt_compiler_boilerplate=`cat conftest.err`
  5449. $rm conftest*
  5450. ])# _LT_COMPILER_BOILERPLATE
  5451. # _LT_LINKER_BOILERPLATE
  5452. # ----------------------
  5453. # Check for linker boilerplate output or warnings with
  5454. # the simple link test code.
  5455. AC_DEFUN([_LT_LINKER_BOILERPLATE],
  5456. [ac_outfile=conftest.$ac_objext
  5457. printf "$lt_simple_link_test_code" >conftest.$ac_ext
  5458. eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
  5459. _lt_linker_boilerplate=`cat conftest.err`
  5460. $rm conftest*
  5461. ])# _LT_LINKER_BOILERPLATE
  5462. # _LT_AC_SYS_LIBPATH_AIX
  5463. # ----------------------
  5464. # Links a minimal program and checks the executable
  5465. # for the system default hardcoded library path. In most cases,
  5466. # this is /usr/lib:/lib, but when the MPI compilers are used
  5467. # the location of the communication and MPI libs are included too.
  5468. # If we don't find anything, use the default library path according
  5469. # to the aix ld manual.
  5470. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
  5471. [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
  5472. aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5473. }'`
  5474. # Check for a 64-bit object if we didn't find anything.
  5475. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  5476. }'`; fi],[])
  5477. if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  5478. ])# _LT_AC_SYS_LIBPATH_AIX
  5479. # _LT_AC_SHELL_INIT(ARG)
  5480. # ----------------------
  5481. AC_DEFUN([_LT_AC_SHELL_INIT],
  5482. [ifdef([AC_DIVERSION_NOTICE],
  5483. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  5484. [AC_DIVERT_PUSH(NOTICE)])
  5485. $1
  5486. AC_DIVERT_POP
  5487. ])# _LT_AC_SHELL_INIT
  5488. # _LT_AC_PROG_ECHO_BACKSLASH
  5489. # --------------------------
  5490. # Add some code to the start of the generated configure script which
  5491. # will find an echo command which doesn't interpret backslashes.
  5492. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
  5493. [_LT_AC_SHELL_INIT([
  5494. # Check that we are running under the correct shell.
  5495. SHELL=${CONFIG_SHELL-/bin/sh}
  5496. case X$ECHO in
  5497. X*--fallback-echo)
  5498. # Remove one level of quotation (which was required for Make).
  5499. ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  5500. ;;
  5501. esac
  5502. echo=${ECHO-echo}
  5503. if test "X[$]1" = X--no-reexec; then
  5504. # Discard the --no-reexec flag, and continue.
  5505. shift
  5506. elif test "X[$]1" = X--fallback-echo; then
  5507. # Avoid inline document here, it may be left over
  5508. :
  5509. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
  5510. # Yippee, $echo works!
  5511. :
  5512. else
  5513. # Restart under the correct shell.
  5514. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5515. fi
  5516. if test "X[$]1" = X--fallback-echo; then
  5517. # used as fallback echo
  5518. shift
  5519. cat <<EOF
  5520. [$]*
  5521. EOF
  5522. exit 0
  5523. fi
  5524. # The HP-UX ksh and POSIX shell print the target directory to stdout
  5525. # if CDPATH is set.
  5526. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  5527. if test -z "$ECHO"; then
  5528. if test "X${echo_test_string+set}" != Xset; then
  5529. # find a string as large as possible, as long as the shell can cope with it
  5530. for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  5531. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  5532. if (echo_test_string=`eval $cmd`) 2>/dev/null &&
  5533. echo_test_string=`eval $cmd` &&
  5534. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
  5535. then
  5536. break
  5537. fi
  5538. done
  5539. fi
  5540. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5541. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5542. test "X$echo_testing_string" = "X$echo_test_string"; then
  5543. :
  5544. else
  5545. # The Solaris, AIX, and Digital Unix default echo programs unquote
  5546. # backslashes. This makes it impossible to quote backslashes using
  5547. # echo "$something" | sed 's/\\/\\\\/g'
  5548. #
  5549. # So, first we look for a working echo in the user's PATH.
  5550. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  5551. for dir in $PATH /usr/ucb; do
  5552. IFS="$lt_save_ifs"
  5553. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  5554. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  5555. echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  5556. test "X$echo_testing_string" = "X$echo_test_string"; then
  5557. echo="$dir/echo"
  5558. break
  5559. fi
  5560. done
  5561. IFS="$lt_save_ifs"
  5562. if test "X$echo" = Xecho; then
  5563. # We didn't find a better echo, so look for alternatives.
  5564. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  5565. echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
  5566. test "X$echo_testing_string" = "X$echo_test_string"; then
  5567. # This shell has a builtin print -r that does the trick.
  5568. echo='print -r'
  5569. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  5570. test "X$CONFIG_SHELL" != X/bin/ksh; then
  5571. # If we have ksh, try running configure again with it.
  5572. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  5573. export ORIGINAL_CONFIG_SHELL
  5574. CONFIG_SHELL=/bin/ksh
  5575. export CONFIG_SHELL
  5576. exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  5577. else
  5578. # Try using printf.
  5579. echo='printf %s\n'
  5580. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  5581. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  5582. test "X$echo_testing_string" = "X$echo_test_string"; then
  5583. # Cool, printf works
  5584. :
  5585. elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5586. test "X$echo_testing_string" = 'X\t' &&
  5587. echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5588. test "X$echo_testing_string" = "X$echo_test_string"; then
  5589. CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  5590. export CONFIG_SHELL
  5591. SHELL="$CONFIG_SHELL"
  5592. export SHELL
  5593. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5594. elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  5595. test "X$echo_testing_string" = 'X\t' &&
  5596. echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5597. test "X$echo_testing_string" = "X$echo_test_string"; then
  5598. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5599. else
  5600. # maybe with a smaller string...
  5601. prev=:
  5602. for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  5603. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
  5604. then
  5605. break
  5606. fi
  5607. prev="$cmd"
  5608. done
  5609. if test "$prev" != 'sed 50q "[$]0"'; then
  5610. echo_test_string=`eval $prev`
  5611. export echo_test_string
  5612. exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  5613. else
  5614. # Oops. We lost completely, so just stick with echo.
  5615. echo=echo
  5616. fi
  5617. fi
  5618. fi
  5619. fi
  5620. fi
  5621. fi
  5622. # Copy echo and quote the copy suitably for passing to libtool from
  5623. # the Makefile, instead of quoting the original, which is used later.
  5624. ECHO=$echo
  5625. if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  5626. ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  5627. fi
  5628. AC_SUBST(ECHO)
  5629. ])])# _LT_AC_PROG_ECHO_BACKSLASH
  5630. # _LT_AC_LOCK
  5631. # -----------
  5632. AC_DEFUN([_LT_AC_LOCK],
  5633. [AC_ARG_ENABLE([libtool-lock],
  5634. [AC_HELP_STRING([--disable-libtool-lock],
  5635. [avoid locking (might break parallel builds)])])
  5636. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5637. # Some flags need to be propagated to the compiler or linker for good
  5638. # libtool support.
  5639. case $host in
  5640. ia64-*-hpux*)
  5641. # Find out which ABI we are using.
  5642. echo 'int i;' > conftest.$ac_ext
  5643. if AC_TRY_EVAL(ac_compile); then
  5644. case `/usr/bin/file conftest.$ac_objext` in
  5645. *ELF-32*)
  5646. HPUX_IA64_MODE="32"
  5647. ;;
  5648. *ELF-64*)
  5649. HPUX_IA64_MODE="64"
  5650. ;;
  5651. esac
  5652. fi
  5653. rm -rf conftest*
  5654. ;;
  5655. *-*-irix6*)
  5656. # Find out which ABI we are using.
  5657. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  5658. if AC_TRY_EVAL(ac_compile); then
  5659. if test "$lt_cv_prog_gnu_ld" = yes; then
  5660. case `/usr/bin/file conftest.$ac_objext` in
  5661. *32-bit*)
  5662. LD="${LD-ld} -melf32bsmip"
  5663. ;;
  5664. *N32*)
  5665. LD="${LD-ld} -melf32bmipn32"
  5666. ;;
  5667. *64-bit*)
  5668. LD="${LD-ld} -melf64bmip"
  5669. ;;
  5670. esac
  5671. else
  5672. case `/usr/bin/file conftest.$ac_objext` in
  5673. *32-bit*)
  5674. LD="${LD-ld} -32"
  5675. ;;
  5676. *N32*)
  5677. LD="${LD-ld} -n32"
  5678. ;;
  5679. *64-bit*)
  5680. LD="${LD-ld} -64"
  5681. ;;
  5682. esac
  5683. fi
  5684. fi
  5685. rm -rf conftest*
  5686. ;;
  5687. x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
  5688. # Find out which ABI we are using.
  5689. echo 'int i;' > conftest.$ac_ext
  5690. if AC_TRY_EVAL(ac_compile); then
  5691. case `/usr/bin/file conftest.o` in
  5692. *32-bit*)
  5693. case $host in
  5694. x86_64-*linux*)
  5695. LD="${LD-ld} -m elf_i386"
  5696. ;;
  5697. ppc64-*linux*|powerpc64-*linux*)
  5698. LD="${LD-ld} -m elf32ppclinux"
  5699. ;;
  5700. s390x-*linux*)
  5701. LD="${LD-ld} -m elf_s390"
  5702. ;;
  5703. sparc64-*linux*)
  5704. LD="${LD-ld} -m elf32_sparc"
  5705. ;;
  5706. esac
  5707. ;;
  5708. *64-bit*)
  5709. case $host in
  5710. x86_64-*linux*)
  5711. LD="${LD-ld} -m elf_x86_64"
  5712. ;;
  5713. ppc*-*linux*|powerpc*-*linux*)
  5714. LD="${LD-ld} -m elf64ppc"
  5715. ;;
  5716. s390*-*linux*)
  5717. LD="${LD-ld} -m elf64_s390"
  5718. ;;
  5719. sparc*-*linux*)
  5720. LD="${LD-ld} -m elf64_sparc"
  5721. ;;
  5722. esac
  5723. ;;
  5724. esac
  5725. fi
  5726. rm -rf conftest*
  5727. ;;
  5728. *-*-sco3.2v5*)
  5729. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  5730. SAVE_CFLAGS="$CFLAGS"
  5731. CFLAGS="$CFLAGS -belf"
  5732. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  5733. [AC_LANG_PUSH(C)
  5734. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  5735. AC_LANG_POP])
  5736. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  5737. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  5738. CFLAGS="$SAVE_CFLAGS"
  5739. fi
  5740. ;;
  5741. sparc*-*solaris*)
  5742. # Find out which ABI we are using.
  5743. echo 'int i;' > conftest.$ac_ext
  5744. if AC_TRY_EVAL(ac_compile); then
  5745. case `/usr/bin/file conftest.o` in
  5746. *64-bit*)
  5747. case $lt_cv_prog_gnu_ld in
  5748. yes*) LD="${LD-ld} -m elf64_sparc" ;;
  5749. *) LD="${LD-ld} -64" ;;
  5750. esac
  5751. ;;
  5752. esac
  5753. fi
  5754. rm -rf conftest*
  5755. ;;
  5756. AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
  5757. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  5758. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  5759. AC_CHECK_TOOL(AS, as, false)
  5760. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  5761. ;;
  5762. ])
  5763. esac
  5764. need_locks="$enable_libtool_lock"
  5765. ])# _LT_AC_LOCK
  5766. # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5767. # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  5768. # ----------------------------------------------------------------
  5769. # Check whether the given compiler option works
  5770. AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
  5771. [AC_REQUIRE([LT_AC_PROG_SED])
  5772. AC_CACHE_CHECK([$1], [$2],
  5773. [$2=no
  5774. ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  5775. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  5776. lt_compiler_flag="$3"
  5777. # Insert the option either (1) after the last *FLAGS variable, or
  5778. # (2) before a word containing "conftest.", or (3) at the end.
  5779. # Note that $ac_compile itself does not contain backslashes and begins
  5780. # with a dollar sign (not a hyphen), so the echo should work correctly.
  5781. # The option is referenced via a variable to avoid confusing sed.
  5782. lt_compile=`echo "$ac_compile" | $SED \
  5783. -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  5784. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  5785. -e 's:$: $lt_compiler_flag:'`
  5786. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  5787. (eval "$lt_compile" 2>conftest.err)
  5788. ac_status=$?
  5789. cat conftest.err >&AS_MESSAGE_LOG_FD
  5790. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  5791. if (exit $ac_status) && test -s "$ac_outfile"; then
  5792. # The compiler can only warn and ignore the option if not recognized
  5793. # So say no if there are warnings other than the usual output.
  5794. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
  5795. $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  5796. if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
  5797. $2=yes
  5798. fi
  5799. fi
  5800. $rm conftest*
  5801. ])
  5802. if test x"[$]$2" = xyes; then
  5803. ifelse([$5], , :, [$5])
  5804. else
  5805. ifelse([$6], , :, [$6])
  5806. fi
  5807. ])# AC_LIBTOOL_COMPILER_OPTION
  5808. # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5809. # [ACTION-SUCCESS], [ACTION-FAILURE])
  5810. # ------------------------------------------------------------
  5811. # Check whether the given compiler option works
  5812. AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
  5813. [AC_CACHE_CHECK([$1], [$2],
  5814. [$2=no
  5815. save_LDFLAGS="$LDFLAGS"
  5816. LDFLAGS="$LDFLAGS $3"
  5817. printf "$lt_simple_link_test_code" > conftest.$ac_ext
  5818. if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  5819. # The linker can only warn and ignore the option if not recognized
  5820. # So say no if there are warnings
  5821. if test -s conftest.err; then
  5822. # Append any errors to the config.log.
  5823. cat conftest.err 1>&AS_MESSAGE_LOG_FD
  5824. $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
  5825. $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
  5826. if diff conftest.exp conftest.er2 >/dev/null; then
  5827. $2=yes
  5828. fi
  5829. else
  5830. $2=yes
  5831. fi
  5832. fi
  5833. $rm conftest*
  5834. LDFLAGS="$save_LDFLAGS"
  5835. ])
  5836. if test x"[$]$2" = xyes; then
  5837. ifelse([$4], , :, [$4])
  5838. else
  5839. ifelse([$5], , :, [$5])
  5840. fi
  5841. ])# AC_LIBTOOL_LINKER_OPTION
  5842. # AC_LIBTOOL_SYS_MAX_CMD_LEN
  5843. # --------------------------
  5844. AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
  5845. [# find the maximum length of command line arguments
  5846. AC_MSG_CHECKING([the maximum length of command line arguments])
  5847. AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  5848. i=0
  5849. teststring="ABCD"
  5850. case $build_os in
  5851. msdosdjgpp*)
  5852. # On DJGPP, this test can blow up pretty badly due to problems in libc
  5853. # (any single argument exceeding 2000 bytes causes a buffer overrun
  5854. # during glob expansion). Even if it were fixed, the result of this
  5855. # check would be larger than it should be.
  5856. lt_cv_sys_max_cmd_len=12288; # 12K is about right
  5857. ;;
  5858. gnu*)
  5859. # Under GNU Hurd, this test is not required because there is
  5860. # no limit to the length of command line arguments.
  5861. # Libtool will interpret -1 as no limit whatsoever
  5862. lt_cv_sys_max_cmd_len=-1;
  5863. ;;
  5864. cygwin* | mingw*)
  5865. # On Win9x/ME, this test blows up -- it succeeds, but takes
  5866. # about 5 minutes as the teststring grows exponentially.
  5867. # Worse, since 9x/ME are not pre-emptively multitasking,
  5868. # you end up with a "frozen" computer, even though with patience
  5869. # the test eventually succeeds (with a max line length of 256k).
  5870. # Instead, let's just punt: use the minimum linelength reported by
  5871. # all of the supported platforms: 8192 (on NT/2K/XP).
  5872. lt_cv_sys_max_cmd_len=8192;
  5873. ;;
  5874. amigaos*)
  5875. # On AmigaOS with pdksh, this test takes hours, literally.
  5876. # So we just punt and use a minimum line length of 8192.
  5877. lt_cv_sys_max_cmd_len=8192;
  5878. ;;
  5879. netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
  5880. # This has been around since 386BSD, at least. Likely further.
  5881. if test -x /sbin/sysctl; then
  5882. lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
  5883. elif test -x /usr/sbin/sysctl; then
  5884. lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
  5885. else
  5886. lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
  5887. fi
  5888. # And add a safety zone
  5889. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
  5890. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
  5891. ;;
  5892. interix*)
  5893. # We know the value 262144 and hardcode it with a safety zone (like BSD)
  5894. lt_cv_sys_max_cmd_len=196608
  5895. ;;
  5896. osf*)
  5897. # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
  5898. # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
  5899. # nice to cause kernel panics so lets avoid the loop below.
  5900. # First set a reasonable default.
  5901. lt_cv_sys_max_cmd_len=16384
  5902. #
  5903. if test -x /sbin/sysconfig; then
  5904. case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
  5905. *1*) lt_cv_sys_max_cmd_len=-1 ;;
  5906. esac
  5907. fi
  5908. ;;
  5909. sco3.2v5*)
  5910. lt_cv_sys_max_cmd_len=102400
  5911. ;;
  5912. sysv5* | sco5v6* | sysv4.2uw2*)
  5913. kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
  5914. if test -n "$kargmax"; then
  5915. lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
  5916. else
  5917. lt_cv_sys_max_cmd_len=32768
  5918. fi
  5919. ;;
  5920. *)
  5921. # If test is not a shell built-in, we'll probably end up computing a
  5922. # maximum length that is only half of the actual maximum length, but
  5923. # we can't tell.
  5924. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
  5925. while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
  5926. = "XX$teststring") >/dev/null 2>&1 &&
  5927. new_result=`expr "X$teststring" : ".*" 2>&1` &&
  5928. lt_cv_sys_max_cmd_len=$new_result &&
  5929. test $i != 17 # 1/2 MB should be enough
  5930. do
  5931. i=`expr $i + 1`
  5932. teststring=$teststring$teststring
  5933. done
  5934. teststring=
  5935. # Add a significant safety factor because C++ compilers can tack on massive
  5936. # amounts of additional arguments before passing them to the linker.
  5937. # It appears as though 1/2 is a usable value.
  5938. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  5939. ;;
  5940. esac
  5941. ])
  5942. if test -n $lt_cv_sys_max_cmd_len ; then
  5943. AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  5944. else
  5945. AC_MSG_RESULT(none)
  5946. fi
  5947. ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
  5948. # _LT_AC_CHECK_DLFCN
  5949. # ------------------
  5950. AC_DEFUN([_LT_AC_CHECK_DLFCN],
  5951. [AC_CHECK_HEADERS(dlfcn.h)dnl
  5952. ])# _LT_AC_CHECK_DLFCN
  5953. # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  5954. # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  5955. # ---------------------------------------------------------------------
  5956. AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
  5957. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5958. if test "$cross_compiling" = yes; then :
  5959. [$4]
  5960. else
  5961. lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  5962. lt_status=$lt_dlunknown
  5963. cat > conftest.$ac_ext <<EOF
  5964. [#line __oline__ "configure"
  5965. #include "confdefs.h"
  5966. #if HAVE_DLFCN_H
  5967. #include <dlfcn.h>
  5968. #endif
  5969. #include <stdio.h>
  5970. #ifdef RTLD_GLOBAL
  5971. # define LT_DLGLOBAL RTLD_GLOBAL
  5972. #else
  5973. # ifdef DL_GLOBAL
  5974. # define LT_DLGLOBAL DL_GLOBAL
  5975. # else
  5976. # define LT_DLGLOBAL 0
  5977. # endif
  5978. #endif
  5979. /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  5980. find out it does not work in some platform. */
  5981. #ifndef LT_DLLAZY_OR_NOW
  5982. # ifdef RTLD_LAZY
  5983. # define LT_DLLAZY_OR_NOW RTLD_LAZY
  5984. # else
  5985. # ifdef DL_LAZY
  5986. # define LT_DLLAZY_OR_NOW DL_LAZY
  5987. # else
  5988. # ifdef RTLD_NOW
  5989. # define LT_DLLAZY_OR_NOW RTLD_NOW
  5990. # else
  5991. # ifdef DL_NOW
  5992. # define LT_DLLAZY_OR_NOW DL_NOW
  5993. # else
  5994. # define LT_DLLAZY_OR_NOW 0
  5995. # endif
  5996. # endif
  5997. # endif
  5998. # endif
  5999. #endif
  6000. #ifdef __cplusplus
  6001. extern "C" void exit (int);
  6002. #endif
  6003. void fnord() { int i=42;}
  6004. int main ()
  6005. {
  6006. void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  6007. int status = $lt_dlunknown;
  6008. if (self)
  6009. {
  6010. if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
  6011. else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  6012. /* dlclose (self); */
  6013. }
  6014. else
  6015. puts (dlerror ());
  6016. exit (status);
  6017. }]
  6018. EOF
  6019. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  6020. (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
  6021. lt_status=$?
  6022. case x$lt_status in
  6023. x$lt_dlno_uscore) $1 ;;
  6024. x$lt_dlneed_uscore) $2 ;;
  6025. x$lt_dlunknown|x*) $3 ;;
  6026. esac
  6027. else :
  6028. # compilation failed
  6029. $3
  6030. fi
  6031. fi
  6032. rm -fr conftest*
  6033. ])# _LT_AC_TRY_DLOPEN_SELF
  6034. # AC_LIBTOOL_DLOPEN_SELF
  6035. # ----------------------
  6036. AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
  6037. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  6038. if test "x$enable_dlopen" != xyes; then
  6039. enable_dlopen=unknown
  6040. enable_dlopen_self=unknown
  6041. enable_dlopen_self_static=unknown
  6042. else
  6043. lt_cv_dlopen=no
  6044. lt_cv_dlopen_libs=
  6045. case $host_os in
  6046. beos*)
  6047. lt_cv_dlopen="load_add_on"
  6048. lt_cv_dlopen_libs=
  6049. lt_cv_dlopen_self=yes
  6050. ;;
  6051. mingw* | pw32*)
  6052. lt_cv_dlopen="LoadLibrary"
  6053. lt_cv_dlopen_libs=
  6054. ;;
  6055. cygwin*)
  6056. lt_cv_dlopen="dlopen"
  6057. lt_cv_dlopen_libs=
  6058. ;;
  6059. darwin*)
  6060. # if libdl is installed we need to link against it
  6061. AC_CHECK_LIB([dl], [dlopen],
  6062. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
  6063. lt_cv_dlopen="dyld"
  6064. lt_cv_dlopen_libs=
  6065. lt_cv_dlopen_self=yes
  6066. ])
  6067. ;;
  6068. *)
  6069. AC_CHECK_FUNC([shl_load],
  6070. [lt_cv_dlopen="shl_load"],
  6071. [AC_CHECK_LIB([dld], [shl_load],
  6072. [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
  6073. [AC_CHECK_FUNC([dlopen],
  6074. [lt_cv_dlopen="dlopen"],
  6075. [AC_CHECK_LIB([dl], [dlopen],
  6076. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  6077. [AC_CHECK_LIB([svld], [dlopen],
  6078. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  6079. [AC_CHECK_LIB([dld], [dld_link],
  6080. [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
  6081. ])
  6082. ])
  6083. ])
  6084. ])
  6085. ])
  6086. ;;
  6087. esac
  6088. if test "x$lt_cv_dlopen" != xno; then
  6089. enable_dlopen=yes
  6090. else
  6091. enable_dlopen=no
  6092. fi
  6093. case $lt_cv_dlopen in
  6094. dlopen)
  6095. save_CPPFLAGS="$CPPFLAGS"
  6096. test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  6097. save_LDFLAGS="$LDFLAGS"
  6098. wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  6099. save_LIBS="$LIBS"
  6100. LIBS="$lt_cv_dlopen_libs $LIBS"
  6101. AC_CACHE_CHECK([whether a program can dlopen itself],
  6102. lt_cv_dlopen_self, [dnl
  6103. _LT_AC_TRY_DLOPEN_SELF(
  6104. lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  6105. lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  6106. ])
  6107. if test "x$lt_cv_dlopen_self" = xyes; then
  6108. wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
  6109. AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  6110. lt_cv_dlopen_self_static, [dnl
  6111. _LT_AC_TRY_DLOPEN_SELF(
  6112. lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  6113. lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
  6114. ])
  6115. fi
  6116. CPPFLAGS="$save_CPPFLAGS"
  6117. LDFLAGS="$save_LDFLAGS"
  6118. LIBS="$save_LIBS"
  6119. ;;
  6120. esac
  6121. case $lt_cv_dlopen_self in
  6122. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  6123. *) enable_dlopen_self=unknown ;;
  6124. esac
  6125. case $lt_cv_dlopen_self_static in
  6126. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  6127. *) enable_dlopen_self_static=unknown ;;
  6128. esac
  6129. fi
  6130. ])# AC_LIBTOOL_DLOPEN_SELF
  6131. # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
  6132. # ---------------------------------
  6133. # Check to see if options -c and -o are simultaneously supported by compiler
  6134. AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
  6135. [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  6136. AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  6137. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  6138. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  6139. $rm -r conftest 2>/dev/null
  6140. mkdir conftest
  6141. cd conftest
  6142. mkdir out
  6143. printf "$lt_simple_compile_test_code" > conftest.$ac_ext
  6144. lt_compiler_flag="-o out/conftest2.$ac_objext"
  6145. # Insert the option either (1) after the last *FLAGS variable, or
  6146. # (2) before a word containing "conftest.", or (3) at the end.
  6147. # Note that $ac_compile itself does not contain backslashes and begins
  6148. # with a dollar sign (not a hyphen), so the echo should work correctly.
  6149. lt_compile=`echo "$ac_compile" | $SED \
  6150. -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
  6151. -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
  6152. -e 's:$: $lt_compiler_flag:'`
  6153. (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
  6154. (eval "$lt_compile" 2>out/conftest.err)
  6155. ac_status=$?
  6156. cat out/conftest.err >&AS_MESSAGE_LOG_FD
  6157. echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
  6158. if (exit $ac_status) && test -s out/conftest2.$ac_objext
  6159. then
  6160. # The compiler can only warn and ignore the option if not recognized
  6161. # So say no if there are warnings
  6162. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
  6163. $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
  6164. if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
  6165. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  6166. fi
  6167. fi
  6168. chmod u+w . 2>&AS_MESSAGE_LOG_FD
  6169. $rm conftest*
  6170. # SGI C++ compiler will create directory out/ii_files/ for
  6171. # template instantiation
  6172. test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
  6173. $rm out/* && rmdir out
  6174. cd ..
  6175. rmdir conftest
  6176. $rm conftest*
  6177. ])
  6178. ])# AC_LIBTOOL_PROG_CC_C_O
  6179. # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
  6180. # -----------------------------------------
  6181. # Check to see if we can do hard links to lock some files if needed
  6182. AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
  6183. [AC_REQUIRE([_LT_AC_LOCK])dnl
  6184. hard_links="nottested"
  6185. if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  6186. # do not overwrite the value of need_locks provided by the user
  6187. AC_MSG_CHECKING([if we can lock with hard links])
  6188. hard_links=yes
  6189. $rm conftest*
  6190. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  6191. touch conftest.a
  6192. ln conftest.a conftest.b 2>&5 || hard_links=no
  6193. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  6194. AC_MSG_RESULT([$hard_links])
  6195. if test "$hard_links" = no; then
  6196. AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  6197. need_locks=warn
  6198. fi
  6199. else
  6200. need_locks=no
  6201. fi
  6202. ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
  6203. # AC_LIBTOOL_OBJDIR
  6204. # -----------------
  6205. AC_DEFUN([AC_LIBTOOL_OBJDIR],
  6206. [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  6207. [rm -f .libs 2>/dev/null
  6208. mkdir .libs 2>/dev/null
  6209. if test -d .libs; then
  6210. lt_cv_objdir=.libs
  6211. else
  6212. # MS-DOS does not allow filenames that begin with a dot.
  6213. lt_cv_objdir=_libs
  6214. fi
  6215. rmdir .libs 2>/dev/null])
  6216. objdir=$lt_cv_objdir
  6217. ])# AC_LIBTOOL_OBJDIR
  6218. # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
  6219. # ----------------------------------------------
  6220. # Check hardcoding attributes.
  6221. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
  6222. [AC_MSG_CHECKING([how to hardcode library paths into programs])
  6223. _LT_AC_TAGVAR(hardcode_action, $1)=
  6224. if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
  6225. test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
  6226. test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
  6227. # We can hardcode non-existant directories.
  6228. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
  6229. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  6230. # have to relink, otherwise we might link with an installed library
  6231. # when we should be linking with a yet-to-be-installed one
  6232. ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  6233. test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
  6234. # Linking always hardcodes the temporary library directory.
  6235. _LT_AC_TAGVAR(hardcode_action, $1)=relink
  6236. else
  6237. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  6238. _LT_AC_TAGVAR(hardcode_action, $1)=immediate
  6239. fi
  6240. else
  6241. # We cannot hardcode anything, or else we can only hardcode existing
  6242. # directories.
  6243. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
  6244. fi
  6245. AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
  6246. if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
  6247. # Fast installation is not supported
  6248. enable_fast_install=no
  6249. elif test "$shlibpath_overrides_runpath" = yes ||
  6250. test "$enable_shared" = no; then
  6251. # Fast installation is not necessary
  6252. enable_fast_install=needless
  6253. fi
  6254. ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
  6255. # AC_LIBTOOL_SYS_LIB_STRIP
  6256. # ------------------------
  6257. AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
  6258. [striplib=
  6259. old_striplib=
  6260. AC_MSG_CHECKING([whether stripping libraries is possible])
  6261. if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  6262. test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  6263. test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  6264. AC_MSG_RESULT([yes])
  6265. else
  6266. # FIXME - insert some real tests, host_os isn't really good enough
  6267. case $host_os in
  6268. darwin*)
  6269. if test -n "$STRIP" ; then
  6270. striplib="$STRIP -x"
  6271. AC_MSG_RESULT([yes])
  6272. else
  6273. AC_MSG_RESULT([no])
  6274. fi
  6275. ;;
  6276. *)
  6277. AC_MSG_RESULT([no])
  6278. ;;
  6279. esac
  6280. fi
  6281. ])# AC_LIBTOOL_SYS_LIB_STRIP
  6282. # AC_LIBTOOL_SYS_DYNAMIC_LINKER
  6283. # -----------------------------
  6284. # PORTME Fill in your ld.so characteristics
  6285. AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
  6286. [AC_MSG_CHECKING([dynamic linker characteristics])
  6287. library_names_spec=
  6288. libname_spec='lib$name'
  6289. soname_spec=
  6290. shrext_cmds=".so"
  6291. postinstall_cmds=
  6292. postuninstall_cmds=
  6293. finish_cmds=
  6294. finish_eval=
  6295. shlibpath_var=
  6296. shlibpath_overrides_runpath=unknown
  6297. version_type=none
  6298. dynamic_linker="$host_os ld.so"
  6299. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  6300. if test "$GCC" = yes; then
  6301. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  6302. if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
  6303. # if the path contains ";" then we assume it to be the separator
  6304. # otherwise default to the standard path separator (i.e. ":") - it is
  6305. # assumed that no part of a normal pathname contains ";" but that should
  6306. # okay in the real world where ";" in dirpaths is itself problematic.
  6307. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  6308. else
  6309. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  6310. fi
  6311. else
  6312. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  6313. fi
  6314. need_lib_prefix=unknown
  6315. hardcode_into_libs=no
  6316. # when you set need_version to no, make sure it does not cause -set_version
  6317. # flags to be left without arguments
  6318. need_version=unknown
  6319. case $host_os in
  6320. aix3*)
  6321. version_type=linux
  6322. library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
  6323. shlibpath_var=LIBPATH
  6324. # AIX 3 has no versioning support, so we append a major version to the name.
  6325. soname_spec='${libname}${release}${shared_ext}$major'
  6326. ;;
  6327. aix4* | aix5*)
  6328. version_type=linux
  6329. need_lib_prefix=no
  6330. need_version=no
  6331. hardcode_into_libs=yes
  6332. if test "$host_cpu" = ia64; then
  6333. # AIX 5 supports IA64
  6334. library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
  6335. shlibpath_var=LD_LIBRARY_PATH
  6336. else
  6337. # With GCC up to 2.95.x, collect2 would create an import file
  6338. # for dependence libraries. The import file would start with
  6339. # the line `#! .'. This would cause the generated library to
  6340. # depend on `.', always an invalid library. This was fixed in
  6341. # development snapshots of GCC prior to 3.0.
  6342. case $host_os in
  6343. aix4 | aix4.[[01]] | aix4.[[01]].*)
  6344. if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  6345. echo ' yes '
  6346. echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
  6347. :
  6348. else
  6349. can_build_shared=no
  6350. fi
  6351. ;;
  6352. esac
  6353. # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
  6354. # soname into executable. Probably we can add versioning support to
  6355. # collect2, so additional links can be useful in future.
  6356. if test "$aix_use_runtimelinking" = yes; then
  6357. # If using run time linking (on AIX 4.2 or later) use lib<name>.so
  6358. # instead of lib<name>.a to let people know that these are not
  6359. # typical AIX shared libraries.
  6360. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6361. else
  6362. # We preserve .a as extension for shared libraries through AIX4.2
  6363. # and later when we are not doing run time linking.
  6364. library_names_spec='${libname}${release}.a $libname.a'
  6365. soname_spec='${libname}${release}${shared_ext}$major'
  6366. fi
  6367. shlibpath_var=LIBPATH
  6368. fi
  6369. ;;
  6370. amigaos*)
  6371. library_names_spec='$libname.ixlibrary $libname.a'
  6372. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  6373. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
  6374. ;;
  6375. beos*)
  6376. library_names_spec='${libname}${shared_ext}'
  6377. dynamic_linker="$host_os ld.so"
  6378. shlibpath_var=LIBRARY_PATH
  6379. ;;
  6380. bsdi[[45]]*)
  6381. version_type=linux
  6382. need_version=no
  6383. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6384. soname_spec='${libname}${release}${shared_ext}$major'
  6385. finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  6386. shlibpath_var=LD_LIBRARY_PATH
  6387. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  6388. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  6389. # the default ld.so.conf also contains /usr/contrib/lib and
  6390. # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  6391. # libtool to hard-code these into programs
  6392. ;;
  6393. cygwin* | mingw* | pw32*)
  6394. version_type=windows
  6395. shrext_cmds=".dll"
  6396. need_version=no
  6397. need_lib_prefix=no
  6398. case $GCC,$host_os in
  6399. yes,cygwin* | yes,mingw* | yes,pw32*)
  6400. library_names_spec='$libname.dll.a'
  6401. # DLL is installed to $(libdir)/../bin by postinstall_cmds
  6402. postinstall_cmds='base_file=`basename \${file}`~
  6403. dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
  6404. dldir=$destdir/`dirname \$dlpath`~
  6405. test -d \$dldir || mkdir -p \$dldir~
  6406. $install_prog $dir/$dlname \$dldir/$dlname~
  6407. chmod a+x \$dldir/$dlname'
  6408. postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
  6409. dlpath=$dir/\$dldll~
  6410. $rm \$dlpath'
  6411. shlibpath_overrides_runpath=yes
  6412. case $host_os in
  6413. cygwin*)
  6414. # Cygwin DLLs use 'cyg' prefix rather than 'lib'
  6415. soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6416. sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
  6417. ;;
  6418. mingw*)
  6419. # MinGW DLLs use traditional 'lib' prefix
  6420. soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6421. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
  6422. if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
  6423. # It is most probably a Windows format PATH printed by
  6424. # mingw gcc, but we are running on Cygwin. Gcc prints its search
  6425. # path with ; separators, and with drive letters. We can handle the
  6426. # drive letters (cygwin fileutils understands them), so leave them,
  6427. # especially as we might pass files found there to a mingw objdump,
  6428. # which wouldn't understand a cygwinified path. Ahh.
  6429. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
  6430. else
  6431. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
  6432. fi
  6433. ;;
  6434. pw32*)
  6435. # pw32 DLLs use 'pw' prefix rather than 'lib'
  6436. library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
  6437. ;;
  6438. esac
  6439. ;;
  6440. *)
  6441. library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
  6442. ;;
  6443. esac
  6444. dynamic_linker='Win32 ld.exe'
  6445. # FIXME: first we should search . and the directory the executable is in
  6446. shlibpath_var=PATH
  6447. ;;
  6448. darwin* | rhapsody*)
  6449. dynamic_linker="$host_os dyld"
  6450. version_type=darwin
  6451. need_lib_prefix=no
  6452. need_version=no
  6453. library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
  6454. soname_spec='${libname}${release}${major}$shared_ext'
  6455. shlibpath_overrides_runpath=yes
  6456. shlibpath_var=DYLD_LIBRARY_PATH
  6457. shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
  6458. # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
  6459. if test "$GCC" = yes; then
  6460. sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
  6461. else
  6462. sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
  6463. fi
  6464. sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
  6465. ;;
  6466. dgux*)
  6467. version_type=linux
  6468. need_lib_prefix=no
  6469. need_version=no
  6470. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
  6471. soname_spec='${libname}${release}${shared_ext}$major'
  6472. shlibpath_var=LD_LIBRARY_PATH
  6473. ;;
  6474. freebsd1*)
  6475. dynamic_linker=no
  6476. ;;
  6477. freebsd* | dragonfly*)
  6478. # DragonFly does not have aout. When/if they implement a new
  6479. # versioning mechanism, adjust this.
  6480. if test -x /usr/bin/objformat; then
  6481. objformat=`/usr/bin/objformat`
  6482. else
  6483. case $host_os in
  6484. freebsd[[123]]*) objformat=aout ;;
  6485. *) objformat=elf ;;
  6486. esac
  6487. fi
  6488. version_type=freebsd-$objformat
  6489. case $version_type in
  6490. freebsd-elf*)
  6491. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  6492. need_version=no
  6493. need_lib_prefix=no
  6494. ;;
  6495. freebsd-*)
  6496. library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
  6497. need_version=yes
  6498. ;;
  6499. esac
  6500. shlibpath_var=LD_LIBRARY_PATH
  6501. case $host_os in
  6502. freebsd2*)
  6503. shlibpath_overrides_runpath=yes
  6504. ;;
  6505. freebsd3.[[01]]* | freebsdelf3.[[01]]*)
  6506. shlibpath_overrides_runpath=yes
  6507. hardcode_into_libs=yes
  6508. ;;
  6509. freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
  6510. freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
  6511. shlibpath_overrides_runpath=no
  6512. hardcode_into_libs=yes
  6513. ;;
  6514. freebsd*) # from 4.6 on
  6515. shlibpath_overrides_runpath=yes
  6516. hardcode_into_libs=yes
  6517. ;;
  6518. esac
  6519. ;;
  6520. gnu*)
  6521. version_type=linux
  6522. need_lib_prefix=no
  6523. need_version=no
  6524. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
  6525. soname_spec='${libname}${release}${shared_ext}$major'
  6526. shlibpath_var=LD_LIBRARY_PATH
  6527. hardcode_into_libs=yes
  6528. ;;
  6529. hpux9* | hpux10* | hpux11*)
  6530. # Give a soname corresponding to the major version so that dld.sl refuses to
  6531. # link against other versions.
  6532. version_type=sunos
  6533. need_lib_prefix=no
  6534. need_version=no
  6535. case $host_cpu in
  6536. ia64*)
  6537. shrext_cmds='.so'
  6538. hardcode_into_libs=yes
  6539. dynamic_linker="$host_os dld.so"
  6540. shlibpath_var=LD_LIBRARY_PATH
  6541. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  6542. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6543. soname_spec='${libname}${release}${shared_ext}$major'
  6544. if test "X$HPUX_IA64_MODE" = X32; then
  6545. sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
  6546. else
  6547. sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
  6548. fi
  6549. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  6550. ;;
  6551. hppa*64*)
  6552. shrext_cmds='.sl'
  6553. hardcode_into_libs=yes
  6554. dynamic_linker="$host_os dld.sl"
  6555. shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
  6556. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  6557. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6558. soname_spec='${libname}${release}${shared_ext}$major'
  6559. sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
  6560. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  6561. ;;
  6562. *)
  6563. shrext_cmds='.sl'
  6564. dynamic_linker="$host_os dld.sl"
  6565. shlibpath_var=SHLIB_PATH
  6566. shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  6567. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6568. soname_spec='${libname}${release}${shared_ext}$major'
  6569. ;;
  6570. esac
  6571. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  6572. postinstall_cmds='chmod 555 $lib'
  6573. ;;
  6574. interix3*)
  6575. version_type=linux
  6576. need_lib_prefix=no
  6577. need_version=no
  6578. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6579. soname_spec='${libname}${release}${shared_ext}$major'
  6580. dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
  6581. shlibpath_var=LD_LIBRARY_PATH
  6582. shlibpath_overrides_runpath=no
  6583. hardcode_into_libs=yes
  6584. ;;
  6585. irix5* | irix6* | nonstopux*)
  6586. case $host_os in
  6587. nonstopux*) version_type=nonstopux ;;
  6588. *)
  6589. if test "$lt_cv_prog_gnu_ld" = yes; then
  6590. version_type=linux
  6591. else
  6592. version_type=irix
  6593. fi ;;
  6594. esac
  6595. need_lib_prefix=no
  6596. need_version=no
  6597. soname_spec='${libname}${release}${shared_ext}$major'
  6598. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
  6599. case $host_os in
  6600. irix5* | nonstopux*)
  6601. libsuff= shlibsuff=
  6602. ;;
  6603. *)
  6604. case $LD in # libtool.m4 will add one of these switches to LD
  6605. *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
  6606. libsuff= shlibsuff= libmagic=32-bit;;
  6607. *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
  6608. libsuff=32 shlibsuff=N32 libmagic=N32;;
  6609. *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
  6610. libsuff=64 shlibsuff=64 libmagic=64-bit;;
  6611. *) libsuff= shlibsuff= libmagic=never-match;;
  6612. esac
  6613. ;;
  6614. esac
  6615. shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  6616. shlibpath_overrides_runpath=no
  6617. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  6618. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  6619. hardcode_into_libs=yes
  6620. ;;
  6621. # No shared lib support for Linux oldld, aout, or coff.
  6622. linux*oldld* | linux*aout* | linux*coff*)
  6623. dynamic_linker=no
  6624. ;;
  6625. # This must be Linux ELF.
  6626. linux* | k*bsd*-gnu)
  6627. version_type=linux
  6628. need_lib_prefix=no
  6629. need_version=no
  6630. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6631. soname_spec='${libname}${release}${shared_ext}$major'
  6632. finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  6633. shlibpath_var=LD_LIBRARY_PATH
  6634. shlibpath_overrides_runpath=no
  6635. # This implies no fast_install, which is unacceptable.
  6636. # Some rework will be needed to allow for fast_install
  6637. # before this can be enabled.
  6638. hardcode_into_libs=yes
  6639. # Append ld.so.conf contents to the search path
  6640. if test -f /etc/ld.so.conf; then
  6641. lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
  6642. sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
  6643. fi
  6644. # We used to test for /lib/ld.so.1 and disable shared libraries on
  6645. # powerpc, because MkLinux only supported shared libraries with the
  6646. # GNU dynamic linker. Since this was broken with cross compilers,
  6647. # most powerpc-linux boxes support dynamic linking these days and
  6648. # people can always --disable-shared, the test was removed, and we
  6649. # assume the GNU/Linux dynamic linker is in use.
  6650. dynamic_linker='GNU/Linux ld.so'
  6651. ;;
  6652. netbsdelf*-gnu)
  6653. version_type=linux
  6654. need_lib_prefix=no
  6655. need_version=no
  6656. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6657. soname_spec='${libname}${release}${shared_ext}$major'
  6658. shlibpath_var=LD_LIBRARY_PATH
  6659. shlibpath_overrides_runpath=no
  6660. hardcode_into_libs=yes
  6661. dynamic_linker='NetBSD ld.elf_so'
  6662. ;;
  6663. netbsd*)
  6664. version_type=sunos
  6665. need_lib_prefix=no
  6666. need_version=no
  6667. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  6668. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  6669. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6670. dynamic_linker='NetBSD (a.out) ld.so'
  6671. else
  6672. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
  6673. soname_spec='${libname}${release}${shared_ext}$major'
  6674. dynamic_linker='NetBSD ld.elf_so'
  6675. fi
  6676. shlibpath_var=LD_LIBRARY_PATH
  6677. shlibpath_overrides_runpath=yes
  6678. hardcode_into_libs=yes
  6679. ;;
  6680. newsos6)
  6681. version_type=linux
  6682. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6683. shlibpath_var=LD_LIBRARY_PATH
  6684. shlibpath_overrides_runpath=yes
  6685. ;;
  6686. nto-qnx*)
  6687. version_type=linux
  6688. need_lib_prefix=no
  6689. need_version=no
  6690. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6691. soname_spec='${libname}${release}${shared_ext}$major'
  6692. shlibpath_var=LD_LIBRARY_PATH
  6693. shlibpath_overrides_runpath=yes
  6694. ;;
  6695. openbsd*)
  6696. version_type=sunos
  6697. sys_lib_dlsearch_path_spec="/usr/lib"
  6698. need_lib_prefix=no
  6699. # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
  6700. case $host_os in
  6701. openbsd3.3 | openbsd3.3.*) need_version=yes ;;
  6702. *) need_version=no ;;
  6703. esac
  6704. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  6705. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6706. shlibpath_var=LD_LIBRARY_PATH
  6707. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  6708. case $host_os in
  6709. openbsd2.[[89]] | openbsd2.[[89]].*)
  6710. shlibpath_overrides_runpath=no
  6711. ;;
  6712. *)
  6713. shlibpath_overrides_runpath=yes
  6714. ;;
  6715. esac
  6716. else
  6717. shlibpath_overrides_runpath=yes
  6718. fi
  6719. ;;
  6720. os2*)
  6721. libname_spec='$name'
  6722. shrext_cmds=".dll"
  6723. need_lib_prefix=no
  6724. library_names_spec='$libname${shared_ext} $libname.a'
  6725. dynamic_linker='OS/2 ld.exe'
  6726. shlibpath_var=LIBPATH
  6727. ;;
  6728. osf3* | osf4* | osf5*)
  6729. version_type=osf
  6730. need_lib_prefix=no
  6731. need_version=no
  6732. soname_spec='${libname}${release}${shared_ext}$major'
  6733. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6734. shlibpath_var=LD_LIBRARY_PATH
  6735. sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  6736. sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  6737. ;;
  6738. solaris*)
  6739. version_type=linux
  6740. need_lib_prefix=no
  6741. need_version=no
  6742. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6743. soname_spec='${libname}${release}${shared_ext}$major'
  6744. shlibpath_var=LD_LIBRARY_PATH
  6745. shlibpath_overrides_runpath=yes
  6746. hardcode_into_libs=yes
  6747. # ldd complains unless libraries are executable
  6748. postinstall_cmds='chmod +x $lib'
  6749. ;;
  6750. sunos4*)
  6751. version_type=sunos
  6752. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
  6753. finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  6754. shlibpath_var=LD_LIBRARY_PATH
  6755. shlibpath_overrides_runpath=yes
  6756. if test "$with_gnu_ld" = yes; then
  6757. need_lib_prefix=no
  6758. fi
  6759. need_version=yes
  6760. ;;
  6761. sysv4 | sysv4.3*)
  6762. version_type=linux
  6763. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6764. soname_spec='${libname}${release}${shared_ext}$major'
  6765. shlibpath_var=LD_LIBRARY_PATH
  6766. case $host_vendor in
  6767. sni)
  6768. shlibpath_overrides_runpath=no
  6769. need_lib_prefix=no
  6770. export_dynamic_flag_spec='${wl}-Blargedynsym'
  6771. runpath_var=LD_RUN_PATH
  6772. ;;
  6773. siemens)
  6774. need_lib_prefix=no
  6775. ;;
  6776. motorola)
  6777. need_lib_prefix=no
  6778. need_version=no
  6779. shlibpath_overrides_runpath=no
  6780. sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  6781. ;;
  6782. esac
  6783. ;;
  6784. sysv4*MP*)
  6785. if test -d /usr/nec ;then
  6786. version_type=linux
  6787. library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
  6788. soname_spec='$libname${shared_ext}.$major'
  6789. shlibpath_var=LD_LIBRARY_PATH
  6790. fi
  6791. ;;
  6792. sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  6793. version_type=freebsd-elf
  6794. need_lib_prefix=no
  6795. need_version=no
  6796. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
  6797. soname_spec='${libname}${release}${shared_ext}$major'
  6798. shlibpath_var=LD_LIBRARY_PATH
  6799. hardcode_into_libs=yes
  6800. if test "$with_gnu_ld" = yes; then
  6801. sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
  6802. shlibpath_overrides_runpath=no
  6803. else
  6804. sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
  6805. shlibpath_overrides_runpath=yes
  6806. case $host_os in
  6807. sco3.2v5*)
  6808. sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
  6809. ;;
  6810. esac
  6811. fi
  6812. sys_lib_dlsearch_path_spec='/usr/lib'
  6813. ;;
  6814. uts4*)
  6815. version_type=linux
  6816. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
  6817. soname_spec='${libname}${release}${shared_ext}$major'
  6818. shlibpath_var=LD_LIBRARY_PATH
  6819. ;;
  6820. *)
  6821. dynamic_linker=no
  6822. ;;
  6823. esac
  6824. AC_MSG_RESULT([$dynamic_linker])
  6825. test "$dynamic_linker" = no && can_build_shared=no
  6826. variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
  6827. if test "$GCC" = yes; then
  6828. variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  6829. fi
  6830. ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
  6831. # _LT_AC_TAGCONFIG
  6832. # ----------------
  6833. AC_DEFUN([_LT_AC_TAGCONFIG],
  6834. [AC_ARG_WITH([tags],
  6835. [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
  6836. [include additional configurations @<:@automatic@:>@])],
  6837. [tagnames="$withval"])
  6838. if test -f "$ltmain" && test -n "$tagnames"; then
  6839. if test ! -f "${ofile}"; then
  6840. AC_MSG_WARN([output file `$ofile' does not exist])
  6841. fi
  6842. if test -z "$LTCC"; then
  6843. eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
  6844. if test -z "$LTCC"; then
  6845. AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
  6846. else
  6847. AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
  6848. fi
  6849. fi
  6850. if test -z "$LTCFLAGS"; then
  6851. eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
  6852. fi
  6853. # Extract list of available tagged configurations in $ofile.
  6854. # Note that this assumes the entire list is on one line.
  6855. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
  6856. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6857. for tagname in $tagnames; do
  6858. IFS="$lt_save_ifs"
  6859. # Check whether tagname contains only valid characters
  6860. case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
  6861. "") ;;
  6862. *) AC_MSG_ERROR([invalid tag name: $tagname])
  6863. ;;
  6864. esac
  6865. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
  6866. then
  6867. AC_MSG_ERROR([tag name \"$tagname\" already exists])
  6868. fi
  6869. # Update the list of available tags.
  6870. if test -n "$tagname"; then
  6871. echo appending configuration tag \"$tagname\" to $ofile
  6872. case $tagname in
  6873. CXX)
  6874. if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
  6875. ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
  6876. (test "X$CXX" != "Xg++"))) ; then
  6877. AC_LIBTOOL_LANG_CXX_CONFIG
  6878. else
  6879. tagname=""
  6880. fi
  6881. ;;
  6882. F77)
  6883. if test -n "$F77" && test "X$F77" != "Xno"; then
  6884. AC_LIBTOOL_LANG_F77_CONFIG
  6885. else
  6886. tagname=""
  6887. fi
  6888. ;;
  6889. GCJ)
  6890. if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
  6891. AC_LIBTOOL_LANG_GCJ_CONFIG
  6892. else
  6893. tagname=""
  6894. fi
  6895. ;;
  6896. RC)
  6897. AC_LIBTOOL_LANG_RC_CONFIG
  6898. ;;
  6899. *)
  6900. AC_MSG_ERROR([Unsupported tag name: $tagname])
  6901. ;;
  6902. esac
  6903. # Append the new tag name to the list of available tags.
  6904. if test -n "$tagname" ; then
  6905. available_tags="$available_tags $tagname"
  6906. fi
  6907. fi
  6908. done
  6909. IFS="$lt_save_ifs"
  6910. # Now substitute the updated list of available tags.
  6911. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
  6912. mv "${ofile}T" "$ofile"
  6913. chmod +x "$ofile"
  6914. else
  6915. rm -f "${ofile}T"
  6916. AC_MSG_ERROR([unable to update list of available tagged configurations.])
  6917. fi
  6918. fi
  6919. ])# _LT_AC_TAGCONFIG
  6920. # AC_LIBTOOL_DLOPEN
  6921. # -----------------
  6922. # enable checks for dlopen support
  6923. AC_DEFUN([AC_LIBTOOL_DLOPEN],
  6924. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
  6925. ])# AC_LIBTOOL_DLOPEN
  6926. # AC_LIBTOOL_WIN32_DLL
  6927. # --------------------
  6928. # declare package support for building win32 DLLs
  6929. AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
  6930. [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
  6931. ])# AC_LIBTOOL_WIN32_DLL
  6932. # AC_ENABLE_SHARED([DEFAULT])
  6933. # ---------------------------
  6934. # implement the --enable-shared flag
  6935. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6936. AC_DEFUN([AC_ENABLE_SHARED],
  6937. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  6938. AC_ARG_ENABLE([shared],
  6939. [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
  6940. [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
  6941. [p=${PACKAGE-default}
  6942. case $enableval in
  6943. yes) enable_shared=yes ;;
  6944. no) enable_shared=no ;;
  6945. *)
  6946. enable_shared=no
  6947. # Look at the argument we got. We use all the common list separators.
  6948. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6949. for pkg in $enableval; do
  6950. IFS="$lt_save_ifs"
  6951. if test "X$pkg" = "X$p"; then
  6952. enable_shared=yes
  6953. fi
  6954. done
  6955. IFS="$lt_save_ifs"
  6956. ;;
  6957. esac],
  6958. [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
  6959. ])# AC_ENABLE_SHARED
  6960. # AC_DISABLE_SHARED
  6961. # -----------------
  6962. # set the default shared flag to --disable-shared
  6963. AC_DEFUN([AC_DISABLE_SHARED],
  6964. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6965. AC_ENABLE_SHARED(no)
  6966. ])# AC_DISABLE_SHARED
  6967. # AC_ENABLE_STATIC([DEFAULT])
  6968. # ---------------------------
  6969. # implement the --enable-static flag
  6970. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6971. AC_DEFUN([AC_ENABLE_STATIC],
  6972. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  6973. AC_ARG_ENABLE([static],
  6974. [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
  6975. [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
  6976. [p=${PACKAGE-default}
  6977. case $enableval in
  6978. yes) enable_static=yes ;;
  6979. no) enable_static=no ;;
  6980. *)
  6981. enable_static=no
  6982. # Look at the argument we got. We use all the common list separators.
  6983. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6984. for pkg in $enableval; do
  6985. IFS="$lt_save_ifs"
  6986. if test "X$pkg" = "X$p"; then
  6987. enable_static=yes
  6988. fi
  6989. done
  6990. IFS="$lt_save_ifs"
  6991. ;;
  6992. esac],
  6993. [enable_static=]AC_ENABLE_STATIC_DEFAULT)
  6994. ])# AC_ENABLE_STATIC
  6995. # AC_DISABLE_STATIC
  6996. # -----------------
  6997. # set the default static flag to --disable-static
  6998. AC_DEFUN([AC_DISABLE_STATIC],
  6999. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7000. AC_ENABLE_STATIC(no)
  7001. ])# AC_DISABLE_STATIC
  7002. # AC_ENABLE_FAST_INSTALL([DEFAULT])
  7003. # ---------------------------------
  7004. # implement the --enable-fast-install flag
  7005. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  7006. AC_DEFUN([AC_ENABLE_FAST_INSTALL],
  7007. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  7008. AC_ARG_ENABLE([fast-install],
  7009. [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
  7010. [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
  7011. [p=${PACKAGE-default}
  7012. case $enableval in
  7013. yes) enable_fast_install=yes ;;
  7014. no) enable_fast_install=no ;;
  7015. *)
  7016. enable_fast_install=no
  7017. # Look at the argument we got. We use all the common list separators.
  7018. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  7019. for pkg in $enableval; do
  7020. IFS="$lt_save_ifs"
  7021. if test "X$pkg" = "X$p"; then
  7022. enable_fast_install=yes
  7023. fi
  7024. done
  7025. IFS="$lt_save_ifs"
  7026. ;;
  7027. esac],
  7028. [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
  7029. ])# AC_ENABLE_FAST_INSTALL
  7030. # AC_DISABLE_FAST_INSTALL
  7031. # -----------------------
  7032. # set the default to --disable-fast-install
  7033. AC_DEFUN([AC_DISABLE_FAST_INSTALL],
  7034. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7035. AC_ENABLE_FAST_INSTALL(no)
  7036. ])# AC_DISABLE_FAST_INSTALL
  7037. # AC_LIBTOOL_PICMODE([MODE])
  7038. # --------------------------
  7039. # implement the --with-pic flag
  7040. # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
  7041. AC_DEFUN([AC_LIBTOOL_PICMODE],
  7042. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7043. pic_mode=ifelse($#,1,$1,default)
  7044. ])# AC_LIBTOOL_PICMODE
  7045. # AC_PROG_EGREP
  7046. # -------------
  7047. # This is predefined starting with Autoconf 2.54, so this conditional
  7048. # definition can be removed once we require Autoconf 2.54 or later.
  7049. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
  7050. [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
  7051. [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
  7052. then ac_cv_prog_egrep='grep -E'
  7053. else ac_cv_prog_egrep='egrep'
  7054. fi])
  7055. EGREP=$ac_cv_prog_egrep
  7056. AC_SUBST([EGREP])
  7057. ])])
  7058. # AC_PATH_TOOL_PREFIX
  7059. # -------------------
  7060. # find a file program which can recognise shared library
  7061. AC_DEFUN([AC_PATH_TOOL_PREFIX],
  7062. [AC_REQUIRE([AC_PROG_EGREP])dnl
  7063. AC_MSG_CHECKING([for $1])
  7064. AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  7065. [case $MAGIC_CMD in
  7066. [[\\/*] | ?:[\\/]*])
  7067. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  7068. ;;
  7069. *)
  7070. lt_save_MAGIC_CMD="$MAGIC_CMD"
  7071. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  7072. dnl $ac_dummy forces splitting on constant user-supplied paths.
  7073. dnl POSIX.2 word splitting is done only on the output of word expansions,
  7074. dnl not every word. This closes a longstanding sh security hole.
  7075. ac_dummy="ifelse([$2], , $PATH, [$2])"
  7076. for ac_dir in $ac_dummy; do
  7077. IFS="$lt_save_ifs"
  7078. test -z "$ac_dir" && ac_dir=.
  7079. if test -f $ac_dir/$1; then
  7080. lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  7081. if test -n "$file_magic_test_file"; then
  7082. case $deplibs_check_method in
  7083. "file_magic "*)
  7084. file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
  7085. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  7086. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  7087. $EGREP "$file_magic_regex" > /dev/null; then
  7088. :
  7089. else
  7090. cat <<EOF 1>&2
  7091. *** Warning: the command libtool uses to detect shared libraries,
  7092. *** $file_magic_cmd, produces output that libtool cannot recognize.
  7093. *** The result is that libtool may fail to recognize shared libraries
  7094. *** as such. This will affect the creation of libtool libraries that
  7095. *** depend on shared libraries, but programs linked with such libtool
  7096. *** libraries will work regardless of this problem. Nevertheless, you
  7097. *** may want to report the problem to your system manager and/or to
  7098. *** bug-libtool@gnu.org
  7099. EOF
  7100. fi ;;
  7101. esac
  7102. fi
  7103. break
  7104. fi
  7105. done
  7106. IFS="$lt_save_ifs"
  7107. MAGIC_CMD="$lt_save_MAGIC_CMD"
  7108. ;;
  7109. esac])
  7110. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  7111. if test -n "$MAGIC_CMD"; then
  7112. AC_MSG_RESULT($MAGIC_CMD)
  7113. else
  7114. AC_MSG_RESULT(no)
  7115. fi
  7116. ])# AC_PATH_TOOL_PREFIX
  7117. # AC_PATH_MAGIC
  7118. # -------------
  7119. # find a file program which can recognise a shared library
  7120. AC_DEFUN([AC_PATH_MAGIC],
  7121. [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
  7122. if test -z "$lt_cv_path_MAGIC_CMD"; then
  7123. if test -n "$ac_tool_prefix"; then
  7124. AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
  7125. else
  7126. MAGIC_CMD=:
  7127. fi
  7128. fi
  7129. ])# AC_PATH_MAGIC
  7130. # AC_PROG_LD
  7131. # ----------
  7132. # find the pathname to the GNU or non-GNU linker
  7133. AC_DEFUN([AC_PROG_LD],
  7134. [AC_ARG_WITH([gnu-ld],
  7135. [AC_HELP_STRING([--with-gnu-ld],
  7136. [assume the C compiler uses GNU ld @<:@default=no@:>@])],
  7137. [test "$withval" = no || with_gnu_ld=yes],
  7138. [with_gnu_ld=no])
  7139. AC_REQUIRE([LT_AC_PROG_SED])dnl
  7140. AC_REQUIRE([AC_PROG_CC])dnl
  7141. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7142. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  7143. ac_prog=ld
  7144. if test "$GCC" = yes; then
  7145. # Check if gcc -print-prog-name=ld gives a path.
  7146. AC_MSG_CHECKING([for ld used by $CC])
  7147. case $host in
  7148. *-*-mingw*)
  7149. # gcc leaves a trailing carriage return which upsets mingw
  7150. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  7151. *)
  7152. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  7153. esac
  7154. case $ac_prog in
  7155. # Accept absolute paths.
  7156. [[\\/]]* | ?:[[\\/]]*)
  7157. re_direlt='/[[^/]][[^/]]*/\.\./'
  7158. # Canonicalize the pathname of ld
  7159. ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
  7160. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  7161. ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
  7162. done
  7163. test -z "$LD" && LD="$ac_prog"
  7164. ;;
  7165. "")
  7166. # If it fails, then pretend we aren't using GCC.
  7167. ac_prog=ld
  7168. ;;
  7169. *)
  7170. # If it is relative, then search for the first ld in PATH.
  7171. with_gnu_ld=unknown
  7172. ;;
  7173. esac
  7174. elif test "$with_gnu_ld" = yes; then
  7175. AC_MSG_CHECKING([for GNU ld])
  7176. else
  7177. AC_MSG_CHECKING([for non-GNU ld])
  7178. fi
  7179. AC_CACHE_VAL(lt_cv_path_LD,
  7180. [if test -z "$LD"; then
  7181. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  7182. for ac_dir in $PATH; do
  7183. IFS="$lt_save_ifs"
  7184. test -z "$ac_dir" && ac_dir=.
  7185. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  7186. lt_cv_path_LD="$ac_dir/$ac_prog"
  7187. # Check to see if the program is GNU ld. I'd rather use --version,
  7188. # but apparently some variants of GNU ld only accept -v.
  7189. # Break only if it was the GNU/non-GNU ld that we prefer.
  7190. case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
  7191. *GNU* | *'with BFD'*)
  7192. test "$with_gnu_ld" != no && break
  7193. ;;
  7194. *)
  7195. test "$with_gnu_ld" != yes && break
  7196. ;;
  7197. esac
  7198. fi
  7199. done
  7200. IFS="$lt_save_ifs"
  7201. else
  7202. lt_cv_path_LD="$LD" # Let the user override the test with a path.
  7203. fi])
  7204. LD="$lt_cv_path_LD"
  7205. if test -n "$LD"; then
  7206. AC_MSG_RESULT($LD)
  7207. else
  7208. AC_MSG_RESULT(no)
  7209. fi
  7210. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  7211. AC_PROG_LD_GNU
  7212. ])# AC_PROG_LD
  7213. # AC_PROG_LD_GNU
  7214. # --------------
  7215. AC_DEFUN([AC_PROG_LD_GNU],
  7216. [AC_REQUIRE([AC_PROG_EGREP])dnl
  7217. AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  7218. [# I'd rather use --version here, but apparently some GNU lds only accept -v.
  7219. case `$LD -v 2>&1 </dev/null` in
  7220. *GNU* | *'with BFD'*)
  7221. lt_cv_prog_gnu_ld=yes
  7222. ;;
  7223. *)
  7224. lt_cv_prog_gnu_ld=no
  7225. ;;
  7226. esac])
  7227. with_gnu_ld=$lt_cv_prog_gnu_ld
  7228. ])# AC_PROG_LD_GNU
  7229. # AC_PROG_LD_RELOAD_FLAG
  7230. # ----------------------
  7231. # find reload flag for linker
  7232. # -- PORTME Some linkers may need a different reload flag.
  7233. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  7234. [AC_CACHE_CHECK([for $LD option to reload object files],
  7235. lt_cv_ld_reload_flag,
  7236. [lt_cv_ld_reload_flag='-r'])
  7237. reload_flag=$lt_cv_ld_reload_flag
  7238. case $reload_flag in
  7239. "" | " "*) ;;
  7240. *) reload_flag=" $reload_flag" ;;
  7241. esac
  7242. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  7243. case $host_os in
  7244. darwin*)
  7245. if test "$GCC" = yes; then
  7246. reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
  7247. else
  7248. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  7249. fi
  7250. ;;
  7251. esac
  7252. ])# AC_PROG_LD_RELOAD_FLAG
  7253. # AC_DEPLIBS_CHECK_METHOD
  7254. # -----------------------
  7255. # how to check for library dependencies
  7256. # -- PORTME fill in with the dynamic library characteristics
  7257. AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
  7258. [AC_CACHE_CHECK([how to recognise dependent libraries],
  7259. lt_cv_deplibs_check_method,
  7260. [lt_cv_file_magic_cmd='$MAGIC_CMD'
  7261. lt_cv_file_magic_test_file=
  7262. lt_cv_deplibs_check_method='unknown'
  7263. # Need to set the preceding variable on all platforms that support
  7264. # interlibrary dependencies.
  7265. # 'none' -- dependencies not supported.
  7266. # `unknown' -- same as none, but documents that we really don't know.
  7267. # 'pass_all' -- all dependencies passed with no checks.
  7268. # 'test_compile' -- check by making test program.
  7269. # 'file_magic [[regex]]' -- check by looking for files in library path
  7270. # which responds to the $file_magic_cmd with a given extended regex.
  7271. # If you have `file' or equivalent on your system and you're not sure
  7272. # whether `pass_all' will *always* work, you probably want this one.
  7273. case $host_os in
  7274. aix4* | aix5*)
  7275. lt_cv_deplibs_check_method=pass_all
  7276. ;;
  7277. beos*)
  7278. lt_cv_deplibs_check_method=pass_all
  7279. ;;
  7280. bsdi[[45]]*)
  7281. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
  7282. lt_cv_file_magic_cmd='/usr/bin/file -L'
  7283. lt_cv_file_magic_test_file=/shlib/libc.so
  7284. ;;
  7285. cygwin*)
  7286. # func_win32_libid is a shell function defined in ltmain.sh
  7287. lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
  7288. lt_cv_file_magic_cmd='func_win32_libid'
  7289. ;;
  7290. mingw* | pw32*)
  7291. # Base MSYS/MinGW do not provide the 'file' command needed by
  7292. # func_win32_libid shell function, so use a weaker test based on 'objdump'.
  7293. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  7294. lt_cv_file_magic_cmd='$OBJDUMP -f'
  7295. ;;
  7296. darwin* | rhapsody*)
  7297. lt_cv_deplibs_check_method=pass_all
  7298. ;;
  7299. freebsd* | dragonfly*)
  7300. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  7301. case $host_cpu in
  7302. i*86 )
  7303. # Not sure whether the presence of OpenBSD here was a mistake.
  7304. # Let's accept both of them until this is cleared up.
  7305. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
  7306. lt_cv_file_magic_cmd=/usr/bin/file
  7307. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  7308. ;;
  7309. esac
  7310. else
  7311. lt_cv_deplibs_check_method=pass_all
  7312. fi
  7313. ;;
  7314. gnu*)
  7315. lt_cv_deplibs_check_method=pass_all
  7316. ;;
  7317. hpux10.20* | hpux11*)
  7318. lt_cv_file_magic_cmd=/usr/bin/file
  7319. case $host_cpu in
  7320. ia64*)
  7321. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
  7322. lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
  7323. ;;
  7324. hppa*64*)
  7325. [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
  7326. lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
  7327. ;;
  7328. *)
  7329. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
  7330. lt_cv_file_magic_test_file=/usr/lib/libc.sl
  7331. ;;
  7332. esac
  7333. ;;
  7334. interix3*)
  7335. # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
  7336. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
  7337. ;;
  7338. irix5* | irix6* | nonstopux*)
  7339. case $LD in
  7340. *-32|*"-32 ") libmagic=32-bit;;
  7341. *-n32|*"-n32 ") libmagic=N32;;
  7342. *-64|*"-64 ") libmagic=64-bit;;
  7343. *) libmagic=never-match;;
  7344. esac
  7345. lt_cv_deplibs_check_method=pass_all
  7346. ;;
  7347. # This must be Linux ELF.
  7348. linux* | k*bsd*-gnu)
  7349. lt_cv_deplibs_check_method=pass_all
  7350. ;;
  7351. netbsd* | netbsdelf*-gnu)
  7352. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  7353. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  7354. else
  7355. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
  7356. fi
  7357. ;;
  7358. newos6*)
  7359. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
  7360. lt_cv_file_magic_cmd=/usr/bin/file
  7361. lt_cv_file_magic_test_file=/usr/lib/libnls.so
  7362. ;;
  7363. nto-qnx*)
  7364. lt_cv_deplibs_check_method=unknown
  7365. ;;
  7366. openbsd*)
  7367. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  7368. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
  7369. else
  7370. lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
  7371. fi
  7372. ;;
  7373. osf3* | osf4* | osf5*)
  7374. lt_cv_deplibs_check_method=pass_all
  7375. ;;
  7376. solaris*)
  7377. lt_cv_deplibs_check_method=pass_all
  7378. ;;
  7379. sysv4 | sysv4.3*)
  7380. case $host_vendor in
  7381. motorola)
  7382. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
  7383. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  7384. ;;
  7385. ncr)
  7386. lt_cv_deplibs_check_method=pass_all
  7387. ;;
  7388. sequent)
  7389. lt_cv_file_magic_cmd='/bin/file'
  7390. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
  7391. ;;
  7392. sni)
  7393. lt_cv_file_magic_cmd='/bin/file'
  7394. lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
  7395. lt_cv_file_magic_test_file=/lib/libc.so
  7396. ;;
  7397. siemens)
  7398. lt_cv_deplibs_check_method=pass_all
  7399. ;;
  7400. pc)
  7401. lt_cv_deplibs_check_method=pass_all
  7402. ;;
  7403. esac
  7404. ;;
  7405. sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
  7406. lt_cv_deplibs_check_method=pass_all
  7407. ;;
  7408. esac
  7409. ])
  7410. file_magic_cmd=$lt_cv_file_magic_cmd
  7411. deplibs_check_method=$lt_cv_deplibs_check_method
  7412. test -z "$deplibs_check_method" && deplibs_check_method=unknown
  7413. ])# AC_DEPLIBS_CHECK_METHOD
  7414. # AC_PROG_NM
  7415. # ----------
  7416. # find the pathname to a BSD-compatible name lister
  7417. AC_DEFUN([AC_PROG_NM],
  7418. [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
  7419. [if test -n "$NM"; then
  7420. # Let the user override the test.
  7421. lt_cv_path_NM="$NM"
  7422. else
  7423. lt_nm_to_check="${ac_tool_prefix}nm"
  7424. if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
  7425. lt_nm_to_check="$lt_nm_to_check nm"
  7426. fi
  7427. for lt_tmp_nm in $lt_nm_to_check; do
  7428. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  7429. for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
  7430. IFS="$lt_save_ifs"
  7431. test -z "$ac_dir" && ac_dir=.
  7432. tmp_nm="$ac_dir/$lt_tmp_nm"
  7433. if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
  7434. # Check to see if the nm accepts a BSD-compat flag.
  7435. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  7436. # nm: unknown option "B" ignored
  7437. # Tru64's nm complains that /dev/null is an invalid object file
  7438. case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
  7439. */dev/null* | *'Invalid file or object type'*)
  7440. lt_cv_path_NM="$tmp_nm -B"
  7441. break
  7442. ;;
  7443. *)
  7444. case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
  7445. */dev/null*)
  7446. lt_cv_path_NM="$tmp_nm -p"
  7447. break
  7448. ;;
  7449. *)
  7450. lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  7451. continue # so that we can try to find one that supports BSD flags
  7452. ;;
  7453. esac
  7454. ;;
  7455. esac
  7456. fi
  7457. done
  7458. IFS="$lt_save_ifs"
  7459. done
  7460. test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  7461. fi])
  7462. NM="$lt_cv_path_NM"
  7463. ])# AC_PROG_NM
  7464. # AC_CHECK_LIBM
  7465. # -------------
  7466. # check for math library
  7467. AC_DEFUN([AC_CHECK_LIBM],
  7468. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  7469. LIBM=
  7470. case $host in
  7471. *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
  7472. # These system don't have libm, or don't need it
  7473. ;;
  7474. *-ncr-sysv4.3*)
  7475. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  7476. AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
  7477. ;;
  7478. *)
  7479. AC_CHECK_LIB(m, cos, LIBM="-lm")
  7480. ;;
  7481. esac
  7482. ])# AC_CHECK_LIBM
  7483. # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
  7484. # -----------------------------------
  7485. # sets LIBLTDL to the link flags for the libltdl convenience library and
  7486. # LTDLINCL to the include flags for the libltdl header and adds
  7487. # --enable-ltdl-convenience to the configure arguments. Note that
  7488. # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
  7489. # it is assumed to be `libltdl'. LIBLTDL will be prefixed with
  7490. # '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
  7491. # (note the single quotes!). If your package is not flat and you're not
  7492. # using automake, define top_builddir and top_srcdir appropriately in
  7493. # the Makefiles.
  7494. AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
  7495. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7496. case $enable_ltdl_convenience in
  7497. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  7498. "") enable_ltdl_convenience=yes
  7499. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  7500. esac
  7501. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  7502. LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  7503. # For backwards non-gettext consistent compatibility...
  7504. INCLTDL="$LTDLINCL"
  7505. ])# AC_LIBLTDL_CONVENIENCE
  7506. # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
  7507. # -----------------------------------
  7508. # sets LIBLTDL to the link flags for the libltdl installable library and
  7509. # LTDLINCL to the include flags for the libltdl header and adds
  7510. # --enable-ltdl-install to the configure arguments. Note that
  7511. # AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
  7512. # and an installed libltdl is not found, it is assumed to be `libltdl'.
  7513. # LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
  7514. # '${top_srcdir}/' (note the single quotes!). If your package is not
  7515. # flat and you're not using automake, define top_builddir and top_srcdir
  7516. # appropriately in the Makefiles.
  7517. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  7518. AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
  7519. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  7520. AC_CHECK_LIB(ltdl, lt_dlinit,
  7521. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  7522. [if test x"$enable_ltdl_install" = xno; then
  7523. AC_MSG_WARN([libltdl not installed, but installation disabled])
  7524. else
  7525. enable_ltdl_install=yes
  7526. fi
  7527. ])
  7528. if test x"$enable_ltdl_install" = x"yes"; then
  7529. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  7530. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  7531. LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  7532. else
  7533. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  7534. LIBLTDL="-lltdl"
  7535. LTDLINCL=
  7536. fi
  7537. # For backwards non-gettext consistent compatibility...
  7538. INCLTDL="$LTDLINCL"
  7539. ])# AC_LIBLTDL_INSTALLABLE
  7540. # AC_LIBTOOL_CXX
  7541. # --------------
  7542. # enable support for C++ libraries
  7543. AC_DEFUN([AC_LIBTOOL_CXX],
  7544. [AC_REQUIRE([_LT_AC_LANG_CXX])
  7545. ])# AC_LIBTOOL_CXX
  7546. # _LT_AC_LANG_CXX
  7547. # ---------------
  7548. AC_DEFUN([_LT_AC_LANG_CXX],
  7549. [AC_REQUIRE([AC_PROG_CXX])
  7550. AC_REQUIRE([_LT_AC_PROG_CXXCPP])
  7551. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
  7552. ])# _LT_AC_LANG_CXX
  7553. # _LT_AC_PROG_CXXCPP
  7554. # ------------------
  7555. AC_DEFUN([_LT_AC_PROG_CXXCPP],
  7556. [
  7557. AC_REQUIRE([AC_PROG_CXX])
  7558. if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
  7559. ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
  7560. (test "X$CXX" != "Xg++"))) ; then
  7561. AC_PROG_CXXCPP
  7562. fi
  7563. ])# _LT_AC_PROG_CXXCPP
  7564. # AC_LIBTOOL_F77
  7565. # --------------
  7566. # enable support for Fortran 77 libraries
  7567. AC_DEFUN([AC_LIBTOOL_F77],
  7568. [AC_REQUIRE([_LT_AC_LANG_F77])
  7569. ])# AC_LIBTOOL_F77
  7570. # _LT_AC_LANG_F77
  7571. # ---------------
  7572. AC_DEFUN([_LT_AC_LANG_F77],
  7573. [AC_REQUIRE([AC_PROG_F77])
  7574. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
  7575. ])# _LT_AC_LANG_F77
  7576. # AC_LIBTOOL_GCJ
  7577. # --------------
  7578. # enable support for GCJ libraries
  7579. AC_DEFUN([AC_LIBTOOL_GCJ],
  7580. [AC_REQUIRE([_LT_AC_LANG_GCJ])
  7581. ])# AC_LIBTOOL_GCJ
  7582. # _LT_AC_LANG_GCJ
  7583. # ---------------
  7584. AC_DEFUN([_LT_AC_LANG_GCJ],
  7585. [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
  7586. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
  7587. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
  7588. [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
  7589. [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
  7590. [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
  7591. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
  7592. ])# _LT_AC_LANG_GCJ
  7593. # AC_LIBTOOL_RC
  7594. # -------------
  7595. # enable support for Windows resource files
  7596. AC_DEFUN([AC_LIBTOOL_RC],
  7597. [AC_REQUIRE([LT_AC_PROG_RC])
  7598. _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
  7599. ])# AC_LIBTOOL_RC
  7600. # AC_LIBTOOL_LANG_C_CONFIG
  7601. # ------------------------
  7602. # Ensure that the configuration vars for the C compiler are
  7603. # suitably defined. Those variables are subsequently used by
  7604. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  7605. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
  7606. AC_DEFUN([_LT_AC_LANG_C_CONFIG],
  7607. [lt_save_CC="$CC"
  7608. AC_LANG_PUSH(C)
  7609. # Source file extension for C test sources.
  7610. ac_ext=c
  7611. # Object file extension for compiled C test sources.
  7612. objext=o
  7613. _LT_AC_TAGVAR(objext, $1)=$objext
  7614. # Code to be used in simple compile tests
  7615. lt_simple_compile_test_code="int some_variable = 0;\n"
  7616. # Code to be used in simple link tests
  7617. lt_simple_link_test_code='int main(){return(0);}\n'
  7618. _LT_AC_SYS_COMPILER
  7619. # save warnings/boilerplate of simple test code
  7620. _LT_COMPILER_BOILERPLATE
  7621. _LT_LINKER_BOILERPLATE
  7622. ## CAVEAT EMPTOR:
  7623. ## There is no encapsulation within the following macros, do not change
  7624. ## the running order or otherwise move them around unless you know exactly
  7625. ## what you are doing...
  7626. AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
  7627. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  7628. AC_LIBTOOL_PROG_CC_C_O($1)
  7629. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  7630. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  7631. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  7632. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  7633. AC_LIBTOOL_SYS_LIB_STRIP
  7634. AC_LIBTOOL_DLOPEN_SELF
  7635. # Report which library types will actually be built
  7636. AC_MSG_CHECKING([if libtool supports shared libraries])
  7637. AC_MSG_RESULT([$can_build_shared])
  7638. AC_MSG_CHECKING([whether to build shared libraries])
  7639. test "$can_build_shared" = "no" && enable_shared=no
  7640. # On AIX, shared libraries and static libraries use the same namespace, and
  7641. # are all built from PIC.
  7642. case $host_os in
  7643. aix3*)
  7644. test "$enable_shared" = yes && enable_static=no
  7645. if test -n "$RANLIB"; then
  7646. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  7647. postinstall_cmds='$RANLIB $lib'
  7648. fi
  7649. ;;
  7650. aix4* | aix5*)
  7651. if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  7652. test "$enable_shared" = yes && enable_static=no
  7653. fi
  7654. ;;
  7655. esac
  7656. AC_MSG_RESULT([$enable_shared])
  7657. AC_MSG_CHECKING([whether to build static libraries])
  7658. # Make sure either enable_shared or enable_static is yes.
  7659. test "$enable_shared" = yes || enable_static=yes
  7660. AC_MSG_RESULT([$enable_static])
  7661. AC_LIBTOOL_CONFIG($1)
  7662. AC_LANG_POP
  7663. CC="$lt_save_CC"
  7664. ])# AC_LIBTOOL_LANG_C_CONFIG
  7665. # AC_LIBTOOL_LANG_CXX_CONFIG
  7666. # --------------------------
  7667. # Ensure that the configuration vars for the C compiler are
  7668. # suitably defined. Those variables are subsequently used by
  7669. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  7670. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
  7671. AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
  7672. [AC_LANG_PUSH(C++)
  7673. AC_REQUIRE([AC_PROG_CXX])
  7674. AC_REQUIRE([_LT_AC_PROG_CXXCPP])
  7675. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7676. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  7677. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  7678. _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
  7679. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
  7680. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  7681. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  7682. _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  7683. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  7684. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  7685. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  7686. _LT_AC_TAGVAR(hardcode_automatic, $1)=no
  7687. _LT_AC_TAGVAR(module_cmds, $1)=
  7688. _LT_AC_TAGVAR(module_expsym_cmds, $1)=
  7689. _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  7690. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  7691. _LT_AC_TAGVAR(no_undefined_flag, $1)=
  7692. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  7693. _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  7694. # Dependencies to place before and after the object being linked:
  7695. _LT_AC_TAGVAR(predep_objects, $1)=
  7696. _LT_AC_TAGVAR(postdep_objects, $1)=
  7697. _LT_AC_TAGVAR(predeps, $1)=
  7698. _LT_AC_TAGVAR(postdeps, $1)=
  7699. _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
  7700. # Source file extension for C++ test sources.
  7701. ac_ext=cpp
  7702. # Object file extension for compiled C++ test sources.
  7703. objext=o
  7704. _LT_AC_TAGVAR(objext, $1)=$objext
  7705. # Code to be used in simple compile tests
  7706. lt_simple_compile_test_code="int some_variable = 0;\n"
  7707. # Code to be used in simple link tests
  7708. lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
  7709. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7710. _LT_AC_SYS_COMPILER
  7711. # save warnings/boilerplate of simple test code
  7712. _LT_COMPILER_BOILERPLATE
  7713. _LT_LINKER_BOILERPLATE
  7714. # Allow CC to be a program name with arguments.
  7715. lt_save_CC=$CC
  7716. lt_save_LD=$LD
  7717. lt_save_GCC=$GCC
  7718. GCC=$GXX
  7719. lt_save_with_gnu_ld=$with_gnu_ld
  7720. lt_save_path_LD=$lt_cv_path_LD
  7721. if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
  7722. lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
  7723. else
  7724. $as_unset lt_cv_prog_gnu_ld
  7725. fi
  7726. if test -n "${lt_cv_path_LDCXX+set}"; then
  7727. lt_cv_path_LD=$lt_cv_path_LDCXX
  7728. else
  7729. $as_unset lt_cv_path_LD
  7730. fi
  7731. test -z "${LDCXX+set}" || LD=$LDCXX
  7732. CC=${CXX-"c++"}
  7733. compiler=$CC
  7734. _LT_AC_TAGVAR(compiler, $1)=$CC
  7735. _LT_CC_BASENAME([$compiler])
  7736. # We don't want -fno-exception wen compiling C++ code, so set the
  7737. # no_builtin_flag separately
  7738. if test "$GXX" = yes; then
  7739. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  7740. else
  7741. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  7742. fi
  7743. if test "$GXX" = yes; then
  7744. # Set up default GNU C++ configuration
  7745. AC_PROG_LD
  7746. # Check if GNU C++ uses GNU ld as the underlying linker, since the
  7747. # archiving commands below assume that GNU ld is being used.
  7748. if test "$with_gnu_ld" = yes; then
  7749. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  7750. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  7751. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  7752. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  7753. # If archive_cmds runs LD, not CC, wlarc should be empty
  7754. # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
  7755. # investigate it a little bit more. (MM)
  7756. wlarc='${wl}'
  7757. # ancient GNU ld didn't support --whole-archive et. al.
  7758. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
  7759. grep 'no-whole-archive' > /dev/null; then
  7760. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  7761. else
  7762. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  7763. fi
  7764. else
  7765. with_gnu_ld=no
  7766. wlarc=
  7767. # A generic and very simple default shared library creation
  7768. # command for GNU C++ for the case where it uses the native
  7769. # linker, instead of GNU ld. If possible, this setting should
  7770. # overridden to take advantage of the native linker features on
  7771. # the platform it is being used on.
  7772. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  7773. fi
  7774. # Commands to make compiler produce verbose output that lists
  7775. # what "hidden" libraries, object files and flags are used when
  7776. # linking a shared library.
  7777. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
  7778. else
  7779. GXX=no
  7780. with_gnu_ld=no
  7781. wlarc=
  7782. fi
  7783. # PORTME: fill in a description of your system's C++ link characteristics
  7784. AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  7785. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  7786. case $host_os in
  7787. aix3*)
  7788. # FIXME: insert proper C++ library support
  7789. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7790. ;;
  7791. aix4* | aix5*)
  7792. if test "$host_cpu" = ia64; then
  7793. # On IA64, the linker does run time linking by default, so we don't
  7794. # have to do anything special.
  7795. aix_use_runtimelinking=no
  7796. exp_sym_flag='-Bexport'
  7797. no_entry_flag=""
  7798. else
  7799. aix_use_runtimelinking=no
  7800. # Test if we are trying to use run time linking or normal
  7801. # AIX style linking. If -brtl is somewhere in LDFLAGS, we
  7802. # need to do runtime linking.
  7803. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
  7804. for ld_flag in $LDFLAGS; do
  7805. case $ld_flag in
  7806. *-brtl*)
  7807. aix_use_runtimelinking=yes
  7808. break
  7809. ;;
  7810. esac
  7811. done
  7812. ;;
  7813. esac
  7814. exp_sym_flag='-bexport'
  7815. no_entry_flag='-bnoentry'
  7816. fi
  7817. # When large executables or shared objects are built, AIX ld can
  7818. # have problems creating the table of contents. If linking a library
  7819. # or program results in "error TOC overflow" add -mminimal-toc to
  7820. # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
  7821. # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  7822. _LT_AC_TAGVAR(archive_cmds, $1)=''
  7823. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  7824. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
  7825. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  7826. if test "$GXX" = yes; then
  7827. case $host_os in aix4.[[012]]|aix4.[[012]].*)
  7828. # We only want to do this on AIX 4.2 and lower, the check
  7829. # below for broken collect2 doesn't work under 4.3+
  7830. collect2name=`${CC} -print-prog-name=collect2`
  7831. if test -f "$collect2name" && \
  7832. strings "$collect2name" | grep resolve_lib_name >/dev/null
  7833. then
  7834. # We have reworked collect2
  7835. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  7836. else
  7837. # We have old collect2
  7838. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
  7839. # It fails to find uninstalled libraries when the uninstalled
  7840. # path is not listed in the libpath. Setting hardcode_minus_L
  7841. # to unsupported forces relinking
  7842. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  7843. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  7844. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  7845. fi
  7846. ;;
  7847. esac
  7848. shared_flag='-shared'
  7849. if test "$aix_use_runtimelinking" = yes; then
  7850. shared_flag="$shared_flag "'${wl}-G'
  7851. fi
  7852. else
  7853. # not using gcc
  7854. if test "$host_cpu" = ia64; then
  7855. # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  7856. # chokes on -Wl,-G. The following line is correct:
  7857. shared_flag='-G'
  7858. else
  7859. if test "$aix_use_runtimelinking" = yes; then
  7860. shared_flag='${wl}-G'
  7861. else
  7862. shared_flag='${wl}-bM:SRE'
  7863. fi
  7864. fi
  7865. fi
  7866. # It seems that -bexpall does not export symbols beginning with
  7867. # underscore (_), so it is better to generate a list of symbols to export.
  7868. _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  7869. if test "$aix_use_runtimelinking" = yes; then
  7870. # Warning - without using the other runtime loading flags (-brtl),
  7871. # -berok will link without error, but may produce a broken library.
  7872. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
  7873. # Determine the default libpath from the value encoded in an empty executable.
  7874. _LT_AC_SYS_LIBPATH_AIX
  7875. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  7876. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
  7877. else
  7878. if test "$host_cpu" = ia64; then
  7879. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  7880. _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  7881. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
  7882. else
  7883. # Determine the default libpath from the value encoded in an empty executable.
  7884. _LT_AC_SYS_LIBPATH_AIX
  7885. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  7886. # Warning - without using the other run time loading flags,
  7887. # -berok will link without error, but may produce a broken library.
  7888. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  7889. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  7890. # Exported symbols can be pulled into shared objects from archives
  7891. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
  7892. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  7893. # This is similar to how AIX traditionally builds its shared libraries.
  7894. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  7895. fi
  7896. fi
  7897. ;;
  7898. beos*)
  7899. if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
  7900. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  7901. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  7902. # support --undefined. This deserves some investigation. FIXME
  7903. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  7904. else
  7905. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7906. fi
  7907. ;;
  7908. chorus*)
  7909. case $cc_basename in
  7910. *)
  7911. # FIXME: insert proper C++ library support
  7912. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7913. ;;
  7914. esac
  7915. ;;
  7916. cygwin* | mingw* | pw32*)
  7917. # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
  7918. # as there is no search path for DLLs.
  7919. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  7920. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  7921. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  7922. _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
  7923. if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
  7924. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  7925. # If the export-symbols file already is a .def file (1st line
  7926. # is EXPORTS), use it as is; otherwise, prepend...
  7927. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
  7928. cp $export_symbols $output_objdir/$soname.def;
  7929. else
  7930. echo EXPORTS > $output_objdir/$soname.def;
  7931. cat $export_symbols >> $output_objdir/$soname.def;
  7932. fi~
  7933. $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
  7934. else
  7935. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7936. fi
  7937. ;;
  7938. darwin* | rhapsody*)
  7939. case $host_os in
  7940. rhapsody* | darwin1.[[012]])
  7941. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
  7942. ;;
  7943. *) # Darwin 1.3 on
  7944. if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
  7945. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
  7946. else
  7947. case ${MACOSX_DEPLOYMENT_TARGET} in
  7948. 10.[[012]])
  7949. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
  7950. ;;
  7951. 10.*)
  7952. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
  7953. ;;
  7954. esac
  7955. fi
  7956. ;;
  7957. esac
  7958. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7959. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  7960. _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
  7961. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  7962. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
  7963. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  7964. if test "$GXX" = yes ; then
  7965. lt_int_apple_cc_single_mod=no
  7966. output_verbose_link_cmd='echo'
  7967. if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
  7968. lt_int_apple_cc_single_mod=yes
  7969. fi
  7970. if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
  7971. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  7972. else
  7973. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
  7974. fi
  7975. _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  7976. # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
  7977. if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
  7978. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7979. else
  7980. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7981. fi
  7982. _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7983. else
  7984. case $cc_basename in
  7985. xlc*)
  7986. output_verbose_link_cmd='echo'
  7987. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
  7988. _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
  7989. # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
  7990. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7991. _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
  7992. ;;
  7993. *)
  7994. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7995. ;;
  7996. esac
  7997. fi
  7998. ;;
  7999. dgux*)
  8000. case $cc_basename in
  8001. ec++*)
  8002. # FIXME: insert proper C++ library support
  8003. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8004. ;;
  8005. ghcx*)
  8006. # Green Hills C++ Compiler
  8007. # FIXME: insert proper C++ library support
  8008. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8009. ;;
  8010. *)
  8011. # FIXME: insert proper C++ library support
  8012. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8013. ;;
  8014. esac
  8015. ;;
  8016. freebsd[[12]]*)
  8017. # C++ shared libraries reported to be fairly broken before switch to ELF
  8018. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8019. ;;
  8020. freebsd-elf*)
  8021. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8022. ;;
  8023. freebsd* | dragonfly*)
  8024. # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
  8025. # conventions
  8026. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  8027. ;;
  8028. gnu*)
  8029. ;;
  8030. hpux9*)
  8031. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  8032. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8033. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8034. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8035. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  8036. # but as the default
  8037. # location of the library.
  8038. case $cc_basename in
  8039. CC*)
  8040. # FIXME: insert proper C++ library support
  8041. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8042. ;;
  8043. aCC*)
  8044. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  8045. # Commands to make compiler produce verbose output that lists
  8046. # what "hidden" libraries, object files and flags are used when
  8047. # linking a shared library.
  8048. #
  8049. # There doesn't appear to be a way to prevent this compiler from
  8050. # explicitly linking system object files so we need to strip them
  8051. # from the output so that they don't get included in the library
  8052. # dependencies.
  8053. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8054. ;;
  8055. *)
  8056. if test "$GXX" = yes; then
  8057. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  8058. else
  8059. # FIXME: insert proper C++ library support
  8060. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8061. fi
  8062. ;;
  8063. esac
  8064. ;;
  8065. hpux10*|hpux11*)
  8066. if test $with_gnu_ld = no; then
  8067. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  8068. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8069. case $host_cpu in
  8070. hppa*64*|ia64*)
  8071. _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
  8072. ;;
  8073. *)
  8074. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8075. ;;
  8076. esac
  8077. fi
  8078. case $host_cpu in
  8079. hppa*64*|ia64*)
  8080. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8081. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8082. ;;
  8083. *)
  8084. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8085. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  8086. # but as the default
  8087. # location of the library.
  8088. ;;
  8089. esac
  8090. case $cc_basename in
  8091. CC*)
  8092. # FIXME: insert proper C++ library support
  8093. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8094. ;;
  8095. aCC*)
  8096. case $host_cpu in
  8097. hppa*64*)
  8098. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8099. ;;
  8100. ia64*)
  8101. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8102. ;;
  8103. *)
  8104. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8105. ;;
  8106. esac
  8107. # Commands to make compiler produce verbose output that lists
  8108. # what "hidden" libraries, object files and flags are used when
  8109. # linking a shared library.
  8110. #
  8111. # There doesn't appear to be a way to prevent this compiler from
  8112. # explicitly linking system object files so we need to strip them
  8113. # from the output so that they don't get included in the library
  8114. # dependencies.
  8115. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8116. ;;
  8117. *)
  8118. if test "$GXX" = yes; then
  8119. if test $with_gnu_ld = no; then
  8120. case $host_cpu in
  8121. hppa*64*)
  8122. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8123. ;;
  8124. ia64*)
  8125. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8126. ;;
  8127. *)
  8128. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8129. ;;
  8130. esac
  8131. fi
  8132. else
  8133. # FIXME: insert proper C++ library support
  8134. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8135. fi
  8136. ;;
  8137. esac
  8138. ;;
  8139. interix3*)
  8140. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8141. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8142. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8143. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8144. # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
  8145. # Instead, shared libraries are loaded at an image base (0x10000000 by
  8146. # default) and relocated if they conflict, which is a slow very memory
  8147. # consuming and fragmenting process. To avoid this, we pick a random,
  8148. # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
  8149. # time. Moving up from 0x10000000 also allows more sbrk(2) space.
  8150. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  8151. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
  8152. ;;
  8153. irix5* | irix6*)
  8154. case $cc_basename in
  8155. CC*)
  8156. # SGI C++
  8157. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8158. # Archives containing C++ object files must be created using
  8159. # "CC -ar", where "CC" is the IRIX C++ compiler. This is
  8160. # necessary to make sure instantiated templates are included
  8161. # in the archive.
  8162. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
  8163. ;;
  8164. *)
  8165. if test "$GXX" = yes; then
  8166. if test "$with_gnu_ld" = no; then
  8167. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  8168. else
  8169. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  8170. fi
  8171. fi
  8172. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8173. ;;
  8174. esac
  8175. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8176. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8177. ;;
  8178. linux* | k*bsd*-gnu)
  8179. case $cc_basename in
  8180. KCC*)
  8181. # Kuck and Associates, Inc. (KAI) C++ Compiler
  8182. # KCC will only create a shared library if the output file
  8183. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  8184. # to its proper name (with version) after linking.
  8185. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  8186. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
  8187. # Commands to make compiler produce verbose output that lists
  8188. # what "hidden" libraries, object files and flags are used when
  8189. # linking a shared library.
  8190. #
  8191. # There doesn't appear to be a way to prevent this compiler from
  8192. # explicitly linking system object files so we need to strip them
  8193. # from the output so that they don't get included in the library
  8194. # dependencies.
  8195. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8196. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
  8197. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8198. # Archives containing C++ object files must be created using
  8199. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  8200. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  8201. ;;
  8202. icpc*)
  8203. # Intel C++
  8204. with_gnu_ld=yes
  8205. # version 8.0 and above of icpc choke on multiply defined symbols
  8206. # if we add $predep_objects and $postdep_objects, however 7.1 and
  8207. # earlier do not add the objects themselves.
  8208. case `$CC -V 2>&1` in
  8209. *"Version 7."*)
  8210. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8211. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8212. ;;
  8213. *) # Version 8.0 or newer
  8214. tmp_idyn=
  8215. case $host_cpu in
  8216. ia64*) tmp_idyn=' -i_dynamic';;
  8217. esac
  8218. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8219. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8220. ;;
  8221. esac
  8222. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8223. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8224. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8225. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
  8226. ;;
  8227. pgCC*)
  8228. # Portland Group C++ compiler
  8229. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
  8230. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
  8231. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  8232. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8233. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
  8234. ;;
  8235. cxx*)
  8236. # Compaq C++
  8237. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8238. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
  8239. runpath_var=LD_RUN_PATH
  8240. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  8241. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8242. # Commands to make compiler produce verbose output that lists
  8243. # what "hidden" libraries, object files and flags are used when
  8244. # linking a shared library.
  8245. #
  8246. # There doesn't appear to be a way to prevent this compiler from
  8247. # explicitly linking system object files so we need to strip them
  8248. # from the output so that they don't get included in the library
  8249. # dependencies.
  8250. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8251. ;;
  8252. esac
  8253. ;;
  8254. lynxos*)
  8255. # FIXME: insert proper C++ library support
  8256. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8257. ;;
  8258. m88k*)
  8259. # FIXME: insert proper C++ library support
  8260. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8261. ;;
  8262. mvs*)
  8263. case $cc_basename in
  8264. cxx*)
  8265. # FIXME: insert proper C++ library support
  8266. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8267. ;;
  8268. *)
  8269. # FIXME: insert proper C++ library support
  8270. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8271. ;;
  8272. esac
  8273. ;;
  8274. netbsd* | netbsdelf*-gnu)
  8275. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  8276. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
  8277. wlarc=
  8278. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8279. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8280. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8281. fi
  8282. # Workaround some broken pre-1.5 toolchains
  8283. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
  8284. ;;
  8285. openbsd2*)
  8286. # C++ shared libraries are fairly broken
  8287. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8288. ;;
  8289. openbsd*)
  8290. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8291. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8292. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  8293. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8294. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  8295. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
  8296. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8297. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  8298. fi
  8299. output_verbose_link_cmd='echo'
  8300. ;;
  8301. osf3*)
  8302. case $cc_basename in
  8303. KCC*)
  8304. # Kuck and Associates, Inc. (KAI) C++ Compiler
  8305. # KCC will only create a shared library if the output file
  8306. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  8307. # to its proper name (with version) after linking.
  8308. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  8309. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8310. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8311. # Archives containing C++ object files must be created using
  8312. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  8313. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  8314. ;;
  8315. RCC*)
  8316. # Rational C++ 2.4.1
  8317. # FIXME: insert proper C++ library support
  8318. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8319. ;;
  8320. cxx*)
  8321. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  8322. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8323. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8324. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8325. # Commands to make compiler produce verbose output that lists
  8326. # what "hidden" libraries, object files and flags are used when
  8327. # linking a shared library.
  8328. #
  8329. # There doesn't appear to be a way to prevent this compiler from
  8330. # explicitly linking system object files so we need to strip them
  8331. # from the output so that they don't get included in the library
  8332. # dependencies.
  8333. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8334. ;;
  8335. *)
  8336. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  8337. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  8338. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  8339. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8340. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8341. # Commands to make compiler produce verbose output that lists
  8342. # what "hidden" libraries, object files and flags are used when
  8343. # linking a shared library.
  8344. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
  8345. else
  8346. # FIXME: insert proper C++ library support
  8347. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8348. fi
  8349. ;;
  8350. esac
  8351. ;;
  8352. osf4* | osf5*)
  8353. case $cc_basename in
  8354. KCC*)
  8355. # Kuck and Associates, Inc. (KAI) C++ Compiler
  8356. # KCC will only create a shared library if the output file
  8357. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  8358. # to its proper name (with version) after linking.
  8359. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  8360. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  8361. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8362. # Archives containing C++ object files must be created using
  8363. # the KAI C++ compiler.
  8364. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
  8365. ;;
  8366. RCC*)
  8367. # Rational C++ 2.4.1
  8368. # FIXME: insert proper C++ library support
  8369. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8370. ;;
  8371. cxx*)
  8372. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  8373. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8374. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
  8375. echo "-hidden">> $lib.exp~
  8376. $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
  8377. $rm $lib.exp'
  8378. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  8379. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8380. # Commands to make compiler produce verbose output that lists
  8381. # what "hidden" libraries, object files and flags are used when
  8382. # linking a shared library.
  8383. #
  8384. # There doesn't appear to be a way to prevent this compiler from
  8385. # explicitly linking system object files so we need to strip them
  8386. # from the output so that they don't get included in the library
  8387. # dependencies.
  8388. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  8389. ;;
  8390. *)
  8391. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  8392. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  8393. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
  8394. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8395. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8396. # Commands to make compiler produce verbose output that lists
  8397. # what "hidden" libraries, object files and flags are used when
  8398. # linking a shared library.
  8399. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
  8400. else
  8401. # FIXME: insert proper C++ library support
  8402. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8403. fi
  8404. ;;
  8405. esac
  8406. ;;
  8407. psos*)
  8408. # FIXME: insert proper C++ library support
  8409. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8410. ;;
  8411. sunos4*)
  8412. case $cc_basename in
  8413. CC*)
  8414. # Sun C++ 4.x
  8415. # FIXME: insert proper C++ library support
  8416. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8417. ;;
  8418. lcc*)
  8419. # Lucid
  8420. # FIXME: insert proper C++ library support
  8421. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8422. ;;
  8423. *)
  8424. # FIXME: insert proper C++ library support
  8425. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8426. ;;
  8427. esac
  8428. ;;
  8429. solaris*)
  8430. case $cc_basename in
  8431. CC*)
  8432. # Sun C++ 4.2, 5.x and Centerline C++
  8433. _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
  8434. _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  8435. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  8436. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  8437. $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  8438. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8439. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8440. case $host_os in
  8441. solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  8442. *)
  8443. # The C++ compiler is used as linker so we must use $wl
  8444. # flag to pass the commands to the underlying system
  8445. # linker. We must also pass each convience library through
  8446. # to the system linker between allextract/defaultextract.
  8447. # The C++ compiler will combine linker options so we
  8448. # cannot just pass the convience library names through
  8449. # without $wl.
  8450. # Supported since Solaris 2.6 (maybe 2.5.1?)
  8451. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
  8452. ;;
  8453. esac
  8454. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8455. output_verbose_link_cmd='echo'
  8456. # Archives containing C++ object files must be created using
  8457. # "CC -xar", where "CC" is the Sun C++ compiler. This is
  8458. # necessary to make sure instantiated templates are included
  8459. # in the archive.
  8460. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  8461. ;;
  8462. gcx*)
  8463. # Green Hills C++ Compiler
  8464. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  8465. # The C++ compiler must be used to create the archive.
  8466. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
  8467. ;;
  8468. *)
  8469. # GNU C++ compiler with Solaris linker
  8470. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  8471. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
  8472. if $CC --version | grep -v '^2\.7' > /dev/null; then
  8473. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  8474. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  8475. $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  8476. # Commands to make compiler produce verbose output that lists
  8477. # what "hidden" libraries, object files and flags are used when
  8478. # linking a shared library.
  8479. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
  8480. else
  8481. # g++ 2.7 appears to require `-G' NOT `-shared' on this
  8482. # platform.
  8483. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  8484. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  8485. $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  8486. # Commands to make compiler produce verbose output that lists
  8487. # what "hidden" libraries, object files and flags are used when
  8488. # linking a shared library.
  8489. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
  8490. fi
  8491. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
  8492. fi
  8493. ;;
  8494. esac
  8495. ;;
  8496. sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
  8497. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  8498. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8499. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8500. runpath_var='LD_RUN_PATH'
  8501. case $cc_basename in
  8502. CC*)
  8503. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8504. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8505. ;;
  8506. *)
  8507. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8508. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
  8509. ;;
  8510. esac
  8511. ;;
  8512. sysv5* | sco3.2v5* | sco5v6*)
  8513. # Note: We can NOT use -z defs as we might desire, because we do not
  8514. # link with -lc, and that would cause any symbols used from libc to
  8515. # always be unresolved, which means just about no library would
  8516. # ever link correctly. If we're not using GNU ld we use -z text
  8517. # though, which does catch some bad symbols but isn't as heavy-handed
  8518. # as -z defs.
  8519. # For security reasons, it is highly recommended that you always
  8520. # use absolute paths for naming shared libraries, and exclude the
  8521. # DT_RUNPATH tag from executables and libraries. But doing so
  8522. # requires that you compile everything twice, which is a pain.
  8523. # So that behaviour is only enabled if SCOABSPATH is set to a
  8524. # non-empty value in the environment. Most likely only useful for
  8525. # creating official distributions of packages.
  8526. # This is a hack until libtool officially supports absolute path
  8527. # names for shared libraries.
  8528. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
  8529. _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
  8530. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8531. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8532. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
  8533. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
  8534. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8535. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  8536. runpath_var='LD_RUN_PATH'
  8537. case $cc_basename in
  8538. CC*)
  8539. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8540. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8541. ;;
  8542. *)
  8543. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8544. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8545. ;;
  8546. esac
  8547. ;;
  8548. tandem*)
  8549. case $cc_basename in
  8550. NCC*)
  8551. # NonStop-UX NCC 3.20
  8552. # FIXME: insert proper C++ library support
  8553. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8554. ;;
  8555. *)
  8556. # FIXME: insert proper C++ library support
  8557. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8558. ;;
  8559. esac
  8560. ;;
  8561. vxworks*)
  8562. # FIXME: insert proper C++ library support
  8563. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8564. ;;
  8565. *)
  8566. # FIXME: insert proper C++ library support
  8567. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8568. ;;
  8569. esac
  8570. AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
  8571. test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  8572. _LT_AC_TAGVAR(GCC, $1)="$GXX"
  8573. _LT_AC_TAGVAR(LD, $1)="$LD"
  8574. ## CAVEAT EMPTOR:
  8575. ## There is no encapsulation within the following macros, do not change
  8576. ## the running order or otherwise move them around unless you know exactly
  8577. ## what you are doing...
  8578. AC_LIBTOOL_POSTDEP_PREDEP($1)
  8579. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  8580. AC_LIBTOOL_PROG_CC_C_O($1)
  8581. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  8582. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  8583. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  8584. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  8585. AC_LIBTOOL_CONFIG($1)
  8586. AC_LANG_POP
  8587. CC=$lt_save_CC
  8588. LDCXX=$LD
  8589. LD=$lt_save_LD
  8590. GCC=$lt_save_GCC
  8591. with_gnu_ldcxx=$with_gnu_ld
  8592. with_gnu_ld=$lt_save_with_gnu_ld
  8593. lt_cv_path_LDCXX=$lt_cv_path_LD
  8594. lt_cv_path_LD=$lt_save_path_LD
  8595. lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
  8596. lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
  8597. ])# AC_LIBTOOL_LANG_CXX_CONFIG
  8598. # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
  8599. # ------------------------------------
  8600. # Figure out "hidden" library dependencies from verbose
  8601. # compiler output when linking a shared library.
  8602. # Parse the compiler output and extract the necessary
  8603. # objects, libraries and library flags.
  8604. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
  8605. dnl we can't use the lt_simple_compile_test_code here,
  8606. dnl because it contains code intended for an executable,
  8607. dnl not a library. It's possible we should let each
  8608. dnl tag define a new lt_????_link_test_code variable,
  8609. dnl but it's only used here...
  8610. ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
  8611. int a;
  8612. void foo (void) { a = 0; }
  8613. EOF
  8614. ],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
  8615. class Foo
  8616. {
  8617. public:
  8618. Foo (void) { a = 0; }
  8619. private:
  8620. int a;
  8621. };
  8622. EOF
  8623. ],[$1],[F77],[cat > conftest.$ac_ext <<EOF
  8624. subroutine foo
  8625. implicit none
  8626. integer*4 a
  8627. a=0
  8628. return
  8629. end
  8630. EOF
  8631. ],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
  8632. public class foo {
  8633. private int a;
  8634. public void bar (void) {
  8635. a = 0;
  8636. }
  8637. };
  8638. EOF
  8639. ])
  8640. dnl Parse the compiler output and extract the necessary
  8641. dnl objects, libraries and library flags.
  8642. if AC_TRY_EVAL(ac_compile); then
  8643. # Parse the compiler output and extract the necessary
  8644. # objects, libraries and library flags.
  8645. # Sentinel used to keep track of whether or not we are before
  8646. # the conftest object file.
  8647. pre_test_object_deps_done=no
  8648. # The `*' in the case matches for architectures that use `case' in
  8649. # $output_verbose_cmd can trigger glob expansion during the loop
  8650. # eval without this substitution.
  8651. output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
  8652. for p in `eval $output_verbose_link_cmd`; do
  8653. case $p in
  8654. -L* | -R* | -l*)
  8655. # Some compilers place space between "-{L,R}" and the path.
  8656. # Remove the space.
  8657. if test $p = "-L" \
  8658. || test $p = "-R"; then
  8659. prev=$p
  8660. continue
  8661. else
  8662. prev=
  8663. fi
  8664. if test "$pre_test_object_deps_done" = no; then
  8665. case $p in
  8666. -L* | -R*)
  8667. # Internal compiler library paths should come after those
  8668. # provided the user. The postdeps already come after the
  8669. # user supplied libs so there is no need to process them.
  8670. if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
  8671. _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
  8672. else
  8673. _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
  8674. fi
  8675. ;;
  8676. # The "-l" case would never come before the object being
  8677. # linked, so don't bother handling this case.
  8678. esac
  8679. else
  8680. if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
  8681. _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
  8682. else
  8683. _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
  8684. fi
  8685. fi
  8686. ;;
  8687. *.$objext)
  8688. # This assumes that the test object file only shows up
  8689. # once in the compiler output.
  8690. if test "$p" = "conftest.$objext"; then
  8691. pre_test_object_deps_done=yes
  8692. continue
  8693. fi
  8694. if test "$pre_test_object_deps_done" = no; then
  8695. if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
  8696. _LT_AC_TAGVAR(predep_objects, $1)="$p"
  8697. else
  8698. _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
  8699. fi
  8700. else
  8701. if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
  8702. _LT_AC_TAGVAR(postdep_objects, $1)="$p"
  8703. else
  8704. _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
  8705. fi
  8706. fi
  8707. ;;
  8708. *) ;; # Ignore the rest.
  8709. esac
  8710. done
  8711. # Clean up.
  8712. rm -f a.out a.exe
  8713. else
  8714. echo "libtool.m4: error: problem compiling $1 test program"
  8715. fi
  8716. $rm -f confest.$objext
  8717. # PORTME: override above test on systems where it is broken
  8718. ifelse([$1],[CXX],
  8719. [case $host_os in
  8720. interix3*)
  8721. # Interix 3.5 installs completely hosed .la files for C++, so rather than
  8722. # hack all around it, let's just trust "g++" to DTRT.
  8723. _LT_AC_TAGVAR(predep_objects,$1)=
  8724. _LT_AC_TAGVAR(postdep_objects,$1)=
  8725. _LT_AC_TAGVAR(postdeps,$1)=
  8726. ;;
  8727. solaris*)
  8728. case $cc_basename in
  8729. CC*)
  8730. # Adding this requires a known-good setup of shared libraries for
  8731. # Sun compiler versions before 5.6, else PIC objects from an old
  8732. # archive will be linked into the output, leading to subtle bugs.
  8733. _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
  8734. ;;
  8735. esac
  8736. ;;
  8737. esac
  8738. ])
  8739. case " $_LT_AC_TAGVAR(postdeps, $1) " in
  8740. *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
  8741. esac
  8742. ])# AC_LIBTOOL_POSTDEP_PREDEP
  8743. # AC_LIBTOOL_LANG_F77_CONFIG
  8744. # --------------------------
  8745. # Ensure that the configuration vars for the C compiler are
  8746. # suitably defined. Those variables are subsequently used by
  8747. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  8748. AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
  8749. AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
  8750. [AC_REQUIRE([AC_PROG_F77])
  8751. AC_LANG_PUSH(Fortran 77)
  8752. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8753. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  8754. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  8755. _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
  8756. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
  8757. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8758. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  8759. _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
  8760. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  8761. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  8762. _LT_AC_TAGVAR(hardcode_automatic, $1)=no
  8763. _LT_AC_TAGVAR(module_cmds, $1)=
  8764. _LT_AC_TAGVAR(module_expsym_cmds, $1)=
  8765. _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  8766. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  8767. _LT_AC_TAGVAR(no_undefined_flag, $1)=
  8768. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  8769. _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
  8770. # Source file extension for f77 test sources.
  8771. ac_ext=f
  8772. # Object file extension for compiled f77 test sources.
  8773. objext=o
  8774. _LT_AC_TAGVAR(objext, $1)=$objext
  8775. # Code to be used in simple compile tests
  8776. lt_simple_compile_test_code=" subroutine t\n return\n end\n"
  8777. # Code to be used in simple link tests
  8778. lt_simple_link_test_code=" program t\n end\n"
  8779. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  8780. _LT_AC_SYS_COMPILER
  8781. # save warnings/boilerplate of simple test code
  8782. _LT_COMPILER_BOILERPLATE
  8783. _LT_LINKER_BOILERPLATE
  8784. # Allow CC to be a program name with arguments.
  8785. lt_save_CC="$CC"
  8786. CC=${F77-"f77"}
  8787. compiler=$CC
  8788. _LT_AC_TAGVAR(compiler, $1)=$CC
  8789. _LT_CC_BASENAME([$compiler])
  8790. AC_MSG_CHECKING([if libtool supports shared libraries])
  8791. AC_MSG_RESULT([$can_build_shared])
  8792. AC_MSG_CHECKING([whether to build shared libraries])
  8793. test "$can_build_shared" = "no" && enable_shared=no
  8794. # On AIX, shared libraries and static libraries use the same namespace, and
  8795. # are all built from PIC.
  8796. case $host_os in
  8797. aix3*)
  8798. test "$enable_shared" = yes && enable_static=no
  8799. if test -n "$RANLIB"; then
  8800. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  8801. postinstall_cmds='$RANLIB $lib'
  8802. fi
  8803. ;;
  8804. aix4* | aix5*)
  8805. if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  8806. test "$enable_shared" = yes && enable_static=no
  8807. fi
  8808. ;;
  8809. esac
  8810. AC_MSG_RESULT([$enable_shared])
  8811. AC_MSG_CHECKING([whether to build static libraries])
  8812. # Make sure either enable_shared or enable_static is yes.
  8813. test "$enable_shared" = yes || enable_static=yes
  8814. AC_MSG_RESULT([$enable_static])
  8815. _LT_AC_TAGVAR(GCC, $1)="$G77"
  8816. _LT_AC_TAGVAR(LD, $1)="$LD"
  8817. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  8818. AC_LIBTOOL_PROG_CC_C_O($1)
  8819. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  8820. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  8821. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  8822. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  8823. AC_LIBTOOL_CONFIG($1)
  8824. AC_LANG_POP
  8825. CC="$lt_save_CC"
  8826. ])# AC_LIBTOOL_LANG_F77_CONFIG
  8827. # AC_LIBTOOL_LANG_GCJ_CONFIG
  8828. # --------------------------
  8829. # Ensure that the configuration vars for the C compiler are
  8830. # suitably defined. Those variables are subsequently used by
  8831. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  8832. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
  8833. AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
  8834. [AC_LANG_SAVE
  8835. # Source file extension for Java test sources.
  8836. ac_ext=java
  8837. # Object file extension for compiled Java test sources.
  8838. objext=o
  8839. _LT_AC_TAGVAR(objext, $1)=$objext
  8840. # Code to be used in simple compile tests
  8841. lt_simple_compile_test_code="class foo {}\n"
  8842. # Code to be used in simple link tests
  8843. lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
  8844. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  8845. _LT_AC_SYS_COMPILER
  8846. # save warnings/boilerplate of simple test code
  8847. _LT_COMPILER_BOILERPLATE
  8848. _LT_LINKER_BOILERPLATE
  8849. # Allow CC to be a program name with arguments.
  8850. lt_save_CC="$CC"
  8851. CC=${GCJ-"gcj"}
  8852. compiler=$CC
  8853. _LT_AC_TAGVAR(compiler, $1)=$CC
  8854. _LT_CC_BASENAME([$compiler])
  8855. # GCJ did not exist at the time GCC didn't implicitly link libc in.
  8856. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  8857. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  8858. ## CAVEAT EMPTOR:
  8859. ## There is no encapsulation within the following macros, do not change
  8860. ## the running order or otherwise move them around unless you know exactly
  8861. ## what you are doing...
  8862. AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
  8863. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  8864. AC_LIBTOOL_PROG_CC_C_O($1)
  8865. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  8866. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  8867. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  8868. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  8869. AC_LIBTOOL_CONFIG($1)
  8870. AC_LANG_RESTORE
  8871. CC="$lt_save_CC"
  8872. ])# AC_LIBTOOL_LANG_GCJ_CONFIG
  8873. # AC_LIBTOOL_LANG_RC_CONFIG
  8874. # -------------------------
  8875. # Ensure that the configuration vars for the Windows resource compiler are
  8876. # suitably defined. Those variables are subsequently used by
  8877. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  8878. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
  8879. AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
  8880. [AC_LANG_SAVE
  8881. # Source file extension for RC test sources.
  8882. ac_ext=rc
  8883. # Object file extension for compiled RC test sources.
  8884. objext=o
  8885. _LT_AC_TAGVAR(objext, $1)=$objext
  8886. # Code to be used in simple compile tests
  8887. lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
  8888. # Code to be used in simple link tests
  8889. lt_simple_link_test_code="$lt_simple_compile_test_code"
  8890. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  8891. _LT_AC_SYS_COMPILER
  8892. # save warnings/boilerplate of simple test code
  8893. _LT_COMPILER_BOILERPLATE
  8894. _LT_LINKER_BOILERPLATE
  8895. # Allow CC to be a program name with arguments.
  8896. lt_save_CC="$CC"
  8897. CC=${RC-"windres"}
  8898. compiler=$CC