libtool 340 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883
  1. #! /bin/bash
  2. # Generated automatically by config.status (Linux-PAM) 1.5.2
  3. # Libtool was configured as follows:
  4. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  5. # Provide generalized library-building support services.
  6. # Written by Gordon Matzigkeit, 1996
  7. # Copyright (C) 2014 Free Software Foundation, Inc.
  8. # This is free software; see the source for copying conditions. There is NO
  9. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. # GNU Libtool is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2 of of the License, or
  13. # (at your option) any later version.
  14. #
  15. # As a special exception to the GNU General Public License, if you
  16. # distribute this file as part of a program or library that is built
  17. # using GNU Libtool, you may include this file under the same
  18. # distribution terms that you use for the rest of that program.
  19. #
  20. # GNU Libtool is distributed in the hope that it will be useful, but
  21. # WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. # GNU General Public License for more details.
  24. #
  25. # You should have received a copy of the GNU General Public License
  26. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  27. # The names of the tagged configurations supported by this script.
  28. available_tags=''
  29. # Configured defaults for sys_lib_dlsearch_path munging.
  30. : ${LT_SYS_LIBRARY_PATH=""}
  31. # ### BEGIN LIBTOOL CONFIG
  32. # Which release of libtool.m4 was used?
  33. macro_version=2.4.6
  34. macro_revision=2.4.6
  35. # Whether or not to build static libraries.
  36. build_old_libs=no
  37. # Whether or not to build shared libraries.
  38. build_libtool_libs=yes
  39. # What type of objects to build.
  40. pic_mode=default
  41. # Whether or not to optimize for fast installation.
  42. fast_install=yes
  43. # Shared archive member basename,for filename based shared library versioning on AIX.
  44. shared_archive_member_spec=
  45. # Shell to use when invoking shell scripts.
  46. SHELL="/bin/bash"
  47. # An echo program that protects backslashes.
  48. ECHO="printf %s\\n"
  49. # The PATH separator for the build system.
  50. PATH_SEPARATOR=":"
  51. # The host system.
  52. host_alias=arm-linux-gnueabihf
  53. host=arm-unknown-linux-gnueabihf
  54. host_os=linux-gnueabihf
  55. # The build system.
  56. build_alias=
  57. build=x86_64-pc-linux-gnu
  58. build_os=linux-gnu
  59. # A sed program that does not truncate output.
  60. SED="/bin/sed"
  61. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  62. Xsed="$SED -e 1s/^X//"
  63. # A grep program that handles long lines.
  64. GREP="/bin/grep"
  65. # An ERE matcher.
  66. EGREP="/bin/grep -E"
  67. # A literal string matcher.
  68. FGREP="/bin/grep -F"
  69. # A BSD- or MS-compatible name lister.
  70. NM="nm"
  71. # Whether we need soft or hard links.
  72. LN_S="ln -s"
  73. # What is the maximum length of a command?
  74. max_cmd_len=1572864
  75. # Object file suffix (normally "o").
  76. objext=o
  77. # Executable file suffix (normally "").
  78. exeext=
  79. # whether the shell understands "unset".
  80. lt_unset=unset
  81. # turn spaces into newlines.
  82. SP2NL="tr \\040 \\012"
  83. # turn newlines into spaces.
  84. NL2SP="tr \\015\\012 \\040\\040"
  85. # convert $build file names to $host format.
  86. to_host_file_cmd=func_convert_file_noop
  87. # convert $build files to toolchain format.
  88. to_tool_file_cmd=func_convert_file_noop
  89. # An object symbol dumper.
  90. OBJDUMP="objdump"
  91. # Method to check whether dependent libraries are shared objects.
  92. deplibs_check_method="pass_all"
  93. # Command to use when deplibs_check_method = "file_magic".
  94. file_magic_cmd="\$MAGIC_CMD"
  95. # How to find potential files when deplibs_check_method = "file_magic".
  96. file_magic_glob=""
  97. # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
  98. want_nocaseglob="no"
  99. # DLL creation program.
  100. DLLTOOL="false"
  101. # Command to associate shared and link libraries.
  102. sharedlib_from_linklib_cmd="printf %s\\n"
  103. # The archiver.
  104. AR="/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-ar"
  105. # Flags to create an archive (by configure).
  106. lt_ar_flags=cr
  107. # Flags to create an archive.
  108. AR_FLAGS=${ARFLAGS-"$lt_ar_flags"}
  109. # How to feed a file listing to the archiver.
  110. archiver_list_spec="@"
  111. # A symbol stripping program.
  112. STRIP="strip"
  113. # Commands used to install an old-style archive.
  114. RANLIB="ranlib"
  115. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
  116. old_postuninstall_cmds=""
  117. # Whether to use a lock for old archive extraction.
  118. lock_old_archive_extraction=no
  119. # A C compiler.
  120. 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"
  121. # LTCC compiler flags.
  122. LTCFLAGS="-g -O2 "
  123. # Take the output of nm and produce a listing of raw symbols and C names.
  124. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
  125. # Transform the output of nm in a proper C declaration.
  126. global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
  127. # Transform the output of nm into a list of symbols to manually relocate.
  128. global_symbol_to_import=""
  129. # Transform the output of nm in a C name address pair.
  130. global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/ {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p'"
  131. # Transform the output of nm in a C name address pair when lib prefix is needed.
  132. 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'"
  133. # The name lister interface.
  134. nm_interface="BSD nm"
  135. # Specify filename containing input files for $NM.
  136. nm_file_list_spec="@"
  137. # The root where to search for dependent libraries,and where our libraries should be installed.
  138. lt_sysroot=
  139. # Command to truncate a binary pipe.
  140. lt_truncate_bin="/bin/dd bs=4096 count=1"
  141. # The name of the directory that contains temporary libtool files.
  142. objdir=.libs
  143. # Used to examine libraries when file_magic_cmd begins with "file".
  144. MAGIC_CMD=file
  145. # Must we lock files when doing compilation?
  146. need_locks="no"
  147. # Manifest tool.
  148. MANIFEST_TOOL=":"
  149. # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
  150. DSYMUTIL=""
  151. # Tool to change global to local symbols on Mac OS X.
  152. NMEDIT=""
  153. # Tool to manipulate fat objects and archives on Mac OS X.
  154. LIPO=""
  155. # ldd/readelf like tool for Mach-O binaries on Mac OS X.
  156. OTOOL=""
  157. # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
  158. OTOOL64=""
  159. # Old archive suffix (normally "a").
  160. libext=a
  161. # Shared library suffix (normally ".so").
  162. shrext_cmds=".so"
  163. # The commands to extract the exported symbol list from a shared archive.
  164. extract_expsyms_cmds=""
  165. # Variables whose values should be saved in libtool wrapper scripts and
  166. # restored at link time.
  167. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  168. # Do we need the "lib" prefix for modules?
  169. need_lib_prefix=no
  170. # Do we need a version for libraries?
  171. need_version=no
  172. # Library versioning type.
  173. version_type=linux
  174. # Shared library runtime path variable.
  175. runpath_var=LD_RUN_PATH
  176. # Shared library path variable.
  177. shlibpath_var=LD_LIBRARY_PATH
  178. # Is shlibpath searched before the hard-coded library search path?
  179. shlibpath_overrides_runpath=no
  180. # Format of library name prefix.
  181. libname_spec="lib\$name"
  182. # List of archive names. First name is the real one, the rest are links.
  183. # The last name is the one that the linker finds with -lNAME
  184. library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
  185. # The coded name of the library, if different from the real name.
  186. soname_spec="\$libname\$release\$shared_ext\$major"
  187. # Permission mode override for installation of shared libraries.
  188. install_override_mode=""
  189. # Command to use after installation of a shared archive.
  190. postinstall_cmds=""
  191. # Command to use after uninstallation of a shared archive.
  192. postuninstall_cmds=""
  193. # Commands used to finish a libtool library installation in a directory.
  194. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  195. # As "finish_cmds", except a single script fragment to be evaled but
  196. # not shown.
  197. finish_eval=""
  198. # Whether we should hardcode library paths into libraries.
  199. hardcode_into_libs=yes
  200. # Compile-time system search path for libraries.
  201. 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 "
  202. # Detected run-time system search path for libraries.
  203. sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib/i386-linux-gnu /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /usr/local/lib/i686-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 "
  204. # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
  205. configure_time_lt_sys_library_path=""
  206. # Whether dlopen is supported.
  207. dlopen_support=unknown
  208. # Whether dlopen of programs is supported.
  209. dlopen_self=unknown
  210. # Whether dlopen of statically linked programs is supported.
  211. dlopen_self_static=unknown
  212. # Commands to strip libraries.
  213. old_striplib="strip --strip-debug"
  214. striplib="strip --strip-unneeded"
  215. # The linker used to build libraries.
  216. 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"
  217. # How to create reloadable object files.
  218. reload_flag=" -r"
  219. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  220. # Commands used to build an old-style archive.
  221. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  222. # A language specific compiler.
  223. 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"
  224. # Is the compiler the GNU compiler?
  225. with_gcc=yes
  226. # Compiler flag to turn off builtin functions.
  227. no_builtin_flag=" -fno-builtin"
  228. # Additional compiler flags for building library objects.
  229. pic_flag=" -fPIC -DPIC"
  230. # How to pass a linker flag through the compiler.
  231. wl="-Wl,"
  232. # Compiler flag to prevent dynamic linking.
  233. link_static_flag="-static"
  234. # Does compiler simultaneously support -c and -o options?
  235. compiler_c_o="yes"
  236. # Whether or not to add -lc for building shared libraries.
  237. build_libtool_need_lc=no
  238. # Whether or not to disallow shared libs when runtime libs are static.
  239. allow_libtool_libs_with_static_runtimes=no
  240. # Compiler flag to allow reflexive dlopens.
  241. export_dynamic_flag_spec="\$wl--export-dynamic"
  242. # Compiler flag to generate shared objects directly from archives.
  243. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  244. # Whether the compiler copes with passing no objects directly.
  245. compiler_needs_object="no"
  246. # Create an old-style archive from a shared archive.
  247. old_archive_from_new_cmds=""
  248. # Create a temporary old-style archive to link instead of a shared archive.
  249. old_archive_from_expsyms_cmds=""
  250. # Commands used to build a shared archive.
  251. archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  252. archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  253. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  254. echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  255. if test -r \$libname-altlinux.ver; then cp \$libname-altlinux.ver \$output_objdir/\$libname.ver; fi~
  256. \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
  257. # Commands used to build a loadable module if different from building
  258. # a shared archive.
  259. module_cmds=""
  260. module_expsym_cmds=""
  261. # Whether we are building with GNU ld or not.
  262. with_gnu_ld="yes"
  263. # Flag that allows shared libraries with undefined symbols to be built.
  264. allow_undefined_flag=""
  265. # Flag that enforces no undefined symbols.
  266. no_undefined_flag=""
  267. # Flag to hardcode $libdir into a binary during linking.
  268. # This must work even if $libdir does not exist
  269. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  270. # Whether we need a single "-rpath" flag with a separated argument.
  271. hardcode_libdir_separator=""
  272. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  273. # DIR into the resulting binary.
  274. hardcode_direct=no
  275. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  276. # DIR into the resulting binary and the resulting library dependency is
  277. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  278. # library is relocated.
  279. hardcode_direct_absolute=no
  280. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  281. # into the resulting binary.
  282. hardcode_minus_L=no
  283. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  284. # into the resulting binary.
  285. hardcode_shlibpath_var=unsupported
  286. # Set to "yes" if building a shared library automatically hardcodes DIR
  287. # into the library and all subsequent libraries and executables linked
  288. # against it.
  289. hardcode_automatic=no
  290. # Set to yes if linker adds runtime paths of dependent libraries
  291. # to runtime path list.
  292. inherit_rpath=no
  293. # Whether libtool must link a program against all its dependency libraries.
  294. link_all_deplibs=no
  295. # Set to "yes" if exported symbols are required.
  296. always_export_symbols=no
  297. # The commands to list exported symbols.
  298. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  299. # Symbols that should not be listed in the preloaded symbols.
  300. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  301. # Symbols that must always be exported.
  302. include_expsyms=""
  303. # Commands necessary for linking programs (against libraries) with templates.
  304. prelink_cmds=""
  305. # Commands necessary for finishing linking programs.
  306. postlink_cmds=""
  307. # Specify filename containing input files.
  308. file_list_spec=""
  309. # How to hardcode a shared library path into an executable.
  310. hardcode_action=immediate
  311. # ### END LIBTOOL CONFIG
  312. # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
  313. # func_munge_path_list VARIABLE PATH
  314. # -----------------------------------
  315. # VARIABLE is name of variable containing _space_ separated list of
  316. # directories to be munged by the contents of PATH, which is string
  317. # having a format:
  318. # "DIR[:DIR]:"
  319. # string "DIR[ DIR]" will be prepended to VARIABLE
  320. # ":DIR[:DIR]"
  321. # string "DIR[ DIR]" will be appended to VARIABLE
  322. # "DIRP[:DIRP]::[DIRA:]DIRA"
  323. # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
  324. # "DIRA[ DIRA]" will be appended to VARIABLE
  325. # "DIR[:DIR]"
  326. # VARIABLE will be replaced by "DIR[ DIR]"
  327. func_munge_path_list ()
  328. {
  329. case x$2 in
  330. x)
  331. ;;
  332. *:)
  333. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
  334. ;;
  335. x:*)
  336. eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
  337. ;;
  338. *::*)
  339. eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
  340. eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
  341. ;;
  342. *)
  343. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
  344. ;;
  345. esac
  346. }
  347. # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
  348. func_cc_basename ()
  349. {
  350. for cc_temp in $*""; do
  351. case $cc_temp in
  352. compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
  353. distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
  354. \-*) ;;
  355. *) break;;
  356. esac
  357. done
  358. func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
  359. }
  360. # ### END FUNCTIONS SHARED WITH CONFIGURE
  361. #! /bin/sh
  362. ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
  363. ## by inline-source v2019-02-19.15
  364. # libtool (GNU libtool) 2.4.6
  365. # Provide generalized library-building support services.
  366. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  367. # Copyright (C) 1996-2019 Free Software Foundation, Inc.
  368. # This is free software; see the source for copying conditions. There is NO
  369. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  370. # GNU Libtool is free software; you can redistribute it and/or modify
  371. # it under the terms of the GNU General Public License as published by
  372. # the Free Software Foundation; either version 2 of the License, or
  373. # (at your option) any later version.
  374. #
  375. # As a special exception to the GNU General Public License,
  376. # if you distribute this file as part of a program or library that
  377. # is built using GNU Libtool, you may include this file under the
  378. # same distribution terms that you use for the rest of that program.
  379. #
  380. # GNU Libtool is distributed in the hope that it will be useful, but
  381. # WITHOUT ANY WARRANTY; without even the implied warranty of
  382. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  383. # General Public License for more details.
  384. #
  385. # You should have received a copy of the GNU General Public License
  386. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  387. PROGRAM=libtool
  388. PACKAGE=libtool
  389. VERSION=2.4.6
  390. package_revision=2.4.6
  391. ## ------ ##
  392. ## Usage. ##
  393. ## ------ ##
  394. # Run './libtool --help' for help with using this script from the
  395. # command line.
  396. ## ------------------------------- ##
  397. ## User overridable command paths. ##
  398. ## ------------------------------- ##
  399. # After configure completes, it has a better idea of some of the
  400. # shell tools we need than the defaults used by the functions shared
  401. # with bootstrap, so set those here where they can still be over-
  402. # ridden by the user, but otherwise take precedence.
  403. : ${AUTOCONF="autoconf"}
  404. : ${AUTOMAKE="automake"}
  405. ## -------------------------- ##
  406. ## Source external libraries. ##
  407. ## -------------------------- ##
  408. # Much of our low-level functionality needs to be sourced from external
  409. # libraries, which are installed to $pkgauxdir.
  410. # Set a version string for this script.
  411. scriptversion=2019-02-19.15; # UTC
  412. # General shell script boiler plate, and helper functions.
  413. # Written by Gary V. Vaughan, 2004
  414. # This is free software. There is NO warranty; not even for
  415. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  416. #
  417. # Copyright (C) 2004-2019 Bootstrap Authors
  418. #
  419. # This file is dual licensed under the terms of the MIT license
  420. # <https://opensource.org/license/MIT>, and GPL version 2 or later
  421. # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
  422. # these licenses when using or redistributing this software or any of
  423. # the files within it. See the URLs above, or the file `LICENSE`
  424. # included in the Bootstrap distribution for the full license texts.
  425. # Please report bugs or propose patches to:
  426. # <https://github.com/gnulib-modules/bootstrap/issues>
  427. ## ------ ##
  428. ## Usage. ##
  429. ## ------ ##
  430. # Evaluate this file near the top of your script to gain access to
  431. # the functions and variables defined here:
  432. #
  433. # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
  434. #
  435. # If you need to override any of the default environment variable
  436. # settings, do that before evaluating this file.
  437. ## -------------------- ##
  438. ## Shell normalisation. ##
  439. ## -------------------- ##
  440. # Some shells need a little help to be as Bourne compatible as possible.
  441. # Before doing anything else, make sure all that help has been provided!
  442. DUALCASE=1; export DUALCASE # for MKS sh
  443. if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  444. emulate sh
  445. NULLCMD=:
  446. # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  447. # is contrary to our usage. Disable this feature.
  448. alias -g '${1+"$@"}'='"$@"'
  449. setopt NO_GLOB_SUBST
  450. else
  451. case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
  452. fi
  453. # NLS nuisances: We save the old values in case they are required later.
  454. _G_user_locale=
  455. _G_safe_locale=
  456. for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  457. do
  458. eval "if test set = \"\${$_G_var+set}\"; then
  459. save_$_G_var=\$$_G_var
  460. $_G_var=C
  461. export $_G_var
  462. _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
  463. _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
  464. fi"
  465. done
  466. # Make sure IFS has a sensible default
  467. sp=' '
  468. nl='
  469. '
  470. IFS="$sp $nl"
  471. # There are apparently some retarded systems that use ';' as a PATH separator!
  472. if test "${PATH_SEPARATOR+set}" != set; then
  473. PATH_SEPARATOR=:
  474. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
  475. (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
  476. PATH_SEPARATOR=';'
  477. }
  478. fi
  479. # func_unset VAR
  480. # --------------
  481. # Portably unset VAR.
  482. # In some shells, an 'unset VAR' statement leaves a non-zero return
  483. # status if VAR is already unset, which might be problematic if the
  484. # statement is used at the end of a function (thus poisoning its return
  485. # value) or when 'set -e' is active (causing even a spurious abort of
  486. # the script in this case).
  487. func_unset ()
  488. {
  489. { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
  490. }
  491. # Make sure CDPATH doesn't cause `cd` commands to output the target dir.
  492. func_unset CDPATH
  493. # Make sure ${,E,F}GREP behave sanely.
  494. func_unset GREP_OPTIONS
  495. ## ------------------------- ##
  496. ## Locate command utilities. ##
  497. ## ------------------------- ##
  498. # func_executable_p FILE
  499. # ----------------------
  500. # Check that FILE is an executable regular file.
  501. func_executable_p ()
  502. {
  503. test -f "$1" && test -x "$1"
  504. }
  505. # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
  506. # --------------------------------------------
  507. # Search for either a program that responds to --version with output
  508. # containing "GNU", or else returned by CHECK_FUNC otherwise, by
  509. # trying all the directories in PATH with each of the elements of
  510. # PROGS_LIST.
  511. #
  512. # CHECK_FUNC should accept the path to a candidate program, and
  513. # set $func_check_prog_result if it truncates its output less than
  514. # $_G_path_prog_max characters.
  515. func_path_progs ()
  516. {
  517. _G_progs_list=$1
  518. _G_check_func=$2
  519. _G_PATH=${3-"$PATH"}
  520. _G_path_prog_max=0
  521. _G_path_prog_found=false
  522. _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
  523. for _G_dir in $_G_PATH; do
  524. IFS=$_G_save_IFS
  525. test -z "$_G_dir" && _G_dir=.
  526. for _G_prog_name in $_G_progs_list; do
  527. for _exeext in '' .EXE; do
  528. _G_path_prog=$_G_dir/$_G_prog_name$_exeext
  529. func_executable_p "$_G_path_prog" || continue
  530. case `"$_G_path_prog" --version 2>&1` in
  531. *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
  532. *) $_G_check_func $_G_path_prog
  533. func_path_progs_result=$func_check_prog_result
  534. ;;
  535. esac
  536. $_G_path_prog_found && break 3
  537. done
  538. done
  539. done
  540. IFS=$_G_save_IFS
  541. test -z "$func_path_progs_result" && {
  542. echo "no acceptable sed could be found in \$PATH" >&2
  543. exit 1
  544. }
  545. }
  546. # We want to be able to use the functions in this file before configure
  547. # has figured out where the best binaries are kept, which means we have
  548. # to search for them ourselves - except when the results are already set
  549. # where we skip the searches.
  550. # Unless the user overrides by setting SED, search the path for either GNU
  551. # sed, or the sed that truncates its output the least.
  552. test -z "$SED" && {
  553. _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
  554. for _G_i in 1 2 3 4 5 6 7; do
  555. _G_sed_script=$_G_sed_script$nl$_G_sed_script
  556. done
  557. echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
  558. _G_sed_script=
  559. func_check_prog_sed ()
  560. {
  561. _G_path_prog=$1
  562. _G_count=0
  563. printf 0123456789 >conftest.in
  564. while :
  565. do
  566. cat conftest.in conftest.in >conftest.tmp
  567. mv conftest.tmp conftest.in
  568. cp conftest.in conftest.nl
  569. echo '' >> conftest.nl
  570. "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
  571. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  572. _G_count=`expr $_G_count + 1`
  573. if test "$_G_count" -gt "$_G_path_prog_max"; then
  574. # Best one so far, save it but keep looking for a better one
  575. func_check_prog_result=$_G_path_prog
  576. _G_path_prog_max=$_G_count
  577. fi
  578. # 10*(2^10) chars as input seems more than enough
  579. test 10 -lt "$_G_count" && break
  580. done
  581. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  582. }
  583. func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
  584. rm -f conftest.sed
  585. SED=$func_path_progs_result
  586. }
  587. # Unless the user overrides by setting GREP, search the path for either GNU
  588. # grep, or the grep that truncates its output the least.
  589. test -z "$GREP" && {
  590. func_check_prog_grep ()
  591. {
  592. _G_path_prog=$1
  593. _G_count=0
  594. _G_path_prog_max=0
  595. printf 0123456789 >conftest.in
  596. while :
  597. do
  598. cat conftest.in conftest.in >conftest.tmp
  599. mv conftest.tmp conftest.in
  600. cp conftest.in conftest.nl
  601. echo 'GREP' >> conftest.nl
  602. "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
  603. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  604. _G_count=`expr $_G_count + 1`
  605. if test "$_G_count" -gt "$_G_path_prog_max"; then
  606. # Best one so far, save it but keep looking for a better one
  607. func_check_prog_result=$_G_path_prog
  608. _G_path_prog_max=$_G_count
  609. fi
  610. # 10*(2^10) chars as input seems more than enough
  611. test 10 -lt "$_G_count" && break
  612. done
  613. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  614. }
  615. func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
  616. GREP=$func_path_progs_result
  617. }
  618. ## ------------------------------- ##
  619. ## User overridable command paths. ##
  620. ## ------------------------------- ##
  621. # All uppercase variable names are used for environment variables. These
  622. # variables can be overridden by the user before calling a script that
  623. # uses them if a suitable command of that name is not already available
  624. # in the command search PATH.
  625. : ${CP="cp -f"}
  626. : ${ECHO="printf %s\n"}
  627. : ${EGREP="$GREP -E"}
  628. : ${FGREP="$GREP -F"}
  629. : ${LN_S="ln -s"}
  630. : ${MAKE="make"}
  631. : ${MKDIR="mkdir"}
  632. : ${MV="mv -f"}
  633. : ${RM="rm -f"}
  634. : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  635. ## -------------------- ##
  636. ## Useful sed snippets. ##
  637. ## -------------------- ##
  638. sed_dirname='s|/[^/]*$||'
  639. sed_basename='s|^.*/||'
  640. # Sed substitution that helps us do robust quoting. It backslashifies
  641. # metacharacters that are still active within double-quoted strings.
  642. sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
  643. # Same as above, but do not quote variable references.
  644. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
  645. # Sed substitution that turns a string into a regex matching for the
  646. # string literally.
  647. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
  648. # Sed substitution that converts a w32 file name or path
  649. # that contains forward slashes, into one that contains
  650. # (escaped) backslashes. A very naive implementation.
  651. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  652. # Re-'\' parameter expansions in output of sed_double_quote_subst that
  653. # were '\'-ed in input to the same. If an odd number of '\' preceded a
  654. # '$' in input to sed_double_quote_subst, that '$' was protected from
  655. # expansion. Since each input '\' is now two '\'s, look for any number
  656. # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
  657. _G_bs='\\'
  658. _G_bs2='\\\\'
  659. _G_bs4='\\\\\\\\'
  660. _G_dollar='\$'
  661. sed_double_backslash="\
  662. s/$_G_bs4/&\\
  663. /g
  664. s/^$_G_bs2$_G_dollar/$_G_bs&/
  665. s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
  666. s/\n//g"
  667. ## ----------------- ##
  668. ## Global variables. ##
  669. ## ----------------- ##
  670. # Except for the global variables explicitly listed below, the following
  671. # functions in the '^func_' namespace, and the '^require_' namespace
  672. # variables initialised in the 'Resource management' section, sourcing
  673. # this file will not pollute your global namespace with anything
  674. # else. There's no portable way to scope variables in Bourne shell
  675. # though, so actually running these functions will sometimes place
  676. # results into a variable named after the function, and often use
  677. # temporary variables in the '^_G_' namespace. If you are careful to
  678. # avoid using those namespaces casually in your sourcing script, things
  679. # should continue to work as you expect. And, of course, you can freely
  680. # overwrite any of the functions or variables defined here before
  681. # calling anything to customize them.
  682. EXIT_SUCCESS=0
  683. EXIT_FAILURE=1
  684. EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  685. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  686. # Allow overriding, eg assuming that you follow the convention of
  687. # putting '$debug_cmd' at the start of all your functions, you can get
  688. # bash to show function call trace with:
  689. #
  690. # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
  691. debug_cmd=${debug_cmd-":"}
  692. exit_cmd=:
  693. # By convention, finish your script with:
  694. #
  695. # exit $exit_status
  696. #
  697. # so that you can set exit_status to non-zero if you want to indicate
  698. # something went wrong during execution without actually bailing out at
  699. # the point of failure.
  700. exit_status=$EXIT_SUCCESS
  701. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  702. # is ksh but when the shell is invoked as "sh" and the current value of
  703. # the _XPG environment variable is not equal to 1 (one), the special
  704. # positional parameter $0, within a function call, is the name of the
  705. # function.
  706. progpath=$0
  707. # The name of this program.
  708. progname=`$ECHO "$progpath" |$SED "$sed_basename"`
  709. # Make sure we have an absolute progpath for reexecution:
  710. case $progpath in
  711. [\\/]*|[A-Za-z]:\\*) ;;
  712. *[\\/]*)
  713. progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
  714. progdir=`cd "$progdir" && pwd`
  715. progpath=$progdir/$progname
  716. ;;
  717. *)
  718. _G_IFS=$IFS
  719. IFS=${PATH_SEPARATOR-:}
  720. for progdir in $PATH; do
  721. IFS=$_G_IFS
  722. test -x "$progdir/$progname" && break
  723. done
  724. IFS=$_G_IFS
  725. test -n "$progdir" || progdir=`pwd`
  726. progpath=$progdir/$progname
  727. ;;
  728. esac
  729. ## ----------------- ##
  730. ## Standard options. ##
  731. ## ----------------- ##
  732. # The following options affect the operation of the functions defined
  733. # below, and should be set appropriately depending on run-time para-
  734. # meters passed on the command line.
  735. opt_dry_run=false
  736. opt_quiet=false
  737. opt_verbose=false
  738. # Categories 'all' and 'none' are always available. Append any others
  739. # you will pass as the first argument to func_warning from your own
  740. # code.
  741. warning_categories=
  742. # By default, display warnings according to 'opt_warning_types'. Set
  743. # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
  744. # treat the next displayed warning as a fatal error.
  745. warning_func=func_warn_and_continue
  746. # Set to 'all' to display all warnings, 'none' to suppress all
  747. # warnings, or a space delimited list of some subset of
  748. # 'warning_categories' to display only the listed warnings.
  749. opt_warning_types=all
  750. ## -------------------- ##
  751. ## Resource management. ##
  752. ## -------------------- ##
  753. # This section contains definitions for functions that each ensure a
  754. # particular resource (a file, or a non-empty configuration variable for
  755. # example) is available, and if appropriate to extract default values
  756. # from pertinent package files. Call them using their associated
  757. # 'require_*' variable to ensure that they are executed, at most, once.
  758. #
  759. # It's entirely deliberate that calling these functions can set
  760. # variables that don't obey the namespace limitations obeyed by the rest
  761. # of this file, in order that that they be as useful as possible to
  762. # callers.
  763. # require_term_colors
  764. # -------------------
  765. # Allow display of bold text on terminals that support it.
  766. require_term_colors=func_require_term_colors
  767. func_require_term_colors ()
  768. {
  769. $debug_cmd
  770. test -t 1 && {
  771. # COLORTERM and USE_ANSI_COLORS environment variables take
  772. # precedence, because most terminfo databases neglect to describe
  773. # whether color sequences are supported.
  774. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
  775. if test 1 = "$USE_ANSI_COLORS"; then
  776. # Standard ANSI escape sequences
  777. tc_reset=''
  778. tc_bold=''; tc_standout=''
  779. tc_red=''; tc_green=''
  780. tc_blue=''; tc_cyan=''
  781. else
  782. # Otherwise trust the terminfo database after all.
  783. test -n "`tput sgr0 2>/dev/null`" && {
  784. tc_reset=`tput sgr0`
  785. test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
  786. tc_standout=$tc_bold
  787. test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
  788. test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
  789. test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
  790. test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
  791. test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
  792. }
  793. fi
  794. }
  795. require_term_colors=:
  796. }
  797. ## ----------------- ##
  798. ## Function library. ##
  799. ## ----------------- ##
  800. # This section contains a variety of useful functions to call in your
  801. # scripts. Take note of the portable wrappers for features provided by
  802. # some modern shells, which will fall back to slower equivalents on
  803. # less featureful shells.
  804. # func_append VAR VALUE
  805. # ---------------------
  806. # Append VALUE onto the existing contents of VAR.
  807. # We should try to minimise forks, especially on Windows where they are
  808. # unreasonably slow, so skip the feature probes when bash or zsh are
  809. # being used:
  810. if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
  811. : ${_G_HAVE_ARITH_OP="yes"}
  812. : ${_G_HAVE_XSI_OPS="yes"}
  813. # The += operator was introduced in bash 3.1
  814. case $BASH_VERSION in
  815. [12].* | 3.0 | 3.0*) ;;
  816. *)
  817. : ${_G_HAVE_PLUSEQ_OP="yes"}
  818. ;;
  819. esac
  820. fi
  821. # _G_HAVE_PLUSEQ_OP
  822. # Can be empty, in which case the shell is probed, "yes" if += is
  823. # useable or anything else if it does not work.
  824. test -z "$_G_HAVE_PLUSEQ_OP" \
  825. && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
  826. && _G_HAVE_PLUSEQ_OP=yes
  827. if test yes = "$_G_HAVE_PLUSEQ_OP"
  828. then
  829. # This is an XSI compatible shell, allowing a faster implementation...
  830. eval 'func_append ()
  831. {
  832. $debug_cmd
  833. eval "$1+=\$2"
  834. }'
  835. else
  836. # ...otherwise fall back to using expr, which is often a shell builtin.
  837. func_append ()
  838. {
  839. $debug_cmd
  840. eval "$1=\$$1\$2"
  841. }
  842. fi
  843. # func_append_quoted VAR VALUE
  844. # ----------------------------
  845. # Quote VALUE and append to the end of shell variable VAR, separated
  846. # by a space.
  847. if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  848. eval 'func_append_quoted ()
  849. {
  850. $debug_cmd
  851. func_quote_arg pretty "$2"
  852. eval "$1+=\\ \$func_quote_arg_result"
  853. }'
  854. else
  855. func_append_quoted ()
  856. {
  857. $debug_cmd
  858. func_quote_arg pretty "$2"
  859. eval "$1=\$$1\\ \$func_quote_arg_result"
  860. }
  861. fi
  862. # func_append_uniq VAR VALUE
  863. # --------------------------
  864. # Append unique VALUE onto the existing contents of VAR, assuming
  865. # entries are delimited by the first character of VALUE. For example:
  866. #
  867. # func_append_uniq options " --another-option option-argument"
  868. #
  869. # will only append to $options if " --another-option option-argument "
  870. # is not already present somewhere in $options already (note spaces at
  871. # each end implied by leading space in second argument).
  872. func_append_uniq ()
  873. {
  874. $debug_cmd
  875. eval _G_current_value='`$ECHO $'$1'`'
  876. _G_delim=`expr "$2" : '\(.\)'`
  877. case $_G_delim$_G_current_value$_G_delim in
  878. *"$2$_G_delim"*) ;;
  879. *) func_append "$@" ;;
  880. esac
  881. }
  882. # func_arith TERM...
  883. # ------------------
  884. # Set func_arith_result to the result of evaluating TERMs.
  885. test -z "$_G_HAVE_ARITH_OP" \
  886. && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
  887. && _G_HAVE_ARITH_OP=yes
  888. if test yes = "$_G_HAVE_ARITH_OP"; then
  889. eval 'func_arith ()
  890. {
  891. $debug_cmd
  892. func_arith_result=$(( $* ))
  893. }'
  894. else
  895. func_arith ()
  896. {
  897. $debug_cmd
  898. func_arith_result=`expr "$@"`
  899. }
  900. fi
  901. # func_basename FILE
  902. # ------------------
  903. # Set func_basename_result to FILE with everything up to and including
  904. # the last / stripped.
  905. if test yes = "$_G_HAVE_XSI_OPS"; then
  906. # If this shell supports suffix pattern removal, then use it to avoid
  907. # forking. Hide the definitions single quotes in case the shell chokes
  908. # on unsupported syntax...
  909. _b='func_basename_result=${1##*/}'
  910. _d='case $1 in
  911. */*) func_dirname_result=${1%/*}$2 ;;
  912. * ) func_dirname_result=$3 ;;
  913. esac'
  914. else
  915. # ...otherwise fall back to using sed.
  916. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
  917. _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
  918. if test "X$func_dirname_result" = "X$1"; then
  919. func_dirname_result=$3
  920. else
  921. func_append func_dirname_result "$2"
  922. fi'
  923. fi
  924. eval 'func_basename ()
  925. {
  926. $debug_cmd
  927. '"$_b"'
  928. }'
  929. # func_dirname FILE APPEND NONDIR_REPLACEMENT
  930. # -------------------------------------------
  931. # Compute the dirname of FILE. If nonempty, add APPEND to the result,
  932. # otherwise set result to NONDIR_REPLACEMENT.
  933. eval 'func_dirname ()
  934. {
  935. $debug_cmd
  936. '"$_d"'
  937. }'
  938. # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
  939. # --------------------------------------------------------
  940. # Perform func_basename and func_dirname in a single function
  941. # call:
  942. # dirname: Compute the dirname of FILE. If nonempty,
  943. # add APPEND to the result, otherwise set result
  944. # to NONDIR_REPLACEMENT.
  945. # value returned in "$func_dirname_result"
  946. # basename: Compute filename of FILE.
  947. # value retuned in "$func_basename_result"
  948. # For efficiency, we do not delegate to the functions above but instead
  949. # duplicate the functionality here.
  950. eval 'func_dirname_and_basename ()
  951. {
  952. $debug_cmd
  953. '"$_b"'
  954. '"$_d"'
  955. }'
  956. # func_echo ARG...
  957. # ----------------
  958. # Echo program name prefixed message.
  959. func_echo ()
  960. {
  961. $debug_cmd
  962. _G_message=$*
  963. func_echo_IFS=$IFS
  964. IFS=$nl
  965. for _G_line in $_G_message; do
  966. IFS=$func_echo_IFS
  967. $ECHO "$progname: $_G_line"
  968. done
  969. IFS=$func_echo_IFS
  970. }
  971. # func_echo_all ARG...
  972. # --------------------
  973. # Invoke $ECHO with all args, space-separated.
  974. func_echo_all ()
  975. {
  976. $ECHO "$*"
  977. }
  978. # func_echo_infix_1 INFIX ARG...
  979. # ------------------------------
  980. # Echo program name, followed by INFIX on the first line, with any
  981. # additional lines not showing INFIX.
  982. func_echo_infix_1 ()
  983. {
  984. $debug_cmd
  985. $require_term_colors
  986. _G_infix=$1; shift
  987. _G_indent=$_G_infix
  988. _G_prefix="$progname: $_G_infix: "
  989. _G_message=$*
  990. # Strip color escape sequences before counting printable length
  991. for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
  992. do
  993. test -n "$_G_tc" && {
  994. _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
  995. _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
  996. }
  997. done
  998. _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
  999. func_echo_infix_1_IFS=$IFS
  1000. IFS=$nl
  1001. for _G_line in $_G_message; do
  1002. IFS=$func_echo_infix_1_IFS
  1003. $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
  1004. _G_prefix=$_G_indent
  1005. done
  1006. IFS=$func_echo_infix_1_IFS
  1007. }
  1008. # func_error ARG...
  1009. # -----------------
  1010. # Echo program name prefixed message to standard error.
  1011. func_error ()
  1012. {
  1013. $debug_cmd
  1014. $require_term_colors
  1015. func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
  1016. }
  1017. # func_fatal_error ARG...
  1018. # -----------------------
  1019. # Echo program name prefixed message to standard error, and exit.
  1020. func_fatal_error ()
  1021. {
  1022. $debug_cmd
  1023. func_error "$*"
  1024. exit $EXIT_FAILURE
  1025. }
  1026. # func_grep EXPRESSION FILENAME
  1027. # -----------------------------
  1028. # Check whether EXPRESSION matches any line of FILENAME, without output.
  1029. func_grep ()
  1030. {
  1031. $debug_cmd
  1032. $GREP "$1" "$2" >/dev/null 2>&1
  1033. }
  1034. # func_len STRING
  1035. # ---------------
  1036. # Set func_len_result to the length of STRING. STRING may not
  1037. # start with a hyphen.
  1038. test -z "$_G_HAVE_XSI_OPS" \
  1039. && (eval 'x=a/b/c;
  1040. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1041. && _G_HAVE_XSI_OPS=yes
  1042. if test yes = "$_G_HAVE_XSI_OPS"; then
  1043. eval 'func_len ()
  1044. {
  1045. $debug_cmd
  1046. func_len_result=${#1}
  1047. }'
  1048. else
  1049. func_len ()
  1050. {
  1051. $debug_cmd
  1052. func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  1053. }
  1054. fi
  1055. # func_mkdir_p DIRECTORY-PATH
  1056. # ---------------------------
  1057. # Make sure the entire path to DIRECTORY-PATH is available.
  1058. func_mkdir_p ()
  1059. {
  1060. $debug_cmd
  1061. _G_directory_path=$1
  1062. _G_dir_list=
  1063. if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
  1064. # Protect directory names starting with '-'
  1065. case $_G_directory_path in
  1066. -*) _G_directory_path=./$_G_directory_path ;;
  1067. esac
  1068. # While some portion of DIR does not yet exist...
  1069. while test ! -d "$_G_directory_path"; do
  1070. # ...make a list in topmost first order. Use a colon delimited
  1071. # list incase some portion of path contains whitespace.
  1072. _G_dir_list=$_G_directory_path:$_G_dir_list
  1073. # If the last portion added has no slash in it, the list is done
  1074. case $_G_directory_path in */*) ;; *) break ;; esac
  1075. # ...otherwise throw away the child directory and loop
  1076. _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
  1077. done
  1078. _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
  1079. func_mkdir_p_IFS=$IFS; IFS=:
  1080. for _G_dir in $_G_dir_list; do
  1081. IFS=$func_mkdir_p_IFS
  1082. # mkdir can fail with a 'File exist' error if two processes
  1083. # try to create one of the directories concurrently. Don't
  1084. # stop in that case!
  1085. $MKDIR "$_G_dir" 2>/dev/null || :
  1086. done
  1087. IFS=$func_mkdir_p_IFS
  1088. # Bail out if we (or some other process) failed to create a directory.
  1089. test -d "$_G_directory_path" || \
  1090. func_fatal_error "Failed to create '$1'"
  1091. fi
  1092. }
  1093. # func_mktempdir [BASENAME]
  1094. # -------------------------
  1095. # Make a temporary directory that won't clash with other running
  1096. # libtool processes, and avoids race conditions if possible. If
  1097. # given, BASENAME is the basename for that directory.
  1098. func_mktempdir ()
  1099. {
  1100. $debug_cmd
  1101. if test : = "$opt_dry_run"; then
  1102. # Return a directory name, but don't create it in dry-run mode
  1103. _G_mktemp='mktemp -dtu'
  1104. else
  1105. _G_mktemp='mktemp -dt'
  1106. fi
  1107. _G_tmpdir=`$_G_mktemp "${1-$progname}-XXXXXXXX"` || \
  1108. func_fatal_error "cannot create temporary directory"
  1109. $ECHO "$_G_tmpdir"
  1110. }
  1111. # func_normal_abspath PATH
  1112. # ------------------------
  1113. # Remove doubled-up and trailing slashes, "." path components,
  1114. # and cancel out any ".." path components in PATH after making
  1115. # it an absolute path.
  1116. func_normal_abspath ()
  1117. {
  1118. $debug_cmd
  1119. # These SED scripts presuppose an absolute path with a trailing slash.
  1120. _G_pathcar='s|^/\([^/]*\).*$|\1|'
  1121. _G_pathcdr='s|^/[^/]*||'
  1122. _G_removedotparts=':dotsl
  1123. s|/\./|/|g
  1124. t dotsl
  1125. s|/\.$|/|'
  1126. _G_collapseslashes='s|/\{1,\}|/|g'
  1127. _G_finalslash='s|/*$|/|'
  1128. # Start from root dir and reassemble the path.
  1129. func_normal_abspath_result=
  1130. func_normal_abspath_tpath=$1
  1131. func_normal_abspath_altnamespace=
  1132. case $func_normal_abspath_tpath in
  1133. "")
  1134. # Empty path, that just means $cwd.
  1135. func_stripname '' '/' "`pwd`"
  1136. func_normal_abspath_result=$func_stripname_result
  1137. return
  1138. ;;
  1139. # The next three entries are used to spot a run of precisely
  1140. # two leading slashes without using negated character classes;
  1141. # we take advantage of case's first-match behaviour.
  1142. ///*)
  1143. # Unusual form of absolute path, do nothing.
  1144. ;;
  1145. //*)
  1146. # Not necessarily an ordinary path; POSIX reserves leading '//'
  1147. # and for example Cygwin uses it to access remote file shares
  1148. # over CIFS/SMB, so we conserve a leading double slash if found.
  1149. func_normal_abspath_altnamespace=/
  1150. ;;
  1151. /*)
  1152. # Absolute path, do nothing.
  1153. ;;
  1154. *)
  1155. # Relative path, prepend $cwd.
  1156. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
  1157. ;;
  1158. esac
  1159. # Cancel out all the simple stuff to save iterations. We also want
  1160. # the path to end with a slash for ease of parsing, so make sure
  1161. # there is one (and only one) here.
  1162. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1163. -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
  1164. while :; do
  1165. # Processed it all yet?
  1166. if test / = "$func_normal_abspath_tpath"; then
  1167. # If we ascended to the root using ".." the result may be empty now.
  1168. if test -z "$func_normal_abspath_result"; then
  1169. func_normal_abspath_result=/
  1170. fi
  1171. break
  1172. fi
  1173. func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1174. -e "$_G_pathcar"`
  1175. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1176. -e "$_G_pathcdr"`
  1177. # Figure out what to do with it
  1178. case $func_normal_abspath_tcomponent in
  1179. "")
  1180. # Trailing empty path component, ignore it.
  1181. ;;
  1182. ..)
  1183. # Parent dir; strip last assembled component from result.
  1184. func_dirname "$func_normal_abspath_result"
  1185. func_normal_abspath_result=$func_dirname_result
  1186. ;;
  1187. *)
  1188. # Actual path component, append it.
  1189. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
  1190. ;;
  1191. esac
  1192. done
  1193. # Restore leading double-slash if one was found on entry.
  1194. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
  1195. }
  1196. # func_notquiet ARG...
  1197. # --------------------
  1198. # Echo program name prefixed message only when not in quiet mode.
  1199. func_notquiet ()
  1200. {
  1201. $debug_cmd
  1202. $opt_quiet || func_echo ${1+"$@"}
  1203. # A bug in bash halts the script if the last line of a function
  1204. # fails when set -e is in force, so we need another command to
  1205. # work around that:
  1206. :
  1207. }
  1208. # func_relative_path SRCDIR DSTDIR
  1209. # --------------------------------
  1210. # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
  1211. func_relative_path ()
  1212. {
  1213. $debug_cmd
  1214. func_relative_path_result=
  1215. func_normal_abspath "$1"
  1216. func_relative_path_tlibdir=$func_normal_abspath_result
  1217. func_normal_abspath "$2"
  1218. func_relative_path_tbindir=$func_normal_abspath_result
  1219. # Ascend the tree starting from libdir
  1220. while :; do
  1221. # check if we have found a prefix of bindir
  1222. case $func_relative_path_tbindir in
  1223. $func_relative_path_tlibdir)
  1224. # found an exact match
  1225. func_relative_path_tcancelled=
  1226. break
  1227. ;;
  1228. $func_relative_path_tlibdir*)
  1229. # found a matching prefix
  1230. func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
  1231. func_relative_path_tcancelled=$func_stripname_result
  1232. if test -z "$func_relative_path_result"; then
  1233. func_relative_path_result=.
  1234. fi
  1235. break
  1236. ;;
  1237. *)
  1238. func_dirname $func_relative_path_tlibdir
  1239. func_relative_path_tlibdir=$func_dirname_result
  1240. if test -z "$func_relative_path_tlibdir"; then
  1241. # Have to descend all the way to the root!
  1242. func_relative_path_result=../$func_relative_path_result
  1243. func_relative_path_tcancelled=$func_relative_path_tbindir
  1244. break
  1245. fi
  1246. func_relative_path_result=../$func_relative_path_result
  1247. ;;
  1248. esac
  1249. done
  1250. # Now calculate path; take care to avoid doubling-up slashes.
  1251. func_stripname '' '/' "$func_relative_path_result"
  1252. func_relative_path_result=$func_stripname_result
  1253. func_stripname '/' '/' "$func_relative_path_tcancelled"
  1254. if test -n "$func_stripname_result"; then
  1255. func_append func_relative_path_result "/$func_stripname_result"
  1256. fi
  1257. # Normalisation. If bindir is libdir, return '.' else relative path.
  1258. if test -n "$func_relative_path_result"; then
  1259. func_stripname './' '' "$func_relative_path_result"
  1260. func_relative_path_result=$func_stripname_result
  1261. fi
  1262. test -n "$func_relative_path_result" || func_relative_path_result=.
  1263. :
  1264. }
  1265. # func_quote_portable EVAL ARG
  1266. # ----------------------------
  1267. # Internal function to portably implement func_quote_arg. Note that we still
  1268. # keep attention to performance here so we as much as possible try to avoid
  1269. # calling sed binary (so far O(N) complexity as long as func_append is O(1)).
  1270. func_quote_portable ()
  1271. {
  1272. $debug_cmd
  1273. func_quote_portable_result=$2
  1274. # one-time-loop (easy break)
  1275. while true
  1276. do
  1277. if $1; then
  1278. func_quote_portable_result=`$ECHO "$2" | $SED \
  1279. -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
  1280. break
  1281. fi
  1282. # Quote for eval.
  1283. case $func_quote_portable_result in
  1284. *[\\\`\"\$]*)
  1285. case $func_quote_portable_result in
  1286. *[\[\*\?]*)
  1287. func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
  1288. | $SED "$sed_quote_subst"`
  1289. break
  1290. ;;
  1291. esac
  1292. func_quote_portable_old_IFS=$IFS
  1293. for _G_char in '\' '`' '"' '$'
  1294. do
  1295. # STATE($1) PREV($2) SEPARATOR($3)
  1296. set start "" ""
  1297. func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
  1298. IFS=$_G_char
  1299. for _G_part in $func_quote_portable_result
  1300. do
  1301. case $1 in
  1302. quote)
  1303. func_append func_quote_portable_result "$3$2"
  1304. set quote "$_G_part" "\\$_G_char"
  1305. ;;
  1306. start)
  1307. set first "" ""
  1308. func_quote_portable_result=
  1309. ;;
  1310. first)
  1311. set quote "$_G_part" ""
  1312. ;;
  1313. esac
  1314. done
  1315. done
  1316. IFS=$func_quote_portable_old_IFS
  1317. ;;
  1318. *) ;;
  1319. esac
  1320. break
  1321. done
  1322. func_quote_portable_unquoted_result=$func_quote_portable_result
  1323. case $func_quote_portable_result in
  1324. # double-quote args containing shell metacharacters to delay
  1325. # word splitting, command substitution and variable expansion
  1326. # for a subsequent eval.
  1327. # many bourne shells cannot handle close brackets correctly
  1328. # in scan sets, so we specify it separately.
  1329. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1330. func_quote_portable_result=\"$func_quote_portable_result\"
  1331. ;;
  1332. esac
  1333. }
  1334. # func_quotefast_eval ARG
  1335. # -----------------------
  1336. # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
  1337. # but optimized for speed. Result is stored in $func_quotefast_eval.
  1338. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
  1339. printf -v _GL_test_printf_tilde %q '~'
  1340. if test '\~' = "$_GL_test_printf_tilde"; then
  1341. func_quotefast_eval ()
  1342. {
  1343. printf -v func_quotefast_eval_result %q "$1"
  1344. }
  1345. else
  1346. # Broken older Bash implementations. Make those faster too if possible.
  1347. func_quotefast_eval ()
  1348. {
  1349. case $1 in
  1350. '~'*)
  1351. func_quote_portable false "$1"
  1352. func_quotefast_eval_result=$func_quote_portable_result
  1353. ;;
  1354. *)
  1355. printf -v func_quotefast_eval_result %q "$1"
  1356. ;;
  1357. esac
  1358. }
  1359. fi
  1360. else
  1361. func_quotefast_eval ()
  1362. {
  1363. func_quote_portable false "$1"
  1364. func_quotefast_eval_result=$func_quote_portable_result
  1365. }
  1366. fi
  1367. # func_quote_arg MODEs ARG
  1368. # ------------------------
  1369. # Quote one ARG to be evaled later. MODEs argument may contain zero or more
  1370. # specifiers listed below separated by ',' character. This function returns two
  1371. # values:
  1372. # i) func_quote_arg_result
  1373. # double-quoted (when needed), suitable for a subsequent eval
  1374. # ii) func_quote_arg_unquoted_result
  1375. # has all characters that are still active within double
  1376. # quotes backslashified. Available only if 'unquoted' is specified.
  1377. #
  1378. # Available modes:
  1379. # ----------------
  1380. # 'eval' (default)
  1381. # - escape shell special characters
  1382. # 'expand'
  1383. # - the same as 'eval'; but do not quote variable references
  1384. # 'pretty'
  1385. # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
  1386. # be used later in func_quote to get output like: 'echo "a b"' instead
  1387. # of 'echo a\ b'. This is slower than default on some shells.
  1388. # 'unquoted'
  1389. # - produce also $func_quote_arg_unquoted_result which does not contain
  1390. # wrapping double-quotes.
  1391. #
  1392. # Examples for 'func_quote_arg pretty,unquoted string':
  1393. #
  1394. # string | *_result | *_unquoted_result
  1395. # ------------+-----------------------+-------------------
  1396. # " | \" | \"
  1397. # a b | "a b" | a b
  1398. # "a b" | "\"a b\"" | \"a b\"
  1399. # * | "*" | *
  1400. # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
  1401. #
  1402. # Examples for 'func_quote_arg pretty,unquoted,expand string':
  1403. #
  1404. # string | *_result | *_unquoted_result
  1405. # --------------+---------------------+--------------------
  1406. # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
  1407. func_quote_arg ()
  1408. {
  1409. _G_quote_expand=false
  1410. case ,$1, in
  1411. *,expand,*)
  1412. _G_quote_expand=:
  1413. ;;
  1414. esac
  1415. case ,$1, in
  1416. *,pretty,*|*,expand,*|*,unquoted,*)
  1417. func_quote_portable $_G_quote_expand "$2"
  1418. func_quote_arg_result=$func_quote_portable_result
  1419. func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
  1420. ;;
  1421. *)
  1422. # Faster quote-for-eval for some shells.
  1423. func_quotefast_eval "$2"
  1424. func_quote_arg_result=$func_quotefast_eval_result
  1425. ;;
  1426. esac
  1427. }
  1428. # func_quote MODEs ARGs...
  1429. # ------------------------
  1430. # Quote all ARGs to be evaled later and join them into single command. See
  1431. # func_quote_arg's description for more info.
  1432. func_quote ()
  1433. {
  1434. $debug_cmd
  1435. _G_func_quote_mode=$1 ; shift
  1436. func_quote_result=
  1437. while test 0 -lt $#; do
  1438. func_quote_arg "$_G_func_quote_mode" "$1"
  1439. if test -n "$func_quote_result"; then
  1440. func_append func_quote_result " $func_quote_arg_result"
  1441. else
  1442. func_append func_quote_result "$func_quote_arg_result"
  1443. fi
  1444. shift
  1445. done
  1446. }
  1447. # func_stripname PREFIX SUFFIX NAME
  1448. # ---------------------------------
  1449. # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
  1450. # PREFIX and SUFFIX must not contain globbing or regex special
  1451. # characters, hashes, percent signs, but SUFFIX may contain a leading
  1452. # dot (in which case that matches only a dot).
  1453. if test yes = "$_G_HAVE_XSI_OPS"; then
  1454. eval 'func_stripname ()
  1455. {
  1456. $debug_cmd
  1457. # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  1458. # positional parameters, so assign one to ordinary variable first.
  1459. func_stripname_result=$3
  1460. func_stripname_result=${func_stripname_result#"$1"}
  1461. func_stripname_result=${func_stripname_result%"$2"}
  1462. }'
  1463. else
  1464. func_stripname ()
  1465. {
  1466. $debug_cmd
  1467. case $2 in
  1468. .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
  1469. *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
  1470. esac
  1471. }
  1472. fi
  1473. # func_show_eval CMD [FAIL_EXP]
  1474. # -----------------------------
  1475. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1476. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1477. # is given, then evaluate it.
  1478. func_show_eval ()
  1479. {
  1480. $debug_cmd
  1481. _G_cmd=$1
  1482. _G_fail_exp=${2-':'}
  1483. func_quote_arg pretty,expand "$_G_cmd"
  1484. eval "func_notquiet $func_quote_arg_result"
  1485. $opt_dry_run || {
  1486. eval "$_G_cmd"
  1487. _G_status=$?
  1488. if test 0 -ne "$_G_status"; then
  1489. eval "(exit $_G_status); $_G_fail_exp"
  1490. fi
  1491. }
  1492. }
  1493. # func_show_eval_locale CMD [FAIL_EXP]
  1494. # ------------------------------------
  1495. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1496. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1497. # is given, then evaluate it. Use the saved locale for evaluation.
  1498. func_show_eval_locale ()
  1499. {
  1500. $debug_cmd
  1501. _G_cmd=$1
  1502. _G_fail_exp=${2-':'}
  1503. $opt_quiet || {
  1504. func_quote_arg expand,pretty "$_G_cmd"
  1505. eval "func_echo $func_quote_arg_result"
  1506. }
  1507. $opt_dry_run || {
  1508. eval "$_G_user_locale
  1509. $_G_cmd"
  1510. _G_status=$?
  1511. eval "$_G_safe_locale"
  1512. if test 0 -ne "$_G_status"; then
  1513. eval "(exit $_G_status); $_G_fail_exp"
  1514. fi
  1515. }
  1516. }
  1517. # func_tr_sh
  1518. # ----------
  1519. # Turn $1 into a string suitable for a shell variable name.
  1520. # Result is stored in $func_tr_sh_result. All characters
  1521. # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
  1522. # if $1 begins with a digit, a '_' is prepended as well.
  1523. func_tr_sh ()
  1524. {
  1525. $debug_cmd
  1526. case $1 in
  1527. [0-9]* | *[!a-zA-Z0-9_]*)
  1528. func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
  1529. ;;
  1530. * )
  1531. func_tr_sh_result=$1
  1532. ;;
  1533. esac
  1534. }
  1535. # func_verbose ARG...
  1536. # -------------------
  1537. # Echo program name prefixed message in verbose mode only.
  1538. func_verbose ()
  1539. {
  1540. $debug_cmd
  1541. $opt_verbose && func_echo "$*"
  1542. :
  1543. }
  1544. # func_warn_and_continue ARG...
  1545. # -----------------------------
  1546. # Echo program name prefixed warning message to standard error.
  1547. func_warn_and_continue ()
  1548. {
  1549. $debug_cmd
  1550. $require_term_colors
  1551. func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
  1552. }
  1553. # func_warning CATEGORY ARG...
  1554. # ----------------------------
  1555. # Echo program name prefixed warning message to standard error. Warning
  1556. # messages can be filtered according to CATEGORY, where this function
  1557. # elides messages where CATEGORY is not listed in the global variable
  1558. # 'opt_warning_types'.
  1559. func_warning ()
  1560. {
  1561. $debug_cmd
  1562. # CATEGORY must be in the warning_categories list!
  1563. case " $warning_categories " in
  1564. *" $1 "*) ;;
  1565. *) func_internal_error "invalid warning category '$1'" ;;
  1566. esac
  1567. _G_category=$1
  1568. shift
  1569. case " $opt_warning_types " in
  1570. *" $_G_category "*) $warning_func ${1+"$@"} ;;
  1571. esac
  1572. }
  1573. # func_sort_ver VER1 VER2
  1574. # -----------------------
  1575. # 'sort -V' is not generally available.
  1576. # Note this deviates from the version comparison in automake
  1577. # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
  1578. # but this should suffice as we won't be specifying old
  1579. # version formats or redundant trailing .0 in bootstrap.conf.
  1580. # If we did want full compatibility then we should probably
  1581. # use m4_version_compare from autoconf.
  1582. func_sort_ver ()
  1583. {
  1584. $debug_cmd
  1585. printf '%s\n%s\n' "$1" "$2" \
  1586. | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
  1587. }
  1588. # func_lt_ver PREV CURR
  1589. # ---------------------
  1590. # Return true if PREV and CURR are in the correct order according to
  1591. # func_sort_ver, otherwise false. Use it like this:
  1592. #
  1593. # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
  1594. func_lt_ver ()
  1595. {
  1596. $debug_cmd
  1597. test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
  1598. }
  1599. # Local variables:
  1600. # mode: shell-script
  1601. # sh-indentation: 2
  1602. # eval: (add-hook 'before-save-hook 'time-stamp)
  1603. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  1604. # time-stamp-time-zone: "UTC"
  1605. # End:
  1606. #! /bin/sh
  1607. # A portable, pluggable option parser for Bourne shell.
  1608. # Written by Gary V. Vaughan, 2010
  1609. # This is free software. There is NO warranty; not even for
  1610. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1611. #
  1612. # Copyright (C) 2010-2019 Bootstrap Authors
  1613. #
  1614. # This file is dual licensed under the terms of the MIT license
  1615. # <https://opensource.org/license/MIT>, and GPL version 2 or later
  1616. # <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
  1617. # these licenses when using or redistributing this software or any of
  1618. # the files within it. See the URLs above, or the file `LICENSE`
  1619. # included in the Bootstrap distribution for the full license texts.
  1620. # Please report bugs or propose patches to:
  1621. # <https://github.com/gnulib-modules/bootstrap/issues>
  1622. # Set a version string for this script.
  1623. scriptversion=2019-02-19.15; # UTC
  1624. ## ------ ##
  1625. ## Usage. ##
  1626. ## ------ ##
  1627. # This file is a library for parsing options in your shell scripts along
  1628. # with assorted other useful supporting features that you can make use
  1629. # of too.
  1630. #
  1631. # For the simplest scripts you might need only:
  1632. #
  1633. # #!/bin/sh
  1634. # . relative/path/to/funclib.sh
  1635. # . relative/path/to/options-parser
  1636. # scriptversion=1.0
  1637. # func_options ${1+"$@"}
  1638. # eval set dummy "$func_options_result"; shift
  1639. # ...rest of your script...
  1640. #
  1641. # In order for the '--version' option to work, you will need to have a
  1642. # suitably formatted comment like the one at the top of this file
  1643. # starting with '# Written by ' and ending with '# Copyright'.
  1644. #
  1645. # For '-h' and '--help' to work, you will also need a one line
  1646. # description of your script's purpose in a comment directly above the
  1647. # '# Written by ' line, like the one at the top of this file.
  1648. #
  1649. # The default options also support '--debug', which will turn on shell
  1650. # execution tracing (see the comment above debug_cmd below for another
  1651. # use), and '--verbose' and the func_verbose function to allow your script
  1652. # to display verbose messages only when your user has specified
  1653. # '--verbose'.
  1654. #
  1655. # After sourcing this file, you can plug in processing for additional
  1656. # options by amending the variables from the 'Configuration' section
  1657. # below, and following the instructions in the 'Option parsing'
  1658. # section further down.
  1659. ## -------------- ##
  1660. ## Configuration. ##
  1661. ## -------------- ##
  1662. # You should override these variables in your script after sourcing this
  1663. # file so that they reflect the customisations you have added to the
  1664. # option parser.
  1665. # The usage line for option parsing errors and the start of '-h' and
  1666. # '--help' output messages. You can embed shell variables for delayed
  1667. # expansion at the time the message is displayed, but you will need to
  1668. # quote other shell meta-characters carefully to prevent them being
  1669. # expanded when the contents are evaled.
  1670. usage='$progpath [OPTION]...'
  1671. # Short help message in response to '-h' and '--help'. Add to this or
  1672. # override it after sourcing this library to reflect the full set of
  1673. # options your script accepts.
  1674. usage_message="\
  1675. --debug enable verbose shell tracing
  1676. -W, --warnings=CATEGORY
  1677. report the warnings falling in CATEGORY [all]
  1678. -v, --verbose verbosely report processing
  1679. --version print version information and exit
  1680. -h, --help print short or long help message and exit
  1681. "
  1682. # Additional text appended to 'usage_message' in response to '--help'.
  1683. long_help_message="
  1684. Warning categories include:
  1685. 'all' show all warnings
  1686. 'none' turn off all the warnings
  1687. 'error' warnings are treated as fatal errors"
  1688. # Help message printed before fatal option parsing errors.
  1689. fatal_help="Try '\$progname --help' for more information."
  1690. ## ------------------------- ##
  1691. ## Hook function management. ##
  1692. ## ------------------------- ##
  1693. # This section contains functions for adding, removing, and running hooks
  1694. # in the main code. A hook is just a list of function names that can be
  1695. # run in order later on.
  1696. # func_hookable FUNC_NAME
  1697. # -----------------------
  1698. # Declare that FUNC_NAME will run hooks added with
  1699. # 'func_add_hook FUNC_NAME ...'.
  1700. func_hookable ()
  1701. {
  1702. $debug_cmd
  1703. func_append hookable_fns " $1"
  1704. }
  1705. # func_add_hook FUNC_NAME HOOK_FUNC
  1706. # ---------------------------------
  1707. # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
  1708. # first have been declared "hookable" by a call to 'func_hookable'.
  1709. func_add_hook ()
  1710. {
  1711. $debug_cmd
  1712. case " $hookable_fns " in
  1713. *" $1 "*) ;;
  1714. *) func_fatal_error "'$1' does not accept hook functions." ;;
  1715. esac
  1716. eval func_append ${1}_hooks '" $2"'
  1717. }
  1718. # func_remove_hook FUNC_NAME HOOK_FUNC
  1719. # ------------------------------------
  1720. # Remove HOOK_FUNC from the list of hook functions to be called by
  1721. # FUNC_NAME.
  1722. func_remove_hook ()
  1723. {
  1724. $debug_cmd
  1725. eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
  1726. }
  1727. # func_propagate_result FUNC_NAME_A FUNC_NAME_B
  1728. # ---------------------------------------------
  1729. # If the *_result variable of FUNC_NAME_A _is set_, assign its value to
  1730. # *_result variable of FUNC_NAME_B.
  1731. func_propagate_result ()
  1732. {
  1733. $debug_cmd
  1734. func_propagate_result_result=:
  1735. if eval "test \"\${${1}_result+set}\" = set"
  1736. then
  1737. eval "${2}_result=\$${1}_result"
  1738. else
  1739. func_propagate_result_result=false
  1740. fi
  1741. }
  1742. # func_run_hooks FUNC_NAME [ARG]...
  1743. # ---------------------------------
  1744. # Run all hook functions registered to FUNC_NAME.
  1745. # It's assumed that the list of hook functions contains nothing more
  1746. # than a whitespace-delimited list of legal shell function names, and
  1747. # no effort is wasted trying to catch shell meta-characters or preserve
  1748. # whitespace.
  1749. func_run_hooks ()
  1750. {
  1751. $debug_cmd
  1752. case " $hookable_fns " in
  1753. *" $1 "*) ;;
  1754. *) func_fatal_error "'$1' does not support hook functions." ;;
  1755. esac
  1756. eval _G_hook_fns=\$$1_hooks; shift
  1757. for _G_hook in $_G_hook_fns; do
  1758. func_unset "${_G_hook}_result"
  1759. eval $_G_hook '${1+"$@"}'
  1760. func_propagate_result $_G_hook func_run_hooks
  1761. if $func_propagate_result_result; then
  1762. eval set dummy "$func_run_hooks_result"; shift
  1763. fi
  1764. done
  1765. }
  1766. ## --------------- ##
  1767. ## Option parsing. ##
  1768. ## --------------- ##
  1769. # In order to add your own option parsing hooks, you must accept the
  1770. # full positional parameter list from your hook function. You may remove
  1771. # or edit any options that you action, and then pass back the remaining
  1772. # unprocessed options in '<hooked_function_name>_result', escaped
  1773. # suitably for 'eval'.
  1774. #
  1775. # The '<hooked_function_name>_result' variable is automatically unset
  1776. # before your hook gets called; for best performance, only set the
  1777. # *_result variable when necessary (i.e. don't call the 'func_quote'
  1778. # function unnecessarily because it can be an expensive operation on some
  1779. # machines).
  1780. #
  1781. # Like this:
  1782. #
  1783. # my_options_prep ()
  1784. # {
  1785. # $debug_cmd
  1786. #
  1787. # # Extend the existing usage message.
  1788. # usage_message=$usage_message'
  1789. # -s, --silent don'\''t print informational messages
  1790. # '
  1791. # # No change in '$@' (ignored completely by this hook). Leave
  1792. # # my_options_prep_result variable intact.
  1793. # }
  1794. # func_add_hook func_options_prep my_options_prep
  1795. #
  1796. #
  1797. # my_silent_option ()
  1798. # {
  1799. # $debug_cmd
  1800. #
  1801. # args_changed=false
  1802. #
  1803. # # Note that, for efficiency, we parse as many options as we can
  1804. # # recognise in a loop before passing the remainder back to the
  1805. # # caller on the first unrecognised argument we encounter.
  1806. # while test $# -gt 0; do
  1807. # opt=$1; shift
  1808. # case $opt in
  1809. # --silent|-s) opt_silent=:
  1810. # args_changed=:
  1811. # ;;
  1812. # # Separate non-argument short options:
  1813. # -s*) func_split_short_opt "$_G_opt"
  1814. # set dummy "$func_split_short_opt_name" \
  1815. # "-$func_split_short_opt_arg" ${1+"$@"}
  1816. # shift
  1817. # args_changed=:
  1818. # ;;
  1819. # *) # Make sure the first unrecognised option "$_G_opt"
  1820. # # is added back to "$@" in case we need it later,
  1821. # # if $args_changed was set to 'true'.
  1822. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  1823. # esac
  1824. # done
  1825. #
  1826. # # Only call 'func_quote' here if we processed at least one argument.
  1827. # if $args_changed; then
  1828. # func_quote eval ${1+"$@"}
  1829. # my_silent_option_result=$func_quote_result
  1830. # fi
  1831. # }
  1832. # func_add_hook func_parse_options my_silent_option
  1833. #
  1834. #
  1835. # my_option_validation ()
  1836. # {
  1837. # $debug_cmd
  1838. #
  1839. # $opt_silent && $opt_verbose && func_fatal_help "\
  1840. # '--silent' and '--verbose' options are mutually exclusive."
  1841. # }
  1842. # func_add_hook func_validate_options my_option_validation
  1843. #
  1844. # You'll also need to manually amend $usage_message to reflect the extra
  1845. # options you parse. It's preferable to append if you can, so that
  1846. # multiple option parsing hooks can be added safely.
  1847. # func_options_finish [ARG]...
  1848. # ----------------------------
  1849. # Finishing the option parse loop (call 'func_options' hooks ATM).
  1850. func_options_finish ()
  1851. {
  1852. $debug_cmd
  1853. func_run_hooks func_options ${1+"$@"}
  1854. func_propagate_result func_run_hooks func_options_finish
  1855. }
  1856. # func_options [ARG]...
  1857. # ---------------------
  1858. # All the functions called inside func_options are hookable. See the
  1859. # individual implementations for details.
  1860. func_hookable func_options
  1861. func_options ()
  1862. {
  1863. $debug_cmd
  1864. _G_options_quoted=false
  1865. for my_func in options_prep parse_options validate_options options_finish
  1866. do
  1867. func_unset func_${my_func}_result
  1868. func_unset func_run_hooks_result
  1869. eval func_$my_func '${1+"$@"}'
  1870. func_propagate_result func_$my_func func_options
  1871. if $func_propagate_result_result; then
  1872. eval set dummy "$func_options_result"; shift
  1873. _G_options_quoted=:
  1874. fi
  1875. done
  1876. $_G_options_quoted || {
  1877. # As we (func_options) are top-level options-parser function and
  1878. # nobody quoted "$@" for us yet, we need to do it explicitly for
  1879. # caller.
  1880. func_quote eval ${1+"$@"}
  1881. func_options_result=$func_quote_result
  1882. }
  1883. }
  1884. # func_options_prep [ARG]...
  1885. # --------------------------
  1886. # All initialisations required before starting the option parse loop.
  1887. # Note that when calling hook functions, we pass through the list of
  1888. # positional parameters. If a hook function modifies that list, and
  1889. # needs to propagate that back to rest of this script, then the complete
  1890. # modified list must be put in 'func_run_hooks_result' before returning.
  1891. func_hookable func_options_prep
  1892. func_options_prep ()
  1893. {
  1894. $debug_cmd
  1895. # Option defaults:
  1896. opt_verbose=false
  1897. opt_warning_types=
  1898. func_run_hooks func_options_prep ${1+"$@"}
  1899. func_propagate_result func_run_hooks func_options_prep
  1900. }
  1901. # func_parse_options [ARG]...
  1902. # ---------------------------
  1903. # The main option parsing loop.
  1904. func_hookable func_parse_options
  1905. func_parse_options ()
  1906. {
  1907. $debug_cmd
  1908. _G_parse_options_requote=false
  1909. # this just eases exit handling
  1910. while test $# -gt 0; do
  1911. # Defer to hook functions for initial option parsing, so they
  1912. # get priority in the event of reusing an option name.
  1913. func_run_hooks func_parse_options ${1+"$@"}
  1914. func_propagate_result func_run_hooks func_parse_options
  1915. if $func_propagate_result_result; then
  1916. eval set dummy "$func_parse_options_result"; shift
  1917. # Even though we may have changed "$@", we passed the "$@" array
  1918. # down into the hook and it quoted it for us (because we are in
  1919. # this if-branch). No need to quote it again.
  1920. _G_parse_options_requote=false
  1921. fi
  1922. # Break out of the loop if we already parsed every option.
  1923. test $# -gt 0 || break
  1924. # We expect that one of the options parsed in this function matches
  1925. # and thus we remove _G_opt from "$@" and need to re-quote.
  1926. _G_match_parse_options=:
  1927. _G_opt=$1
  1928. shift
  1929. case $_G_opt in
  1930. --debug|-x) debug_cmd='set -x'
  1931. func_echo "enabling shell trace mode" >&2
  1932. $debug_cmd
  1933. ;;
  1934. --no-warnings|--no-warning|--no-warn)
  1935. set dummy --warnings none ${1+"$@"}
  1936. shift
  1937. ;;
  1938. --warnings|--warning|-W)
  1939. if test $# = 0 && func_missing_arg $_G_opt; then
  1940. _G_parse_options_requote=:
  1941. break
  1942. fi
  1943. case " $warning_categories $1" in
  1944. *" $1 "*)
  1945. # trailing space prevents matching last $1 above
  1946. func_append_uniq opt_warning_types " $1"
  1947. ;;
  1948. *all)
  1949. opt_warning_types=$warning_categories
  1950. ;;
  1951. *none)
  1952. opt_warning_types=none
  1953. warning_func=:
  1954. ;;
  1955. *error)
  1956. opt_warning_types=$warning_categories
  1957. warning_func=func_fatal_error
  1958. ;;
  1959. *)
  1960. func_fatal_error \
  1961. "unsupported warning category: '$1'"
  1962. ;;
  1963. esac
  1964. shift
  1965. ;;
  1966. --verbose|-v) opt_verbose=: ;;
  1967. --version) func_version ;;
  1968. -\?|-h) func_usage ;;
  1969. --help) func_help ;;
  1970. # Separate optargs to long options (plugins may need this):
  1971. --*=*) func_split_equals "$_G_opt"
  1972. set dummy "$func_split_equals_lhs" \
  1973. "$func_split_equals_rhs" ${1+"$@"}
  1974. shift
  1975. ;;
  1976. # Separate optargs to short options:
  1977. -W*)
  1978. func_split_short_opt "$_G_opt"
  1979. set dummy "$func_split_short_opt_name" \
  1980. "$func_split_short_opt_arg" ${1+"$@"}
  1981. shift
  1982. ;;
  1983. # Separate non-argument short options:
  1984. -\?*|-h*|-v*|-x*)
  1985. func_split_short_opt "$_G_opt"
  1986. set dummy "$func_split_short_opt_name" \
  1987. "-$func_split_short_opt_arg" ${1+"$@"}
  1988. shift
  1989. ;;
  1990. --) _G_parse_options_requote=: ; break ;;
  1991. -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
  1992. *) set dummy "$_G_opt" ${1+"$@"}; shift
  1993. _G_match_parse_options=false
  1994. break
  1995. ;;
  1996. esac
  1997. if $_G_match_parse_options; then
  1998. _G_parse_options_requote=:
  1999. fi
  2000. done
  2001. if $_G_parse_options_requote; then
  2002. # save modified positional parameters for caller
  2003. func_quote eval ${1+"$@"}
  2004. func_parse_options_result=$func_quote_result
  2005. fi
  2006. }
  2007. # func_validate_options [ARG]...
  2008. # ------------------------------
  2009. # Perform any sanity checks on option settings and/or unconsumed
  2010. # arguments.
  2011. func_hookable func_validate_options
  2012. func_validate_options ()
  2013. {
  2014. $debug_cmd
  2015. # Display all warnings if -W was not given.
  2016. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  2017. func_run_hooks func_validate_options ${1+"$@"}
  2018. func_propagate_result func_run_hooks func_validate_options
  2019. # Bail if the options were screwed!
  2020. $exit_cmd $EXIT_FAILURE
  2021. }
  2022. ## ----------------- ##
  2023. ## Helper functions. ##
  2024. ## ----------------- ##
  2025. # This section contains the helper functions used by the rest of the
  2026. # hookable option parser framework in ascii-betical order.
  2027. # func_fatal_help ARG...
  2028. # ----------------------
  2029. # Echo program name prefixed message to standard error, followed by
  2030. # a help hint, and exit.
  2031. func_fatal_help ()
  2032. {
  2033. $debug_cmd
  2034. eval \$ECHO \""Usage: $usage"\"
  2035. eval \$ECHO \""$fatal_help"\"
  2036. func_error ${1+"$@"}
  2037. exit $EXIT_FAILURE
  2038. }
  2039. # func_help
  2040. # ---------
  2041. # Echo long help message to standard output and exit.
  2042. func_help ()
  2043. {
  2044. $debug_cmd
  2045. func_usage_message
  2046. $ECHO "$long_help_message"
  2047. exit 0
  2048. }
  2049. # func_missing_arg ARGNAME
  2050. # ------------------------
  2051. # Echo program name prefixed message to standard error and set global
  2052. # exit_cmd.
  2053. func_missing_arg ()
  2054. {
  2055. $debug_cmd
  2056. func_error "Missing argument for '$1'."
  2057. exit_cmd=exit
  2058. }
  2059. # func_split_equals STRING
  2060. # ------------------------
  2061. # Set func_split_equals_lhs and func_split_equals_rhs shell variables
  2062. # after splitting STRING at the '=' sign.
  2063. test -z "$_G_HAVE_XSI_OPS" \
  2064. && (eval 'x=a/b/c;
  2065. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  2066. && _G_HAVE_XSI_OPS=yes
  2067. if test yes = "$_G_HAVE_XSI_OPS"
  2068. then
  2069. # This is an XSI compatible shell, allowing a faster implementation...
  2070. eval 'func_split_equals ()
  2071. {
  2072. $debug_cmd
  2073. func_split_equals_lhs=${1%%=*}
  2074. func_split_equals_rhs=${1#*=}
  2075. if test "x$func_split_equals_lhs" = "x$1"; then
  2076. func_split_equals_rhs=
  2077. fi
  2078. }'
  2079. else
  2080. # ...otherwise fall back to using expr, which is often a shell builtin.
  2081. func_split_equals ()
  2082. {
  2083. $debug_cmd
  2084. func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
  2085. func_split_equals_rhs=
  2086. test "x$func_split_equals_lhs" = "x$1" \
  2087. || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  2088. }
  2089. fi #func_split_equals
  2090. # func_split_short_opt SHORTOPT
  2091. # -----------------------------
  2092. # Set func_split_short_opt_name and func_split_short_opt_arg shell
  2093. # variables after splitting SHORTOPT after the 2nd character.
  2094. if test yes = "$_G_HAVE_XSI_OPS"
  2095. then
  2096. # This is an XSI compatible shell, allowing a faster implementation...
  2097. eval 'func_split_short_opt ()
  2098. {
  2099. $debug_cmd
  2100. func_split_short_opt_arg=${1#??}
  2101. func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  2102. }'
  2103. else
  2104. # ...otherwise fall back to using expr, which is often a shell builtin.
  2105. func_split_short_opt ()
  2106. {
  2107. $debug_cmd
  2108. func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
  2109. func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  2110. }
  2111. fi #func_split_short_opt
  2112. # func_usage
  2113. # ----------
  2114. # Echo short help message to standard output and exit.
  2115. func_usage ()
  2116. {
  2117. $debug_cmd
  2118. func_usage_message
  2119. $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
  2120. exit 0
  2121. }
  2122. # func_usage_message
  2123. # ------------------
  2124. # Echo short help message to standard output.
  2125. func_usage_message ()
  2126. {
  2127. $debug_cmd
  2128. eval \$ECHO \""Usage: $usage"\"
  2129. echo
  2130. $SED -n 's|^# ||
  2131. /^Written by/{
  2132. x;p;x
  2133. }
  2134. h
  2135. /^Written by/q' < "$progpath"
  2136. echo
  2137. eval \$ECHO \""$usage_message"\"
  2138. }
  2139. # func_version
  2140. # ------------
  2141. # Echo version message to standard output and exit.
  2142. # The version message is extracted from the calling file's header
  2143. # comments, with leading '# ' stripped:
  2144. # 1. First display the progname and version
  2145. # 2. Followed by the header comment line matching /^# Written by /
  2146. # 3. Then a blank line followed by the first following line matching
  2147. # /^# Copyright /
  2148. # 4. Immediately followed by any lines between the previous matches,
  2149. # except lines preceding the intervening completely blank line.
  2150. # For example, see the header comments of this file.
  2151. func_version ()
  2152. {
  2153. $debug_cmd
  2154. printf '%s\n' "$progname $scriptversion"
  2155. $SED -n '
  2156. /^# Written by /!b
  2157. s|^# ||; p; n
  2158. :fwd2blnk
  2159. /./ {
  2160. n
  2161. b fwd2blnk
  2162. }
  2163. p; n
  2164. :holdwrnt
  2165. s|^# ||
  2166. s|^# *$||
  2167. /^Copyright /!{
  2168. /./H
  2169. n
  2170. b holdwrnt
  2171. }
  2172. s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
  2173. G
  2174. s|\(\n\)\n*|\1|g
  2175. p; q' < "$progpath"
  2176. exit $?
  2177. }
  2178. # Local variables:
  2179. # mode: shell-script
  2180. # sh-indentation: 2
  2181. # eval: (add-hook 'before-save-hook 'time-stamp)
  2182. # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  2183. # time-stamp-time-zone: "UTC"
  2184. # End:
  2185. # Set a version string.
  2186. scriptversion='(GNU libtool) 2.4.6'
  2187. # func_echo ARG...
  2188. # ----------------
  2189. # Libtool also displays the current mode in messages, so override
  2190. # funclib.sh func_echo with this custom definition.
  2191. func_echo ()
  2192. {
  2193. $debug_cmd
  2194. _G_message=$*
  2195. func_echo_IFS=$IFS
  2196. IFS=$nl
  2197. for _G_line in $_G_message; do
  2198. IFS=$func_echo_IFS
  2199. $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
  2200. done
  2201. IFS=$func_echo_IFS
  2202. }
  2203. # func_warning ARG...
  2204. # -------------------
  2205. # Libtool warnings are not categorized, so override funclib.sh
  2206. # func_warning with this simpler definition.
  2207. func_warning ()
  2208. {
  2209. $debug_cmd
  2210. $warning_func ${1+"$@"}
  2211. }
  2212. ## ---------------- ##
  2213. ## Options parsing. ##
  2214. ## ---------------- ##
  2215. # Hook in the functions to make sure our own options are parsed during
  2216. # the option parsing loop.
  2217. usage='$progpath [OPTION]... [MODE-ARG]...'
  2218. # Short help message in response to '-h'.
  2219. usage_message="Options:
  2220. --config show all configuration variables
  2221. --debug enable verbose shell tracing
  2222. -n, --dry-run display commands without modifying any files
  2223. --features display basic configuration information and exit
  2224. --mode=MODE use operation mode MODE
  2225. --no-warnings equivalent to '-Wnone'
  2226. --preserve-dup-deps don't remove duplicate dependency libraries
  2227. --quiet, --silent don't print informational messages
  2228. --tag=TAG use configuration variables from tag TAG
  2229. -v, --verbose print more informational messages than default
  2230. --version print version information
  2231. -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
  2232. -h, --help, --help-all print short, long, or detailed help message
  2233. "
  2234. # Additional text appended to 'usage_message' in response to '--help'.
  2235. func_help ()
  2236. {
  2237. $debug_cmd
  2238. func_usage_message
  2239. $ECHO "$long_help_message
  2240. MODE must be one of the following:
  2241. clean remove files from the build directory
  2242. compile compile a source file into a libtool object
  2243. execute automatically set library path, then run a program
  2244. finish complete the installation of libtool libraries
  2245. install install libraries or executables
  2246. link create a library or an executable
  2247. uninstall remove libraries from an installed directory
  2248. MODE-ARGS vary depending on the MODE. When passed as first option,
  2249. '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
  2250. Try '$progname --help --mode=MODE' for a more detailed description of MODE.
  2251. When reporting a bug, please describe a test case to reproduce it and
  2252. include the following information:
  2253. host-triplet: $host
  2254. shell: $SHELL
  2255. compiler: $LTCC
  2256. compiler flags: $LTCFLAGS
  2257. linker: $LD (gnu? $with_gnu_ld)
  2258. version: $progname (GNU libtool) 2.4.6
  2259. automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
  2260. autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
  2261. Report bugs to <bug-libtool@gnu.org>.
  2262. GNU libtool home page: <http://www.gnu.org/s/libtool/>.
  2263. General help using GNU software: <http://www.gnu.org/gethelp/>."
  2264. exit 0
  2265. }
  2266. # func_lo2o OBJECT-NAME
  2267. # ---------------------
  2268. # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
  2269. # object suffix.
  2270. lo2o=s/\\.lo\$/.$objext/
  2271. o2lo=s/\\.$objext\$/.lo/
  2272. if test yes = "$_G_HAVE_XSI_OPS"; then
  2273. eval 'func_lo2o ()
  2274. {
  2275. case $1 in
  2276. *.lo) func_lo2o_result=${1%.lo}.$objext ;;
  2277. * ) func_lo2o_result=$1 ;;
  2278. esac
  2279. }'
  2280. # func_xform LIBOBJ-OR-SOURCE
  2281. # ---------------------------
  2282. # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
  2283. # suffix to a '.lo' libtool-object suffix.
  2284. eval 'func_xform ()
  2285. {
  2286. func_xform_result=${1%.*}.lo
  2287. }'
  2288. else
  2289. # ...otherwise fall back to using sed.
  2290. func_lo2o ()
  2291. {
  2292. func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
  2293. }
  2294. func_xform ()
  2295. {
  2296. func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
  2297. }
  2298. fi
  2299. # func_fatal_configuration ARG...
  2300. # -------------------------------
  2301. # Echo program name prefixed message to standard error, followed by
  2302. # a configuration failure hint, and exit.
  2303. func_fatal_configuration ()
  2304. {
  2305. func_fatal_error ${1+"$@"} \
  2306. "See the $PACKAGE documentation for more information." \
  2307. "Fatal configuration error."
  2308. }
  2309. # func_config
  2310. # -----------
  2311. # Display the configuration for all the tags in this script.
  2312. func_config ()
  2313. {
  2314. re_begincf='^# ### BEGIN LIBTOOL'
  2315. re_endcf='^# ### END LIBTOOL'
  2316. # Default configuration.
  2317. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  2318. # Now print the configurations for the tags.
  2319. for tagname in $taglist; do
  2320. $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  2321. done
  2322. exit $?
  2323. }
  2324. # func_features
  2325. # -------------
  2326. # Display the features supported by this script.
  2327. func_features ()
  2328. {
  2329. echo "host: $host"
  2330. if test yes = "$build_libtool_libs"; then
  2331. echo "enable shared libraries"
  2332. else
  2333. echo "disable shared libraries"
  2334. fi
  2335. if test yes = "$build_old_libs"; then
  2336. echo "enable static libraries"
  2337. else
  2338. echo "disable static libraries"
  2339. fi
  2340. exit $?
  2341. }
  2342. # func_enable_tag TAGNAME
  2343. # -----------------------
  2344. # Verify that TAGNAME is valid, and either flag an error and exit, or
  2345. # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  2346. # variable here.
  2347. func_enable_tag ()
  2348. {
  2349. # Global variable:
  2350. tagname=$1
  2351. re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  2352. re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  2353. sed_extractcf=/$re_begincf/,/$re_endcf/p
  2354. # Validate tagname.
  2355. case $tagname in
  2356. *[!-_A-Za-z0-9,/]*)
  2357. func_fatal_error "invalid tag name: $tagname"
  2358. ;;
  2359. esac
  2360. # Don't test for the "default" C tag, as we know it's
  2361. # there but not specially marked.
  2362. case $tagname in
  2363. CC) ;;
  2364. *)
  2365. if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  2366. taglist="$taglist $tagname"
  2367. # Evaluate the configuration. Be careful to quote the path
  2368. # and the sed script, to avoid splitting on whitespace, but
  2369. # also don't use non-portable quotes within backquotes within
  2370. # quotes we have to do it in 2 steps:
  2371. extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  2372. eval "$extractedcf"
  2373. else
  2374. func_error "ignoring unknown tag $tagname"
  2375. fi
  2376. ;;
  2377. esac
  2378. }
  2379. # func_check_version_match
  2380. # ------------------------
  2381. # Ensure that we are using m4 macros, and libtool script from the same
  2382. # release of libtool.
  2383. func_check_version_match ()
  2384. {
  2385. if test "$package_revision" != "$macro_revision"; then
  2386. if test "$VERSION" != "$macro_version"; then
  2387. if test -z "$macro_version"; then
  2388. cat >&2 <<_LT_EOF
  2389. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2390. $progname: definition of this LT_INIT comes from an older release.
  2391. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2392. $progname: and run autoconf again.
  2393. _LT_EOF
  2394. else
  2395. cat >&2 <<_LT_EOF
  2396. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2397. $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  2398. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2399. $progname: and run autoconf again.
  2400. _LT_EOF
  2401. fi
  2402. else
  2403. cat >&2 <<_LT_EOF
  2404. $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  2405. $progname: but the definition of this LT_INIT comes from revision $macro_revision.
  2406. $progname: You should recreate aclocal.m4 with macros from revision $package_revision
  2407. $progname: of $PACKAGE $VERSION and run autoconf again.
  2408. _LT_EOF
  2409. fi
  2410. exit $EXIT_MISMATCH
  2411. fi
  2412. }
  2413. # libtool_options_prep [ARG]...
  2414. # -----------------------------
  2415. # Preparation for options parsed by libtool.
  2416. libtool_options_prep ()
  2417. {
  2418. $debug_mode
  2419. # Option defaults:
  2420. opt_config=false
  2421. opt_dlopen=
  2422. opt_dry_run=false
  2423. opt_help=false
  2424. opt_mode=
  2425. opt_preserve_dup_deps=false
  2426. opt_quiet=false
  2427. nonopt=
  2428. preserve_args=
  2429. _G_rc_lt_options_prep=:
  2430. # Shorthand for --mode=foo, only valid as the first argument
  2431. case $1 in
  2432. clean|clea|cle|cl)
  2433. shift; set dummy --mode clean ${1+"$@"}; shift
  2434. ;;
  2435. compile|compil|compi|comp|com|co|c)
  2436. shift; set dummy --mode compile ${1+"$@"}; shift
  2437. ;;
  2438. execute|execut|execu|exec|exe|ex|e)
  2439. shift; set dummy --mode execute ${1+"$@"}; shift
  2440. ;;
  2441. finish|finis|fini|fin|fi|f)
  2442. shift; set dummy --mode finish ${1+"$@"}; shift
  2443. ;;
  2444. install|instal|insta|inst|ins|in|i)
  2445. shift; set dummy --mode install ${1+"$@"}; shift
  2446. ;;
  2447. link|lin|li|l)
  2448. shift; set dummy --mode link ${1+"$@"}; shift
  2449. ;;
  2450. uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  2451. shift; set dummy --mode uninstall ${1+"$@"}; shift
  2452. ;;
  2453. *)
  2454. _G_rc_lt_options_prep=false
  2455. ;;
  2456. esac
  2457. if $_G_rc_lt_options_prep; then
  2458. # Pass back the list of options.
  2459. func_quote eval ${1+"$@"}
  2460. libtool_options_prep_result=$func_quote_result
  2461. fi
  2462. }
  2463. func_add_hook func_options_prep libtool_options_prep
  2464. # libtool_parse_options [ARG]...
  2465. # ---------------------------------
  2466. # Provide handling for libtool specific options.
  2467. libtool_parse_options ()
  2468. {
  2469. $debug_cmd
  2470. _G_rc_lt_parse_options=false
  2471. # Perform our own loop to consume as many options as possible in
  2472. # each iteration.
  2473. while test $# -gt 0; do
  2474. _G_match_lt_parse_options=:
  2475. _G_opt=$1
  2476. shift
  2477. case $_G_opt in
  2478. --dry-run|--dryrun|-n)
  2479. opt_dry_run=:
  2480. ;;
  2481. --config) func_config ;;
  2482. --dlopen|-dlopen)
  2483. opt_dlopen="${opt_dlopen+$opt_dlopen
  2484. }$1"
  2485. shift
  2486. ;;
  2487. --preserve-dup-deps)
  2488. opt_preserve_dup_deps=: ;;
  2489. --features) func_features ;;
  2490. --finish) set dummy --mode finish ${1+"$@"}; shift ;;
  2491. --help) opt_help=: ;;
  2492. --help-all) opt_help=': help-all' ;;
  2493. --mode) test $# = 0 && func_missing_arg $_G_opt && break
  2494. opt_mode=$1
  2495. case $1 in
  2496. # Valid mode arguments:
  2497. clean|compile|execute|finish|install|link|relink|uninstall) ;;
  2498. # Catch anything else as an error
  2499. *) func_error "invalid argument for $_G_opt"
  2500. exit_cmd=exit
  2501. break
  2502. ;;
  2503. esac
  2504. shift
  2505. ;;
  2506. --no-silent|--no-quiet)
  2507. opt_quiet=false
  2508. func_append preserve_args " $_G_opt"
  2509. ;;
  2510. --no-warnings|--no-warning|--no-warn)
  2511. opt_warning=false
  2512. func_append preserve_args " $_G_opt"
  2513. ;;
  2514. --no-verbose)
  2515. opt_verbose=false
  2516. func_append preserve_args " $_G_opt"
  2517. ;;
  2518. --silent|--quiet)
  2519. opt_quiet=:
  2520. opt_verbose=false
  2521. func_append preserve_args " $_G_opt"
  2522. ;;
  2523. --tag) test $# = 0 && func_missing_arg $_G_opt && break
  2524. opt_tag=$1
  2525. func_append preserve_args " $_G_opt $1"
  2526. func_enable_tag "$1"
  2527. shift
  2528. ;;
  2529. --verbose|-v) opt_quiet=false
  2530. opt_verbose=:
  2531. func_append preserve_args " $_G_opt"
  2532. ;;
  2533. # An option not handled by this hook function:
  2534. *) set dummy "$_G_opt" ${1+"$@"} ; shift
  2535. _G_match_lt_parse_options=false
  2536. break
  2537. ;;
  2538. esac
  2539. $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
  2540. done
  2541. if $_G_rc_lt_parse_options; then
  2542. # save modified positional parameters for caller
  2543. func_quote eval ${1+"$@"}
  2544. libtool_parse_options_result=$func_quote_result
  2545. fi
  2546. }
  2547. func_add_hook func_parse_options libtool_parse_options
  2548. # libtool_validate_options [ARG]...
  2549. # ---------------------------------
  2550. # Perform any sanity checks on option settings and/or unconsumed
  2551. # arguments.
  2552. libtool_validate_options ()
  2553. {
  2554. # save first non-option argument
  2555. if test 0 -lt $#; then
  2556. nonopt=$1
  2557. shift
  2558. fi
  2559. # preserve --debug
  2560. test : = "$debug_cmd" || func_append preserve_args " --debug"
  2561. case $host in
  2562. # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
  2563. # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
  2564. *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
  2565. # don't eliminate duplications in $postdeps and $predeps
  2566. opt_duplicate_compiler_generated_deps=:
  2567. ;;
  2568. *)
  2569. opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  2570. ;;
  2571. esac
  2572. $opt_help || {
  2573. # Sanity checks first:
  2574. func_check_version_match
  2575. test yes != "$build_libtool_libs" \
  2576. && test yes != "$build_old_libs" \
  2577. && func_fatal_configuration "not configured to build any kind of library"
  2578. # Darwin sucks
  2579. eval std_shrext=\"$shrext_cmds\"
  2580. # Only execute mode is allowed to have -dlopen flags.
  2581. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
  2582. func_error "unrecognized option '-dlopen'"
  2583. $ECHO "$help" 1>&2
  2584. exit $EXIT_FAILURE
  2585. fi
  2586. # Change the help message to a mode-specific one.
  2587. generic_help=$help
  2588. help="Try '$progname --help --mode=$opt_mode' for more information."
  2589. }
  2590. # Pass back the unparsed argument list
  2591. func_quote eval ${1+"$@"}
  2592. libtool_validate_options_result=$func_quote_result
  2593. }
  2594. func_add_hook func_validate_options libtool_validate_options
  2595. # Process options as early as possible so that --help and --version
  2596. # can return quickly.
  2597. func_options ${1+"$@"}
  2598. eval set dummy "$func_options_result"; shift
  2599. ## ----------- ##
  2600. ## Main. ##
  2601. ## ----------- ##
  2602. magic='%%%MAGIC variable%%%'
  2603. magic_exe='%%%MAGIC EXE variable%%%'
  2604. # Global variables.
  2605. extracted_archives=
  2606. extracted_serial=0
  2607. # If this variable is set in any of the actions, the command in it
  2608. # will be execed at the end. This prevents here-documents from being
  2609. # left over by shells.
  2610. exec_cmd=
  2611. # A function that is used when there is no print builtin or printf.
  2612. func_fallback_echo ()
  2613. {
  2614. eval 'cat <<_LTECHO_EOF
  2615. $1
  2616. _LTECHO_EOF'
  2617. }
  2618. # func_generated_by_libtool
  2619. # True iff stdin has been generated by Libtool. This function is only
  2620. # a basic sanity check; it will hardly flush out determined imposters.
  2621. func_generated_by_libtool_p ()
  2622. {
  2623. $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  2624. }
  2625. # func_lalib_p file
  2626. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2627. # This function is only a basic sanity check; it will hardly flush out
  2628. # determined imposters.
  2629. func_lalib_p ()
  2630. {
  2631. test -f "$1" &&
  2632. $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
  2633. }
  2634. # func_lalib_unsafe_p file
  2635. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2636. # This function implements the same check as func_lalib_p without
  2637. # resorting to external programs. To this end, it redirects stdin and
  2638. # closes it afterwards, without saving the original file descriptor.
  2639. # As a safety measure, use it only where a negative result would be
  2640. # fatal anyway. Works if 'file' does not exist.
  2641. func_lalib_unsafe_p ()
  2642. {
  2643. lalib_p=no
  2644. if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  2645. for lalib_p_l in 1 2 3 4
  2646. do
  2647. read lalib_p_line
  2648. case $lalib_p_line in
  2649. \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  2650. esac
  2651. done
  2652. exec 0<&5 5<&-
  2653. fi
  2654. test yes = "$lalib_p"
  2655. }
  2656. # func_ltwrapper_script_p file
  2657. # True iff FILE is a libtool wrapper script
  2658. # This function is only a basic sanity check; it will hardly flush out
  2659. # determined imposters.
  2660. func_ltwrapper_script_p ()
  2661. {
  2662. test -f "$1" &&
  2663. $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
  2664. }
  2665. # func_ltwrapper_executable_p file
  2666. # True iff FILE is a libtool wrapper executable
  2667. # This function is only a basic sanity check; it will hardly flush out
  2668. # determined imposters.
  2669. func_ltwrapper_executable_p ()
  2670. {
  2671. func_ltwrapper_exec_suffix=
  2672. case $1 in
  2673. *.exe) ;;
  2674. *) func_ltwrapper_exec_suffix=.exe ;;
  2675. esac
  2676. $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  2677. }
  2678. # func_ltwrapper_scriptname file
  2679. # Assumes file is an ltwrapper_executable
  2680. # uses $file to determine the appropriate filename for a
  2681. # temporary ltwrapper_script.
  2682. func_ltwrapper_scriptname ()
  2683. {
  2684. func_dirname_and_basename "$1" "" "."
  2685. func_stripname '' '.exe' "$func_basename_result"
  2686. func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
  2687. }
  2688. # func_ltwrapper_p file
  2689. # True iff FILE is a libtool wrapper script or wrapper executable
  2690. # This function is only a basic sanity check; it will hardly flush out
  2691. # determined imposters.
  2692. func_ltwrapper_p ()
  2693. {
  2694. func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  2695. }
  2696. # func_execute_cmds commands fail_cmd
  2697. # Execute tilde-delimited COMMANDS.
  2698. # If FAIL_CMD is given, eval that upon failure.
  2699. # FAIL_CMD may read-access the current command in variable CMD!
  2700. func_execute_cmds ()
  2701. {
  2702. $debug_cmd
  2703. save_ifs=$IFS; IFS='~'
  2704. for cmd in $1; do
  2705. IFS=$sp$nl
  2706. eval cmd=\"$cmd\"
  2707. IFS=$save_ifs
  2708. func_show_eval "$cmd" "${2-:}"
  2709. done
  2710. IFS=$save_ifs
  2711. }
  2712. # func_source file
  2713. # Source FILE, adding directory component if necessary.
  2714. # Note that it is not necessary on cygwin/mingw to append a dot to
  2715. # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  2716. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  2717. # 'FILE.' does not work on cygwin managed mounts.
  2718. func_source ()
  2719. {
  2720. $debug_cmd
  2721. case $1 in
  2722. */* | *\\*) . "$1" ;;
  2723. *) . "./$1" ;;
  2724. esac
  2725. }
  2726. # func_resolve_sysroot PATH
  2727. # Replace a leading = in PATH with a sysroot. Store the result into
  2728. # func_resolve_sysroot_result
  2729. func_resolve_sysroot ()
  2730. {
  2731. func_resolve_sysroot_result=$1
  2732. case $func_resolve_sysroot_result in
  2733. =*)
  2734. func_stripname '=' '' "$func_resolve_sysroot_result"
  2735. func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
  2736. ;;
  2737. esac
  2738. }
  2739. # func_replace_sysroot PATH
  2740. # If PATH begins with the sysroot, replace it with = and
  2741. # store the result into func_replace_sysroot_result.
  2742. func_replace_sysroot ()
  2743. {
  2744. case $lt_sysroot:$1 in
  2745. ?*:"$lt_sysroot"*)
  2746. func_stripname "$lt_sysroot" '' "$1"
  2747. func_replace_sysroot_result='='$func_stripname_result
  2748. ;;
  2749. *)
  2750. # Including no sysroot.
  2751. func_replace_sysroot_result=$1
  2752. ;;
  2753. esac
  2754. }
  2755. # func_infer_tag arg
  2756. # Infer tagged configuration to use if any are available and
  2757. # if one wasn't chosen via the "--tag" command line option.
  2758. # Only attempt this if the compiler in the base compile
  2759. # command doesn't match the default compiler.
  2760. # arg is usually of the form 'gcc ...'
  2761. func_infer_tag ()
  2762. {
  2763. $debug_cmd
  2764. if test -n "$available_tags" && test -z "$tagname"; then
  2765. CC_quoted=
  2766. for arg in $CC; do
  2767. func_append_quoted CC_quoted "$arg"
  2768. done
  2769. CC_expanded=`func_echo_all $CC`
  2770. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2771. case $@ in
  2772. # Blanks in the command may have been stripped by the calling shell,
  2773. # but not from the CC environment variable when configure was run.
  2774. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2775. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
  2776. # Blanks at the start of $base_compile will cause this to fail
  2777. # if we don't check for them as well.
  2778. *)
  2779. for z in $available_tags; do
  2780. if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  2781. # Evaluate the configuration.
  2782. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  2783. CC_quoted=
  2784. for arg in $CC; do
  2785. # Double-quote args containing other shell metacharacters.
  2786. func_append_quoted CC_quoted "$arg"
  2787. done
  2788. CC_expanded=`func_echo_all $CC`
  2789. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2790. case "$@ " in
  2791. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2792. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
  2793. # The compiler in the base compile command matches
  2794. # the one in the tagged configuration.
  2795. # Assume this is the tagged configuration we want.
  2796. tagname=$z
  2797. break
  2798. ;;
  2799. esac
  2800. fi
  2801. done
  2802. # If $tagname still isn't set, then no tagged configuration
  2803. # was found and let the user know that the "--tag" command
  2804. # line option must be used.
  2805. if test -z "$tagname"; then
  2806. func_echo "unable to infer tagged configuration"
  2807. func_fatal_error "specify a tag with '--tag'"
  2808. # else
  2809. # func_verbose "using $tagname tagged configuration"
  2810. fi
  2811. ;;
  2812. esac
  2813. fi
  2814. }
  2815. # func_write_libtool_object output_name pic_name nonpic_name
  2816. # Create a libtool object file (analogous to a ".la" file),
  2817. # but don't create it if we're doing a dry run.
  2818. func_write_libtool_object ()
  2819. {
  2820. write_libobj=$1
  2821. if test yes = "$build_libtool_libs"; then
  2822. write_lobj=\'$2\'
  2823. else
  2824. write_lobj=none
  2825. fi
  2826. if test yes = "$build_old_libs"; then
  2827. write_oldobj=\'$3\'
  2828. else
  2829. write_oldobj=none
  2830. fi
  2831. $opt_dry_run || {
  2832. cat >${write_libobj}T <<EOF
  2833. # $write_libobj - a libtool object file
  2834. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  2835. #
  2836. # Please DO NOT delete this file!
  2837. # It is necessary for linking the library.
  2838. # Name of the PIC object.
  2839. pic_object=$write_lobj
  2840. # Name of the non-PIC object
  2841. non_pic_object=$write_oldobj
  2842. EOF
  2843. $MV "${write_libobj}T" "$write_libobj"
  2844. }
  2845. }
  2846. ##################################################
  2847. # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
  2848. ##################################################
  2849. # func_convert_core_file_wine_to_w32 ARG
  2850. # Helper function used by file name conversion functions when $build is *nix,
  2851. # and $host is mingw, cygwin, or some other w32 environment. Relies on a
  2852. # correctly configured wine environment available, with the winepath program
  2853. # in $build's $PATH.
  2854. #
  2855. # ARG is the $build file name to be converted to w32 format.
  2856. # Result is available in $func_convert_core_file_wine_to_w32_result, and will
  2857. # be empty on error (or when ARG is empty)
  2858. func_convert_core_file_wine_to_w32 ()
  2859. {
  2860. $debug_cmd
  2861. func_convert_core_file_wine_to_w32_result=$1
  2862. if test -n "$1"; then
  2863. # Unfortunately, winepath does not exit with a non-zero error code, so we
  2864. # are forced to check the contents of stdout. On the other hand, if the
  2865. # command is not found, the shell will set an exit code of 127 and print
  2866. # *an error message* to stdout. So we must check for both error code of
  2867. # zero AND non-empty stdout, which explains the odd construction:
  2868. func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
  2869. if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
  2870. func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
  2871. $SED -e "$sed_naive_backslashify"`
  2872. else
  2873. func_convert_core_file_wine_to_w32_result=
  2874. fi
  2875. fi
  2876. }
  2877. # end: func_convert_core_file_wine_to_w32
  2878. # func_convert_core_path_wine_to_w32 ARG
  2879. # Helper function used by path conversion functions when $build is *nix, and
  2880. # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
  2881. # configured wine environment available, with the winepath program in $build's
  2882. # $PATH. Assumes ARG has no leading or trailing path separator characters.
  2883. #
  2884. # ARG is path to be converted from $build format to win32.
  2885. # Result is available in $func_convert_core_path_wine_to_w32_result.
  2886. # Unconvertible file (directory) names in ARG are skipped; if no directory names
  2887. # are convertible, then the result may be empty.
  2888. func_convert_core_path_wine_to_w32 ()
  2889. {
  2890. $debug_cmd
  2891. # unfortunately, winepath doesn't convert paths, only file names
  2892. func_convert_core_path_wine_to_w32_result=
  2893. if test -n "$1"; then
  2894. oldIFS=$IFS
  2895. IFS=:
  2896. for func_convert_core_path_wine_to_w32_f in $1; do
  2897. IFS=$oldIFS
  2898. func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
  2899. if test -n "$func_convert_core_file_wine_to_w32_result"; then
  2900. if test -z "$func_convert_core_path_wine_to_w32_result"; then
  2901. func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
  2902. else
  2903. func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
  2904. fi
  2905. fi
  2906. done
  2907. IFS=$oldIFS
  2908. fi
  2909. }
  2910. # end: func_convert_core_path_wine_to_w32
  2911. # func_cygpath ARGS...
  2912. # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
  2913. # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
  2914. # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
  2915. # (2), returns the Cygwin file name or path in func_cygpath_result (input
  2916. # file name or path is assumed to be in w32 format, as previously converted
  2917. # from $build's *nix or MSYS format). In case (3), returns the w32 file name
  2918. # or path in func_cygpath_result (input file name or path is assumed to be in
  2919. # Cygwin format). Returns an empty string on error.
  2920. #
  2921. # ARGS are passed to cygpath, with the last one being the file name or path to
  2922. # be converted.
  2923. #
  2924. # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
  2925. # environment variable; do not put it in $PATH.
  2926. func_cygpath ()
  2927. {
  2928. $debug_cmd
  2929. if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
  2930. func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
  2931. if test "$?" -ne 0; then
  2932. # on failure, ensure result is empty
  2933. func_cygpath_result=
  2934. fi
  2935. else
  2936. func_cygpath_result=
  2937. func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  2938. fi
  2939. }
  2940. #end: func_cygpath
  2941. # func_convert_core_msys_to_w32 ARG
  2942. # Convert file name or path ARG from MSYS format to w32 format. Return
  2943. # result in func_convert_core_msys_to_w32_result.
  2944. func_convert_core_msys_to_w32 ()
  2945. {
  2946. $debug_cmd
  2947. # awkward: cmd appends spaces to result
  2948. func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
  2949. $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
  2950. }
  2951. #end: func_convert_core_msys_to_w32
  2952. # func_convert_file_check ARG1 ARG2
  2953. # Verify that ARG1 (a file name in $build format) was converted to $host
  2954. # format in ARG2. Otherwise, emit an error message, but continue (resetting
  2955. # func_to_host_file_result to ARG1).
  2956. func_convert_file_check ()
  2957. {
  2958. $debug_cmd
  2959. if test -z "$2" && test -n "$1"; then
  2960. func_error "Could not determine host file name corresponding to"
  2961. func_error " '$1'"
  2962. func_error "Continuing, but uninstalled executables may not work."
  2963. # Fallback:
  2964. func_to_host_file_result=$1
  2965. fi
  2966. }
  2967. # end func_convert_file_check
  2968. # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
  2969. # Verify that FROM_PATH (a path in $build format) was converted to $host
  2970. # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
  2971. # func_to_host_file_result to a simplistic fallback value (see below).
  2972. func_convert_path_check ()
  2973. {
  2974. $debug_cmd
  2975. if test -z "$4" && test -n "$3"; then
  2976. func_error "Could not determine the host path corresponding to"
  2977. func_error " '$3'"
  2978. func_error "Continuing, but uninstalled executables may not work."
  2979. # Fallback. This is a deliberately simplistic "conversion" and
  2980. # should not be "improved". See libtool.info.
  2981. if test "x$1" != "x$2"; then
  2982. lt_replace_pathsep_chars="s|$1|$2|g"
  2983. func_to_host_path_result=`echo "$3" |
  2984. $SED -e "$lt_replace_pathsep_chars"`
  2985. else
  2986. func_to_host_path_result=$3
  2987. fi
  2988. fi
  2989. }
  2990. # end func_convert_path_check
  2991. # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
  2992. # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
  2993. # and appending REPL if ORIG matches BACKPAT.
  2994. func_convert_path_front_back_pathsep ()
  2995. {
  2996. $debug_cmd
  2997. case $4 in
  2998. $1 ) func_to_host_path_result=$3$func_to_host_path_result
  2999. ;;
  3000. esac
  3001. case $4 in
  3002. $2 ) func_append func_to_host_path_result "$3"
  3003. ;;
  3004. esac
  3005. }
  3006. # end func_convert_path_front_back_pathsep
  3007. ##################################################
  3008. # $build to $host FILE NAME CONVERSION FUNCTIONS #
  3009. ##################################################
  3010. # invoked via '$to_host_file_cmd ARG'
  3011. #
  3012. # In each case, ARG is the path to be converted from $build to $host format.
  3013. # Result will be available in $func_to_host_file_result.
  3014. # func_to_host_file ARG
  3015. # Converts the file name ARG from $build format to $host format. Return result
  3016. # in func_to_host_file_result.
  3017. func_to_host_file ()
  3018. {
  3019. $debug_cmd
  3020. $to_host_file_cmd "$1"
  3021. }
  3022. # end func_to_host_file
  3023. # func_to_tool_file ARG LAZY
  3024. # converts the file name ARG from $build format to toolchain format. Return
  3025. # result in func_to_tool_file_result. If the conversion in use is listed
  3026. # in (the comma separated) LAZY, no conversion takes place.
  3027. func_to_tool_file ()
  3028. {
  3029. $debug_cmd
  3030. case ,$2, in
  3031. *,"$to_tool_file_cmd",*)
  3032. func_to_tool_file_result=$1
  3033. ;;
  3034. *)
  3035. $to_tool_file_cmd "$1"
  3036. func_to_tool_file_result=$func_to_host_file_result
  3037. ;;
  3038. esac
  3039. }
  3040. # end func_to_tool_file
  3041. # func_convert_file_noop ARG
  3042. # Copy ARG to func_to_host_file_result.
  3043. func_convert_file_noop ()
  3044. {
  3045. func_to_host_file_result=$1
  3046. }
  3047. # end func_convert_file_noop
  3048. # func_convert_file_msys_to_w32 ARG
  3049. # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3050. # conversion to w32 is not available inside the cwrapper. Returns result in
  3051. # func_to_host_file_result.
  3052. func_convert_file_msys_to_w32 ()
  3053. {
  3054. $debug_cmd
  3055. func_to_host_file_result=$1
  3056. if test -n "$1"; then
  3057. func_convert_core_msys_to_w32 "$1"
  3058. func_to_host_file_result=$func_convert_core_msys_to_w32_result
  3059. fi
  3060. func_convert_file_check "$1" "$func_to_host_file_result"
  3061. }
  3062. # end func_convert_file_msys_to_w32
  3063. # func_convert_file_cygwin_to_w32 ARG
  3064. # Convert file name ARG from Cygwin to w32 format. Returns result in
  3065. # func_to_host_file_result.
  3066. func_convert_file_cygwin_to_w32 ()
  3067. {
  3068. $debug_cmd
  3069. func_to_host_file_result=$1
  3070. if test -n "$1"; then
  3071. # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
  3072. # LT_CYGPATH in this case.
  3073. func_to_host_file_result=`cygpath -m "$1"`
  3074. fi
  3075. func_convert_file_check "$1" "$func_to_host_file_result"
  3076. }
  3077. # end func_convert_file_cygwin_to_w32
  3078. # func_convert_file_nix_to_w32 ARG
  3079. # Convert file name ARG from *nix to w32 format. Requires a wine environment
  3080. # and a working winepath. Returns result in func_to_host_file_result.
  3081. func_convert_file_nix_to_w32 ()
  3082. {
  3083. $debug_cmd
  3084. func_to_host_file_result=$1
  3085. if test -n "$1"; then
  3086. func_convert_core_file_wine_to_w32 "$1"
  3087. func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  3088. fi
  3089. func_convert_file_check "$1" "$func_to_host_file_result"
  3090. }
  3091. # end func_convert_file_nix_to_w32
  3092. # func_convert_file_msys_to_cygwin ARG
  3093. # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  3094. # Returns result in func_to_host_file_result.
  3095. func_convert_file_msys_to_cygwin ()
  3096. {
  3097. $debug_cmd
  3098. func_to_host_file_result=$1
  3099. if test -n "$1"; then
  3100. func_convert_core_msys_to_w32 "$1"
  3101. func_cygpath -u "$func_convert_core_msys_to_w32_result"
  3102. func_to_host_file_result=$func_cygpath_result
  3103. fi
  3104. func_convert_file_check "$1" "$func_to_host_file_result"
  3105. }
  3106. # end func_convert_file_msys_to_cygwin
  3107. # func_convert_file_nix_to_cygwin ARG
  3108. # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
  3109. # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
  3110. # in func_to_host_file_result.
  3111. func_convert_file_nix_to_cygwin ()
  3112. {
  3113. $debug_cmd
  3114. func_to_host_file_result=$1
  3115. if test -n "$1"; then
  3116. # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
  3117. func_convert_core_file_wine_to_w32 "$1"
  3118. func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
  3119. func_to_host_file_result=$func_cygpath_result
  3120. fi
  3121. func_convert_file_check "$1" "$func_to_host_file_result"
  3122. }
  3123. # end func_convert_file_nix_to_cygwin
  3124. #############################################
  3125. # $build to $host PATH CONVERSION FUNCTIONS #
  3126. #############################################
  3127. # invoked via '$to_host_path_cmd ARG'
  3128. #
  3129. # In each case, ARG is the path to be converted from $build to $host format.
  3130. # The result will be available in $func_to_host_path_result.
  3131. #
  3132. # Path separators are also converted from $build format to $host format. If
  3133. # ARG begins or ends with a path separator character, it is preserved (but
  3134. # converted to $host format) on output.
  3135. #
  3136. # All path conversion functions are named using the following convention:
  3137. # file name conversion function : func_convert_file_X_to_Y ()
  3138. # path conversion function : func_convert_path_X_to_Y ()
  3139. # where, for any given $build/$host combination the 'X_to_Y' value is the
  3140. # same. If conversion functions are added for new $build/$host combinations,
  3141. # the two new functions must follow this pattern, or func_init_to_host_path_cmd
  3142. # will break.
  3143. # func_init_to_host_path_cmd
  3144. # Ensures that function "pointer" variable $to_host_path_cmd is set to the
  3145. # appropriate value, based on the value of $to_host_file_cmd.
  3146. to_host_path_cmd=
  3147. func_init_to_host_path_cmd ()
  3148. {
  3149. $debug_cmd
  3150. if test -z "$to_host_path_cmd"; then
  3151. func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
  3152. to_host_path_cmd=func_convert_path_$func_stripname_result
  3153. fi
  3154. }
  3155. # func_to_host_path ARG
  3156. # Converts the path ARG from $build format to $host format. Return result
  3157. # in func_to_host_path_result.
  3158. func_to_host_path ()
  3159. {
  3160. $debug_cmd
  3161. func_init_to_host_path_cmd
  3162. $to_host_path_cmd "$1"
  3163. }
  3164. # end func_to_host_path
  3165. # func_convert_path_noop ARG
  3166. # Copy ARG to func_to_host_path_result.
  3167. func_convert_path_noop ()
  3168. {
  3169. func_to_host_path_result=$1
  3170. }
  3171. # end func_convert_path_noop
  3172. # func_convert_path_msys_to_w32 ARG
  3173. # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3174. # conversion to w32 is not available inside the cwrapper. Returns result in
  3175. # func_to_host_path_result.
  3176. func_convert_path_msys_to_w32 ()
  3177. {
  3178. $debug_cmd
  3179. func_to_host_path_result=$1
  3180. if test -n "$1"; then
  3181. # Remove leading and trailing path separator characters from ARG. MSYS
  3182. # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
  3183. # and winepath ignores them completely.
  3184. func_stripname : : "$1"
  3185. func_to_host_path_tmp1=$func_stripname_result
  3186. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3187. func_to_host_path_result=$func_convert_core_msys_to_w32_result
  3188. func_convert_path_check : ";" \
  3189. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3190. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3191. fi
  3192. }
  3193. # end func_convert_path_msys_to_w32
  3194. # func_convert_path_cygwin_to_w32 ARG
  3195. # Convert path ARG from Cygwin to w32 format. Returns result in
  3196. # func_to_host_file_result.
  3197. func_convert_path_cygwin_to_w32 ()
  3198. {
  3199. $debug_cmd
  3200. func_to_host_path_result=$1
  3201. if test -n "$1"; then
  3202. # See func_convert_path_msys_to_w32:
  3203. func_stripname : : "$1"
  3204. func_to_host_path_tmp1=$func_stripname_result
  3205. func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
  3206. func_convert_path_check : ";" \
  3207. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3208. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3209. fi
  3210. }
  3211. # end func_convert_path_cygwin_to_w32
  3212. # func_convert_path_nix_to_w32 ARG
  3213. # Convert path ARG from *nix to w32 format. Requires a wine environment and
  3214. # a working winepath. Returns result in func_to_host_file_result.
  3215. func_convert_path_nix_to_w32 ()
  3216. {
  3217. $debug_cmd
  3218. func_to_host_path_result=$1
  3219. if test -n "$1"; then
  3220. # See func_convert_path_msys_to_w32:
  3221. func_stripname : : "$1"
  3222. func_to_host_path_tmp1=$func_stripname_result
  3223. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3224. func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
  3225. func_convert_path_check : ";" \
  3226. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3227. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3228. fi
  3229. }
  3230. # end func_convert_path_nix_to_w32
  3231. # func_convert_path_msys_to_cygwin ARG
  3232. # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  3233. # Returns result in func_to_host_file_result.
  3234. func_convert_path_msys_to_cygwin ()
  3235. {
  3236. $debug_cmd
  3237. func_to_host_path_result=$1
  3238. if test -n "$1"; then
  3239. # See func_convert_path_msys_to_w32:
  3240. func_stripname : : "$1"
  3241. func_to_host_path_tmp1=$func_stripname_result
  3242. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3243. func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
  3244. func_to_host_path_result=$func_cygpath_result
  3245. func_convert_path_check : : \
  3246. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3247. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3248. fi
  3249. }
  3250. # end func_convert_path_msys_to_cygwin
  3251. # func_convert_path_nix_to_cygwin ARG
  3252. # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
  3253. # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
  3254. # func_to_host_file_result.
  3255. func_convert_path_nix_to_cygwin ()
  3256. {
  3257. $debug_cmd
  3258. func_to_host_path_result=$1
  3259. if test -n "$1"; then
  3260. # Remove leading and trailing path separator characters from
  3261. # ARG. msys behavior is inconsistent here, cygpath turns them
  3262. # into '.;' and ';.', and winepath ignores them completely.
  3263. func_stripname : : "$1"
  3264. func_to_host_path_tmp1=$func_stripname_result
  3265. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3266. func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
  3267. func_to_host_path_result=$func_cygpath_result
  3268. func_convert_path_check : : \
  3269. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3270. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3271. fi
  3272. }
  3273. # end func_convert_path_nix_to_cygwin
  3274. # func_dll_def_p FILE
  3275. # True iff FILE is a Windows DLL '.def' file.
  3276. # Keep in sync with _LT_DLL_DEF_P in libtool.m4
  3277. func_dll_def_p ()
  3278. {
  3279. $debug_cmd
  3280. func_dll_def_p_tmp=`$SED -n \
  3281. -e 's/^[ ]*//' \
  3282. -e '/^\(;.*\)*$/d' \
  3283. -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
  3284. -e q \
  3285. "$1"`
  3286. test DEF = "$func_dll_def_p_tmp"
  3287. }
  3288. # func_mode_compile arg...
  3289. func_mode_compile ()
  3290. {
  3291. $debug_cmd
  3292. # Get the compilation command and the source file.
  3293. base_compile=
  3294. srcfile=$nonopt # always keep a non-empty value in "srcfile"
  3295. suppress_opt=yes
  3296. suppress_output=
  3297. arg_mode=normal
  3298. libobj=
  3299. later=
  3300. pie_flag=
  3301. for arg
  3302. do
  3303. case $arg_mode in
  3304. arg )
  3305. # do not "continue". Instead, add this to base_compile
  3306. lastarg=$arg
  3307. arg_mode=normal
  3308. ;;
  3309. target )
  3310. libobj=$arg
  3311. arg_mode=normal
  3312. continue
  3313. ;;
  3314. normal )
  3315. # Accept any command-line options.
  3316. case $arg in
  3317. -o)
  3318. test -n "$libobj" && \
  3319. func_fatal_error "you cannot specify '-o' more than once"
  3320. arg_mode=target
  3321. continue
  3322. ;;
  3323. -pie | -fpie | -fPIE)
  3324. func_append pie_flag " $arg"
  3325. continue
  3326. ;;
  3327. -shared | -static | -prefer-pic | -prefer-non-pic)
  3328. func_append later " $arg"
  3329. continue
  3330. ;;
  3331. -no-suppress)
  3332. suppress_opt=no
  3333. continue
  3334. ;;
  3335. -Xcompiler)
  3336. arg_mode=arg # the next one goes into the "base_compile" arg list
  3337. continue # The current "srcfile" will either be retained or
  3338. ;; # replaced later. I would guess that would be a bug.
  3339. -Wc,*)
  3340. func_stripname '-Wc,' '' "$arg"
  3341. args=$func_stripname_result
  3342. lastarg=
  3343. save_ifs=$IFS; IFS=,
  3344. for arg in $args; do
  3345. IFS=$save_ifs
  3346. func_append_quoted lastarg "$arg"
  3347. done
  3348. IFS=$save_ifs
  3349. func_stripname ' ' '' "$lastarg"
  3350. lastarg=$func_stripname_result
  3351. # Add the arguments to base_compile.
  3352. func_append base_compile " $lastarg"
  3353. continue
  3354. ;;
  3355. *)
  3356. # Accept the current argument as the source file.
  3357. # The previous "srcfile" becomes the current argument.
  3358. #
  3359. lastarg=$srcfile
  3360. srcfile=$arg
  3361. ;;
  3362. esac # case $arg
  3363. ;;
  3364. esac # case $arg_mode
  3365. # Aesthetically quote the previous argument.
  3366. func_append_quoted base_compile "$lastarg"
  3367. done # for arg
  3368. case $arg_mode in
  3369. arg)
  3370. func_fatal_error "you must specify an argument for -Xcompile"
  3371. ;;
  3372. target)
  3373. func_fatal_error "you must specify a target with '-o'"
  3374. ;;
  3375. *)
  3376. # Get the name of the library object.
  3377. test -z "$libobj" && {
  3378. func_basename "$srcfile"
  3379. libobj=$func_basename_result
  3380. }
  3381. ;;
  3382. esac
  3383. # Recognize several different file suffixes.
  3384. # If the user specifies -o file.o, it is replaced with file.lo
  3385. case $libobj in
  3386. *.[cCFSifmso] | \
  3387. *.ada | *.adb | *.ads | *.asm | \
  3388. *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  3389. *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
  3390. func_xform "$libobj"
  3391. libobj=$func_xform_result
  3392. ;;
  3393. esac
  3394. case $libobj in
  3395. *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  3396. *)
  3397. func_fatal_error "cannot determine name of library object from '$libobj'"
  3398. ;;
  3399. esac
  3400. func_infer_tag $base_compile
  3401. for arg in $later; do
  3402. case $arg in
  3403. -shared)
  3404. test yes = "$build_libtool_libs" \
  3405. || func_fatal_configuration "cannot build a shared library"
  3406. build_old_libs=no
  3407. continue
  3408. ;;
  3409. -static)
  3410. build_libtool_libs=no
  3411. build_old_libs=yes
  3412. continue
  3413. ;;
  3414. -prefer-pic)
  3415. pic_mode=yes
  3416. continue
  3417. ;;
  3418. -prefer-non-pic)
  3419. pic_mode=no
  3420. continue
  3421. ;;
  3422. esac
  3423. done
  3424. func_quote_arg pretty "$libobj"
  3425. test "X$libobj" != "X$func_quote_arg_result" \
  3426. && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  3427. && func_warning "libobj name '$libobj' may not contain shell special characters."
  3428. func_dirname_and_basename "$obj" "/" ""
  3429. objname=$func_basename_result
  3430. xdir=$func_dirname_result
  3431. lobj=$xdir$objdir/$objname
  3432. test -z "$base_compile" && \
  3433. func_fatal_help "you must specify a compilation command"
  3434. # Delete any leftover library objects.
  3435. if test yes = "$build_old_libs"; then
  3436. removelist="$obj $lobj $libobj ${libobj}T"
  3437. else
  3438. removelist="$lobj $libobj ${libobj}T"
  3439. fi
  3440. # On Cygwin there's no "real" PIC flag so we must build both object types
  3441. case $host_os in
  3442. cygwin* | mingw* | pw32* | os2* | cegcc*)
  3443. pic_mode=default
  3444. ;;
  3445. esac
  3446. if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
  3447. # non-PIC code in shared libraries is not supported
  3448. pic_mode=default
  3449. fi
  3450. # Calculate the filename of the output object if compiler does
  3451. # not support -o with -c
  3452. if test no = "$compiler_c_o"; then
  3453. output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
  3454. lockfile=$output_obj.lock
  3455. else
  3456. output_obj=
  3457. need_locks=no
  3458. lockfile=
  3459. fi
  3460. # Lock this critical section if it is needed
  3461. # We use this script file to make the link, it avoids creating a new file
  3462. if test yes = "$need_locks"; then
  3463. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  3464. func_echo "Waiting for $lockfile to be removed"
  3465. sleep 2
  3466. done
  3467. elif test warn = "$need_locks"; then
  3468. if test -f "$lockfile"; then
  3469. $ECHO "\
  3470. *** ERROR, $lockfile exists and contains:
  3471. `cat $lockfile 2>/dev/null`
  3472. This indicates that another process is trying to use the same
  3473. temporary object file, and libtool could not work around it because
  3474. your compiler does not support '-c' and '-o' together. If you
  3475. repeat this compilation, it may succeed, by chance, but you had better
  3476. avoid parallel builds (make -j) in this platform, or get a better
  3477. compiler."
  3478. $opt_dry_run || $RM $removelist
  3479. exit $EXIT_FAILURE
  3480. fi
  3481. func_append removelist " $output_obj"
  3482. $ECHO "$srcfile" > "$lockfile"
  3483. fi
  3484. $opt_dry_run || $RM $removelist
  3485. func_append removelist " $lockfile"
  3486. trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  3487. func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
  3488. srcfile=$func_to_tool_file_result
  3489. func_quote_arg pretty "$srcfile"
  3490. qsrcfile=$func_quote_arg_result
  3491. # Only build a PIC object if we are building libtool libraries.
  3492. if test yes = "$build_libtool_libs"; then
  3493. # Without this assignment, base_compile gets emptied.
  3494. fbsd_hideous_sh_bug=$base_compile
  3495. if test no != "$pic_mode"; then
  3496. command="$base_compile $qsrcfile $pic_flag"
  3497. else
  3498. # Don't build PIC code
  3499. command="$base_compile $qsrcfile"
  3500. fi
  3501. func_mkdir_p "$xdir$objdir"
  3502. if test -z "$output_obj"; then
  3503. # Place PIC objects in $objdir
  3504. func_append command " -o $lobj"
  3505. fi
  3506. func_show_eval_locale "$command" \
  3507. 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  3508. if test warn = "$need_locks" &&
  3509. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3510. $ECHO "\
  3511. *** ERROR, $lockfile contains:
  3512. `cat $lockfile 2>/dev/null`
  3513. but it should contain:
  3514. $srcfile
  3515. This indicates that another process is trying to use the same
  3516. temporary object file, and libtool could not work around it because
  3517. your compiler does not support '-c' and '-o' together. If you
  3518. repeat this compilation, it may succeed, by chance, but you had better
  3519. avoid parallel builds (make -j) in this platform, or get a better
  3520. compiler."
  3521. $opt_dry_run || $RM $removelist
  3522. exit $EXIT_FAILURE
  3523. fi
  3524. # Just move the object if needed, then go on to compile the next one
  3525. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  3526. func_show_eval '$MV "$output_obj" "$lobj"' \
  3527. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3528. fi
  3529. # Allow error messages only from the first compilation.
  3530. if test yes = "$suppress_opt"; then
  3531. suppress_output=' >/dev/null 2>&1'
  3532. fi
  3533. fi
  3534. # Only build a position-dependent object if we build old libraries.
  3535. if test yes = "$build_old_libs"; then
  3536. if test yes != "$pic_mode"; then
  3537. # Don't build PIC code
  3538. command="$base_compile $qsrcfile$pie_flag"
  3539. else
  3540. command="$base_compile $qsrcfile $pic_flag"
  3541. fi
  3542. if test yes = "$compiler_c_o"; then
  3543. func_append command " -o $obj"
  3544. fi
  3545. # Suppress compiler output if we already did a PIC compilation.
  3546. func_append command "$suppress_output"
  3547. func_show_eval_locale "$command" \
  3548. '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  3549. if test warn = "$need_locks" &&
  3550. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3551. $ECHO "\
  3552. *** ERROR, $lockfile contains:
  3553. `cat $lockfile 2>/dev/null`
  3554. but it should contain:
  3555. $srcfile
  3556. This indicates that another process is trying to use the same
  3557. temporary object file, and libtool could not work around it because
  3558. your compiler does not support '-c' and '-o' together. If you
  3559. repeat this compilation, it may succeed, by chance, but you had better
  3560. avoid parallel builds (make -j) in this platform, or get a better
  3561. compiler."
  3562. $opt_dry_run || $RM $removelist
  3563. exit $EXIT_FAILURE
  3564. fi
  3565. # Just move the object if needed
  3566. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  3567. func_show_eval '$MV "$output_obj" "$obj"' \
  3568. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3569. fi
  3570. fi
  3571. $opt_dry_run || {
  3572. func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  3573. # Unlock the critical section if it was locked
  3574. if test no != "$need_locks"; then
  3575. removelist=$lockfile
  3576. $RM "$lockfile"
  3577. fi
  3578. }
  3579. exit $EXIT_SUCCESS
  3580. }
  3581. $opt_help || {
  3582. test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
  3583. }
  3584. func_mode_help ()
  3585. {
  3586. # We need to display help for each of the modes.
  3587. case $opt_mode in
  3588. "")
  3589. # Generic help is extracted from the usage comments
  3590. # at the start of this file.
  3591. func_help
  3592. ;;
  3593. clean)
  3594. $ECHO \
  3595. "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  3596. Remove files from the build directory.
  3597. RM is the name of the program to use to delete files associated with each FILE
  3598. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3599. to RM.
  3600. If FILE is a libtool library, object or program, all the files associated
  3601. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  3602. ;;
  3603. compile)
  3604. $ECHO \
  3605. "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3606. Compile a source file into a libtool library object.
  3607. This mode accepts the following additional options:
  3608. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  3609. -no-suppress do not suppress compiler output for multiple passes
  3610. -prefer-pic try to build PIC objects only
  3611. -prefer-non-pic try to build non-PIC objects only
  3612. -shared do not build a '.o' file suitable for static linking
  3613. -static only build a '.o' file suitable for static linking
  3614. -Wc,FLAG pass FLAG directly to the compiler
  3615. COMPILE-COMMAND is a command to be used in creating a 'standard' object file
  3616. from the given SOURCEFILE.
  3617. The output file name is determined by removing the directory component from
  3618. SOURCEFILE, then substituting the C source code suffix '.c' with the
  3619. library object suffix, '.lo'."
  3620. ;;
  3621. execute)
  3622. $ECHO \
  3623. "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  3624. Automatically set library path, then run a program.
  3625. This mode accepts the following additional options:
  3626. -dlopen FILE add the directory containing FILE to the library path
  3627. This mode sets the library path environment variable according to '-dlopen'
  3628. flags.
  3629. If any of the ARGS are libtool executable wrappers, then they are translated
  3630. into their corresponding uninstalled binary, and any of their required library
  3631. directories are added to the library path.
  3632. Then, COMMAND is executed, with ARGS as arguments."
  3633. ;;
  3634. finish)
  3635. $ECHO \
  3636. "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  3637. Complete the installation of libtool libraries.
  3638. Each LIBDIR is a directory that contains libtool libraries.
  3639. The commands that this mode executes may require superuser privileges. Use
  3640. the '--dry-run' option if you just want to see what would be executed."
  3641. ;;
  3642. install)
  3643. $ECHO \
  3644. "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  3645. Install executables or libraries.
  3646. INSTALL-COMMAND is the installation command. The first component should be
  3647. either the 'install' or 'cp' program.
  3648. The following components of INSTALL-COMMAND are treated specially:
  3649. -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  3650. The rest of the components are interpreted as arguments to that command (only
  3651. BSD-compatible install options are recognized)."
  3652. ;;
  3653. link)
  3654. $ECHO \
  3655. "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  3656. Link object files or libraries together to form another library, or to
  3657. create an executable program.
  3658. LINK-COMMAND is a command using the C compiler that you would use to create
  3659. a program from several object files.
  3660. The following components of LINK-COMMAND are treated specially:
  3661. -all-static do not do any dynamic linking at all
  3662. -avoid-version do not add a version suffix if possible
  3663. -bindir BINDIR specify path to binaries directory (for systems where
  3664. libraries must be found in the PATH setting at runtime)
  3665. -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
  3666. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  3667. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  3668. -export-symbols SYMFILE
  3669. try to export only the symbols listed in SYMFILE
  3670. -export-symbols-regex REGEX
  3671. try to export only the symbols matching REGEX
  3672. -LLIBDIR search LIBDIR for required installed libraries
  3673. -lNAME OUTPUT-FILE requires the installed library libNAME
  3674. -module build a library that can dlopened
  3675. -no-fast-install disable the fast-install mode
  3676. -no-install link a not-installable executable
  3677. -no-undefined declare that a library does not refer to external symbols
  3678. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  3679. -objectlist FILE use a list of object files found in FILE to specify objects
  3680. -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
  3681. -precious-files-regex REGEX
  3682. don't remove output files matching REGEX
  3683. -release RELEASE specify package release information
  3684. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  3685. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  3686. -shared only do dynamic linking of libtool libraries
  3687. -shrext SUFFIX override the standard shared library file extension
  3688. -static do not do any dynamic linking of uninstalled libtool libraries
  3689. -static-libtool-libs
  3690. do not do any dynamic linking of libtool libraries
  3691. -version-info CURRENT[:REVISION[:AGE]]
  3692. specify library version info [each variable defaults to 0]
  3693. -weak LIBNAME declare that the target provides the LIBNAME interface
  3694. -Wc,FLAG
  3695. -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
  3696. -Wl,FLAG
  3697. -Xlinker FLAG pass linker-specific FLAG directly to the linker
  3698. -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
  3699. All other options (arguments beginning with '-') are ignored.
  3700. Every other argument is treated as a filename. Files ending in '.la' are
  3701. treated as uninstalled libtool libraries, other files are standard or library
  3702. object files.
  3703. If the OUTPUT-FILE ends in '.la', then a libtool library is created,
  3704. only library objects ('.lo' files) may be specified, and '-rpath' is
  3705. required, except when creating a convenience library.
  3706. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
  3707. using 'ar' and 'ranlib', or on Windows using 'lib'.
  3708. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
  3709. is created, otherwise an executable program is created."
  3710. ;;
  3711. uninstall)
  3712. $ECHO \
  3713. "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  3714. Remove libraries from an installation directory.
  3715. RM is the name of the program to use to delete files associated with each FILE
  3716. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3717. to RM.
  3718. If FILE is a libtool library, all the files associated with it are deleted.
  3719. Otherwise, only FILE itself is deleted using RM."
  3720. ;;
  3721. *)
  3722. func_fatal_help "invalid operation mode '$opt_mode'"
  3723. ;;
  3724. esac
  3725. echo
  3726. $ECHO "Try '$progname --help' for more information about other modes."
  3727. }
  3728. # Now that we've collected a possible --mode arg, show help if necessary
  3729. if $opt_help; then
  3730. if test : = "$opt_help"; then
  3731. func_mode_help
  3732. else
  3733. {
  3734. func_help noexit
  3735. for opt_mode in compile link execute install finish uninstall clean; do
  3736. func_mode_help
  3737. done
  3738. } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
  3739. {
  3740. func_help noexit
  3741. for opt_mode in compile link execute install finish uninstall clean; do
  3742. echo
  3743. func_mode_help
  3744. done
  3745. } |
  3746. $SED '1d
  3747. /^When reporting/,/^Report/{
  3748. H
  3749. d
  3750. }
  3751. $x
  3752. /information about other modes/d
  3753. /more detailed .*MODE/d
  3754. s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  3755. fi
  3756. exit $?
  3757. fi
  3758. # func_mode_execute arg...
  3759. func_mode_execute ()
  3760. {
  3761. $debug_cmd
  3762. # The first argument is the command name.
  3763. cmd=$nonopt
  3764. test -z "$cmd" && \
  3765. func_fatal_help "you must specify a COMMAND"
  3766. # Handle -dlopen flags immediately.
  3767. for file in $opt_dlopen; do
  3768. test -f "$file" \
  3769. || func_fatal_help "'$file' is not a file"
  3770. dir=
  3771. case $file in
  3772. *.la)
  3773. func_resolve_sysroot "$file"
  3774. file=$func_resolve_sysroot_result
  3775. # Check to see that this really is a libtool archive.
  3776. func_lalib_unsafe_p "$file" \
  3777. || func_fatal_help "'$lib' is not a valid libtool archive"
  3778. # Read the libtool library.
  3779. dlname=
  3780. library_names=
  3781. func_source "$file"
  3782. # Skip this library if it cannot be dlopened.
  3783. if test -z "$dlname"; then
  3784. # Warn if it was a shared library.
  3785. test -n "$library_names" && \
  3786. func_warning "'$file' was not linked with '-export-dynamic'"
  3787. continue
  3788. fi
  3789. func_dirname "$file" "" "."
  3790. dir=$func_dirname_result
  3791. if test -f "$dir/$objdir/$dlname"; then
  3792. func_append dir "/$objdir"
  3793. else
  3794. if test ! -f "$dir/$dlname"; then
  3795. func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
  3796. fi
  3797. fi
  3798. ;;
  3799. *.lo)
  3800. # Just add the directory containing the .lo file.
  3801. func_dirname "$file" "" "."
  3802. dir=$func_dirname_result
  3803. ;;
  3804. *)
  3805. func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
  3806. continue
  3807. ;;
  3808. esac
  3809. # Get the absolute pathname.
  3810. absdir=`cd "$dir" && pwd`
  3811. test -n "$absdir" && dir=$absdir
  3812. # Now add the directory to shlibpath_var.
  3813. if eval "test -z \"\$$shlibpath_var\""; then
  3814. eval "$shlibpath_var=\"\$dir\""
  3815. else
  3816. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3817. fi
  3818. done
  3819. # This variable tells wrapper scripts just to set shlibpath_var
  3820. # rather than running their programs.
  3821. libtool_execute_magic=$magic
  3822. # Check if any of the arguments is a wrapper script.
  3823. args=
  3824. for file
  3825. do
  3826. case $file in
  3827. -* | *.la | *.lo ) ;;
  3828. *)
  3829. # Do a test to see if this is really a libtool program.
  3830. if func_ltwrapper_script_p "$file"; then
  3831. func_source "$file"
  3832. # Transform arg to wrapped name.
  3833. file=$progdir/$program
  3834. elif func_ltwrapper_executable_p "$file"; then
  3835. func_ltwrapper_scriptname "$file"
  3836. func_source "$func_ltwrapper_scriptname_result"
  3837. # Transform arg to wrapped name.
  3838. file=$progdir/$program
  3839. fi
  3840. ;;
  3841. esac
  3842. # Quote arguments (to preserve shell metacharacters).
  3843. func_append_quoted args "$file"
  3844. done
  3845. if $opt_dry_run; then
  3846. # Display what would be done.
  3847. if test -n "$shlibpath_var"; then
  3848. eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  3849. echo "export $shlibpath_var"
  3850. fi
  3851. $ECHO "$cmd$args"
  3852. exit $EXIT_SUCCESS
  3853. else
  3854. if test -n "$shlibpath_var"; then
  3855. # Export the shlibpath_var.
  3856. eval "export $shlibpath_var"
  3857. fi
  3858. # Restore saved environment variables
  3859. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  3860. do
  3861. eval "if test \"\${save_$lt_var+set}\" = set; then
  3862. $lt_var=\$save_$lt_var; export $lt_var
  3863. else
  3864. $lt_unset $lt_var
  3865. fi"
  3866. done
  3867. # Now prepare to actually exec the command.
  3868. exec_cmd=\$cmd$args
  3869. fi
  3870. }
  3871. test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
  3872. # func_mode_finish arg...
  3873. func_mode_finish ()
  3874. {
  3875. $debug_cmd
  3876. libs=
  3877. libdirs=
  3878. admincmds=
  3879. for opt in "$nonopt" ${1+"$@"}
  3880. do
  3881. if test -d "$opt"; then
  3882. func_append libdirs " $opt"
  3883. elif test -f "$opt"; then
  3884. if func_lalib_unsafe_p "$opt"; then
  3885. func_append libs " $opt"
  3886. else
  3887. func_warning "'$opt' is not a valid libtool archive"
  3888. fi
  3889. else
  3890. func_fatal_error "invalid argument '$opt'"
  3891. fi
  3892. done
  3893. if test -n "$libs"; then
  3894. if test -n "$lt_sysroot"; then
  3895. sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
  3896. sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
  3897. else
  3898. sysroot_cmd=
  3899. fi
  3900. # Remove sysroot references
  3901. if $opt_dry_run; then
  3902. for lib in $libs; do
  3903. echo "removing references to $lt_sysroot and '=' prefixes from $lib"
  3904. done
  3905. else
  3906. tmpdir=`func_mktempdir`
  3907. for lib in $libs; do
  3908. $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
  3909. > $tmpdir/tmp-la
  3910. mv -f $tmpdir/tmp-la $lib
  3911. done
  3912. ${RM}r "$tmpdir"
  3913. fi
  3914. fi
  3915. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3916. for libdir in $libdirs; do
  3917. if test -n "$finish_cmds"; then
  3918. # Do each command in the finish commands.
  3919. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  3920. '"$cmd"'"'
  3921. fi
  3922. if test -n "$finish_eval"; then
  3923. # Do the single finish_eval.
  3924. eval cmds=\"$finish_eval\"
  3925. $opt_dry_run || eval "$cmds" || func_append admincmds "
  3926. $cmds"
  3927. fi
  3928. done
  3929. fi
  3930. # Exit here if they wanted silent mode.
  3931. $opt_quiet && exit $EXIT_SUCCESS
  3932. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3933. echo "----------------------------------------------------------------------"
  3934. echo "Libraries have been installed in:"
  3935. for libdir in $libdirs; do
  3936. $ECHO " $libdir"
  3937. done
  3938. echo
  3939. echo "If you ever happen to want to link against installed libraries"
  3940. echo "in a given directory, LIBDIR, you must either use libtool, and"
  3941. echo "specify the full pathname of the library, or use the '-LLIBDIR'"
  3942. echo "flag during linking and do at least one of the following:"
  3943. if test -n "$shlibpath_var"; then
  3944. echo " - add LIBDIR to the '$shlibpath_var' environment variable"
  3945. echo " during execution"
  3946. fi
  3947. if test -n "$runpath_var"; then
  3948. echo " - add LIBDIR to the '$runpath_var' environment variable"
  3949. echo " during linking"
  3950. fi
  3951. if test -n "$hardcode_libdir_flag_spec"; then
  3952. libdir=LIBDIR
  3953. eval flag=\"$hardcode_libdir_flag_spec\"
  3954. $ECHO " - use the '$flag' linker flag"
  3955. fi
  3956. if test -n "$admincmds"; then
  3957. $ECHO " - have your system administrator run these commands:$admincmds"
  3958. fi
  3959. if test -f /etc/ld.so.conf; then
  3960. echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
  3961. fi
  3962. echo
  3963. echo "See any operating system documentation about shared libraries for"
  3964. case $host in
  3965. solaris2.[6789]|solaris2.1[0-9])
  3966. echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  3967. echo "pages."
  3968. ;;
  3969. *)
  3970. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3971. ;;
  3972. esac
  3973. echo "----------------------------------------------------------------------"
  3974. fi
  3975. exit $EXIT_SUCCESS
  3976. }
  3977. test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
  3978. # func_mode_install arg...
  3979. func_mode_install ()
  3980. {
  3981. $debug_cmd
  3982. # There may be an optional sh(1) argument at the beginning of
  3983. # install_prog (especially on Windows NT).
  3984. if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
  3985. # Allow the use of GNU shtool's install command.
  3986. case $nonopt in *shtool*) :;; *) false;; esac
  3987. then
  3988. # Aesthetically quote it.
  3989. func_quote_arg pretty "$nonopt"
  3990. install_prog="$func_quote_arg_result "
  3991. arg=$1
  3992. shift
  3993. else
  3994. install_prog=
  3995. arg=$nonopt
  3996. fi
  3997. # The real first argument should be the name of the installation program.
  3998. # Aesthetically quote it.
  3999. func_quote_arg pretty "$arg"
  4000. func_append install_prog "$func_quote_arg_result"
  4001. install_shared_prog=$install_prog
  4002. case " $install_prog " in
  4003. *[\\\ /]cp\ *) install_cp=: ;;
  4004. *) install_cp=false ;;
  4005. esac
  4006. # We need to accept at least all the BSD install flags.
  4007. dest=
  4008. files=
  4009. opts=
  4010. prev=
  4011. install_type=
  4012. isdir=false
  4013. stripme=
  4014. no_mode=:
  4015. for arg
  4016. do
  4017. arg2=
  4018. if test -n "$dest"; then
  4019. func_append files " $dest"
  4020. dest=$arg
  4021. continue
  4022. fi
  4023. case $arg in
  4024. -d) isdir=: ;;
  4025. -f)
  4026. if $install_cp; then :; else
  4027. prev=$arg
  4028. fi
  4029. ;;
  4030. -g | -m | -o)
  4031. prev=$arg
  4032. ;;
  4033. -s)
  4034. stripme=" -s"
  4035. continue
  4036. ;;
  4037. -*)
  4038. ;;
  4039. *)
  4040. # If the previous option needed an argument, then skip it.
  4041. if test -n "$prev"; then
  4042. if test X-m = "X$prev" && test -n "$install_override_mode"; then
  4043. arg2=$install_override_mode
  4044. no_mode=false
  4045. fi
  4046. prev=
  4047. else
  4048. dest=$arg
  4049. continue
  4050. fi
  4051. ;;
  4052. esac
  4053. # Aesthetically quote the argument.
  4054. func_quote_arg pretty "$arg"
  4055. func_append install_prog " $func_quote_arg_result"
  4056. if test -n "$arg2"; then
  4057. func_quote_arg pretty "$arg2"
  4058. fi
  4059. func_append install_shared_prog " $func_quote_arg_result"
  4060. done
  4061. test -z "$install_prog" && \
  4062. func_fatal_help "you must specify an install program"
  4063. test -n "$prev" && \
  4064. func_fatal_help "the '$prev' option requires an argument"
  4065. if test -n "$install_override_mode" && $no_mode; then
  4066. if $install_cp; then :; else
  4067. func_quote_arg pretty "$install_override_mode"
  4068. func_append install_shared_prog " -m $func_quote_arg_result"
  4069. fi
  4070. fi
  4071. if test -z "$files"; then
  4072. if test -z "$dest"; then
  4073. func_fatal_help "no file or destination specified"
  4074. else
  4075. func_fatal_help "you must specify a destination"
  4076. fi
  4077. fi
  4078. # Strip any trailing slash from the destination.
  4079. func_stripname '' '/' "$dest"
  4080. dest=$func_stripname_result
  4081. # Check to see that the destination is a directory.
  4082. test -d "$dest" && isdir=:
  4083. if $isdir; then
  4084. destdir=$dest
  4085. destname=
  4086. else
  4087. func_dirname_and_basename "$dest" "" "."
  4088. destdir=$func_dirname_result
  4089. destname=$func_basename_result
  4090. func_stripname '' '/' "$destdir"
  4091. destdir=$func_stripname_result
  4092. # Not a directory, so check to see that there is only one file specified.
  4093. set dummy $files; shift
  4094. test "$#" -gt 1 && \
  4095. func_fatal_help "'$dest' is not a directory"
  4096. fi
  4097. case $destdir in
  4098. [\\/]* | [A-Za-z]:[\\/]*)
  4099. func_normal_abspath "$destdir"
  4100. destdir="$func_normal_abspath_result"
  4101. ;;
  4102. *)
  4103. for file in $files; do
  4104. case $file in
  4105. *.lo) ;;
  4106. *)
  4107. func_fatal_help "'$destdir' must be an absolute directory name"
  4108. ;;
  4109. esac
  4110. done
  4111. ;;
  4112. esac
  4113. # This variable tells wrapper scripts just to set variables rather
  4114. # than running their programs.
  4115. libtool_install_magic=$magic
  4116. staticlibs=
  4117. future_libdirs=
  4118. current_libdirs=
  4119. for file in $files; do
  4120. # Do each installation.
  4121. case $file in
  4122. *.$libext)
  4123. # Do the static libraries later.
  4124. func_append staticlibs " $file"
  4125. ;;
  4126. *.la)
  4127. func_resolve_sysroot "$file"
  4128. file=$func_resolve_sysroot_result
  4129. # Check to see that this really is a libtool archive.
  4130. func_lalib_unsafe_p "$file" \
  4131. || func_fatal_help "'$file' is not a valid libtool archive"
  4132. library_names=
  4133. old_library=
  4134. relink_command=
  4135. func_source "$file"
  4136. # Add the libdir to current_libdirs if it is the destination.
  4137. if test "X$destdir" = "X$libdir"; then
  4138. case "$current_libdirs " in
  4139. *" $libdir "*) ;;
  4140. *) func_append current_libdirs " $libdir" ;;
  4141. esac
  4142. else
  4143. # Note the libdir as a future libdir.
  4144. case "$future_libdirs " in
  4145. *" $libdir "*) ;;
  4146. *) func_append future_libdirs " $libdir" ;;
  4147. esac
  4148. fi
  4149. func_dirname "$file" "/" ""
  4150. dir=$func_dirname_result
  4151. func_append dir "$objdir"
  4152. if test -n "$relink_command"; then
  4153. # Determine the prefix the user has applied to our future dir.
  4154. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
  4155. # Don't allow the user to place us outside of our expected
  4156. # location b/c this prevents finding dependent libraries that
  4157. # are installed to the same prefix.
  4158. # At present, this check doesn't affect windows .dll's that
  4159. # are installed into $libdir/../bin (currently, that works fine)
  4160. # but it's something to keep an eye on.
  4161. test "$inst_prefix_dir" = "$destdir" && \
  4162. func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
  4163. if test -n "$inst_prefix_dir"; then
  4164. # Stick the inst_prefix_dir data into the link command.
  4165. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  4166. else
  4167. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  4168. fi
  4169. func_warning "relinking '$file'"
  4170. func_show_eval "$relink_command" \
  4171. 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
  4172. fi
  4173. # See the names of the shared library.
  4174. set dummy $library_names; shift
  4175. if test -n "$1"; then
  4176. realname=$1
  4177. shift
  4178. srcname=$realname
  4179. test -n "$relink_command" && srcname=${realname}T
  4180. # Install the shared library and build the symlinks.
  4181. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
  4182. 'exit $?'
  4183. tstripme=$stripme
  4184. case $host_os in
  4185. cygwin* | mingw* | pw32* | cegcc*)
  4186. case $realname in
  4187. *.dll.a)
  4188. tstripme=
  4189. ;;
  4190. esac
  4191. ;;
  4192. os2*)
  4193. case $realname in
  4194. *_dll.a)
  4195. tstripme=
  4196. ;;
  4197. esac
  4198. ;;
  4199. esac
  4200. if test -n "$tstripme" && test -n "$striplib"; then
  4201. func_show_eval "$striplib $destdir/$realname" 'exit $?'
  4202. fi
  4203. if test "$#" -gt 0; then
  4204. # Delete the old symlinks, and create new ones.
  4205. # Try 'ln -sf' first, because the 'ln' binary might depend on
  4206. # the symlink we replace! Solaris /bin/ln does not understand -f,
  4207. # so we also need to try rm && ln -s.
  4208. for linkname
  4209. do
  4210. test "$linkname" != "$realname" \
  4211. && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  4212. done
  4213. fi
  4214. # Do each command in the postinstall commands.
  4215. lib=$destdir/$realname
  4216. func_execute_cmds "$postinstall_cmds" 'exit $?'
  4217. fi
  4218. # Install the pseudo-library for information purposes.
  4219. func_basename "$file"
  4220. name=$func_basename_result
  4221. instname=$dir/${name}i
  4222. func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  4223. # Maybe install the static library, too.
  4224. test -n "$old_library" && func_append staticlibs " $dir/$old_library"
  4225. ;;
  4226. *.lo)
  4227. # Install (i.e. copy) a libtool object.
  4228. # Figure out destination file name, if it wasn't already specified.
  4229. if test -n "$destname"; then
  4230. destfile=$destdir/$destname
  4231. else
  4232. func_basename "$file"
  4233. destfile=$func_basename_result
  4234. destfile=$destdir/$destfile
  4235. fi
  4236. # Deduce the name of the destination old-style object file.
  4237. case $destfile in
  4238. *.lo)
  4239. func_lo2o "$destfile"
  4240. staticdest=$func_lo2o_result
  4241. ;;
  4242. *.$objext)
  4243. staticdest=$destfile
  4244. destfile=
  4245. ;;
  4246. *)
  4247. func_fatal_help "cannot copy a libtool object to '$destfile'"
  4248. ;;
  4249. esac
  4250. # Install the libtool object if requested.
  4251. test -n "$destfile" && \
  4252. func_show_eval "$install_prog $file $destfile" 'exit $?'
  4253. # Install the old object if enabled.
  4254. if test yes = "$build_old_libs"; then
  4255. # Deduce the name of the old-style object file.
  4256. func_lo2o "$file"
  4257. staticobj=$func_lo2o_result
  4258. func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  4259. fi
  4260. exit $EXIT_SUCCESS
  4261. ;;
  4262. *)
  4263. # Figure out destination file name, if it wasn't already specified.
  4264. if test -n "$destname"; then
  4265. destfile=$destdir/$destname
  4266. else
  4267. func_basename "$file"
  4268. destfile=$func_basename_result
  4269. destfile=$destdir/$destfile
  4270. fi
  4271. # If the file is missing, and there is a .exe on the end, strip it
  4272. # because it is most likely a libtool script we actually want to
  4273. # install
  4274. stripped_ext=
  4275. case $file in
  4276. *.exe)
  4277. if test ! -f "$file"; then
  4278. func_stripname '' '.exe' "$file"
  4279. file=$func_stripname_result
  4280. stripped_ext=.exe
  4281. fi
  4282. ;;
  4283. esac
  4284. # Do a test to see if this is really a libtool program.
  4285. case $host in
  4286. *cygwin* | *mingw*)
  4287. if func_ltwrapper_executable_p "$file"; then
  4288. func_ltwrapper_scriptname "$file"
  4289. wrapper=$func_ltwrapper_scriptname_result
  4290. else
  4291. func_stripname '' '.exe' "$file"
  4292. wrapper=$func_stripname_result
  4293. fi
  4294. ;;
  4295. *)
  4296. wrapper=$file
  4297. ;;
  4298. esac
  4299. if func_ltwrapper_script_p "$wrapper"; then
  4300. notinst_deplibs=
  4301. relink_command=
  4302. func_source "$wrapper"
  4303. # Check the variables that should have been set.
  4304. test -z "$generated_by_libtool_version" && \
  4305. func_fatal_error "invalid libtool wrapper script '$wrapper'"
  4306. finalize=:
  4307. for lib in $notinst_deplibs; do
  4308. # Check to see that each library is installed.
  4309. libdir=
  4310. if test -f "$lib"; then
  4311. func_source "$lib"
  4312. fi
  4313. libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
  4314. if test -n "$libdir" && test ! -f "$libfile"; then
  4315. func_warning "'$lib' has not been installed in '$libdir'"
  4316. finalize=false
  4317. fi
  4318. done
  4319. relink_command=
  4320. func_source "$wrapper"
  4321. outputname=
  4322. if test no = "$fast_install" && test -n "$relink_command"; then
  4323. $opt_dry_run || {
  4324. if $finalize; then
  4325. tmpdir=`func_mktempdir`
  4326. func_basename "$file$stripped_ext"
  4327. file=$func_basename_result
  4328. outputname=$tmpdir/$file
  4329. # Replace the output file specification.
  4330. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
  4331. $opt_quiet || {
  4332. func_quote_arg expand,pretty "$relink_command"
  4333. eval "func_echo $func_quote_arg_result"
  4334. }
  4335. if eval "$relink_command"; then :
  4336. else
  4337. func_error "error: relink '$file' with the above command before installing it"
  4338. $opt_dry_run || ${RM}r "$tmpdir"
  4339. continue
  4340. fi
  4341. file=$outputname
  4342. else
  4343. func_warning "cannot relink '$file'"
  4344. fi
  4345. }
  4346. else
  4347. # Install the binary that we compiled earlier.
  4348. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
  4349. fi
  4350. fi
  4351. # remove .exe since cygwin /usr/bin/install will append another
  4352. # one anyway
  4353. case $install_prog,$host in
  4354. */usr/bin/install*,*cygwin*)
  4355. case $file:$destfile in
  4356. *.exe:*.exe)
  4357. # this is ok
  4358. ;;
  4359. *.exe:*)
  4360. destfile=$destfile.exe
  4361. ;;
  4362. *:*.exe)
  4363. func_stripname '' '.exe' "$destfile"
  4364. destfile=$func_stripname_result
  4365. ;;
  4366. esac
  4367. ;;
  4368. esac
  4369. func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  4370. $opt_dry_run || if test -n "$outputname"; then
  4371. ${RM}r "$tmpdir"
  4372. fi
  4373. ;;
  4374. esac
  4375. done
  4376. for file in $staticlibs; do
  4377. func_basename "$file"
  4378. name=$func_basename_result
  4379. # Set up the ranlib parameters.
  4380. oldlib=$destdir/$name
  4381. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  4382. tool_oldlib=$func_to_tool_file_result
  4383. func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  4384. if test -n "$stripme" && test -n "$old_striplib"; then
  4385. func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
  4386. fi
  4387. # Do each command in the postinstall commands.
  4388. func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  4389. done
  4390. test -n "$future_libdirs" && \
  4391. func_warning "remember to run '$progname --finish$future_libdirs'"
  4392. if test -n "$current_libdirs"; then
  4393. # Maybe just do a dry run.
  4394. $opt_dry_run && current_libdirs=" -n$current_libdirs"
  4395. exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
  4396. else
  4397. exit $EXIT_SUCCESS
  4398. fi
  4399. }
  4400. test install = "$opt_mode" && func_mode_install ${1+"$@"}
  4401. # func_generate_dlsyms outputname originator pic_p
  4402. # Extract symbols from dlprefiles and create ${outputname}S.o with
  4403. # a dlpreopen symbol table.
  4404. func_generate_dlsyms ()
  4405. {
  4406. $debug_cmd
  4407. my_outputname=$1
  4408. my_originator=$2
  4409. my_pic_p=${3-false}
  4410. my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
  4411. my_dlsyms=
  4412. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  4413. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4414. my_dlsyms=${my_outputname}S.c
  4415. else
  4416. func_error "not configured to extract global symbols from dlpreopened files"
  4417. fi
  4418. fi
  4419. if test -n "$my_dlsyms"; then
  4420. case $my_dlsyms in
  4421. "") ;;
  4422. *.c)
  4423. # Discover the nlist of each of the dlfiles.
  4424. nlist=$output_objdir/$my_outputname.nm
  4425. func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  4426. # Parse the name list into a source file.
  4427. func_verbose "creating $output_objdir/$my_dlsyms"
  4428. $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  4429. /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
  4430. /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
  4431. #ifdef __cplusplus
  4432. extern \"C\" {
  4433. #endif
  4434. #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
  4435. #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
  4436. #endif
  4437. /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
  4438. #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
  4439. /* DATA imports from DLLs on WIN32 can't be const, because runtime
  4440. relocations are performed -- see ld's documentation on pseudo-relocs. */
  4441. # define LT_DLSYM_CONST
  4442. #elif defined __osf__
  4443. /* This system does not cope well with relocations in const data. */
  4444. # define LT_DLSYM_CONST
  4445. #else
  4446. # define LT_DLSYM_CONST const
  4447. #endif
  4448. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  4449. /* External symbol declarations for the compiler. */\
  4450. "
  4451. if test yes = "$dlself"; then
  4452. func_verbose "generating symbol list for '$output'"
  4453. $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  4454. # Add our own program objects to the symbol list.
  4455. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  4456. for progfile in $progfiles; do
  4457. func_to_tool_file "$progfile" func_convert_file_msys_to_w32
  4458. func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
  4459. $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
  4460. done
  4461. if test -n "$exclude_expsyms"; then
  4462. $opt_dry_run || {
  4463. eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4464. eval '$MV "$nlist"T "$nlist"'
  4465. }
  4466. fi
  4467. if test -n "$export_symbols_regex"; then
  4468. $opt_dry_run || {
  4469. eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4470. eval '$MV "$nlist"T "$nlist"'
  4471. }
  4472. fi
  4473. # Prepare the list of exported symbols
  4474. if test -z "$export_symbols"; then
  4475. export_symbols=$output_objdir/$outputname.exp
  4476. $opt_dry_run || {
  4477. $RM $export_symbols
  4478. eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4479. case $host in
  4480. *cygwin* | *mingw* | *cegcc* )
  4481. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4482. eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  4483. ;;
  4484. esac
  4485. }
  4486. else
  4487. $opt_dry_run || {
  4488. eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4489. eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4490. eval '$MV "$nlist"T "$nlist"'
  4491. case $host in
  4492. *cygwin* | *mingw* | *cegcc* )
  4493. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4494. eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  4495. ;;
  4496. esac
  4497. }
  4498. fi
  4499. fi
  4500. for dlprefile in $dlprefiles; do
  4501. func_verbose "extracting global C symbols from '$dlprefile'"
  4502. func_basename "$dlprefile"
  4503. name=$func_basename_result
  4504. case $host in
  4505. *cygwin* | *mingw* | *cegcc* )
  4506. # if an import library, we need to obtain dlname
  4507. if func_win32_import_lib_p "$dlprefile"; then
  4508. func_tr_sh "$dlprefile"
  4509. eval "curr_lafile=\$libfile_$func_tr_sh_result"
  4510. dlprefile_dlbasename=
  4511. if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
  4512. # Use subshell, to avoid clobbering current variable values
  4513. dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
  4514. if test -n "$dlprefile_dlname"; then
  4515. func_basename "$dlprefile_dlname"
  4516. dlprefile_dlbasename=$func_basename_result
  4517. else
  4518. # no lafile. user explicitly requested -dlpreopen <import library>.
  4519. $sharedlib_from_linklib_cmd "$dlprefile"
  4520. dlprefile_dlbasename=$sharedlib_from_linklib_result
  4521. fi
  4522. fi
  4523. $opt_dry_run || {
  4524. if test -n "$dlprefile_dlbasename"; then
  4525. eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
  4526. else
  4527. func_warning "Could not compute DLL name from $name"
  4528. eval '$ECHO ": $name " >> "$nlist"'
  4529. fi
  4530. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4531. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
  4532. $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
  4533. }
  4534. else # not an import lib
  4535. $opt_dry_run || {
  4536. eval '$ECHO ": $name " >> "$nlist"'
  4537. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4538. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4539. }
  4540. fi
  4541. ;;
  4542. *)
  4543. $opt_dry_run || {
  4544. eval '$ECHO ": $name " >> "$nlist"'
  4545. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4546. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4547. }
  4548. ;;
  4549. esac
  4550. done
  4551. $opt_dry_run || {
  4552. # Make sure we have at least an empty file.
  4553. test -f "$nlist" || : > "$nlist"
  4554. if test -n "$exclude_expsyms"; then
  4555. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4556. $MV "$nlist"T "$nlist"
  4557. fi
  4558. # Try sorting and uniquifying the output.
  4559. if $GREP -v "^: " < "$nlist" |
  4560. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4561. sort -k 3
  4562. else
  4563. sort +2
  4564. fi |
  4565. uniq > "$nlist"S; then
  4566. :
  4567. else
  4568. $GREP -v "^: " < "$nlist" > "$nlist"S
  4569. fi
  4570. if test -f "$nlist"S; then
  4571. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  4572. else
  4573. echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
  4574. fi
  4575. func_show_eval '$RM "${nlist}I"'
  4576. if test -n "$global_symbol_to_import"; then
  4577. eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
  4578. fi
  4579. echo >> "$output_objdir/$my_dlsyms" "\
  4580. /* The mapping between symbol names and symbols. */
  4581. typedef struct {
  4582. const char *name;
  4583. void *address;
  4584. } lt_dlsymlist;
  4585. extern LT_DLSYM_CONST lt_dlsymlist
  4586. lt_${my_prefix}_LTX_preloaded_symbols[];\
  4587. "
  4588. if test -s "$nlist"I; then
  4589. echo >> "$output_objdir/$my_dlsyms" "\
  4590. static void lt_syminit(void)
  4591. {
  4592. LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
  4593. for (; symbol->name; ++symbol)
  4594. {"
  4595. $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
  4596. echo >> "$output_objdir/$my_dlsyms" "\
  4597. }
  4598. }"
  4599. fi
  4600. echo >> "$output_objdir/$my_dlsyms" "\
  4601. LT_DLSYM_CONST lt_dlsymlist
  4602. lt_${my_prefix}_LTX_preloaded_symbols[] =
  4603. { {\"$my_originator\", (void *) 0},"
  4604. if test -s "$nlist"I; then
  4605. echo >> "$output_objdir/$my_dlsyms" "\
  4606. {\"@INIT@\", (void *) &lt_syminit},"
  4607. fi
  4608. case $need_lib_prefix in
  4609. no)
  4610. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4611. ;;
  4612. *)
  4613. eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4614. ;;
  4615. esac
  4616. echo >> "$output_objdir/$my_dlsyms" "\
  4617. {0, (void *) 0}
  4618. };
  4619. /* This works around a problem in FreeBSD linker */
  4620. #ifdef FREEBSD_WORKAROUND
  4621. static const void *lt_preloaded_setup() {
  4622. return lt_${my_prefix}_LTX_preloaded_symbols;
  4623. }
  4624. #endif
  4625. #ifdef __cplusplus
  4626. }
  4627. #endif\
  4628. "
  4629. } # !$opt_dry_run
  4630. pic_flag_for_symtable=
  4631. case "$compile_command " in
  4632. *" -static "*) ;;
  4633. *)
  4634. case $host in
  4635. # compiling the symbol table file with pic_flag works around
  4636. # a FreeBSD bug that causes programs to crash when -lm is
  4637. # linked before any other PIC object. But we must not use
  4638. # pic_flag when linking with -static. The problem exists in
  4639. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4640. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4641. pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  4642. *-*-hpux*)
  4643. pic_flag_for_symtable=" $pic_flag" ;;
  4644. *)
  4645. $my_pic_p && pic_flag_for_symtable=" $pic_flag"
  4646. ;;
  4647. esac
  4648. ;;
  4649. esac
  4650. symtab_cflags=
  4651. for arg in $LTCFLAGS; do
  4652. case $arg in
  4653. -pie | -fpie | -fPIE) ;;
  4654. *) func_append symtab_cflags " $arg" ;;
  4655. esac
  4656. done
  4657. # Now compile the dynamic symbol file.
  4658. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  4659. # Clean up the generated files.
  4660. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
  4661. # Transform the symbol file into the correct name.
  4662. symfileobj=$output_objdir/${my_outputname}S.$objext
  4663. case $host in
  4664. *cygwin* | *mingw* | *cegcc* )
  4665. if test -f "$output_objdir/$my_outputname.def"; then
  4666. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4667. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4668. else
  4669. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4670. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4671. fi
  4672. ;;
  4673. *)
  4674. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4675. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4676. ;;
  4677. esac
  4678. ;;
  4679. *)
  4680. func_fatal_error "unknown suffix for '$my_dlsyms'"
  4681. ;;
  4682. esac
  4683. else
  4684. # We keep going just in case the user didn't refer to
  4685. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4686. # really was required.
  4687. # Nullify the symbol file.
  4688. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
  4689. finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
  4690. fi
  4691. }
  4692. # func_cygming_gnu_implib_p ARG
  4693. # This predicate returns with zero status (TRUE) if
  4694. # ARG is a GNU/binutils-style import library. Returns
  4695. # with nonzero status (FALSE) otherwise.
  4696. func_cygming_gnu_implib_p ()
  4697. {
  4698. $debug_cmd
  4699. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4700. 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)$'`
  4701. test -n "$func_cygming_gnu_implib_tmp"
  4702. }
  4703. # func_cygming_ms_implib_p ARG
  4704. # This predicate returns with zero status (TRUE) if
  4705. # ARG is an MS-style import library. Returns
  4706. # with nonzero status (FALSE) otherwise.
  4707. func_cygming_ms_implib_p ()
  4708. {
  4709. $debug_cmd
  4710. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4711. func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  4712. test -n "$func_cygming_ms_implib_tmp"
  4713. }
  4714. # func_win32_libid arg
  4715. # return the library type of file 'arg'
  4716. #
  4717. # Need a lot of goo to handle *both* DLLs and import libs
  4718. # Has to be a shell function in order to 'eat' the argument
  4719. # that is supplied when $file_magic_command is called.
  4720. # Despite the name, also deal with 64 bit binaries.
  4721. func_win32_libid ()
  4722. {
  4723. $debug_cmd
  4724. win32_libid_type=unknown
  4725. win32_fileres=`file -L $1 2>/dev/null`
  4726. case $win32_fileres in
  4727. *ar\ archive\ import\ library*) # definitely import
  4728. win32_libid_type="x86 archive import"
  4729. ;;
  4730. *ar\ archive*) # could be an import, or static
  4731. # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
  4732. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  4733. $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
  4734. case $nm_interface in
  4735. "MS dumpbin")
  4736. if func_cygming_ms_implib_p "$1" ||
  4737. func_cygming_gnu_implib_p "$1"
  4738. then
  4739. win32_nmres=import
  4740. else
  4741. win32_nmres=
  4742. fi
  4743. ;;
  4744. *)
  4745. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4746. win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
  4747. $SED -n -e '
  4748. 1,100{
  4749. / I /{
  4750. s|.*|import|
  4751. p
  4752. q
  4753. }
  4754. }'`
  4755. ;;
  4756. esac
  4757. case $win32_nmres in
  4758. import*) win32_libid_type="x86 archive import";;
  4759. *) win32_libid_type="x86 archive static";;
  4760. esac
  4761. fi
  4762. ;;
  4763. *DLL*)
  4764. win32_libid_type="x86 DLL"
  4765. ;;
  4766. *executable*) # but shell scripts are "executable" too...
  4767. case $win32_fileres in
  4768. *MS\ Windows\ PE\ Intel*)
  4769. win32_libid_type="x86 DLL"
  4770. ;;
  4771. esac
  4772. ;;
  4773. esac
  4774. $ECHO "$win32_libid_type"
  4775. }
  4776. # func_cygming_dll_for_implib ARG
  4777. #
  4778. # Platform-specific function to extract the
  4779. # name of the DLL associated with the specified
  4780. # import library ARG.
  4781. # Invoked by eval'ing the libtool variable
  4782. # $sharedlib_from_linklib_cmd
  4783. # Result is available in the variable
  4784. # $sharedlib_from_linklib_result
  4785. func_cygming_dll_for_implib ()
  4786. {
  4787. $debug_cmd
  4788. sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
  4789. }
  4790. # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
  4791. #
  4792. # The is the core of a fallback implementation of a
  4793. # platform-specific function to extract the name of the
  4794. # DLL associated with the specified import library LIBNAME.
  4795. #
  4796. # SECTION_NAME is either .idata$6 or .idata$7, depending
  4797. # on the platform and compiler that created the implib.
  4798. #
  4799. # Echos the name of the DLL associated with the
  4800. # specified import library.
  4801. func_cygming_dll_for_implib_fallback_core ()
  4802. {
  4803. $debug_cmd
  4804. match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  4805. $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
  4806. $SED '/^Contents of section '"$match_literal"':/{
  4807. # Place marker at beginning of archive member dllname section
  4808. s/.*/====MARK====/
  4809. p
  4810. d
  4811. }
  4812. # These lines can sometimes be longer than 43 characters, but
  4813. # are always uninteresting
  4814. /:[ ]*file format pe[i]\{,1\}-/d
  4815. /^In archive [^:]*:/d
  4816. # Ensure marker is printed
  4817. /^====MARK====/p
  4818. # Remove all lines with less than 43 characters
  4819. /^.\{43\}/!d
  4820. # From remaining lines, remove first 43 characters
  4821. s/^.\{43\}//' |
  4822. $SED -n '
  4823. # Join marker and all lines until next marker into a single line
  4824. /^====MARK====/ b para
  4825. H
  4826. $ b para
  4827. b
  4828. :para
  4829. x
  4830. s/\n//g
  4831. # Remove the marker
  4832. s/^====MARK====//
  4833. # Remove trailing dots and whitespace
  4834. s/[\. \t]*$//
  4835. # Print
  4836. /./p' |
  4837. # we now have a list, one entry per line, of the stringified
  4838. # contents of the appropriate section of all members of the
  4839. # archive that possess that section. Heuristic: eliminate
  4840. # all those that have a first or second character that is
  4841. # a '.' (that is, objdump's representation of an unprintable
  4842. # character.) This should work for all archives with less than
  4843. # 0x302f exports -- but will fail for DLLs whose name actually
  4844. # begins with a literal '.' or a single character followed by
  4845. # a '.'.
  4846. #
  4847. # Of those that remain, print the first one.
  4848. $SED -e '/^\./d;/^.\./d;q'
  4849. }
  4850. # func_cygming_dll_for_implib_fallback ARG
  4851. # Platform-specific function to extract the
  4852. # name of the DLL associated with the specified
  4853. # import library ARG.
  4854. #
  4855. # This fallback implementation is for use when $DLLTOOL
  4856. # does not support the --identify-strict option.
  4857. # Invoked by eval'ing the libtool variable
  4858. # $sharedlib_from_linklib_cmd
  4859. # Result is available in the variable
  4860. # $sharedlib_from_linklib_result
  4861. func_cygming_dll_for_implib_fallback ()
  4862. {
  4863. $debug_cmd
  4864. if func_cygming_gnu_implib_p "$1"; then
  4865. # binutils import library
  4866. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  4867. elif func_cygming_ms_implib_p "$1"; then
  4868. # ms-generated import library
  4869. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  4870. else
  4871. # unknown
  4872. sharedlib_from_linklib_result=
  4873. fi
  4874. }
  4875. # func_extract_an_archive dir oldlib
  4876. func_extract_an_archive ()
  4877. {
  4878. $debug_cmd
  4879. f_ex_an_ar_dir=$1; shift
  4880. f_ex_an_ar_oldlib=$1
  4881. if test yes = "$lock_old_archive_extraction"; then
  4882. lockfile=$f_ex_an_ar_oldlib.lock
  4883. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  4884. func_echo "Waiting for $lockfile to be removed"
  4885. sleep 2
  4886. done
  4887. fi
  4888. func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
  4889. 'stat=$?; rm -f "$lockfile"; exit $stat'
  4890. if test yes = "$lock_old_archive_extraction"; then
  4891. $opt_dry_run || rm -f "$lockfile"
  4892. fi
  4893. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  4894. :
  4895. else
  4896. func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  4897. fi
  4898. }
  4899. # func_extract_archives gentop oldlib ...
  4900. func_extract_archives ()
  4901. {
  4902. $debug_cmd
  4903. my_gentop=$1; shift
  4904. my_oldlibs=${1+"$@"}
  4905. my_oldobjs=
  4906. my_xlib=
  4907. my_xabs=
  4908. my_xdir=
  4909. for my_xlib in $my_oldlibs; do
  4910. # Extract the objects.
  4911. case $my_xlib in
  4912. [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
  4913. *) my_xabs=`pwd`"/$my_xlib" ;;
  4914. esac
  4915. func_basename "$my_xlib"
  4916. my_xlib=$func_basename_result
  4917. my_xlib_u=$my_xlib
  4918. while :; do
  4919. case " $extracted_archives " in
  4920. *" $my_xlib_u "*)
  4921. func_arith $extracted_serial + 1
  4922. extracted_serial=$func_arith_result
  4923. my_xlib_u=lt$extracted_serial-$my_xlib ;;
  4924. *) break ;;
  4925. esac
  4926. done
  4927. extracted_archives="$extracted_archives $my_xlib_u"
  4928. my_xdir=$my_gentop/$my_xlib_u
  4929. func_mkdir_p "$my_xdir"
  4930. case $host in
  4931. *-darwin*)
  4932. func_verbose "Extracting $my_xabs"
  4933. # Do not bother doing anything if just a dry run
  4934. $opt_dry_run || {
  4935. darwin_orig_dir=`pwd`
  4936. cd $my_xdir || exit $?
  4937. darwin_archive=$my_xabs
  4938. darwin_curdir=`pwd`
  4939. func_basename "$darwin_archive"
  4940. darwin_base_archive=$func_basename_result
  4941. darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  4942. if test -n "$darwin_arches"; then
  4943. darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  4944. darwin_arch=
  4945. func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  4946. for darwin_arch in $darwin_arches; do
  4947. func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
  4948. $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
  4949. cd "unfat-$$/$darwin_base_archive-$darwin_arch"
  4950. func_extract_an_archive "`pwd`" "$darwin_base_archive"
  4951. cd "$darwin_curdir"
  4952. $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
  4953. done # $darwin_arches
  4954. ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  4955. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
  4956. darwin_file=
  4957. darwin_files=
  4958. for darwin_file in $darwin_filelist; do
  4959. darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  4960. $LIPO -create -output "$darwin_file" $darwin_files
  4961. done # $darwin_filelist
  4962. $RM -rf unfat-$$
  4963. cd "$darwin_orig_dir"
  4964. else
  4965. cd $darwin_orig_dir
  4966. func_extract_an_archive "$my_xdir" "$my_xabs"
  4967. fi # $darwin_arches
  4968. } # !$opt_dry_run
  4969. ;;
  4970. *)
  4971. func_extract_an_archive "$my_xdir" "$my_xabs"
  4972. ;;
  4973. esac
  4974. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  4975. done
  4976. func_extract_archives_result=$my_oldobjs
  4977. }
  4978. # func_emit_wrapper [arg=no]
  4979. #
  4980. # Emit a libtool wrapper script on stdout.
  4981. # Don't directly open a file because we may want to
  4982. # incorporate the script contents within a cygwin/mingw
  4983. # wrapper executable. Must ONLY be called from within
  4984. # func_mode_link because it depends on a number of variables
  4985. # set therein.
  4986. #
  4987. # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  4988. # variable will take. If 'yes', then the emitted script
  4989. # will assume that the directory where it is stored is
  4990. # the $objdir directory. This is a cygwin/mingw-specific
  4991. # behavior.
  4992. func_emit_wrapper ()
  4993. {
  4994. func_emit_wrapper_arg1=${1-no}
  4995. $ECHO "\
  4996. #! $SHELL
  4997. # $output - temporary wrapper script for $objdir/$outputname
  4998. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  4999. #
  5000. # The $output program cannot be directly executed until all the libtool
  5001. # libraries that it depends on are installed.
  5002. #
  5003. # This wrapper script should never be moved out of the build directory.
  5004. # If it is, it will not operate correctly.
  5005. # Sed substitution that helps us do robust quoting. It backslashifies
  5006. # metacharacters that are still active within double-quoted strings.
  5007. sed_quote_subst='$sed_quote_subst'
  5008. # Be Bourne compatible
  5009. if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  5010. emulate sh
  5011. NULLCMD=:
  5012. # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  5013. # is contrary to our usage. Disable this feature.
  5014. alias -g '\${1+\"\$@\"}'='\"\$@\"'
  5015. setopt NO_GLOB_SUBST
  5016. else
  5017. case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  5018. fi
  5019. BIN_SH=xpg4; export BIN_SH # for Tru64
  5020. DUALCASE=1; export DUALCASE # for MKS sh
  5021. # The HP-UX ksh and POSIX shell print the target directory to stdout
  5022. # if CDPATH is set.
  5023. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  5024. relink_command=\"$relink_command\"
  5025. # This environment variable determines our operation mode.
  5026. if test \"\$libtool_install_magic\" = \"$magic\"; then
  5027. # install mode needs the following variables:
  5028. generated_by_libtool_version='$macro_version'
  5029. notinst_deplibs='$notinst_deplibs'
  5030. else
  5031. # When we are sourced in execute mode, \$file and \$ECHO are already set.
  5032. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5033. file=\"\$0\""
  5034. func_quote_arg pretty "$ECHO"
  5035. qECHO=$func_quote_arg_result
  5036. $ECHO "\
  5037. # A function that is used when there is no print builtin or printf.
  5038. func_fallback_echo ()
  5039. {
  5040. eval 'cat <<_LTECHO_EOF
  5041. \$1
  5042. _LTECHO_EOF'
  5043. }
  5044. ECHO=$qECHO
  5045. fi
  5046. # Very basic option parsing. These options are (a) specific to
  5047. # the libtool wrapper, (b) are identical between the wrapper
  5048. # /script/ and the wrapper /executable/ that is used only on
  5049. # windows platforms, and (c) all begin with the string "--lt-"
  5050. # (application programs are unlikely to have options that match
  5051. # this pattern).
  5052. #
  5053. # There are only two supported options: --lt-debug and
  5054. # --lt-dump-script. There is, deliberately, no --lt-help.
  5055. #
  5056. # The first argument to this parsing function should be the
  5057. # script's $0 value, followed by "$@".
  5058. lt_option_debug=
  5059. func_parse_lt_options ()
  5060. {
  5061. lt_script_arg0=\$0
  5062. shift
  5063. for lt_opt
  5064. do
  5065. case \"\$lt_opt\" in
  5066. --lt-debug) lt_option_debug=1 ;;
  5067. --lt-dump-script)
  5068. lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
  5069. test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
  5070. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
  5071. cat \"\$lt_dump_D/\$lt_dump_F\"
  5072. exit 0
  5073. ;;
  5074. --lt-*)
  5075. \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
  5076. exit 1
  5077. ;;
  5078. esac
  5079. done
  5080. # Print the debug banner immediately:
  5081. if test -n \"\$lt_option_debug\"; then
  5082. echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  5083. fi
  5084. }
  5085. # Used when --lt-debug. Prints its arguments to stdout
  5086. # (redirection is the responsibility of the caller)
  5087. func_lt_dump_args ()
  5088. {
  5089. lt_dump_args_N=1;
  5090. for lt_arg
  5091. do
  5092. \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
  5093. lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  5094. done
  5095. }
  5096. # Core function for launching the target application
  5097. func_exec_program_core ()
  5098. {
  5099. "
  5100. case $host in
  5101. # Backslashes separate directories on plain windows
  5102. *-*-mingw | *-*-os2* | *-cegcc*)
  5103. $ECHO "\
  5104. if test -n \"\$lt_option_debug\"; then
  5105. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
  5106. func_lt_dump_args \${1+\"\$@\"} 1>&2
  5107. fi
  5108. exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  5109. "
  5110. ;;
  5111. *)
  5112. $ECHO "\
  5113. if test -n \"\$lt_option_debug\"; then
  5114. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
  5115. func_lt_dump_args \${1+\"\$@\"} 1>&2
  5116. fi
  5117. exec \"\$progdir/\$program\" \${1+\"\$@\"}
  5118. "
  5119. ;;
  5120. esac
  5121. $ECHO "\
  5122. \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  5123. exit 1
  5124. }
  5125. # A function to encapsulate launching the target application
  5126. # Strips options in the --lt-* namespace from \$@ and
  5127. # launches target application with the remaining arguments.
  5128. func_exec_program ()
  5129. {
  5130. case \" \$* \" in
  5131. *\\ --lt-*)
  5132. for lt_wr_arg
  5133. do
  5134. case \$lt_wr_arg in
  5135. --lt-*) ;;
  5136. *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
  5137. esac
  5138. shift
  5139. done ;;
  5140. esac
  5141. func_exec_program_core \${1+\"\$@\"}
  5142. }
  5143. # Parse options
  5144. func_parse_lt_options \"\$0\" \${1+\"\$@\"}
  5145. # Find the directory that this script lives in.
  5146. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
  5147. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  5148. # Follow symbolic links until we get to the real thisdir.
  5149. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
  5150. while test -n \"\$file\"; do
  5151. destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
  5152. # If there was a directory component, then change thisdir.
  5153. if test \"x\$destdir\" != \"x\$file\"; then
  5154. case \"\$destdir\" in
  5155. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  5156. *) thisdir=\"\$thisdir/\$destdir\" ;;
  5157. esac
  5158. fi
  5159. file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
  5160. file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
  5161. done
  5162. # Usually 'no', except on cygwin/mingw when embedded into
  5163. # the cwrapper.
  5164. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
  5165. if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  5166. # special case for '.'
  5167. if test \"\$thisdir\" = \".\"; then
  5168. thisdir=\`pwd\`
  5169. fi
  5170. # remove .libs from thisdir
  5171. case \"\$thisdir\" in
  5172. *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
  5173. $objdir ) thisdir=. ;;
  5174. esac
  5175. fi
  5176. # Try to get the absolute directory name.
  5177. absdir=\`cd \"\$thisdir\" && pwd\`
  5178. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  5179. "
  5180. if test yes = "$fast_install"; then
  5181. $ECHO "\
  5182. program=lt-'$outputname'$exeext
  5183. progdir=\"\$thisdir/$objdir\"
  5184. if test ! -f \"\$progdir/\$program\" ||
  5185. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
  5186. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  5187. file=\"\$\$-\$program\"
  5188. if test ! -d \"\$progdir\"; then
  5189. $MKDIR \"\$progdir\"
  5190. else
  5191. $RM \"\$progdir/\$file\"
  5192. fi"
  5193. $ECHO "\
  5194. # relink executable if necessary
  5195. if test -n \"\$relink_command\"; then
  5196. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  5197. else
  5198. \$ECHO \"\$relink_command_output\" >&2
  5199. $RM \"\$progdir/\$file\"
  5200. exit 1
  5201. fi
  5202. fi
  5203. $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  5204. { $RM \"\$progdir/\$program\";
  5205. $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  5206. $RM \"\$progdir/\$file\"
  5207. fi"
  5208. else
  5209. $ECHO "\
  5210. program='$outputname'
  5211. progdir=\"\$thisdir/$objdir\"
  5212. "
  5213. fi
  5214. $ECHO "\
  5215. if test -f \"\$progdir/\$program\"; then"
  5216. # fixup the dll searchpath if we need to.
  5217. #
  5218. # Fix the DLL searchpath if we need to. Do this before prepending
  5219. # to shlibpath, because on Windows, both are PATH and uninstalled
  5220. # libraries must come first.
  5221. if test -n "$dllsearchpath"; then
  5222. $ECHO "\
  5223. # Add the dll search path components to the executable PATH
  5224. PATH=$dllsearchpath:\$PATH
  5225. "
  5226. fi
  5227. # Export our shlibpath_var if we have one.
  5228. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5229. $ECHO "\
  5230. # Add our own library path to $shlibpath_var
  5231. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  5232. # Some systems cannot cope with colon-terminated $shlibpath_var
  5233. # The second colon is a workaround for a bug in BeOS R4 sed
  5234. $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
  5235. export $shlibpath_var
  5236. "
  5237. fi
  5238. $ECHO "\
  5239. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5240. # Run the actual program with our arguments.
  5241. func_exec_program \${1+\"\$@\"}
  5242. fi
  5243. else
  5244. # The program doesn't exist.
  5245. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
  5246. \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  5247. \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  5248. exit 1
  5249. fi
  5250. fi\
  5251. "
  5252. }
  5253. # func_emit_cwrapperexe_src
  5254. # emit the source code for a wrapper executable on stdout
  5255. # Must ONLY be called from within func_mode_link because
  5256. # it depends on a number of variable set therein.
  5257. func_emit_cwrapperexe_src ()
  5258. {
  5259. cat <<EOF
  5260. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  5261. Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  5262. The $output program cannot be directly executed until all the libtool
  5263. libraries that it depends on are installed.
  5264. This wrapper executable should never be moved out of the build directory.
  5265. If it is, it will not operate correctly.
  5266. */
  5267. EOF
  5268. cat <<"EOF"
  5269. #ifdef _MSC_VER
  5270. # define _CRT_SECURE_NO_DEPRECATE 1
  5271. #endif
  5272. #include <stdio.h>
  5273. #include <stdlib.h>
  5274. #ifdef _MSC_VER
  5275. # include <direct.h>
  5276. # include <process.h>
  5277. # include <io.h>
  5278. #else
  5279. # include <unistd.h>
  5280. # include <stdint.h>
  5281. # ifdef __CYGWIN__
  5282. # include <io.h>
  5283. # endif
  5284. #endif
  5285. #include <malloc.h>
  5286. #include <stdarg.h>
  5287. #include <assert.h>
  5288. #include <string.h>
  5289. #include <ctype.h>
  5290. #include <errno.h>
  5291. #include <fcntl.h>
  5292. #include <sys/stat.h>
  5293. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  5294. /* declarations of non-ANSI functions */
  5295. #if defined __MINGW32__
  5296. # ifdef __STRICT_ANSI__
  5297. int _putenv (const char *);
  5298. # endif
  5299. #elif defined __CYGWIN__
  5300. # ifdef __STRICT_ANSI__
  5301. char *realpath (const char *, char *);
  5302. int putenv (char *);
  5303. int setenv (const char *, const char *, int);
  5304. # endif
  5305. /* #elif defined other_platform || defined ... */
  5306. #endif
  5307. /* portability defines, excluding path handling macros */
  5308. #if defined _MSC_VER
  5309. # define setmode _setmode
  5310. # define stat _stat
  5311. # define chmod _chmod
  5312. # define getcwd _getcwd
  5313. # define putenv _putenv
  5314. # define S_IXUSR _S_IEXEC
  5315. #elif defined __MINGW32__
  5316. # define setmode _setmode
  5317. # define stat _stat
  5318. # define chmod _chmod
  5319. # define getcwd _getcwd
  5320. # define putenv _putenv
  5321. #elif defined __CYGWIN__
  5322. # define HAVE_SETENV
  5323. # define FOPEN_WB "wb"
  5324. /* #elif defined other platforms ... */
  5325. #endif
  5326. #if defined PATH_MAX
  5327. # define LT_PATHMAX PATH_MAX
  5328. #elif defined MAXPATHLEN
  5329. # define LT_PATHMAX MAXPATHLEN
  5330. #else
  5331. # define LT_PATHMAX 1024
  5332. #endif
  5333. #ifndef S_IXOTH
  5334. # define S_IXOTH 0
  5335. #endif
  5336. #ifndef S_IXGRP
  5337. # define S_IXGRP 0
  5338. #endif
  5339. /* path handling portability macros */
  5340. #ifndef DIR_SEPARATOR
  5341. # define DIR_SEPARATOR '/'
  5342. # define PATH_SEPARATOR ':'
  5343. #endif
  5344. #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
  5345. defined __OS2__
  5346. # define HAVE_DOS_BASED_FILE_SYSTEM
  5347. # define FOPEN_WB "wb"
  5348. # ifndef DIR_SEPARATOR_2
  5349. # define DIR_SEPARATOR_2 '\\'
  5350. # endif
  5351. # ifndef PATH_SEPARATOR_2
  5352. # define PATH_SEPARATOR_2 ';'
  5353. # endif
  5354. #endif
  5355. #ifndef DIR_SEPARATOR_2
  5356. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  5357. #else /* DIR_SEPARATOR_2 */
  5358. # define IS_DIR_SEPARATOR(ch) \
  5359. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  5360. #endif /* DIR_SEPARATOR_2 */
  5361. #ifndef PATH_SEPARATOR_2
  5362. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  5363. #else /* PATH_SEPARATOR_2 */
  5364. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  5365. #endif /* PATH_SEPARATOR_2 */
  5366. #ifndef FOPEN_WB
  5367. # define FOPEN_WB "w"
  5368. #endif
  5369. #ifndef _O_BINARY
  5370. # define _O_BINARY 0
  5371. #endif
  5372. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  5373. #define XFREE(stale) do { \
  5374. if (stale) { free (stale); stale = 0; } \
  5375. } while (0)
  5376. #if defined LT_DEBUGWRAPPER
  5377. static int lt_debug = 1;
  5378. #else
  5379. static int lt_debug = 0;
  5380. #endif
  5381. const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
  5382. void *xmalloc (size_t num);
  5383. char *xstrdup (const char *string);
  5384. const char *base_name (const char *name);
  5385. char *find_executable (const char *wrapper);
  5386. char *chase_symlinks (const char *pathspec);
  5387. int make_executable (const char *path);
  5388. int check_executable (const char *path);
  5389. char *strendzap (char *str, const char *pat);
  5390. void lt_debugprintf (const char *file, int line, const char *fmt, ...);
  5391. void lt_fatal (const char *file, int line, const char *message, ...);
  5392. static const char *nonnull (const char *s);
  5393. static const char *nonempty (const char *s);
  5394. void lt_setenv (const char *name, const char *value);
  5395. char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  5396. void lt_update_exe_path (const char *name, const char *value);
  5397. void lt_update_lib_path (const char *name, const char *value);
  5398. char **prepare_spawn (char **argv);
  5399. void lt_dump_script (FILE *f);
  5400. EOF
  5401. cat <<EOF
  5402. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  5403. # define externally_visible volatile
  5404. #else
  5405. # define externally_visible __attribute__((externally_visible)) volatile
  5406. #endif
  5407. externally_visible const char * MAGIC_EXE = "$magic_exe";
  5408. const char * LIB_PATH_VARNAME = "$shlibpath_var";
  5409. EOF
  5410. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5411. func_to_host_path "$temp_rpath"
  5412. cat <<EOF
  5413. const char * LIB_PATH_VALUE = "$func_to_host_path_result";
  5414. EOF
  5415. else
  5416. cat <<"EOF"
  5417. const char * LIB_PATH_VALUE = "";
  5418. EOF
  5419. fi
  5420. if test -n "$dllsearchpath"; then
  5421. func_to_host_path "$dllsearchpath:"
  5422. cat <<EOF
  5423. const char * EXE_PATH_VARNAME = "PATH";
  5424. const char * EXE_PATH_VALUE = "$func_to_host_path_result";
  5425. EOF
  5426. else
  5427. cat <<"EOF"
  5428. const char * EXE_PATH_VARNAME = "";
  5429. const char * EXE_PATH_VALUE = "";
  5430. EOF
  5431. fi
  5432. if test yes = "$fast_install"; then
  5433. cat <<EOF
  5434. const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  5435. EOF
  5436. else
  5437. cat <<EOF
  5438. const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  5439. EOF
  5440. fi
  5441. cat <<"EOF"
  5442. #define LTWRAPPER_OPTION_PREFIX "--lt-"
  5443. static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  5444. static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  5445. static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
  5446. int
  5447. main (int argc, char *argv[])
  5448. {
  5449. char **newargz;
  5450. int newargc;
  5451. char *tmp_pathspec;
  5452. char *actual_cwrapper_path;
  5453. char *actual_cwrapper_name;
  5454. char *target_name;
  5455. char *lt_argv_zero;
  5456. int rval = 127;
  5457. int i;
  5458. program_name = (char *) xstrdup (base_name (argv[0]));
  5459. newargz = XMALLOC (char *, (size_t) argc + 1);
  5460. /* very simple arg parsing; don't want to rely on getopt
  5461. * also, copy all non cwrapper options to newargz, except
  5462. * argz[0], which is handled differently
  5463. */
  5464. newargc=0;
  5465. for (i = 1; i < argc; i++)
  5466. {
  5467. if (STREQ (argv[i], dumpscript_opt))
  5468. {
  5469. EOF
  5470. case $host in
  5471. *mingw* | *cygwin* )
  5472. # make stdout use "unix" line endings
  5473. echo " setmode(1,_O_BINARY);"
  5474. ;;
  5475. esac
  5476. cat <<"EOF"
  5477. lt_dump_script (stdout);
  5478. return 0;
  5479. }
  5480. if (STREQ (argv[i], debug_opt))
  5481. {
  5482. lt_debug = 1;
  5483. continue;
  5484. }
  5485. if (STREQ (argv[i], ltwrapper_option_prefix))
  5486. {
  5487. /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  5488. namespace, but it is not one of the ones we know about and
  5489. have already dealt with, above (inluding dump-script), then
  5490. report an error. Otherwise, targets might begin to believe
  5491. they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  5492. namespace. The first time any user complains about this, we'll
  5493. need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  5494. or a configure.ac-settable value.
  5495. */
  5496. lt_fatal (__FILE__, __LINE__,
  5497. "unrecognized %s option: '%s'",
  5498. ltwrapper_option_prefix, argv[i]);
  5499. }
  5500. /* otherwise ... */
  5501. newargz[++newargc] = xstrdup (argv[i]);
  5502. }
  5503. newargz[++newargc] = NULL;
  5504. EOF
  5505. cat <<EOF
  5506. /* The GNU banner must be the first non-error debug message */
  5507. lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
  5508. EOF
  5509. cat <<"EOF"
  5510. lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  5511. lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
  5512. tmp_pathspec = find_executable (argv[0]);
  5513. if (tmp_pathspec == NULL)
  5514. lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  5515. lt_debugprintf (__FILE__, __LINE__,
  5516. "(main) found exe (before symlink chase) at: %s\n",
  5517. tmp_pathspec);
  5518. actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  5519. lt_debugprintf (__FILE__, __LINE__,
  5520. "(main) found exe (after symlink chase) at: %s\n",
  5521. actual_cwrapper_path);
  5522. XFREE (tmp_pathspec);
  5523. actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  5524. strendzap (actual_cwrapper_path, actual_cwrapper_name);
  5525. /* wrapper name transforms */
  5526. strendzap (actual_cwrapper_name, ".exe");
  5527. tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  5528. XFREE (actual_cwrapper_name);
  5529. actual_cwrapper_name = tmp_pathspec;
  5530. tmp_pathspec = 0;
  5531. /* target_name transforms -- use actual target program name; might have lt- prefix */
  5532. target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  5533. strendzap (target_name, ".exe");
  5534. tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  5535. XFREE (target_name);
  5536. target_name = tmp_pathspec;
  5537. tmp_pathspec = 0;
  5538. lt_debugprintf (__FILE__, __LINE__,
  5539. "(main) libtool target name: %s\n",
  5540. target_name);
  5541. EOF
  5542. cat <<EOF
  5543. newargz[0] =
  5544. XMALLOC (char, (strlen (actual_cwrapper_path) +
  5545. strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  5546. strcpy (newargz[0], actual_cwrapper_path);
  5547. strcat (newargz[0], "$objdir");
  5548. strcat (newargz[0], "/");
  5549. EOF
  5550. cat <<"EOF"
  5551. /* stop here, and copy so we don't have to do this twice */
  5552. tmp_pathspec = xstrdup (newargz[0]);
  5553. /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  5554. strcat (newargz[0], actual_cwrapper_name);
  5555. /* DO want the lt- prefix here if it exists, so use target_name */
  5556. lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  5557. XFREE (tmp_pathspec);
  5558. tmp_pathspec = NULL;
  5559. EOF
  5560. case $host_os in
  5561. mingw*)
  5562. cat <<"EOF"
  5563. {
  5564. char* p;
  5565. while ((p = strchr (newargz[0], '\\')) != NULL)
  5566. {
  5567. *p = '/';
  5568. }
  5569. while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  5570. {
  5571. *p = '/';
  5572. }
  5573. }
  5574. EOF
  5575. ;;
  5576. esac
  5577. cat <<"EOF"
  5578. XFREE (target_name);
  5579. XFREE (actual_cwrapper_path);
  5580. XFREE (actual_cwrapper_name);
  5581. lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  5582. lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  5583. /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
  5584. be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
  5585. because on Windows, both *_VARNAMEs are PATH but uninstalled
  5586. libraries must come first. */
  5587. lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  5588. lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  5589. lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
  5590. nonnull (lt_argv_zero));
  5591. for (i = 0; i < newargc; i++)
  5592. {
  5593. lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
  5594. i, nonnull (newargz[i]));
  5595. }
  5596. EOF
  5597. case $host_os in
  5598. mingw*)
  5599. cat <<"EOF"
  5600. /* execv doesn't actually work on mingw as expected on unix */
  5601. newargz = prepare_spawn (newargz);
  5602. rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  5603. if (rval == -1)
  5604. {
  5605. /* failed to start process */
  5606. lt_debugprintf (__FILE__, __LINE__,
  5607. "(main) failed to launch target \"%s\": %s\n",
  5608. lt_argv_zero, nonnull (strerror (errno)));
  5609. return 127;
  5610. }
  5611. return rval;
  5612. EOF
  5613. ;;
  5614. *)
  5615. cat <<"EOF"
  5616. execv (lt_argv_zero, newargz);
  5617. return rval; /* =127, but avoids unused variable warning */
  5618. EOF
  5619. ;;
  5620. esac
  5621. cat <<"EOF"
  5622. }
  5623. void *
  5624. xmalloc (size_t num)
  5625. {
  5626. void *p = (void *) malloc (num);
  5627. if (!p)
  5628. lt_fatal (__FILE__, __LINE__, "memory exhausted");
  5629. return p;
  5630. }
  5631. char *
  5632. xstrdup (const char *string)
  5633. {
  5634. return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  5635. string) : NULL;
  5636. }
  5637. const char *
  5638. base_name (const char *name)
  5639. {
  5640. const char *base;
  5641. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5642. /* Skip over the disk name in MSDOS pathnames. */
  5643. if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  5644. name += 2;
  5645. #endif
  5646. for (base = name; *name; name++)
  5647. if (IS_DIR_SEPARATOR (*name))
  5648. base = name + 1;
  5649. return base;
  5650. }
  5651. int
  5652. check_executable (const char *path)
  5653. {
  5654. struct stat st;
  5655. lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
  5656. nonempty (path));
  5657. if ((!path) || (!*path))
  5658. return 0;
  5659. if ((stat (path, &st) >= 0)
  5660. && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  5661. return 1;
  5662. else
  5663. return 0;
  5664. }
  5665. int
  5666. make_executable (const char *path)
  5667. {
  5668. int rval = 0;
  5669. struct stat st;
  5670. lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
  5671. nonempty (path));
  5672. if ((!path) || (!*path))
  5673. return 0;
  5674. if (stat (path, &st) >= 0)
  5675. {
  5676. rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  5677. }
  5678. return rval;
  5679. }
  5680. /* Searches for the full path of the wrapper. Returns
  5681. newly allocated full path name if found, NULL otherwise
  5682. Does not chase symlinks, even on platforms that support them.
  5683. */
  5684. char *
  5685. find_executable (const char *wrapper)
  5686. {
  5687. int has_slash = 0;
  5688. const char *p;
  5689. const char *p_next;
  5690. /* static buffer for getcwd */
  5691. char tmp[LT_PATHMAX + 1];
  5692. size_t tmp_len;
  5693. char *concat_name;
  5694. lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
  5695. nonempty (wrapper));
  5696. if ((wrapper == NULL) || (*wrapper == '\0'))
  5697. return NULL;
  5698. /* Absolute path? */
  5699. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5700. if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  5701. {
  5702. concat_name = xstrdup (wrapper);
  5703. if (check_executable (concat_name))
  5704. return concat_name;
  5705. XFREE (concat_name);
  5706. }
  5707. else
  5708. {
  5709. #endif
  5710. if (IS_DIR_SEPARATOR (wrapper[0]))
  5711. {
  5712. concat_name = xstrdup (wrapper);
  5713. if (check_executable (concat_name))
  5714. return concat_name;
  5715. XFREE (concat_name);
  5716. }
  5717. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5718. }
  5719. #endif
  5720. for (p = wrapper; *p; p++)
  5721. if (*p == '/')
  5722. {
  5723. has_slash = 1;
  5724. break;
  5725. }
  5726. if (!has_slash)
  5727. {
  5728. /* no slashes; search PATH */
  5729. const char *path = getenv ("PATH");
  5730. if (path != NULL)
  5731. {
  5732. for (p = path; *p; p = p_next)
  5733. {
  5734. const char *q;
  5735. size_t p_len;
  5736. for (q = p; *q; q++)
  5737. if (IS_PATH_SEPARATOR (*q))
  5738. break;
  5739. p_len = (size_t) (q - p);
  5740. p_next = (*q == '\0' ? q : q + 1);
  5741. if (p_len == 0)
  5742. {
  5743. /* empty path: current directory */
  5744. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5745. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5746. nonnull (strerror (errno)));
  5747. tmp_len = strlen (tmp);
  5748. concat_name =
  5749. XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5750. memcpy (concat_name, tmp, tmp_len);
  5751. concat_name[tmp_len] = '/';
  5752. strcpy (concat_name + tmp_len + 1, wrapper);
  5753. }
  5754. else
  5755. {
  5756. concat_name =
  5757. XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  5758. memcpy (concat_name, p, p_len);
  5759. concat_name[p_len] = '/';
  5760. strcpy (concat_name + p_len + 1, wrapper);
  5761. }
  5762. if (check_executable (concat_name))
  5763. return concat_name;
  5764. XFREE (concat_name);
  5765. }
  5766. }
  5767. /* not found in PATH; assume curdir */
  5768. }
  5769. /* Relative path | not found in path: prepend cwd */
  5770. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5771. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5772. nonnull (strerror (errno)));
  5773. tmp_len = strlen (tmp);
  5774. concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5775. memcpy (concat_name, tmp, tmp_len);
  5776. concat_name[tmp_len] = '/';
  5777. strcpy (concat_name + tmp_len + 1, wrapper);
  5778. if (check_executable (concat_name))
  5779. return concat_name;
  5780. XFREE (concat_name);
  5781. return NULL;
  5782. }
  5783. char *
  5784. chase_symlinks (const char *pathspec)
  5785. {
  5786. #ifndef S_ISLNK
  5787. return xstrdup (pathspec);
  5788. #else
  5789. char buf[LT_PATHMAX];
  5790. struct stat s;
  5791. char *tmp_pathspec = xstrdup (pathspec);
  5792. char *p;
  5793. int has_symlinks = 0;
  5794. while (strlen (tmp_pathspec) && !has_symlinks)
  5795. {
  5796. lt_debugprintf (__FILE__, __LINE__,
  5797. "checking path component for symlinks: %s\n",
  5798. tmp_pathspec);
  5799. if (lstat (tmp_pathspec, &s) == 0)
  5800. {
  5801. if (S_ISLNK (s.st_mode) != 0)
  5802. {
  5803. has_symlinks = 1;
  5804. break;
  5805. }
  5806. /* search backwards for last DIR_SEPARATOR */
  5807. p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  5808. while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5809. p--;
  5810. if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5811. {
  5812. /* no more DIR_SEPARATORS left */
  5813. break;
  5814. }
  5815. *p = '\0';
  5816. }
  5817. else
  5818. {
  5819. lt_fatal (__FILE__, __LINE__,
  5820. "error accessing file \"%s\": %s",
  5821. tmp_pathspec, nonnull (strerror (errno)));
  5822. }
  5823. }
  5824. XFREE (tmp_pathspec);
  5825. if (!has_symlinks)
  5826. {
  5827. return xstrdup (pathspec);
  5828. }
  5829. tmp_pathspec = realpath (pathspec, buf);
  5830. if (tmp_pathspec == 0)
  5831. {
  5832. lt_fatal (__FILE__, __LINE__,
  5833. "could not follow symlinks for %s", pathspec);
  5834. }
  5835. return xstrdup (tmp_pathspec);
  5836. #endif
  5837. }
  5838. char *
  5839. strendzap (char *str, const char *pat)
  5840. {
  5841. size_t len, patlen;
  5842. assert (str != NULL);
  5843. assert (pat != NULL);
  5844. len = strlen (str);
  5845. patlen = strlen (pat);
  5846. if (patlen <= len)
  5847. {
  5848. str += len - patlen;
  5849. if (STREQ (str, pat))
  5850. *str = '\0';
  5851. }
  5852. return str;
  5853. }
  5854. void
  5855. lt_debugprintf (const char *file, int line, const char *fmt, ...)
  5856. {
  5857. va_list args;
  5858. if (lt_debug)
  5859. {
  5860. (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
  5861. va_start (args, fmt);
  5862. (void) vfprintf (stderr, fmt, args);
  5863. va_end (args);
  5864. }
  5865. }
  5866. static void
  5867. lt_error_core (int exit_status, const char *file,
  5868. int line, const char *mode,
  5869. const char *message, va_list ap)
  5870. {
  5871. fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
  5872. vfprintf (stderr, message, ap);
  5873. fprintf (stderr, ".\n");
  5874. if (exit_status >= 0)
  5875. exit (exit_status);
  5876. }
  5877. void
  5878. lt_fatal (const char *file, int line, const char *message, ...)
  5879. {
  5880. va_list ap;
  5881. va_start (ap, message);
  5882. lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
  5883. va_end (ap);
  5884. }
  5885. static const char *
  5886. nonnull (const char *s)
  5887. {
  5888. return s ? s : "(null)";
  5889. }
  5890. static const char *
  5891. nonempty (const char *s)
  5892. {
  5893. return (s && !*s) ? "(empty)" : nonnull (s);
  5894. }
  5895. void
  5896. lt_setenv (const char *name, const char *value)
  5897. {
  5898. lt_debugprintf (__FILE__, __LINE__,
  5899. "(lt_setenv) setting '%s' to '%s'\n",
  5900. nonnull (name), nonnull (value));
  5901. {
  5902. #ifdef HAVE_SETENV
  5903. /* always make a copy, for consistency with !HAVE_SETENV */
  5904. char *str = xstrdup (value);
  5905. setenv (name, str, 1);
  5906. #else
  5907. size_t len = strlen (name) + 1 + strlen (value) + 1;
  5908. char *str = XMALLOC (char, len);
  5909. sprintf (str, "%s=%s", name, value);
  5910. if (putenv (str) != EXIT_SUCCESS)
  5911. {
  5912. XFREE (str);
  5913. }
  5914. #endif
  5915. }
  5916. }
  5917. char *
  5918. lt_extend_str (const char *orig_value, const char *add, int to_end)
  5919. {
  5920. char *new_value;
  5921. if (orig_value && *orig_value)
  5922. {
  5923. size_t orig_value_len = strlen (orig_value);
  5924. size_t add_len = strlen (add);
  5925. new_value = XMALLOC (char, add_len + orig_value_len + 1);
  5926. if (to_end)
  5927. {
  5928. strcpy (new_value, orig_value);
  5929. strcpy (new_value + orig_value_len, add);
  5930. }
  5931. else
  5932. {
  5933. strcpy (new_value, add);
  5934. strcpy (new_value + add_len, orig_value);
  5935. }
  5936. }
  5937. else
  5938. {
  5939. new_value = xstrdup (add);
  5940. }
  5941. return new_value;
  5942. }
  5943. void
  5944. lt_update_exe_path (const char *name, const char *value)
  5945. {
  5946. lt_debugprintf (__FILE__, __LINE__,
  5947. "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  5948. nonnull (name), nonnull (value));
  5949. if (name && *name && value && *value)
  5950. {
  5951. char *new_value = lt_extend_str (getenv (name), value, 0);
  5952. /* some systems can't cope with a ':'-terminated path #' */
  5953. size_t len = strlen (new_value);
  5954. while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  5955. {
  5956. new_value[--len] = '\0';
  5957. }
  5958. lt_setenv (name, new_value);
  5959. XFREE (new_value);
  5960. }
  5961. }
  5962. void
  5963. lt_update_lib_path (const char *name, const char *value)
  5964. {
  5965. lt_debugprintf (__FILE__, __LINE__,
  5966. "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  5967. nonnull (name), nonnull (value));
  5968. if (name && *name && value && *value)
  5969. {
  5970. char *new_value = lt_extend_str (getenv (name), value, 0);
  5971. lt_setenv (name, new_value);
  5972. XFREE (new_value);
  5973. }
  5974. }
  5975. EOF
  5976. case $host_os in
  5977. mingw*)
  5978. cat <<"EOF"
  5979. /* Prepares an argument vector before calling spawn().
  5980. Note that spawn() does not by itself call the command interpreter
  5981. (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
  5982. ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  5983. GetVersionEx(&v);
  5984. v.dwPlatformId == VER_PLATFORM_WIN32_NT;
  5985. }) ? "cmd.exe" : "command.com").
  5986. Instead it simply concatenates the arguments, separated by ' ', and calls
  5987. CreateProcess(). We must quote the arguments since Win32 CreateProcess()
  5988. interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
  5989. special way:
  5990. - Space and tab are interpreted as delimiters. They are not treated as
  5991. delimiters if they are surrounded by double quotes: "...".
  5992. - Unescaped double quotes are removed from the input. Their only effect is
  5993. that within double quotes, space and tab are treated like normal
  5994. characters.
  5995. - Backslashes not followed by double quotes are not special.
  5996. - But 2*n+1 backslashes followed by a double quote become
  5997. n backslashes followed by a double quote (n >= 0):
  5998. \" -> "
  5999. \\\" -> \"
  6000. \\\\\" -> \\"
  6001. */
  6002. #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"
  6003. #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"
  6004. char **
  6005. prepare_spawn (char **argv)
  6006. {
  6007. size_t argc;
  6008. char **new_argv;
  6009. size_t i;
  6010. /* Count number of arguments. */
  6011. for (argc = 0; argv[argc] != NULL; argc++)
  6012. ;
  6013. /* Allocate new argument vector. */
  6014. new_argv = XMALLOC (char *, argc + 1);
  6015. /* Put quoted arguments into the new argument vector. */
  6016. for (i = 0; i < argc; i++)
  6017. {
  6018. const char *string = argv[i];
  6019. if (string[0] == '\0')
  6020. new_argv[i] = xstrdup ("\"\"");
  6021. else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
  6022. {
  6023. int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
  6024. size_t length;
  6025. unsigned int backslashes;
  6026. const char *s;
  6027. char *quoted_string;
  6028. char *p;
  6029. length = 0;
  6030. backslashes = 0;
  6031. if (quote_around)
  6032. length++;
  6033. for (s = string; *s != '\0'; s++)
  6034. {
  6035. char c = *s;
  6036. if (c == '"')
  6037. length += backslashes + 1;
  6038. length++;
  6039. if (c == '\\')
  6040. backslashes++;
  6041. else
  6042. backslashes = 0;
  6043. }
  6044. if (quote_around)
  6045. length += backslashes + 1;
  6046. quoted_string = XMALLOC (char, length + 1);
  6047. p = quoted_string;
  6048. backslashes = 0;
  6049. if (quote_around)
  6050. *p++ = '"';
  6051. for (s = string; *s != '\0'; s++)
  6052. {
  6053. char c = *s;
  6054. if (c == '"')
  6055. {
  6056. unsigned int j;
  6057. for (j = backslashes + 1; j > 0; j--)
  6058. *p++ = '\\';
  6059. }
  6060. *p++ = c;
  6061. if (c == '\\')
  6062. backslashes++;
  6063. else
  6064. backslashes = 0;
  6065. }
  6066. if (quote_around)
  6067. {
  6068. unsigned int j;
  6069. for (j = backslashes; j > 0; j--)
  6070. *p++ = '\\';
  6071. *p++ = '"';
  6072. }
  6073. *p = '\0';
  6074. new_argv[i] = quoted_string;
  6075. }
  6076. else
  6077. new_argv[i] = (char *) string;
  6078. }
  6079. new_argv[argc] = NULL;
  6080. return new_argv;
  6081. }
  6082. EOF
  6083. ;;
  6084. esac
  6085. cat <<"EOF"
  6086. void lt_dump_script (FILE* f)
  6087. {
  6088. EOF
  6089. func_emit_wrapper yes |
  6090. $SED -n -e '
  6091. s/^\(.\{79\}\)\(..*\)/\1\
  6092. \2/
  6093. h
  6094. s/\([\\"]\)/\\\1/g
  6095. s/$/\\n/
  6096. s/\([^\n]*\).*/ fputs ("\1", f);/p
  6097. g
  6098. D'
  6099. cat <<"EOF"
  6100. }
  6101. EOF
  6102. }
  6103. # end: func_emit_cwrapperexe_src
  6104. # func_win32_import_lib_p ARG
  6105. # True if ARG is an import lib, as indicated by $file_magic_cmd
  6106. func_win32_import_lib_p ()
  6107. {
  6108. $debug_cmd
  6109. case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
  6110. *import*) : ;;
  6111. *) false ;;
  6112. esac
  6113. }
  6114. # func_suncc_cstd_abi
  6115. # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
  6116. # Several compiler flags select an ABI that is incompatible with the
  6117. # Cstd library. Avoid specifying it if any are in CXXFLAGS.
  6118. func_suncc_cstd_abi ()
  6119. {
  6120. $debug_cmd
  6121. case " $compile_command " in
  6122. *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
  6123. suncc_use_cstd_abi=no
  6124. ;;
  6125. *)
  6126. suncc_use_cstd_abi=yes
  6127. ;;
  6128. esac
  6129. }
  6130. # func_mode_link arg...
  6131. func_mode_link ()
  6132. {
  6133. $debug_cmd
  6134. case $host in
  6135. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6136. # It is impossible to link a dll without this setting, and
  6137. # we shouldn't force the makefile maintainer to figure out
  6138. # what system we are compiling for in order to pass an extra
  6139. # flag for every libtool invocation.
  6140. # allow_undefined=no
  6141. # FIXME: Unfortunately, there are problems with the above when trying
  6142. # to make a dll that has undefined symbols, in which case not
  6143. # even a static library is built. For now, we need to specify
  6144. # -no-undefined on the libtool link line when we can be certain
  6145. # that all symbols are satisfied, otherwise we get a static library.
  6146. allow_undefined=yes
  6147. ;;
  6148. *-*-linux*)
  6149. if test "$link_all_deplibs" = unknown; then
  6150. link_all_deplibs=no
  6151. fi
  6152. ;;
  6153. *)
  6154. allow_undefined=yes
  6155. ;;
  6156. esac
  6157. libtool_args=$nonopt
  6158. base_compile="$nonopt $@"
  6159. compile_command=$nonopt
  6160. finalize_command=$nonopt
  6161. compile_rpath=
  6162. finalize_rpath=
  6163. compile_shlibpath=
  6164. finalize_shlibpath=
  6165. convenience=
  6166. old_convenience=
  6167. deplibs=
  6168. old_deplibs=
  6169. compiler_flags=
  6170. linker_flags=
  6171. dllsearchpath=
  6172. lib_search_path=`pwd`
  6173. inst_prefix_dir=
  6174. new_inherited_linker_flags=
  6175. avoid_version=no
  6176. bindir=
  6177. dlfiles=
  6178. dlprefiles=
  6179. dlself=no
  6180. export_dynamic=no
  6181. export_symbols=
  6182. export_symbols_regex=
  6183. generated=
  6184. libobjs=
  6185. ltlibs=
  6186. module=no
  6187. no_install=no
  6188. objs=
  6189. os2dllname=
  6190. non_pic_objects=
  6191. precious_files_regex=
  6192. prefer_static_libs=no
  6193. preload=false
  6194. prev=
  6195. prevarg=
  6196. release=
  6197. rpath=
  6198. xrpath=
  6199. perm_rpath=
  6200. temp_rpath=
  6201. thread_safe=no
  6202. vinfo=
  6203. vinfo_number=no
  6204. weak_libs=
  6205. single_module=$wl-single_module
  6206. func_infer_tag $base_compile
  6207. # We need to know -static, to get the right output filenames.
  6208. for arg
  6209. do
  6210. case $arg in
  6211. -shared)
  6212. test yes != "$build_libtool_libs" \
  6213. && func_fatal_configuration "cannot build a shared library"
  6214. build_old_libs=no
  6215. break
  6216. ;;
  6217. -all-static | -static | -static-libtool-libs)
  6218. case $arg in
  6219. -all-static)
  6220. if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  6221. func_warning "complete static linking is impossible in this configuration"
  6222. fi
  6223. if test -n "$link_static_flag"; then
  6224. dlopen_self=$dlopen_self_static
  6225. fi
  6226. prefer_static_libs=yes
  6227. ;;
  6228. -static)
  6229. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6230. dlopen_self=$dlopen_self_static
  6231. fi
  6232. prefer_static_libs=built
  6233. ;;
  6234. -static-libtool-libs)
  6235. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6236. dlopen_self=$dlopen_self_static
  6237. fi
  6238. prefer_static_libs=yes
  6239. ;;
  6240. esac
  6241. build_libtool_libs=no
  6242. build_old_libs=yes
  6243. break
  6244. ;;
  6245. esac
  6246. done
  6247. # See if our shared archives depend on static archives.
  6248. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  6249. # Go through the arguments, transforming them on the way.
  6250. while test "$#" -gt 0; do
  6251. arg=$1
  6252. shift
  6253. func_quote_arg pretty,unquoted "$arg"
  6254. qarg=$func_quote_arg_unquoted_result
  6255. func_append libtool_args " $func_quote_arg_result"
  6256. # If the previous option needs an argument, assign it.
  6257. if test -n "$prev"; then
  6258. case $prev in
  6259. output)
  6260. func_append compile_command " @OUTPUT@"
  6261. func_append finalize_command " @OUTPUT@"
  6262. ;;
  6263. esac
  6264. case $prev in
  6265. bindir)
  6266. bindir=$arg
  6267. prev=
  6268. continue
  6269. ;;
  6270. dlfiles|dlprefiles)
  6271. $preload || {
  6272. # Add the symbol object into the linking commands.
  6273. func_append compile_command " @SYMFILE@"
  6274. func_append finalize_command " @SYMFILE@"
  6275. preload=:
  6276. }
  6277. case $arg in
  6278. *.la | *.lo) ;; # We handle these cases below.
  6279. force)
  6280. if test no = "$dlself"; then
  6281. dlself=needless
  6282. export_dynamic=yes
  6283. fi
  6284. prev=
  6285. continue
  6286. ;;
  6287. self)
  6288. if test dlprefiles = "$prev"; then
  6289. dlself=yes
  6290. elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
  6291. dlself=yes
  6292. else
  6293. dlself=needless
  6294. export_dynamic=yes
  6295. fi
  6296. prev=
  6297. continue
  6298. ;;
  6299. *)
  6300. if test dlfiles = "$prev"; then
  6301. func_append dlfiles " $arg"
  6302. else
  6303. func_append dlprefiles " $arg"
  6304. fi
  6305. prev=
  6306. continue
  6307. ;;
  6308. esac
  6309. ;;
  6310. expsyms)
  6311. export_symbols=$arg
  6312. test -f "$arg" \
  6313. || func_fatal_error "symbol file '$arg' does not exist"
  6314. prev=
  6315. continue
  6316. ;;
  6317. expsyms_regex)
  6318. export_symbols_regex=$arg
  6319. prev=
  6320. continue
  6321. ;;
  6322. framework)
  6323. case $host in
  6324. *-*-darwin*)
  6325. case "$deplibs " in
  6326. *" $qarg.ltframework "*) ;;
  6327. *) func_append deplibs " $qarg.ltframework" # this is fixed later
  6328. ;;
  6329. esac
  6330. ;;
  6331. esac
  6332. prev=
  6333. continue
  6334. ;;
  6335. inst_prefix)
  6336. inst_prefix_dir=$arg
  6337. prev=
  6338. continue
  6339. ;;
  6340. mllvm)
  6341. # Clang does not use LLVM to link, so we can simply discard any
  6342. # '-mllvm $arg' options when doing the link step.
  6343. prev=
  6344. continue
  6345. ;;
  6346. objectlist)
  6347. if test -f "$arg"; then
  6348. save_arg=$arg
  6349. moreargs=
  6350. for fil in `cat "$save_arg"`
  6351. do
  6352. # func_append moreargs " $fil"
  6353. arg=$fil
  6354. # A libtool-controlled object.
  6355. # Check to see that this really is a libtool object.
  6356. if func_lalib_unsafe_p "$arg"; then
  6357. pic_object=
  6358. non_pic_object=
  6359. # Read the .lo file
  6360. func_source "$arg"
  6361. if test -z "$pic_object" ||
  6362. test -z "$non_pic_object" ||
  6363. test none = "$pic_object" &&
  6364. test none = "$non_pic_object"; then
  6365. func_fatal_error "cannot find name of object for '$arg'"
  6366. fi
  6367. # Extract subdirectory from the argument.
  6368. func_dirname "$arg" "/" ""
  6369. xdir=$func_dirname_result
  6370. if test none != "$pic_object"; then
  6371. # Prepend the subdirectory the object is found in.
  6372. pic_object=$xdir$pic_object
  6373. if test dlfiles = "$prev"; then
  6374. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6375. func_append dlfiles " $pic_object"
  6376. prev=
  6377. continue
  6378. else
  6379. # If libtool objects are unsupported, then we need to preload.
  6380. prev=dlprefiles
  6381. fi
  6382. fi
  6383. # CHECK ME: I think I busted this. -Ossama
  6384. if test dlprefiles = "$prev"; then
  6385. # Preload the old-style object.
  6386. func_append dlprefiles " $pic_object"
  6387. prev=
  6388. fi
  6389. # A PIC object.
  6390. func_append libobjs " $pic_object"
  6391. arg=$pic_object
  6392. fi
  6393. # Non-PIC object.
  6394. if test none != "$non_pic_object"; then
  6395. # Prepend the subdirectory the object is found in.
  6396. non_pic_object=$xdir$non_pic_object
  6397. # A standard non-PIC object
  6398. func_append non_pic_objects " $non_pic_object"
  6399. if test -z "$pic_object" || test none = "$pic_object"; then
  6400. arg=$non_pic_object
  6401. fi
  6402. else
  6403. # If the PIC object exists, use it instead.
  6404. # $xdir was prepended to $pic_object above.
  6405. non_pic_object=$pic_object
  6406. func_append non_pic_objects " $non_pic_object"
  6407. fi
  6408. else
  6409. # Only an error if not doing a dry-run.
  6410. if $opt_dry_run; then
  6411. # Extract subdirectory from the argument.
  6412. func_dirname "$arg" "/" ""
  6413. xdir=$func_dirname_result
  6414. func_lo2o "$arg"
  6415. pic_object=$xdir$objdir/$func_lo2o_result
  6416. non_pic_object=$xdir$func_lo2o_result
  6417. func_append libobjs " $pic_object"
  6418. func_append non_pic_objects " $non_pic_object"
  6419. else
  6420. func_fatal_error "'$arg' is not a valid libtool object"
  6421. fi
  6422. fi
  6423. done
  6424. else
  6425. func_fatal_error "link input file '$arg' does not exist"
  6426. fi
  6427. arg=$save_arg
  6428. prev=
  6429. continue
  6430. ;;
  6431. os2dllname)
  6432. os2dllname=$arg
  6433. prev=
  6434. continue
  6435. ;;
  6436. precious_regex)
  6437. precious_files_regex=$arg
  6438. prev=
  6439. continue
  6440. ;;
  6441. release)
  6442. release=-$arg
  6443. prev=
  6444. continue
  6445. ;;
  6446. rpath | xrpath)
  6447. # We need an absolute path.
  6448. case $arg in
  6449. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6450. *)
  6451. func_fatal_error "only absolute run-paths are allowed"
  6452. ;;
  6453. esac
  6454. func_normal_abspath "$arg"
  6455. arg="$func_normal_abspath_result"
  6456. if test rpath = "$prev"; then
  6457. case "$rpath " in
  6458. *" $arg "*) ;;
  6459. *) func_append rpath " $arg" ;;
  6460. esac
  6461. else
  6462. case "$xrpath " in
  6463. *" $arg "*) ;;
  6464. *) func_append xrpath " $arg" ;;
  6465. esac
  6466. fi
  6467. prev=
  6468. continue
  6469. ;;
  6470. shrext)
  6471. shrext_cmds=$arg
  6472. prev=
  6473. continue
  6474. ;;
  6475. weak)
  6476. func_append weak_libs " $arg"
  6477. prev=
  6478. continue
  6479. ;;
  6480. xcclinker)
  6481. func_append linker_flags " $qarg"
  6482. func_append compiler_flags " $qarg"
  6483. prev=
  6484. func_append compile_command " $qarg"
  6485. func_append finalize_command " $qarg"
  6486. continue
  6487. ;;
  6488. xcompiler)
  6489. func_append compiler_flags " $qarg"
  6490. prev=
  6491. func_append compile_command " $qarg"
  6492. func_append finalize_command " $qarg"
  6493. continue
  6494. ;;
  6495. xlinker)
  6496. func_append linker_flags " $qarg"
  6497. func_append compiler_flags " $wl$qarg"
  6498. prev=
  6499. func_append compile_command " $wl$qarg"
  6500. func_append finalize_command " $wl$qarg"
  6501. continue
  6502. ;;
  6503. *)
  6504. eval "$prev=\"\$arg\""
  6505. prev=
  6506. continue
  6507. ;;
  6508. esac
  6509. fi # test -n "$prev"
  6510. prevarg=$arg
  6511. case $arg in
  6512. -all-static)
  6513. if test -n "$link_static_flag"; then
  6514. # See comment for -static flag below, for more details.
  6515. func_append compile_command " $link_static_flag"
  6516. func_append finalize_command " $link_static_flag"
  6517. fi
  6518. continue
  6519. ;;
  6520. -allow-undefined)
  6521. # FIXME: remove this flag sometime in the future.
  6522. func_fatal_error "'-allow-undefined' must not be used because it is the default"
  6523. ;;
  6524. -avoid-version)
  6525. avoid_version=yes
  6526. continue
  6527. ;;
  6528. -bindir)
  6529. prev=bindir
  6530. continue
  6531. ;;
  6532. -dlopen)
  6533. prev=dlfiles
  6534. continue
  6535. ;;
  6536. -dlpreopen)
  6537. prev=dlprefiles
  6538. continue
  6539. ;;
  6540. -export-dynamic)
  6541. export_dynamic=yes
  6542. continue
  6543. ;;
  6544. -export-symbols | -export-symbols-regex)
  6545. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  6546. func_fatal_error "more than one -exported-symbols argument is not allowed"
  6547. fi
  6548. if test X-export-symbols = "X$arg"; then
  6549. prev=expsyms
  6550. else
  6551. prev=expsyms_regex
  6552. fi
  6553. continue
  6554. ;;
  6555. -framework)
  6556. prev=framework
  6557. continue
  6558. ;;
  6559. -inst-prefix-dir)
  6560. prev=inst_prefix
  6561. continue
  6562. ;;
  6563. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  6564. # so, if we see these flags be careful not to treat them like -L
  6565. -L[A-Z][A-Z]*:*)
  6566. case $with_gcc/$host in
  6567. no/*-*-irix* | /*-*-irix*)
  6568. func_append compile_command " $arg"
  6569. func_append finalize_command " $arg"
  6570. ;;
  6571. esac
  6572. continue
  6573. ;;
  6574. -L*)
  6575. func_stripname "-L" '' "$arg"
  6576. if test -z "$func_stripname_result"; then
  6577. if test "$#" -gt 0; then
  6578. func_fatal_error "require no space between '-L' and '$1'"
  6579. else
  6580. func_fatal_error "need path for '-L' option"
  6581. fi
  6582. fi
  6583. func_resolve_sysroot "$func_stripname_result"
  6584. dir=$func_resolve_sysroot_result
  6585. # We need an absolute path.
  6586. case $dir in
  6587. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6588. *)
  6589. absdir=`cd "$dir" && pwd`
  6590. test -z "$absdir" && \
  6591. func_fatal_error "cannot determine absolute directory name of '$dir'"
  6592. dir=$absdir
  6593. ;;
  6594. esac
  6595. case "$deplibs " in
  6596. *" -L$dir "* | *" $arg "*)
  6597. # Will only happen for absolute or sysroot arguments
  6598. ;;
  6599. *)
  6600. # Preserve sysroot, but never include relative directories
  6601. case $dir in
  6602. [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
  6603. *) func_append deplibs " -L$dir" ;;
  6604. esac
  6605. func_append lib_search_path " $dir"
  6606. ;;
  6607. esac
  6608. case $host in
  6609. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6610. testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
  6611. case :$dllsearchpath: in
  6612. *":$dir:"*) ;;
  6613. ::) dllsearchpath=$dir;;
  6614. *) func_append dllsearchpath ":$dir";;
  6615. esac
  6616. case :$dllsearchpath: in
  6617. *":$testbindir:"*) ;;
  6618. ::) dllsearchpath=$testbindir;;
  6619. *) func_append dllsearchpath ":$testbindir";;
  6620. esac
  6621. ;;
  6622. esac
  6623. continue
  6624. ;;
  6625. -l*)
  6626. if test X-lc = "X$arg" || test X-lm = "X$arg"; then
  6627. case $host in
  6628. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
  6629. # These systems don't actually have a C or math library (as such)
  6630. continue
  6631. ;;
  6632. *-*-os2*)
  6633. # These systems don't actually have a C library (as such)
  6634. test X-lc = "X$arg" && continue
  6635. ;;
  6636. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6637. # Do not include libc due to us having libc/libc_r.
  6638. test X-lc = "X$arg" && continue
  6639. ;;
  6640. *-*-rhapsody* | *-*-darwin1.[012])
  6641. # Rhapsody C and math libraries are in the System framework
  6642. func_append deplibs " System.ltframework"
  6643. continue
  6644. ;;
  6645. *-*-sco3.2v5* | *-*-sco5v6*)
  6646. # Causes problems with __ctype
  6647. test X-lc = "X$arg" && continue
  6648. ;;
  6649. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  6650. # Compiler inserts libc in the correct place for threads to work
  6651. test X-lc = "X$arg" && continue
  6652. ;;
  6653. esac
  6654. elif test X-lc_r = "X$arg"; then
  6655. case $host in
  6656. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6657. # Do not include libc_r directly, use -pthread flag.
  6658. continue
  6659. ;;
  6660. esac
  6661. fi
  6662. func_append deplibs " $arg"
  6663. continue
  6664. ;;
  6665. -mllvm)
  6666. prev=mllvm
  6667. continue
  6668. ;;
  6669. -module)
  6670. module=yes
  6671. continue
  6672. ;;
  6673. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  6674. # classes, name mangling, and exception handling.
  6675. # Darwin uses the -arch flag to determine output architecture.
  6676. -model|-arch|-isysroot|--sysroot)
  6677. func_append compiler_flags " $arg"
  6678. func_append compile_command " $arg"
  6679. func_append finalize_command " $arg"
  6680. prev=xcompiler
  6681. continue
  6682. ;;
  6683. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  6684. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  6685. func_append compiler_flags " $arg"
  6686. func_append compile_command " $arg"
  6687. func_append finalize_command " $arg"
  6688. case "$new_inherited_linker_flags " in
  6689. *" $arg "*) ;;
  6690. * ) func_append new_inherited_linker_flags " $arg" ;;
  6691. esac
  6692. continue
  6693. ;;
  6694. -multi_module)
  6695. single_module=$wl-multi_module
  6696. continue
  6697. ;;
  6698. -no-fast-install)
  6699. fast_install=no
  6700. continue
  6701. ;;
  6702. -no-install)
  6703. case $host in
  6704. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  6705. # The PATH hackery in wrapper scripts is required on Windows
  6706. # and Darwin in order for the loader to find any dlls it needs.
  6707. func_warning "'-no-install' is ignored for $host"
  6708. func_warning "assuming '-no-fast-install' instead"
  6709. fast_install=no
  6710. ;;
  6711. *) no_install=yes ;;
  6712. esac
  6713. continue
  6714. ;;
  6715. -no-undefined)
  6716. allow_undefined=no
  6717. continue
  6718. ;;
  6719. -objectlist)
  6720. prev=objectlist
  6721. continue
  6722. ;;
  6723. -os2dllname)
  6724. prev=os2dllname
  6725. continue
  6726. ;;
  6727. -o) prev=output ;;
  6728. -precious-files-regex)
  6729. prev=precious_regex
  6730. continue
  6731. ;;
  6732. -release)
  6733. prev=release
  6734. continue
  6735. ;;
  6736. -rpath)
  6737. prev=rpath
  6738. continue
  6739. ;;
  6740. -R)
  6741. prev=xrpath
  6742. continue
  6743. ;;
  6744. -R*)
  6745. func_stripname '-R' '' "$arg"
  6746. dir=$func_stripname_result
  6747. # We need an absolute path.
  6748. case $dir in
  6749. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6750. =*)
  6751. func_stripname '=' '' "$dir"
  6752. dir=$lt_sysroot$func_stripname_result
  6753. ;;
  6754. *)
  6755. func_fatal_error "only absolute run-paths are allowed"
  6756. ;;
  6757. esac
  6758. case "$xrpath " in
  6759. *" $dir "*) ;;
  6760. *) func_append xrpath " $dir" ;;
  6761. esac
  6762. continue
  6763. ;;
  6764. -shared)
  6765. # The effects of -shared are defined in a previous loop.
  6766. continue
  6767. ;;
  6768. -shrext)
  6769. prev=shrext
  6770. continue
  6771. ;;
  6772. -static | -static-libtool-libs)
  6773. # The effects of -static are defined in a previous loop.
  6774. # We used to do the same as -all-static on platforms that
  6775. # didn't have a PIC flag, but the assumption that the effects
  6776. # would be equivalent was wrong. It would break on at least
  6777. # Digital Unix and AIX.
  6778. continue
  6779. ;;
  6780. -thread-safe)
  6781. thread_safe=yes
  6782. continue
  6783. ;;
  6784. -version-info)
  6785. prev=vinfo
  6786. continue
  6787. ;;
  6788. -version-number)
  6789. prev=vinfo
  6790. vinfo_number=yes
  6791. continue
  6792. ;;
  6793. -weak)
  6794. prev=weak
  6795. continue
  6796. ;;
  6797. -Wc,*)
  6798. func_stripname '-Wc,' '' "$arg"
  6799. args=$func_stripname_result
  6800. arg=
  6801. save_ifs=$IFS; IFS=,
  6802. for flag in $args; do
  6803. IFS=$save_ifs
  6804. func_quote_arg pretty "$flag"
  6805. func_append arg " $func_quote_arg_result"
  6806. func_append compiler_flags " $func_quote_arg_result"
  6807. done
  6808. IFS=$save_ifs
  6809. func_stripname ' ' '' "$arg"
  6810. arg=$func_stripname_result
  6811. ;;
  6812. -Wl,*)
  6813. func_stripname '-Wl,' '' "$arg"
  6814. args=$func_stripname_result
  6815. arg=
  6816. save_ifs=$IFS; IFS=,
  6817. for flag in $args; do
  6818. IFS=$save_ifs
  6819. func_quote_arg pretty "$flag"
  6820. func_append arg " $wl$func_quote_arg_result"
  6821. func_append compiler_flags " $wl$func_quote_arg_result"
  6822. func_append linker_flags " $func_quote_arg_result"
  6823. done
  6824. IFS=$save_ifs
  6825. func_stripname ' ' '' "$arg"
  6826. arg=$func_stripname_result
  6827. ;;
  6828. -Xcompiler)
  6829. prev=xcompiler
  6830. continue
  6831. ;;
  6832. -Xlinker)
  6833. prev=xlinker
  6834. continue
  6835. ;;
  6836. -XCClinker)
  6837. prev=xcclinker
  6838. continue
  6839. ;;
  6840. # -msg_* for osf cc
  6841. -msg_*)
  6842. func_quote_arg pretty "$arg"
  6843. arg=$func_quote_arg_result
  6844. ;;
  6845. # Flags to be passed through unchanged, with rationale:
  6846. # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
  6847. # -r[0-9][0-9]* specify processor for the SGI compiler
  6848. # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  6849. # +DA*, +DD* enable 64-bit mode for the HP compiler
  6850. # -q* compiler args for the IBM compiler
  6851. # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  6852. # -F/path path to uninstalled frameworks, gcc on darwin
  6853. # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
  6854. # -fstack-protector* stack protector flags for GCC
  6855. # @file GCC response files
  6856. # -tp=* Portland pgcc target processor selection
  6857. # --sysroot=* for sysroot support
  6858. # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
  6859. # -specs=* GCC specs files
  6860. # -stdlib=* select c++ std lib with clang
  6861. # -fsanitize=* Clang/GCC memory and address sanitizer
  6862. # -fuse-ld=* Linker select flags for GCC
  6863. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  6864. -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
  6865. -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
  6866. -specs=*|-fsanitize=*|-fuse-ld=*)
  6867. func_quote_arg pretty "$arg"
  6868. arg=$func_quote_arg_result
  6869. func_append compile_command " $arg"
  6870. func_append finalize_command " $arg"
  6871. func_append compiler_flags " $arg"
  6872. continue
  6873. ;;
  6874. -Z*)
  6875. if test os2 = "`expr $host : '.*\(os2\)'`"; then
  6876. # OS/2 uses -Zxxx to specify OS/2-specific options
  6877. compiler_flags="$compiler_flags $arg"
  6878. func_append compile_command " $arg"
  6879. func_append finalize_command " $arg"
  6880. case $arg in
  6881. -Zlinker | -Zstack)
  6882. prev=xcompiler
  6883. ;;
  6884. esac
  6885. continue
  6886. else
  6887. # Otherwise treat like 'Some other compiler flag' below
  6888. func_quote_arg pretty "$arg"
  6889. arg=$func_quote_arg_result
  6890. fi
  6891. ;;
  6892. # Some other compiler flag.
  6893. -* | +*)
  6894. func_quote_arg pretty "$arg"
  6895. arg=$func_quote_arg_result
  6896. ;;
  6897. *.$objext)
  6898. # A standard object.
  6899. func_append objs " $arg"
  6900. ;;
  6901. *.lo)
  6902. # A libtool-controlled object.
  6903. # Check to see that this really is a libtool object.
  6904. if func_lalib_unsafe_p "$arg"; then
  6905. pic_object=
  6906. non_pic_object=
  6907. # Read the .lo file
  6908. func_source "$arg"
  6909. if test -z "$pic_object" ||
  6910. test -z "$non_pic_object" ||
  6911. test none = "$pic_object" &&
  6912. test none = "$non_pic_object"; then
  6913. func_fatal_error "cannot find name of object for '$arg'"
  6914. fi
  6915. # Extract subdirectory from the argument.
  6916. func_dirname "$arg" "/" ""
  6917. xdir=$func_dirname_result
  6918. test none = "$pic_object" || {
  6919. # Prepend the subdirectory the object is found in.
  6920. pic_object=$xdir$pic_object
  6921. if test dlfiles = "$prev"; then
  6922. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6923. func_append dlfiles " $pic_object"
  6924. prev=
  6925. continue
  6926. else
  6927. # If libtool objects are unsupported, then we need to preload.
  6928. prev=dlprefiles
  6929. fi
  6930. fi
  6931. # CHECK ME: I think I busted this. -Ossama
  6932. if test dlprefiles = "$prev"; then
  6933. # Preload the old-style object.
  6934. func_append dlprefiles " $pic_object"
  6935. prev=
  6936. fi
  6937. # A PIC object.
  6938. func_append libobjs " $pic_object"
  6939. arg=$pic_object
  6940. }
  6941. # Non-PIC object.
  6942. if test none != "$non_pic_object"; then
  6943. # Prepend the subdirectory the object is found in.
  6944. non_pic_object=$xdir$non_pic_object
  6945. # A standard non-PIC object
  6946. func_append non_pic_objects " $non_pic_object"
  6947. if test -z "$pic_object" || test none = "$pic_object"; then
  6948. arg=$non_pic_object
  6949. fi
  6950. else
  6951. # If the PIC object exists, use it instead.
  6952. # $xdir was prepended to $pic_object above.
  6953. non_pic_object=$pic_object
  6954. func_append non_pic_objects " $non_pic_object"
  6955. fi
  6956. else
  6957. # Only an error if not doing a dry-run.
  6958. if $opt_dry_run; then
  6959. # Extract subdirectory from the argument.
  6960. func_dirname "$arg" "/" ""
  6961. xdir=$func_dirname_result
  6962. func_lo2o "$arg"
  6963. pic_object=$xdir$objdir/$func_lo2o_result
  6964. non_pic_object=$xdir$func_lo2o_result
  6965. func_append libobjs " $pic_object"
  6966. func_append non_pic_objects " $non_pic_object"
  6967. else
  6968. func_fatal_error "'$arg' is not a valid libtool object"
  6969. fi
  6970. fi
  6971. ;;
  6972. *.$libext)
  6973. # An archive.
  6974. func_append deplibs " $arg"
  6975. func_append old_deplibs " $arg"
  6976. continue
  6977. ;;
  6978. *.la)
  6979. # A libtool-controlled library.
  6980. func_resolve_sysroot "$arg"
  6981. if test dlfiles = "$prev"; then
  6982. # This library was specified with -dlopen.
  6983. func_append dlfiles " $func_resolve_sysroot_result"
  6984. prev=
  6985. elif test dlprefiles = "$prev"; then
  6986. # The library was specified with -dlpreopen.
  6987. func_append dlprefiles " $func_resolve_sysroot_result"
  6988. prev=
  6989. else
  6990. func_append deplibs " $func_resolve_sysroot_result"
  6991. fi
  6992. continue
  6993. ;;
  6994. # Some other compiler argument.
  6995. *)
  6996. # Unknown arguments in both finalize_command and compile_command need
  6997. # to be aesthetically quoted because they are evaled later.
  6998. func_quote_arg pretty "$arg"
  6999. arg=$func_quote_arg_result
  7000. ;;
  7001. esac # arg
  7002. # Now actually substitute the argument into the commands.
  7003. if test -n "$arg"; then
  7004. func_append compile_command " $arg"
  7005. func_append finalize_command " $arg"
  7006. fi
  7007. done # argument parsing loop
  7008. test -n "$prev" && \
  7009. func_fatal_help "the '$prevarg' option requires an argument"
  7010. if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
  7011. eval arg=\"$export_dynamic_flag_spec\"
  7012. func_append compile_command " $arg"
  7013. func_append finalize_command " $arg"
  7014. fi
  7015. oldlibs=
  7016. # calculate the name of the file, without its directory
  7017. func_basename "$output"
  7018. outputname=$func_basename_result
  7019. libobjs_save=$libobjs
  7020. if test -n "$shlibpath_var"; then
  7021. # get the directories listed in $shlibpath_var
  7022. eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
  7023. else
  7024. shlib_search_path=
  7025. fi
  7026. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  7027. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  7028. # Definition is injected by LT_CONFIG during libtool generation.
  7029. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
  7030. func_dirname "$output" "/" ""
  7031. output_objdir=$func_dirname_result$objdir
  7032. func_to_tool_file "$output_objdir/"
  7033. tool_output_objdir=$func_to_tool_file_result
  7034. # Create the object directory.
  7035. func_mkdir_p "$output_objdir"
  7036. # Determine the type of output
  7037. case $output in
  7038. "")
  7039. func_fatal_help "you must specify an output file"
  7040. ;;
  7041. *.$libext) linkmode=oldlib ;;
  7042. *.lo | *.$objext) linkmode=obj ;;
  7043. *.la) linkmode=lib ;;
  7044. *) linkmode=prog ;; # Anything else should be a program.
  7045. esac
  7046. specialdeplibs=
  7047. libs=
  7048. # Find all interdependent deplibs by searching for libraries
  7049. # that are linked more than once (e.g. -la -lb -la)
  7050. for deplib in $deplibs; do
  7051. if $opt_preserve_dup_deps; then
  7052. case "$libs " in
  7053. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7054. esac
  7055. fi
  7056. func_append libs " $deplib"
  7057. done
  7058. if test lib = "$linkmode"; then
  7059. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  7060. # Compute libraries that are listed more than once in $predeps
  7061. # $postdeps and mark them as special (i.e., whose duplicates are
  7062. # not to be eliminated).
  7063. pre_post_deps=
  7064. if $opt_duplicate_compiler_generated_deps; then
  7065. for pre_post_dep in $predeps $postdeps; do
  7066. case "$pre_post_deps " in
  7067. *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
  7068. esac
  7069. func_append pre_post_deps " $pre_post_dep"
  7070. done
  7071. fi
  7072. pre_post_deps=
  7073. fi
  7074. deplibs=
  7075. newdependency_libs=
  7076. newlib_search_path=
  7077. need_relink=no # whether we're linking any uninstalled libtool libraries
  7078. notinst_deplibs= # not-installed libtool libraries
  7079. notinst_path= # paths that contain not-installed libtool libraries
  7080. case $linkmode in
  7081. lib)
  7082. passes="conv dlpreopen link"
  7083. for file in $dlfiles $dlprefiles; do
  7084. case $file in
  7085. *.la) ;;
  7086. *)
  7087. func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
  7088. ;;
  7089. esac
  7090. done
  7091. ;;
  7092. prog)
  7093. compile_deplibs=
  7094. finalize_deplibs=
  7095. alldeplibs=false
  7096. newdlfiles=
  7097. newdlprefiles=
  7098. passes="conv scan dlopen dlpreopen link"
  7099. ;;
  7100. *) passes="conv"
  7101. ;;
  7102. esac
  7103. for pass in $passes; do
  7104. # The preopen pass in lib mode reverses $deplibs; put it back here
  7105. # so that -L comes before libs that need it for instance...
  7106. if test lib,link = "$linkmode,$pass"; then
  7107. ## FIXME: Find the place where the list is rebuilt in the wrong
  7108. ## order, and fix it there properly
  7109. tmp_deplibs=
  7110. for deplib in $deplibs; do
  7111. tmp_deplibs="$deplib $tmp_deplibs"
  7112. done
  7113. deplibs=$tmp_deplibs
  7114. fi
  7115. if test lib,link = "$linkmode,$pass" ||
  7116. test prog,scan = "$linkmode,$pass"; then
  7117. libs=$deplibs
  7118. deplibs=
  7119. fi
  7120. if test prog = "$linkmode"; then
  7121. case $pass in
  7122. dlopen) libs=$dlfiles ;;
  7123. dlpreopen) libs=$dlprefiles ;;
  7124. link)
  7125. libs="$deplibs %DEPLIBS%"
  7126. test "X$link_all_deplibs" = Xno ||
  7127. func_append libs " $dependency_libs"
  7128. ;;
  7129. esac
  7130. fi
  7131. if test lib,dlpreopen = "$linkmode,$pass"; then
  7132. # Collect and forward deplibs of preopened libtool libs
  7133. for lib in $dlprefiles; do
  7134. # Ignore non-libtool-libs
  7135. dependency_libs=
  7136. func_resolve_sysroot "$lib"
  7137. case $lib in
  7138. *.la) func_source "$func_resolve_sysroot_result" ;;
  7139. esac
  7140. # Collect preopened libtool deplibs, except any this library
  7141. # has declared as weak libs
  7142. for deplib in $dependency_libs; do
  7143. func_basename "$deplib"
  7144. deplib_base=$func_basename_result
  7145. case " $weak_libs " in
  7146. *" $deplib_base "*) ;;
  7147. *) func_append deplibs " $deplib" ;;
  7148. esac
  7149. done
  7150. done
  7151. libs=$dlprefiles
  7152. fi
  7153. if test dlopen = "$pass"; then
  7154. # Collect dlpreopened libraries
  7155. save_deplibs=$deplibs
  7156. deplibs=
  7157. fi
  7158. for deplib in $libs; do
  7159. lib=
  7160. found=false
  7161. case $deplib in
  7162. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  7163. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  7164. if test prog,link = "$linkmode,$pass"; then
  7165. compile_deplibs="$deplib $compile_deplibs"
  7166. finalize_deplibs="$deplib $finalize_deplibs"
  7167. else
  7168. func_append compiler_flags " $deplib"
  7169. if test lib = "$linkmode"; then
  7170. case "$new_inherited_linker_flags " in
  7171. *" $deplib "*) ;;
  7172. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7173. esac
  7174. fi
  7175. fi
  7176. continue
  7177. ;;
  7178. -l*)
  7179. if test lib != "$linkmode" && test prog != "$linkmode"; then
  7180. func_warning "'-l' is ignored for archives/objects"
  7181. continue
  7182. fi
  7183. func_stripname '-l' '' "$deplib"
  7184. name=$func_stripname_result
  7185. if test lib = "$linkmode"; then
  7186. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  7187. else
  7188. searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  7189. fi
  7190. for searchdir in $searchdirs; do
  7191. for search_ext in .la $std_shrext .so .a; do
  7192. # Search the libtool library
  7193. lib=$searchdir/lib$name$search_ext
  7194. if test -f "$lib"; then
  7195. if test .la = "$search_ext"; then
  7196. found=:
  7197. else
  7198. found=false
  7199. fi
  7200. break 2
  7201. fi
  7202. done
  7203. done
  7204. if $found; then
  7205. # deplib is a libtool library
  7206. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  7207. # We need to do some special things here, and not later.
  7208. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  7209. case " $predeps $postdeps " in
  7210. *" $deplib "*)
  7211. if func_lalib_p "$lib"; then
  7212. library_names=
  7213. old_library=
  7214. func_source "$lib"
  7215. for l in $old_library $library_names; do
  7216. ll=$l
  7217. done
  7218. if test "X$ll" = "X$old_library"; then # only static version available
  7219. found=false
  7220. func_dirname "$lib" "" "."
  7221. ladir=$func_dirname_result
  7222. lib=$ladir/$old_library
  7223. if test prog,link = "$linkmode,$pass"; then
  7224. compile_deplibs="$deplib $compile_deplibs"
  7225. finalize_deplibs="$deplib $finalize_deplibs"
  7226. else
  7227. deplibs="$deplib $deplibs"
  7228. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7229. fi
  7230. continue
  7231. fi
  7232. fi
  7233. ;;
  7234. *) ;;
  7235. esac
  7236. fi
  7237. else
  7238. # deplib doesn't seem to be a libtool library
  7239. if test prog,link = "$linkmode,$pass"; then
  7240. compile_deplibs="$deplib $compile_deplibs"
  7241. finalize_deplibs="$deplib $finalize_deplibs"
  7242. else
  7243. deplibs="$deplib $deplibs"
  7244. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7245. fi
  7246. continue
  7247. fi
  7248. ;; # -l
  7249. *.ltframework)
  7250. if test prog,link = "$linkmode,$pass"; then
  7251. compile_deplibs="$deplib $compile_deplibs"
  7252. finalize_deplibs="$deplib $finalize_deplibs"
  7253. else
  7254. deplibs="$deplib $deplibs"
  7255. if test lib = "$linkmode"; then
  7256. case "$new_inherited_linker_flags " in
  7257. *" $deplib "*) ;;
  7258. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7259. esac
  7260. fi
  7261. fi
  7262. continue
  7263. ;;
  7264. -L*)
  7265. case $linkmode in
  7266. lib)
  7267. deplibs="$deplib $deplibs"
  7268. test conv = "$pass" && continue
  7269. newdependency_libs="$deplib $newdependency_libs"
  7270. func_stripname '-L' '' "$deplib"
  7271. func_resolve_sysroot "$func_stripname_result"
  7272. func_append newlib_search_path " $func_resolve_sysroot_result"
  7273. ;;
  7274. prog)
  7275. if test conv = "$pass"; then
  7276. deplibs="$deplib $deplibs"
  7277. continue
  7278. fi
  7279. if test scan = "$pass"; then
  7280. deplibs="$deplib $deplibs"
  7281. else
  7282. compile_deplibs="$deplib $compile_deplibs"
  7283. finalize_deplibs="$deplib $finalize_deplibs"
  7284. fi
  7285. func_stripname '-L' '' "$deplib"
  7286. func_resolve_sysroot "$func_stripname_result"
  7287. func_append newlib_search_path " $func_resolve_sysroot_result"
  7288. ;;
  7289. *)
  7290. func_warning "'-L' is ignored for archives/objects"
  7291. ;;
  7292. esac # linkmode
  7293. continue
  7294. ;; # -L
  7295. -R*)
  7296. if test link = "$pass"; then
  7297. func_stripname '-R' '' "$deplib"
  7298. func_resolve_sysroot "$func_stripname_result"
  7299. dir=$func_resolve_sysroot_result
  7300. # Make sure the xrpath contains only unique directories.
  7301. case "$xrpath " in
  7302. *" $dir "*) ;;
  7303. *) func_append xrpath " $dir" ;;
  7304. esac
  7305. fi
  7306. deplibs="$deplib $deplibs"
  7307. continue
  7308. ;;
  7309. *.la)
  7310. func_resolve_sysroot "$deplib"
  7311. lib=$func_resolve_sysroot_result
  7312. ;;
  7313. *.$libext)
  7314. if test conv = "$pass"; then
  7315. deplibs="$deplib $deplibs"
  7316. continue
  7317. fi
  7318. case $linkmode in
  7319. lib)
  7320. # Linking convenience modules into shared libraries is allowed,
  7321. # but linking other static libraries is non-portable.
  7322. case " $dlpreconveniencelibs " in
  7323. *" $deplib "*) ;;
  7324. *)
  7325. valid_a_lib=false
  7326. case $deplibs_check_method in
  7327. match_pattern*)
  7328. set dummy $deplibs_check_method; shift
  7329. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  7330. if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  7331. | $EGREP "$match_pattern_regex" > /dev/null; then
  7332. valid_a_lib=:
  7333. fi
  7334. ;;
  7335. pass_all)
  7336. valid_a_lib=:
  7337. ;;
  7338. esac
  7339. if $valid_a_lib; then
  7340. echo
  7341. $ECHO "*** Warning: Linking the shared library $output against the"
  7342. $ECHO "*** static library $deplib is not portable!"
  7343. deplibs="$deplib $deplibs"
  7344. else
  7345. echo
  7346. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  7347. echo "*** I have the capability to make that library automatically link in when"
  7348. echo "*** you link to this library. But I can only do this if you have a"
  7349. echo "*** shared version of the library, which you do not appear to have"
  7350. echo "*** because the file extensions .$libext of this argument makes me believe"
  7351. echo "*** that it is just a static archive that I should not use here."
  7352. fi
  7353. ;;
  7354. esac
  7355. continue
  7356. ;;
  7357. prog)
  7358. if test link != "$pass"; then
  7359. deplibs="$deplib $deplibs"
  7360. else
  7361. compile_deplibs="$deplib $compile_deplibs"
  7362. finalize_deplibs="$deplib $finalize_deplibs"
  7363. fi
  7364. continue
  7365. ;;
  7366. esac # linkmode
  7367. ;; # *.$libext
  7368. *.lo | *.$objext)
  7369. if test conv = "$pass"; then
  7370. deplibs="$deplib $deplibs"
  7371. elif test prog = "$linkmode"; then
  7372. if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
  7373. # If there is no dlopen support or we're linking statically,
  7374. # we need to preload.
  7375. func_append newdlprefiles " $deplib"
  7376. compile_deplibs="$deplib $compile_deplibs"
  7377. finalize_deplibs="$deplib $finalize_deplibs"
  7378. else
  7379. func_append newdlfiles " $deplib"
  7380. fi
  7381. fi
  7382. continue
  7383. ;;
  7384. %DEPLIBS%)
  7385. alldeplibs=:
  7386. continue
  7387. ;;
  7388. esac # case $deplib
  7389. $found || test -f "$lib" \
  7390. || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
  7391. # Check to see that this really is a libtool archive.
  7392. func_lalib_unsafe_p "$lib" \
  7393. || func_fatal_error "'$lib' is not a valid libtool archive"
  7394. func_dirname "$lib" "" "."
  7395. ladir=$func_dirname_result
  7396. dlname=
  7397. dlopen=
  7398. dlpreopen=
  7399. libdir=
  7400. library_names=
  7401. old_library=
  7402. inherited_linker_flags=
  7403. # If the library was installed with an old release of libtool,
  7404. # it will not redefine variables installed, or shouldnotlink
  7405. installed=yes
  7406. shouldnotlink=no
  7407. avoidtemprpath=
  7408. # Read the .la file
  7409. func_source "$lib"
  7410. # Convert "-framework foo" to "foo.ltframework"
  7411. if test -n "$inherited_linker_flags"; then
  7412. tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  7413. for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  7414. case " $new_inherited_linker_flags " in
  7415. *" $tmp_inherited_linker_flag "*) ;;
  7416. *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
  7417. esac
  7418. done
  7419. fi
  7420. dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7421. if test lib,link = "$linkmode,$pass" ||
  7422. test prog,scan = "$linkmode,$pass" ||
  7423. { test prog != "$linkmode" && test lib != "$linkmode"; }; then
  7424. test -n "$dlopen" && func_append dlfiles " $dlopen"
  7425. test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
  7426. fi
  7427. if test conv = "$pass"; then
  7428. # Only check for convenience libraries
  7429. deplibs="$lib $deplibs"
  7430. if test -z "$libdir"; then
  7431. if test -z "$old_library"; then
  7432. func_fatal_error "cannot find name of link library for '$lib'"
  7433. fi
  7434. # It is a libtool convenience library, so add in its objects.
  7435. func_append convenience " $ladir/$objdir/$old_library"
  7436. func_append old_convenience " $ladir/$objdir/$old_library"
  7437. tmp_libs=
  7438. for deplib in $dependency_libs; do
  7439. deplibs="$deplib $deplibs"
  7440. if $opt_duplicate_deps; then
  7441. case "$tmp_libs " in
  7442. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7443. esac
  7444. fi
  7445. func_append tmp_libs " $deplib"
  7446. done
  7447. elif test prog != "$linkmode" && test lib != "$linkmode"; then
  7448. func_fatal_error "'$lib' is not a convenience library"
  7449. fi
  7450. continue
  7451. fi # $pass = conv
  7452. # Get the name of the library we link against.
  7453. linklib=
  7454. if test -n "$old_library" &&
  7455. { test yes = "$prefer_static_libs" ||
  7456. test built,no = "$prefer_static_libs,$installed"; }; then
  7457. linklib=$old_library
  7458. else
  7459. for l in $old_library $library_names; do
  7460. linklib=$l
  7461. done
  7462. fi
  7463. if test -z "$linklib"; then
  7464. func_fatal_error "cannot find name of link library for '$lib'"
  7465. fi
  7466. # This library was specified with -dlopen.
  7467. if test dlopen = "$pass"; then
  7468. test -z "$libdir" \
  7469. && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
  7470. if test -z "$dlname" ||
  7471. test yes != "$dlopen_support" ||
  7472. test no = "$build_libtool_libs"
  7473. then
  7474. # If there is no dlname, no dlopen support or we're linking
  7475. # statically, we need to preload. We also need to preload any
  7476. # dependent libraries so libltdl's deplib preloader doesn't
  7477. # bomb out in the load deplibs phase.
  7478. func_append dlprefiles " $lib $dependency_libs"
  7479. else
  7480. func_append newdlfiles " $lib"
  7481. fi
  7482. continue
  7483. fi # $pass = dlopen
  7484. # We need an absolute path.
  7485. case $ladir in
  7486. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
  7487. *)
  7488. abs_ladir=`cd "$ladir" && pwd`
  7489. if test -z "$abs_ladir"; then
  7490. func_warning "cannot determine absolute directory name of '$ladir'"
  7491. func_warning "passing it literally to the linker, although it might fail"
  7492. abs_ladir=$ladir
  7493. fi
  7494. ;;
  7495. esac
  7496. func_basename "$lib"
  7497. laname=$func_basename_result
  7498. # Find the relevant object directory and library name.
  7499. if test yes = "$installed"; then
  7500. if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7501. func_warning "library '$lib' was moved."
  7502. dir=$ladir
  7503. absdir=$abs_ladir
  7504. libdir=$abs_ladir
  7505. else
  7506. dir=$lt_sysroot$libdir
  7507. absdir=$lt_sysroot$libdir
  7508. fi
  7509. test yes = "$hardcode_automatic" && avoidtemprpath=yes
  7510. else
  7511. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7512. dir=$ladir
  7513. absdir=$abs_ladir
  7514. # Remove this search path later
  7515. func_append notinst_path " $abs_ladir"
  7516. else
  7517. dir=$ladir/$objdir
  7518. absdir=$abs_ladir/$objdir
  7519. # Remove this search path later
  7520. func_append notinst_path " $abs_ladir"
  7521. fi
  7522. fi # $installed = yes
  7523. func_stripname 'lib' '.la' "$laname"
  7524. name=$func_stripname_result
  7525. # This library was specified with -dlpreopen.
  7526. if test dlpreopen = "$pass"; then
  7527. if test -z "$libdir" && test prog = "$linkmode"; then
  7528. func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
  7529. fi
  7530. case $host in
  7531. # special handling for platforms with PE-DLLs.
  7532. *cygwin* | *mingw* | *cegcc* )
  7533. # Linker will automatically link against shared library if both
  7534. # static and shared are present. Therefore, ensure we extract
  7535. # symbols from the import library if a shared library is present
  7536. # (otherwise, the dlopen module name will be incorrect). We do
  7537. # this by putting the import library name into $newdlprefiles.
  7538. # We recover the dlopen module name by 'saving' the la file
  7539. # name in a special purpose variable, and (later) extracting the
  7540. # dlname from the la file.
  7541. if test -n "$dlname"; then
  7542. func_tr_sh "$dir/$linklib"
  7543. eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  7544. func_append newdlprefiles " $dir/$linklib"
  7545. else
  7546. func_append newdlprefiles " $dir/$old_library"
  7547. # Keep a list of preopened convenience libraries to check
  7548. # that they are being used correctly in the link pass.
  7549. test -z "$libdir" && \
  7550. func_append dlpreconveniencelibs " $dir/$old_library"
  7551. fi
  7552. ;;
  7553. * )
  7554. # Prefer using a static library (so that no silly _DYNAMIC symbols
  7555. # are required to link).
  7556. if test -n "$old_library"; then
  7557. func_append newdlprefiles " $dir/$old_library"
  7558. # Keep a list of preopened convenience libraries to check
  7559. # that they are being used correctly in the link pass.
  7560. test -z "$libdir" && \
  7561. func_append dlpreconveniencelibs " $dir/$old_library"
  7562. # Otherwise, use the dlname, so that lt_dlopen finds it.
  7563. elif test -n "$dlname"; then
  7564. func_append newdlprefiles " $dir/$dlname"
  7565. else
  7566. func_append newdlprefiles " $dir/$linklib"
  7567. fi
  7568. ;;
  7569. esac
  7570. fi # $pass = dlpreopen
  7571. if test -z "$libdir"; then
  7572. # Link the convenience library
  7573. if test lib = "$linkmode"; then
  7574. deplibs="$dir/$old_library $deplibs"
  7575. elif test prog,link = "$linkmode,$pass"; then
  7576. compile_deplibs="$dir/$old_library $compile_deplibs"
  7577. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  7578. else
  7579. deplibs="$lib $deplibs" # used for prog,scan pass
  7580. fi
  7581. continue
  7582. fi
  7583. if test prog = "$linkmode" && test link != "$pass"; then
  7584. func_append newlib_search_path " $ladir"
  7585. deplibs="$lib $deplibs"
  7586. linkalldeplibs=false
  7587. if test no != "$link_all_deplibs" || test -z "$library_names" ||
  7588. test no = "$build_libtool_libs"; then
  7589. linkalldeplibs=:
  7590. fi
  7591. tmp_libs=
  7592. for deplib in $dependency_libs; do
  7593. case $deplib in
  7594. -L*) func_stripname '-L' '' "$deplib"
  7595. func_resolve_sysroot "$func_stripname_result"
  7596. func_append newlib_search_path " $func_resolve_sysroot_result"
  7597. ;;
  7598. esac
  7599. # Need to link against all dependency_libs?
  7600. if $linkalldeplibs; then
  7601. deplibs="$deplib $deplibs"
  7602. else
  7603. # Need to hardcode shared library paths
  7604. # or/and link against static libraries
  7605. newdependency_libs="$deplib $newdependency_libs"
  7606. fi
  7607. if $opt_preserve_dup_deps; then
  7608. case "$tmp_libs " in
  7609. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7610. esac
  7611. fi
  7612. func_append tmp_libs " $deplib"
  7613. done # for deplib
  7614. continue
  7615. fi # $linkmode = prog...
  7616. if test prog,link = "$linkmode,$pass"; then
  7617. if test -n "$library_names" &&
  7618. { { test no = "$prefer_static_libs" ||
  7619. test built,yes = "$prefer_static_libs,$installed"; } ||
  7620. test -z "$old_library"; }; then
  7621. # We need to hardcode the library path
  7622. if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
  7623. # Make sure the rpath contains only unique directories.
  7624. case $temp_rpath: in
  7625. *"$absdir:"*) ;;
  7626. *) func_append temp_rpath "$absdir:" ;;
  7627. esac
  7628. fi
  7629. # Hardcode the library path.
  7630. # Skip directories that are in the system default run-time
  7631. # search path.
  7632. case " $sys_lib_dlsearch_path " in
  7633. *" $absdir "*) ;;
  7634. *)
  7635. case "$compile_rpath " in
  7636. *" $absdir "*) ;;
  7637. *) func_append compile_rpath " $absdir" ;;
  7638. esac
  7639. ;;
  7640. esac
  7641. case " $sys_lib_dlsearch_path " in
  7642. *" $libdir "*) ;;
  7643. *)
  7644. case "$finalize_rpath " in
  7645. *" $libdir "*) ;;
  7646. *) func_append finalize_rpath " $libdir" ;;
  7647. esac
  7648. ;;
  7649. esac
  7650. fi # $linkmode,$pass = prog,link...
  7651. if $alldeplibs &&
  7652. { test pass_all = "$deplibs_check_method" ||
  7653. { test yes = "$build_libtool_libs" &&
  7654. test -n "$library_names"; }; }; then
  7655. # We only need to search for static libraries
  7656. continue
  7657. fi
  7658. fi
  7659. link_static=no # Whether the deplib will be linked statically
  7660. use_static_libs=$prefer_static_libs
  7661. if test built = "$use_static_libs" && test yes = "$installed"; then
  7662. use_static_libs=no
  7663. fi
  7664. if test -n "$library_names" &&
  7665. { test no = "$use_static_libs" || test -z "$old_library"; }; then
  7666. case $host in
  7667. *cygwin* | *mingw* | *cegcc* | *os2*)
  7668. # No point in relinking DLLs because paths are not encoded
  7669. func_append notinst_deplibs " $lib"
  7670. need_relink=no
  7671. ;;
  7672. *)
  7673. if test no = "$installed"; then
  7674. func_append notinst_deplibs " $lib"
  7675. need_relink=yes
  7676. fi
  7677. ;;
  7678. esac
  7679. # This is a shared library
  7680. # Warn about portability, can't link against -module's on some
  7681. # systems (darwin). Don't bleat about dlopened modules though!
  7682. dlopenmodule=
  7683. for dlpremoduletest in $dlprefiles; do
  7684. if test "X$dlpremoduletest" = "X$lib"; then
  7685. dlopenmodule=$dlpremoduletest
  7686. break
  7687. fi
  7688. done
  7689. if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
  7690. echo
  7691. if test prog = "$linkmode"; then
  7692. $ECHO "*** Warning: Linking the executable $output against the loadable module"
  7693. else
  7694. $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  7695. fi
  7696. $ECHO "*** $linklib is not portable!"
  7697. fi
  7698. if test lib = "$linkmode" &&
  7699. test yes = "$hardcode_into_libs"; then
  7700. # Hardcode the library path.
  7701. # Skip directories that are in the system default run-time
  7702. # search path.
  7703. case " $sys_lib_dlsearch_path " in
  7704. *" $absdir "*) ;;
  7705. *)
  7706. case "$compile_rpath " in
  7707. *" $absdir "*) ;;
  7708. *) func_append compile_rpath " $absdir" ;;
  7709. esac
  7710. ;;
  7711. esac
  7712. case " $sys_lib_dlsearch_path " in
  7713. *" $libdir "*) ;;
  7714. *)
  7715. case "$finalize_rpath " in
  7716. *" $libdir "*) ;;
  7717. *) func_append finalize_rpath " $libdir" ;;
  7718. esac
  7719. ;;
  7720. esac
  7721. fi
  7722. if test -n "$old_archive_from_expsyms_cmds"; then
  7723. # figure out the soname
  7724. set dummy $library_names
  7725. shift
  7726. realname=$1
  7727. shift
  7728. libname=`eval "\\$ECHO \"$libname_spec\""`
  7729. # use dlname if we got it. it's perfectly good, no?
  7730. if test -n "$dlname"; then
  7731. soname=$dlname
  7732. elif test -n "$soname_spec"; then
  7733. # bleh windows
  7734. case $host in
  7735. *cygwin* | mingw* | *cegcc* | *os2*)
  7736. func_arith $current - $age
  7737. major=$func_arith_result
  7738. versuffix=-$major
  7739. ;;
  7740. esac
  7741. eval soname=\"$soname_spec\"
  7742. else
  7743. soname=$realname
  7744. fi
  7745. # Make a new name for the extract_expsyms_cmds to use
  7746. soroot=$soname
  7747. func_basename "$soroot"
  7748. soname=$func_basename_result
  7749. func_stripname 'lib' '.dll' "$soname"
  7750. newlib=libimp-$func_stripname_result.a
  7751. # If the library has no export list, then create one now
  7752. if test -f "$output_objdir/$soname-def"; then :
  7753. else
  7754. func_verbose "extracting exported symbol list from '$soname'"
  7755. func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  7756. fi
  7757. # Create $newlib
  7758. if test -f "$output_objdir/$newlib"; then :; else
  7759. func_verbose "generating import library for '$soname'"
  7760. func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  7761. fi
  7762. # make sure the library variables are pointing to the new library
  7763. dir=$output_objdir
  7764. linklib=$newlib
  7765. fi # test -n "$old_archive_from_expsyms_cmds"
  7766. if test prog = "$linkmode" || test relink != "$opt_mode"; then
  7767. add_shlibpath=
  7768. add_dir=
  7769. add=
  7770. lib_linked=yes
  7771. case $hardcode_action in
  7772. immediate | unsupported)
  7773. if test no = "$hardcode_direct"; then
  7774. add=$dir/$linklib
  7775. case $host in
  7776. *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
  7777. *-*-sysv4*uw2*) add_dir=-L$dir ;;
  7778. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  7779. *-*-unixware7*) add_dir=-L$dir ;;
  7780. *-*-darwin* )
  7781. # if the lib is a (non-dlopened) module then we cannot
  7782. # link against it, someone is ignoring the earlier warnings
  7783. if /usr/bin/file -L $add 2> /dev/null |
  7784. $GREP ": [^:]* bundle" >/dev/null; then
  7785. if test "X$dlopenmodule" != "X$lib"; then
  7786. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  7787. if test -z "$old_library"; then
  7788. echo
  7789. echo "*** And there doesn't seem to be a static archive available"
  7790. echo "*** The link will probably fail, sorry"
  7791. else
  7792. add=$dir/$old_library
  7793. fi
  7794. elif test -n "$old_library"; then
  7795. add=$dir/$old_library
  7796. fi
  7797. fi
  7798. esac
  7799. elif test no = "$hardcode_minus_L"; then
  7800. case $host in
  7801. *-*-sunos*) add_shlibpath=$dir ;;
  7802. esac
  7803. add_dir=-L$dir
  7804. add=-l$name
  7805. elif test no = "$hardcode_shlibpath_var"; then
  7806. add_shlibpath=$dir
  7807. add=-l$name
  7808. else
  7809. lib_linked=no
  7810. fi
  7811. ;;
  7812. relink)
  7813. if test yes = "$hardcode_direct" &&
  7814. test no = "$hardcode_direct_absolute"; then
  7815. add=$dir/$linklib
  7816. elif test yes = "$hardcode_minus_L"; then
  7817. add_dir=-L$absdir
  7818. # Try looking first in the location we're being installed to.
  7819. if test -n "$inst_prefix_dir"; then
  7820. case $libdir in
  7821. [\\/]*)
  7822. func_append add_dir " -L$inst_prefix_dir$libdir"
  7823. ;;
  7824. esac
  7825. fi
  7826. add=-l$name
  7827. elif test yes = "$hardcode_shlibpath_var"; then
  7828. add_shlibpath=$dir
  7829. add=-l$name
  7830. else
  7831. lib_linked=no
  7832. fi
  7833. ;;
  7834. *) lib_linked=no ;;
  7835. esac
  7836. if test yes != "$lib_linked"; then
  7837. func_fatal_configuration "unsupported hardcode properties"
  7838. fi
  7839. if test -n "$add_shlibpath"; then
  7840. case :$compile_shlibpath: in
  7841. *":$add_shlibpath:"*) ;;
  7842. *) func_append compile_shlibpath "$add_shlibpath:" ;;
  7843. esac
  7844. fi
  7845. if test prog = "$linkmode"; then
  7846. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  7847. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  7848. else
  7849. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7850. test -n "$add" && deplibs="$add $deplibs"
  7851. if test yes != "$hardcode_direct" &&
  7852. test yes != "$hardcode_minus_L" &&
  7853. test yes = "$hardcode_shlibpath_var"; then
  7854. case :$finalize_shlibpath: in
  7855. *":$libdir:"*) ;;
  7856. *) func_append finalize_shlibpath "$libdir:" ;;
  7857. esac
  7858. fi
  7859. fi
  7860. fi
  7861. if test prog = "$linkmode" || test relink = "$opt_mode"; then
  7862. add_shlibpath=
  7863. add_dir=
  7864. add=
  7865. # Finalize command for both is simple: just hardcode it.
  7866. if test yes = "$hardcode_direct" &&
  7867. test no = "$hardcode_direct_absolute"; then
  7868. add=$libdir/$linklib
  7869. elif test yes = "$hardcode_minus_L"; then
  7870. add_dir=-L$libdir
  7871. add=-l$name
  7872. elif test yes = "$hardcode_shlibpath_var"; then
  7873. case :$finalize_shlibpath: in
  7874. *":$libdir:"*) ;;
  7875. *) func_append finalize_shlibpath "$libdir:" ;;
  7876. esac
  7877. add=-l$name
  7878. elif test yes = "$hardcode_automatic"; then
  7879. if test -n "$inst_prefix_dir" &&
  7880. test -f "$inst_prefix_dir$libdir/$linklib"; then
  7881. add=$inst_prefix_dir$libdir/$linklib
  7882. else
  7883. add=$libdir/$linklib
  7884. fi
  7885. else
  7886. # We cannot seem to hardcode it, guess we'll fake it.
  7887. add_dir=-L$libdir
  7888. # Try looking first in the location we're being installed to.
  7889. if test -n "$inst_prefix_dir"; then
  7890. case $libdir in
  7891. [\\/]*)
  7892. func_append add_dir " -L$inst_prefix_dir$libdir"
  7893. ;;
  7894. esac
  7895. fi
  7896. add=-l$name
  7897. fi
  7898. if test prog = "$linkmode"; then
  7899. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  7900. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  7901. else
  7902. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7903. test -n "$add" && deplibs="$add $deplibs"
  7904. fi
  7905. fi
  7906. elif test prog = "$linkmode"; then
  7907. # Here we assume that one of hardcode_direct or hardcode_minus_L
  7908. # is not unsupported. This is valid on all known static and
  7909. # shared platforms.
  7910. if test unsupported != "$hardcode_direct"; then
  7911. test -n "$old_library" && linklib=$old_library
  7912. compile_deplibs="$dir/$linklib $compile_deplibs"
  7913. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  7914. else
  7915. compile_deplibs="-l$name -L$dir $compile_deplibs"
  7916. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  7917. fi
  7918. elif test yes = "$build_libtool_libs"; then
  7919. # Not a shared library
  7920. if test pass_all != "$deplibs_check_method"; then
  7921. # We're trying link a shared library against a static one
  7922. # but the system doesn't support it.
  7923. # Just print a warning and add the library to dependency_libs so
  7924. # that the program can be linked against the static library.
  7925. echo
  7926. $ECHO "*** Warning: This system cannot link to static lib archive $lib."
  7927. echo "*** I have the capability to make that library automatically link in when"
  7928. echo "*** you link to this library. But I can only do this if you have a"
  7929. echo "*** shared version of the library, which you do not appear to have."
  7930. if test yes = "$module"; then
  7931. echo "*** But as you try to build a module library, libtool will still create "
  7932. echo "*** a static module, that should work as long as the dlopening application"
  7933. echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  7934. if test -z "$global_symbol_pipe"; then
  7935. echo
  7936. echo "*** However, this would only work if libtool was able to extract symbol"
  7937. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  7938. echo "*** not find such a program. So, this module is probably useless."
  7939. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  7940. fi
  7941. if test no = "$build_old_libs"; then
  7942. build_libtool_libs=module
  7943. build_old_libs=yes
  7944. else
  7945. build_libtool_libs=no
  7946. fi
  7947. fi
  7948. else
  7949. deplibs="$dir/$old_library $deplibs"
  7950. link_static=yes
  7951. fi
  7952. fi # link shared/static library?
  7953. if test lib = "$linkmode"; then
  7954. if test -n "$dependency_libs" &&
  7955. { test yes != "$hardcode_into_libs" ||
  7956. test yes = "$build_old_libs" ||
  7957. test yes = "$link_static"; }; then
  7958. # Extract -R from dependency_libs
  7959. temp_deplibs=
  7960. for libdir in $dependency_libs; do
  7961. case $libdir in
  7962. -R*) func_stripname '-R' '' "$libdir"
  7963. temp_xrpath=$func_stripname_result
  7964. case " $xrpath " in
  7965. *" $temp_xrpath "*) ;;
  7966. *) func_append xrpath " $temp_xrpath";;
  7967. esac;;
  7968. *) func_append temp_deplibs " $libdir";;
  7969. esac
  7970. done
  7971. dependency_libs=$temp_deplibs
  7972. fi
  7973. func_append newlib_search_path " $absdir"
  7974. # Link against this library
  7975. test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  7976. # ... and its dependency_libs
  7977. tmp_libs=
  7978. for deplib in $dependency_libs; do
  7979. newdependency_libs="$deplib $newdependency_libs"
  7980. case $deplib in
  7981. -L*) func_stripname '-L' '' "$deplib"
  7982. func_resolve_sysroot "$func_stripname_result";;
  7983. *) func_resolve_sysroot "$deplib" ;;
  7984. esac
  7985. if $opt_preserve_dup_deps; then
  7986. case "$tmp_libs " in
  7987. *" $func_resolve_sysroot_result "*)
  7988. func_append specialdeplibs " $func_resolve_sysroot_result" ;;
  7989. esac
  7990. fi
  7991. func_append tmp_libs " $func_resolve_sysroot_result"
  7992. done
  7993. if test no != "$link_all_deplibs"; then
  7994. # Add the search paths of all dependency libraries
  7995. for deplib in $dependency_libs; do
  7996. path=
  7997. case $deplib in
  7998. -L*) path=$deplib ;;
  7999. *.la)
  8000. func_resolve_sysroot "$deplib"
  8001. deplib=$func_resolve_sysroot_result
  8002. func_dirname "$deplib" "" "."
  8003. dir=$func_dirname_result
  8004. # We need an absolute path.
  8005. case $dir in
  8006. [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
  8007. *)
  8008. absdir=`cd "$dir" && pwd`
  8009. if test -z "$absdir"; then
  8010. func_warning "cannot determine absolute directory name of '$dir'"
  8011. absdir=$dir
  8012. fi
  8013. ;;
  8014. esac
  8015. if $GREP "^installed=no" $deplib > /dev/null; then
  8016. case $host in
  8017. *-*-darwin*)
  8018. depdepl=
  8019. eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  8020. if test -n "$deplibrary_names"; then
  8021. for tmp in $deplibrary_names; do
  8022. depdepl=$tmp
  8023. done
  8024. if test -f "$absdir/$objdir/$depdepl"; then
  8025. depdepl=$absdir/$objdir/$depdepl
  8026. darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  8027. if test -z "$darwin_install_name"; then
  8028. darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  8029. fi
  8030. func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
  8031. func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
  8032. path=
  8033. fi
  8034. fi
  8035. ;;
  8036. *)
  8037. path=-L$absdir/$objdir
  8038. ;;
  8039. esac
  8040. else
  8041. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  8042. test -z "$libdir" && \
  8043. func_fatal_error "'$deplib' is not a valid libtool archive"
  8044. test "$absdir" != "$libdir" && \
  8045. func_warning "'$deplib' seems to be moved"
  8046. path=-L$absdir
  8047. fi
  8048. ;;
  8049. esac
  8050. case " $deplibs " in
  8051. *" $path "*) ;;
  8052. *) deplibs="$path $deplibs" ;;
  8053. esac
  8054. done
  8055. fi # link_all_deplibs != no
  8056. fi # linkmode = lib
  8057. done # for deplib in $libs
  8058. if test link = "$pass"; then
  8059. if test prog = "$linkmode"; then
  8060. compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  8061. finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  8062. else
  8063. compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8064. fi
  8065. fi
  8066. dependency_libs=$newdependency_libs
  8067. if test dlpreopen = "$pass"; then
  8068. # Link the dlpreopened libraries before other libraries
  8069. for deplib in $save_deplibs; do
  8070. deplibs="$deplib $deplibs"
  8071. done
  8072. fi
  8073. if test dlopen != "$pass"; then
  8074. test conv = "$pass" || {
  8075. # Make sure lib_search_path contains only unique directories.
  8076. lib_search_path=
  8077. for dir in $newlib_search_path; do
  8078. case "$lib_search_path " in
  8079. *" $dir "*) ;;
  8080. *) func_append lib_search_path " $dir" ;;
  8081. esac
  8082. done
  8083. newlib_search_path=
  8084. }
  8085. if test prog,link = "$linkmode,$pass"; then
  8086. vars="compile_deplibs finalize_deplibs"
  8087. else
  8088. vars=deplibs
  8089. fi
  8090. for var in $vars dependency_libs; do
  8091. # Add libraries to $var in reverse order
  8092. eval tmp_libs=\"\$$var\"
  8093. new_libs=
  8094. for deplib in $tmp_libs; do
  8095. # FIXME: Pedantically, this is the right thing to do, so
  8096. # that some nasty dependency loop isn't accidentally
  8097. # broken:
  8098. #new_libs="$deplib $new_libs"
  8099. # Pragmatically, this seems to cause very few problems in
  8100. # practice:
  8101. case $deplib in
  8102. -L*) new_libs="$deplib $new_libs" ;;
  8103. -R*) ;;
  8104. *)
  8105. # And here is the reason: when a library appears more
  8106. # than once as an explicit dependence of a library, or
  8107. # is implicitly linked in more than once by the
  8108. # compiler, it is considered special, and multiple
  8109. # occurrences thereof are not removed. Compare this
  8110. # with having the same library being listed as a
  8111. # dependency of multiple other libraries: in this case,
  8112. # we know (pedantically, we assume) the library does not
  8113. # need to be listed more than once, so we keep only the
  8114. # last copy. This is not always right, but it is rare
  8115. # enough that we require users that really mean to play
  8116. # such unportable linking tricks to link the library
  8117. # using -Wl,-lname, so that libtool does not consider it
  8118. # for duplicate removal.
  8119. case " $specialdeplibs " in
  8120. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  8121. *)
  8122. case " $new_libs " in
  8123. *" $deplib "*) ;;
  8124. *) new_libs="$deplib $new_libs" ;;
  8125. esac
  8126. ;;
  8127. esac
  8128. ;;
  8129. esac
  8130. done
  8131. tmp_libs=
  8132. for deplib in $new_libs; do
  8133. case $deplib in
  8134. -L*)
  8135. case " $tmp_libs " in
  8136. *" $deplib "*) ;;
  8137. *) func_append tmp_libs " $deplib" ;;
  8138. esac
  8139. ;;
  8140. *) func_append tmp_libs " $deplib" ;;
  8141. esac
  8142. done
  8143. eval $var=\"$tmp_libs\"
  8144. done # for var
  8145. fi
  8146. # Add Sun CC postdeps if required:
  8147. test CXX = "$tagname" && {
  8148. case $host_os in
  8149. linux*)
  8150. case `$CC -V 2>&1 | sed 5q` in
  8151. *Sun\ C*) # Sun C++ 5.9
  8152. func_suncc_cstd_abi
  8153. if test no != "$suncc_use_cstd_abi"; then
  8154. func_append postdeps ' -library=Cstd -library=Crun'
  8155. fi
  8156. ;;
  8157. esac
  8158. ;;
  8159. solaris*)
  8160. func_cc_basename "$CC"
  8161. case $func_cc_basename_result in
  8162. CC* | sunCC*)
  8163. func_suncc_cstd_abi
  8164. if test no != "$suncc_use_cstd_abi"; then
  8165. func_append postdeps ' -library=Cstd -library=Crun'
  8166. fi
  8167. ;;
  8168. esac
  8169. ;;
  8170. esac
  8171. }
  8172. # Last step: remove runtime libs from dependency_libs
  8173. # (they stay in deplibs)
  8174. tmp_libs=
  8175. for i in $dependency_libs; do
  8176. case " $predeps $postdeps $compiler_lib_search_path " in
  8177. *" $i "*)
  8178. i=
  8179. ;;
  8180. esac
  8181. if test -n "$i"; then
  8182. func_append tmp_libs " $i"
  8183. fi
  8184. done
  8185. dependency_libs=$tmp_libs
  8186. done # for pass
  8187. if test prog = "$linkmode"; then
  8188. dlfiles=$newdlfiles
  8189. fi
  8190. if test prog = "$linkmode" || test lib = "$linkmode"; then
  8191. dlprefiles=$newdlprefiles
  8192. fi
  8193. case $linkmode in
  8194. oldlib)
  8195. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  8196. func_warning "'-dlopen' is ignored for archives"
  8197. fi
  8198. case " $deplibs" in
  8199. *\ -l* | *\ -L*)
  8200. func_warning "'-l' and '-L' are ignored for archives" ;;
  8201. esac
  8202. test -n "$rpath" && \
  8203. func_warning "'-rpath' is ignored for archives"
  8204. test -n "$xrpath" && \
  8205. func_warning "'-R' is ignored for archives"
  8206. test -n "$vinfo" && \
  8207. func_warning "'-version-info/-version-number' is ignored for archives"
  8208. test -n "$release" && \
  8209. func_warning "'-release' is ignored for archives"
  8210. test -n "$export_symbols$export_symbols_regex" && \
  8211. func_warning "'-export-symbols' is ignored for archives"
  8212. # Now set the variables for building old libraries.
  8213. build_libtool_libs=no
  8214. oldlibs=$output
  8215. func_append objs "$old_deplibs"
  8216. ;;
  8217. lib)
  8218. # Make sure we only generate libraries of the form 'libNAME.la'.
  8219. case $outputname in
  8220. lib*)
  8221. func_stripname 'lib' '.la' "$outputname"
  8222. name=$func_stripname_result
  8223. eval shared_ext=\"$shrext_cmds\"
  8224. eval libname=\"$libname_spec\"
  8225. ;;
  8226. *)
  8227. test no = "$module" \
  8228. && func_fatal_help "libtool library '$output' must begin with 'lib'"
  8229. if test no != "$need_lib_prefix"; then
  8230. # Add the "lib" prefix for modules if required
  8231. func_stripname '' '.la' "$outputname"
  8232. name=$func_stripname_result
  8233. eval shared_ext=\"$shrext_cmds\"
  8234. eval libname=\"$libname_spec\"
  8235. else
  8236. func_stripname '' '.la' "$outputname"
  8237. libname=$func_stripname_result
  8238. fi
  8239. ;;
  8240. esac
  8241. if test -n "$objs"; then
  8242. if test pass_all != "$deplibs_check_method"; then
  8243. func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
  8244. else
  8245. echo
  8246. $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  8247. $ECHO "*** objects $objs is not portable!"
  8248. func_append libobjs " $objs"
  8249. fi
  8250. fi
  8251. test no = "$dlself" \
  8252. || func_warning "'-dlopen self' is ignored for libtool libraries"
  8253. set dummy $rpath
  8254. shift
  8255. test 1 -lt "$#" \
  8256. && func_warning "ignoring multiple '-rpath's for a libtool library"
  8257. install_libdir=$1
  8258. oldlibs=
  8259. if test -z "$rpath"; then
  8260. if test yes = "$build_libtool_libs"; then
  8261. # Building a libtool convenience library.
  8262. # Some compilers have problems with a '.al' extension so
  8263. # convenience libraries should have the same extension an
  8264. # archive normally would.
  8265. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  8266. build_libtool_libs=convenience
  8267. build_old_libs=yes
  8268. fi
  8269. test -n "$vinfo" && \
  8270. func_warning "'-version-info/-version-number' is ignored for convenience libraries"
  8271. test -n "$release" && \
  8272. func_warning "'-release' is ignored for convenience libraries"
  8273. else
  8274. # Parse the version information argument.
  8275. save_ifs=$IFS; IFS=:
  8276. set dummy $vinfo 0 0 0
  8277. shift
  8278. IFS=$save_ifs
  8279. test -n "$7" && \
  8280. func_fatal_help "too many parameters to '-version-info'"
  8281. # convert absolute version numbers to libtool ages
  8282. # this retains compatibility with .la files and attempts
  8283. # to make the code below a bit more comprehensible
  8284. case $vinfo_number in
  8285. yes)
  8286. number_major=$1
  8287. number_minor=$2
  8288. number_revision=$3
  8289. #
  8290. # There are really only two kinds -- those that
  8291. # use the current revision as the major version
  8292. # and those that subtract age and use age as
  8293. # a minor version. But, then there is irix
  8294. # that has an extra 1 added just for fun
  8295. #
  8296. case $version_type in
  8297. # correct linux to gnu/linux during the next big refactor
  8298. darwin|freebsd-elf|linux|osf|windows|none)
  8299. func_arith $number_major + $number_minor
  8300. current=$func_arith_result
  8301. age=$number_minor
  8302. revision=$number_revision
  8303. ;;
  8304. freebsd-aout|qnx|sunos)
  8305. current=$number_major
  8306. revision=$number_minor
  8307. age=0
  8308. ;;
  8309. irix|nonstopux)
  8310. func_arith $number_major + $number_minor
  8311. current=$func_arith_result
  8312. age=$number_minor
  8313. revision=$number_minor
  8314. lt_irix_increment=no
  8315. ;;
  8316. *)
  8317. func_fatal_configuration "$modename: unknown library version type \`$version_type'"
  8318. ;;
  8319. esac
  8320. ;;
  8321. no)
  8322. current=$1
  8323. revision=$2
  8324. age=$3
  8325. ;;
  8326. esac
  8327. # Check that each of the things are valid numbers.
  8328. case $current in
  8329. 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]) ;;
  8330. *)
  8331. func_error "CURRENT '$current' must be a nonnegative integer"
  8332. func_fatal_error "'$vinfo' is not valid version information"
  8333. ;;
  8334. esac
  8335. case $revision in
  8336. 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]) ;;
  8337. *)
  8338. func_error "REVISION '$revision' must be a nonnegative integer"
  8339. func_fatal_error "'$vinfo' is not valid version information"
  8340. ;;
  8341. esac
  8342. case $age in
  8343. 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]) ;;
  8344. *)
  8345. func_error "AGE '$age' must be a nonnegative integer"
  8346. func_fatal_error "'$vinfo' is not valid version information"
  8347. ;;
  8348. esac
  8349. if test "$age" -gt "$current"; then
  8350. func_error "AGE '$age' is greater than the current interface number '$current'"
  8351. func_fatal_error "'$vinfo' is not valid version information"
  8352. fi
  8353. # Calculate the version variables.
  8354. major=
  8355. versuffix=
  8356. verstring=
  8357. case $version_type in
  8358. none) ;;
  8359. darwin)
  8360. # Like Linux, but with the current version available in
  8361. # verstring for coding it into the library header
  8362. func_arith $current - $age
  8363. major=.$func_arith_result
  8364. versuffix=$major.$age.$revision
  8365. # Darwin ld doesn't like 0 for these options...
  8366. func_arith $current + 1
  8367. minor_current=$func_arith_result
  8368. xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8369. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8370. # On Darwin other compilers
  8371. case $CC in
  8372. nagfor*)
  8373. verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8374. ;;
  8375. *)
  8376. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8377. ;;
  8378. esac
  8379. ;;
  8380. freebsd-aout)
  8381. major=.$current
  8382. versuffix=.$current.$revision
  8383. ;;
  8384. freebsd-elf)
  8385. func_arith $current - $age
  8386. major=.$func_arith_result
  8387. versuffix=$major.$age.$revision
  8388. ;;
  8389. irix | nonstopux)
  8390. if test no = "$lt_irix_increment"; then
  8391. func_arith $current - $age
  8392. else
  8393. func_arith $current - $age + 1
  8394. fi
  8395. major=$func_arith_result
  8396. case $version_type in
  8397. nonstopux) verstring_prefix=nonstopux ;;
  8398. *) verstring_prefix=sgi ;;
  8399. esac
  8400. verstring=$verstring_prefix$major.$revision
  8401. # Add in all the interfaces that we are compatible with.
  8402. loop=$revision
  8403. while test 0 -ne "$loop"; do
  8404. func_arith $revision - $loop
  8405. iface=$func_arith_result
  8406. func_arith $loop - 1
  8407. loop=$func_arith_result
  8408. verstring=$verstring_prefix$major.$iface:$verstring
  8409. done
  8410. # Before this point, $major must not contain '.'.
  8411. major=.$major
  8412. versuffix=$major.$revision
  8413. ;;
  8414. linux) # correct to gnu/linux during the next big refactor
  8415. func_arith $current - $age
  8416. major=.$func_arith_result
  8417. versuffix=$major.$age.$revision
  8418. ;;
  8419. osf)
  8420. func_arith $current - $age
  8421. major=.$func_arith_result
  8422. versuffix=.$current.$age.$revision
  8423. verstring=$current.$age.$revision
  8424. # Add in all the interfaces that we are compatible with.
  8425. loop=$age
  8426. while test 0 -ne "$loop"; do
  8427. func_arith $current - $loop
  8428. iface=$func_arith_result
  8429. func_arith $loop - 1
  8430. loop=$func_arith_result
  8431. verstring=$verstring:$iface.0
  8432. done
  8433. # Make executables depend on our current version.
  8434. func_append verstring ":$current.0"
  8435. ;;
  8436. qnx)
  8437. major=.$current
  8438. versuffix=.$current
  8439. ;;
  8440. sco)
  8441. major=.$current
  8442. versuffix=.$current
  8443. ;;
  8444. sunos)
  8445. major=.$current
  8446. versuffix=.$current.$revision
  8447. ;;
  8448. windows)
  8449. # Use '-' rather than '.', since we only want one
  8450. # extension on DOS 8.3 file systems.
  8451. func_arith $current - $age
  8452. major=$func_arith_result
  8453. versuffix=-$major
  8454. ;;
  8455. *)
  8456. func_fatal_configuration "unknown library version type '$version_type'"
  8457. ;;
  8458. esac
  8459. # Clear the version info if we defaulted, and they specified a release.
  8460. if test -z "$vinfo" && test -n "$release"; then
  8461. major=
  8462. case $version_type in
  8463. darwin)
  8464. # we can't check for "0.0" in archive_cmds due to quoting
  8465. # problems, so we reset it completely
  8466. verstring=
  8467. ;;
  8468. *)
  8469. verstring=0.0
  8470. ;;
  8471. esac
  8472. if test no = "$need_version"; then
  8473. versuffix=
  8474. else
  8475. versuffix=.0.0
  8476. fi
  8477. fi
  8478. # Remove version info from name if versioning should be avoided
  8479. if test yes,no = "$avoid_version,$need_version"; then
  8480. major=
  8481. versuffix=
  8482. verstring=
  8483. fi
  8484. # Check to see if the archive will have undefined symbols.
  8485. if test yes = "$allow_undefined"; then
  8486. if test unsupported = "$allow_undefined_flag"; then
  8487. if test yes = "$build_old_libs"; then
  8488. func_warning "undefined symbols not allowed in $host shared libraries; building static only"
  8489. build_libtool_libs=no
  8490. else
  8491. func_fatal_error "can't build $host shared library unless -no-undefined is specified"
  8492. fi
  8493. fi
  8494. else
  8495. # Don't allow undefined symbols.
  8496. allow_undefined_flag=$no_undefined_flag
  8497. fi
  8498. fi
  8499. func_generate_dlsyms "$libname" "$libname" :
  8500. func_append libobjs " $symfileobj"
  8501. test " " = "$libobjs" && libobjs=
  8502. if test relink != "$opt_mode"; then
  8503. # Remove our outputs, but don't remove object files since they
  8504. # may have been created when compiling PIC objects.
  8505. removelist=
  8506. tempremovelist=`$ECHO "$output_objdir/*"`
  8507. for p in $tempremovelist; do
  8508. case $p in
  8509. *.$objext | *.gcno)
  8510. ;;
  8511. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
  8512. if test -n "$precious_files_regex"; then
  8513. if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  8514. then
  8515. continue
  8516. fi
  8517. fi
  8518. func_append removelist " $p"
  8519. ;;
  8520. *) ;;
  8521. esac
  8522. done
  8523. test -n "$removelist" && \
  8524. func_show_eval "${RM}r \$removelist"
  8525. fi
  8526. # Now set the variables for building old libraries.
  8527. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
  8528. func_append oldlibs " $output_objdir/$libname.$libext"
  8529. # Transform .lo files to .o files.
  8530. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
  8531. fi
  8532. # Eliminate all temporary directories.
  8533. #for path in $notinst_path; do
  8534. # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  8535. # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  8536. # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  8537. #done
  8538. if test -n "$xrpath"; then
  8539. # If the user specified any rpath flags, then add them.
  8540. temp_xrpath=
  8541. for libdir in $xrpath; do
  8542. # Skip directories that are in the system default run-time search path.
  8543. case " $sys_lib_dlsearch_path " in
  8544. *" $libdir "*) continue ;;
  8545. esac
  8546. func_replace_sysroot "$libdir"
  8547. func_append temp_xrpath " -R$func_replace_sysroot_result"
  8548. case "$finalize_rpath " in
  8549. *" $libdir "*) ;;
  8550. *) func_append finalize_rpath " $libdir" ;;
  8551. esac
  8552. done
  8553. if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
  8554. dependency_libs="$temp_xrpath $dependency_libs"
  8555. fi
  8556. fi
  8557. # Make sure dlfiles contains only unique files that won't be dlpreopened
  8558. old_dlfiles=$dlfiles
  8559. dlfiles=
  8560. for lib in $old_dlfiles; do
  8561. case " $dlprefiles $dlfiles " in
  8562. *" $lib "*) ;;
  8563. *) func_append dlfiles " $lib" ;;
  8564. esac
  8565. done
  8566. # Make sure dlprefiles contains only unique files
  8567. old_dlprefiles=$dlprefiles
  8568. dlprefiles=
  8569. for lib in $old_dlprefiles; do
  8570. case "$dlprefiles " in
  8571. *" $lib "*) ;;
  8572. *) func_append dlprefiles " $lib" ;;
  8573. esac
  8574. done
  8575. if test yes = "$build_libtool_libs"; then
  8576. if test -n "$rpath"; then
  8577. case $host in
  8578. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  8579. # these systems don't actually have a c library (as such)!
  8580. ;;
  8581. *-*-rhapsody* | *-*-darwin1.[012])
  8582. # Rhapsody C library is in the System framework
  8583. func_append deplibs " System.ltframework"
  8584. ;;
  8585. *-*-netbsd*)
  8586. # Don't link with libc until the a.out ld.so is fixed.
  8587. ;;
  8588. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  8589. # Do not include libc due to us having libc/libc_r.
  8590. ;;
  8591. *-*-sco3.2v5* | *-*-sco5v6*)
  8592. # Causes problems with __ctype
  8593. ;;
  8594. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  8595. # Compiler inserts libc in the correct place for threads to work
  8596. ;;
  8597. *)
  8598. # Add libc to deplibs on all other systems if necessary.
  8599. if test yes = "$build_libtool_need_lc"; then
  8600. func_append deplibs " -lc"
  8601. fi
  8602. ;;
  8603. esac
  8604. fi
  8605. # Transform deplibs into only deplibs that can be linked in shared.
  8606. name_save=$name
  8607. libname_save=$libname
  8608. release_save=$release
  8609. versuffix_save=$versuffix
  8610. major_save=$major
  8611. # I'm not sure if I'm treating the release correctly. I think
  8612. # release should show up in the -l (ie -lgmp5) so we don't want to
  8613. # add it in twice. Is that correct?
  8614. release=
  8615. versuffix=
  8616. major=
  8617. newdeplibs=
  8618. droppeddeps=no
  8619. case $deplibs_check_method in
  8620. pass_all)
  8621. # Don't check for shared/static. Everything works.
  8622. # This might be a little naive. We might want to check
  8623. # whether the library exists or not. But this is on
  8624. # osf3 & osf4 and I'm not really sure... Just
  8625. # implementing what was already the behavior.
  8626. newdeplibs=$deplibs
  8627. ;;
  8628. test_compile)
  8629. # This code stresses the "libraries are programs" paradigm to its
  8630. # limits. Maybe even breaks it. We compile a program, linking it
  8631. # against the deplibs as a proxy for the library. Then we can check
  8632. # whether they linked in statically or dynamically with ldd.
  8633. $opt_dry_run || $RM conftest.c
  8634. cat > conftest.c <<EOF
  8635. int main() { return 0; }
  8636. EOF
  8637. $opt_dry_run || $RM conftest
  8638. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  8639. ldd_output=`ldd conftest`
  8640. for i in $deplibs; do
  8641. case $i in
  8642. -l*)
  8643. func_stripname -l '' "$i"
  8644. name=$func_stripname_result
  8645. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8646. case " $predeps $postdeps " in
  8647. *" $i "*)
  8648. func_append newdeplibs " $i"
  8649. i=
  8650. ;;
  8651. esac
  8652. fi
  8653. if test -n "$i"; then
  8654. libname=`eval "\\$ECHO \"$libname_spec\""`
  8655. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8656. set dummy $deplib_matches; shift
  8657. deplib_match=$1
  8658. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8659. func_append newdeplibs " $i"
  8660. else
  8661. droppeddeps=yes
  8662. echo
  8663. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8664. echo "*** I have the capability to make that library automatically link in when"
  8665. echo "*** you link to this library. But I can only do this if you have a"
  8666. echo "*** shared version of the library, which I believe you do not have"
  8667. echo "*** because a test_compile did reveal that the linker did not use it for"
  8668. echo "*** its dynamic dependency list that programs get resolved with at runtime."
  8669. fi
  8670. fi
  8671. ;;
  8672. *)
  8673. func_append newdeplibs " $i"
  8674. ;;
  8675. esac
  8676. done
  8677. else
  8678. # Error occurred in the first compile. Let's try to salvage
  8679. # the situation: Compile a separate program for each library.
  8680. for i in $deplibs; do
  8681. case $i in
  8682. -l*)
  8683. func_stripname -l '' "$i"
  8684. name=$func_stripname_result
  8685. $opt_dry_run || $RM conftest
  8686. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  8687. ldd_output=`ldd conftest`
  8688. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8689. case " $predeps $postdeps " in
  8690. *" $i "*)
  8691. func_append newdeplibs " $i"
  8692. i=
  8693. ;;
  8694. esac
  8695. fi
  8696. if test -n "$i"; then
  8697. libname=`eval "\\$ECHO \"$libname_spec\""`
  8698. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8699. set dummy $deplib_matches; shift
  8700. deplib_match=$1
  8701. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8702. func_append newdeplibs " $i"
  8703. else
  8704. droppeddeps=yes
  8705. echo
  8706. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8707. echo "*** I have the capability to make that library automatically link in when"
  8708. echo "*** you link to this library. But I can only do this if you have a"
  8709. echo "*** shared version of the library, which you do not appear to have"
  8710. echo "*** because a test_compile did reveal that the linker did not use this one"
  8711. echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  8712. fi
  8713. fi
  8714. else
  8715. droppeddeps=yes
  8716. echo
  8717. $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  8718. echo "*** make it link in! You will probably need to install it or some"
  8719. echo "*** library that it depends on before this library will be fully"
  8720. echo "*** functional. Installing it before continuing would be even better."
  8721. fi
  8722. ;;
  8723. *)
  8724. func_append newdeplibs " $i"
  8725. ;;
  8726. esac
  8727. done
  8728. fi
  8729. ;;
  8730. file_magic*)
  8731. set dummy $deplibs_check_method; shift
  8732. file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8733. for a_deplib in $deplibs; do
  8734. case $a_deplib in
  8735. -l*)
  8736. func_stripname -l '' "$a_deplib"
  8737. name=$func_stripname_result
  8738. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8739. case " $predeps $postdeps " in
  8740. *" $a_deplib "*)
  8741. func_append newdeplibs " $a_deplib"
  8742. a_deplib=
  8743. ;;
  8744. esac
  8745. fi
  8746. if test -n "$a_deplib"; then
  8747. libname=`eval "\\$ECHO \"$libname_spec\""`
  8748. if test -n "$file_magic_glob"; then
  8749. libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  8750. else
  8751. libnameglob=$libname
  8752. fi
  8753. test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
  8754. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8755. if test yes = "$want_nocaseglob"; then
  8756. shopt -s nocaseglob
  8757. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8758. $nocaseglob
  8759. else
  8760. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8761. fi
  8762. for potent_lib in $potential_libs; do
  8763. # Follow soft links.
  8764. if ls -lLd "$potent_lib" 2>/dev/null |
  8765. $GREP " -> " >/dev/null; then
  8766. continue
  8767. fi
  8768. # The statement above tries to avoid entering an
  8769. # endless loop below, in case of cyclic links.
  8770. # We might still enter an endless loop, since a link
  8771. # loop can be closed while we follow links,
  8772. # but so what?
  8773. potlib=$potent_lib
  8774. while test -h "$potlib" 2>/dev/null; do
  8775. potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
  8776. case $potliblink in
  8777. [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
  8778. *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
  8779. esac
  8780. done
  8781. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  8782. $SED -e 10q |
  8783. $EGREP "$file_magic_regex" > /dev/null; then
  8784. func_append newdeplibs " $a_deplib"
  8785. a_deplib=
  8786. break 2
  8787. fi
  8788. done
  8789. done
  8790. fi
  8791. if test -n "$a_deplib"; then
  8792. droppeddeps=yes
  8793. echo
  8794. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8795. echo "*** I have the capability to make that library automatically link in when"
  8796. echo "*** you link to this library. But I can only do this if you have a"
  8797. echo "*** shared version of the library, which you do not appear to have"
  8798. echo "*** because I did check the linker path looking for a file starting"
  8799. if test -z "$potlib"; then
  8800. $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  8801. else
  8802. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8803. $ECHO "*** using a file magic. Last file checked: $potlib"
  8804. fi
  8805. fi
  8806. ;;
  8807. *)
  8808. # Add a -L argument.
  8809. func_append newdeplibs " $a_deplib"
  8810. ;;
  8811. esac
  8812. done # Gone through all deplibs.
  8813. ;;
  8814. match_pattern*)
  8815. set dummy $deplibs_check_method; shift
  8816. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8817. for a_deplib in $deplibs; do
  8818. case $a_deplib in
  8819. -l*)
  8820. func_stripname -l '' "$a_deplib"
  8821. name=$func_stripname_result
  8822. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8823. case " $predeps $postdeps " in
  8824. *" $a_deplib "*)
  8825. func_append newdeplibs " $a_deplib"
  8826. a_deplib=
  8827. ;;
  8828. esac
  8829. fi
  8830. if test -n "$a_deplib"; then
  8831. libname=`eval "\\$ECHO \"$libname_spec\""`
  8832. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8833. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  8834. for potent_lib in $potential_libs; do
  8835. potlib=$potent_lib # see symlink-check above in file_magic test
  8836. if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  8837. $EGREP "$match_pattern_regex" > /dev/null; then
  8838. func_append newdeplibs " $a_deplib"
  8839. a_deplib=
  8840. break 2
  8841. fi
  8842. done
  8843. done
  8844. fi
  8845. if test -n "$a_deplib"; then
  8846. droppeddeps=yes
  8847. echo
  8848. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8849. echo "*** I have the capability to make that library automatically link in when"
  8850. echo "*** you link to this library. But I can only do this if you have a"
  8851. echo "*** shared version of the library, which you do not appear to have"
  8852. echo "*** because I did check the linker path looking for a file starting"
  8853. if test -z "$potlib"; then
  8854. $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  8855. else
  8856. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8857. $ECHO "*** using a regex pattern. Last file checked: $potlib"
  8858. fi
  8859. fi
  8860. ;;
  8861. *)
  8862. # Add a -L argument.
  8863. func_append newdeplibs " $a_deplib"
  8864. ;;
  8865. esac
  8866. done # Gone through all deplibs.
  8867. ;;
  8868. none | unknown | *)
  8869. newdeplibs=
  8870. tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  8871. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8872. for i in $predeps $postdeps; do
  8873. # can't use Xsed below, because $i might contain '/'
  8874. tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
  8875. done
  8876. fi
  8877. case $tmp_deplibs in
  8878. *[!\ \ ]*)
  8879. echo
  8880. if test none = "$deplibs_check_method"; then
  8881. echo "*** Warning: inter-library dependencies are not supported in this platform."
  8882. else
  8883. echo "*** Warning: inter-library dependencies are not known to be supported."
  8884. fi
  8885. echo "*** All declared inter-library dependencies are being dropped."
  8886. droppeddeps=yes
  8887. ;;
  8888. esac
  8889. ;;
  8890. esac
  8891. versuffix=$versuffix_save
  8892. major=$major_save
  8893. release=$release_save
  8894. libname=$libname_save
  8895. name=$name_save
  8896. case $host in
  8897. *-*-rhapsody* | *-*-darwin1.[012])
  8898. # On Rhapsody replace the C library with the System framework
  8899. newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  8900. ;;
  8901. esac
  8902. if test yes = "$droppeddeps"; then
  8903. if test yes = "$module"; then
  8904. echo
  8905. echo "*** Warning: libtool could not satisfy all declared inter-library"
  8906. $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  8907. echo "*** a static module, that should work as long as the dlopening"
  8908. echo "*** application is linked with the -dlopen flag."
  8909. if test -z "$global_symbol_pipe"; then
  8910. echo
  8911. echo "*** However, this would only work if libtool was able to extract symbol"
  8912. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  8913. echo "*** not find such a program. So, this module is probably useless."
  8914. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  8915. fi
  8916. if test no = "$build_old_libs"; then
  8917. oldlibs=$output_objdir/$libname.$libext
  8918. build_libtool_libs=module
  8919. build_old_libs=yes
  8920. else
  8921. build_libtool_libs=no
  8922. fi
  8923. else
  8924. echo "*** The inter-library dependencies that have been dropped here will be"
  8925. echo "*** automatically added whenever a program is linked with this library"
  8926. echo "*** or is declared to -dlopen it."
  8927. if test no = "$allow_undefined"; then
  8928. echo
  8929. echo "*** Since this library must not contain undefined symbols,"
  8930. echo "*** because either the platform does not support them or"
  8931. echo "*** it was explicitly requested with -no-undefined,"
  8932. echo "*** libtool will only create a static version of it."
  8933. if test no = "$build_old_libs"; then
  8934. oldlibs=$output_objdir/$libname.$libext
  8935. build_libtool_libs=module
  8936. build_old_libs=yes
  8937. else
  8938. build_libtool_libs=no
  8939. fi
  8940. fi
  8941. fi
  8942. fi
  8943. # Done checking deplibs!
  8944. deplibs=$newdeplibs
  8945. fi
  8946. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  8947. case $host in
  8948. *-*-darwin*)
  8949. newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8950. new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8951. deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8952. ;;
  8953. esac
  8954. # move library search paths that coincide with paths to not yet
  8955. # installed libraries to the beginning of the library search list
  8956. new_libs=
  8957. for path in $notinst_path; do
  8958. case " $new_libs " in
  8959. *" -L$path/$objdir "*) ;;
  8960. *)
  8961. case " $deplibs " in
  8962. *" -L$path/$objdir "*)
  8963. func_append new_libs " -L$path/$objdir" ;;
  8964. esac
  8965. ;;
  8966. esac
  8967. done
  8968. for deplib in $deplibs; do
  8969. case $deplib in
  8970. -L*)
  8971. case " $new_libs " in
  8972. *" $deplib "*) ;;
  8973. *) func_append new_libs " $deplib" ;;
  8974. esac
  8975. ;;
  8976. *) func_append new_libs " $deplib" ;;
  8977. esac
  8978. done
  8979. deplibs=$new_libs
  8980. # All the library-specific variables (install_libdir is set above).
  8981. library_names=
  8982. old_library=
  8983. dlname=
  8984. # Test again, we may have decided not to build it any more
  8985. if test yes = "$build_libtool_libs"; then
  8986. # Remove $wl instances when linking with ld.
  8987. # FIXME: should test the right _cmds variable.
  8988. case $archive_cmds in
  8989. *\$LD\ *) wl= ;;
  8990. esac
  8991. if test yes = "$hardcode_into_libs"; then
  8992. # Hardcode the library paths
  8993. hardcode_libdirs=
  8994. dep_rpath=
  8995. rpath=$finalize_rpath
  8996. test relink = "$opt_mode" || rpath=$compile_rpath$rpath
  8997. for libdir in $rpath; do
  8998. if test -n "$hardcode_libdir_flag_spec"; then
  8999. if test -n "$hardcode_libdir_separator"; then
  9000. func_replace_sysroot "$libdir"
  9001. libdir=$func_replace_sysroot_result
  9002. if test -z "$hardcode_libdirs"; then
  9003. hardcode_libdirs=$libdir
  9004. else
  9005. # Just accumulate the unique libdirs.
  9006. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9007. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9008. ;;
  9009. *)
  9010. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9011. ;;
  9012. esac
  9013. fi
  9014. else
  9015. eval flag=\"$hardcode_libdir_flag_spec\"
  9016. func_append dep_rpath " $flag"
  9017. fi
  9018. elif test -n "$runpath_var"; then
  9019. case "$perm_rpath " in
  9020. *" $libdir "*) ;;
  9021. *) func_append perm_rpath " $libdir" ;;
  9022. esac
  9023. fi
  9024. done
  9025. # Substitute the hardcoded libdirs into the rpath.
  9026. if test -n "$hardcode_libdir_separator" &&
  9027. test -n "$hardcode_libdirs"; then
  9028. libdir=$hardcode_libdirs
  9029. eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
  9030. fi
  9031. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  9032. # We should set the runpath_var.
  9033. rpath=
  9034. for dir in $perm_rpath; do
  9035. func_append rpath "$dir:"
  9036. done
  9037. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  9038. fi
  9039. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  9040. fi
  9041. shlibpath=$finalize_shlibpath
  9042. test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
  9043. if test -n "$shlibpath"; then
  9044. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  9045. fi
  9046. # Get the real and link names of the library.
  9047. eval shared_ext=\"$shrext_cmds\"
  9048. eval library_names=\"$library_names_spec\"
  9049. set dummy $library_names
  9050. shift
  9051. realname=$1
  9052. shift
  9053. if test -n "$soname_spec"; then
  9054. eval soname=\"$soname_spec\"
  9055. else
  9056. soname=$realname
  9057. fi
  9058. if test -z "$dlname"; then
  9059. dlname=$soname
  9060. fi
  9061. lib=$output_objdir/$realname
  9062. linknames=
  9063. for link
  9064. do
  9065. func_append linknames " $link"
  9066. done
  9067. # Use standard objects if they are pic
  9068. test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9069. test "X$libobjs" = "X " && libobjs=
  9070. delfiles=
  9071. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9072. $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  9073. export_symbols=$output_objdir/$libname.uexp
  9074. func_append delfiles " $export_symbols"
  9075. fi
  9076. orig_export_symbols=
  9077. case $host_os in
  9078. cygwin* | mingw* | cegcc*)
  9079. if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  9080. # exporting using user supplied symfile
  9081. func_dll_def_p "$export_symbols" || {
  9082. # and it's NOT already a .def file. Must figure out
  9083. # which of the given symbols are data symbols and tag
  9084. # them as such. So, trigger use of export_symbols_cmds.
  9085. # export_symbols gets reassigned inside the "prepare
  9086. # the list of exported symbols" if statement, so the
  9087. # include_expsyms logic still works.
  9088. orig_export_symbols=$export_symbols
  9089. export_symbols=
  9090. always_export_symbols=yes
  9091. }
  9092. fi
  9093. ;;
  9094. esac
  9095. # Prepare the list of exported symbols
  9096. if test -z "$export_symbols"; then
  9097. if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
  9098. func_verbose "generating symbol list for '$libname.la'"
  9099. export_symbols=$output_objdir/$libname.exp
  9100. $opt_dry_run || $RM $export_symbols
  9101. cmds=$export_symbols_cmds
  9102. save_ifs=$IFS; IFS='~'
  9103. for cmd1 in $cmds; do
  9104. IFS=$save_ifs
  9105. # Take the normal branch if the nm_file_list_spec branch
  9106. # doesn't work or if tool conversion is not needed.
  9107. case $nm_file_list_spec~$to_tool_file_cmd in
  9108. *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
  9109. try_normal_branch=yes
  9110. eval cmd=\"$cmd1\"
  9111. func_len " $cmd"
  9112. len=$func_len_result
  9113. ;;
  9114. *)
  9115. try_normal_branch=no
  9116. ;;
  9117. esac
  9118. if test yes = "$try_normal_branch" \
  9119. && { test "$len" -lt "$max_cmd_len" \
  9120. || test "$max_cmd_len" -le -1; }
  9121. then
  9122. func_show_eval "$cmd" 'exit $?'
  9123. skipped_export=false
  9124. elif test -n "$nm_file_list_spec"; then
  9125. func_basename "$output"
  9126. output_la=$func_basename_result
  9127. save_libobjs=$libobjs
  9128. save_output=$output
  9129. output=$output_objdir/$output_la.nm
  9130. func_to_tool_file "$output"
  9131. libobjs=$nm_file_list_spec$func_to_tool_file_result
  9132. func_append delfiles " $output"
  9133. func_verbose "creating $NM input file list: $output"
  9134. for obj in $save_libobjs; do
  9135. func_to_tool_file "$obj"
  9136. $ECHO "$func_to_tool_file_result"
  9137. done > "$output"
  9138. eval cmd=\"$cmd1\"
  9139. func_show_eval "$cmd" 'exit $?'
  9140. output=$save_output
  9141. libobjs=$save_libobjs
  9142. skipped_export=false
  9143. else
  9144. # The command line is too long to execute in one step.
  9145. func_verbose "using reloadable object file for export list..."
  9146. skipped_export=:
  9147. # Break out early, otherwise skipped_export may be
  9148. # set to false by a later but shorter cmd.
  9149. break
  9150. fi
  9151. done
  9152. IFS=$save_ifs
  9153. if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
  9154. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9155. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9156. fi
  9157. fi
  9158. fi
  9159. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9160. tmp_export_symbols=$export_symbols
  9161. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9162. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9163. fi
  9164. if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
  9165. # The given exports_symbols file has to be filtered, so filter it.
  9166. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9167. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9168. # 's' commands, which not all seds can handle. GNU sed should be fine
  9169. # though. Also, the filter scales superlinearly with the number of
  9170. # global variables. join(1) would be nice here, but unfortunately
  9171. # isn't a blessed tool.
  9172. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9173. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9174. export_symbols=$output_objdir/$libname.def
  9175. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9176. fi
  9177. tmp_deplibs=
  9178. for test_deplib in $deplibs; do
  9179. case " $convenience " in
  9180. *" $test_deplib "*) ;;
  9181. *)
  9182. func_append tmp_deplibs " $test_deplib"
  9183. ;;
  9184. esac
  9185. done
  9186. deplibs=$tmp_deplibs
  9187. if test -n "$convenience"; then
  9188. if test -n "$whole_archive_flag_spec" &&
  9189. test yes = "$compiler_needs_object" &&
  9190. test -z "$libobjs"; then
  9191. # extract the archives, so we have objects to list.
  9192. # TODO: could optimize this to just extract one archive.
  9193. whole_archive_flag_spec=
  9194. fi
  9195. if test -n "$whole_archive_flag_spec"; then
  9196. save_libobjs=$libobjs
  9197. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9198. test "X$libobjs" = "X " && libobjs=
  9199. else
  9200. gentop=$output_objdir/${outputname}x
  9201. func_append generated " $gentop"
  9202. func_extract_archives $gentop $convenience
  9203. func_append libobjs " $func_extract_archives_result"
  9204. test "X$libobjs" = "X " && libobjs=
  9205. fi
  9206. fi
  9207. if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
  9208. eval flag=\"$thread_safe_flag_spec\"
  9209. func_append linker_flags " $flag"
  9210. fi
  9211. # Make a backup of the uninstalled library when relinking
  9212. if test relink = "$opt_mode"; then
  9213. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  9214. fi
  9215. # Do each of the archive commands.
  9216. if test yes = "$module" && test -n "$module_cmds"; then
  9217. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9218. eval test_cmds=\"$module_expsym_cmds\"
  9219. cmds=$module_expsym_cmds
  9220. else
  9221. eval test_cmds=\"$module_cmds\"
  9222. cmds=$module_cmds
  9223. fi
  9224. else
  9225. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9226. eval test_cmds=\"$archive_expsym_cmds\"
  9227. cmds=$archive_expsym_cmds
  9228. else
  9229. eval test_cmds=\"$archive_cmds\"
  9230. cmds=$archive_cmds
  9231. fi
  9232. fi
  9233. if test : != "$skipped_export" &&
  9234. func_len " $test_cmds" &&
  9235. len=$func_len_result &&
  9236. test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9237. :
  9238. else
  9239. # The command line is too long to link in one step, link piecewise
  9240. # or, if using GNU ld and skipped_export is not :, use a linker
  9241. # script.
  9242. # Save the value of $output and $libobjs because we want to
  9243. # use them later. If we have whole_archive_flag_spec, we
  9244. # want to use save_libobjs as it was before
  9245. # whole_archive_flag_spec was expanded, because we can't
  9246. # assume the linker understands whole_archive_flag_spec.
  9247. # This may have to be revisited, in case too many
  9248. # convenience libraries get linked in and end up exceeding
  9249. # the spec.
  9250. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  9251. save_libobjs=$libobjs
  9252. fi
  9253. save_output=$output
  9254. func_basename "$output"
  9255. output_la=$func_basename_result
  9256. # Clear the reloadable object creation command queue and
  9257. # initialize k to one.
  9258. test_cmds=
  9259. concat_cmds=
  9260. objlist=
  9261. last_robj=
  9262. k=1
  9263. if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
  9264. output=$output_objdir/$output_la.lnkscript
  9265. func_verbose "creating GNU ld script: $output"
  9266. echo 'INPUT (' > $output
  9267. for obj in $save_libobjs
  9268. do
  9269. func_to_tool_file "$obj"
  9270. $ECHO "$func_to_tool_file_result" >> $output
  9271. done
  9272. echo ')' >> $output
  9273. func_append delfiles " $output"
  9274. func_to_tool_file "$output"
  9275. output=$func_to_tool_file_result
  9276. elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
  9277. output=$output_objdir/$output_la.lnk
  9278. func_verbose "creating linker input file list: $output"
  9279. : > $output
  9280. set x $save_libobjs
  9281. shift
  9282. firstobj=
  9283. if test yes = "$compiler_needs_object"; then
  9284. firstobj="$1 "
  9285. shift
  9286. fi
  9287. for obj
  9288. do
  9289. func_to_tool_file "$obj"
  9290. $ECHO "$func_to_tool_file_result" >> $output
  9291. done
  9292. func_append delfiles " $output"
  9293. func_to_tool_file "$output"
  9294. output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
  9295. else
  9296. if test -n "$save_libobjs"; then
  9297. func_verbose "creating reloadable object files..."
  9298. output=$output_objdir/$output_la-$k.$objext
  9299. eval test_cmds=\"$reload_cmds\"
  9300. func_len " $test_cmds"
  9301. len0=$func_len_result
  9302. len=$len0
  9303. # Loop over the list of objects to be linked.
  9304. for obj in $save_libobjs
  9305. do
  9306. func_len " $obj"
  9307. func_arith $len + $func_len_result
  9308. len=$func_arith_result
  9309. if test -z "$objlist" ||
  9310. test "$len" -lt "$max_cmd_len"; then
  9311. func_append objlist " $obj"
  9312. else
  9313. # The command $test_cmds is almost too long, add a
  9314. # command to the queue.
  9315. if test 1 -eq "$k"; then
  9316. # The first file doesn't have a previous command to add.
  9317. reload_objs=$objlist
  9318. eval concat_cmds=\"$reload_cmds\"
  9319. else
  9320. # All subsequent reloadable object files will link in
  9321. # the last one created.
  9322. reload_objs="$objlist $last_robj"
  9323. eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
  9324. fi
  9325. last_robj=$output_objdir/$output_la-$k.$objext
  9326. func_arith $k + 1
  9327. k=$func_arith_result
  9328. output=$output_objdir/$output_la-$k.$objext
  9329. objlist=" $obj"
  9330. func_len " $last_robj"
  9331. func_arith $len0 + $func_len_result
  9332. len=$func_arith_result
  9333. fi
  9334. done
  9335. # Handle the remaining objects by creating one last
  9336. # reloadable object file. All subsequent reloadable object
  9337. # files will link in the last one created.
  9338. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9339. reload_objs="$objlist $last_robj"
  9340. eval concat_cmds=\"\$concat_cmds$reload_cmds\"
  9341. if test -n "$last_robj"; then
  9342. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9343. fi
  9344. func_append delfiles " $output"
  9345. else
  9346. output=
  9347. fi
  9348. ${skipped_export-false} && {
  9349. func_verbose "generating symbol list for '$libname.la'"
  9350. export_symbols=$output_objdir/$libname.exp
  9351. $opt_dry_run || $RM $export_symbols
  9352. libobjs=$output
  9353. # Append the command to create the export file.
  9354. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9355. eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  9356. if test -n "$last_robj"; then
  9357. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9358. fi
  9359. }
  9360. test -n "$save_libobjs" &&
  9361. func_verbose "creating a temporary reloadable object file: $output"
  9362. # Loop through the commands generated above and execute them.
  9363. save_ifs=$IFS; IFS='~'
  9364. for cmd in $concat_cmds; do
  9365. IFS=$save_ifs
  9366. $opt_quiet || {
  9367. func_quote_arg expand,pretty "$cmd"
  9368. eval "func_echo $func_quote_arg_result"
  9369. }
  9370. $opt_dry_run || eval "$cmd" || {
  9371. lt_exit=$?
  9372. # Restore the uninstalled library and exit
  9373. if test relink = "$opt_mode"; then
  9374. ( cd "$output_objdir" && \
  9375. $RM "${realname}T" && \
  9376. $MV "${realname}U" "$realname" )
  9377. fi
  9378. exit $lt_exit
  9379. }
  9380. done
  9381. IFS=$save_ifs
  9382. if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  9383. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9384. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9385. fi
  9386. fi
  9387. ${skipped_export-false} && {
  9388. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9389. tmp_export_symbols=$export_symbols
  9390. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9391. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9392. fi
  9393. if test -n "$orig_export_symbols"; then
  9394. # The given exports_symbols file has to be filtered, so filter it.
  9395. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9396. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9397. # 's' commands, which not all seds can handle. GNU sed should be fine
  9398. # though. Also, the filter scales superlinearly with the number of
  9399. # global variables. join(1) would be nice here, but unfortunately
  9400. # isn't a blessed tool.
  9401. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9402. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9403. export_symbols=$output_objdir/$libname.def
  9404. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9405. fi
  9406. }
  9407. libobjs=$output
  9408. # Restore the value of output.
  9409. output=$save_output
  9410. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  9411. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9412. test "X$libobjs" = "X " && libobjs=
  9413. fi
  9414. # Expand the library linking commands again to reset the
  9415. # value of $libobjs for piecewise linking.
  9416. # Do each of the archive commands.
  9417. if test yes = "$module" && test -n "$module_cmds"; then
  9418. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9419. cmds=$module_expsym_cmds
  9420. else
  9421. cmds=$module_cmds
  9422. fi
  9423. else
  9424. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9425. cmds=$archive_expsym_cmds
  9426. else
  9427. cmds=$archive_cmds
  9428. fi
  9429. fi
  9430. fi
  9431. if test -n "$delfiles"; then
  9432. # Append the command to remove temporary files to $cmds.
  9433. eval cmds=\"\$cmds~\$RM $delfiles\"
  9434. fi
  9435. # Add any objects from preloaded convenience libraries
  9436. if test -n "$dlprefiles"; then
  9437. gentop=$output_objdir/${outputname}x
  9438. func_append generated " $gentop"
  9439. func_extract_archives $gentop $dlprefiles
  9440. func_append libobjs " $func_extract_archives_result"
  9441. test "X$libobjs" = "X " && libobjs=
  9442. fi
  9443. save_ifs=$IFS; IFS='~'
  9444. for cmd in $cmds; do
  9445. IFS=$sp$nl
  9446. eval cmd=\"$cmd\"
  9447. IFS=$save_ifs
  9448. $opt_quiet || {
  9449. func_quote_arg expand,pretty "$cmd"
  9450. eval "func_echo $func_quote_arg_result"
  9451. }
  9452. $opt_dry_run || eval "$cmd" || {
  9453. lt_exit=$?
  9454. # Restore the uninstalled library and exit
  9455. if test relink = "$opt_mode"; then
  9456. ( cd "$output_objdir" && \
  9457. $RM "${realname}T" && \
  9458. $MV "${realname}U" "$realname" )
  9459. fi
  9460. exit $lt_exit
  9461. }
  9462. done
  9463. IFS=$save_ifs
  9464. # Restore the uninstalled library and exit
  9465. if test relink = "$opt_mode"; then
  9466. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  9467. if test -n "$convenience"; then
  9468. if test -z "$whole_archive_flag_spec"; then
  9469. func_show_eval '${RM}r "$gentop"'
  9470. fi
  9471. fi
  9472. exit $EXIT_SUCCESS
  9473. fi
  9474. # Create links to the real library.
  9475. for linkname in $linknames; do
  9476. if test "$realname" != "$linkname"; then
  9477. func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  9478. fi
  9479. done
  9480. # If -module or -export-dynamic was specified, set the dlname.
  9481. if test yes = "$module" || test yes = "$export_dynamic"; then
  9482. # On all known operating systems, these are identical.
  9483. dlname=$soname
  9484. fi
  9485. fi
  9486. ;;
  9487. obj)
  9488. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  9489. func_warning "'-dlopen' is ignored for objects"
  9490. fi
  9491. case " $deplibs" in
  9492. *\ -l* | *\ -L*)
  9493. func_warning "'-l' and '-L' are ignored for objects" ;;
  9494. esac
  9495. test -n "$rpath" && \
  9496. func_warning "'-rpath' is ignored for objects"
  9497. test -n "$xrpath" && \
  9498. func_warning "'-R' is ignored for objects"
  9499. test -n "$vinfo" && \
  9500. func_warning "'-version-info' is ignored for objects"
  9501. test -n "$release" && \
  9502. func_warning "'-release' is ignored for objects"
  9503. case $output in
  9504. *.lo)
  9505. test -n "$objs$old_deplibs" && \
  9506. func_fatal_error "cannot build library object '$output' from non-libtool objects"
  9507. libobj=$output
  9508. func_lo2o "$libobj"
  9509. obj=$func_lo2o_result
  9510. ;;
  9511. *)
  9512. libobj=
  9513. obj=$output
  9514. ;;
  9515. esac
  9516. # Delete the old objects.
  9517. $opt_dry_run || $RM $obj $libobj
  9518. # Objects from convenience libraries. This assumes
  9519. # single-version convenience libraries. Whenever we create
  9520. # different ones for PIC/non-PIC, this we'll have to duplicate
  9521. # the extraction.
  9522. reload_conv_objs=
  9523. gentop=
  9524. # if reload_cmds runs $LD directly, get rid of -Wl from
  9525. # whole_archive_flag_spec and hope we can get by with turning comma
  9526. # into space.
  9527. case $reload_cmds in
  9528. *\$LD[\ \$]*) wl= ;;
  9529. esac
  9530. if test -n "$convenience"; then
  9531. if test -n "$whole_archive_flag_spec"; then
  9532. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  9533. test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
  9534. reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
  9535. else
  9536. gentop=$output_objdir/${obj}x
  9537. func_append generated " $gentop"
  9538. func_extract_archives $gentop $convenience
  9539. reload_conv_objs="$reload_objs $func_extract_archives_result"
  9540. fi
  9541. fi
  9542. # If we're not building shared, we need to use non_pic_objs
  9543. test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
  9544. # Create the old-style object.
  9545. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
  9546. output=$obj
  9547. func_execute_cmds "$reload_cmds" 'exit $?'
  9548. # Exit if we aren't doing a library object file.
  9549. if test -z "$libobj"; then
  9550. if test -n "$gentop"; then
  9551. func_show_eval '${RM}r "$gentop"'
  9552. fi
  9553. exit $EXIT_SUCCESS
  9554. fi
  9555. test yes = "$build_libtool_libs" || {
  9556. if test -n "$gentop"; then
  9557. func_show_eval '${RM}r "$gentop"'
  9558. fi
  9559. # Create an invalid libtool object if no PIC, so that we don't
  9560. # accidentally link it into a program.
  9561. # $show "echo timestamp > $libobj"
  9562. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  9563. exit $EXIT_SUCCESS
  9564. }
  9565. if test -n "$pic_flag" || test default != "$pic_mode"; then
  9566. # Only do commands if we really have different PIC objects.
  9567. reload_objs="$libobjs $reload_conv_objs"
  9568. output=$libobj
  9569. func_execute_cmds "$reload_cmds" 'exit $?'
  9570. fi
  9571. if test -n "$gentop"; then
  9572. func_show_eval '${RM}r "$gentop"'
  9573. fi
  9574. exit $EXIT_SUCCESS
  9575. ;;
  9576. prog)
  9577. case $host in
  9578. *cygwin*) func_stripname '' '.exe' "$output"
  9579. output=$func_stripname_result.exe;;
  9580. esac
  9581. test -n "$vinfo" && \
  9582. func_warning "'-version-info' is ignored for programs"
  9583. test -n "$release" && \
  9584. func_warning "'-release' is ignored for programs"
  9585. $preload \
  9586. && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
  9587. && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
  9588. case $host in
  9589. *-*-rhapsody* | *-*-darwin1.[012])
  9590. # On Rhapsody replace the C library is the System framework
  9591. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9592. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9593. ;;
  9594. esac
  9595. case $host in
  9596. *-*-darwin*)
  9597. # Don't allow lazy linking, it breaks C++ global constructors
  9598. # But is supposedly fixed on 10.4 or later (yay!).
  9599. if test CXX = "$tagname"; then
  9600. case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  9601. 10.[0123])
  9602. func_append compile_command " $wl-bind_at_load"
  9603. func_append finalize_command " $wl-bind_at_load"
  9604. ;;
  9605. esac
  9606. fi
  9607. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  9608. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9609. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9610. ;;
  9611. esac
  9612. # move library search paths that coincide with paths to not yet
  9613. # installed libraries to the beginning of the library search list
  9614. new_libs=
  9615. for path in $notinst_path; do
  9616. case " $new_libs " in
  9617. *" -L$path/$objdir "*) ;;
  9618. *)
  9619. case " $compile_deplibs " in
  9620. *" -L$path/$objdir "*)
  9621. func_append new_libs " -L$path/$objdir" ;;
  9622. esac
  9623. ;;
  9624. esac
  9625. done
  9626. for deplib in $compile_deplibs; do
  9627. case $deplib in
  9628. -L*)
  9629. case " $new_libs " in
  9630. *" $deplib "*) ;;
  9631. *) func_append new_libs " $deplib" ;;
  9632. esac
  9633. ;;
  9634. *) func_append new_libs " $deplib" ;;
  9635. esac
  9636. done
  9637. compile_deplibs=$new_libs
  9638. func_append compile_command " $compile_deplibs"
  9639. func_append finalize_command " $finalize_deplibs"
  9640. if test -n "$rpath$xrpath"; then
  9641. # If the user specified any rpath flags, then add them.
  9642. for libdir in $rpath $xrpath; do
  9643. # Skip directories that are in the system default run-time search path.
  9644. case " $sys_lib_dlsearch_path " in
  9645. *" $libdir "*) continue ;;
  9646. esac
  9647. # This is the magic to use -rpath.
  9648. case "$finalize_rpath " in
  9649. *" $libdir "*) ;;
  9650. *) func_append finalize_rpath " $libdir" ;;
  9651. esac
  9652. done
  9653. fi
  9654. # Now hardcode the library paths
  9655. rpath=
  9656. hardcode_libdirs=
  9657. for libdir in $compile_rpath $finalize_rpath; do
  9658. if test -n "$hardcode_libdir_flag_spec"; then
  9659. if test -n "$hardcode_libdir_separator"; then
  9660. if test -z "$hardcode_libdirs"; then
  9661. hardcode_libdirs=$libdir
  9662. else
  9663. # Just accumulate the unique libdirs.
  9664. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9665. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9666. ;;
  9667. *)
  9668. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9669. ;;
  9670. esac
  9671. fi
  9672. else
  9673. eval flag=\"$hardcode_libdir_flag_spec\"
  9674. func_append rpath " $flag"
  9675. fi
  9676. elif test -n "$runpath_var"; then
  9677. case "$perm_rpath " in
  9678. *" $libdir "*) ;;
  9679. *) func_append perm_rpath " $libdir" ;;
  9680. esac
  9681. fi
  9682. case $host in
  9683. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  9684. testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
  9685. case :$dllsearchpath: in
  9686. *":$libdir:"*) ;;
  9687. ::) dllsearchpath=$libdir;;
  9688. *) func_append dllsearchpath ":$libdir";;
  9689. esac
  9690. case :$dllsearchpath: in
  9691. *":$testbindir:"*) ;;
  9692. ::) dllsearchpath=$testbindir;;
  9693. *) func_append dllsearchpath ":$testbindir";;
  9694. esac
  9695. ;;
  9696. esac
  9697. done
  9698. # Substitute the hardcoded libdirs into the rpath.
  9699. if test -n "$hardcode_libdir_separator" &&
  9700. test -n "$hardcode_libdirs"; then
  9701. libdir=$hardcode_libdirs
  9702. eval rpath=\" $hardcode_libdir_flag_spec\"
  9703. fi
  9704. compile_rpath=$rpath
  9705. rpath=
  9706. hardcode_libdirs=
  9707. for libdir in $finalize_rpath; do
  9708. if test -n "$hardcode_libdir_flag_spec"; then
  9709. if test -n "$hardcode_libdir_separator"; then
  9710. if test -z "$hardcode_libdirs"; then
  9711. hardcode_libdirs=$libdir
  9712. else
  9713. # Just accumulate the unique libdirs.
  9714. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9715. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9716. ;;
  9717. *)
  9718. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9719. ;;
  9720. esac
  9721. fi
  9722. else
  9723. eval flag=\"$hardcode_libdir_flag_spec\"
  9724. func_append rpath " $flag"
  9725. fi
  9726. elif test -n "$runpath_var"; then
  9727. case "$finalize_perm_rpath " in
  9728. *" $libdir "*) ;;
  9729. *) func_append finalize_perm_rpath " $libdir" ;;
  9730. esac
  9731. fi
  9732. done
  9733. # Substitute the hardcoded libdirs into the rpath.
  9734. if test -n "$hardcode_libdir_separator" &&
  9735. test -n "$hardcode_libdirs"; then
  9736. libdir=$hardcode_libdirs
  9737. eval rpath=\" $hardcode_libdir_flag_spec\"
  9738. fi
  9739. finalize_rpath=$rpath
  9740. if test -n "$libobjs" && test yes = "$build_old_libs"; then
  9741. # Transform all the library objects into standard objects.
  9742. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9743. finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9744. fi
  9745. func_generate_dlsyms "$outputname" "@PROGRAM@" false
  9746. # template prelinking step
  9747. if test -n "$prelink_cmds"; then
  9748. func_execute_cmds "$prelink_cmds" 'exit $?'
  9749. fi
  9750. wrappers_required=:
  9751. case $host in
  9752. *cegcc* | *mingw32ce*)
  9753. # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
  9754. wrappers_required=false
  9755. ;;
  9756. *cygwin* | *mingw* )
  9757. test yes = "$build_libtool_libs" || wrappers_required=false
  9758. ;;
  9759. *)
  9760. if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
  9761. wrappers_required=false
  9762. fi
  9763. ;;
  9764. esac
  9765. $wrappers_required || {
  9766. # Replace the output file specification.
  9767. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9768. link_command=$compile_command$compile_rpath
  9769. # We have no uninstalled library dependencies, so finalize right now.
  9770. exit_status=0
  9771. func_show_eval "$link_command" 'exit_status=$?'
  9772. if test -n "$postlink_cmds"; then
  9773. func_to_tool_file "$output"
  9774. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9775. func_execute_cmds "$postlink_cmds" 'exit $?'
  9776. fi
  9777. # Delete the generated files.
  9778. if test -f "$output_objdir/${outputname}S.$objext"; then
  9779. func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
  9780. fi
  9781. exit $exit_status
  9782. }
  9783. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  9784. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  9785. fi
  9786. if test -n "$finalize_shlibpath"; then
  9787. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  9788. fi
  9789. compile_var=
  9790. finalize_var=
  9791. if test -n "$runpath_var"; then
  9792. if test -n "$perm_rpath"; then
  9793. # We should set the runpath_var.
  9794. rpath=
  9795. for dir in $perm_rpath; do
  9796. func_append rpath "$dir:"
  9797. done
  9798. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9799. fi
  9800. if test -n "$finalize_perm_rpath"; then
  9801. # We should set the runpath_var.
  9802. rpath=
  9803. for dir in $finalize_perm_rpath; do
  9804. func_append rpath "$dir:"
  9805. done
  9806. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9807. fi
  9808. fi
  9809. if test yes = "$no_install"; then
  9810. # We don't need to create a wrapper script.
  9811. link_command=$compile_var$compile_command$compile_rpath
  9812. # Replace the output file specification.
  9813. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9814. # Delete the old output file.
  9815. $opt_dry_run || $RM $output
  9816. # Link the executable and exit
  9817. func_show_eval "$link_command" 'exit $?'
  9818. if test -n "$postlink_cmds"; then
  9819. func_to_tool_file "$output"
  9820. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9821. func_execute_cmds "$postlink_cmds" 'exit $?'
  9822. fi
  9823. exit $EXIT_SUCCESS
  9824. fi
  9825. case $hardcode_action,$fast_install in
  9826. relink,*)
  9827. # Fast installation is not supported
  9828. link_command=$compile_var$compile_command$compile_rpath
  9829. relink_command=$finalize_var$finalize_command$finalize_rpath
  9830. func_warning "this platform does not like uninstalled shared libraries"
  9831. func_warning "'$output' will be relinked during installation"
  9832. ;;
  9833. *,yes)
  9834. link_command=$finalize_var$compile_command$finalize_rpath
  9835. relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
  9836. ;;
  9837. *,no)
  9838. link_command=$compile_var$compile_command$compile_rpath
  9839. relink_command=$finalize_var$finalize_command$finalize_rpath
  9840. ;;
  9841. *,needless)
  9842. link_command=$finalize_var$compile_command$finalize_rpath
  9843. relink_command=
  9844. ;;
  9845. esac
  9846. # Replace the output file specification.
  9847. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  9848. # Delete the old output files.
  9849. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  9850. func_show_eval "$link_command" 'exit $?'
  9851. if test -n "$postlink_cmds"; then
  9852. func_to_tool_file "$output_objdir/$outputname"
  9853. 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'`
  9854. func_execute_cmds "$postlink_cmds" 'exit $?'
  9855. fi
  9856. # Now create the wrapper script.
  9857. func_verbose "creating $output"
  9858. # Quote the relink command for shipping.
  9859. if test -n "$relink_command"; then
  9860. # Preserve any variables that may affect compiler behavior
  9861. for var in $variables_saved_for_relink; do
  9862. if eval test -z \"\${$var+set}\"; then
  9863. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  9864. elif eval var_value=\$$var; test -z "$var_value"; then
  9865. relink_command="$var=; export $var; $relink_command"
  9866. else
  9867. func_quote_arg pretty "$var_value"
  9868. relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
  9869. fi
  9870. done
  9871. func_quote eval cd "`pwd`"
  9872. func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
  9873. relink_command=$func_quote_arg_unquoted_result
  9874. fi
  9875. # Only actually do things if not in dry run mode.
  9876. $opt_dry_run || {
  9877. # win32 will think the script is a binary if it has
  9878. # a .exe suffix, so we strip it off here.
  9879. case $output in
  9880. *.exe) func_stripname '' '.exe' "$output"
  9881. output=$func_stripname_result ;;
  9882. esac
  9883. # test for cygwin because mv fails w/o .exe extensions
  9884. case $host in
  9885. *cygwin*)
  9886. exeext=.exe
  9887. func_stripname '' '.exe' "$outputname"
  9888. outputname=$func_stripname_result ;;
  9889. *) exeext= ;;
  9890. esac
  9891. case $host in
  9892. *cygwin* | *mingw* )
  9893. func_dirname_and_basename "$output" "" "."
  9894. output_name=$func_basename_result
  9895. output_path=$func_dirname_result
  9896. cwrappersource=$output_path/$objdir/lt-$output_name.c
  9897. cwrapper=$output_path/$output_name.exe
  9898. $RM $cwrappersource $cwrapper
  9899. trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  9900. func_emit_cwrapperexe_src > $cwrappersource
  9901. # The wrapper executable is built using the $host compiler,
  9902. # because it contains $host paths and files. If cross-
  9903. # compiling, it, like the target executable, must be
  9904. # executed on the $host or under an emulation environment.
  9905. $opt_dry_run || {
  9906. $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  9907. $STRIP $cwrapper
  9908. }
  9909. # Now, create the wrapper script for func_source use:
  9910. func_ltwrapper_scriptname $cwrapper
  9911. $RM $func_ltwrapper_scriptname_result
  9912. trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  9913. $opt_dry_run || {
  9914. # note: this script will not be executed, so do not chmod.
  9915. if test "x$build" = "x$host"; then
  9916. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  9917. else
  9918. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  9919. fi
  9920. }
  9921. ;;
  9922. * )
  9923. $RM $output
  9924. trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  9925. func_emit_wrapper no > $output
  9926. chmod +x $output
  9927. ;;
  9928. esac
  9929. }
  9930. exit $EXIT_SUCCESS
  9931. ;;
  9932. esac
  9933. # See if we need to build an old-fashioned archive.
  9934. for oldlib in $oldlibs; do
  9935. case $build_libtool_libs in
  9936. convenience)
  9937. oldobjs="$libobjs_save $symfileobj"
  9938. addlibs=$convenience
  9939. build_libtool_libs=no
  9940. ;;
  9941. module)
  9942. oldobjs=$libobjs_save
  9943. addlibs=$old_convenience
  9944. build_libtool_libs=no
  9945. ;;
  9946. *)
  9947. oldobjs="$old_deplibs $non_pic_objects"
  9948. $preload && test -f "$symfileobj" \
  9949. && func_append oldobjs " $symfileobj"
  9950. addlibs=$old_convenience
  9951. ;;
  9952. esac
  9953. if test -n "$addlibs"; then
  9954. gentop=$output_objdir/${outputname}x
  9955. func_append generated " $gentop"
  9956. func_extract_archives $gentop $addlibs
  9957. func_append oldobjs " $func_extract_archives_result"
  9958. fi
  9959. # Do each command in the archive commands.
  9960. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
  9961. cmds=$old_archive_from_new_cmds
  9962. else
  9963. # Add any objects from preloaded convenience libraries
  9964. if test -n "$dlprefiles"; then
  9965. gentop=$output_objdir/${outputname}x
  9966. func_append generated " $gentop"
  9967. func_extract_archives $gentop $dlprefiles
  9968. func_append oldobjs " $func_extract_archives_result"
  9969. fi
  9970. # POSIX demands no paths to be encoded in archives. We have
  9971. # to avoid creating archives with duplicate basenames if we
  9972. # might have to extract them afterwards, e.g., when creating a
  9973. # static archive out of a convenience library, or when linking
  9974. # the entirety of a libtool archive into another (currently
  9975. # not supported by libtool).
  9976. if (for obj in $oldobjs
  9977. do
  9978. func_basename "$obj"
  9979. $ECHO "$func_basename_result"
  9980. done | sort | sort -uc >/dev/null 2>&1); then
  9981. :
  9982. else
  9983. echo "copying selected object files to avoid basename conflicts..."
  9984. gentop=$output_objdir/${outputname}x
  9985. func_append generated " $gentop"
  9986. func_mkdir_p "$gentop"
  9987. save_oldobjs=$oldobjs
  9988. oldobjs=
  9989. counter=1
  9990. for obj in $save_oldobjs
  9991. do
  9992. func_basename "$obj"
  9993. objbase=$func_basename_result
  9994. case " $oldobjs " in
  9995. " ") oldobjs=$obj ;;
  9996. *[\ /]"$objbase "*)
  9997. while :; do
  9998. # Make sure we don't pick an alternate name that also
  9999. # overlaps.
  10000. newobj=lt$counter-$objbase
  10001. func_arith $counter + 1
  10002. counter=$func_arith_result
  10003. case " $oldobjs " in
  10004. *[\ /]"$newobj "*) ;;
  10005. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  10006. esac
  10007. done
  10008. func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  10009. func_append oldobjs " $gentop/$newobj"
  10010. ;;
  10011. *) func_append oldobjs " $obj" ;;
  10012. esac
  10013. done
  10014. fi
  10015. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  10016. tool_oldlib=$func_to_tool_file_result
  10017. eval cmds=\"$old_archive_cmds\"
  10018. func_len " $cmds"
  10019. len=$func_len_result
  10020. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  10021. cmds=$old_archive_cmds
  10022. elif test -n "$archiver_list_spec"; then
  10023. func_verbose "using command file archive linking..."
  10024. for obj in $oldobjs
  10025. do
  10026. func_to_tool_file "$obj"
  10027. $ECHO "$func_to_tool_file_result"
  10028. done > $output_objdir/$libname.libcmd
  10029. func_to_tool_file "$output_objdir/$libname.libcmd"
  10030. oldobjs=" $archiver_list_spec$func_to_tool_file_result"
  10031. cmds=$old_archive_cmds
  10032. else
  10033. # the command line is too long to link in one step, link in parts
  10034. func_verbose "using piecewise archive linking..."
  10035. save_RANLIB=$RANLIB
  10036. RANLIB=:
  10037. objlist=
  10038. concat_cmds=
  10039. save_oldobjs=$oldobjs
  10040. oldobjs=
  10041. # Is there a better way of finding the last object in the list?
  10042. for obj in $save_oldobjs
  10043. do
  10044. last_oldobj=$obj
  10045. done
  10046. eval test_cmds=\"$old_archive_cmds\"
  10047. func_len " $test_cmds"
  10048. len0=$func_len_result
  10049. len=$len0
  10050. for obj in $save_oldobjs
  10051. do
  10052. func_len " $obj"
  10053. func_arith $len + $func_len_result
  10054. len=$func_arith_result
  10055. func_append objlist " $obj"
  10056. if test "$len" -lt "$max_cmd_len"; then
  10057. :
  10058. else
  10059. # the above command should be used before it gets too long
  10060. oldobjs=$objlist
  10061. if test "$obj" = "$last_oldobj"; then
  10062. RANLIB=$save_RANLIB
  10063. fi
  10064. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  10065. eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
  10066. objlist=
  10067. len=$len0
  10068. fi
  10069. done
  10070. RANLIB=$save_RANLIB
  10071. oldobjs=$objlist
  10072. if test -z "$oldobjs"; then
  10073. eval cmds=\"\$concat_cmds\"
  10074. else
  10075. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  10076. fi
  10077. fi
  10078. fi
  10079. func_execute_cmds "$cmds" 'exit $?'
  10080. done
  10081. test -n "$generated" && \
  10082. func_show_eval "${RM}r$generated"
  10083. # Now create the libtool archive.
  10084. case $output in
  10085. *.la)
  10086. old_library=
  10087. test yes = "$build_old_libs" && old_library=$libname.$libext
  10088. func_verbose "creating $output"
  10089. # Preserve any variables that may affect compiler behavior
  10090. for var in $variables_saved_for_relink; do
  10091. if eval test -z \"\${$var+set}\"; then
  10092. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  10093. elif eval var_value=\$$var; test -z "$var_value"; then
  10094. relink_command="$var=; export $var; $relink_command"
  10095. else
  10096. func_quote_arg pretty,unquoted "$var_value"
  10097. relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
  10098. fi
  10099. done
  10100. # Quote the link command for shipping.
  10101. func_quote eval cd "`pwd`"
  10102. relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  10103. func_quote_arg pretty,unquoted "$relink_command"
  10104. relink_command=$func_quote_arg_unquoted_result
  10105. if test yes = "$hardcode_automatic"; then
  10106. relink_command=
  10107. fi
  10108. # Only create the output if not a dry run.
  10109. $opt_dry_run || {
  10110. for installed in no yes; do
  10111. if test yes = "$installed"; then
  10112. if test -z "$install_libdir"; then
  10113. break
  10114. fi
  10115. output=$output_objdir/${outputname}i
  10116. # Replace all uninstalled libtool libraries with the installed ones
  10117. newdependency_libs=
  10118. for deplib in $dependency_libs; do
  10119. case $deplib in
  10120. *.la)
  10121. func_basename "$deplib"
  10122. name=$func_basename_result
  10123. func_resolve_sysroot "$deplib"
  10124. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
  10125. test -z "$libdir" && \
  10126. func_fatal_error "'$deplib' is not a valid libtool archive"
  10127. func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
  10128. ;;
  10129. -L*)
  10130. func_stripname -L '' "$deplib"
  10131. func_replace_sysroot "$func_stripname_result"
  10132. func_append newdependency_libs " -L$func_replace_sysroot_result"
  10133. ;;
  10134. -R*)
  10135. func_stripname -R '' "$deplib"
  10136. func_replace_sysroot "$func_stripname_result"
  10137. func_append newdependency_libs " -R$func_replace_sysroot_result"
  10138. ;;
  10139. *) func_append newdependency_libs " $deplib" ;;
  10140. esac
  10141. done
  10142. dependency_libs=$newdependency_libs
  10143. newdlfiles=
  10144. for lib in $dlfiles; do
  10145. case $lib in
  10146. *.la)
  10147. func_basename "$lib"
  10148. name=$func_basename_result
  10149. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  10150. test -z "$libdir" && \
  10151. func_fatal_error "'$lib' is not a valid libtool archive"
  10152. func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
  10153. ;;
  10154. *) func_append newdlfiles " $lib" ;;
  10155. esac
  10156. done
  10157. dlfiles=$newdlfiles
  10158. newdlprefiles=
  10159. for lib in $dlprefiles; do
  10160. case $lib in
  10161. *.la)
  10162. # Only pass preopened files to the pseudo-archive (for
  10163. # eventual linking with the app. that links it) if we
  10164. # didn't already link the preopened objects directly into
  10165. # the library:
  10166. func_basename "$lib"
  10167. name=$func_basename_result
  10168. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  10169. test -z "$libdir" && \
  10170. func_fatal_error "'$lib' is not a valid libtool archive"
  10171. func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
  10172. ;;
  10173. esac
  10174. done
  10175. dlprefiles=$newdlprefiles
  10176. else
  10177. newdlfiles=
  10178. for lib in $dlfiles; do
  10179. case $lib in
  10180. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  10181. *) abs=`pwd`"/$lib" ;;
  10182. esac
  10183. func_append newdlfiles " $abs"
  10184. done
  10185. dlfiles=$newdlfiles
  10186. newdlprefiles=
  10187. for lib in $dlprefiles; do
  10188. case $lib in
  10189. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  10190. *) abs=`pwd`"/$lib" ;;
  10191. esac
  10192. func_append newdlprefiles " $abs"
  10193. done
  10194. dlprefiles=$newdlprefiles
  10195. fi
  10196. $RM $output
  10197. # place dlname in correct position for cygwin
  10198. # In fact, it would be nice if we could use this code for all target
  10199. # systems that can't hard-code library paths into their executables
  10200. # and that have no shared library path variable independent of PATH,
  10201. # but it turns out we can't easily determine that from inspecting
  10202. # libtool variables, so we have to hard-code the OSs to which it
  10203. # applies here; at the moment, that means platforms that use the PE
  10204. # object format with DLL files. See the long comment at the top of
  10205. # tests/bindir.at for full details.
  10206. tdlname=$dlname
  10207. case $host,$output,$installed,$module,$dlname in
  10208. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
  10209. # If a -bindir argument was supplied, place the dll there.
  10210. if test -n "$bindir"; then
  10211. func_relative_path "$install_libdir" "$bindir"
  10212. tdlname=$func_relative_path_result/$dlname
  10213. else
  10214. # Otherwise fall back on heuristic.
  10215. tdlname=../bin/$dlname
  10216. fi
  10217. ;;
  10218. esac
  10219. $ECHO > $output "\
  10220. # $outputname - a libtool library file
  10221. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  10222. #
  10223. # Please DO NOT delete this file!
  10224. # It is necessary for linking the library.
  10225. # The name that we can dlopen(3).
  10226. dlname='$tdlname'
  10227. # Names of this library.
  10228. library_names='$library_names'
  10229. # The name of the static archive.
  10230. old_library='$old_library'
  10231. # Linker flags that cannot go in dependency_libs.
  10232. inherited_linker_flags='$new_inherited_linker_flags'
  10233. # Libraries that this one depends upon.
  10234. dependency_libs='$dependency_libs'
  10235. # Names of additional weak libraries provided by this library
  10236. weak_library_names='$weak_libs'
  10237. # Version information for $libname.
  10238. current=$current
  10239. age=$age
  10240. revision=$revision
  10241. # Is this an already installed library?
  10242. installed=$installed
  10243. # Should we warn about portability when linking against -modules?
  10244. shouldnotlink=$module
  10245. # Files to dlopen/dlpreopen
  10246. dlopen='$dlfiles'
  10247. dlpreopen='$dlprefiles'
  10248. # Directory that this library needs to be installed in:
  10249. libdir='$install_libdir'"
  10250. if test no,yes = "$installed,$need_relink"; then
  10251. $ECHO >> $output "\
  10252. relink_command=\"$relink_command\""
  10253. fi
  10254. done
  10255. }
  10256. # Do a symbolic link so that the libtool archive can be found in
  10257. # LD_LIBRARY_PATH before the program is installed.
  10258. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  10259. ;;
  10260. esac
  10261. exit $EXIT_SUCCESS
  10262. }
  10263. if test link = "$opt_mode" || test relink = "$opt_mode"; then
  10264. func_mode_link ${1+"$@"}
  10265. fi
  10266. # func_mode_uninstall arg...
  10267. func_mode_uninstall ()
  10268. {
  10269. $debug_cmd
  10270. RM=$nonopt
  10271. files=
  10272. rmforce=false
  10273. exit_status=0
  10274. # This variable tells wrapper scripts just to set variables rather
  10275. # than running their programs.
  10276. libtool_install_magic=$magic
  10277. for arg
  10278. do
  10279. case $arg in
  10280. -f) func_append RM " $arg"; rmforce=: ;;
  10281. -*) func_append RM " $arg" ;;
  10282. *) func_append files " $arg" ;;
  10283. esac
  10284. done
  10285. test -z "$RM" && \
  10286. func_fatal_help "you must specify an RM program"
  10287. rmdirs=
  10288. for file in $files; do
  10289. func_dirname "$file" "" "."
  10290. dir=$func_dirname_result
  10291. if test . = "$dir"; then
  10292. odir=$objdir
  10293. else
  10294. odir=$dir/$objdir
  10295. fi
  10296. func_basename "$file"
  10297. name=$func_basename_result
  10298. test uninstall = "$opt_mode" && odir=$dir
  10299. # Remember odir for removal later, being careful to avoid duplicates
  10300. if test clean = "$opt_mode"; then
  10301. case " $rmdirs " in
  10302. *" $odir "*) ;;
  10303. *) func_append rmdirs " $odir" ;;
  10304. esac
  10305. fi
  10306. # Don't error if the file doesn't exist and rm -f was used.
  10307. if { test -L "$file"; } >/dev/null 2>&1 ||
  10308. { test -h "$file"; } >/dev/null 2>&1 ||
  10309. test -f "$file"; then
  10310. :
  10311. elif test -d "$file"; then
  10312. exit_status=1
  10313. continue
  10314. elif $rmforce; then
  10315. continue
  10316. fi
  10317. rmfiles=$file
  10318. case $name in
  10319. *.la)
  10320. # Possibly a libtool archive, so verify it.
  10321. if func_lalib_p "$file"; then
  10322. func_source $dir/$name
  10323. # Delete the libtool libraries and symlinks.
  10324. for n in $library_names; do
  10325. func_append rmfiles " $odir/$n"
  10326. done
  10327. test -n "$old_library" && func_append rmfiles " $odir/$old_library"
  10328. case $opt_mode in
  10329. clean)
  10330. case " $library_names " in
  10331. *" $dlname "*) ;;
  10332. *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
  10333. esac
  10334. test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
  10335. ;;
  10336. uninstall)
  10337. if test -n "$library_names"; then
  10338. # Do each command in the postuninstall commands.
  10339. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
  10340. fi
  10341. if test -n "$old_library"; then
  10342. # Do each command in the old_postuninstall commands.
  10343. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
  10344. fi
  10345. # FIXME: should reinstall the best remaining shared library.
  10346. ;;
  10347. esac
  10348. fi
  10349. ;;
  10350. *.lo)
  10351. # Possibly a libtool object, so verify it.
  10352. if func_lalib_p "$file"; then
  10353. # Read the .lo file
  10354. func_source $dir/$name
  10355. # Add PIC object to the list of files to remove.
  10356. if test -n "$pic_object" && test none != "$pic_object"; then
  10357. func_append rmfiles " $dir/$pic_object"
  10358. fi
  10359. # Add non-PIC object to the list of files to remove.
  10360. if test -n "$non_pic_object" && test none != "$non_pic_object"; then
  10361. func_append rmfiles " $dir/$non_pic_object"
  10362. fi
  10363. fi
  10364. ;;
  10365. *)
  10366. if test clean = "$opt_mode"; then
  10367. noexename=$name
  10368. case $file in
  10369. *.exe)
  10370. func_stripname '' '.exe' "$file"
  10371. file=$func_stripname_result
  10372. func_stripname '' '.exe' "$name"
  10373. noexename=$func_stripname_result
  10374. # $file with .exe has already been added to rmfiles,
  10375. # add $file without .exe
  10376. func_append rmfiles " $file"
  10377. ;;
  10378. esac
  10379. # Do a test to see if this is a libtool program.
  10380. if func_ltwrapper_p "$file"; then
  10381. if func_ltwrapper_executable_p "$file"; then
  10382. func_ltwrapper_scriptname "$file"
  10383. relink_command=
  10384. func_source $func_ltwrapper_scriptname_result
  10385. func_append rmfiles " $func_ltwrapper_scriptname_result"
  10386. else
  10387. relink_command=
  10388. func_source $dir/$noexename
  10389. fi
  10390. # note $name still contains .exe if it was in $file originally
  10391. # as does the version of $file that was added into $rmfiles
  10392. func_append rmfiles " $odir/$name $odir/${name}S.$objext"
  10393. if test yes = "$fast_install" && test -n "$relink_command"; then
  10394. func_append rmfiles " $odir/lt-$name"
  10395. fi
  10396. if test "X$noexename" != "X$name"; then
  10397. func_append rmfiles " $odir/lt-$noexename.c"
  10398. fi
  10399. fi
  10400. fi
  10401. ;;
  10402. esac
  10403. func_show_eval "$RM $rmfiles" 'exit_status=1'
  10404. done
  10405. # Try to remove the $objdir's in the directories where we deleted files
  10406. for dir in $rmdirs; do
  10407. if test -d "$dir"; then
  10408. func_show_eval "rmdir $dir >/dev/null 2>&1"
  10409. fi
  10410. done
  10411. exit $exit_status
  10412. }
  10413. if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
  10414. func_mode_uninstall ${1+"$@"}
  10415. fi
  10416. test -z "$opt_mode" && {
  10417. help=$generic_help
  10418. func_fatal_help "you must specify a MODE"
  10419. }
  10420. test -z "$exec_cmd" && \
  10421. func_fatal_help "invalid operation mode '$opt_mode'"
  10422. if test -n "$exec_cmd"; then
  10423. eval exec "$exec_cmd"
  10424. exit $EXIT_FAILURE
  10425. fi
  10426. exit $exit_status
  10427. # The TAGs below are defined such that we never get into a situation
  10428. # where we disable both kinds of libraries. Given conflicting
  10429. # choices, we go for a static library, that is the most portable,
  10430. # since we can't tell whether shared libraries were disabled because
  10431. # the user asked for that or because the platform doesn't support
  10432. # them. This is particularly important on AIX, because we don't
  10433. # support having both static and shared libraries enabled at the same
  10434. # time on that platform, so we default to a shared-only configuration.
  10435. # If a disable-shared tag is given, we'll fallback to a static-only
  10436. # configuration. But we'll never go from static-only to shared-only.
  10437. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  10438. build_libtool_libs=no
  10439. build_old_libs=yes
  10440. # ### END LIBTOOL TAG CONFIG: disable-shared
  10441. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  10442. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  10443. # ### END LIBTOOL TAG CONFIG: disable-static
  10444. # Local Variables:
  10445. # mode:shell-script
  10446. # sh-indentation:2
  10447. # End: