libtool 260 KB

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