acinclude.m4 329 KB

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