libtool 258 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063
  1. #! /bin/bash
  2. # libtool - Provide generalized library-building support services.
  3. # Generated automatically by config.status ()
  4. # Libtool was configured on host i-0000022c:
  5. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  6. #
  7. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
  8. # 2006, 2007, 2008 Free Software Foundation, Inc.
  9. # Written by Gordon Matzigkeit, 1996
  10. #
  11. # This file is part of GNU Libtool.
  12. #
  13. # GNU Libtool is free software; you can redistribute it and/or
  14. # modify it under the terms of the GNU General Public License as
  15. # published by the Free Software Foundation; either version 2 of
  16. # the License, or (at your option) any later version.
  17. #
  18. # As a special exception to the GNU General Public License,
  19. # if you distribute this file as part of a program or library that
  20. # is built using GNU Libtool, you may include this file under the
  21. # same distribution terms that you use for the rest of that program.
  22. #
  23. # GNU Libtool is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU General Public License
  29. # along with GNU Libtool; see the file COPYING. If not, a copy
  30. # can be downloaded from http://www.gnu.org/licenses/gpl.html, or
  31. # obtained by writing to the Free Software Foundation, Inc.,
  32. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  33. # The names of the tagged configurations supported by this script.
  34. available_tags="CXX "
  35. # ### BEGIN LIBTOOL CONFIG
  36. # Which release of libtool.m4 was used?
  37. macro_version=2.2.6b
  38. macro_revision=1.3017
  39. # Whether or not to build shared libraries.
  40. build_libtool_libs=yes
  41. # Whether or not to build static libraries.
  42. build_old_libs=no
  43. # What type of objects to build.
  44. pic_mode=default
  45. # Whether or not to optimize for fast installation.
  46. fast_install=yes
  47. # The host system.
  48. host_alias=x86_64-unknown-linux-gnu
  49. host=x86_64-unknown-linux-gnu
  50. host_os=linux-gnu
  51. # The build system.
  52. build_alias=
  53. build=x86_64-unknown-linux-gnu
  54. build_os=linux-gnu
  55. # A sed program that does not truncate output.
  56. SED="/bin/sed"
  57. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  58. Xsed="$SED -e 1s/^X//"
  59. # A grep program that handles long lines.
  60. GREP="/bin/grep"
  61. # An ERE matcher.
  62. EGREP="/bin/grep -E"
  63. # A literal string matcher.
  64. FGREP="/bin/grep -F"
  65. # A BSD- or MS-compatible name lister.
  66. NM="/usr/bin/nm -B"
  67. # Whether we need soft or hard links.
  68. LN_S="ln -s"
  69. # What is the maximum length of a command?
  70. max_cmd_len=1572864
  71. # Object file suffix (normally "o").
  72. objext=o
  73. # Executable file suffix (normally "").
  74. exeext=
  75. # whether the shell understands "unset".
  76. lt_unset=unset
  77. # turn spaces into newlines.
  78. SP2NL="tr \\040 \\012"
  79. # turn newlines into spaces.
  80. NL2SP="tr \\015\\012 \\040\\040"
  81. # How to create reloadable object files.
  82. reload_flag=" -r"
  83. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  84. # An object symbol dumper.
  85. OBJDUMP="objdump"
  86. # Method to check whether dependent libraries are shared objects.
  87. deplibs_check_method="pass_all"
  88. # Command to use when deplibs_check_method == "file_magic".
  89. file_magic_cmd="\$MAGIC_CMD"
  90. # The archiver.
  91. AR="ar"
  92. AR_FLAGS="cru"
  93. # A symbol stripping program.
  94. STRIP="strip"
  95. # Commands used to install an old-style archive.
  96. RANLIB="ranlib"
  97. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
  98. old_postuninstall_cmds=""
  99. # A C compiler.
  100. LTCC="cc"
  101. # LTCC compiler flags.
  102. LTCFLAGS="-g -O2"
  103. # Take the output of nm and produce a listing of raw symbols and C names.
  104. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
  105. # Transform the output of nm in a proper C declaration.
  106. global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
  107. # Transform the output of nm in a C name address pair.
  108. global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
  109. # Transform the output of nm in a C name address pair when lib prefix is needed.
  110. global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
  111. # The name of the directory that contains temporary libtool files.
  112. objdir=.libs
  113. # Shell to use when invoking shell scripts.
  114. SHELL="/bin/bash"
  115. # An echo program that does not interpret backslashes.
  116. ECHO="echo"
  117. # Used to examine libraries when file_magic_cmd begins with "file".
  118. MAGIC_CMD=file
  119. # Must we lock files when doing compilation?
  120. need_locks="no"
  121. # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
  122. DSYMUTIL=""
  123. # Tool to change global to local symbols on Mac OS X.
  124. NMEDIT=""
  125. # Tool to manipulate fat objects and archives on Mac OS X.
  126. LIPO=""
  127. # ldd/readelf like tool for Mach-O binaries on Mac OS X.
  128. OTOOL=""
  129. # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
  130. OTOOL64=""
  131. # Old archive suffix (normally "a").
  132. libext=a
  133. # Shared library suffix (normally ".so").
  134. shrext_cmds=".so"
  135. # The commands to extract the exported symbol list from a shared archive.
  136. extract_expsyms_cmds=""
  137. # Variables whose values should be saved in libtool wrapper scripts and
  138. # restored at link time.
  139. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  140. # Do we need the "lib" prefix for modules?
  141. need_lib_prefix=no
  142. # Do we need a version for libraries?
  143. need_version=no
  144. # Library versioning type.
  145. version_type=linux
  146. # Shared library runtime path variable.
  147. runpath_var=LD_RUN_PATH
  148. # Shared library path variable.
  149. shlibpath_var=LD_LIBRARY_PATH
  150. # Is shlibpath searched before the hard-coded library search path?
  151. shlibpath_overrides_runpath=no
  152. # Format of library name prefix.
  153. libname_spec="lib\$name"
  154. # List of archive names. First name is the real one, the rest are links.
  155. # The last name is the one that the linker finds with -lNAME
  156. library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
  157. # The coded name of the library, if different from the real name.
  158. soname_spec="\${libname}\${release}\${shared_ext}\$major"
  159. # Command to use after installation of a shared archive.
  160. postinstall_cmds=""
  161. # Command to use after uninstallation of a shared archive.
  162. postuninstall_cmds=""
  163. # Commands used to finish a libtool library installation in a directory.
  164. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  165. # As "finish_cmds", except a single script fragment to be evaled but
  166. # not shown.
  167. finish_eval=""
  168. # Whether we should hardcode library paths into libraries.
  169. hardcode_into_libs=yes
  170. # Compile-time system search path for libraries.
  171. sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.4.3 /usr/lib /lib"
  172. # Run-time system search path for libraries.
  173. sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu "
  174. # Whether dlopen is supported.
  175. dlopen_support=unknown
  176. # Whether dlopen of programs is supported.
  177. dlopen_self=unknown
  178. # Whether dlopen of statically linked programs is supported.
  179. dlopen_self_static=unknown
  180. # Commands to strip libraries.
  181. old_striplib="strip --strip-debug"
  182. striplib="strip --strip-unneeded"
  183. # The linker used to build libraries.
  184. LD="/usr/bin/ld -m elf_x86_64"
  185. # Commands used to build an old-style archive.
  186. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
  187. # A language specific compiler.
  188. CC="cc"
  189. # Is the compiler the GNU compiler?
  190. with_gcc=yes
  191. # Compiler flag to turn off builtin functions.
  192. no_builtin_flag=" -fno-builtin"
  193. # How to pass a linker flag through the compiler.
  194. wl="-Wl,"
  195. # Additional compiler flags for building library objects.
  196. pic_flag=" -fPIC -DPIC"
  197. # Compiler flag to prevent dynamic linking.
  198. link_static_flag="-static"
  199. # Does compiler simultaneously support -c and -o options?
  200. compiler_c_o="yes"
  201. # Whether or not to add -lc for building shared libraries.
  202. build_libtool_need_lc=no
  203. # Whether or not to disallow shared libs when runtime libs are static.
  204. allow_libtool_libs_with_static_runtimes=no
  205. # Compiler flag to allow reflexive dlopens.
  206. export_dynamic_flag_spec="\${wl}--export-dynamic"
  207. # Compiler flag to generate shared objects directly from archives.
  208. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
  209. # Whether the compiler copes with passing no objects directly.
  210. compiler_needs_object="no"
  211. # Create an old-style archive from a shared archive.
  212. old_archive_from_new_cmds=""
  213. # Create a temporary old-style archive to link instead of a shared archive.
  214. old_archive_from_expsyms_cmds=""
  215. # Commands used to build a shared archive.
  216. archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
  217. archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  218. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  219. echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  220. \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
  221. # Commands used to build a loadable module if different from building
  222. # a shared archive.
  223. module_cmds=""
  224. module_expsym_cmds=""
  225. # Whether we are building with GNU ld or not.
  226. with_gnu_ld="yes"
  227. # Flag that allows shared libraries with undefined symbols to be built.
  228. allow_undefined_flag=""
  229. # Flag that enforces no undefined symbols.
  230. no_undefined_flag=""
  231. # Flag to hardcode $libdir into a binary during linking.
  232. # This must work even if $libdir does not exist
  233. hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
  234. # If ld is used when linking, flag to hardcode $libdir into a binary
  235. # during linking. This must work even if $libdir does not exist.
  236. hardcode_libdir_flag_spec_ld=""
  237. # Whether we need a single "-rpath" flag with a separated argument.
  238. hardcode_libdir_separator=""
  239. # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  240. # DIR into the resulting binary.
  241. hardcode_direct=no
  242. # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  243. # DIR into the resulting binary and the resulting library dependency is
  244. # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
  245. # library is relocated.
  246. hardcode_direct_absolute=no
  247. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  248. # into the resulting binary.
  249. hardcode_minus_L=no
  250. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  251. # into the resulting binary.
  252. hardcode_shlibpath_var=unsupported
  253. # Set to "yes" if building a shared library automatically hardcodes DIR
  254. # into the library and all subsequent libraries and executables linked
  255. # against it.
  256. hardcode_automatic=no
  257. # Set to yes if linker adds runtime paths of dependent libraries
  258. # to runtime path list.
  259. inherit_rpath=no
  260. # Whether libtool must link a program against all its dependency libraries.
  261. link_all_deplibs=no
  262. # Fix the shell variable $srcfile for the compiler.
  263. fix_srcfile_path=""
  264. # Set to "yes" if exported symbols are required.
  265. always_export_symbols=no
  266. # The commands to list exported symbols.
  267. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  268. # Symbols that should not be listed in the preloaded symbols.
  269. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  270. # Symbols that must always be exported.
  271. include_expsyms=""
  272. # Commands necessary for linking programs (against libraries) with templates.
  273. prelink_cmds=""
  274. # Specify filename containing input files.
  275. file_list_spec=""
  276. # How to hardcode a shared library path into an executable.
  277. hardcode_action=immediate
  278. # The directories searched by this compiler when creating a shared library.
  279. compiler_lib_search_dirs=""
  280. # Dependencies to place before and after the objects being linked to
  281. # create a shared library.
  282. predep_objects=""
  283. postdep_objects=""
  284. predeps=""
  285. postdeps=""
  286. # The library search path used internally by the compiler when linking
  287. # a shared library.
  288. compiler_lib_search_path=""
  289. # ### END LIBTOOL CONFIG
  290. # Generated from ltmain.m4sh.
  291. # ltmain.sh (GNU libtool) 2.2.6b
  292. # Written by Gordon Matzigkeit <[email protected]>, 1996
  293. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
  294. # This is free software; see the source for copying conditions. There is NO
  295. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  296. # GNU Libtool is free software; you can redistribute it and/or modify
  297. # it under the terms of the GNU General Public License as published by
  298. # the Free Software Foundation; either version 2 of the License, or
  299. # (at your option) any later version.
  300. #
  301. # As a special exception to the GNU General Public License,
  302. # if you distribute this file as part of a program or library that
  303. # is built using GNU Libtool, you may include this file under the
  304. # same distribution terms that you use for the rest of that program.
  305. #
  306. # GNU Libtool is distributed in the hope that it will be useful, but
  307. # WITHOUT ANY WARRANTY; without even the implied warranty of
  308. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  309. # General Public License for more details.
  310. #
  311. # You should have received a copy of the GNU General Public License
  312. # along with GNU Libtool; see the file COPYING. If not, a copy
  313. # can be downloaded from http://www.gnu.org/licenses/gpl.html,
  314. # or obtained by writing to the Free Software Foundation, Inc.,
  315. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  316. # Usage: $progname [OPTION]... [MODE-ARG]...
  317. #
  318. # Provide generalized library-building support services.
  319. #
  320. # --config show all configuration variables
  321. # --debug enable verbose shell tracing
  322. # -n, --dry-run display commands without modifying any files
  323. # --features display basic configuration information and exit
  324. # --mode=MODE use operation mode MODE
  325. # --preserve-dup-deps don't remove duplicate dependency libraries
  326. # --quiet, --silent don't print informational messages
  327. # --tag=TAG use configuration variables from tag TAG
  328. # -v, --verbose print informational messages (default)
  329. # --version print version information
  330. # -h, --help print short or long help message
  331. #
  332. # MODE must be one of the following:
  333. #
  334. # clean remove files from the build directory
  335. # compile compile a source file into a libtool object
  336. # execute automatically set library path, then run a program
  337. # finish complete the installation of libtool libraries
  338. # install install libraries or executables
  339. # link create a library or an executable
  340. # uninstall remove libraries from an installed directory
  341. #
  342. # MODE-ARGS vary depending on the MODE.
  343. # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
  344. #
  345. # When reporting a bug, please describe a test case to reproduce it and
  346. # include the following information:
  347. #
  348. # host-triplet: $host
  349. # shell: $SHELL
  350. # compiler: $LTCC
  351. # compiler flags: $LTCFLAGS
  352. # linker: $LD (gnu? $with_gnu_ld)
  353. # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1
  354. # automake: $automake_version
  355. # autoconf: $autoconf_version
  356. #
  357. # Report bugs to <[email protected]>.
  358. PROGRAM=ltmain.sh
  359. PACKAGE=libtool
  360. VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"
  361. TIMESTAMP=""
  362. package_revision=1.3017
  363. # Be Bourne compatible
  364. if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  365. emulate sh
  366. NULLCMD=:
  367. # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
  368. # is contrary to our usage. Disable this feature.
  369. alias -g '${1+"$@"}'='"$@"'
  370. setopt NO_GLOB_SUBST
  371. else
  372. case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
  373. fi
  374. BIN_SH=xpg4; export BIN_SH # for Tru64
  375. DUALCASE=1; export DUALCASE # for MKS sh
  376. # NLS nuisances: We save the old values to restore during execute mode.
  377. # Only set LANG and LC_ALL to C if already set.
  378. # These must not be set unconditionally because not all systems understand
  379. # e.g. LANG=C (notably SCO).
  380. lt_user_locale=
  381. lt_safe_locale=
  382. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  383. do
  384. eval "if test \"\${$lt_var+set}\" = set; then
  385. save_$lt_var=\$$lt_var
  386. $lt_var=C
  387. export $lt_var
  388. lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
  389. lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
  390. fi"
  391. done
  392. $lt_unset CDPATH
  393. : ${CP="cp -f"}
  394. : ${ECHO="echo"}
  395. : ${EGREP="/bin/grep -E"}
  396. : ${FGREP="/bin/grep -F"}
  397. : ${GREP="/bin/grep"}
  398. : ${LN_S="ln -s"}
  399. : ${MAKE="make"}
  400. : ${MKDIR="mkdir"}
  401. : ${MV="mv -f"}
  402. : ${RM="rm -f"}
  403. : ${SED="/bin/sed"}
  404. : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  405. : ${Xsed="$SED -e 1s/^X//"}
  406. # Global variables:
  407. EXIT_SUCCESS=0
  408. EXIT_FAILURE=1
  409. EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  410. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  411. exit_status=$EXIT_SUCCESS
  412. # Make sure IFS has a sensible default
  413. lt_nl='
  414. '
  415. IFS=" $lt_nl"
  416. dirname="s,/[^/]*$,,"
  417. basename="s,^.*/,,"
  418. # func_dirname_and_basename file append nondir_replacement
  419. # perform func_basename and func_dirname in a single function
  420. # call:
  421. # dirname: Compute the dirname of FILE. If nonempty,
  422. # add APPEND to the result, otherwise set result
  423. # to NONDIR_REPLACEMENT.
  424. # value returned in "$func_dirname_result"
  425. # basename: Compute filename of FILE.
  426. # value retuned in "$func_basename_result"
  427. # Implementation must be kept synchronized with func_dirname
  428. # and func_basename. For efficiency, we do not delegate to
  429. # those functions but instead duplicate the functionality here.
  430. func_dirname_and_basename ()
  431. {
  432. # Extract subdirectory from the argument.
  433. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
  434. if test "X$func_dirname_result" = "X${1}"; then
  435. func_dirname_result="${3}"
  436. else
  437. func_dirname_result="$func_dirname_result${2}"
  438. fi
  439. func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
  440. }
  441. # Generated shell functions inserted here.
  442. # func_dirname file append nondir_replacement
  443. # Compute the dirname of FILE. If nonempty, add APPEND to the result,
  444. # otherwise set result to NONDIR_REPLACEMENT.
  445. func_dirname ()
  446. {
  447. case ${1} in
  448. */*) func_dirname_result="${1%/*}${2}" ;;
  449. * ) func_dirname_result="${3}" ;;
  450. esac
  451. }
  452. # func_basename file
  453. func_basename ()
  454. {
  455. func_basename_result="${1##*/}"
  456. }
  457. # func_dirname_and_basename file append nondir_replacement
  458. # perform func_basename and func_dirname in a single function
  459. # call:
  460. # dirname: Compute the dirname of FILE. If nonempty,
  461. # add APPEND to the result, otherwise set result
  462. # to NONDIR_REPLACEMENT.
  463. # value returned in "$func_dirname_result"
  464. # basename: Compute filename of FILE.
  465. # value retuned in "$func_basename_result"
  466. # Implementation must be kept synchronized with func_dirname
  467. # and func_basename. For efficiency, we do not delegate to
  468. # those functions but instead duplicate the functionality here.
  469. func_dirname_and_basename ()
  470. {
  471. case ${1} in
  472. */*) func_dirname_result="${1%/*}${2}" ;;
  473. * ) func_dirname_result="${3}" ;;
  474. esac
  475. func_basename_result="${1##*/}"
  476. }
  477. # func_stripname prefix suffix name
  478. # strip PREFIX and SUFFIX off of NAME.
  479. # PREFIX and SUFFIX must not contain globbing or regex special
  480. # characters, hashes, percent signs, but SUFFIX may contain a leading
  481. # dot (in which case that matches only a dot).
  482. func_stripname ()
  483. {
  484. # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  485. # positional parameters, so assign one to ordinary parameter first.
  486. func_stripname_result=${3}
  487. func_stripname_result=${func_stripname_result#"${1}"}
  488. func_stripname_result=${func_stripname_result%"${2}"}
  489. }
  490. # func_opt_split
  491. func_opt_split ()
  492. {
  493. func_opt_split_opt=${1%%=*}
  494. func_opt_split_arg=${1#*=}
  495. }
  496. # func_lo2o object
  497. func_lo2o ()
  498. {
  499. case ${1} in
  500. *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
  501. *) func_lo2o_result=${1} ;;
  502. esac
  503. }
  504. # func_xform libobj-or-source
  505. func_xform ()
  506. {
  507. func_xform_result=${1%.*}.lo
  508. }
  509. # func_arith arithmetic-term...
  510. func_arith ()
  511. {
  512. func_arith_result=$(( $* ))
  513. }
  514. # func_len string
  515. # STRING may not start with a hyphen.
  516. func_len ()
  517. {
  518. func_len_result=${#1}
  519. }
  520. # func_append var value
  521. # Append VALUE to the end of shell variable VAR.
  522. func_append ()
  523. {
  524. eval "$1+=\$2"
  525. }
  526. # Generated shell functions inserted here.
  527. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  528. # is ksh but when the shell is invoked as "sh" and the current value of
  529. # the _XPG environment variable is not equal to 1 (one), the special
  530. # positional parameter $0, within a function call, is the name of the
  531. # function.
  532. progpath="$0"
  533. # The name of this program:
  534. # In the unlikely event $progname began with a '-', it would play havoc with
  535. # func_echo (imagine progname=-n), so we prepend ./ in that case:
  536. func_dirname_and_basename "$progpath"
  537. progname=$func_basename_result
  538. case $progname in
  539. -*) progname=./$progname ;;
  540. esac
  541. # Make sure we have an absolute path for reexecution:
  542. case $progpath in
  543. [\\/]*|[A-Za-z]:\\*) ;;
  544. *[\\/]*)
  545. progdir=$func_dirname_result
  546. progdir=`cd "$progdir" && pwd`
  547. progpath="$progdir/$progname"
  548. ;;
  549. *)
  550. save_IFS="$IFS"
  551. IFS=:
  552. for progdir in $PATH; do
  553. IFS="$save_IFS"
  554. test -x "$progdir/$progname" && break
  555. done
  556. IFS="$save_IFS"
  557. test -n "$progdir" || progdir=`pwd`
  558. progpath="$progdir/$progname"
  559. ;;
  560. esac
  561. # Sed substitution that helps us do robust quoting. It backslashifies
  562. # metacharacters that are still active within double-quoted strings.
  563. Xsed="${SED}"' -e 1s/^X//'
  564. sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
  565. # Same as above, but do not quote variable references.
  566. double_quote_subst='s/\(["`\\]\)/\\\1/g'
  567. # Re-`\' parameter expansions in output of double_quote_subst that were
  568. # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
  569. # in input to double_quote_subst, that '$' was protected from expansion.
  570. # Since each input `\' is now two `\'s, look for any number of runs of
  571. # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
  572. bs='\\'
  573. bs2='\\\\'
  574. bs4='\\\\\\\\'
  575. dollar='\$'
  576. sed_double_backslash="\
  577. s/$bs4/&\\
  578. /g
  579. s/^$bs2$dollar/$bs&/
  580. s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
  581. s/\n//g"
  582. # Standard options:
  583. opt_dry_run=false
  584. opt_help=false
  585. opt_quiet=false
  586. opt_verbose=false
  587. opt_warning=:
  588. # func_echo arg...
  589. # Echo program name prefixed message, along with the current mode
  590. # name if it has been set yet.
  591. func_echo ()
  592. {
  593. $ECHO "$progname${mode+: }$mode: $*"
  594. }
  595. # func_verbose arg...
  596. # Echo program name prefixed message in verbose mode only.
  597. func_verbose ()
  598. {
  599. $opt_verbose && func_echo ${1+"$@"}
  600. # A bug in bash halts the script if the last line of a function
  601. # fails when set -e is in force, so we need another command to
  602. # work around that:
  603. :
  604. }
  605. # func_error arg...
  606. # Echo program name prefixed message to standard error.
  607. func_error ()
  608. {
  609. $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
  610. }
  611. # func_warning arg...
  612. # Echo program name prefixed warning message to standard error.
  613. func_warning ()
  614. {
  615. $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
  616. # bash bug again:
  617. :
  618. }
  619. # func_fatal_error arg...
  620. # Echo program name prefixed message to standard error, and exit.
  621. func_fatal_error ()
  622. {
  623. func_error ${1+"$@"}
  624. exit $EXIT_FAILURE
  625. }
  626. # func_fatal_help arg...
  627. # Echo program name prefixed message to standard error, followed by
  628. # a help hint, and exit.
  629. func_fatal_help ()
  630. {
  631. func_error ${1+"$@"}
  632. func_fatal_error "$help"
  633. }
  634. help="Try \`$progname --help' for more information." ## default
  635. # func_grep expression filename
  636. # Check whether EXPRESSION matches any line of FILENAME, without output.
  637. func_grep ()
  638. {
  639. $GREP "$1" "$2" >/dev/null 2>&1
  640. }
  641. # func_mkdir_p directory-path
  642. # Make sure the entire path to DIRECTORY-PATH is available.
  643. func_mkdir_p ()
  644. {
  645. my_directory_path="$1"
  646. my_dir_list=
  647. if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
  648. # Protect directory names starting with `-'
  649. case $my_directory_path in
  650. -*) my_directory_path="./$my_directory_path" ;;
  651. esac
  652. # While some portion of DIR does not yet exist...
  653. while test ! -d "$my_directory_path"; do
  654. # ...make a list in topmost first order. Use a colon delimited
  655. # list incase some portion of path contains whitespace.
  656. my_dir_list="$my_directory_path:$my_dir_list"
  657. # If the last portion added has no slash in it, the list is done
  658. case $my_directory_path in */*) ;; *) break ;; esac
  659. # ...otherwise throw away the child directory and loop
  660. my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
  661. done
  662. my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
  663. save_mkdir_p_IFS="$IFS"; IFS=':'
  664. for my_dir in $my_dir_list; do
  665. IFS="$save_mkdir_p_IFS"
  666. # mkdir can fail with a `File exist' error if two processes
  667. # try to create one of the directories concurrently. Don't
  668. # stop in that case!
  669. $MKDIR "$my_dir" 2>/dev/null || :
  670. done
  671. IFS="$save_mkdir_p_IFS"
  672. # Bail out if we (or some other process) failed to create a directory.
  673. test -d "$my_directory_path" || \
  674. func_fatal_error "Failed to create \`$1'"
  675. fi
  676. }
  677. # func_mktempdir [string]
  678. # Make a temporary directory that won't clash with other running
  679. # libtool processes, and avoids race conditions if possible. If
  680. # given, STRING is the basename for that directory.
  681. func_mktempdir ()
  682. {
  683. my_template="${TMPDIR-/tmp}/${1-$progname}"
  684. if test "$opt_dry_run" = ":"; then
  685. # Return a directory name, but don't create it in dry-run mode
  686. my_tmpdir="${my_template}-$$"
  687. else
  688. # If mktemp works, use that first and foremost
  689. my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
  690. if test ! -d "$my_tmpdir"; then
  691. # Failing that, at least try and use $RANDOM to avoid a race
  692. my_tmpdir="${my_template}-${RANDOM-0}$$"
  693. save_mktempdir_umask=`umask`
  694. umask 0077
  695. $MKDIR "$my_tmpdir"
  696. umask $save_mktempdir_umask
  697. fi
  698. # If we're not in dry-run mode, bomb out on failure
  699. test -d "$my_tmpdir" || \
  700. func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
  701. fi
  702. $ECHO "X$my_tmpdir" | $Xsed
  703. }
  704. # func_quote_for_eval arg
  705. # Aesthetically quote ARG to be evaled later.
  706. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
  707. # is double-quoted, suitable for a subsequent eval, whereas
  708. # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
  709. # which are still active within double quotes backslashified.
  710. func_quote_for_eval ()
  711. {
  712. case $1 in
  713. *[\\\`\"\$]*)
  714. func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
  715. *)
  716. func_quote_for_eval_unquoted_result="$1" ;;
  717. esac
  718. case $func_quote_for_eval_unquoted_result in
  719. # Double-quote args containing shell metacharacters to delay
  720. # word splitting, command substitution and and variable
  721. # expansion for a subsequent eval.
  722. # Many Bourne shells cannot handle close brackets correctly
  723. # in scan sets, so we specify it separately.
  724. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  725. func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
  726. ;;
  727. *)
  728. func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
  729. esac
  730. }
  731. # func_quote_for_expand arg
  732. # Aesthetically quote ARG to be evaled later; same as above,
  733. # but do not quote variable references.
  734. func_quote_for_expand ()
  735. {
  736. case $1 in
  737. *[\\\`\"]*)
  738. my_arg=`$ECHO "X$1" | $Xsed \
  739. -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
  740. *)
  741. my_arg="$1" ;;
  742. esac
  743. case $my_arg in
  744. # Double-quote args containing shell metacharacters to delay
  745. # word splitting and command substitution for a subsequent eval.
  746. # Many Bourne shells cannot handle close brackets correctly
  747. # in scan sets, so we specify it separately.
  748. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  749. my_arg="\"$my_arg\""
  750. ;;
  751. esac
  752. func_quote_for_expand_result="$my_arg"
  753. }
  754. # func_show_eval cmd [fail_exp]
  755. # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
  756. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  757. # is given, then evaluate it.
  758. func_show_eval ()
  759. {
  760. my_cmd="$1"
  761. my_fail_exp="${2-:}"
  762. ${opt_silent-false} || {
  763. func_quote_for_expand "$my_cmd"
  764. eval "func_echo $func_quote_for_expand_result"
  765. }
  766. if ${opt_dry_run-false}; then :; else
  767. eval "$my_cmd"
  768. my_status=$?
  769. if test "$my_status" -eq 0; then :; else
  770. eval "(exit $my_status); $my_fail_exp"
  771. fi
  772. fi
  773. }
  774. # func_show_eval_locale cmd [fail_exp]
  775. # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
  776. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  777. # is given, then evaluate it. Use the saved locale for evaluation.
  778. func_show_eval_locale ()
  779. {
  780. my_cmd="$1"
  781. my_fail_exp="${2-:}"
  782. ${opt_silent-false} || {
  783. func_quote_for_expand "$my_cmd"
  784. eval "func_echo $func_quote_for_expand_result"
  785. }
  786. if ${opt_dry_run-false}; then :; else
  787. eval "$lt_user_locale
  788. $my_cmd"
  789. my_status=$?
  790. eval "$lt_safe_locale"
  791. if test "$my_status" -eq 0; then :; else
  792. eval "(exit $my_status); $my_fail_exp"
  793. fi
  794. fi
  795. }
  796. # func_version
  797. # Echo version message to standard output and exit.
  798. func_version ()
  799. {
  800. $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
  801. s/^# //
  802. s/^# *$//
  803. s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
  804. p
  805. }' < "$progpath"
  806. exit $?
  807. }
  808. # func_usage
  809. # Echo short help message to standard output and exit.
  810. func_usage ()
  811. {
  812. $SED -n '/^# Usage:/,/# -h/ {
  813. s/^# //
  814. s/^# *$//
  815. s/\$progname/'$progname'/
  816. p
  817. }' < "$progpath"
  818. $ECHO
  819. $ECHO "run \`$progname --help | more' for full usage"
  820. exit $?
  821. }
  822. # func_help
  823. # Echo long help message to standard output and exit.
  824. func_help ()
  825. {
  826. $SED -n '/^# Usage:/,/# Report bugs to/ {
  827. s/^# //
  828. s/^# *$//
  829. s*\$progname*'$progname'*
  830. s*\$host*'"$host"'*
  831. s*\$SHELL*'"$SHELL"'*
  832. s*\$LTCC*'"$LTCC"'*
  833. s*\$LTCFLAGS*'"$LTCFLAGS"'*
  834. s*\$LD*'"$LD"'*
  835. s/\$with_gnu_ld/'"$with_gnu_ld"'/
  836. s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
  837. s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
  838. p
  839. }' < "$progpath"
  840. exit $?
  841. }
  842. # func_missing_arg argname
  843. # Echo program name prefixed message to standard error and set global
  844. # exit_cmd.
  845. func_missing_arg ()
  846. {
  847. func_error "missing argument for $1"
  848. exit_cmd=exit
  849. }
  850. exit_cmd=:
  851. # Check that we have a working $ECHO.
  852. if test "X$1" = X--no-reexec; then
  853. # Discard the --no-reexec flag, and continue.
  854. shift
  855. elif test "X$1" = X--fallback-echo; then
  856. # Avoid inline document here, it may be left over
  857. :
  858. elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
  859. # Yippee, $ECHO works!
  860. :
  861. else
  862. # Restart under the correct shell, and then maybe $ECHO will work.
  863. exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  864. fi
  865. if test "X$1" = X--fallback-echo; then
  866. # used as fallback echo
  867. shift
  868. cat <<EOF
  869. $*
  870. EOF
  871. exit $EXIT_SUCCESS
  872. fi
  873. magic="%%%MAGIC variable%%%"
  874. magic_exe="%%%MAGIC EXE variable%%%"
  875. # Global variables.
  876. # $mode is unset
  877. nonopt=
  878. execute_dlfiles=
  879. preserve_args=
  880. lo2o="s/\\.lo\$/.${objext}/"
  881. o2lo="s/\\.${objext}\$/.lo/"
  882. extracted_archives=
  883. extracted_serial=0
  884. opt_dry_run=false
  885. opt_duplicate_deps=false
  886. opt_silent=false
  887. opt_debug=:
  888. # If this variable is set in any of the actions, the command in it
  889. # will be execed at the end. This prevents here-documents from being
  890. # left over by shells.
  891. exec_cmd=
  892. # func_fatal_configuration arg...
  893. # Echo program name prefixed message to standard error, followed by
  894. # a configuration failure hint, and exit.
  895. func_fatal_configuration ()
  896. {
  897. func_error ${1+"$@"}
  898. func_error "See the $PACKAGE documentation for more information."
  899. func_fatal_error "Fatal configuration error."
  900. }
  901. # func_config
  902. # Display the configuration for all the tags in this script.
  903. func_config ()
  904. {
  905. re_begincf='^# ### BEGIN LIBTOOL'
  906. re_endcf='^# ### END LIBTOOL'
  907. # Default configuration.
  908. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  909. # Now print the configurations for the tags.
  910. for tagname in $taglist; do
  911. $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  912. done
  913. exit $?
  914. }
  915. # func_features
  916. # Display the features supported by this script.
  917. func_features ()
  918. {
  919. $ECHO "host: $host"
  920. if test "$build_libtool_libs" = yes; then
  921. $ECHO "enable shared libraries"
  922. else
  923. $ECHO "disable shared libraries"
  924. fi
  925. if test "$build_old_libs" = yes; then
  926. $ECHO "enable static libraries"
  927. else
  928. $ECHO "disable static libraries"
  929. fi
  930. exit $?
  931. }
  932. # func_enable_tag tagname
  933. # Verify that TAGNAME is valid, and either flag an error and exit, or
  934. # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  935. # variable here.
  936. func_enable_tag ()
  937. {
  938. # Global variable:
  939. tagname="$1"
  940. re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  941. re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  942. sed_extractcf="/$re_begincf/,/$re_endcf/p"
  943. # Validate tagname.
  944. case $tagname in
  945. *[!-_A-Za-z0-9,/]*)
  946. func_fatal_error "invalid tag name: $tagname"
  947. ;;
  948. esac
  949. # Don't test for the "default" C tag, as we know it's
  950. # there but not specially marked.
  951. case $tagname in
  952. CC) ;;
  953. *)
  954. if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  955. taglist="$taglist $tagname"
  956. # Evaluate the configuration. Be careful to quote the path
  957. # and the sed script, to avoid splitting on whitespace, but
  958. # also don't use non-portable quotes within backquotes within
  959. # quotes we have to do it in 2 steps:
  960. extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  961. eval "$extractedcf"
  962. else
  963. func_error "ignoring unknown tag $tagname"
  964. fi
  965. ;;
  966. esac
  967. }
  968. # Parse options once, thoroughly. This comes as soon as possible in
  969. # the script to make things like `libtool --version' happen quickly.
  970. {
  971. # Shorthand for --mode=foo, only valid as the first argument
  972. case $1 in
  973. clean|clea|cle|cl)
  974. shift; set dummy --mode clean ${1+"$@"}; shift
  975. ;;
  976. compile|compil|compi|comp|com|co|c)
  977. shift; set dummy --mode compile ${1+"$@"}; shift
  978. ;;
  979. execute|execut|execu|exec|exe|ex|e)
  980. shift; set dummy --mode execute ${1+"$@"}; shift
  981. ;;
  982. finish|finis|fini|fin|fi|f)
  983. shift; set dummy --mode finish ${1+"$@"}; shift
  984. ;;
  985. install|instal|insta|inst|ins|in|i)
  986. shift; set dummy --mode install ${1+"$@"}; shift
  987. ;;
  988. link|lin|li|l)
  989. shift; set dummy --mode link ${1+"$@"}; shift
  990. ;;
  991. uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  992. shift; set dummy --mode uninstall ${1+"$@"}; shift
  993. ;;
  994. esac
  995. # Parse non-mode specific arguments:
  996. while test "$#" -gt 0; do
  997. opt="$1"
  998. shift
  999. case $opt in
  1000. --config) func_config ;;
  1001. --debug) preserve_args="$preserve_args $opt"
  1002. func_echo "enabling shell trace mode"
  1003. opt_debug='set -x'
  1004. $opt_debug
  1005. ;;
  1006. -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
  1007. execute_dlfiles="$execute_dlfiles $1"
  1008. shift
  1009. ;;
  1010. --dry-run | -n) opt_dry_run=: ;;
  1011. --features) func_features ;;
  1012. --finish) mode="finish" ;;
  1013. --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
  1014. case $1 in
  1015. # Valid mode arguments:
  1016. clean) ;;
  1017. compile) ;;
  1018. execute) ;;
  1019. finish) ;;
  1020. install) ;;
  1021. link) ;;
  1022. relink) ;;
  1023. uninstall) ;;
  1024. # Catch anything else as an error
  1025. *) func_error "invalid argument for $opt"
  1026. exit_cmd=exit
  1027. break
  1028. ;;
  1029. esac
  1030. mode="$1"
  1031. shift
  1032. ;;
  1033. --preserve-dup-deps)
  1034. opt_duplicate_deps=: ;;
  1035. --quiet|--silent) preserve_args="$preserve_args $opt"
  1036. opt_silent=:
  1037. ;;
  1038. --verbose| -v) preserve_args="$preserve_args $opt"
  1039. opt_silent=false
  1040. ;;
  1041. --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
  1042. preserve_args="$preserve_args $opt $1"
  1043. func_enable_tag "$1" # tagname is set here
  1044. shift
  1045. ;;
  1046. # Separate optargs to long options:
  1047. -dlopen=*|--mode=*|--tag=*)
  1048. func_opt_split "$opt"
  1049. set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
  1050. shift
  1051. ;;
  1052. -\?|-h) func_usage ;;
  1053. --help) opt_help=: ;;
  1054. --version) func_version ;;
  1055. -*) func_fatal_help "unrecognized option \`$opt'" ;;
  1056. *) nonopt="$opt"
  1057. break
  1058. ;;
  1059. esac
  1060. done
  1061. case $host in
  1062. *cygwin* | *mingw* | *pw32* | *cegcc*)
  1063. # don't eliminate duplications in $postdeps and $predeps
  1064. opt_duplicate_compiler_generated_deps=:
  1065. ;;
  1066. *)
  1067. opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
  1068. ;;
  1069. esac
  1070. # Having warned about all mis-specified options, bail out if
  1071. # anything was wrong.
  1072. $exit_cmd $EXIT_FAILURE
  1073. }
  1074. # func_check_version_match
  1075. # Ensure that we are using m4 macros, and libtool script from the same
  1076. # release of libtool.
  1077. func_check_version_match ()
  1078. {
  1079. if test "$package_revision" != "$macro_revision"; then
  1080. if test "$VERSION" != "$macro_version"; then
  1081. if test -z "$macro_version"; then
  1082. cat >&2 <<_LT_EOF
  1083. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  1084. $progname: definition of this LT_INIT comes from an older release.
  1085. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  1086. $progname: and run autoconf again.
  1087. _LT_EOF
  1088. else
  1089. cat >&2 <<_LT_EOF
  1090. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  1091. $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  1092. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  1093. $progname: and run autoconf again.
  1094. _LT_EOF
  1095. fi
  1096. else
  1097. cat >&2 <<_LT_EOF
  1098. $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  1099. $progname: but the definition of this LT_INIT comes from revision $macro_revision.
  1100. $progname: You should recreate aclocal.m4 with macros from revision $package_revision
  1101. $progname: of $PACKAGE $VERSION and run autoconf again.
  1102. _LT_EOF
  1103. fi
  1104. exit $EXIT_MISMATCH
  1105. fi
  1106. }
  1107. ## ----------- ##
  1108. ## Main. ##
  1109. ## ----------- ##
  1110. $opt_help || {
  1111. # Sanity checks first:
  1112. func_check_version_match
  1113. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  1114. func_fatal_configuration "not configured to build any kind of library"
  1115. fi
  1116. test -z "$mode" && func_fatal_error "error: you must specify a MODE."
  1117. # Darwin sucks
  1118. eval std_shrext=\"$shrext_cmds\"
  1119. # Only execute mode is allowed to have -dlopen flags.
  1120. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  1121. func_error "unrecognized option \`-dlopen'"
  1122. $ECHO "$help" 1>&2
  1123. exit $EXIT_FAILURE
  1124. fi
  1125. # Change the help message to a mode-specific one.
  1126. generic_help="$help"
  1127. help="Try \`$progname --help --mode=$mode' for more information."
  1128. }
  1129. # func_lalib_p file
  1130. # True iff FILE is a libtool `.la' library or `.lo' object file.
  1131. # This function is only a basic sanity check; it will hardly flush out
  1132. # determined imposters.
  1133. func_lalib_p ()
  1134. {
  1135. test -f "$1" &&
  1136. $SED -e 4q "$1" 2>/dev/null \
  1137. | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  1138. }
  1139. # func_lalib_unsafe_p file
  1140. # True iff FILE is a libtool `.la' library or `.lo' object file.
  1141. # This function implements the same check as func_lalib_p without
  1142. # resorting to external programs. To this end, it redirects stdin and
  1143. # closes it afterwards, without saving the original file descriptor.
  1144. # As a safety measure, use it only where a negative result would be
  1145. # fatal anyway. Works if `file' does not exist.
  1146. func_lalib_unsafe_p ()
  1147. {
  1148. lalib_p=no
  1149. if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  1150. for lalib_p_l in 1 2 3 4
  1151. do
  1152. read lalib_p_line
  1153. case "$lalib_p_line" in
  1154. \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  1155. esac
  1156. done
  1157. exec 0<&5 5<&-
  1158. fi
  1159. test "$lalib_p" = yes
  1160. }
  1161. # func_ltwrapper_script_p file
  1162. # True iff FILE is a libtool wrapper script
  1163. # This function is only a basic sanity check; it will hardly flush out
  1164. # determined imposters.
  1165. func_ltwrapper_script_p ()
  1166. {
  1167. func_lalib_p "$1"
  1168. }
  1169. # func_ltwrapper_executable_p file
  1170. # True iff FILE is a libtool wrapper executable
  1171. # This function is only a basic sanity check; it will hardly flush out
  1172. # determined imposters.
  1173. func_ltwrapper_executable_p ()
  1174. {
  1175. func_ltwrapper_exec_suffix=
  1176. case $1 in
  1177. *.exe) ;;
  1178. *) func_ltwrapper_exec_suffix=.exe ;;
  1179. esac
  1180. $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  1181. }
  1182. # func_ltwrapper_scriptname file
  1183. # Assumes file is an ltwrapper_executable
  1184. # uses $file to determine the appropriate filename for a
  1185. # temporary ltwrapper_script.
  1186. func_ltwrapper_scriptname ()
  1187. {
  1188. func_ltwrapper_scriptname_result=""
  1189. if func_ltwrapper_executable_p "$1"; then
  1190. func_dirname_and_basename "$1" "" "."
  1191. func_stripname '' '.exe' "$func_basename_result"
  1192. func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
  1193. fi
  1194. }
  1195. # func_ltwrapper_p file
  1196. # True iff FILE is a libtool wrapper script or wrapper executable
  1197. # This function is only a basic sanity check; it will hardly flush out
  1198. # determined imposters.
  1199. func_ltwrapper_p ()
  1200. {
  1201. func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  1202. }
  1203. # func_execute_cmds commands fail_cmd
  1204. # Execute tilde-delimited COMMANDS.
  1205. # If FAIL_CMD is given, eval that upon failure.
  1206. # FAIL_CMD may read-access the current command in variable CMD!
  1207. func_execute_cmds ()
  1208. {
  1209. $opt_debug
  1210. save_ifs=$IFS; IFS='~'
  1211. for cmd in $1; do
  1212. IFS=$save_ifs
  1213. eval cmd=\"$cmd\"
  1214. func_show_eval "$cmd" "${2-:}"
  1215. done
  1216. IFS=$save_ifs
  1217. }
  1218. # func_source file
  1219. # Source FILE, adding directory component if necessary.
  1220. # Note that it is not necessary on cygwin/mingw to append a dot to
  1221. # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  1222. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  1223. # `FILE.' does not work on cygwin managed mounts.
  1224. func_source ()
  1225. {
  1226. $opt_debug
  1227. case $1 in
  1228. */* | *\\*) . "$1" ;;
  1229. *) . "./$1" ;;
  1230. esac
  1231. }
  1232. # func_infer_tag arg
  1233. # Infer tagged configuration to use if any are available and
  1234. # if one wasn't chosen via the "--tag" command line option.
  1235. # Only attempt this if the compiler in the base compile
  1236. # command doesn't match the default compiler.
  1237. # arg is usually of the form 'gcc ...'
  1238. func_infer_tag ()
  1239. {
  1240. $opt_debug
  1241. if test -n "$available_tags" && test -z "$tagname"; then
  1242. CC_quoted=
  1243. for arg in $CC; do
  1244. func_quote_for_eval "$arg"
  1245. CC_quoted="$CC_quoted $func_quote_for_eval_result"
  1246. done
  1247. case $@ in
  1248. # Blanks in the command may have been stripped by the calling shell,
  1249. # but not from the CC environment variable when configure was run.
  1250. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
  1251. # Blanks at the start of $base_compile will cause this to fail
  1252. # if we don't check for them as well.
  1253. *)
  1254. for z in $available_tags; do
  1255. if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  1256. # Evaluate the configuration.
  1257. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  1258. CC_quoted=
  1259. for arg in $CC; do
  1260. # Double-quote args containing other shell metacharacters.
  1261. func_quote_for_eval "$arg"
  1262. CC_quoted="$CC_quoted $func_quote_for_eval_result"
  1263. done
  1264. case "$@ " in
  1265. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
  1266. # The compiler in the base compile command matches
  1267. # the one in the tagged configuration.
  1268. # Assume this is the tagged configuration we want.
  1269. tagname=$z
  1270. break
  1271. ;;
  1272. esac
  1273. fi
  1274. done
  1275. # If $tagname still isn't set, then no tagged configuration
  1276. # was found and let the user know that the "--tag" command
  1277. # line option must be used.
  1278. if test -z "$tagname"; then
  1279. func_echo "unable to infer tagged configuration"
  1280. func_fatal_error "specify a tag with \`--tag'"
  1281. # else
  1282. # func_verbose "using $tagname tagged configuration"
  1283. fi
  1284. ;;
  1285. esac
  1286. fi
  1287. }
  1288. # func_write_libtool_object output_name pic_name nonpic_name
  1289. # Create a libtool object file (analogous to a ".la" file),
  1290. # but don't create it if we're doing a dry run.
  1291. func_write_libtool_object ()
  1292. {
  1293. write_libobj=${1}
  1294. if test "$build_libtool_libs" = yes; then
  1295. write_lobj=\'${2}\'
  1296. else
  1297. write_lobj=none
  1298. fi
  1299. if test "$build_old_libs" = yes; then
  1300. write_oldobj=\'${3}\'
  1301. else
  1302. write_oldobj=none
  1303. fi
  1304. $opt_dry_run || {
  1305. cat >${write_libobj}T <<EOF
  1306. # $write_libobj - a libtool object file
  1307. # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  1308. #
  1309. # Please DO NOT delete this file!
  1310. # It is necessary for linking the library.
  1311. # Name of the PIC object.
  1312. pic_object=$write_lobj
  1313. # Name of the non-PIC object
  1314. non_pic_object=$write_oldobj
  1315. EOF
  1316. $MV "${write_libobj}T" "${write_libobj}"
  1317. }
  1318. }
  1319. # func_mode_compile arg...
  1320. func_mode_compile ()
  1321. {
  1322. $opt_debug
  1323. # Get the compilation command and the source file.
  1324. base_compile=
  1325. srcfile="$nonopt" # always keep a non-empty value in "srcfile"
  1326. suppress_opt=yes
  1327. suppress_output=
  1328. arg_mode=normal
  1329. libobj=
  1330. later=
  1331. pie_flag=
  1332. for arg
  1333. do
  1334. case $arg_mode in
  1335. arg )
  1336. # do not "continue". Instead, add this to base_compile
  1337. lastarg="$arg"
  1338. arg_mode=normal
  1339. ;;
  1340. target )
  1341. libobj="$arg"
  1342. arg_mode=normal
  1343. continue
  1344. ;;
  1345. normal )
  1346. # Accept any command-line options.
  1347. case $arg in
  1348. -o)
  1349. test -n "$libobj" && \
  1350. func_fatal_error "you cannot specify \`-o' more than once"
  1351. arg_mode=target
  1352. continue
  1353. ;;
  1354. -pie | -fpie | -fPIE)
  1355. pie_flag="$pie_flag $arg"
  1356. continue
  1357. ;;
  1358. -shared | -static | -prefer-pic | -prefer-non-pic)
  1359. later="$later $arg"
  1360. continue
  1361. ;;
  1362. -no-suppress)
  1363. suppress_opt=no
  1364. continue
  1365. ;;
  1366. -Xcompiler)
  1367. arg_mode=arg # the next one goes into the "base_compile" arg list
  1368. continue # The current "srcfile" will either be retained or
  1369. ;; # replaced later. I would guess that would be a bug.
  1370. -Wc,*)
  1371. func_stripname '-Wc,' '' "$arg"
  1372. args=$func_stripname_result
  1373. lastarg=
  1374. save_ifs="$IFS"; IFS=','
  1375. for arg in $args; do
  1376. IFS="$save_ifs"
  1377. func_quote_for_eval "$arg"
  1378. lastarg="$lastarg $func_quote_for_eval_result"
  1379. done
  1380. IFS="$save_ifs"
  1381. func_stripname ' ' '' "$lastarg"
  1382. lastarg=$func_stripname_result
  1383. # Add the arguments to base_compile.
  1384. base_compile="$base_compile $lastarg"
  1385. continue
  1386. ;;
  1387. *)
  1388. # Accept the current argument as the source file.
  1389. # The previous "srcfile" becomes the current argument.
  1390. #
  1391. lastarg="$srcfile"
  1392. srcfile="$arg"
  1393. ;;
  1394. esac # case $arg
  1395. ;;
  1396. esac # case $arg_mode
  1397. # Aesthetically quote the previous argument.
  1398. func_quote_for_eval "$lastarg"
  1399. base_compile="$base_compile $func_quote_for_eval_result"
  1400. done # for arg
  1401. case $arg_mode in
  1402. arg)
  1403. func_fatal_error "you must specify an argument for -Xcompile"
  1404. ;;
  1405. target)
  1406. func_fatal_error "you must specify a target with \`-o'"
  1407. ;;
  1408. *)
  1409. # Get the name of the library object.
  1410. test -z "$libobj" && {
  1411. func_basename "$srcfile"
  1412. libobj="$func_basename_result"
  1413. }
  1414. ;;
  1415. esac
  1416. # Recognize several different file suffixes.
  1417. # If the user specifies -o file.o, it is replaced with file.lo
  1418. case $libobj in
  1419. *.[cCFSifmso] | \
  1420. *.ada | *.adb | *.ads | *.asm | \
  1421. *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  1422. *.[fF][09]? | *.for | *.java | *.obj | *.sx)
  1423. func_xform "$libobj"
  1424. libobj=$func_xform_result
  1425. ;;
  1426. esac
  1427. case $libobj in
  1428. *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  1429. *)
  1430. func_fatal_error "cannot determine name of library object from \`$libobj'"
  1431. ;;
  1432. esac
  1433. func_infer_tag $base_compile
  1434. for arg in $later; do
  1435. case $arg in
  1436. -shared)
  1437. test "$build_libtool_libs" != yes && \
  1438. func_fatal_configuration "can not build a shared library"
  1439. build_old_libs=no
  1440. continue
  1441. ;;
  1442. -static)
  1443. build_libtool_libs=no
  1444. build_old_libs=yes
  1445. continue
  1446. ;;
  1447. -prefer-pic)
  1448. pic_mode=yes
  1449. continue
  1450. ;;
  1451. -prefer-non-pic)
  1452. pic_mode=no
  1453. continue
  1454. ;;
  1455. esac
  1456. done
  1457. func_quote_for_eval "$libobj"
  1458. test "X$libobj" != "X$func_quote_for_eval_result" \
  1459. && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  1460. && func_warning "libobj name \`$libobj' may not contain shell special characters."
  1461. func_dirname_and_basename "$obj" "/" ""
  1462. objname="$func_basename_result"
  1463. xdir="$func_dirname_result"
  1464. lobj=${xdir}$objdir/$objname
  1465. test -z "$base_compile" && \
  1466. func_fatal_help "you must specify a compilation command"
  1467. # Delete any leftover library objects.
  1468. if test "$build_old_libs" = yes; then
  1469. removelist="$obj $lobj $libobj ${libobj}T"
  1470. else
  1471. removelist="$lobj $libobj ${libobj}T"
  1472. fi
  1473. # On Cygwin there's no "real" PIC flag so we must build both object types
  1474. case $host_os in
  1475. cygwin* | mingw* | pw32* | os2* | cegcc*)
  1476. pic_mode=default
  1477. ;;
  1478. esac
  1479. if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  1480. # non-PIC code in shared libraries is not supported
  1481. pic_mode=default
  1482. fi
  1483. # Calculate the filename of the output object if compiler does
  1484. # not support -o with -c
  1485. if test "$compiler_c_o" = no; then
  1486. output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  1487. lockfile="$output_obj.lock"
  1488. else
  1489. output_obj=
  1490. need_locks=no
  1491. lockfile=
  1492. fi
  1493. # Lock this critical section if it is needed
  1494. # We use this script file to make the link, it avoids creating a new file
  1495. if test "$need_locks" = yes; then
  1496. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  1497. func_echo "Waiting for $lockfile to be removed"
  1498. sleep 2
  1499. done
  1500. elif test "$need_locks" = warn; then
  1501. if test -f "$lockfile"; then
  1502. $ECHO "\
  1503. *** ERROR, $lockfile exists and contains:
  1504. `cat $lockfile 2>/dev/null`
  1505. This indicates that another process is trying to use the same
  1506. temporary object file, and libtool could not work around it because
  1507. your compiler does not support \`-c' and \`-o' together. If you
  1508. repeat this compilation, it may succeed, by chance, but you had better
  1509. avoid parallel builds (make -j) in this platform, or get a better
  1510. compiler."
  1511. $opt_dry_run || $RM $removelist
  1512. exit $EXIT_FAILURE
  1513. fi
  1514. removelist="$removelist $output_obj"
  1515. $ECHO "$srcfile" > "$lockfile"
  1516. fi
  1517. $opt_dry_run || $RM $removelist
  1518. removelist="$removelist $lockfile"
  1519. trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  1520. if test -n "$fix_srcfile_path"; then
  1521. eval srcfile=\"$fix_srcfile_path\"
  1522. fi
  1523. func_quote_for_eval "$srcfile"
  1524. qsrcfile=$func_quote_for_eval_result
  1525. # Only build a PIC object if we are building libtool libraries.
  1526. if test "$build_libtool_libs" = yes; then
  1527. # Without this assignment, base_compile gets emptied.
  1528. fbsd_hideous_sh_bug=$base_compile
  1529. if test "$pic_mode" != no; then
  1530. command="$base_compile $qsrcfile $pic_flag"
  1531. else
  1532. # Don't build PIC code
  1533. command="$base_compile $qsrcfile"
  1534. fi
  1535. func_mkdir_p "$xdir$objdir"
  1536. if test -z "$output_obj"; then
  1537. # Place PIC objects in $objdir
  1538. command="$command -o $lobj"
  1539. fi
  1540. func_show_eval_locale "$command" \
  1541. 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  1542. if test "$need_locks" = warn &&
  1543. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1544. $ECHO "\
  1545. *** ERROR, $lockfile contains:
  1546. `cat $lockfile 2>/dev/null`
  1547. but it should contain:
  1548. $srcfile
  1549. This indicates that another process is trying to use the same
  1550. temporary object file, and libtool could not work around it because
  1551. your compiler does not support \`-c' and \`-o' together. If you
  1552. repeat this compilation, it may succeed, by chance, but you had better
  1553. avoid parallel builds (make -j) in this platform, or get a better
  1554. compiler."
  1555. $opt_dry_run || $RM $removelist
  1556. exit $EXIT_FAILURE
  1557. fi
  1558. # Just move the object if needed, then go on to compile the next one
  1559. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  1560. func_show_eval '$MV "$output_obj" "$lobj"' \
  1561. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  1562. fi
  1563. # Allow error messages only from the first compilation.
  1564. if test "$suppress_opt" = yes; then
  1565. suppress_output=' >/dev/null 2>&1'
  1566. fi
  1567. fi
  1568. # Only build a position-dependent object if we build old libraries.
  1569. if test "$build_old_libs" = yes; then
  1570. if test "$pic_mode" != yes; then
  1571. # Don't build PIC code
  1572. command="$base_compile $qsrcfile$pie_flag"
  1573. else
  1574. command="$base_compile $qsrcfile $pic_flag"
  1575. fi
  1576. if test "$compiler_c_o" = yes; then
  1577. command="$command -o $obj"
  1578. fi
  1579. # Suppress compiler output if we already did a PIC compilation.
  1580. command="$command$suppress_output"
  1581. func_show_eval_locale "$command" \
  1582. '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  1583. if test "$need_locks" = warn &&
  1584. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1585. $ECHO "\
  1586. *** ERROR, $lockfile contains:
  1587. `cat $lockfile 2>/dev/null`
  1588. but it should contain:
  1589. $srcfile
  1590. This indicates that another process is trying to use the same
  1591. temporary object file, and libtool could not work around it because
  1592. your compiler does not support \`-c' and \`-o' together. If you
  1593. repeat this compilation, it may succeed, by chance, but you had better
  1594. avoid parallel builds (make -j) in this platform, or get a better
  1595. compiler."
  1596. $opt_dry_run || $RM $removelist
  1597. exit $EXIT_FAILURE
  1598. fi
  1599. # Just move the object if needed
  1600. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  1601. func_show_eval '$MV "$output_obj" "$obj"' \
  1602. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  1603. fi
  1604. fi
  1605. $opt_dry_run || {
  1606. func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  1607. # Unlock the critical section if it was locked
  1608. if test "$need_locks" != no; then
  1609. removelist=$lockfile
  1610. $RM "$lockfile"
  1611. fi
  1612. }
  1613. exit $EXIT_SUCCESS
  1614. }
  1615. $opt_help || {
  1616. test "$mode" = compile && func_mode_compile ${1+"$@"}
  1617. }
  1618. func_mode_help ()
  1619. {
  1620. # We need to display help for each of the modes.
  1621. case $mode in
  1622. "")
  1623. # Generic help is extracted from the usage comments
  1624. # at the start of this file.
  1625. func_help
  1626. ;;
  1627. clean)
  1628. $ECHO \
  1629. "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  1630. Remove files from the build directory.
  1631. RM is the name of the program to use to delete files associated with each FILE
  1632. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  1633. to RM.
  1634. If FILE is a libtool library, object or program, all the files associated
  1635. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  1636. ;;
  1637. compile)
  1638. $ECHO \
  1639. "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  1640. Compile a source file into a libtool library object.
  1641. This mode accepts the following additional options:
  1642. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  1643. -no-suppress do not suppress compiler output for multiple passes
  1644. -prefer-pic try to building PIC objects only
  1645. -prefer-non-pic try to building non-PIC objects only
  1646. -shared do not build a \`.o' file suitable for static linking
  1647. -static only build a \`.o' file suitable for static linking
  1648. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  1649. from the given SOURCEFILE.
  1650. The output file name is determined by removing the directory component from
  1651. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  1652. library object suffix, \`.lo'."
  1653. ;;
  1654. execute)
  1655. $ECHO \
  1656. "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  1657. Automatically set library path, then run a program.
  1658. This mode accepts the following additional options:
  1659. -dlopen FILE add the directory containing FILE to the library path
  1660. This mode sets the library path environment variable according to \`-dlopen'
  1661. flags.
  1662. If any of the ARGS are libtool executable wrappers, then they are translated
  1663. into their corresponding uninstalled binary, and any of their required library
  1664. directories are added to the library path.
  1665. Then, COMMAND is executed, with ARGS as arguments."
  1666. ;;
  1667. finish)
  1668. $ECHO \
  1669. "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  1670. Complete the installation of libtool libraries.
  1671. Each LIBDIR is a directory that contains libtool libraries.
  1672. The commands that this mode executes may require superuser privileges. Use
  1673. the \`--dry-run' option if you just want to see what would be executed."
  1674. ;;
  1675. install)
  1676. $ECHO \
  1677. "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  1678. Install executables or libraries.
  1679. INSTALL-COMMAND is the installation command. The first component should be
  1680. either the \`install' or \`cp' program.
  1681. The following components of INSTALL-COMMAND are treated specially:
  1682. -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  1683. The rest of the components are interpreted as arguments to that command (only
  1684. BSD-compatible install options are recognized)."
  1685. ;;
  1686. link)
  1687. $ECHO \
  1688. "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  1689. Link object files or libraries together to form another library, or to
  1690. create an executable program.
  1691. LINK-COMMAND is a command using the C compiler that you would use to create
  1692. a program from several object files.
  1693. The following components of LINK-COMMAND are treated specially:
  1694. -all-static do not do any dynamic linking at all
  1695. -avoid-version do not add a version suffix if possible
  1696. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  1697. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  1698. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  1699. -export-symbols SYMFILE
  1700. try to export only the symbols listed in SYMFILE
  1701. -export-symbols-regex REGEX
  1702. try to export only the symbols matching REGEX
  1703. -LLIBDIR search LIBDIR for required installed libraries
  1704. -lNAME OUTPUT-FILE requires the installed library libNAME
  1705. -module build a library that can dlopened
  1706. -no-fast-install disable the fast-install mode
  1707. -no-install link a not-installable executable
  1708. -no-undefined declare that a library does not refer to external symbols
  1709. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  1710. -objectlist FILE Use a list of object files found in FILE to specify objects
  1711. -precious-files-regex REGEX
  1712. don't remove output files matching REGEX
  1713. -release RELEASE specify package release information
  1714. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  1715. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  1716. -shared only do dynamic linking of libtool libraries
  1717. -shrext SUFFIX override the standard shared library file extension
  1718. -static do not do any dynamic linking of uninstalled libtool libraries
  1719. -static-libtool-libs
  1720. do not do any dynamic linking of libtool libraries
  1721. -version-info CURRENT[:REVISION[:AGE]]
  1722. specify library version info [each variable defaults to 0]
  1723. -weak LIBNAME declare that the target provides the LIBNAME interface
  1724. All other options (arguments beginning with \`-') are ignored.
  1725. Every other argument is treated as a filename. Files ending in \`.la' are
  1726. treated as uninstalled libtool libraries, other files are standard or library
  1727. object files.
  1728. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  1729. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  1730. required, except when creating a convenience library.
  1731. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  1732. using \`ar' and \`ranlib', or on Windows using \`lib'.
  1733. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  1734. is created, otherwise an executable program is created."
  1735. ;;
  1736. uninstall)
  1737. $ECHO \
  1738. "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  1739. Remove libraries from an installation directory.
  1740. RM is the name of the program to use to delete files associated with each FILE
  1741. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  1742. to RM.
  1743. If FILE is a libtool library, all the files associated with it are deleted.
  1744. Otherwise, only FILE itself is deleted using RM."
  1745. ;;
  1746. *)
  1747. func_fatal_help "invalid operation mode \`$mode'"
  1748. ;;
  1749. esac
  1750. $ECHO
  1751. $ECHO "Try \`$progname --help' for more information about other modes."
  1752. exit $?
  1753. }
  1754. # Now that we've collected a possible --mode arg, show help if necessary
  1755. $opt_help && func_mode_help
  1756. # func_mode_execute arg...
  1757. func_mode_execute ()
  1758. {
  1759. $opt_debug
  1760. # The first argument is the command name.
  1761. cmd="$nonopt"
  1762. test -z "$cmd" && \
  1763. func_fatal_help "you must specify a COMMAND"
  1764. # Handle -dlopen flags immediately.
  1765. for file in $execute_dlfiles; do
  1766. test -f "$file" \
  1767. || func_fatal_help "\`$file' is not a file"
  1768. dir=
  1769. case $file in
  1770. *.la)
  1771. # Check to see that this really is a libtool archive.
  1772. func_lalib_unsafe_p "$file" \
  1773. || func_fatal_help "\`$lib' is not a valid libtool archive"
  1774. # Read the libtool library.
  1775. dlname=
  1776. library_names=
  1777. func_source "$file"
  1778. # Skip this library if it cannot be dlopened.
  1779. if test -z "$dlname"; then
  1780. # Warn if it was a shared library.
  1781. test -n "$library_names" && \
  1782. func_warning "\`$file' was not linked with \`-export-dynamic'"
  1783. continue
  1784. fi
  1785. func_dirname "$file" "" "."
  1786. dir="$func_dirname_result"
  1787. if test -f "$dir/$objdir/$dlname"; then
  1788. dir="$dir/$objdir"
  1789. else
  1790. if test ! -f "$dir/$dlname"; then
  1791. func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
  1792. fi
  1793. fi
  1794. ;;
  1795. *.lo)
  1796. # Just add the directory containing the .lo file.
  1797. func_dirname "$file" "" "."
  1798. dir="$func_dirname_result"
  1799. ;;
  1800. *)
  1801. func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
  1802. continue
  1803. ;;
  1804. esac
  1805. # Get the absolute pathname.
  1806. absdir=`cd "$dir" && pwd`
  1807. test -n "$absdir" && dir="$absdir"
  1808. # Now add the directory to shlibpath_var.
  1809. if eval "test -z \"\$$shlibpath_var\""; then
  1810. eval "$shlibpath_var=\"\$dir\""
  1811. else
  1812. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  1813. fi
  1814. done
  1815. # This variable tells wrapper scripts just to set shlibpath_var
  1816. # rather than running their programs.
  1817. libtool_execute_magic="$magic"
  1818. # Check if any of the arguments is a wrapper script.
  1819. args=
  1820. for file
  1821. do
  1822. case $file in
  1823. -*) ;;
  1824. *)
  1825. # Do a test to see if this is really a libtool program.
  1826. if func_ltwrapper_script_p "$file"; then
  1827. func_source "$file"
  1828. # Transform arg to wrapped name.
  1829. file="$progdir/$program"
  1830. elif func_ltwrapper_executable_p "$file"; then
  1831. func_ltwrapper_scriptname "$file"
  1832. func_source "$func_ltwrapper_scriptname_result"
  1833. # Transform arg to wrapped name.
  1834. file="$progdir/$program"
  1835. fi
  1836. ;;
  1837. esac
  1838. # Quote arguments (to preserve shell metacharacters).
  1839. func_quote_for_eval "$file"
  1840. args="$args $func_quote_for_eval_result"
  1841. done
  1842. if test "X$opt_dry_run" = Xfalse; then
  1843. if test -n "$shlibpath_var"; then
  1844. # Export the shlibpath_var.
  1845. eval "export $shlibpath_var"
  1846. fi
  1847. # Restore saved environment variables
  1848. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  1849. do
  1850. eval "if test \"\${save_$lt_var+set}\" = set; then
  1851. $lt_var=\$save_$lt_var; export $lt_var
  1852. else
  1853. $lt_unset $lt_var
  1854. fi"
  1855. done
  1856. # Now prepare to actually exec the command.
  1857. exec_cmd="\$cmd$args"
  1858. else
  1859. # Display what would be done.
  1860. if test -n "$shlibpath_var"; then
  1861. eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  1862. $ECHO "export $shlibpath_var"
  1863. fi
  1864. $ECHO "$cmd$args"
  1865. exit $EXIT_SUCCESS
  1866. fi
  1867. }
  1868. test "$mode" = execute && func_mode_execute ${1+"$@"}
  1869. # func_mode_finish arg...
  1870. func_mode_finish ()
  1871. {
  1872. $opt_debug
  1873. libdirs="$nonopt"
  1874. admincmds=
  1875. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  1876. for dir
  1877. do
  1878. libdirs="$libdirs $dir"
  1879. done
  1880. for libdir in $libdirs; do
  1881. if test -n "$finish_cmds"; then
  1882. # Do each command in the finish commands.
  1883. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  1884. '"$cmd"'"'
  1885. fi
  1886. if test -n "$finish_eval"; then
  1887. # Do the single finish_eval.
  1888. eval cmds=\"$finish_eval\"
  1889. $opt_dry_run || eval "$cmds" || admincmds="$admincmds
  1890. $cmds"
  1891. fi
  1892. done
  1893. fi
  1894. # Exit here if they wanted silent mode.
  1895. $opt_silent && exit $EXIT_SUCCESS
  1896. $ECHO "X----------------------------------------------------------------------" | $Xsed
  1897. $ECHO "Libraries have been installed in:"
  1898. for libdir in $libdirs; do
  1899. $ECHO " $libdir"
  1900. done
  1901. $ECHO
  1902. $ECHO "If you ever happen to want to link against installed libraries"
  1903. $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
  1904. $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
  1905. $ECHO "flag during linking and do at least one of the following:"
  1906. if test -n "$shlibpath_var"; then
  1907. $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
  1908. $ECHO " during execution"
  1909. fi
  1910. if test -n "$runpath_var"; then
  1911. $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
  1912. $ECHO " during linking"
  1913. fi
  1914. if test -n "$hardcode_libdir_flag_spec"; then
  1915. libdir=LIBDIR
  1916. eval flag=\"$hardcode_libdir_flag_spec\"
  1917. $ECHO " - use the \`$flag' linker flag"
  1918. fi
  1919. if test -n "$admincmds"; then
  1920. $ECHO " - have your system administrator run these commands:$admincmds"
  1921. fi
  1922. if test -f /etc/ld.so.conf; then
  1923. $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  1924. fi
  1925. $ECHO
  1926. $ECHO "See any operating system documentation about shared libraries for"
  1927. case $host in
  1928. solaris2.[6789]|solaris2.1[0-9])
  1929. $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  1930. $ECHO "pages."
  1931. ;;
  1932. *)
  1933. $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
  1934. ;;
  1935. esac
  1936. $ECHO "X----------------------------------------------------------------------" | $Xsed
  1937. exit $EXIT_SUCCESS
  1938. }
  1939. test "$mode" = finish && func_mode_finish ${1+"$@"}
  1940. # func_mode_install arg...
  1941. func_mode_install ()
  1942. {
  1943. $opt_debug
  1944. # There may be an optional sh(1) argument at the beginning of
  1945. # install_prog (especially on Windows NT).
  1946. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  1947. # Allow the use of GNU shtool's install command.
  1948. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
  1949. # Aesthetically quote it.
  1950. func_quote_for_eval "$nonopt"
  1951. install_prog="$func_quote_for_eval_result "
  1952. arg=$1
  1953. shift
  1954. else
  1955. install_prog=
  1956. arg=$nonopt
  1957. fi
  1958. # The real first argument should be the name of the installation program.
  1959. # Aesthetically quote it.
  1960. func_quote_for_eval "$arg"
  1961. install_prog="$install_prog$func_quote_for_eval_result"
  1962. # We need to accept at least all the BSD install flags.
  1963. dest=
  1964. files=
  1965. opts=
  1966. prev=
  1967. install_type=
  1968. isdir=no
  1969. stripme=
  1970. for arg
  1971. do
  1972. if test -n "$dest"; then
  1973. files="$files $dest"
  1974. dest=$arg
  1975. continue
  1976. fi
  1977. case $arg in
  1978. -d) isdir=yes ;;
  1979. -f)
  1980. case " $install_prog " in
  1981. *[\\\ /]cp\ *) ;;
  1982. *) prev=$arg ;;
  1983. esac
  1984. ;;
  1985. -g | -m | -o)
  1986. prev=$arg
  1987. ;;
  1988. -s)
  1989. stripme=" -s"
  1990. continue
  1991. ;;
  1992. -*)
  1993. ;;
  1994. *)
  1995. # If the previous option needed an argument, then skip it.
  1996. if test -n "$prev"; then
  1997. prev=
  1998. else
  1999. dest=$arg
  2000. continue
  2001. fi
  2002. ;;
  2003. esac
  2004. # Aesthetically quote the argument.
  2005. func_quote_for_eval "$arg"
  2006. install_prog="$install_prog $func_quote_for_eval_result"
  2007. done
  2008. test -z "$install_prog" && \
  2009. func_fatal_help "you must specify an install program"
  2010. test -n "$prev" && \
  2011. func_fatal_help "the \`$prev' option requires an argument"
  2012. if test -z "$files"; then
  2013. if test -z "$dest"; then
  2014. func_fatal_help "no file or destination specified"
  2015. else
  2016. func_fatal_help "you must specify a destination"
  2017. fi
  2018. fi
  2019. # Strip any trailing slash from the destination.
  2020. func_stripname '' '/' "$dest"
  2021. dest=$func_stripname_result
  2022. # Check to see that the destination is a directory.
  2023. test -d "$dest" && isdir=yes
  2024. if test "$isdir" = yes; then
  2025. destdir="$dest"
  2026. destname=
  2027. else
  2028. func_dirname_and_basename "$dest" "" "."
  2029. destdir="$func_dirname_result"
  2030. destname="$func_basename_result"
  2031. # Not a directory, so check to see that there is only one file specified.
  2032. set dummy $files; shift
  2033. test "$#" -gt 1 && \
  2034. func_fatal_help "\`$dest' is not a directory"
  2035. fi
  2036. case $destdir in
  2037. [\\/]* | [A-Za-z]:[\\/]*) ;;
  2038. *)
  2039. for file in $files; do
  2040. case $file in
  2041. *.lo) ;;
  2042. *)
  2043. func_fatal_help "\`$destdir' must be an absolute directory name"
  2044. ;;
  2045. esac
  2046. done
  2047. ;;
  2048. esac
  2049. # This variable tells wrapper scripts just to set variables rather
  2050. # than running their programs.
  2051. libtool_install_magic="$magic"
  2052. staticlibs=
  2053. future_libdirs=
  2054. current_libdirs=
  2055. for file in $files; do
  2056. # Do each installation.
  2057. case $file in
  2058. *.$libext)
  2059. # Do the static libraries later.
  2060. staticlibs="$staticlibs $file"
  2061. ;;
  2062. *.la)
  2063. # Check to see that this really is a libtool archive.
  2064. func_lalib_unsafe_p "$file" \
  2065. || func_fatal_help "\`$file' is not a valid libtool archive"
  2066. library_names=
  2067. old_library=
  2068. relink_command=
  2069. func_source "$file"
  2070. # Add the libdir to current_libdirs if it is the destination.
  2071. if test "X$destdir" = "X$libdir"; then
  2072. case "$current_libdirs " in
  2073. *" $libdir "*) ;;
  2074. *) current_libdirs="$current_libdirs $libdir" ;;
  2075. esac
  2076. else
  2077. # Note the libdir as a future libdir.
  2078. case "$future_libdirs " in
  2079. *" $libdir "*) ;;
  2080. *) future_libdirs="$future_libdirs $libdir" ;;
  2081. esac
  2082. fi
  2083. func_dirname "$file" "/" ""
  2084. dir="$func_dirname_result"
  2085. dir="$dir$objdir"
  2086. if test -n "$relink_command"; then
  2087. # Determine the prefix the user has applied to our future dir.
  2088. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
  2089. # Don't allow the user to place us outside of our expected
  2090. # location b/c this prevents finding dependent libraries that
  2091. # are installed to the same prefix.
  2092. # At present, this check doesn't affect windows .dll's that
  2093. # are installed into $libdir/../bin (currently, that works fine)
  2094. # but it's something to keep an eye on.
  2095. test "$inst_prefix_dir" = "$destdir" && \
  2096. func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
  2097. if test -n "$inst_prefix_dir"; then
  2098. # Stick the inst_prefix_dir data into the link command.
  2099. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  2100. else
  2101. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
  2102. fi
  2103. func_warning "relinking \`$file'"
  2104. func_show_eval "$relink_command" \
  2105. 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
  2106. fi
  2107. # See the names of the shared library.
  2108. set dummy $library_names; shift
  2109. if test -n "$1"; then
  2110. realname="$1"
  2111. shift
  2112. srcname="$realname"
  2113. test -n "$relink_command" && srcname="$realname"T
  2114. # Install the shared library and build the symlinks.
  2115. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
  2116. 'exit $?'
  2117. tstripme="$stripme"
  2118. case $host_os in
  2119. cygwin* | mingw* | pw32* | cegcc*)
  2120. case $realname in
  2121. *.dll.a)
  2122. tstripme=""
  2123. ;;
  2124. esac
  2125. ;;
  2126. esac
  2127. if test -n "$tstripme" && test -n "$striplib"; then
  2128. func_show_eval "$striplib $destdir/$realname" 'exit $?'
  2129. fi
  2130. if test "$#" -gt 0; then
  2131. # Delete the old symlinks, and create new ones.
  2132. # Try `ln -sf' first, because the `ln' binary might depend on
  2133. # the symlink we replace! Solaris /bin/ln does not understand -f,
  2134. # so we also need to try rm && ln -s.
  2135. for linkname
  2136. do
  2137. test "$linkname" != "$realname" \
  2138. && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  2139. done
  2140. fi
  2141. # Do each command in the postinstall commands.
  2142. lib="$destdir/$realname"
  2143. func_execute_cmds "$postinstall_cmds" 'exit $?'
  2144. fi
  2145. # Install the pseudo-library for information purposes.
  2146. func_basename "$file"
  2147. name="$func_basename_result"
  2148. instname="$dir/$name"i
  2149. func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  2150. # Maybe install the static library, too.
  2151. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  2152. ;;
  2153. *.lo)
  2154. # Install (i.e. copy) a libtool object.
  2155. # Figure out destination file name, if it wasn't already specified.
  2156. if test -n "$destname"; then
  2157. destfile="$destdir/$destname"
  2158. else
  2159. func_basename "$file"
  2160. destfile="$func_basename_result"
  2161. destfile="$destdir/$destfile"
  2162. fi
  2163. # Deduce the name of the destination old-style object file.
  2164. case $destfile in
  2165. *.lo)
  2166. func_lo2o "$destfile"
  2167. staticdest=$func_lo2o_result
  2168. ;;
  2169. *.$objext)
  2170. staticdest="$destfile"
  2171. destfile=
  2172. ;;
  2173. *)
  2174. func_fatal_help "cannot copy a libtool object to \`$destfile'"
  2175. ;;
  2176. esac
  2177. # Install the libtool object if requested.
  2178. test -n "$destfile" && \
  2179. func_show_eval "$install_prog $file $destfile" 'exit $?'
  2180. # Install the old object if enabled.
  2181. if test "$build_old_libs" = yes; then
  2182. # Deduce the name of the old-style object file.
  2183. func_lo2o "$file"
  2184. staticobj=$func_lo2o_result
  2185. func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  2186. fi
  2187. exit $EXIT_SUCCESS
  2188. ;;
  2189. *)
  2190. # Figure out destination file name, if it wasn't already specified.
  2191. if test -n "$destname"; then
  2192. destfile="$destdir/$destname"
  2193. else
  2194. func_basename "$file"
  2195. destfile="$func_basename_result"
  2196. destfile="$destdir/$destfile"
  2197. fi
  2198. # If the file is missing, and there is a .exe on the end, strip it
  2199. # because it is most likely a libtool script we actually want to
  2200. # install
  2201. stripped_ext=""
  2202. case $file in
  2203. *.exe)
  2204. if test ! -f "$file"; then
  2205. func_stripname '' '.exe' "$file"
  2206. file=$func_stripname_result
  2207. stripped_ext=".exe"
  2208. fi
  2209. ;;
  2210. esac
  2211. # Do a test to see if this is really a libtool program.
  2212. case $host in
  2213. *cygwin* | *mingw*)
  2214. if func_ltwrapper_executable_p "$file"; then
  2215. func_ltwrapper_scriptname "$file"
  2216. wrapper=$func_ltwrapper_scriptname_result
  2217. else
  2218. func_stripname '' '.exe' "$file"
  2219. wrapper=$func_stripname_result
  2220. fi
  2221. ;;
  2222. *)
  2223. wrapper=$file
  2224. ;;
  2225. esac
  2226. if func_ltwrapper_script_p "$wrapper"; then
  2227. notinst_deplibs=
  2228. relink_command=
  2229. func_source "$wrapper"
  2230. # Check the variables that should have been set.
  2231. test -z "$generated_by_libtool_version" && \
  2232. func_fatal_error "invalid libtool wrapper script \`$wrapper'"
  2233. finalize=yes
  2234. for lib in $notinst_deplibs; do
  2235. # Check to see that each library is installed.
  2236. libdir=
  2237. if test -f "$lib"; then
  2238. func_source "$lib"
  2239. fi
  2240. libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  2241. if test -n "$libdir" && test ! -f "$libfile"; then
  2242. func_warning "\`$lib' has not been installed in \`$libdir'"
  2243. finalize=no
  2244. fi
  2245. done
  2246. relink_command=
  2247. func_source "$wrapper"
  2248. outputname=
  2249. if test "$fast_install" = no && test -n "$relink_command"; then
  2250. $opt_dry_run || {
  2251. if test "$finalize" = yes; then
  2252. tmpdir=`func_mktempdir`
  2253. func_basename "$file$stripped_ext"
  2254. file="$func_basename_result"
  2255. outputname="$tmpdir/$file"
  2256. # Replace the output file specification.
  2257. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  2258. $opt_silent || {
  2259. func_quote_for_expand "$relink_command"
  2260. eval "func_echo $func_quote_for_expand_result"
  2261. }
  2262. if eval "$relink_command"; then :
  2263. else
  2264. func_error "error: relink \`$file' with the above command before installing it"
  2265. $opt_dry_run || ${RM}r "$tmpdir"
  2266. continue
  2267. fi
  2268. file="$outputname"
  2269. else
  2270. func_warning "cannot relink \`$file'"
  2271. fi
  2272. }
  2273. else
  2274. # Install the binary that we compiled earlier.
  2275. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  2276. fi
  2277. fi
  2278. # remove .exe since cygwin /usr/bin/install will append another
  2279. # one anyway
  2280. case $install_prog,$host in
  2281. */usr/bin/install*,*cygwin*)
  2282. case $file:$destfile in
  2283. *.exe:*.exe)
  2284. # this is ok
  2285. ;;
  2286. *.exe:*)
  2287. destfile=$destfile.exe
  2288. ;;
  2289. *:*.exe)
  2290. func_stripname '' '.exe' "$destfile"
  2291. destfile=$func_stripname_result
  2292. ;;
  2293. esac
  2294. ;;
  2295. esac
  2296. func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  2297. $opt_dry_run || if test -n "$outputname"; then
  2298. ${RM}r "$tmpdir"
  2299. fi
  2300. ;;
  2301. esac
  2302. done
  2303. for file in $staticlibs; do
  2304. func_basename "$file"
  2305. name="$func_basename_result"
  2306. # Set up the ranlib parameters.
  2307. oldlib="$destdir/$name"
  2308. func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  2309. if test -n "$stripme" && test -n "$old_striplib"; then
  2310. func_show_eval "$old_striplib $oldlib" 'exit $?'
  2311. fi
  2312. # Do each command in the postinstall commands.
  2313. func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  2314. done
  2315. test -n "$future_libdirs" && \
  2316. func_warning "remember to run \`$progname --finish$future_libdirs'"
  2317. if test -n "$current_libdirs"; then
  2318. # Maybe just do a dry run.
  2319. $opt_dry_run && current_libdirs=" -n$current_libdirs"
  2320. exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  2321. else
  2322. exit $EXIT_SUCCESS
  2323. fi
  2324. }
  2325. test "$mode" = install && func_mode_install ${1+"$@"}
  2326. # func_generate_dlsyms outputname originator pic_p
  2327. # Extract symbols from dlprefiles and create ${outputname}S.o with
  2328. # a dlpreopen symbol table.
  2329. func_generate_dlsyms ()
  2330. {
  2331. $opt_debug
  2332. my_outputname="$1"
  2333. my_originator="$2"
  2334. my_pic_p="${3-no}"
  2335. my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
  2336. my_dlsyms=
  2337. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2338. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2339. my_dlsyms="${my_outputname}S.c"
  2340. else
  2341. func_error "not configured to extract global symbols from dlpreopened files"
  2342. fi
  2343. fi
  2344. if test -n "$my_dlsyms"; then
  2345. case $my_dlsyms in
  2346. "") ;;
  2347. *.c)
  2348. # Discover the nlist of each of the dlfiles.
  2349. nlist="$output_objdir/${my_outputname}.nm"
  2350. func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  2351. # Parse the name list into a source file.
  2352. func_verbose "creating $output_objdir/$my_dlsyms"
  2353. $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  2354. /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
  2355. /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
  2356. #ifdef __cplusplus
  2357. extern \"C\" {
  2358. #endif
  2359. /* External symbol declarations for the compiler. */\
  2360. "
  2361. if test "$dlself" = yes; then
  2362. func_verbose "generating symbol list for \`$output'"
  2363. $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  2364. # Add our own program objects to the symbol list.
  2365. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2366. for progfile in $progfiles; do
  2367. func_verbose "extracting global C symbols from \`$progfile'"
  2368. $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
  2369. done
  2370. if test -n "$exclude_expsyms"; then
  2371. $opt_dry_run || {
  2372. eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2373. eval '$MV "$nlist"T "$nlist"'
  2374. }
  2375. fi
  2376. if test -n "$export_symbols_regex"; then
  2377. $opt_dry_run || {
  2378. eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2379. eval '$MV "$nlist"T "$nlist"'
  2380. }
  2381. fi
  2382. # Prepare the list of exported symbols
  2383. if test -z "$export_symbols"; then
  2384. export_symbols="$output_objdir/$outputname.exp"
  2385. $opt_dry_run || {
  2386. $RM $export_symbols
  2387. eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2388. case $host in
  2389. *cygwin* | *mingw* | *cegcc* )
  2390. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  2391. eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  2392. ;;
  2393. esac
  2394. }
  2395. else
  2396. $opt_dry_run || {
  2397. eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  2398. eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  2399. eval '$MV "$nlist"T "$nlist"'
  2400. case $host in
  2401. *cygwin | *mingw* | *cegcc* )
  2402. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  2403. eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  2404. ;;
  2405. esac
  2406. }
  2407. fi
  2408. fi
  2409. for dlprefile in $dlprefiles; do
  2410. func_verbose "extracting global C symbols from \`$dlprefile'"
  2411. func_basename "$dlprefile"
  2412. name="$func_basename_result"
  2413. $opt_dry_run || {
  2414. eval '$ECHO ": $name " >> "$nlist"'
  2415. eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  2416. }
  2417. done
  2418. $opt_dry_run || {
  2419. # Make sure we have at least an empty file.
  2420. test -f "$nlist" || : > "$nlist"
  2421. if test -n "$exclude_expsyms"; then
  2422. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2423. $MV "$nlist"T "$nlist"
  2424. fi
  2425. # Try sorting and uniquifying the output.
  2426. if $GREP -v "^: " < "$nlist" |
  2427. if sort -k 3 </dev/null >/dev/null 2>&1; then
  2428. sort -k 3
  2429. else
  2430. sort +2
  2431. fi |
  2432. uniq > "$nlist"S; then
  2433. :
  2434. else
  2435. $GREP -v "^: " < "$nlist" > "$nlist"S
  2436. fi
  2437. if test -f "$nlist"S; then
  2438. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  2439. else
  2440. $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
  2441. fi
  2442. $ECHO >> "$output_objdir/$my_dlsyms" "\
  2443. /* The mapping between symbol names and symbols. */
  2444. typedef struct {
  2445. const char *name;
  2446. void *address;
  2447. } lt_dlsymlist;
  2448. "
  2449. case $host in
  2450. *cygwin* | *mingw* | *cegcc* )
  2451. $ECHO >> "$output_objdir/$my_dlsyms" "\
  2452. /* DATA imports from DLLs on WIN32 con't be const, because
  2453. runtime relocations are performed -- see ld's documentation
  2454. on pseudo-relocs. */"
  2455. lt_dlsym_const= ;;
  2456. *osf5*)
  2457. echo >> "$output_objdir/$my_dlsyms" "\
  2458. /* This system does not cope well with relocations in const data */"
  2459. lt_dlsym_const= ;;
  2460. *)
  2461. lt_dlsym_const=const ;;
  2462. esac
  2463. $ECHO >> "$output_objdir/$my_dlsyms" "\
  2464. extern $lt_dlsym_const lt_dlsymlist
  2465. lt_${my_prefix}_LTX_preloaded_symbols[];
  2466. $lt_dlsym_const lt_dlsymlist
  2467. lt_${my_prefix}_LTX_preloaded_symbols[] =
  2468. {\
  2469. { \"$my_originator\", (void *) 0 },"
  2470. case $need_lib_prefix in
  2471. no)
  2472. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  2473. ;;
  2474. *)
  2475. eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  2476. ;;
  2477. esac
  2478. $ECHO >> "$output_objdir/$my_dlsyms" "\
  2479. {0, (void *) 0}
  2480. };
  2481. /* This works around a problem in FreeBSD linker */
  2482. #ifdef FREEBSD_WORKAROUND
  2483. static const void *lt_preloaded_setup() {
  2484. return lt_${my_prefix}_LTX_preloaded_symbols;
  2485. }
  2486. #endif
  2487. #ifdef __cplusplus
  2488. }
  2489. #endif\
  2490. "
  2491. } # !$opt_dry_run
  2492. pic_flag_for_symtable=
  2493. case "$compile_command " in
  2494. *" -static "*) ;;
  2495. *)
  2496. case $host in
  2497. # compiling the symbol table file with pic_flag works around
  2498. # a FreeBSD bug that causes programs to crash when -lm is
  2499. # linked before any other PIC object. But we must not use
  2500. # pic_flag when linking with -static. The problem exists in
  2501. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  2502. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  2503. pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  2504. *-*-hpux*)
  2505. pic_flag_for_symtable=" $pic_flag" ;;
  2506. *)
  2507. if test "X$my_pic_p" != Xno; then
  2508. pic_flag_for_symtable=" $pic_flag"
  2509. fi
  2510. ;;
  2511. esac
  2512. ;;
  2513. esac
  2514. symtab_cflags=
  2515. for arg in $LTCFLAGS; do
  2516. case $arg in
  2517. -pie | -fpie | -fPIE) ;;
  2518. *) symtab_cflags="$symtab_cflags $arg" ;;
  2519. esac
  2520. done
  2521. # Now compile the dynamic symbol file.
  2522. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  2523. # Clean up the generated files.
  2524. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
  2525. # Transform the symbol file into the correct name.
  2526. symfileobj="$output_objdir/${my_outputname}S.$objext"
  2527. case $host in
  2528. *cygwin* | *mingw* | *cegcc* )
  2529. if test -f "$output_objdir/$my_outputname.def"; then
  2530. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  2531. finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  2532. else
  2533. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  2534. finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  2535. fi
  2536. ;;
  2537. *)
  2538. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  2539. finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  2540. ;;
  2541. esac
  2542. ;;
  2543. *)
  2544. func_fatal_error "unknown suffix for \`$my_dlsyms'"
  2545. ;;
  2546. esac
  2547. else
  2548. # We keep going just in case the user didn't refer to
  2549. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  2550. # really was required.
  2551. # Nullify the symbol file.
  2552. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2553. finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2554. fi
  2555. }
  2556. # func_win32_libid arg
  2557. # return the library type of file 'arg'
  2558. #
  2559. # Need a lot of goo to handle *both* DLLs and import libs
  2560. # Has to be a shell function in order to 'eat' the argument
  2561. # that is supplied when $file_magic_command is called.
  2562. func_win32_libid ()
  2563. {
  2564. $opt_debug
  2565. win32_libid_type="unknown"
  2566. win32_fileres=`file -L $1 2>/dev/null`
  2567. case $win32_fileres in
  2568. *ar\ archive\ import\ library*) # definitely import
  2569. win32_libid_type="x86 archive import"
  2570. ;;
  2571. *ar\ archive*) # could be an import, or static
  2572. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  2573. $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  2574. win32_nmres=`eval $NM -f posix -A $1 |
  2575. $SED -n -e '
  2576. 1,100{
  2577. / I /{
  2578. s,.*,import,
  2579. p
  2580. q
  2581. }
  2582. }'`
  2583. case $win32_nmres in
  2584. import*) win32_libid_type="x86 archive import";;
  2585. *) win32_libid_type="x86 archive static";;
  2586. esac
  2587. fi
  2588. ;;
  2589. *DLL*)
  2590. win32_libid_type="x86 DLL"
  2591. ;;
  2592. *executable*) # but shell scripts are "executable" too...
  2593. case $win32_fileres in
  2594. *MS\ Windows\ PE\ Intel*)
  2595. win32_libid_type="x86 DLL"
  2596. ;;
  2597. esac
  2598. ;;
  2599. esac
  2600. $ECHO "$win32_libid_type"
  2601. }
  2602. # func_extract_an_archive dir oldlib
  2603. func_extract_an_archive ()
  2604. {
  2605. $opt_debug
  2606. f_ex_an_ar_dir="$1"; shift
  2607. f_ex_an_ar_oldlib="$1"
  2608. func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
  2609. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  2610. :
  2611. else
  2612. func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  2613. fi
  2614. }
  2615. # func_extract_archives gentop oldlib ...
  2616. func_extract_archives ()
  2617. {
  2618. $opt_debug
  2619. my_gentop="$1"; shift
  2620. my_oldlibs=${1+"$@"}
  2621. my_oldobjs=""
  2622. my_xlib=""
  2623. my_xabs=""
  2624. my_xdir=""
  2625. for my_xlib in $my_oldlibs; do
  2626. # Extract the objects.
  2627. case $my_xlib in
  2628. [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  2629. *) my_xabs=`pwd`"/$my_xlib" ;;
  2630. esac
  2631. func_basename "$my_xlib"
  2632. my_xlib="$func_basename_result"
  2633. my_xlib_u=$my_xlib
  2634. while :; do
  2635. case " $extracted_archives " in
  2636. *" $my_xlib_u "*)
  2637. func_arith $extracted_serial + 1
  2638. extracted_serial=$func_arith_result
  2639. my_xlib_u=lt$extracted_serial-$my_xlib ;;
  2640. *) break ;;
  2641. esac
  2642. done
  2643. extracted_archives="$extracted_archives $my_xlib_u"
  2644. my_xdir="$my_gentop/$my_xlib_u"
  2645. func_mkdir_p "$my_xdir"
  2646. case $host in
  2647. *-darwin*)
  2648. func_verbose "Extracting $my_xabs"
  2649. # Do not bother doing anything if just a dry run
  2650. $opt_dry_run || {
  2651. darwin_orig_dir=`pwd`
  2652. cd $my_xdir || exit $?
  2653. darwin_archive=$my_xabs
  2654. darwin_curdir=`pwd`
  2655. darwin_base_archive=`basename "$darwin_archive"`
  2656. darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  2657. if test -n "$darwin_arches"; then
  2658. darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  2659. darwin_arch=
  2660. func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  2661. for darwin_arch in $darwin_arches ; do
  2662. func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  2663. $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  2664. cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  2665. func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  2666. cd "$darwin_curdir"
  2667. $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  2668. done # $darwin_arches
  2669. ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  2670. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
  2671. darwin_file=
  2672. darwin_files=
  2673. for darwin_file in $darwin_filelist; do
  2674. darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  2675. $LIPO -create -output "$darwin_file" $darwin_files
  2676. done # $darwin_filelist
  2677. $RM -rf unfat-$$
  2678. cd "$darwin_orig_dir"
  2679. else
  2680. cd $darwin_orig_dir
  2681. func_extract_an_archive "$my_xdir" "$my_xabs"
  2682. fi # $darwin_arches
  2683. } # !$opt_dry_run
  2684. ;;
  2685. *)
  2686. func_extract_an_archive "$my_xdir" "$my_xabs"
  2687. ;;
  2688. esac
  2689. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  2690. done
  2691. func_extract_archives_result="$my_oldobjs"
  2692. }
  2693. # func_emit_wrapper_part1 [arg=no]
  2694. #
  2695. # Emit the first part of a libtool wrapper script on stdout.
  2696. # For more information, see the description associated with
  2697. # func_emit_wrapper(), below.
  2698. func_emit_wrapper_part1 ()
  2699. {
  2700. func_emit_wrapper_part1_arg1=no
  2701. if test -n "$1" ; then
  2702. func_emit_wrapper_part1_arg1=$1
  2703. fi
  2704. $ECHO "\
  2705. #! $SHELL
  2706. # $output - temporary wrapper script for $objdir/$outputname
  2707. # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  2708. #
  2709. # The $output program cannot be directly executed until all the libtool
  2710. # libraries that it depends on are installed.
  2711. #
  2712. # This wrapper script should never be moved out of the build directory.
  2713. # If it is, it will not operate correctly.
  2714. # Sed substitution that helps us do robust quoting. It backslashifies
  2715. # metacharacters that are still active within double-quoted strings.
  2716. Xsed='${SED} -e 1s/^X//'
  2717. sed_quote_subst='$sed_quote_subst'
  2718. # Be Bourne compatible
  2719. if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  2720. emulate sh
  2721. NULLCMD=:
  2722. # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  2723. # is contrary to our usage. Disable this feature.
  2724. alias -g '\${1+\"\$@\"}'='\"\$@\"'
  2725. setopt NO_GLOB_SUBST
  2726. else
  2727. case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  2728. fi
  2729. BIN_SH=xpg4; export BIN_SH # for Tru64
  2730. DUALCASE=1; export DUALCASE # for MKS sh
  2731. # The HP-UX ksh and POSIX shell print the target directory to stdout
  2732. # if CDPATH is set.
  2733. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  2734. relink_command=\"$relink_command\"
  2735. # This environment variable determines our operation mode.
  2736. if test \"\$libtool_install_magic\" = \"$magic\"; then
  2737. # install mode needs the following variables:
  2738. generated_by_libtool_version='$macro_version'
  2739. notinst_deplibs='$notinst_deplibs'
  2740. else
  2741. # When we are sourced in execute mode, \$file and \$ECHO are already set.
  2742. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2743. ECHO=\"$qecho\"
  2744. file=\"\$0\"
  2745. # Make sure echo works.
  2746. if test \"X\$1\" = X--no-reexec; then
  2747. # Discard the --no-reexec flag, and continue.
  2748. shift
  2749. elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
  2750. # Yippee, \$ECHO works!
  2751. :
  2752. else
  2753. # Restart under the correct shell, and then maybe \$ECHO will work.
  2754. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  2755. fi
  2756. fi\
  2757. "
  2758. $ECHO "\
  2759. # Find the directory that this script lives in.
  2760. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  2761. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  2762. # Follow symbolic links until we get to the real thisdir.
  2763. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  2764. while test -n \"\$file\"; do
  2765. destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  2766. # If there was a directory component, then change thisdir.
  2767. if test \"x\$destdir\" != \"x\$file\"; then
  2768. case \"\$destdir\" in
  2769. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  2770. *) thisdir=\"\$thisdir/\$destdir\" ;;
  2771. esac
  2772. fi
  2773. file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  2774. file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  2775. done
  2776. "
  2777. }
  2778. # end: func_emit_wrapper_part1
  2779. # func_emit_wrapper_part2 [arg=no]
  2780. #
  2781. # Emit the second part of a libtool wrapper script on stdout.
  2782. # For more information, see the description associated with
  2783. # func_emit_wrapper(), below.
  2784. func_emit_wrapper_part2 ()
  2785. {
  2786. func_emit_wrapper_part2_arg1=no
  2787. if test -n "$1" ; then
  2788. func_emit_wrapper_part2_arg1=$1
  2789. fi
  2790. $ECHO "\
  2791. # Usually 'no', except on cygwin/mingw when embedded into
  2792. # the cwrapper.
  2793. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
  2794. if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  2795. # special case for '.'
  2796. if test \"\$thisdir\" = \".\"; then
  2797. thisdir=\`pwd\`
  2798. fi
  2799. # remove .libs from thisdir
  2800. case \"\$thisdir\" in
  2801. *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
  2802. $objdir ) thisdir=. ;;
  2803. esac
  2804. fi
  2805. # Try to get the absolute directory name.
  2806. absdir=\`cd \"\$thisdir\" && pwd\`
  2807. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  2808. "
  2809. if test "$fast_install" = yes; then
  2810. $ECHO "\
  2811. program=lt-'$outputname'$exeext
  2812. progdir=\"\$thisdir/$objdir\"
  2813. if test ! -f \"\$progdir/\$program\" ||
  2814. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  2815. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  2816. file=\"\$\$-\$program\"
  2817. if test ! -d \"\$progdir\"; then
  2818. $MKDIR \"\$progdir\"
  2819. else
  2820. $RM \"\$progdir/\$file\"
  2821. fi"
  2822. $ECHO "\
  2823. # relink executable if necessary
  2824. if test -n \"\$relink_command\"; then
  2825. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  2826. else
  2827. $ECHO \"\$relink_command_output\" >&2
  2828. $RM \"\$progdir/\$file\"
  2829. exit 1
  2830. fi
  2831. fi
  2832. $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  2833. { $RM \"\$progdir/\$program\";
  2834. $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  2835. $RM \"\$progdir/\$file\"
  2836. fi"
  2837. else
  2838. $ECHO "\
  2839. program='$outputname'
  2840. progdir=\"\$thisdir/$objdir\"
  2841. "
  2842. fi
  2843. $ECHO "\
  2844. if test -f \"\$progdir/\$program\"; then"
  2845. # Export our shlibpath_var if we have one.
  2846. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  2847. $ECHO "\
  2848. # Add our own library path to $shlibpath_var
  2849. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  2850. # Some systems cannot cope with colon-terminated $shlibpath_var
  2851. # The second colon is a workaround for a bug in BeOS R4 sed
  2852. $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  2853. export $shlibpath_var
  2854. "
  2855. fi
  2856. # fixup the dll searchpath if we need to.
  2857. if test -n "$dllsearchpath"; then
  2858. $ECHO "\
  2859. # Add the dll search path components to the executable PATH
  2860. PATH=$dllsearchpath:\$PATH
  2861. "
  2862. fi
  2863. $ECHO "\
  2864. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  2865. # Run the actual program with our arguments.
  2866. "
  2867. case $host in
  2868. # Backslashes separate directories on plain windows
  2869. *-*-mingw | *-*-os2* | *-cegcc*)
  2870. $ECHO "\
  2871. exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  2872. "
  2873. ;;
  2874. *)
  2875. $ECHO "\
  2876. exec \"\$progdir/\$program\" \${1+\"\$@\"}
  2877. "
  2878. ;;
  2879. esac
  2880. $ECHO "\
  2881. \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  2882. exit 1
  2883. fi
  2884. else
  2885. # The program doesn't exist.
  2886. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
  2887. \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  2888. $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  2889. exit 1
  2890. fi
  2891. fi\
  2892. "
  2893. }
  2894. # end: func_emit_wrapper_part2
  2895. # func_emit_wrapper [arg=no]
  2896. #
  2897. # Emit a libtool wrapper script on stdout.
  2898. # Don't directly open a file because we may want to
  2899. # incorporate the script contents within a cygwin/mingw
  2900. # wrapper executable. Must ONLY be called from within
  2901. # func_mode_link because it depends on a number of variables
  2902. # set therein.
  2903. #
  2904. # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  2905. # variable will take. If 'yes', then the emitted script
  2906. # will assume that the directory in which it is stored is
  2907. # the $objdir directory. This is a cygwin/mingw-specific
  2908. # behavior.
  2909. func_emit_wrapper ()
  2910. {
  2911. func_emit_wrapper_arg1=no
  2912. if test -n "$1" ; then
  2913. func_emit_wrapper_arg1=$1
  2914. fi
  2915. # split this up so that func_emit_cwrapperexe_src
  2916. # can call each part independently.
  2917. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
  2918. func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
  2919. }
  2920. # func_to_host_path arg
  2921. #
  2922. # Convert paths to host format when used with build tools.
  2923. # Intended for use with "native" mingw (where libtool itself
  2924. # is running under the msys shell), or in the following cross-
  2925. # build environments:
  2926. # $build $host
  2927. # mingw (msys) mingw [e.g. native]
  2928. # cygwin mingw
  2929. # *nix + wine mingw
  2930. # where wine is equipped with the `winepath' executable.
  2931. # In the native mingw case, the (msys) shell automatically
  2932. # converts paths for any non-msys applications it launches,
  2933. # but that facility isn't available from inside the cwrapper.
  2934. # Similar accommodations are necessary for $host mingw and
  2935. # $build cygwin. Calling this function does no harm for other
  2936. # $host/$build combinations not listed above.
  2937. #
  2938. # ARG is the path (on $build) that should be converted to
  2939. # the proper representation for $host. The result is stored
  2940. # in $func_to_host_path_result.
  2941. func_to_host_path ()
  2942. {
  2943. func_to_host_path_result="$1"
  2944. if test -n "$1" ; then
  2945. case $host in
  2946. *mingw* )
  2947. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  2948. case $build in
  2949. *mingw* ) # actually, msys
  2950. # awkward: cmd appends spaces to result
  2951. lt_sed_strip_trailing_spaces="s/[ ]*\$//"
  2952. func_to_host_path_tmp1=`( cmd //c echo "$1" |\
  2953. $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
  2954. func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  2955. $SED -e "$lt_sed_naive_backslashify"`
  2956. ;;
  2957. *cygwin* )
  2958. func_to_host_path_tmp1=`cygpath -w "$1"`
  2959. func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  2960. $SED -e "$lt_sed_naive_backslashify"`
  2961. ;;
  2962. * )
  2963. # Unfortunately, winepath does not exit with a non-zero
  2964. # error code, so we are forced to check the contents of
  2965. # stdout. On the other hand, if the command is not
  2966. # found, the shell will set an exit code of 127 and print
  2967. # *an error message* to stdout. So we must check for both
  2968. # error code of zero AND non-empty stdout, which explains
  2969. # the odd construction:
  2970. func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
  2971. if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
  2972. func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  2973. $SED -e "$lt_sed_naive_backslashify"`
  2974. else
  2975. # Allow warning below.
  2976. func_to_host_path_result=""
  2977. fi
  2978. ;;
  2979. esac
  2980. if test -z "$func_to_host_path_result" ; then
  2981. func_error "Could not determine host path corresponding to"
  2982. func_error " '$1'"
  2983. func_error "Continuing, but uninstalled executables may not work."
  2984. # Fallback:
  2985. func_to_host_path_result="$1"
  2986. fi
  2987. ;;
  2988. esac
  2989. fi
  2990. }
  2991. # end: func_to_host_path
  2992. # func_to_host_pathlist arg
  2993. #
  2994. # Convert pathlists to host format when used with build tools.
  2995. # See func_to_host_path(), above. This function supports the
  2996. # following $build/$host combinations (but does no harm for
  2997. # combinations not listed here):
  2998. # $build $host
  2999. # mingw (msys) mingw [e.g. native]
  3000. # cygwin mingw
  3001. # *nix + wine mingw
  3002. #
  3003. # Path separators are also converted from $build format to
  3004. # $host format. If ARG begins or ends with a path separator
  3005. # character, it is preserved (but converted to $host format)
  3006. # on output.
  3007. #
  3008. # ARG is a pathlist (on $build) that should be converted to
  3009. # the proper representation on $host. The result is stored
  3010. # in $func_to_host_pathlist_result.
  3011. func_to_host_pathlist ()
  3012. {
  3013. func_to_host_pathlist_result="$1"
  3014. if test -n "$1" ; then
  3015. case $host in
  3016. *mingw* )
  3017. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  3018. # Remove leading and trailing path separator characters from
  3019. # ARG. msys behavior is inconsistent here, cygpath turns them
  3020. # into '.;' and ';.', and winepath ignores them completely.
  3021. func_to_host_pathlist_tmp2="$1"
  3022. # Once set for this call, this variable should not be
  3023. # reassigned. It is used in tha fallback case.
  3024. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
  3025. $SED -e 's|^:*||' -e 's|:*$||'`
  3026. case $build in
  3027. *mingw* ) # Actually, msys.
  3028. # Awkward: cmd appends spaces to result.
  3029. lt_sed_strip_trailing_spaces="s/[ ]*\$//"
  3030. func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
  3031. $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
  3032. func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
  3033. $SED -e "$lt_sed_naive_backslashify"`
  3034. ;;
  3035. *cygwin* )
  3036. func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
  3037. func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
  3038. $SED -e "$lt_sed_naive_backslashify"`
  3039. ;;
  3040. * )
  3041. # unfortunately, winepath doesn't convert pathlists
  3042. func_to_host_pathlist_result=""
  3043. func_to_host_pathlist_oldIFS=$IFS
  3044. IFS=:
  3045. for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
  3046. IFS=$func_to_host_pathlist_oldIFS
  3047. if test -n "$func_to_host_pathlist_f" ; then
  3048. func_to_host_path "$func_to_host_pathlist_f"
  3049. if test -n "$func_to_host_path_result" ; then
  3050. if test -z "$func_to_host_pathlist_result" ; then
  3051. func_to_host_pathlist_result="$func_to_host_path_result"
  3052. else
  3053. func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
  3054. fi
  3055. fi
  3056. fi
  3057. IFS=:
  3058. done
  3059. IFS=$func_to_host_pathlist_oldIFS
  3060. ;;
  3061. esac
  3062. if test -z "$func_to_host_pathlist_result" ; then
  3063. func_error "Could not determine the host path(s) corresponding to"
  3064. func_error " '$1'"
  3065. func_error "Continuing, but uninstalled executables may not work."
  3066. # Fallback. This may break if $1 contains DOS-style drive
  3067. # specifications. The fix is not to complicate the expression
  3068. # below, but for the user to provide a working wine installation
  3069. # with winepath so that path translation in the cross-to-mingw
  3070. # case works properly.
  3071. lt_replace_pathsep_nix_to_dos="s|:|;|g"
  3072. func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
  3073. $SED -e "$lt_replace_pathsep_nix_to_dos"`
  3074. fi
  3075. # Now, add the leading and trailing path separators back
  3076. case "$1" in
  3077. :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
  3078. ;;
  3079. esac
  3080. case "$1" in
  3081. *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
  3082. ;;
  3083. esac
  3084. ;;
  3085. esac
  3086. fi
  3087. }
  3088. # end: func_to_host_pathlist
  3089. # func_emit_cwrapperexe_src
  3090. # emit the source code for a wrapper executable on stdout
  3091. # Must ONLY be called from within func_mode_link because
  3092. # it depends on a number of variable set therein.
  3093. func_emit_cwrapperexe_src ()
  3094. {
  3095. cat <<EOF
  3096. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  3097. Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  3098. The $output program cannot be directly executed until all the libtool
  3099. libraries that it depends on are installed.
  3100. This wrapper executable should never be moved out of the build directory.
  3101. If it is, it will not operate correctly.
  3102. Currently, it simply execs the wrapper *script* "$SHELL $output",
  3103. but could eventually absorb all of the scripts functionality and
  3104. exec $objdir/$outputname directly.
  3105. */
  3106. EOF
  3107. cat <<"EOF"
  3108. #include <stdio.h>
  3109. #include <stdlib.h>
  3110. #ifdef _MSC_VER
  3111. # include <direct.h>
  3112. # include <process.h>
  3113. # include <io.h>
  3114. # define setmode _setmode
  3115. #else
  3116. # include <unistd.h>
  3117. # include <stdint.h>
  3118. # ifdef __CYGWIN__
  3119. # include <io.h>
  3120. # define HAVE_SETENV
  3121. # ifdef __STRICT_ANSI__
  3122. char *realpath (const char *, char *);
  3123. int putenv (char *);
  3124. int setenv (const char *, const char *, int);
  3125. # endif
  3126. # endif
  3127. #endif
  3128. #include <malloc.h>
  3129. #include <stdarg.h>
  3130. #include <assert.h>
  3131. #include <string.h>
  3132. #include <ctype.h>
  3133. #include <errno.h>
  3134. #include <fcntl.h>
  3135. #include <sys/stat.h>
  3136. #if defined(PATH_MAX)
  3137. # define LT_PATHMAX PATH_MAX
  3138. #elif defined(MAXPATHLEN)
  3139. # define LT_PATHMAX MAXPATHLEN
  3140. #else
  3141. # define LT_PATHMAX 1024
  3142. #endif
  3143. #ifndef S_IXOTH
  3144. # define S_IXOTH 0
  3145. #endif
  3146. #ifndef S_IXGRP
  3147. # define S_IXGRP 0
  3148. #endif
  3149. #ifdef _MSC_VER
  3150. # define S_IXUSR _S_IEXEC
  3151. # define stat _stat
  3152. # ifndef _INTPTR_T_DEFINED
  3153. # define intptr_t int
  3154. # endif
  3155. #endif
  3156. #ifndef DIR_SEPARATOR
  3157. # define DIR_SEPARATOR '/'
  3158. # define PATH_SEPARATOR ':'
  3159. #endif
  3160. #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  3161. defined (__OS2__)
  3162. # define HAVE_DOS_BASED_FILE_SYSTEM
  3163. # define FOPEN_WB "wb"
  3164. # ifndef DIR_SEPARATOR_2
  3165. # define DIR_SEPARATOR_2 '\\'
  3166. # endif
  3167. # ifndef PATH_SEPARATOR_2
  3168. # define PATH_SEPARATOR_2 ';'
  3169. # endif
  3170. #endif
  3171. #ifndef DIR_SEPARATOR_2
  3172. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  3173. #else /* DIR_SEPARATOR_2 */
  3174. # define IS_DIR_SEPARATOR(ch) \
  3175. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  3176. #endif /* DIR_SEPARATOR_2 */
  3177. #ifndef PATH_SEPARATOR_2
  3178. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  3179. #else /* PATH_SEPARATOR_2 */
  3180. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  3181. #endif /* PATH_SEPARATOR_2 */
  3182. #ifdef __CYGWIN__
  3183. # define FOPEN_WB "wb"
  3184. #endif
  3185. #ifndef FOPEN_WB
  3186. # define FOPEN_WB "w"
  3187. #endif
  3188. #ifndef _O_BINARY
  3189. # define _O_BINARY 0
  3190. #endif
  3191. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  3192. #define XFREE(stale) do { \
  3193. if (stale) { free ((void *) stale); stale = 0; } \
  3194. } while (0)
  3195. #undef LTWRAPPER_DEBUGPRINTF
  3196. #if defined DEBUGWRAPPER
  3197. # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
  3198. static void
  3199. ltwrapper_debugprintf (const char *fmt, ...)
  3200. {
  3201. va_list args;
  3202. va_start (args, fmt);
  3203. (void) vfprintf (stderr, fmt, args);
  3204. va_end (args);
  3205. }
  3206. #else
  3207. # define LTWRAPPER_DEBUGPRINTF(args)
  3208. #endif
  3209. const char *program_name = NULL;
  3210. void *xmalloc (size_t num);
  3211. char *xstrdup (const char *string);
  3212. const char *base_name (const char *name);
  3213. char *find_executable (const char *wrapper);
  3214. char *chase_symlinks (const char *pathspec);
  3215. int make_executable (const char *path);
  3216. int check_executable (const char *path);
  3217. char *strendzap (char *str, const char *pat);
  3218. void lt_fatal (const char *message, ...);
  3219. void lt_setenv (const char *name, const char *value);
  3220. char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  3221. void lt_opt_process_env_set (const char *arg);
  3222. void lt_opt_process_env_prepend (const char *arg);
  3223. void lt_opt_process_env_append (const char *arg);
  3224. int lt_split_name_value (const char *arg, char** name, char** value);
  3225. void lt_update_exe_path (const char *name, const char *value);
  3226. void lt_update_lib_path (const char *name, const char *value);
  3227. static const char *script_text_part1 =
  3228. EOF
  3229. func_emit_wrapper_part1 yes |
  3230. $SED -e 's/\([\\"]\)/\\\1/g' \
  3231. -e 's/^/ "/' -e 's/$/\\n"/'
  3232. echo ";"
  3233. cat <<EOF
  3234. static const char *script_text_part2 =
  3235. EOF
  3236. func_emit_wrapper_part2 yes |
  3237. $SED -e 's/\([\\"]\)/\\\1/g' \
  3238. -e 's/^/ "/' -e 's/$/\\n"/'
  3239. echo ";"
  3240. cat <<EOF
  3241. const char * MAGIC_EXE = "$magic_exe";
  3242. const char * LIB_PATH_VARNAME = "$shlibpath_var";
  3243. EOF
  3244. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3245. func_to_host_pathlist "$temp_rpath"
  3246. cat <<EOF
  3247. const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
  3248. EOF
  3249. else
  3250. cat <<"EOF"
  3251. const char * LIB_PATH_VALUE = "";
  3252. EOF
  3253. fi
  3254. if test -n "$dllsearchpath"; then
  3255. func_to_host_pathlist "$dllsearchpath:"
  3256. cat <<EOF
  3257. const char * EXE_PATH_VARNAME = "PATH";
  3258. const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
  3259. EOF
  3260. else
  3261. cat <<"EOF"
  3262. const char * EXE_PATH_VARNAME = "";
  3263. const char * EXE_PATH_VALUE = "";
  3264. EOF
  3265. fi
  3266. if test "$fast_install" = yes; then
  3267. cat <<EOF
  3268. const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  3269. EOF
  3270. else
  3271. cat <<EOF
  3272. const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  3273. EOF
  3274. fi
  3275. cat <<"EOF"
  3276. #define LTWRAPPER_OPTION_PREFIX "--lt-"
  3277. #define LTWRAPPER_OPTION_PREFIX_LENGTH 5
  3278. static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
  3279. static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  3280. static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  3281. static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
  3282. static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
  3283. /* argument is putenv-style "foo=bar", value of foo is set to bar */
  3284. static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
  3285. static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
  3286. /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
  3287. static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
  3288. static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
  3289. /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
  3290. int
  3291. main (int argc, char *argv[])
  3292. {
  3293. char **newargz;
  3294. int newargc;
  3295. char *tmp_pathspec;
  3296. char *actual_cwrapper_path;
  3297. char *actual_cwrapper_name;
  3298. char *target_name;
  3299. char *lt_argv_zero;
  3300. intptr_t rval = 127;
  3301. int i;
  3302. program_name = (char *) xstrdup (base_name (argv[0]));
  3303. LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
  3304. LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
  3305. /* very simple arg parsing; don't want to rely on getopt */
  3306. for (i = 1; i < argc; i++)
  3307. {
  3308. if (strcmp (argv[i], dumpscript_opt) == 0)
  3309. {
  3310. EOF
  3311. case "$host" in
  3312. *mingw* | *cygwin* )
  3313. # make stdout use "unix" line endings
  3314. echo " setmode(1,_O_BINARY);"
  3315. ;;
  3316. esac
  3317. cat <<"EOF"
  3318. printf ("%s", script_text_part1);
  3319. printf ("%s", script_text_part2);
  3320. return 0;
  3321. }
  3322. }
  3323. newargz = XMALLOC (char *, argc + 1);
  3324. tmp_pathspec = find_executable (argv[0]);
  3325. if (tmp_pathspec == NULL)
  3326. lt_fatal ("Couldn't find %s", argv[0]);
  3327. LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
  3328. tmp_pathspec));
  3329. actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  3330. LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
  3331. actual_cwrapper_path));
  3332. XFREE (tmp_pathspec);
  3333. actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
  3334. strendzap (actual_cwrapper_path, actual_cwrapper_name);
  3335. /* wrapper name transforms */
  3336. strendzap (actual_cwrapper_name, ".exe");
  3337. tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  3338. XFREE (actual_cwrapper_name);
  3339. actual_cwrapper_name = tmp_pathspec;
  3340. tmp_pathspec = 0;
  3341. /* target_name transforms -- use actual target program name; might have lt- prefix */
  3342. target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  3343. strendzap (target_name, ".exe");
  3344. tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  3345. XFREE (target_name);
  3346. target_name = tmp_pathspec;
  3347. tmp_pathspec = 0;
  3348. LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
  3349. target_name));
  3350. EOF
  3351. cat <<EOF
  3352. newargz[0] =
  3353. XMALLOC (char, (strlen (actual_cwrapper_path) +
  3354. strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  3355. strcpy (newargz[0], actual_cwrapper_path);
  3356. strcat (newargz[0], "$objdir");
  3357. strcat (newargz[0], "/");
  3358. EOF
  3359. cat <<"EOF"
  3360. /* stop here, and copy so we don't have to do this twice */
  3361. tmp_pathspec = xstrdup (newargz[0]);
  3362. /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  3363. strcat (newargz[0], actual_cwrapper_name);
  3364. /* DO want the lt- prefix here if it exists, so use target_name */
  3365. lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  3366. XFREE (tmp_pathspec);
  3367. tmp_pathspec = NULL;
  3368. EOF
  3369. case $host_os in
  3370. mingw*)
  3371. cat <<"EOF"
  3372. {
  3373. char* p;
  3374. while ((p = strchr (newargz[0], '\\')) != NULL)
  3375. {
  3376. *p = '/';
  3377. }
  3378. while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  3379. {
  3380. *p = '/';
  3381. }
  3382. }
  3383. EOF
  3384. ;;
  3385. esac
  3386. cat <<"EOF"
  3387. XFREE (target_name);
  3388. XFREE (actual_cwrapper_path);
  3389. XFREE (actual_cwrapper_name);
  3390. lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  3391. lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  3392. lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  3393. lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  3394. newargc=0;
  3395. for (i = 1; i < argc; i++)
  3396. {
  3397. if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
  3398. {
  3399. if (argv[i][env_set_opt_len] == '=')
  3400. {
  3401. const char *p = argv[i] + env_set_opt_len + 1;
  3402. lt_opt_process_env_set (p);
  3403. }
  3404. else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
  3405. {
  3406. lt_opt_process_env_set (argv[++i]); /* don't copy */
  3407. }
  3408. else
  3409. lt_fatal ("%s missing required argument", env_set_opt);
  3410. continue;
  3411. }
  3412. if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
  3413. {
  3414. if (argv[i][env_prepend_opt_len] == '=')
  3415. {
  3416. const char *p = argv[i] + env_prepend_opt_len + 1;
  3417. lt_opt_process_env_prepend (p);
  3418. }
  3419. else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
  3420. {
  3421. lt_opt_process_env_prepend (argv[++i]); /* don't copy */
  3422. }
  3423. else
  3424. lt_fatal ("%s missing required argument", env_prepend_opt);
  3425. continue;
  3426. }
  3427. if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
  3428. {
  3429. if (argv[i][env_append_opt_len] == '=')
  3430. {
  3431. const char *p = argv[i] + env_append_opt_len + 1;
  3432. lt_opt_process_env_append (p);
  3433. }
  3434. else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
  3435. {
  3436. lt_opt_process_env_append (argv[++i]); /* don't copy */
  3437. }
  3438. else
  3439. lt_fatal ("%s missing required argument", env_append_opt);
  3440. continue;
  3441. }
  3442. if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
  3443. {
  3444. /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  3445. namespace, but it is not one of the ones we know about and
  3446. have already dealt with, above (inluding dump-script), then
  3447. report an error. Otherwise, targets might begin to believe
  3448. they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  3449. namespace. The first time any user complains about this, we'll
  3450. need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  3451. or a configure.ac-settable value.
  3452. */
  3453. lt_fatal ("Unrecognized option in %s namespace: '%s'",
  3454. ltwrapper_option_prefix, argv[i]);
  3455. }
  3456. /* otherwise ... */
  3457. newargz[++newargc] = xstrdup (argv[i]);
  3458. }
  3459. newargz[++newargc] = NULL;
  3460. LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
  3461. for (i = 0; i < newargc; i++)
  3462. {
  3463. LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
  3464. }
  3465. EOF
  3466. case $host_os in
  3467. mingw*)
  3468. cat <<"EOF"
  3469. /* execv doesn't actually work on mingw as expected on unix */
  3470. rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  3471. if (rval == -1)
  3472. {
  3473. /* failed to start process */
  3474. LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
  3475. return 127;
  3476. }
  3477. return rval;
  3478. EOF
  3479. ;;
  3480. *)
  3481. cat <<"EOF"
  3482. execv (lt_argv_zero, newargz);
  3483. return rval; /* =127, but avoids unused variable warning */
  3484. EOF
  3485. ;;
  3486. esac
  3487. cat <<"EOF"
  3488. }
  3489. void *
  3490. xmalloc (size_t num)
  3491. {
  3492. void *p = (void *) malloc (num);
  3493. if (!p)
  3494. lt_fatal ("Memory exhausted");
  3495. return p;
  3496. }
  3497. char *
  3498. xstrdup (const char *string)
  3499. {
  3500. return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  3501. string) : NULL;
  3502. }
  3503. const char *
  3504. base_name (const char *name)
  3505. {
  3506. const char *base;
  3507. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  3508. /* Skip over the disk name in MSDOS pathnames. */
  3509. if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  3510. name += 2;
  3511. #endif
  3512. for (base = name; *name; name++)
  3513. if (IS_DIR_SEPARATOR (*name))
  3514. base = name + 1;
  3515. return base;
  3516. }
  3517. int
  3518. check_executable (const char *path)
  3519. {
  3520. struct stat st;
  3521. LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
  3522. path ? (*path ? path : "EMPTY!") : "NULL!"));
  3523. if ((!path) || (!*path))
  3524. return 0;
  3525. if ((stat (path, &st) >= 0)
  3526. && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  3527. return 1;
  3528. else
  3529. return 0;
  3530. }
  3531. int
  3532. make_executable (const char *path)
  3533. {
  3534. int rval = 0;
  3535. struct stat st;
  3536. LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
  3537. path ? (*path ? path : "EMPTY!") : "NULL!"));
  3538. if ((!path) || (!*path))
  3539. return 0;
  3540. if (stat (path, &st) >= 0)
  3541. {
  3542. rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  3543. }
  3544. return rval;
  3545. }
  3546. /* Searches for the full path of the wrapper. Returns
  3547. newly allocated full path name if found, NULL otherwise
  3548. Does not chase symlinks, even on platforms that support them.
  3549. */
  3550. char *
  3551. find_executable (const char *wrapper)
  3552. {
  3553. int has_slash = 0;
  3554. const char *p;
  3555. const char *p_next;
  3556. /* static buffer for getcwd */
  3557. char tmp[LT_PATHMAX + 1];
  3558. int tmp_len;
  3559. char *concat_name;
  3560. LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
  3561. wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
  3562. if ((wrapper == NULL) || (*wrapper == '\0'))
  3563. return NULL;
  3564. /* Absolute path? */
  3565. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  3566. if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  3567. {
  3568. concat_name = xstrdup (wrapper);
  3569. if (check_executable (concat_name))
  3570. return concat_name;
  3571. XFREE (concat_name);
  3572. }
  3573. else
  3574. {
  3575. #endif
  3576. if (IS_DIR_SEPARATOR (wrapper[0]))
  3577. {
  3578. concat_name = xstrdup (wrapper);
  3579. if (check_executable (concat_name))
  3580. return concat_name;
  3581. XFREE (concat_name);
  3582. }
  3583. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  3584. }
  3585. #endif
  3586. for (p = wrapper; *p; p++)
  3587. if (*p == '/')
  3588. {
  3589. has_slash = 1;
  3590. break;
  3591. }
  3592. if (!has_slash)
  3593. {
  3594. /* no slashes; search PATH */
  3595. const char *path = getenv ("PATH");
  3596. if (path != NULL)
  3597. {
  3598. for (p = path; *p; p = p_next)
  3599. {
  3600. const char *q;
  3601. size_t p_len;
  3602. for (q = p; *q; q++)
  3603. if (IS_PATH_SEPARATOR (*q))
  3604. break;
  3605. p_len = q - p;
  3606. p_next = (*q == '\0' ? q : q + 1);
  3607. if (p_len == 0)
  3608. {
  3609. /* empty path: current directory */
  3610. if (getcwd (tmp, LT_PATHMAX) == NULL)
  3611. lt_fatal ("getcwd failed");
  3612. tmp_len = strlen (tmp);
  3613. concat_name =
  3614. XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  3615. memcpy (concat_name, tmp, tmp_len);
  3616. concat_name[tmp_len] = '/';
  3617. strcpy (concat_name + tmp_len + 1, wrapper);
  3618. }
  3619. else
  3620. {
  3621. concat_name =
  3622. XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  3623. memcpy (concat_name, p, p_len);
  3624. concat_name[p_len] = '/';
  3625. strcpy (concat_name + p_len + 1, wrapper);
  3626. }
  3627. if (check_executable (concat_name))
  3628. return concat_name;
  3629. XFREE (concat_name);
  3630. }
  3631. }
  3632. /* not found in PATH; assume curdir */
  3633. }
  3634. /* Relative path | not found in path: prepend cwd */
  3635. if (getcwd (tmp, LT_PATHMAX) == NULL)
  3636. lt_fatal ("getcwd failed");
  3637. tmp_len = strlen (tmp);
  3638. concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  3639. memcpy (concat_name, tmp, tmp_len);
  3640. concat_name[tmp_len] = '/';
  3641. strcpy (concat_name + tmp_len + 1, wrapper);
  3642. if (check_executable (concat_name))
  3643. return concat_name;
  3644. XFREE (concat_name);
  3645. return NULL;
  3646. }
  3647. char *
  3648. chase_symlinks (const char *pathspec)
  3649. {
  3650. #ifndef S_ISLNK
  3651. return xstrdup (pathspec);
  3652. #else
  3653. char buf[LT_PATHMAX];
  3654. struct stat s;
  3655. char *tmp_pathspec = xstrdup (pathspec);
  3656. char *p;
  3657. int has_symlinks = 0;
  3658. while (strlen (tmp_pathspec) && !has_symlinks)
  3659. {
  3660. LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
  3661. tmp_pathspec));
  3662. if (lstat (tmp_pathspec, &s) == 0)
  3663. {
  3664. if (S_ISLNK (s.st_mode) != 0)
  3665. {
  3666. has_symlinks = 1;
  3667. break;
  3668. }
  3669. /* search backwards for last DIR_SEPARATOR */
  3670. p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  3671. while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  3672. p--;
  3673. if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  3674. {
  3675. /* no more DIR_SEPARATORS left */
  3676. break;
  3677. }
  3678. *p = '\0';
  3679. }
  3680. else
  3681. {
  3682. char *errstr = strerror (errno);
  3683. lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
  3684. }
  3685. }
  3686. XFREE (tmp_pathspec);
  3687. if (!has_symlinks)
  3688. {
  3689. return xstrdup (pathspec);
  3690. }
  3691. tmp_pathspec = realpath (pathspec, buf);
  3692. if (tmp_pathspec == 0)
  3693. {
  3694. lt_fatal ("Could not follow symlinks for %s", pathspec);
  3695. }
  3696. return xstrdup (tmp_pathspec);
  3697. #endif
  3698. }
  3699. char *
  3700. strendzap (char *str, const char *pat)
  3701. {
  3702. size_t len, patlen;
  3703. assert (str != NULL);
  3704. assert (pat != NULL);
  3705. len = strlen (str);
  3706. patlen = strlen (pat);
  3707. if (patlen <= len)
  3708. {
  3709. str += len - patlen;
  3710. if (strcmp (str, pat) == 0)
  3711. *str = '\0';
  3712. }
  3713. return str;
  3714. }
  3715. static void
  3716. lt_error_core (int exit_status, const char *mode,
  3717. const char *message, va_list ap)
  3718. {
  3719. fprintf (stderr, "%s: %s: ", program_name, mode);
  3720. vfprintf (stderr, message, ap);
  3721. fprintf (stderr, ".\n");
  3722. if (exit_status >= 0)
  3723. exit (exit_status);
  3724. }
  3725. void
  3726. lt_fatal (const char *message, ...)
  3727. {
  3728. va_list ap;
  3729. va_start (ap, message);
  3730. lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  3731. va_end (ap);
  3732. }
  3733. void
  3734. lt_setenv (const char *name, const char *value)
  3735. {
  3736. LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
  3737. (name ? name : "<NULL>"),
  3738. (value ? value : "<NULL>")));
  3739. {
  3740. #ifdef HAVE_SETENV
  3741. /* always make a copy, for consistency with !HAVE_SETENV */
  3742. char *str = xstrdup (value);
  3743. setenv (name, str, 1);
  3744. #else
  3745. int len = strlen (name) + 1 + strlen (value) + 1;
  3746. char *str = XMALLOC (char, len);
  3747. sprintf (str, "%s=%s", name, value);
  3748. if (putenv (str) != EXIT_SUCCESS)
  3749. {
  3750. XFREE (str);
  3751. }
  3752. #endif
  3753. }
  3754. }
  3755. char *
  3756. lt_extend_str (const char *orig_value, const char *add, int to_end)
  3757. {
  3758. char *new_value;
  3759. if (orig_value && *orig_value)
  3760. {
  3761. int orig_value_len = strlen (orig_value);
  3762. int add_len = strlen (add);
  3763. new_value = XMALLOC (char, add_len + orig_value_len + 1);
  3764. if (to_end)
  3765. {
  3766. strcpy (new_value, orig_value);
  3767. strcpy (new_value + orig_value_len, add);
  3768. }
  3769. else
  3770. {
  3771. strcpy (new_value, add);
  3772. strcpy (new_value + add_len, orig_value);
  3773. }
  3774. }
  3775. else
  3776. {
  3777. new_value = xstrdup (add);
  3778. }
  3779. return new_value;
  3780. }
  3781. int
  3782. lt_split_name_value (const char *arg, char** name, char** value)
  3783. {
  3784. const char *p;
  3785. int len;
  3786. if (!arg || !*arg)
  3787. return 1;
  3788. p = strchr (arg, (int)'=');
  3789. if (!p)
  3790. return 1;
  3791. *value = xstrdup (++p);
  3792. len = strlen (arg) - strlen (*value);
  3793. *name = XMALLOC (char, len);
  3794. strncpy (*name, arg, len-1);
  3795. (*name)[len - 1] = '\0';
  3796. return 0;
  3797. }
  3798. void
  3799. lt_opt_process_env_set (const char *arg)
  3800. {
  3801. char *name = NULL;
  3802. char *value = NULL;
  3803. if (lt_split_name_value (arg, &name, &value) != 0)
  3804. {
  3805. XFREE (name);
  3806. XFREE (value);
  3807. lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
  3808. }
  3809. lt_setenv (name, value);
  3810. XFREE (name);
  3811. XFREE (value);
  3812. }
  3813. void
  3814. lt_opt_process_env_prepend (const char *arg)
  3815. {
  3816. char *name = NULL;
  3817. char *value = NULL;
  3818. char *new_value = NULL;
  3819. if (lt_split_name_value (arg, &name, &value) != 0)
  3820. {
  3821. XFREE (name);
  3822. XFREE (value);
  3823. lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
  3824. }
  3825. new_value = lt_extend_str (getenv (name), value, 0);
  3826. lt_setenv (name, new_value);
  3827. XFREE (new_value);
  3828. XFREE (name);
  3829. XFREE (value);
  3830. }
  3831. void
  3832. lt_opt_process_env_append (const char *arg)
  3833. {
  3834. char *name = NULL;
  3835. char *value = NULL;
  3836. char *new_value = NULL;
  3837. if (lt_split_name_value (arg, &name, &value) != 0)
  3838. {
  3839. XFREE (name);
  3840. XFREE (value);
  3841. lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
  3842. }
  3843. new_value = lt_extend_str (getenv (name), value, 1);
  3844. lt_setenv (name, new_value);
  3845. XFREE (new_value);
  3846. XFREE (name);
  3847. XFREE (value);
  3848. }
  3849. void
  3850. lt_update_exe_path (const char *name, const char *value)
  3851. {
  3852. LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  3853. (name ? name : "<NULL>"),
  3854. (value ? value : "<NULL>")));
  3855. if (name && *name && value && *value)
  3856. {
  3857. char *new_value = lt_extend_str (getenv (name), value, 0);
  3858. /* some systems can't cope with a ':'-terminated path #' */
  3859. int len = strlen (new_value);
  3860. while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  3861. {
  3862. new_value[len-1] = '\0';
  3863. }
  3864. lt_setenv (name, new_value);
  3865. XFREE (new_value);
  3866. }
  3867. }
  3868. void
  3869. lt_update_lib_path (const char *name, const char *value)
  3870. {
  3871. LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  3872. (name ? name : "<NULL>"),
  3873. (value ? value : "<NULL>")));
  3874. if (name && *name && value && *value)
  3875. {
  3876. char *new_value = lt_extend_str (getenv (name), value, 0);
  3877. lt_setenv (name, new_value);
  3878. XFREE (new_value);
  3879. }
  3880. }
  3881. EOF
  3882. }
  3883. # end: func_emit_cwrapperexe_src
  3884. # func_mode_link arg...
  3885. func_mode_link ()
  3886. {
  3887. $opt_debug
  3888. case $host in
  3889. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  3890. # It is impossible to link a dll without this setting, and
  3891. # we shouldn't force the makefile maintainer to figure out
  3892. # which system we are compiling for in order to pass an extra
  3893. # flag for every libtool invocation.
  3894. # allow_undefined=no
  3895. # FIXME: Unfortunately, there are problems with the above when trying
  3896. # to make a dll which has undefined symbols, in which case not
  3897. # even a static library is built. For now, we need to specify
  3898. # -no-undefined on the libtool link line when we can be certain
  3899. # that all symbols are satisfied, otherwise we get a static library.
  3900. allow_undefined=yes
  3901. ;;
  3902. *)
  3903. allow_undefined=yes
  3904. ;;
  3905. esac
  3906. libtool_args=$nonopt
  3907. base_compile="$nonopt $@"
  3908. compile_command=$nonopt
  3909. finalize_command=$nonopt
  3910. compile_rpath=
  3911. finalize_rpath=
  3912. compile_shlibpath=
  3913. finalize_shlibpath=
  3914. convenience=
  3915. old_convenience=
  3916. deplibs=
  3917. old_deplibs=
  3918. compiler_flags=
  3919. linker_flags=
  3920. dllsearchpath=
  3921. lib_search_path=`pwd`
  3922. inst_prefix_dir=
  3923. new_inherited_linker_flags=
  3924. avoid_version=no
  3925. dlfiles=
  3926. dlprefiles=
  3927. dlself=no
  3928. export_dynamic=no
  3929. export_symbols=
  3930. export_symbols_regex=
  3931. generated=
  3932. libobjs=
  3933. ltlibs=
  3934. module=no
  3935. no_install=no
  3936. objs=
  3937. non_pic_objects=
  3938. precious_files_regex=
  3939. prefer_static_libs=no
  3940. preload=no
  3941. prev=
  3942. prevarg=
  3943. release=
  3944. rpath=
  3945. xrpath=
  3946. perm_rpath=
  3947. temp_rpath=
  3948. thread_safe=no
  3949. vinfo=
  3950. vinfo_number=no
  3951. weak_libs=
  3952. single_module="${wl}-single_module"
  3953. func_infer_tag $base_compile
  3954. # We need to know -static, to get the right output filenames.
  3955. for arg
  3956. do
  3957. case $arg in
  3958. -shared)
  3959. test "$build_libtool_libs" != yes && \
  3960. func_fatal_configuration "can not build a shared library"
  3961. build_old_libs=no
  3962. break
  3963. ;;
  3964. -all-static | -static | -static-libtool-libs)
  3965. case $arg in
  3966. -all-static)
  3967. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  3968. func_warning "complete static linking is impossible in this configuration"
  3969. fi
  3970. if test -n "$link_static_flag"; then
  3971. dlopen_self=$dlopen_self_static
  3972. fi
  3973. prefer_static_libs=yes
  3974. ;;
  3975. -static)
  3976. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  3977. dlopen_self=$dlopen_self_static
  3978. fi
  3979. prefer_static_libs=built
  3980. ;;
  3981. -static-libtool-libs)
  3982. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  3983. dlopen_self=$dlopen_self_static
  3984. fi
  3985. prefer_static_libs=yes
  3986. ;;
  3987. esac
  3988. build_libtool_libs=no
  3989. build_old_libs=yes
  3990. break
  3991. ;;
  3992. esac
  3993. done
  3994. # See if our shared archives depend on static archives.
  3995. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  3996. # Go through the arguments, transforming them on the way.
  3997. while test "$#" -gt 0; do
  3998. arg="$1"
  3999. shift
  4000. func_quote_for_eval "$arg"
  4001. qarg=$func_quote_for_eval_unquoted_result
  4002. func_append libtool_args " $func_quote_for_eval_result"
  4003. # If the previous option needs an argument, assign it.
  4004. if test -n "$prev"; then
  4005. case $prev in
  4006. output)
  4007. func_append compile_command " @OUTPUT@"
  4008. func_append finalize_command " @OUTPUT@"
  4009. ;;
  4010. esac
  4011. case $prev in
  4012. dlfiles|dlprefiles)
  4013. if test "$preload" = no; then
  4014. # Add the symbol object into the linking commands.
  4015. func_append compile_command " @SYMFILE@"
  4016. func_append finalize_command " @SYMFILE@"
  4017. preload=yes
  4018. fi
  4019. case $arg in
  4020. *.la | *.lo) ;; # We handle these cases below.
  4021. force)
  4022. if test "$dlself" = no; then
  4023. dlself=needless
  4024. export_dynamic=yes
  4025. fi
  4026. prev=
  4027. continue
  4028. ;;
  4029. self)
  4030. if test "$prev" = dlprefiles; then
  4031. dlself=yes
  4032. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  4033. dlself=yes
  4034. else
  4035. dlself=needless
  4036. export_dynamic=yes
  4037. fi
  4038. prev=
  4039. continue
  4040. ;;
  4041. *)
  4042. if test "$prev" = dlfiles; then
  4043. dlfiles="$dlfiles $arg"
  4044. else
  4045. dlprefiles="$dlprefiles $arg"
  4046. fi
  4047. prev=
  4048. continue
  4049. ;;
  4050. esac
  4051. ;;
  4052. expsyms)
  4053. export_symbols="$arg"
  4054. test -f "$arg" \
  4055. || func_fatal_error "symbol file \`$arg' does not exist"
  4056. prev=
  4057. continue
  4058. ;;
  4059. expsyms_regex)
  4060. export_symbols_regex="$arg"
  4061. prev=
  4062. continue
  4063. ;;
  4064. framework)
  4065. case $host in
  4066. *-*-darwin*)
  4067. case "$deplibs " in
  4068. *" $qarg.ltframework "*) ;;
  4069. *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
  4070. ;;
  4071. esac
  4072. ;;
  4073. esac
  4074. prev=
  4075. continue
  4076. ;;
  4077. inst_prefix)
  4078. inst_prefix_dir="$arg"
  4079. prev=
  4080. continue
  4081. ;;
  4082. objectlist)
  4083. if test -f "$arg"; then
  4084. save_arg=$arg
  4085. moreargs=
  4086. for fil in `cat "$save_arg"`
  4087. do
  4088. # moreargs="$moreargs $fil"
  4089. arg=$fil
  4090. # A libtool-controlled object.
  4091. # Check to see that this really is a libtool object.
  4092. if func_lalib_unsafe_p "$arg"; then
  4093. pic_object=
  4094. non_pic_object=
  4095. # Read the .lo file
  4096. func_source "$arg"
  4097. if test -z "$pic_object" ||
  4098. test -z "$non_pic_object" ||
  4099. test "$pic_object" = none &&
  4100. test "$non_pic_object" = none; then
  4101. func_fatal_error "cannot find name of object for \`$arg'"
  4102. fi
  4103. # Extract subdirectory from the argument.
  4104. func_dirname "$arg" "/" ""
  4105. xdir="$func_dirname_result"
  4106. if test "$pic_object" != none; then
  4107. # Prepend the subdirectory the object is found in.
  4108. pic_object="$xdir$pic_object"
  4109. if test "$prev" = dlfiles; then
  4110. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  4111. dlfiles="$dlfiles $pic_object"
  4112. prev=
  4113. continue
  4114. else
  4115. # If libtool objects are unsupported, then we need to preload.
  4116. prev=dlprefiles
  4117. fi
  4118. fi
  4119. # CHECK ME: I think I busted this. -Ossama
  4120. if test "$prev" = dlprefiles; then
  4121. # Preload the old-style object.
  4122. dlprefiles="$dlprefiles $pic_object"
  4123. prev=
  4124. fi
  4125. # A PIC object.
  4126. func_append libobjs " $pic_object"
  4127. arg="$pic_object"
  4128. fi
  4129. # Non-PIC object.
  4130. if test "$non_pic_object" != none; then
  4131. # Prepend the subdirectory the object is found in.
  4132. non_pic_object="$xdir$non_pic_object"
  4133. # A standard non-PIC object
  4134. func_append non_pic_objects " $non_pic_object"
  4135. if test -z "$pic_object" || test "$pic_object" = none ; then
  4136. arg="$non_pic_object"
  4137. fi
  4138. else
  4139. # If the PIC object exists, use it instead.
  4140. # $xdir was prepended to $pic_object above.
  4141. non_pic_object="$pic_object"
  4142. func_append non_pic_objects " $non_pic_object"
  4143. fi
  4144. else
  4145. # Only an error if not doing a dry-run.
  4146. if $opt_dry_run; then
  4147. # Extract subdirectory from the argument.
  4148. func_dirname "$arg" "/" ""
  4149. xdir="$func_dirname_result"
  4150. func_lo2o "$arg"
  4151. pic_object=$xdir$objdir/$func_lo2o_result
  4152. non_pic_object=$xdir$func_lo2o_result
  4153. func_append libobjs " $pic_object"
  4154. func_append non_pic_objects " $non_pic_object"
  4155. else
  4156. func_fatal_error "\`$arg' is not a valid libtool object"
  4157. fi
  4158. fi
  4159. done
  4160. else
  4161. func_fatal_error "link input file \`$arg' does not exist"
  4162. fi
  4163. arg=$save_arg
  4164. prev=
  4165. continue
  4166. ;;
  4167. precious_regex)
  4168. precious_files_regex="$arg"
  4169. prev=
  4170. continue
  4171. ;;
  4172. release)
  4173. release="-$arg"
  4174. prev=
  4175. continue
  4176. ;;
  4177. rpath | xrpath)
  4178. # We need an absolute path.
  4179. case $arg in
  4180. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4181. *)
  4182. func_fatal_error "only absolute run-paths are allowed"
  4183. ;;
  4184. esac
  4185. if test "$prev" = rpath; then
  4186. case "$rpath " in
  4187. *" $arg "*) ;;
  4188. *) rpath="$rpath $arg" ;;
  4189. esac
  4190. else
  4191. case "$xrpath " in
  4192. *" $arg "*) ;;
  4193. *) xrpath="$xrpath $arg" ;;
  4194. esac
  4195. fi
  4196. prev=
  4197. continue
  4198. ;;
  4199. shrext)
  4200. shrext_cmds="$arg"
  4201. prev=
  4202. continue
  4203. ;;
  4204. weak)
  4205. weak_libs="$weak_libs $arg"
  4206. prev=
  4207. continue
  4208. ;;
  4209. xcclinker)
  4210. linker_flags="$linker_flags $qarg"
  4211. compiler_flags="$compiler_flags $qarg"
  4212. prev=
  4213. func_append compile_command " $qarg"
  4214. func_append finalize_command " $qarg"
  4215. continue
  4216. ;;
  4217. xcompiler)
  4218. compiler_flags="$compiler_flags $qarg"
  4219. prev=
  4220. func_append compile_command " $qarg"
  4221. func_append finalize_command " $qarg"
  4222. continue
  4223. ;;
  4224. xlinker)
  4225. linker_flags="$linker_flags $qarg"
  4226. compiler_flags="$compiler_flags $wl$qarg"
  4227. prev=
  4228. func_append compile_command " $wl$qarg"
  4229. func_append finalize_command " $wl$qarg"
  4230. continue
  4231. ;;
  4232. *)
  4233. eval "$prev=\"\$arg\""
  4234. prev=
  4235. continue
  4236. ;;
  4237. esac
  4238. fi # test -n "$prev"
  4239. prevarg="$arg"
  4240. case $arg in
  4241. -all-static)
  4242. if test -n "$link_static_flag"; then
  4243. # See comment for -static flag below, for more details.
  4244. func_append compile_command " $link_static_flag"
  4245. func_append finalize_command " $link_static_flag"
  4246. fi
  4247. continue
  4248. ;;
  4249. -allow-undefined)
  4250. # FIXME: remove this flag sometime in the future.
  4251. func_fatal_error "\`-allow-undefined' must not be used because it is the default"
  4252. ;;
  4253. -avoid-version)
  4254. avoid_version=yes
  4255. continue
  4256. ;;
  4257. -dlopen)
  4258. prev=dlfiles
  4259. continue
  4260. ;;
  4261. -dlpreopen)
  4262. prev=dlprefiles
  4263. continue
  4264. ;;
  4265. -export-dynamic)
  4266. export_dynamic=yes
  4267. continue
  4268. ;;
  4269. -export-symbols | -export-symbols-regex)
  4270. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  4271. func_fatal_error "more than one -exported-symbols argument is not allowed"
  4272. fi
  4273. if test "X$arg" = "X-export-symbols"; then
  4274. prev=expsyms
  4275. else
  4276. prev=expsyms_regex
  4277. fi
  4278. continue
  4279. ;;
  4280. -framework)
  4281. prev=framework
  4282. continue
  4283. ;;
  4284. -inst-prefix-dir)
  4285. prev=inst_prefix
  4286. continue
  4287. ;;
  4288. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  4289. # so, if we see these flags be careful not to treat them like -L
  4290. -L[A-Z][A-Z]*:*)
  4291. case $with_gcc/$host in
  4292. no/*-*-irix* | /*-*-irix*)
  4293. func_append compile_command " $arg"
  4294. func_append finalize_command " $arg"
  4295. ;;
  4296. esac
  4297. continue
  4298. ;;
  4299. -L*)
  4300. func_stripname '-L' '' "$arg"
  4301. dir=$func_stripname_result
  4302. if test -z "$dir"; then
  4303. if test "$#" -gt 0; then
  4304. func_fatal_error "require no space between \`-L' and \`$1'"
  4305. else
  4306. func_fatal_error "need path for \`-L' option"
  4307. fi
  4308. fi
  4309. # We need an absolute path.
  4310. case $dir in
  4311. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4312. *)
  4313. absdir=`cd "$dir" && pwd`
  4314. test -z "$absdir" && \
  4315. func_fatal_error "cannot determine absolute directory name of \`$dir'"
  4316. dir="$absdir"
  4317. ;;
  4318. esac
  4319. case "$deplibs " in
  4320. *" -L$dir "*) ;;
  4321. *)
  4322. deplibs="$deplibs -L$dir"
  4323. lib_search_path="$lib_search_path $dir"
  4324. ;;
  4325. esac
  4326. case $host in
  4327. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  4328. testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  4329. case :$dllsearchpath: in
  4330. *":$dir:"*) ;;
  4331. ::) dllsearchpath=$dir;;
  4332. *) dllsearchpath="$dllsearchpath:$dir";;
  4333. esac
  4334. case :$dllsearchpath: in
  4335. *":$testbindir:"*) ;;
  4336. ::) dllsearchpath=$testbindir;;
  4337. *) dllsearchpath="$dllsearchpath:$testbindir";;
  4338. esac
  4339. ;;
  4340. esac
  4341. continue
  4342. ;;
  4343. -l*)
  4344. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  4345. case $host in
  4346. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
  4347. # These systems don't actually have a C or math library (as such)
  4348. continue
  4349. ;;
  4350. *-*-os2*)
  4351. # These systems don't actually have a C library (as such)
  4352. test "X$arg" = "X-lc" && continue
  4353. ;;
  4354. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  4355. # Do not include libc due to us having libc/libc_r.
  4356. test "X$arg" = "X-lc" && continue
  4357. ;;
  4358. *-*-rhapsody* | *-*-darwin1.[012])
  4359. # Rhapsody C and math libraries are in the System framework
  4360. deplibs="$deplibs System.ltframework"
  4361. continue
  4362. ;;
  4363. *-*-sco3.2v5* | *-*-sco5v6*)
  4364. # Causes problems with __ctype
  4365. test "X$arg" = "X-lc" && continue
  4366. ;;
  4367. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  4368. # Compiler inserts libc in the correct place for threads to work
  4369. test "X$arg" = "X-lc" && continue
  4370. ;;
  4371. esac
  4372. elif test "X$arg" = "X-lc_r"; then
  4373. case $host in
  4374. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  4375. # Do not include libc_r directly, use -pthread flag.
  4376. continue
  4377. ;;
  4378. esac
  4379. fi
  4380. deplibs="$deplibs $arg"
  4381. continue
  4382. ;;
  4383. -module)
  4384. module=yes
  4385. continue
  4386. ;;
  4387. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  4388. # classes, name mangling, and exception handling.
  4389. # Darwin uses the -arch flag to determine output architecture.
  4390. -model|-arch|-isysroot)
  4391. compiler_flags="$compiler_flags $arg"
  4392. func_append compile_command " $arg"
  4393. func_append finalize_command " $arg"
  4394. prev=xcompiler
  4395. continue
  4396. ;;
  4397. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  4398. compiler_flags="$compiler_flags $arg"
  4399. func_append compile_command " $arg"
  4400. func_append finalize_command " $arg"
  4401. case "$new_inherited_linker_flags " in
  4402. *" $arg "*) ;;
  4403. * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
  4404. esac
  4405. continue
  4406. ;;
  4407. -multi_module)
  4408. single_module="${wl}-multi_module"
  4409. continue
  4410. ;;
  4411. -no-fast-install)
  4412. fast_install=no
  4413. continue
  4414. ;;
  4415. -no-install)
  4416. case $host in
  4417. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  4418. # The PATH hackery in wrapper scripts is required on Windows
  4419. # and Darwin in order for the loader to find any dlls it needs.
  4420. func_warning "\`-no-install' is ignored for $host"
  4421. func_warning "assuming \`-no-fast-install' instead"
  4422. fast_install=no
  4423. ;;
  4424. *) no_install=yes ;;
  4425. esac
  4426. continue
  4427. ;;
  4428. -no-undefined)
  4429. allow_undefined=no
  4430. continue
  4431. ;;
  4432. -objectlist)
  4433. prev=objectlist
  4434. continue
  4435. ;;
  4436. -o) prev=output ;;
  4437. -precious-files-regex)
  4438. prev=precious_regex
  4439. continue
  4440. ;;
  4441. -release)
  4442. prev=release
  4443. continue
  4444. ;;
  4445. -rpath)
  4446. prev=rpath
  4447. continue
  4448. ;;
  4449. -R)
  4450. prev=xrpath
  4451. continue
  4452. ;;
  4453. -R*)
  4454. func_stripname '-R' '' "$arg"
  4455. dir=$func_stripname_result
  4456. # We need an absolute path.
  4457. case $dir in
  4458. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4459. *)
  4460. func_fatal_error "only absolute run-paths are allowed"
  4461. ;;
  4462. esac
  4463. case "$xrpath " in
  4464. *" $dir "*) ;;
  4465. *) xrpath="$xrpath $dir" ;;
  4466. esac
  4467. continue
  4468. ;;
  4469. -shared)
  4470. # The effects of -shared are defined in a previous loop.
  4471. continue
  4472. ;;
  4473. -shrext)
  4474. prev=shrext
  4475. continue
  4476. ;;
  4477. -static | -static-libtool-libs)
  4478. # The effects of -static are defined in a previous loop.
  4479. # We used to do the same as -all-static on platforms that
  4480. # didn't have a PIC flag, but the assumption that the effects
  4481. # would be equivalent was wrong. It would break on at least
  4482. # Digital Unix and AIX.
  4483. continue
  4484. ;;
  4485. -thread-safe)
  4486. thread_safe=yes
  4487. continue
  4488. ;;
  4489. -version-info)
  4490. prev=vinfo
  4491. continue
  4492. ;;
  4493. -version-number)
  4494. prev=vinfo
  4495. vinfo_number=yes
  4496. continue
  4497. ;;
  4498. -weak)
  4499. prev=weak
  4500. continue
  4501. ;;
  4502. -Wc,*)
  4503. func_stripname '-Wc,' '' "$arg"
  4504. args=$func_stripname_result
  4505. arg=
  4506. save_ifs="$IFS"; IFS=','
  4507. for flag in $args; do
  4508. IFS="$save_ifs"
  4509. func_quote_for_eval "$flag"
  4510. arg="$arg $wl$func_quote_for_eval_result"
  4511. compiler_flags="$compiler_flags $func_quote_for_eval_result"
  4512. done
  4513. IFS="$save_ifs"
  4514. func_stripname ' ' '' "$arg"
  4515. arg=$func_stripname_result
  4516. ;;
  4517. -Wl,*)
  4518. func_stripname '-Wl,' '' "$arg"
  4519. args=$func_stripname_result
  4520. arg=
  4521. save_ifs="$IFS"; IFS=','
  4522. for flag in $args; do
  4523. IFS="$save_ifs"
  4524. func_quote_for_eval "$flag"
  4525. arg="$arg $wl$func_quote_for_eval_result"
  4526. compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
  4527. linker_flags="$linker_flags $func_quote_for_eval_result"
  4528. done
  4529. IFS="$save_ifs"
  4530. func_stripname ' ' '' "$arg"
  4531. arg=$func_stripname_result
  4532. ;;
  4533. -Xcompiler)
  4534. prev=xcompiler
  4535. continue
  4536. ;;
  4537. -Xlinker)
  4538. prev=xlinker
  4539. continue
  4540. ;;
  4541. -XCClinker)
  4542. prev=xcclinker
  4543. continue
  4544. ;;
  4545. # -msg_* for osf cc
  4546. -msg_*)
  4547. func_quote_for_eval "$arg"
  4548. arg="$func_quote_for_eval_result"
  4549. ;;
  4550. # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  4551. # -r[0-9][0-9]* specifies the processor on the SGI compiler
  4552. # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  4553. # +DA*, +DD* enable 64-bit mode on the HP compiler
  4554. # -q* pass through compiler args for the IBM compiler
  4555. # -m*, -t[45]*, -txscale* pass through architecture-specific
  4556. # compiler args for GCC
  4557. # -F/path gives path to uninstalled frameworks, gcc on darwin
  4558. # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
  4559. # @file GCC response files
  4560. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  4561. -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
  4562. func_quote_for_eval "$arg"
  4563. arg="$func_quote_for_eval_result"
  4564. func_append compile_command " $arg"
  4565. func_append finalize_command " $arg"
  4566. compiler_flags="$compiler_flags $arg"
  4567. continue
  4568. ;;
  4569. # Some other compiler flag.
  4570. -* | +*)
  4571. func_quote_for_eval "$arg"
  4572. arg="$func_quote_for_eval_result"
  4573. ;;
  4574. *.$objext)
  4575. # A standard object.
  4576. objs="$objs $arg"
  4577. ;;
  4578. *.lo)
  4579. # A libtool-controlled object.
  4580. # Check to see that this really is a libtool object.
  4581. if func_lalib_unsafe_p "$arg"; then
  4582. pic_object=
  4583. non_pic_object=
  4584. # Read the .lo file
  4585. func_source "$arg"
  4586. if test -z "$pic_object" ||
  4587. test -z "$non_pic_object" ||
  4588. test "$pic_object" = none &&
  4589. test "$non_pic_object" = none; then
  4590. func_fatal_error "cannot find name of object for \`$arg'"
  4591. fi
  4592. # Extract subdirectory from the argument.
  4593. func_dirname "$arg" "/" ""
  4594. xdir="$func_dirname_result"
  4595. if test "$pic_object" != none; then
  4596. # Prepend the subdirectory the object is found in.
  4597. pic_object="$xdir$pic_object"
  4598. if test "$prev" = dlfiles; then
  4599. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  4600. dlfiles="$dlfiles $pic_object"
  4601. prev=
  4602. continue
  4603. else
  4604. # If libtool objects are unsupported, then we need to preload.
  4605. prev=dlprefiles
  4606. fi
  4607. fi
  4608. # CHECK ME: I think I busted this. -Ossama
  4609. if test "$prev" = dlprefiles; then
  4610. # Preload the old-style object.
  4611. dlprefiles="$dlprefiles $pic_object"
  4612. prev=
  4613. fi
  4614. # A PIC object.
  4615. func_append libobjs " $pic_object"
  4616. arg="$pic_object"
  4617. fi
  4618. # Non-PIC object.
  4619. if test "$non_pic_object" != none; then
  4620. # Prepend the subdirectory the object is found in.
  4621. non_pic_object="$xdir$non_pic_object"
  4622. # A standard non-PIC object
  4623. func_append non_pic_objects " $non_pic_object"
  4624. if test -z "$pic_object" || test "$pic_object" = none ; then
  4625. arg="$non_pic_object"
  4626. fi
  4627. else
  4628. # If the PIC object exists, use it instead.
  4629. # $xdir was prepended to $pic_object above.
  4630. non_pic_object="$pic_object"
  4631. func_append non_pic_objects " $non_pic_object"
  4632. fi
  4633. else
  4634. # Only an error if not doing a dry-run.
  4635. if $opt_dry_run; then
  4636. # Extract subdirectory from the argument.
  4637. func_dirname "$arg" "/" ""
  4638. xdir="$func_dirname_result"
  4639. func_lo2o "$arg"
  4640. pic_object=$xdir$objdir/$func_lo2o_result
  4641. non_pic_object=$xdir$func_lo2o_result
  4642. func_append libobjs " $pic_object"
  4643. func_append non_pic_objects " $non_pic_object"
  4644. else
  4645. func_fatal_error "\`$arg' is not a valid libtool object"
  4646. fi
  4647. fi
  4648. ;;
  4649. *.$libext)
  4650. # An archive.
  4651. deplibs="$deplibs $arg"
  4652. old_deplibs="$old_deplibs $arg"
  4653. continue
  4654. ;;
  4655. *.la)
  4656. # A libtool-controlled library.
  4657. if test "$prev" = dlfiles; then
  4658. # This library was specified with -dlopen.
  4659. dlfiles="$dlfiles $arg"
  4660. prev=
  4661. elif test "$prev" = dlprefiles; then
  4662. # The library was specified with -dlpreopen.
  4663. dlprefiles="$dlprefiles $arg"
  4664. prev=
  4665. else
  4666. deplibs="$deplibs $arg"
  4667. fi
  4668. continue
  4669. ;;
  4670. # Some other compiler argument.
  4671. *)
  4672. # Unknown arguments in both finalize_command and compile_command need
  4673. # to be aesthetically quoted because they are evaled later.
  4674. func_quote_for_eval "$arg"
  4675. arg="$func_quote_for_eval_result"
  4676. ;;
  4677. esac # arg
  4678. # Now actually substitute the argument into the commands.
  4679. if test -n "$arg"; then
  4680. func_append compile_command " $arg"
  4681. func_append finalize_command " $arg"
  4682. fi
  4683. done # argument parsing loop
  4684. test -n "$prev" && \
  4685. func_fatal_help "the \`$prevarg' option requires an argument"
  4686. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  4687. eval arg=\"$export_dynamic_flag_spec\"
  4688. func_append compile_command " $arg"
  4689. func_append finalize_command " $arg"
  4690. fi
  4691. oldlibs=
  4692. # calculate the name of the file, without its directory
  4693. func_basename "$output"
  4694. outputname="$func_basename_result"
  4695. libobjs_save="$libobjs"
  4696. if test -n "$shlibpath_var"; then
  4697. # get the directories listed in $shlibpath_var
  4698. eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  4699. else
  4700. shlib_search_path=
  4701. fi
  4702. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  4703. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  4704. func_dirname "$output" "/" ""
  4705. output_objdir="$func_dirname_result$objdir"
  4706. # Create the object directory.
  4707. func_mkdir_p "$output_objdir"
  4708. # Determine the type of output
  4709. case $output in
  4710. "")
  4711. func_fatal_help "you must specify an output file"
  4712. ;;
  4713. *.$libext) linkmode=oldlib ;;
  4714. *.lo | *.$objext) linkmode=obj ;;
  4715. *.la) linkmode=lib ;;
  4716. *) linkmode=prog ;; # Anything else should be a program.
  4717. esac
  4718. specialdeplibs=
  4719. libs=
  4720. # Find all interdependent deplibs by searching for libraries
  4721. # that are linked more than once (e.g. -la -lb -la)
  4722. for deplib in $deplibs; do
  4723. if $opt_duplicate_deps ; then
  4724. case "$libs " in
  4725. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  4726. esac
  4727. fi
  4728. libs="$libs $deplib"
  4729. done
  4730. if test "$linkmode" = lib; then
  4731. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  4732. # Compute libraries that are listed more than once in $predeps
  4733. # $postdeps and mark them as special (i.e., whose duplicates are
  4734. # not to be eliminated).
  4735. pre_post_deps=
  4736. if $opt_duplicate_compiler_generated_deps; then
  4737. for pre_post_dep in $predeps $postdeps; do
  4738. case "$pre_post_deps " in
  4739. *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  4740. esac
  4741. pre_post_deps="$pre_post_deps $pre_post_dep"
  4742. done
  4743. fi
  4744. pre_post_deps=
  4745. fi
  4746. deplibs=
  4747. newdependency_libs=
  4748. newlib_search_path=
  4749. need_relink=no # whether we're linking any uninstalled libtool libraries
  4750. notinst_deplibs= # not-installed libtool libraries
  4751. notinst_path= # paths that contain not-installed libtool libraries
  4752. case $linkmode in
  4753. lib)
  4754. passes="conv dlpreopen link"
  4755. for file in $dlfiles $dlprefiles; do
  4756. case $file in
  4757. *.la) ;;
  4758. *)
  4759. func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
  4760. ;;
  4761. esac
  4762. done
  4763. ;;
  4764. prog)
  4765. compile_deplibs=
  4766. finalize_deplibs=
  4767. alldeplibs=no
  4768. newdlfiles=
  4769. newdlprefiles=
  4770. passes="conv scan dlopen dlpreopen link"
  4771. ;;
  4772. *) passes="conv"
  4773. ;;
  4774. esac
  4775. for pass in $passes; do
  4776. # The preopen pass in lib mode reverses $deplibs; put it back here
  4777. # so that -L comes before libs that need it for instance...
  4778. if test "$linkmode,$pass" = "lib,link"; then
  4779. ## FIXME: Find the place where the list is rebuilt in the wrong
  4780. ## order, and fix it there properly
  4781. tmp_deplibs=
  4782. for deplib in $deplibs; do
  4783. tmp_deplibs="$deplib $tmp_deplibs"
  4784. done
  4785. deplibs="$tmp_deplibs"
  4786. fi
  4787. if test "$linkmode,$pass" = "lib,link" ||
  4788. test "$linkmode,$pass" = "prog,scan"; then
  4789. libs="$deplibs"
  4790. deplibs=
  4791. fi
  4792. if test "$linkmode" = prog; then
  4793. case $pass in
  4794. dlopen) libs="$dlfiles" ;;
  4795. dlpreopen) libs="$dlprefiles" ;;
  4796. link)
  4797. libs="$deplibs %DEPLIBS%"
  4798. test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
  4799. ;;
  4800. esac
  4801. fi
  4802. if test "$linkmode,$pass" = "lib,dlpreopen"; then
  4803. # Collect and forward deplibs of preopened libtool libs
  4804. for lib in $dlprefiles; do
  4805. # Ignore non-libtool-libs
  4806. dependency_libs=
  4807. case $lib in
  4808. *.la) func_source "$lib" ;;
  4809. esac
  4810. # Collect preopened libtool deplibs, except any this library
  4811. # has declared as weak libs
  4812. for deplib in $dependency_libs; do
  4813. deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
  4814. case " $weak_libs " in
  4815. *" $deplib_base "*) ;;
  4816. *) deplibs="$deplibs $deplib" ;;
  4817. esac
  4818. done
  4819. done
  4820. libs="$dlprefiles"
  4821. fi
  4822. if test "$pass" = dlopen; then
  4823. # Collect dlpreopened libraries
  4824. save_deplibs="$deplibs"
  4825. deplibs=
  4826. fi
  4827. for deplib in $libs; do
  4828. lib=
  4829. found=no
  4830. case $deplib in
  4831. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  4832. if test "$linkmode,$pass" = "prog,link"; then
  4833. compile_deplibs="$deplib $compile_deplibs"
  4834. finalize_deplibs="$deplib $finalize_deplibs"
  4835. else
  4836. compiler_flags="$compiler_flags $deplib"
  4837. if test "$linkmode" = lib ; then
  4838. case "$new_inherited_linker_flags " in
  4839. *" $deplib "*) ;;
  4840. * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  4841. esac
  4842. fi
  4843. fi
  4844. continue
  4845. ;;
  4846. -l*)
  4847. if test "$linkmode" != lib && test "$linkmode" != prog; then
  4848. func_warning "\`-l' is ignored for archives/objects"
  4849. continue
  4850. fi
  4851. func_stripname '-l' '' "$deplib"
  4852. name=$func_stripname_result
  4853. if test "$linkmode" = lib; then
  4854. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  4855. else
  4856. searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  4857. fi
  4858. for searchdir in $searchdirs; do
  4859. for search_ext in .la $std_shrext .so .a; do
  4860. # Search the libtool library
  4861. lib="$searchdir/lib${name}${search_ext}"
  4862. if test -f "$lib"; then
  4863. if test "$search_ext" = ".la"; then
  4864. found=yes
  4865. else
  4866. found=no
  4867. fi
  4868. break 2
  4869. fi
  4870. done
  4871. done
  4872. if test "$found" != yes; then
  4873. # deplib doesn't seem to be a libtool library
  4874. if test "$linkmode,$pass" = "prog,link"; then
  4875. compile_deplibs="$deplib $compile_deplibs"
  4876. finalize_deplibs="$deplib $finalize_deplibs"
  4877. else
  4878. deplibs="$deplib $deplibs"
  4879. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  4880. fi
  4881. continue
  4882. else # deplib is a libtool library
  4883. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  4884. # We need to do some special things here, and not later.
  4885. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  4886. case " $predeps $postdeps " in
  4887. *" $deplib "*)
  4888. if func_lalib_p "$lib"; then
  4889. library_names=
  4890. old_library=
  4891. func_source "$lib"
  4892. for l in $old_library $library_names; do
  4893. ll="$l"
  4894. done
  4895. if test "X$ll" = "X$old_library" ; then # only static version available
  4896. found=no
  4897. func_dirname "$lib" "" "."
  4898. ladir="$func_dirname_result"
  4899. lib=$ladir/$old_library
  4900. if test "$linkmode,$pass" = "prog,link"; then
  4901. compile_deplibs="$deplib $compile_deplibs"
  4902. finalize_deplibs="$deplib $finalize_deplibs"
  4903. else
  4904. deplibs="$deplib $deplibs"
  4905. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  4906. fi
  4907. continue
  4908. fi
  4909. fi
  4910. ;;
  4911. *) ;;
  4912. esac
  4913. fi
  4914. fi
  4915. ;; # -l
  4916. *.ltframework)
  4917. if test "$linkmode,$pass" = "prog,link"; then
  4918. compile_deplibs="$deplib $compile_deplibs"
  4919. finalize_deplibs="$deplib $finalize_deplibs"
  4920. else
  4921. deplibs="$deplib $deplibs"
  4922. if test "$linkmode" = lib ; then
  4923. case "$new_inherited_linker_flags " in
  4924. *" $deplib "*) ;;
  4925. * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  4926. esac
  4927. fi
  4928. fi
  4929. continue
  4930. ;;
  4931. -L*)
  4932. case $linkmode in
  4933. lib)
  4934. deplibs="$deplib $deplibs"
  4935. test "$pass" = conv && continue
  4936. newdependency_libs="$deplib $newdependency_libs"
  4937. func_stripname '-L' '' "$deplib"
  4938. newlib_search_path="$newlib_search_path $func_stripname_result"
  4939. ;;
  4940. prog)
  4941. if test "$pass" = conv; then
  4942. deplibs="$deplib $deplibs"
  4943. continue
  4944. fi
  4945. if test "$pass" = scan; then
  4946. deplibs="$deplib $deplibs"
  4947. else
  4948. compile_deplibs="$deplib $compile_deplibs"
  4949. finalize_deplibs="$deplib $finalize_deplibs"
  4950. fi
  4951. func_stripname '-L' '' "$deplib"
  4952. newlib_search_path="$newlib_search_path $func_stripname_result"
  4953. ;;
  4954. *)
  4955. func_warning "\`-L' is ignored for archives/objects"
  4956. ;;
  4957. esac # linkmode
  4958. continue
  4959. ;; # -L
  4960. -R*)
  4961. if test "$pass" = link; then
  4962. func_stripname '-R' '' "$deplib"
  4963. dir=$func_stripname_result
  4964. # Make sure the xrpath contains only unique directories.
  4965. case "$xrpath " in
  4966. *" $dir "*) ;;
  4967. *) xrpath="$xrpath $dir" ;;
  4968. esac
  4969. fi
  4970. deplibs="$deplib $deplibs"
  4971. continue
  4972. ;;
  4973. *.la) lib="$deplib" ;;
  4974. *.$libext)
  4975. if test "$pass" = conv; then
  4976. deplibs="$deplib $deplibs"
  4977. continue
  4978. fi
  4979. case $linkmode in
  4980. lib)
  4981. # Linking convenience modules into shared libraries is allowed,
  4982. # but linking other static libraries is non-portable.
  4983. case " $dlpreconveniencelibs " in
  4984. *" $deplib "*) ;;
  4985. *)
  4986. valid_a_lib=no
  4987. case $deplibs_check_method in
  4988. match_pattern*)
  4989. set dummy $deplibs_check_method; shift
  4990. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  4991. if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
  4992. | $EGREP "$match_pattern_regex" > /dev/null; then
  4993. valid_a_lib=yes
  4994. fi
  4995. ;;
  4996. pass_all)
  4997. valid_a_lib=yes
  4998. ;;
  4999. esac
  5000. if test "$valid_a_lib" != yes; then
  5001. $ECHO
  5002. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  5003. $ECHO "*** I have the capability to make that library automatically link in when"
  5004. $ECHO "*** you link to this library. But I can only do this if you have a"
  5005. $ECHO "*** shared version of the library, which you do not appear to have"
  5006. $ECHO "*** because the file extensions .$libext of this argument makes me believe"
  5007. $ECHO "*** that it is just a static archive that I should not use here."
  5008. else
  5009. $ECHO
  5010. $ECHO "*** Warning: Linking the shared library $output against the"
  5011. $ECHO "*** static library $deplib is not portable!"
  5012. deplibs="$deplib $deplibs"
  5013. fi
  5014. ;;
  5015. esac
  5016. continue
  5017. ;;
  5018. prog)
  5019. if test "$pass" != link; then
  5020. deplibs="$deplib $deplibs"
  5021. else
  5022. compile_deplibs="$deplib $compile_deplibs"
  5023. finalize_deplibs="$deplib $finalize_deplibs"
  5024. fi
  5025. continue
  5026. ;;
  5027. esac # linkmode
  5028. ;; # *.$libext
  5029. *.lo | *.$objext)
  5030. if test "$pass" = conv; then
  5031. deplibs="$deplib $deplibs"
  5032. elif test "$linkmode" = prog; then
  5033. if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  5034. # If there is no dlopen support or we're linking statically,
  5035. # we need to preload.
  5036. newdlprefiles="$newdlprefiles $deplib"
  5037. compile_deplibs="$deplib $compile_deplibs"
  5038. finalize_deplibs="$deplib $finalize_deplibs"
  5039. else
  5040. newdlfiles="$newdlfiles $deplib"
  5041. fi
  5042. fi
  5043. continue
  5044. ;;
  5045. %DEPLIBS%)
  5046. alldeplibs=yes
  5047. continue
  5048. ;;
  5049. esac # case $deplib
  5050. if test "$found" = yes || test -f "$lib"; then :
  5051. else
  5052. func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
  5053. fi
  5054. # Check to see that this really is a libtool archive.
  5055. func_lalib_unsafe_p "$lib" \
  5056. || func_fatal_error "\`$lib' is not a valid libtool archive"
  5057. func_dirname "$lib" "" "."
  5058. ladir="$func_dirname_result"
  5059. dlname=
  5060. dlopen=
  5061. dlpreopen=
  5062. libdir=
  5063. library_names=
  5064. old_library=
  5065. inherited_linker_flags=
  5066. # If the library was installed with an old release of libtool,
  5067. # it will not redefine variables installed, or shouldnotlink
  5068. installed=yes
  5069. shouldnotlink=no
  5070. avoidtemprpath=
  5071. # Read the .la file
  5072. func_source "$lib"
  5073. # Convert "-framework foo" to "foo.ltframework"
  5074. if test -n "$inherited_linker_flags"; then
  5075. tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
  5076. for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  5077. case " $new_inherited_linker_flags " in
  5078. *" $tmp_inherited_linker_flag "*) ;;
  5079. *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
  5080. esac
  5081. done
  5082. fi
  5083. dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  5084. if test "$linkmode,$pass" = "lib,link" ||
  5085. test "$linkmode,$pass" = "prog,scan" ||
  5086. { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  5087. test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  5088. test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  5089. fi
  5090. if test "$pass" = conv; then
  5091. # Only check for convenience libraries
  5092. deplibs="$lib $deplibs"
  5093. if test -z "$libdir"; then
  5094. if test -z "$old_library"; then
  5095. func_fatal_error "cannot find name of link library for \`$lib'"
  5096. fi
  5097. # It is a libtool convenience library, so add in its objects.
  5098. convenience="$convenience $ladir/$objdir/$old_library"
  5099. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  5100. tmp_libs=
  5101. for deplib in $dependency_libs; do
  5102. deplibs="$deplib $deplibs"
  5103. if $opt_duplicate_deps ; then
  5104. case "$tmp_libs " in
  5105. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5106. esac
  5107. fi
  5108. tmp_libs="$tmp_libs $deplib"
  5109. done
  5110. elif test "$linkmode" != prog && test "$linkmode" != lib; then
  5111. func_fatal_error "\`$lib' is not a convenience library"
  5112. fi
  5113. continue
  5114. fi # $pass = conv
  5115. # Get the name of the library we link against.
  5116. linklib=
  5117. for l in $old_library $library_names; do
  5118. linklib="$l"
  5119. done
  5120. if test -z "$linklib"; then
  5121. func_fatal_error "cannot find name of link library for \`$lib'"
  5122. fi
  5123. # This library was specified with -dlopen.
  5124. if test "$pass" = dlopen; then
  5125. if test -z "$libdir"; then
  5126. func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
  5127. fi
  5128. if test -z "$dlname" ||
  5129. test "$dlopen_support" != yes ||
  5130. test "$build_libtool_libs" = no; then
  5131. # If there is no dlname, no dlopen support or we're linking
  5132. # statically, we need to preload. We also need to preload any
  5133. # dependent libraries so libltdl's deplib preloader doesn't
  5134. # bomb out in the load deplibs phase.
  5135. dlprefiles="$dlprefiles $lib $dependency_libs"
  5136. else
  5137. newdlfiles="$newdlfiles $lib"
  5138. fi
  5139. continue
  5140. fi # $pass = dlopen
  5141. # We need an absolute path.
  5142. case $ladir in
  5143. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  5144. *)
  5145. abs_ladir=`cd "$ladir" && pwd`
  5146. if test -z "$abs_ladir"; then
  5147. func_warning "cannot determine absolute directory name of \`$ladir'"
  5148. func_warning "passing it literally to the linker, although it might fail"
  5149. abs_ladir="$ladir"
  5150. fi
  5151. ;;
  5152. esac
  5153. func_basename "$lib"
  5154. laname="$func_basename_result"
  5155. # Find the relevant object directory and library name.
  5156. if test "X$installed" = Xyes; then
  5157. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  5158. func_warning "library \`$lib' was moved."
  5159. dir="$ladir"
  5160. absdir="$abs_ladir"
  5161. libdir="$abs_ladir"
  5162. else
  5163. dir="$libdir"
  5164. absdir="$libdir"
  5165. fi
  5166. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  5167. else
  5168. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  5169. dir="$ladir"
  5170. absdir="$abs_ladir"
  5171. # Remove this search path later
  5172. notinst_path="$notinst_path $abs_ladir"
  5173. else
  5174. dir="$ladir/$objdir"
  5175. absdir="$abs_ladir/$objdir"
  5176. # Remove this search path later
  5177. notinst_path="$notinst_path $abs_ladir"
  5178. fi
  5179. fi # $installed = yes
  5180. func_stripname 'lib' '.la' "$laname"
  5181. name=$func_stripname_result
  5182. # This library was specified with -dlpreopen.
  5183. if test "$pass" = dlpreopen; then
  5184. if test -z "$libdir" && test "$linkmode" = prog; then
  5185. func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
  5186. fi
  5187. # Prefer using a static library (so that no silly _DYNAMIC symbols
  5188. # are required to link).
  5189. if test -n "$old_library"; then
  5190. newdlprefiles="$newdlprefiles $dir/$old_library"
  5191. # Keep a list of preopened convenience libraries to check
  5192. # that they are being used correctly in the link pass.
  5193. test -z "$libdir" && \
  5194. dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
  5195. # Otherwise, use the dlname, so that lt_dlopen finds it.
  5196. elif test -n "$dlname"; then
  5197. newdlprefiles="$newdlprefiles $dir/$dlname"
  5198. else
  5199. newdlprefiles="$newdlprefiles $dir/$linklib"
  5200. fi
  5201. fi # $pass = dlpreopen
  5202. if test -z "$libdir"; then
  5203. # Link the convenience library
  5204. if test "$linkmode" = lib; then
  5205. deplibs="$dir/$old_library $deplibs"
  5206. elif test "$linkmode,$pass" = "prog,link"; then
  5207. compile_deplibs="$dir/$old_library $compile_deplibs"
  5208. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  5209. else
  5210. deplibs="$lib $deplibs" # used for prog,scan pass
  5211. fi
  5212. continue
  5213. fi
  5214. if test "$linkmode" = prog && test "$pass" != link; then
  5215. newlib_search_path="$newlib_search_path $ladir"
  5216. deplibs="$lib $deplibs"
  5217. linkalldeplibs=no
  5218. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  5219. test "$build_libtool_libs" = no; then
  5220. linkalldeplibs=yes
  5221. fi
  5222. tmp_libs=
  5223. for deplib in $dependency_libs; do
  5224. case $deplib in
  5225. -L*) func_stripname '-L' '' "$deplib"
  5226. newlib_search_path="$newlib_search_path $func_stripname_result"
  5227. ;;
  5228. esac
  5229. # Need to link against all dependency_libs?
  5230. if test "$linkalldeplibs" = yes; then
  5231. deplibs="$deplib $deplibs"
  5232. else
  5233. # Need to hardcode shared library paths
  5234. # or/and link against static libraries
  5235. newdependency_libs="$deplib $newdependency_libs"
  5236. fi
  5237. if $opt_duplicate_deps ; then
  5238. case "$tmp_libs " in
  5239. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5240. esac
  5241. fi
  5242. tmp_libs="$tmp_libs $deplib"
  5243. done # for deplib
  5244. continue
  5245. fi # $linkmode = prog...
  5246. if test "$linkmode,$pass" = "prog,link"; then
  5247. if test -n "$library_names" &&
  5248. { { test "$prefer_static_libs" = no ||
  5249. test "$prefer_static_libs,$installed" = "built,yes"; } ||
  5250. test -z "$old_library"; }; then
  5251. # We need to hardcode the library path
  5252. if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  5253. # Make sure the rpath contains only unique directories.
  5254. case "$temp_rpath:" in
  5255. *"$absdir:"*) ;;
  5256. *) temp_rpath="$temp_rpath$absdir:" ;;
  5257. esac
  5258. fi
  5259. # Hardcode the library path.
  5260. # Skip directories that are in the system default run-time
  5261. # search path.
  5262. case " $sys_lib_dlsearch_path " in
  5263. *" $absdir "*) ;;
  5264. *)
  5265. case "$compile_rpath " in
  5266. *" $absdir "*) ;;
  5267. *) compile_rpath="$compile_rpath $absdir"
  5268. esac
  5269. ;;
  5270. esac
  5271. case " $sys_lib_dlsearch_path " in
  5272. *" $libdir "*) ;;
  5273. *)
  5274. case "$finalize_rpath " in
  5275. *" $libdir "*) ;;
  5276. *) finalize_rpath="$finalize_rpath $libdir"
  5277. esac
  5278. ;;
  5279. esac
  5280. fi # $linkmode,$pass = prog,link...
  5281. if test "$alldeplibs" = yes &&
  5282. { test "$deplibs_check_method" = pass_all ||
  5283. { test "$build_libtool_libs" = yes &&
  5284. test -n "$library_names"; }; }; then
  5285. # We only need to search for static libraries
  5286. continue
  5287. fi
  5288. fi
  5289. link_static=no # Whether the deplib will be linked statically
  5290. use_static_libs=$prefer_static_libs
  5291. if test "$use_static_libs" = built && test "$installed" = yes; then
  5292. use_static_libs=no
  5293. fi
  5294. if test -n "$library_names" &&
  5295. { test "$use_static_libs" = no || test -z "$old_library"; }; then
  5296. case $host in
  5297. *cygwin* | *mingw* | *cegcc*)
  5298. # No point in relinking DLLs because paths are not encoded
  5299. notinst_deplibs="$notinst_deplibs $lib"
  5300. need_relink=no
  5301. ;;
  5302. *)
  5303. if test "$installed" = no; then
  5304. notinst_deplibs="$notinst_deplibs $lib"
  5305. need_relink=yes
  5306. fi
  5307. ;;
  5308. esac
  5309. # This is a shared library
  5310. # Warn about portability, can't link against -module's on some
  5311. # systems (darwin). Don't bleat about dlopened modules though!
  5312. dlopenmodule=""
  5313. for dlpremoduletest in $dlprefiles; do
  5314. if test "X$dlpremoduletest" = "X$lib"; then
  5315. dlopenmodule="$dlpremoduletest"
  5316. break
  5317. fi
  5318. done
  5319. if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
  5320. $ECHO
  5321. if test "$linkmode" = prog; then
  5322. $ECHO "*** Warning: Linking the executable $output against the loadable module"
  5323. else
  5324. $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  5325. fi
  5326. $ECHO "*** $linklib is not portable!"
  5327. fi
  5328. if test "$linkmode" = lib &&
  5329. test "$hardcode_into_libs" = yes; then
  5330. # Hardcode the library path.
  5331. # Skip directories that are in the system default run-time
  5332. # search path.
  5333. case " $sys_lib_dlsearch_path " in
  5334. *" $absdir "*) ;;
  5335. *)
  5336. case "$compile_rpath " in
  5337. *" $absdir "*) ;;
  5338. *) compile_rpath="$compile_rpath $absdir"
  5339. esac
  5340. ;;
  5341. esac
  5342. case " $sys_lib_dlsearch_path " in
  5343. *" $libdir "*) ;;
  5344. *)
  5345. case "$finalize_rpath " in
  5346. *" $libdir "*) ;;
  5347. *) finalize_rpath="$finalize_rpath $libdir"
  5348. esac
  5349. ;;
  5350. esac
  5351. fi
  5352. if test -n "$old_archive_from_expsyms_cmds"; then
  5353. # figure out the soname
  5354. set dummy $library_names
  5355. shift
  5356. realname="$1"
  5357. shift
  5358. libname=`eval "\\$ECHO \"$libname_spec\""`
  5359. # use dlname if we got it. it's perfectly good, no?
  5360. if test -n "$dlname"; then
  5361. soname="$dlname"
  5362. elif test -n "$soname_spec"; then
  5363. # bleh windows
  5364. case $host in
  5365. *cygwin* | mingw* | *cegcc*)
  5366. func_arith $current - $age
  5367. major=$func_arith_result
  5368. versuffix="-$major"
  5369. ;;
  5370. esac
  5371. eval soname=\"$soname_spec\"
  5372. else
  5373. soname="$realname"
  5374. fi
  5375. # Make a new name for the extract_expsyms_cmds to use
  5376. soroot="$soname"
  5377. func_basename "$soroot"
  5378. soname="$func_basename_result"
  5379. func_stripname 'lib' '.dll' "$soname"
  5380. newlib=libimp-$func_stripname_result.a
  5381. # If the library has no export list, then create one now
  5382. if test -f "$output_objdir/$soname-def"; then :
  5383. else
  5384. func_verbose "extracting exported symbol list from \`$soname'"
  5385. func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  5386. fi
  5387. # Create $newlib
  5388. if test -f "$output_objdir/$newlib"; then :; else
  5389. func_verbose "generating import library for \`$soname'"
  5390. func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  5391. fi
  5392. # make sure the library variables are pointing to the new library
  5393. dir=$output_objdir
  5394. linklib=$newlib
  5395. fi # test -n "$old_archive_from_expsyms_cmds"
  5396. if test "$linkmode" = prog || test "$mode" != relink; then
  5397. add_shlibpath=
  5398. add_dir=
  5399. add=
  5400. lib_linked=yes
  5401. case $hardcode_action in
  5402. immediate | unsupported)
  5403. if test "$hardcode_direct" = no; then
  5404. add="$dir/$linklib"
  5405. case $host in
  5406. *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  5407. *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  5408. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  5409. *-*-unixware7*) add_dir="-L$dir" ;;
  5410. *-*-darwin* )
  5411. # if the lib is a (non-dlopened) module then we can not
  5412. # link against it, someone is ignoring the earlier warnings
  5413. if /usr/bin/file -L $add 2> /dev/null |
  5414. $GREP ": [^:]* bundle" >/dev/null ; then
  5415. if test "X$dlopenmodule" != "X$lib"; then
  5416. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  5417. if test -z "$old_library" ; then
  5418. $ECHO
  5419. $ECHO "*** And there doesn't seem to be a static archive available"
  5420. $ECHO "*** The link will probably fail, sorry"
  5421. else
  5422. add="$dir/$old_library"
  5423. fi
  5424. elif test -n "$old_library"; then
  5425. add="$dir/$old_library"
  5426. fi
  5427. fi
  5428. esac
  5429. elif test "$hardcode_minus_L" = no; then
  5430. case $host in
  5431. *-*-sunos*) add_shlibpath="$dir" ;;
  5432. esac
  5433. add_dir="-L$dir"
  5434. add="-l$name"
  5435. elif test "$hardcode_shlibpath_var" = no; then
  5436. add_shlibpath="$dir"
  5437. add="-l$name"
  5438. else
  5439. lib_linked=no
  5440. fi
  5441. ;;
  5442. relink)
  5443. if test "$hardcode_direct" = yes &&
  5444. test "$hardcode_direct_absolute" = no; then
  5445. add="$dir/$linklib"
  5446. elif test "$hardcode_minus_L" = yes; then
  5447. add_dir="-L$dir"
  5448. # Try looking first in the location we're being installed to.
  5449. if test -n "$inst_prefix_dir"; then
  5450. case $libdir in
  5451. [\\/]*)
  5452. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  5453. ;;
  5454. esac
  5455. fi
  5456. add="-l$name"
  5457. elif test "$hardcode_shlibpath_var" = yes; then
  5458. add_shlibpath="$dir"
  5459. add="-l$name"
  5460. else
  5461. lib_linked=no
  5462. fi
  5463. ;;
  5464. *) lib_linked=no ;;
  5465. esac
  5466. if test "$lib_linked" != yes; then
  5467. func_fatal_configuration "unsupported hardcode properties"
  5468. fi
  5469. if test -n "$add_shlibpath"; then
  5470. case :$compile_shlibpath: in
  5471. *":$add_shlibpath:"*) ;;
  5472. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  5473. esac
  5474. fi
  5475. if test "$linkmode" = prog; then
  5476. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  5477. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  5478. else
  5479. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  5480. test -n "$add" && deplibs="$add $deplibs"
  5481. if test "$hardcode_direct" != yes &&
  5482. test "$hardcode_minus_L" != yes &&
  5483. test "$hardcode_shlibpath_var" = yes; then
  5484. case :$finalize_shlibpath: in
  5485. *":$libdir:"*) ;;
  5486. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  5487. esac
  5488. fi
  5489. fi
  5490. fi
  5491. if test "$linkmode" = prog || test "$mode" = relink; then
  5492. add_shlibpath=
  5493. add_dir=
  5494. add=
  5495. # Finalize command for both is simple: just hardcode it.
  5496. if test "$hardcode_direct" = yes &&
  5497. test "$hardcode_direct_absolute" = no; then
  5498. add="$libdir/$linklib"
  5499. elif test "$hardcode_minus_L" = yes; then
  5500. add_dir="-L$libdir"
  5501. add="-l$name"
  5502. elif test "$hardcode_shlibpath_var" = yes; then
  5503. case :$finalize_shlibpath: in
  5504. *":$libdir:"*) ;;
  5505. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  5506. esac
  5507. add="-l$name"
  5508. elif test "$hardcode_automatic" = yes; then
  5509. if test -n "$inst_prefix_dir" &&
  5510. test -f "$inst_prefix_dir$libdir/$linklib" ; then
  5511. add="$inst_prefix_dir$libdir/$linklib"
  5512. else
  5513. add="$libdir/$linklib"
  5514. fi
  5515. else
  5516. # We cannot seem to hardcode it, guess we'll fake it.
  5517. add_dir="-L$libdir"
  5518. # Try looking first in the location we're being installed to.
  5519. if test -n "$inst_prefix_dir"; then
  5520. case $libdir in
  5521. [\\/]*)
  5522. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  5523. ;;
  5524. esac
  5525. fi
  5526. add="-l$name"
  5527. fi
  5528. if test "$linkmode" = prog; then
  5529. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  5530. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  5531. else
  5532. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  5533. test -n "$add" && deplibs="$add $deplibs"
  5534. fi
  5535. fi
  5536. elif test "$linkmode" = prog; then
  5537. # Here we assume that one of hardcode_direct or hardcode_minus_L
  5538. # is not unsupported. This is valid on all known static and
  5539. # shared platforms.
  5540. if test "$hardcode_direct" != unsupported; then
  5541. test -n "$old_library" && linklib="$old_library"
  5542. compile_deplibs="$dir/$linklib $compile_deplibs"
  5543. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  5544. else
  5545. compile_deplibs="-l$name -L$dir $compile_deplibs"
  5546. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  5547. fi
  5548. elif test "$build_libtool_libs" = yes; then
  5549. # Not a shared library
  5550. if test "$deplibs_check_method" != pass_all; then
  5551. # We're trying link a shared library against a static one
  5552. # but the system doesn't support it.
  5553. # Just print a warning and add the library to dependency_libs so
  5554. # that the program can be linked against the static library.
  5555. $ECHO
  5556. $ECHO "*** Warning: This system can not link to static lib archive $lib."
  5557. $ECHO "*** I have the capability to make that library automatically link in when"
  5558. $ECHO "*** you link to this library. But I can only do this if you have a"
  5559. $ECHO "*** shared version of the library, which you do not appear to have."
  5560. if test "$module" = yes; then
  5561. $ECHO "*** But as you try to build a module library, libtool will still create "
  5562. $ECHO "*** a static module, that should work as long as the dlopening application"
  5563. $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
  5564. if test -z "$global_symbol_pipe"; then
  5565. $ECHO
  5566. $ECHO "*** However, this would only work if libtool was able to extract symbol"
  5567. $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  5568. $ECHO "*** not find such a program. So, this module is probably useless."
  5569. $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  5570. fi
  5571. if test "$build_old_libs" = no; then
  5572. build_libtool_libs=module
  5573. build_old_libs=yes
  5574. else
  5575. build_libtool_libs=no
  5576. fi
  5577. fi
  5578. else
  5579. deplibs="$dir/$old_library $deplibs"
  5580. link_static=yes
  5581. fi
  5582. fi # link shared/static library?
  5583. if test "$linkmode" = lib; then
  5584. if test -n "$dependency_libs" &&
  5585. { test "$hardcode_into_libs" != yes ||
  5586. test "$build_old_libs" = yes ||
  5587. test "$link_static" = yes; }; then
  5588. # Extract -R from dependency_libs
  5589. temp_deplibs=
  5590. for libdir in $dependency_libs; do
  5591. case $libdir in
  5592. -R*) func_stripname '-R' '' "$libdir"
  5593. temp_xrpath=$func_stripname_result
  5594. case " $xrpath " in
  5595. *" $temp_xrpath "*) ;;
  5596. *) xrpath="$xrpath $temp_xrpath";;
  5597. esac;;
  5598. *) temp_deplibs="$temp_deplibs $libdir";;
  5599. esac
  5600. done
  5601. dependency_libs="$temp_deplibs"
  5602. fi
  5603. newlib_search_path="$newlib_search_path $absdir"
  5604. # Link against this library
  5605. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  5606. # ... and its dependency_libs
  5607. tmp_libs=
  5608. for deplib in $dependency_libs; do
  5609. newdependency_libs="$deplib $newdependency_libs"
  5610. if $opt_duplicate_deps ; then
  5611. case "$tmp_libs " in
  5612. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5613. esac
  5614. fi
  5615. tmp_libs="$tmp_libs $deplib"
  5616. done
  5617. if test "$link_all_deplibs" != no; then
  5618. # Add the search paths of all dependency libraries
  5619. for deplib in $dependency_libs; do
  5620. path=
  5621. case $deplib in
  5622. -L*) path="$deplib" ;;
  5623. *.la)
  5624. func_dirname "$deplib" "" "."
  5625. dir="$func_dirname_result"
  5626. # We need an absolute path.
  5627. case $dir in
  5628. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  5629. *)
  5630. absdir=`cd "$dir" && pwd`
  5631. if test -z "$absdir"; then
  5632. func_warning "cannot determine absolute directory name of \`$dir'"
  5633. absdir="$dir"
  5634. fi
  5635. ;;
  5636. esac
  5637. if $GREP "^installed=no" $deplib > /dev/null; then
  5638. case $host in
  5639. *-*-darwin*)
  5640. depdepl=
  5641. eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  5642. if test -n "$deplibrary_names" ; then
  5643. for tmp in $deplibrary_names ; do
  5644. depdepl=$tmp
  5645. done
  5646. if test -f "$absdir/$objdir/$depdepl" ; then
  5647. depdepl="$absdir/$objdir/$depdepl"
  5648. darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  5649. if test -z "$darwin_install_name"; then
  5650. darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  5651. fi
  5652. compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
  5653. linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
  5654. path=
  5655. fi
  5656. fi
  5657. ;;
  5658. *)
  5659. path="-L$absdir/$objdir"
  5660. ;;
  5661. esac
  5662. else
  5663. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  5664. test -z "$libdir" && \
  5665. func_fatal_error "\`$deplib' is not a valid libtool archive"
  5666. test "$absdir" != "$libdir" && \
  5667. func_warning "\`$deplib' seems to be moved"
  5668. path="-L$absdir"
  5669. fi
  5670. ;;
  5671. esac
  5672. case " $deplibs " in
  5673. *" $path "*) ;;
  5674. *) deplibs="$path $deplibs" ;;
  5675. esac
  5676. done
  5677. fi # link_all_deplibs != no
  5678. fi # linkmode = lib
  5679. done # for deplib in $libs
  5680. if test "$pass" = link; then
  5681. if test "$linkmode" = "prog"; then
  5682. compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  5683. finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  5684. else
  5685. compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  5686. fi
  5687. fi
  5688. dependency_libs="$newdependency_libs"
  5689. if test "$pass" = dlpreopen; then
  5690. # Link the dlpreopened libraries before other libraries
  5691. for deplib in $save_deplibs; do
  5692. deplibs="$deplib $deplibs"
  5693. done
  5694. fi
  5695. if test "$pass" != dlopen; then
  5696. if test "$pass" != conv; then
  5697. # Make sure lib_search_path contains only unique directories.
  5698. lib_search_path=
  5699. for dir in $newlib_search_path; do
  5700. case "$lib_search_path " in
  5701. *" $dir "*) ;;
  5702. *) lib_search_path="$lib_search_path $dir" ;;
  5703. esac
  5704. done
  5705. newlib_search_path=
  5706. fi
  5707. if test "$linkmode,$pass" != "prog,link"; then
  5708. vars="deplibs"
  5709. else
  5710. vars="compile_deplibs finalize_deplibs"
  5711. fi
  5712. for var in $vars dependency_libs; do
  5713. # Add libraries to $var in reverse order
  5714. eval tmp_libs=\"\$$var\"
  5715. new_libs=
  5716. for deplib in $tmp_libs; do
  5717. # FIXME: Pedantically, this is the right thing to do, so
  5718. # that some nasty dependency loop isn't accidentally
  5719. # broken:
  5720. #new_libs="$deplib $new_libs"
  5721. # Pragmatically, this seems to cause very few problems in
  5722. # practice:
  5723. case $deplib in
  5724. -L*) new_libs="$deplib $new_libs" ;;
  5725. -R*) ;;
  5726. *)
  5727. # And here is the reason: when a library appears more
  5728. # than once as an explicit dependence of a library, or
  5729. # is implicitly linked in more than once by the
  5730. # compiler, it is considered special, and multiple
  5731. # occurrences thereof are not removed. Compare this
  5732. # with having the same library being listed as a
  5733. # dependency of multiple other libraries: in this case,
  5734. # we know (pedantically, we assume) the library does not
  5735. # need to be listed more than once, so we keep only the
  5736. # last copy. This is not always right, but it is rare
  5737. # enough that we require users that really mean to play
  5738. # such unportable linking tricks to link the library
  5739. # using -Wl,-lname, so that libtool does not consider it
  5740. # for duplicate removal.
  5741. case " $specialdeplibs " in
  5742. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  5743. *)
  5744. case " $new_libs " in
  5745. *" $deplib "*) ;;
  5746. *) new_libs="$deplib $new_libs" ;;
  5747. esac
  5748. ;;
  5749. esac
  5750. ;;
  5751. esac
  5752. done
  5753. tmp_libs=
  5754. for deplib in $new_libs; do
  5755. case $deplib in
  5756. -L*)
  5757. case " $tmp_libs " in
  5758. *" $deplib "*) ;;
  5759. *) tmp_libs="$tmp_libs $deplib" ;;
  5760. esac
  5761. ;;
  5762. *) tmp_libs="$tmp_libs $deplib" ;;
  5763. esac
  5764. done
  5765. eval $var=\"$tmp_libs\"
  5766. done # for var
  5767. fi
  5768. # Last step: remove runtime libs from dependency_libs
  5769. # (they stay in deplibs)
  5770. tmp_libs=
  5771. for i in $dependency_libs ; do
  5772. case " $predeps $postdeps $compiler_lib_search_path " in
  5773. *" $i "*)
  5774. i=""
  5775. ;;
  5776. esac
  5777. if test -n "$i" ; then
  5778. tmp_libs="$tmp_libs $i"
  5779. fi
  5780. done
  5781. dependency_libs=$tmp_libs
  5782. done # for pass
  5783. if test "$linkmode" = prog; then
  5784. dlfiles="$newdlfiles"
  5785. fi
  5786. if test "$linkmode" = prog || test "$linkmode" = lib; then
  5787. dlprefiles="$newdlprefiles"
  5788. fi
  5789. case $linkmode in
  5790. oldlib)
  5791. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  5792. func_warning "\`-dlopen' is ignored for archives"
  5793. fi
  5794. case " $deplibs" in
  5795. *\ -l* | *\ -L*)
  5796. func_warning "\`-l' and \`-L' are ignored for archives" ;;
  5797. esac
  5798. test -n "$rpath" && \
  5799. func_warning "\`-rpath' is ignored for archives"
  5800. test -n "$xrpath" && \
  5801. func_warning "\`-R' is ignored for archives"
  5802. test -n "$vinfo" && \
  5803. func_warning "\`-version-info/-version-number' is ignored for archives"
  5804. test -n "$release" && \
  5805. func_warning "\`-release' is ignored for archives"
  5806. test -n "$export_symbols$export_symbols_regex" && \
  5807. func_warning "\`-export-symbols' is ignored for archives"
  5808. # Now set the variables for building old libraries.
  5809. build_libtool_libs=no
  5810. oldlibs="$output"
  5811. objs="$objs$old_deplibs"
  5812. ;;
  5813. lib)
  5814. # Make sure we only generate libraries of the form `libNAME.la'.
  5815. case $outputname in
  5816. lib*)
  5817. func_stripname 'lib' '.la' "$outputname"
  5818. name=$func_stripname_result
  5819. eval shared_ext=\"$shrext_cmds\"
  5820. eval libname=\"$libname_spec\"
  5821. ;;
  5822. *)
  5823. test "$module" = no && \
  5824. func_fatal_help "libtool library \`$output' must begin with \`lib'"
  5825. if test "$need_lib_prefix" != no; then
  5826. # Add the "lib" prefix for modules if required
  5827. func_stripname '' '.la' "$outputname"
  5828. name=$func_stripname_result
  5829. eval shared_ext=\"$shrext_cmds\"
  5830. eval libname=\"$libname_spec\"
  5831. else
  5832. func_stripname '' '.la' "$outputname"
  5833. libname=$func_stripname_result
  5834. fi
  5835. ;;
  5836. esac
  5837. if test -n "$objs"; then
  5838. if test "$deplibs_check_method" != pass_all; then
  5839. func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
  5840. else
  5841. $ECHO
  5842. $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  5843. $ECHO "*** objects $objs is not portable!"
  5844. libobjs="$libobjs $objs"
  5845. fi
  5846. fi
  5847. test "$dlself" != no && \
  5848. func_warning "\`-dlopen self' is ignored for libtool libraries"
  5849. set dummy $rpath
  5850. shift
  5851. test "$#" -gt 1 && \
  5852. func_warning "ignoring multiple \`-rpath's for a libtool library"
  5853. install_libdir="$1"
  5854. oldlibs=
  5855. if test -z "$rpath"; then
  5856. if test "$build_libtool_libs" = yes; then
  5857. # Building a libtool convenience library.
  5858. # Some compilers have problems with a `.al' extension so
  5859. # convenience libraries should have the same extension an
  5860. # archive normally would.
  5861. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  5862. build_libtool_libs=convenience
  5863. build_old_libs=yes
  5864. fi
  5865. test -n "$vinfo" && \
  5866. func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
  5867. test -n "$release" && \
  5868. func_warning "\`-release' is ignored for convenience libraries"
  5869. else
  5870. # Parse the version information argument.
  5871. save_ifs="$IFS"; IFS=':'
  5872. set dummy $vinfo 0 0 0
  5873. shift
  5874. IFS="$save_ifs"
  5875. test -n "$7" && \
  5876. func_fatal_help "too many parameters to \`-version-info'"
  5877. # convert absolute version numbers to libtool ages
  5878. # this retains compatibility with .la files and attempts
  5879. # to make the code below a bit more comprehensible
  5880. case $vinfo_number in
  5881. yes)
  5882. number_major="$1"
  5883. number_minor="$2"
  5884. number_revision="$3"
  5885. #
  5886. # There are really only two kinds -- those that
  5887. # use the current revision as the major version
  5888. # and those that subtract age and use age as
  5889. # a minor version. But, then there is irix
  5890. # which has an extra 1 added just for fun
  5891. #
  5892. case $version_type in
  5893. darwin|linux|osf|windows|none)
  5894. func_arith $number_major + $number_minor
  5895. current=$func_arith_result
  5896. age="$number_minor"
  5897. revision="$number_revision"
  5898. ;;
  5899. freebsd-aout|freebsd-elf|sunos)
  5900. current="$number_major"
  5901. revision="$number_minor"
  5902. age="0"
  5903. ;;
  5904. irix|nonstopux)
  5905. func_arith $number_major + $number_minor
  5906. current=$func_arith_result
  5907. age="$number_minor"
  5908. revision="$number_minor"
  5909. lt_irix_increment=no
  5910. ;;
  5911. *)
  5912. func_fatal_configuration "$modename: unknown library version type \`$version_type'"
  5913. ;;
  5914. esac
  5915. ;;
  5916. no)
  5917. current="$1"
  5918. revision="$2"
  5919. age="$3"
  5920. ;;
  5921. esac
  5922. # Check that each of the things are valid numbers.
  5923. case $current in
  5924. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  5925. *)
  5926. func_error "CURRENT \`$current' must be a nonnegative integer"
  5927. func_fatal_error "\`$vinfo' is not valid version information"
  5928. ;;
  5929. esac
  5930. case $revision in
  5931. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  5932. *)
  5933. func_error "REVISION \`$revision' must be a nonnegative integer"
  5934. func_fatal_error "\`$vinfo' is not valid version information"
  5935. ;;
  5936. esac
  5937. case $age in
  5938. 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
  5939. *)
  5940. func_error "AGE \`$age' must be a nonnegative integer"
  5941. func_fatal_error "\`$vinfo' is not valid version information"
  5942. ;;
  5943. esac
  5944. if test "$age" -gt "$current"; then
  5945. func_error "AGE \`$age' is greater than the current interface number \`$current'"
  5946. func_fatal_error "\`$vinfo' is not valid version information"
  5947. fi
  5948. # Calculate the version variables.
  5949. major=
  5950. versuffix=
  5951. verstring=
  5952. case $version_type in
  5953. none) ;;
  5954. darwin)
  5955. # Like Linux, but with the current version available in
  5956. # verstring for coding it into the library header
  5957. func_arith $current - $age
  5958. major=.$func_arith_result
  5959. versuffix="$major.$age.$revision"
  5960. # Darwin ld doesn't like 0 for these options...
  5961. func_arith $current + 1
  5962. minor_current=$func_arith_result
  5963. xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  5964. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  5965. ;;
  5966. freebsd-aout)
  5967. major=".$current"
  5968. versuffix=".$current.$revision";
  5969. ;;
  5970. freebsd-elf)
  5971. major=".$current"
  5972. versuffix=".$current"
  5973. ;;
  5974. irix | nonstopux)
  5975. if test "X$lt_irix_increment" = "Xno"; then
  5976. func_arith $current - $age
  5977. else
  5978. func_arith $current - $age + 1
  5979. fi
  5980. major=$func_arith_result
  5981. case $version_type in
  5982. nonstopux) verstring_prefix=nonstopux ;;
  5983. *) verstring_prefix=sgi ;;
  5984. esac
  5985. verstring="$verstring_prefix$major.$revision"
  5986. # Add in all the interfaces that we are compatible with.
  5987. loop=$revision
  5988. while test "$loop" -ne 0; do
  5989. func_arith $revision - $loop
  5990. iface=$func_arith_result
  5991. func_arith $loop - 1
  5992. loop=$func_arith_result
  5993. verstring="$verstring_prefix$major.$iface:$verstring"
  5994. done
  5995. # Before this point, $major must not contain `.'.
  5996. major=.$major
  5997. versuffix="$major.$revision"
  5998. ;;
  5999. linux)
  6000. func_arith $current - $age
  6001. major=.$func_arith_result
  6002. versuffix="$major.$age.$revision"
  6003. ;;
  6004. osf)
  6005. func_arith $current - $age
  6006. major=.$func_arith_result
  6007. versuffix=".$current.$age.$revision"
  6008. verstring="$current.$age.$revision"
  6009. # Add in all the interfaces that we are compatible with.
  6010. loop=$age
  6011. while test "$loop" -ne 0; do
  6012. func_arith $current - $loop
  6013. iface=$func_arith_result
  6014. func_arith $loop - 1
  6015. loop=$func_arith_result
  6016. verstring="$verstring:${iface}.0"
  6017. done
  6018. # Make executables depend on our current version.
  6019. verstring="$verstring:${current}.0"
  6020. ;;
  6021. qnx)
  6022. major=".$current"
  6023. versuffix=".$current"
  6024. ;;
  6025. sunos)
  6026. major=".$current"
  6027. versuffix=".$current.$revision"
  6028. ;;
  6029. windows)
  6030. # Use '-' rather than '.', since we only want one
  6031. # extension on DOS 8.3 filesystems.
  6032. func_arith $current - $age
  6033. major=$func_arith_result
  6034. versuffix="-$major"
  6035. ;;
  6036. *)
  6037. func_fatal_configuration "unknown library version type \`$version_type'"
  6038. ;;
  6039. esac
  6040. # Clear the version info if we defaulted, and they specified a release.
  6041. if test -z "$vinfo" && test -n "$release"; then
  6042. major=
  6043. case $version_type in
  6044. darwin)
  6045. # we can't check for "0.0" in archive_cmds due to quoting
  6046. # problems, so we reset it completely
  6047. verstring=
  6048. ;;
  6049. *)
  6050. verstring="0.0"
  6051. ;;
  6052. esac
  6053. if test "$need_version" = no; then
  6054. versuffix=
  6055. else
  6056. versuffix=".0.0"
  6057. fi
  6058. fi
  6059. # Remove version info from name if versioning should be avoided
  6060. if test "$avoid_version" = yes && test "$need_version" = no; then
  6061. major=
  6062. versuffix=
  6063. verstring=""
  6064. fi
  6065. # Check to see if the archive will have undefined symbols.
  6066. if test "$allow_undefined" = yes; then
  6067. if test "$allow_undefined_flag" = unsupported; then
  6068. func_warning "undefined symbols not allowed in $host shared libraries"
  6069. build_libtool_libs=no
  6070. build_old_libs=yes
  6071. fi
  6072. else
  6073. # Don't allow undefined symbols.
  6074. allow_undefined_flag="$no_undefined_flag"
  6075. fi
  6076. fi
  6077. func_generate_dlsyms "$libname" "$libname" "yes"
  6078. libobjs="$libobjs $symfileobj"
  6079. test "X$libobjs" = "X " && libobjs=
  6080. if test "$mode" != relink; then
  6081. # Remove our outputs, but don't remove object files since they
  6082. # may have been created when compiling PIC objects.
  6083. removelist=
  6084. tempremovelist=`$ECHO "$output_objdir/*"`
  6085. for p in $tempremovelist; do
  6086. case $p in
  6087. *.$objext | *.gcno)
  6088. ;;
  6089. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  6090. if test "X$precious_files_regex" != "X"; then
  6091. if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  6092. then
  6093. continue
  6094. fi
  6095. fi
  6096. removelist="$removelist $p"
  6097. ;;
  6098. *) ;;
  6099. esac
  6100. done
  6101. test -n "$removelist" && \
  6102. func_show_eval "${RM}r \$removelist"
  6103. fi
  6104. # Now set the variables for building old libraries.
  6105. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  6106. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  6107. # Transform .lo files to .o files.
  6108. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  6109. fi
  6110. # Eliminate all temporary directories.
  6111. #for path in $notinst_path; do
  6112. # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
  6113. # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
  6114. # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
  6115. #done
  6116. if test -n "$xrpath"; then
  6117. # If the user specified any rpath flags, then add them.
  6118. temp_xrpath=
  6119. for libdir in $xrpath; do
  6120. temp_xrpath="$temp_xrpath -R$libdir"
  6121. case "$finalize_rpath " in
  6122. *" $libdir "*) ;;
  6123. *) finalize_rpath="$finalize_rpath $libdir" ;;
  6124. esac
  6125. done
  6126. if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  6127. dependency_libs="$temp_xrpath $dependency_libs"
  6128. fi
  6129. fi
  6130. # Make sure dlfiles contains only unique files that won't be dlpreopened
  6131. old_dlfiles="$dlfiles"
  6132. dlfiles=
  6133. for lib in $old_dlfiles; do
  6134. case " $dlprefiles $dlfiles " in
  6135. *" $lib "*) ;;
  6136. *) dlfiles="$dlfiles $lib" ;;
  6137. esac
  6138. done
  6139. # Make sure dlprefiles contains only unique files
  6140. old_dlprefiles="$dlprefiles"
  6141. dlprefiles=
  6142. for lib in $old_dlprefiles; do
  6143. case "$dlprefiles " in
  6144. *" $lib "*) ;;
  6145. *) dlprefiles="$dlprefiles $lib" ;;
  6146. esac
  6147. done
  6148. if test "$build_libtool_libs" = yes; then
  6149. if test -n "$rpath"; then
  6150. case $host in
  6151. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
  6152. # these systems don't actually have a c library (as such)!
  6153. ;;
  6154. *-*-rhapsody* | *-*-darwin1.[012])
  6155. # Rhapsody C library is in the System framework
  6156. deplibs="$deplibs System.ltframework"
  6157. ;;
  6158. *-*-netbsd*)
  6159. # Don't link with libc until the a.out ld.so is fixed.
  6160. ;;
  6161. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  6162. # Do not include libc due to us having libc/libc_r.
  6163. ;;
  6164. *-*-sco3.2v5* | *-*-sco5v6*)
  6165. # Causes problems with __ctype
  6166. ;;
  6167. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  6168. # Compiler inserts libc in the correct place for threads to work
  6169. ;;
  6170. *)
  6171. # Add libc to deplibs on all other systems if necessary.
  6172. if test "$build_libtool_need_lc" = "yes"; then
  6173. deplibs="$deplibs -lc"
  6174. fi
  6175. ;;
  6176. esac
  6177. fi
  6178. # Transform deplibs into only deplibs that can be linked in shared.
  6179. name_save=$name
  6180. libname_save=$libname
  6181. release_save=$release
  6182. versuffix_save=$versuffix
  6183. major_save=$major
  6184. # I'm not sure if I'm treating the release correctly. I think
  6185. # release should show up in the -l (ie -lgmp5) so we don't want to
  6186. # add it in twice. Is that correct?
  6187. release=""
  6188. versuffix=""
  6189. major=""
  6190. newdeplibs=
  6191. droppeddeps=no
  6192. case $deplibs_check_method in
  6193. pass_all)
  6194. # Don't check for shared/static. Everything works.
  6195. # This might be a little naive. We might want to check
  6196. # whether the library exists or not. But this is on
  6197. # osf3 & osf4 and I'm not really sure... Just
  6198. # implementing what was already the behavior.
  6199. newdeplibs=$deplibs
  6200. ;;
  6201. test_compile)
  6202. # This code stresses the "libraries are programs" paradigm to its
  6203. # limits. Maybe even breaks it. We compile a program, linking it
  6204. # against the deplibs as a proxy for the library. Then we can check
  6205. # whether they linked in statically or dynamically with ldd.
  6206. $opt_dry_run || $RM conftest.c
  6207. cat > conftest.c <<EOF
  6208. int main() { return 0; }
  6209. EOF
  6210. $opt_dry_run || $RM conftest
  6211. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  6212. ldd_output=`ldd conftest`
  6213. for i in $deplibs; do
  6214. case $i in
  6215. -l*)
  6216. func_stripname -l '' "$i"
  6217. name=$func_stripname_result
  6218. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6219. case " $predeps $postdeps " in
  6220. *" $i "*)
  6221. newdeplibs="$newdeplibs $i"
  6222. i=""
  6223. ;;
  6224. esac
  6225. fi
  6226. if test -n "$i" ; then
  6227. libname=`eval "\\$ECHO \"$libname_spec\""`
  6228. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  6229. set dummy $deplib_matches; shift
  6230. deplib_match=$1
  6231. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  6232. newdeplibs="$newdeplibs $i"
  6233. else
  6234. droppeddeps=yes
  6235. $ECHO
  6236. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  6237. $ECHO "*** I have the capability to make that library automatically link in when"
  6238. $ECHO "*** you link to this library. But I can only do this if you have a"
  6239. $ECHO "*** shared version of the library, which I believe you do not have"
  6240. $ECHO "*** because a test_compile did reveal that the linker did not use it for"
  6241. $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
  6242. fi
  6243. fi
  6244. ;;
  6245. *)
  6246. newdeplibs="$newdeplibs $i"
  6247. ;;
  6248. esac
  6249. done
  6250. else
  6251. # Error occurred in the first compile. Let's try to salvage
  6252. # the situation: Compile a separate program for each library.
  6253. for i in $deplibs; do
  6254. case $i in
  6255. -l*)
  6256. func_stripname -l '' "$i"
  6257. name=$func_stripname_result
  6258. $opt_dry_run || $RM conftest
  6259. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  6260. ldd_output=`ldd conftest`
  6261. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6262. case " $predeps $postdeps " in
  6263. *" $i "*)
  6264. newdeplibs="$newdeplibs $i"
  6265. i=""
  6266. ;;
  6267. esac
  6268. fi
  6269. if test -n "$i" ; then
  6270. libname=`eval "\\$ECHO \"$libname_spec\""`
  6271. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  6272. set dummy $deplib_matches; shift
  6273. deplib_match=$1
  6274. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  6275. newdeplibs="$newdeplibs $i"
  6276. else
  6277. droppeddeps=yes
  6278. $ECHO
  6279. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  6280. $ECHO "*** I have the capability to make that library automatically link in when"
  6281. $ECHO "*** you link to this library. But I can only do this if you have a"
  6282. $ECHO "*** shared version of the library, which you do not appear to have"
  6283. $ECHO "*** because a test_compile did reveal that the linker did not use this one"
  6284. $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
  6285. fi
  6286. fi
  6287. else
  6288. droppeddeps=yes
  6289. $ECHO
  6290. $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  6291. $ECHO "*** make it link in! You will probably need to install it or some"
  6292. $ECHO "*** library that it depends on before this library will be fully"
  6293. $ECHO "*** functional. Installing it before continuing would be even better."
  6294. fi
  6295. ;;
  6296. *)
  6297. newdeplibs="$newdeplibs $i"
  6298. ;;
  6299. esac
  6300. done
  6301. fi
  6302. ;;
  6303. file_magic*)
  6304. set dummy $deplibs_check_method; shift
  6305. file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  6306. for a_deplib in $deplibs; do
  6307. case $a_deplib in
  6308. -l*)
  6309. func_stripname -l '' "$a_deplib"
  6310. name=$func_stripname_result
  6311. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6312. case " $predeps $postdeps " in
  6313. *" $a_deplib "*)
  6314. newdeplibs="$newdeplibs $a_deplib"
  6315. a_deplib=""
  6316. ;;
  6317. esac
  6318. fi
  6319. if test -n "$a_deplib" ; then
  6320. libname=`eval "\\$ECHO \"$libname_spec\""`
  6321. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  6322. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  6323. for potent_lib in $potential_libs; do
  6324. # Follow soft links.
  6325. if ls -lLd "$potent_lib" 2>/dev/null |
  6326. $GREP " -> " >/dev/null; then
  6327. continue
  6328. fi
  6329. # The statement above tries to avoid entering an
  6330. # endless loop below, in case of cyclic links.
  6331. # We might still enter an endless loop, since a link
  6332. # loop can be closed while we follow links,
  6333. # but so what?
  6334. potlib="$potent_lib"
  6335. while test -h "$potlib" 2>/dev/null; do
  6336. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  6337. case $potliblink in
  6338. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  6339. *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  6340. esac
  6341. done
  6342. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  6343. $SED -e 10q |
  6344. $EGREP "$file_magic_regex" > /dev/null; then
  6345. newdeplibs="$newdeplibs $a_deplib"
  6346. a_deplib=""
  6347. break 2
  6348. fi
  6349. done
  6350. done
  6351. fi
  6352. if test -n "$a_deplib" ; then
  6353. droppeddeps=yes
  6354. $ECHO
  6355. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  6356. $ECHO "*** I have the capability to make that library automatically link in when"
  6357. $ECHO "*** you link to this library. But I can only do this if you have a"
  6358. $ECHO "*** shared version of the library, which you do not appear to have"
  6359. $ECHO "*** because I did check the linker path looking for a file starting"
  6360. if test -z "$potlib" ; then
  6361. $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  6362. else
  6363. $ECHO "*** with $libname and none of the candidates passed a file format test"
  6364. $ECHO "*** using a file magic. Last file checked: $potlib"
  6365. fi
  6366. fi
  6367. ;;
  6368. *)
  6369. # Add a -L argument.
  6370. newdeplibs="$newdeplibs $a_deplib"
  6371. ;;
  6372. esac
  6373. done # Gone through all deplibs.
  6374. ;;
  6375. match_pattern*)
  6376. set dummy $deplibs_check_method; shift
  6377. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  6378. for a_deplib in $deplibs; do
  6379. case $a_deplib in
  6380. -l*)
  6381. func_stripname -l '' "$a_deplib"
  6382. name=$func_stripname_result
  6383. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6384. case " $predeps $postdeps " in
  6385. *" $a_deplib "*)
  6386. newdeplibs="$newdeplibs $a_deplib"
  6387. a_deplib=""
  6388. ;;
  6389. esac
  6390. fi
  6391. if test -n "$a_deplib" ; then
  6392. libname=`eval "\\$ECHO \"$libname_spec\""`
  6393. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  6394. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  6395. for potent_lib in $potential_libs; do
  6396. potlib="$potent_lib" # see symlink-check above in file_magic test
  6397. if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
  6398. $EGREP "$match_pattern_regex" > /dev/null; then
  6399. newdeplibs="$newdeplibs $a_deplib"
  6400. a_deplib=""
  6401. break 2
  6402. fi
  6403. done
  6404. done
  6405. fi
  6406. if test -n "$a_deplib" ; then
  6407. droppeddeps=yes
  6408. $ECHO
  6409. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  6410. $ECHO "*** I have the capability to make that library automatically link in when"
  6411. $ECHO "*** you link to this library. But I can only do this if you have a"
  6412. $ECHO "*** shared version of the library, which you do not appear to have"
  6413. $ECHO "*** because I did check the linker path looking for a file starting"
  6414. if test -z "$potlib" ; then
  6415. $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  6416. else
  6417. $ECHO "*** with $libname and none of the candidates passed a file format test"
  6418. $ECHO "*** using a regex pattern. Last file checked: $potlib"
  6419. fi
  6420. fi
  6421. ;;
  6422. *)
  6423. # Add a -L argument.
  6424. newdeplibs="$newdeplibs $a_deplib"
  6425. ;;
  6426. esac
  6427. done # Gone through all deplibs.
  6428. ;;
  6429. none | unknown | *)
  6430. newdeplibs=""
  6431. tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
  6432. -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
  6433. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6434. for i in $predeps $postdeps ; do
  6435. # can't use Xsed below, because $i might contain '/'
  6436. tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
  6437. done
  6438. fi
  6439. if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
  6440. $GREP . >/dev/null; then
  6441. $ECHO
  6442. if test "X$deplibs_check_method" = "Xnone"; then
  6443. $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
  6444. else
  6445. $ECHO "*** Warning: inter-library dependencies are not known to be supported."
  6446. fi
  6447. $ECHO "*** All declared inter-library dependencies are being dropped."
  6448. droppeddeps=yes
  6449. fi
  6450. ;;
  6451. esac
  6452. versuffix=$versuffix_save
  6453. major=$major_save
  6454. release=$release_save
  6455. libname=$libname_save
  6456. name=$name_save
  6457. case $host in
  6458. *-*-rhapsody* | *-*-darwin1.[012])
  6459. # On Rhapsody replace the C library with the System framework
  6460. newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  6461. ;;
  6462. esac
  6463. if test "$droppeddeps" = yes; then
  6464. if test "$module" = yes; then
  6465. $ECHO
  6466. $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
  6467. $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  6468. $ECHO "*** a static module, that should work as long as the dlopening"
  6469. $ECHO "*** application is linked with the -dlopen flag."
  6470. if test -z "$global_symbol_pipe"; then
  6471. $ECHO
  6472. $ECHO "*** However, this would only work if libtool was able to extract symbol"
  6473. $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  6474. $ECHO "*** not find such a program. So, this module is probably useless."
  6475. $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  6476. fi
  6477. if test "$build_old_libs" = no; then
  6478. oldlibs="$output_objdir/$libname.$libext"
  6479. build_libtool_libs=module
  6480. build_old_libs=yes
  6481. else
  6482. build_libtool_libs=no
  6483. fi
  6484. else
  6485. $ECHO "*** The inter-library dependencies that have been dropped here will be"
  6486. $ECHO "*** automatically added whenever a program is linked with this library"
  6487. $ECHO "*** or is declared to -dlopen it."
  6488. if test "$allow_undefined" = no; then
  6489. $ECHO
  6490. $ECHO "*** Since this library must not contain undefined symbols,"
  6491. $ECHO "*** because either the platform does not support them or"
  6492. $ECHO "*** it was explicitly requested with -no-undefined,"
  6493. $ECHO "*** libtool will only create a static version of it."
  6494. if test "$build_old_libs" = no; then
  6495. oldlibs="$output_objdir/$libname.$libext"
  6496. build_libtool_libs=module
  6497. build_old_libs=yes
  6498. else
  6499. build_libtool_libs=no
  6500. fi
  6501. fi
  6502. fi
  6503. fi
  6504. # Done checking deplibs!
  6505. deplibs=$newdeplibs
  6506. fi
  6507. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  6508. case $host in
  6509. *-*-darwin*)
  6510. newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  6511. new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  6512. deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  6513. ;;
  6514. esac
  6515. # move library search paths that coincide with paths to not yet
  6516. # installed libraries to the beginning of the library search list
  6517. new_libs=
  6518. for path in $notinst_path; do
  6519. case " $new_libs " in
  6520. *" -L$path/$objdir "*) ;;
  6521. *)
  6522. case " $deplibs " in
  6523. *" -L$path/$objdir "*)
  6524. new_libs="$new_libs -L$path/$objdir" ;;
  6525. esac
  6526. ;;
  6527. esac
  6528. done
  6529. for deplib in $deplibs; do
  6530. case $deplib in
  6531. -L*)
  6532. case " $new_libs " in
  6533. *" $deplib "*) ;;
  6534. *) new_libs="$new_libs $deplib" ;;
  6535. esac
  6536. ;;
  6537. *) new_libs="$new_libs $deplib" ;;
  6538. esac
  6539. done
  6540. deplibs="$new_libs"
  6541. # All the library-specific variables (install_libdir is set above).
  6542. library_names=
  6543. old_library=
  6544. dlname=
  6545. # Test again, we may have decided not to build it any more
  6546. if test "$build_libtool_libs" = yes; then
  6547. if test "$hardcode_into_libs" = yes; then
  6548. # Hardcode the library paths
  6549. hardcode_libdirs=
  6550. dep_rpath=
  6551. rpath="$finalize_rpath"
  6552. test "$mode" != relink && rpath="$compile_rpath$rpath"
  6553. for libdir in $rpath; do
  6554. if test -n "$hardcode_libdir_flag_spec"; then
  6555. if test -n "$hardcode_libdir_separator"; then
  6556. if test -z "$hardcode_libdirs"; then
  6557. hardcode_libdirs="$libdir"
  6558. else
  6559. # Just accumulate the unique libdirs.
  6560. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  6561. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  6562. ;;
  6563. *)
  6564. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  6565. ;;
  6566. esac
  6567. fi
  6568. else
  6569. eval flag=\"$hardcode_libdir_flag_spec\"
  6570. dep_rpath="$dep_rpath $flag"
  6571. fi
  6572. elif test -n "$runpath_var"; then
  6573. case "$perm_rpath " in
  6574. *" $libdir "*) ;;
  6575. *) perm_rpath="$perm_rpath $libdir" ;;
  6576. esac
  6577. fi
  6578. done
  6579. # Substitute the hardcoded libdirs into the rpath.
  6580. if test -n "$hardcode_libdir_separator" &&
  6581. test -n "$hardcode_libdirs"; then
  6582. libdir="$hardcode_libdirs"
  6583. if test -n "$hardcode_libdir_flag_spec_ld"; then
  6584. eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  6585. else
  6586. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  6587. fi
  6588. fi
  6589. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  6590. # We should set the runpath_var.
  6591. rpath=
  6592. for dir in $perm_rpath; do
  6593. rpath="$rpath$dir:"
  6594. done
  6595. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  6596. fi
  6597. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  6598. fi
  6599. shlibpath="$finalize_shlibpath"
  6600. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  6601. if test -n "$shlibpath"; then
  6602. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  6603. fi
  6604. # Get the real and link names of the library.
  6605. eval shared_ext=\"$shrext_cmds\"
  6606. eval library_names=\"$library_names_spec\"
  6607. set dummy $library_names
  6608. shift
  6609. realname="$1"
  6610. shift
  6611. if test -n "$soname_spec"; then
  6612. eval soname=\"$soname_spec\"
  6613. else
  6614. soname="$realname"
  6615. fi
  6616. if test -z "$dlname"; then
  6617. dlname=$soname
  6618. fi
  6619. lib="$output_objdir/$realname"
  6620. linknames=
  6621. for link
  6622. do
  6623. linknames="$linknames $link"
  6624. done
  6625. # Use standard objects if they are pic
  6626. test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  6627. test "X$libobjs" = "X " && libobjs=
  6628. delfiles=
  6629. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  6630. $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  6631. export_symbols="$output_objdir/$libname.uexp"
  6632. delfiles="$delfiles $export_symbols"
  6633. fi
  6634. orig_export_symbols=
  6635. case $host_os in
  6636. cygwin* | mingw* | cegcc*)
  6637. if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  6638. # exporting using user supplied symfile
  6639. if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
  6640. # and it's NOT already a .def file. Must figure out
  6641. # which of the given symbols are data symbols and tag
  6642. # them as such. So, trigger use of export_symbols_cmds.
  6643. # export_symbols gets reassigned inside the "prepare
  6644. # the list of exported symbols" if statement, so the
  6645. # include_expsyms logic still works.
  6646. orig_export_symbols="$export_symbols"
  6647. export_symbols=
  6648. always_export_symbols=yes
  6649. fi
  6650. fi
  6651. ;;
  6652. esac
  6653. # Prepare the list of exported symbols
  6654. if test -z "$export_symbols"; then
  6655. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  6656. func_verbose "generating symbol list for \`$libname.la'"
  6657. export_symbols="$output_objdir/$libname.exp"
  6658. $opt_dry_run || $RM $export_symbols
  6659. cmds=$export_symbols_cmds
  6660. save_ifs="$IFS"; IFS='~'
  6661. for cmd in $cmds; do
  6662. IFS="$save_ifs"
  6663. eval cmd=\"$cmd\"
  6664. func_len " $cmd"
  6665. len=$func_len_result
  6666. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  6667. func_show_eval "$cmd" 'exit $?'
  6668. skipped_export=false
  6669. else
  6670. # The command line is too long to execute in one step.
  6671. func_verbose "using reloadable object file for export list..."
  6672. skipped_export=:
  6673. # Break out early, otherwise skipped_export may be
  6674. # set to false by a later but shorter cmd.
  6675. break
  6676. fi
  6677. done
  6678. IFS="$save_ifs"
  6679. if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
  6680. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  6681. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  6682. fi
  6683. fi
  6684. fi
  6685. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  6686. tmp_export_symbols="$export_symbols"
  6687. test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  6688. $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  6689. fi
  6690. if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
  6691. # The given exports_symbols file has to be filtered, so filter it.
  6692. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  6693. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  6694. # 's' commands which not all seds can handle. GNU sed should be fine
  6695. # though. Also, the filter scales superlinearly with the number of
  6696. # global variables. join(1) would be nice here, but unfortunately
  6697. # isn't a blessed tool.
  6698. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  6699. delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  6700. export_symbols=$output_objdir/$libname.def
  6701. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  6702. fi
  6703. tmp_deplibs=
  6704. for test_deplib in $deplibs; do
  6705. case " $convenience " in
  6706. *" $test_deplib "*) ;;
  6707. *)
  6708. tmp_deplibs="$tmp_deplibs $test_deplib"
  6709. ;;
  6710. esac
  6711. done
  6712. deplibs="$tmp_deplibs"
  6713. if test -n "$convenience"; then
  6714. if test -n "$whole_archive_flag_spec" &&
  6715. test "$compiler_needs_object" = yes &&
  6716. test -z "$libobjs"; then
  6717. # extract the archives, so we have objects to list.
  6718. # TODO: could optimize this to just extract one archive.
  6719. whole_archive_flag_spec=
  6720. fi
  6721. if test -n "$whole_archive_flag_spec"; then
  6722. save_libobjs=$libobjs
  6723. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  6724. test "X$libobjs" = "X " && libobjs=
  6725. else
  6726. gentop="$output_objdir/${outputname}x"
  6727. generated="$generated $gentop"
  6728. func_extract_archives $gentop $convenience
  6729. libobjs="$libobjs $func_extract_archives_result"
  6730. test "X$libobjs" = "X " && libobjs=
  6731. fi
  6732. fi
  6733. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  6734. eval flag=\"$thread_safe_flag_spec\"
  6735. linker_flags="$linker_flags $flag"
  6736. fi
  6737. # Make a backup of the uninstalled library when relinking
  6738. if test "$mode" = relink; then
  6739. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  6740. fi
  6741. # Do each of the archive commands.
  6742. if test "$module" = yes && test -n "$module_cmds" ; then
  6743. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  6744. eval test_cmds=\"$module_expsym_cmds\"
  6745. cmds=$module_expsym_cmds
  6746. else
  6747. eval test_cmds=\"$module_cmds\"
  6748. cmds=$module_cmds
  6749. fi
  6750. else
  6751. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  6752. eval test_cmds=\"$archive_expsym_cmds\"
  6753. cmds=$archive_expsym_cmds
  6754. else
  6755. eval test_cmds=\"$archive_cmds\"
  6756. cmds=$archive_cmds
  6757. fi
  6758. fi
  6759. if test "X$skipped_export" != "X:" &&
  6760. func_len " $test_cmds" &&
  6761. len=$func_len_result &&
  6762. test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  6763. :
  6764. else
  6765. # The command line is too long to link in one step, link piecewise
  6766. # or, if using GNU ld and skipped_export is not :, use a linker
  6767. # script.
  6768. # Save the value of $output and $libobjs because we want to
  6769. # use them later. If we have whole_archive_flag_spec, we
  6770. # want to use save_libobjs as it was before
  6771. # whole_archive_flag_spec was expanded, because we can't
  6772. # assume the linker understands whole_archive_flag_spec.
  6773. # This may have to be revisited, in case too many
  6774. # convenience libraries get linked in and end up exceeding
  6775. # the spec.
  6776. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  6777. save_libobjs=$libobjs
  6778. fi
  6779. save_output=$output
  6780. output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
  6781. # Clear the reloadable object creation command queue and
  6782. # initialize k to one.
  6783. test_cmds=
  6784. concat_cmds=
  6785. objlist=
  6786. last_robj=
  6787. k=1
  6788. if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
  6789. output=${output_objdir}/${output_la}.lnkscript
  6790. func_verbose "creating GNU ld script: $output"
  6791. $ECHO 'INPUT (' > $output
  6792. for obj in $save_libobjs
  6793. do
  6794. $ECHO "$obj" >> $output
  6795. done
  6796. $ECHO ')' >> $output
  6797. delfiles="$delfiles $output"
  6798. elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
  6799. output=${output_objdir}/${output_la}.lnk
  6800. func_verbose "creating linker input file list: $output"
  6801. : > $output
  6802. set x $save_libobjs
  6803. shift
  6804. firstobj=
  6805. if test "$compiler_needs_object" = yes; then
  6806. firstobj="$1 "
  6807. shift
  6808. fi
  6809. for obj
  6810. do
  6811. $ECHO "$obj" >> $output
  6812. done
  6813. delfiles="$delfiles $output"
  6814. output=$firstobj\"$file_list_spec$output\"
  6815. else
  6816. if test -n "$save_libobjs"; then
  6817. func_verbose "creating reloadable object files..."
  6818. output=$output_objdir/$output_la-${k}.$objext
  6819. eval test_cmds=\"$reload_cmds\"
  6820. func_len " $test_cmds"
  6821. len0=$func_len_result
  6822. len=$len0
  6823. # Loop over the list of objects to be linked.
  6824. for obj in $save_libobjs
  6825. do
  6826. func_len " $obj"
  6827. func_arith $len + $func_len_result
  6828. len=$func_arith_result
  6829. if test "X$objlist" = X ||
  6830. test "$len" -lt "$max_cmd_len"; then
  6831. func_append objlist " $obj"
  6832. else
  6833. # The command $test_cmds is almost too long, add a
  6834. # command to the queue.
  6835. if test "$k" -eq 1 ; then
  6836. # The first file doesn't have a previous command to add.
  6837. eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  6838. else
  6839. # All subsequent reloadable object files will link in
  6840. # the last one created.
  6841. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
  6842. fi
  6843. last_robj=$output_objdir/$output_la-${k}.$objext
  6844. func_arith $k + 1
  6845. k=$func_arith_result
  6846. output=$output_objdir/$output_la-${k}.$objext
  6847. objlist=$obj
  6848. func_len " $last_robj"
  6849. func_arith $len0 + $func_len_result
  6850. len=$func_arith_result
  6851. fi
  6852. done
  6853. # Handle the remaining objects by creating one last
  6854. # reloadable object file. All subsequent reloadable object
  6855. # files will link in the last one created.
  6856. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  6857. eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  6858. if test -n "$last_robj"; then
  6859. eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
  6860. fi
  6861. delfiles="$delfiles $output"
  6862. else
  6863. output=
  6864. fi
  6865. if ${skipped_export-false}; then
  6866. func_verbose "generating symbol list for \`$libname.la'"
  6867. export_symbols="$output_objdir/$libname.exp"
  6868. $opt_dry_run || $RM $export_symbols
  6869. libobjs=$output
  6870. # Append the command to create the export file.
  6871. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  6872. eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  6873. if test -n "$last_robj"; then
  6874. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  6875. fi
  6876. fi
  6877. test -n "$save_libobjs" &&
  6878. func_verbose "creating a temporary reloadable object file: $output"
  6879. # Loop through the commands generated above and execute them.
  6880. save_ifs="$IFS"; IFS='~'
  6881. for cmd in $concat_cmds; do
  6882. IFS="$save_ifs"
  6883. $opt_silent || {
  6884. func_quote_for_expand "$cmd"
  6885. eval "func_echo $func_quote_for_expand_result"
  6886. }
  6887. $opt_dry_run || eval "$cmd" || {
  6888. lt_exit=$?
  6889. # Restore the uninstalled library and exit
  6890. if test "$mode" = relink; then
  6891. ( cd "$output_objdir" && \
  6892. $RM "${realname}T" && \
  6893. $MV "${realname}U" "$realname" )
  6894. fi
  6895. exit $lt_exit
  6896. }
  6897. done
  6898. IFS="$save_ifs"
  6899. if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  6900. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  6901. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  6902. fi
  6903. fi
  6904. if ${skipped_export-false}; then
  6905. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  6906. tmp_export_symbols="$export_symbols"
  6907. test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  6908. $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  6909. fi
  6910. if test -n "$orig_export_symbols"; then
  6911. # The given exports_symbols file has to be filtered, so filter it.
  6912. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  6913. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  6914. # 's' commands which not all seds can handle. GNU sed should be fine
  6915. # though. Also, the filter scales superlinearly with the number of
  6916. # global variables. join(1) would be nice here, but unfortunately
  6917. # isn't a blessed tool.
  6918. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  6919. delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  6920. export_symbols=$output_objdir/$libname.def
  6921. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  6922. fi
  6923. fi
  6924. libobjs=$output
  6925. # Restore the value of output.
  6926. output=$save_output
  6927. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  6928. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  6929. test "X$libobjs" = "X " && libobjs=
  6930. fi
  6931. # Expand the library linking commands again to reset the
  6932. # value of $libobjs for piecewise linking.
  6933. # Do each of the archive commands.
  6934. if test "$module" = yes && test -n "$module_cmds" ; then
  6935. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  6936. cmds=$module_expsym_cmds
  6937. else
  6938. cmds=$module_cmds
  6939. fi
  6940. else
  6941. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  6942. cmds=$archive_expsym_cmds
  6943. else
  6944. cmds=$archive_cmds
  6945. fi
  6946. fi
  6947. fi
  6948. if test -n "$delfiles"; then
  6949. # Append the command to remove temporary files to $cmds.
  6950. eval cmds=\"\$cmds~\$RM $delfiles\"
  6951. fi
  6952. # Add any objects from preloaded convenience libraries
  6953. if test -n "$dlprefiles"; then
  6954. gentop="$output_objdir/${outputname}x"
  6955. generated="$generated $gentop"
  6956. func_extract_archives $gentop $dlprefiles
  6957. libobjs="$libobjs $func_extract_archives_result"
  6958. test "X$libobjs" = "X " && libobjs=
  6959. fi
  6960. save_ifs="$IFS"; IFS='~'
  6961. for cmd in $cmds; do
  6962. IFS="$save_ifs"
  6963. eval cmd=\"$cmd\"
  6964. $opt_silent || {
  6965. func_quote_for_expand "$cmd"
  6966. eval "func_echo $func_quote_for_expand_result"
  6967. }
  6968. $opt_dry_run || eval "$cmd" || {
  6969. lt_exit=$?
  6970. # Restore the uninstalled library and exit
  6971. if test "$mode" = relink; then
  6972. ( cd "$output_objdir" && \
  6973. $RM "${realname}T" && \
  6974. $MV "${realname}U" "$realname" )
  6975. fi
  6976. exit $lt_exit
  6977. }
  6978. done
  6979. IFS="$save_ifs"
  6980. # Restore the uninstalled library and exit
  6981. if test "$mode" = relink; then
  6982. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  6983. if test -n "$convenience"; then
  6984. if test -z "$whole_archive_flag_spec"; then
  6985. func_show_eval '${RM}r "$gentop"'
  6986. fi
  6987. fi
  6988. exit $EXIT_SUCCESS
  6989. fi
  6990. # Create links to the real library.
  6991. for linkname in $linknames; do
  6992. if test "$realname" != "$linkname"; then
  6993. func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  6994. fi
  6995. done
  6996. # If -module or -export-dynamic was specified, set the dlname.
  6997. if test "$module" = yes || test "$export_dynamic" = yes; then
  6998. # On all known operating systems, these are identical.
  6999. dlname="$soname"
  7000. fi
  7001. fi
  7002. ;;
  7003. obj)
  7004. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  7005. func_warning "\`-dlopen' is ignored for objects"
  7006. fi
  7007. case " $deplibs" in
  7008. *\ -l* | *\ -L*)
  7009. func_warning "\`-l' and \`-L' are ignored for objects" ;;
  7010. esac
  7011. test -n "$rpath" && \
  7012. func_warning "\`-rpath' is ignored for objects"
  7013. test -n "$xrpath" && \
  7014. func_warning "\`-R' is ignored for objects"
  7015. test -n "$vinfo" && \
  7016. func_warning "\`-version-info' is ignored for objects"
  7017. test -n "$release" && \
  7018. func_warning "\`-release' is ignored for objects"
  7019. case $output in
  7020. *.lo)
  7021. test -n "$objs$old_deplibs" && \
  7022. func_fatal_error "cannot build library object \`$output' from non-libtool objects"
  7023. libobj=$output
  7024. func_lo2o "$libobj"
  7025. obj=$func_lo2o_result
  7026. ;;
  7027. *)
  7028. libobj=
  7029. obj="$output"
  7030. ;;
  7031. esac
  7032. # Delete the old objects.
  7033. $opt_dry_run || $RM $obj $libobj
  7034. # Objects from convenience libraries. This assumes
  7035. # single-version convenience libraries. Whenever we create
  7036. # different ones for PIC/non-PIC, this we'll have to duplicate
  7037. # the extraction.
  7038. reload_conv_objs=
  7039. gentop=
  7040. # reload_cmds runs $LD directly, so let us get rid of
  7041. # -Wl from whole_archive_flag_spec and hope we can get by with
  7042. # turning comma into space..
  7043. wl=
  7044. if test -n "$convenience"; then
  7045. if test -n "$whole_archive_flag_spec"; then
  7046. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  7047. reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
  7048. else
  7049. gentop="$output_objdir/${obj}x"
  7050. generated="$generated $gentop"
  7051. func_extract_archives $gentop $convenience
  7052. reload_conv_objs="$reload_objs $func_extract_archives_result"
  7053. fi
  7054. fi
  7055. # Create the old-style object.
  7056. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  7057. output="$obj"
  7058. func_execute_cmds "$reload_cmds" 'exit $?'
  7059. # Exit if we aren't doing a library object file.
  7060. if test -z "$libobj"; then
  7061. if test -n "$gentop"; then
  7062. func_show_eval '${RM}r "$gentop"'
  7063. fi
  7064. exit $EXIT_SUCCESS
  7065. fi
  7066. if test "$build_libtool_libs" != yes; then
  7067. if test -n "$gentop"; then
  7068. func_show_eval '${RM}r "$gentop"'
  7069. fi
  7070. # Create an invalid libtool object if no PIC, so that we don't
  7071. # accidentally link it into a program.
  7072. # $show "echo timestamp > $libobj"
  7073. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  7074. exit $EXIT_SUCCESS
  7075. fi
  7076. if test -n "$pic_flag" || test "$pic_mode" != default; then
  7077. # Only do commands if we really have different PIC objects.
  7078. reload_objs="$libobjs $reload_conv_objs"
  7079. output="$libobj"
  7080. func_execute_cmds "$reload_cmds" 'exit $?'
  7081. fi
  7082. if test -n "$gentop"; then
  7083. func_show_eval '${RM}r "$gentop"'
  7084. fi
  7085. exit $EXIT_SUCCESS
  7086. ;;
  7087. prog)
  7088. case $host in
  7089. *cygwin*) func_stripname '' '.exe' "$output"
  7090. output=$func_stripname_result.exe;;
  7091. esac
  7092. test -n "$vinfo" && \
  7093. func_warning "\`-version-info' is ignored for programs"
  7094. test -n "$release" && \
  7095. func_warning "\`-release' is ignored for programs"
  7096. test "$preload" = yes \
  7097. && test "$dlopen_support" = unknown \
  7098. && test "$dlopen_self" = unknown \
  7099. && test "$dlopen_self_static" = unknown && \
  7100. func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
  7101. case $host in
  7102. *-*-rhapsody* | *-*-darwin1.[012])
  7103. # On Rhapsody replace the C library is the System framework
  7104. compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  7105. finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  7106. ;;
  7107. esac
  7108. case $host in
  7109. *-*-darwin*)
  7110. # Don't allow lazy linking, it breaks C++ global constructors
  7111. # But is supposedly fixed on 10.4 or later (yay!).
  7112. if test "$tagname" = CXX ; then
  7113. case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  7114. 10.[0123])
  7115. compile_command="$compile_command ${wl}-bind_at_load"
  7116. finalize_command="$finalize_command ${wl}-bind_at_load"
  7117. ;;
  7118. esac
  7119. fi
  7120. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  7121. compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7122. finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7123. ;;
  7124. esac
  7125. # move library search paths that coincide with paths to not yet
  7126. # installed libraries to the beginning of the library search list
  7127. new_libs=
  7128. for path in $notinst_path; do
  7129. case " $new_libs " in
  7130. *" -L$path/$objdir "*) ;;
  7131. *)
  7132. case " $compile_deplibs " in
  7133. *" -L$path/$objdir "*)
  7134. new_libs="$new_libs -L$path/$objdir" ;;
  7135. esac
  7136. ;;
  7137. esac
  7138. done
  7139. for deplib in $compile_deplibs; do
  7140. case $deplib in
  7141. -L*)
  7142. case " $new_libs " in
  7143. *" $deplib "*) ;;
  7144. *) new_libs="$new_libs $deplib" ;;
  7145. esac
  7146. ;;
  7147. *) new_libs="$new_libs $deplib" ;;
  7148. esac
  7149. done
  7150. compile_deplibs="$new_libs"
  7151. compile_command="$compile_command $compile_deplibs"
  7152. finalize_command="$finalize_command $finalize_deplibs"
  7153. if test -n "$rpath$xrpath"; then
  7154. # If the user specified any rpath flags, then add them.
  7155. for libdir in $rpath $xrpath; do
  7156. # This is the magic to use -rpath.
  7157. case "$finalize_rpath " in
  7158. *" $libdir "*) ;;
  7159. *) finalize_rpath="$finalize_rpath $libdir" ;;
  7160. esac
  7161. done
  7162. fi
  7163. # Now hardcode the library paths
  7164. rpath=
  7165. hardcode_libdirs=
  7166. for libdir in $compile_rpath $finalize_rpath; do
  7167. if test -n "$hardcode_libdir_flag_spec"; then
  7168. if test -n "$hardcode_libdir_separator"; then
  7169. if test -z "$hardcode_libdirs"; then
  7170. hardcode_libdirs="$libdir"
  7171. else
  7172. # Just accumulate the unique libdirs.
  7173. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  7174. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  7175. ;;
  7176. *)
  7177. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  7178. ;;
  7179. esac
  7180. fi
  7181. else
  7182. eval flag=\"$hardcode_libdir_flag_spec\"
  7183. rpath="$rpath $flag"
  7184. fi
  7185. elif test -n "$runpath_var"; then
  7186. case "$perm_rpath " in
  7187. *" $libdir "*) ;;
  7188. *) perm_rpath="$perm_rpath $libdir" ;;
  7189. esac
  7190. fi
  7191. case $host in
  7192. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  7193. testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
  7194. case :$dllsearchpath: in
  7195. *":$libdir:"*) ;;
  7196. ::) dllsearchpath=$libdir;;
  7197. *) dllsearchpath="$dllsearchpath:$libdir";;
  7198. esac
  7199. case :$dllsearchpath: in
  7200. *":$testbindir:"*) ;;
  7201. ::) dllsearchpath=$testbindir;;
  7202. *) dllsearchpath="$dllsearchpath:$testbindir";;
  7203. esac
  7204. ;;
  7205. esac
  7206. done
  7207. # Substitute the hardcoded libdirs into the rpath.
  7208. if test -n "$hardcode_libdir_separator" &&
  7209. test -n "$hardcode_libdirs"; then
  7210. libdir="$hardcode_libdirs"
  7211. eval rpath=\" $hardcode_libdir_flag_spec\"
  7212. fi
  7213. compile_rpath="$rpath"
  7214. rpath=
  7215. hardcode_libdirs=
  7216. for libdir in $finalize_rpath; do
  7217. if test -n "$hardcode_libdir_flag_spec"; then
  7218. if test -n "$hardcode_libdir_separator"; then
  7219. if test -z "$hardcode_libdirs"; then
  7220. hardcode_libdirs="$libdir"
  7221. else
  7222. # Just accumulate the unique libdirs.
  7223. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  7224. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  7225. ;;
  7226. *)
  7227. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  7228. ;;
  7229. esac
  7230. fi
  7231. else
  7232. eval flag=\"$hardcode_libdir_flag_spec\"
  7233. rpath="$rpath $flag"
  7234. fi
  7235. elif test -n "$runpath_var"; then
  7236. case "$finalize_perm_rpath " in
  7237. *" $libdir "*) ;;
  7238. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  7239. esac
  7240. fi
  7241. done
  7242. # Substitute the hardcoded libdirs into the rpath.
  7243. if test -n "$hardcode_libdir_separator" &&
  7244. test -n "$hardcode_libdirs"; then
  7245. libdir="$hardcode_libdirs"
  7246. eval rpath=\" $hardcode_libdir_flag_spec\"
  7247. fi
  7248. finalize_rpath="$rpath"
  7249. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  7250. # Transform all the library objects into standard objects.
  7251. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7252. finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7253. fi
  7254. func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
  7255. # template prelinking step
  7256. if test -n "$prelink_cmds"; then
  7257. func_execute_cmds "$prelink_cmds" 'exit $?'
  7258. fi
  7259. wrappers_required=yes
  7260. case $host in
  7261. *cygwin* | *mingw* )
  7262. if test "$build_libtool_libs" != yes; then
  7263. wrappers_required=no
  7264. fi
  7265. ;;
  7266. *cegcc)
  7267. # Disable wrappers for cegcc, we are cross compiling anyway.
  7268. wrappers_required=no
  7269. ;;
  7270. *)
  7271. if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  7272. wrappers_required=no
  7273. fi
  7274. ;;
  7275. esac
  7276. if test "$wrappers_required" = no; then
  7277. # Replace the output file specification.
  7278. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  7279. link_command="$compile_command$compile_rpath"
  7280. # We have no uninstalled library dependencies, so finalize right now.
  7281. exit_status=0
  7282. func_show_eval "$link_command" 'exit_status=$?'
  7283. # Delete the generated files.
  7284. if test -f "$output_objdir/${outputname}S.${objext}"; then
  7285. func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
  7286. fi
  7287. exit $exit_status
  7288. fi
  7289. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  7290. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  7291. fi
  7292. if test -n "$finalize_shlibpath"; then
  7293. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  7294. fi
  7295. compile_var=
  7296. finalize_var=
  7297. if test -n "$runpath_var"; then
  7298. if test -n "$perm_rpath"; then
  7299. # We should set the runpath_var.
  7300. rpath=
  7301. for dir in $perm_rpath; do
  7302. rpath="$rpath$dir:"
  7303. done
  7304. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  7305. fi
  7306. if test -n "$finalize_perm_rpath"; then
  7307. # We should set the runpath_var.
  7308. rpath=
  7309. for dir in $finalize_perm_rpath; do
  7310. rpath="$rpath$dir:"
  7311. done
  7312. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  7313. fi
  7314. fi
  7315. if test "$no_install" = yes; then
  7316. # We don't need to create a wrapper script.
  7317. link_command="$compile_var$compile_command$compile_rpath"
  7318. # Replace the output file specification.
  7319. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  7320. # Delete the old output file.
  7321. $opt_dry_run || $RM $output
  7322. # Link the executable and exit
  7323. func_show_eval "$link_command" 'exit $?'
  7324. exit $EXIT_SUCCESS
  7325. fi
  7326. if test "$hardcode_action" = relink; then
  7327. # Fast installation is not supported
  7328. link_command="$compile_var$compile_command$compile_rpath"
  7329. relink_command="$finalize_var$finalize_command$finalize_rpath"
  7330. func_warning "this platform does not like uninstalled shared libraries"
  7331. func_warning "\`$output' will be relinked during installation"
  7332. else
  7333. if test "$fast_install" != no; then
  7334. link_command="$finalize_var$compile_command$finalize_rpath"
  7335. if test "$fast_install" = yes; then
  7336. relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  7337. else
  7338. # fast_install is set to needless
  7339. relink_command=
  7340. fi
  7341. else
  7342. link_command="$compile_var$compile_command$compile_rpath"
  7343. relink_command="$finalize_var$finalize_command$finalize_rpath"
  7344. fi
  7345. fi
  7346. # Replace the output file specification.
  7347. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  7348. # Delete the old output files.
  7349. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  7350. func_show_eval "$link_command" 'exit $?'
  7351. # Now create the wrapper script.
  7352. func_verbose "creating $output"
  7353. # Quote the relink command for shipping.
  7354. if test -n "$relink_command"; then
  7355. # Preserve any variables that may affect compiler behavior
  7356. for var in $variables_saved_for_relink; do
  7357. if eval test -z \"\${$var+set}\"; then
  7358. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  7359. elif eval var_value=\$$var; test -z "$var_value"; then
  7360. relink_command="$var=; export $var; $relink_command"
  7361. else
  7362. func_quote_for_eval "$var_value"
  7363. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  7364. fi
  7365. done
  7366. relink_command="(cd `pwd`; $relink_command)"
  7367. relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  7368. fi
  7369. # Quote $ECHO for shipping.
  7370. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
  7371. case $progpath in
  7372. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  7373. *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  7374. esac
  7375. qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
  7376. else
  7377. qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
  7378. fi
  7379. # Only actually do things if not in dry run mode.
  7380. $opt_dry_run || {
  7381. # win32 will think the script is a binary if it has
  7382. # a .exe suffix, so we strip it off here.
  7383. case $output in
  7384. *.exe) func_stripname '' '.exe' "$output"
  7385. output=$func_stripname_result ;;
  7386. esac
  7387. # test for cygwin because mv fails w/o .exe extensions
  7388. case $host in
  7389. *cygwin*)
  7390. exeext=.exe
  7391. func_stripname '' '.exe' "$outputname"
  7392. outputname=$func_stripname_result ;;
  7393. *) exeext= ;;
  7394. esac
  7395. case $host in
  7396. *cygwin* | *mingw* )
  7397. func_dirname_and_basename "$output" "" "."
  7398. output_name=$func_basename_result
  7399. output_path=$func_dirname_result
  7400. cwrappersource="$output_path/$objdir/lt-$output_name.c"
  7401. cwrapper="$output_path/$output_name.exe"
  7402. $RM $cwrappersource $cwrapper
  7403. trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  7404. func_emit_cwrapperexe_src > $cwrappersource
  7405. # The wrapper executable is built using the $host compiler,
  7406. # because it contains $host paths and files. If cross-
  7407. # compiling, it, like the target executable, must be
  7408. # executed on the $host or under an emulation environment.
  7409. $opt_dry_run || {
  7410. $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  7411. $STRIP $cwrapper
  7412. }
  7413. # Now, create the wrapper script for func_source use:
  7414. func_ltwrapper_scriptname $cwrapper
  7415. $RM $func_ltwrapper_scriptname_result
  7416. trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  7417. $opt_dry_run || {
  7418. # note: this script will not be executed, so do not chmod.
  7419. if test "x$build" = "x$host" ; then
  7420. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  7421. else
  7422. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  7423. fi
  7424. }
  7425. ;;
  7426. * )
  7427. $RM $output
  7428. trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  7429. func_emit_wrapper no > $output
  7430. chmod +x $output
  7431. ;;
  7432. esac
  7433. }
  7434. exit $EXIT_SUCCESS
  7435. ;;
  7436. esac
  7437. # See if we need to build an old-fashioned archive.
  7438. for oldlib in $oldlibs; do
  7439. if test "$build_libtool_libs" = convenience; then
  7440. oldobjs="$libobjs_save $symfileobj"
  7441. addlibs="$convenience"
  7442. build_libtool_libs=no
  7443. else
  7444. if test "$build_libtool_libs" = module; then
  7445. oldobjs="$libobjs_save"
  7446. build_libtool_libs=no
  7447. else
  7448. oldobjs="$old_deplibs $non_pic_objects"
  7449. if test "$preload" = yes && test -f "$symfileobj"; then
  7450. oldobjs="$oldobjs $symfileobj"
  7451. fi
  7452. fi
  7453. addlibs="$old_convenience"
  7454. fi
  7455. if test -n "$addlibs"; then
  7456. gentop="$output_objdir/${outputname}x"
  7457. generated="$generated $gentop"
  7458. func_extract_archives $gentop $addlibs
  7459. oldobjs="$oldobjs $func_extract_archives_result"
  7460. fi
  7461. # Do each command in the archive commands.
  7462. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  7463. cmds=$old_archive_from_new_cmds
  7464. else
  7465. # Add any objects from preloaded convenience libraries
  7466. if test -n "$dlprefiles"; then
  7467. gentop="$output_objdir/${outputname}x"
  7468. generated="$generated $gentop"
  7469. func_extract_archives $gentop $dlprefiles
  7470. oldobjs="$oldobjs $func_extract_archives_result"
  7471. fi
  7472. # POSIX demands no paths to be encoded in archives. We have
  7473. # to avoid creating archives with duplicate basenames if we
  7474. # might have to extract them afterwards, e.g., when creating a
  7475. # static archive out of a convenience library, or when linking
  7476. # the entirety of a libtool archive into another (currently
  7477. # not supported by libtool).
  7478. if (for obj in $oldobjs
  7479. do
  7480. func_basename "$obj"
  7481. $ECHO "$func_basename_result"
  7482. done | sort | sort -uc >/dev/null 2>&1); then
  7483. :
  7484. else
  7485. $ECHO "copying selected object files to avoid basename conflicts..."
  7486. gentop="$output_objdir/${outputname}x"
  7487. generated="$generated $gentop"
  7488. func_mkdir_p "$gentop"
  7489. save_oldobjs=$oldobjs
  7490. oldobjs=
  7491. counter=1
  7492. for obj in $save_oldobjs
  7493. do
  7494. func_basename "$obj"
  7495. objbase="$func_basename_result"
  7496. case " $oldobjs " in
  7497. " ") oldobjs=$obj ;;
  7498. *[\ /]"$objbase "*)
  7499. while :; do
  7500. # Make sure we don't pick an alternate name that also
  7501. # overlaps.
  7502. newobj=lt$counter-$objbase
  7503. func_arith $counter + 1
  7504. counter=$func_arith_result
  7505. case " $oldobjs " in
  7506. *[\ /]"$newobj "*) ;;
  7507. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  7508. esac
  7509. done
  7510. func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  7511. oldobjs="$oldobjs $gentop/$newobj"
  7512. ;;
  7513. *) oldobjs="$oldobjs $obj" ;;
  7514. esac
  7515. done
  7516. fi
  7517. eval cmds=\"$old_archive_cmds\"
  7518. func_len " $cmds"
  7519. len=$func_len_result
  7520. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  7521. cmds=$old_archive_cmds
  7522. else
  7523. # the command line is too long to link in one step, link in parts
  7524. func_verbose "using piecewise archive linking..."
  7525. save_RANLIB=$RANLIB
  7526. RANLIB=:
  7527. objlist=
  7528. concat_cmds=
  7529. save_oldobjs=$oldobjs
  7530. oldobjs=
  7531. # Is there a better way of finding the last object in the list?
  7532. for obj in $save_oldobjs
  7533. do
  7534. last_oldobj=$obj
  7535. done
  7536. eval test_cmds=\"$old_archive_cmds\"
  7537. func_len " $test_cmds"
  7538. len0=$func_len_result
  7539. len=$len0
  7540. for obj in $save_oldobjs
  7541. do
  7542. func_len " $obj"
  7543. func_arith $len + $func_len_result
  7544. len=$func_arith_result
  7545. func_append objlist " $obj"
  7546. if test "$len" -lt "$max_cmd_len"; then
  7547. :
  7548. else
  7549. # the above command should be used before it gets too long
  7550. oldobjs=$objlist
  7551. if test "$obj" = "$last_oldobj" ; then
  7552. RANLIB=$save_RANLIB
  7553. fi
  7554. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  7555. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  7556. objlist=
  7557. len=$len0
  7558. fi
  7559. done
  7560. RANLIB=$save_RANLIB
  7561. oldobjs=$objlist
  7562. if test "X$oldobjs" = "X" ; then
  7563. eval cmds=\"\$concat_cmds\"
  7564. else
  7565. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  7566. fi
  7567. fi
  7568. fi
  7569. func_execute_cmds "$cmds" 'exit $?'
  7570. done
  7571. test -n "$generated" && \
  7572. func_show_eval "${RM}r$generated"
  7573. # Now create the libtool archive.
  7574. case $output in
  7575. *.la)
  7576. old_library=
  7577. test "$build_old_libs" = yes && old_library="$libname.$libext"
  7578. func_verbose "creating $output"
  7579. # Preserve any variables that may affect compiler behavior
  7580. for var in $variables_saved_for_relink; do
  7581. if eval test -z \"\${$var+set}\"; then
  7582. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  7583. elif eval var_value=\$$var; test -z "$var_value"; then
  7584. relink_command="$var=; export $var; $relink_command"
  7585. else
  7586. func_quote_for_eval "$var_value"
  7587. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  7588. fi
  7589. done
  7590. # Quote the link command for shipping.
  7591. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  7592. relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  7593. if test "$hardcode_automatic" = yes ; then
  7594. relink_command=
  7595. fi
  7596. # Only create the output if not a dry run.
  7597. $opt_dry_run || {
  7598. for installed in no yes; do
  7599. if test "$installed" = yes; then
  7600. if test -z "$install_libdir"; then
  7601. break
  7602. fi
  7603. output="$output_objdir/$outputname"i
  7604. # Replace all uninstalled libtool libraries with the installed ones
  7605. newdependency_libs=
  7606. for deplib in $dependency_libs; do
  7607. case $deplib in
  7608. *.la)
  7609. func_basename "$deplib"
  7610. name="$func_basename_result"
  7611. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  7612. test -z "$libdir" && \
  7613. func_fatal_error "\`$deplib' is not a valid libtool archive"
  7614. newdependency_libs="$newdependency_libs $libdir/$name"
  7615. ;;
  7616. *) newdependency_libs="$newdependency_libs $deplib" ;;
  7617. esac
  7618. done
  7619. dependency_libs="$newdependency_libs"
  7620. newdlfiles=
  7621. for lib in $dlfiles; do
  7622. case $lib in
  7623. *.la)
  7624. func_basename "$lib"
  7625. name="$func_basename_result"
  7626. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  7627. test -z "$libdir" && \
  7628. func_fatal_error "\`$lib' is not a valid libtool archive"
  7629. newdlfiles="$newdlfiles $libdir/$name"
  7630. ;;
  7631. *) newdlfiles="$newdlfiles $lib" ;;
  7632. esac
  7633. done
  7634. dlfiles="$newdlfiles"
  7635. newdlprefiles=
  7636. for lib in $dlprefiles; do
  7637. case $lib in
  7638. *.la)
  7639. # Only pass preopened files to the pseudo-archive (for
  7640. # eventual linking with the app. that links it) if we
  7641. # didn't already link the preopened objects directly into
  7642. # the library:
  7643. func_basename "$lib"
  7644. name="$func_basename_result"
  7645. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  7646. test -z "$libdir" && \
  7647. func_fatal_error "\`$lib' is not a valid libtool archive"
  7648. newdlprefiles="$newdlprefiles $libdir/$name"
  7649. ;;
  7650. esac
  7651. done
  7652. dlprefiles="$newdlprefiles"
  7653. else
  7654. newdlfiles=
  7655. for lib in $dlfiles; do
  7656. case $lib in
  7657. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  7658. *) abs=`pwd`"/$lib" ;;
  7659. esac
  7660. newdlfiles="$newdlfiles $abs"
  7661. done
  7662. dlfiles="$newdlfiles"
  7663. newdlprefiles=
  7664. for lib in $dlprefiles; do
  7665. case $lib in
  7666. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  7667. *) abs=`pwd`"/$lib" ;;
  7668. esac
  7669. newdlprefiles="$newdlprefiles $abs"
  7670. done
  7671. dlprefiles="$newdlprefiles"
  7672. fi
  7673. $RM $output
  7674. # place dlname in correct position for cygwin
  7675. tdlname=$dlname
  7676. case $host,$output,$installed,$module,$dlname in
  7677. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  7678. esac
  7679. $ECHO > $output "\
  7680. # $outputname - a libtool library file
  7681. # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  7682. #
  7683. # Please DO NOT delete this file!
  7684. # It is necessary for linking the library.
  7685. # The name that we can dlopen(3).
  7686. dlname='$tdlname'
  7687. # Names of this library.
  7688. library_names='$library_names'
  7689. # The name of the static archive.
  7690. old_library='$old_library'
  7691. # Linker flags that can not go in dependency_libs.
  7692. inherited_linker_flags='$new_inherited_linker_flags'
  7693. # Libraries that this one depends upon.
  7694. dependency_libs='$dependency_libs'
  7695. # Names of additional weak libraries provided by this library
  7696. weak_library_names='$weak_libs'
  7697. # Version information for $libname.
  7698. current=$current
  7699. age=$age
  7700. revision=$revision
  7701. # Is this an already installed library?
  7702. installed=$installed
  7703. # Should we warn about portability when linking against -modules?
  7704. shouldnotlink=$module
  7705. # Files to dlopen/dlpreopen
  7706. dlopen='$dlfiles'
  7707. dlpreopen='$dlprefiles'
  7708. # Directory that this library needs to be installed in:
  7709. libdir='$install_libdir'"
  7710. if test "$installed" = no && test "$need_relink" = yes; then
  7711. $ECHO >> $output "\
  7712. relink_command=\"$relink_command\""
  7713. fi
  7714. done
  7715. }
  7716. # Do a symbolic link so that the libtool archive can be found in
  7717. # LD_LIBRARY_PATH before the program is installed.
  7718. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  7719. ;;
  7720. esac
  7721. exit $EXIT_SUCCESS
  7722. }
  7723. { test "$mode" = link || test "$mode" = relink; } &&
  7724. func_mode_link ${1+"$@"}
  7725. # func_mode_uninstall arg...
  7726. func_mode_uninstall ()
  7727. {
  7728. $opt_debug
  7729. RM="$nonopt"
  7730. files=
  7731. rmforce=
  7732. exit_status=0
  7733. # This variable tells wrapper scripts just to set variables rather
  7734. # than running their programs.
  7735. libtool_install_magic="$magic"
  7736. for arg
  7737. do
  7738. case $arg in
  7739. -f) RM="$RM $arg"; rmforce=yes ;;
  7740. -*) RM="$RM $arg" ;;
  7741. *) files="$files $arg" ;;
  7742. esac
  7743. done
  7744. test -z "$RM" && \
  7745. func_fatal_help "you must specify an RM program"
  7746. rmdirs=
  7747. origobjdir="$objdir"
  7748. for file in $files; do
  7749. func_dirname "$file" "" "."
  7750. dir="$func_dirname_result"
  7751. if test "X$dir" = X.; then
  7752. objdir="$origobjdir"
  7753. else
  7754. objdir="$dir/$origobjdir"
  7755. fi
  7756. func_basename "$file"
  7757. name="$func_basename_result"
  7758. test "$mode" = uninstall && objdir="$dir"
  7759. # Remember objdir for removal later, being careful to avoid duplicates
  7760. if test "$mode" = clean; then
  7761. case " $rmdirs " in
  7762. *" $objdir "*) ;;
  7763. *) rmdirs="$rmdirs $objdir" ;;
  7764. esac
  7765. fi
  7766. # Don't error if the file doesn't exist and rm -f was used.
  7767. if { test -L "$file"; } >/dev/null 2>&1 ||
  7768. { test -h "$file"; } >/dev/null 2>&1 ||
  7769. test -f "$file"; then
  7770. :
  7771. elif test -d "$file"; then
  7772. exit_status=1
  7773. continue
  7774. elif test "$rmforce" = yes; then
  7775. continue
  7776. fi
  7777. rmfiles="$file"
  7778. case $name in
  7779. *.la)
  7780. # Possibly a libtool archive, so verify it.
  7781. if func_lalib_p "$file"; then
  7782. func_source $dir/$name
  7783. # Delete the libtool libraries and symlinks.
  7784. for n in $library_names; do
  7785. rmfiles="$rmfiles $objdir/$n"
  7786. done
  7787. test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  7788. case "$mode" in
  7789. clean)
  7790. case " $library_names " in
  7791. # " " in the beginning catches empty $dlname
  7792. *" $dlname "*) ;;
  7793. *) rmfiles="$rmfiles $objdir/$dlname" ;;
  7794. esac
  7795. test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  7796. ;;
  7797. uninstall)
  7798. if test -n "$library_names"; then
  7799. # Do each command in the postuninstall commands.
  7800. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  7801. fi
  7802. if test -n "$old_library"; then
  7803. # Do each command in the old_postuninstall commands.
  7804. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  7805. fi
  7806. # FIXME: should reinstall the best remaining shared library.
  7807. ;;
  7808. esac
  7809. fi
  7810. ;;
  7811. *.lo)
  7812. # Possibly a libtool object, so verify it.
  7813. if func_lalib_p "$file"; then
  7814. # Read the .lo file
  7815. func_source $dir/$name
  7816. # Add PIC object to the list of files to remove.
  7817. if test -n "$pic_object" &&
  7818. test "$pic_object" != none; then
  7819. rmfiles="$rmfiles $dir/$pic_object"
  7820. fi
  7821. # Add non-PIC object to the list of files to remove.
  7822. if test -n "$non_pic_object" &&
  7823. test "$non_pic_object" != none; then
  7824. rmfiles="$rmfiles $dir/$non_pic_object"
  7825. fi
  7826. fi
  7827. ;;
  7828. *)
  7829. if test "$mode" = clean ; then
  7830. noexename=$name
  7831. case $file in
  7832. *.exe)
  7833. func_stripname '' '.exe' "$file"
  7834. file=$func_stripname_result
  7835. func_stripname '' '.exe' "$name"
  7836. noexename=$func_stripname_result
  7837. # $file with .exe has already been added to rmfiles,
  7838. # add $file without .exe
  7839. rmfiles="$rmfiles $file"
  7840. ;;
  7841. esac
  7842. # Do a test to see if this is a libtool program.
  7843. if func_ltwrapper_p "$file"; then
  7844. if func_ltwrapper_executable_p "$file"; then
  7845. func_ltwrapper_scriptname "$file"
  7846. relink_command=
  7847. func_source $func_ltwrapper_scriptname_result
  7848. rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
  7849. else
  7850. relink_command=
  7851. func_source $dir/$noexename
  7852. fi
  7853. # note $name still contains .exe if it was in $file originally
  7854. # as does the version of $file that was added into $rmfiles
  7855. rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  7856. if test "$fast_install" = yes && test -n "$relink_command"; then
  7857. rmfiles="$rmfiles $objdir/lt-$name"
  7858. fi
  7859. if test "X$noexename" != "X$name" ; then
  7860. rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  7861. fi
  7862. fi
  7863. fi
  7864. ;;
  7865. esac
  7866. func_show_eval "$RM $rmfiles" 'exit_status=1'
  7867. done
  7868. objdir="$origobjdir"
  7869. # Try to remove the ${objdir}s in the directories where we deleted files
  7870. for dir in $rmdirs; do
  7871. if test -d "$dir"; then
  7872. func_show_eval "rmdir $dir >/dev/null 2>&1"
  7873. fi
  7874. done
  7875. exit $exit_status
  7876. }
  7877. { test "$mode" = uninstall || test "$mode" = clean; } &&
  7878. func_mode_uninstall ${1+"$@"}
  7879. test -z "$mode" && {
  7880. help="$generic_help"
  7881. func_fatal_help "you must specify a MODE"
  7882. }
  7883. test -z "$exec_cmd" && \
  7884. func_fatal_help "invalid operation mode \`$mode'"
  7885. if test -n "$exec_cmd"; then
  7886. eval exec "$exec_cmd"
  7887. exit $EXIT_FAILURE
  7888. fi
  7889. exit $exit_status
  7890. # The TAGs below are defined such that we never get into a situation
  7891. # in which we disable both kinds of libraries. Given conflicting
  7892. # choices, we go for a static library, that is the most portable,
  7893. # since we can't tell whether shared libraries were disabled because
  7894. # the user asked for that or because the platform doesn't support
  7895. # them. This is particularly important on AIX, because we don't
  7896. # support having both static and shared libraries enabled at the same
  7897. # time on that platform, so we default to a shared-only configuration.
  7898. # If a disable-shared tag is given, we'll fallback to a static-only
  7899. # configuration. But we'll never go from static-only to shared-only.
  7900. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  7901. build_libtool_libs=no
  7902. build_old_libs=yes
  7903. # ### END LIBTOOL TAG CONFIG: disable-shared
  7904. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  7905. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  7906. # ### END LIBTOOL TAG CONFIG: disable-static
  7907. # Local Variables:
  7908. # mode:shell-script
  7909. # sh-indentation:2
  7910. # End:
  7911. # vi:sw=2
  7912. # ### BEGIN LIBTOOL TAG CONFIG: CXX
  7913. # The linker used to build libraries.
  7914. LD="/usr/bin/ld -m elf_x86_64"
  7915. # Commands used to build an old-style archive.
  7916. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib"
  7917. # A language specific compiler.
  7918. CC="g++"
  7919. # Is the compiler the GNU compiler?
  7920. with_gcc=yes
  7921. # Compiler flag to turn off builtin functions.
  7922. no_builtin_flag=" -fno-builtin"
  7923. # How to pass a linker flag through the compiler.
  7924. wl="-Wl,"
  7925. # Additional compiler flags for building library objects.
  7926. pic_flag=" -fPIC -DPIC"
  7927. # Compiler flag to prevent dynamic linking.
  7928. link_static_flag="-static"
  7929. # Does compiler simultaneously support -c and -o options?
  7930. compiler_c_o="yes"
  7931. # Whether or not to add -lc for building shared libraries.
  7932. build_libtool_need_lc=no
  7933. # Whether or not to disallow shared libs when runtime libs are static.
  7934. allow_libtool_libs_with_static_runtimes=no
  7935. # Compiler flag to allow reflexive dlopens.
  7936. export_dynamic_flag_spec="\${wl}--export-dynamic"
  7937. # Compiler flag to generate shared objects directly from archives.
  7938. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
  7939. # Whether the compiler copes with passing no objects directly.
  7940. compiler_needs_object="no"
  7941. # Create an old-style archive from a shared archive.
  7942. old_archive_from_new_cmds=""
  7943. # Create a temporary old-style archive to link instead of a shared archive.
  7944. old_archive_from_expsyms_cmds=""
  7945. # Commands used to build a shared archive.
  7946. archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
  7947. archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
  7948. # Commands used to build a loadable module if different from building
  7949. # a shared archive.
  7950. module_cmds=""
  7951. module_expsym_cmds=""
  7952. # Whether we are building with GNU ld or not.
  7953. with_gnu_ld="yes"
  7954. # Flag that allows shared libraries with undefined symbols to be built.
  7955. allow_undefined_flag=""
  7956. # Flag that enforces no undefined symbols.
  7957. no_undefined_flag=""
  7958. # Flag to hardcode $libdir into a binary during linking.
  7959. # This must work even if $libdir does not exist
  7960. hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
  7961. # If ld is used when linking, flag to hardcode $libdir into a binary
  7962. # during linking. This must work even if $libdir does not exist.
  7963. hardcode_libdir_flag_spec_ld=""
  7964. # Whether we need a single "-rpath" flag with a separated argument.
  7965. hardcode_libdir_separator=""
  7966. # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  7967. # DIR into the resulting binary.
  7968. hardcode_direct=no
  7969. # Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
  7970. # DIR into the resulting binary and the resulting library dependency is
  7971. # "absolute",i.e impossible to change by setting ${shlibpath_var} if the
  7972. # library is relocated.
  7973. hardcode_direct_absolute=no
  7974. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  7975. # into the resulting binary.
  7976. hardcode_minus_L=no
  7977. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  7978. # into the resulting binary.
  7979. hardcode_shlibpath_var=unsupported
  7980. # Set to "yes" if building a shared library automatically hardcodes DIR
  7981. # into the library and all subsequent libraries and executables linked
  7982. # against it.
  7983. hardcode_automatic=no
  7984. # Set to yes if linker adds runtime paths of dependent libraries
  7985. # to runtime path list.
  7986. inherit_rpath=no
  7987. # Whether libtool must link a program against all its dependency libraries.
  7988. link_all_deplibs=no
  7989. # Fix the shell variable $srcfile for the compiler.
  7990. fix_srcfile_path=""
  7991. # Set to "yes" if exported symbols are required.
  7992. always_export_symbols=no
  7993. # The commands to list exported symbols.
  7994. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  7995. # Symbols that should not be listed in the preloaded symbols.
  7996. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  7997. # Symbols that must always be exported.
  7998. include_expsyms=""
  7999. # Commands necessary for linking programs (against libraries) with templates.
  8000. prelink_cmds=""
  8001. # Specify filename containing input files.
  8002. file_list_spec=""
  8003. # How to hardcode a shared library path into an executable.
  8004. hardcode_action=immediate
  8005. # The directories searched by this compiler when creating a shared library.
  8006. compiler_lib_search_dirs="/usr/lib/gcc/x86_64-linux-gnu/4.4.3 /usr/lib/gcc/x86_64-linux-gnu/4.4.3 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib /lib/../lib /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.."
  8007. # Dependencies to place before and after the objects being linked to
  8008. # create a shared library.
  8009. predep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbeginS.o"
  8010. postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crtn.o"
  8011. predeps=""
  8012. postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
  8013. # The library search path used internally by the compiler when linking
  8014. # a shared library.
  8015. compiler_lib_search_path="-L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.."
  8016. # ### END LIBTOOL TAG CONFIG: CXX