libtool 289 KB

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