libtool 288 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083
  1. #! /bin/bash
  2. # libtool - Provide generalized library-building support services.
  3. # Generated automatically by config.status (lighttpd) 1.4.39
  4. # Libtool was configured on host am335x_ide:
  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. # A sed program that does not truncate output.
  38. SED="/bin/sed"
  39. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  40. Xsed="$SED -e 1s/^X//"
  41. # A grep program that handles long lines.
  42. GREP="/bin/grep"
  43. # An ERE matcher.
  44. EGREP="/bin/grep -E"
  45. # A literal string matcher.
  46. FGREP="/bin/grep -F"
  47. # Shell to use when invoking shell scripts.
  48. SHELL="/bin/bash"
  49. # An echo program that protects backslashes.
  50. ECHO="printf %s\\n"
  51. # Whether or not to build static libraries.
  52. build_old_libs=no
  53. # Whether or not to build shared libraries.
  54. build_libtool_libs=yes
  55. # Which release of libtool.m4 was used?
  56. macro_version=2.4.2
  57. macro_revision=1.3337
  58. # What type of objects to build.
  59. pic_mode=default
  60. # Whether or not to optimize for fast installation.
  61. fast_install=yes
  62. # The PATH separator for the build system.
  63. PATH_SEPARATOR=":"
  64. # The host system.
  65. host_alias=arm-linux-gnueabihf
  66. host=arm-unknown-linux-gnueabihf
  67. host_os=linux-gnueabihf
  68. # The build system.
  69. build_alias=
  70. build=x86_64-pc-linux-gnu
  71. build_os=linux-gnu
  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="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="strip"
  114. # Commands used to install an old-style archive.
  115. RANLIB="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="-I/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/GPL/pcre-8.43/release/include -DHAVE_PCRE_H=1 -DHAVE_LIBPCRE=1 -Wall -W -Wshadow -pedantic -std=gnu99"
  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="/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 "
  199. # Whether dlopen is supported.
  200. dlopen_support=yes
  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="strip --strip-debug"
  207. striplib="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/bin/arm-linux-gnueabihf-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=no
  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 Debian-2.4.2-1.11
  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 Debian-2.4.2-1.11"
  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)
  5729. libs="$deplibs %DEPLIBS%"
  5730. test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
  5731. ;;
  5732. esac
  5733. fi
  5734. if test "$linkmode,$pass" = "lib,dlpreopen"; then
  5735. # Collect and forward deplibs of preopened libtool libs
  5736. for lib in $dlprefiles; do
  5737. # Ignore non-libtool-libs
  5738. dependency_libs=
  5739. func_resolve_sysroot "$lib"
  5740. case $lib in
  5741. *.la) func_source "$func_resolve_sysroot_result" ;;
  5742. esac
  5743. # Collect preopened libtool deplibs, except any this library
  5744. # has declared as weak libs
  5745. for deplib in $dependency_libs; do
  5746. func_basename "$deplib"
  5747. deplib_base=$func_basename_result
  5748. case " $weak_libs " in
  5749. *" $deplib_base "*) ;;
  5750. *) deplibs+=" $deplib" ;;
  5751. esac
  5752. done
  5753. done
  5754. libs="$dlprefiles"
  5755. fi
  5756. if test "$pass" = dlopen; then
  5757. # Collect dlpreopened libraries
  5758. save_deplibs="$deplibs"
  5759. deplibs=
  5760. fi
  5761. for deplib in $libs; do
  5762. lib=
  5763. found=no
  5764. case $deplib in
  5765. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  5766. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  5767. if test "$linkmode,$pass" = "prog,link"; then
  5768. compile_deplibs="$deplib $compile_deplibs"
  5769. finalize_deplibs="$deplib $finalize_deplibs"
  5770. else
  5771. compiler_flags+=" $deplib"
  5772. if test "$linkmode" = lib ; then
  5773. case "$new_inherited_linker_flags " in
  5774. *" $deplib "*) ;;
  5775. * ) new_inherited_linker_flags+=" $deplib" ;;
  5776. esac
  5777. fi
  5778. fi
  5779. continue
  5780. ;;
  5781. -l*)
  5782. if test "$linkmode" != lib && test "$linkmode" != prog; then
  5783. func_warning "\`-l' is ignored for archives/objects"
  5784. continue
  5785. fi
  5786. func_stripname '-l' '' "$deplib"
  5787. name=$func_stripname_result
  5788. if test "$linkmode" = lib; then
  5789. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  5790. else
  5791. searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  5792. fi
  5793. for searchdir in $searchdirs; do
  5794. for search_ext in .la $std_shrext .so .a; do
  5795. # Search the libtool library
  5796. lib="$searchdir/lib${name}${search_ext}"
  5797. if test -f "$lib"; then
  5798. if test "$search_ext" = ".la"; then
  5799. found=yes
  5800. else
  5801. found=no
  5802. fi
  5803. break 2
  5804. fi
  5805. done
  5806. done
  5807. if test "$found" != yes; then
  5808. # deplib doesn't seem to be a libtool library
  5809. if test "$linkmode,$pass" = "prog,link"; then
  5810. compile_deplibs="$deplib $compile_deplibs"
  5811. finalize_deplibs="$deplib $finalize_deplibs"
  5812. else
  5813. deplibs="$deplib $deplibs"
  5814. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  5815. fi
  5816. continue
  5817. else # deplib is a libtool library
  5818. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  5819. # We need to do some special things here, and not later.
  5820. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  5821. case " $predeps $postdeps " in
  5822. *" $deplib "*)
  5823. if func_lalib_p "$lib"; then
  5824. library_names=
  5825. old_library=
  5826. func_source "$lib"
  5827. for l in $old_library $library_names; do
  5828. ll="$l"
  5829. done
  5830. if test "X$ll" = "X$old_library" ; then # only static version available
  5831. found=no
  5832. func_dirname "$lib" "" "."
  5833. ladir="$func_dirname_result"
  5834. lib=$ladir/$old_library
  5835. if test "$linkmode,$pass" = "prog,link"; then
  5836. compile_deplibs="$deplib $compile_deplibs"
  5837. finalize_deplibs="$deplib $finalize_deplibs"
  5838. else
  5839. deplibs="$deplib $deplibs"
  5840. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  5841. fi
  5842. continue
  5843. fi
  5844. fi
  5845. ;;
  5846. *) ;;
  5847. esac
  5848. fi
  5849. fi
  5850. ;; # -l
  5851. *.ltframework)
  5852. if test "$linkmode,$pass" = "prog,link"; then
  5853. compile_deplibs="$deplib $compile_deplibs"
  5854. finalize_deplibs="$deplib $finalize_deplibs"
  5855. else
  5856. deplibs="$deplib $deplibs"
  5857. if test "$linkmode" = lib ; then
  5858. case "$new_inherited_linker_flags " in
  5859. *" $deplib "*) ;;
  5860. * ) new_inherited_linker_flags+=" $deplib" ;;
  5861. esac
  5862. fi
  5863. fi
  5864. continue
  5865. ;;
  5866. -L*)
  5867. case $linkmode in
  5868. lib)
  5869. deplibs="$deplib $deplibs"
  5870. test "$pass" = conv && continue
  5871. newdependency_libs="$deplib $newdependency_libs"
  5872. func_stripname '-L' '' "$deplib"
  5873. func_resolve_sysroot "$func_stripname_result"
  5874. newlib_search_path+=" $func_resolve_sysroot_result"
  5875. ;;
  5876. prog)
  5877. if test "$pass" = conv; then
  5878. deplibs="$deplib $deplibs"
  5879. continue
  5880. fi
  5881. if test "$pass" = scan; then
  5882. deplibs="$deplib $deplibs"
  5883. else
  5884. compile_deplibs="$deplib $compile_deplibs"
  5885. finalize_deplibs="$deplib $finalize_deplibs"
  5886. fi
  5887. func_stripname '-L' '' "$deplib"
  5888. func_resolve_sysroot "$func_stripname_result"
  5889. newlib_search_path+=" $func_resolve_sysroot_result"
  5890. ;;
  5891. *)
  5892. func_warning "\`-L' is ignored for archives/objects"
  5893. ;;
  5894. esac # linkmode
  5895. continue
  5896. ;; # -L
  5897. -R*)
  5898. if test "$pass" = link; then
  5899. func_stripname '-R' '' "$deplib"
  5900. func_resolve_sysroot "$func_stripname_result"
  5901. dir=$func_resolve_sysroot_result
  5902. # Make sure the xrpath contains only unique directories.
  5903. case "$xrpath " in
  5904. *" $dir "*) ;;
  5905. *) xrpath+=" $dir" ;;
  5906. esac
  5907. fi
  5908. deplibs="$deplib $deplibs"
  5909. continue
  5910. ;;
  5911. *.la)
  5912. func_resolve_sysroot "$deplib"
  5913. lib=$func_resolve_sysroot_result
  5914. ;;
  5915. *.$libext)
  5916. if test "$pass" = conv; then
  5917. deplibs="$deplib $deplibs"
  5918. continue
  5919. fi
  5920. case $linkmode in
  5921. lib)
  5922. # Linking convenience modules into shared libraries is allowed,
  5923. # but linking other static libraries is non-portable.
  5924. case " $dlpreconveniencelibs " in
  5925. *" $deplib "*) ;;
  5926. *)
  5927. valid_a_lib=no
  5928. case $deplibs_check_method in
  5929. match_pattern*)
  5930. set dummy $deplibs_check_method; shift
  5931. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  5932. if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  5933. | $EGREP "$match_pattern_regex" > /dev/null; then
  5934. valid_a_lib=yes
  5935. fi
  5936. ;;
  5937. pass_all)
  5938. valid_a_lib=yes
  5939. ;;
  5940. esac
  5941. if test "$valid_a_lib" != yes; then
  5942. echo
  5943. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  5944. echo "*** I have the capability to make that library automatically link in when"
  5945. echo "*** you link to this library. But I can only do this if you have a"
  5946. echo "*** shared version of the library, which you do not appear to have"
  5947. echo "*** because the file extensions .$libext of this argument makes me believe"
  5948. echo "*** that it is just a static archive that I should not use here."
  5949. else
  5950. echo
  5951. $ECHO "*** Warning: Linking the shared library $output against the"
  5952. $ECHO "*** static library $deplib is not portable!"
  5953. deplibs="$deplib $deplibs"
  5954. fi
  5955. ;;
  5956. esac
  5957. continue
  5958. ;;
  5959. prog)
  5960. if test "$pass" != link; then
  5961. deplibs="$deplib $deplibs"
  5962. else
  5963. compile_deplibs="$deplib $compile_deplibs"
  5964. finalize_deplibs="$deplib $finalize_deplibs"
  5965. fi
  5966. continue
  5967. ;;
  5968. esac # linkmode
  5969. ;; # *.$libext
  5970. *.lo | *.$objext)
  5971. if test "$pass" = conv; then
  5972. deplibs="$deplib $deplibs"
  5973. elif test "$linkmode" = prog; then
  5974. if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  5975. # If there is no dlopen support or we're linking statically,
  5976. # we need to preload.
  5977. newdlprefiles+=" $deplib"
  5978. compile_deplibs="$deplib $compile_deplibs"
  5979. finalize_deplibs="$deplib $finalize_deplibs"
  5980. else
  5981. newdlfiles+=" $deplib"
  5982. fi
  5983. fi
  5984. continue
  5985. ;;
  5986. %DEPLIBS%)
  5987. alldeplibs=yes
  5988. continue
  5989. ;;
  5990. esac # case $deplib
  5991. if test "$found" = yes || test -f "$lib"; then :
  5992. else
  5993. func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
  5994. fi
  5995. # Check to see that this really is a libtool archive.
  5996. func_lalib_unsafe_p "$lib" \
  5997. || func_fatal_error "\`$lib' is not a valid libtool archive"
  5998. func_dirname "$lib" "" "."
  5999. ladir="$func_dirname_result"
  6000. dlname=
  6001. dlopen=
  6002. dlpreopen=
  6003. libdir=
  6004. library_names=
  6005. old_library=
  6006. inherited_linker_flags=
  6007. # If the library was installed with an old release of libtool,
  6008. # it will not redefine variables installed, or shouldnotlink
  6009. installed=yes
  6010. shouldnotlink=no
  6011. avoidtemprpath=
  6012. # Read the .la file
  6013. func_source "$lib"
  6014. # Convert "-framework foo" to "foo.ltframework"
  6015. if test -n "$inherited_linker_flags"; then
  6016. tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  6017. for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  6018. case " $new_inherited_linker_flags " in
  6019. *" $tmp_inherited_linker_flag "*) ;;
  6020. *) new_inherited_linker_flags+=" $tmp_inherited_linker_flag";;
  6021. esac
  6022. done
  6023. fi
  6024. dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  6025. if test "$linkmode,$pass" = "lib,link" ||
  6026. test "$linkmode,$pass" = "prog,scan" ||
  6027. { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  6028. test -n "$dlopen" && dlfiles+=" $dlopen"
  6029. test -n "$dlpreopen" && dlprefiles+=" $dlpreopen"
  6030. fi
  6031. if test "$pass" = conv; then
  6032. # Only check for convenience libraries
  6033. deplibs="$lib $deplibs"
  6034. if test -z "$libdir"; then
  6035. if test -z "$old_library"; then
  6036. func_fatal_error "cannot find name of link library for \`$lib'"
  6037. fi
  6038. # It is a libtool convenience library, so add in its objects.
  6039. convenience+=" $ladir/$objdir/$old_library"
  6040. old_convenience+=" $ladir/$objdir/$old_library"
  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. elif test "$linkmode" != prog && test "$linkmode" != lib; then
  6052. func_fatal_error "\`$lib' is not a convenience library"
  6053. fi
  6054. continue
  6055. fi # $pass = conv
  6056. # Get the name of the library we link against.
  6057. linklib=
  6058. if test -n "$old_library" &&
  6059. { test "$prefer_static_libs" = yes ||
  6060. test "$prefer_static_libs,$installed" = "built,no"; }; then
  6061. linklib=$old_library
  6062. else
  6063. for l in $old_library $library_names; do
  6064. linklib="$l"
  6065. done
  6066. fi
  6067. if test -z "$linklib"; then
  6068. func_fatal_error "cannot find name of link library for \`$lib'"
  6069. fi
  6070. # This library was specified with -dlopen.
  6071. if test "$pass" = dlopen; then
  6072. if test -z "$libdir"; then
  6073. func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
  6074. fi
  6075. if test -z "$dlname" ||
  6076. test "$dlopen_support" != yes ||
  6077. test "$build_libtool_libs" = no; then
  6078. # If there is no dlname, no dlopen support or we're linking
  6079. # statically, we need to preload. We also need to preload any
  6080. # dependent libraries so libltdl's deplib preloader doesn't
  6081. # bomb out in the load deplibs phase.
  6082. dlprefiles+=" $lib $dependency_libs"
  6083. else
  6084. newdlfiles+=" $lib"
  6085. fi
  6086. continue
  6087. fi # $pass = dlopen
  6088. # We need an absolute path.
  6089. case $ladir in
  6090. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  6091. *)
  6092. abs_ladir=`cd "$ladir" && pwd`
  6093. if test -z "$abs_ladir"; then
  6094. func_warning "cannot determine absolute directory name of \`$ladir'"
  6095. func_warning "passing it literally to the linker, although it might fail"
  6096. abs_ladir="$ladir"
  6097. fi
  6098. ;;
  6099. esac
  6100. func_basename "$lib"
  6101. laname="$func_basename_result"
  6102. # Find the relevant object directory and library name.
  6103. if test "X$installed" = Xyes; then
  6104. if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  6105. func_warning "library \`$lib' was moved."
  6106. dir="$ladir"
  6107. absdir="$abs_ladir"
  6108. libdir="$abs_ladir"
  6109. else
  6110. dir="$lt_sysroot$libdir"
  6111. absdir="$lt_sysroot$libdir"
  6112. fi
  6113. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  6114. else
  6115. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  6116. dir="$ladir"
  6117. absdir="$abs_ladir"
  6118. # Remove this search path later
  6119. notinst_path+=" $abs_ladir"
  6120. else
  6121. dir="$ladir/$objdir"
  6122. absdir="$abs_ladir/$objdir"
  6123. # Remove this search path later
  6124. notinst_path+=" $abs_ladir"
  6125. fi
  6126. fi # $installed = yes
  6127. func_stripname 'lib' '.la' "$laname"
  6128. name=$func_stripname_result
  6129. # This library was specified with -dlpreopen.
  6130. if test "$pass" = dlpreopen; then
  6131. if test -z "$libdir" && test "$linkmode" = prog; then
  6132. func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
  6133. fi
  6134. case "$host" in
  6135. # special handling for platforms with PE-DLLs.
  6136. *cygwin* | *mingw* | *cegcc* )
  6137. # Linker will automatically link against shared library if both
  6138. # static and shared are present. Therefore, ensure we extract
  6139. # symbols from the import library if a shared library is present
  6140. # (otherwise, the dlopen module name will be incorrect). We do
  6141. # this by putting the import library name into $newdlprefiles.
  6142. # We recover the dlopen module name by 'saving' the la file
  6143. # name in a special purpose variable, and (later) extracting the
  6144. # dlname from the la file.
  6145. if test -n "$dlname"; then
  6146. func_tr_sh "$dir/$linklib"
  6147. eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  6148. newdlprefiles+=" $dir/$linklib"
  6149. else
  6150. newdlprefiles+=" $dir/$old_library"
  6151. # Keep a list of preopened convenience libraries to check
  6152. # that they are being used correctly in the link pass.
  6153. test -z "$libdir" && \
  6154. dlpreconveniencelibs+=" $dir/$old_library"
  6155. fi
  6156. ;;
  6157. * )
  6158. # Prefer using a static library (so that no silly _DYNAMIC symbols
  6159. # are required to link).
  6160. if test -n "$old_library"; then
  6161. newdlprefiles+=" $dir/$old_library"
  6162. # Keep a list of preopened convenience libraries to check
  6163. # that they are being used correctly in the link pass.
  6164. test -z "$libdir" && \
  6165. dlpreconveniencelibs+=" $dir/$old_library"
  6166. # Otherwise, use the dlname, so that lt_dlopen finds it.
  6167. elif test -n "$dlname"; then
  6168. newdlprefiles+=" $dir/$dlname"
  6169. else
  6170. newdlprefiles+=" $dir/$linklib"
  6171. fi
  6172. ;;
  6173. esac
  6174. fi # $pass = dlpreopen
  6175. if test -z "$libdir"; then
  6176. # Link the convenience library
  6177. if test "$linkmode" = lib; then
  6178. deplibs="$dir/$old_library $deplibs"
  6179. elif test "$linkmode,$pass" = "prog,link"; then
  6180. compile_deplibs="$dir/$old_library $compile_deplibs"
  6181. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  6182. else
  6183. deplibs="$lib $deplibs" # used for prog,scan pass
  6184. fi
  6185. continue
  6186. fi
  6187. if test "$linkmode" = prog && test "$pass" != link; then
  6188. newlib_search_path+=" $ladir"
  6189. deplibs="$lib $deplibs"
  6190. linkalldeplibs=no
  6191. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  6192. test "$build_libtool_libs" = no; then
  6193. linkalldeplibs=yes
  6194. fi
  6195. tmp_libs=
  6196. for deplib in $dependency_libs; do
  6197. case $deplib in
  6198. -L*) func_stripname '-L' '' "$deplib"
  6199. func_resolve_sysroot "$func_stripname_result"
  6200. newlib_search_path+=" $func_resolve_sysroot_result"
  6201. ;;
  6202. esac
  6203. # Need to link against all dependency_libs?
  6204. if test "$linkalldeplibs" = yes; then
  6205. deplibs="$deplib $deplibs"
  6206. else
  6207. # Need to hardcode shared library paths
  6208. # or/and link against static libraries
  6209. newdependency_libs="$deplib $newdependency_libs"
  6210. fi
  6211. if $opt_preserve_dup_deps ; then
  6212. case "$tmp_libs " in
  6213. *" $deplib "*) specialdeplibs+=" $deplib" ;;
  6214. esac
  6215. fi
  6216. tmp_libs+=" $deplib"
  6217. done # for deplib
  6218. continue
  6219. fi # $linkmode = prog...
  6220. if test "$linkmode,$pass" = "prog,link"; then
  6221. if test -n "$library_names" &&
  6222. { { test "$prefer_static_libs" = no ||
  6223. test "$prefer_static_libs,$installed" = "built,yes"; } ||
  6224. test -z "$old_library"; }; then
  6225. # We need to hardcode the library path
  6226. if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  6227. # Make sure the rpath contains only unique directories.
  6228. case "$temp_rpath:" in
  6229. *"$absdir:"*) ;;
  6230. *) temp_rpath+="$absdir:" ;;
  6231. esac
  6232. fi
  6233. # Hardcode the library path.
  6234. # Skip directories that are in the system default run-time
  6235. # search path.
  6236. case " $sys_lib_dlsearch_path " in
  6237. *" $absdir "*) ;;
  6238. *)
  6239. case "$compile_rpath " in
  6240. *" $absdir "*) ;;
  6241. *) compile_rpath+=" $absdir" ;;
  6242. esac
  6243. ;;
  6244. esac
  6245. case " $sys_lib_dlsearch_path " in
  6246. *" $libdir "*) ;;
  6247. *)
  6248. case "$finalize_rpath " in
  6249. *" $libdir "*) ;;
  6250. *) finalize_rpath+=" $libdir" ;;
  6251. esac
  6252. ;;
  6253. esac
  6254. fi # $linkmode,$pass = prog,link...
  6255. if test "$alldeplibs" = yes &&
  6256. { test "$deplibs_check_method" = pass_all ||
  6257. { test "$build_libtool_libs" = yes &&
  6258. test -n "$library_names"; }; }; then
  6259. # We only need to search for static libraries
  6260. continue
  6261. fi
  6262. fi
  6263. link_static=no # Whether the deplib will be linked statically
  6264. use_static_libs=$prefer_static_libs
  6265. if test "$use_static_libs" = built && test "$installed" = yes; then
  6266. use_static_libs=no
  6267. fi
  6268. if test -n "$library_names" &&
  6269. { test "$use_static_libs" = no || test -z "$old_library"; }; then
  6270. case $host in
  6271. *cygwin* | *mingw* | *cegcc*)
  6272. # No point in relinking DLLs because paths are not encoded
  6273. notinst_deplibs+=" $lib"
  6274. need_relink=no
  6275. ;;
  6276. *)
  6277. if test "$installed" = no; then
  6278. notinst_deplibs+=" $lib"
  6279. need_relink=yes
  6280. fi
  6281. ;;
  6282. esac
  6283. # This is a shared library
  6284. # Warn about portability, can't link against -module's on some
  6285. # systems (darwin). Don't bleat about dlopened modules though!
  6286. dlopenmodule=""
  6287. for dlpremoduletest in $dlprefiles; do
  6288. if test "X$dlpremoduletest" = "X$lib"; then
  6289. dlopenmodule="$dlpremoduletest"
  6290. break
  6291. fi
  6292. done
  6293. if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
  6294. echo
  6295. if test "$linkmode" = prog; then
  6296. $ECHO "*** Warning: Linking the executable $output against the loadable module"
  6297. else
  6298. $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  6299. fi
  6300. $ECHO "*** $linklib is not portable!"
  6301. fi
  6302. if test "$linkmode" = lib &&
  6303. test "$hardcode_into_libs" = yes; then
  6304. # Hardcode the library path.
  6305. # Skip directories that are in the system default run-time
  6306. # search path.
  6307. case " $sys_lib_dlsearch_path " in
  6308. *" $absdir "*) ;;
  6309. *)
  6310. case "$compile_rpath " in
  6311. *" $absdir "*) ;;
  6312. *) compile_rpath+=" $absdir" ;;
  6313. esac
  6314. ;;
  6315. esac
  6316. case " $sys_lib_dlsearch_path " in
  6317. *" $libdir "*) ;;
  6318. *)
  6319. case "$finalize_rpath " in
  6320. *" $libdir "*) ;;
  6321. *) finalize_rpath+=" $libdir" ;;
  6322. esac
  6323. ;;
  6324. esac
  6325. fi
  6326. if test -n "$old_archive_from_expsyms_cmds"; then
  6327. # figure out the soname
  6328. set dummy $library_names
  6329. shift
  6330. realname="$1"
  6331. shift
  6332. libname=`eval "\\$ECHO \"$libname_spec\""`
  6333. # use dlname if we got it. it's perfectly good, no?
  6334. if test -n "$dlname"; then
  6335. soname="$dlname"
  6336. elif test -n "$soname_spec"; then
  6337. # bleh windows
  6338. case $host in
  6339. *cygwin* | mingw* | *cegcc*)
  6340. func_arith $current - $age
  6341. major=$func_arith_result
  6342. versuffix="-$major"
  6343. ;;
  6344. esac
  6345. eval soname=\"$soname_spec\"
  6346. else
  6347. soname="$realname"
  6348. fi
  6349. # Make a new name for the extract_expsyms_cmds to use
  6350. soroot="$soname"
  6351. func_basename "$soroot"
  6352. soname="$func_basename_result"
  6353. func_stripname 'lib' '.dll' "$soname"
  6354. newlib=libimp-$func_stripname_result.a
  6355. # If the library has no export list, then create one now
  6356. if test -f "$output_objdir/$soname-def"; then :
  6357. else
  6358. func_verbose "extracting exported symbol list from \`$soname'"
  6359. func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  6360. fi
  6361. # Create $newlib
  6362. if test -f "$output_objdir/$newlib"; then :; else
  6363. func_verbose "generating import library for \`$soname'"
  6364. func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  6365. fi
  6366. # make sure the library variables are pointing to the new library
  6367. dir=$output_objdir
  6368. linklib=$newlib
  6369. fi # test -n "$old_archive_from_expsyms_cmds"
  6370. if test "$linkmode" = prog || test "$opt_mode" != relink; then
  6371. add_shlibpath=
  6372. add_dir=
  6373. add=
  6374. lib_linked=yes
  6375. case $hardcode_action in
  6376. immediate | unsupported)
  6377. if test "$hardcode_direct" = no; then
  6378. add="$dir/$linklib"
  6379. case $host in
  6380. *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  6381. *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  6382. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  6383. *-*-unixware7*) add_dir="-L$dir" ;;
  6384. *-*-darwin* )
  6385. # if the lib is a (non-dlopened) module then we can not
  6386. # link against it, someone is ignoring the earlier warnings
  6387. if /usr/bin/file -L $add 2> /dev/null |
  6388. $GREP ": [^:]* bundle" >/dev/null ; then
  6389. if test "X$dlopenmodule" != "X$lib"; then
  6390. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  6391. if test -z "$old_library" ; then
  6392. echo
  6393. echo "*** And there doesn't seem to be a static archive available"
  6394. echo "*** The link will probably fail, sorry"
  6395. else
  6396. add="$dir/$old_library"
  6397. fi
  6398. elif test -n "$old_library"; then
  6399. add="$dir/$old_library"
  6400. fi
  6401. fi
  6402. esac
  6403. elif test "$hardcode_minus_L" = no; then
  6404. case $host in
  6405. *-*-sunos*) add_shlibpath="$dir" ;;
  6406. esac
  6407. add_dir="-L$dir"
  6408. add="-l$name"
  6409. elif test "$hardcode_shlibpath_var" = no; then
  6410. add_shlibpath="$dir"
  6411. add="-l$name"
  6412. else
  6413. lib_linked=no
  6414. fi
  6415. ;;
  6416. relink)
  6417. if test "$hardcode_direct" = yes &&
  6418. test "$hardcode_direct_absolute" = no; then
  6419. add="$dir/$linklib"
  6420. elif test "$hardcode_minus_L" = yes; then
  6421. add_dir="-L$absdir"
  6422. # Try looking first in the location we're being installed to.
  6423. if test -n "$inst_prefix_dir"; then
  6424. case $libdir in
  6425. [\\/]*)
  6426. add_dir+=" -L$inst_prefix_dir$libdir"
  6427. ;;
  6428. esac
  6429. fi
  6430. add="-l$name"
  6431. elif test "$hardcode_shlibpath_var" = yes; then
  6432. add_shlibpath="$dir"
  6433. add="-l$name"
  6434. else
  6435. lib_linked=no
  6436. fi
  6437. ;;
  6438. *) lib_linked=no ;;
  6439. esac
  6440. if test "$lib_linked" != yes; then
  6441. func_fatal_configuration "unsupported hardcode properties"
  6442. fi
  6443. if test -n "$add_shlibpath"; then
  6444. case :$compile_shlibpath: in
  6445. *":$add_shlibpath:"*) ;;
  6446. *) compile_shlibpath+="$add_shlibpath:" ;;
  6447. esac
  6448. fi
  6449. if test "$linkmode" = prog; then
  6450. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  6451. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  6452. else
  6453. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  6454. test -n "$add" && deplibs="$add $deplibs"
  6455. if test "$hardcode_direct" != yes &&
  6456. test "$hardcode_minus_L" != yes &&
  6457. test "$hardcode_shlibpath_var" = yes; then
  6458. case :$finalize_shlibpath: in
  6459. *":$libdir:"*) ;;
  6460. *) finalize_shlibpath+="$libdir:" ;;
  6461. esac
  6462. fi
  6463. fi
  6464. fi
  6465. if test "$linkmode" = prog || test "$opt_mode" = relink; then
  6466. add_shlibpath=
  6467. add_dir=
  6468. add=
  6469. # Finalize command for both is simple: just hardcode it.
  6470. if test "$hardcode_direct" = yes &&
  6471. test "$hardcode_direct_absolute" = no; then
  6472. add="$libdir/$linklib"
  6473. elif test "$hardcode_minus_L" = yes; then
  6474. add_dir="-L$libdir"
  6475. add="-l$name"
  6476. elif test "$hardcode_shlibpath_var" = yes; then
  6477. case :$finalize_shlibpath: in
  6478. *":$libdir:"*) ;;
  6479. *) finalize_shlibpath+="$libdir:" ;;
  6480. esac
  6481. add="-l$name"
  6482. elif test "$hardcode_automatic" = yes; then
  6483. if test -n "$inst_prefix_dir" &&
  6484. test -f "$inst_prefix_dir$libdir/$linklib" ; then
  6485. add="$inst_prefix_dir$libdir/$linklib"
  6486. else
  6487. add="$libdir/$linklib"
  6488. fi
  6489. else
  6490. # We cannot seem to hardcode it, guess we'll fake it.
  6491. add_dir="-L$libdir"
  6492. # Try looking first in the location we're being installed to.
  6493. if test -n "$inst_prefix_dir"; then
  6494. case $libdir in
  6495. [\\/]*)
  6496. add_dir+=" -L$inst_prefix_dir$libdir"
  6497. ;;
  6498. esac
  6499. fi
  6500. add="-l$name"
  6501. fi
  6502. if test "$linkmode" = prog; then
  6503. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  6504. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  6505. else
  6506. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  6507. test -n "$add" && deplibs="$add $deplibs"
  6508. fi
  6509. fi
  6510. elif test "$linkmode" = prog; then
  6511. # Here we assume that one of hardcode_direct or hardcode_minus_L
  6512. # is not unsupported. This is valid on all known static and
  6513. # shared platforms.
  6514. if test "$hardcode_direct" != unsupported; then
  6515. test -n "$old_library" && linklib="$old_library"
  6516. compile_deplibs="$dir/$linklib $compile_deplibs"
  6517. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  6518. else
  6519. compile_deplibs="-l$name -L$dir $compile_deplibs"
  6520. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  6521. fi
  6522. elif test "$build_libtool_libs" = yes; then
  6523. # Not a shared library
  6524. if test "$deplibs_check_method" != pass_all; then
  6525. # We're trying link a shared library against a static one
  6526. # but the system doesn't support it.
  6527. # Just print a warning and add the library to dependency_libs so
  6528. # that the program can be linked against the static library.
  6529. echo
  6530. $ECHO "*** Warning: This system can not link to static lib archive $lib."
  6531. echo "*** I have the capability to make that library automatically link in when"
  6532. echo "*** you link to this library. But I can only do this if you have a"
  6533. echo "*** shared version of the library, which you do not appear to have."
  6534. if test "$module" = yes; then
  6535. echo "*** But as you try to build a module library, libtool will still create "
  6536. echo "*** a static module, that should work as long as the dlopening application"
  6537. echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  6538. if test -z "$global_symbol_pipe"; then
  6539. echo
  6540. echo "*** However, this would only work if libtool was able to extract symbol"
  6541. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  6542. echo "*** not find such a program. So, this module is probably useless."
  6543. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  6544. fi
  6545. if test "$build_old_libs" = no; then
  6546. build_libtool_libs=module
  6547. build_old_libs=yes
  6548. else
  6549. build_libtool_libs=no
  6550. fi
  6551. fi
  6552. else
  6553. deplibs="$dir/$old_library $deplibs"
  6554. link_static=yes
  6555. fi
  6556. fi # link shared/static library?
  6557. if test "$linkmode" = lib; then
  6558. if test -n "$dependency_libs" &&
  6559. { test "$hardcode_into_libs" != yes ||
  6560. test "$build_old_libs" = yes ||
  6561. test "$link_static" = yes; }; then
  6562. # Extract -R from dependency_libs
  6563. temp_deplibs=
  6564. for libdir in $dependency_libs; do
  6565. case $libdir in
  6566. -R*) func_stripname '-R' '' "$libdir"
  6567. temp_xrpath=$func_stripname_result
  6568. case " $xrpath " in
  6569. *" $temp_xrpath "*) ;;
  6570. *) xrpath+=" $temp_xrpath";;
  6571. esac;;
  6572. *) temp_deplibs+=" $libdir";;
  6573. esac
  6574. done
  6575. dependency_libs="$temp_deplibs"
  6576. fi
  6577. newlib_search_path+=" $absdir"
  6578. # Link against this library
  6579. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  6580. # ... and its dependency_libs
  6581. tmp_libs=
  6582. for deplib in $dependency_libs; do
  6583. newdependency_libs="$deplib $newdependency_libs"
  6584. case $deplib in
  6585. -L*) func_stripname '-L' '' "$deplib"
  6586. func_resolve_sysroot "$func_stripname_result";;
  6587. *) func_resolve_sysroot "$deplib" ;;
  6588. esac
  6589. if $opt_preserve_dup_deps ; then
  6590. case "$tmp_libs " in
  6591. *" $func_resolve_sysroot_result "*)
  6592. specialdeplibs+=" $func_resolve_sysroot_result" ;;
  6593. esac
  6594. fi
  6595. tmp_libs+=" $func_resolve_sysroot_result"
  6596. done
  6597. if test "$link_all_deplibs" != no; then
  6598. # Add the search paths of all dependency libraries
  6599. for deplib in $dependency_libs; do
  6600. path=
  6601. case $deplib in
  6602. -L*) path="$deplib" ;;
  6603. *.la)
  6604. func_resolve_sysroot "$deplib"
  6605. deplib=$func_resolve_sysroot_result
  6606. func_dirname "$deplib" "" "."
  6607. dir=$func_dirname_result
  6608. # We need an absolute path.
  6609. case $dir in
  6610. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  6611. *)
  6612. absdir=`cd "$dir" && pwd`
  6613. if test -z "$absdir"; then
  6614. func_warning "cannot determine absolute directory name of \`$dir'"
  6615. absdir="$dir"
  6616. fi
  6617. ;;
  6618. esac
  6619. if $GREP "^installed=no" $deplib > /dev/null; then
  6620. case $host in
  6621. *-*-darwin*)
  6622. depdepl=
  6623. eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  6624. if test -n "$deplibrary_names" ; then
  6625. for tmp in $deplibrary_names ; do
  6626. depdepl=$tmp
  6627. done
  6628. if test -f "$absdir/$objdir/$depdepl" ; then
  6629. depdepl="$absdir/$objdir/$depdepl"
  6630. darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  6631. if test -z "$darwin_install_name"; then
  6632. darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  6633. fi
  6634. compiler_flags+=" ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
  6635. linker_flags+=" -dylib_file ${darwin_install_name}:${depdepl}"
  6636. path=
  6637. fi
  6638. fi
  6639. ;;
  6640. *)
  6641. path="-L$absdir/$objdir"
  6642. ;;
  6643. esac
  6644. else
  6645. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  6646. test -z "$libdir" && \
  6647. func_fatal_error "\`$deplib' is not a valid libtool archive"
  6648. test "$absdir" != "$libdir" && \
  6649. func_warning "\`$deplib' seems to be moved"
  6650. path="-L$absdir"
  6651. fi
  6652. ;;
  6653. esac
  6654. case " $deplibs " in
  6655. *" $path "*) ;;
  6656. *) deplibs="$path $deplibs" ;;
  6657. esac
  6658. done
  6659. fi # link_all_deplibs != no
  6660. fi # linkmode = lib
  6661. done # for deplib in $libs
  6662. if test "$pass" = link; then
  6663. if test "$linkmode" = "prog"; then
  6664. compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  6665. finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  6666. else
  6667. compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  6668. fi
  6669. fi
  6670. dependency_libs="$newdependency_libs"
  6671. if test "$pass" = dlpreopen; then
  6672. # Link the dlpreopened libraries before other libraries
  6673. for deplib in $save_deplibs; do
  6674. deplibs="$deplib $deplibs"
  6675. done
  6676. fi
  6677. if test "$pass" != dlopen; then
  6678. if test "$pass" != conv; then
  6679. # Make sure lib_search_path contains only unique directories.
  6680. lib_search_path=
  6681. for dir in $newlib_search_path; do
  6682. case "$lib_search_path " in
  6683. *" $dir "*) ;;
  6684. *) lib_search_path+=" $dir" ;;
  6685. esac
  6686. done
  6687. newlib_search_path=
  6688. fi
  6689. if test "$linkmode,$pass" != "prog,link"; then
  6690. vars="deplibs"
  6691. else
  6692. vars="compile_deplibs finalize_deplibs"
  6693. fi
  6694. for var in $vars dependency_libs; do
  6695. # Add libraries to $var in reverse order
  6696. eval tmp_libs=\"\$$var\"
  6697. new_libs=
  6698. for deplib in $tmp_libs; do
  6699. # FIXME: Pedantically, this is the right thing to do, so
  6700. # that some nasty dependency loop isn't accidentally
  6701. # broken:
  6702. #new_libs="$deplib $new_libs"
  6703. # Pragmatically, this seems to cause very few problems in
  6704. # practice:
  6705. case $deplib in
  6706. -L*) new_libs="$deplib $new_libs" ;;
  6707. -R*) ;;
  6708. *)
  6709. # And here is the reason: when a library appears more
  6710. # than once as an explicit dependence of a library, or
  6711. # is implicitly linked in more than once by the
  6712. # compiler, it is considered special, and multiple
  6713. # occurrences thereof are not removed. Compare this
  6714. # with having the same library being listed as a
  6715. # dependency of multiple other libraries: in this case,
  6716. # we know (pedantically, we assume) the library does not
  6717. # need to be listed more than once, so we keep only the
  6718. # last copy. This is not always right, but it is rare
  6719. # enough that we require users that really mean to play
  6720. # such unportable linking tricks to link the library
  6721. # using -Wl,-lname, so that libtool does not consider it
  6722. # for duplicate removal.
  6723. case " $specialdeplibs " in
  6724. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  6725. *)
  6726. case " $new_libs " in
  6727. *" $deplib "*) ;;
  6728. *) new_libs="$deplib $new_libs" ;;
  6729. esac
  6730. ;;
  6731. esac
  6732. ;;
  6733. esac
  6734. done
  6735. tmp_libs=
  6736. for deplib in $new_libs; do
  6737. case $deplib in
  6738. -L*)
  6739. case " $tmp_libs " in
  6740. *" $deplib "*) ;;
  6741. *) tmp_libs+=" $deplib" ;;
  6742. esac
  6743. ;;
  6744. *) tmp_libs+=" $deplib" ;;
  6745. esac
  6746. done
  6747. eval $var=\"$tmp_libs\"
  6748. done # for var
  6749. fi
  6750. # Last step: remove runtime libs from dependency_libs
  6751. # (they stay in deplibs)
  6752. tmp_libs=
  6753. for i in $dependency_libs ; do
  6754. case " $predeps $postdeps $compiler_lib_search_path " in
  6755. *" $i "*)
  6756. i=""
  6757. ;;
  6758. esac
  6759. if test -n "$i" ; then
  6760. tmp_libs+=" $i"
  6761. fi
  6762. done
  6763. dependency_libs=$tmp_libs
  6764. done # for pass
  6765. if test "$linkmode" = prog; then
  6766. dlfiles="$newdlfiles"
  6767. fi
  6768. if test "$linkmode" = prog || test "$linkmode" = lib; then
  6769. dlprefiles="$newdlprefiles"
  6770. fi
  6771. case $linkmode in
  6772. oldlib)
  6773. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  6774. func_warning "\`-dlopen' is ignored for archives"
  6775. fi
  6776. case " $deplibs" in
  6777. *\ -l* | *\ -L*)
  6778. func_warning "\`-l' and \`-L' are ignored for archives" ;;
  6779. esac
  6780. test -n "$rpath" && \
  6781. func_warning "\`-rpath' is ignored for archives"
  6782. test -n "$xrpath" && \
  6783. func_warning "\`-R' is ignored for archives"
  6784. test -n "$vinfo" && \
  6785. func_warning "\`-version-info/-version-number' is ignored for archives"
  6786. test -n "$release" && \
  6787. func_warning "\`-release' is ignored for archives"
  6788. test -n "$export_symbols$export_symbols_regex" && \
  6789. func_warning "\`-export-symbols' is ignored for archives"
  6790. # Now set the variables for building old libraries.
  6791. build_libtool_libs=no
  6792. oldlibs="$output"
  6793. objs+="$old_deplibs"
  6794. ;;
  6795. lib)
  6796. # Make sure we only generate libraries of the form `libNAME.la'.
  6797. case $outputname in
  6798. lib*)
  6799. func_stripname 'lib' '.la' "$outputname"
  6800. name=$func_stripname_result
  6801. eval shared_ext=\"$shrext_cmds\"
  6802. eval libname=\"$libname_spec\"
  6803. ;;
  6804. *)
  6805. test "$module" = no && \
  6806. func_fatal_help "libtool library \`$output' must begin with \`lib'"
  6807. if test "$need_lib_prefix" != no; then
  6808. # Add the "lib" prefix for modules if required
  6809. func_stripname '' '.la' "$outputname"
  6810. name=$func_stripname_result
  6811. eval shared_ext=\"$shrext_cmds\"
  6812. eval libname=\"$libname_spec\"
  6813. else
  6814. func_stripname '' '.la' "$outputname"
  6815. libname=$func_stripname_result
  6816. fi
  6817. ;;
  6818. esac
  6819. if test -n "$objs"; then
  6820. if test "$deplibs_check_method" != pass_all; then
  6821. func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
  6822. else
  6823. echo
  6824. $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  6825. $ECHO "*** objects $objs is not portable!"
  6826. libobjs+=" $objs"
  6827. fi
  6828. fi
  6829. test "$dlself" != no && \
  6830. func_warning "\`-dlopen self' is ignored for libtool libraries"
  6831. set dummy $rpath
  6832. shift
  6833. test "$#" -gt 1 && \
  6834. func_warning "ignoring multiple \`-rpath's for a libtool library"
  6835. install_libdir="$1"
  6836. oldlibs=
  6837. if test -z "$rpath"; then
  6838. if test "$build_libtool_libs" = yes; then
  6839. # Building a libtool convenience library.
  6840. # Some compilers have problems with a `.al' extension so
  6841. # convenience libraries should have the same extension an
  6842. # archive normally would.
  6843. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  6844. build_libtool_libs=convenience
  6845. build_old_libs=yes
  6846. fi
  6847. test -n "$vinfo" && \
  6848. func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
  6849. test -n "$release" && \
  6850. func_warning "\`-release' is ignored for convenience libraries"
  6851. else
  6852. # Parse the version information argument.
  6853. save_ifs="$IFS"; IFS=':'
  6854. set dummy $vinfo 0 0 0
  6855. shift
  6856. IFS="$save_ifs"
  6857. test -n "$7" && \
  6858. func_fatal_help "too many parameters to \`-version-info'"
  6859. # convert absolute version numbers to libtool ages
  6860. # this retains compatibility with .la files and attempts
  6861. # to make the code below a bit more comprehensible
  6862. case $vinfo_number in
  6863. yes)
  6864. number_major="$1"
  6865. number_minor="$2"
  6866. number_revision="$3"
  6867. #
  6868. # There are really only two kinds -- those that
  6869. # use the current revision as the major version
  6870. # and those that subtract age and use age as
  6871. # a minor version. But, then there is irix
  6872. # which has an extra 1 added just for fun
  6873. #
  6874. case $version_type in
  6875. # correct linux to gnu/linux during the next big refactor
  6876. darwin|linux|osf|windows|none)
  6877. func_arith $number_major + $number_minor
  6878. current=$func_arith_result
  6879. age="$number_minor"
  6880. revision="$number_revision"
  6881. ;;
  6882. freebsd-aout|freebsd-elf|qnx|sunos)
  6883. current="$number_major"
  6884. revision="$number_minor"
  6885. age="0"
  6886. ;;
  6887. irix|nonstopux)
  6888. func_arith $number_major + $number_minor
  6889. current=$func_arith_result
  6890. age="$number_minor"
  6891. revision="$number_minor"
  6892. lt_irix_increment=no
  6893. ;;
  6894. *)
  6895. func_fatal_configuration "$modename: unknown library version type \`$version_type'"
  6896. ;;
  6897. esac
  6898. ;;
  6899. no)
  6900. current="$1"
  6901. revision="$2"
  6902. age="$3"
  6903. ;;
  6904. esac
  6905. # Check that each of the things are valid numbers.
  6906. case $current in
  6907. 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]) ;;
  6908. *)
  6909. func_error "CURRENT \`$current' must be a nonnegative integer"
  6910. func_fatal_error "\`$vinfo' is not valid version information"
  6911. ;;
  6912. esac
  6913. case $revision in
  6914. 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]) ;;
  6915. *)
  6916. func_error "REVISION \`$revision' must be a nonnegative integer"
  6917. func_fatal_error "\`$vinfo' is not valid version information"
  6918. ;;
  6919. esac
  6920. case $age in
  6921. 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]) ;;
  6922. *)
  6923. func_error "AGE \`$age' must be a nonnegative integer"
  6924. func_fatal_error "\`$vinfo' is not valid version information"
  6925. ;;
  6926. esac
  6927. if test "$age" -gt "$current"; then
  6928. func_error "AGE \`$age' is greater than the current interface number \`$current'"
  6929. func_fatal_error "\`$vinfo' is not valid version information"
  6930. fi
  6931. # Calculate the version variables.
  6932. major=
  6933. versuffix=
  6934. verstring=
  6935. case $version_type in
  6936. none) ;;
  6937. darwin)
  6938. # Like Linux, but with the current version available in
  6939. # verstring for coding it into the library header
  6940. func_arith $current - $age
  6941. major=.$func_arith_result
  6942. versuffix="$major.$age.$revision"
  6943. # Darwin ld doesn't like 0 for these options...
  6944. func_arith $current + 1
  6945. minor_current=$func_arith_result
  6946. xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  6947. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  6948. ;;
  6949. freebsd-aout)
  6950. major=".$current"
  6951. versuffix=".$current.$revision";
  6952. ;;
  6953. freebsd-elf)
  6954. major=".$current"
  6955. versuffix=".$current"
  6956. ;;
  6957. irix | nonstopux)
  6958. if test "X$lt_irix_increment" = "Xno"; then
  6959. func_arith $current - $age
  6960. else
  6961. func_arith $current - $age + 1
  6962. fi
  6963. major=$func_arith_result
  6964. case $version_type in
  6965. nonstopux) verstring_prefix=nonstopux ;;
  6966. *) verstring_prefix=sgi ;;
  6967. esac
  6968. verstring="$verstring_prefix$major.$revision"
  6969. # Add in all the interfaces that we are compatible with.
  6970. loop=$revision
  6971. while test "$loop" -ne 0; do
  6972. func_arith $revision - $loop
  6973. iface=$func_arith_result
  6974. func_arith $loop - 1
  6975. loop=$func_arith_result
  6976. verstring="$verstring_prefix$major.$iface:$verstring"
  6977. done
  6978. # Before this point, $major must not contain `.'.
  6979. major=.$major
  6980. versuffix="$major.$revision"
  6981. ;;
  6982. linux) # correct to gnu/linux during the next big refactor
  6983. func_arith $current - $age
  6984. major=.$func_arith_result
  6985. versuffix="$major.$age.$revision"
  6986. ;;
  6987. osf)
  6988. func_arith $current - $age
  6989. major=.$func_arith_result
  6990. versuffix=".$current.$age.$revision"
  6991. verstring="$current.$age.$revision"
  6992. # Add in all the interfaces that we are compatible with.
  6993. loop=$age
  6994. while test "$loop" -ne 0; do
  6995. func_arith $current - $loop
  6996. iface=$func_arith_result
  6997. func_arith $loop - 1
  6998. loop=$func_arith_result
  6999. verstring="$verstring:${iface}.0"
  7000. done
  7001. # Make executables depend on our current version.
  7002. verstring+=":${current}.0"
  7003. ;;
  7004. qnx)
  7005. major=".$current"
  7006. versuffix=".$current"
  7007. ;;
  7008. sunos)
  7009. major=".$current"
  7010. versuffix=".$current.$revision"
  7011. ;;
  7012. windows)
  7013. # Use '-' rather than '.', since we only want one
  7014. # extension on DOS 8.3 filesystems.
  7015. func_arith $current - $age
  7016. major=$func_arith_result
  7017. versuffix="-$major"
  7018. ;;
  7019. *)
  7020. func_fatal_configuration "unknown library version type \`$version_type'"
  7021. ;;
  7022. esac
  7023. # Clear the version info if we defaulted, and they specified a release.
  7024. if test -z "$vinfo" && test -n "$release"; then
  7025. major=
  7026. case $version_type in
  7027. darwin)
  7028. # we can't check for "0.0" in archive_cmds due to quoting
  7029. # problems, so we reset it completely
  7030. verstring=
  7031. ;;
  7032. *)
  7033. verstring="0.0"
  7034. ;;
  7035. esac
  7036. if test "$need_version" = no; then
  7037. versuffix=
  7038. else
  7039. versuffix=".0.0"
  7040. fi
  7041. fi
  7042. # Remove version info from name if versioning should be avoided
  7043. if test "$avoid_version" = yes && test "$need_version" = no; then
  7044. major=
  7045. versuffix=
  7046. verstring=""
  7047. fi
  7048. # Check to see if the archive will have undefined symbols.
  7049. if test "$allow_undefined" = yes; then
  7050. if test "$allow_undefined_flag" = unsupported; then
  7051. func_warning "undefined symbols not allowed in $host shared libraries"
  7052. build_libtool_libs=no
  7053. build_old_libs=yes
  7054. fi
  7055. else
  7056. # Don't allow undefined symbols.
  7057. allow_undefined_flag="$no_undefined_flag"
  7058. fi
  7059. fi
  7060. func_generate_dlsyms "$libname" "$libname" "yes"
  7061. libobjs+=" $symfileobj"
  7062. test "X$libobjs" = "X " && libobjs=
  7063. if test "$opt_mode" != relink; then
  7064. # Remove our outputs, but don't remove object files since they
  7065. # may have been created when compiling PIC objects.
  7066. removelist=
  7067. tempremovelist=`$ECHO "$output_objdir/*"`
  7068. for p in $tempremovelist; do
  7069. case $p in
  7070. *.$objext | *.gcno)
  7071. ;;
  7072. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  7073. if test "X$precious_files_regex" != "X"; then
  7074. if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  7075. then
  7076. continue
  7077. fi
  7078. fi
  7079. removelist+=" $p"
  7080. ;;
  7081. *) ;;
  7082. esac
  7083. done
  7084. test -n "$removelist" && \
  7085. func_show_eval "${RM}r \$removelist"
  7086. fi
  7087. # Now set the variables for building old libraries.
  7088. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  7089. oldlibs+=" $output_objdir/$libname.$libext"
  7090. # Transform .lo files to .o files.
  7091. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
  7092. fi
  7093. # Eliminate all temporary directories.
  7094. #for path in $notinst_path; do
  7095. # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  7096. # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  7097. # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  7098. #done
  7099. if test -n "$xrpath"; then
  7100. # If the user specified any rpath flags, then add them.
  7101. temp_xrpath=
  7102. for libdir in $xrpath; do
  7103. func_replace_sysroot "$libdir"
  7104. temp_xrpath+=" -R$func_replace_sysroot_result"
  7105. case "$finalize_rpath " in
  7106. *" $libdir "*) ;;
  7107. *) finalize_rpath+=" $libdir" ;;
  7108. esac
  7109. done
  7110. if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  7111. dependency_libs="$temp_xrpath $dependency_libs"
  7112. fi
  7113. fi
  7114. # Make sure dlfiles contains only unique files that won't be dlpreopened
  7115. old_dlfiles="$dlfiles"
  7116. dlfiles=
  7117. for lib in $old_dlfiles; do
  7118. case " $dlprefiles $dlfiles " in
  7119. *" $lib "*) ;;
  7120. *) dlfiles+=" $lib" ;;
  7121. esac
  7122. done
  7123. # Make sure dlprefiles contains only unique files
  7124. old_dlprefiles="$dlprefiles"
  7125. dlprefiles=
  7126. for lib in $old_dlprefiles; do
  7127. case "$dlprefiles " in
  7128. *" $lib "*) ;;
  7129. *) dlprefiles+=" $lib" ;;
  7130. esac
  7131. done
  7132. if test "$build_libtool_libs" = yes; then
  7133. if test -n "$rpath"; then
  7134. case $host in
  7135. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  7136. # these systems don't actually have a c library (as such)!
  7137. ;;
  7138. *-*-rhapsody* | *-*-darwin1.[012])
  7139. # Rhapsody C library is in the System framework
  7140. deplibs+=" System.ltframework"
  7141. ;;
  7142. *-*-netbsd*)
  7143. # Don't link with libc until the a.out ld.so is fixed.
  7144. ;;
  7145. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  7146. # Do not include libc due to us having libc/libc_r.
  7147. ;;
  7148. *-*-sco3.2v5* | *-*-sco5v6*)
  7149. # Causes problems with __ctype
  7150. ;;
  7151. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  7152. # Compiler inserts libc in the correct place for threads to work
  7153. ;;
  7154. *)
  7155. # Add libc to deplibs on all other systems if necessary.
  7156. if test "$build_libtool_need_lc" = "yes"; then
  7157. deplibs+=" -lc"
  7158. fi
  7159. ;;
  7160. esac
  7161. fi
  7162. # Transform deplibs into only deplibs that can be linked in shared.
  7163. name_save=$name
  7164. libname_save=$libname
  7165. release_save=$release
  7166. versuffix_save=$versuffix
  7167. major_save=$major
  7168. # I'm not sure if I'm treating the release correctly. I think
  7169. # release should show up in the -l (ie -lgmp5) so we don't want to
  7170. # add it in twice. Is that correct?
  7171. release=""
  7172. versuffix=""
  7173. major=""
  7174. newdeplibs=
  7175. droppeddeps=no
  7176. case $deplibs_check_method in
  7177. pass_all)
  7178. # Don't check for shared/static. Everything works.
  7179. # This might be a little naive. We might want to check
  7180. # whether the library exists or not. But this is on
  7181. # osf3 & osf4 and I'm not really sure... Just
  7182. # implementing what was already the behavior.
  7183. newdeplibs=$deplibs
  7184. ;;
  7185. test_compile)
  7186. # This code stresses the "libraries are programs" paradigm to its
  7187. # limits. Maybe even breaks it. We compile a program, linking it
  7188. # against the deplibs as a proxy for the library. Then we can check
  7189. # whether they linked in statically or dynamically with ldd.
  7190. $opt_dry_run || $RM conftest.c
  7191. cat > conftest.c <<EOF
  7192. int main() { return 0; }
  7193. EOF
  7194. $opt_dry_run || $RM conftest
  7195. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  7196. ldd_output=`ldd conftest`
  7197. for i in $deplibs; do
  7198. case $i in
  7199. -l*)
  7200. func_stripname -l '' "$i"
  7201. name=$func_stripname_result
  7202. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  7203. case " $predeps $postdeps " in
  7204. *" $i "*)
  7205. newdeplibs+=" $i"
  7206. i=""
  7207. ;;
  7208. esac
  7209. fi
  7210. if test -n "$i" ; then
  7211. libname=`eval "\\$ECHO \"$libname_spec\""`
  7212. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  7213. set dummy $deplib_matches; shift
  7214. deplib_match=$1
  7215. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  7216. newdeplibs+=" $i"
  7217. else
  7218. droppeddeps=yes
  7219. echo
  7220. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  7221. echo "*** I have the capability to make that library automatically link in when"
  7222. echo "*** you link to this library. But I can only do this if you have a"
  7223. echo "*** shared version of the library, which I believe you do not have"
  7224. echo "*** because a test_compile did reveal that the linker did not use it for"
  7225. echo "*** its dynamic dependency list that programs get resolved with at runtime."
  7226. fi
  7227. fi
  7228. ;;
  7229. *)
  7230. newdeplibs+=" $i"
  7231. ;;
  7232. esac
  7233. done
  7234. else
  7235. # Error occurred in the first compile. Let's try to salvage
  7236. # the situation: Compile a separate program for each library.
  7237. for i in $deplibs; do
  7238. case $i in
  7239. -l*)
  7240. func_stripname -l '' "$i"
  7241. name=$func_stripname_result
  7242. $opt_dry_run || $RM conftest
  7243. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  7244. ldd_output=`ldd conftest`
  7245. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  7246. case " $predeps $postdeps " in
  7247. *" $i "*)
  7248. newdeplibs+=" $i"
  7249. i=""
  7250. ;;
  7251. esac
  7252. fi
  7253. if test -n "$i" ; then
  7254. libname=`eval "\\$ECHO \"$libname_spec\""`
  7255. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  7256. set dummy $deplib_matches; shift
  7257. deplib_match=$1
  7258. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  7259. newdeplibs+=" $i"
  7260. else
  7261. droppeddeps=yes
  7262. echo
  7263. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  7264. echo "*** I have the capability to make that library automatically link in when"
  7265. echo "*** you link to this library. But I can only do this if you have a"
  7266. echo "*** shared version of the library, which you do not appear to have"
  7267. echo "*** because a test_compile did reveal that the linker did not use this one"
  7268. echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  7269. fi
  7270. fi
  7271. else
  7272. droppeddeps=yes
  7273. echo
  7274. $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  7275. echo "*** make it link in! You will probably need to install it or some"
  7276. echo "*** library that it depends on before this library will be fully"
  7277. echo "*** functional. Installing it before continuing would be even better."
  7278. fi
  7279. ;;
  7280. *)
  7281. newdeplibs+=" $i"
  7282. ;;
  7283. esac
  7284. done
  7285. fi
  7286. ;;
  7287. file_magic*)
  7288. set dummy $deplibs_check_method; shift
  7289. file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  7290. for a_deplib in $deplibs; do
  7291. case $a_deplib in
  7292. -l*)
  7293. func_stripname -l '' "$a_deplib"
  7294. name=$func_stripname_result
  7295. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  7296. case " $predeps $postdeps " in
  7297. *" $a_deplib "*)
  7298. newdeplibs+=" $a_deplib"
  7299. a_deplib=""
  7300. ;;
  7301. esac
  7302. fi
  7303. if test -n "$a_deplib" ; then
  7304. libname=`eval "\\$ECHO \"$libname_spec\""`
  7305. if test -n "$file_magic_glob"; then
  7306. libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  7307. else
  7308. libnameglob=$libname
  7309. fi
  7310. test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
  7311. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  7312. if test "$want_nocaseglob" = yes; then
  7313. shopt -s nocaseglob
  7314. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  7315. $nocaseglob
  7316. else
  7317. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  7318. fi
  7319. for potent_lib in $potential_libs; do
  7320. # Follow soft links.
  7321. if ls -lLd "$potent_lib" 2>/dev/null |
  7322. $GREP " -> " >/dev/null; then
  7323. continue
  7324. fi
  7325. # The statement above tries to avoid entering an
  7326. # endless loop below, in case of cyclic links.
  7327. # We might still enter an endless loop, since a link
  7328. # loop can be closed while we follow links,
  7329. # but so what?
  7330. potlib="$potent_lib"
  7331. while test -h "$potlib" 2>/dev/null; do
  7332. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  7333. case $potliblink in
  7334. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  7335. *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
  7336. esac
  7337. done
  7338. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  7339. $SED -e 10q |
  7340. $EGREP "$file_magic_regex" > /dev/null; then
  7341. newdeplibs+=" $a_deplib"
  7342. a_deplib=""
  7343. break 2
  7344. fi
  7345. done
  7346. done
  7347. fi
  7348. if test -n "$a_deplib" ; then
  7349. droppeddeps=yes
  7350. echo
  7351. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  7352. echo "*** I have the capability to make that library automatically link in when"
  7353. echo "*** you link to this library. But I can only do this if you have a"
  7354. echo "*** shared version of the library, which you do not appear to have"
  7355. echo "*** because I did check the linker path looking for a file starting"
  7356. if test -z "$potlib" ; then
  7357. $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  7358. else
  7359. $ECHO "*** with $libname and none of the candidates passed a file format test"
  7360. $ECHO "*** using a file magic. Last file checked: $potlib"
  7361. fi
  7362. fi
  7363. ;;
  7364. *)
  7365. # Add a -L argument.
  7366. newdeplibs+=" $a_deplib"
  7367. ;;
  7368. esac
  7369. done # Gone through all deplibs.
  7370. ;;
  7371. match_pattern*)
  7372. set dummy $deplibs_check_method; shift
  7373. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  7374. for a_deplib in $deplibs; do
  7375. case $a_deplib in
  7376. -l*)
  7377. func_stripname -l '' "$a_deplib"
  7378. name=$func_stripname_result
  7379. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  7380. case " $predeps $postdeps " in
  7381. *" $a_deplib "*)
  7382. newdeplibs+=" $a_deplib"
  7383. a_deplib=""
  7384. ;;
  7385. esac
  7386. fi
  7387. if test -n "$a_deplib" ; then
  7388. libname=`eval "\\$ECHO \"$libname_spec\""`
  7389. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  7390. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  7391. for potent_lib in $potential_libs; do
  7392. potlib="$potent_lib" # see symlink-check above in file_magic test
  7393. if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  7394. $EGREP "$match_pattern_regex" > /dev/null; then
  7395. newdeplibs+=" $a_deplib"
  7396. a_deplib=""
  7397. break 2
  7398. fi
  7399. done
  7400. done
  7401. fi
  7402. if test -n "$a_deplib" ; then
  7403. droppeddeps=yes
  7404. echo
  7405. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  7406. echo "*** I have the capability to make that library automatically link in when"
  7407. echo "*** you link to this library. But I can only do this if you have a"
  7408. echo "*** shared version of the library, which you do not appear to have"
  7409. echo "*** because I did check the linker path looking for a file starting"
  7410. if test -z "$potlib" ; then
  7411. $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  7412. else
  7413. $ECHO "*** with $libname and none of the candidates passed a file format test"
  7414. $ECHO "*** using a regex pattern. Last file checked: $potlib"
  7415. fi
  7416. fi
  7417. ;;
  7418. *)
  7419. # Add a -L argument.
  7420. newdeplibs+=" $a_deplib"
  7421. ;;
  7422. esac
  7423. done # Gone through all deplibs.
  7424. ;;
  7425. none | unknown | *)
  7426. newdeplibs=""
  7427. tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  7428. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  7429. for i in $predeps $postdeps ; do
  7430. # can't use Xsed below, because $i might contain '/'
  7431. tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
  7432. done
  7433. fi
  7434. case $tmp_deplibs in
  7435. *[!\ \ ]*)
  7436. echo
  7437. if test "X$deplibs_check_method" = "Xnone"; then
  7438. echo "*** Warning: inter-library dependencies are not supported in this platform."
  7439. else
  7440. echo "*** Warning: inter-library dependencies are not known to be supported."
  7441. fi
  7442. echo "*** All declared inter-library dependencies are being dropped."
  7443. droppeddeps=yes
  7444. ;;
  7445. esac
  7446. ;;
  7447. esac
  7448. versuffix=$versuffix_save
  7449. major=$major_save
  7450. release=$release_save
  7451. libname=$libname_save
  7452. name=$name_save
  7453. case $host in
  7454. *-*-rhapsody* | *-*-darwin1.[012])
  7455. # On Rhapsody replace the C library with the System framework
  7456. newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  7457. ;;
  7458. esac
  7459. if test "$droppeddeps" = yes; then
  7460. if test "$module" = yes; then
  7461. echo
  7462. echo "*** Warning: libtool could not satisfy all declared inter-library"
  7463. $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  7464. echo "*** a static module, that should work as long as the dlopening"
  7465. echo "*** application is linked with the -dlopen flag."
  7466. if test -z "$global_symbol_pipe"; then
  7467. echo
  7468. echo "*** However, this would only work if libtool was able to extract symbol"
  7469. echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  7470. echo "*** not find such a program. So, this module is probably useless."
  7471. echo "*** \`nm' from GNU binutils and a full rebuild may help."
  7472. fi
  7473. if test "$build_old_libs" = no; then
  7474. oldlibs="$output_objdir/$libname.$libext"
  7475. build_libtool_libs=module
  7476. build_old_libs=yes
  7477. else
  7478. build_libtool_libs=no
  7479. fi
  7480. else
  7481. echo "*** The inter-library dependencies that have been dropped here will be"
  7482. echo "*** automatically added whenever a program is linked with this library"
  7483. echo "*** or is declared to -dlopen it."
  7484. if test "$allow_undefined" = no; then
  7485. echo
  7486. echo "*** Since this library must not contain undefined symbols,"
  7487. echo "*** because either the platform does not support them or"
  7488. echo "*** it was explicitly requested with -no-undefined,"
  7489. echo "*** libtool will only create a static version of it."
  7490. if test "$build_old_libs" = no; then
  7491. oldlibs="$output_objdir/$libname.$libext"
  7492. build_libtool_libs=module
  7493. build_old_libs=yes
  7494. else
  7495. build_libtool_libs=no
  7496. fi
  7497. fi
  7498. fi
  7499. fi
  7500. # Done checking deplibs!
  7501. deplibs=$newdeplibs
  7502. fi
  7503. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  7504. case $host in
  7505. *-*-darwin*)
  7506. newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7507. new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7508. deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7509. ;;
  7510. esac
  7511. # move library search paths that coincide with paths to not yet
  7512. # installed libraries to the beginning of the library search list
  7513. new_libs=
  7514. for path in $notinst_path; do
  7515. case " $new_libs " in
  7516. *" -L$path/$objdir "*) ;;
  7517. *)
  7518. case " $deplibs " in
  7519. *" -L$path/$objdir "*)
  7520. new_libs+=" -L$path/$objdir" ;;
  7521. esac
  7522. ;;
  7523. esac
  7524. done
  7525. for deplib in $deplibs; do
  7526. case $deplib in
  7527. -L*)
  7528. case " $new_libs " in
  7529. *" $deplib "*) ;;
  7530. *) new_libs+=" $deplib" ;;
  7531. esac
  7532. ;;
  7533. *) new_libs+=" $deplib" ;;
  7534. esac
  7535. done
  7536. deplibs="$new_libs"
  7537. # All the library-specific variables (install_libdir is set above).
  7538. library_names=
  7539. old_library=
  7540. dlname=
  7541. # Test again, we may have decided not to build it any more
  7542. if test "$build_libtool_libs" = yes; then
  7543. # Remove ${wl} instances when linking with ld.
  7544. # FIXME: should test the right _cmds variable.
  7545. case $archive_cmds in
  7546. *\$LD\ *) wl= ;;
  7547. esac
  7548. if test "$hardcode_into_libs" = yes; then
  7549. # Hardcode the library paths
  7550. hardcode_libdirs=
  7551. dep_rpath=
  7552. rpath="$finalize_rpath"
  7553. test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
  7554. for libdir in $rpath; do
  7555. if test -n "$hardcode_libdir_flag_spec"; then
  7556. if test -n "$hardcode_libdir_separator"; then
  7557. func_replace_sysroot "$libdir"
  7558. libdir=$func_replace_sysroot_result
  7559. if test -z "$hardcode_libdirs"; then
  7560. hardcode_libdirs="$libdir"
  7561. else
  7562. # Just accumulate the unique libdirs.
  7563. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  7564. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  7565. ;;
  7566. *)
  7567. hardcode_libdirs+="$hardcode_libdir_separator$libdir"
  7568. ;;
  7569. esac
  7570. fi
  7571. else
  7572. eval flag=\"$hardcode_libdir_flag_spec\"
  7573. dep_rpath+=" $flag"
  7574. fi
  7575. elif test -n "$runpath_var"; then
  7576. case "$perm_rpath " in
  7577. *" $libdir "*) ;;
  7578. *) perm_rpath+=" $libdir" ;;
  7579. esac
  7580. fi
  7581. done
  7582. # Substitute the hardcoded libdirs into the rpath.
  7583. if test -n "$hardcode_libdir_separator" &&
  7584. test -n "$hardcode_libdirs"; then
  7585. libdir="$hardcode_libdirs"
  7586. eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
  7587. fi
  7588. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  7589. # We should set the runpath_var.
  7590. rpath=
  7591. for dir in $perm_rpath; do
  7592. rpath+="$dir:"
  7593. done
  7594. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  7595. fi
  7596. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  7597. fi
  7598. shlibpath="$finalize_shlibpath"
  7599. test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  7600. if test -n "$shlibpath"; then
  7601. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  7602. fi
  7603. # Get the real and link names of the library.
  7604. eval shared_ext=\"$shrext_cmds\"
  7605. eval library_names=\"$library_names_spec\"
  7606. set dummy $library_names
  7607. shift
  7608. realname="$1"
  7609. shift
  7610. if test -n "$soname_spec"; then
  7611. eval soname=\"$soname_spec\"
  7612. else
  7613. soname="$realname"
  7614. fi
  7615. if test -z "$dlname"; then
  7616. dlname=$soname
  7617. fi
  7618. lib="$output_objdir/$realname"
  7619. linknames=
  7620. for link
  7621. do
  7622. linknames+=" $link"
  7623. done
  7624. # Use standard objects if they are pic
  7625. test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  7626. test "X$libobjs" = "X " && libobjs=
  7627. delfiles=
  7628. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  7629. $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  7630. export_symbols="$output_objdir/$libname.uexp"
  7631. delfiles+=" $export_symbols"
  7632. fi
  7633. orig_export_symbols=
  7634. case $host_os in
  7635. cygwin* | mingw* | cegcc*)
  7636. if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  7637. # exporting using user supplied symfile
  7638. if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
  7639. # and it's NOT already a .def file. Must figure out
  7640. # which of the given symbols are data symbols and tag
  7641. # them as such. So, trigger use of export_symbols_cmds.
  7642. # export_symbols gets reassigned inside the "prepare
  7643. # the list of exported symbols" if statement, so the
  7644. # include_expsyms logic still works.
  7645. orig_export_symbols="$export_symbols"
  7646. export_symbols=
  7647. always_export_symbols=yes
  7648. fi
  7649. fi
  7650. ;;
  7651. esac
  7652. # Prepare the list of exported symbols
  7653. if test -z "$export_symbols"; then
  7654. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  7655. func_verbose "generating symbol list for \`$libname.la'"
  7656. export_symbols="$output_objdir/$libname.exp"
  7657. $opt_dry_run || $RM $export_symbols
  7658. cmds=$export_symbols_cmds
  7659. save_ifs="$IFS"; IFS='~'
  7660. for cmd1 in $cmds; do
  7661. IFS="$save_ifs"
  7662. # Take the normal branch if the nm_file_list_spec branch
  7663. # doesn't work or if tool conversion is not needed.
  7664. case $nm_file_list_spec~$to_tool_file_cmd in
  7665. *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
  7666. try_normal_branch=yes
  7667. eval cmd=\"$cmd1\"
  7668. func_len " $cmd"
  7669. len=$func_len_result
  7670. ;;
  7671. *)
  7672. try_normal_branch=no
  7673. ;;
  7674. esac
  7675. if test "$try_normal_branch" = yes \
  7676. && { test "$len" -lt "$max_cmd_len" \
  7677. || test "$max_cmd_len" -le -1; }
  7678. then
  7679. func_show_eval "$cmd" 'exit $?'
  7680. skipped_export=false
  7681. elif test -n "$nm_file_list_spec"; then
  7682. func_basename "$output"
  7683. output_la=$func_basename_result
  7684. save_libobjs=$libobjs
  7685. save_output=$output
  7686. output=${output_objdir}/${output_la}.nm
  7687. func_to_tool_file "$output"
  7688. libobjs=$nm_file_list_spec$func_to_tool_file_result
  7689. delfiles+=" $output"
  7690. func_verbose "creating $NM input file list: $output"
  7691. for obj in $save_libobjs; do
  7692. func_to_tool_file "$obj"
  7693. $ECHO "$func_to_tool_file_result"
  7694. done > "$output"
  7695. eval cmd=\"$cmd1\"
  7696. func_show_eval "$cmd" 'exit $?'
  7697. output=$save_output
  7698. libobjs=$save_libobjs
  7699. skipped_export=false
  7700. else
  7701. # The command line is too long to execute in one step.
  7702. func_verbose "using reloadable object file for export list..."
  7703. skipped_export=:
  7704. # Break out early, otherwise skipped_export may be
  7705. # set to false by a later but shorter cmd.
  7706. break
  7707. fi
  7708. done
  7709. IFS="$save_ifs"
  7710. if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
  7711. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  7712. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  7713. fi
  7714. fi
  7715. fi
  7716. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  7717. tmp_export_symbols="$export_symbols"
  7718. test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  7719. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  7720. fi
  7721. if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
  7722. # The given exports_symbols file has to be filtered, so filter it.
  7723. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  7724. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  7725. # 's' commands which not all seds can handle. GNU sed should be fine
  7726. # though. Also, the filter scales superlinearly with the number of
  7727. # global variables. join(1) would be nice here, but unfortunately
  7728. # isn't a blessed tool.
  7729. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  7730. delfiles+=" $export_symbols $output_objdir/$libname.filter"
  7731. export_symbols=$output_objdir/$libname.def
  7732. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  7733. fi
  7734. tmp_deplibs=
  7735. for test_deplib in $deplibs; do
  7736. case " $convenience " in
  7737. *" $test_deplib "*) ;;
  7738. *)
  7739. tmp_deplibs+=" $test_deplib"
  7740. ;;
  7741. esac
  7742. done
  7743. deplibs="$tmp_deplibs"
  7744. if test -n "$convenience"; then
  7745. if test -n "$whole_archive_flag_spec" &&
  7746. test "$compiler_needs_object" = yes &&
  7747. test -z "$libobjs"; then
  7748. # extract the archives, so we have objects to list.
  7749. # TODO: could optimize this to just extract one archive.
  7750. whole_archive_flag_spec=
  7751. fi
  7752. if test -n "$whole_archive_flag_spec"; then
  7753. save_libobjs=$libobjs
  7754. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  7755. test "X$libobjs" = "X " && libobjs=
  7756. else
  7757. gentop="$output_objdir/${outputname}x"
  7758. generated+=" $gentop"
  7759. func_extract_archives $gentop $convenience
  7760. libobjs+=" $func_extract_archives_result"
  7761. test "X$libobjs" = "X " && libobjs=
  7762. fi
  7763. fi
  7764. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  7765. eval flag=\"$thread_safe_flag_spec\"
  7766. linker_flags+=" $flag"
  7767. fi
  7768. # Make a backup of the uninstalled library when relinking
  7769. if test "$opt_mode" = relink; then
  7770. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  7771. fi
  7772. # Do each of the archive commands.
  7773. if test "$module" = yes && test -n "$module_cmds" ; then
  7774. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  7775. eval test_cmds=\"$module_expsym_cmds\"
  7776. cmds=$module_expsym_cmds
  7777. else
  7778. eval test_cmds=\"$module_cmds\"
  7779. cmds=$module_cmds
  7780. fi
  7781. else
  7782. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  7783. eval test_cmds=\"$archive_expsym_cmds\"
  7784. cmds=$archive_expsym_cmds
  7785. else
  7786. eval test_cmds=\"$archive_cmds\"
  7787. cmds=$archive_cmds
  7788. fi
  7789. fi
  7790. if test "X$skipped_export" != "X:" &&
  7791. func_len " $test_cmds" &&
  7792. len=$func_len_result &&
  7793. test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  7794. :
  7795. else
  7796. # The command line is too long to link in one step, link piecewise
  7797. # or, if using GNU ld and skipped_export is not :, use a linker
  7798. # script.
  7799. # Save the value of $output and $libobjs because we want to
  7800. # use them later. If we have whole_archive_flag_spec, we
  7801. # want to use save_libobjs as it was before
  7802. # whole_archive_flag_spec was expanded, because we can't
  7803. # assume the linker understands whole_archive_flag_spec.
  7804. # This may have to be revisited, in case too many
  7805. # convenience libraries get linked in and end up exceeding
  7806. # the spec.
  7807. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  7808. save_libobjs=$libobjs
  7809. fi
  7810. save_output=$output
  7811. func_basename "$output"
  7812. output_la=$func_basename_result
  7813. # Clear the reloadable object creation command queue and
  7814. # initialize k to one.
  7815. test_cmds=
  7816. concat_cmds=
  7817. objlist=
  7818. last_robj=
  7819. k=1
  7820. if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
  7821. output=${output_objdir}/${output_la}.lnkscript
  7822. func_verbose "creating GNU ld script: $output"
  7823. echo 'INPUT (' > $output
  7824. for obj in $save_libobjs
  7825. do
  7826. func_to_tool_file "$obj"
  7827. $ECHO "$func_to_tool_file_result" >> $output
  7828. done
  7829. echo ')' >> $output
  7830. delfiles+=" $output"
  7831. func_to_tool_file "$output"
  7832. output=$func_to_tool_file_result
  7833. elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
  7834. output=${output_objdir}/${output_la}.lnk
  7835. func_verbose "creating linker input file list: $output"
  7836. : > $output
  7837. set x $save_libobjs
  7838. shift
  7839. firstobj=
  7840. if test "$compiler_needs_object" = yes; then
  7841. firstobj="$1 "
  7842. shift
  7843. fi
  7844. for obj
  7845. do
  7846. func_to_tool_file "$obj"
  7847. $ECHO "$func_to_tool_file_result" >> $output
  7848. done
  7849. delfiles+=" $output"
  7850. func_to_tool_file "$output"
  7851. output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
  7852. else
  7853. if test -n "$save_libobjs"; then
  7854. func_verbose "creating reloadable object files..."
  7855. output=$output_objdir/$output_la-${k}.$objext
  7856. eval test_cmds=\"$reload_cmds\"
  7857. func_len " $test_cmds"
  7858. len0=$func_len_result
  7859. len=$len0
  7860. # Loop over the list of objects to be linked.
  7861. for obj in $save_libobjs
  7862. do
  7863. func_len " $obj"
  7864. func_arith $len + $func_len_result
  7865. len=$func_arith_result
  7866. if test "X$objlist" = X ||
  7867. test "$len" -lt "$max_cmd_len"; then
  7868. objlist+=" $obj"
  7869. else
  7870. # The command $test_cmds is almost too long, add a
  7871. # command to the queue.
  7872. if test "$k" -eq 1 ; then
  7873. # The first file doesn't have a previous command to add.
  7874. reload_objs=$objlist
  7875. eval concat_cmds=\"$reload_cmds\"
  7876. else
  7877. # All subsequent reloadable object files will link in
  7878. # the last one created.
  7879. reload_objs="$objlist $last_robj"
  7880. eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
  7881. fi
  7882. last_robj=$output_objdir/$output_la-${k}.$objext
  7883. func_arith $k + 1
  7884. k=$func_arith_result
  7885. output=$output_objdir/$output_la-${k}.$objext
  7886. objlist=" $obj"
  7887. func_len " $last_robj"
  7888. func_arith $len0 + $func_len_result
  7889. len=$func_arith_result
  7890. fi
  7891. done
  7892. # Handle the remaining objects by creating one last
  7893. # reloadable object file. All subsequent reloadable object
  7894. # files will link in the last one created.
  7895. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  7896. reload_objs="$objlist $last_robj"
  7897. eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
  7898. if test -n "$last_robj"; then
  7899. eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
  7900. fi
  7901. delfiles+=" $output"
  7902. else
  7903. output=
  7904. fi
  7905. if ${skipped_export-false}; then
  7906. func_verbose "generating symbol list for \`$libname.la'"
  7907. export_symbols="$output_objdir/$libname.exp"
  7908. $opt_dry_run || $RM $export_symbols
  7909. libobjs=$output
  7910. # Append the command to create the export file.
  7911. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  7912. eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  7913. if test -n "$last_robj"; then
  7914. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  7915. fi
  7916. fi
  7917. test -n "$save_libobjs" &&
  7918. func_verbose "creating a temporary reloadable object file: $output"
  7919. # Loop through the commands generated above and execute them.
  7920. save_ifs="$IFS"; IFS='~'
  7921. for cmd in $concat_cmds; do
  7922. IFS="$save_ifs"
  7923. $opt_silent || {
  7924. func_quote_for_expand "$cmd"
  7925. eval "func_echo $func_quote_for_expand_result"
  7926. }
  7927. $opt_dry_run || eval "$cmd" || {
  7928. lt_exit=$?
  7929. # Restore the uninstalled library and exit
  7930. if test "$opt_mode" = relink; then
  7931. ( cd "$output_objdir" && \
  7932. $RM "${realname}T" && \
  7933. $MV "${realname}U" "$realname" )
  7934. fi
  7935. exit $lt_exit
  7936. }
  7937. done
  7938. IFS="$save_ifs"
  7939. if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  7940. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  7941. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  7942. fi
  7943. fi
  7944. if ${skipped_export-false}; then
  7945. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  7946. tmp_export_symbols="$export_symbols"
  7947. test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  7948. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  7949. fi
  7950. if test -n "$orig_export_symbols"; then
  7951. # The given exports_symbols file has to be filtered, so filter it.
  7952. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  7953. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  7954. # 's' commands which not all seds can handle. GNU sed should be fine
  7955. # though. Also, the filter scales superlinearly with the number of
  7956. # global variables. join(1) would be nice here, but unfortunately
  7957. # isn't a blessed tool.
  7958. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  7959. delfiles+=" $export_symbols $output_objdir/$libname.filter"
  7960. export_symbols=$output_objdir/$libname.def
  7961. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  7962. fi
  7963. fi
  7964. libobjs=$output
  7965. # Restore the value of output.
  7966. output=$save_output
  7967. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  7968. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  7969. test "X$libobjs" = "X " && libobjs=
  7970. fi
  7971. # Expand the library linking commands again to reset the
  7972. # value of $libobjs for piecewise linking.
  7973. # Do each of the archive commands.
  7974. if test "$module" = yes && test -n "$module_cmds" ; then
  7975. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  7976. cmds=$module_expsym_cmds
  7977. else
  7978. cmds=$module_cmds
  7979. fi
  7980. else
  7981. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  7982. cmds=$archive_expsym_cmds
  7983. else
  7984. cmds=$archive_cmds
  7985. fi
  7986. fi
  7987. fi
  7988. if test -n "$delfiles"; then
  7989. # Append the command to remove temporary files to $cmds.
  7990. eval cmds=\"\$cmds~\$RM $delfiles\"
  7991. fi
  7992. # Add any objects from preloaded convenience libraries
  7993. if test -n "$dlprefiles"; then
  7994. gentop="$output_objdir/${outputname}x"
  7995. generated+=" $gentop"
  7996. func_extract_archives $gentop $dlprefiles
  7997. libobjs+=" $func_extract_archives_result"
  7998. test "X$libobjs" = "X " && libobjs=
  7999. fi
  8000. save_ifs="$IFS"; IFS='~'
  8001. for cmd in $cmds; do
  8002. IFS="$save_ifs"
  8003. eval cmd=\"$cmd\"
  8004. $opt_silent || {
  8005. func_quote_for_expand "$cmd"
  8006. eval "func_echo $func_quote_for_expand_result"
  8007. }
  8008. $opt_dry_run || eval "$cmd" || {
  8009. lt_exit=$?
  8010. # Restore the uninstalled library and exit
  8011. if test "$opt_mode" = relink; then
  8012. ( cd "$output_objdir" && \
  8013. $RM "${realname}T" && \
  8014. $MV "${realname}U" "$realname" )
  8015. fi
  8016. exit $lt_exit
  8017. }
  8018. done
  8019. IFS="$save_ifs"
  8020. # Restore the uninstalled library and exit
  8021. if test "$opt_mode" = relink; then
  8022. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  8023. if test -n "$convenience"; then
  8024. if test -z "$whole_archive_flag_spec"; then
  8025. func_show_eval '${RM}r "$gentop"'
  8026. fi
  8027. fi
  8028. exit $EXIT_SUCCESS
  8029. fi
  8030. # Create links to the real library.
  8031. for linkname in $linknames; do
  8032. if test "$realname" != "$linkname"; then
  8033. func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  8034. fi
  8035. done
  8036. # If -module or -export-dynamic was specified, set the dlname.
  8037. if test "$module" = yes || test "$export_dynamic" = yes; then
  8038. # On all known operating systems, these are identical.
  8039. dlname="$soname"
  8040. fi
  8041. fi
  8042. ;;
  8043. obj)
  8044. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  8045. func_warning "\`-dlopen' is ignored for objects"
  8046. fi
  8047. case " $deplibs" in
  8048. *\ -l* | *\ -L*)
  8049. func_warning "\`-l' and \`-L' are ignored for objects" ;;
  8050. esac
  8051. test -n "$rpath" && \
  8052. func_warning "\`-rpath' is ignored for objects"
  8053. test -n "$xrpath" && \
  8054. func_warning "\`-R' is ignored for objects"
  8055. test -n "$vinfo" && \
  8056. func_warning "\`-version-info' is ignored for objects"
  8057. test -n "$release" && \
  8058. func_warning "\`-release' is ignored for objects"
  8059. case $output in
  8060. *.lo)
  8061. test -n "$objs$old_deplibs" && \
  8062. func_fatal_error "cannot build library object \`$output' from non-libtool objects"
  8063. libobj=$output
  8064. func_lo2o "$libobj"
  8065. obj=$func_lo2o_result
  8066. ;;
  8067. *)
  8068. libobj=
  8069. obj="$output"
  8070. ;;
  8071. esac
  8072. # Delete the old objects.
  8073. $opt_dry_run || $RM $obj $libobj
  8074. # Objects from convenience libraries. This assumes
  8075. # single-version convenience libraries. Whenever we create
  8076. # different ones for PIC/non-PIC, this we'll have to duplicate
  8077. # the extraction.
  8078. reload_conv_objs=
  8079. gentop=
  8080. # reload_cmds runs $LD directly, so let us get rid of
  8081. # -Wl from whole_archive_flag_spec and hope we can get by with
  8082. # turning comma into space..
  8083. wl=
  8084. if test -n "$convenience"; then
  8085. if test -n "$whole_archive_flag_spec"; then
  8086. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  8087. reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
  8088. else
  8089. gentop="$output_objdir/${obj}x"
  8090. generated+=" $gentop"
  8091. func_extract_archives $gentop $convenience
  8092. reload_conv_objs="$reload_objs $func_extract_archives_result"
  8093. fi
  8094. fi
  8095. # If we're not building shared, we need to use non_pic_objs
  8096. test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
  8097. # Create the old-style object.
  8098. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  8099. output="$obj"
  8100. func_execute_cmds "$reload_cmds" 'exit $?'
  8101. # Exit if we aren't doing a library object file.
  8102. if test -z "$libobj"; then
  8103. if test -n "$gentop"; then
  8104. func_show_eval '${RM}r "$gentop"'
  8105. fi
  8106. exit $EXIT_SUCCESS
  8107. fi
  8108. if test "$build_libtool_libs" != yes; then
  8109. if test -n "$gentop"; then
  8110. func_show_eval '${RM}r "$gentop"'
  8111. fi
  8112. # Create an invalid libtool object if no PIC, so that we don't
  8113. # accidentally link it into a program.
  8114. # $show "echo timestamp > $libobj"
  8115. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  8116. exit $EXIT_SUCCESS
  8117. fi
  8118. if test -n "$pic_flag" || test "$pic_mode" != default; then
  8119. # Only do commands if we really have different PIC objects.
  8120. reload_objs="$libobjs $reload_conv_objs"
  8121. output="$libobj"
  8122. func_execute_cmds "$reload_cmds" 'exit $?'
  8123. fi
  8124. if test -n "$gentop"; then
  8125. func_show_eval '${RM}r "$gentop"'
  8126. fi
  8127. exit $EXIT_SUCCESS
  8128. ;;
  8129. prog)
  8130. case $host in
  8131. *cygwin*) func_stripname '' '.exe' "$output"
  8132. output=$func_stripname_result.exe;;
  8133. esac
  8134. test -n "$vinfo" && \
  8135. func_warning "\`-version-info' is ignored for programs"
  8136. test -n "$release" && \
  8137. func_warning "\`-release' is ignored for programs"
  8138. test "$preload" = yes \
  8139. && test "$dlopen_support" = unknown \
  8140. && test "$dlopen_self" = unknown \
  8141. && test "$dlopen_self_static" = unknown && \
  8142. func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
  8143. case $host in
  8144. *-*-rhapsody* | *-*-darwin1.[012])
  8145. # On Rhapsody replace the C library is the System framework
  8146. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
  8147. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
  8148. ;;
  8149. esac
  8150. case $host in
  8151. *-*-darwin*)
  8152. # Don't allow lazy linking, it breaks C++ global constructors
  8153. # But is supposedly fixed on 10.4 or later (yay!).
  8154. if test "$tagname" = CXX ; then
  8155. case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  8156. 10.[0123])
  8157. compile_command+=" ${wl}-bind_at_load"
  8158. finalize_command+=" ${wl}-bind_at_load"
  8159. ;;
  8160. esac
  8161. fi
  8162. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  8163. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8164. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8165. ;;
  8166. esac
  8167. # move library search paths that coincide with paths to not yet
  8168. # installed libraries to the beginning of the library search list
  8169. new_libs=
  8170. for path in $notinst_path; do
  8171. case " $new_libs " in
  8172. *" -L$path/$objdir "*) ;;
  8173. *)
  8174. case " $compile_deplibs " in
  8175. *" -L$path/$objdir "*)
  8176. new_libs+=" -L$path/$objdir" ;;
  8177. esac
  8178. ;;
  8179. esac
  8180. done
  8181. for deplib in $compile_deplibs; do
  8182. case $deplib in
  8183. -L*)
  8184. case " $new_libs " in
  8185. *" $deplib "*) ;;
  8186. *) new_libs+=" $deplib" ;;
  8187. esac
  8188. ;;
  8189. *) new_libs+=" $deplib" ;;
  8190. esac
  8191. done
  8192. compile_deplibs="$new_libs"
  8193. compile_command+=" $compile_deplibs"
  8194. finalize_command+=" $finalize_deplibs"
  8195. if test -n "$rpath$xrpath"; then
  8196. # If the user specified any rpath flags, then add them.
  8197. for libdir in $rpath $xrpath; do
  8198. # This is the magic to use -rpath.
  8199. case "$finalize_rpath " in
  8200. *" $libdir "*) ;;
  8201. *) finalize_rpath+=" $libdir" ;;
  8202. esac
  8203. done
  8204. fi
  8205. # Now hardcode the library paths
  8206. rpath=
  8207. hardcode_libdirs=
  8208. for libdir in $compile_rpath $finalize_rpath; do
  8209. if test -n "$hardcode_libdir_flag_spec"; then
  8210. if test -n "$hardcode_libdir_separator"; then
  8211. if test -z "$hardcode_libdirs"; then
  8212. hardcode_libdirs="$libdir"
  8213. else
  8214. # Just accumulate the unique libdirs.
  8215. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  8216. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  8217. ;;
  8218. *)
  8219. hardcode_libdirs+="$hardcode_libdir_separator$libdir"
  8220. ;;
  8221. esac
  8222. fi
  8223. else
  8224. eval flag=\"$hardcode_libdir_flag_spec\"
  8225. rpath+=" $flag"
  8226. fi
  8227. elif test -n "$runpath_var"; then
  8228. case "$perm_rpath " in
  8229. *" $libdir "*) ;;
  8230. *) perm_rpath+=" $libdir" ;;
  8231. esac
  8232. fi
  8233. case $host in
  8234. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  8235. testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
  8236. case :$dllsearchpath: in
  8237. *":$libdir:"*) ;;
  8238. ::) dllsearchpath=$libdir;;
  8239. *) dllsearchpath+=":$libdir";;
  8240. esac
  8241. case :$dllsearchpath: in
  8242. *":$testbindir:"*) ;;
  8243. ::) dllsearchpath=$testbindir;;
  8244. *) dllsearchpath+=":$testbindir";;
  8245. esac
  8246. ;;
  8247. esac
  8248. done
  8249. # Substitute the hardcoded libdirs into the rpath.
  8250. if test -n "$hardcode_libdir_separator" &&
  8251. test -n "$hardcode_libdirs"; then
  8252. libdir="$hardcode_libdirs"
  8253. eval rpath=\" $hardcode_libdir_flag_spec\"
  8254. fi
  8255. compile_rpath="$rpath"
  8256. rpath=
  8257. hardcode_libdirs=
  8258. for libdir in $finalize_rpath; do
  8259. if test -n "$hardcode_libdir_flag_spec"; then
  8260. if test -n "$hardcode_libdir_separator"; then
  8261. if test -z "$hardcode_libdirs"; then
  8262. hardcode_libdirs="$libdir"
  8263. else
  8264. # Just accumulate the unique libdirs.
  8265. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  8266. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  8267. ;;
  8268. *)
  8269. hardcode_libdirs+="$hardcode_libdir_separator$libdir"
  8270. ;;
  8271. esac
  8272. fi
  8273. else
  8274. eval flag=\"$hardcode_libdir_flag_spec\"
  8275. rpath+=" $flag"
  8276. fi
  8277. elif test -n "$runpath_var"; then
  8278. case "$finalize_perm_rpath " in
  8279. *" $libdir "*) ;;
  8280. *) finalize_perm_rpath+=" $libdir" ;;
  8281. esac
  8282. fi
  8283. done
  8284. # Substitute the hardcoded libdirs into the rpath.
  8285. if test -n "$hardcode_libdir_separator" &&
  8286. test -n "$hardcode_libdirs"; then
  8287. libdir="$hardcode_libdirs"
  8288. eval rpath=\" $hardcode_libdir_flag_spec\"
  8289. fi
  8290. finalize_rpath="$rpath"
  8291. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  8292. # Transform all the library objects into standard objects.
  8293. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  8294. finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  8295. fi
  8296. func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
  8297. # template prelinking step
  8298. if test -n "$prelink_cmds"; then
  8299. func_execute_cmds "$prelink_cmds" 'exit $?'
  8300. fi
  8301. wrappers_required=yes
  8302. case $host in
  8303. *cegcc* | *mingw32ce*)
  8304. # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
  8305. wrappers_required=no
  8306. ;;
  8307. *cygwin* | *mingw* )
  8308. if test "$build_libtool_libs" != yes; then
  8309. wrappers_required=no
  8310. fi
  8311. ;;
  8312. *)
  8313. if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  8314. wrappers_required=no
  8315. fi
  8316. ;;
  8317. esac
  8318. if test "$wrappers_required" = no; then
  8319. # Replace the output file specification.
  8320. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  8321. link_command="$compile_command$compile_rpath"
  8322. # We have no uninstalled library dependencies, so finalize right now.
  8323. exit_status=0
  8324. func_show_eval "$link_command" 'exit_status=$?'
  8325. if test -n "$postlink_cmds"; then
  8326. func_to_tool_file "$output"
  8327. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  8328. func_execute_cmds "$postlink_cmds" 'exit $?'
  8329. fi
  8330. # Delete the generated files.
  8331. if test -f "$output_objdir/${outputname}S.${objext}"; then
  8332. func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
  8333. fi
  8334. exit $exit_status
  8335. fi
  8336. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  8337. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  8338. fi
  8339. if test -n "$finalize_shlibpath"; then
  8340. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  8341. fi
  8342. compile_var=
  8343. finalize_var=
  8344. if test -n "$runpath_var"; then
  8345. if test -n "$perm_rpath"; then
  8346. # We should set the runpath_var.
  8347. rpath=
  8348. for dir in $perm_rpath; do
  8349. rpath+="$dir:"
  8350. done
  8351. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  8352. fi
  8353. if test -n "$finalize_perm_rpath"; then
  8354. # We should set the runpath_var.
  8355. rpath=
  8356. for dir in $finalize_perm_rpath; do
  8357. rpath+="$dir:"
  8358. done
  8359. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  8360. fi
  8361. fi
  8362. if test "$no_install" = yes; then
  8363. # We don't need to create a wrapper script.
  8364. link_command="$compile_var$compile_command$compile_rpath"
  8365. # Replace the output file specification.
  8366. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  8367. # Delete the old output file.
  8368. $opt_dry_run || $RM $output
  8369. # Link the executable and exit
  8370. func_show_eval "$link_command" 'exit $?'
  8371. if test -n "$postlink_cmds"; then
  8372. func_to_tool_file "$output"
  8373. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  8374. func_execute_cmds "$postlink_cmds" 'exit $?'
  8375. fi
  8376. exit $EXIT_SUCCESS
  8377. fi
  8378. if test "$hardcode_action" = relink; then
  8379. # Fast installation is not supported
  8380. link_command="$compile_var$compile_command$compile_rpath"
  8381. relink_command="$finalize_var$finalize_command$finalize_rpath"
  8382. func_warning "this platform does not like uninstalled shared libraries"
  8383. func_warning "\`$output' will be relinked during installation"
  8384. else
  8385. if test "$fast_install" != no; then
  8386. link_command="$finalize_var$compile_command$finalize_rpath"
  8387. if test "$fast_install" = yes; then
  8388. relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
  8389. else
  8390. # fast_install is set to needless
  8391. relink_command=
  8392. fi
  8393. else
  8394. link_command="$compile_var$compile_command$compile_rpath"
  8395. relink_command="$finalize_var$finalize_command$finalize_rpath"
  8396. fi
  8397. fi
  8398. # Replace the output file specification.
  8399. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  8400. # Delete the old output files.
  8401. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  8402. func_show_eval "$link_command" 'exit $?'
  8403. if test -n "$postlink_cmds"; then
  8404. func_to_tool_file "$output_objdir/$outputname"
  8405. 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'`
  8406. func_execute_cmds "$postlink_cmds" 'exit $?'
  8407. fi
  8408. # Now create the wrapper script.
  8409. func_verbose "creating $output"
  8410. # Quote the relink command for shipping.
  8411. if test -n "$relink_command"; then
  8412. # Preserve any variables that may affect compiler behavior
  8413. for var in $variables_saved_for_relink; do
  8414. if eval test -z \"\${$var+set}\"; then
  8415. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  8416. elif eval var_value=\$$var; test -z "$var_value"; then
  8417. relink_command="$var=; export $var; $relink_command"
  8418. else
  8419. func_quote_for_eval "$var_value"
  8420. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  8421. fi
  8422. done
  8423. relink_command="(cd `pwd`; $relink_command)"
  8424. relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  8425. fi
  8426. # Only actually do things if not in dry run mode.
  8427. $opt_dry_run || {
  8428. # win32 will think the script is a binary if it has
  8429. # a .exe suffix, so we strip it off here.
  8430. case $output in
  8431. *.exe) func_stripname '' '.exe' "$output"
  8432. output=$func_stripname_result ;;
  8433. esac
  8434. # test for cygwin because mv fails w/o .exe extensions
  8435. case $host in
  8436. *cygwin*)
  8437. exeext=.exe
  8438. func_stripname '' '.exe' "$outputname"
  8439. outputname=$func_stripname_result ;;
  8440. *) exeext= ;;
  8441. esac
  8442. case $host in
  8443. *cygwin* | *mingw* )
  8444. func_dirname_and_basename "$output" "" "."
  8445. output_name=$func_basename_result
  8446. output_path=$func_dirname_result
  8447. cwrappersource="$output_path/$objdir/lt-$output_name.c"
  8448. cwrapper="$output_path/$output_name.exe"
  8449. $RM $cwrappersource $cwrapper
  8450. trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  8451. func_emit_cwrapperexe_src > $cwrappersource
  8452. # The wrapper executable is built using the $host compiler,
  8453. # because it contains $host paths and files. If cross-
  8454. # compiling, it, like the target executable, must be
  8455. # executed on the $host or under an emulation environment.
  8456. $opt_dry_run || {
  8457. $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  8458. $STRIP $cwrapper
  8459. }
  8460. # Now, create the wrapper script for func_source use:
  8461. func_ltwrapper_scriptname $cwrapper
  8462. $RM $func_ltwrapper_scriptname_result
  8463. trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  8464. $opt_dry_run || {
  8465. # note: this script will not be executed, so do not chmod.
  8466. if test "x$build" = "x$host" ; then
  8467. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  8468. else
  8469. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  8470. fi
  8471. }
  8472. ;;
  8473. * )
  8474. $RM $output
  8475. trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  8476. func_emit_wrapper no > $output
  8477. chmod +x $output
  8478. ;;
  8479. esac
  8480. }
  8481. exit $EXIT_SUCCESS
  8482. ;;
  8483. esac
  8484. # See if we need to build an old-fashioned archive.
  8485. for oldlib in $oldlibs; do
  8486. if test "$build_libtool_libs" = convenience; then
  8487. oldobjs="$libobjs_save $symfileobj"
  8488. addlibs="$convenience"
  8489. build_libtool_libs=no
  8490. else
  8491. if test "$build_libtool_libs" = module; then
  8492. oldobjs="$libobjs_save"
  8493. build_libtool_libs=no
  8494. else
  8495. oldobjs="$old_deplibs $non_pic_objects"
  8496. if test "$preload" = yes && test -f "$symfileobj"; then
  8497. oldobjs+=" $symfileobj"
  8498. fi
  8499. fi
  8500. addlibs="$old_convenience"
  8501. fi
  8502. if test -n "$addlibs"; then
  8503. gentop="$output_objdir/${outputname}x"
  8504. generated+=" $gentop"
  8505. func_extract_archives $gentop $addlibs
  8506. oldobjs+=" $func_extract_archives_result"
  8507. fi
  8508. # Do each command in the archive commands.
  8509. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  8510. cmds=$old_archive_from_new_cmds
  8511. else
  8512. # Add any objects from preloaded convenience libraries
  8513. if test -n "$dlprefiles"; then
  8514. gentop="$output_objdir/${outputname}x"
  8515. generated+=" $gentop"
  8516. func_extract_archives $gentop $dlprefiles
  8517. oldobjs+=" $func_extract_archives_result"
  8518. fi
  8519. # POSIX demands no paths to be encoded in archives. We have
  8520. # to avoid creating archives with duplicate basenames if we
  8521. # might have to extract them afterwards, e.g., when creating a
  8522. # static archive out of a convenience library, or when linking
  8523. # the entirety of a libtool archive into another (currently
  8524. # not supported by libtool).
  8525. if (for obj in $oldobjs
  8526. do
  8527. func_basename "$obj"
  8528. $ECHO "$func_basename_result"
  8529. done | sort | sort -uc >/dev/null 2>&1); then
  8530. :
  8531. else
  8532. echo "copying selected object files to avoid basename conflicts..."
  8533. gentop="$output_objdir/${outputname}x"
  8534. generated+=" $gentop"
  8535. func_mkdir_p "$gentop"
  8536. save_oldobjs=$oldobjs
  8537. oldobjs=
  8538. counter=1
  8539. for obj in $save_oldobjs
  8540. do
  8541. func_basename "$obj"
  8542. objbase="$func_basename_result"
  8543. case " $oldobjs " in
  8544. " ") oldobjs=$obj ;;
  8545. *[\ /]"$objbase "*)
  8546. while :; do
  8547. # Make sure we don't pick an alternate name that also
  8548. # overlaps.
  8549. newobj=lt$counter-$objbase
  8550. func_arith $counter + 1
  8551. counter=$func_arith_result
  8552. case " $oldobjs " in
  8553. *[\ /]"$newobj "*) ;;
  8554. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  8555. esac
  8556. done
  8557. func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  8558. oldobjs+=" $gentop/$newobj"
  8559. ;;
  8560. *) oldobjs+=" $obj" ;;
  8561. esac
  8562. done
  8563. fi
  8564. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  8565. tool_oldlib=$func_to_tool_file_result
  8566. eval cmds=\"$old_archive_cmds\"
  8567. func_len " $cmds"
  8568. len=$func_len_result
  8569. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  8570. cmds=$old_archive_cmds
  8571. elif test -n "$archiver_list_spec"; then
  8572. func_verbose "using command file archive linking..."
  8573. for obj in $oldobjs
  8574. do
  8575. func_to_tool_file "$obj"
  8576. $ECHO "$func_to_tool_file_result"
  8577. done > $output_objdir/$libname.libcmd
  8578. func_to_tool_file "$output_objdir/$libname.libcmd"
  8579. oldobjs=" $archiver_list_spec$func_to_tool_file_result"
  8580. cmds=$old_archive_cmds
  8581. else
  8582. # the command line is too long to link in one step, link in parts
  8583. func_verbose "using piecewise archive linking..."
  8584. save_RANLIB=$RANLIB
  8585. RANLIB=:
  8586. objlist=
  8587. concat_cmds=
  8588. save_oldobjs=$oldobjs
  8589. oldobjs=
  8590. # Is there a better way of finding the last object in the list?
  8591. for obj in $save_oldobjs
  8592. do
  8593. last_oldobj=$obj
  8594. done
  8595. eval test_cmds=\"$old_archive_cmds\"
  8596. func_len " $test_cmds"
  8597. len0=$func_len_result
  8598. len=$len0
  8599. for obj in $save_oldobjs
  8600. do
  8601. func_len " $obj"
  8602. func_arith $len + $func_len_result
  8603. len=$func_arith_result
  8604. objlist+=" $obj"
  8605. if test "$len" -lt "$max_cmd_len"; then
  8606. :
  8607. else
  8608. # the above command should be used before it gets too long
  8609. oldobjs=$objlist
  8610. if test "$obj" = "$last_oldobj" ; then
  8611. RANLIB=$save_RANLIB
  8612. fi
  8613. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  8614. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  8615. objlist=
  8616. len=$len0
  8617. fi
  8618. done
  8619. RANLIB=$save_RANLIB
  8620. oldobjs=$objlist
  8621. if test "X$oldobjs" = "X" ; then
  8622. eval cmds=\"\$concat_cmds\"
  8623. else
  8624. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  8625. fi
  8626. fi
  8627. fi
  8628. func_execute_cmds "$cmds" 'exit $?'
  8629. done
  8630. test -n "$generated" && \
  8631. func_show_eval "${RM}r$generated"
  8632. # Now create the libtool archive.
  8633. case $output in
  8634. *.la)
  8635. old_library=
  8636. test "$build_old_libs" = yes && old_library="$libname.$libext"
  8637. func_verbose "creating $output"
  8638. # Preserve any variables that may affect compiler behavior
  8639. for var in $variables_saved_for_relink; do
  8640. if eval test -z \"\${$var+set}\"; then
  8641. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  8642. elif eval var_value=\$$var; test -z "$var_value"; then
  8643. relink_command="$var=; export $var; $relink_command"
  8644. else
  8645. func_quote_for_eval "$var_value"
  8646. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  8647. fi
  8648. done
  8649. # Quote the link command for shipping.
  8650. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  8651. relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  8652. if test "$hardcode_automatic" = yes ; then
  8653. relink_command=
  8654. fi
  8655. # Only create the output if not a dry run.
  8656. $opt_dry_run || {
  8657. for installed in no yes; do
  8658. if test "$installed" = yes; then
  8659. if test -z "$install_libdir"; then
  8660. break
  8661. fi
  8662. output="$output_objdir/$outputname"i
  8663. # Replace all uninstalled libtool libraries with the installed ones
  8664. newdependency_libs=
  8665. for deplib in $dependency_libs; do
  8666. case $deplib in
  8667. *.la)
  8668. func_basename "$deplib"
  8669. name="$func_basename_result"
  8670. func_resolve_sysroot "$deplib"
  8671. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
  8672. test -z "$libdir" && \
  8673. func_fatal_error "\`$deplib' is not a valid libtool archive"
  8674. newdependency_libs+=" ${lt_sysroot:+=}$libdir/$name"
  8675. ;;
  8676. -L*)
  8677. func_stripname -L '' "$deplib"
  8678. func_replace_sysroot "$func_stripname_result"
  8679. newdependency_libs+=" -L$func_replace_sysroot_result"
  8680. ;;
  8681. -R*)
  8682. func_stripname -R '' "$deplib"
  8683. func_replace_sysroot "$func_stripname_result"
  8684. newdependency_libs+=" -R$func_replace_sysroot_result"
  8685. ;;
  8686. *) newdependency_libs+=" $deplib" ;;
  8687. esac
  8688. done
  8689. dependency_libs="$newdependency_libs"
  8690. newdlfiles=
  8691. for lib in $dlfiles; do
  8692. case $lib in
  8693. *.la)
  8694. func_basename "$lib"
  8695. name="$func_basename_result"
  8696. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  8697. test -z "$libdir" && \
  8698. func_fatal_error "\`$lib' is not a valid libtool archive"
  8699. newdlfiles+=" ${lt_sysroot:+=}$libdir/$name"
  8700. ;;
  8701. *) newdlfiles+=" $lib" ;;
  8702. esac
  8703. done
  8704. dlfiles="$newdlfiles"
  8705. newdlprefiles=
  8706. for lib in $dlprefiles; do
  8707. case $lib in
  8708. *.la)
  8709. # Only pass preopened files to the pseudo-archive (for
  8710. # eventual linking with the app. that links it) if we
  8711. # didn't already link the preopened objects directly into
  8712. # the library:
  8713. func_basename "$lib"
  8714. name="$func_basename_result"
  8715. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  8716. test -z "$libdir" && \
  8717. func_fatal_error "\`$lib' is not a valid libtool archive"
  8718. newdlprefiles+=" ${lt_sysroot:+=}$libdir/$name"
  8719. ;;
  8720. esac
  8721. done
  8722. dlprefiles="$newdlprefiles"
  8723. else
  8724. newdlfiles=
  8725. for lib in $dlfiles; do
  8726. case $lib in
  8727. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  8728. *) abs=`pwd`"/$lib" ;;
  8729. esac
  8730. newdlfiles+=" $abs"
  8731. done
  8732. dlfiles="$newdlfiles"
  8733. newdlprefiles=
  8734. for lib in $dlprefiles; do
  8735. case $lib in
  8736. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  8737. *) abs=`pwd`"/$lib" ;;
  8738. esac
  8739. newdlprefiles+=" $abs"
  8740. done
  8741. dlprefiles="$newdlprefiles"
  8742. fi
  8743. $RM $output
  8744. # place dlname in correct position for cygwin
  8745. # In fact, it would be nice if we could use this code for all target
  8746. # systems that can't hard-code library paths into their executables
  8747. # and that have no shared library path variable independent of PATH,
  8748. # but it turns out we can't easily determine that from inspecting
  8749. # libtool variables, so we have to hard-code the OSs to which it
  8750. # applies here; at the moment, that means platforms that use the PE
  8751. # object format with DLL files. See the long comment at the top of
  8752. # tests/bindir.at for full details.
  8753. tdlname=$dlname
  8754. case $host,$output,$installed,$module,$dlname in
  8755. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
  8756. # If a -bindir argument was supplied, place the dll there.
  8757. if test "x$bindir" != x ;
  8758. then
  8759. func_relative_path "$install_libdir" "$bindir"
  8760. tdlname=$func_relative_path_result$dlname
  8761. else
  8762. # Otherwise fall back on heuristic.
  8763. tdlname=../bin/$dlname
  8764. fi
  8765. ;;
  8766. esac
  8767. $ECHO > $output "\
  8768. # $outputname - a libtool library file
  8769. # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  8770. #
  8771. # Please DO NOT delete this file!
  8772. # It is necessary for linking the library.
  8773. # The name that we can dlopen(3).
  8774. dlname='$tdlname'
  8775. # Names of this library.
  8776. library_names='$library_names'
  8777. # The name of the static archive.
  8778. old_library='$old_library'
  8779. # Linker flags that can not go in dependency_libs.
  8780. inherited_linker_flags='$new_inherited_linker_flags'
  8781. # Libraries that this one depends upon.
  8782. dependency_libs='$dependency_libs'
  8783. # Names of additional weak libraries provided by this library
  8784. weak_library_names='$weak_libs'
  8785. # Version information for $libname.
  8786. current=$current
  8787. age=$age
  8788. revision=$revision
  8789. # Is this an already installed library?
  8790. installed=$installed
  8791. # Should we warn about portability when linking against -modules?
  8792. shouldnotlink=$module
  8793. # Files to dlopen/dlpreopen
  8794. dlopen='$dlfiles'
  8795. dlpreopen='$dlprefiles'
  8796. # Directory that this library needs to be installed in:
  8797. libdir='$install_libdir'"
  8798. if test "$installed" = no && test "$need_relink" = yes; then
  8799. $ECHO >> $output "\
  8800. relink_command=\"$relink_command\""
  8801. fi
  8802. done
  8803. }
  8804. # Do a symbolic link so that the libtool archive can be found in
  8805. # LD_LIBRARY_PATH before the program is installed.
  8806. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  8807. ;;
  8808. esac
  8809. exit $EXIT_SUCCESS
  8810. }
  8811. { test "$opt_mode" = link || test "$opt_mode" = relink; } &&
  8812. func_mode_link ${1+"$@"}
  8813. # func_mode_uninstall arg...
  8814. func_mode_uninstall ()
  8815. {
  8816. $opt_debug
  8817. RM="$nonopt"
  8818. files=
  8819. rmforce=
  8820. exit_status=0
  8821. # This variable tells wrapper scripts just to set variables rather
  8822. # than running their programs.
  8823. libtool_install_magic="$magic"
  8824. for arg
  8825. do
  8826. case $arg in
  8827. -f) RM+=" $arg"; rmforce=yes ;;
  8828. -*) RM+=" $arg" ;;
  8829. *) files+=" $arg" ;;
  8830. esac
  8831. done
  8832. test -z "$RM" && \
  8833. func_fatal_help "you must specify an RM program"
  8834. rmdirs=
  8835. for file in $files; do
  8836. func_dirname "$file" "" "."
  8837. dir="$func_dirname_result"
  8838. if test "X$dir" = X.; then
  8839. odir="$objdir"
  8840. else
  8841. odir="$dir/$objdir"
  8842. fi
  8843. func_basename "$file"
  8844. name="$func_basename_result"
  8845. test "$opt_mode" = uninstall && odir="$dir"
  8846. # Remember odir for removal later, being careful to avoid duplicates
  8847. if test "$opt_mode" = clean; then
  8848. case " $rmdirs " in
  8849. *" $odir "*) ;;
  8850. *) rmdirs+=" $odir" ;;
  8851. esac
  8852. fi
  8853. # Don't error if the file doesn't exist and rm -f was used.
  8854. if { test -L "$file"; } >/dev/null 2>&1 ||
  8855. { test -h "$file"; } >/dev/null 2>&1 ||
  8856. test -f "$file"; then
  8857. :
  8858. elif test -d "$file"; then
  8859. exit_status=1
  8860. continue
  8861. elif test "$rmforce" = yes; then
  8862. continue
  8863. fi
  8864. rmfiles="$file"
  8865. case $name in
  8866. *.la)
  8867. # Possibly a libtool archive, so verify it.
  8868. if func_lalib_p "$file"; then
  8869. func_source $dir/$name
  8870. # Delete the libtool libraries and symlinks.
  8871. for n in $library_names; do
  8872. rmfiles+=" $odir/$n"
  8873. done
  8874. test -n "$old_library" && rmfiles+=" $odir/$old_library"
  8875. case "$opt_mode" in
  8876. clean)
  8877. case " $library_names " in
  8878. *" $dlname "*) ;;
  8879. *) test -n "$dlname" && rmfiles+=" $odir/$dlname" ;;
  8880. esac
  8881. test -n "$libdir" && rmfiles+=" $odir/$name $odir/${name}i"
  8882. ;;
  8883. uninstall)
  8884. if test -n "$library_names"; then
  8885. # Do each command in the postuninstall commands.
  8886. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  8887. fi
  8888. if test -n "$old_library"; then
  8889. # Do each command in the old_postuninstall commands.
  8890. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  8891. fi
  8892. # FIXME: should reinstall the best remaining shared library.
  8893. ;;
  8894. esac
  8895. fi
  8896. ;;
  8897. *.lo)
  8898. # Possibly a libtool object, so verify it.
  8899. if func_lalib_p "$file"; then
  8900. # Read the .lo file
  8901. func_source $dir/$name
  8902. # Add PIC object to the list of files to remove.
  8903. if test -n "$pic_object" &&
  8904. test "$pic_object" != none; then
  8905. rmfiles+=" $dir/$pic_object"
  8906. fi
  8907. # Add non-PIC object to the list of files to remove.
  8908. if test -n "$non_pic_object" &&
  8909. test "$non_pic_object" != none; then
  8910. rmfiles+=" $dir/$non_pic_object"
  8911. fi
  8912. fi
  8913. ;;
  8914. *)
  8915. if test "$opt_mode" = clean ; then
  8916. noexename=$name
  8917. case $file in
  8918. *.exe)
  8919. func_stripname '' '.exe' "$file"
  8920. file=$func_stripname_result
  8921. func_stripname '' '.exe' "$name"
  8922. noexename=$func_stripname_result
  8923. # $file with .exe has already been added to rmfiles,
  8924. # add $file without .exe
  8925. rmfiles+=" $file"
  8926. ;;
  8927. esac
  8928. # Do a test to see if this is a libtool program.
  8929. if func_ltwrapper_p "$file"; then
  8930. if func_ltwrapper_executable_p "$file"; then
  8931. func_ltwrapper_scriptname "$file"
  8932. relink_command=
  8933. func_source $func_ltwrapper_scriptname_result
  8934. rmfiles+=" $func_ltwrapper_scriptname_result"
  8935. else
  8936. relink_command=
  8937. func_source $dir/$noexename
  8938. fi
  8939. # note $name still contains .exe if it was in $file originally
  8940. # as does the version of $file that was added into $rmfiles
  8941. rmfiles+=" $odir/$name $odir/${name}S.${objext}"
  8942. if test "$fast_install" = yes && test -n "$relink_command"; then
  8943. rmfiles+=" $odir/lt-$name"
  8944. fi
  8945. if test "X$noexename" != "X$name" ; then
  8946. rmfiles+=" $odir/lt-${noexename}.c"
  8947. fi
  8948. fi
  8949. fi
  8950. ;;
  8951. esac
  8952. func_show_eval "$RM $rmfiles" 'exit_status=1'
  8953. done
  8954. # Try to remove the ${objdir}s in the directories where we deleted files
  8955. for dir in $rmdirs; do
  8956. if test -d "$dir"; then
  8957. func_show_eval "rmdir $dir >/dev/null 2>&1"
  8958. fi
  8959. done
  8960. exit $exit_status
  8961. }
  8962. { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
  8963. func_mode_uninstall ${1+"$@"}
  8964. test -z "$opt_mode" && {
  8965. help="$generic_help"
  8966. func_fatal_help "you must specify a MODE"
  8967. }
  8968. test -z "$exec_cmd" && \
  8969. func_fatal_help "invalid operation mode \`$opt_mode'"
  8970. if test -n "$exec_cmd"; then
  8971. eval exec "$exec_cmd"
  8972. exit $EXIT_FAILURE
  8973. fi
  8974. exit $exit_status
  8975. # The TAGs below are defined such that we never get into a situation
  8976. # in which we disable both kinds of libraries. Given conflicting
  8977. # choices, we go for a static library, that is the most portable,
  8978. # since we can't tell whether shared libraries were disabled because
  8979. # the user asked for that or because the platform doesn't support
  8980. # them. This is particularly important on AIX, because we don't
  8981. # support having both static and shared libraries enabled at the same
  8982. # time on that platform, so we default to a shared-only configuration.
  8983. # If a disable-shared tag is given, we'll fallback to a static-only
  8984. # configuration. But we'll never go from static-only to shared-only.
  8985. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  8986. build_libtool_libs=no
  8987. build_old_libs=yes
  8988. # ### END LIBTOOL TAG CONFIG: disable-shared
  8989. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  8990. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  8991. # ### END LIBTOOL TAG CONFIG: disable-static
  8992. # Local Variables:
  8993. # mode:shell-script
  8994. # sh-indentation:2
  8995. # End:
  8996. # vi:sw=2