libtool 349 KB

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