libtool 325 KB

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