KNights – chess game
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 323KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747
  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 tdelibs
  22. dnl and tdebase or configure.in.in if present.
  23. dnl ------------------------------------------------------------------------
  24. dnl Forward compatibility macros (make autoconf 2.13 look like 2.50),
  25. dnl thanks to Raja R Harinath.
  26. dnl ------------------------------------------------------------------------
  27. dnl
  28. ifdef([_AC_PATH_X_XMKMF],[],
  29. [AC_DEFUN([_AC_PATH_X_XMKMF],[AC_PATH_X_XMKMF])])
  30. ifdef([AC_OUTPUT_SUBDIRS],[],
  31. [AC_DEFUN([AC_OUTPUT_SUBDIRS],[subdirs=$1; _AC_OUTPUT_SUBDIRS])])
  32. # KDE_PATH_X_DIRECT
  33. dnl Internal subroutine of AC_PATH_X.
  34. dnl Set ac_x_includes and/or ac_x_libraries.
  35. AC_DEFUN(KDE_PATH_X_DIRECT,
  36. [
  37. AC_REQUIRE([KDE_CHECK_LIB64])
  38. if test "$ac_x_includes" = NO; then
  39. # Guess where to find include files, by looking for this one X11 .h file.
  40. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  41. # First, try using that file with no special directory specified.
  42. AC_TRY_CPP([#include <$x_direct_test_include>],
  43. [# We can compile using X headers with no special include directory.
  44. ac_x_includes=],
  45. [# Look for the header file in a standard set of common directories.
  46. # Check X11 before X11Rn because it is often a symlink to the current release.
  47. for ac_dir in \
  48. /usr/X11/include \
  49. /usr/X11R6/include \
  50. /usr/X11R5/include \
  51. /usr/X11R4/include \
  52. \
  53. /usr/include/X11 \
  54. /usr/include/X11R6 \
  55. /usr/include/X11R5 \
  56. /usr/include/X11R4 \
  57. \
  58. /usr/local/X11/include \
  59. /usr/local/X11R6/include \
  60. /usr/local/X11R5/include \
  61. /usr/local/X11R4/include \
  62. \
  63. /usr/local/include/X11 \
  64. /usr/local/include/X11R6 \
  65. /usr/local/include/X11R5 \
  66. /usr/local/include/X11R4 \
  67. \
  68. /usr/X386/include \
  69. /usr/x386/include \
  70. /usr/XFree86/include/X11 \
  71. \
  72. /usr/include \
  73. /usr/local/include \
  74. /usr/unsupported/include \
  75. /usr/athena/include \
  76. /usr/local/x11r5/include \
  77. /usr/lpp/Xamples/include \
  78. \
  79. /usr/openwin/include \
  80. /usr/openwin/share/include \
  81. ; \
  82. do
  83. if test -r "$ac_dir/$x_direct_test_include"; then
  84. ac_x_includes=$ac_dir
  85. break
  86. fi
  87. done])
  88. fi # $ac_x_includes = NO
  89. if test "$ac_x_libraries" = NO; then
  90. # Check for the libraries.
  91. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  92. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  93. # See if we find them without any special options.
  94. # Don't add to $LIBS permanently.
  95. ac_save_LIBS="$LIBS"
  96. LIBS="-l$x_direct_test_library $LIBS"
  97. AC_TRY_LINK(, [${x_direct_test_function}()],
  98. [LIBS="$ac_save_LIBS"
  99. # We can link X programs with no special library path.
  100. ac_x_libraries=],
  101. [LIBS="$ac_save_LIBS"
  102. # First see if replacing the include by lib works.
  103. # Check X11 before X11Rn because it is often a symlink to the current release.
  104. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib${tdelibsuff}/` \
  105. /usr/X11/lib${tdelibsuff} \
  106. /usr/X11R6/lib${tdelibsuff} \
  107. /usr/X11R5/lib${tdelibsuff} \
  108. /usr/X11R4/lib${tdelibsuff} \
  109. \
  110. /usr/lib${tdelibsuff}/X11 \
  111. /usr/lib${tdelibsuff}/X11R6 \
  112. /usr/lib${tdelibsuff}/X11R5 \
  113. /usr/lib${tdelibsuff}/X11R4 \
  114. \
  115. /usr/local/X11/lib${tdelibsuff} \
  116. /usr/local/X11R6/lib${tdelibsuff} \
  117. /usr/local/X11R5/lib${tdelibsuff} \
  118. /usr/local/X11R4/lib${tdelibsuff} \
  119. \
  120. /usr/local/lib${tdelibsuff}/X11 \
  121. /usr/local/lib${tdelibsuff}/X11R6 \
  122. /usr/local/lib${tdelibsuff}/X11R5 \
  123. /usr/local/lib${tdelibsuff}/X11R4 \
  124. \
  125. /usr/X386/lib${tdelibsuff} \
  126. /usr/x386/lib${tdelibsuff} \
  127. /usr/XFree86/lib${tdelibsuff}/X11 \
  128. \
  129. /usr/lib${tdelibsuff} \
  130. /usr/local/lib${tdelibsuff} \
  131. /usr/unsupported/lib${tdelibsuff} \
  132. /usr/athena/lib${tdelibsuff} \
  133. /usr/local/x11r5/lib${tdelibsuff} \
  134. /usr/lpp/Xamples/lib${tdelibsuff} \
  135. /lib/usr/lib${tdelibsuff}/X11 \
  136. \
  137. /usr/openwin/lib${tdelibsuff} \
  138. /usr/openwin/share/lib${tdelibsuff} \
  139. ; \
  140. do
  141. dnl Don't even attempt the hair of trying to link an X program!
  142. for ac_extension in a so sl; do
  143. if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  144. ac_x_libraries=$ac_dir
  145. break 2
  146. fi
  147. done
  148. done])
  149. fi # $ac_x_libraries = NO
  150. ])
  151. dnl ------------------------------------------------------------------------
  152. dnl Find a file (or one of more files in a list of dirs)
  153. dnl ------------------------------------------------------------------------
  154. dnl
  155. AC_DEFUN(AC_FIND_FILE,
  156. [
  157. $3=NO
  158. for i in $2;
  159. do
  160. for j in $1;
  161. do
  162. echo "configure: __oline__: $i/$j" >&AC_FD_CC
  163. if test -r "$i/$j"; then
  164. echo "taking that" >&AC_FD_CC
  165. $3=$i
  166. break 2
  167. fi
  168. done
  169. done
  170. ])
  171. dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
  172. dnl if-not-found, test-parameter)
  173. AC_DEFUN(KDE_FIND_PATH,
  174. [
  175. AC_MSG_CHECKING([for $1])
  176. if test -n "$$2"; then
  177. kde_cv_path="$$2";
  178. else
  179. kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
  180. AC_CACHE_VAL(kde_cv_path_$kde_cache,
  181. [
  182. kde_cv_path="NONE"
  183. dirs="$3"
  184. kde_save_IFS=$IFS
  185. IFS=':'
  186. for dir in $PATH; do
  187. dirs="$dirs $dir"
  188. done
  189. IFS=$kde_save_IFS
  190. for dir in $dirs; do
  191. if test -x "$dir/$1"; then
  192. if test -n "$5"
  193. then
  194. evalstr="$dir/$1 $5 2>&1 "
  195. if eval $evalstr; then
  196. kde_cv_path="$dir/$1"
  197. break
  198. fi
  199. else
  200. kde_cv_path="$dir/$1"
  201. break
  202. fi
  203. fi
  204. done
  205. eval "kde_cv_path_$kde_cache=$kde_cv_path"
  206. ])
  207. eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
  208. fi
  209. if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
  210. AC_MSG_RESULT(not found)
  211. $4
  212. else
  213. AC_MSG_RESULT($kde_cv_path)
  214. $2=$kde_cv_path
  215. fi
  216. ])
  217. AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
  218. [
  219. AC_MSG_ERROR([No Qt meta object compiler (moc) found!
  220. Please check whether you installed Qt correctly.
  221. You need to have a running moc binary.
  222. configure tried to run $ac_cv_path_moc and the test didn't
  223. succeed. If configure shouldn't have tried this one, set
  224. the environment variable MOC to the right one before running
  225. configure.
  226. ])
  227. ])
  228. AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
  229. [
  230. AC_MSG_WARN([No Qt ui compiler (uic) found!
  231. Please check whether you installed Qt correctly.
  232. You need to have a running uic binary.
  233. configure tried to run $ac_cv_path_uic and the test didn't
  234. succeed. If configure shouldn't have tried this one, set
  235. the environment variable UIC to the right one before running
  236. configure.
  237. ])
  238. ])
  239. AC_DEFUN(KDE_CHECK_UIC_FLAG,
  240. [
  241. AC_MSG_CHECKING([whether uic supports -$1 ])
  242. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  243. AC_CACHE_VAL(kde_cv_prog_uic_$kde_cache,
  244. [
  245. cat >conftest.ui <<EOT
  246. <!DOCTYPE UI><UI version="3" stdsetdef="1"></UI>
  247. EOT
  248. ac_uic_testrun="$UIC_PATH -$1 $2 conftest.ui >/dev/null"
  249. if AC_TRY_EVAL(ac_uic_testrun); then
  250. eval "kde_cv_prog_uic_$kde_cache=yes"
  251. else
  252. eval "kde_cv_prog_uic_$kde_cache=no"
  253. fi
  254. rm -f conftest*
  255. ])
  256. if eval "test \"`echo '$kde_cv_prog_uic_'$kde_cache`\" = yes"; then
  257. AC_MSG_RESULT([yes])
  258. :
  259. $3
  260. else
  261. AC_MSG_RESULT([no])
  262. :
  263. $4
  264. fi
  265. ])
  266. dnl ------------------------------------------------------------------------
  267. dnl Find the meta object compiler and the ui compiler in the PATH,
  268. dnl in $TQTDIR/bin, and some more usual places
  269. dnl ------------------------------------------------------------------------
  270. dnl
  271. AC_DEFUN(AC_PATH_TQT_MOC_UIC,
  272. [
  273. qt_bindirs=""
  274. for dir in $kde_qt_dirs; do
  275. qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
  276. done
  277. qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
  278. if test ! "$ac_qt_bindir" = "NO"; then
  279. qt_bindirs="$ac_qt_bindir $qt_bindirs"
  280. fi
  281. KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
  282. if test -z "$UIC_NOT_NEEDED"; then
  283. KDE_FIND_PATH(uic, UIC_PATH, [$qt_bindirs], [UIC_PATH=""])
  284. if test -z "$UIC_PATH" ; then
  285. KDE_UIC_ERROR_MESSAGE
  286. exit 1
  287. elif test $kde_qtver = 3; then
  288. KDE_CHECK_UIC_FLAG(L,[/nonexistant],ac_uic_supports_libpath=yes,ac_uic_supports_libpath=no)
  289. KDE_CHECK_UIC_FLAG(nounload,,ac_uic_supports_nounload=yes,ac_uic_supports_nounload=no)
  290. UIC=$UIC_PATH
  291. if test x$ac_uic_supports_libpath = xyes; then
  292. UIC="$UIC -L \$(kde_widgetdir)"
  293. fi
  294. if test x$ac_uic_supports_nounload = xyes; then
  295. UIC="$UIC -nounload"
  296. fi
  297. fi
  298. else
  299. UIC="echo uic not available: "
  300. fi
  301. AC_SUBST(MOC)
  302. AC_SUBST(UIC)
  303. UIC_TR="i18n"
  304. if test $kde_qtver = 3; then
  305. UIC_TR="tr2i18n"
  306. fi
  307. AC_SUBST(UIC_TR)
  308. ])
  309. AC_DEFUN(KDE_1_CHECK_PATHS,
  310. [
  311. KDE_1_CHECK_PATH_HEADERS
  312. KDE_TEST_RPATH=
  313. if test -n "$USE_RPATH"; then
  314. if test -n "$kde_libraries"; then
  315. KDE_TEST_RPATH="-R $kde_libraries"
  316. fi
  317. if test -n "$qt_libraries"; then
  318. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
  319. fi
  320. if test -n "$x_libraries"; then
  321. KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
  322. fi
  323. KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
  324. fi
  325. AC_MSG_CHECKING([for KDE libraries installed])
  326. ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -ltdecore $LIBTQT $KDE_TEST_RPATH 1>&5'
  327. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  328. AC_MSG_RESULT(yes)
  329. else
  330. AC_MSG_ERROR([your system fails at linking a small KDE application!
  331. Check, if your compiler is installed correctly and if you have used the
  332. same compiler to compile Qt and tdelibs as you did use now.
  333. For more details about this problem, look at the end of config.log.])
  334. fi
  335. if eval `TDEDIR= ./conftest 2>&5`; then
  336. kde_result=done
  337. else
  338. kde_result=problems
  339. fi
  340. TDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
  341. kde_have_all_paths=yes
  342. KDE_SET_PATHS($kde_result)
  343. ])
  344. AC_DEFUN(KDE_SET_PATHS,
  345. [
  346. kde_cv_all_paths="kde_have_all_paths=\"yes\" \
  347. kde_htmldir=\"$kde_htmldir\" \
  348. kde_appsdir=\"$kde_appsdir\" \
  349. kde_icondir=\"$kde_icondir\" \
  350. kde_sounddir=\"$kde_sounddir\" \
  351. kde_datadir=\"$kde_datadir\" \
  352. kde_locale=\"$kde_locale\" \
  353. kde_cgidir=\"$kde_cgidir\" \
  354. kde_confdir=\"$kde_confdir\" \
  355. kde_mimedir=\"$kde_mimedir\" \
  356. kde_toolbardir=\"$kde_toolbardir\" \
  357. kde_wallpaperdir=\"$kde_wallpaperdir\" \
  358. kde_templatesdir=\"$kde_templatesdir\" \
  359. kde_bindir=\"$kde_bindir\" \
  360. kde_servicesdir=\"$kde_servicesdir\" \
  361. kde_servicetypesdir=\"$kde_servicetypesdir\" \
  362. kde_moduledir=\"$kde_moduledir\" \
  363. kde_styledir=\"$kde_styledir\" \
  364. kde_widgetdir=\"$kde_widgetdir\" \
  365. kde_result=$1"
  366. ])
  367. AC_DEFUN(KDE_SET_DEFAULT_PATHS,
  368. [
  369. if test "$1" = "default"; then
  370. if test -z "$kde_htmldir"; then
  371. kde_htmldir='\${prefix}/share/doc/tde/HTML'
  372. fi
  373. if test -z "$kde_appsdir"; then
  374. kde_appsdir='\${prefix}/share/applnk'
  375. fi
  376. if test -z "$kde_icondir"; then
  377. kde_icondir='\${prefix}/share/icons'
  378. fi
  379. if test -z "$kde_sounddir"; then
  380. kde_sounddir='\${prefix}/share/sounds'
  381. fi
  382. if test -z "$kde_datadir"; then
  383. kde_datadir='\${prefix}/share/apps'
  384. fi
  385. if test -z "$kde_locale"; then
  386. kde_locale='\${prefix}/share/locale'
  387. fi
  388. if test -z "$kde_cgidir"; then
  389. kde_cgidir='\${exec_prefix}/cgi-bin'
  390. fi
  391. if test -z "$kde_confdir"; then
  392. kde_confdir='\${prefix}/share/config'
  393. fi
  394. if test -z "$kde_mimedir"; then
  395. kde_mimedir='\${prefix}/share/mimelnk'
  396. fi
  397. if test -z "$kde_toolbardir"; then
  398. kde_toolbardir='\${prefix}/share/toolbar'
  399. fi
  400. if test -z "$kde_wallpaperdir"; then
  401. kde_wallpaperdir='\${prefix}/share/wallpapers'
  402. fi
  403. if test -z "$kde_templatesdir"; then
  404. kde_templatesdir='\${prefix}/share/templates'
  405. fi
  406. if test -z "$kde_bindir"; then
  407. kde_bindir='\${exec_prefix}/bin'
  408. fi
  409. if test -z "$kde_servicesdir"; then
  410. kde_servicesdir='\${prefix}/share/services'
  411. fi
  412. if test -z "$kde_servicetypesdir"; then
  413. kde_servicetypesdir='\${prefix}/share/servicetypes'
  414. fi
  415. if test -z "$kde_moduledir"; then
  416. if test "$kde_qtver" = "2"; then
  417. kde_moduledir='\${libdir}/kde2'
  418. else
  419. kde_moduledir='\${libdir}/trinity'
  420. fi
  421. fi
  422. if test -z "$kde_styledir"; then
  423. kde_styledir='\${libdir}/trinity/plugins/styles'
  424. fi
  425. if test -z "$kde_widgetdir"; then
  426. kde_widgetdir='\${libdir}/trinity/plugins/designer'
  427. fi
  428. KDE_SET_PATHS(defaults)
  429. else
  430. if test $kde_qtver = 1; then
  431. AC_MSG_RESULT([compiling])
  432. KDE_1_CHECK_PATHS
  433. else
  434. AC_MSG_ERROR([path checking not yet supported for KDE 2])
  435. fi
  436. fi
  437. ])
  438. AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
  439. [ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
  440. test -z "$kde_icondir" || test -z "$kde_sounddir" ||
  441. test -z "$kde_datadir" || test -z "$kde_locale" ||
  442. test -z "$kde_cgidir" || test -z "$kde_confdir" ||
  443. test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
  444. test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
  445. test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
  446. test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
  447. test -z "$kde_styledir" || test -z "kde_widgetdir"
  448. test "x$kde_have_all_paths" != "xyes"; then
  449. kde_have_all_paths=no
  450. fi
  451. ])
  452. AC_DEFUN(KDE_MISSING_PROG_ERROR,
  453. [
  454. AC_MSG_ERROR([The important program $1 was not found!
  455. Please check whether you installed KDE correctly.
  456. ])
  457. ])
  458. AC_DEFUN(KDE_MISSING_ARTS_ERROR,
  459. [
  460. AC_MSG_ERROR([The important program $1 was not found!
  461. Please check whether you installed aRts correctly.
  462. ])
  463. ])
  464. AC_DEFUN(KDE_SUBST_PROGRAMS,
  465. [
  466. 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"
  467. test -n "$TDEDIR" && kde_default_bindirs="$TDEDIR/bin $kde_default_bindirs"
  468. if test -n "$TDEDIRS"; then
  469. kde_save_IFS=$IFS
  470. IFS=:
  471. for dir in $TDEDIRS; do
  472. kde_default_bindirs="$dir/bin $kde_default_bindirs "
  473. done
  474. IFS=$kde_save_IFS
  475. fi
  476. kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
  477. KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
  478. KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
  479. KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(mcopidl)])
  480. KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_ARTS_ERROR(artsc-config)])
  481. KDE_FIND_PATH(tde-config, KDECONFIG, [$kde_default_bindirs])
  482. KDE_FIND_PATH(meinproc, MEINPROC, [$kde_default_bindirs])
  483. if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then
  484. kde_sharedirs="$prefix/share /opt/trinity/share /opt/trinity/share /opt/kde/share /usr/share/kde /usr/local/share /usr/share"
  485. test -n "$TDEDIR" && kde_sharedirs="$TDEDIR/share $kde_sharedirs"
  486. AC_FIND_FILE(apps/ksgmltools2/customization/tde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
  487. if test "$KDE_XSL_STYLESHEET" = "NO"; then
  488. KDE_XSL_STYLESHEET=""
  489. else
  490. KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/tde-chunk.xsl"
  491. fi
  492. fi
  493. DCOP_DEPENDENCIES='$(DCOPIDL)'
  494. AC_SUBST(DCOPIDL)
  495. AC_SUBST(DCOPIDL2CPP)
  496. AC_SUBST(DCOP_DEPENDENCIES)
  497. AC_SUBST(MCOPIDL)
  498. AC_SUBST(ARTSCCONFIG)
  499. AC_SUBST(KDECONFIG)
  500. AC_SUBST(MEINPROC)
  501. AC_SUBST(KDE_XSL_STYLESHEET)
  502. if test -x "$KDECONFIG"; then # it can be "compiled"
  503. kde_libs_prefix=`$KDECONFIG --prefix`
  504. if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
  505. AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for tdelibs.
  506. This means it has been moved since you installed it.
  507. This won't work. Please recompile tdelibs for the new prefix.
  508. ])
  509. fi
  510. kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
  511. else
  512. kde_libs_prefix='$(prefix)'
  513. kde_libs_htmldir='$(kde_htmldir)'
  514. fi
  515. AC_SUBST(kde_libs_prefix)
  516. AC_SUBST(kde_libs_htmldir)
  517. ])dnl
  518. AC_DEFUN(AC_CREATE_KFSSTND,
  519. [
  520. AC_REQUIRE([AC_CHECK_RPATH])
  521. AC_MSG_CHECKING([for KDE paths])
  522. kde_result=""
  523. kde_cached_paths=yes
  524. AC_CACHE_VAL(kde_cv_all_paths,
  525. [
  526. KDE_SET_DEFAULT_PATHS($1)
  527. kde_cached_paths=no
  528. ])
  529. eval "$kde_cv_all_paths"
  530. KDE_CHECK_PATHS_FOR_COMPLETENESS
  531. if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
  532. # wrong values were cached, may be, we can set better ones
  533. kde_result=
  534. kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
  535. kde_datadir= kde_locale= kde_cgidir= kde_confdir=
  536. kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
  537. kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
  538. kde_have_all_paths=
  539. kde_styledir=
  540. kde_widgetdir=
  541. KDE_SET_DEFAULT_PATHS($1)
  542. eval "$kde_cv_all_paths"
  543. KDE_CHECK_PATHS_FOR_COMPLETENESS
  544. kde_result="$kde_result (cache overridden)"
  545. fi
  546. if test "$kde_have_all_paths" = "no"; then
  547. AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
  548. Since it had compiled and linked before, it must be a strange problem on your system.
  549. Look at config.log for details. If you are not able to fix this, look at
  550. http://www.kde.org/faq/installation.html or any www.kde.org mirror.
  551. (If you're using an egcs version on Linux, you may update binutils!)
  552. ])
  553. else
  554. rm -f conftest*
  555. AC_MSG_RESULT($kde_result)
  556. fi
  557. bindir=$kde_bindir
  558. KDE_SUBST_PROGRAMS
  559. ])
  560. AC_DEFUN(AC_SUBST_KFSSTND,
  561. [
  562. AC_SUBST(kde_htmldir)
  563. AC_SUBST(kde_appsdir)
  564. AC_SUBST(kde_icondir)
  565. AC_SUBST(kde_sounddir)
  566. AC_SUBST(kde_datadir)
  567. AC_SUBST(kde_locale)
  568. AC_SUBST(kde_confdir)
  569. AC_SUBST(kde_mimedir)
  570. AC_SUBST(kde_wallpaperdir)
  571. AC_SUBST(kde_bindir)
  572. dnl for KDE 2
  573. AC_SUBST(kde_templatesdir)
  574. AC_SUBST(kde_servicesdir)
  575. AC_SUBST(kde_servicetypesdir)
  576. AC_SUBST(kde_moduledir)
  577. AC_SUBST(kde_styledir)
  578. AC_SUBST(kde_widgetdir)
  579. if test "$kde_qtver" = 1; then
  580. kde_minidir="$kde_icondir/mini"
  581. else
  582. # for KDE 1 - this breaks KDE2 apps using minidir, but
  583. # that's the plan ;-/
  584. kde_minidir="/dev/null"
  585. fi
  586. dnl AC_SUBST(kde_minidir)
  587. dnl AC_SUBST(kde_cgidir)
  588. dnl AC_SUBST(kde_toolbardir)
  589. ])
  590. AC_DEFUN(KDE_MISC_TESTS,
  591. [
  592. AC_LANG_C
  593. dnl Checks for libraries.
  594. AC_CHECK_LIB(util, main, [LIBUTIL="-lutil"]) dnl for *BSD
  595. AC_SUBST(LIBUTIL)
  596. AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for *BSD
  597. AC_SUBST(LIBCOMPAT)
  598. kde_have_crypt=
  599. AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
  600. AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
  601. AC_MSG_WARN([you have no crypt in either libcrypt or libc.
  602. You should install libcrypt from another source or configure with PAM
  603. support])
  604. kde_have_crypt=no
  605. ]))
  606. AC_SUBST(LIBCRYPT)
  607. if test $kde_have_crypt = yes; then
  608. AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
  609. fi
  610. AC_CHECK_SOCKLEN_T
  611. AC_LANG_C
  612. AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
  613. if test $ac_cv_lib_dnet_dnet_ntoa = no; then
  614. AC_CHECK_LIB(dnet_stub, dnet_ntoa,
  615. [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
  616. fi
  617. AC_CHECK_FUNC(inet_ntoa)
  618. if test $ac_cv_func_inet_ntoa = no; then
  619. AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
  620. fi
  621. AC_CHECK_FUNC(connect)
  622. if test $ac_cv_func_connect = no; then
  623. AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
  624. $X_EXTRA_LIBS)
  625. fi
  626. AC_CHECK_FUNC(remove)
  627. if test $ac_cv_func_remove = no; then
  628. AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
  629. fi
  630. # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
  631. AC_CHECK_FUNC(shmat, ,
  632. AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
  633. # darwin needs this to initialize the environment
  634. AC_CHECK_HEADERS(crt_externs.h)
  635. AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
  636. # more headers that need to be explicitly included on darwin
  637. AC_CHECK_HEADERS(sys/types.h stdint.h)
  638. # darwin requires a poll emulation library
  639. AC_CHECK_LIB(poll, poll, LIB_POLL="-lpoll")
  640. # CoreAudio framework
  641. AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [
  642. AC_DEFINE(HAVE_COREAUDIO, 1, [Define if you have the CoreAudio API])
  643. FRAMEWORK_COREAUDIO="-framework CoreAudio"
  644. ])
  645. AC_CHECK_RES_INIT
  646. AC_SUBST(LIB_POLL)
  647. AC_SUBST(FRAMEWORK_COREAUDIO)
  648. LIBSOCKET="$X_EXTRA_LIBS"
  649. AC_SUBST(LIBSOCKET)
  650. AC_SUBST(X_EXTRA_LIBS)
  651. AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
  652. AC_SUBST(LIBUCB)
  653. case $host in dnl this *is* LynxOS specific
  654. *-*-lynxos* )
  655. AC_MSG_CHECKING([LynxOS header file wrappers])
  656. [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
  657. AC_MSG_RESULT(disabled)
  658. AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
  659. ;;
  660. esac
  661. KDE_CHECK_TYPES
  662. KDE_CHECK_LIBDL
  663. AH_VERBATIM(_AIX_STRINGS_H_BZERO,
  664. [
  665. /*
  666. * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
  667. * that defines bzero.
  668. */
  669. #if defined(_AIX)
  670. #include <strings.h>
  671. #endif
  672. ])
  673. AC_CHECK_FUNCS([vsnprintf snprintf])
  674. AH_VERBATIM(_TRU64,[
  675. /*
  676. * On HP-UX, the declaration of vsnprintf() is needed every time !
  677. */
  678. #if !defined(HAVE_VSNPRINTF) || defined(hpux)
  679. #if __STDC__
  680. #include <stdarg.h>
  681. #include <stdlib.h>
  682. #else
  683. #include <varargs.h>
  684. #endif
  685. #ifdef __cplusplus
  686. extern "C"
  687. #endif
  688. int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
  689. #ifdef __cplusplus
  690. extern "C"
  691. #endif
  692. int snprintf(char *str, size_t n, char const *fmt, ...);
  693. #endif
  694. ])
  695. ])
  696. dnl ------------------------------------------------------------------------
  697. dnl Find the header files and libraries for X-Windows. Extended the
  698. dnl macro AC_PATH_X
  699. dnl ------------------------------------------------------------------------
  700. dnl
  701. AC_DEFUN(K_PATH_X,
  702. [
  703. AC_REQUIRE([KDE_MISC_TESTS])dnl
  704. AC_REQUIRE([KDE_CHECK_LIB64])
  705. AC_ARG_ENABLE(
  706. embedded,
  707. [ --enable-embedded link to Qt-embedded, don't use X],
  708. kde_use_qt_emb=$enableval,
  709. kde_use_qt_emb=no
  710. )
  711. AC_ARG_ENABLE(
  712. qtopia,
  713. [ --enable-qtopia link to Qt-embedded, link to the Qtopia Environment],
  714. kde_use_qt_emb_palm=$enableval,
  715. kde_use_qt_emb_palm=no
  716. )
  717. if test "$kde_use_qt_emb" = "no"; then
  718. AC_MSG_CHECKING(for X)
  719. AC_LANG_SAVE
  720. AC_LANG_C
  721. AC_CACHE_VAL(kde_cv_have_x,
  722. [# One or both of the vars are not set, and there is no cached value.
  723. if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
  724. kde_x_includes=NO
  725. else
  726. kde_x_includes=$x_includes
  727. fi
  728. if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
  729. kde_x_libraries=NO
  730. else
  731. kde_x_libraries=$x_libraries
  732. fi
  733. # below we use the standard autoconf calls
  734. ac_x_libraries=$kde_x_libraries
  735. ac_x_includes=$kde_x_includes
  736. KDE_PATH_X_DIRECT
  737. dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
  738. dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
  739. dnl location. The correct location is /usr/lib32 or an undefined value
  740. dnl (the linker is smart enough to pick the correct default library).
  741. dnl Things work just fine if you use just AC_PATH_X_DIRECT.
  742. dnl Solaris has a similar problem. AC_PATH_X_XMKMF forces x_includes to
  743. dnl /usr/openwin/include, which doesn't work. /usr/include does work, so
  744. dnl x_includes should be left alone.
  745. case "$host" in
  746. mips-sgi-irix6*)
  747. ;;
  748. *-*-solaris*)
  749. ;;
  750. *)
  751. _AC_PATH_X_XMKMF
  752. if test -z "$ac_x_includes"; then
  753. ac_x_includes="."
  754. fi
  755. if test -z "$ac_x_libraries"; then
  756. ac_x_libraries="/usr/lib${tdelibsuff}"
  757. fi
  758. esac
  759. #from now on we use our own again
  760. # when the user already gave --x-includes, we ignore
  761. # what the standard autoconf macros told us.
  762. if test "$kde_x_includes" = NO; then
  763. kde_x_includes=$ac_x_includes
  764. fi
  765. # for --x-libraries too
  766. if test "$kde_x_libraries" = NO; then
  767. kde_x_libraries=$ac_x_libraries
  768. fi
  769. if test "$kde_x_includes" = NO; then
  770. AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
  771. fi
  772. if test "$kde_x_libraries" = NO; then
  773. AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
  774. fi
  775. # Record where we found X for the cache.
  776. kde_cv_have_x="have_x=yes \
  777. kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
  778. ])dnl
  779. eval "$kde_cv_have_x"
  780. if test "$have_x" != yes; then
  781. AC_MSG_RESULT($have_x)
  782. no_x=yes
  783. else
  784. AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
  785. fi
  786. if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
  787. X_INCLUDES=""
  788. x_includes="."; dnl better than nothing :-
  789. else
  790. x_includes=$kde_x_includes
  791. X_INCLUDES="-I$x_includes"
  792. fi
  793. if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
  794. X_LDFLAGS=""
  795. x_libraries="/usr/lib"; dnl better than nothing :-
  796. else
  797. x_libraries=$kde_x_libraries
  798. X_LDFLAGS="-L$x_libraries"
  799. fi
  800. all_includes="$X_INCLUDES"
  801. all_libraries="$X_LDFLAGS"
  802. AC_SUBST(X_INCLUDES)
  803. AC_SUBST(X_LDFLAGS)
  804. AC_SUBST(x_libraries)
  805. AC_SUBST(x_includes)
  806. # Check for libraries that X11R6 Xt/Xaw programs need.
  807. ac_save_LDFLAGS="$LDFLAGS"
  808. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  809. # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
  810. # check for ICE first), but we must link in the order -lSM -lICE or
  811. # we get undefined symbols. So assume we have SM if we have ICE.
  812. # These have to be linked with before -lX11, unlike the other
  813. # libraries we check for below, so use a different variable.
  814. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
  815. AC_CHECK_LIB(ICE, IceConnectionNumber,
  816. [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
  817. AC_SUBST(LIBSM)
  818. LDFLAGS="$ac_save_LDFLAGS"
  819. AC_SUBST(X_PRE_LIBS)
  820. LIB_X11='-lX11 $(LIBSOCKET)'
  821. AC_SUBST(LIB_X11)
  822. AC_MSG_CHECKING(for libXext)
  823. AC_CACHE_VAL(kde_cv_have_libXext,
  824. [
  825. kde_ldflags_safe="$LDFLAGS"
  826. kde_libs_safe="$LIBS"
  827. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  828. LIBS="-lXext -lX11 $LIBSOCKET"
  829. AC_TRY_LINK([
  830. #include <stdio.h>
  831. #ifdef STDC_HEADERS
  832. # include <stdlib.h>
  833. #endif
  834. ],
  835. [
  836. printf("hello Xext\n");
  837. ],
  838. kde_cv_have_libXext=yes,
  839. kde_cv_have_libXext=no
  840. )
  841. LDFLAGS=$kde_ldflags_safe
  842. LIBS=$kde_libs_safe
  843. ])
  844. AC_MSG_RESULT($kde_cv_have_libXext)
  845. if test "$kde_cv_have_libXext" = "no"; then
  846. AC_MSG_ERROR([We need a working libXext to proceed. Since configure
  847. can't find it itself, we stop here assuming that make wouldn't find
  848. them either.])
  849. fi
  850. AC_MSG_CHECKING(for Xinerama)
  851. AC_ARG_WITH(xinerama,
  852. [ --with-xinerama enable support for Xinerama ],
  853. [
  854. no_xinerama=no
  855. ], [
  856. no_xinerama=yes
  857. ]
  858. )
  859. kde_save_LDFLAGS="$LDFLAGS"
  860. kde_save_CFLAGS="$CFLAGS"
  861. kde_save_LIBS="$LIBS"
  862. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
  863. CFLAGS="$CFLAGS -I$x_includes"
  864. LIBS="-lXinerama -lXext"
  865. if test "x$no_xinerama" = "xno"; then
  866. AC_CACHE_VAL(ac_cv_have_xinerama,
  867. [
  868. AC_TRY_LINK([#include <X11/Xlib.h>
  869. #include <X11/extensions/Xinerama.h>],
  870. [XineramaIsActive(NULL);],
  871. [ac_cv_have_xinerama="yes"],
  872. [ac_cv_have_xinerama="no"])
  873. ])
  874. else
  875. ac_cv_have_xinerama=no;
  876. fi
  877. AC_MSG_RESULT($ac_cv_have_xinerama)
  878. LIBXINERAMA=""
  879. if test "$ac_cv_have_xinerama" = "yes"; then
  880. AC_DEFINE(HAVE_XINERAMA, 1, [Define if you want Xinerama support])
  881. LIBXINERAMA="-lXinerama"
  882. fi
  883. AC_SUBST(LIBXINERAMA)
  884. LDFLAGS="$kde_save_LDFLAGS"
  885. CFLAGS="$kde_save_CFLAGS"
  886. LIBS="$kde_save_LIBS"
  887. LIB_XEXT="-lXext"
  888. QTE_NORTTI=""
  889. else
  890. dnl We're using QT Embedded
  891. CPPFLAGS=-DQWS
  892. CXXFLAGS="$CXXFLAGS -fno-rtti"
  893. QTE_NORTTI="-fno-rtti -DQWS"
  894. X_PRE_LIBS=""
  895. LIB_X11=""
  896. LIB_XEXT=""
  897. LIBSM=""
  898. X_INCLUDES=""
  899. X_LDFLAGS=""
  900. x_includes=""
  901. x_libraries=""
  902. AC_SUBST(X_PRE_LIBS)
  903. AC_SUBST(LIB_X11)
  904. AC_SUBST(LIBSM)
  905. AC_SUBST(X_INCLUDES)
  906. AC_SUBST(X_LDFLAGS)
  907. AC_SUBST(x_includes)
  908. AC_SUBST(x_libraries)
  909. fi
  910. AC_SUBST(QTE_NORTTI)
  911. AC_SUBST(LIB_XEXT)
  912. AC_LANG_RESTORE
  913. ])
  914. AC_DEFUN(KDE_PRINT_QT_PROGRAM,
  915. [
  916. AC_REQUIRE([KDE_USE_TQT])
  917. cat > conftest.$ac_ext <<EOF
  918. #include "confdefs.h"
  919. #include <qglobal.h>
  920. #include <qapplication.h>
  921. EOF
  922. if test "$kde_qtver" = "2"; then
  923. cat >> conftest.$ac_ext <<EOF
  924. #include <qevent.h>
  925. #include <qstring.h>
  926. #include <qstyle.h>
  927. EOF
  928. if test $kde_qtsubver -gt 0; then
  929. cat >> conftest.$ac_ext <<EOF
  930. #if TQT_VERSION < 210
  931. #error 1
  932. #endif
  933. EOF
  934. fi
  935. fi
  936. if test "$kde_qtver" = "3"; then
  937. cat >> conftest.$ac_ext <<EOF
  938. #include <qcursor.h>
  939. #include <qstylefactory.h>
  940. #include <private/qucomextra_p.h>
  941. EOF
  942. fi
  943. echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
  944. cat >> conftest.$ac_ext <<EOF
  945. #error 1
  946. #endif
  947. int main() {
  948. EOF
  949. if test "$kde_qtver" = "2"; then
  950. cat >> conftest.$ac_ext <<EOF
  951. QStringList *t = new QStringList();
  952. Q_UNUSED(t);
  953. EOF
  954. if test $kde_qtsubver -gt 0; then
  955. cat >> conftest.$ac_ext <<EOF
  956. QString s;
  957. s.setLatin1("Elvis is alive", 14);
  958. EOF
  959. fi
  960. fi
  961. if test "$kde_qtver" = "3"; then
  962. cat >> conftest.$ac_ext <<EOF
  963. (void)QStyleFactory::create(QString::null);
  964. QCursor c(Qt::WhatsThisCursor);
  965. EOF
  966. fi
  967. cat >> conftest.$ac_ext <<EOF
  968. return 0;
  969. }
  970. EOF
  971. ])
  972. AC_DEFUN(KDE_USE_TQT,
  973. [
  974. if test -z "$1"; then
  975. # Current default Qt version: 3.1
  976. kde_qtver=3
  977. kde_qtsubver=1
  978. else
  979. kde_qtsubver=`echo "$1" | sed -e 's#[0-9][0-9]*\.\([0-9][0-9]*\).*#\1#'`
  980. # following is the check if subversion isnt found in passed argument
  981. if test "$kde_qtsubver" = "$1"; then
  982. kde_qtsubver=1
  983. fi
  984. kde_qtver=`echo "$1" | sed -e 's#^\([0-9][0-9]*\)\..*#\1#'`
  985. if test "$kde_qtver" = "1"; then
  986. kde_qtsubver=42
  987. fi
  988. fi
  989. if test -z "$2"; then
  990. if test "$kde_qtver" = "2"; then
  991. if test $kde_qtsubver -gt 0; then
  992. kde_qt_minversion=">= Qt 2.2.2"
  993. else
  994. kde_qt_minversion=">= Qt 2.0.2"
  995. fi
  996. fi
  997. if test "$kde_qtver" = "3"; then
  998. if test $kde_qtsubver -gt 0; then
  999. kde_qt_minversion=">= Qt 3.1 (20021021)"
  1000. else
  1001. kde_qt_minversion=">= Qt 3.0"
  1002. fi
  1003. fi
  1004. if test "$kde_qtver" = "1"; then
  1005. kde_qt_minversion=">= 1.42 and < 2.0"
  1006. fi
  1007. else
  1008. kde_qt_minversion=$2
  1009. fi
  1010. if test -z "$3"; then
  1011. if test $kde_qtver = 3; then
  1012. if test $kde_qtsubver -gt 0; then
  1013. kde_qt_verstring="TQT_VERSION >= 0x030100"
  1014. else
  1015. kde_qt_verstring="TQT_VERSION >= 300"
  1016. fi
  1017. fi
  1018. if test $kde_qtver = 2; then
  1019. if test $kde_qtsubver -gt 0; then
  1020. kde_qt_verstring="TQT_VERSION >= 222"
  1021. else
  1022. kde_qt_verstring="TQT_VERSION >= 200"
  1023. fi
  1024. fi
  1025. if test $kde_qtver = 1; then
  1026. kde_qt_verstring="TQT_VERSION >= 142 && TQT_VERSION < 200"
  1027. fi
  1028. else
  1029. kde_qt_verstring=$3
  1030. fi
  1031. if test $kde_qtver = 3; then
  1032. kde_qt_dirs="$TQTDIR /usr/lib/qt3 /usr/lib/qt"
  1033. fi
  1034. if test $kde_qtver = 2; then
  1035. kde_qt_dirs="$TQTDIR /usr/lib/qt2 /usr/lib/qt"
  1036. fi
  1037. if test $kde_qtver = 1; then
  1038. kde_qt_dirs="$TQTDIR /usr/lib/qt"
  1039. fi
  1040. ])
  1041. AC_DEFUN(KDE_CHECK_QT_DIRECT,
  1042. [
  1043. AC_REQUIRE([KDE_USE_TQT])
  1044. AC_MSG_CHECKING([if Qt compiles without flags])
  1045. AC_CACHE_VAL(kde_cv_qt_direct,
  1046. [
  1047. AC_LANG_SAVE
  1048. AC_LANG_CPLUSPLUS
  1049. ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
  1050. ac_LIBRARY_PATH="$LIBRARY_PATH"
  1051. ac_cxxflags_safe="$CXXFLAGS"
  1052. ac_ldflags_safe="$LDFLAGS"
  1053. ac_libs_safe="$LIBS"
  1054. CXXFLAGS="$CXXFLAGS -I$tqt_includes"
  1055. LDFLAGS="$LDFLAGS $X_LDFLAGS"
  1056. if test "x$kde_use_qt_emb" != "xyes"; then
  1057. LIBS="$LIBTQT -lXext -lX11 $LIBSOCKET"
  1058. else
  1059. LIBS="$LIBTQT $LIBSOCKET"
  1060. fi
  1061. LD_LIBRARY_PATH=
  1062. export LD_LIBRARY_PATH
  1063. LIBRARY_PATH=
  1064. export LIBRARY_PATH
  1065. KDE_PRINT_QT_PROGRAM
  1066. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1067. kde_cv_qt_direct="yes"
  1068. else
  1069. kde_cv_qt_direct="no"
  1070. echo "configure: failed program was:" >&AC_FD_CC
  1071. cat conftest.$ac_ext >&AC_FD_CC
  1072. fi
  1073. rm -f conftest*
  1074. CXXFLAGS="$ac_cxxflags_safe"
  1075. LDFLAGS="$ac_ldflags_safe"
  1076. LIBS="$ac_libs_safe"
  1077. LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
  1078. export LD_LIBRARY_PATH
  1079. LIBRARY_PATH="$ac_LIBRARY_PATH"
  1080. export LIBRARY_PATH
  1081. AC_LANG_RESTORE
  1082. ])
  1083. if test "$kde_cv_qt_direct" = "yes"; then
  1084. AC_MSG_RESULT(yes)
  1085. $1
  1086. else
  1087. AC_MSG_RESULT(no)
  1088. $2
  1089. fi
  1090. ])
  1091. dnl ------------------------------------------------------------------------
  1092. dnl Try to find the Qt headers and libraries.
  1093. dnl $(QT_LDFLAGS) will be -Ltqtliblocation (if needed)
  1094. dnl and $(TQT_INCLUDES) will be -Iqthdrlocation (if needed)
  1095. dnl ------------------------------------------------------------------------
  1096. dnl
  1097. AC_DEFUN(AC_PATH_TQT_1_3,
  1098. [
  1099. AC_REQUIRE([K_PATH_X])
  1100. AC_REQUIRE([KDE_USE_TQT])
  1101. AC_REQUIRE([KDE_CHECK_LIB64])
  1102. dnl ------------------------------------------------------------------------
  1103. dnl Add configure flag to enable linking to MT version of Qt library.
  1104. dnl ------------------------------------------------------------------------
  1105. AC_ARG_ENABLE(
  1106. mt,
  1107. [ --disable-mt link to non-threaded Qt (deprecated)],
  1108. kde_use_qt_mt=$enableval,
  1109. [
  1110. if test $kde_qtver = 3; then
  1111. kde_use_qt_mt=yes
  1112. else
  1113. kde_use_qt_mt=no
  1114. fi
  1115. ]
  1116. )
  1117. USING_QT_MT=""
  1118. dnl ------------------------------------------------------------------------
  1119. dnl If we not get --disable-qt-mt then adjust some vars for the host.
  1120. dnl ------------------------------------------------------------------------
  1121. KDE_MT_LDFLAGS=
  1122. KDE_MT_LIBS=
  1123. if test "x$kde_use_qt_mt" = "xyes"; then
  1124. KDE_CHECK_THREADING
  1125. if test "x$kde_use_threading" = "xyes"; then
  1126. CPPFLAGS="$USE_THREADS -DTQT_THREAD_SUPPORT $CPPFLAGS"
  1127. KDE_MT_LDFLAGS="$USE_THREADS"
  1128. KDE_MT_LIBS="$LIBPTHREAD"
  1129. else
  1130. kde_use_qt_mt=no
  1131. fi
  1132. fi
  1133. AC_SUBST(KDE_MT_LDFLAGS)
  1134. AC_SUBST(KDE_MT_LIBS)
  1135. kde_qt_was_given=yes
  1136. dnl ------------------------------------------------------------------------
  1137. dnl If we haven't been told how to link to Qt, we work it out for ourselves.
  1138. dnl ------------------------------------------------------------------------
  1139. if test -z "$LIBTQT_GLOB"; then
  1140. if test "x$kde_use_qt_emb" = "xyes"; then
  1141. LIBTQT_GLOB="libtqte.*"
  1142. else
  1143. LIBTQT_GLOB="libtqt.*"
  1144. fi
  1145. fi
  1146. if test -z "$LIBTQT"; then
  1147. dnl ------------------------------------------------------------
  1148. dnl If we got --enable-embedded then adjust the Qt library name.
  1149. dnl ------------------------------------------------------------
  1150. if test "x$kde_use_qt_emb" = "xyes"; then
  1151. tqtlib="qte"
  1152. else
  1153. tqtlib="qt"
  1154. fi
  1155. kde_int_qt="-l$tqtlib"
  1156. else
  1157. kde_int_qt="$LIBTQT"
  1158. kde_lib_qt_set=yes
  1159. fi
  1160. if test -z "$LIBQPE"; then
  1161. dnl ------------------------------------------------------------
  1162. dnl If we got --enable-palmtop then add -lqpe to the link line
  1163. dnl ------------------------------------------------------------
  1164. if test "x$kde_use_qt_emb" = "xyes"; then
  1165. if test "x$kde_use_qt_emb_palm" = "xyes"; then
  1166. LIB_QPE="-lqpe"
  1167. else
  1168. LIB_QPE=""
  1169. fi
  1170. else
  1171. LIB_QPE=""
  1172. fi
  1173. fi
  1174. dnl ------------------------------------------------------------------------
  1175. dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
  1176. dnl ------------------------------------------------------------------------
  1177. if test "x$kde_use_qt_mt" = "xyes"; then
  1178. if test -z "$LIBTQT"; then
  1179. LIBTQT="-l$tqtlib-mt"
  1180. kde_int_qt="-l$tqtlib-mt"
  1181. else
  1182. LIBTQT="$tqtlib-mt"
  1183. kde_int_qt="$tqtlib-mt"
  1184. fi
  1185. LIBTQT_GLOB="lib$tqtlib-mt.*"
  1186. USING_QT_MT="using -mt"
  1187. else
  1188. LIBTQT="-l$tqtlib"
  1189. fi
  1190. if test $kde_qtver != 1; then
  1191. AC_REQUIRE([AC_FIND_PNG])
  1192. AC_REQUIRE([AC_FIND_JPEG])
  1193. LIBTQT="$LIBTQT $LIBPNG $LIBJPEG"
  1194. fi
  1195. if test $kde_qtver = 3; then
  1196. AC_REQUIRE([KDE_CHECK_LIBDL])
  1197. LIBTQT="$LIBTQT $LIBDL"
  1198. fi
  1199. AC_MSG_CHECKING([for Qt])
  1200. if test "x$kde_use_qt_emb" != "xyes"; then
  1201. LIBTQT="$LIBTQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
  1202. fi
  1203. ac_tqt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
  1204. qt_libraries=""
  1205. tqt_includes=""
  1206. AC_ARG_WITH(qt-dir,
  1207. [ --with-qt-dir=DIR where the root of Qt is installed ],
  1208. [ ac_tqt_includes="$withval"/include
  1209. ac_qt_libraries="$withval"/lib${tdelibsuff}
  1210. ac_qt_bindir="$withval"/bin
  1211. ])
  1212. AC_ARG_WITH(qt-includes,
  1213. [ --with-qt-includes=DIR where the Qt includes are. ],
  1214. [
  1215. ac_tqt_includes="$withval"
  1216. ])
  1217. kde_qt_libs_given=no
  1218. AC_ARG_WITH(qt-libraries,
  1219. [ --with-qt-libraries=DIR where the Qt library is installed.],
  1220. [ ac_qt_libraries="$withval"
  1221. kde_qt_libs_given=yes
  1222. ])
  1223. AC_CACHE_VAL(ac_cv_have_qt,
  1224. [#try to guess Qt locations
  1225. qt_incdirs=""
  1226. for dir in $kde_qt_dirs; do
  1227. qt_incdirs="$qt_incdirs $dir/include $dir"
  1228. done
  1229. 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 $x_includes"
  1230. if test ! "$ac_tqt_includes" = "NO"; then
  1231. qt_incdirs="$ac_tqt_includes $qt_incdirs"
  1232. fi
  1233. if test "$kde_qtver" != "1"; then
  1234. kde_qt_header=qstyle.h
  1235. else
  1236. kde_qt_header=qglobal.h
  1237. fi
  1238. AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
  1239. ac_tqt_includes="$qt_incdir"
  1240. qt_libdirs=""
  1241. for dir in $kde_qt_dirs; do
  1242. qt_libdirs="$qt_libdirs $dir/lib${tdelibsuff} $dir"
  1243. done
  1244. qt_libdirs="$TQTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
  1245. if test ! "$ac_qt_libraries" = "NO"; then
  1246. qt_libdir=$ac_qt_libraries
  1247. else
  1248. qt_libdirs="$ac_qt_libraries $qt_libdirs"
  1249. # if the Qt was given, the chance is too big that libtqt.* doesn't exist
  1250. qt_libdir=NONE
  1251. for dir in $qt_libdirs; do
  1252. try="ls -1 $dir/${LIBTQT_GLOB}"
  1253. if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  1254. done
  1255. fi
  1256. ac_qt_libraries="$qt_libdir"
  1257. AC_LANG_SAVE
  1258. AC_LANG_CPLUSPLUS
  1259. ac_cxxflags_safe="$CXXFLAGS"
  1260. ac_ldflags_safe="$LDFLAGS"
  1261. ac_libs_safe="$LIBS"
  1262. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  1263. LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  1264. LIBS="$LIBS $LIBTQT $KDE_MT_LIBS"
  1265. KDE_PRINT_QT_PROGRAM
  1266. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  1267. rm -f conftest*
  1268. else
  1269. echo "configure: failed program was:" >&AC_FD_CC
  1270. cat conftest.$ac_ext >&AC_FD_CC
  1271. ac_qt_libraries="NO"
  1272. fi
  1273. rm -f conftest*
  1274. CXXFLAGS="$ac_cxxflags_safe"
  1275. LDFLAGS="$ac_ldflags_safe"
  1276. LIBS="$ac_libs_safe"
  1277. AC_LANG_RESTORE
  1278. if test "$ac_tqt_includes" = NO || test "$ac_qt_libraries" = NO; then
  1279. ac_cv_have_qt="have_qt=no"
  1280. ac_qt_notfound=""
  1281. missing_qt_mt=""
  1282. if test "$ac_tqt_includes" = NO; then
  1283. if test "$ac_qt_libraries" = NO; then
  1284. ac_qt_notfound="(headers and libraries)";
  1285. else
  1286. ac_qt_notfound="(headers)";
  1287. fi
  1288. else
  1289. if test "x$kde_use_qt_mt" = "xyes"; then
  1290. missing_qt_mt="
  1291. Make sure that you have compiled Qt with thread support!"
  1292. ac_qt_notfound="(library $tqtlib-mt)";
  1293. else
  1294. ac_qt_notfound="(library $tqtlib)";
  1295. fi
  1296. fi
  1297. AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
  1298. For more details about this problem, look at the end of config.log.$missing_qt_mt])
  1299. else
  1300. have_qt="yes"
  1301. fi
  1302. ])
  1303. eval "$ac_cv_have_qt"
  1304. if test "$have_qt" != yes; then
  1305. AC_MSG_RESULT([$have_qt]);
  1306. else
  1307. ac_cv_have_qt="have_qt=yes \
  1308. ac_tqt_includes=$ac_tqt_includes ac_qt_libraries=$ac_qt_libraries"
  1309. AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_tqt_includes $USING_QT_MT])
  1310. qt_libraries="$ac_qt_libraries"
  1311. tqt_includes="$ac_tqt_includes"
  1312. fi
  1313. if test ! "$kde_qt_libs_given" = "yes"; then
  1314. KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
  1315. fi
  1316. AC_SUBST(qt_libraries)
  1317. AC_SUBST(tqt_includes)
  1318. if test "$tqt_includes" = "$x_includes" || test -z "$tqt_includes"; then
  1319. TQT_INCLUDES=""
  1320. else
  1321. TQT_INCLUDES="-I$tqt_includes"
  1322. all_includes="$TQT_INCLUDES $all_includes"
  1323. fi
  1324. if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
  1325. QT_LDFLAGS=""
  1326. else
  1327. QT_LDFLAGS="-L$qt_libraries"
  1328. all_libraries="$all_libraries $QT_LDFLAGS"
  1329. fi
  1330. test -z "$KDE_MT_LDFLAGS" || all_libraries="$all_libraries $KDE_MT_LDFLAGS"
  1331. AC_SUBST(TQT_INCLUDES)
  1332. AC_SUBST(QT_LDFLAGS)
  1333. AC_PATH_TQT_MOC_UIC
  1334. KDE_CHECK_QT_JPEG
  1335. if test "x$kde_use_qt_emb" != "xyes"; then
  1336. LIB_TQT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
  1337. else
  1338. LIB_TQT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
  1339. fi
  1340. test -z "$KDE_MT_LIBS" || LIB_TQT="$LIB_TQT $KDE_MT_LIBS"
  1341. AC_SUBST(LIB_TQT)
  1342. AC_SUBST(LIB_QPE)
  1343. AC_SUBST(kde_qtver)
  1344. ])
  1345. AC_DEFUN(AC_PATH_TQT,
  1346. [
  1347. AC_PATH_TQT_1_3
  1348. ])
  1349. AC_DEFUN(KDE_CHECK_UIC_PLUGINS,
  1350. [
  1351. AC_REQUIRE([AC_PATH_TQT_MOC_UIC])
  1352. if test x$ac_uic_supports_libpath = xyes; then
  1353. AC_MSG_CHECKING([if UIC has KDE plugins available])
  1354. AC_CACHE_VAL(kde_cv_uic_plugins,
  1355. [
  1356. cat > actest.ui << EOF
  1357. <!DOCTYPE UI><UI version="3.0" stdsetdef="1">
  1358. <class>NewConnectionDialog</class>
  1359. <widget class="QDialog">
  1360. <widget class="KLineEdit">
  1361. <property name="name">
  1362. <cstring>testInput</cstring>
  1363. </property>
  1364. </widget>
  1365. </widget>
  1366. </UI>
  1367. EOF
  1368. kde_cv_uic_plugins=no
  1369. kde_line="$UIC_PATH -L $kde_widgetdir"
  1370. if test x$ac_uic_supports_nounload = xyes; then
  1371. kde_line="$kde_line -nounload"
  1372. fi
  1373. kde_line="$kde_line -impl actest.h actest.ui > actest.cpp"
  1374. if AC_TRY_EVAL(kde_line); then
  1375. if test -f actest.cpp && grep klineedit actest.cpp > /dev/null; then
  1376. kde_cv_uic_plugins=yes
  1377. fi
  1378. fi
  1379. rm -f actest.ui actest.cpp
  1380. ])
  1381. if test "$kde_cv_uic_plugins" = yes; then
  1382. AC_MSG_RESULT([yes])
  1383. else
  1384. AC_MSG_ERROR([not found - you need to install tdelibs first.])
  1385. fi
  1386. fi
  1387. ])
  1388. AC_DEFUN(KDE_CHECK_FINAL,
  1389. [
  1390. AC_ARG_ENABLE(final, [ --enable-final build size optimized apps (experimental - needs lots of memory)],
  1391. kde_use_final=$enableval, kde_use_final=no)
  1392. KDE_COMPILER_REPO
  1393. if test "x$kde_use_final" = "xyes"; then
  1394. KDE_USE_FINAL_TRUE=""
  1395. KDE_USE_FINAL_FALSE="#"
  1396. else
  1397. KDE_USE_FINAL_TRUE="#"
  1398. KDE_USE_FINAL_FALSE=""
  1399. fi
  1400. AC_SUBST(KDE_USE_FINAL_TRUE)
  1401. AC_SUBST(KDE_USE_FINAL_FALSE)
  1402. AC_ARG_ENABLE(closure, [ --disable-closure don't delay template instantiation],
  1403. kde_use_closure=$enableval, kde_use_closure=yes)
  1404. if test "x$kde_use_closure" = "xyes"; then
  1405. KDE_USE_CLOSURE_TRUE=""
  1406. KDE_USE_CLOSURE_FALSE="#"
  1407. # CXXFLAGS="$CXXFLAGS $REPO"
  1408. else
  1409. KDE_USE_CLOSURE_TRUE="#"
  1410. KDE_USE_CLOSURE_FALSE=""
  1411. fi
  1412. AC_SUBST(KDE_USE_CLOSURE_TRUE)
  1413. AC_SUBST(KDE_USE_CLOSURE_FALSE)
  1414. ])
  1415. dnl ------------------------------------------------------------------------
  1416. dnl Now, the same with KDE
  1417. dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
  1418. dnl and $(kde_includes) will be the kdehdrlocation (if needed)
  1419. dnl ------------------------------------------------------------------------
  1420. dnl
  1421. AC_DEFUN(AC_BASE_PATH_KDE,
  1422. [
  1423. AC_PREREQ([2.13])
  1424. AC_REQUIRE([AC_PATH_TQT])dnl
  1425. AC_REQUIRE([KDE_CHECK_LIB64])
  1426. AC_CHECK_RPATH
  1427. AC_MSG_CHECKING([for KDE])
  1428. if test "${prefix}" != NONE; then
  1429. kde_includes=${prefix}/include
  1430. ac_kde_includes=$prefix/include
  1431. if test "${exec_prefix}" != NONE; then
  1432. kde_libraries=${libdir}
  1433. ac_kde_libraries=$libdir
  1434. if test "$ac_kde_libraries" = '${exec_prefix}/lib'${tdelibsuff}; then
  1435. ac_kde_libraries=$exec_prefix/lib${tdelibsuff}
  1436. fi
  1437. else
  1438. kde_libraries=${prefix}/lib${tdelibsuff}
  1439. ac_kde_libraries=$prefix/lib${tdelibsuff}
  1440. fi
  1441. else
  1442. ac_kde_includes=
  1443. ac_kde_libraries=
  1444. kde_libraries=""
  1445. kde_includes=""
  1446. fi
  1447. AC_CACHE_VAL(ac_cv_have_kde,
  1448. [#try to guess kde locations
  1449. if test "$kde_qtver" = 1; then
  1450. kde_check_header="ksock.h"
  1451. kde_check_lib="libtdecore.la"
  1452. else
  1453. kde_check_header="ksharedptr.h"
  1454. kde_check_lib="libtdeio.la"
  1455. fi
  1456. if test -z "$1"; then
  1457. kde_incdirs="/opt/trinity/include/tde /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/tde /usr/include /opt/trinity/include /opt/kde/include $x_includes $tqt_includes"
  1458. test -n "$TDEDIR" && kde_incdirs="$TDEDIR/include $TDEDIR/include/tde $TDEDIR $kde_incdirs"
  1459. kde_incdirs="$ac_kde_includes $kde_incdirs"
  1460. AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
  1461. ac_kde_includes="$kde_incdir"
  1462. if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
  1463. AC_MSG_ERROR([
  1464. in the prefix, you've chosen, are no KDE headers installed. This will fail.
  1465. So, check this please and use another prefix!])
  1466. fi
  1467. kde_libdirs="$kde_libs_prefix/lib${tdelibsuff} /usr/lib/kde/lib${tdelibsuff} /usr/local/kde/lib${tdelibsuff} /usr/kde/lib${tdelibsuff} /usr/lib${tdelibsuff}/kde /usr/lib${tdelibsuff}/trinity /usr/lib${tdelibsuff} /usr/X11R6/lib${tdelibsuff} /usr/local/lib${tdelibsuff} /opt/trinity/lib${tdelibsuff} /opt/kde/lib${tdelibsuff} /usr/X11R6/kde/lib${tdelibsuff}"
  1468. test -n "$TDEDIR" && kde_libdirs="$TDEDIR/lib${tdelibsuff} $TDEDIR $kde_libdirs"
  1469. kde_libdirs="$ac_kde_libraries $libdir $kde_libdirs"
  1470. AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
  1471. ac_kde_libraries="$kde_libdir"
  1472. kde_widgetdir=NO
  1473. dnl this might be somewhere else
  1474. AC_FIND_FILE("trinity/plugins/designer/tdewidgets.la", $kde_libdirs, kde_widgetdir)
  1475. if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
  1476. AC_MSG_ERROR([
  1477. in the prefix, you've chosen, are no KDE libraries installed. This will fail.
  1478. So, check this please and use another prefix!])
  1479. fi
  1480. if test -n "$kde_widgetdir" && test ! -r "$kde_widgetdir/trinity/plugins/designer/tdewidgets.la"; then
  1481. AC_MSG_ERROR([
  1482. I can't find the designer plugins. These are required and should have been installed
  1483. by tdelibs])
  1484. fi
  1485. if test -n "$kde_widgetdir"; then
  1486. kde_widgetdir="$kde_widgetdir/trinity/plugins/designer"
  1487. fi
  1488. if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO || test "$kde_widgetdir" = NO; then
  1489. ac_cv_have_kde="have_kde=no"
  1490. else
  1491. ac_cv_have_kde="have_kde=yes \
  1492. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1493. fi
  1494. else dnl test -z $1
  1495. ac_cv_have_kde="have_kde=no"
  1496. fi
  1497. ])dnl
  1498. eval "$ac_cv_have_kde"
  1499. if test "$have_kde" != "yes"; then
  1500. if test "${prefix}" = NONE; then
  1501. ac_kde_prefix="$ac_default_prefix"
  1502. else
  1503. ac_kde_prefix="$prefix"
  1504. fi
  1505. if test "$exec_prefix" = NONE; then
  1506. ac_kde_exec_prefix="$ac_kde_prefix"
  1507. AC_MSG_RESULT([will be installed in $ac_kde_prefix])
  1508. else
  1509. ac_kde_exec_prefix="$exec_prefix"
  1510. AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
  1511. fi
  1512. kde_libraries="${libdir}"
  1513. kde_includes=${ac_kde_prefix}/include
  1514. else
  1515. ac_cv_have_kde="have_kde=yes \
  1516. ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
  1517. AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
  1518. kde_libraries="$ac_kde_libraries"
  1519. kde_includes="$ac_kde_includes"
  1520. fi
  1521. AC_SUBST(kde_libraries)
  1522. AC_SUBST(kde_includes)
  1523. if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$tqt_includes" || test "$kde_includes" = "/usr/include"; then
  1524. KDE_INCLUDES=""
  1525. else
  1526. KDE_INCLUDES="-I$kde_includes"
  1527. all_includes="$KDE_INCLUDES $all_includes"
  1528. fi
  1529. KDE_LDFLAGS="-L$kde_libraries"
  1530. if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then
  1531. all_libraries="$all_libraries $KDE_LDFLAGS"
  1532. fi
  1533. AC_SUBST(KDE_LDFLAGS)
  1534. AC_SUBST(KDE_INCLUDES)
  1535. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1536. all_libraries="$all_libraries $USER_LDFLAGS"
  1537. all_includes="$all_includes $USER_INCLUDES"
  1538. AC_SUBST(all_includes)
  1539. AC_SUBST(all_libraries)
  1540. if test -z "$1"; then
  1541. KDE_CHECK_UIC_PLUGINS
  1542. fi
  1543. ac_kde_libraries="$kde_libdir"
  1544. AC_SUBST(AUTODIRS)
  1545. ])
  1546. AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
  1547. [
  1548. AC_MSG_CHECKING(for extra includes)
  1549. AC_ARG_WITH(extra-includes, [ --with-extra-includes=DIR
  1550. adds non standard include paths],
  1551. kde_use_extra_includes="$withval",
  1552. kde_use_extra_includes=NONE
  1553. )
  1554. kde_extra_includes=
  1555. if test -n "$kde_use_extra_includes" && \
  1556. test "$kde_use_extra_includes" != "NONE"; then
  1557. ac_save_ifs=$IFS
  1558. IFS=':'
  1559. for dir in $kde_use_extra_includes; do
  1560. kde_extra_includes="$kde_extra_includes $dir"
  1561. USER_INCLUDES="$USER_INCLUDES -I$dir"
  1562. done
  1563. IFS=$ac_save_ifs
  1564. kde_use_extra_includes="added"
  1565. else
  1566. kde_use_extra_includes="no"
  1567. fi
  1568. AC_SUBST(USER_INCLUDES)
  1569. AC_MSG_RESULT($kde_use_extra_includes)
  1570. kde_extra_libs=
  1571. AC_MSG_CHECKING(for extra libs)
  1572. AC_ARG_WITH(extra-libs, [ --with-extra-libs=DIR adds non standard library paths],
  1573. kde_use_extra_libs=$withval,
  1574. kde_use_extra_libs=NONE
  1575. )
  1576. if test -n "$kde_use_extra_libs" && \
  1577. test "$kde_use_extra_libs" != "NONE"; then
  1578. ac_save_ifs=$IFS
  1579. IFS=':'
  1580. for dir in $kde_use_extra_libs; do
  1581. kde_extra_libs="$kde_extra_libs $dir"
  1582. KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
  1583. USER_LDFLAGS="$USER_LDFLAGS -L$dir"
  1584. done
  1585. IFS=$ac_save_ifs
  1586. kde_use_extra_libs="added"
  1587. else
  1588. kde_use_extra_libs="no"
  1589. fi
  1590. AC_SUBST(USER_LDFLAGS)
  1591. AC_MSG_RESULT($kde_use_extra_libs)
  1592. ])
  1593. AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
  1594. [
  1595. AC_MSG_CHECKING([for KDE headers installed])
  1596. AC_LANG_SAVE
  1597. AC_LANG_CPLUSPLUS
  1598. cat > conftest.$ac_ext <<EOF
  1599. #ifdef STDC_HEADERS
  1600. # include <stdlib.h>
  1601. #endif
  1602. #include <stdio.h>
  1603. #include "confdefs.h"
  1604. #include <kapp.h>
  1605. int main() {
  1606. printf("kde_htmldir=\\"%s\\"\n", TDEApplication::kde_htmldir().data());
  1607. printf("kde_appsdir=\\"%s\\"\n", TDEApplication::kde_appsdir().data());
  1608. printf("kde_icondir=\\"%s\\"\n", TDEApplication::kde_icondir().data());
  1609. printf("kde_sounddir=\\"%s\\"\n", TDEApplication::kde_sounddir().data());
  1610. printf("kde_datadir=\\"%s\\"\n", TDEApplication::kde_datadir().data());
  1611. printf("kde_locale=\\"%s\\"\n", TDEApplication::kde_localedir().data());
  1612. printf("kde_cgidir=\\"%s\\"\n", TDEApplication::kde_cgidir().data());
  1613. printf("kde_confdir=\\"%s\\"\n", TDEApplication::kde_configdir().data());
  1614. printf("kde_mimedir=\\"%s\\"\n", TDEApplication::kde_mimedir().data());
  1615. printf("kde_toolbardir=\\"%s\\"\n", TDEApplication::kde_toolbardir().data());
  1616. printf("kde_wallpaperdir=\\"%s\\"\n",
  1617. TDEApplication::kde_wallpaperdir().data());
  1618. printf("kde_bindir=\\"%s\\"\n", TDEApplication::kde_bindir().data());
  1619. printf("kde_partsdir=\\"%s\\"\n", TDEApplication::kde_partsdir().data());
  1620. printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
  1621. printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
  1622. printf("kde_moduledir=\\"/tmp/dummy\\"\n");
  1623. printf("kde_styledir=\\"/tmp/dummy\\"\n");
  1624. printf("kde_widgetdir=\\"/tmp/dummy\\"\n");
  1625. return 0;
  1626. }
  1627. EOF
  1628. ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
  1629. if AC_TRY_EVAL(ac_compile); then
  1630. AC_MSG_RESULT(yes)
  1631. else
  1632. AC_MSG_ERROR([your system is not able to compile a small KDE application!
  1633. Check, if you installed the KDE header files correctly.
  1634. For more details about this problem, look at the end of config.log.])
  1635. fi
  1636. AC_LANG_RESTORE
  1637. ])
  1638. AC_DEFUN(KDE_CHECK_KDEQTADDON,
  1639. [
  1640. AC_MSG_CHECKING(for kde-qt-addon)
  1641. AC_CACHE_VAL(kde_cv_have_kdetqtaddon,
  1642. [
  1643. kde_ldflags_safe="$LDFLAGS"
  1644. kde_libs_safe="$LIBS"
  1645. kde_cxxflags_safe="$CXXFLAGS"
  1646. LIBS="-lkde-qt-addon $LIBTQT $LIBS"
  1647. CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/tde $all_includes"
  1648. LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
  1649. AC_TRY_LINK([
  1650. #include <qdom.h>
  1651. ],
  1652. [
  1653. QDomDocument doc;
  1654. ],
  1655. kde_cv_have_kdetqtaddon=yes,
  1656. kde_cv_have_kdetqtaddon=no
  1657. )
  1658. LDFLAGS=$kde_ldflags_safe
  1659. LIBS=$kde_libs_safe
  1660. CXXFLAGS=$kde_cxxflags_safe
  1661. ])
  1662. AC_MSG_RESULT($kde_cv_have_kdetqtaddon)
  1663. if test "$kde_cv_have_kdetqtaddon" = "no"; then
  1664. AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
  1665. It is a separate package (and CVS module) named kde-qt-addon.])
  1666. fi
  1667. ])
  1668. AC_DEFUN(KDE_CHECK_KIMGIO,
  1669. [
  1670. AC_REQUIRE([AC_BASE_PATH_KDE])
  1671. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  1672. AC_REQUIRE([AC_FIND_TIFF])
  1673. AC_REQUIRE([AC_FIND_JPEG])
  1674. AC_REQUIRE([AC_FIND_PNG])
  1675. AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
  1676. if test "$1" = "existance"; then
  1677. AC_LANG_SAVE
  1678. AC_LANG_CPLUSPLUS
  1679. kde_save_LIBS="$LIBS"
  1680. LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBTQT -lm"
  1681. AC_CHECK_LIB(kimgio, kimgioRegister, [
  1682. LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
  1683. LIBS="$kde_save_LIBS"
  1684. AC_LANG_RESTORE
  1685. else
  1686. LIBKIMGIO_EXISTS=yes
  1687. fi
  1688. if test "$LIBKIMGIO_EXISTS" = "yes"; then
  1689. LIB_KIMGIO='-lkimgio'
  1690. else
  1691. LIB_KIMGIO=''
  1692. fi
  1693. AC_SUBST(LIB_KIMGIO)
  1694. ])
  1695. AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
  1696. [
  1697. AC_REQUIRE([KDE_MISC_TESTS])
  1698. AC_REQUIRE([KDE_CHECK_LIBDL])
  1699. AC_REQUIRE([K_PATH_X])
  1700. if test $kde_qtver = 3; then
  1701. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1702. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1703. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1704. AC_SUBST(LIB_SMB, "-lsmb")
  1705. AC_SUBST(LIB_KAB, "-lkab")
  1706. AC_SUBST(LIB_TDEABC, "-ltdeabc")
  1707. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1708. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1709. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1710. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1711. # these are for backward compatibility
  1712. AC_SUBST(LIB_TDESYCOCA, "-ltdeio")
  1713. AC_SUBST(LIB_TDEFILE, "-ltdeio")
  1714. elif test $kde_qtver = 2; then
  1715. AC_SUBST(LIB_TDECORE, "-ltdecore")
  1716. AC_SUBST(LIB_TDEUI, "-ltdeui")
  1717. AC_SUBST(LIB_TDEIO, "-ltdeio")
  1718. AC_SUBST(LIB_TDESYCOCA, "-ltdesycoca")
  1719. AC_SUBST(LIB_SMB, "-lsmb")
  1720. AC_SUBST(LIB_TDEFILE, "-ltdefile")
  1721. AC_SUBST(LIB_KAB, "-lkab")
  1722. AC_SUBST(LIB_TDEHTML, "-ltdehtml")
  1723. AC_SUBST(LIB_TDESPELL, "-ltdespell")
  1724. AC_SUBST(LIB_TDEPARTS, "-ltdeparts")
  1725. AC_SUBST(LIB_TDEPRINT, "-ltdeprint")
  1726. else
  1727. AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_TQT)")
  1728. AC_SUBST(LIB_TDEUI, "-ltdeui $(LIB_TDECORE)")
  1729. AC_SUBST(LIB_KFM, "-lkfm $(LIB_TDECORE)")
  1730. AC_SUBST(LIB_TDEFILE, "-ltdefile $(LIB_KFM) $(LIB_TDEUI)")
  1731. AC_SUBST(LIB_KAB, "-lkab $(LIB_KIMGIO) $(LIB_TDECORE)")
  1732. fi
  1733. ])
  1734. AC_DEFUN(AC_PATH_KDE,
  1735. [
  1736. AC_BASE_PATH_KDE
  1737. AC_ARG_ENABLE(path-check, [ --disable-path-check don't try to find out, where to install],
  1738. [
  1739. if test "$enableval" = "no";
  1740. then ac_use_path_checking="default"
  1741. else ac_use_path_checking=""
  1742. fi
  1743. ],
  1744. [
  1745. if test "$kde_qtver" = 1;
  1746. then ac_use_path_checking=""
  1747. else ac_use_path_checking="default"
  1748. fi
  1749. ]
  1750. )
  1751. AC_CREATE_KFSSTND($ac_use_path_checking)
  1752. AC_SUBST_KFSSTND
  1753. KDE_CREATE_LIBS_ALIASES
  1754. ])
  1755. dnl KDE_CHECK_FUNC_EXT(<func>, [headers], [sample-use], [C prototype], [autoheader define], [call if found])
  1756. AC_DEFUN(KDE_CHECK_FUNC_EXT,
  1757. [
  1758. AC_MSG_CHECKING(for $1)
  1759. AC_CACHE_VAL(kde_cv_func_$1,
  1760. [
  1761. AC_LANG_SAVE
  1762. AC_LANG_CPLUSPLUS
  1763. save_CXXFLAGS="$CXXFLAGS"
  1764. kde_safe_LIBS="$LIBS"
  1765. LIBS="$LIBS $X_EXTRA_LIBS"
  1766. if test "$GXX" = "yes"; then
  1767. CXXFLAGS="$CXXFLAGS -pedantic-errors"
  1768. fi
  1769. AC_TRY_COMPILE([
  1770. $2
  1771. ],
  1772. [
  1773. $3
  1774. ],
  1775. kde_cv_func_$1=yes,
  1776. kde_cv_func_$1=no)
  1777. CXXFLAGS="$save_CXXFLAGS"
  1778. LIBS=$kde_safe_LIBS
  1779. AC_LANG_RESTORE
  1780. ])
  1781. AC_MSG_RESULT($kde_cv_func_$1)
  1782. AC_MSG_CHECKING([if $1 needs custom prototype])
  1783. AC_CACHE_VAL(kde_cv_proto_$1,
  1784. [
  1785. if test "x$kde_cv_func_$1" = xyes; then
  1786. kde_cv_proto_$1=no
  1787. else
  1788. case "$1" in
  1789. setenv|unsetenv|usleep|getdomainname|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
  1790. kde_cv_proto_$1="yes - in libtdefakes"
  1791. ;;
  1792. *)
  1793. kde_cv_proto_$1=unknown
  1794. ;;
  1795. esac
  1796. fi
  1797. if test "x$kde_cv_proto_$1" = xunknown; then
  1798. AC_LANG_SAVE
  1799. AC_LANG_CPLUSPLUS
  1800. kde_safe_libs=$LIBS
  1801. LIBS="$LIBS $X_EXTRA_LIBS"
  1802. AC_TRY_LINK([
  1803. $2
  1804. extern "C" $4;
  1805. ],
  1806. [
  1807. $3
  1808. ],
  1809. [ kde_cv_func_$1=yes
  1810. kde_cv_proto_$1=yes ],
  1811. [kde_cv_proto_$1="$1 unavailable"]
  1812. )
  1813. LIBS=$kde_safe_libs
  1814. AC_LANG_RESTORE
  1815. fi
  1816. ])
  1817. AC_MSG_RESULT($kde_cv_proto_$1)
  1818. if test "x$kde_cv_func_$1" = xyes; then
  1819. AC_DEFINE(HAVE_$5, 1, [Define if you have $1])
  1820. $6
  1821. fi
  1822. if test "x$kde_cv_proto_$1" = xno; then
  1823. AC_DEFINE(HAVE_$5_PROTO, 1,
  1824. [Define if you have the $1 prototype])
  1825. fi
  1826. AH_VERBATIM([_HAVE_$5_PROTO],
  1827. [
  1828. #if !defined(HAVE_$5_PROTO)
  1829. #ifdef __cplusplus
  1830. extern "C"
  1831. #endif
  1832. $4;
  1833. #endif
  1834. ])
  1835. ])
  1836. AC_DEFUN(AC_CHECK_SETENV,
  1837. [
  1838. KDE_CHECK_FUNC_EXT(setenv, [
  1839. #include <stdlib.h>
  1840. ],
  1841. [setenv("VAR", "VALUE", 1);],
  1842. [int setenv (const char *, const char *, int)],
  1843. [SETENV])
  1844. ])
  1845. AC_DEFUN(AC_CHECK_UNSETENV,
  1846. [
  1847. KDE_CHECK_FUNC_EXT(unsetenv, [
  1848. #include <stdlib.h>
  1849. ],
  1850. [unsetenv("VAR");],
  1851. [void unsetenv (const char *)],
  1852. [UNSETENV])
  1853. ])
  1854. AC_DEFUN(AC_CHECK_GETDOMAINNAME,
  1855. [
  1856. KDE_CHECK_FUNC_EXT(getdomainname, [
  1857. #include <stdlib.h>
  1858. #include <unistd.h>
  1859. ],
  1860. [
  1861. char buffer[200];
  1862. getdomainname(buffer, 200);
  1863. ],
  1864. [int getdomainname (char *, unsigned int)],
  1865. [GETDOMAINNAME])
  1866. ])
  1867. AC_DEFUN(AC_CHECK_GETHOSTNAME,
  1868. [
  1869. KDE_CHECK_FUNC_EXT(gethostname, [
  1870. #include <stdlib.h>
  1871. #include <unistd.h>
  1872. ],
  1873. [
  1874. char buffer[200];
  1875. gethostname(buffer, 200);
  1876. ],
  1877. [int gethostname (char *, unsigned int)],
  1878. [GETHOSTNAME])
  1879. ])
  1880. AC_DEFUN(AC_CHECK_USLEEP,
  1881. [
  1882. KDE_CHECK_FUNC_EXT(usleep, [
  1883. #include <unistd.h>
  1884. ],
  1885. [
  1886. usleep(200);
  1887. ],
  1888. [int usleep (unsigned int)],
  1889. [USLEEP])
  1890. ])
  1891. AC_DEFUN(AC_CHECK_RANDOM,
  1892. [
  1893. KDE_CHECK_FUNC_EXT(random, [
  1894. #include <stdlib.h>
  1895. ],
  1896. [
  1897. random();
  1898. ],
  1899. [long int random(void)],
  1900. [RANDOM])
  1901. KDE_CHECK_FUNC_EXT(srandom, [
  1902. #include <stdlib.h>
  1903. ],
  1904. [
  1905. srandom(27);
  1906. ],
  1907. [void srandom(unsigned int)],
  1908. [SRANDOM])
  1909. ])
  1910. AC_DEFUN(AC_CHECK_INITGROUPS,
  1911. [
  1912. KDE_CHECK_FUNC_EXT(initgroups, [
  1913. #include <sys/types.h>
  1914. #include <unistd.h>
  1915. #include <grp.h>
  1916. ],
  1917. [
  1918. char buffer[200];
  1919. initgroups(buffer, 27);
  1920. ],
  1921. [int initgroups(const char *, gid_t)],
  1922. [INITGROUPS])
  1923. ])
  1924. AC_DEFUN(AC_CHECK_MKSTEMP,
  1925. [
  1926. KDE_CHECK_FUNC_EXT(mkstemp, [
  1927. #include <stdlib.h>
  1928. ],
  1929. [
  1930. mkstemp("/tmp/aaaXXXXXX");
  1931. ],
  1932. [int mkstemp(char *)],
  1933. [MKSTEMP])
  1934. ])
  1935. AC_DEFUN(AC_CHECK_MKSTEMPS,
  1936. [
  1937. KDE_CHECK_FUNC_EXT(mkstemps, [
  1938. #include <stdlib.h>
  1939. #include <unistd.h>
  1940. ],
  1941. [
  1942. mkstemps("/tmp/aaaXXXXXX", 6);
  1943. ],
  1944. [int mkstemps(char *, int)],
  1945. [MKSTEMPS])
  1946. ])
  1947. AC_DEFUN(AC_CHECK_RES_INIT,
  1948. [
  1949. AC_MSG_CHECKING([if res_init needs -lresolv])
  1950. kde_libs_safe="$LIBS"
  1951. LIBS="$LIBS $X_EXTRA_LIBS -lresolv"
  1952. AC_TRY_LINK(
  1953. [
  1954. #include <sys/types.h>
  1955. #include <netinet/in.h>
  1956. #include <arpa/nameser.h>
  1957. #include <resolv.h>
  1958. ],
  1959. [
  1960. res_init();
  1961. ],
  1962. [
  1963. LIBRESOLV="-lresolv"
  1964. AC_MSG_RESULT(yes)
  1965. X_EXTRA_LIBS="$X_EXTRA_LIBS $LIBRESOLV"
  1966. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  1967. ],
  1968. [ AC_MSG_RESULT(no) ]
  1969. )
  1970. LIBS=$kde_libs_safe
  1971. AC_SUBST(LIBRESOLV)
  1972. AC_MSG_CHECKING([if res_init is available])
  1973. AC_TRY_COMPILE(
  1974. [
  1975. #include <sys/types.h>
  1976. #include <netinet/in.h>
  1977. #include <arpa/nameser.h>
  1978. #include <resolv.h>
  1979. ],
  1980. [
  1981. res_init();
  1982. ],
  1983. [
  1984. AC_MSG_RESULT(yes)
  1985. AC_DEFINE(HAVE_RES_INIT, 1, [Define if you have the res_init function])
  1986. ],
  1987. [ AC_MSG_RESULT(no) ]
  1988. )
  1989. ])
  1990. AC_DEFUN(AC_CHECK_STRLCPY,
  1991. [
  1992. KDE_CHECK_FUNC_EXT(strlcpy, [
  1993. #include <string.h>
  1994. ],
  1995. [ char buf[20];
  1996. strlcpy(buf, "KDE function test", sizeof(buf));
  1997. ],
  1998. [unsigned long strlcpy(char*, const char*, unsigned long)],
  1999. [STRLCPY])
  2000. ])
  2001. AC_DEFUN(AC_CHECK_STRLCAT,
  2002. [
  2003. KDE_CHECK_FUNC_EXT(strlcat, [
  2004. #include <string.h>
  2005. ],
  2006. [ char buf[20];
  2007. buf[0]='\0';
  2008. strlcat(buf, "KDE function test", sizeof(buf));
  2009. ],
  2010. [unsigned long strlcat(char*, const char*, unsigned long)],
  2011. [STRLCAT])
  2012. ])
  2013. AC_DEFUN(AC_FIND_GIF,
  2014. [AC_MSG_CHECKING([for giflib])
  2015. AC_CACHE_VAL(ac_cv_lib_gif,
  2016. [ac_save_LIBS="$LIBS"
  2017. if test "x$kde_use_qt_emb" != "xyes"; then
  2018. LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
  2019. else
  2020. LIBS="$all_libraries -lgif"
  2021. fi
  2022. AC_TRY_LINK(dnl
  2023. [
  2024. #ifdef __cplusplus
  2025. extern "C" {
  2026. #endif
  2027. int GifLastError(void);
  2028. #ifdef __cplusplus
  2029. }
  2030. #endif
  2031. /* We use char because int might match the return type of a gcc2
  2032. builtin and then its argument prototype would still apply. */
  2033. ],
  2034. [return GifLastError();],
  2035. eval "ac_cv_lib_gif=yes",
  2036. eval "ac_cv_lib_gif=no")
  2037. LIBS="$ac_save_LIBS"
  2038. ])dnl
  2039. if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
  2040. AC_MSG_RESULT(yes)
  2041. AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
  2042. else
  2043. AC_MSG_ERROR(You need giflib30. Please install the tdesupport package)
  2044. fi
  2045. ])
  2046. AC_DEFUN(KDE_FIND_JPEG_HELPER,
  2047. [
  2048. AC_MSG_CHECKING([for libjpeg$2])
  2049. AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
  2050. [
  2051. AC_LANG_C
  2052. ac_save_LIBS="$LIBS"
  2053. LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
  2054. ac_save_CFLAGS="$CFLAGS"
  2055. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2056. AC_TRY_LINK(
  2057. [/* Override any gcc2 internal prototype to avoid an error. */
  2058. struct jpeg_decompress_struct;
  2059. typedef struct jpeg_decompress_struct * j_decompress_ptr;
  2060. typedef int size_t;
  2061. #ifdef __cplusplus
  2062. extern "C" {
  2063. #endif
  2064. void jpeg_CreateDecompress(j_decompress_ptr cinfo,
  2065. int version, size_t structsize);
  2066. #ifdef __cplusplus
  2067. }
  2068. #endif
  2069. /* We use char because int might match the return type of a gcc2
  2070. builtin and then its argument prototype would still apply. */
  2071. ],
  2072. [jpeg_CreateDecompress(0L, 0, 0);],
  2073. eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
  2074. eval "ac_cv_lib_jpeg_$1=no")
  2075. LIBS="$ac_save_LIBS"
  2076. CFLAGS="$ac_save_CFLAGS"
  2077. ])
  2078. if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
  2079. LIBJPEG="$ac_cv_lib_jpeg_$1"
  2080. AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
  2081. else
  2082. AC_MSG_RESULT(no)
  2083. $3
  2084. fi
  2085. ])
  2086. AC_DEFUN(AC_FIND_JPEG,
  2087. [
  2088. dnl first look for libraries
  2089. KDE_FIND_JPEG_HELPER(6b, 6b,
  2090. KDE_FIND_JPEG_HELPER(normal, [],
  2091. [
  2092. LIBJPEG=
  2093. ]
  2094. )
  2095. )
  2096. dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
  2097. dnl requires system dependent includes loaded before it)
  2098. jpeg_incdirs="$includedir /usr/include /usr/local/include $kde_extra_includes"
  2099. AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
  2100. test "x$jpeg_incdir" = xNO && jpeg_incdir=
  2101. dnl if headers _and_ libraries are missing, this is no error, and we
  2102. dnl continue with a warning (the user will get no jpeg support in tdehtml)
  2103. dnl if only one is missing, it means a configuration error, but we still
  2104. dnl only warn
  2105. if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
  2106. AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
  2107. else
  2108. if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
  2109. AC_MSG_WARN([
  2110. There is an installation error in jpeg support. You seem to have only one
  2111. of either the headers _or_ the libraries installed. You may need to either
  2112. provide correct --with-extra-... options, or the development package of
  2113. libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
  2114. Disabling JPEG support.
  2115. ])
  2116. else
  2117. AC_MSG_WARN([libjpeg not found. disable JPEG support.])
  2118. fi
  2119. jpeg_incdir=
  2120. LIBJPEG=
  2121. fi
  2122. AC_SUBST(LIBJPEG)
  2123. AH_VERBATIM(_AC_CHECK_JPEG,
  2124. [/*
  2125. * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
  2126. * headers and I'm too lazy to write a configure test as long as only
  2127. * unixware is related
  2128. */
  2129. #ifdef _UNIXWARE
  2130. #define HAVE_BOOLEAN
  2131. #endif
  2132. ])
  2133. ])
  2134. AC_DEFUN(KDE_CHECK_QT_JPEG,
  2135. [
  2136. AC_MSG_CHECKING([if Qt needs $LIBJPEG])
  2137. AC_CACHE_VAL(kde_cv_qt_jpeg,
  2138. [
  2139. AC_LANG_SAVE
  2140. AC_LANG_CPLUSPLUS
  2141. ac_save_LIBS="$LIBS"
  2142. LIBS="$all_libraries $USER_LDFLAGS $LIBTQT"
  2143. LIBS=`echo $LIBS | sed "s/$LIBJPEG//"`
  2144. ac_save_CXXFLAGS="$CXXFLAGS"
  2145. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2146. AC_TRY_LINK(
  2147. [#include <qapplication.h>],
  2148. [
  2149. int argc;
  2150. char** argv;
  2151. QApplication app(argc, argv);],
  2152. eval "kde_cv_qt_jpeg=no",
  2153. eval "kde_cv_qt_jpeg=yes")
  2154. LIBS="$ac_save_LIBS"
  2155. CXXFLAGS="$ac_save_CXXFLAGS"
  2156. AC_LANG_RESTORE
  2157. ])
  2158. if eval "test ! \"`echo $kde_cv_qt_jpeg`\" = no"; then
  2159. AC_MSG_RESULT(yes)
  2160. LIBJPEG_QT='$(LIBJPEG)'
  2161. else
  2162. AC_MSG_RESULT(no)
  2163. LIBJPEG_QT=
  2164. fi
  2165. ])
  2166. AC_DEFUN(AC_FIND_ZLIB,
  2167. [
  2168. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2169. AC_MSG_CHECKING([for libz])
  2170. AC_CACHE_VAL(ac_cv_lib_z,
  2171. [
  2172. AC_LANG_C
  2173. kde_save_LIBS="$LIBS"
  2174. LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
  2175. kde_save_CFLAGS="$CFLAGS"
  2176. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2177. AC_TRY_LINK(dnl
  2178. [
  2179. #include<zlib.h>
  2180. ],
  2181. [return (zlibVersion() == ZLIB_VERSION); ],
  2182. eval "ac_cv_lib_z='-lz'",
  2183. eval "ac_cv_lib_z=no")
  2184. LIBS="$kde_save_LIBS"
  2185. CFLAGS="$kde_save_CFLAGS"
  2186. ])dnl
  2187. if test ! "$ac_cv_lib_z" = no; then
  2188. AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
  2189. LIBZ="$ac_cv_lib_z"
  2190. AC_SUBST(LIBZ)
  2191. AC_MSG_RESULT($ac_cv_lib_z)
  2192. else
  2193. AC_MSG_ERROR(not found. Check your installation and look into config.log)
  2194. LIBZ=""
  2195. AC_SUBST(LIBZ)
  2196. fi
  2197. ])
  2198. AC_DEFUN(KDE_TRY_TIFFLIB,
  2199. [
  2200. AC_MSG_CHECKING([for libtiff $1])
  2201. AC_CACHE_VAL(kde_cv_libtiff_$1,
  2202. [
  2203. AC_LANG_SAVE
  2204. AC_LANG_CPLUSPLUS
  2205. kde_save_LIBS="$LIBS"
  2206. if test "x$kde_use_qt_emb" != "xyes"; then
  2207. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
  2208. else
  2209. LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
  2210. fi
  2211. kde_save_CXXFLAGS="$CXXFLAGS"
  2212. CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
  2213. AC_TRY_LINK(dnl
  2214. [
  2215. #include<tiffio.h>
  2216. ],
  2217. [return (TIFFOpen( "", "r") == 0); ],
  2218. [
  2219. kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
  2220. ], [
  2221. kde_cv_libtiff_$1=no
  2222. ])
  2223. LIBS="$kde_save_LIBS"
  2224. CXXFLAGS="$kde_save_CXXFLAGS"
  2225. AC_LANG_RESTORE
  2226. ])
  2227. if test "$kde_cv_libtiff_$1" = "no"; then
  2228. AC_MSG_RESULT(no)
  2229. LIBTIFF=""
  2230. $3
  2231. else
  2232. LIBTIFF="$kde_cv_libtiff_$1"
  2233. AC_MSG_RESULT(yes)
  2234. AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
  2235. $2
  2236. fi
  2237. ])
  2238. AC_DEFUN(AC_FIND_TIFF,
  2239. [
  2240. AC_REQUIRE([K_PATH_X])
  2241. AC_REQUIRE([AC_FIND_ZLIB])
  2242. AC_REQUIRE([AC_FIND_JPEG])
  2243. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2244. KDE_TRY_TIFFLIB(tiff, [],
  2245. KDE_TRY_TIFFLIB(tiff34))
  2246. AC_SUBST(LIBTIFF)
  2247. ])
  2248. AC_DEFUN(AC_FIND_PNG,
  2249. [
  2250. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2251. AC_REQUIRE([AC_FIND_ZLIB])
  2252. AC_MSG_CHECKING([for libpng])
  2253. AC_CACHE_VAL(ac_cv_lib_png,
  2254. [
  2255. kde_save_LIBS="$LIBS"
  2256. if test "x$kde_use_qt_emb" != "xyes"; then
  2257. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
  2258. else
  2259. LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
  2260. fi
  2261. kde_save_CFLAGS="$CFLAGS"
  2262. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  2263. AC_LANG_C
  2264. AC_TRY_LINK(dnl
  2265. [
  2266. #include<png.h>
  2267. ],
  2268. [
  2269. png_structp png_ptr = png_create_read_struct( /* image ptr */
  2270. PNG_LIBPNG_VER_STRING, 0, 0, 0 );
  2271. return( png_ptr != 0 );
  2272. ],
  2273. eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
  2274. eval "ac_cv_lib_png=no"
  2275. )
  2276. LIBS="$kde_save_LIBS"
  2277. CFLAGS="$kde_save_CFLAGS"
  2278. ])dnl
  2279. if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
  2280. AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
  2281. LIBPNG="$ac_cv_lib_png"
  2282. AC_SUBST(LIBPNG)
  2283. AC_MSG_RESULT($ac_cv_lib_png)
  2284. else
  2285. AC_MSG_RESULT(no)
  2286. LIBPNG=""
  2287. AC_SUBST(LIBPNG)
  2288. fi
  2289. ])
  2290. AC_DEFUN(AC_CHECK_BOOL,
  2291. [
  2292. AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
  2293. ])
  2294. AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
  2295. [
  2296. AC_MSG_CHECKING(whether $CXX supports -$1)
  2297. kde_cache=`echo $1 | sed 'y% .=/+-%____p_%'`
  2298. AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
  2299. [
  2300. AC_LANG_SAVE
  2301. AC_LANG_CPLUSPLUS
  2302. save_CXXFLAGS="$CXXFLAGS"
  2303. CXXFLAGS="$CXXFLAGS -$1"
  2304. AC_TRY_LINK([],[ return 0; ], [eval "kde_cv_prog_cxx_$kde_cache=yes"], [])
  2305. CXXFLAGS="$save_CXXFLAGS"
  2306. AC_LANG_RESTORE
  2307. ])
  2308. if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
  2309. AC_MSG_RESULT(yes)
  2310. :
  2311. $2
  2312. else
  2313. AC_MSG_RESULT(no)
  2314. :
  2315. $3
  2316. fi
  2317. ])
  2318. dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
  2319. dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
  2320. dnl it's all white-space separated
  2321. AC_DEFUN(AC_REMOVE_FORBIDDEN,
  2322. [ __val=$$1
  2323. __forbid=" $2 "
  2324. if test -n "$__val"; then
  2325. __new=""
  2326. ac_save_IFS=$IFS
  2327. IFS=" "
  2328. for i in $__val; do
  2329. case "$__forbid" in
  2330. *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
  2331. *) # Careful to not add spaces, where there were none, because otherwise
  2332. # libtool gets confused, if we change e.g. CXX
  2333. if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
  2334. esac
  2335. done
  2336. IFS=$ac_save_IFS
  2337. $1=$__new
  2338. fi
  2339. ])
  2340. dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
  2341. AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
  2342. [dnl
  2343. if test "x$kde_use_qt_emb" != "xyes"; then
  2344. AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
  2345. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
  2346. else
  2347. AC_REMOVE_FORBIDDEN(CXX, [-rpath])
  2348. AC_REMOVE_FORBIDDEN(CXXFLAGS, [-rpath])
  2349. fi
  2350. ])
  2351. AC_DEFUN(AC_CHECK_COMPILERS,
  2352. [
  2353. AC_ARG_ENABLE(debug,[ --enable-debug[=ARG] enables debug symbols (yes|no|full) [default=no]],
  2354. [
  2355. case $enableval in
  2356. yes)
  2357. kde_use_debug_code="yes"
  2358. kde_use_debug_define=no
  2359. ;;
  2360. full)
  2361. kde_use_debug_code="full"
  2362. kde_use_debug_define=no
  2363. ;;
  2364. *)
  2365. kde_use_debug_code="no"
  2366. kde_use_debug_define=yes
  2367. ;;
  2368. esac
  2369. ],
  2370. [kde_use_debug_code="no"
  2371. kde_use_debug_define=no
  2372. ])
  2373. dnl Just for configure --help
  2374. AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
  2375. AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
  2376. [
  2377. if test $enableval = "no"; then
  2378. kde_use_strict_options="no"
  2379. else
  2380. kde_use_strict_options="yes"
  2381. fi
  2382. ], [kde_use_strict_options="no"])
  2383. AC_ARG_ENABLE(warnings,[ --disable-warnings disables compilation with -Wall and similiar],
  2384. [
  2385. if test $enableval = "no"; then
  2386. kde_use_warnings="no"
  2387. else
  2388. kde_use_warnings="yes"
  2389. fi
  2390. ], [kde_use_warnings="yes"])
  2391. dnl enable warnings for debug build
  2392. if test "$kde_use_debug_code" != "no"; then
  2393. kde_use_warnings=yes
  2394. fi
  2395. AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
  2396. [kde_use_profiling=$enableval],
  2397. [kde_use_profiling="no"]
  2398. )
  2399. dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
  2400. CFLAGS=" $CFLAGS"
  2401. AC_PROG_CC
  2402. AC_PROG_CPP
  2403. if test "$GCC" = "yes"; then
  2404. if test "$kde_use_debug_code" != "no"; then
  2405. if test $kde_use_debug_code = "full"; then
  2406. CFLAGS="-g3 $CFLAGS"
  2407. else
  2408. CFLAGS="-g -O2 $CFLAGS"
  2409. fi
  2410. else
  2411. CFLAGS="-O2 $CFLAGS"
  2412. fi
  2413. fi
  2414. if test "$kde_use_debug_define" = "yes"; then
  2415. CFLAGS="-DNDEBUG $CFLAGS"
  2416. fi
  2417. case "$host" in
  2418. *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
  2419. *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
  2420. esac
  2421. if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
  2422. LDFLAGS=""
  2423. fi
  2424. CXXFLAGS=" $CXXFLAGS"
  2425. AC_PROG_CXX
  2426. if test "$GXX" = "yes" || test "$CXX" = "KCC"; then
  2427. if test "$kde_use_debug_code" != "no"; then
  2428. if test "$CXX" = "KCC"; then
  2429. CXXFLAGS="+K0 -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
  2430. else
  2431. if test "$kde_use_debug_code" = "full"; then
  2432. CXXFLAGS="-g3 $CXXFLAGS"
  2433. else
  2434. CXXFLAGS="-g -O2 $CXXFLAGS"
  2435. fi
  2436. fi
  2437. KDE_CHECK_COMPILER_FLAG(fno-builtin,[CXXFLAGS="-fno-builtin $CXXFLAGS"])
  2438. dnl convenience compiler flags
  2439. KDE_CHECK_COMPILER_FLAG(Woverloaded-virtual, [WOVERLOADED_VIRTUAL="-Woverloaded-virtual"], [WOVERLOADED_VRITUAL=""])
  2440. AC_SUBST(WOVERLOADED_VIRTUAL)
  2441. else
  2442. if test "$CXX" = "KCC"; then
  2443. CXXFLAGS="+K3 $CXXFLAGS"
  2444. else
  2445. CXXFLAGS="-O2 $CXXFLAGS"
  2446. fi
  2447. fi
  2448. fi
  2449. if test "$kde_use_debug_define" = "yes"; then
  2450. CXXFLAGS="-DNDEBUG -DNO_DEBUG $CXXFLAGS"
  2451. fi
  2452. if test "$kde_use_profiling" = "yes"; then
  2453. KDE_CHECK_COMPILER_FLAG(pg,
  2454. [
  2455. CFLAGS="-pg $CFLAGS"
  2456. CXXFLAGS="-pg $CXXFLAGS"
  2457. ])
  2458. fi
  2459. if test "$kde_use_warnings" = "yes"; then
  2460. if test "$GCC" = "yes"; then
  2461. case $host in
  2462. *-*-linux-gnu)
  2463. CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE $CFLAGS"
  2464. CXXFLAGS="-ansi -D_XOPEN_SOURCE=500 -D_DEFAULT_SOURCE -Wcast-align -Wconversion $CXXFLAGS"
  2465. ;;
  2466. esac
  2467. CXXFLAGS="-Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings $CXXFLAGS"
  2468. KDE_CHECK_COMPILER_FLAG(Wundef,[CXXFLAGS="-Wundef $CXXFLAGS"])
  2469. KDE_CHECK_COMPILER_FLAG(Wno-long-long,[CXXFLAGS="-Wno-long-long $CXXFLAGS"])
  2470. KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,[CXXFLAGS="-Wnon-virtual-dtor $CXXFLAGS"])
  2471. fi
  2472. fi
  2473. if test "$GCC" = "yes" && test "$kde_use_strict_options" = "yes"; then
  2474. CXXFLAGS="-Wcast-qual -Wshadow -Wcast-align $CXXFLAGS"
  2475. fi
  2476. if test "$GXX" = "yes"; then
  2477. KDE_CHECK_COMPILER_FLAG(fno-exceptions,[CXXFLAGS="$CXXFLAGS -fno-exceptions"])
  2478. KDE_CHECK_COMPILER_FLAG(fno-check-new, [CXXFLAGS="$CXXFLAGS -fno-check-new"])
  2479. KDE_CHECK_COMPILER_FLAG(fexceptions, [USE_EXCEPTIONS="-fexceptions"], USE_EXCEPTIONS= )
  2480. fi
  2481. if test "$CXX" = "KCC"; then
  2482. dnl unfortunately we currently cannot disable exception support in KCC
  2483. dnl because doing so is binary incompatible and Qt by default links with exceptions :-(
  2484. dnl KDE_CHECK_COMPILER_FLAG(-no_exceptions,[CXXFLAGS="$CXXFLAGS --no_exceptions"])
  2485. dnl KDE_CHECK_COMPILER_FLAG(-exceptions, [USE_EXCEPTIONS="--exceptions"], USE_EXCEPTIONS= )
  2486. AC_ARG_ENABLE(pch,[ --enable-pch enables precompiled header support (currently only KCC) [default=no]],
  2487. [
  2488. kde_use_pch=$enableval
  2489. ],[kde_use_pch=no])
  2490. if test "$kde_use_pch" = "yes"; then
  2491. dnl TODO: support --pch-dir!
  2492. KDE_CHECK_COMPILER_FLAG(-pch,[CXXFLAGS="$CXXFLAGS --pch"])
  2493. dnl the below works (but the dir must exist), but it's
  2494. dnl useless for a whole package.
  2495. dnl The are precompiled headers for each source file, so when compiling
  2496. dnl from scratch, it doesn't make a difference, and they take up
  2497. dnl around ~5Mb _per_ sourcefile.
  2498. dnl KDE_CHECK_COMPILER_FLAG(-pch_dir /tmp,
  2499. dnl [CXXFLAGS="$CXXFLAGS --pch_dir `pwd`/pcheaders"])
  2500. fi
  2501. dnl this flag controls inlining. by default KCC inlines in optimisation mode
  2502. dnl all implementations that are defined inside the class {} declaration.
  2503. dnl because of templates-compatibility with broken gcc compilers, this
  2504. dnl can cause excessive inlining. This flag limits it to a sane level
  2505. KDE_CHECK_COMPILER_FLAG(-inline_keyword_space_time=6,[CXXFLAGS="$CXXFLAGS --inline_keyword_space_time=6"])
  2506. KDE_CHECK_COMPILER_FLAG(-inline_auto_space_time=2,[CXXFLAGS="$CXXFLAGS --inline_auto_space_time=2"])
  2507. KDE_CHECK_COMPILER_FLAG(-inline_implicit_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_implicit_space_time=2.0"])
  2508. KDE_CHECK_COMPILER_FLAG(-inline_generated_space_time=2.0,[CXXFLAGS="$CXXFLAGS --inline_generated_space_time=2.0"])
  2509. dnl Some source files are shared between multiple executables
  2510. dnl (or libraries) and some of those need template instantiations.
  2511. dnl In that case KCC needs to compile those sources with
  2512. dnl --one_instantiation_per_object. To make it easy for us we compile
  2513. dnl _all_ objects with that flag (--one_per is a shorthand).
  2514. KDE_CHECK_COMPILER_FLAG(-one_per, [CXXFLAGS="$CXXFLAGS --one_per"])
  2515. fi
  2516. AC_SUBST(USE_EXCEPTIONS)
  2517. dnl obsolete macro - provided to keep things going
  2518. USE_RTTI=
  2519. AC_SUBST(USE_RTTI)
  2520. case "$host" in
  2521. *-*-irix*) test "$GXX" = yes && CXXFLAGS="-D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS $CXXFLAGS" ;;
  2522. *-*-sysv4.2uw*) CXXFLAGS="-D_UNIXWARE $CXXFLAGS";;
  2523. *-*-sysv5uw7*) CXXFLAGS="-D_UNIXWARE7 $CXXFLAGS";;
  2524. *-*-solaris*)
  2525. if test "$GXX" = yes; then
  2526. libstdcpp=`$CXX -print-file-name=libstdc++.so`
  2527. if test ! -f $libstdcpp; then
  2528. 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])
  2529. fi
  2530. fi
  2531. ;;
  2532. esac
  2533. AC_VALIDIFY_CXXFLAGS
  2534. AC_PROG_CXXCPP
  2535. if test "$GCC" = yes; then
  2536. NOOPT_CXXFLAGS=-O0
  2537. NOOPT_CFLAGS=-O0
  2538. fi
  2539. AC_SUBST(NOOPT_CXXFLAGS)
  2540. AC_SUBST(NOOPT_CFLAGS)
  2541. KDE_CHECK_FINAL
  2542. ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
  2543. ])
  2544. AC_DEFUN(KDE_ADD_DEPENDENCIES,
  2545. [
  2546. [A]M_DEPENDENCIES(CC)
  2547. [A]M_DEPENDENCIES(CXX)
  2548. ])
  2549. dnl just a wrapper to clean up configure.in
  2550. AC_DEFUN(KDE_PROG_LIBTOOL,
  2551. [
  2552. AC_REQUIRE([AC_CHECK_COMPILERS])
  2553. AC_REQUIRE([AC_ENABLE_SHARED])
  2554. AC_REQUIRE([AC_ENABLE_STATIC])
  2555. AC_REQUIRE([AC_LIBTOOL_DLOPEN])
  2556. AC_REQUIRE([KDE_CHECK_LIB64])
  2557. AC_LANG_SAVE
  2558. AC_LANG_C
  2559. AC_OBJEXT
  2560. AC_EXEEXT
  2561. AC_LANG_RESTORE
  2562. AM_PROG_LIBTOOL
  2563. AC_LIBTOOL_CXX
  2564. LIBTOOL_SHELL="/bin/sh ./libtool"
  2565. # LIBTOOL="$LIBTOOL --silent"
  2566. KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)"
  2567. AC_SUBST(KDE_PLUGIN)
  2568. AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps using objprelink (obsolete)],
  2569. kde_use_objprelink=$enableval, kde_use_objprelink=no)
  2570. if test "x$kde_use_objprelink" = "xyes"; then
  2571. AC_MSG_WARN([
  2572. ------------------------------------------------------------
  2573. Configuration option --enable-objprelink is no longer useful.
  2574. See http:://objprelink.sourceforge.net for details:
  2575. 1- Recent binutils are fast enough to do without objprelink.
  2576. 2- Newer versions of objprelink do not need this option.
  2577. ------------------------------------------------------------
  2578. ])
  2579. fi
  2580. ])
  2581. AC_DEFUN(KDE_CHECK_LIB64,
  2582. [
  2583. tdelibsuff=none
  2584. AC_ARG_ENABLE(libsuffix,
  2585. AC_HELP_STRING([--enable-libsuffix],
  2586. [/lib directory suffix (64,32,none)]),
  2587. tdelibsuff=$enableval)
  2588. if test "$tdelibsuff" = "none"; then
  2589. if test -d /lib64 ; then
  2590. tdelibsuff=64
  2591. else
  2592. tdelibsuff=
  2593. fi
  2594. fi
  2595. if test -z "$tdelibsuff"; then
  2596. AC_MSG_RESULT([not using lib directory suffix])
  2597. AC_DEFINE(KDELIBSUFF, [""], Suffix for lib directories)
  2598. else
  2599. if test "$libdir" = '${exec_prefix}/lib'; then
  2600. libdir="$libdir${tdelibsuff}"
  2601. AC_SUBST([libdir], ["$libdir"]) dnl ugly hack for lib64 platforms
  2602. fi
  2603. AC_DEFINE_UNQUOTED(KDELIBSUFF, ["\"${tdelibsuff}\""], Suffix for lib directories)
  2604. AC_MSG_RESULT([using lib directory suffix $tdelibsuff])
  2605. fi
  2606. ])
  2607. AC_DEFUN(KDE_CHECK_TYPES,
  2608. [ AC_CHECK_SIZEOF(int, 4)dnl
  2609. AC_CHECK_SIZEOF(long, 4)dnl
  2610. AC_CHECK_SIZEOF(char *, 4)dnl
  2611. AC_CHECK_SIZEOF(char, 1)dnl
  2612. ])dnl
  2613. AC_DEFUN(KDE_DO_IT_ALL,
  2614. [
  2615. AC_CANONICAL_SYSTEM
  2616. AC_ARG_PROGRAM
  2617. AM_INIT_AUTOMAKE($1, $2)
  2618. AM_DISABLE_LIBRARIES
  2619. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  2620. AC_CHECK_COMPILERS
  2621. KDE_PROG_LIBTOOL
  2622. AM_KDE_WITH_NLS
  2623. AC_PATH_KDE
  2624. ])
  2625. AC_DEFUN(AC_CHECK_RPATH,
  2626. [
  2627. AC_MSG_CHECKING(for rpath)
  2628. AC_ARG_ENABLE(rpath,
  2629. [ --disable-rpath do not use the rpath feature of ld],
  2630. USE_RPATH=$enableval, USE_RPATH=yes)
  2631. if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
  2632. KDE_RPATH="-R \$(kde_libraries)"
  2633. if test -n "$qt_libraries"; then
  2634. KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
  2635. fi
  2636. dnl $x_libraries is set to /usr/lib in case
  2637. if test -n "$X_LDFLAGS"; then
  2638. KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
  2639. fi
  2640. if test -n "$KDE_EXTRA_RPATH"; then
  2641. KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
  2642. fi
  2643. fi
  2644. AC_SUBST(KDE_EXTRA_RPATH)
  2645. AC_SUBST(KDE_RPATH)
  2646. AC_MSG_RESULT($USE_RPATH)
  2647. ])
  2648. dnl Check for the type of the third argument of getsockname
  2649. AC_DEFUN(AC_CHECK_SOCKLEN_T, [
  2650. AC_MSG_CHECKING(for socklen_t)
  2651. AC_CACHE_VAL(ac_cv_socklen_t, [
  2652. AC_LANG_SAVE
  2653. AC_LANG_CPLUSPLUS
  2654. AC_TRY_COMPILE([
  2655. #include <sys/types.h>
  2656. #include <sys/socket.h>
  2657. ],[
  2658. socklen_t a=0;
  2659. getsockname(0,(struct sockaddr*)0, &a);
  2660. ],
  2661. ac_cv_socklen_t=socklen_t,
  2662. AC_TRY_COMPILE([
  2663. #include <sys/types.h>
  2664. #include <sys/socket.h>
  2665. ],[
  2666. int a=0;
  2667. getsockname(0,(struct sockaddr*)0, &a);
  2668. ],
  2669. ac_cv_socklen_t=int,
  2670. ac_cv_socklen_t=size_t
  2671. )
  2672. )
  2673. AC_LANG_RESTORE
  2674. ])
  2675. AC_MSG_RESULT($ac_cv_socklen_t)
  2676. if test "$ac_cv_socklen_t" != "socklen_t"; then
  2677. AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
  2678. [Define the real type of socklen_t])
  2679. fi
  2680. AC_DEFINE_UNQUOTED(ksize_t, socklen_t, [Compatibility define])
  2681. ])
  2682. dnl This is a merge of some macros out of the gettext aclocal.m4
  2683. dnl since we don't need anything, I took the things we need
  2684. dnl the copyright for them is:
  2685. dnl >
  2686. dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
  2687. dnl This Makefile.in is free software; the Free Software Foundation
  2688. dnl gives unlimited permission to copy and/or distribute it,
  2689. dnl with or without modifications, as long as this notice is preserved.
  2690. dnl This program is distributed in the hope that it will be useful,
  2691. dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  2692. dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  2693. dnl PARTICULAR PURPOSE.
  2694. dnl >
  2695. dnl for this file it is relicensed under LGPL
  2696. AC_DEFUN(AM_KDE_WITH_NLS,
  2697. [
  2698. dnl If we use NLS figure out what method
  2699. AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
  2700. [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
  2701. AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  2702. if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
  2703. AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
  2704. GMSGFMT=":"
  2705. fi
  2706. MSGFMT=$GMSGFMT
  2707. AC_SUBST(GMSGFMT)
  2708. AC_SUBST(MSGFMT)
  2709. AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
  2710. [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
  2711. dnl Test whether we really found GNU xgettext.
  2712. if test "$XGETTEXT" != ":"; then
  2713. dnl If it is no GNU xgettext we define it as : so that the
  2714. dnl Makefiles still can work.
  2715. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
  2716. : ;
  2717. else
  2718. AC_MSG_RESULT(
  2719. [found xgettext programs is not GNU xgettext; ignore it])
  2720. XGETTEXT=":"
  2721. fi
  2722. fi
  2723. AC_SUBST(XGETTEXT)
  2724. ])
  2725. # Search path for a program which passes the given test.
  2726. # Ulrich Drepper <drepper@cygnus.com>, 1996.
  2727. # serial 1
  2728. # Stephan Kulow: I appended a _KDE against name conflicts
  2729. dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
  2730. dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  2731. AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
  2732. [# Extract the first word of "$2", so it can be a program name with args.
  2733. set dummy $2; ac_word=[$]2
  2734. AC_MSG_CHECKING([for $ac_word])
  2735. AC_CACHE_VAL(ac_cv_path_$1,
  2736. [case "[$]$1" in
  2737. /*)
  2738. ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  2739. ;;
  2740. *)
  2741. IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  2742. for ac_dir in ifelse([$5], , $PATH, [$5]); do
  2743. test -z "$ac_dir" && ac_dir=.
  2744. if test -f $ac_dir/$ac_word; then
  2745. if [$3]; then
  2746. ac_cv_path_$1="$ac_dir/$ac_word"
  2747. break
  2748. fi
  2749. fi
  2750. done
  2751. IFS="$ac_save_ifs"
  2752. dnl If no 4th arg is given, leave the cache variable unset,
  2753. dnl so AC_PATH_PROGS will keep looking.
  2754. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  2755. ])dnl
  2756. ;;
  2757. esac])dnl
  2758. $1="$ac_cv_path_$1"
  2759. if test -n "[$]$1"; then
  2760. AC_MSG_RESULT([$]$1)
  2761. else
  2762. AC_MSG_RESULT(no)
  2763. fi
  2764. AC_SUBST($1)dnl
  2765. ])
  2766. # Check whether LC_MESSAGES is available in <locale.h>.
  2767. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  2768. # serial 1
  2769. AC_DEFUN(AM_LC_MESSAGES,
  2770. [if test $ac_cv_header_locale_h = yes; then
  2771. AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  2772. [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  2773. am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  2774. if test $am_cv_val_LC_MESSAGES = yes; then
  2775. AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
  2776. fi
  2777. fi])
  2778. dnl From Jim Meyering.
  2779. dnl FIXME: migrate into libit.
  2780. AC_DEFUN([AM_FUNC_OBSTACK],
  2781. [AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
  2782. [AC_TRY_LINK([#include "obstack.h"],
  2783. [struct obstack *mem;obstack_free(mem,(char *) 0)],
  2784. am_cv_func_obstack=yes,
  2785. am_cv_func_obstack=no)])
  2786. if test $am_cv_func_obstack = yes; then
  2787. AC_DEFINE(HAVE_OBSTACK)
  2788. else
  2789. LIBOBJS="$LIBOBJS obstack.o"
  2790. fi
  2791. ])
  2792. dnl From Jim Meyering. Use this if you use the GNU error.[ch].
  2793. dnl FIXME: Migrate into libit
  2794. AC_DEFUN([AM_FUNC_ERROR_AT_LINE],
  2795. [AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
  2796. [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
  2797. am_cv_lib_error_at_line=yes,
  2798. am_cv_lib_error_at_line=no)])
  2799. if test $am_cv_lib_error_at_line = no; then
  2800. LIBOBJS="$LIBOBJS error.o"
  2801. fi
  2802. AC_SUBST(LIBOBJS)dnl
  2803. ])
  2804. # Macro to add for using GNU gettext.
  2805. # Ulrich Drepper <drepper@cygnus.com>, 1995.
  2806. # serial 1
  2807. # Stephan Kulow: I put a KDE in it to avoid name conflicts
  2808. AC_DEFUN(AM_KDE_GNU_GETTEXT,
  2809. [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
  2810. AC_REQUIRE([AC_PROG_RANLIB])dnl
  2811. AC_REQUIRE([AC_HEADER_STDC])dnl
  2812. AC_REQUIRE([AC_TYPE_OFF_T])dnl
  2813. AC_REQUIRE([AC_TYPE_SIZE_T])dnl
  2814. AC_REQUIRE([AC_FUNC_ALLOCA])dnl
  2815. AC_REQUIRE([AC_FUNC_MMAP])dnl
  2816. AC_REQUIRE([AM_KDE_WITH_NLS])dnl
  2817. AC_CHECK_HEADERS([limits.h locale.h nl_types.h string.h values.h alloca.h])
  2818. AC_CHECK_FUNCS([getcwd munmap putenv setlocale strchr strcasecmp \
  2819. __argz_count __argz_stringify __argz_next])
  2820. AC_MSG_CHECKING(for stpcpy)
  2821. AC_CACHE_VAL(kde_cv_func_stpcpy,
  2822. [
  2823. kde_safe_cxxflags=$CXXFLAGS
  2824. CXXFLAGS="-Wmissing-prototypes -Werror"
  2825. AC_LANG_SAVE
  2826. AC_LANG_CPLUSPLUS
  2827. AC_TRY_COMPILE([
  2828. #include <string.h>
  2829. ],
  2830. [
  2831. char buffer[200];
  2832. stpcpy(buffer, buffer);
  2833. ],
  2834. kde_cv_func_stpcpy=yes,
  2835. kde_cv_func_stpcpy=no)
  2836. AC_LANG_RESTORE
  2837. CXXFLAGS=$kde_safe_cxxflags
  2838. ])
  2839. AC_MSG_RESULT($kde_cv_func_stpcpy)
  2840. if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
  2841. AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
  2842. fi
  2843. AM_LC_MESSAGES
  2844. if test "x$CATOBJEXT" != "x"; then
  2845. if test "x$ALL_LINGUAS" = "x"; then
  2846. LINGUAS=
  2847. else
  2848. AC_MSG_CHECKING(for catalogs to be installed)
  2849. NEW_LINGUAS=
  2850. for lang in ${LINGUAS=$ALL_LINGUAS}; do
  2851. case "$ALL_LINGUAS" in
  2852. *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
  2853. esac
  2854. done
  2855. LINGUAS=$NEW_LINGUAS
  2856. AC_MSG_RESULT($LINGUAS)
  2857. fi
  2858. dnl Construct list of names of catalog files to be constructed.
  2859. if test -n "$LINGUAS"; then
  2860. for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  2861. fi
  2862. fi
  2863. ])
  2864. AC_DEFUN(AC_HAVE_XPM,
  2865. [AC_REQUIRE_CPP()dnl
  2866. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2867. test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
  2868. test -z "$XPM_INCLUDE" && XPM_INCLUDE=
  2869. AC_ARG_WITH(xpm, [ --without-xpm disable color pixmap XPM tests],
  2870. xpm_test=$withval, xpm_test="yes")
  2871. if test "x$xpm_test" = xno; then
  2872. ac_cv_have_xpm=no
  2873. else
  2874. AC_MSG_CHECKING(for XPM)
  2875. AC_CACHE_VAL(ac_cv_have_xpm,
  2876. [
  2877. AC_LANG_C
  2878. ac_save_ldflags="$LDFLAGS"
  2879. ac_save_cflags="$CFLAGS"
  2880. if test "x$kde_use_qt_emb" != "xyes"; then
  2881. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
  2882. else
  2883. LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
  2884. fi
  2885. CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
  2886. test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
  2887. AC_TRY_LINK([#include <X11/xpm.h>],[],
  2888. ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
  2889. LDFLAGS="$ac_save_ldflags"
  2890. CFLAGS="$ac_save_cflags"
  2891. ])dnl
  2892. if test "$ac_cv_have_xpm" = no; then
  2893. AC_MSG_RESULT(no)
  2894. XPM_LDFLAGS=""
  2895. XPMINC=""
  2896. $2
  2897. else
  2898. AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
  2899. if test "$XPM_LDFLAGS" = ""; then
  2900. XPMLIB='-lXpm $(LIB_X11)'
  2901. else
  2902. XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
  2903. fi
  2904. if test "$XPM_INCLUDE" = ""; then
  2905. XPMINC=""
  2906. else
  2907. XPMINC="-I$XPM_INCLUDE"
  2908. fi
  2909. AC_MSG_RESULT(yes)
  2910. $1
  2911. fi
  2912. fi
  2913. AC_SUBST(XPMINC)
  2914. AC_SUBST(XPMLIB)
  2915. ])
  2916. AC_DEFUN(AC_HAVE_DPMS,
  2917. [AC_REQUIRE_CPP()dnl
  2918. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  2919. test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
  2920. test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
  2921. DPMS_LIB=
  2922. AC_ARG_WITH(dpms, [ --without-dpms disable DPMS power saving],
  2923. dpms_test=$withval, dpms_test="yes")
  2924. if test "x$dpms_test" = xno; then
  2925. ac_cv_have_dpms=no
  2926. else
  2927. AC_MSG_CHECKING(for DPMS)
  2928. dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
  2929. dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
  2930. AC_CACHE_VAL(ac_cv_have_dpms,
  2931. [
  2932. if test "x$kde_use_qt_emb" = "xyes"; then
  2933. AC_MSG_RESULT(no)
  2934. ac_cv_have_dpms="no"
  2935. else
  2936. AC_LANG_C
  2937. ac_save_ldflags="$LDFLAGS"
  2938. ac_save_cflags="$CFLAGS"
  2939. ac_save_libs="$LIBS"
  2940. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  2941. CFLAGS="$CFLAGS $X_INCLUDES"
  2942. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  2943. AC_TRY_LINK([
  2944. #include <X11/Xproto.h>
  2945. #include <X11/X.h>
  2946. #include <X11/Xlib.h>
  2947. #include <X11/extensions/dpms.h>
  2948. int foo_test_dpms()
  2949. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  2950. ac_cv_have_dpms="yes", [
  2951. LDFLAGS="$ac_save_ldflags"
  2952. CFLAGS="$ac_save_cflags"
  2953. LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
  2954. LIBS="$LIBS -lXdpms"
  2955. CFLAGS="$CFLAGS $X_INCLUDES"
  2956. test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
  2957. AC_TRY_LINK([
  2958. #include <X11/Xproto.h>
  2959. #include <X11/X.h>
  2960. #include <X11/Xlib.h>
  2961. #include <X11/extensions/dpms.h>
  2962. int foo_test_dpms()
  2963. { return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
  2964. [
  2965. ac_cv_have_dpms="-lXdpms"
  2966. ],ac_cv_have_dpms="no")
  2967. ])
  2968. LDFLAGS="$ac_save_ldflags"
  2969. CFLAGS="$ac_save_cflags"
  2970. LIBS="$ac_save_libs"
  2971. fi
  2972. ])dnl
  2973. if test "$ac_cv_have_dpms" = no; then
  2974. AC_MSG_RESULT(no)
  2975. DPMS_LDFLAGS=""
  2976. DPMSINC=""
  2977. $2
  2978. else
  2979. AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
  2980. if test "$ac_cv_have_dpms" = "-lXdpms"; then
  2981. DPMS_LIB="-lXdpms"
  2982. fi
  2983. if test "$DPMS_LDFLAGS" = ""; then
  2984. DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
  2985. else
  2986. DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
  2987. fi
  2988. if test "$DPMS_INCLUDE" = ""; then
  2989. DPMSINC=""
  2990. else
  2991. DPMSINC="-I$DPMS_INCLUDE"
  2992. fi
  2993. AC_MSG_RESULT(yes)
  2994. $1
  2995. fi
  2996. fi
  2997. AC_SUBST(DPMSINC)
  2998. AC_SUBST(DPMSLIB)
  2999. ])
  3000. AC_DEFUN(AC_HAVE_GL,
  3001. [AC_REQUIRE_CPP()dnl
  3002. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3003. test -z "$GL_LDFLAGS" && GL_LDFLAGS=
  3004. test -z "$GL_INCLUDE" && GL_INCLUDE=
  3005. AC_ARG_WITH(gl, [ --without-gl disable 3D GL modes],
  3006. gl_test=$withval, gl_test="yes")
  3007. if test "x$kde_use_qt_emb" = "xyes"; then
  3008. # GL and Qt Embedded is a no-go for now.
  3009. ac_cv_have_gl=no
  3010. elif test "x$gl_test" = xno; then
  3011. ac_cv_have_gl=no
  3012. else
  3013. AC_MSG_CHECKING(for GL)
  3014. AC_CACHE_VAL(ac_cv_have_gl,
  3015. [
  3016. AC_LANG_SAVE
  3017. AC_LANG_CPLUSPLUS
  3018. ac_save_ldflags="$LDFLAGS"
  3019. ac_save_cxxflags="$CXXFLAGS"
  3020. LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
  3021. test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
  3022. LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
  3023. CXXFLAGS="$CFLAGS $X_INCLUDES"
  3024. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3025. AC_TRY_LINK([#include <GL/gl.h>
  3026. #include <GL/glu.h>
  3027. ], [],
  3028. ac_cv_have_gl="mesa", ac_cv_have_gl="no")
  3029. if test "x$ac_cv_have_gl" = "xno"; then
  3030. LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
  3031. test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
  3032. LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
  3033. CXXFLAGS="$ac_save_cflags $X_INCLUDES"
  3034. test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
  3035. AC_TRY_LINK([#include <GL/gl.h>
  3036. #include <GL/glu.h>
  3037. ], [],
  3038. ac_cv_have_gl="yes", ac_cv_have_gl="no")
  3039. fi
  3040. AC_LANG_RESTORE
  3041. LDFLAGS="$ac_save_ldflags"
  3042. CXXFLAGS="$ac_save_cxxflags"
  3043. ])dnl
  3044. if test "$ac_cv_have_gl" = "no"; then
  3045. AC_MSG_RESULT(no)
  3046. GL_LDFLAGS=""
  3047. GLINC=""
  3048. $2
  3049. else
  3050. AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
  3051. if test "$GL_LDFLAGS" = ""; then
  3052. if test "$ac_cv_have_gl" = "mesa"; then
  3053. GLLIB='-lMesaGLU -lMesaGL $(LIB_X11)'
  3054. else
  3055. GLLIB='-lGLU -lGL $(LIB_X11)'
  3056. fi
  3057. else
  3058. if test "$ac_cv_have_gl" = "mesa"; then
  3059. GLLIB="$GL_LDFLAGS -lMesaGLU -lMesaGL "'$(LIB_X11)'
  3060. else
  3061. GLLIB="$GL_LDFLAGS -lGLU -lGL "'$(LIB_X11)'
  3062. fi
  3063. fi
  3064. if test "$GL_INCLUDE" = ""; then
  3065. GLINC=""
  3066. else
  3067. GLINC="-I$GL_INCLUDE"
  3068. fi
  3069. AC_MSG_RESULT($ac_cv_have_gl)
  3070. $1
  3071. fi
  3072. fi
  3073. AC_SUBST(GLINC)
  3074. AC_SUBST(GLLIB)
  3075. ])
  3076. dnl shadow password and PAM magic - maintained by ossi@kde.org
  3077. AC_DEFUN(KDE_PAM, [
  3078. AC_REQUIRE([KDE_CHECK_LIBDL])
  3079. AC_ARG_WITH(pam,
  3080. [ --with-pam[=ARG] enable support for PAM: ARG=[yes|no|service name]],
  3081. [ if test "x$withval" = "xyes"; then
  3082. use_pam=yes
  3083. pam_service=kde
  3084. elif test "x$withval" = "xno"; then
  3085. use_pam=no
  3086. else
  3087. use_pam=yes
  3088. pam_service=$withval
  3089. fi
  3090. ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
  3091. ], [
  3092. AC_CACHE_VAL(ac_cv_path_pam,
  3093. [ use_pam=no
  3094. AC_CHECK_LIB(pam, pam_start,
  3095. [ AC_CHECK_HEADER(security/pam_appl.h,
  3096. [ use_pam=yes
  3097. pam_service=kde ])
  3098. ], , $LIBDL)
  3099. ac_cv_path_pam="use_pam=$use_pam pam_service=$pam_service"
  3100. ])
  3101. ])
  3102. eval "$ac_cv_path_pam"
  3103. AC_MSG_CHECKING(for PAM)
  3104. if test "x$use_pam" = xno; then
  3105. AC_MSG_RESULT(no)
  3106. PAMLIBS=""
  3107. else
  3108. AC_MSG_RESULT(yes)
  3109. AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules)])
  3110. PAMLIBS="$PAM_MISC_LIB -lpam $LIBDL"
  3111. dnl test whether struct pam_message is const (Linux) or not (Sun)
  3112. AC_MSG_CHECKING(for const pam_message)
  3113. AC_EGREP_HEADER([struct pam_message], security/pam_appl.h,
  3114. [ AC_EGREP_HEADER([const struct pam_message], security/pam_appl.h,
  3115. [AC_MSG_RESULT([const: Linux-type PAM])],
  3116. [AC_MSG_RESULT([nonconst: Sun-type PAM])
  3117. AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
  3118. )],
  3119. [AC_MSG_RESULT([not found - assume const, Linux-type PAM])])
  3120. fi
  3121. AC_SUBST(PAMLIBS)
  3122. ])
  3123. dnl DEF_PAM_SERVICE(arg name, full name, define name)
  3124. AC_DEFUN(DEF_PAM_SERVICE, [
  3125. AC_ARG_WITH($1-pam,
  3126. [ --with-$1-pam=[val] override PAM service from --with-pam for $2],
  3127. [ if test "x$use_pam" = xyes; then
  3128. $3_PAM_SERVICE="$withval"
  3129. else
  3130. AC_MSG_ERROR([Cannot use use --with-$1-pam, as no PAM was detected.
  3131. You may want to enforce it by using --with-pam.])
  3132. fi
  3133. ],
  3134. [ if test "x$use_pam" = xyes; then
  3135. $3_PAM_SERVICE="$pam_service"
  3136. fi
  3137. ])
  3138. if test -n "$$3_PAM_SERVICE"; then
  3139. AC_MSG_RESULT([The PAM service used by $2 will be $$3_PAM_SERVICE])
  3140. AC_DEFINE_UNQUOTED($3_PAM_SERVICE, "$$3_PAM_SERVICE", [The PAM service to be used by $2])
  3141. fi
  3142. AC_SUBST($3_PAM_SERVICE)
  3143. ])
  3144. AC_DEFUN(KDE_SHADOWPASSWD, [
  3145. AC_REQUIRE([KDE_PAM])
  3146. AC_CHECK_LIB(shadow, getspent,
  3147. [ LIBSHADOW="-lshadow"
  3148. ac_use_shadow=yes
  3149. ],
  3150. [ dnl for UnixWare
  3151. AC_CHECK_LIB(gen, getspent,
  3152. [ LIBGEN="-lgen"
  3153. ac_use_shadow=yes
  3154. ],
  3155. [ AC_CHECK_FUNC(getspent,
  3156. [ ac_use_shadow=yes ],
  3157. [ ac_use_shadow=no ])
  3158. ])
  3159. ])
  3160. AC_SUBST(LIBSHADOW)
  3161. AC_SUBST(LIBGEN)
  3162. AC_MSG_CHECKING([for shadow passwords])
  3163. AC_ARG_WITH(shadow,
  3164. [ --with-shadow If you want shadow password support ],
  3165. [ if test "x$withval" != "xno"; then
  3166. use_shadow=yes
  3167. else
  3168. use_shadow=no
  3169. fi
  3170. ], [
  3171. use_shadow="$ac_use_shadow"
  3172. ])
  3173. if test "x$use_shadow" = xyes; then
  3174. AC_MSG_RESULT(yes)
  3175. AC_DEFINE(HAVE_SHADOW, 1, [Define if you use shadow passwords])
  3176. else
  3177. AC_MSG_RESULT(no)
  3178. LIBSHADOW=
  3179. LIBGEN=
  3180. fi
  3181. dnl finally make the relevant binaries setuid root, if we have shadow passwds.
  3182. dnl this still applies, if we could use it indirectly through pam.
  3183. if test "x$use_shadow" = xyes ||
  3184. ( test "x$use_pam" = xyes && test "x$ac_use_shadow" = xyes ); then
  3185. case $host in
  3186. *-*-freebsd* | *-*-netbsd* | *-*-openbsd*)
  3187. SETUIDFLAGS="-m 4755 -o root";;
  3188. *)
  3189. SETUIDFLAGS="-m 4755";;
  3190. esac
  3191. fi
  3192. AC_SUBST(SETUIDFLAGS)
  3193. ])
  3194. AC_DEFUN(KDE_PASSWDLIBS, [
  3195. AC_REQUIRE([KDE_MISC_TESTS]) dnl for LIBCRYPT
  3196. AC_REQUIRE([KDE_PAM])
  3197. AC_REQUIRE([KDE_SHADOWPASSWD])
  3198. if test "x$use_pam" = "xyes"; then
  3199. PASSWDLIBS="$PAMLIBS"
  3200. else
  3201. PASSWDLIBS="$LIBCRYPT $LIBSHADOW $LIBGEN"
  3202. fi
  3203. dnl FreeBSD uses a shadow-like setup, where /etc/passwd holds the users, but
  3204. dnl /etc/master.passwd holds the actual passwords. /etc/master.passwd requires
  3205. dnl root to read, so kcheckpass needs to be root (even when using pam, since pam
  3206. dnl may need to read /etc/master.passwd).
  3207. case $host in
  3208. *-*-freebsd*)
  3209. SETUIDFLAGS="-m 4755 -o root"
  3210. ;;
  3211. *)
  3212. ;;
  3213. esac
  3214. AC_SUBST(PASSWDLIBS)
  3215. ])
  3216. AC_DEFUN(KDE_CHECK_LIBDL,
  3217. [
  3218. AC_CHECK_LIB(dl, dlopen, [
  3219. LIBDL="-ldl"
  3220. ac_cv_have_dlfcn=yes
  3221. ])
  3222. AC_CHECK_LIB(dld, shl_unload, [
  3223. LIBDL="-ldld"
  3224. ac_cv_have_shload=yes
  3225. ])
  3226. AC_SUBST(LIBDL)
  3227. ])
  3228. AC_DEFUN(KDE_CHECK_DLOPEN,
  3229. [
  3230. KDE_CHECK_LIBDL
  3231. AC_CHECK_HEADERS(dlfcn.h dl.h)
  3232. if test "$ac_cv_header_dlfcn_h" = "no"; then
  3233. ac_cv_have_dlfcn=no
  3234. fi
  3235. if test "$ac_cv_header_dl_h" = "no"; then
  3236. ac_cv_have_shload=no
  3237. fi
  3238. dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
  3239. dnl (MM)
  3240. AC_ARG_ENABLE(dlopen,
  3241. [ --disable-dlopen link statically [default=no]] ,
  3242. enable_dlopen=$enableval,
  3243. enable_dlopen=yes)
  3244. # override the user's opinion, if we know it better ;)
  3245. if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
  3246. enable_dlopen=no
  3247. fi
  3248. if test "$ac_cv_have_dlfcn" = "yes"; then
  3249. AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
  3250. fi
  3251. if test "$ac_cv_have_shload" = "yes"; then
  3252. AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
  3253. fi
  3254. if test "$enable_dlopen" = no ; then
  3255. test -n "$1" && eval $1
  3256. else
  3257. test -n "$2" && eval $2
  3258. fi
  3259. ])
  3260. AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
  3261. [
  3262. KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
  3263. KDE_PROG_LIBTOOL
  3264. AC_MSG_CHECKING([dynamic loading])
  3265. eval "`egrep '^build_libtool_libs=' libtool`"
  3266. if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
  3267. dynamic_loading=yes
  3268. AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
  3269. else
  3270. dynamic_loading=no
  3271. fi
  3272. AC_MSG_RESULT($dynamic_loading)
  3273. if test "$dynamic_loading" = "yes"; then
  3274. $1
  3275. else
  3276. $2
  3277. fi
  3278. ])
  3279. AC_DEFUN(KDE_ADD_INCLUDES,
  3280. [
  3281. if test -z "$1"; then
  3282. test_include="Pix.h"
  3283. else
  3284. test_include="$1"
  3285. fi
  3286. AC_MSG_CHECKING([for libg++ ($test_include)])
  3287. AC_CACHE_VAL(kde_cv_libgpp_includes,
  3288. [
  3289. kde_cv_libgpp_includes=no
  3290. for ac_dir in \
  3291. \
  3292. /usr/include/g++ \
  3293. /usr/include \
  3294. /usr/unsupported/include \
  3295. /opt/include \
  3296. $extra_include \
  3297. ; \
  3298. do
  3299. if test -r "$ac_dir/$test_include"; then
  3300. kde_cv_libgpp_includes=$ac_dir
  3301. break
  3302. fi
  3303. done
  3304. ])
  3305. AC_MSG_RESULT($kde_cv_libgpp_includes)
  3306. if test "$kde_cv_libgpp_includes" != "no"; then
  3307. all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
  3308. fi
  3309. ])
  3310. ])
  3311. AC_DEFUN(KDE_CHECK_MICO,
  3312. [
  3313. AC_REQUIRE([KDE_CHECK_LIBDL])
  3314. AC_REQUIRE([KDE_MISC_TESTS])
  3315. AC_MSG_CHECKING(for MICO)
  3316. if test -z "$MICODIR"; then
  3317. kde_micodir=/usr/local
  3318. else
  3319. kde_micodir="$MICODIR"
  3320. fi
  3321. AC_ARG_WITH(micodir,
  3322. [ --with-micodir=micodir where mico is installed ],
  3323. kde_micodir=$withval,
  3324. kde_micodir=$kde_micodir
  3325. )
  3326. AC_CACHE_VAL(kde_cv_mico_incdir,
  3327. [
  3328. mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
  3329. AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
  3330. ])
  3331. kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
  3332. if test ! -r $kde_micodir/include/CORBA.h; then
  3333. AC_MSG_ERROR([No CORBA.h found, specify another micodir])
  3334. fi
  3335. AC_MSG_RESULT($kde_micodir)
  3336. MICO_INCLUDES=-I$kde_micodir/include
  3337. AC_SUBST(MICO_INCLUDES)
  3338. MICO_LDFLAGS=-L$kde_micodir/lib
  3339. AC_SUBST(MICO_LDFLAGS)
  3340. micodir=$kde_micodir
  3341. AC_SUBST(micodir)
  3342. AC_MSG_CHECKING([for MICO version])
  3343. AC_CACHE_VAL(kde_cv_mico_version,
  3344. [
  3345. AC_LANG_C
  3346. cat >conftest.$ac_ext <<EOF
  3347. #include <stdio.h>
  3348. #include <mico/version.h>
  3349. int main() {
  3350. printf("MICO_VERSION=%s\n",MICO_VERSION);
  3351. return (0);
  3352. }
  3353. EOF
  3354. ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
  3355. if AC_TRY_EVAL(ac_compile); then
  3356. if eval `./conftest 2>&5`; then
  3357. kde_cv_mico_version=$MICO_VERSION
  3358. else
  3359. AC_MSG_ERROR([your system is not able to execute a small application to
  3360. find MICO version! Check $kde_micodir/include/mico/version.h])
  3361. fi
  3362. else
  3363. AC_MSG_ERROR([your system is not able to compile a small application to
  3364. find MICO version! Check $kde_micodir/include/mico/version.h])
  3365. fi
  3366. ])
  3367. dnl installed MICO version
  3368. mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
  3369. mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
  3370. mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
  3371. if test "x$1" = "x"; then
  3372. req_version="2.3.0"
  3373. else
  3374. req_version=$1
  3375. fi
  3376. dnl required MICO version
  3377. req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
  3378. req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
  3379. req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
  3380. if test "$mico_v_maj" -lt "$req_v_maj" || \
  3381. ( test "$mico_v_maj" -eq "$req_v_maj" && \
  3382. test "$mico_v_mid" -lt "$req_v_mid" ) || \
  3383. ( test "$mico_v_mid" -eq "$req_v_mid" && \
  3384. test "$mico_v_min" -lt "$req_v_min" )
  3385. then
  3386. AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
  3387. at least is required. You should upgrade MICO.])
  3388. else
  3389. AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
  3390. fi
  3391. LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
  3392. AC_SUBST(LIBMICO)
  3393. if test -z "$IDL"; then
  3394. IDL='$(kde_bindir)/cuteidl'
  3395. fi
  3396. AC_SUBST(IDL)
  3397. IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
  3398. AC_SUBST(IDL_DEPENDENCIES)
  3399. idldir="\$(includedir)/idl"
  3400. AC_SUBST(idldir)
  3401. ])
  3402. AC_DEFUN(KDE_CHECK_MINI_STL,
  3403. [
  3404. AC_REQUIRE([KDE_CHECK_MICO])
  3405. AC_MSG_CHECKING(if we use mico's mini-STL)
  3406. AC_CACHE_VAL(kde_cv_have_mini_stl,
  3407. [
  3408. AC_LANG_SAVE
  3409. AC_LANG_CPLUSPLUS
  3410. kde_save_cxxflags="$CXXFLAGS"
  3411. CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
  3412. AC_TRY_COMPILE(
  3413. [
  3414. #include <mico/config.h>
  3415. ],
  3416. [
  3417. #ifdef HAVE_MINI_STL
  3418. #error "nothing"
  3419. #endif
  3420. ],
  3421. kde_cv_have_mini_stl=no,
  3422. kde_cv_have_mini_stl=yes)
  3423. CXXFLAGS="$kde_save_cxxflags"
  3424. AC_LANG_RESTORE
  3425. ])
  3426. if test "x$kde_cv_have_mini_stl" = "xyes"; then
  3427. AC_MSG_RESULT(yes)
  3428. $1
  3429. else
  3430. AC_MSG_RESULT(no)
  3431. $2
  3432. fi
  3433. ])
  3434. ])
  3435. AC_DEFUN(KDE_CHECK_LIBPTHREAD,
  3436. [
  3437. AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
  3438. AC_SUBST(LIBPTHREAD)
  3439. ])
  3440. AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
  3441. [
  3442. AC_ARG_ENABLE(kernel-threads, [ --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
  3443. kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
  3444. if test "$kde_use_kernthreads" = "yes"; then
  3445. ac_save_CXXFLAGS="$CXXFLAGS"
  3446. ac_save_CFLAGS="$CFLAGS"
  3447. CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
  3448. CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
  3449. AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
  3450. CXXFLAGS="$ac_save_CXXFLAGS"
  3451. CFLAGS="$ac_save_CFLAGS"
  3452. if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
  3453. kde_use_kernthreads=no
  3454. else
  3455. dnl Add proper -I and -l statements
  3456. AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
  3457. if test "x$LIBPTHREAD" = "x"; then
  3458. kde_use_kernthreads=no
  3459. else
  3460. USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
  3461. fi
  3462. fi
  3463. else
  3464. USE_THREADS=""
  3465. if test -z "$LIBPTHREAD"; then
  3466. KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
  3467. fi
  3468. fi
  3469. AH_VERBATIM(__svr_define, [
  3470. #if defined(__SVR4) && !defined(__svr4__)
  3471. #define __svr4__ 1
  3472. #endif
  3473. ])
  3474. case $host_os in
  3475. solaris*)
  3476. KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
  3477. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4"
  3478. ;;
  3479. freebsd*)
  3480. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3481. ;;
  3482. aix*)
  3483. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  3484. LIBPTHREAD="$LIBPTHREAD -lc_r"
  3485. ;;
  3486. linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  3487. if test "$CXX" = "KCC"; then
  3488. CXXFLAGS="$CXXFLAGS --thread_safe"
  3489. NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS --thread_safe"
  3490. fi
  3491. ;;
  3492. *)
  3493. ;;
  3494. esac
  3495. AC_SUBST(USE_THREADS)
  3496. AC_SUBST(LIBPTHREAD)
  3497. ])
  3498. AC_DEFUN(KDE_CHECK_THREADING,
  3499. [
  3500. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3501. AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
  3502. dnl default is yes if libpthread is found and no if no libpthread is available
  3503. if test -z "$LIBPTHREAD"; then
  3504. if test -z "$USE_THREADS"; then
  3505. kde_check_threading_default=no
  3506. else
  3507. kde_check_threading_default=yes
  3508. fi
  3509. else
  3510. kde_check_threading_default=yes
  3511. fi
  3512. AC_ARG_ENABLE(threading, [ --disable-threading disables threading even if libpthread found ],
  3513. kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
  3514. if test "x$kde_use_threading" = "xyes"; then
  3515. AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
  3516. fi
  3517. ])
  3518. AC_DEFUN(KDE_TRY_LINK_PYTHON,
  3519. [
  3520. if test "$kde_python_link_found" = no; then
  3521. if test "$1" = normal; then
  3522. AC_MSG_CHECKING(if a Python application links)
  3523. else
  3524. AC_MSG_CHECKING(if Python depends on $2)
  3525. fi
  3526. AC_CACHE_VAL(kde_cv_try_link_python_$1,
  3527. [
  3528. AC_LANG_SAVE
  3529. AC_LANG_C
  3530. kde_save_cflags="$CFLAGS"
  3531. CFLAGS="$CFLAGS $PYTHONINC"
  3532. kde_save_libs="$LIBS"
  3533. LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
  3534. kde_save_ldflags="$LDFLAGS"
  3535. LDFLAGS="$LDFLAGS $PYTHONLIB"
  3536. AC_TRY_LINK(
  3537. [
  3538. #include <Python.h>
  3539. ],[
  3540. PySys_SetArgv(1, 0);
  3541. ],
  3542. [kde_cv_try_link_python_$1=yes],
  3543. [kde_cv_try_link_python_$1=no]
  3544. )
  3545. CFLAGS="$kde_save_cflags"
  3546. LIBS="$kde_save_libs"
  3547. LDFLAGS="$kde_save_ldflags"
  3548. ])
  3549. if test "$kde_cv_try_link_python_$1" = "yes"; then
  3550. AC_MSG_RESULT(yes)
  3551. kde_python_link_found=yes
  3552. if test ! "$1" = normal; then
  3553. LIBPYTHON="$LIBPYTHON $2"
  3554. fi
  3555. $3
  3556. else
  3557. AC_MSG_RESULT(no)
  3558. $4
  3559. fi
  3560. AC_LANG_RESTORE
  3561. fi
  3562. ])
  3563. AC_DEFUN(KDE_CHECK_PYTHON_DIR,
  3564. [
  3565. AC_MSG_CHECKING([for Python directory])
  3566. AC_CACHE_VAL(kde_cv_pythondir,
  3567. [
  3568. if test -z "$PYTHONDIR"; then
  3569. kde_cv_pythondir=/usr/local
  3570. else
  3571. kde_cv_pythondir="$PYTHONDIR"
  3572. fi
  3573. ])
  3574. AC_ARG_WITH(pythondir,
  3575. [ --with-pythondir=pythondir use python installed in pythondir ],
  3576. [
  3577. ac_python_dir=$withval
  3578. ], ac_python_dir=$kde_cv_pythondir
  3579. )
  3580. AC_MSG_RESULT($ac_python_dir)
  3581. ])
  3582. AC_DEFUN(KDE_CHECK_PYTHON_INTERN,
  3583. [
  3584. AC_REQUIRE([KDE_CHECK_LIBDL])
  3585. AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
  3586. AC_REQUIRE([KDE_CHECK_PYTHON_DIR])
  3587. if test -z "$1"; then
  3588. version="1.5"
  3589. else
  3590. version="$1"
  3591. fi
  3592. AC_MSG_CHECKING([for Python$version])
  3593. python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
  3594. AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
  3595. if test ! -r $python_incdir/Python.h; then
  3596. AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
  3597. python_incdir=$python_incdir/python$version
  3598. if test ! -r $python_incdir/Python.h; then
  3599. python_incdir=no
  3600. fi
  3601. fi
  3602. PYTHONINC=-I$python_incdir
  3603. python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
  3604. AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
  3605. if test ! -r $python_libdir/libpython$version.a; then
  3606. AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
  3607. python_libdir=$python_libdir/python$version/config
  3608. if test ! -r $python_libdir/libpython$version.a; then
  3609. python_libdir=no
  3610. fi
  3611. fi
  3612. PYTHONLIB=-L$python_libdir
  3613. kde_orig_LIBPYTHON=$LIBPYTHON
  3614. if test -z "$LIBPYTHON"; then
  3615. LIBPYTHON=-lpython$version
  3616. fi
  3617. python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
  3618. AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
  3619. python_moddir=$python_moddir/python$version
  3620. if test ! -r $python_moddir/copy.py; then
  3621. python_moddir=no
  3622. fi
  3623. PYTHONMODDIR=$python_moddir
  3624. AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
  3625. if test x$python_incdir = xno || test x$python_libdir = xno || test x$python_moddir = xno; then
  3626. LIBPYTHON=$kde_orig_LIBPYTHON
  3627. test "x$PYTHONLIB" = "x-Lno" && PYTHONLIB=""
  3628. test "x$PYTHONINC" = "x-Ino" && PYTHONINC=""
  3629. $2
  3630. else
  3631. dnl Note: this test is very weak
  3632. kde_python_link_found=no
  3633. KDE_TRY_LINK_PYTHON(normal)
  3634. KDE_TRY_LINK_PYTHON(m, -lm)
  3635. KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
  3636. KDE_TRY_LINK_PYTHON(tcl, -ltcl)
  3637. KDE_TRY_LINK_PYTHON(db2, -ldb2)
  3638. KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm])
  3639. KDE_TRY_LINK_PYTHON(m_and_thread_and_util, [$LIBPTHREAD -lm -lutil])
  3640. KDE_TRY_LINK_PYTHON(m_and_thread_and_db3, [$LIBPTHREAD -lm -ldb-3 -lutil])
  3641. KDE_TRY_LINK_PYTHON(pthread_and_db3, [$LIBPTHREAD -ldb-3])
  3642. KDE_TRY_LINK_PYTHON(m_and_thread_and_db, [$LIBPTHREAD -lm -ldb -ltermcap -lutil])
  3643. KDE_TRY_LINK_PYTHON(pthread_and_dl, [$LIBPTHREAD $LIBDL -lutil -lreadline -lncurses -lm])
  3644. KDE_TRY_LINK_PYTHON(m_and_thread_and_db_special, [$LIBPTHREAD -lm -ldb -lutil], [],
  3645. [AC_MSG_WARN([it seems, Python depends on another library.
  3646. Pleae set LIBPYTHON to '-lpython$version -lotherlib' before calling configure to fix this
  3647. and contact the authors to let them know about this problem])
  3648. ])
  3649. LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
  3650. AC_SUBST(PYTHONINC)
  3651. AC_SUBST(PYTHONLIB)
  3652. AC_SUBST(LIBPYTHON)
  3653. AC_SUBST(PYTHONMODDIR)
  3654. AC_DEFINE(HAVE_PYTHON, 1, [Define if you have the development files for python])
  3655. fi
  3656. ])
  3657. AC_DEFUN(KDE_CHECK_PYTHON,
  3658. [
  3659. KDE_CHECK_PYTHON_INTERN("2.2",
  3660. [KDE_CHECK_PYTHON_INTERN("2.1",
  3661. [KDE_CHECK_PYTHON_INTERN("2.0", [ KDE_CHECK_PYTHON_INTERN($1, $2) ])
  3662. ])])
  3663. ])
  3664. AC_DEFUN(KDE_CHECK_STL_SGI,
  3665. [
  3666. AC_MSG_CHECKING([if STL implementation is SGI like])
  3667. AC_CACHE_VAL(kde_cv_stl_type_sgi,
  3668. [
  3669. AC_TRY_COMPILE([
  3670. #include <string>
  3671. using namespace std;
  3672. ],[
  3673. string astring="Hallo Welt.";
  3674. astring.erase(0, 6); // now astring is "Welt"
  3675. return 0;
  3676. ], kde_cv_stl_type_sgi=yes,
  3677. kde_cv_stl_type_sgi=no)
  3678. ])
  3679. AC_MSG_RESULT($kde_cv_stl_type_sgi)
  3680. if test "$kde_cv_stl_type_sgi" = "yes"; then
  3681. AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
  3682. fi
  3683. ])
  3684. AC_DEFUN(KDE_CHECK_STL_HP,
  3685. [
  3686. AC_MSG_CHECKING([if STL implementation is HP like])
  3687. AC_CACHE_VAL(kde_cv_stl_type_hp,
  3688. [
  3689. AC_TRY_COMPILE([
  3690. #include <string>
  3691. using namespace std;
  3692. ],[
  3693. string astring="Hello World";
  3694. astring.remove(0, 6); // now astring is "World"
  3695. return 0;
  3696. ], kde_cv_stl_type_hp=yes,
  3697. kde_cv_stl_type_hp=no)
  3698. ])
  3699. AC_MSG_RESULT($kde_cv_stl_type_hp)
  3700. if test "$kde_cv_stl_type_hp" = "yes"; then
  3701. AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by HP])
  3702. fi
  3703. ])
  3704. AC_DEFUN(KDE_CHECK_STL,
  3705. [
  3706. AC_LANG_SAVE
  3707. AC_LANG_CPLUSPLUS
  3708. ac_save_CXXFLAGS="$CXXFLAGS"
  3709. CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
  3710. KDE_CHECK_STL_SGI
  3711. if test "$kde_cv_stl_type_sgi" = "no"; then
  3712. KDE_CHECK_STL_HP
  3713. if test "$kde_cv_stl_type_hp" = "no"; then
  3714. AC_MSG_ERROR("no known STL type found - did you forget to install libstdc++[-devel] ?")
  3715. fi
  3716. fi
  3717. CXXFLAGS="$ac_save_CXXFLAGS"
  3718. AC_LANG_RESTORE
  3719. ])
  3720. AC_DEFUN(AC_FIND_QIMGIO,
  3721. [AC_REQUIRE([AC_FIND_JPEG])
  3722. AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
  3723. AC_MSG_CHECKING([for qimgio])
  3724. AC_CACHE_VAL(ac_cv_lib_qimgio,
  3725. [
  3726. AC_LANG_SAVE
  3727. AC_LANG_CPLUSPLUS
  3728. ac_save_LIBS="$LIBS"
  3729. ac_save_CXXFLAGS="$CXXFLAGS"
  3730. LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBTQT"
  3731. CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
  3732. AC_TRY_RUN(dnl
  3733. [
  3734. #include <qimageio.h>
  3735. #include <qstring.h>
  3736. int main() {
  3737. QString t = "hallo";
  3738. t.fill('t');
  3739. qInitImageIO();
  3740. }
  3741. ],
  3742. ac_cv_lib_qimgio=yes,
  3743. ac_cv_lib_qimgio=no,
  3744. ac_cv_lib_qimgio=no)
  3745. LIBS="$ac_save_LIBS"
  3746. CXXFLAGS="$ac_save_CXXFLAGS"
  3747. AC_LANG_RESTORE
  3748. ])dnl
  3749. if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
  3750. LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
  3751. AC_MSG_RESULT(yes)
  3752. AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
  3753. AC_SUBST(LIBQIMGIO)
  3754. else
  3755. AC_MSG_RESULT(not found)
  3756. fi
  3757. ])
  3758. AC_DEFUN(KDE_CHECK_ANSI,
  3759. [
  3760. ])
  3761. AC_DEFUN(KDE_CHECK_INSURE,
  3762. [
  3763. AC_ARG_ENABLE(insure, [ --enable-insure use insure++ for debugging [default=no]],
  3764. [
  3765. if test $enableval = "no"; dnl
  3766. then ac_use_insure="no"
  3767. else ac_use_insure="yes"
  3768. fi
  3769. ], [ac_use_insure="no"])
  3770. AC_MSG_CHECKING(if we will use Insure++ to debug)
  3771. AC_MSG_RESULT($ac_use_insure)
  3772. if test "$ac_use_insure" = "yes"; dnl
  3773. then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
  3774. fi
  3775. ])
  3776. AC_DEFUN(AM_DISABLE_LIBRARIES,
  3777. [
  3778. AC_PROVIDE([AM_ENABLE_STATIC])
  3779. AC_PROVIDE([AM_ENABLE_SHARED])
  3780. enable_static=no
  3781. enable_shared=yes
  3782. ])
  3783. AC_DEFUN(AC_CHECK_UTMP_FILE,
  3784. [
  3785. AC_MSG_CHECKING([for utmp file])
  3786. AC_CACHE_VAL(kde_cv_utmp_file,
  3787. [
  3788. kde_cv_utmp_file=no
  3789. for ac_file in \
  3790. \
  3791. /var/run/utmp \
  3792. /var/adm/utmp \
  3793. /etc/utmp \
  3794. ; \
  3795. do
  3796. if test -r "$ac_file"; then
  3797. kde_cv_utmp_file=$ac_file
  3798. break
  3799. fi
  3800. done
  3801. ])
  3802. if test "$kde_cv_utmp_file" != "no"; then
  3803. AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
  3804. $1
  3805. AC_MSG_RESULT($kde_cv_utmp_file)
  3806. else
  3807. $2
  3808. AC_MSG_RESULT([non found])
  3809. fi
  3810. ])
  3811. AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
  3812. [
  3813. DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
  3814. if test ! -s $srcdir/subdirs; then
  3815. dnl Note: Makefile.common creates subdirs, so this is just a fallback
  3816. TOPSUBDIRS=""
  3817. files=`cd $srcdir && ls -1`
  3818. dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
  3819. for i in $dirs; do
  3820. echo $i >> $srcdir/subdirs
  3821. done
  3822. fi
  3823. if test -s $srcdir/inst-apps; then
  3824. ac_topsubdirs="`cat $srcdir/inst-apps`"
  3825. else
  3826. ac_topsubdirs="`cat $srcdir/subdirs`"
  3827. fi
  3828. for i in $ac_topsubdirs; do
  3829. AC_MSG_CHECKING([if $i should be compiled])
  3830. if test -d $srcdir/$i; then
  3831. install_it="yes"
  3832. for j in $DO_NOT_COMPILE; do
  3833. if test $i = $j; then
  3834. install_it="no"
  3835. fi
  3836. done
  3837. else
  3838. install_it="no"
  3839. fi
  3840. AC_MSG_RESULT($install_it)
  3841. vari=`echo $i | sed -e 's,[[-+.]],_,g'`
  3842. if test $install_it = "yes"; then
  3843. TOPSUBDIRS="$TOPSUBDIRS $i"
  3844. eval "$vari""_SUBDIR_included=yes"
  3845. else
  3846. eval "$vari""_SUBDIR_included=no"
  3847. fi
  3848. done
  3849. AC_SUBST(TOPSUBDIRS)
  3850. ])
  3851. AC_DEFUN(KDE_CHECK_NAMESPACES,
  3852. [
  3853. AC_MSG_CHECKING(whether C++ compiler supports namespaces)
  3854. AC_LANG_SAVE
  3855. AC_LANG_CPLUSPLUS
  3856. AC_TRY_COMPILE([
  3857. ],
  3858. [
  3859. namespace Foo {
  3860. extern int i;
  3861. namespace Bar {
  3862. extern int i;
  3863. }
  3864. }
  3865. int Foo::i = 0;
  3866. int Foo::Bar::i = 1;
  3867. ],[
  3868. AC_MSG_RESULT(yes)
  3869. AC_DEFINE(HAVE_NAMESPACES)
  3870. ], [
  3871. AC_MSG_RESULT(no)
  3872. ])
  3873. AC_LANG_RESTORE
  3874. ])
  3875. AC_DEFUN(KDE_CHECK_NEWLIBS,
  3876. [
  3877. ])
  3878. dnl ------------------------------------------------------------------------
  3879. dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
  3880. dnl ------------------------------------------------------------------------
  3881. dnl
  3882. AC_DEFUN(AC_CHECK_S_ISSOCK,
  3883. [
  3884. AC_MSG_CHECKING(for S_ISSOCK)
  3885. AC_CACHE_VAL(ac_cv_have_s_issock,
  3886. [
  3887. AC_LANG_SAVE
  3888. AC_LANG_C
  3889. AC_TRY_LINK(
  3890. [
  3891. #include <sys/stat.h>
  3892. ],
  3893. [
  3894. struct stat buff;
  3895. int b = S_ISSOCK( buff.st_mode );
  3896. ],
  3897. ac_cv_have_s_issock=yes,
  3898. ac_cv_have_s_issock=no)
  3899. AC_LANG_RESTORE
  3900. ])
  3901. AC_MSG_RESULT($ac_cv_have_s_issock)
  3902. if test "$ac_cv_have_s_issock" = "yes"; then
  3903. AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
  3904. fi
  3905. AH_VERBATIM(_ISSOCK,
  3906. [
  3907. #ifndef HAVE_S_ISSOCK
  3908. #define HAVE_S_ISSOCK
  3909. #define S_ISSOCK(mode) (1==0)
  3910. #endif
  3911. ])
  3912. ])
  3913. dnl ------------------------------------------------------------------------
  3914. dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
  3915. dnl ------------------------------------------------------------------------
  3916. dnl
  3917. AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
  3918. [
  3919. AC_MSG_CHECKING(for MAXPATHLEN)
  3920. AC_CACHE_VAL(ac_cv_maxpathlen,
  3921. [
  3922. AC_LANG_C
  3923. cat > conftest.$ac_ext <<EOF
  3924. #ifdef STDC_HEADERS
  3925. # include <stdlib.h>
  3926. #endif
  3927. #include <stdio.h>
  3928. #include <sys/param.h>
  3929. #ifndef MAXPATHLEN
  3930. #define MAXPATHLEN 1024
  3931. #endif
  3932. KDE_HELLO MAXPATHLEN
  3933. EOF
  3934. ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
  3935. if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
  3936. ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
  3937. else
  3938. ac_cv_maxpathlen=1024
  3939. fi
  3940. rm conftest.*
  3941. ])
  3942. AC_MSG_RESULT($ac_cv_maxpathlen)
  3943. AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
  3944. ])
  3945. dnl -------------------------------------------------------------------------
  3946. dnl See if the compiler supports a template repository bero@redhat.de
  3947. dnl -------------------------------------------------------------------------
  3948. AC_DEFUN(KDE_COMPILER_REPO,
  3949. [
  3950. REPO=""
  3951. NOREPO=""
  3952. KDE_CHECK_COMPILER_FLAG(frepo,
  3953. [
  3954. REPO="-frepo"
  3955. NOREPO="-fno-repo"
  3956. ])
  3957. if test -z "$REPO"; then
  3958. KDE_CHECK_COMPILER_FLAG(instances=explicit,
  3959. [
  3960. REPO="-instances=explicit"
  3961. NOREPO="-instances=extern"
  3962. ])
  3963. fi
  3964. if test -n "$REPO"; then
  3965. AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
  3966. [C++ compiler supports template repository])
  3967. $1
  3968. fi
  3969. AC_SUBST(REPO)
  3970. AC_SUBST(NOREPO)
  3971. ])
  3972. AC_DEFUN(KDE_CHECK_HEADER,
  3973. [
  3974. AC_LANG_SAVE
  3975. kde_safe_cppflags=$CPPFLAGS
  3976. CPPFLAGS="$CPPFLAGS $all_includes"
  3977. AC_LANG_CPLUSPLUS
  3978. AC_CHECK_HEADER($1, $2, $3)
  3979. CPPFLAGS=$kde_safe_cppflags
  3980. AC_LANG_RESTORE
  3981. ])
  3982. AC_DEFUN(KDE_CHECK_HEADERS,
  3983. [
  3984. AH_CHECK_HEADERS([$1])
  3985. AC_LANG_SAVE
  3986. kde_safe_cppflags=$CPPFLAGS
  3987. CPPFLAGS="$CPPFLAGS $all_includes"
  3988. AC_LANG_CPLUSPLUS
  3989. AC_CHECK_HEADERS([$1], [$2], [$3], [$4])
  3990. CPPFLAGS=$kde_safe_cppflags
  3991. AC_LANG_RESTORE
  3992. ])
  3993. AC_DEFUN(KDE_FAST_CONFIGURE,
  3994. [
  3995. dnl makes configure fast (needs perl)
  3996. AC_ARG_ENABLE(fast-perl, [ --disable-fast-perl disable fast Makefile generation (needs perl)],
  3997. with_fast_perl=$enableval, with_fast_perl=yes)
  3998. ])
  3999. AC_DEFUN(KDE_CONF_FILES,
  4000. [
  4001. val=
  4002. if test -f $srcdir/configure.files ; then
  4003. val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
  4004. fi
  4005. CONF_FILES=
  4006. if test -n "$val" ; then
  4007. for i in $val ; do
  4008. CONF_FILES="$CONF_FILES $i"
  4009. done
  4010. fi
  4011. AC_SUBST(CONF_FILES)
  4012. ])dnl
  4013. AC_DEFUN(KDE_SET_PREFIX,
  4014. [
  4015. unset CDPATH
  4016. dnl make $TDEDIR the default for the installation
  4017. AC_PREFIX_DEFAULT(${TDEDIR:-/usr/local/kde})
  4018. if test "x$prefix" = "xNONE"; then
  4019. prefix=$ac_default_prefix
  4020. ac_configure_args="$ac_configure_args --prefix=$prefix"
  4021. fi
  4022. # And delete superflous '/' to make compares easier
  4023. prefix=`echo "$prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4024. exec_prefix=`echo "$exec_prefix" | sed 's,//*,/,g' | sed -e 's,/$,,'`
  4025. KDE_FAST_CONFIGURE
  4026. KDE_CONF_FILES
  4027. ])
  4028. pushdef([AC_PROG_INSTALL],
  4029. [
  4030. dnl our own version, testing for a -p flag
  4031. popdef([AC_PROG_INSTALL])
  4032. dnl as AC_PROG_INSTALL works as it works we first have
  4033. dnl to save if the user didn't specify INSTALL, as the
  4034. dnl autoconf one overwrites INSTALL and we have no chance to find
  4035. dnl out afterwards
  4036. test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
  4037. test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
  4038. test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
  4039. AC_PROG_INSTALL
  4040. if test -z "$kde_save_INSTALL_given" ; then
  4041. # OK, user hasn't given any INSTALL, autoconf found one for us
  4042. # now we test, if it supports the -p flag
  4043. AC_MSG_CHECKING(for -p flag to install)
  4044. rm -f confinst.$$.* > /dev/null 2>&1
  4045. echo "Testtest" > confinst.$$.orig
  4046. ac_res=no
  4047. if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
  4048. if test -f confinst.$$.new ; then
  4049. # OK, -p seems to do no harm to install
  4050. INSTALL="${INSTALL} -p"
  4051. ac_res=yes
  4052. fi
  4053. fi
  4054. rm -f confinst.$$.*
  4055. AC_MSG_RESULT($ac_res)
  4056. fi
  4057. dnl the following tries to resolve some signs and wonders coming up
  4058. dnl with different autoconf/automake versions
  4059. dnl e.g.:
  4060. dnl *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
  4061. dnl and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
  4062. dnl it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
  4063. dnl *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
  4064. dnl INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
  4065. dnl install-@DIR@PROGRAMS targets to explicitly use that flag
  4066. dnl *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
  4067. dnl INSTALL_SCRIPT, which breaks with automake <= 1.4
  4068. dnl *autoconf >2.13 (since 10.Apr 1999) has not that failure
  4069. dnl *sometimes KDE does not use the install-@DIR@PROGRAM targets from
  4070. dnl automake (due to broken Makefile.am or whatever) to install programs,
  4071. dnl and so does not see the -s flag in automake > 1.4
  4072. dnl to clean up that mess we:
  4073. dnl +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
  4074. dnl which cleans KDE's program with automake > 1.4;
  4075. dnl +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
  4076. dnl with automake<=1.4
  4077. dnl note that dues to this sometimes two '-s' flags are used (if KDE
  4078. dnl properly uses install-@DIR@PROGRAMS, but I don't care
  4079. dnl
  4080. dnl And to all this comes, that I even can't write in comments variable
  4081. dnl names used by automake, because it is so stupid to think I wanted to
  4082. dnl _use_ them, therefor I have written A_M_... instead of AM_
  4083. dnl hmm, I wanted to say something ... ahh yes: Arghhh.
  4084. if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
  4085. INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
  4086. fi
  4087. if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
  4088. INSTALL_SCRIPT='${INSTALL}'
  4089. fi
  4090. ])dnl
  4091. AC_DEFUN(KDE_LANG_CPLUSPLUS,
  4092. [AC_LANG_CPLUSPLUS
  4093. ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
  4094. pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
  4095. ])
  4096. pushdef([AC_LANG_CPLUSPLUS],
  4097. [popdef([AC_LANG_CPLUSPLUS])
  4098. KDE_LANG_CPLUSPLUS
  4099. ])
  4100. AC_DEFUN(KDE_CHECK_LONG_LONG,
  4101. [
  4102. AC_MSG_CHECKING(for long long)
  4103. AC_CACHE_VAL(kde_cv_c_long_long,
  4104. [
  4105. AC_LANG_SAVE
  4106. AC_LANG_CPLUSPLUS
  4107. AC_TRY_LINK([], [
  4108. long long foo = 0;
  4109. foo = foo+1;
  4110. ],
  4111. kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
  4112. AC_LANG_RESTORE
  4113. ])
  4114. AC_MSG_RESULT($kde_cv_c_long_long)
  4115. if test "$kde_cv_c_long_long" = yes; then
  4116. AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
  4117. fi
  4118. ])
  4119. AC_DEFUN(KDE_CHECK_LIB,
  4120. [
  4121. kde_save_LDFLAGS="$LDFLAGS"
  4122. dnl AC_CHECK_LIB modifies LIBS, so save it here
  4123. kde_save_LIBS="$LIBS"
  4124. LDFLAGS="$LDFLAGS $all_libraries"
  4125. case $host_os in
  4126. aix*) LDFLAGS="-brtl $LDFLAGS"
  4127. test "$GCC" = yes && LDFLAGS="-Wl,$LDFLAGS"
  4128. ;;
  4129. esac
  4130. AC_CHECK_LIB($1, $2, $3, $4, $5)
  4131. LDFLAGS="$kde_save_LDFLAGS"
  4132. LIBS="$kde_save_LIBS"
  4133. ])
  4134. AC_DEFUN(KDE_JAVA_PREFIX,
  4135. [
  4136. dir=`dirname "$1"`
  4137. base=`basename "$1"`
  4138. list=`ls -1 $dir 2> /dev/null`
  4139. for entry in $list; do
  4140. if test -d $dir/$entry/bin; then
  4141. case $entry in
  4142. $base)
  4143. javadirs="$javadirs $dir/$entry/bin"
  4144. ;;
  4145. esac
  4146. elif test -d $dir/$entry/jre/bin; then
  4147. case $entry in
  4148. $base)
  4149. javadirs="$javadirs $dir/$entry/jre/bin"
  4150. ;;
  4151. esac
  4152. fi
  4153. done
  4154. ])
  4155. dnl KDE_CHEC_JAVA_DIR(onlyjre)
  4156. AC_DEFUN(KDE_CHECK_JAVA_DIR,
  4157. [
  4158. AC_ARG_WITH(java,
  4159. [ --with-java=javadir use java installed in javadir, --without-java disables ],
  4160. [ ac_java_dir=$withval
  4161. ], ac_java_dir=""
  4162. )
  4163. AC_MSG_CHECKING([for Java])
  4164. dnl at this point ac_java_dir is either a dir, 'no' to disable, or '' to say look in $PATH
  4165. if test "x$ac_java_dir" = "xno"; then
  4166. kde_java_bindir=no
  4167. kde_java_includedir=no
  4168. kde_java_libjvmdir=no
  4169. kde_java_libhpidir=no
  4170. else
  4171. if test "x$ac_java_dir" = "x"; then
  4172. dnl No option set -> look in $PATH
  4173. KDE_JAVA_PREFIX(/usr/j2se)
  4174. KDE_JAVA_PREFIX(/usr/j*dk*)
  4175. KDE_JAVA_PREFIX(/usr/lib/j*dk*)
  4176. KDE_JAVA_PREFIX(/opt/j*sdk*)
  4177. KDE_JAVA_PREFIX(/usr/lib/java*)
  4178. KDE_JAVA_PREFIX(/usr/java*)
  4179. KDE_JAVA_PREFIX(/usr/lib/SunJava2*)
  4180. KDE_JAVA_PREFIX(/usr/lib/SunJava*)
  4181. KDE_JAVA_PREFIX(/usr/lib/IBMJava2*)
  4182. KDE_JAVA_PREFIX(/usr/lib/IBMJava*)
  4183. KDE_JAVA_PREFIX(/opt/java*)
  4184. kde_cv_path="NONE"
  4185. kde_save_IFS=$IFS
  4186. IFS=':'
  4187. for dir in $PATH; do
  4188. javadirs="$javadirs $dir"
  4189. done
  4190. IFS=$kde_save_IFS
  4191. jredirs=
  4192. for dir in $javadirs; do
  4193. if test ! -d $dir; then break; fi
  4194. if test -x "$dir/java"; then
  4195. libjvmdir=`find $dir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4196. if test ! -f $libjvmdir/libjvm.so; then continue; fi
  4197. jredirs="$jredirs $dir"
  4198. fi
  4199. done
  4200. JAVAC=
  4201. JAVA=
  4202. kde_java_bindir=no
  4203. for dir in $jredirs; do
  4204. JAVA="$dir/java"
  4205. kde_java_bindir=$dir
  4206. if test -x "$dir/javac"; then
  4207. JAVAC="$dir/javac"
  4208. break
  4209. fi
  4210. done
  4211. if test -n "$JAVAC"; then
  4212. dnl this substitution might not work - well, we test for jni.h below
  4213. kde_java_includedir=`echo $JAVAC | sed -e 's,bin/javac$,include/,'`
  4214. else
  4215. kde_java_includedir=no
  4216. fi
  4217. else
  4218. dnl config option set
  4219. kde_java_bindir=$ac_java_dir/bin
  4220. if test -x $ac_java_dir/bin/java && test ! -x $ac_java_dir/bin/javac; then
  4221. kde_java_includedir=no
  4222. else
  4223. kde_java_includedir=$ac_java_dir/include
  4224. fi
  4225. fi
  4226. fi
  4227. dnl At this point kde_java_bindir and kde_java_includedir are either set or "no"
  4228. if test "x$kde_java_bindir" != "xno"; then
  4229. dnl Look for libjvm.so
  4230. kde_java_libjvmdir=`find $kde_java_bindir/.. -name libjvm.so | sed 's,libjvm.so,,'|head -n 1`
  4231. dnl Look for libhpi.so and avoid green threads
  4232. kde_java_libhpidir=`find $kde_java_bindir/.. -name libhpi.so | grep -v green | sed 's,libhpi.so,,' | head -n 1`
  4233. dnl Now check everything's fine under there
  4234. dnl the include dir is our flag for having the JDK
  4235. if test -d "$kde_java_includedir"; then
  4236. if test ! -x "$kde_java_bindir/javac"; then
  4237. AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
  4238. fi
  4239. if test ! -x "$kde_java_bindir/javah"; then
  4240. AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4241. fi
  4242. if test ! -x "$kde_java_bindir/jar"; then
  4243. AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4244. fi
  4245. if test ! -r "$kde_java_includedir/jni.h"; then
  4246. AC_MSG_ERROR([jni.h not found under $kde_java_includedir. Use --with-java or --without-java.])
  4247. fi
  4248. jni_includes="-I$kde_java_includedir"
  4249. dnl Strange thing, jni.h requires jni_md.h which is under genunix here..
  4250. dnl and under linux here..
  4251. test -d "$kde_java_includedir/linux" && jni_includes="$jni_includes -I$kde_java_includedir/linux"
  4252. test -d "$kde_java_includedir/solaris" && jni_includes="$jni_includes -I$kde_java_includedir/solaris"
  4253. test -d "$kde_java_includedir/genunix" && jni_includes="$jni_includes -I$kde_java_includedir/genunix"
  4254. else
  4255. JAVAC=
  4256. jni_includes=
  4257. fi
  4258. if test ! -r "$kde_java_libjvmdir/libjvm.so"; then
  4259. AC_MSG_ERROR([libjvm.so not found under $kde_java_libjvmdir. Use --without-java.])
  4260. fi
  4261. if test ! -x "$kde_java_bindir/java"; then
  4262. AC_MSG_ERROR([java not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
  4263. fi
  4264. if test ! -r "$kde_java_libhpidir/libhpi.so"; then
  4265. AC_MSG_ERROR([libhpi.so not found under $kde_java_libhpidir. Use --without-java.])
  4266. fi
  4267. if test -n "$jni_includes"; then
  4268. dnl Check for JNI version
  4269. AC_LANG_SAVE
  4270. AC_LANG_CPLUSPLUS
  4271. ac_cxxflags_safe="$CXXFLAGS"
  4272. CXXFLAGS="$CXXFLAGS $all_includes $jni_includes"
  4273. AC_TRY_COMPILE([
  4274. #include <jni.h>
  4275. ],
  4276. [
  4277. #ifndef JNI_VERSION_1_2
  4278. Syntax Error
  4279. #endif
  4280. ],[ kde_jni_works=yes ],
  4281. [ kde_jni_works=no ])
  4282. if test $kde_jni_works = no; then
  4283. AC_MSG_ERROR([Incorrect version of $kde_java_includedir/jni.h.
  4284. You need to have Java Development Kit (JDK) version 1.2.
  4285. Use --with-java to specify another location.
  4286. Use --without-java to configure without java support.
  4287. Or download a newer JDK and try again.
  4288. See e.g. http://java.sun.com/products/jdk/1.2 ])
  4289. fi
  4290. CXXFLAGS="$ac_cxxflags_safe"
  4291. AC_LANG_RESTORE
  4292. dnl All tests ok, inform and subst the variables
  4293. JAVAC=$kde_java_bindir/javac
  4294. JAVAH=$kde_java_bindir/javah
  4295. JAR=$kde_java_bindir/jar
  4296. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4297. JVMLIBS="-L$kde_java_libjvmdir -ljvm -L$kde_java_libhpidir -lhpi"
  4298. AC_MSG_RESULT([java JDK in $kde_java_bindir])
  4299. else
  4300. AC_DEFINE_UNQUOTED(PATH_JAVA, "$kde_java_bindir/java", [Define where your java executable is])
  4301. AC_MSG_RESULT([java JRE in $kde_java_bindir])
  4302. fi
  4303. else # no
  4304. AC_MSG_RESULT([none found])
  4305. fi
  4306. AC_SUBST(JAVAC)
  4307. AC_SUBST(JAVAH)
  4308. AC_SUBST(JAR)
  4309. AC_SUBST(JVMLIBS)
  4310. AC_SUBST(jni_includes)
  4311. # for backward compat
  4312. kde_cv_java_includedir=$kde_java_includedir
  4313. kde_cv_java_bindir=$kde_java_bindir
  4314. ])
  4315. dnl this is a redefinition of autoconf 2.5x's AC_FOREACH.
  4316. dnl When the argument list becomes big, as in KDE for AC_OUTPUT in
  4317. dnl big packages, m4_foreach is dog-slow. So use our own version of
  4318. dnl it. (matz@kde.org)
  4319. m4_define([mm_foreach],
  4320. [m4_pushdef([$1])_mm_foreach($@)m4_popdef([$1])])
  4321. m4_define([mm_car], [[$1]])
  4322. m4_define([mm_car2], [[$@]])
  4323. m4_define([_mm_foreach],
  4324. [m4_if(m4_quote($2), [], [],
  4325. [m4_define([$1], [mm_car($2)])$3[]_mm_foreach([$1],
  4326. mm_car2(m4_shift($2)),
  4327. [$3])])])
  4328. m4_define([AC_FOREACH],
  4329. [mm_foreach([$1], m4_split(m4_normalize([$2])), [$3])])
  4330. AC_DEFUN(KDE_NEED_FLEX,
  4331. [
  4332. kde_libs_safe=$LIBS
  4333. LIBS="$LIBS $USER_LDFLAGS"
  4334. AM_PROG_LEX
  4335. LIBS=$kde_libs_safe
  4336. if test -z "$LEXLIB"; then
  4337. AC_MSG_ERROR([You need to have flex installed.])
  4338. fi
  4339. AC_SUBST(LEXLIB)
  4340. ])
  4341. AC_DEFUN(AC_PATH_TQTOPIA,
  4342. [
  4343. dnl TODO: use AC_CACHE_VAL
  4344. if test -z "$1"; then
  4345. qtopia_minver_maj=1
  4346. qtopia_minver_min=5
  4347. qtopia_minver_pat=0
  4348. else
  4349. qtopia_minver_maj=`echo "$1" | sed -e "s/^\(.*\)\..*\..*$/\1/"`
  4350. qtopia_minver_min=`echo "$1" | sed -e "s/^.*\.\(.*\)\..*$/\1/"`
  4351. qtopia_minver_pat=`echo "$1" | sed -e "s/^.*\..*\.\(.*\)$/\1/"`
  4352. fi
  4353. qtopia_minver="$qtopia_minver_maj$qtopia_minver_min$qtopia_minver_pat"
  4354. qtopia_minverstr="$qtopia_minver_maj.$qtopia_minver_min.$qtopia_minver_pat"
  4355. AC_REQUIRE([AC_PATH_TQT])
  4356. AC_MSG_CHECKING([for Qtopia])
  4357. LIB_TQTOPIA="-lqpe"
  4358. AC_SUBST(LIB_TQTOPIA)
  4359. kde_qtopia_dirs="$QPEDIR /opt/Qtopia"
  4360. ac_qtopia_incdir=NO
  4361. AC_ARG_WITH(qtopia-dir,
  4362. [ --with-qtopia-dir=DIR where the root of Qtopia is installed ],
  4363. [ ac_qtopia_incdir="$withval"/include] )
  4364. qtopia_incdirs=""
  4365. for dir in $kde_qtopia_dirs; do
  4366. qtopia_incdirs="$qtopia_incdirs $dir/include"
  4367. done
  4368. if test ! "$ac_qtopia_incdir" = "NO"; then
  4369. qtopia_incdirs="$ac_qtopia_incdir $qtopia_incdirs"
  4370. fi
  4371. qtopia_incdir=""
  4372. AC_FIND_FILE(qpe/qpeapplication.h, $qtopia_incdirs, qtopia_incdir)
  4373. ac_qtopia_incdir="$qtopia_incdir"
  4374. if test -z "$qtopia_incdir"; then
  4375. AC_MSG_ERROR([Cannot find Qtopia headers. Please check your installation.])
  4376. fi
  4377. qtopia_ver_maj=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION "\(.*\)\..*\..*".*,\1,p'`;
  4378. qtopia_ver_min=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\.\(.*\)\..*".*,\1,p'`;
  4379. qtopia_ver_pat=`cat $qtopia_incdir/qpe/version.h | sed -n -e 's,.*QPE_VERSION ".*\..*\.\(.*\)".*,\1,p'`;
  4380. qtopia_ver="$qtopia_ver_maj$qtopia_ver_min$qtopia_ver_pat"
  4381. qtopia_verstr="$qtopia_ver_maj.$qtopia_ver_min.$qtopia_ver_pat"
  4382. if test "$qtopia_ver" -lt "$qtopia_minver"; then
  4383. AC_MSG_ERROR([found Qtopia version $qtopia_verstr but version $qtopia_minverstr
  4384. is required.])
  4385. fi
  4386. AC_LANG_SAVE
  4387. AC_LANG_CPLUSPLUS
  4388. ac_cxxflags_safe="$CXXFLAGS"
  4389. ac_ldflags_safe="$LDFLAGS"
  4390. ac_libs_safe="$LIBS"
  4391. CXXFLAGS="$CXXFLAGS -I$qtopia_incdir $all_includes"
  4392. LDFLAGS="$LDFLAGS $QT_LDFLAGS $all_libraries $USER_LDFLAGS $KDE_MT_LDFLAGS"
  4393. LIBS="$LIBS $LIB_TQTOPIA $LIBTQT"
  4394. cat > conftest.$ac_ext <<EOF
  4395. #include "confdefs.h"
  4396. #include <qpe/qpeapplication.h>
  4397. #include <qpe/version.h>
  4398. int main( int argc, char **argv )
  4399. {
  4400. QPEApplication app( argc, argv );
  4401. return 0;
  4402. }
  4403. EOF
  4404. if AC_TRY_EVAL(ac_link) && test -s conftest; then
  4405. rm -f conftest*
  4406. else
  4407. rm -f conftest*
  4408. AC_MSG_ERROR([Cannot link small Qtopia Application. For more details look at
  4409. the end of config.log])
  4410. fi
  4411. CXXFLAGS="$ac_cxxflags_safe"
  4412. LDFLAGS="$ac_ldflags_safe"
  4413. LIBS="$ac_libs_safe"
  4414. AC_LANG_RESTORE
  4415. QTOPIA_INCLUDES="-I$qtopia_incdir"
  4416. AC_SUBST(QTOPIA_INCLUDES)
  4417. AC_MSG_RESULT([found version $qtopia_verstr with headers at $qtopia_incdir])
  4418. ])
  4419. AC_DEFUN(KDE_INIT_DOXYGEN,
  4420. [
  4421. AC_MSG_CHECKING([for Qt docs])
  4422. kde_qtdir=
  4423. if test "${with_qt_dir+set}" = set; then
  4424. kde_qtdir="$with_qt_dir"
  4425. fi
  4426. AC_FIND_FILE(qsql.html, [ $kde_qtdir/doc/html $TQTDIR/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], TQTDOCDIR)
  4427. AC_MSG_RESULT($TQTDOCDIR)
  4428. AC_SUBST(TQTDOCDIR)
  4429. KDE_FIND_PATH(dot, DOT, [], [])
  4430. if test -n "$DOT"; then
  4431. KDE_HAVE_DOT="YES"
  4432. else
  4433. KDE_HAVE_DOT="NO"
  4434. fi
  4435. AC_SUBST(KDE_HAVE_DOT)
  4436. KDE_FIND_PATH(doxygen, DOXYGEN, [], [])
  4437. AC_SUBST(DOXYGEN)
  4438. DOXYGEN_PROJECT_NAME="$1"
  4439. DOXYGEN_PROJECT_NUMBER="$2"
  4440. AC_SUBST(DOXYGEN_PROJECT_NAME)
  4441. AC_SUBST(DOXYGEN_PROJECT_NUMBER)
  4442. KDE_HAS_DOXYGEN=no
  4443. if test -n "$DOXYGEN" && test -x "$DOXYGEN" && test -f $TQTDOCDIR/qsql.html; then
  4444. KDE_HAS_DOXYGEN=yes
  4445. fi
  4446. AC_SUBST(KDE_HAS_DOXYGEN)
  4447. ])
  4448. AC_DEFUN(AC_FIND_BZIP2,
  4449. [
  4450. AC_MSG_CHECKING([for bzDecompress in libbz2])
  4451. AC_CACHE_VAL(ac_cv_lib_bzip2,
  4452. [
  4453. AC_LANG_C
  4454. kde_save_LIBS="$LIBS"
  4455. LIBS="$all_libraries $USER_LDFLAGS -lbz2 $LIBSOCKET"
  4456. kde_save_CFLAGS="$CFLAGS"
  4457. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  4458. AC_TRY_LINK(dnl
  4459. [
  4460. #define BZ_NO_STDIO
  4461. #include<bzlib.h>
  4462. ],
  4463. [ bz_stream s; (void) bzDecompress(&s); ],
  4464. eval "ac_cv_lib_bzip2='-lbz2'",
  4465. eval "ac_cv_lib_bzip2=no")
  4466. LIBS="$kde_save_LIBS"
  4467. CFLAGS="$kde_save_CFLAGS"
  4468. ])dnl
  4469. AC_MSG_RESULT($ac_cv_lib_bzip2)
  4470. if test ! "$ac_cv_lib_bzip2" = no; then
  4471. BZIP2DIR=bzip2
  4472. LIBBZ2="$ac_cv_lib_bzip2"
  4473. AC_SUBST(LIBBZ2)
  4474. else
  4475. cxx_shared_flags=
  4476. KDE_CHECK_COMPILER_FLAG(shared, [
  4477. cxx_shared_flag="-shared"
  4478. ])
  4479. AC_MSG_CHECKING([for BZ2_bzDecompress in (shared) libbz2])
  4480. AC_CACHE_VAL(ac_cv_lib_bzip2_prefix,
  4481. [
  4482. AC_LANG_C
  4483. kde_save_LIBS="$LIBS"
  4484. LIBS="$all_libraries $USER_LDFLAGS $cxx_shared_flag -lbz2 $LIBSOCKET"
  4485. kde_save_CFLAGS="$CFLAGS"
  4486. CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
  4487. AC_TRY_LINK(dnl
  4488. [
  4489. #define BZ_NO_STDIO
  4490. #include<bzlib.h>
  4491. ],
  4492. [ bz_stream s; (void) BZ2_bzDecompress(&s); ],
  4493. eval "ac_cv_lib_bzip2_prefix='-lbz2'",
  4494. eval "ac_cv_lib_bzip2_prefix=no")
  4495. LIBS="$kde_save_LIBS"
  4496. CFLAGS="$kde_save_CFLAGS"
  4497. ])dnl
  4498. AC_MSG_RESULT($ac_cv_lib_bzip2_prefix)
  4499. if test ! "$ac_cv_lib_bzip2_prefix" = no; then
  4500. BZIP2DIR=bzip2
  4501. LIBBZ2="$ac_cv_lib_bzip2_prefix"
  4502. AC_SUBST(LIBBZ2)
  4503. AC_DEFINE(NEED_BZ2_PREFIX, 1, [Define if the libbz2 functions need the BZ2_ prefix])
  4504. dnl else, we just ignore this
  4505. fi
  4506. fi
  4507. AM_CONDITIONAL(include_BZIP2, test -n "$BZIP2DIR")
  4508. ])
  4509. dnl ------------------------------------------------------------------------
  4510. dnl Try to find the SSL headers and libraries.
  4511. dnl $(SSL_LDFLAGS) will be -Lsslliblocation (if needed)
  4512. dnl and $(SSL_INCLUDES) will be -Isslhdrlocation (if needed)
  4513. dnl ------------------------------------------------------------------------
  4514. dnl
  4515. AC_DEFUN(KDE_CHECK_SSL,
  4516. [
  4517. LIBSSL="-lssl -lcrypto"
  4518. AC_REQUIRE([KDE_CHECK_LIB64])
  4519. ac_ssl_includes=NO ac_ssl_libraries=NO
  4520. ssl_libraries=""
  4521. ssl_includes=""
  4522. AC_ARG_WITH(ssl-dir,
  4523. [ --with-ssl-dir=DIR where the root of OpenSSL is installed],
  4524. [ ac_ssl_includes="$withval"/include
  4525. ac_ssl_libraries="$withval"/lib$tdelibsuff
  4526. ])
  4527. want_ssl=yes
  4528. AC_ARG_WITH(ssl,
  4529. [ --without-ssl disable SSL checks],
  4530. [want_ssl=$withval])
  4531. if test $want_ssl = yes; then
  4532. AC_MSG_CHECKING(for OpenSSL)
  4533. AC_CACHE_VAL(ac_cv_have_ssl,
  4534. [#try to guess OpenSSL locations
  4535. ssl_incdirs="/usr/include /usr/local/include /usr/ssl/include /usr/local/ssl/include $prefix/include $kde_extra_includes"
  4536. ssl_incdirs="$ac_ssl_includes $ssl_incdirs"
  4537. AC_FIND_FILE(openssl/ssl.h, $ssl_incdirs, ssl_incdir)
  4538. ac_ssl_includes="$ssl_incdir"
  4539. ssl_libdirs="/usr/lib$tdelibsuff /usr/local/lib$tdelibsuff /usr/ssl/lib$tdelibsuff /usr/local/ssl/lib$tdelibsuff $libdir $prefix/lib$tdelibsuff $exec_prefix/lib$tdelibsuff $kde_extra_libs"
  4540. if test ! "$ac_ssl_libraries" = "NO"; then
  4541. ssl_libdirs="$ac_ssl_libraries $ssl_libdirs"
  4542. fi
  4543. test=NONE
  4544. ssl_libdir=NONE
  4545. for dir in $ssl_libdirs; do
  4546. try="ls -1 $dir/libssl*"
  4547. if test=`eval $try 2> /dev/null`; then ssl_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
  4548. done
  4549. ac_ssl_libraries="$ssl_libdir"
  4550. AC_LANG_SAVE
  4551. AC_LANG_C
  4552. ac_cflags_safe="$CFLAGS"
  4553. ac_ldflags_safe="$LDFLAGS"
  4554. ac_libs_safe="$LIBS"
  4555. CFLAGS="$CFLAGS -I$ssl_incdir $all_includes"
  4556. LDFLAGS="$LDFLAGS -L$ssl_libdir $all_libraries"
  4557. LIBS="$LIBS $LIBSSL -lRSAglue -lrsaref"
  4558. AC_TRY_LINK(,void RSAPrivateEncrypt(void);RSAPrivateEncrypt();,
  4559. ac_ssl_rsaref="yes"
  4560. ,
  4561. ac_ssl_rsaref="no"
  4562. )
  4563. CFLAGS="$ac_cflags_safe"
  4564. LDFLAGS="$ac_ldflags_safe"
  4565. LIBS="$ac_libs_safe"
  4566. AC_LANG_RESTORE
  4567. if test "$ac_ssl_includes" = NO || test "$ac_ssl_libraries" = NO; then
  4568. have_ssl=no
  4569. else
  4570. have_ssl=yes;
  4571. fi
  4572. ])
  4573. eval "$ac_cv_have_ssl"
  4574. AC_MSG_RESULT([libraries $ac_ssl_libraries, headers $ac_ssl_includes])
  4575. AC_MSG_CHECKING([whether OpenSSL uses rsaref])
  4576. AC_MSG_RESULT($ac_ssl_rsaref)
  4577. AC_MSG_CHECKING([for easter eggs])
  4578. AC_MSG_RESULT([none found])
  4579. else
  4580. have_ssl=no
  4581. fi
  4582. if test "$have_ssl" = yes; then
  4583. AC_MSG_CHECKING(for OpenSSL version)
  4584. dnl Check for SSL version
  4585. AC_CACHE_VAL(ac_cv_ssl_version,
  4586. [
  4587. AC_LANG_SAVE
  4588. AC_LANG_C
  4589. cat >conftest.$ac_ext <<EOF
  4590. #include <openssl/opensslv.h>
  4591. #include <stdio.h>
  4592. int main() {
  4593. #ifndef OPENSSL_VERSION_NUMBER
  4594. printf("ssl_version=\\"error\\"\n");
  4595. #else
  4596. if (OPENSSL_VERSION_NUMBER < 0x00906000)
  4597. printf("ssl_version=\\"old\\"\n");
  4598. else
  4599. printf("ssl_version=\\"ok\\"\n");
  4600. #endif
  4601. return (0);
  4602. }
  4603. EOF
  4604. ac_compile='${CC-gcc} $CFLAGS -I$ac_ssl_includes conftest.$ac_ext -o conftest'
  4605. if AC_TRY_EVAL(ac_compile); then
  4606. if eval `./conftest 2>&5`; then
  4607. if test $ssl_version = error; then
  4608. AC_MSG_ERROR([$ssl_incdir/openssl/opensslv.h doesn't define OPENSSL_VERSION_NUMBER !])
  4609. else
  4610. if test $ssl_version = old; then
  4611. AC_MSG_WARN([OpenSSL version too old. Upgrade to 0.9.6 at least, see http://www.openssl.org. SSL support disabled.])
  4612. have_ssl=no
  4613. fi
  4614. fi
  4615. ac_cv_ssl_version="ssl_version=$ssl_version"
  4616. else
  4617. AC_MSG_ERROR([Your system couldn't run a small SSL test program.
  4618. Check config.log, and if you can't figure it out, send a mail to
  4619. David Faure <faure@kde.org>, attaching your config.log])
  4620. fi
  4621. else
  4622. AC_MSG_ERROR([Your system couldn't link a small SSL test program.
  4623. Check config.log, and if you can't figure it out, send a mail to
  4624. David Faure <faure@kde.org>, attaching your config.log])
  4625. fi
  4626. AC_LANG_RESTORE
  4627. ])
  4628. eval "$ac_cv_ssl_version"
  4629. AC_MSG_RESULT($ssl_version)
  4630. fi
  4631. if test "$have_ssl" != yes; then
  4632. LIBSSL="";
  4633. else
  4634. AC_DEFINE(HAVE_SSL, 1, [If we are going to use OpenSSL])
  4635. ac_cv_have_ssl="have_ssl=yes \
  4636. ac_ssl_includes=$ac_ssl_includes ac_ssl_libraries=$ac_ssl_libraries ac_ssl_rsaref=$ac_ssl_rsaref"
  4637. ssl_libraries="$ac_ssl_libraries"
  4638. ssl_includes="$ac_ssl_includes"
  4639. if test "$ac_ssl_rsaref" = yes; then
  4640. LIBSSL="-lssl -lcrypto -lRSAglue -lrsaref"
  4641. fi
  4642. if test $ssl_version = "old"; then
  4643. AC_DEFINE(HAVE_OLD_SSL_API, 1, [Define if you have OpenSSL < 0.9.6])
  4644. fi
  4645. fi
  4646. if test "$ssl_includes" = "/usr/include" || test "$ssl_includes" = "/usr/local/include" || test -z "$ssl_includes"; then
  4647. SSL_INCLUDES="";
  4648. else
  4649. SSL_INCLUDES="-I$ssl_includes"
  4650. fi
  4651. if test "$ssl_libraries" = "/usr/lib" || test "$ssl_libraries" = "/usr/local/lib" || test -z "$ssl_libraries"; then
  4652. SSL_LDFLAGS=""
  4653. else
  4654. SSL_LDFLAGS="-L$ssl_libraries -R$ssl_libraries"
  4655. fi
  4656. AC_SUBST(SSL_INCLUDES)
  4657. AC_SUBST(SSL_LDFLAGS)
  4658. AC_SUBST(LIBSSL)
  4659. ])
  4660. AC_DEFUN(KDE_CHECK_STRLCPY,
  4661. [
  4662. AC_CHECK_STRLCPY
  4663. AC_CHECK_STRLCAT
  4664. AC_CHECK_SIZEOF(size_t)
  4665. AC_CHECK_SIZEOF(unsigned long)
  4666. AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned long)])
  4667. AC_TRY_COMPILE(,[
  4668. #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_LONG
  4669. choke me
  4670. #endif
  4671. ],[AC_MSG_RESULT([yes])],[
  4672. AC_MSG_RESULT([no])
  4673. AC_MSG_ERROR([
  4674. Apparently on your system our assumption sizeof(size_t) == sizeof(unsigned long)
  4675. does not apply. Please mail kde-devel@kde.org with a description of your system!
  4676. ])
  4677. ])
  4678. ])
  4679. # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
  4680. ## Copyright 1996, 1997, 1998, 1999, 2000, 2001
  4681. ## Free Software Foundation, Inc.
  4682. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4683. ##
  4684. ## This program is free software; you can redistribute it and/or modify
  4685. ## it under the terms of the GNU General Public License as published by
  4686. ## the Free Software Foundation; either version 2 of the License, or
  4687. ## (at your option) any later version.
  4688. ##
  4689. ## This program is distributed in the hope that it will be useful, but
  4690. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  4691. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  4692. ## General Public License for more details.
  4693. ##
  4694. ## You should have received a copy of the GNU General Public License
  4695. ## along with this program; if not, write to the Free Software
  4696. ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  4697. ##
  4698. ## As a special exception to the GNU General Public License, if you
  4699. ## distribute this file as part of a program that contains a
  4700. ## configuration script generated by Autoconf, you may include it under
  4701. ## the same distribution terms that you use for the rest of that program.
  4702. # serial 47 AC_PROG_LIBTOOL
  4703. # AC_PROG_LIBTOOL
  4704. # ---------------
  4705. AC_DEFUN([AC_PROG_LIBTOOL],
  4706. [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
  4707. dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
  4708. dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
  4709. AC_PROVIDE_IFELSE([AC_PROG_CXX],
  4710. [AC_LIBTOOL_CXX],
  4711. [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
  4712. ])])
  4713. dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
  4714. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
  4715. dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
  4716. AC_PROVIDE_IFELSE([AC_PROG_GCJ],
  4717. [AC_LIBTOOL_GCJ],
  4718. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
  4719. [AC_LIBTOOL_GCJ],
  4720. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
  4721. [AC_LIBTOOL_GCJ],
  4722. [ifdef([AC_PROG_GCJ],
  4723. [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  4724. ifdef([A][M_PROG_GCJ],
  4725. [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
  4726. ifdef([LT_AC_PROG_GCJ],
  4727. [define([LT_AC_PROG_GCJ],
  4728. defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
  4729. ])])# AC_PROG_LIBTOOL
  4730. # _AC_PROG_LIBTOOL
  4731. # ----------------
  4732. AC_DEFUN([_AC_PROG_LIBTOOL],
  4733. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  4734. AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
  4735. AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
  4736. # This can be used to rebuild libtool when needed
  4737. LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
  4738. # Always use our own libtool.
  4739. LIBTOOL='$(SHELL) $(top_builddir)/libtool --silent'
  4740. AC_SUBST(LIBTOOL)dnl
  4741. # Prevent multiple expansion
  4742. define([AC_PROG_LIBTOOL], [])
  4743. ])# _AC_PROG_LIBTOOL
  4744. # AC_LIBTOOL_SETUP
  4745. # ----------------
  4746. AC_DEFUN([AC_LIBTOOL_SETUP],
  4747. [AC_PREREQ(2.50)dnl
  4748. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  4749. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  4750. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  4751. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  4752. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  4753. AC_REQUIRE([AC_PROG_CC])dnl
  4754. AC_REQUIRE([AC_PROG_LD])dnl
  4755. AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
  4756. AC_REQUIRE([AC_PROG_NM])dnl
  4757. AC_REQUIRE([LT_AC_PROG_SED])dnl
  4758. AC_REQUIRE([AC_PROG_LN_S])dnl
  4759. AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
  4760. # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
  4761. AC_REQUIRE([AC_OBJEXT])dnl
  4762. AC_REQUIRE([AC_EXEEXT])dnl
  4763. dnl
  4764. AC_LIBTOOL_SYS_MAX_CMD_LEN
  4765. AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  4766. AC_LIBTOOL_OBJDIR
  4767. AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  4768. _LT_AC_PROG_ECHO_BACKSLASH
  4769. case $host_os in
  4770. aix3*)
  4771. # AIX sometimes has problems with the GCC collect2 program. For some
  4772. # reason, if we set the COLLECT_NAMES environment variable, the problems
  4773. # vanish in a puff of smoke.
  4774. if test "X${COLLECT_NAMES+set}" != Xset; then
  4775. COLLECT_NAMES=
  4776. export COLLECT_NAMES
  4777. fi
  4778. ;;
  4779. esac
  4780. # Sed substitution that helps us do robust quoting. It backslashifies
  4781. # metacharacters that are still active within double-quoted strings.
  4782. Xsed='sed -e s/^X//'
  4783. [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
  4784. # Same as above, but do not quote variable references.
  4785. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
  4786. # Sed substitution to delay expansion of an escaped shell variable in a
  4787. # double_quote_subst'ed string.
  4788. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  4789. # Sed substitution to avoid accidental globbing in evaled expressions
  4790. no_glob_subst='s/\*/\\\*/g'
  4791. # Constants:
  4792. rm="rm -f"
  4793. # Global variables:
  4794. default_ofile=libtool
  4795. can_build_shared=yes
  4796. # All known linkers require a `.a' archive for static linking (except M$VC,
  4797. # which needs '.lib').
  4798. libext=a
  4799. ltmain="$ac_aux_dir/ltmain.sh"
  4800. ofile="$default_ofile"
  4801. with_gnu_ld="$lt_cv_prog_gnu_ld"
  4802. AC_CHECK_TOOL(RANLIB, ranlib, :)
  4803. AC_CHECK_TOOL(STRIP, strip, :)
  4804. old_CC="$CC"
  4805. old_CFLAGS="$CFLAGS"
  4806. # Set sane defaults for various variables
  4807. test -z "$AR" && AR=ar
  4808. test -z "$AR_FLAGS" && AR_FLAGS=cru
  4809. test -z "$AS" && AS=as
  4810. test -z "$CC" && CC=cc
  4811. test -z "$LTCC" && LTCC=$CC
  4812. test -z "$DLLTOOL" && DLLTOOL=dlltool
  4813. test -z "$LD" && LD=ld
  4814. test -z "$LN_S" && LN_S="ln -s"
  4815. test -z "$MAGIC_CMD" && MAGIC_CMD=file
  4816. test -z "$NM" && NM=nm
  4817. test -z "$SED" && SED=sed
  4818. test -z "$OBJDUMP" && OBJDUMP=objdump
  4819. test -z "$RANLIB" && RANLIB=:
  4820. test -z "$STRIP" && STRIP=:
  4821. test -z "$ac_objext" && ac_objext=o
  4822. # Determine commands to create old-style static archives.
  4823. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
  4824. old_postinstall_cmds='chmod 644 $oldlib'
  4825. old_postuninstall_cmds=
  4826. if test -n "$RANLIB"; then
  4827. case $host_os in
  4828. openbsd*)
  4829. old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
  4830. ;;
  4831. *)
  4832. old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  4833. ;;
  4834. esac
  4835. old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  4836. fi
  4837. # Only perform the check for file, if the check method requires it
  4838. case $deplibs_check_method in
  4839. file_magic*)
  4840. if test "$file_magic_cmd" = '$MAGIC_CMD'; then
  4841. AC_PATH_MAGIC
  4842. fi
  4843. ;;
  4844. esac
  4845. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
  4846. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  4847. enable_win32_dll=yes, enable_win32_dll=no)
  4848. AC_ARG_ENABLE([libtool-lock],
  4849. [AC_HELP_STRING([--disable-libtool-lock],
  4850. [avoid locking (might break parallel builds)])])
  4851. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  4852. AC_ARG_WITH([pic],
  4853. [AC_HELP_STRING([--with-pic],
  4854. [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
  4855. [pic_mode="$withval"],
  4856. [pic_mode=default])
  4857. test -z "$pic_mode" && pic_mode=default
  4858. # Use C for the default configuration in the libtool script
  4859. tagname=
  4860. AC_LIBTOOL_LANG_C_CONFIG
  4861. _LT_AC_TAGCONFIG
  4862. ])# AC_LIBTOOL_SETUP
  4863. # _LT_AC_SYS_COMPILER
  4864. # -------------------
  4865. AC_DEFUN([_LT_AC_SYS_COMPILER],
  4866. [AC_REQUIRE([AC_PROG_CC])dnl
  4867. # If no C compiler was specified, use CC.
  4868. LTCC=${LTCC-"$CC"}
  4869. # Allow CC to be a program name with arguments.
  4870. set dummy $CC
  4871. compiler="[$]2"
  4872. ])# _LT_AC_SYS_COMPILER
  4873. # _LT_AC_SYS_LIBPATH_AIX
  4874. # ----------------------
  4875. # Links a minimal program and checks the executable
  4876. # for the system default hardcoded library path. In most cases,
  4877. # this is /usr/lib:/lib, but when the MPI compilers are used
  4878. # the location of the communication and MPI libs are included too.
  4879. # If we don't find anything, use the default library path according
  4880. # to the aix ld manual.
  4881. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
  4882. [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
  4883. aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
  4884. }'`
  4885. # Check for a 64-bit object if we didn't find anything.
  4886. 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; }
  4887. }'`; fi],[])
  4888. if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
  4889. ])# _LT_AC_SYS_LIBPATH_AIX
  4890. # _LT_AC_PROG_ECHO_BACKSLASH
  4891. # --------------------------
  4892. # Add some code to the start of the generated configure script which
  4893. # will find an echo command which doesn't interpret backslashes.
  4894. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
  4895. [ifdef([AC_DIVERSION_NOTICE],
  4896. [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
  4897. [AC_DIVERT_PUSH(NOTICE)])
  4898. # Check that we are running under the correct shell.
  4899. SHELL=${CONFIG_SHELL-/bin/sh}
  4900. case X$ECHO in
  4901. X*--fallback-echo)
  4902. # Remove one level of quotation (which was required for Make).
  4903. ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
  4904. ;;
  4905. esac
  4906. echo=${ECHO-echo}
  4907. if test "X[$]1" = X--no-reexec; then
  4908. # Discard the --no-reexec flag, and continue.
  4909. shift
  4910. elif test "X[$]1" = X--fallback-echo; then
  4911. # Avoid inline document here, it may be left over
  4912. :
  4913. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  4914. # Yippee, $echo works!
  4915. :
  4916. else
  4917. # Restart under the correct shell.
  4918. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
  4919. fi
  4920. if test "X[$]1" = X--fallback-echo; then
  4921. # used as fallback echo
  4922. shift
  4923. cat <<EOF
  4924. [$]*
  4925. EOF
  4926. exit 0
  4927. fi
  4928. # The HP-UX ksh and POSIX shell print the target directory to stdout
  4929. # if CDPATH is set.
  4930. if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  4931. if test -z "$ECHO"; then
  4932. if test "X${echo_test_string+set}" != Xset; then
  4933. # find a string as large as possible, as long as the shell can cope with it
  4934. for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
  4935. # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  4936. if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  4937. echo_test_string="`eval $cmd`" &&
  4938. (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
  4939. then
  4940. break
  4941. fi
  4942. done
  4943. fi
  4944. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  4945. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  4946. test "X$echo_testing_string" = "X$echo_test_string"; then
  4947. :
  4948. else
  4949. # The Solaris, AIX, and Digital Unix default echo programs unquote
  4950. # backslashes. This makes it impossible to quote backslashes using
  4951. # echo "$something" | sed 's/\\/\\\\/g'
  4952. #
  4953. # So, first we look for a working echo in the user's PATH.
  4954. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  4955. for dir in $PATH /usr/ucb; do
  4956. IFS="$lt_save_ifs"
  4957. if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
  4958. test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  4959. echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
  4960. test "X$echo_testing_string" = "X$echo_test_string"; then
  4961. echo="$dir/echo"
  4962. break
  4963. fi
  4964. done
  4965. IFS="$lt_save_ifs"
  4966. if test "X$echo" = Xecho; then
  4967. # We didn't find a better echo, so look for alternatives.
  4968. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  4969. echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
  4970. test "X$echo_testing_string" = "X$echo_test_string"; then
  4971. # This shell has a builtin print -r that does the trick.
  4972. echo='print -r'
  4973. elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
  4974. test "X$CONFIG_SHELL" != X/bin/ksh; then
  4975. # If we have ksh, try running configure again with it.
  4976. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
  4977. export ORIGINAL_CONFIG_SHELL
  4978. CONFIG_SHELL=/bin/ksh
  4979. export CONFIG_SHELL
  4980. exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
  4981. else
  4982. # Try using printf.
  4983. echo='printf %s\n'
  4984. if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  4985. echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
  4986. test "X$echo_testing_string" = "X$echo_test_string"; then
  4987. # Cool, printf works
  4988. :
  4989. elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  4990. test "X$echo_testing_string" = 'X\t' &&
  4991. echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  4992. test "X$echo_testing_string" = "X$echo_test_string"; then
  4993. CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
  4994. export CONFIG_SHELL
  4995. SHELL="$CONFIG_SHELL"
  4996. export SHELL
  4997. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  4998. elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
  4999. test "X$echo_testing_string" = 'X\t' &&
  5000. echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
  5001. test "X$echo_testing_string" = "X$echo_test_string"; then
  5002. echo="$CONFIG_SHELL [$]0 --fallback-echo"
  5003. else
  5004. # maybe with a smaller string...
  5005. prev=:
  5006. for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
  5007. if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
  5008. then
  5009. break
  5010. fi
  5011. prev="$cmd"
  5012. done
  5013. if test "$prev" != 'sed 50q "[$]0"'; then
  5014. echo_test_string=`eval $prev`
  5015. export echo_test_string
  5016. exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
  5017. else
  5018. # Oops. We lost completely, so just stick with echo.
  5019. echo=echo
  5020. fi
  5021. fi
  5022. fi
  5023. fi
  5024. fi
  5025. fi
  5026. # Copy echo and quote the copy suitably for passing to libtool from
  5027. # the Makefile, instead of quoting the original, which is used later.
  5028. ECHO=$echo
  5029. if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
  5030. ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
  5031. fi
  5032. AC_SUBST(ECHO)
  5033. AC_DIVERT_POP
  5034. ])# _LT_AC_PROG_ECHO_BACKSLASH
  5035. # _LT_AC_LOCK
  5036. # -----------
  5037. AC_DEFUN([_LT_AC_LOCK],
  5038. [AC_ARG_ENABLE([libtool-lock],
  5039. [AC_HELP_STRING([--disable-libtool-lock],
  5040. [avoid locking (might break parallel builds)])])
  5041. test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
  5042. # Some flags need to be propagated to the compiler or linker for good
  5043. # libtool support.
  5044. case $host in
  5045. ia64-*-hpux*)
  5046. # Find out which ABI we are using.
  5047. echo 'int i;' > conftest.$ac_ext
  5048. if AC_TRY_EVAL(ac_compile); then
  5049. case `/usr/bin/file conftest.$ac_objext` in
  5050. *ELF-32*)
  5051. HPUX_IA64_MODE="32"
  5052. ;;
  5053. *ELF-64*)
  5054. HPUX_IA64_MODE="64"
  5055. ;;
  5056. esac
  5057. fi
  5058. rm -rf conftest*
  5059. ;;
  5060. *-*-irix6*)
  5061. # Find out which ABI we are using.
  5062. echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  5063. if AC_TRY_EVAL(ac_compile); then
  5064. case `/usr/bin/file conftest.$ac_objext` in
  5065. *32-bit*)
  5066. LD="${LD-ld} -32"
  5067. ;;
  5068. *N32*)
  5069. LD="${LD-ld} -n32"
  5070. ;;
  5071. *64-bit*)
  5072. LD="${LD-ld} -64"
  5073. ;;
  5074. esac
  5075. fi
  5076. rm -rf conftest*
  5077. ;;
  5078. *-*-linux*)
  5079. # Test if the compiler is 64bit
  5080. echo 'int i;' > conftest.$ac_ext
  5081. if AC_TRY_EVAL(ac_compile); then
  5082. case `/usr/bin/file conftest.$ac_objext` in
  5083. *"ELF 32"*)
  5084. LINUX_64_MODE="32"
  5085. ;;
  5086. *"ELF 64"*)
  5087. LINUX_64_MODE="64"
  5088. ;;
  5089. esac
  5090. fi
  5091. rm -rf conftest*
  5092. ;;
  5093. *-*-sco3.2v5*)
  5094. # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  5095. SAVE_CFLAGS="$CFLAGS"
  5096. CFLAGS="$CFLAGS -belf"
  5097. AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  5098. [AC_LANG_PUSH(C)
  5099. AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
  5100. AC_LANG_POP])
  5101. if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  5102. # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  5103. CFLAGS="$SAVE_CFLAGS"
  5104. fi
  5105. ;;
  5106. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  5107. [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
  5108. AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  5109. AC_CHECK_TOOL(AS, as, false)
  5110. AC_CHECK_TOOL(OBJDUMP, objdump, false)
  5111. # recent cygwin and mingw systems supply a stub DllMain which the user
  5112. # can override, but on older systems we have to supply one
  5113. AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
  5114. [AC_TRY_LINK([],
  5115. [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
  5116. DllMain (0, 0, 0);],
  5117. [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
  5118. case $host/$CC in
  5119. *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
  5120. # old mingw systems require "-dll" to link a DLL, while more recent ones
  5121. # require "-mdll"
  5122. SAVE_CFLAGS="$CFLAGS"
  5123. CFLAGS="$CFLAGS -mdll"
  5124. AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
  5125. [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
  5126. CFLAGS="$SAVE_CFLAGS" ;;
  5127. *-*-cygwin* | *-*-pw32*)
  5128. # cygwin systems need to pass --dll to the linker, and not link
  5129. # crt.o which will require a WinMain@16 definition.
  5130. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
  5131. esac
  5132. ;;
  5133. ])
  5134. esac
  5135. need_locks="$enable_libtool_lock"
  5136. ])# _LT_AC_LOCK
  5137. # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5138. # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
  5139. # ----------------------------------------------------------------
  5140. # Check whether the given compiler option works
  5141. AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
  5142. [AC_CACHE_CHECK([$1], [$2],
  5143. [$2=no
  5144. ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
  5145. save_CFLAGS="$CFLAGS"
  5146. CFLAGS="$CFLAGS $3"
  5147. echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  5148. if (eval $ac_compile 2>conftest.err) && test -s $ac_outfile; then
  5149. # The compiler can only warn and ignore the option if not recognized
  5150. # So say no if there are warnings
  5151. if test -s conftest.err; then
  5152. # Append any errors to the config.log.
  5153. cat conftest.err 1>&AS_MESSAGE_LOG_FD
  5154. else
  5155. $2=yes
  5156. fi
  5157. fi
  5158. $rm conftest*
  5159. CFLAGS="$save_CFLAGS"
  5160. ])
  5161. if test x"[$]$2" = xyes; then
  5162. ifelse([$5], , :, [$5])
  5163. else
  5164. ifelse([$6], , :, [$6])
  5165. fi
  5166. ])# AC_LIBTOOL_COMPILER_OPTION
  5167. # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
  5168. # [ACTION-SUCCESS], [ACTION-FAILURE])
  5169. # ------------------------------------------------------------
  5170. # Check whether the given compiler option works
  5171. AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
  5172. [AC_CACHE_CHECK([$1], [$2],
  5173. [$2=no
  5174. save_LDFLAGS="$LDFLAGS"
  5175. LDFLAGS="$LDFLAGS $3"
  5176. echo "$lt_simple_link_test_code" > conftest.$ac_ext
  5177. if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
  5178. # The compiler can only warn and ignore the option if not recognized
  5179. # So say no if there are warnings
  5180. if test -s conftest.err; then
  5181. # Append any errors to the config.log.
  5182. cat conftest.err 1>&AS_MESSAGE_LOG_FD
  5183. else
  5184. $2=yes
  5185. fi
  5186. fi
  5187. $rm conftest*
  5188. LDFLAGS="$save_LDFLAGS"
  5189. ])
  5190. if test x"[$]$2" = xyes; then
  5191. ifelse([$4], , :, [$4])
  5192. else
  5193. ifelse([$5], , :, [$5])
  5194. fi
  5195. ])# AC_LIBTOOL_LINKER_OPTION
  5196. # AC_LIBTOOL_SYS_MAX_CMD_LEN
  5197. # --------------------------
  5198. AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
  5199. [# find the maximum length of command line arguments
  5200. AC_MSG_CHECKING([the maximum length of command line arguments])
  5201. AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
  5202. i=0
  5203. testring="ABCD"
  5204. case $host_os in
  5205. msdosdjgpp*)
  5206. # On DJGPP, this test can blow up pretty badly due to problems in libc
  5207. # (any single argument exceeding 2000 bytes causes a buffer overrun
  5208. # during glob expansion). Even if it were fixed, the result of this
  5209. # check would be larger than it should be.
  5210. lt_cv_sys_max_cmd_len=12288; # 12K is about right
  5211. ;;
  5212. gnu*)
  5213. # Under GNU Hurd, this test is not required because there is
  5214. # no limit to the length of command line arguments.
  5215. # Libtool will interpret -1 as no limit whatsoever
  5216. lt_cv_sys_max_cmd_len=-1;
  5217. ;;
  5218. *)
  5219. # If test is not a shell built-in, we'll probably end up computing a
  5220. # maximum length that is only half of the actual maximum length, but
  5221. # we can't tell.
  5222. while (test "X"`$CONFIG_SHELL [$]0 --fallback-echo "X$testring" 2>/dev/null` \
  5223. = "XX$testring") >/dev/null 2>&1 &&
  5224. new_result=`expr "X$testring" : ".*" 2>&1` &&
  5225. lt_cv_sys_max_cmd_len=$new_result &&
  5226. test $i != 17 # 1/2 MB should be enough
  5227. do
  5228. i=`expr $i + 1`
  5229. testring=$testring$testring
  5230. done
  5231. testring=
  5232. # Add a significant safety factor because C++ compilers can tack on massive
  5233. # amounts of additional arguments before passing them to the linker.
  5234. # It appears as though 1/2 is a usable value.
  5235. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
  5236. ;;
  5237. esac
  5238. ])
  5239. if test -n $lt_cv_sys_max_cmd_len ; then
  5240. AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
  5241. else
  5242. AC_MSG_RESULT(none)
  5243. fi
  5244. ])# AC_LIBTOOL_SYS_MAX_CMD_LEN
  5245. # _LT_AC_CHECK_DLFCN
  5246. # --------------------
  5247. AC_DEFUN([_LT_AC_CHECK_DLFCN],
  5248. [AC_CHECK_HEADERS(dlfcn.h)dnl
  5249. ])# _LT_AC_CHECK_DLFCN
  5250. # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
  5251. # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
  5252. # ------------------------------------------------------------------
  5253. AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
  5254. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5255. if test "$cross_compiling" = yes; then :
  5256. [$4]
  5257. else
  5258. lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
  5259. lt_status=$lt_dlunknown
  5260. cat > conftest.$ac_ext <<EOF
  5261. [#line __oline__ "configure"
  5262. #include "confdefs.h"
  5263. #if HAVE_DLFCN_H
  5264. #include <dlfcn.h>
  5265. #endif
  5266. #include <stdio.h>
  5267. #ifdef RTLD_GLOBAL
  5268. # define LT_DLGLOBAL RTLD_GLOBAL
  5269. #else
  5270. # ifdef DL_GLOBAL
  5271. # define LT_DLGLOBAL DL_GLOBAL
  5272. # else
  5273. # define LT_DLGLOBAL 0
  5274. # endif
  5275. #endif
  5276. /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
  5277. find out it does not work in some platform. */
  5278. #ifndef LT_DLLAZY_OR_NOW
  5279. # ifdef RTLD_LAZY
  5280. # define LT_DLLAZY_OR_NOW RTLD_LAZY
  5281. # else
  5282. # ifdef DL_LAZY
  5283. # define LT_DLLAZY_OR_NOW DL_LAZY
  5284. # else
  5285. # ifdef RTLD_NOW
  5286. # define LT_DLLAZY_OR_NOW RTLD_NOW
  5287. # else
  5288. # ifdef DL_NOW
  5289. # define LT_DLLAZY_OR_NOW DL_NOW
  5290. # else
  5291. # define LT_DLLAZY_OR_NOW 0
  5292. # endif
  5293. # endif
  5294. # endif
  5295. # endif
  5296. #endif
  5297. #ifdef __cplusplus
  5298. extern "C" void exit (int);
  5299. #endif
  5300. void fnord() { int i=42;}
  5301. int main ()
  5302. {
  5303. void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
  5304. int status = $lt_dlunknown;
  5305. if (self)
  5306. {
  5307. if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
  5308. else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
  5309. /* dlclose (self); */
  5310. }
  5311. exit (status);
  5312. }]
  5313. EOF
  5314. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
  5315. (./conftest; exit; ) 2>/dev/null
  5316. lt_status=$?
  5317. case x$lt_status in
  5318. x$lt_dlno_uscore) $1 ;;
  5319. x$lt_dlneed_uscore) $2 ;;
  5320. x$lt_unknown|x*) $3 ;;
  5321. esac
  5322. else :
  5323. # compilation failed
  5324. $3
  5325. fi
  5326. fi
  5327. rm -fr conftest*
  5328. ])# _LT_AC_TRY_DLOPEN_SELF
  5329. # AC_LIBTOOL_DLOPEN_SELF
  5330. # -------------------
  5331. AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
  5332. [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
  5333. if test "x$enable_dlopen" != xyes; then
  5334. enable_dlopen=unknown
  5335. enable_dlopen_self=unknown
  5336. enable_dlopen_self_static=unknown
  5337. else
  5338. lt_cv_dlopen=no
  5339. lt_cv_dlopen_libs=
  5340. case $host_os in
  5341. beos*)
  5342. lt_cv_dlopen="load_add_on"
  5343. lt_cv_dlopen_libs=
  5344. lt_cv_dlopen_self=yes
  5345. ;;
  5346. cygwin* | mingw* | pw32*)
  5347. lt_cv_dlopen="LoadLibrary"
  5348. lt_cv_dlopen_libs=
  5349. ;;
  5350. *)
  5351. AC_CHECK_FUNC([shl_load],
  5352. [lt_cv_dlopen="shl_load"],
  5353. [AC_CHECK_LIB([dld], [shl_load],
  5354. [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
  5355. [AC_CHECK_FUNC([dlopen],
  5356. [lt_cv_dlopen="dlopen"],
  5357. [AC_CHECK_LIB([dl], [dlopen],
  5358. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
  5359. [AC_CHECK_LIB([svld], [dlopen],
  5360. [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
  5361. [AC_CHECK_LIB([dld], [dld_link],
  5362. [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
  5363. ])
  5364. ])
  5365. ])
  5366. ])
  5367. ])
  5368. ;;
  5369. esac
  5370. if test "x$lt_cv_dlopen" != xno; then
  5371. enable_dlopen=yes
  5372. else
  5373. enable_dlopen=no
  5374. fi
  5375. case $lt_cv_dlopen in
  5376. dlopen)
  5377. save_CPPFLAGS="$CPPFLAGS"
  5378. test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  5379. save_LDFLAGS="$LDFLAGS"
  5380. eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  5381. save_LIBS="$LIBS"
  5382. LIBS="$lt_cv_dlopen_libs $LIBS"
  5383. AC_CACHE_CHECK([whether a program can dlopen itself],
  5384. lt_cv_dlopen_self, [dnl
  5385. _LT_AC_TRY_DLOPEN_SELF(
  5386. lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
  5387. lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
  5388. ])
  5389. if test "x$lt_cv_dlopen_self" = xyes; then
  5390. LDFLAGS="$LDFLAGS $link_static_flag"
  5391. AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
  5392. lt_cv_dlopen_self_static, [dnl
  5393. _LT_AC_TRY_DLOPEN_SELF(
  5394. lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
  5395. lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
  5396. ])
  5397. fi
  5398. CPPFLAGS="$save_CPPFLAGS"
  5399. LDFLAGS="$save_LDFLAGS"
  5400. LIBS="$save_LIBS"
  5401. ;;
  5402. esac
  5403. case $lt_cv_dlopen_self in
  5404. yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  5405. *) enable_dlopen_self=unknown ;;
  5406. esac
  5407. case $lt_cv_dlopen_self_static in
  5408. yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  5409. *) enable_dlopen_self_static=unknown ;;
  5410. esac
  5411. fi
  5412. ])# AC_LIBTOOL_DLOPEN_SELF
  5413. # AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
  5414. # ---------------------------------
  5415. # Check to see if options -c and -o are simultaneously supported by compiler
  5416. AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
  5417. [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  5418. AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
  5419. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
  5420. [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
  5421. $rm -r conftest 2>/dev/null
  5422. mkdir conftest
  5423. cd conftest
  5424. mkdir out
  5425. ifelse([$1],[],[save_CFLAGS="$CFLAGS"
  5426. CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"],
  5427. [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS"
  5428. CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"],
  5429. [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS"
  5430. GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
  5431. echo "$lt_simple_compile_test_code" > conftest.$ac_ext
  5432. # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
  5433. # that will create temporary files in the current directory regardless of
  5434. # the output directory. Thus, making CWD read-only will cause this test
  5435. # to fail, enabling locking or at least warning the user not to do parallel
  5436. # builds.
  5437. chmod -w .
  5438. if (eval $ac_compile 2>out/conftest.err) && test -s out/conftest2.$ac_objext
  5439. then
  5440. # The compiler can only warn and ignore the option if not recognized
  5441. # So say no if there are warnings
  5442. if test -s out/conftest.err; then
  5443. # Append any errors to the config.log.
  5444. cat out/conftest.err 1>&AS_MESSAGE_LOG_FD
  5445. else
  5446. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  5447. fi
  5448. fi
  5449. ifelse([$1],[],[CFLAGS="$save_CFLAGS"],
  5450. [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"],
  5451. [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"])
  5452. chmod u+w .
  5453. $rm conftest* out/*
  5454. rmdir out
  5455. cd ..
  5456. rmdir conftest
  5457. $rm conftest*
  5458. ])
  5459. ])# AC_LIBTOOL_PROG_CC_C_O
  5460. # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
  5461. # -----------------------------------------
  5462. # Check to see if we can do hard links to lock some files if needed
  5463. AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
  5464. [AC_REQUIRE([_LT_AC_LOCK])dnl
  5465. hard_links="nottested"
  5466. if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
  5467. # do not overwrite the value of need_locks provided by the user
  5468. AC_MSG_CHECKING([if we can lock with hard links])
  5469. hard_links=yes
  5470. $rm conftest*
  5471. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  5472. touch conftest.a
  5473. ln conftest.a conftest.b 2>&5 || hard_links=no
  5474. ln conftest.a conftest.b 2>/dev/null && hard_links=no
  5475. AC_MSG_RESULT([$hard_links])
  5476. if test "$hard_links" = no; then
  5477. AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
  5478. need_locks=warn
  5479. fi
  5480. else
  5481. need_locks=no
  5482. fi
  5483. ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
  5484. # AC_LIBTOOL_OBJDIR
  5485. # -----------------
  5486. AC_DEFUN([AC_LIBTOOL_OBJDIR],
  5487. [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
  5488. [rm -f .libs 2>/dev/null
  5489. mkdir .libs 2>/dev/null
  5490. if test -d .libs; then
  5491. lt_cv_objdir=.libs
  5492. else
  5493. # MS-DOS does not allow filenames that begin with a dot.
  5494. lt_cv_objdir=_libs
  5495. fi
  5496. rmdir .libs 2>/dev/null])
  5497. objdir=$lt_cv_objdir
  5498. ])# AC_LIBTOOL_OBJDIR
  5499. # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
  5500. # ----------------------------------------------
  5501. # Check hardcoding attributes.
  5502. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
  5503. [AC_MSG_CHECKING([how to hardcode library paths into programs])
  5504. _LT_AC_TAGVAR(hardcode_action, $1)=
  5505. if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
  5506. test -n "$_LT_AC_TAGVAR(runpath_var $1)"; then
  5507. # We can hardcode non-existant directories.
  5508. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
  5509. # If the only mechanism to avoid hardcoding is shlibpath_var, we
  5510. # have to relink, otherwise we might link with an installed library
  5511. # when we should be linking with a yet-to-be-installed one
  5512. ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
  5513. test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
  5514. # Linking always hardcodes the temporary library directory.
  5515. _LT_AC_TAGVAR(hardcode_action, $1)=relink
  5516. else
  5517. # We can link without hardcoding, and we can hardcode nonexisting dirs.
  5518. _LT_AC_TAGVAR(hardcode_action, $1)=immediate
  5519. fi
  5520. else
  5521. # We cannot hardcode anything, or else we can only hardcode existing
  5522. # directories.
  5523. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
  5524. fi
  5525. AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
  5526. if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
  5527. # Fast installation is not supported
  5528. enable_fast_install=no
  5529. elif test "$shlibpath_overrides_runpath" = yes ||
  5530. test "$enable_shared" = no; then
  5531. # Fast installation is not necessary
  5532. enable_fast_install=needless
  5533. fi
  5534. ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
  5535. # AC_LIBTOOL_SYS_LIB_STRIP
  5536. # ------------------------
  5537. AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
  5538. [striplib=
  5539. old_striplib=
  5540. AC_MSG_CHECKING([whether stripping libraries is possible])
  5541. if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
  5542. test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
  5543. test -z "$striplib" && striplib="$STRIP --strip-unneeded"
  5544. AC_MSG_RESULT([yes])
  5545. else
  5546. AC_MSG_RESULT([no])
  5547. fi
  5548. ])# AC_LIBTOOL_SYS_LIB_STRIP
  5549. # AC_LIBTOOL_SYS_DYNAMIC_LINKER
  5550. # -----------------------------
  5551. # PORTME Fill in your ld.so characteristics
  5552. AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
  5553. [AC_MSG_CHECKING([dynamic linker characteristics])
  5554. library_names_spec=
  5555. libname_spec='lib$name'
  5556. soname_spec=
  5557. postinstall_cmds=
  5558. postuninstall_cmds=
  5559. finish_cmds=
  5560. finish_eval=
  5561. shlibpath_var=
  5562. shlibpath_overrides_runpath=unknown
  5563. version_type=none
  5564. dynamic_linker="$host_os ld.so"
  5565. sys_lib_dlsearch_path_spec="/lib /usr/lib"
  5566. sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  5567. need_lib_prefix=unknown
  5568. hardcode_into_libs=no
  5569. # when you set need_version to no, make sure it does not cause -set_version
  5570. # flags to be left without arguments
  5571. need_version=unknown
  5572. case $host_os in
  5573. aix3*)
  5574. version_type=linux
  5575. library_names_spec='${libname}${release}.so$versuffix $libname.a'
  5576. shlibpath_var=LIBPATH
  5577. # AIX 3 has no versioning support, so we append a major version to the name.
  5578. soname_spec='${libname}${release}.so$major'
  5579. ;;
  5580. aix4* | aix5*)
  5581. version_type=linux
  5582. if test "$host_cpu" = ia64; then
  5583. # AIX 5 supports IA64
  5584. library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
  5585. shlibpath_var=LD_LIBRARY_PATH
  5586. else
  5587. # With GCC up to 2.95.x, collect2 would create an import file
  5588. # for dependence libraries. The import file would start with
  5589. # the line `#! .'. This would cause the generated library to
  5590. # depend on `.', always an invalid library. This was fixed in
  5591. # development snapshots of GCC prior to 3.0.
  5592. case $host_os in
  5593. aix4 | aix4.[[01]] | aix4.[[01]].*)
  5594. if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
  5595. echo ' yes '
  5596. echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
  5597. :
  5598. else
  5599. can_build_shared=no
  5600. fi
  5601. ;;
  5602. esac
  5603. # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
  5604. # soname into executable. Probably we can add versioning support to
  5605. # collect2, so additional links can be useful in future.
  5606. if test "$aix_use_runtimelinking" = yes; then
  5607. # If using run time linking (on AIX 4.2 or later) use lib<name>.so
  5608. # instead of lib<name>.a to let people know that these are not
  5609. # typical AIX shared libraries.
  5610. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5611. else
  5612. # We preserve .a as extension for shared libraries through AIX4.2
  5613. # and later when we are not doing run time linking.
  5614. library_names_spec='${libname}${release}.a $libname.a'
  5615. soname_spec='${libname}${release}.so$major'
  5616. fi
  5617. shlibpath_var=LIBPATH
  5618. fi
  5619. ;;
  5620. amigaos*)
  5621. library_names_spec='$libname.ixlibrary $libname.a'
  5622. # Create ${libname}_ixlibrary.a entries in /sys/libs.
  5623. 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'
  5624. ;;
  5625. beos*)
  5626. library_names_spec='${libname}.so'
  5627. dynamic_linker="$host_os ld.so"
  5628. shlibpath_var=LIBRARY_PATH
  5629. ;;
  5630. bsdi4*)
  5631. version_type=linux
  5632. need_version=no
  5633. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5634. soname_spec='${libname}${release}.so$major'
  5635. finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
  5636. shlibpath_var=LD_LIBRARY_PATH
  5637. sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  5638. sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  5639. # the default ld.so.conf also contains /usr/contrib/lib and
  5640. # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  5641. # libtool to hard-code these into programs
  5642. ;;
  5643. cygwin* | mingw* | pw32*)
  5644. version_type=windows
  5645. need_version=no
  5646. need_lib_prefix=no
  5647. case $GCC,$host_os in
  5648. yes,cygwin*)
  5649. library_names_spec='$libname.dll.a'
  5650. sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
  5651. soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
  5652. postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
  5653. dldir=$destdir/`dirname \$dlpath`~
  5654. test -d \$dldir || mkdir -p \$dldir~
  5655. $install_prog .libs/$dlname \$dldir/$dlname'
  5656. postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
  5657. dlpath=$dir/\$dldll~
  5658. $rm \$dlpath'
  5659. ;;
  5660. yes,mingw*)
  5661. library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll'
  5662. sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"`
  5663. if echo "$sys_lib_search_path_spec" | [egrep ';[C-Z]:/' >/dev/null]; then
  5664. # It is most probably a Windows format PATH printed by
  5665. # mingw gcc, but we are running on Cygwin. Gcc prints its search
  5666. # path with ; separators, and with drive letters. We can handle the
  5667. # drive letters (cygwin fileutils understands them), so leave them,
  5668. # especially as we might pass files found there to a mingw objdump,
  5669. # which wouldn't understand a cygwinified path. Ahh.
  5670. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'`
  5671. else
  5672. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e "s/$PATH_SEPARATOR/ /g"`
  5673. fi
  5674. ;;
  5675. yes,pw32*)
  5676. library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll'
  5677. ;;
  5678. *)
  5679. library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib'
  5680. ;;
  5681. esac
  5682. dynamic_linker='Win32 ld.exe'
  5683. # FIXME: first we should search . and the directory the executable is in
  5684. shlibpath_var=PATH
  5685. ;;
  5686. darwin* | rhapsody*)
  5687. dynamic_linker="$host_os dyld"
  5688. version_type=darwin
  5689. need_lib_prefix=no
  5690. need_version=no
  5691. # FIXME: Relying on posixy $() will cause problems for
  5692. # cross-compilation, but unfortunately the echo tests do not
  5693. # yet detect zsh echo's removal of \ escapes.
  5694. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
  5695. soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
  5696. shlibpath_overrides_runpath=yes
  5697. shlibpath_var=DYLD_LIBRARY_PATH
  5698. ;;
  5699. dgux*)
  5700. version_type=linux
  5701. need_lib_prefix=no
  5702. need_version=no
  5703. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5704. soname_spec='${libname}${release}.so$major'
  5705. shlibpath_var=LD_LIBRARY_PATH
  5706. ;;
  5707. freebsd1*)
  5708. dynamic_linker=no
  5709. ;;
  5710. freebsd*)
  5711. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  5712. version_type=freebsd-$objformat
  5713. case $version_type in
  5714. freebsd-elf*)
  5715. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  5716. need_version=no
  5717. need_lib_prefix=no
  5718. ;;
  5719. freebsd-*)
  5720. library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  5721. need_version=yes
  5722. ;;
  5723. esac
  5724. shlibpath_var=LD_LIBRARY_PATH
  5725. case $host_os in
  5726. freebsd2*)
  5727. shlibpath_overrides_runpath=yes
  5728. ;;
  5729. freebsd3.[01]* | freebsdelf3.[01]*)
  5730. shlibpath_overrides_runpath=yes
  5731. hardcode_into_libs=yes
  5732. ;;
  5733. *) # from 3.2 on
  5734. shlibpath_overrides_runpath=no
  5735. hardcode_into_libs=yes
  5736. ;;
  5737. esac
  5738. ;;
  5739. gnu*)
  5740. version_type=linux
  5741. need_lib_prefix=no
  5742. need_version=no
  5743. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
  5744. soname_spec='${libname}${release}.so$major'
  5745. shlibpath_var=LD_LIBRARY_PATH
  5746. hardcode_into_libs=yes
  5747. ;;
  5748. hpux9* | hpux10* | hpux11*)
  5749. # Give a soname corresponding to the major version so that dld.sl refuses to
  5750. # link against other versions.
  5751. version_type=sunos
  5752. need_lib_prefix=no
  5753. need_version=no
  5754. if test "$host_cpu" = ia64; then
  5755. hardcode_into_libs=yes
  5756. dynamic_linker="$host_os dld.so"
  5757. shlibpath_var=LD_LIBRARY_PATH
  5758. shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
  5759. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5760. soname_spec='${libname}${release}.so$major'
  5761. if test "X$HPUX_IA64_MODE" = X32; then
  5762. sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
  5763. else
  5764. sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
  5765. fi
  5766. sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
  5767. else
  5768. dynamic_linker="$host_os dld.sl"
  5769. shlibpath_var=SHLIB_PATH
  5770. shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
  5771. library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  5772. soname_spec='${libname}${release}.sl$major'
  5773. fi
  5774. # HP-UX runs *really* slowly unless shared libraries are mode 555.
  5775. postinstall_cmds='chmod 555 $lib'
  5776. ;;
  5777. irix5* | irix6* | nonstopux*)
  5778. case $host_os in
  5779. nonstopux*) version_type=nonstopux ;;
  5780. *) version_type=irix ;;
  5781. esac
  5782. need_lib_prefix=no
  5783. need_version=no
  5784. soname_spec='${libname}${release}.so$major'
  5785. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so'
  5786. case $host_os in
  5787. irix5* | nonstopux*)
  5788. libsuff= shlibsuff=
  5789. ;;
  5790. *)
  5791. case $LD in # libtool.m4 will add one of these switches to LD
  5792. *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  5793. *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  5794. *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  5795. *) libsuff= shlibsuff= libmagic=never-match;;
  5796. esac
  5797. ;;
  5798. esac
  5799. shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  5800. shlibpath_overrides_runpath=no
  5801. sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
  5802. sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
  5803. ;;
  5804. # No shared lib support for Linux oldld, aout, or coff.
  5805. linux*oldld* | linux*aout* | linux*coff*)
  5806. dynamic_linker=no
  5807. ;;
  5808. # This must be Linux ELF.
  5809. linux*)
  5810. version_type=linux
  5811. need_lib_prefix=no
  5812. need_version=no
  5813. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5814. soname_spec='${libname}${release}.so$major'
  5815. finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  5816. libsuff=
  5817. if test "x$LINUX_64_MODE" = x64; then
  5818. # Some platforms are per default 64-bit, so there's no /lib64
  5819. if test -d /lib64; then
  5820. libsuff=64
  5821. fi
  5822. fi
  5823. shlibpath_var=LD_LIBRARY_PATH
  5824. shlibpath_overrides_runpath=no
  5825. sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff}"
  5826. sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
  5827. # This implies no fast_install, which is unacceptable.
  5828. # Some rework will be needed to allow for fast_install
  5829. # before this can be enabled.
  5830. hardcode_into_libs=yes
  5831. # We used to test for /lib/ld.so.1 and disable shared libraries on
  5832. # powerpc, because MkLinux only supported shared libraries with the
  5833. # GNU dynamic linker. Since this was broken with cross compilers,
  5834. # most powerpc-linux boxes support dynamic linking these days and
  5835. # people can always --disable-shared, the test was removed, and we
  5836. # assume the GNU/Linux dynamic linker is in use.
  5837. dynamic_linker='GNU/Linux ld.so'
  5838. ;;
  5839. netbsd*)
  5840. version_type=sunos
  5841. need_lib_prefix=no
  5842. need_version=no
  5843. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  5844. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  5845. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  5846. dynamic_linker='NetBSD (a.out) ld.so'
  5847. else
  5848. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  5849. soname_spec='${libname}${release}.so$major'
  5850. dynamic_linker='NetBSD ld.elf_so'
  5851. fi
  5852. shlibpath_var=LD_LIBRARY_PATH
  5853. shlibpath_overrides_runpath=yes
  5854. hardcode_into_libs=yes
  5855. ;;
  5856. newsos6)
  5857. version_type=linux
  5858. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5859. shlibpath_var=LD_LIBRARY_PATH
  5860. shlibpath_overrides_runpath=yes
  5861. ;;
  5862. nto-qnx)
  5863. version_type=linux
  5864. need_lib_prefix=no
  5865. need_version=no
  5866. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5867. soname_spec='${libname}${release}.so$major'
  5868. shlibpath_var=LD_LIBRARY_PATH
  5869. shlibpath_overrides_runpath=yes
  5870. ;;
  5871. openbsd*)
  5872. version_type=sunos
  5873. need_lib_prefix=no
  5874. need_version=no
  5875. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  5876. finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  5877. shlibpath_var=LD_LIBRARY_PATH
  5878. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  5879. case $host_os in
  5880. openbsd2.[[89]] | openbsd2.[[89]].*)
  5881. shlibpath_overrides_runpath=no
  5882. ;;
  5883. *)
  5884. shlibpath_overrides_runpath=yes
  5885. ;;
  5886. esac
  5887. else
  5888. shlibpath_overrides_runpath=yes
  5889. fi
  5890. ;;
  5891. os2*)
  5892. libname_spec='$name'
  5893. need_lib_prefix=no
  5894. library_names_spec='$libname.dll $libname.a'
  5895. dynamic_linker='OS/2 ld.exe'
  5896. shlibpath_var=LIBPATH
  5897. ;;
  5898. osf3* | osf4* | osf5*)
  5899. version_type=osf
  5900. need_lib_prefix=no
  5901. need_version=no
  5902. soname_spec='${libname}${release}.so'
  5903. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  5904. shlibpath_var=LD_LIBRARY_PATH
  5905. sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  5906. sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  5907. ;;
  5908. sco3.2v5*)
  5909. version_type=osf
  5910. soname_spec='${libname}${release}.so$major'
  5911. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5912. shlibpath_var=LD_LIBRARY_PATH
  5913. ;;
  5914. solaris*)
  5915. version_type=linux
  5916. need_lib_prefix=no
  5917. need_version=no
  5918. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5919. soname_spec='${libname}${release}.so$major'
  5920. shlibpath_var=LD_LIBRARY_PATH
  5921. shlibpath_overrides_runpath=yes
  5922. hardcode_into_libs=yes
  5923. # ldd complains unless libraries are executable
  5924. postinstall_cmds='chmod +x $lib'
  5925. ;;
  5926. sunos4*)
  5927. version_type=sunos
  5928. library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  5929. finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  5930. shlibpath_var=LD_LIBRARY_PATH
  5931. shlibpath_overrides_runpath=yes
  5932. if test "$with_gnu_ld" = yes; then
  5933. need_lib_prefix=no
  5934. fi
  5935. need_version=yes
  5936. ;;
  5937. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  5938. version_type=linux
  5939. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5940. soname_spec='${libname}${release}.so$major'
  5941. shlibpath_var=LD_LIBRARY_PATH
  5942. case $host_vendor in
  5943. sni)
  5944. shlibpath_overrides_runpath=no
  5945. ;;
  5946. motorola)
  5947. need_lib_prefix=no
  5948. need_version=no
  5949. shlibpath_overrides_runpath=no
  5950. sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
  5951. ;;
  5952. esac
  5953. ;;
  5954. sysv4*MP*)
  5955. if test -d /usr/nec ;then
  5956. version_type=linux
  5957. library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  5958. soname_spec='$libname.so.$major'
  5959. shlibpath_var=LD_LIBRARY_PATH
  5960. fi
  5961. ;;
  5962. uts4*)
  5963. version_type=linux
  5964. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  5965. soname_spec='${libname}${release}.so$major'
  5966. shlibpath_var=LD_LIBRARY_PATH
  5967. ;;
  5968. *)
  5969. dynamic_linker=no
  5970. ;;
  5971. esac
  5972. AC_MSG_RESULT([$dynamic_linker])
  5973. test "$dynamic_linker" = no && can_build_shared=no
  5974. ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
  5975. # _LT_AC_TAGCONFIG
  5976. # ----------------
  5977. AC_DEFUN([_LT_AC_TAGCONFIG],
  5978. [AC_ARG_WITH([tags],
  5979. [AC_HELP_STRING([--with-tags=TAGS],
  5980. [include additional configurations @<:@CXX,GCJ@:>@])],
  5981. [tagnames="$withval"],
  5982. [tagnames="CXX,GCJ"
  5983. case $host_os in
  5984. mingw*|cygwin*) tagnames="$tagnames,RC" ;;
  5985. esac])
  5986. if test -f "$ltmain" && test -n "$tagnames"; then
  5987. if test ! -f "${ofile}"; then
  5988. AC_MSG_WARN([output file `$ofile' does not exist])
  5989. fi
  5990. if test -z "$LTCC"; then
  5991. eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
  5992. if test -z "$LTCC"; then
  5993. AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
  5994. else
  5995. AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
  5996. fi
  5997. fi
  5998. # Extract list of available tagged configurations in $ofile.
  5999. # Note that this assumes the entire list is on one line.
  6000. available_tags=`grep "^available_tags=" "${ofile}" | sed -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
  6001. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6002. for tagname in $tagnames; do
  6003. IFS="$lt_save_ifs"
  6004. # Check whether tagname contains only valid characters
  6005. case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
  6006. "") ;;
  6007. *) AC_MSG_ERROR([invalid tag name: $tagname])
  6008. ;;
  6009. esac
  6010. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
  6011. then
  6012. AC_MSG_ERROR([tag name \"$tagname\" already exists])
  6013. fi
  6014. # Update the list of available tags.
  6015. if test -n "$tagname"; then
  6016. echo appending configuration tag \"$tagname\" to $ofile
  6017. case $tagname in
  6018. CXX)
  6019. AC_LIBTOOL_LANG_CXX_CONFIG
  6020. ;;
  6021. GCJ)
  6022. AC_LIBTOOL_LANG_GCJ_CONFIG
  6023. ;;
  6024. RC)
  6025. AC_LIBTOOL_LANG_RC_CONFIG
  6026. ;;
  6027. *)
  6028. AC_MSG_ERROR([Unsupported tag name: $tagname])
  6029. ;;
  6030. esac
  6031. # Append the new tag name to the list of available tags.
  6032. available_tags="$available_tags $tagname"
  6033. fi
  6034. done
  6035. IFS="$lt_save_ifs"
  6036. # Now substitute the updated list of available tags.
  6037. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
  6038. mv "${ofile}T" "$ofile"
  6039. chmod +x "$ofile"
  6040. else
  6041. rm -f "${ofile}T"
  6042. AC_MSG_ERROR([unable to update list of available tagged configurations.])
  6043. fi
  6044. fi
  6045. ])# _LT_AC_TAGCONFIG
  6046. # AC_LIBTOOL_DLOPEN
  6047. # -----------------
  6048. # enable checks for dlopen support
  6049. AC_DEFUN([AC_LIBTOOL_DLOPEN],
  6050. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
  6051. ])# AC_LIBTOOL_DLOPEN
  6052. # AC_LIBTOOL_WIN32_DLL
  6053. # --------------------
  6054. # declare package support for building win32 dll's
  6055. AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
  6056. [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
  6057. ])# AC_LIBTOOL_WIN32_DLL
  6058. # AC_ENABLE_SHARED([DEFAULT])
  6059. # ---------------------------
  6060. # implement the --enable-shared flag
  6061. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6062. AC_DEFUN([AC_ENABLE_SHARED],
  6063. [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  6064. AC_ARG_ENABLE([shared],
  6065. [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
  6066. [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
  6067. [p=${PACKAGE-default}
  6068. case $enableval in
  6069. yes) enable_shared=yes ;;
  6070. no) enable_shared=no ;;
  6071. *)
  6072. enable_shared=no
  6073. # Look at the argument we got. We use all the common list separators.
  6074. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6075. for pkg in $enableval; do
  6076. IFS="$lt_save_ifs"
  6077. if test "X$pkg" = "X$p"; then
  6078. enable_shared=yes
  6079. fi
  6080. done
  6081. IFS="$lt_save_ifs"
  6082. ;;
  6083. esac],
  6084. [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
  6085. ])# AC_ENABLE_SHARED
  6086. # AC_DISABLE_SHARED
  6087. # -----------------
  6088. #- set the default shared flag to --disable-shared
  6089. AC_DEFUN([AC_DISABLE_SHARED],
  6090. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6091. AC_ENABLE_SHARED(no)
  6092. ])# AC_DISABLE_SHARED
  6093. # AC_ENABLE_STATIC([DEFAULT])
  6094. # ---------------------------
  6095. # implement the --enable-static flag
  6096. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6097. AC_DEFUN([AC_ENABLE_STATIC],
  6098. [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  6099. AC_ARG_ENABLE([static],
  6100. [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
  6101. [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
  6102. [p=${PACKAGE-default}
  6103. case $enableval in
  6104. yes) enable_static=yes ;;
  6105. no) enable_static=no ;;
  6106. *)
  6107. enable_static=no
  6108. # Look at the argument we got. We use all the common list separators.
  6109. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6110. for pkg in $enableval; do
  6111. IFS="$lt_save_ifs"
  6112. if test "X$pkg" = "X$p"; then
  6113. enable_static=yes
  6114. fi
  6115. done
  6116. IFS="$lt_save_ifs"
  6117. ;;
  6118. esac],
  6119. [enable_static=]AC_ENABLE_STATIC_DEFAULT)
  6120. ])# AC_ENABLE_STATIC
  6121. # AC_DISABLE_STATIC
  6122. # -----------------
  6123. # set the default static flag to --disable-static
  6124. AC_DEFUN([AC_DISABLE_STATIC],
  6125. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6126. AC_ENABLE_STATIC(no)
  6127. ])# AC_DISABLE_STATIC
  6128. # AC_ENABLE_FAST_INSTALL([DEFAULT])
  6129. # ---------------------------------
  6130. # implement the --enable-fast-install flag
  6131. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
  6132. AC_DEFUN([AC_ENABLE_FAST_INSTALL],
  6133. [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  6134. AC_ARG_ENABLE([fast-install],
  6135. [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
  6136. [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
  6137. [p=${PACKAGE-default}
  6138. case $enableval in
  6139. yes) enable_fast_install=yes ;;
  6140. no) enable_fast_install=no ;;
  6141. *)
  6142. enable_fast_install=no
  6143. # Look at the argument we got. We use all the common list separators.
  6144. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
  6145. for pkg in $enableval; do
  6146. IFS="$lt_save_ifs"
  6147. if test "X$pkg" = "X$p"; then
  6148. enable_fast_install=yes
  6149. fi
  6150. done
  6151. IFS="$lt_save_ifs"
  6152. ;;
  6153. esac],
  6154. [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
  6155. ])# AC_ENABLE_FAST_INSTALL
  6156. # AC_DISABLE_FAST_INSTALL
  6157. # -----------------------
  6158. # set the default to --disable-fast-install
  6159. AC_DEFUN([AC_DISABLE_FAST_INSTALL],
  6160. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6161. AC_ENABLE_FAST_INSTALL(no)
  6162. ])# AC_DISABLE_FAST_INSTALL
  6163. # AC_LIBTOOL_PICMODE([MODE])
  6164. # --------------------------
  6165. # implement the --with-pic flag
  6166. # MODE is either `yes' or `no'. If omitted, it defaults to `both'.
  6167. AC_DEFUN([AC_LIBTOOL_PICMODE],
  6168. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6169. pic_mode=ifelse($#,1,$1,default)
  6170. ])# AC_LIBTOOL_PICMODE
  6171. # AC_PATH_TOOL_PREFIX
  6172. # -------------------
  6173. # find a file program which can recognise shared library
  6174. AC_DEFUN([AC_PATH_TOOL_PREFIX],
  6175. [AC_MSG_CHECKING([for $1])
  6176. AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
  6177. [case $MAGIC_CMD in
  6178. [[\\/*] | ?:[\\/]*])
  6179. lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
  6180. ;;
  6181. *)
  6182. lt_save_MAGIC_CMD="$MAGIC_CMD"
  6183. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  6184. dnl $ac_dummy forces splitting on constant user-supplied paths.
  6185. dnl POSIX.2 word splitting is done only on the output of word expansions,
  6186. dnl not every word. This closes a longstanding sh security hole.
  6187. ac_dummy="ifelse([$2], , $PATH, [$2])"
  6188. for ac_dir in $ac_dummy; do
  6189. IFS="$lt_save_ifs"
  6190. test -z "$ac_dir" && ac_dir=.
  6191. if test -f $ac_dir/$1; then
  6192. lt_cv_path_MAGIC_CMD="$ac_dir/$1"
  6193. if test -n "$file_magic_test_file"; then
  6194. case $deplibs_check_method in
  6195. "file_magic "*)
  6196. file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  6197. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  6198. if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  6199. egrep "$file_magic_regex" > /dev/null; then
  6200. :
  6201. else
  6202. cat <<EOF 1>&2
  6203. *** Warning: the command libtool uses to detect shared libraries,
  6204. *** $file_magic_cmd, produces output that libtool cannot recognize.
  6205. *** The result is that libtool may fail to recognize shared libraries
  6206. *** as such. This will affect the creation of libtool libraries that
  6207. *** depend on shared libraries, but programs linked with such libtool
  6208. *** libraries will work regardless of this problem. Nevertheless, you
  6209. *** may want to report the problem to your system manager and/or to
  6210. *** bug-libtool@gnu.org
  6211. EOF
  6212. fi ;;
  6213. esac
  6214. fi
  6215. break
  6216. fi
  6217. done
  6218. IFS="$lt_save_ifs"
  6219. MAGIC_CMD="$lt_save_MAGIC_CMD"
  6220. ;;
  6221. esac])
  6222. MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
  6223. if test -n "$MAGIC_CMD"; then
  6224. AC_MSG_RESULT($MAGIC_CMD)
  6225. else
  6226. AC_MSG_RESULT(no)
  6227. fi
  6228. ])# AC_PATH_TOOL_PREFIX
  6229. # AC_PATH_MAGIC
  6230. # -------------
  6231. # find a file program which can recognise a shared library
  6232. AC_DEFUN([AC_PATH_MAGIC],
  6233. [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
  6234. if test -z "$lt_cv_path_MAGIC_CMD"; then
  6235. if test -n "$ac_tool_prefix"; then
  6236. AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
  6237. else
  6238. MAGIC_CMD=:
  6239. fi
  6240. fi
  6241. ])# AC_PATH_MAGIC
  6242. # AC_PROG_LD
  6243. # ----------
  6244. # find the path to the GNU or non-GNU linker
  6245. AC_DEFUN([AC_PROG_LD],
  6246. [AC_ARG_WITH([gnu-ld],
  6247. [AC_HELP_STRING([--with-gnu-ld],
  6248. [assume the C compiler uses GNU ld @<:@default=no@:>@])],
  6249. [test "$withval" = no || with_gnu_ld=yes],
  6250. [with_gnu_ld=no])
  6251. AC_REQUIRE([AC_PROG_CC])dnl
  6252. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  6253. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  6254. ac_prog=ld
  6255. if test "$GCC" = yes; then
  6256. # Check if gcc -print-prog-name=ld gives a path.
  6257. AC_MSG_CHECKING([for ld used by GCC])
  6258. case $host in
  6259. *-*-mingw*)
  6260. # gcc leaves a trailing carriage return which upsets mingw
  6261. ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
  6262. *)
  6263. ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
  6264. esac
  6265. case $ac_prog in
  6266. # Accept absolute paths.
  6267. [[\\/]]* | ?:[[\\/]]*)
  6268. re_direlt='/[[^/]][[^/]]*/\.\./'
  6269. # Canonicalize the path of ld
  6270. ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  6271. while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  6272. ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  6273. done
  6274. test -z "$LD" && LD="$ac_prog"
  6275. ;;
  6276. "")
  6277. # If it fails, then pretend we aren't using GCC.
  6278. ac_prog=ld
  6279. ;;
  6280. *)
  6281. # If it is relative, then search for the first ld in PATH.
  6282. with_gnu_ld=unknown
  6283. ;;
  6284. esac
  6285. elif test "$with_gnu_ld" = yes; then
  6286. AC_MSG_CHECKING([for GNU ld])
  6287. else
  6288. AC_MSG_CHECKING([for non-GNU ld])
  6289. fi
  6290. AC_CACHE_VAL(lt_cv_path_LD,
  6291. [if test -z "$LD"; then
  6292. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  6293. for ac_dir in $PATH; do
  6294. IFS="$lt_save_ifs"
  6295. test -z "$ac_dir" && ac_dir=.
  6296. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  6297. lt_cv_path_LD="$ac_dir/$ac_prog"
  6298. # Check to see if the program is GNU ld. I'd rather use --version,
  6299. # but apparently some GNU ld's only accept -v.
  6300. # Break only if it was the GNU/non-GNU ld that we prefer.
  6301. if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  6302. test "$with_gnu_ld" != no && break
  6303. else
  6304. test "$with_gnu_ld" != yes && break
  6305. fi
  6306. fi
  6307. done
  6308. IFS="$lt_save_ifs"
  6309. else
  6310. lt_cv_path_LD="$LD" # Let the user override the test with a path.
  6311. fi])
  6312. LD="$lt_cv_path_LD"
  6313. if test -n "$LD"; then
  6314. AC_MSG_RESULT($LD)
  6315. else
  6316. AC_MSG_RESULT(no)
  6317. fi
  6318. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  6319. AC_PROG_LD_GNU
  6320. ])# AC_PROG_LD
  6321. # AC_PROG_LD_GNU
  6322. # --------------
  6323. AC_DEFUN([AC_PROG_LD_GNU],
  6324. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
  6325. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  6326. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  6327. lt_cv_prog_gnu_ld=yes
  6328. else
  6329. lt_cv_prog_gnu_ld=no
  6330. fi])
  6331. with_gnu_ld=$lt_cv_prog_gnu_ld
  6332. ])# AC_PROG_LD_GNU
  6333. # AC_PROG_LD_RELOAD_FLAG
  6334. # ----------------------
  6335. # find reload flag for linker
  6336. # -- PORTME Some linkers may need a different reload flag.
  6337. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
  6338. [AC_CACHE_CHECK([for $LD option to reload object files],
  6339. lt_cv_ld_reload_flag,
  6340. [lt_cv_ld_reload_flag='-r'])
  6341. reload_flag=$lt_cv_ld_reload_flag
  6342. case $reload_flag in
  6343. "" | " "*) ;;
  6344. *) reload_flag=" $reload_flag" ;;
  6345. esac
  6346. reload_cmds='$LD$reload_flag -o $output$reload_objs'
  6347. ])# AC_PROG_LD_RELOAD_FLAG
  6348. # AC_DEPLIBS_CHECK_METHOD
  6349. # -----------------------
  6350. # how to check for library dependencies
  6351. # -- PORTME fill in with the dynamic library characteristics
  6352. AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
  6353. [AC_CACHE_CHECK([how to recognise dependant libraries],
  6354. lt_cv_deplibs_check_method,
  6355. [lt_cv_file_magic_cmd='$MAGIC_CMD'
  6356. lt_cv_file_magic_test_file=
  6357. lt_cv_deplibs_check_method='unknown'
  6358. # Need to set the preceding variable on all platforms that support
  6359. # interlibrary dependencies.
  6360. # 'none' -- dependencies not supported.
  6361. # `unknown' -- same as none, but documents that we really don't know.
  6362. # 'pass_all' -- all dependencies passed with no checks.
  6363. # 'test_compile' -- check by making test program.
  6364. # 'file_magic [[regex]]' -- check by looking for files in library path
  6365. # which responds to the $file_magic_cmd with a given egrep regex.
  6366. # If you have `file' or equivalent on your system and you're not sure
  6367. # whether `pass_all' will *always* work, you probably want this one.
  6368. case $host_os in
  6369. aix4* | aix5*)
  6370. lt_cv_deplibs_check_method=pass_all
  6371. ;;
  6372. beos*)
  6373. lt_cv_deplibs_check_method=pass_all
  6374. ;;
  6375. bsdi4*)
  6376. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
  6377. lt_cv_file_magic_cmd='/usr/bin/file -L'
  6378. lt_cv_file_magic_test_file=/shlib/libc.so
  6379. ;;
  6380. cygwin* | mingw* | pw32*)
  6381. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
  6382. lt_cv_file_magic_cmd='$OBJDUMP -f'
  6383. ;;
  6384. darwin* | rhapsody*)
  6385. lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
  6386. lt_cv_file_magic_cmd='/usr/bin/file -L'
  6387. case "$host_os" in
  6388. rhapsody* | darwin1.[[012]])
  6389. lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
  6390. ;;
  6391. *) # Darwin 1.3 on
  6392. lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
  6393. ;;
  6394. esac
  6395. ;;
  6396. freebsd*)
  6397. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  6398. case $host_cpu in
  6399. i*86 )
  6400. # Not sure whether the presence of OpenBSD here was a mistake.
  6401. # Let's accept both of them until this is cleared up.
  6402. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library'
  6403. lt_cv_file_magic_cmd=/usr/bin/file
  6404. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  6405. ;;
  6406. esac
  6407. else
  6408. lt_cv_deplibs_check_method=pass_all
  6409. fi
  6410. ;;
  6411. gnu*)
  6412. lt_cv_deplibs_check_method=pass_all
  6413. ;;
  6414. hpux10.20* | hpux11*)
  6415. lt_cv_file_magic_cmd=/usr/bin/file
  6416. if test "$host_cpu" = ia64; then
  6417. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
  6418. lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
  6419. else
  6420. lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
  6421. lt_cv_file_magic_test_file=/usr/lib/libc.sl
  6422. fi
  6423. ;;
  6424. irix5* | irix6* | nonstopux*)
  6425. case $host_os in
  6426. irix5* | nonstopux*)
  6427. # this will be overridden with pass_all, but let us keep it just in case
  6428. lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
  6429. ;;
  6430. *)
  6431. case $LD in
  6432. *-32|*"-32 ") libmagic=32-bit;;
  6433. *-n32|*"-n32 ") libmagic=N32;;
  6434. *-64|*"-64 ") libmagic=64-bit;;
  6435. *) libmagic=never-match;;
  6436. esac
  6437. # this will be overridden with pass_all, but let us keep it just in case
  6438. lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1"
  6439. ;;
  6440. esac
  6441. lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  6442. lt_cv_deplibs_check_method=pass_all
  6443. ;;
  6444. # This must be Linux ELF.
  6445. linux*)
  6446. case $host_cpu in
  6447. alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh* | x86_64* )
  6448. lt_cv_deplibs_check_method=pass_all ;;
  6449. *)
  6450. # glibc up to 2.1.1 does not perform some relocations on ARM
  6451. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;;
  6452. esac
  6453. lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  6454. ;;
  6455. netbsd*)
  6456. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  6457. lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$'
  6458. else
  6459. lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
  6460. fi
  6461. ;;
  6462. newos6*)
  6463. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
  6464. lt_cv_file_magic_cmd=/usr/bin/file
  6465. lt_cv_file_magic_test_file=/usr/lib/libnls.so
  6466. ;;
  6467. nto-qnx)
  6468. lt_cv_deplibs_check_method=unknown
  6469. ;;
  6470. openbsd*)
  6471. lt_cv_file_magic_cmd=/usr/bin/file
  6472. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
  6473. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  6474. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
  6475. else
  6476. lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
  6477. fi
  6478. ;;
  6479. osf3* | osf4* | osf5*)
  6480. # this will be overridden with pass_all, but let us keep it just in case
  6481. lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
  6482. lt_cv_file_magic_test_file=/shlib/libc.so
  6483. lt_cv_deplibs_check_method=pass_all
  6484. ;;
  6485. sco3.2v5*)
  6486. lt_cv_deplibs_check_method=pass_all
  6487. ;;
  6488. solaris*)
  6489. lt_cv_deplibs_check_method=pass_all
  6490. lt_cv_file_magic_test_file=/lib/libc.so
  6491. ;;
  6492. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  6493. case $host_vendor in
  6494. motorola)
  6495. 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]]'
  6496. lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
  6497. ;;
  6498. ncr)
  6499. lt_cv_deplibs_check_method=pass_all
  6500. ;;
  6501. sequent)
  6502. lt_cv_file_magic_cmd='/bin/file'
  6503. lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
  6504. ;;
  6505. sni)
  6506. lt_cv_file_magic_cmd='/bin/file'
  6507. lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
  6508. lt_cv_file_magic_test_file=/lib/libc.so
  6509. ;;
  6510. esac
  6511. ;;
  6512. sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
  6513. lt_cv_deplibs_check_method=pass_all
  6514. ;;
  6515. esac
  6516. ])
  6517. file_magic_cmd=$lt_cv_file_magic_cmd
  6518. deplibs_check_method=$lt_cv_deplibs_check_method
  6519. test -z "$deplibs_check_method" && deplibs_check_method=unknown
  6520. ])# AC_DEPLIBS_CHECK_METHOD
  6521. # AC_PROG_NM
  6522. # ----------
  6523. # find the path to a BSD-compatible name lister
  6524. AC_DEFUN([AC_PROG_NM],
  6525. [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
  6526. [if test -n "$NM"; then
  6527. # Let the user override the test.
  6528. lt_cv_path_NM="$NM"
  6529. else
  6530. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  6531. for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  6532. IFS="$lt_save_ifs"
  6533. test -z "$ac_dir" && ac_dir=.
  6534. tmp_nm="$ac_dir/${ac_tool_prefix}nm"
  6535. if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
  6536. # Check to see if the nm accepts a BSD-compat flag.
  6537. # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  6538. # nm: unknown option "B" ignored
  6539. # Tru64's nm complains that /dev/null is an invalid object file
  6540. if ("$tmp_nm" -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
  6541. lt_cv_path_NM="$tmp_nm -B"
  6542. break
  6543. elif ("$tmp_nm" -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  6544. lt_cv_path_NM="$tmp_nm -p"
  6545. break
  6546. else
  6547. lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
  6548. continue # so that we can try to find one that supports BSD flags
  6549. fi
  6550. fi
  6551. done
  6552. IFS="$lt_save_ifs"
  6553. test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
  6554. fi])
  6555. NM="$lt_cv_path_NM"
  6556. ])# AC_PROG_NM
  6557. # AC_CHECK_LIBM
  6558. # -------------
  6559. # check for math library
  6560. AC_DEFUN([AC_CHECK_LIBM],
  6561. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  6562. LIBM=
  6563. case $host in
  6564. *-*-beos* | *-*-cygwin* | *-*-pw32*)
  6565. # These system don't have libm
  6566. ;;
  6567. *-ncr-sysv4.3*)
  6568. AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  6569. AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  6570. ;;
  6571. *)
  6572. AC_CHECK_LIB(m, main, LIBM="-lm")
  6573. ;;
  6574. esac
  6575. ])# AC_CHECK_LIBM
  6576. # AC_LIBLTDL_CONVENIENCE([DIRECTORY])
  6577. # -----------------------------------
  6578. # sets LIBLTDL to the link flags for the libltdl convenience library and
  6579. # LTDLINCL to the include flags for the libltdl header and adds
  6580. # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
  6581. # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
  6582. # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
  6583. # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
  6584. # '${top_srcdir}/' (note the single quotes!). If your package is not
  6585. # flat and you're not using automake, define top_builddir and
  6586. # top_srcdir appropriately in the Makefiles.
  6587. AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
  6588. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6589. case $enable_ltdl_convenience in
  6590. no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  6591. "") enable_ltdl_convenience=yes
  6592. ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  6593. esac
  6594. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  6595. LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  6596. # For backwards non-gettext consistent compatibility...
  6597. INCLTDL="$LTDLINCL"
  6598. ])# AC_LIBLTDL_CONVENIENCE
  6599. # AC_LIBLTDL_INSTALLABLE([DIRECTORY])
  6600. # -----------------------------------
  6601. # sets LIBLTDL to the link flags for the libltdl installable library and
  6602. # LTDLINCL to the include flags for the libltdl header and adds
  6603. # --enable-ltdl-install to the configure arguments. Note that LIBLTDL
  6604. # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
  6605. # DIRECTORY is not provided and an installed libltdl is not found, it is
  6606. # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
  6607. # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
  6608. # quotes!). If your package is not flat and you're not using automake,
  6609. # define top_builddir and top_srcdir appropriately in the Makefiles.
  6610. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  6611. AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
  6612. [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  6613. AC_CHECK_LIB(ltdl, main,
  6614. [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  6615. [if test x"$enable_ltdl_install" = xno; then
  6616. AC_MSG_WARN([libltdl not installed, but installation disabled])
  6617. else
  6618. enable_ltdl_install=yes
  6619. fi
  6620. ])
  6621. if test x"$enable_ltdl_install" = x"yes"; then
  6622. ac_configure_args="$ac_configure_args --enable-ltdl-install"
  6623. LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  6624. LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  6625. else
  6626. ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  6627. LIBLTDL="-lltdl"
  6628. LTDLINCL=
  6629. fi
  6630. # For backwards non-gettext consistent compatibility...
  6631. INCLTDL="$LTDLINCL"
  6632. ])# AC_LIBLTDL_INSTALLABLE
  6633. # If this macro is not defined by Autoconf, define it here.
  6634. ifdef([AC_PROVIDE_IFELSE],
  6635. [],
  6636. [define([AC_PROVIDE_IFELSE],
  6637. [ifdef([AC_PROVIDE_$1],
  6638. [$2], [$3])])])
  6639. # AC_LIBTOOL_CXX
  6640. # --------------
  6641. # enable support for C++ libraries
  6642. AC_DEFUN([AC_LIBTOOL_CXX],
  6643. [AC_REQUIRE([_LT_AC_LANG_CXX])
  6644. ])# AC_LIBTOOL_CXX
  6645. # _LT_AC_LANG_CXX
  6646. # ---------------
  6647. AC_DEFUN([_LT_AC_LANG_CXX],
  6648. [AC_REQUIRE([AC_PROG_CXX])
  6649. AC_REQUIRE([AC_PROG_CXXCPP])
  6650. ])# _LT_AC_LANG_CXX
  6651. # AC_LIBTOOL_GCJ
  6652. # --------------
  6653. # enable support for GCJ libraries
  6654. AC_DEFUN([AC_LIBTOOL_GCJ],
  6655. [AC_REQUIRE([_LT_AC_LANG_GCJ])
  6656. ])# AC_LIBTOOL_GCJ
  6657. # _LT_AC_LANG_GCJ
  6658. # ---------------
  6659. AC_DEFUN([_LT_AC_LANG_GCJ],
  6660. [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
  6661. [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
  6662. [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
  6663. [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
  6664. [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
  6665. [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
  6666. ])# _LT_AC_LANG_GCJ
  6667. # AC_LIBTOOL_RC
  6668. # --------------
  6669. # enable support for Windows resource files
  6670. AC_DEFUN([AC_LIBTOOL_RC],
  6671. [AC_REQUIRE([AC_PROG_RC])
  6672. ])# AC_LIBTOOL_RC
  6673. # AC_LIBTOOL_LANG_C_CONFIG
  6674. # ------------------------
  6675. # Ensure that the configuration vars for the C compiler are
  6676. # suitably defined. Those variables are subsequently used by
  6677. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  6678. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
  6679. AC_DEFUN([_LT_AC_LANG_C_CONFIG],
  6680. [lt_save_CC="$CC"
  6681. AC_LANG_PUSH(C)
  6682. # Source file extension for C test sources.
  6683. ac_ext=c
  6684. # Object file extension for compiled C test sources.
  6685. objext=o
  6686. _LT_AC_TAGVAR(objext, $1)=$objext
  6687. # Code to be used in simple compile tests
  6688. lt_simple_compile_test_code="int some_variable = 0;"
  6689. # Code to be used in simple link tests
  6690. lt_simple_link_test_code='main(){return(0);}'
  6691. _LT_AC_SYS_COMPILER
  6692. #
  6693. # Check for any special shared library compilation flags.
  6694. #
  6695. _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
  6696. if test "$GCC" = no; then
  6697. case $host_os in
  6698. sco3.2v5*)
  6699. _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
  6700. ;;
  6701. esac
  6702. fi
  6703. if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
  6704. AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
  6705. if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then :
  6706. else
  6707. AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
  6708. _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
  6709. fi
  6710. fi
  6711. #
  6712. # Check to make sure the static flag actually works.
  6713. #
  6714. AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
  6715. _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
  6716. $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
  6717. [],
  6718. [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
  6719. ## CAVEAT EMPTOR:
  6720. ## There is no encapsulation within the following macros, do not change
  6721. ## the running order or otherwise move them around unless you know exactly
  6722. ## what you are doing...
  6723. AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
  6724. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  6725. AC_LIBTOOL_PROG_CC_C_O($1)
  6726. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  6727. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  6728. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  6729. AC_LIBTOOL_SYS_LIB_STRIP
  6730. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  6731. AC_LIBTOOL_DLOPEN_SELF($1)
  6732. # Report which librarie types wil actually be built
  6733. AC_MSG_CHECKING([if libtool supports shared libraries])
  6734. AC_MSG_RESULT([$can_build_shared])
  6735. AC_MSG_CHECKING([whether to build shared libraries])
  6736. test "$can_build_shared" = "no" && enable_shared=no
  6737. # On AIX, shared libraries and static libraries use the same namespace, and
  6738. # are all built from PIC.
  6739. case "$host_os" in
  6740. aix3*)
  6741. test "$enable_shared" = yes && enable_static=no
  6742. if test -n "$RANLIB"; then
  6743. archive_cmds="$archive_cmds~\$RANLIB \$lib"
  6744. postinstall_cmds='$RANLIB $lib'
  6745. fi
  6746. ;;
  6747. aix4*)
  6748. if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
  6749. test "$enable_shared" = yes && enable_static=no
  6750. fi
  6751. ;;
  6752. esac
  6753. AC_MSG_RESULT([$enable_shared])
  6754. AC_MSG_CHECKING([whether to build static libraries])
  6755. # Make sure either enable_shared or enable_static is yes.
  6756. test "$enable_shared" = yes || enable_static=yes
  6757. AC_MSG_RESULT([$enable_static])
  6758. AC_LIBTOOL_CONFIG($1)
  6759. AC_LANG_POP
  6760. CC="$lt_save_CC"
  6761. ])# AC_LIBTOOL_LANG_C_CONFIG
  6762. # AC_LIBTOOL_LANG_CXX_CONFIG
  6763. # --------------------------
  6764. # Ensure that the configuration vars for the C compiler are
  6765. # suitably defined. Those variables are subsequently used by
  6766. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  6767. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
  6768. AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
  6769. [AC_LANG_PUSH(C++)
  6770. AC_REQUIRE([AC_PROG_CXX])
  6771. AC_REQUIRE([AC_PROG_CXXCPP])
  6772. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  6773. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  6774. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  6775. _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
  6776. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
  6777. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  6778. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  6779. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  6780. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  6781. _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  6782. _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
  6783. _LT_AC_TAGVAR(no_undefined_flag, $1)=
  6784. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  6785. # Dependencies to place before and after the object being linked:
  6786. _LT_AC_TAGVAR(predep_objects, $1)=
  6787. _LT_AC_TAGVAR(postdep_objects, $1)=
  6788. _LT_AC_TAGVAR(predeps, $1)=
  6789. _LT_AC_TAGVAR(postdeps, $1)=
  6790. _LT_AC_TAGVAR(compiler_lib_search_path, $1)=
  6791. # Source file extension for C test sources.
  6792. ac_ext=cc
  6793. # Object file extension for compiled C test sources.
  6794. objext=o
  6795. _LT_AC_TAGVAR(objext, $1)=$objext
  6796. # Code to be used in simple compile tests
  6797. lt_simple_compile_test_code="int some_variable = 0;"
  6798. # Code to be used in simple link tests
  6799. lt_simple_link_test_code='int main(int char *[]) { return(0); }'
  6800. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  6801. _LT_AC_SYS_COMPILER
  6802. # Allow CC to be a program name with arguments.
  6803. lt_save_CC="$CC"
  6804. CC=${CXX-"c++"}
  6805. set dummy $CC
  6806. compiler="[$]2"
  6807. _LT_AC_TAGVAR(compiler, $1)=$CC
  6808. cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
  6809. # We don't want -fno-exception wen compiling C++ code, so set the
  6810. # no_builtin_flag separately
  6811. if test "$GXX" = yes; then
  6812. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  6813. else
  6814. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  6815. fi
  6816. if test "$GXX" = yes; then
  6817. # Set up default GNU C++ configuration
  6818. # Check if GNU C++ uses GNU ld as the underlying linker, since the
  6819. # archiving commands below assume that GNU ld is being used.
  6820. if eval "`$CC -print-prog-name=ld` --version 2>&1" | \
  6821. egrep 'GNU ld' > /dev/null; then
  6822. with_gnu_ld=yes
  6823. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  6824. _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'
  6825. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  6826. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  6827. # If archive_cmds runs LD, not CC, wlarc should be empty
  6828. # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
  6829. # investigate it a little bit more. (MM)
  6830. wlarc='${wl}'
  6831. # ancient GNU ld didn't support --whole-archive et. al.
  6832. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
  6833. egrep 'no-whole-archive' > /dev/null; then
  6834. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  6835. else
  6836. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  6837. fi
  6838. else
  6839. with_gnu_ld=no
  6840. wlarc=
  6841. # A generic and very simple default shared library creation
  6842. # command for GNU C++ for the case where it uses the native
  6843. # linker, instead of GNU ld. If possible, this setting should
  6844. # overridden to take advantage of the native linker features on
  6845. # the platform it is being used on.
  6846. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
  6847. fi
  6848. # Commands to make compiler produce verbose output that lists
  6849. # what "hidden" libraries, object files and flags are used when
  6850. # linking a shared library.
  6851. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
  6852. else
  6853. GXX=no
  6854. with_gnu_ld=no
  6855. wlarc=
  6856. fi
  6857. # PORTME: fill in a description of your system's C++ link characteristics
  6858. AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  6859. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  6860. case $host_os in
  6861. aix3*)
  6862. # FIXME: insert proper C++ library support
  6863. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  6864. ;;
  6865. aix4* | aix5*)
  6866. if test "$host_cpu" = ia64; then
  6867. # On IA64, the linker does run time linking by default, so we don't
  6868. # have to do anything special.
  6869. aix_use_runtimelinking=no
  6870. exp_sym_flag='-Bexport'
  6871. no_entry_flag=""
  6872. else
  6873. # KDE requires run time linking. Make it the default.
  6874. aix_use_runtimelinking=yes
  6875. exp_sym_flag='-bexport'
  6876. no_entry_flag='-bnoentry'
  6877. fi
  6878. # When large executables or shared objects are built, AIX ld can
  6879. # have problems creating the table of contents. If linking a library
  6880. # or program results in "error TOC overflow" add -mminimal-toc to
  6881. # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
  6882. # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  6883. _LT_AC_TAGVAR(archive_cmds, $1)=''
  6884. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  6885. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
  6886. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  6887. if test "$GXX" = yes; then
  6888. case $host_os in aix4.[012]|aix4.[012].*)
  6889. # We only want to do this on AIX 4.2 and lower, the check
  6890. # below for broken collect2 doesn't work under 4.3+
  6891. collect2name=`${CC} -print-prog-name=collect2`
  6892. if test -f "$collect2name" && \
  6893. strings "$collect2name" | grep resolve_lib_name >/dev/null
  6894. then
  6895. # We have reworked collect2
  6896. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  6897. else
  6898. # We have old collect2
  6899. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
  6900. # It fails to find uninstalled libraries when the uninstalled
  6901. # path is not listed in the libpath. Setting hardcode_minus_L
  6902. # to unsupported forces relinking
  6903. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  6904. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  6905. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  6906. fi
  6907. esac
  6908. shared_flag='-shared'
  6909. else
  6910. # not using gcc
  6911. if test "$host_cpu" = ia64; then
  6912. # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  6913. # chokes on -Wl,-G. The following line is correct:
  6914. shared_flag='-G'
  6915. else
  6916. if test "$aix_use_runtimelinking" = yes; then
  6917. shared_flag='-qmkshrobj ${wl}-G'
  6918. else
  6919. shared_flag='-qmkshrobj'
  6920. fi
  6921. fi
  6922. fi
  6923. # Let the compiler handle the export list.
  6924. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  6925. if test "$aix_use_runtimelinking" = yes; then
  6926. # Warning - without using the other runtime loading flags (-brtl),
  6927. # -berok will link without error, but may produce a broken library.
  6928. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
  6929. # Determine the default libpath from the value encoded in an empty executable.
  6930. _LT_AC_SYS_LIBPATH_AIX
  6931. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  6932. _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
  6933. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $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"
  6934. else
  6935. if test "$host_cpu" = ia64; then
  6936. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  6937. _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  6938. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
  6939. else
  6940. # Determine the default libpath from the value encoded in an empty executable.
  6941. _LT_AC_SYS_LIBPATH_AIX
  6942. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  6943. # Warning - without using the other run time loading flags,
  6944. # -berok will link without error, but may produce a broken library.
  6945. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  6946. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  6947. # -bexpall does not export symbols beginning with underscore (_)
  6948. _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  6949. # Exported symbols can be pulled into shared objects from archives
  6950. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
  6951. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  6952. # This is similar to how AIX traditionally builds it's shared libraries.
  6953. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  6954. fi
  6955. fi
  6956. ;;
  6957. chorus*)
  6958. case $cc_basename in
  6959. *)
  6960. # FIXME: insert proper C++ library support
  6961. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  6962. ;;
  6963. esac
  6964. ;;
  6965. dgux*)
  6966. case $cc_basename in
  6967. ec++)
  6968. # FIXME: insert proper C++ library support
  6969. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  6970. ;;
  6971. ghcx)
  6972. # Green Hills C++ Compiler
  6973. # FIXME: insert proper C++ library support
  6974. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  6975. ;;
  6976. *)
  6977. # FIXME: insert proper C++ library support
  6978. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  6979. ;;
  6980. esac
  6981. ;;
  6982. freebsd[12]*)
  6983. # C++ shared libraries reported to be fairly broken before switch to ELF
  6984. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  6985. ;;
  6986. freebsd-elf*)
  6987. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  6988. ;;
  6989. freebsd*)
  6990. # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
  6991. # conventions
  6992. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  6993. ;;
  6994. gnu*)
  6995. ;;
  6996. hpux*)
  6997. if test $with_gnu_ld = no; then
  6998. if test "$host_cpu" = ia64; then
  6999. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  7000. else
  7001. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  7002. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7003. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  7004. fi
  7005. fi
  7006. if test "$host_cpu" = ia64; then
  7007. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  7008. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  7009. else
  7010. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  7011. fi
  7012. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
  7013. # but as the default
  7014. # location of the library.
  7015. case $cc_basename in
  7016. CC)
  7017. # FIXME: insert proper C++ library support
  7018. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7019. ;;
  7020. aCC)
  7021. case $host_os in
  7022. hpux9*)
  7023. _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'
  7024. ;;
  7025. *)
  7026. if test "$host_cpu" = ia64; then
  7027. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
  7028. else
  7029. _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'
  7030. fi
  7031. ;;
  7032. esac
  7033. # Commands to make compiler produce verbose output that lists
  7034. # what "hidden" libraries, object files and flags are used when
  7035. # linking a shared library.
  7036. #
  7037. # There doesn't appear to be a way to prevent this compiler from
  7038. # explicitly linking system object files so we need to strip them
  7039. # from the output so that they don't get included in the library
  7040. # dependencies.
  7041. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | egrep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  7042. ;;
  7043. *)
  7044. if test "$GXX" = yes; then
  7045. if test $with_gnu_ld = no; then
  7046. case $host_os in
  7047. hpux9*)
  7048. _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'
  7049. ;;
  7050. *)
  7051. if test "$host_cpu" = ia64; then
  7052. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
  7053. else
  7054. _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'
  7055. fi
  7056. ;;
  7057. esac
  7058. fi
  7059. else
  7060. # FIXME: insert proper C++ library support
  7061. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7062. fi
  7063. ;;
  7064. esac
  7065. ;;
  7066. irix5* | irix6*)
  7067. case $cc_basename in
  7068. CC)
  7069. # SGI C++
  7070. _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 ${objdir}/so_locations -o $lib'
  7071. # Archives containing C++ object files must be created using
  7072. # "CC -ar", where "CC" is the IRIX C++ compiler. This is
  7073. # necessary to make sure instantiated templates are included
  7074. # in the archive.
  7075. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
  7076. ;;
  7077. *)
  7078. if test "$GXX" = yes; then
  7079. if test "$with_gnu_ld" = no; then
  7080. _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}${objdir}/so_locations -o $lib'
  7081. else
  7082. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  7083. fi
  7084. fi
  7085. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  7086. ;;
  7087. esac
  7088. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  7089. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7090. ;;
  7091. linux*)
  7092. case $cc_basename in
  7093. KCC)
  7094. # Kuck and Associates, Inc. (KAI) C++ Compiler
  7095. # KCC will only create a shared library if the output file
  7096. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  7097. # to its proper name (with version) after linking.
  7098. _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  7099. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
  7100. # Commands to make compiler produce verbose output that lists
  7101. # what "hidden" libraries, object files and flags are used when
  7102. # linking a shared library.
  7103. #
  7104. # There doesn't appear to be a way to prevent this compiler from
  7105. # explicitly linking system object files so we need to strip them
  7106. # from the output so that they don't get included in the library
  7107. # dependencies.
  7108. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest.so 2>&1 | egrep "ld"`; rm -f libconftest.so; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  7109. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
  7110. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  7111. # Archives containing C++ object files must be created using
  7112. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  7113. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  7114. ;;
  7115. cxx)
  7116. # Compaq C++
  7117. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
  7118. _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'
  7119. runpath_var=LD_RUN_PATH
  7120. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  7121. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7122. # Commands to make compiler produce verbose output that lists
  7123. # what "hidden" libraries, object files and flags are used when
  7124. # linking a shared library.
  7125. #
  7126. # There doesn't appear to be a way to prevent this compiler from
  7127. # explicitly linking system object files so we need to strip them
  7128. # from the output so that they don't get included in the library
  7129. # dependencies.
  7130. 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'
  7131. ;;
  7132. esac
  7133. ;;
  7134. lynxos*)
  7135. # FIXME: insert proper C++ library support
  7136. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7137. ;;
  7138. m88k*)
  7139. # FIXME: insert proper C++ library support
  7140. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7141. ;;
  7142. mvs*)
  7143. case $cc_basename in
  7144. cxx)
  7145. # FIXME: insert proper C++ library support
  7146. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7147. ;;
  7148. *)
  7149. # FIXME: insert proper C++ library support
  7150. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7151. ;;
  7152. esac
  7153. ;;
  7154. netbsd*)
  7155. # NetBSD uses g++ - do we need to do anything?
  7156. ;;
  7157. osf3*)
  7158. case $cc_basename in
  7159. KCC)
  7160. # Kuck and Associates, Inc. (KAI) C++ Compiler
  7161. # KCC will only create a shared library if the output file
  7162. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  7163. # to its proper name (with version) after linking.
  7164. _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  7165. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  7166. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7167. # Archives containing C++ object files must be created using
  7168. # "CC -Bstatic", where "CC" is the KAI C++ compiler.
  7169. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
  7170. ;;
  7171. RCC)
  7172. # Rational C++ 2.4.1
  7173. # FIXME: insert proper C++ library support
  7174. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7175. ;;
  7176. cxx)
  7177. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  7178. _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 ${objdir}/so_locations -o $lib'
  7179. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  7180. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7181. # Commands to make compiler produce verbose output that lists
  7182. # what "hidden" libraries, object files and flags are used when
  7183. # linking a shared library.
  7184. #
  7185. # There doesn't appear to be a way to prevent this compiler from
  7186. # explicitly linking system object files so we need to strip them
  7187. # from the output so that they don't get included in the library
  7188. # dependencies.
  7189. 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'
  7190. ;;
  7191. *)
  7192. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  7193. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  7194. _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}${objdir}/so_locations -o $lib'
  7195. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  7196. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7197. # Commands to make compiler produce verbose output that lists
  7198. # what "hidden" libraries, object files and flags are used when
  7199. # linking a shared library.
  7200. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
  7201. else
  7202. # FIXME: insert proper C++ library support
  7203. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7204. fi
  7205. ;;
  7206. esac
  7207. ;;
  7208. osf4* | osf5*)
  7209. case $cc_basename in
  7210. KCC)
  7211. # Kuck and Associates, Inc. (KAI) C++ Compiler
  7212. # KCC will only create a shared library if the output file
  7213. # ends with ".so" (or ".sl" for HP-UX), so rename the library
  7214. # to its proper name (with version) after linking.
  7215. _LT_AC_TAGVAR(archive_cmds, $1)='templib=`echo $lib | sed -e "s/\.so\..*/\.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
  7216. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  7217. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7218. # Archives containing C++ object files must be created using
  7219. # the KAI C++ compiler.
  7220. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
  7221. ;;
  7222. RCC)
  7223. # Rational C++ 2.4.1
  7224. # FIXME: insert proper C++ library support
  7225. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7226. ;;
  7227. cxx)
  7228. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  7229. _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 ${objdir}/so_locations -o $lib'
  7230. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done~
  7231. echo "-hidden">> $lib.exp~
  7232. $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 $objdir/so_locations -o $lib~
  7233. $rm $lib.exp'
  7234. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  7235. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7236. # Commands to make compiler produce verbose output that lists
  7237. # what "hidden" libraries, object files and flags are used when
  7238. # linking a shared library.
  7239. #
  7240. # There doesn't appear to be a way to prevent this compiler from
  7241. # explicitly linking system object files so we need to strip them
  7242. # from the output so that they don't get included in the library
  7243. # dependencies.
  7244. 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'
  7245. ;;
  7246. *)
  7247. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  7248. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  7249. _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}${objdir}/so_locations -o $lib'
  7250. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  7251. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  7252. # Commands to make compiler produce verbose output that lists
  7253. # what "hidden" libraries, object files and flags are used when
  7254. # linking a shared library.
  7255. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
  7256. else
  7257. # FIXME: insert proper C++ library support
  7258. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7259. fi
  7260. ;;
  7261. esac
  7262. ;;
  7263. psos*)
  7264. # FIXME: insert proper C++ library support
  7265. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7266. ;;
  7267. sco*)
  7268. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7269. case $cc_basename in
  7270. CC)
  7271. # FIXME: insert proper C++ library support
  7272. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7273. ;;
  7274. *)
  7275. # FIXME: insert proper C++ library support
  7276. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7277. ;;
  7278. esac
  7279. ;;
  7280. sunos4*)
  7281. case $cc_basename in
  7282. CC)
  7283. # Sun C++ 4.x
  7284. # FIXME: insert proper C++ library support
  7285. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7286. ;;
  7287. lcc)
  7288. # Lucid
  7289. # FIXME: insert proper C++ library support
  7290. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7291. ;;
  7292. *)
  7293. # FIXME: insert proper C++ library support
  7294. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7295. ;;
  7296. esac
  7297. ;;
  7298. solaris*)
  7299. case $cc_basename in
  7300. CC)
  7301. # Sun C++ 4.2, 5.x and Centerline C++
  7302. _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
  7303. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
  7304. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  7305. $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
  7306. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  7307. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  7308. case $host_os in
  7309. solaris2.[0-5] | solaris2.[0-5].*) ;;
  7310. *)
  7311. # The C++ compiler is used as linker so we must use $wl
  7312. # flag to pass the commands to the underlying system
  7313. # linker.
  7314. # Supported since Solaris 2.6 (maybe 2.5.1?)
  7315. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
  7316. ;;
  7317. esac
  7318. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  7319. # Commands to make compiler produce verbose output that lists
  7320. # what "hidden" libraries, object files and flags are used when
  7321. # linking a shared library.
  7322. #
  7323. # There doesn't appear to be a way to prevent this compiler from
  7324. # explicitly linking system object files so we need to strip them
  7325. # from the output so that they don't get included in the library
  7326. # dependencies.
  7327. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep "\-R|\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
  7328. # Archives containing C++ object files must be created using
  7329. # "CC -xar", where "CC" is the Sun C++ compiler. This is
  7330. # necessary to make sure instantiated templates are included
  7331. # in the archive.
  7332. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
  7333. ;;
  7334. gcx)
  7335. # Green Hills C++ Compiler
  7336. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
  7337. # The C++ compiler must be used to create the archive.
  7338. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
  7339. ;;
  7340. *)
  7341. # GNU C++ compiler with Solaris linker
  7342. if test "$GXX" = yes && test "$with_gnu_ld" = no; then
  7343. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
  7344. if $CC --version | egrep -v '^2\.7' > /dev/null; then
  7345. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
  7346. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  7347. $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
  7348. # Commands to make compiler produce verbose output that lists
  7349. # what "hidden" libraries, object files and flags are used when
  7350. # linking a shared library.
  7351. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
  7352. else
  7353. # g++ 2.7 appears to require `-G' NOT `-shared' on this
  7354. # platform.
  7355. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $linker_flags ${wl}-h $wl$soname -o $lib'
  7356. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  7357. $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags~$rm $lib.exp'
  7358. # Commands to make compiler produce verbose output that lists
  7359. # what "hidden" libraries, object files and flags are used when
  7360. # linking a shared library.
  7361. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | egrep \"\-L\""
  7362. fi
  7363. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
  7364. fi
  7365. ;;
  7366. esac
  7367. ;;
  7368. sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
  7369. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7370. ;;
  7371. tandem*)
  7372. case $cc_basename in
  7373. NCC)
  7374. # NonStop-UX NCC 3.20
  7375. # FIXME: insert proper C++ library support
  7376. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7377. ;;
  7378. *)
  7379. # FIXME: insert proper C++ library support
  7380. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7381. ;;
  7382. esac
  7383. ;;
  7384. vxworks*)
  7385. # FIXME: insert proper C++ library support
  7386. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7387. ;;
  7388. *)
  7389. # FIXME: insert proper C++ library support
  7390. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  7391. ;;
  7392. esac
  7393. AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
  7394. test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  7395. # Figure out "hidden" C++ library dependencies from verbose
  7396. # compiler output whening linking a shared library.
  7397. cat > conftest.$ac_ext <<EOF
  7398. class Foo
  7399. {
  7400. public:
  7401. Foo (void) { a = 0; }
  7402. private:
  7403. int a;
  7404. };
  7405. EOF
  7406. if AC_TRY_EVAL(ac_compile); then
  7407. # Parse the compiler output and extract the necessary
  7408. # objects, libraries and library flags.
  7409. # Sentinel used to keep track of whether or not we are before
  7410. # the conftest object file.
  7411. pre_test_object_deps_done=no
  7412. # The `*' in the case matches for architectures that use `case' in
  7413. # $output_verbose_cmd can trigger glob expansion during the loop
  7414. # eval without this substitution.
  7415. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
  7416. for p in `eval $output_verbose_link_cmd`; do
  7417. case $p in
  7418. -L* | -R* | -l*)
  7419. # Some compilers place space between "-{L,R}" and the path.
  7420. # Remove the space.
  7421. if test $p = "-L" \
  7422. || test $p = "-R"; then
  7423. prev=$p
  7424. continue
  7425. else
  7426. prev=
  7427. fi
  7428. if test "$pre_test_object_deps_done" = no; then
  7429. case $p in
  7430. -L* | -R*)
  7431. # Internal compiler library paths should come after those
  7432. # provided the user. The postdeps already come after the
  7433. # user supplied libs so there is no need to process them.
  7434. if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
  7435. _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
  7436. else
  7437. _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
  7438. fi
  7439. ;;
  7440. # The "-l" case would never come before the object being
  7441. # linked, so don't bother handling this case.
  7442. esac
  7443. else
  7444. if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
  7445. _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
  7446. else
  7447. _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
  7448. fi
  7449. fi
  7450. ;;
  7451. *.$objext|*.$libext)
  7452. # This assumes that the test object file only shows up
  7453. # once in the compiler output.
  7454. if test "$p" = "conftest.$objext"; then
  7455. pre_test_object_deps_done=yes
  7456. continue
  7457. fi
  7458. if test "$pre_test_object_deps_done" = no; then
  7459. if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
  7460. _LT_AC_TAGVAR(predep_objects, $1)="$p"
  7461. else
  7462. _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
  7463. fi
  7464. else
  7465. if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
  7466. _LT_AC_TAGVAR(postdep_objects, $1)="$p"
  7467. else
  7468. _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
  7469. fi
  7470. fi
  7471. ;;
  7472. *) ;; # Ignore the rest.
  7473. esac
  7474. done
  7475. # Clean up.
  7476. rm -f a.out
  7477. else
  7478. echo "libtool.m4: error: problem compiling C++ test program"
  7479. fi
  7480. $rm -f confest.$objext
  7481. case " $_LT_AC_TAGVAR(postdeps, $1) " in
  7482. *" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
  7483. *) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes ;;
  7484. esac
  7485. _LT_AC_TAGVAR(GCC, $1)="$GXX"
  7486. _LT_AC_TAGVAR(LD, $1)="$LD"
  7487. ## CAVEAT EMPTOR:
  7488. ## There is no encapsulation within the following macros, do not change
  7489. ## the running order or otherwise move them around unless you know exactly
  7490. ## what you are doing...
  7491. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  7492. AC_LIBTOOL_PROG_CC_C_O($1)
  7493. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  7494. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  7495. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  7496. AC_LIBTOOL_SYS_LIB_STRIP
  7497. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  7498. AC_LIBTOOL_DLOPEN_SELF($1)
  7499. AC_LIBTOOL_CONFIG($1)
  7500. AC_LANG_POP
  7501. CC="$lt_save_CC"
  7502. ])# AC_LIBTOOL_LANG_CXX_CONFIG
  7503. # AC_LIBTOOL_LANG_GCJ_CONFIG
  7504. # --------------------------
  7505. # Ensure that the configuration vars for the C compiler are
  7506. # suitably defined. Those variables are subsequently used by
  7507. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  7508. AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
  7509. AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
  7510. [AC_LANG_SAVE
  7511. # Source file extension for C test sources.
  7512. ac_ext=java
  7513. # Object file extension for compiled C test sources.
  7514. objext=o
  7515. _LT_AC_TAGVAR(objext, $1)=$objext
  7516. # Code to be used in simple compile tests
  7517. lt_simple_compile_test_code="class foo {}"
  7518. # Code to be used in simple link tests
  7519. lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
  7520. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7521. _LT_AC_SYS_COMPILER
  7522. # Allow CC to be a program name with arguments.
  7523. lt_save_CC="$CC"
  7524. CC=${GCJ-"gcj"}
  7525. set dummy $CC
  7526. compiler="[$]2"
  7527. _LT_AC_TAGVAR(compiler, $1)=$CC
  7528. # GCJ did not exist at the time GCC didn't implicitly link libc in.
  7529. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  7530. ## CAVEAT EMPTOR:
  7531. ## There is no encapsulation within the following macros, do not change
  7532. ## the running order or otherwise move them around unless you know exactly
  7533. ## what you are doing...
  7534. AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
  7535. AC_LIBTOOL_PROG_COMPILER_PIC($1)
  7536. AC_LIBTOOL_PROG_CC_C_O($1)
  7537. AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
  7538. AC_LIBTOOL_PROG_LD_SHLIBS($1)
  7539. AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
  7540. AC_LIBTOOL_SYS_LIB_STRIP
  7541. AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
  7542. AC_LIBTOOL_DLOPEN_SELF($1)
  7543. AC_LIBTOOL_CONFIG($1)
  7544. AC_LANG_RESTORE
  7545. CC="$lt_save_CC"
  7546. ])# AC_LIBTOOL_LANG_GCJ_CONFIG
  7547. # AC_LIBTOOL_LANG_RC_CONFIG
  7548. # --------------------------
  7549. # Ensure that the configuration vars for the Windows resource compiler are
  7550. # suitably defined. Those variables are subsequently used by
  7551. # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
  7552. AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
  7553. AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
  7554. [AC_LANG_SAVE
  7555. # Source file extension for RC test sources.
  7556. ac_ext=rc
  7557. # Object file extension for compiled RC test sources.
  7558. objext=o
  7559. _LT_AC_TAGVAR(objext, $1)=$objext
  7560. # Code to be used in simple compile tests
  7561. lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
  7562. # Code to be used in simple link tests
  7563. lt_simple_link_test_code="$lt_simple_compile_test_code"
  7564. # ltmain only uses $CC for tagged configurations so make sure $CC is set.
  7565. _LT_AC_SYS_COMPILER
  7566. # Allow CC to be a program name with arguments.
  7567. lt_save_CC="$CC"
  7568. CC=${RC-"windres"}
  7569. set dummy $CC
  7570. compiler="[$]2"
  7571. _LT_AC_TAGVAR(compiler, $1)=$CC
  7572. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
  7573. AC_LIBTOOL_CONFIG($1)
  7574. AC_LANG_RESTORE
  7575. CC="$lt_save_CC"
  7576. ])# AC_LIBTOOL_LANG_RC_CONFIG
  7577. # AC_LIBTOOL_CONFIG([TAGNAME])
  7578. # ----------------------------
  7579. # If TAGNAME is not passed, then create an initial libtool script
  7580. # with a default configuration from the untagged config vars. Otherwise
  7581. # add code to config.status for appending the configuration named by
  7582. # TAGNAME from the matching tagged config vars.
  7583. AC_DEFUN([AC_LIBTOOL_CONFIG],
  7584. [# The else clause should only fire when bootstrapping the
  7585. # libtool distribution, otherwise you forgot to ship ltmain.sh
  7586. # with your package, and you will get complaints that there are
  7587. # no rules to generate ltmain.sh.
  7588. if test -f "$ltmain"; then
  7589. # Now quote all the things that may contain metacharacters while being
  7590. # careful not to overquote the AC_SUBSTed values. We take copies of the
  7591. # variables and quote the copies for generation of the libtool script.
  7592. for var in echo old_CC old_CFLAGS AR AR_FLAGS RANLIB LN_S LTCC NM SED SHELL \
  7593. libname_spec library_names_spec soname_spec extract_expsyms_cmds \
  7594. old_striplib striplib file_magic_cmd finish_cmds finish_eval \
  7595. deplibs_check_method reload_flag reload_cmds need_locks \
  7596. lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
  7597. lt_cv_sys_global_symbol_to_c_name_address \
  7598. sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  7599. old_postinstall_cmds old_postuninstall_cmds \
  7600. _LT_AC_TAGVAR(compiler, $1) \
  7601. _LT_AC_TAGVAR(CC, $1) \
  7602. _LT_AC_TAGVAR(LD, $1) \
  7603. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
  7604. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
  7605. _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
  7606. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
  7607. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
  7608. _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
  7609. _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
  7610. _LT_AC_TAGVAR(old_archive_cmds, $1) \
  7611. _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
  7612. _LT_AC_TAGVAR(predep_objects, $1) \
  7613. _LT_AC_TAGVAR(postdep_objects, $1) \
  7614. _LT_AC_TAGVAR(predeps, $1) \
  7615. _LT_AC_TAGVAR(postdeps, $1) \
  7616. _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
  7617. _LT_AC_TAGVAR(archive_cmds, $1) \
  7618. _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
  7619. _LT_AC_TAGVAR(postinstall_cmds, $1) \
  7620. _LT_AC_TAGVAR(postuninstall_cmds, $1) \
  7621. _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
  7622. _LT_AC_TAGVAR(allow_undefined_flag, $1) \
  7623. _LT_AC_TAGVAR(no_undefined_flag, $1) \
  7624. _LT_AC_TAGVAR(export_symbols_cmds, $1) \
  7625. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
  7626. _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
  7627. _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
  7628. _LT_AC_TAGVAR(exclude_expsyms, $1) \
  7629. _LT_AC_TAGVAR(include_expsyms, $1); do
  7630. case $var in
  7631. _LT_AC_TAGVAR(old_archive_cmds, $1) | \
  7632. _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
  7633. _LT_AC_TAGVAR(archive_cmds, $1) | \
  7634. _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
  7635. _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
  7636. _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
  7637. extract_expsyms_cmds | reload_cmds | finish_cmds | \
  7638. postinstall_cmds | postuninstall_cmds | \
  7639. old_postinstall_cmds | old_postuninstall_cmds | \
  7640. sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  7641. # Double-quote double-evaled strings.
  7642. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  7643. ;;
  7644. *)
  7645. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  7646. ;;
  7647. esac
  7648. done
  7649. case $lt_echo in
  7650. *'\[$]0 --fallback-echo"')
  7651. lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
  7652. ;;
  7653. esac
  7654. ifelse([$1], [],
  7655. [cfgfile="${ofile}T"
  7656. trap "$rm \"$cfgfile\"; exit 1" 1 2 15
  7657. $rm -f "$cfgfile"
  7658. AC_MSG_NOTICE([creating $ofile])],
  7659. [cfgfile="$ofile"])
  7660. cat <<__EOF__ >> "$cfgfile"
  7661. ifelse([$1], [],
  7662. [#! $SHELL
  7663. # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
  7664. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  7665. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  7666. #
  7667. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
  7668. # Free Software Foundation, Inc.
  7669. #
  7670. # This file is part of GNU Libtool:
  7671. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  7672. #
  7673. # This program is free software; you can redistribute it and/or modify
  7674. # it under the terms of the GNU General Public License as published by
  7675. # the Free Software Foundation; either version 2 of the License, or
  7676. # (at your option) any later version.
  7677. #
  7678. # This program is distributed in the hope that it will be useful, but
  7679. # WITHOUT ANY WARRANTY; without even the implied warranty of
  7680. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  7681. # General Public License for more details.
  7682. #
  7683. # You should have received a copy of the GNU General Public License
  7684. # along with this program; if not, write to the Free Software
  7685. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  7686. #
  7687. # As a special exception to the GNU General Public License, if you
  7688. # distribute this file as part of a program that contains a
  7689. # configuration script generated by Autoconf, you may include it under
  7690. # the same distribution terms that you use for the rest of that program.
  7691. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  7692. Xsed="sed -e s/^X//"
  7693. # The HP-UX ksh and POSIX shell print the target directory to stdout
  7694. # if CDPATH is set.
  7695. if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
  7696. # The names of the tagged configurations supported by this script.
  7697. available_tags=
  7698. # ### BEGIN LIBTOOL CONFIG],
  7699. [# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
  7700. # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  7701. # Shell to use when invoking shell scripts.
  7702. SHELL=$lt_SHELL
  7703. # Whether or not to build shared libraries.
  7704. build_libtool_libs=$enable_shared
  7705. # Whether or not to build static libraries.
  7706. build_old_libs=$enable_static
  7707. # Whether or not to add -lc for building shared libraries.
  7708. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
  7709. # Whether or not to optimize for fast installation.
  7710. fast_install=$enable_fast_install
  7711. # The host system.
  7712. host_alias=$host_alias
  7713. host=$host
  7714. # An echo program that does not interpret backslashes.
  7715. echo=$lt_echo
  7716. # The archiver.
  7717. AR=$lt_AR
  7718. AR_FLAGS=$lt_AR_FLAGS
  7719. # A C compiler.
  7720. LTCC=$lt_LTCC
  7721. # A language-specific compiler.
  7722. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
  7723. # Is the compiler the GNU C compiler?
  7724. with_gcc=$_LT_AC_TAGVAR(GCC, $1)
  7725. # The linker used to build libraries.
  7726. LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
  7727. # Whether we need hard or soft links.
  7728. LN_S=$lt_LN_S
  7729. # A BSD-compatible nm program.
  7730. NM=$lt_NM
  7731. # A sed program that does not truncate output.
  7732. SED=$lt_SED
  7733. # A symbol stripping program
  7734. STRIP=$STRIP
  7735. # Used to examine libraries when file_magic_cmd begins "file"
  7736. MAGIC_CMD=$MAGIC_CMD
  7737. # Used on cygwin: DLL creation program.
  7738. DLLTOOL="$DLLTOOL"
  7739. # Used on cygwin: object dumper.
  7740. OBJDUMP="$OBJDUMP"
  7741. # Used on cygwin: assembler.
  7742. AS="$AS"
  7743. # The name of the directory that contains temporary libtool files.
  7744. objdir=$objdir
  7745. # How to create reloadable object files.
  7746. reload_flag=$lt_reload_flag
  7747. reload_cmds=$lt_reload_cmds
  7748. # How to pass a linker flag through the compiler.
  7749. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
  7750. # Object file suffix (normally "o").
  7751. objext="$ac_objext"
  7752. # Old archive suffix (normally "a").
  7753. libext="$libext"
  7754. # Executable file suffix (normally "").
  7755. exeext="$exeext"
  7756. # Additional compiler flags for building library objects.
  7757. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
  7758. pic_mode=$pic_mode
  7759. # What is the maximum length of a command?
  7760. max_cmd_len=$lt_cv_sys_max_cmd_len
  7761. # Does compiler simultaneously support -c and -o options?
  7762. compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
  7763. # Must we lock files when doing compilation ?
  7764. need_locks=$lt_need_locks
  7765. # Do we need the lib prefix for modules?
  7766. need_lib_prefix=$need_lib_prefix
  7767. # Do we need a version for libraries?
  7768. need_version=$need_version
  7769. # Whether dlopen is supported.
  7770. dlopen_support=$enable_dlopen
  7771. # Whether dlopen of programs is supported.
  7772. dlopen_self=$enable_dlopen_self
  7773. # Whether dlopen of statically linked programs is supported.
  7774. dlopen_self_static=$enable_dlopen_self_static
  7775. # Compiler flag to prevent dynamic linking.
  7776. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
  7777. # Compiler flag to turn off builtin functions.
  7778. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
  7779. # Compiler flag to allow reflexive dlopens.
  7780. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
  7781. # Compiler flag to generate shared objects directly from archives.
  7782. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
  7783. # Compiler flag to generate thread-safe objects.
  7784. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
  7785. # Library versioning type.
  7786. version_type=$version_type
  7787. # Format of library name prefix.
  7788. libname_spec=$lt_libname_spec
  7789. # List of archive names. First name is the real one, the rest are links.
  7790. # The last name is the one that the linker finds with -lNAME.
  7791. library_names_spec=$lt_library_names_spec
  7792. # The coded name of the library, if different from the real name.
  7793. soname_spec=$lt_soname_spec
  7794. # Commands used to build and install an old-style archive.
  7795. RANLIB=$lt_RANLIB
  7796. old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
  7797. old_postinstall_cmds=$lt_old_postinstall_cmds
  7798. old_postuninstall_cmds=$lt_old_postuninstall_cmds
  7799. # Create an old-style archive from a shared archive.
  7800. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
  7801. # Create a temporary old-style archive to link instead of a shared archive.
  7802. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
  7803. # Commands used to build and install a shared archive.
  7804. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
  7805. archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
  7806. postinstall_cmds=$lt_postinstall_cmds
  7807. postuninstall_cmds=$lt_postuninstall_cmds
  7808. # Commands to strip libraries.
  7809. old_striplib=$lt_old_striplib
  7810. striplib=$lt_striplib
  7811. # Dependencies to place before the objects being linked to create a
  7812. # shared library.
  7813. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
  7814. # Dependencies to place after the objects being linked to create a
  7815. # shared library.
  7816. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
  7817. # Dependencies to place before the objects being linked to create a
  7818. # shared library.
  7819. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
  7820. # Dependencies to place after the objects being linked to create a
  7821. # shared library.
  7822. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
  7823. # The library search path used internally by the compiler when linking
  7824. # a shared library.
  7825. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
  7826. # Method to check whether dependent libraries are shared objects.
  7827. deplibs_check_method=$lt_deplibs_check_method
  7828. # Command to use when deplibs_check_method == file_magic.
  7829. file_magic_cmd=$lt_file_magic_cmd
  7830. # Flag that allows shared libraries with undefined symbols to be built.
  7831. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
  7832. # Flag that forces no undefined symbols.
  7833. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
  7834. # Commands used to finish a libtool library installation in a directory.
  7835. finish_cmds=$lt_finish_cmds
  7836. # Same as above, but a single script fragment to be evaled but not shown.
  7837. finish_eval=$lt_finish_eval
  7838. # Take the output of nm and produce a listing of raw symbols and C names.
  7839. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
  7840. # Transform the output of nm in a proper C declaration
  7841. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
  7842. # Transform the output of nm in a C name address pair
  7843. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
  7844. # This is the shared library runtime path variable.
  7845. runpath_var=$runpath_var
  7846. # This is the shared library path variable.
  7847. shlibpath_var=$shlibpath_var
  7848. # Is shlibpath searched before the hard-coded library search path?
  7849. shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  7850. # How to hardcode a shared library path into an executable.
  7851. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
  7852. # Whether we should hardcode library paths into libraries.
  7853. hardcode_into_libs=$hardcode_into_libs
  7854. # Flag to hardcode \$libdir into a binary during linking.
  7855. # This must work even if \$libdir does not exist.
  7856. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
  7857. # Whether we need a single -rpath flag with a separated argument.
  7858. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
  7859. # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  7860. # resulting binary.
  7861. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
  7862. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  7863. # resulting binary.
  7864. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
  7865. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  7866. # the resulting binary.
  7867. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
  7868. # Variables whose values should be saved in libtool wrapper scripts and
  7869. # restored at relink time.
  7870. variables_saved_for_relink="$variables_saved_for_relink"
  7871. # Whether libtool must link a program against all its dependency libraries.
  7872. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
  7873. # Compile-time system search path for libraries
  7874. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
  7875. # Run-time system search path for libraries
  7876. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
  7877. # Fix the shell variable \$srcfile for the compiler.
  7878. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
  7879. # Set to yes if exported symbols are required.
  7880. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
  7881. # The commands to list exported symbols.
  7882. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
  7883. # The commands to extract the exported symbol list from a shared archive.
  7884. extract_expsyms_cmds=$lt_extract_expsyms_cmds
  7885. # Symbols that should not be listed in the preloaded symbols.
  7886. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
  7887. # Symbols that must always be exported.
  7888. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
  7889. ifelse([$1],[],
  7890. [# ### END LIBTOOL CONFIG],
  7891. [# ### END LIBTOOL TAG CONFIG: $tagname])
  7892. __EOF__
  7893. ifelse([$1],[], [
  7894. case $host_os in
  7895. aix3*)
  7896. cat <<\EOF >> "$cfgfile"
  7897. # AIX sometimes has problems with the GCC collect2 program. For some
  7898. # reason, if we set the COLLECT_NAMES environment variable, the problems
  7899. # vanish in a puff of smoke.
  7900. if test "X${COLLECT_NAMES+set}" != Xset; then
  7901. COLLECT_NAMES=
  7902. export COLLECT_NAMES
  7903. fi
  7904. EOF
  7905. ;;
  7906. cygwin* | mingw* | pw32* | os2*)
  7907. cat <<'EOF' >> "$cfgfile"
  7908. # This is a source program that is used to create dlls on Windows
  7909. # Don't remove nor modify the starting and closing comments
  7910. _LT_AC_FILE_LTDLL_C
  7911. # This is a source program that is used to create import libraries
  7912. # on Windows for dlls which lack them. Don't remove nor modify the
  7913. # starting and closing comments
  7914. _LT_AC_FILE_IMPGEN_C
  7915. EOF
  7916. ;;
  7917. esac
  7918. # We use sed instead of cat because bash on DJGPP gets confused if
  7919. # if finds mixed CR/LF and LF-only lines. Since sed operates in
  7920. # text mode, it properly converts lines to CR/LF. This bash problem
  7921. # is reportedly fixed, but why not run on old versions too?
  7922. sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
  7923. mv -f "$cfgfile" "$ofile" || \
  7924. (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
  7925. chmod +x "$ofile"
  7926. ])
  7927. else
  7928. # If there is no Makefile yet, we rely on a make rule to execute
  7929. # `config.status --recheck' to rerun these tests and create the
  7930. # libtool script then.
  7931. test -f Makefile && make "$ltmain"
  7932. fi
  7933. ])# AC_LIBTOOL_CONFIG
  7934. # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
  7935. # -------------------------------------------
  7936. AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
  7937. [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
  7938. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
  7939. if test "$GCC" = yes; then
  7940. _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
  7941. AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
  7942. lt_cv_prog_compiler_rtti_exceptions,
  7943. [-fno-rtti -fno-exceptions -c conftest.$ac_ext], [],
  7944. [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
  7945. fi
  7946. ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
  7947. # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  7948. # ---------------------------------
  7949. AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
  7950. [AC_REQUIRE([AC_CANONICAL_HOST])
  7951. AC_REQUIRE([AC_PROG_NM])
  7952. AC_REQUIRE([AC_OBJEXT])
  7953. # Check for command to grab the raw symbol name followed by C symbol from nm.
  7954. AC_MSG_CHECKING([command to parse $NM output from $compiler object])
  7955. AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
  7956. [
  7957. # These are sane defaults that work on at least a few old systems.
  7958. # [They come from Ultrix. What could be older than Ultrix?!! ;)]
  7959. # Character class describing NM global symbol codes.
  7960. symcode='[[BCDEGRST]]'
  7961. # Regexp to match symbols that can be accessed directly from C.
  7962. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
  7963. # Transform the above into a raw symbol and a C symbol.
  7964. symxfrm='\1 \2\3 \3'
  7965. # Transform an extracted symbol line into a proper C declaration
  7966. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
  7967. # Transform an extracted symbol line into symbol name and symbol address
  7968. lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
  7969. # Define system-specific variables.
  7970. case $host_os in
  7971. aix*)
  7972. symcode='[[BCDT]]'
  7973. ;;
  7974. cygwin* | mingw* | pw32*)
  7975. symcode='[[ABCDGISTW]]'
  7976. ;;
  7977. hpux*) # Its linker distinguishes data from code symbols
  7978. if test "$host_cpu" = ia64; then
  7979. symcode='[[ABCDEGRST]]'
  7980. fi
  7981. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
  7982. lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
  7983. ;;
  7984. irix* | nonstopux*)
  7985. symcode='[[BCDEGRST]]'
  7986. ;;
  7987. solaris* | sysv5*)
  7988. symcode='[[BDT]]'
  7989. ;;
  7990. sysv4)
  7991. symcode='[[DFNSTU]]'
  7992. ;;
  7993. esac
  7994. # Handle CRLF in mingw tool chain
  7995. opt_cr=
  7996. case $host_os in
  7997. mingw*)
  7998. opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
  7999. ;;
  8000. esac
  8001. # If we're using GNU nm, then use its standard symbol codes.
  8002. if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  8003. symcode='[[ABCDGISTW]]'
  8004. fi
  8005. # Try without a prefix undercore, then with it.
  8006. for ac_symprfx in "" "_"; do
  8007. # Write the raw and C identifiers.
  8008. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
  8009. # Check to see that the pipe works correctly.
  8010. pipe_works=no
  8011. rm -f conftest*
  8012. cat > conftest.$ac_ext <<EOF
  8013. #ifdef __cplusplus
  8014. extern "C" {
  8015. #endif
  8016. char nm_test_var;
  8017. void nm_test_func(){}
  8018. #ifdef __cplusplus
  8019. }
  8020. #endif
  8021. int main(){nm_test_var='a';nm_test_func();return(0);}
  8022. EOF
  8023. if AC_TRY_EVAL(ac_compile); then
  8024. # Now try to grab the symbols.
  8025. nlist=conftest.nm
  8026. if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
  8027. # Try sorting and uniquifying the output.
  8028. if sort "$nlist" | uniq > "$nlist"T; then
  8029. mv -f "$nlist"T "$nlist"
  8030. else
  8031. rm -f "$nlist"T
  8032. fi
  8033. # Make sure that we snagged all the symbols we need.
  8034. if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  8035. if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  8036. cat <<EOF > conftest.$ac_ext
  8037. #ifdef __cplusplus
  8038. extern "C" {
  8039. #endif
  8040. EOF
  8041. # Now generate the symbol file.
  8042. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
  8043. cat <<EOF >> conftest.$ac_ext
  8044. #if defined (__STDC__) && __STDC__
  8045. # define lt_ptr_t void *
  8046. #else
  8047. # define lt_ptr_t char *
  8048. # define const
  8049. #endif
  8050. /* The mapping between symbol names and symbols. */
  8051. const struct {
  8052. const char *name;
  8053. lt_ptr_t address;
  8054. }
  8055. lt_preloaded_symbols[[]] =
  8056. {
  8057. EOF
  8058. sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
  8059. cat <<\EOF >> conftest.$ac_ext
  8060. {0, (lt_ptr_t) 0}
  8061. };
  8062. #ifdef __cplusplus
  8063. }
  8064. #endif
  8065. EOF
  8066. # Now try linking the two files.
  8067. mv conftest.$ac_objext conftstm.$ac_objext
  8068. lt_save_LIBS="$LIBS"
  8069. lt_save_CFLAGS="$CFLAGS"
  8070. LIBS="conftstm.$ac_objext"
  8071. CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
  8072. if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
  8073. pipe_works=yes
  8074. fi
  8075. LIBS="$lt_save_LIBS"
  8076. CFLAGS="$lt_save_CFLAGS"
  8077. else
  8078. echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
  8079. fi
  8080. else
  8081. echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
  8082. fi
  8083. else
  8084. echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
  8085. fi
  8086. else
  8087. echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
  8088. cat conftest.$ac_ext >&5
  8089. fi
  8090. rm -f conftest* conftst*
  8091. # Do not use the global_symbol_pipe unless it works.
  8092. if test "$pipe_works" = yes; then
  8093. break
  8094. else
  8095. lt_cv_sys_global_symbol_pipe=
  8096. fi
  8097. done
  8098. ])
  8099. if test -z "$lt_cv_sys_global_symbol_pipe"; then
  8100. lt_cv_sys_global_symbol_to_cdecl=
  8101. fi
  8102. if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
  8103. AC_MSG_RESULT(failed)
  8104. else
  8105. AC_MSG_RESULT(ok)
  8106. fi
  8107. ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
  8108. # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
  8109. # ---------------------------------------
  8110. AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
  8111. [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
  8112. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  8113. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
  8114. AC_MSG_CHECKING([for $compiler option to produce PIC])
  8115. ifelse([$1],[CXX],[
  8116. # C++ specific cases for pic, static, wl, etc.
  8117. if test "$GXX" = yes; then
  8118. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8119. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  8120. case $host_os in
  8121. aix*)
  8122. # All AIX code is PIC.
  8123. if test "$host_cpu" = ia64; then
  8124. # AIX 5 now supports IA64 processor
  8125. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8126. fi
  8127. ;;
  8128. amigaos*)
  8129. # FIXME: we need at least 68020 code to build shared libraries, but
  8130. # adding the `-m68020' flag to GCC prevents building anything better,
  8131. # like `-m68040'.
  8132. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  8133. ;;
  8134. beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
  8135. # PIC is the default for these OSes.
  8136. ;;
  8137. cygwin* | mingw* | os2*)
  8138. # This hack is so that the source file can tell whether it is being
  8139. # built for inclusion in a dll (and should export symbols for example).
  8140. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
  8141. ;;
  8142. darwin* | rhapsody*)
  8143. # PIC is the default on this platform
  8144. # Common symbols not allowed in MH_DYLIB files
  8145. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  8146. ;;
  8147. *djgpp*)
  8148. # DJGPP does not support shared libraries at all
  8149. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  8150. ;;
  8151. sysv4*MP*)
  8152. if test -d /usr/nec; then
  8153. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
  8154. fi
  8155. ;;
  8156. hpux*)
  8157. # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
  8158. if test "$host_cpu" != ia64; then
  8159. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  8160. fi
  8161. ;;
  8162. *)
  8163. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  8164. ;;
  8165. esac
  8166. else
  8167. case $host_os in
  8168. aix4* | aix5*)
  8169. # All AIX code is PIC.
  8170. if test "$host_cpu" = ia64; then
  8171. # AIX 5 now supports IA64 processor
  8172. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8173. else
  8174. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  8175. fi
  8176. ;;
  8177. chorus*)
  8178. case $cc_basename in
  8179. cxch68)
  8180. # Green Hills C++ Compiler
  8181. # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
  8182. ;;
  8183. esac
  8184. ;;
  8185. dgux*)
  8186. case $cc_basename in
  8187. ec++)
  8188. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  8189. ;;
  8190. ghcx)
  8191. # Green Hills C++ Compiler
  8192. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  8193. ;;
  8194. *)
  8195. ;;
  8196. esac
  8197. ;;
  8198. freebsd*)
  8199. # FreeBSD uses GNU C++
  8200. ;;
  8201. hpux9* | hpux10* | hpux11*)
  8202. case $cc_basename in
  8203. CC)
  8204. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8205. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
  8206. if test "$host_cpu" != ia64; then
  8207. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  8208. fi
  8209. ;;
  8210. aCC)
  8211. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8212. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
  8213. if test "$host_cpu" != ia64; then
  8214. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  8215. fi
  8216. ;;
  8217. *)
  8218. ;;
  8219. esac
  8220. ;;
  8221. irix5* | irix6* | nonstopux*)
  8222. case $cc_basename in
  8223. CC)
  8224. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8225. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  8226. # CC pic flag -KPIC is the default.
  8227. ;;
  8228. *)
  8229. ;;
  8230. esac
  8231. ;;
  8232. linux*)
  8233. case $cc_basename in
  8234. KCC)
  8235. # KAI C++ Compiler
  8236. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
  8237. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  8238. ;;
  8239. cxx)
  8240. # Compaq C++
  8241. # Make sure the PIC flag is empty. It appears that all Alpha
  8242. # Linux and Compaq Tru64 Unix objects are PIC.
  8243. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  8244. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  8245. ;;
  8246. *)
  8247. ;;
  8248. esac
  8249. ;;
  8250. lynxos*)
  8251. ;;
  8252. m88k*)
  8253. ;;
  8254. mvs*)
  8255. case $cc_basename in
  8256. cxx)
  8257. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
  8258. ;;
  8259. *)
  8260. ;;
  8261. esac
  8262. ;;
  8263. netbsd*)
  8264. ;;
  8265. osf3* | osf4* | osf5*)
  8266. case $cc_basename in
  8267. KCC)
  8268. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
  8269. ;;
  8270. RCC)
  8271. # Rational C++ 2.4.1
  8272. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  8273. ;;
  8274. cxx)
  8275. # Digital/Compaq C++
  8276. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8277. # Make sure the PIC flag is empty. It appears that all Alpha
  8278. # Linux and Compaq Tru64 Unix objects are PIC.
  8279. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  8280. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  8281. ;;
  8282. *)
  8283. ;;
  8284. esac
  8285. ;;
  8286. psos*)
  8287. ;;
  8288. sco*)
  8289. case $cc_basename in
  8290. CC)
  8291. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  8292. ;;
  8293. *)
  8294. ;;
  8295. esac
  8296. ;;
  8297. solaris*)
  8298. case $cc_basename in
  8299. CC)
  8300. # Sun C++ 4.2, 5.x and Centerline C++
  8301. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  8302. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8303. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  8304. ;;
  8305. gcx)
  8306. # Green Hills C++ Compiler
  8307. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  8308. ;;
  8309. *)
  8310. ;;
  8311. esac
  8312. ;;
  8313. sunos4*)
  8314. case $cc_basename in
  8315. CC)
  8316. # Sun C++ 4.x
  8317. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  8318. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8319. ;;
  8320. lcc)
  8321. # Lucid
  8322. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  8323. ;;
  8324. *)
  8325. ;;
  8326. esac
  8327. ;;
  8328. tandem*)
  8329. case $cc_basename in
  8330. NCC)
  8331. # NonStop-UX NCC 3.20
  8332. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  8333. ;;
  8334. *)
  8335. ;;
  8336. esac
  8337. ;;
  8338. unixware*)
  8339. ;;
  8340. vxworks*)
  8341. ;;
  8342. *)
  8343. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  8344. ;;
  8345. esac
  8346. fi
  8347. ],
  8348. [
  8349. if test "$GCC" = yes; then
  8350. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8351. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
  8352. case $host_os in
  8353. aix*)
  8354. # All AIX code is PIC.
  8355. if test "$host_cpu" = ia64; then
  8356. # AIX 5 now supports IA64 processor
  8357. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8358. fi
  8359. ;;
  8360. amigaos*)
  8361. # FIXME: we need at least 68020 code to build shared libraries, but
  8362. # adding the `-m68020' flag to GCC prevents building anything better,
  8363. # like `-m68040'.
  8364. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
  8365. ;;
  8366. beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
  8367. # PIC is the default for these OSes.
  8368. ;;
  8369. cygwin* | mingw* | pw32* | os2*)
  8370. # This hack is so that the source file can tell whether it is being
  8371. # built for inclusion in a dll (and should export symbols for example).
  8372. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
  8373. ;;
  8374. darwin* | rhapsody*)
  8375. # PIC is the default on this platform
  8376. # Common symbols not allowed in MH_DYLIB files
  8377. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
  8378. ;;
  8379. msdosdjgpp*)
  8380. # Just because we use GCC doesn't mean we suddenly get shared libraries
  8381. # on systems that don't support them.
  8382. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  8383. enable_shared=no
  8384. ;;
  8385. sysv4*MP*)
  8386. if test -d /usr/nec; then
  8387. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
  8388. fi
  8389. ;;
  8390. hpux*)
  8391. # PIC is the default for IA64 HP-UX, but not for PA HP-UX.
  8392. if test "$host_cpu" != ia64; then
  8393. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  8394. fi
  8395. ;;
  8396. *)
  8397. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
  8398. ;;
  8399. esac
  8400. else
  8401. # PORTME Check for flag to pass linker flags through the system compiler.
  8402. case $host_os in
  8403. aix*)
  8404. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8405. if test "$host_cpu" = ia64; then
  8406. # AIX 5 now supports IA64 processor
  8407. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8408. else
  8409. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
  8410. fi
  8411. ;;
  8412. cygwin* | mingw* | pw32* | os2*)
  8413. # This hack is so that the source file can tell whether it is being
  8414. # built for inclusion in a dll (and should export symbols for example).
  8415. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
  8416. ;;
  8417. hpux9* | hpux10* | hpux11*)
  8418. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8419. if test "$host_cpu" != ia64; then
  8420. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
  8421. fi
  8422. # Is there a better lt_prog_compiler_static that works with the bundled CC?
  8423. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
  8424. ;;
  8425. irix5* | irix6* | nonstopux*)
  8426. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8427. # PIC (with -KPIC) is the default.
  8428. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  8429. ;;
  8430. newsos6)
  8431. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  8432. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8433. ;;
  8434. osf3* | osf4* | osf5*)
  8435. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8436. # All OSF/1 code is PIC.
  8437. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
  8438. ;;
  8439. sco3.2v5*)
  8440. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
  8441. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
  8442. ;;
  8443. solaris*)
  8444. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8445. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  8446. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8447. ;;
  8448. sunos4*)
  8449. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
  8450. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
  8451. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8452. ;;
  8453. sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
  8454. if test "x$host_vendor" = xsni; then
  8455. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-LD'
  8456. else
  8457. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
  8458. fi
  8459. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
  8460. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8461. ;;
  8462. sysv4*MP*)
  8463. if test -d /usr/nec ;then
  8464. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
  8465. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8466. fi
  8467. ;;
  8468. uts4*)
  8469. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
  8470. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
  8471. ;;
  8472. *)
  8473. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
  8474. ;;
  8475. esac
  8476. fi
  8477. ])
  8478. AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
  8479. #
  8480. # Check to make sure the PIC flag actually works.
  8481. #
  8482. if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
  8483. AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
  8484. _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
  8485. [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
  8486. [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
  8487. "" | " "*) ;;
  8488. *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
  8489. esac],
  8490. [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  8491. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
  8492. fi
  8493. case "$host_os" in
  8494. # For platforms which do not support PIC, -DPIC is meaningless:
  8495. *djgpp*)
  8496. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
  8497. ;;
  8498. *)
  8499. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"
  8500. ;;
  8501. esac
  8502. ])
  8503. # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
  8504. # ------------------------------------
  8505. # See if the linker supports building shared libraries.
  8506. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
  8507. [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
  8508. ifelse([$1],[CXX],[
  8509. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  8510. case $host_os in
  8511. aix4* | aix5*)
  8512. # If we're using GNU nm, then we don't want the "-C" option.
  8513. # -C means demangle to AIX nm, but means don't demangle with GNU nm
  8514. if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
  8515. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  8516. else
  8517. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  8518. fi
  8519. ;;
  8520. cygwin* | mingw* | pw32*)
  8521. _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
  8522. ;;
  8523. *)
  8524. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  8525. ;;
  8526. esac
  8527. ],[
  8528. runpath_var=
  8529. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  8530. _LT_AC_TAGVAR(archive_cmds, $1)=
  8531. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=
  8532. _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
  8533. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
  8534. _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
  8535. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
  8536. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  8537. _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
  8538. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  8539. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  8540. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8541. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  8542. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
  8543. _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
  8544. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  8545. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  8546. # include_expsyms should be a list of space-separated symbols to be *always*
  8547. # included in the symbol list
  8548. _LT_AC_TAGVAR(include_expsyms, $1)=
  8549. # exclude_expsyms can be an egrep regular expression of symbols to exclude
  8550. # it will be wrapped by ` (' and `)$', so one must not match beginning or
  8551. # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  8552. # as well as any symbol that contains `d'.
  8553. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
  8554. # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
  8555. # platforms (ab)use it in PIC code, but their linkers get confused if
  8556. # the symbol is explicitly referenced. Since portable code cannot
  8557. # rely on this symbol name, it's probably fine to never include it in
  8558. # preloaded symbol tables.
  8559. extract_expsyms_cmds=
  8560. case $host_os in
  8561. cygwin* | mingw* | pw32*)
  8562. # FIXME: the MSVC++ port hasn't been tested in a loooong time
  8563. # When not using gcc, we currently assume that we are using
  8564. # Microsoft Visual C++.
  8565. if test "$GCC" != yes; then
  8566. with_gnu_ld=no
  8567. fi
  8568. ;;
  8569. openbsd*)
  8570. with_gnu_ld=no
  8571. ;;
  8572. esac
  8573. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  8574. if test "$with_gnu_ld" = yes; then
  8575. # If archive_cmds runs LD, not CC, wlarc should be empty
  8576. wlarc='${wl}'
  8577. # See if GNU ld supports shared libraries.
  8578. case $host_os in
  8579. aix3* | aix4* | aix5*)
  8580. # On AIX/PPC, the GNU linker is very broken
  8581. if test "$host_cpu" != ia64; then
  8582. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8583. cat <<EOF 1>&2
  8584. *** Warning: the GNU linker, at least up to release 2.9.1, is reported
  8585. *** to be unable to reliably create shared libraries on AIX.
  8586. *** Therefore, libtool is disabling shared libraries support. If you
  8587. *** really care for shared libraries, you may want to modify your PATH
  8588. *** so that a non-GNU linker is found, and then restart.
  8589. EOF
  8590. fi
  8591. ;;
  8592. amigaos*)
  8593. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  8594. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  8595. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  8596. # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
  8597. # that the semantics of dynamic libraries on AmigaOS, at least up
  8598. # to version 4, is to share data among multiple programs linked
  8599. # with the same dynamic library. Since this doesn't match the
  8600. # behavior of shared libraries on other platforms, we can't use
  8601. # them.
  8602. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8603. ;;
  8604. beos*)
  8605. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  8606. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  8607. # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
  8608. # support --undefined. This deserves some investigation. FIXME
  8609. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8610. else
  8611. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8612. fi
  8613. ;;
  8614. cygwin* | mingw* | pw32*)
  8615. # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is
  8616. # no search path for DLLs.
  8617. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  8618. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  8619. _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  8620. extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
  8621. sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
  8622. test -f $output_objdir/impgen.exe || (cd $output_objdir && \
  8623. if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \
  8624. else $CC -o impgen impgen.c ; fi)~
  8625. $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def'
  8626. _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib'
  8627. # cygwin and mingw dlls have different entry points and sets of symbols
  8628. # to exclude.
  8629. # FIXME: what about values for MSVC?
  8630. dll_entry=__cygwin_dll_entry@12
  8631. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~
  8632. case $host_os in
  8633. mingw*)
  8634. # mingw values
  8635. dll_entry=_DllMainCRTStartup@12
  8636. dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
  8637. ;;
  8638. esac
  8639. # mingw and cygwin differ, and it's simplest to just exclude the union
  8640. # of the two symbol sets.
  8641. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
  8642. # recent cygwin and mingw systems supply a stub DllMain which the user
  8643. # can override, but on older systems we have to supply one (in ltdll.c)
  8644. if test "x$lt_cv_need_dllmain" = "xyes"; then
  8645. ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
  8646. ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
  8647. test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
  8648. else
  8649. ltdll_obj=
  8650. ltdll_cmds=
  8651. fi
  8652. # Extract the symbol export list from an `--export-all' def file,
  8653. # then regenerate the def file from the symbol export list, so that
  8654. # the compiled dll only exports the symbol export list.
  8655. # Be careful not to strip the DATA tag left by newer dlltools.
  8656. _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"'
  8657. $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
  8658. sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols'
  8659. # If the export-symbols file already is a .def file (1st line
  8660. # is EXPORTS), use it as is.
  8661. # If DATA tags from a recent dlltool are present, honour them!
  8662. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`head -1 $export_symbols`" = xEXPORTS; then
  8663. cp $export_symbols $output_objdir/$soname-def;
  8664. else
  8665. echo EXPORTS > $output_objdir/$soname-def;
  8666. _lt_hint=1;
  8667. cat $export_symbols | while read symbol; do
  8668. set dummy \$symbol;
  8669. case \[$]# in
  8670. 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
  8671. *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
  8672. esac;
  8673. _lt_hint=`expr 1 + \$_lt_hint`;
  8674. done;
  8675. fi~
  8676. '"$ltdll_cmds"'
  8677. $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
  8678. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~
  8679. $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~
  8680. $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~
  8681. $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
  8682. ;;
  8683. netbsd*)
  8684. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  8685. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
  8686. wlarc=
  8687. else
  8688. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8689. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8690. fi
  8691. ;;
  8692. solaris* | sysv5*)
  8693. if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
  8694. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8695. cat <<EOF 1>&2
  8696. *** Warning: The releases 2.8.* of the GNU linker cannot reliably
  8697. *** create shared libraries on Solaris systems. Therefore, libtool
  8698. *** is disabling shared libraries support. We urge you to upgrade GNU
  8699. *** binutils to release 2.9.1 or newer. Another option is to modify
  8700. *** your PATH or compiler configuration so that the native linker is
  8701. *** used, and then restart.
  8702. EOF
  8703. elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  8704. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8705. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8706. else
  8707. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8708. fi
  8709. ;;
  8710. sunos4*)
  8711. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  8712. wlarc=
  8713. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8714. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8715. ;;
  8716. *)
  8717. if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  8718. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
  8719. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  8720. else
  8721. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8722. fi
  8723. ;;
  8724. esac
  8725. if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
  8726. runpath_var=LD_RUN_PATH
  8727. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
  8728. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
  8729. case $host_os in
  8730. cygwin* | mingw* | pw32*)
  8731. # dlltool doesn't understand --whole-archive et. al.
  8732. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  8733. ;;
  8734. *)
  8735. # ancient GNU ld didn't support --whole-archive et. al.
  8736. if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
  8737. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  8738. else
  8739. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
  8740. fi
  8741. ;;
  8742. esac
  8743. fi
  8744. else
  8745. # PORTME fill in a description of your system's linker (not GNU ld)
  8746. case $host_os in
  8747. aix3*)
  8748. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  8749. _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  8750. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
  8751. # Note: this linker hardcodes the directories in LIBPATH if there
  8752. # are no directories specified by -L.
  8753. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  8754. if test "$GCC" = yes && test -z "$link_static_flag"; then
  8755. # Neither direct hardcoding nor static linking is supported with a
  8756. # broken collect2.
  8757. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
  8758. fi
  8759. ;;
  8760. aix4* | aix5*)
  8761. if test "$host_cpu" = ia64; then
  8762. # On IA64, the linker does run time linking by default, so we don't
  8763. # have to do anything special.
  8764. aix_use_runtimelinking=no
  8765. exp_sym_flag='-Bexport'
  8766. no_entry_flag=""
  8767. else
  8768. # If we're using GNU nm, then we don't want the "-C" option.
  8769. # -C means demangle to AIX nm, but means don't demangle with GNU nm
  8770. if $NM -V 2>&1 | egrep '(GNU)' > /dev/null; then
  8771. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  8772. else
  8773. _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
  8774. fi
  8775. # KDE requires run time linking. Make it the default.
  8776. aix_use_runtimelinking=yes
  8777. exp_sym_flag='-bexport'
  8778. no_entry_flag='-bnoentry'
  8779. fi
  8780. # When large executables or shared objects are built, AIX ld can
  8781. # have problems creating the table of contents. If linking a library
  8782. # or program results in "error TOC overflow" add -mminimal-toc to
  8783. # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
  8784. # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
  8785. _LT_AC_TAGVAR(archive_cmds, $1)=''
  8786. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8787. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
  8788. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8789. if test "$GCC" = yes; then
  8790. case $host_os in aix4.[012]|aix4.[012].*)
  8791. # We only want to do this on AIX 4.2 and lower, the check
  8792. # below for broken collect2 doesn't work under 4.3+
  8793. collect2name=`${CC} -print-prog-name=collect2`
  8794. if test -f "$collect2name" && \
  8795. strings "$collect2name" | grep resolve_lib_name >/dev/null
  8796. then
  8797. # We have reworked collect2
  8798. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8799. else
  8800. # We have old collect2
  8801. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
  8802. # It fails to find uninstalled libraries when the uninstalled
  8803. # path is not listed in the libpath. Setting hardcode_minus_L
  8804. # to unsupported forces relinking
  8805. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  8806. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  8807. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
  8808. fi
  8809. esac
  8810. shared_flag='-shared'
  8811. else
  8812. # not using gcc
  8813. if test "$host_cpu" = ia64; then
  8814. # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
  8815. # chokes on -Wl,-G. The following line is correct:
  8816. shared_flag='-G'
  8817. else
  8818. if test "$aix_use_runtimelinking" = yes; then
  8819. shared_flag='-qmkshrobj ${wl}-G'
  8820. else
  8821. shared_flag='-qmkshrobj'
  8822. fi
  8823. fi
  8824. fi
  8825. # Let the compiler handle the export list.
  8826. _LT_AC_TAGVAR(always_export_symbols, $1)=no
  8827. if test "$aix_use_runtimelinking" = yes; then
  8828. # Warning - without using the other runtime loading flags (-brtl),
  8829. # -berok will link without error, but may produce a broken library.
  8830. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
  8831. # Determine the default libpath from the value encoded in an empty executable.
  8832. _LT_AC_SYS_LIBPATH_AIX
  8833. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  8834. _LT_AC_TAGVAR(archive_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '" $shared_flag"
  8835. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $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"
  8836. else
  8837. if test "$host_cpu" = ia64; then
  8838. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
  8839. _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
  8840. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
  8841. else
  8842. # Determine the default libpath from the value encoded in an empty executable.
  8843. _LT_AC_SYS_LIBPATH_AIX
  8844. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
  8845. # Warning - without using the other run time loading flags,
  8846. # -berok will link without error, but may produce a broken library.
  8847. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
  8848. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
  8849. # -bexpall does not export symbols beginning with underscore (_)
  8850. _LT_AC_TAGVAR(always_export_symbols, $1)=yes
  8851. # Exported symbols can be pulled into shared objects from archives
  8852. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
  8853. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  8854. # This is similar to how AIX traditionally builds it's shared libraries.
  8855. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
  8856. fi
  8857. fi
  8858. ;;
  8859. amigaos*)
  8860. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
  8861. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  8862. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  8863. # see comment about different semantics on the GNU ld section
  8864. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8865. ;;
  8866. bsdi4*)
  8867. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
  8868. ;;
  8869. cygwin* | mingw* | pw32*)
  8870. # When not using gcc, we currently assume that we are using
  8871. # Microsoft Visual C++.
  8872. # hardcode_libdir_flag_spec is actually meaningless, as there is
  8873. # no search path for DLLs.
  8874. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
  8875. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  8876. # Tell ltmain to make .lib files, not .a files.
  8877. libext=lib
  8878. # FIXME: Setting linknames here is a bad hack.
  8879. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  8880. # The linker will automatically build a .lib file if we build a DLL.
  8881. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
  8882. # FIXME: Should let the user specify the lib program.
  8883. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
  8884. fix_srcfile_path='`cygpath -w "$srcfile"`'
  8885. ;;
  8886. darwin* | rhapsody*)
  8887. case "$host_os" in
  8888. rhapsody* | darwin1.[[012]])
  8889. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
  8890. ;;
  8891. *) # Darwin 1.3 on
  8892. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
  8893. ;;
  8894. esac
  8895. # FIXME: Relying on posixy $() will cause problems for
  8896. # cross-compilation, but unfortunately the echo tests do not
  8897. # yet detect zsh echo's removal of \ escapes. Also zsh mangles
  8898. # `"' quotes if we put them in here... so don't!
  8899. _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
  8900. # We need to add '_' to the symbols in $export_symbols first
  8901. #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols'
  8902. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8903. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8904. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
  8905. ;;
  8906. dgux*)
  8907. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  8908. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  8909. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8910. ;;
  8911. freebsd1*)
  8912. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  8913. ;;
  8914. # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  8915. # support. Future versions do this automatically, but an explicit c++rt0.o
  8916. # does not break anything, and helps significantly (at the cost of a little
  8917. # extra space).
  8918. freebsd2.2*)
  8919. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
  8920. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8921. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8922. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8923. ;;
  8924. # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  8925. freebsd2*)
  8926. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  8927. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8928. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  8929. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8930. ;;
  8931. # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  8932. freebsd*)
  8933. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
  8934. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8935. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8936. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8937. ;;
  8938. hpux9* | hpux10* | hpux11*)
  8939. if test "$GCC" = yes; then
  8940. case $host_os in
  8941. hpux9*)
  8942. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  8943. ;;
  8944. *)
  8945. if test "$host_cpu" = ia64; then
  8946. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  8947. else
  8948. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
  8949. fi
  8950. ;;
  8951. esac
  8952. else
  8953. case $host_os in
  8954. hpux9*)
  8955. _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
  8956. ;;
  8957. *)
  8958. if test "$host_cpu" = ia64; then
  8959. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
  8960. else
  8961. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
  8962. fi
  8963. ;;
  8964. esac
  8965. fi
  8966. if test "$host_cpu" = ia64; then
  8967. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  8968. _LT_AC_TAGVAR(hardcode_direct, $1)=no
  8969. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8970. else
  8971. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
  8972. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8973. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8974. fi
  8975. # hardcode_minus_L: Not really in the search PATH,
  8976. # but as the default location of the library.
  8977. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  8978. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  8979. ;;
  8980. irix5* | irix6* | nonstopux*)
  8981. if test "$GCC" = yes; then
  8982. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $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'
  8983. else
  8984. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  8985. fi
  8986. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  8987. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  8988. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  8989. ;;
  8990. netbsd*)
  8991. if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  8992. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
  8993. else
  8994. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
  8995. fi
  8996. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  8997. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  8998. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  8999. ;;
  9000. newsos6)
  9001. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9002. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  9003. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  9004. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  9005. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9006. ;;
  9007. openbsd*)
  9008. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  9009. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9010. if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
  9011. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
  9012. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  9013. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
  9014. else
  9015. case $host_os in
  9016. openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
  9017. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
  9018. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  9019. ;;
  9020. *)
  9021. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
  9022. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
  9023. ;;
  9024. esac
  9025. fi
  9026. ;;
  9027. os2*)
  9028. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  9029. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  9030. _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
  9031. _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
  9032. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
  9033. ;;
  9034. osf3*)
  9035. if test "$GCC" = yes; then
  9036. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  9037. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $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'
  9038. else
  9039. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  9040. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  9041. fi
  9042. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  9043. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  9044. ;;
  9045. osf4* | osf5*) # as osf3* with the addition of -msym flag
  9046. if test "$GCC" = yes; then
  9047. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
  9048. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $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'
  9049. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
  9050. else
  9051. _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
  9052. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
  9053. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
  9054. $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp'
  9055. # Both c and cxx compiler support -rpath directly
  9056. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
  9057. fi
  9058. _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
  9059. ;;
  9060. sco3.2v5*)
  9061. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9062. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9063. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
  9064. runpath_var=LD_RUN_PATH
  9065. hardcode_runpath_var=yes
  9066. ;;
  9067. solaris*)
  9068. _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
  9069. if test "$GCC" = yes; then
  9070. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  9071. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  9072. $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
  9073. else
  9074. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9075. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  9076. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
  9077. fi
  9078. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
  9079. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9080. case $host_os in
  9081. solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
  9082. *) # Supported since Solaris 2.6 (maybe 2.5.1?)
  9083. _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
  9084. esac
  9085. _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
  9086. ;;
  9087. sunos4*)
  9088. if test "x$host_vendor" = xsequent; then
  9089. # Use $CC to link under sequent, because it throws in some extra .o
  9090. # files that make .init and .fini sections work.
  9091. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
  9092. else
  9093. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
  9094. fi
  9095. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  9096. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  9097. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
  9098. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9099. ;;
  9100. sysv4)
  9101. if test "x$host_vendor" = xsni; then
  9102. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9103. _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
  9104. else
  9105. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9106. _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
  9107. fi
  9108. runpath_var='LD_RUN_PATH'
  9109. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9110. ;;
  9111. sysv4.3*)
  9112. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9113. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9114. _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
  9115. ;;
  9116. sysv4*MP*)
  9117. if test -d /usr/nec; then
  9118. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9119. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9120. runpath_var=LD_RUN_PATH
  9121. hardcode_runpath_var=yes
  9122. _LT_AC_TAGVAR(ld_shlibs, $1)=yes
  9123. fi
  9124. ;;
  9125. sysv4.2uw2*)
  9126. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
  9127. _LT_AC_TAGVAR(hardcode_direct, $1)=yes
  9128. _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
  9129. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9130. hardcode_runpath_var=yes
  9131. runpath_var=LD_RUN_PATH
  9132. ;;
  9133. sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
  9134. _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
  9135. if test "$GCC" = yes; then
  9136. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  9137. else
  9138. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
  9139. fi
  9140. runpath_var='LD_RUN_PATH'
  9141. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9142. ;;
  9143. sysv5*)
  9144. _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
  9145. # $CC -shared without GNU ld will not create a library from C++
  9146. # object files and a static libstdc++, better avoid it by now
  9147. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9148. _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  9149. $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
  9150. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
  9151. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9152. runpath_var='LD_RUN_PATH'
  9153. ;;
  9154. uts4*)
  9155. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
  9156. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
  9157. _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
  9158. ;;
  9159. *)
  9160. _LT_AC_TAGVAR(ld_shlibs, $1)=no
  9161. ;;
  9162. esac
  9163. fi
  9164. ])
  9165. AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
  9166. test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
  9167. variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
  9168. if test "$GCC" = yes; then
  9169. variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  9170. fi
  9171. #
  9172. # Do we need to explicitly link libc?
  9173. #
  9174. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  9175. if test "$enable_shared" = yes && test "$GCC" = yes; then
  9176. case $_LT_AC_TAGVAR(archive_cmds, $1) in
  9177. *'~'*)
  9178. # FIXME: we may have to deal with multi-command sequences.
  9179. ;;
  9180. '$CC '*)
  9181. # Test whether the compiler implicitly links with -lc since on some
  9182. # systems, -lgcc has to come before -lc. If gcc already passes -lc
  9183. # to ld, don't add -lc before -lgcc.
  9184. AC_MSG_CHECKING([whether -lc should be explicitly linked in])
  9185. $rm conftest*
  9186. echo 'static int dummy;' > conftest.$ac_ext
  9187. if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
  9188. soname=conftest
  9189. lib=conftest
  9190. libobjs=conftest.$ac_objext
  9191. deplibs=
  9192. wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
  9193. compiler_flags=-v
  9194. linker_flags=-v
  9195. verstring=
  9196. output_objdir=.
  9197. libname=conftest
  9198. lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
  9199. _LT_AC_TAGVAR(allow_undefined_flag, $1)=
  9200. if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
  9201. then
  9202. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
  9203. else
  9204. _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
  9205. fi
  9206. _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
  9207. else
  9208. cat conftest.err 1>&5
  9209. fi
  9210. $rm conftest*
  9211. AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
  9212. ;;
  9213. esac
  9214. fi
  9215. ])# AC_LIBTOOL_PROG_LD_SHLIBS
  9216. # _LT_AC_FILE_LTDLL_C
  9217. # -------------------
  9218. # Be careful that the start marker always follows a newline.
  9219. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
  9220. # /* ltdll.c starts here */
  9221. # #define WIN32_LEAN_AND_MEAN
  9222. # #include <windows.h>
  9223. # #undef WIN32_LEAN_AND_MEAN
  9224. # #include <stdio.h>
  9225. #
  9226. # #ifndef __CYGWIN__
  9227. # # ifdef __CYGWIN32__
  9228. # # define __CYGWIN__ __CYGWIN32__
  9229. # # endif
  9230. # #endif
  9231. #
  9232. # #ifdef __cplusplus
  9233. # extern "C" {
  9234. # #endif
  9235. # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  9236. # #ifdef __cplusplus
  9237. # }
  9238. # #endif
  9239. #
  9240. # #ifdef __CYGWIN__
  9241. # #include <cygwin/cygwin_dll.h>
  9242. # DECLARE_CYGWIN_DLL( DllMain );
  9243. # #endif
  9244. # HINSTANCE __hDllInstance_base;
  9245. #
  9246. # BOOL APIENTRY
  9247. # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  9248. # {
  9249. # __hDllInstance_base = hInst;
  9250. # return TRUE;
  9251. # }
  9252. # /* ltdll.c ends here */
  9253. ])# _LT_AC_FILE_LTDLL_C
  9254. # _LT_AC_FILE_IMPGEN_C
  9255. # --------------------
  9256. # Be careful that the start marker always follows a newline.
  9257. AC_DEFUN([_LT_AC_FILE_IMPGEN_C], [
  9258. # /* impgen.c starts here */
  9259. # /* Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
  9260. #
  9261. # This file is part of GNU libtool.
  9262. #
  9263. # This program is free software; you can redistribute it and/or modify
  9264. # it under the terms of the GNU General Public License as published by
  9265. # the Free Software Foundation; either version 2 of the License, or
  9266. # (at your option) any later version.
  9267. #
  9268. # This program is distributed in the hope that it will be useful,
  9269. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9270. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9271. # GNU General Public License for more details.
  9272. #
  9273. # You should have received a copy of the GNU General Public License
  9274. # along with this program; if not, write to the Free Software
  9275. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  9276. # */
  9277. #
  9278. # #include <stdio.h> /* for printf() */
  9279. # #include <unistd.h> /* for open(), lseek(), read() */
  9280. # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
  9281. # #include <string.h> /* for strdup() */
  9282. #
  9283. # /* O_BINARY isn't required (or even defined sometimes) under Unix */
  9284. # #ifndef O_BINARY
  9285. # #define O_BINARY 0
  9286. # #endif
  9287. #
  9288. # static unsigned int
  9289. # pe_get16 (fd, offset)
  9290. # int fd;
  9291. # int offset;
  9292. # {
  9293. # unsigned char b[2];
  9294. # lseek (fd, offset, SEEK_SET);
  9295. # read (fd, b, 2);
  9296. # return b[0] + (b[1]<<8);
  9297. # }
  9298. #
  9299. # static unsigned int
  9300. # pe_get32 (fd, offset)
  9301. # int fd;
  9302. # int offset;
  9303. # {
  9304. # unsigned char b[4];
  9305. # lseek (fd, offset, SEEK_SET);
  9306. # read (fd, b, 4);
  9307. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  9308. # }
  9309. #
  9310. # static unsigned int
  9311. # pe_as32 (ptr)
  9312. # void *ptr;
  9313. # {
  9314. # unsigned char *b = ptr;
  9315. # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  9316. # }
  9317. #
  9318. # int
  9319. # main (argc, argv)
  9320. # int argc;
  9321. # char *argv[];
  9322. # {
  9323. # int dll;
  9324. # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  9325. # unsigned long export_rva, export_size, nsections, secptr, expptr;
  9326. # unsigned long name_rvas, nexp;
  9327. # unsigned char *expdata, *erva;
  9328. # char *filename, *dll_name;
  9329. #
  9330. # filename = argv[1];
  9331. #
  9332. # dll = open(filename, O_RDONLY|O_BINARY);
  9333. # if (dll < 1)
  9334. # return 1;
  9335. #
  9336. # dll_name = filename;
  9337. #
  9338. # for (i=0; filename[i]; i++)
  9339. # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
  9340. # dll_name = filename + i +1;
  9341. #
  9342. # pe_header_offset = pe_get32 (dll, 0x3c);
  9343. # opthdr_ofs = pe_header_offset + 4 + 20;
  9344. # num_entries = pe_get32 (dll, opthdr_ofs + 92);
  9345. #
  9346. # if (num_entries < 1) /* no exports */
  9347. # return 1;
  9348. #
  9349. # export_rva = pe_get32 (dll, opthdr_ofs + 96);
  9350. # export_size = pe_get32 (dll, opthdr_ofs + 100);
  9351. # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  9352. # secptr = (pe_header_offset + 4 + 20 +
  9353. # pe_get16 (dll, pe_header_offset + 4 + 16));
  9354. #
  9355. # expptr = 0;
  9356. # for (i = 0; i < nsections; i++)
  9357. # {
  9358. # char sname[8];
  9359. # unsigned long secptr1 = secptr + 40 * i;
  9360. # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  9361. # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  9362. # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  9363. # lseek(dll, secptr1, SEEK_SET);
  9364. # read(dll, sname, 8);
  9365. # if (vaddr <= export_rva && vaddr+vsize > export_rva)
  9366. # {
  9367. # expptr = fptr + (export_rva - vaddr);
  9368. # if (export_rva + export_size > vaddr + vsize)
  9369. # export_size = vsize - (export_rva - vaddr);
  9370. # break;
  9371. # }
  9372. # }
  9373. #
  9374. # expdata = (unsigned char*)malloc(export_size);
  9375. # lseek (dll, expptr, SEEK_SET);
  9376. # read (dll, expdata, export_size);
  9377. # erva = expdata - export_rva;
  9378. #
  9379. # nexp = pe_as32 (expdata+24);
  9380. # name_rvas = pe_as32 (expdata+32);
  9381. #
  9382. # printf ("EXPORTS\n");
  9383. # for (i = 0; i<nexp; i++)
  9384. # {
  9385. # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  9386. # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  9387. # }
  9388. #
  9389. # return 0;
  9390. # }
  9391. # /* impgen.c ends here */
  9392. ])# _LT_AC_FILE_IMPGEN_C
  9393. # _LT_AC_TAGVAR(VARNAME, [TAGNAME])
  9394. # ---------------------------------
  9395. AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
  9396. # old names
  9397. AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
  9398. AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
  9399. AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
  9400. AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
  9401. AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
  9402. AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
  9403. AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
  9404. # This is just to silence aclocal about the macro not being used
  9405. ifelse([AC_DISABLE_FAST_INSTALL])
  9406. AC_DEFUN([LT_AC_PROG_GCJ],
  9407. [AC_CHECK_TOOL(GCJ, gcj, no)
  9408. test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
  9409. AC_SUBST(GCJFLAGS)
  9410. ])
  9411. AC_DEFUN([LT_AC_PROG_RC],
  9412. [AC_CHECK_TOOL(RC, windres, no)
  9413. ])
  9414. ############################################################
  9415. # NOTE: This macro has been submitted for inclusion into #
  9416. # GNU Autoconf as AC_PROG_SED. When it is available in #
  9417. # a released version of Autoconf we should remove this #
  9418. # macro and use it instead. #
  9419. ############################################################
  9420. # LT_AC_PROG_SED
  9421. # --------------
  9422. # Check for a fully-functional sed program, that truncates
  9423. # as few characters as possible. Prefer GNU sed if found.
  9424. AC_DEFUN([LT_AC_PROG_SED],
  9425. [AC_MSG_CHECKING([for a sed that does not truncate output])
  9426. AC_CACHE_VAL(lt_cv_path_SED,
  9427. [# Loop through the user's path and test for sed and gsed.
  9428. # Then use that list of sed's as ones to test for truncation.
  9429. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  9430. for as_dir in $PATH
  9431. do
  9432. IFS=$as_save_IFS
  9433. test -z "$as_dir" && as_dir=.
  9434. for ac_prog in sed gsed; do
  9435. for ac_exec_ext in '' $ac_executable_extensions; do
  9436. if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
  9437. _sed_list="$_sed_list $as_dir/$ac_prog$ac_exec_ext"
  9438. fi
  9439. done
  9440. done
  9441. done
  9442. # Create a temporary directory, and hook for its removal unless debugging.
  9443. $debug ||
  9444. {
  9445. trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
  9446. trap '{ (exit 1); exit 1; }' 1 2 13 15
  9447. }
  9448. # Create a (secure) tmp directory for tmp files.
  9449. : ${TMPDIR=/tmp}
  9450. {
  9451. tmp=`(umask 077 && mktemp -d -q "$TMPDIR/sedXXXXXX") 2>/dev/null` &&
  9452. test -n "$tmp" && test -d "$tmp"
  9453. } ||
  9454. {
  9455. tmp=$TMPDIR/sed$$-$RANDOM
  9456. (umask 077 && mkdir $tmp)
  9457. } ||
  9458. {
  9459. echo "$me: cannot create a temporary directory in $TMPDIR" >&2
  9460. { (exit 1); exit 1; }
  9461. }
  9462. _max=0
  9463. _count=0
  9464. # Add /usr/xpg4/bin/sed as it is typically found on Solaris
  9465. # along with /bin/sed that truncates output.
  9466. for _sed in $_sed_list /usr/xpg4/bin/sed; do
  9467. test ! -f ${_sed} && break
  9468. cat /dev/null > "$tmp/sed.in"
  9469. _count=0
  9470. echo $ECHO_N "0123456789$ECHO_C" >"$tmp/sed.in"
  9471. # Check for GNU sed and select it if it is found.
  9472. if "${_sed}" --version 2>&1 < /dev/null | egrep '(GNU)' > /dev/null; then
  9473. lt_cv_path_SED=${_sed}
  9474. break;
  9475. fi
  9476. while true; do
  9477. cat "$tmp/sed.in" "$tmp/sed.in" >"$tmp/sed.tmp"
  9478. mv "$tmp/sed.tmp" "$tmp/sed.in"
  9479. cp "$tmp/sed.in" "$tmp/sed.nl"
  9480. echo >>"$tmp/sed.n