libtool 343 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006
  1. #! /bin/sh
  2. # Generated automatically by config.status (gperftools) 2.7
  3. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  4. # Provide generalized library-building support services.
  5. # Written by Gordon Matzigkeit, 1996
  6. # Copyright (C) 2014 Free Software Foundation, Inc.
  7. # This is free software; see the source for copying conditions. There is NO
  8. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # GNU Libtool is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of of the License, or
  12. # (at your option) any later version.
  13. #
  14. # As a special exception to the GNU General Public License, if you
  15. # distribute this file as part of a program or library that is built
  16. # using GNU Libtool, you may include this file under the same
  17. # distribution terms that you use for the rest of that program.
  18. #
  19. # GNU Libtool is distributed in the hope that it will be useful, but
  20. # WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. # GNU General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU General Public License
  25. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. # The names of the tagged configurations supported by this script.
  27. available_tags='CXX '
  28. # Configured defaults for sys_lib_dlsearch_path munging.
  29. : ${LT_SYS_LIBRARY_PATH=""}
  30. # ### BEGIN LIBTOOL CONFIG
  31. # Which release of libtool.m4 was used?
  32. macro_version=2.4.6
  33. macro_revision=2.4.6
  34. # Whether or not to build shared libraries.
  35. build_libtool_libs=yes
  36. # Whether or not to build static libraries.
  37. build_old_libs=yes
  38. # What type of objects to build.
  39. pic_mode=default
  40. # Whether or not to optimize for fast installation.
  41. fast_install=needless
  42. # Shared archive member basename,for filename based shared library versioning on AIX.
  43. shared_archive_member_spec=
  44. # Shell to use when invoking shell scripts.
  45. SHELL="/bin/sh"
  46. # An echo program that protects backslashes.
  47. ECHO="printf %s\\n"
  48. # The PATH separator for the build system.
  49. PATH_SEPARATOR=":"
  50. # The host system.
  51. host_alias=
  52. host=x86_64-pc-linux-gnu
  53. host_os=linux-gnu
  54. # The build system.
  55. build_alias=
  56. build=x86_64-pc-linux-gnu
  57. build_os=linux-gnu
  58. # A sed program that does not truncate output.
  59. SED="/bin/sed"
  60. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  61. Xsed="$SED -e 1s/^X//"
  62. # A grep program that handles long lines.
  63. GREP="/bin/grep"
  64. # An ERE matcher.
  65. EGREP="/bin/grep -E"
  66. # A literal string matcher.
  67. FGREP="/bin/grep -F"
  68. # A BSD- or MS-compatible name lister.
  69. NM="/usr/bin/nm -B"
  70. # Whether we need soft or hard links.
  71. LN_S="ln -s"
  72. # What is the maximum length of a command?
  73. max_cmd_len=1572864
  74. # Object file suffix (normally "o").
  75. objext=o
  76. # Executable file suffix (normally "").
  77. exeext=
  78. # whether the shell understands "unset".
  79. lt_unset=unset
  80. # turn spaces into newlines.
  81. SP2NL="tr \\040 \\012"
  82. # turn newlines into spaces.
  83. NL2SP="tr \\015\\012 \\040\\040"
  84. # convert $build file names to $host format.
  85. to_host_file_cmd=func_convert_file_noop
  86. # convert $build files to toolchain format.
  87. to_tool_file_cmd=func_convert_file_noop
  88. # An object symbol dumper.
  89. OBJDUMP="objdump"
  90. # Method to check whether dependent libraries are shared objects.
  91. deplibs_check_method="pass_all"
  92. # Command to use when deplibs_check_method = "file_magic".
  93. file_magic_cmd="\$MAGIC_CMD"
  94. # How to find potential files when deplibs_check_method = "file_magic".
  95. file_magic_glob=""
  96. # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
  97. want_nocaseglob="no"
  98. # DLL creation program.
  99. DLLTOOL="false"
  100. # Command to associate shared and link libraries.
  101. sharedlib_from_linklib_cmd="printf %s\\n"
  102. # The archiver.
  103. AR="ar"
  104. # Flags to create an archive.
  105. AR_FLAGS="cru"
  106. # How to feed a file listing to the archiver.
  107. archiver_list_spec="@"
  108. # A symbol stripping program.
  109. STRIP="strip"
  110. # Commands used to install an old-style archive.
  111. RANLIB="ranlib"
  112. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
  113. old_postuninstall_cmds=""
  114. # Whether to use a lock for old archive extraction.
  115. lock_old_archive_extraction=no
  116. # A C compiler.
  117. LTCC="gcc"
  118. # LTCC compiler flags.
  119. LTCFLAGS="-g -O2"
  120. # Take the output of nm and produce a listing of raw symbols and C names.
  121. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
  122. # Transform the output of nm in a proper C declaration.
  123. global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
  124. # Transform the output of nm into a list of symbols to manually relocate.
  125. global_symbol_to_import=""
  126. # Transform the output of nm in a C name address pair.
  127. global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/ {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p'"
  128. # Transform the output of nm in a C name address pair when lib prefix is needed.
  129. 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'"
  130. # The name lister interface.
  131. nm_interface="BSD nm"
  132. # Specify filename containing input files for $NM.
  133. nm_file_list_spec="@"
  134. # The root where to search for dependent libraries,and where our libraries should be installed.
  135. lt_sysroot=
  136. # Command to truncate a binary pipe.
  137. lt_truncate_bin="/bin/dd bs=4096 count=1"
  138. # The name of the directory that contains temporary libtool files.
  139. objdir=.libs
  140. # Used to examine libraries when file_magic_cmd begins with "file".
  141. MAGIC_CMD=file
  142. # Must we lock files when doing compilation?
  143. need_locks="no"
  144. # Manifest tool.
  145. MANIFEST_TOOL=":"
  146. # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
  147. DSYMUTIL=""
  148. # Tool to change global to local symbols on Mac OS X.
  149. NMEDIT=""
  150. # Tool to manipulate fat objects and archives on Mac OS X.
  151. LIPO=""
  152. # ldd/readelf like tool for Mach-O binaries on Mac OS X.
  153. OTOOL=""
  154. # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
  155. OTOOL64=""
  156. # Old archive suffix (normally "a").
  157. libext=a
  158. # Shared library suffix (normally ".so").
  159. shrext_cmds=".so"
  160. # The commands to extract the exported symbol list from a shared archive.
  161. extract_expsyms_cmds=""
  162. # Variables whose values should be saved in libtool wrapper scripts and
  163. # restored at link time.
  164. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  165. # Do we need the "lib" prefix for modules?
  166. need_lib_prefix=no
  167. # Do we need a version for libraries?
  168. need_version=no
  169. # Library versioning type.
  170. version_type=linux
  171. # Shared library runtime path variable.
  172. runpath_var=LD_RUN_PATH
  173. # Shared library path variable.
  174. shlibpath_var=LD_LIBRARY_PATH
  175. # Is shlibpath searched before the hard-coded library search path?
  176. shlibpath_overrides_runpath=yes
  177. # Format of library name prefix.
  178. libname_spec="lib\$name"
  179. # List of archive names. First name is the real one, the rest are links.
  180. # The last name is the one that the linker finds with -lNAME
  181. library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
  182. # The coded name of the library, if different from the real name.
  183. soname_spec="\$libname\$release\$shared_ext\$major"
  184. # Permission mode override for installation of shared libraries.
  185. install_override_mode=""
  186. # Command to use after installation of a shared archive.
  187. postinstall_cmds=""
  188. # Command to use after uninstallation of a shared archive.
  189. postuninstall_cmds=""
  190. # Commands used to finish a libtool library installation in a directory.
  191. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  192. # As "finish_cmds", except a single script fragment to be evaled but
  193. # not shown.
  194. finish_eval=""
  195. # Whether we should hardcode library paths into libraries.
  196. hardcode_into_libs=yes
  197. # Compile-time system search path for libraries.
  198. sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/7 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "
  199. # Detected run-time system search path for libraries.
  200. sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib/i386-linux-gnu /lib/i386-linux-gnu /usr/lib/i386-linux-gnu /usr/local/lib/i686-linux-gnu /lib/i686-linux-gnu /usr/lib/i686-linux-gnu /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 /libx32 /usr/libx32 "
  201. # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
  202. configure_time_lt_sys_library_path=""
  203. # Whether dlopen is supported.
  204. dlopen_support=unknown
  205. # Whether dlopen of programs is supported.
  206. dlopen_self=unknown
  207. # Whether dlopen of statically linked programs is supported.
  208. dlopen_self_static=unknown
  209. # Commands to strip libraries.
  210. old_striplib="strip --strip-debug"
  211. striplib="strip --strip-unneeded"
  212. # The linker used to build libraries.
  213. LD="/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64"
  214. # How to create reloadable object files.
  215. reload_flag=" -r"
  216. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  217. # Commands used to build an old-style archive.
  218. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  219. # A language specific compiler.
  220. CC="gcc"
  221. # Is the compiler the GNU compiler?
  222. with_gcc=yes
  223. # Compiler flag to turn off builtin functions.
  224. no_builtin_flag=" -fno-builtin"
  225. # Additional compiler flags for building library objects.
  226. pic_flag=" -fPIC -DPIC"
  227. # How to pass a linker flag through the compiler.
  228. wl="-Wl,"
  229. # Compiler flag to prevent dynamic linking.
  230. link_static_flag="-static"
  231. # Does compiler simultaneously support -c and -o options?
  232. compiler_c_o="yes"
  233. # Whether or not to add -lc for building shared libraries.
  234. build_libtool_need_lc=no
  235. # Whether or not to disallow shared libs when runtime libs are static.
  236. allow_libtool_libs_with_static_runtimes=no
  237. # Compiler flag to allow reflexive dlopens.
  238. export_dynamic_flag_spec="\$wl--export-dynamic"
  239. # Compiler flag to generate shared objects directly from archives.
  240. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  241. # Whether the compiler copes with passing no objects directly.
  242. compiler_needs_object="no"
  243. # Create an old-style archive from a shared archive.
  244. old_archive_from_new_cmds=""
  245. # Create a temporary old-style archive to link instead of a shared archive.
  246. old_archive_from_expsyms_cmds=""
  247. # Commands used to build a shared archive.
  248. archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  249. archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  250. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  251. echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  252. \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
  253. # Commands used to build a loadable module if different from building
  254. # a shared archive.
  255. module_cmds=""
  256. module_expsym_cmds=""
  257. # Whether we are building with GNU ld or not.
  258. with_gnu_ld="yes"
  259. # Flag that allows shared libraries with undefined symbols to be built.
  260. allow_undefined_flag=""
  261. # Flag that enforces no undefined symbols.
  262. no_undefined_flag=""
  263. # Flag to hardcode $libdir into a binary during linking.
  264. # This must work even if $libdir does not exist
  265. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  266. # Whether we need a single "-rpath" flag with a separated argument.
  267. hardcode_libdir_separator=""
  268. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  269. # DIR into the resulting binary.
  270. hardcode_direct=no
  271. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  272. # DIR into the resulting binary and the resulting library dependency is
  273. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  274. # library is relocated.
  275. hardcode_direct_absolute=no
  276. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  277. # into the resulting binary.
  278. hardcode_minus_L=no
  279. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  280. # into the resulting binary.
  281. hardcode_shlibpath_var=unsupported
  282. # Set to "yes" if building a shared library automatically hardcodes DIR
  283. # into the library and all subsequent libraries and executables linked
  284. # against it.
  285. hardcode_automatic=no
  286. # Set to yes if linker adds runtime paths of dependent libraries
  287. # to runtime path list.
  288. inherit_rpath=no
  289. # Whether libtool must link a program against all its dependency libraries.
  290. link_all_deplibs=no
  291. # Set to "yes" if exported symbols are required.
  292. always_export_symbols=no
  293. # The commands to list exported symbols.
  294. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  295. # Symbols that should not be listed in the preloaded symbols.
  296. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  297. # Symbols that must always be exported.
  298. include_expsyms=""
  299. # Commands necessary for linking programs (against libraries) with templates.
  300. prelink_cmds=""
  301. # Commands necessary for finishing linking programs.
  302. postlink_cmds=""
  303. # Specify filename containing input files.
  304. file_list_spec=""
  305. # How to hardcode a shared library path into an executable.
  306. hardcode_action=immediate
  307. # The directories searched by this compiler when creating a shared library.
  308. compiler_lib_search_dirs=""
  309. # Dependencies to place before and after the objects being linked to
  310. # create a shared library.
  311. predep_objects=""
  312. postdep_objects=""
  313. predeps=""
  314. postdeps=""
  315. # The library search path used internally by the compiler when linking
  316. # a shared library.
  317. compiler_lib_search_path=""
  318. # ### END LIBTOOL CONFIG
  319. # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
  320. # func_munge_path_list VARIABLE PATH
  321. # -----------------------------------
  322. # VARIABLE is name of variable containing _space_ separated list of
  323. # directories to be munged by the contents of PATH, which is string
  324. # having a format:
  325. # "DIR[:DIR]:"
  326. # string "DIR[ DIR]" will be prepended to VARIABLE
  327. # ":DIR[:DIR]"
  328. # string "DIR[ DIR]" will be appended to VARIABLE
  329. # "DIRP[:DIRP]::[DIRA:]DIRA"
  330. # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
  331. # "DIRA[ DIRA]" will be appended to VARIABLE
  332. # "DIR[:DIR]"
  333. # VARIABLE will be replaced by "DIR[ DIR]"
  334. func_munge_path_list ()
  335. {
  336. case x$2 in
  337. x)
  338. ;;
  339. *:)
  340. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
  341. ;;
  342. x:*)
  343. eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
  344. ;;
  345. *::*)
  346. eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
  347. eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
  348. ;;
  349. *)
  350. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
  351. ;;
  352. esac
  353. }
  354. # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
  355. func_cc_basename ()
  356. {
  357. for cc_temp in $*""; do
  358. case $cc_temp in
  359. compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
  360. distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
  361. \-*) ;;
  362. *) break;;
  363. esac
  364. done
  365. func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
  366. }
  367. # ### END FUNCTIONS SHARED WITH CONFIGURE
  368. #! /bin/sh
  369. ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
  370. ## by inline-source v2014-01-03.01
  371. # libtool (GNU libtool) 2.4.6
  372. # Provide generalized library-building support services.
  373. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  374. # Copyright (C) 1996-2015 Free Software Foundation, Inc.
  375. # This is free software; see the source for copying conditions. There is NO
  376. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  377. # GNU Libtool is free software; you can redistribute it and/or modify
  378. # it under the terms of the GNU General Public License as published by
  379. # the Free Software Foundation; either version 2 of the License, or
  380. # (at your option) any later version.
  381. #
  382. # As a special exception to the GNU General Public License,
  383. # if you distribute this file as part of a program or library that
  384. # is built using GNU Libtool, you may include this file under the
  385. # same distribution terms that you use for the rest of that program.
  386. #
  387. # GNU Libtool is distributed in the hope that it will be useful, but
  388. # WITHOUT ANY WARRANTY; without even the implied warranty of
  389. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  390. # General Public License for more details.
  391. #
  392. # You should have received a copy of the GNU General Public License
  393. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  394. PROGRAM=libtool
  395. PACKAGE=libtool
  396. VERSION="2.4.6 Debian-2.4.6-2.1"
  397. package_revision=2.4.6
  398. ## ------ ##
  399. ## Usage. ##
  400. ## ------ ##
  401. # Run './libtool --help' for help with using this script from the
  402. # command line.
  403. ## ------------------------------- ##
  404. ## User overridable command paths. ##
  405. ## ------------------------------- ##
  406. # After configure completes, it has a better idea of some of the
  407. # shell tools we need than the defaults used by the functions shared
  408. # with bootstrap, so set those here where they can still be over-
  409. # ridden by the user, but otherwise take precedence.
  410. : ${AUTOCONF="autoconf"}
  411. : ${AUTOMAKE="automake"}
  412. ## -------------------------- ##
  413. ## Source external libraries. ##
  414. ## -------------------------- ##
  415. # Much of our low-level functionality needs to be sourced from external
  416. # libraries, which are installed to $pkgauxdir.
  417. # Set a version string for this script.
  418. scriptversion=2015-10-12.13; # UTC
  419. # General shell script boiler plate, and helper functions.
  420. # Written by Gary V. Vaughan, 2004
  421. # Copyright (C) 2004-2015 Free Software Foundation, Inc.
  422. # This is free software; see the source for copying conditions. There is NO
  423. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  424. # This program is free software; you can redistribute it and/or modify
  425. # it under the terms of the GNU General Public License as published by
  426. # the Free Software Foundation; either version 3 of the License, or
  427. # (at your option) any later version.
  428. # As a special exception to the GNU General Public License, if you distribute
  429. # this file as part of a program or library that is built using GNU Libtool,
  430. # you may include this file under the same distribution terms that you use
  431. # for the rest of that program.
  432. # This program is distributed in the hope that it will be useful,
  433. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  434. # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
  435. # General Public License for more details.
  436. # You should have received a copy of the GNU General Public License
  437. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  438. # Please report bugs or propose patches to gary@gnu.org.
  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. # CDPATH.
  479. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  480. # Make sure IFS has a sensible default
  481. sp=' '
  482. nl='
  483. '
  484. IFS="$sp $nl"
  485. # There are apparently some retarded systems that use ';' as a PATH separator!
  486. if test "${PATH_SEPARATOR+set}" != set; then
  487. PATH_SEPARATOR=:
  488. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
  489. (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
  490. PATH_SEPARATOR=';'
  491. }
  492. fi
  493. ## ------------------------- ##
  494. ## Locate command utilities. ##
  495. ## ------------------------- ##
  496. # func_executable_p FILE
  497. # ----------------------
  498. # Check that FILE is an executable regular file.
  499. func_executable_p ()
  500. {
  501. test -f "$1" && test -x "$1"
  502. }
  503. # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
  504. # --------------------------------------------
  505. # Search for either a program that responds to --version with output
  506. # containing "GNU", or else returned by CHECK_FUNC otherwise, by
  507. # trying all the directories in PATH with each of the elements of
  508. # PROGS_LIST.
  509. #
  510. # CHECK_FUNC should accept the path to a candidate program, and
  511. # set $func_check_prog_result if it truncates its output less than
  512. # $_G_path_prog_max characters.
  513. func_path_progs ()
  514. {
  515. _G_progs_list=$1
  516. _G_check_func=$2
  517. _G_PATH=${3-"$PATH"}
  518. _G_path_prog_max=0
  519. _G_path_prog_found=false
  520. _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
  521. for _G_dir in $_G_PATH; do
  522. IFS=$_G_save_IFS
  523. test -z "$_G_dir" && _G_dir=.
  524. for _G_prog_name in $_G_progs_list; do
  525. for _exeext in '' .EXE; do
  526. _G_path_prog=$_G_dir/$_G_prog_name$_exeext
  527. func_executable_p "$_G_path_prog" || continue
  528. case `"$_G_path_prog" --version 2>&1` in
  529. *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
  530. *) $_G_check_func $_G_path_prog
  531. func_path_progs_result=$func_check_prog_result
  532. ;;
  533. esac
  534. $_G_path_prog_found && break 3
  535. done
  536. done
  537. done
  538. IFS=$_G_save_IFS
  539. test -z "$func_path_progs_result" && {
  540. echo "no acceptable sed could be found in \$PATH" >&2
  541. exit 1
  542. }
  543. }
  544. # We want to be able to use the functions in this file before configure
  545. # has figured out where the best binaries are kept, which means we have
  546. # to search for them ourselves - except when the results are already set
  547. # where we skip the searches.
  548. # Unless the user overrides by setting SED, search the path for either GNU
  549. # sed, or the sed that truncates its output the least.
  550. test -z "$SED" && {
  551. _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
  552. for _G_i in 1 2 3 4 5 6 7; do
  553. _G_sed_script=$_G_sed_script$nl$_G_sed_script
  554. done
  555. echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
  556. _G_sed_script=
  557. func_check_prog_sed ()
  558. {
  559. _G_path_prog=$1
  560. _G_count=0
  561. printf 0123456789 >conftest.in
  562. while :
  563. do
  564. cat conftest.in conftest.in >conftest.tmp
  565. mv conftest.tmp conftest.in
  566. cp conftest.in conftest.nl
  567. echo '' >> conftest.nl
  568. "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
  569. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  570. _G_count=`expr $_G_count + 1`
  571. if test "$_G_count" -gt "$_G_path_prog_max"; then
  572. # Best one so far, save it but keep looking for a better one
  573. func_check_prog_result=$_G_path_prog
  574. _G_path_prog_max=$_G_count
  575. fi
  576. # 10*(2^10) chars as input seems more than enough
  577. test 10 -lt "$_G_count" && break
  578. done
  579. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  580. }
  581. func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
  582. rm -f conftest.sed
  583. SED=$func_path_progs_result
  584. }
  585. # Unless the user overrides by setting GREP, search the path for either GNU
  586. # grep, or the grep that truncates its output the least.
  587. test -z "$GREP" && {
  588. func_check_prog_grep ()
  589. {
  590. _G_path_prog=$1
  591. _G_count=0
  592. _G_path_prog_max=0
  593. printf 0123456789 >conftest.in
  594. while :
  595. do
  596. cat conftest.in conftest.in >conftest.tmp
  597. mv conftest.tmp conftest.in
  598. cp conftest.in conftest.nl
  599. echo 'GREP' >> conftest.nl
  600. "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
  601. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  602. _G_count=`expr $_G_count + 1`
  603. if test "$_G_count" -gt "$_G_path_prog_max"; then
  604. # Best one so far, save it but keep looking for a better one
  605. func_check_prog_result=$_G_path_prog
  606. _G_path_prog_max=$_G_count
  607. fi
  608. # 10*(2^10) chars as input seems more than enough
  609. test 10 -lt "$_G_count" && break
  610. done
  611. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  612. }
  613. func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
  614. GREP=$func_path_progs_result
  615. }
  616. ## ------------------------------- ##
  617. ## User overridable command paths. ##
  618. ## ------------------------------- ##
  619. # All uppercase variable names are used for environment variables. These
  620. # variables can be overridden by the user before calling a script that
  621. # uses them if a suitable command of that name is not already available
  622. # in the command search PATH.
  623. : ${CP="cp -f"}
  624. : ${ECHO="printf %s\n"}
  625. : ${EGREP="$GREP -E"}
  626. : ${FGREP="$GREP -F"}
  627. : ${LN_S="ln -s"}
  628. : ${MAKE="make"}
  629. : ${MKDIR="mkdir"}
  630. : ${MV="mv -f"}
  631. : ${RM="rm -f"}
  632. : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  633. ## -------------------- ##
  634. ## Useful sed snippets. ##
  635. ## -------------------- ##
  636. sed_dirname='s|/[^/]*$||'
  637. sed_basename='s|^.*/||'
  638. # Sed substitution that helps us do robust quoting. It backslashifies
  639. # metacharacters that are still active within double-quoted strings.
  640. sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
  641. # Same as above, but do not quote variable references.
  642. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
  643. # Sed substitution that turns a string into a regex matching for the
  644. # string literally.
  645. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
  646. # Sed substitution that converts a w32 file name or path
  647. # that contains forward slashes, into one that contains
  648. # (escaped) backslashes. A very naive implementation.
  649. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  650. # Re-'\' parameter expansions in output of sed_double_quote_subst that
  651. # were '\'-ed in input to the same. If an odd number of '\' preceded a
  652. # '$' in input to sed_double_quote_subst, that '$' was protected from
  653. # expansion. Since each input '\' is now two '\'s, look for any number
  654. # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
  655. _G_bs='\\'
  656. _G_bs2='\\\\'
  657. _G_bs4='\\\\\\\\'
  658. _G_dollar='\$'
  659. sed_double_backslash="\
  660. s/$_G_bs4/&\\
  661. /g
  662. s/^$_G_bs2$_G_dollar/$_G_bs&/
  663. s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
  664. s/\n//g"
  665. ## ----------------- ##
  666. ## Global variables. ##
  667. ## ----------------- ##
  668. # Except for the global variables explicitly listed below, the following
  669. # functions in the '^func_' namespace, and the '^require_' namespace
  670. # variables initialised in the 'Resource management' section, sourcing
  671. # this file will not pollute your global namespace with anything
  672. # else. There's no portable way to scope variables in Bourne shell
  673. # though, so actually running these functions will sometimes place
  674. # results into a variable named after the function, and often use
  675. # temporary variables in the '^_G_' namespace. If you are careful to
  676. # avoid using those namespaces casually in your sourcing script, things
  677. # should continue to work as you expect. And, of course, you can freely
  678. # overwrite any of the functions or variables defined here before
  679. # calling anything to customize them.
  680. EXIT_SUCCESS=0
  681. EXIT_FAILURE=1
  682. EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  683. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  684. # Allow overriding, eg assuming that you follow the convention of
  685. # putting '$debug_cmd' at the start of all your functions, you can get
  686. # bash to show function call trace with:
  687. #
  688. # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
  689. debug_cmd=${debug_cmd-":"}
  690. exit_cmd=:
  691. # By convention, finish your script with:
  692. #
  693. # exit $exit_status
  694. #
  695. # so that you can set exit_status to non-zero if you want to indicate
  696. # something went wrong during execution without actually bailing out at
  697. # the point of failure.
  698. exit_status=$EXIT_SUCCESS
  699. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  700. # is ksh but when the shell is invoked as "sh" and the current value of
  701. # the _XPG environment variable is not equal to 1 (one), the special
  702. # positional parameter $0, within a function call, is the name of the
  703. # function.
  704. progpath=$0
  705. # The name of this program.
  706. progname=`$ECHO "$progpath" |$SED "$sed_basename"`
  707. # Make sure we have an absolute progpath for reexecution:
  708. case $progpath in
  709. [\\/]*|[A-Za-z]:\\*) ;;
  710. *[\\/]*)
  711. progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
  712. progdir=`cd "$progdir" && pwd`
  713. progpath=$progdir/$progname
  714. ;;
  715. *)
  716. _G_IFS=$IFS
  717. IFS=${PATH_SEPARATOR-:}
  718. for progdir in $PATH; do
  719. IFS=$_G_IFS
  720. test -x "$progdir/$progname" && break
  721. done
  722. IFS=$_G_IFS
  723. test -n "$progdir" || progdir=`pwd`
  724. progpath=$progdir/$progname
  725. ;;
  726. esac
  727. ## ----------------- ##
  728. ## Standard options. ##
  729. ## ----------------- ##
  730. # The following options affect the operation of the functions defined
  731. # below, and should be set appropriately depending on run-time para-
  732. # meters passed on the command line.
  733. opt_dry_run=false
  734. opt_quiet=false
  735. opt_verbose=false
  736. # Categories 'all' and 'none' are always available. Append any others
  737. # you will pass as the first argument to func_warning from your own
  738. # code.
  739. warning_categories=
  740. # By default, display warnings according to 'opt_warning_types'. Set
  741. # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
  742. # treat the next displayed warning as a fatal error.
  743. warning_func=func_warn_and_continue
  744. # Set to 'all' to display all warnings, 'none' to suppress all
  745. # warnings, or a space delimited list of some subset of
  746. # 'warning_categories' to display only the listed warnings.
  747. opt_warning_types=all
  748. ## -------------------- ##
  749. ## Resource management. ##
  750. ## -------------------- ##
  751. # This section contains definitions for functions that each ensure a
  752. # particular resource (a file, or a non-empty configuration variable for
  753. # example) is available, and if appropriate to extract default values
  754. # from pertinent package files. Call them using their associated
  755. # 'require_*' variable to ensure that they are executed, at most, once.
  756. #
  757. # It's entirely deliberate that calling these functions can set
  758. # variables that don't obey the namespace limitations obeyed by the rest
  759. # of this file, in order that that they be as useful as possible to
  760. # callers.
  761. # require_term_colors
  762. # -------------------
  763. # Allow display of bold text on terminals that support it.
  764. require_term_colors=func_require_term_colors
  765. func_require_term_colors ()
  766. {
  767. $debug_cmd
  768. test -t 1 && {
  769. # COLORTERM and USE_ANSI_COLORS environment variables take
  770. # precedence, because most terminfo databases neglect to describe
  771. # whether color sequences are supported.
  772. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
  773. if test 1 = "$USE_ANSI_COLORS"; then
  774. # Standard ANSI escape sequences
  775. tc_reset=''
  776. tc_bold=''; tc_standout=''
  777. tc_red=''; tc_green=''
  778. tc_blue=''; tc_cyan=''
  779. else
  780. # Otherwise trust the terminfo database after all.
  781. test -n "`tput sgr0 2>/dev/null`" && {
  782. tc_reset=`tput sgr0`
  783. test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
  784. tc_standout=$tc_bold
  785. test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
  786. test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
  787. test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
  788. test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
  789. test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
  790. }
  791. fi
  792. }
  793. require_term_colors=:
  794. }
  795. ## ----------------- ##
  796. ## Function library. ##
  797. ## ----------------- ##
  798. # This section contains a variety of useful functions to call in your
  799. # scripts. Take note of the portable wrappers for features provided by
  800. # some modern shells, which will fall back to slower equivalents on
  801. # less featureful shells.
  802. # func_append VAR VALUE
  803. # ---------------------
  804. # Append VALUE onto the existing contents of VAR.
  805. # We should try to minimise forks, especially on Windows where they are
  806. # unreasonably slow, so skip the feature probes when bash or zsh are
  807. # being used:
  808. if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
  809. : ${_G_HAVE_ARITH_OP="yes"}
  810. : ${_G_HAVE_XSI_OPS="yes"}
  811. # The += operator was introduced in bash 3.1
  812. case $BASH_VERSION in
  813. [12].* | 3.0 | 3.0*) ;;
  814. *)
  815. : ${_G_HAVE_PLUSEQ_OP="yes"}
  816. ;;
  817. esac
  818. fi
  819. # _G_HAVE_PLUSEQ_OP
  820. # Can be empty, in which case the shell is probed, "yes" if += is
  821. # useable or anything else if it does not work.
  822. test -z "$_G_HAVE_PLUSEQ_OP" \
  823. && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
  824. && _G_HAVE_PLUSEQ_OP=yes
  825. if test yes = "$_G_HAVE_PLUSEQ_OP"
  826. then
  827. # This is an XSI compatible shell, allowing a faster implementation...
  828. eval 'func_append ()
  829. {
  830. $debug_cmd
  831. eval "$1+=\$2"
  832. }'
  833. else
  834. # ...otherwise fall back to using expr, which is often a shell builtin.
  835. func_append ()
  836. {
  837. $debug_cmd
  838. eval "$1=\$$1\$2"
  839. }
  840. fi
  841. # func_append_quoted VAR VALUE
  842. # ----------------------------
  843. # Quote VALUE and append to the end of shell variable VAR, separated
  844. # by a space.
  845. if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  846. eval 'func_append_quoted ()
  847. {
  848. $debug_cmd
  849. func_quote_arg pretty "$2"
  850. eval "$1+=\\ \$func_quote_arg_result"
  851. }'
  852. else
  853. func_append_quoted ()
  854. {
  855. $debug_cmd
  856. func_quote_arg pretty "$2"
  857. eval "$1=\$$1\\ \$func_quote_arg_result"
  858. }
  859. fi
  860. # func_append_uniq VAR VALUE
  861. # --------------------------
  862. # Append unique VALUE onto the existing contents of VAR, assuming
  863. # entries are delimited by the first character of VALUE. For example:
  864. #
  865. # func_append_uniq options " --another-option option-argument"
  866. #
  867. # will only append to $options if " --another-option option-argument "
  868. # is not already present somewhere in $options already (note spaces at
  869. # each end implied by leading space in second argument).
  870. func_append_uniq ()
  871. {
  872. $debug_cmd
  873. eval _G_current_value='`$ECHO $'$1'`'
  874. _G_delim=`expr "$2" : '\(.\)'`
  875. case $_G_delim$_G_current_value$_G_delim in
  876. *"$2$_G_delim"*) ;;
  877. *) func_append "$@" ;;
  878. esac
  879. }
  880. # func_arith TERM...
  881. # ------------------
  882. # Set func_arith_result to the result of evaluating TERMs.
  883. test -z "$_G_HAVE_ARITH_OP" \
  884. && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
  885. && _G_HAVE_ARITH_OP=yes
  886. if test yes = "$_G_HAVE_ARITH_OP"; then
  887. eval 'func_arith ()
  888. {
  889. $debug_cmd
  890. func_arith_result=$(( $* ))
  891. }'
  892. else
  893. func_arith ()
  894. {
  895. $debug_cmd
  896. func_arith_result=`expr "$@"`
  897. }
  898. fi
  899. # func_basename FILE
  900. # ------------------
  901. # Set func_basename_result to FILE with everything up to and including
  902. # the last / stripped.
  903. if test yes = "$_G_HAVE_XSI_OPS"; then
  904. # If this shell supports suffix pattern removal, then use it to avoid
  905. # forking. Hide the definitions single quotes in case the shell chokes
  906. # on unsupported syntax...
  907. _b='func_basename_result=${1##*/}'
  908. _d='case $1 in
  909. */*) func_dirname_result=${1%/*}$2 ;;
  910. * ) func_dirname_result=$3 ;;
  911. esac'
  912. else
  913. # ...otherwise fall back to using sed.
  914. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
  915. _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
  916. if test "X$func_dirname_result" = "X$1"; then
  917. func_dirname_result=$3
  918. else
  919. func_append func_dirname_result "$2"
  920. fi'
  921. fi
  922. eval 'func_basename ()
  923. {
  924. $debug_cmd
  925. '"$_b"'
  926. }'
  927. # func_dirname FILE APPEND NONDIR_REPLACEMENT
  928. # -------------------------------------------
  929. # Compute the dirname of FILE. If nonempty, add APPEND to the result,
  930. # otherwise set result to NONDIR_REPLACEMENT.
  931. eval 'func_dirname ()
  932. {
  933. $debug_cmd
  934. '"$_d"'
  935. }'
  936. # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
  937. # --------------------------------------------------------
  938. # Perform func_basename and func_dirname in a single function
  939. # call:
  940. # dirname: Compute the dirname of FILE. If nonempty,
  941. # add APPEND to the result, otherwise set result
  942. # to NONDIR_REPLACEMENT.
  943. # value returned in "$func_dirname_result"
  944. # basename: Compute filename of FILE.
  945. # value retuned in "$func_basename_result"
  946. # For efficiency, we do not delegate to the functions above but instead
  947. # duplicate the functionality here.
  948. eval 'func_dirname_and_basename ()
  949. {
  950. $debug_cmd
  951. '"$_b"'
  952. '"$_d"'
  953. }'
  954. # func_echo ARG...
  955. # ----------------
  956. # Echo program name prefixed message.
  957. func_echo ()
  958. {
  959. $debug_cmd
  960. _G_message=$*
  961. func_echo_IFS=$IFS
  962. IFS=$nl
  963. for _G_line in $_G_message; do
  964. IFS=$func_echo_IFS
  965. $ECHO "$progname: $_G_line"
  966. done
  967. IFS=$func_echo_IFS
  968. }
  969. # func_echo_all ARG...
  970. # --------------------
  971. # Invoke $ECHO with all args, space-separated.
  972. func_echo_all ()
  973. {
  974. $ECHO "$*"
  975. }
  976. # func_echo_infix_1 INFIX ARG...
  977. # ------------------------------
  978. # Echo program name, followed by INFIX on the first line, with any
  979. # additional lines not showing INFIX.
  980. func_echo_infix_1 ()
  981. {
  982. $debug_cmd
  983. $require_term_colors
  984. _G_infix=$1; shift
  985. _G_indent=$_G_infix
  986. _G_prefix="$progname: $_G_infix: "
  987. _G_message=$*
  988. # Strip color escape sequences before counting printable length
  989. for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
  990. do
  991. test -n "$_G_tc" && {
  992. _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
  993. _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
  994. }
  995. done
  996. _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
  997. func_echo_infix_1_IFS=$IFS
  998. IFS=$nl
  999. for _G_line in $_G_message; do
  1000. IFS=$func_echo_infix_1_IFS
  1001. $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
  1002. _G_prefix=$_G_indent
  1003. done
  1004. IFS=$func_echo_infix_1_IFS
  1005. }
  1006. # func_error ARG...
  1007. # -----------------
  1008. # Echo program name prefixed message to standard error.
  1009. func_error ()
  1010. {
  1011. $debug_cmd
  1012. $require_term_colors
  1013. func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
  1014. }
  1015. # func_fatal_error ARG...
  1016. # -----------------------
  1017. # Echo program name prefixed message to standard error, and exit.
  1018. func_fatal_error ()
  1019. {
  1020. $debug_cmd
  1021. func_error "$*"
  1022. exit $EXIT_FAILURE
  1023. }
  1024. # func_grep EXPRESSION FILENAME
  1025. # -----------------------------
  1026. # Check whether EXPRESSION matches any line of FILENAME, without output.
  1027. func_grep ()
  1028. {
  1029. $debug_cmd
  1030. $GREP "$1" "$2" >/dev/null 2>&1
  1031. }
  1032. # func_len STRING
  1033. # ---------------
  1034. # Set func_len_result to the length of STRING. STRING may not
  1035. # start with a hyphen.
  1036. test -z "$_G_HAVE_XSI_OPS" \
  1037. && (eval 'x=a/b/c;
  1038. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1039. && _G_HAVE_XSI_OPS=yes
  1040. if test yes = "$_G_HAVE_XSI_OPS"; then
  1041. eval 'func_len ()
  1042. {
  1043. $debug_cmd
  1044. func_len_result=${#1}
  1045. }'
  1046. else
  1047. func_len ()
  1048. {
  1049. $debug_cmd
  1050. func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  1051. }
  1052. fi
  1053. # func_mkdir_p DIRECTORY-PATH
  1054. # ---------------------------
  1055. # Make sure the entire path to DIRECTORY-PATH is available.
  1056. func_mkdir_p ()
  1057. {
  1058. $debug_cmd
  1059. _G_directory_path=$1
  1060. _G_dir_list=
  1061. if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
  1062. # Protect directory names starting with '-'
  1063. case $_G_directory_path in
  1064. -*) _G_directory_path=./$_G_directory_path ;;
  1065. esac
  1066. # While some portion of DIR does not yet exist...
  1067. while test ! -d "$_G_directory_path"; do
  1068. # ...make a list in topmost first order. Use a colon delimited
  1069. # list incase some portion of path contains whitespace.
  1070. _G_dir_list=$_G_directory_path:$_G_dir_list
  1071. # If the last portion added has no slash in it, the list is done
  1072. case $_G_directory_path in */*) ;; *) break ;; esac
  1073. # ...otherwise throw away the child directory and loop
  1074. _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
  1075. done
  1076. _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
  1077. func_mkdir_p_IFS=$IFS; IFS=:
  1078. for _G_dir in $_G_dir_list; do
  1079. IFS=$func_mkdir_p_IFS
  1080. # mkdir can fail with a 'File exist' error if two processes
  1081. # try to create one of the directories concurrently. Don't
  1082. # stop in that case!
  1083. $MKDIR "$_G_dir" 2>/dev/null || :
  1084. done
  1085. IFS=$func_mkdir_p_IFS
  1086. # Bail out if we (or some other process) failed to create a directory.
  1087. test -d "$_G_directory_path" || \
  1088. func_fatal_error "Failed to create '$1'"
  1089. fi
  1090. }
  1091. # func_mktempdir [BASENAME]
  1092. # -------------------------
  1093. # Make a temporary directory that won't clash with other running
  1094. # libtool processes, and avoids race conditions if possible. If
  1095. # given, BASENAME is the basename for that directory.
  1096. func_mktempdir ()
  1097. {
  1098. $debug_cmd
  1099. _G_template=${TMPDIR-/tmp}/${1-$progname}
  1100. if test : = "$opt_dry_run"; then
  1101. # Return a directory name, but don't create it in dry-run mode
  1102. _G_tmpdir=$_G_template-$$
  1103. else
  1104. # If mktemp works, use that first and foremost
  1105. _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
  1106. if test ! -d "$_G_tmpdir"; then
  1107. # Failing that, at least try and use $RANDOM to avoid a race
  1108. _G_tmpdir=$_G_template-${RANDOM-0}$$
  1109. func_mktempdir_umask=`umask`
  1110. umask 0077
  1111. $MKDIR "$_G_tmpdir"
  1112. umask $func_mktempdir_umask
  1113. fi
  1114. # If we're not in dry-run mode, bomb out on failure
  1115. test -d "$_G_tmpdir" || \
  1116. func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
  1117. fi
  1118. $ECHO "$_G_tmpdir"
  1119. }
  1120. # func_normal_abspath PATH
  1121. # ------------------------
  1122. # Remove doubled-up and trailing slashes, "." path components,
  1123. # and cancel out any ".." path components in PATH after making
  1124. # it an absolute path.
  1125. func_normal_abspath ()
  1126. {
  1127. $debug_cmd
  1128. # These SED scripts presuppose an absolute path with a trailing slash.
  1129. _G_pathcar='s|^/\([^/]*\).*$|\1|'
  1130. _G_pathcdr='s|^/[^/]*||'
  1131. _G_removedotparts=':dotsl
  1132. s|/\./|/|g
  1133. t dotsl
  1134. s|/\.$|/|'
  1135. _G_collapseslashes='s|/\{1,\}|/|g'
  1136. _G_finalslash='s|/*$|/|'
  1137. # Start from root dir and reassemble the path.
  1138. func_normal_abspath_result=
  1139. func_normal_abspath_tpath=$1
  1140. func_normal_abspath_altnamespace=
  1141. case $func_normal_abspath_tpath in
  1142. "")
  1143. # Empty path, that just means $cwd.
  1144. func_stripname '' '/' "`pwd`"
  1145. func_normal_abspath_result=$func_stripname_result
  1146. return
  1147. ;;
  1148. # The next three entries are used to spot a run of precisely
  1149. # two leading slashes without using negated character classes;
  1150. # we take advantage of case's first-match behaviour.
  1151. ///*)
  1152. # Unusual form of absolute path, do nothing.
  1153. ;;
  1154. //*)
  1155. # Not necessarily an ordinary path; POSIX reserves leading '//'
  1156. # and for example Cygwin uses it to access remote file shares
  1157. # over CIFS/SMB, so we conserve a leading double slash if found.
  1158. func_normal_abspath_altnamespace=/
  1159. ;;
  1160. /*)
  1161. # Absolute path, do nothing.
  1162. ;;
  1163. *)
  1164. # Relative path, prepend $cwd.
  1165. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
  1166. ;;
  1167. esac
  1168. # Cancel out all the simple stuff to save iterations. We also want
  1169. # the path to end with a slash for ease of parsing, so make sure
  1170. # there is one (and only one) here.
  1171. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1172. -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
  1173. while :; do
  1174. # Processed it all yet?
  1175. if test / = "$func_normal_abspath_tpath"; then
  1176. # If we ascended to the root using ".." the result may be empty now.
  1177. if test -z "$func_normal_abspath_result"; then
  1178. func_normal_abspath_result=/
  1179. fi
  1180. break
  1181. fi
  1182. func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1183. -e "$_G_pathcar"`
  1184. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1185. -e "$_G_pathcdr"`
  1186. # Figure out what to do with it
  1187. case $func_normal_abspath_tcomponent in
  1188. "")
  1189. # Trailing empty path component, ignore it.
  1190. ;;
  1191. ..)
  1192. # Parent dir; strip last assembled component from result.
  1193. func_dirname "$func_normal_abspath_result"
  1194. func_normal_abspath_result=$func_dirname_result
  1195. ;;
  1196. *)
  1197. # Actual path component, append it.
  1198. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
  1199. ;;
  1200. esac
  1201. done
  1202. # Restore leading double-slash if one was found on entry.
  1203. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
  1204. }
  1205. # func_notquiet ARG...
  1206. # --------------------
  1207. # Echo program name prefixed message only when not in quiet mode.
  1208. func_notquiet ()
  1209. {
  1210. $debug_cmd
  1211. $opt_quiet || func_echo ${1+"$@"}
  1212. # A bug in bash halts the script if the last line of a function
  1213. # fails when set -e is in force, so we need another command to
  1214. # work around that:
  1215. :
  1216. }
  1217. # func_relative_path SRCDIR DSTDIR
  1218. # --------------------------------
  1219. # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
  1220. func_relative_path ()
  1221. {
  1222. $debug_cmd
  1223. func_relative_path_result=
  1224. func_normal_abspath "$1"
  1225. func_relative_path_tlibdir=$func_normal_abspath_result
  1226. func_normal_abspath "$2"
  1227. func_relative_path_tbindir=$func_normal_abspath_result
  1228. # Ascend the tree starting from libdir
  1229. while :; do
  1230. # check if we have found a prefix of bindir
  1231. case $func_relative_path_tbindir in
  1232. $func_relative_path_tlibdir)
  1233. # found an exact match
  1234. func_relative_path_tcancelled=
  1235. break
  1236. ;;
  1237. $func_relative_path_tlibdir*)
  1238. # found a matching prefix
  1239. func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
  1240. func_relative_path_tcancelled=$func_stripname_result
  1241. if test -z "$func_relative_path_result"; then
  1242. func_relative_path_result=.
  1243. fi
  1244. break
  1245. ;;
  1246. *)
  1247. func_dirname $func_relative_path_tlibdir
  1248. func_relative_path_tlibdir=$func_dirname_result
  1249. if test -z "$func_relative_path_tlibdir"; then
  1250. # Have to descend all the way to the root!
  1251. func_relative_path_result=../$func_relative_path_result
  1252. func_relative_path_tcancelled=$func_relative_path_tbindir
  1253. break
  1254. fi
  1255. func_relative_path_result=../$func_relative_path_result
  1256. ;;
  1257. esac
  1258. done
  1259. # Now calculate path; take care to avoid doubling-up slashes.
  1260. func_stripname '' '/' "$func_relative_path_result"
  1261. func_relative_path_result=$func_stripname_result
  1262. func_stripname '/' '/' "$func_relative_path_tcancelled"
  1263. if test -n "$func_stripname_result"; then
  1264. func_append func_relative_path_result "/$func_stripname_result"
  1265. fi
  1266. # Normalisation. If bindir is libdir, return '.' else relative path.
  1267. if test -n "$func_relative_path_result"; then
  1268. func_stripname './' '' "$func_relative_path_result"
  1269. func_relative_path_result=$func_stripname_result
  1270. fi
  1271. test -n "$func_relative_path_result" || func_relative_path_result=.
  1272. :
  1273. }
  1274. # func_quote_portable EVAL ARG
  1275. # ----------------------------
  1276. # Internal function to portably implement func_quote_arg. Note that we still
  1277. # keep attention to performance here so we as much as possible try to avoid
  1278. # calling sed binary (so far O(N) complexity as long as func_append is O(1)).
  1279. func_quote_portable ()
  1280. {
  1281. $debug_cmd
  1282. func_quote_portable_result=$2
  1283. # one-time-loop (easy break)
  1284. while true
  1285. do
  1286. if $1; then
  1287. func_quote_portable_result=`$ECHO "$2" | $SED \
  1288. -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
  1289. break
  1290. fi
  1291. # Quote for eval.
  1292. case $func_quote_portable_result in
  1293. *[\\\`\"\$]*)
  1294. case $func_quote_portable_result in
  1295. *[\[\*\?]*)
  1296. func_quote_portable_result=`$ECHO "$func_quote_portable_result" | $SED "$sed_quote_subst"`
  1297. break
  1298. ;;
  1299. esac
  1300. func_quote_portable_old_IFS=$IFS
  1301. for _G_char in '\' '`' '"' '$'
  1302. do
  1303. # STATE($1) PREV($2) SEPARATOR($3)
  1304. set start "" ""
  1305. func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
  1306. IFS=$_G_char
  1307. for _G_part in $func_quote_portable_result
  1308. do
  1309. case $1 in
  1310. quote)
  1311. func_append func_quote_portable_result "$3$2"
  1312. set quote "$_G_part" "\\$_G_char"
  1313. ;;
  1314. start)
  1315. set first "" ""
  1316. func_quote_portable_result=
  1317. ;;
  1318. first)
  1319. set quote "$_G_part" ""
  1320. ;;
  1321. esac
  1322. done
  1323. done
  1324. IFS=$func_quote_portable_old_IFS
  1325. ;;
  1326. *) ;;
  1327. esac
  1328. break
  1329. done
  1330. func_quote_portable_unquoted_result=$func_quote_portable_result
  1331. case $func_quote_portable_result in
  1332. # double-quote args containing shell metacharacters to delay
  1333. # word splitting, command substitution and variable expansion
  1334. # for a subsequent eval.
  1335. # many bourne shells cannot handle close brackets correctly
  1336. # in scan sets, so we specify it separately.
  1337. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1338. func_quote_portable_result=\"$func_quote_portable_result\"
  1339. ;;
  1340. esac
  1341. }
  1342. # func_quotefast_eval ARG
  1343. # -----------------------
  1344. # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
  1345. # but optimized for speed. Result is stored in $func_quotefast_eval.
  1346. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
  1347. func_quotefast_eval ()
  1348. {
  1349. printf -v func_quotefast_eval_result %q "$1"
  1350. }
  1351. else
  1352. func_quotefast_eval ()
  1353. {
  1354. func_quote_portable false "$1"
  1355. func_quotefast_eval_result=$func_quote_portable_result
  1356. }
  1357. fi
  1358. # func_quote_arg MODEs ARG
  1359. # ------------------------
  1360. # Quote one ARG to be evaled later. MODEs argument may contain zero ore more
  1361. # specifiers listed below separated by ',' character. This function returns two
  1362. # values:
  1363. # i) func_quote_arg_result
  1364. # double-quoted (when needed), suitable for a subsequent eval
  1365. # ii) func_quote_arg_unquoted_result
  1366. # has all characters that are still active within double
  1367. # quotes backslashified. Available only if 'unquoted' is specified.
  1368. #
  1369. # Available modes:
  1370. # ----------------
  1371. # 'eval' (default)
  1372. # - escape shell special characters
  1373. # 'expand'
  1374. # - the same as 'eval'; but do not quote variable references
  1375. # 'pretty'
  1376. # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
  1377. # later used in func_quote to get output like: 'echo "a b"' instead of
  1378. # 'echo a\ b'. This is slower than default on some shells.
  1379. # 'unquoted'
  1380. # - produce also $func_quote_arg_unquoted_result which does not contain
  1381. # wrapping double-quotes.
  1382. #
  1383. # Examples for 'func_quote_arg pretty,unquoted string':
  1384. #
  1385. # string | *_result | *_unquoted_result
  1386. # ------------+-----------------------+-------------------
  1387. # " | \" | \"
  1388. # a b | "a b" | a b
  1389. # "a b" | "\"a b\"" | \"a b\"
  1390. # * | "*" | *
  1391. # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
  1392. #
  1393. # Examples for 'func_quote_arg pretty,unquoted,expand string':
  1394. #
  1395. # string | *_result | *_unquoted_result
  1396. # --------------+---------------------+--------------------
  1397. # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
  1398. func_quote_arg ()
  1399. {
  1400. _G_quote_expand=false
  1401. case ,$1, in
  1402. *,expand,*)
  1403. _G_quote_expand=:
  1404. ;;
  1405. esac
  1406. case ,$1, in
  1407. *,pretty,*|*,expand,*|*,unquoted,*)
  1408. func_quote_portable $_G_quote_expand "$2"
  1409. func_quote_arg_result=$func_quote_portable_result
  1410. func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
  1411. ;;
  1412. *)
  1413. # Faster quote-for-eval for some shells.
  1414. func_quotefast_eval "$2"
  1415. func_quote_arg_result=$func_quotefast_eval_result
  1416. ;;
  1417. esac
  1418. }
  1419. # func_quote MODEs ARGs...
  1420. # ------------------------
  1421. # Quote all ARGs to be evaled later and join them into single command. See
  1422. # func_quote_arg's description for more info.
  1423. func_quote ()
  1424. {
  1425. $debug_cmd
  1426. _G_func_quote_mode=$1 ; shift
  1427. func_quote_result=
  1428. while test 0 -lt $#; do
  1429. func_quote_arg "$_G_func_quote_mode" "$1"
  1430. if test -n "$func_quote_result"; then
  1431. func_append func_quote_result " $func_quote_arg_result"
  1432. else
  1433. func_append func_quote_result "$func_quote_arg_result"
  1434. fi
  1435. shift
  1436. done
  1437. }
  1438. # func_stripname PREFIX SUFFIX NAME
  1439. # ---------------------------------
  1440. # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
  1441. # PREFIX and SUFFIX must not contain globbing or regex special
  1442. # characters, hashes, percent signs, but SUFFIX may contain a leading
  1443. # dot (in which case that matches only a dot).
  1444. if test yes = "$_G_HAVE_XSI_OPS"; then
  1445. eval 'func_stripname ()
  1446. {
  1447. $debug_cmd
  1448. # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  1449. # positional parameters, so assign one to ordinary variable first.
  1450. func_stripname_result=$3
  1451. func_stripname_result=${func_stripname_result#"$1"}
  1452. func_stripname_result=${func_stripname_result%"$2"}
  1453. }'
  1454. else
  1455. func_stripname ()
  1456. {
  1457. $debug_cmd
  1458. case $2 in
  1459. .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
  1460. *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
  1461. esac
  1462. }
  1463. fi
  1464. # func_show_eval CMD [FAIL_EXP]
  1465. # -----------------------------
  1466. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1467. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1468. # is given, then evaluate it.
  1469. func_show_eval ()
  1470. {
  1471. $debug_cmd
  1472. _G_cmd=$1
  1473. _G_fail_exp=${2-':'}
  1474. func_quote_arg pretty,expand "$_G_cmd"
  1475. eval "func_notquiet $func_quote_arg_result"
  1476. $opt_dry_run || {
  1477. eval "$_G_cmd"
  1478. _G_status=$?
  1479. if test 0 -ne "$_G_status"; then
  1480. eval "(exit $_G_status); $_G_fail_exp"
  1481. fi
  1482. }
  1483. }
  1484. # func_show_eval_locale CMD [FAIL_EXP]
  1485. # ------------------------------------
  1486. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1487. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1488. # is given, then evaluate it. Use the saved locale for evaluation.
  1489. func_show_eval_locale ()
  1490. {
  1491. $debug_cmd
  1492. _G_cmd=$1
  1493. _G_fail_exp=${2-':'}
  1494. $opt_quiet || {
  1495. func_quote_arg expand,pretty "$_G_cmd"
  1496. eval "func_echo $func_quote_arg_result"
  1497. }
  1498. $opt_dry_run || {
  1499. eval "$_G_user_locale
  1500. $_G_cmd"
  1501. _G_status=$?
  1502. eval "$_G_safe_locale"
  1503. if test 0 -ne "$_G_status"; then
  1504. eval "(exit $_G_status); $_G_fail_exp"
  1505. fi
  1506. }
  1507. }
  1508. # func_tr_sh
  1509. # ----------
  1510. # Turn $1 into a string suitable for a shell variable name.
  1511. # Result is stored in $func_tr_sh_result. All characters
  1512. # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
  1513. # if $1 begins with a digit, a '_' is prepended as well.
  1514. func_tr_sh ()
  1515. {
  1516. $debug_cmd
  1517. case $1 in
  1518. [0-9]* | *[!a-zA-Z0-9_]*)
  1519. func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
  1520. ;;
  1521. * )
  1522. func_tr_sh_result=$1
  1523. ;;
  1524. esac
  1525. }
  1526. # func_verbose ARG...
  1527. # -------------------
  1528. # Echo program name prefixed message in verbose mode only.
  1529. func_verbose ()
  1530. {
  1531. $debug_cmd
  1532. $opt_verbose && func_echo "$*"
  1533. :
  1534. }
  1535. # func_warn_and_continue ARG...
  1536. # -----------------------------
  1537. # Echo program name prefixed warning message to standard error.
  1538. func_warn_and_continue ()
  1539. {
  1540. $debug_cmd
  1541. $require_term_colors
  1542. func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
  1543. }
  1544. # func_warning CATEGORY ARG...
  1545. # ----------------------------
  1546. # Echo program name prefixed warning message to standard error. Warning
  1547. # messages can be filtered according to CATEGORY, where this function
  1548. # elides messages where CATEGORY is not listed in the global variable
  1549. # 'opt_warning_types'.
  1550. func_warning ()
  1551. {
  1552. $debug_cmd
  1553. # CATEGORY must be in the warning_categories list!
  1554. case " $warning_categories " in
  1555. *" $1 "*) ;;
  1556. *) func_internal_error "invalid warning category '$1'" ;;
  1557. esac
  1558. _G_category=$1
  1559. shift
  1560. case " $opt_warning_types " in
  1561. *" $_G_category "*) $warning_func ${1+"$@"} ;;
  1562. esac
  1563. }
  1564. # func_sort_ver VER1 VER2
  1565. # -----------------------
  1566. # 'sort -V' is not generally available.
  1567. # Note this deviates from the version comparison in automake
  1568. # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
  1569. # but this should suffice as we won't be specifying old
  1570. # version formats or redundant trailing .0 in bootstrap.conf.
  1571. # If we did want full compatibility then we should probably
  1572. # use m4_version_compare from autoconf.
  1573. func_sort_ver ()
  1574. {
  1575. $debug_cmd
  1576. printf '%s\n%s\n' "$1" "$2" \
  1577. | 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
  1578. }
  1579. # func_lt_ver PREV CURR
  1580. # ---------------------
  1581. # Return true if PREV and CURR are in the correct order according to
  1582. # func_sort_ver, otherwise false. Use it like this:
  1583. #
  1584. # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
  1585. func_lt_ver ()
  1586. {
  1587. $debug_cmd
  1588. test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
  1589. }
  1590. # Local variables:
  1591. # mode: shell-script
  1592. # sh-indentation: 2
  1593. # eval: (add-hook 'before-save-hook 'time-stamp)
  1594. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  1595. # time-stamp-time-zone: "UTC"
  1596. # End:
  1597. #! /bin/sh
  1598. # Set a version string for this script.
  1599. scriptversion=2015-10-12.13; # UTC
  1600. # A portable, pluggable option parser for Bourne shell.
  1601. # Written by Gary V. Vaughan, 2010
  1602. # Copyright (C) 2010-2015 Free Software Foundation, Inc.
  1603. # This is free software; see the source for copying conditions. There is NO
  1604. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1605. # This program is free software: you can redistribute it and/or modify
  1606. # it under the terms of the GNU General Public License as published by
  1607. # the Free Software Foundation, either version 3 of the License, or
  1608. # (at your option) any later version.
  1609. # This program is distributed in the hope that it will be useful,
  1610. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  1611. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1612. # GNU General Public License for more details.
  1613. # You should have received a copy of the GNU General Public License
  1614. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  1615. # Please report bugs or propose patches to gary@gnu.org.
  1616. ## ------ ##
  1617. ## Usage. ##
  1618. ## ------ ##
  1619. # This file is a library for parsing options in your shell scripts along
  1620. # with assorted other useful supporting features that you can make use
  1621. # of too.
  1622. #
  1623. # For the simplest scripts you might need only:
  1624. #
  1625. # #!/bin/sh
  1626. # . relative/path/to/funclib.sh
  1627. # . relative/path/to/options-parser
  1628. # scriptversion=1.0
  1629. # func_options ${1+"$@"}
  1630. # eval set dummy "$func_options_result"; shift
  1631. # ...rest of your script...
  1632. #
  1633. # In order for the '--version' option to work, you will need to have a
  1634. # suitably formatted comment like the one at the top of this file
  1635. # starting with '# Written by ' and ending with '# warranty; '.
  1636. #
  1637. # For '-h' and '--help' to work, you will also need a one line
  1638. # description of your script's purpose in a comment directly above the
  1639. # '# Written by ' line, like the one at the top of this file.
  1640. #
  1641. # The default options also support '--debug', which will turn on shell
  1642. # execution tracing (see the comment above debug_cmd below for another
  1643. # use), and '--verbose' and the func_verbose function to allow your script
  1644. # to display verbose messages only when your user has specified
  1645. # '--verbose'.
  1646. #
  1647. # After sourcing this file, you can plug processing for additional
  1648. # options by amending the variables from the 'Configuration' section
  1649. # below, and following the instructions in the 'Option parsing'
  1650. # section further down.
  1651. ## -------------- ##
  1652. ## Configuration. ##
  1653. ## -------------- ##
  1654. # You should override these variables in your script after sourcing this
  1655. # file so that they reflect the customisations you have added to the
  1656. # option parser.
  1657. # The usage line for option parsing errors and the start of '-h' and
  1658. # '--help' output messages. You can embed shell variables for delayed
  1659. # expansion at the time the message is displayed, but you will need to
  1660. # quote other shell meta-characters carefully to prevent them being
  1661. # expanded when the contents are evaled.
  1662. usage='$progpath [OPTION]...'
  1663. # Short help message in response to '-h' and '--help'. Add to this or
  1664. # override it after sourcing this library to reflect the full set of
  1665. # options your script accepts.
  1666. usage_message="\
  1667. --debug enable verbose shell tracing
  1668. -W, --warnings=CATEGORY
  1669. report the warnings falling in CATEGORY [all]
  1670. -v, --verbose verbosely report processing
  1671. --version print version information and exit
  1672. -h, --help print short or long help message and exit
  1673. "
  1674. # Additional text appended to 'usage_message' in response to '--help'.
  1675. long_help_message="
  1676. Warning categories include:
  1677. 'all' show all warnings
  1678. 'none' turn off all the warnings
  1679. 'error' warnings are treated as fatal errors"
  1680. # Help message printed before fatal option parsing errors.
  1681. fatal_help="Try '\$progname --help' for more information."
  1682. ## ------------------------- ##
  1683. ## Hook function management. ##
  1684. ## ------------------------- ##
  1685. # This section contains functions for adding, removing, and running hooks
  1686. # to the main code. A hook is just a named list of of function, that can
  1687. # be run in order later on.
  1688. # func_hookable FUNC_NAME
  1689. # -----------------------
  1690. # Declare that FUNC_NAME will run hooks added with
  1691. # 'func_add_hook FUNC_NAME ...'.
  1692. func_hookable ()
  1693. {
  1694. $debug_cmd
  1695. func_append hookable_fns " $1"
  1696. }
  1697. # func_add_hook FUNC_NAME HOOK_FUNC
  1698. # ---------------------------------
  1699. # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
  1700. # first have been declared "hookable" by a call to 'func_hookable'.
  1701. func_add_hook ()
  1702. {
  1703. $debug_cmd
  1704. case " $hookable_fns " in
  1705. *" $1 "*) ;;
  1706. *) func_fatal_error "'$1' does not accept hook functions." ;;
  1707. esac
  1708. eval func_append ${1}_hooks '" $2"'
  1709. }
  1710. # func_remove_hook FUNC_NAME HOOK_FUNC
  1711. # ------------------------------------
  1712. # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
  1713. func_remove_hook ()
  1714. {
  1715. $debug_cmd
  1716. eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
  1717. }
  1718. # func_run_hooks FUNC_NAME [ARG]...
  1719. # ---------------------------------
  1720. # Run all hook functions registered to FUNC_NAME.
  1721. # It is assumed that the list of hook functions contains nothing more
  1722. # than a whitespace-delimited list of legal shell function names, and
  1723. # no effort is wasted trying to catch shell meta-characters or preserve
  1724. # whitespace.
  1725. func_run_hooks ()
  1726. {
  1727. $debug_cmd
  1728. _G_rc_run_hooks=false
  1729. case " $hookable_fns " in
  1730. *" $1 "*) ;;
  1731. *) func_fatal_error "'$1' does not support hook funcions.n" ;;
  1732. esac
  1733. eval _G_hook_fns=\$$1_hooks; shift
  1734. for _G_hook in $_G_hook_fns; do
  1735. if eval $_G_hook '"$@"'; then
  1736. # store returned options list back into positional
  1737. # parameters for next 'cmd' execution.
  1738. eval _G_hook_result=\$${_G_hook}_result
  1739. eval set dummy "$_G_hook_result"; shift
  1740. _G_rc_run_hooks=:
  1741. fi
  1742. done
  1743. $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
  1744. }
  1745. ## --------------- ##
  1746. ## Option parsing. ##
  1747. ## --------------- ##
  1748. # In order to add your own option parsing hooks, you must accept the
  1749. # full positional parameter list in your hook function, you may remove/edit
  1750. # any options that you action, and then pass back the remaining unprocessed
  1751. # options in '<hooked_function_name>_result', escaped suitably for
  1752. # 'eval'. In this case you also must return $EXIT_SUCCESS to let the
  1753. # hook's caller know that it should pay attention to
  1754. # '<hooked_function_name>_result'. Returning $EXIT_FAILURE signalizes that
  1755. # arguments are left untouched by the hook and therefore caller will ignore the
  1756. # result variable.
  1757. #
  1758. # Like this:
  1759. #
  1760. # my_options_prep ()
  1761. # {
  1762. # $debug_cmd
  1763. #
  1764. # # Extend the existing usage message.
  1765. # usage_message=$usage_message'
  1766. # -s, --silent don'\''t print informational messages
  1767. # '
  1768. # # No change in '$@' (ignored completely by this hook). There is
  1769. # # no need to do the equivalent (but slower) action:
  1770. # # func_quote eval ${1+"$@"}
  1771. # # my_options_prep_result=$func_quote_result
  1772. # false
  1773. # }
  1774. # func_add_hook func_options_prep my_options_prep
  1775. #
  1776. #
  1777. # my_silent_option ()
  1778. # {
  1779. # $debug_cmd
  1780. #
  1781. # args_changed=false
  1782. #
  1783. # # Note that for efficiency, we parse as many options as we can
  1784. # # recognise in a loop before passing the remainder back to the
  1785. # # caller on the first unrecognised argument we encounter.
  1786. # while test $# -gt 0; do
  1787. # opt=$1; shift
  1788. # case $opt in
  1789. # --silent|-s) opt_silent=:
  1790. # args_changed=:
  1791. # ;;
  1792. # # Separate non-argument short options:
  1793. # -s*) func_split_short_opt "$_G_opt"
  1794. # set dummy "$func_split_short_opt_name" \
  1795. # "-$func_split_short_opt_arg" ${1+"$@"}
  1796. # shift
  1797. # args_changed=:
  1798. # ;;
  1799. # *) # Make sure the first unrecognised option "$_G_opt"
  1800. # # is added back to "$@", we could need that later
  1801. # # if $args_changed is true.
  1802. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  1803. # esac
  1804. # done
  1805. #
  1806. # if $args_changed; then
  1807. # func_quote eval ${1+"$@"}
  1808. # my_silent_option_result=$func_quote_result
  1809. # fi
  1810. #
  1811. # $args_changed
  1812. # }
  1813. # func_add_hook func_parse_options my_silent_option
  1814. #
  1815. #
  1816. # my_option_validation ()
  1817. # {
  1818. # $debug_cmd
  1819. #
  1820. # $opt_silent && $opt_verbose && func_fatal_help "\
  1821. # '--silent' and '--verbose' options are mutually exclusive."
  1822. #
  1823. # false
  1824. # }
  1825. # func_add_hook func_validate_options my_option_validation
  1826. #
  1827. # You'll also need to manually amend $usage_message to reflect the extra
  1828. # options you parse. It's preferable to append if you can, so that
  1829. # multiple option parsing hooks can be added safely.
  1830. # func_options_finish [ARG]...
  1831. # ----------------------------
  1832. # Finishing the option parse loop (call 'func_options' hooks ATM).
  1833. func_options_finish ()
  1834. {
  1835. $debug_cmd
  1836. _G_func_options_finish_exit=false
  1837. if func_run_hooks func_options ${1+"$@"}; then
  1838. func_options_finish_result=$func_run_hooks_result
  1839. _G_func_options_finish_exit=:
  1840. fi
  1841. $_G_func_options_finish_exit
  1842. }
  1843. # func_options [ARG]...
  1844. # ---------------------
  1845. # All the functions called inside func_options are hookable. See the
  1846. # individual implementations for details.
  1847. func_hookable func_options
  1848. func_options ()
  1849. {
  1850. $debug_cmd
  1851. _G_rc_options=false
  1852. for my_func in options_prep parse_options validate_options options_finish
  1853. do
  1854. if eval func_$my_func '${1+"$@"}'; then
  1855. eval _G_res_var='$'"func_${my_func}_result"
  1856. eval set dummy "$_G_res_var" ; shift
  1857. _G_rc_options=:
  1858. fi
  1859. done
  1860. # Save modified positional parameters for caller. As a top-level
  1861. # options-parser function we always need to set the 'func_options_result'
  1862. # variable (regardless the $_G_rc_options value).
  1863. if $_G_rc_options; then
  1864. func_options_result=$_G_res_var
  1865. else
  1866. func_quote eval ${1+"$@"}
  1867. func_options_result=$func_quote_result
  1868. fi
  1869. $_G_rc_options
  1870. }
  1871. # func_options_prep [ARG]...
  1872. # --------------------------
  1873. # All initialisations required before starting the option parse loop.
  1874. # Note that when calling hook functions, we pass through the list of
  1875. # positional parameters. If a hook function modifies that list, and
  1876. # needs to propagate that back to rest of this script, then the complete
  1877. # modified list must be put in 'func_run_hooks_result' before
  1878. # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
  1879. func_hookable func_options_prep
  1880. func_options_prep ()
  1881. {
  1882. $debug_cmd
  1883. # Option defaults:
  1884. opt_verbose=false
  1885. opt_warning_types=
  1886. _G_rc_options_prep=false
  1887. if func_run_hooks func_options_prep ${1+"$@"}; then
  1888. _G_rc_options_prep=:
  1889. # save modified positional parameters for caller
  1890. func_options_prep_result=$func_run_hooks_result
  1891. fi
  1892. $_G_rc_options_prep
  1893. }
  1894. # func_parse_options [ARG]...
  1895. # ---------------------------
  1896. # The main option parsing loop.
  1897. func_hookable func_parse_options
  1898. func_parse_options ()
  1899. {
  1900. $debug_cmd
  1901. func_parse_options_result=
  1902. _G_rc_parse_options=false
  1903. # this just eases exit handling
  1904. while test $# -gt 0; do
  1905. # Defer to hook functions for initial option parsing, so they
  1906. # get priority in the event of reusing an option name.
  1907. if func_run_hooks func_parse_options ${1+"$@"}; then
  1908. eval set dummy "$func_run_hooks_result"; shift
  1909. _G_rc_parse_options=:
  1910. fi
  1911. # Break out of the loop if we already parsed every option.
  1912. test $# -gt 0 || break
  1913. _G_match_parse_options=:
  1914. _G_opt=$1
  1915. shift
  1916. case $_G_opt in
  1917. --debug|-x) debug_cmd='set -x'
  1918. func_echo "enabling shell trace mode"
  1919. $debug_cmd
  1920. ;;
  1921. --no-warnings|--no-warning|--no-warn)
  1922. set dummy --warnings none ${1+"$@"}
  1923. shift
  1924. ;;
  1925. --warnings|--warning|-W)
  1926. if test $# = 0 && func_missing_arg $_G_opt; then
  1927. _G_rc_parse_options=:
  1928. break
  1929. fi
  1930. case " $warning_categories $1" in
  1931. *" $1 "*)
  1932. # trailing space prevents matching last $1 above
  1933. func_append_uniq opt_warning_types " $1"
  1934. ;;
  1935. *all)
  1936. opt_warning_types=$warning_categories
  1937. ;;
  1938. *none)
  1939. opt_warning_types=none
  1940. warning_func=:
  1941. ;;
  1942. *error)
  1943. opt_warning_types=$warning_categories
  1944. warning_func=func_fatal_error
  1945. ;;
  1946. *)
  1947. func_fatal_error \
  1948. "unsupported warning category: '$1'"
  1949. ;;
  1950. esac
  1951. shift
  1952. ;;
  1953. --verbose|-v) opt_verbose=: ;;
  1954. --version) func_version ;;
  1955. -\?|-h) func_usage ;;
  1956. --help) func_help ;;
  1957. # Separate optargs to long options (plugins may need this):
  1958. --*=*) func_split_equals "$_G_opt"
  1959. set dummy "$func_split_equals_lhs" \
  1960. "$func_split_equals_rhs" ${1+"$@"}
  1961. shift
  1962. ;;
  1963. # Separate optargs to short options:
  1964. -W*)
  1965. func_split_short_opt "$_G_opt"
  1966. set dummy "$func_split_short_opt_name" \
  1967. "$func_split_short_opt_arg" ${1+"$@"}
  1968. shift
  1969. ;;
  1970. # Separate non-argument short options:
  1971. -\?*|-h*|-v*|-x*)
  1972. func_split_short_opt "$_G_opt"
  1973. set dummy "$func_split_short_opt_name" \
  1974. "-$func_split_short_opt_arg" ${1+"$@"}
  1975. shift
  1976. ;;
  1977. --) _G_rc_parse_options=: ; break ;;
  1978. -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
  1979. *) set dummy "$_G_opt" ${1+"$@"}; shift
  1980. _G_match_parse_options=false
  1981. break
  1982. ;;
  1983. esac
  1984. $_G_match_parse_options && _G_rc_parse_options=:
  1985. done
  1986. if $_G_rc_parse_options; then
  1987. # save modified positional parameters for caller
  1988. func_quote eval ${1+"$@"}
  1989. func_parse_options_result=$func_quote_result
  1990. fi
  1991. $_G_rc_parse_options
  1992. }
  1993. # func_validate_options [ARG]...
  1994. # ------------------------------
  1995. # Perform any sanity checks on option settings and/or unconsumed
  1996. # arguments.
  1997. func_hookable func_validate_options
  1998. func_validate_options ()
  1999. {
  2000. $debug_cmd
  2001. _G_rc_validate_options=false
  2002. # Display all warnings if -W was not given.
  2003. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  2004. if func_run_hooks func_validate_options ${1+"$@"}; then
  2005. # save modified positional parameters for caller
  2006. func_validate_options_result=$func_run_hooks_result
  2007. _G_rc_validate_options=:
  2008. fi
  2009. # Bail if the options were screwed!
  2010. $exit_cmd $EXIT_FAILURE
  2011. $_G_rc_validate_options
  2012. }
  2013. ## ----------------- ##
  2014. ## Helper functions. ##
  2015. ## ----------------- ##
  2016. # This section contains the helper functions used by the rest of the
  2017. # hookable option parser framework in ascii-betical order.
  2018. # func_fatal_help ARG...
  2019. # ----------------------
  2020. # Echo program name prefixed message to standard error, followed by
  2021. # a help hint, and exit.
  2022. func_fatal_help ()
  2023. {
  2024. $debug_cmd
  2025. eval \$ECHO \""Usage: $usage"\"
  2026. eval \$ECHO \""$fatal_help"\"
  2027. func_error ${1+"$@"}
  2028. exit $EXIT_FAILURE
  2029. }
  2030. # func_help
  2031. # ---------
  2032. # Echo long help message to standard output and exit.
  2033. func_help ()
  2034. {
  2035. $debug_cmd
  2036. func_usage_message
  2037. $ECHO "$long_help_message"
  2038. exit 0
  2039. }
  2040. # func_missing_arg ARGNAME
  2041. # ------------------------
  2042. # Echo program name prefixed message to standard error and set global
  2043. # exit_cmd.
  2044. func_missing_arg ()
  2045. {
  2046. $debug_cmd
  2047. func_error "Missing argument for '$1'."
  2048. exit_cmd=exit
  2049. }
  2050. # func_split_equals STRING
  2051. # ------------------------
  2052. # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
  2053. # splitting STRING at the '=' sign.
  2054. test -z "$_G_HAVE_XSI_OPS" \
  2055. && (eval 'x=a/b/c;
  2056. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  2057. && _G_HAVE_XSI_OPS=yes
  2058. if test yes = "$_G_HAVE_XSI_OPS"
  2059. then
  2060. # This is an XSI compatible shell, allowing a faster implementation...
  2061. eval 'func_split_equals ()
  2062. {
  2063. $debug_cmd
  2064. func_split_equals_lhs=${1%%=*}
  2065. func_split_equals_rhs=${1#*=}
  2066. test "x$func_split_equals_lhs" = "x$1" \
  2067. && func_split_equals_rhs=
  2068. }'
  2069. else
  2070. # ...otherwise fall back to using expr, which is often a shell builtin.
  2071. func_split_equals ()
  2072. {
  2073. $debug_cmd
  2074. func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
  2075. func_split_equals_rhs=
  2076. test "x$func_split_equals_lhs" = "x$1" \
  2077. || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  2078. }
  2079. fi #func_split_equals
  2080. # func_split_short_opt SHORTOPT
  2081. # -----------------------------
  2082. # Set func_split_short_opt_name and func_split_short_opt_arg shell
  2083. # variables after splitting SHORTOPT after the 2nd character.
  2084. if test yes = "$_G_HAVE_XSI_OPS"
  2085. then
  2086. # This is an XSI compatible shell, allowing a faster implementation...
  2087. eval 'func_split_short_opt ()
  2088. {
  2089. $debug_cmd
  2090. func_split_short_opt_arg=${1#??}
  2091. func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  2092. }'
  2093. else
  2094. # ...otherwise fall back to using expr, which is often a shell builtin.
  2095. func_split_short_opt ()
  2096. {
  2097. $debug_cmd
  2098. func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
  2099. func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  2100. }
  2101. fi #func_split_short_opt
  2102. # func_usage
  2103. # ----------
  2104. # Echo short help message to standard output and exit.
  2105. func_usage ()
  2106. {
  2107. $debug_cmd
  2108. func_usage_message
  2109. $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
  2110. exit 0
  2111. }
  2112. # func_usage_message
  2113. # ------------------
  2114. # Echo short help message to standard output.
  2115. func_usage_message ()
  2116. {
  2117. $debug_cmd
  2118. eval \$ECHO \""Usage: $usage"\"
  2119. echo
  2120. $SED -n 's|^# ||
  2121. /^Written by/{
  2122. x;p;x
  2123. }
  2124. h
  2125. /^Written by/q' < "$progpath"
  2126. echo
  2127. eval \$ECHO \""$usage_message"\"
  2128. }
  2129. # func_version
  2130. # ------------
  2131. # Echo version message to standard output and exit.
  2132. func_version ()
  2133. {
  2134. $debug_cmd
  2135. printf '%s\n' "$progname $scriptversion"
  2136. $SED -n '
  2137. /(C)/!b go
  2138. :more
  2139. /\./!{
  2140. N
  2141. s|\n# | |
  2142. b more
  2143. }
  2144. :go
  2145. /^# Written by /,/# warranty; / {
  2146. s|^# ||
  2147. s|^# *$||
  2148. s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
  2149. p
  2150. }
  2151. /^# Written by / {
  2152. s|^# ||
  2153. p
  2154. }
  2155. /^warranty; /q' < "$progpath"
  2156. exit $?
  2157. }
  2158. # Local variables:
  2159. # mode: shell-script
  2160. # sh-indentation: 2
  2161. # eval: (add-hook 'before-save-hook 'time-stamp)
  2162. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  2163. # time-stamp-time-zone: "UTC"
  2164. # End:
  2165. # Set a version string.
  2166. scriptversion='(GNU libtool) 2.4.6'
  2167. # func_echo ARG...
  2168. # ----------------
  2169. # Libtool also displays the current mode in messages, so override
  2170. # funclib.sh func_echo with this custom definition.
  2171. func_echo ()
  2172. {
  2173. $debug_cmd
  2174. _G_message=$*
  2175. func_echo_IFS=$IFS
  2176. IFS=$nl
  2177. for _G_line in $_G_message; do
  2178. IFS=$func_echo_IFS
  2179. $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
  2180. done
  2181. IFS=$func_echo_IFS
  2182. }
  2183. # func_warning ARG...
  2184. # -------------------
  2185. # Libtool warnings are not categorized, so override funclib.sh
  2186. # func_warning with this simpler definition.
  2187. func_warning ()
  2188. {
  2189. $debug_cmd
  2190. $warning_func ${1+"$@"}
  2191. }
  2192. ## ---------------- ##
  2193. ## Options parsing. ##
  2194. ## ---------------- ##
  2195. # Hook in the functions to make sure our own options are parsed during
  2196. # the option parsing loop.
  2197. usage='$progpath [OPTION]... [MODE-ARG]...'
  2198. # Short help message in response to '-h'.
  2199. usage_message="Options:
  2200. --config show all configuration variables
  2201. --debug enable verbose shell tracing
  2202. -n, --dry-run display commands without modifying any files
  2203. --features display basic configuration information and exit
  2204. --mode=MODE use operation mode MODE
  2205. --no-warnings equivalent to '-Wnone'
  2206. --preserve-dup-deps don't remove duplicate dependency libraries
  2207. --quiet, --silent don't print informational messages
  2208. --tag=TAG use configuration variables from tag TAG
  2209. -v, --verbose print more informational messages than default
  2210. --version print version information
  2211. -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
  2212. -h, --help, --help-all print short, long, or detailed help message
  2213. "
  2214. # Additional text appended to 'usage_message' in response to '--help'.
  2215. func_help ()
  2216. {
  2217. $debug_cmd
  2218. func_usage_message
  2219. $ECHO "$long_help_message
  2220. MODE must be one of the following:
  2221. clean remove files from the build directory
  2222. compile compile a source file into a libtool object
  2223. execute automatically set library path, then run a program
  2224. finish complete the installation of libtool libraries
  2225. install install libraries or executables
  2226. link create a library or an executable
  2227. uninstall remove libraries from an installed directory
  2228. MODE-ARGS vary depending on the MODE. When passed as first option,
  2229. '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
  2230. Try '$progname --help --mode=MODE' for a more detailed description of MODE.
  2231. When reporting a bug, please describe a test case to reproduce it and
  2232. include the following information:
  2233. host-triplet: $host
  2234. shell: $SHELL
  2235. compiler: $LTCC
  2236. compiler flags: $LTCFLAGS
  2237. linker: $LD (gnu? $with_gnu_ld)
  2238. version: $progname $scriptversion Debian-2.4.6-2.1
  2239. automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
  2240. autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
  2241. Report bugs to <bug-libtool@gnu.org>.
  2242. GNU libtool home page: <http://www.gnu.org/s/libtool/>.
  2243. General help using GNU software: <http://www.gnu.org/gethelp/>."
  2244. exit 0
  2245. }
  2246. # func_lo2o OBJECT-NAME
  2247. # ---------------------
  2248. # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
  2249. # object suffix.
  2250. lo2o=s/\\.lo\$/.$objext/
  2251. o2lo=s/\\.$objext\$/.lo/
  2252. if test yes = "$_G_HAVE_XSI_OPS"; then
  2253. eval 'func_lo2o ()
  2254. {
  2255. case $1 in
  2256. *.lo) func_lo2o_result=${1%.lo}.$objext ;;
  2257. * ) func_lo2o_result=$1 ;;
  2258. esac
  2259. }'
  2260. # func_xform LIBOBJ-OR-SOURCE
  2261. # ---------------------------
  2262. # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
  2263. # suffix to a '.lo' libtool-object suffix.
  2264. eval 'func_xform ()
  2265. {
  2266. func_xform_result=${1%.*}.lo
  2267. }'
  2268. else
  2269. # ...otherwise fall back to using sed.
  2270. func_lo2o ()
  2271. {
  2272. func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
  2273. }
  2274. func_xform ()
  2275. {
  2276. func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
  2277. }
  2278. fi
  2279. # func_fatal_configuration ARG...
  2280. # -------------------------------
  2281. # Echo program name prefixed message to standard error, followed by
  2282. # a configuration failure hint, and exit.
  2283. func_fatal_configuration ()
  2284. {
  2285. func__fatal_error ${1+"$@"} \
  2286. "See the $PACKAGE documentation for more information." \
  2287. "Fatal configuration error."
  2288. }
  2289. # func_config
  2290. # -----------
  2291. # Display the configuration for all the tags in this script.
  2292. func_config ()
  2293. {
  2294. re_begincf='^# ### BEGIN LIBTOOL'
  2295. re_endcf='^# ### END LIBTOOL'
  2296. # Default configuration.
  2297. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  2298. # Now print the configurations for the tags.
  2299. for tagname in $taglist; do
  2300. $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  2301. done
  2302. exit $?
  2303. }
  2304. # func_features
  2305. # -------------
  2306. # Display the features supported by this script.
  2307. func_features ()
  2308. {
  2309. echo "host: $host"
  2310. if test yes = "$build_libtool_libs"; then
  2311. echo "enable shared libraries"
  2312. else
  2313. echo "disable shared libraries"
  2314. fi
  2315. if test yes = "$build_old_libs"; then
  2316. echo "enable static libraries"
  2317. else
  2318. echo "disable static libraries"
  2319. fi
  2320. exit $?
  2321. }
  2322. # func_enable_tag TAGNAME
  2323. # -----------------------
  2324. # Verify that TAGNAME is valid, and either flag an error and exit, or
  2325. # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  2326. # variable here.
  2327. func_enable_tag ()
  2328. {
  2329. # Global variable:
  2330. tagname=$1
  2331. re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  2332. re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  2333. sed_extractcf=/$re_begincf/,/$re_endcf/p
  2334. # Validate tagname.
  2335. case $tagname in
  2336. *[!-_A-Za-z0-9,/]*)
  2337. func_fatal_error "invalid tag name: $tagname"
  2338. ;;
  2339. esac
  2340. # Don't test for the "default" C tag, as we know it's
  2341. # there but not specially marked.
  2342. case $tagname in
  2343. CC) ;;
  2344. *)
  2345. if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  2346. taglist="$taglist $tagname"
  2347. # Evaluate the configuration. Be careful to quote the path
  2348. # and the sed script, to avoid splitting on whitespace, but
  2349. # also don't use non-portable quotes within backquotes within
  2350. # quotes we have to do it in 2 steps:
  2351. extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  2352. eval "$extractedcf"
  2353. else
  2354. func_error "ignoring unknown tag $tagname"
  2355. fi
  2356. ;;
  2357. esac
  2358. }
  2359. # func_check_version_match
  2360. # ------------------------
  2361. # Ensure that we are using m4 macros, and libtool script from the same
  2362. # release of libtool.
  2363. func_check_version_match ()
  2364. {
  2365. if test "$package_revision" != "$macro_revision"; then
  2366. if test "$VERSION" != "$macro_version"; then
  2367. if test -z "$macro_version"; then
  2368. cat >&2 <<_LT_EOF
  2369. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2370. $progname: definition of this LT_INIT comes from an older release.
  2371. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2372. $progname: and run autoconf again.
  2373. _LT_EOF
  2374. else
  2375. cat >&2 <<_LT_EOF
  2376. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2377. $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  2378. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2379. $progname: and run autoconf again.
  2380. _LT_EOF
  2381. fi
  2382. else
  2383. cat >&2 <<_LT_EOF
  2384. $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  2385. $progname: but the definition of this LT_INIT comes from revision $macro_revision.
  2386. $progname: You should recreate aclocal.m4 with macros from revision $package_revision
  2387. $progname: of $PACKAGE $VERSION and run autoconf again.
  2388. _LT_EOF
  2389. fi
  2390. exit $EXIT_MISMATCH
  2391. fi
  2392. }
  2393. # libtool_options_prep [ARG]...
  2394. # -----------------------------
  2395. # Preparation for options parsed by libtool.
  2396. libtool_options_prep ()
  2397. {
  2398. $debug_mode
  2399. # Option defaults:
  2400. opt_config=false
  2401. opt_dlopen=
  2402. opt_dry_run=false
  2403. opt_help=false
  2404. opt_mode=
  2405. opt_preserve_dup_deps=false
  2406. opt_quiet=false
  2407. nonopt=
  2408. preserve_args=
  2409. _G_rc_lt_options_prep=:
  2410. # Shorthand for --mode=foo, only valid as the first argument
  2411. case $1 in
  2412. clean|clea|cle|cl)
  2413. shift; set dummy --mode clean ${1+"$@"}; shift
  2414. ;;
  2415. compile|compil|compi|comp|com|co|c)
  2416. shift; set dummy --mode compile ${1+"$@"}; shift
  2417. ;;
  2418. execute|execut|execu|exec|exe|ex|e)
  2419. shift; set dummy --mode execute ${1+"$@"}; shift
  2420. ;;
  2421. finish|finis|fini|fin|fi|f)
  2422. shift; set dummy --mode finish ${1+"$@"}; shift
  2423. ;;
  2424. install|instal|insta|inst|ins|in|i)
  2425. shift; set dummy --mode install ${1+"$@"}; shift
  2426. ;;
  2427. link|lin|li|l)
  2428. shift; set dummy --mode link ${1+"$@"}; shift
  2429. ;;
  2430. uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  2431. shift; set dummy --mode uninstall ${1+"$@"}; shift
  2432. ;;
  2433. *)
  2434. _G_rc_lt_options_prep=false
  2435. ;;
  2436. esac
  2437. if $_G_rc_lt_options_prep; then
  2438. # Pass back the list of options.
  2439. func_quote eval ${1+"$@"}
  2440. libtool_options_prep_result=$func_quote_result
  2441. fi
  2442. $_G_rc_lt_options_prep
  2443. }
  2444. func_add_hook func_options_prep libtool_options_prep
  2445. # libtool_parse_options [ARG]...
  2446. # ---------------------------------
  2447. # Provide handling for libtool specific options.
  2448. libtool_parse_options ()
  2449. {
  2450. $debug_cmd
  2451. _G_rc_lt_parse_options=false
  2452. # Perform our own loop to consume as many options as possible in
  2453. # each iteration.
  2454. while test $# -gt 0; do
  2455. _G_match_lt_parse_options=:
  2456. _G_opt=$1
  2457. shift
  2458. case $_G_opt in
  2459. --dry-run|--dryrun|-n)
  2460. opt_dry_run=:
  2461. ;;
  2462. --config) func_config ;;
  2463. --dlopen|-dlopen)
  2464. opt_dlopen="${opt_dlopen+$opt_dlopen
  2465. }$1"
  2466. shift
  2467. ;;
  2468. --preserve-dup-deps)
  2469. opt_preserve_dup_deps=: ;;
  2470. --features) func_features ;;
  2471. --finish) set dummy --mode finish ${1+"$@"}; shift ;;
  2472. --help) opt_help=: ;;
  2473. --help-all) opt_help=': help-all' ;;
  2474. --mode) test $# = 0 && func_missing_arg $_G_opt && break
  2475. opt_mode=$1
  2476. case $1 in
  2477. # Valid mode arguments:
  2478. clean|compile|execute|finish|install|link|relink|uninstall) ;;
  2479. # Catch anything else as an error
  2480. *) func_error "invalid argument for $_G_opt"
  2481. exit_cmd=exit
  2482. break
  2483. ;;
  2484. esac
  2485. shift
  2486. ;;
  2487. --no-silent|--no-quiet)
  2488. opt_quiet=false
  2489. func_append preserve_args " $_G_opt"
  2490. ;;
  2491. --no-warnings|--no-warning|--no-warn)
  2492. opt_warning=false
  2493. func_append preserve_args " $_G_opt"
  2494. ;;
  2495. --no-verbose)
  2496. opt_verbose=false
  2497. func_append preserve_args " $_G_opt"
  2498. ;;
  2499. --silent|--quiet)
  2500. opt_quiet=:
  2501. opt_verbose=false
  2502. func_append preserve_args " $_G_opt"
  2503. ;;
  2504. --tag) test $# = 0 && func_missing_arg $_G_opt && break
  2505. opt_tag=$1
  2506. func_append preserve_args " $_G_opt $1"
  2507. func_enable_tag "$1"
  2508. shift
  2509. ;;
  2510. --verbose|-v) opt_quiet=false
  2511. opt_verbose=:
  2512. func_append preserve_args " $_G_opt"
  2513. ;;
  2514. # An option not handled by this hook function:
  2515. *) set dummy "$_G_opt" ${1+"$@"} ; shift
  2516. _G_match_lt_parse_options=false
  2517. break
  2518. ;;
  2519. esac
  2520. $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
  2521. done
  2522. if $_G_rc_lt_parse_options; then
  2523. # save modified positional parameters for caller
  2524. func_quote eval ${1+"$@"}
  2525. libtool_parse_options_result=$func_quote_result
  2526. fi
  2527. $_G_rc_lt_parse_options
  2528. }
  2529. func_add_hook func_parse_options libtool_parse_options
  2530. # libtool_validate_options [ARG]...
  2531. # ---------------------------------
  2532. # Perform any sanity checks on option settings and/or unconsumed
  2533. # arguments.
  2534. libtool_validate_options ()
  2535. {
  2536. # save first non-option argument
  2537. if test 0 -lt $#; then
  2538. nonopt=$1
  2539. shift
  2540. fi
  2541. # preserve --debug
  2542. test : = "$debug_cmd" || func_append preserve_args " --debug"
  2543. case $host in
  2544. # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
  2545. # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
  2546. *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
  2547. # don't eliminate duplications in $postdeps and $predeps
  2548. opt_duplicate_compiler_generated_deps=:
  2549. ;;
  2550. *)
  2551. opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  2552. ;;
  2553. esac
  2554. $opt_help || {
  2555. # Sanity checks first:
  2556. func_check_version_match
  2557. test yes != "$build_libtool_libs" \
  2558. && test yes != "$build_old_libs" \
  2559. && func_fatal_configuration "not configured to build any kind of library"
  2560. # Darwin sucks
  2561. eval std_shrext=\"$shrext_cmds\"
  2562. # Only execute mode is allowed to have -dlopen flags.
  2563. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
  2564. func_error "unrecognized option '-dlopen'"
  2565. $ECHO "$help" 1>&2
  2566. exit $EXIT_FAILURE
  2567. fi
  2568. # Change the help message to a mode-specific one.
  2569. generic_help=$help
  2570. help="Try '$progname --help --mode=$opt_mode' for more information."
  2571. }
  2572. # Pass back the unparsed argument list
  2573. func_quote eval ${1+"$@"}
  2574. libtool_validate_options_result=$func_quote_result
  2575. }
  2576. func_add_hook func_validate_options libtool_validate_options
  2577. # Process options as early as possible so that --help and --version
  2578. # can return quickly.
  2579. func_options ${1+"$@"}
  2580. eval set dummy "$func_options_result"; shift
  2581. ## ----------- ##
  2582. ## Main. ##
  2583. ## ----------- ##
  2584. magic='%%%MAGIC variable%%%'
  2585. magic_exe='%%%MAGIC EXE variable%%%'
  2586. # Global variables.
  2587. extracted_archives=
  2588. extracted_serial=0
  2589. # If this variable is set in any of the actions, the command in it
  2590. # will be execed at the end. This prevents here-documents from being
  2591. # left over by shells.
  2592. exec_cmd=
  2593. # A function that is used when there is no print builtin or printf.
  2594. func_fallback_echo ()
  2595. {
  2596. eval 'cat <<_LTECHO_EOF
  2597. $1
  2598. _LTECHO_EOF'
  2599. }
  2600. # func_generated_by_libtool
  2601. # True iff stdin has been generated by Libtool. This function is only
  2602. # a basic sanity check; it will hardly flush out determined imposters.
  2603. func_generated_by_libtool_p ()
  2604. {
  2605. $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  2606. }
  2607. # func_lalib_p file
  2608. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2609. # This function is only a basic sanity check; it will hardly flush out
  2610. # determined imposters.
  2611. func_lalib_p ()
  2612. {
  2613. test -f "$1" &&
  2614. $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
  2615. }
  2616. # func_lalib_unsafe_p file
  2617. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2618. # This function implements the same check as func_lalib_p without
  2619. # resorting to external programs. To this end, it redirects stdin and
  2620. # closes it afterwards, without saving the original file descriptor.
  2621. # As a safety measure, use it only where a negative result would be
  2622. # fatal anyway. Works if 'file' does not exist.
  2623. func_lalib_unsafe_p ()
  2624. {
  2625. lalib_p=no
  2626. if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  2627. for lalib_p_l in 1 2 3 4
  2628. do
  2629. read lalib_p_line
  2630. case $lalib_p_line in
  2631. \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  2632. esac
  2633. done
  2634. exec 0<&5 5<&-
  2635. fi
  2636. test yes = "$lalib_p"
  2637. }
  2638. # func_ltwrapper_script_p file
  2639. # True iff FILE is a libtool wrapper script
  2640. # This function is only a basic sanity check; it will hardly flush out
  2641. # determined imposters.
  2642. func_ltwrapper_script_p ()
  2643. {
  2644. test -f "$1" &&
  2645. $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
  2646. }
  2647. # func_ltwrapper_executable_p file
  2648. # True iff FILE is a libtool wrapper executable
  2649. # This function is only a basic sanity check; it will hardly flush out
  2650. # determined imposters.
  2651. func_ltwrapper_executable_p ()
  2652. {
  2653. func_ltwrapper_exec_suffix=
  2654. case $1 in
  2655. *.exe) ;;
  2656. *) func_ltwrapper_exec_suffix=.exe ;;
  2657. esac
  2658. $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  2659. }
  2660. # func_ltwrapper_scriptname file
  2661. # Assumes file is an ltwrapper_executable
  2662. # uses $file to determine the appropriate filename for a
  2663. # temporary ltwrapper_script.
  2664. func_ltwrapper_scriptname ()
  2665. {
  2666. func_dirname_and_basename "$1" "" "."
  2667. func_stripname '' '.exe' "$func_basename_result"
  2668. func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
  2669. }
  2670. # func_ltwrapper_p file
  2671. # True iff FILE is a libtool wrapper script or wrapper executable
  2672. # This function is only a basic sanity check; it will hardly flush out
  2673. # determined imposters.
  2674. func_ltwrapper_p ()
  2675. {
  2676. func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  2677. }
  2678. # func_execute_cmds commands fail_cmd
  2679. # Execute tilde-delimited COMMANDS.
  2680. # If FAIL_CMD is given, eval that upon failure.
  2681. # FAIL_CMD may read-access the current command in variable CMD!
  2682. func_execute_cmds ()
  2683. {
  2684. $debug_cmd
  2685. save_ifs=$IFS; IFS='~'
  2686. for cmd in $1; do
  2687. IFS=$sp$nl
  2688. eval cmd=\"$cmd\"
  2689. IFS=$save_ifs
  2690. func_show_eval "$cmd" "${2-:}"
  2691. done
  2692. IFS=$save_ifs
  2693. }
  2694. # func_source file
  2695. # Source FILE, adding directory component if necessary.
  2696. # Note that it is not necessary on cygwin/mingw to append a dot to
  2697. # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  2698. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  2699. # 'FILE.' does not work on cygwin managed mounts.
  2700. func_source ()
  2701. {
  2702. $debug_cmd
  2703. case $1 in
  2704. */* | *\\*) . "$1" ;;
  2705. *) . "./$1" ;;
  2706. esac
  2707. }
  2708. # func_resolve_sysroot PATH
  2709. # Replace a leading = in PATH with a sysroot. Store the result into
  2710. # func_resolve_sysroot_result
  2711. func_resolve_sysroot ()
  2712. {
  2713. func_resolve_sysroot_result=$1
  2714. case $func_resolve_sysroot_result in
  2715. =*)
  2716. func_stripname '=' '' "$func_resolve_sysroot_result"
  2717. func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
  2718. ;;
  2719. esac
  2720. }
  2721. # func_replace_sysroot PATH
  2722. # If PATH begins with the sysroot, replace it with = and
  2723. # store the result into func_replace_sysroot_result.
  2724. func_replace_sysroot ()
  2725. {
  2726. case $lt_sysroot:$1 in
  2727. ?*:"$lt_sysroot"*)
  2728. func_stripname "$lt_sysroot" '' "$1"
  2729. func_replace_sysroot_result='='$func_stripname_result
  2730. ;;
  2731. *)
  2732. # Including no sysroot.
  2733. func_replace_sysroot_result=$1
  2734. ;;
  2735. esac
  2736. }
  2737. # func_infer_tag arg
  2738. # Infer tagged configuration to use if any are available and
  2739. # if one wasn't chosen via the "--tag" command line option.
  2740. # Only attempt this if the compiler in the base compile
  2741. # command doesn't match the default compiler.
  2742. # arg is usually of the form 'gcc ...'
  2743. func_infer_tag ()
  2744. {
  2745. $debug_cmd
  2746. if test -n "$available_tags" && test -z "$tagname"; then
  2747. CC_quoted=
  2748. for arg in $CC; do
  2749. func_append_quoted CC_quoted "$arg"
  2750. done
  2751. CC_expanded=`func_echo_all $CC`
  2752. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2753. case $@ in
  2754. # Blanks in the command may have been stripped by the calling shell,
  2755. # but not from the CC environment variable when configure was run.
  2756. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2757. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
  2758. # Blanks at the start of $base_compile will cause this to fail
  2759. # if we don't check for them as well.
  2760. *)
  2761. for z in $available_tags; do
  2762. if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  2763. # Evaluate the configuration.
  2764. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  2765. CC_quoted=
  2766. for arg in $CC; do
  2767. # Double-quote args containing other shell metacharacters.
  2768. func_append_quoted CC_quoted "$arg"
  2769. done
  2770. CC_expanded=`func_echo_all $CC`
  2771. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2772. case "$@ " in
  2773. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2774. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
  2775. # The compiler in the base compile command matches
  2776. # the one in the tagged configuration.
  2777. # Assume this is the tagged configuration we want.
  2778. tagname=$z
  2779. break
  2780. ;;
  2781. esac
  2782. fi
  2783. done
  2784. # If $tagname still isn't set, then no tagged configuration
  2785. # was found and let the user know that the "--tag" command
  2786. # line option must be used.
  2787. if test -z "$tagname"; then
  2788. func_echo "unable to infer tagged configuration"
  2789. func_fatal_error "specify a tag with '--tag'"
  2790. # else
  2791. # func_verbose "using $tagname tagged configuration"
  2792. fi
  2793. ;;
  2794. esac
  2795. fi
  2796. }
  2797. # func_write_libtool_object output_name pic_name nonpic_name
  2798. # Create a libtool object file (analogous to a ".la" file),
  2799. # but don't create it if we're doing a dry run.
  2800. func_write_libtool_object ()
  2801. {
  2802. write_libobj=$1
  2803. if test yes = "$build_libtool_libs"; then
  2804. write_lobj=\'$2\'
  2805. else
  2806. write_lobj=none
  2807. fi
  2808. if test yes = "$build_old_libs"; then
  2809. write_oldobj=\'$3\'
  2810. else
  2811. write_oldobj=none
  2812. fi
  2813. $opt_dry_run || {
  2814. cat >${write_libobj}T <<EOF
  2815. # $write_libobj - a libtool object file
  2816. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  2817. #
  2818. # Please DO NOT delete this file!
  2819. # It is necessary for linking the library.
  2820. # Name of the PIC object.
  2821. pic_object=$write_lobj
  2822. # Name of the non-PIC object
  2823. non_pic_object=$write_oldobj
  2824. EOF
  2825. $MV "${write_libobj}T" "$write_libobj"
  2826. }
  2827. }
  2828. ##################################################
  2829. # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
  2830. ##################################################
  2831. # func_convert_core_file_wine_to_w32 ARG
  2832. # Helper function used by file name conversion functions when $build is *nix,
  2833. # and $host is mingw, cygwin, or some other w32 environment. Relies on a
  2834. # correctly configured wine environment available, with the winepath program
  2835. # in $build's $PATH.
  2836. #
  2837. # ARG is the $build file name to be converted to w32 format.
  2838. # Result is available in $func_convert_core_file_wine_to_w32_result, and will
  2839. # be empty on error (or when ARG is empty)
  2840. func_convert_core_file_wine_to_w32 ()
  2841. {
  2842. $debug_cmd
  2843. func_convert_core_file_wine_to_w32_result=$1
  2844. if test -n "$1"; then
  2845. # Unfortunately, winepath does not exit with a non-zero error code, so we
  2846. # are forced to check the contents of stdout. On the other hand, if the
  2847. # command is not found, the shell will set an exit code of 127 and print
  2848. # *an error message* to stdout. So we must check for both error code of
  2849. # zero AND non-empty stdout, which explains the odd construction:
  2850. func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
  2851. if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
  2852. func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
  2853. $SED -e "$sed_naive_backslashify"`
  2854. else
  2855. func_convert_core_file_wine_to_w32_result=
  2856. fi
  2857. fi
  2858. }
  2859. # end: func_convert_core_file_wine_to_w32
  2860. # func_convert_core_path_wine_to_w32 ARG
  2861. # Helper function used by path conversion functions when $build is *nix, and
  2862. # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
  2863. # configured wine environment available, with the winepath program in $build's
  2864. # $PATH. Assumes ARG has no leading or trailing path separator characters.
  2865. #
  2866. # ARG is path to be converted from $build format to win32.
  2867. # Result is available in $func_convert_core_path_wine_to_w32_result.
  2868. # Unconvertible file (directory) names in ARG are skipped; if no directory names
  2869. # are convertible, then the result may be empty.
  2870. func_convert_core_path_wine_to_w32 ()
  2871. {
  2872. $debug_cmd
  2873. # unfortunately, winepath doesn't convert paths, only file names
  2874. func_convert_core_path_wine_to_w32_result=
  2875. if test -n "$1"; then
  2876. oldIFS=$IFS
  2877. IFS=:
  2878. for func_convert_core_path_wine_to_w32_f in $1; do
  2879. IFS=$oldIFS
  2880. func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
  2881. if test -n "$func_convert_core_file_wine_to_w32_result"; then
  2882. if test -z "$func_convert_core_path_wine_to_w32_result"; then
  2883. func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
  2884. else
  2885. func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
  2886. fi
  2887. fi
  2888. done
  2889. IFS=$oldIFS
  2890. fi
  2891. }
  2892. # end: func_convert_core_path_wine_to_w32
  2893. # func_cygpath ARGS...
  2894. # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
  2895. # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
  2896. # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
  2897. # (2), returns the Cygwin file name or path in func_cygpath_result (input
  2898. # file name or path is assumed to be in w32 format, as previously converted
  2899. # from $build's *nix or MSYS format). In case (3), returns the w32 file name
  2900. # or path in func_cygpath_result (input file name or path is assumed to be in
  2901. # Cygwin format). Returns an empty string on error.
  2902. #
  2903. # ARGS are passed to cygpath, with the last one being the file name or path to
  2904. # be converted.
  2905. #
  2906. # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
  2907. # environment variable; do not put it in $PATH.
  2908. func_cygpath ()
  2909. {
  2910. $debug_cmd
  2911. if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
  2912. func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
  2913. if test "$?" -ne 0; then
  2914. # on failure, ensure result is empty
  2915. func_cygpath_result=
  2916. fi
  2917. else
  2918. func_cygpath_result=
  2919. func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  2920. fi
  2921. }
  2922. #end: func_cygpath
  2923. # func_convert_core_msys_to_w32 ARG
  2924. # Convert file name or path ARG from MSYS format to w32 format. Return
  2925. # result in func_convert_core_msys_to_w32_result.
  2926. func_convert_core_msys_to_w32 ()
  2927. {
  2928. $debug_cmd
  2929. # awkward: cmd appends spaces to result
  2930. func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
  2931. $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
  2932. }
  2933. #end: func_convert_core_msys_to_w32
  2934. # func_convert_file_check ARG1 ARG2
  2935. # Verify that ARG1 (a file name in $build format) was converted to $host
  2936. # format in ARG2. Otherwise, emit an error message, but continue (resetting
  2937. # func_to_host_file_result to ARG1).
  2938. func_convert_file_check ()
  2939. {
  2940. $debug_cmd
  2941. if test -z "$2" && test -n "$1"; then
  2942. func_error "Could not determine host file name corresponding to"
  2943. func_error " '$1'"
  2944. func_error "Continuing, but uninstalled executables may not work."
  2945. # Fallback:
  2946. func_to_host_file_result=$1
  2947. fi
  2948. }
  2949. # end func_convert_file_check
  2950. # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
  2951. # Verify that FROM_PATH (a path in $build format) was converted to $host
  2952. # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
  2953. # func_to_host_file_result to a simplistic fallback value (see below).
  2954. func_convert_path_check ()
  2955. {
  2956. $debug_cmd
  2957. if test -z "$4" && test -n "$3"; then
  2958. func_error "Could not determine the host path corresponding to"
  2959. func_error " '$3'"
  2960. func_error "Continuing, but uninstalled executables may not work."
  2961. # Fallback. This is a deliberately simplistic "conversion" and
  2962. # should not be "improved". See libtool.info.
  2963. if test "x$1" != "x$2"; then
  2964. lt_replace_pathsep_chars="s|$1|$2|g"
  2965. func_to_host_path_result=`echo "$3" |
  2966. $SED -e "$lt_replace_pathsep_chars"`
  2967. else
  2968. func_to_host_path_result=$3
  2969. fi
  2970. fi
  2971. }
  2972. # end func_convert_path_check
  2973. # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
  2974. # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
  2975. # and appending REPL if ORIG matches BACKPAT.
  2976. func_convert_path_front_back_pathsep ()
  2977. {
  2978. $debug_cmd
  2979. case $4 in
  2980. $1 ) func_to_host_path_result=$3$func_to_host_path_result
  2981. ;;
  2982. esac
  2983. case $4 in
  2984. $2 ) func_append func_to_host_path_result "$3"
  2985. ;;
  2986. esac
  2987. }
  2988. # end func_convert_path_front_back_pathsep
  2989. ##################################################
  2990. # $build to $host FILE NAME CONVERSION FUNCTIONS #
  2991. ##################################################
  2992. # invoked via '$to_host_file_cmd ARG'
  2993. #
  2994. # In each case, ARG is the path to be converted from $build to $host format.
  2995. # Result will be available in $func_to_host_file_result.
  2996. # func_to_host_file ARG
  2997. # Converts the file name ARG from $build format to $host format. Return result
  2998. # in func_to_host_file_result.
  2999. func_to_host_file ()
  3000. {
  3001. $debug_cmd
  3002. $to_host_file_cmd "$1"
  3003. }
  3004. # end func_to_host_file
  3005. # func_to_tool_file ARG LAZY
  3006. # converts the file name ARG from $build format to toolchain format. Return
  3007. # result in func_to_tool_file_result. If the conversion in use is listed
  3008. # in (the comma separated) LAZY, no conversion takes place.
  3009. func_to_tool_file ()
  3010. {
  3011. $debug_cmd
  3012. case ,$2, in
  3013. *,"$to_tool_file_cmd",*)
  3014. func_to_tool_file_result=$1
  3015. ;;
  3016. *)
  3017. $to_tool_file_cmd "$1"
  3018. func_to_tool_file_result=$func_to_host_file_result
  3019. ;;
  3020. esac
  3021. }
  3022. # end func_to_tool_file
  3023. # func_convert_file_noop ARG
  3024. # Copy ARG to func_to_host_file_result.
  3025. func_convert_file_noop ()
  3026. {
  3027. func_to_host_file_result=$1
  3028. }
  3029. # end func_convert_file_noop
  3030. # func_convert_file_msys_to_w32 ARG
  3031. # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3032. # conversion to w32 is not available inside the cwrapper. Returns result in
  3033. # func_to_host_file_result.
  3034. func_convert_file_msys_to_w32 ()
  3035. {
  3036. $debug_cmd
  3037. func_to_host_file_result=$1
  3038. if test -n "$1"; then
  3039. func_convert_core_msys_to_w32 "$1"
  3040. func_to_host_file_result=$func_convert_core_msys_to_w32_result
  3041. fi
  3042. func_convert_file_check "$1" "$func_to_host_file_result"
  3043. }
  3044. # end func_convert_file_msys_to_w32
  3045. # func_convert_file_cygwin_to_w32 ARG
  3046. # Convert file name ARG from Cygwin to w32 format. Returns result in
  3047. # func_to_host_file_result.
  3048. func_convert_file_cygwin_to_w32 ()
  3049. {
  3050. $debug_cmd
  3051. func_to_host_file_result=$1
  3052. if test -n "$1"; then
  3053. # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
  3054. # LT_CYGPATH in this case.
  3055. func_to_host_file_result=`cygpath -m "$1"`
  3056. fi
  3057. func_convert_file_check "$1" "$func_to_host_file_result"
  3058. }
  3059. # end func_convert_file_cygwin_to_w32
  3060. # func_convert_file_nix_to_w32 ARG
  3061. # Convert file name ARG from *nix to w32 format. Requires a wine environment
  3062. # and a working winepath. Returns result in func_to_host_file_result.
  3063. func_convert_file_nix_to_w32 ()
  3064. {
  3065. $debug_cmd
  3066. func_to_host_file_result=$1
  3067. if test -n "$1"; then
  3068. func_convert_core_file_wine_to_w32 "$1"
  3069. func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  3070. fi
  3071. func_convert_file_check "$1" "$func_to_host_file_result"
  3072. }
  3073. # end func_convert_file_nix_to_w32
  3074. # func_convert_file_msys_to_cygwin ARG
  3075. # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  3076. # Returns result in func_to_host_file_result.
  3077. func_convert_file_msys_to_cygwin ()
  3078. {
  3079. $debug_cmd
  3080. func_to_host_file_result=$1
  3081. if test -n "$1"; then
  3082. func_convert_core_msys_to_w32 "$1"
  3083. func_cygpath -u "$func_convert_core_msys_to_w32_result"
  3084. func_to_host_file_result=$func_cygpath_result
  3085. fi
  3086. func_convert_file_check "$1" "$func_to_host_file_result"
  3087. }
  3088. # end func_convert_file_msys_to_cygwin
  3089. # func_convert_file_nix_to_cygwin ARG
  3090. # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
  3091. # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
  3092. # in func_to_host_file_result.
  3093. func_convert_file_nix_to_cygwin ()
  3094. {
  3095. $debug_cmd
  3096. func_to_host_file_result=$1
  3097. if test -n "$1"; then
  3098. # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
  3099. func_convert_core_file_wine_to_w32 "$1"
  3100. func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
  3101. func_to_host_file_result=$func_cygpath_result
  3102. fi
  3103. func_convert_file_check "$1" "$func_to_host_file_result"
  3104. }
  3105. # end func_convert_file_nix_to_cygwin
  3106. #############################################
  3107. # $build to $host PATH CONVERSION FUNCTIONS #
  3108. #############################################
  3109. # invoked via '$to_host_path_cmd ARG'
  3110. #
  3111. # In each case, ARG is the path to be converted from $build to $host format.
  3112. # The result will be available in $func_to_host_path_result.
  3113. #
  3114. # Path separators are also converted from $build format to $host format. If
  3115. # ARG begins or ends with a path separator character, it is preserved (but
  3116. # converted to $host format) on output.
  3117. #
  3118. # All path conversion functions are named using the following convention:
  3119. # file name conversion function : func_convert_file_X_to_Y ()
  3120. # path conversion function : func_convert_path_X_to_Y ()
  3121. # where, for any given $build/$host combination the 'X_to_Y' value is the
  3122. # same. If conversion functions are added for new $build/$host combinations,
  3123. # the two new functions must follow this pattern, or func_init_to_host_path_cmd
  3124. # will break.
  3125. # func_init_to_host_path_cmd
  3126. # Ensures that function "pointer" variable $to_host_path_cmd is set to the
  3127. # appropriate value, based on the value of $to_host_file_cmd.
  3128. to_host_path_cmd=
  3129. func_init_to_host_path_cmd ()
  3130. {
  3131. $debug_cmd
  3132. if test -z "$to_host_path_cmd"; then
  3133. func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
  3134. to_host_path_cmd=func_convert_path_$func_stripname_result
  3135. fi
  3136. }
  3137. # func_to_host_path ARG
  3138. # Converts the path ARG from $build format to $host format. Return result
  3139. # in func_to_host_path_result.
  3140. func_to_host_path ()
  3141. {
  3142. $debug_cmd
  3143. func_init_to_host_path_cmd
  3144. $to_host_path_cmd "$1"
  3145. }
  3146. # end func_to_host_path
  3147. # func_convert_path_noop ARG
  3148. # Copy ARG to func_to_host_path_result.
  3149. func_convert_path_noop ()
  3150. {
  3151. func_to_host_path_result=$1
  3152. }
  3153. # end func_convert_path_noop
  3154. # func_convert_path_msys_to_w32 ARG
  3155. # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3156. # conversion to w32 is not available inside the cwrapper. Returns result in
  3157. # func_to_host_path_result.
  3158. func_convert_path_msys_to_w32 ()
  3159. {
  3160. $debug_cmd
  3161. func_to_host_path_result=$1
  3162. if test -n "$1"; then
  3163. # Remove leading and trailing path separator characters from ARG. MSYS
  3164. # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
  3165. # and winepath ignores them completely.
  3166. func_stripname : : "$1"
  3167. func_to_host_path_tmp1=$func_stripname_result
  3168. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3169. func_to_host_path_result=$func_convert_core_msys_to_w32_result
  3170. func_convert_path_check : ";" \
  3171. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3172. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3173. fi
  3174. }
  3175. # end func_convert_path_msys_to_w32
  3176. # func_convert_path_cygwin_to_w32 ARG
  3177. # Convert path ARG from Cygwin to w32 format. Returns result in
  3178. # func_to_host_file_result.
  3179. func_convert_path_cygwin_to_w32 ()
  3180. {
  3181. $debug_cmd
  3182. func_to_host_path_result=$1
  3183. if test -n "$1"; then
  3184. # See func_convert_path_msys_to_w32:
  3185. func_stripname : : "$1"
  3186. func_to_host_path_tmp1=$func_stripname_result
  3187. func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
  3188. func_convert_path_check : ";" \
  3189. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3190. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3191. fi
  3192. }
  3193. # end func_convert_path_cygwin_to_w32
  3194. # func_convert_path_nix_to_w32 ARG
  3195. # Convert path ARG from *nix to w32 format. Requires a wine environment and
  3196. # a working winepath. Returns result in func_to_host_file_result.
  3197. func_convert_path_nix_to_w32 ()
  3198. {
  3199. $debug_cmd
  3200. func_to_host_path_result=$1
  3201. if test -n "$1"; then
  3202. # See func_convert_path_msys_to_w32:
  3203. func_stripname : : "$1"
  3204. func_to_host_path_tmp1=$func_stripname_result
  3205. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3206. func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
  3207. func_convert_path_check : ";" \
  3208. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3209. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3210. fi
  3211. }
  3212. # end func_convert_path_nix_to_w32
  3213. # func_convert_path_msys_to_cygwin ARG
  3214. # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  3215. # Returns result in func_to_host_file_result.
  3216. func_convert_path_msys_to_cygwin ()
  3217. {
  3218. $debug_cmd
  3219. func_to_host_path_result=$1
  3220. if test -n "$1"; then
  3221. # See func_convert_path_msys_to_w32:
  3222. func_stripname : : "$1"
  3223. func_to_host_path_tmp1=$func_stripname_result
  3224. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3225. func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
  3226. func_to_host_path_result=$func_cygpath_result
  3227. func_convert_path_check : : \
  3228. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3229. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3230. fi
  3231. }
  3232. # end func_convert_path_msys_to_cygwin
  3233. # func_convert_path_nix_to_cygwin ARG
  3234. # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
  3235. # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
  3236. # func_to_host_file_result.
  3237. func_convert_path_nix_to_cygwin ()
  3238. {
  3239. $debug_cmd
  3240. func_to_host_path_result=$1
  3241. if test -n "$1"; then
  3242. # Remove leading and trailing path separator characters from
  3243. # ARG. msys behavior is inconsistent here, cygpath turns them
  3244. # into '.;' and ';.', and winepath ignores them completely.
  3245. func_stripname : : "$1"
  3246. func_to_host_path_tmp1=$func_stripname_result
  3247. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3248. func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
  3249. func_to_host_path_result=$func_cygpath_result
  3250. func_convert_path_check : : \
  3251. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3252. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3253. fi
  3254. }
  3255. # end func_convert_path_nix_to_cygwin
  3256. # func_dll_def_p FILE
  3257. # True iff FILE is a Windows DLL '.def' file.
  3258. # Keep in sync with _LT_DLL_DEF_P in libtool.m4
  3259. func_dll_def_p ()
  3260. {
  3261. $debug_cmd
  3262. func_dll_def_p_tmp=`$SED -n \
  3263. -e 's/^[ ]*//' \
  3264. -e '/^\(;.*\)*$/d' \
  3265. -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
  3266. -e q \
  3267. "$1"`
  3268. test DEF = "$func_dll_def_p_tmp"
  3269. }
  3270. # func_mode_compile arg...
  3271. func_mode_compile ()
  3272. {
  3273. $debug_cmd
  3274. # Get the compilation command and the source file.
  3275. base_compile=
  3276. srcfile=$nonopt # always keep a non-empty value in "srcfile"
  3277. suppress_opt=yes
  3278. suppress_output=
  3279. arg_mode=normal
  3280. libobj=
  3281. later=
  3282. pie_flag=
  3283. for arg
  3284. do
  3285. case $arg_mode in
  3286. arg )
  3287. # do not "continue". Instead, add this to base_compile
  3288. lastarg=$arg
  3289. arg_mode=normal
  3290. ;;
  3291. target )
  3292. libobj=$arg
  3293. arg_mode=normal
  3294. continue
  3295. ;;
  3296. normal )
  3297. # Accept any command-line options.
  3298. case $arg in
  3299. -o)
  3300. test -n "$libobj" && \
  3301. func_fatal_error "you cannot specify '-o' more than once"
  3302. arg_mode=target
  3303. continue
  3304. ;;
  3305. -pie | -fpie | -fPIE)
  3306. func_append pie_flag " $arg"
  3307. continue
  3308. ;;
  3309. -shared | -static | -prefer-pic | -prefer-non-pic)
  3310. func_append later " $arg"
  3311. continue
  3312. ;;
  3313. -no-suppress)
  3314. suppress_opt=no
  3315. continue
  3316. ;;
  3317. -Xcompiler)
  3318. arg_mode=arg # the next one goes into the "base_compile" arg list
  3319. continue # The current "srcfile" will either be retained or
  3320. ;; # replaced later. I would guess that would be a bug.
  3321. -Wc,*)
  3322. func_stripname '-Wc,' '' "$arg"
  3323. args=$func_stripname_result
  3324. lastarg=
  3325. save_ifs=$IFS; IFS=,
  3326. for arg in $args; do
  3327. IFS=$save_ifs
  3328. func_append_quoted lastarg "$arg"
  3329. done
  3330. IFS=$save_ifs
  3331. func_stripname ' ' '' "$lastarg"
  3332. lastarg=$func_stripname_result
  3333. # Add the arguments to base_compile.
  3334. func_append base_compile " $lastarg"
  3335. continue
  3336. ;;
  3337. *)
  3338. # Accept the current argument as the source file.
  3339. # The previous "srcfile" becomes the current argument.
  3340. #
  3341. lastarg=$srcfile
  3342. srcfile=$arg
  3343. ;;
  3344. esac # case $arg
  3345. ;;
  3346. esac # case $arg_mode
  3347. # Aesthetically quote the previous argument.
  3348. func_append_quoted base_compile "$lastarg"
  3349. done # for arg
  3350. case $arg_mode in
  3351. arg)
  3352. func_fatal_error "you must specify an argument for -Xcompile"
  3353. ;;
  3354. target)
  3355. func_fatal_error "you must specify a target with '-o'"
  3356. ;;
  3357. *)
  3358. # Get the name of the library object.
  3359. test -z "$libobj" && {
  3360. func_basename "$srcfile"
  3361. libobj=$func_basename_result
  3362. }
  3363. ;;
  3364. esac
  3365. # Recognize several different file suffixes.
  3366. # If the user specifies -o file.o, it is replaced with file.lo
  3367. case $libobj in
  3368. *.[cCFSifmso] | \
  3369. *.ada | *.adb | *.ads | *.asm | \
  3370. *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  3371. *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
  3372. func_xform "$libobj"
  3373. libobj=$func_xform_result
  3374. ;;
  3375. esac
  3376. case $libobj in
  3377. *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  3378. *)
  3379. func_fatal_error "cannot determine name of library object from '$libobj'"
  3380. ;;
  3381. esac
  3382. func_infer_tag $base_compile
  3383. for arg in $later; do
  3384. case $arg in
  3385. -shared)
  3386. test yes = "$build_libtool_libs" \
  3387. || func_fatal_configuration "cannot build a shared library"
  3388. build_old_libs=no
  3389. continue
  3390. ;;
  3391. -static)
  3392. build_libtool_libs=no
  3393. build_old_libs=yes
  3394. continue
  3395. ;;
  3396. -prefer-pic)
  3397. pic_mode=yes
  3398. continue
  3399. ;;
  3400. -prefer-non-pic)
  3401. pic_mode=no
  3402. continue
  3403. ;;
  3404. esac
  3405. done
  3406. func_quote_arg pretty "$libobj"
  3407. test "X$libobj" != "X$func_quote_arg_result" \
  3408. && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  3409. && func_warning "libobj name '$libobj' may not contain shell special characters."
  3410. func_dirname_and_basename "$obj" "/" ""
  3411. objname=$func_basename_result
  3412. xdir=$func_dirname_result
  3413. lobj=$xdir$objdir/$objname
  3414. test -z "$base_compile" && \
  3415. func_fatal_help "you must specify a compilation command"
  3416. # Delete any leftover library objects.
  3417. if test yes = "$build_old_libs"; then
  3418. removelist="$obj $lobj $libobj ${libobj}T"
  3419. else
  3420. removelist="$lobj $libobj ${libobj}T"
  3421. fi
  3422. # On Cygwin there's no "real" PIC flag so we must build both object types
  3423. case $host_os in
  3424. cygwin* | mingw* | pw32* | os2* | cegcc*)
  3425. pic_mode=default
  3426. ;;
  3427. esac
  3428. if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
  3429. # non-PIC code in shared libraries is not supported
  3430. pic_mode=default
  3431. fi
  3432. # Calculate the filename of the output object if compiler does
  3433. # not support -o with -c
  3434. if test no = "$compiler_c_o"; then
  3435. output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
  3436. lockfile=$output_obj.lock
  3437. else
  3438. output_obj=
  3439. need_locks=no
  3440. lockfile=
  3441. fi
  3442. # Lock this critical section if it is needed
  3443. # We use this script file to make the link, it avoids creating a new file
  3444. if test yes = "$need_locks"; then
  3445. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  3446. func_echo "Waiting for $lockfile to be removed"
  3447. sleep 2
  3448. done
  3449. elif test warn = "$need_locks"; then
  3450. if test -f "$lockfile"; then
  3451. $ECHO "\
  3452. *** ERROR, $lockfile exists and contains:
  3453. `cat $lockfile 2>/dev/null`
  3454. This indicates that another process is trying to use the same
  3455. temporary object file, and libtool could not work around it because
  3456. your compiler does not support '-c' and '-o' together. If you
  3457. repeat this compilation, it may succeed, by chance, but you had better
  3458. avoid parallel builds (make -j) in this platform, or get a better
  3459. compiler."
  3460. $opt_dry_run || $RM $removelist
  3461. exit $EXIT_FAILURE
  3462. fi
  3463. func_append removelist " $output_obj"
  3464. $ECHO "$srcfile" > "$lockfile"
  3465. fi
  3466. $opt_dry_run || $RM $removelist
  3467. func_append removelist " $lockfile"
  3468. trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  3469. func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
  3470. srcfile=$func_to_tool_file_result
  3471. func_quote_arg pretty "$srcfile"
  3472. qsrcfile=$func_quote_arg_result
  3473. # Only build a PIC object if we are building libtool libraries.
  3474. if test yes = "$build_libtool_libs"; then
  3475. # Without this assignment, base_compile gets emptied.
  3476. fbsd_hideous_sh_bug=$base_compile
  3477. if test no != "$pic_mode"; then
  3478. command="$base_compile $qsrcfile $pic_flag"
  3479. else
  3480. # Don't build PIC code
  3481. command="$base_compile $qsrcfile"
  3482. fi
  3483. func_mkdir_p "$xdir$objdir"
  3484. if test -z "$output_obj"; then
  3485. # Place PIC objects in $objdir
  3486. func_append command " -o $lobj"
  3487. fi
  3488. func_show_eval_locale "$command" \
  3489. 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  3490. if test warn = "$need_locks" &&
  3491. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3492. $ECHO "\
  3493. *** ERROR, $lockfile contains:
  3494. `cat $lockfile 2>/dev/null`
  3495. but it should contain:
  3496. $srcfile
  3497. This indicates that another process is trying to use the same
  3498. temporary object file, and libtool could not work around it because
  3499. your compiler does not support '-c' and '-o' together. If you
  3500. repeat this compilation, it may succeed, by chance, but you had better
  3501. avoid parallel builds (make -j) in this platform, or get a better
  3502. compiler."
  3503. $opt_dry_run || $RM $removelist
  3504. exit $EXIT_FAILURE
  3505. fi
  3506. # Just move the object if needed, then go on to compile the next one
  3507. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  3508. func_show_eval '$MV "$output_obj" "$lobj"' \
  3509. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3510. fi
  3511. # Allow error messages only from the first compilation.
  3512. if test yes = "$suppress_opt"; then
  3513. suppress_output=' >/dev/null 2>&1'
  3514. fi
  3515. fi
  3516. # Only build a position-dependent object if we build old libraries.
  3517. if test yes = "$build_old_libs"; then
  3518. if test yes != "$pic_mode"; then
  3519. # Don't build PIC code
  3520. command="$base_compile $qsrcfile$pie_flag"
  3521. else
  3522. command="$base_compile $qsrcfile $pic_flag"
  3523. fi
  3524. if test yes = "$compiler_c_o"; then
  3525. func_append command " -o $obj"
  3526. fi
  3527. # Suppress compiler output if we already did a PIC compilation.
  3528. func_append command "$suppress_output"
  3529. func_show_eval_locale "$command" \
  3530. '$opt_dry_run || $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
  3548. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  3549. func_show_eval '$MV "$output_obj" "$obj"' \
  3550. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3551. fi
  3552. fi
  3553. $opt_dry_run || {
  3554. func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  3555. # Unlock the critical section if it was locked
  3556. if test no != "$need_locks"; then
  3557. removelist=$lockfile
  3558. $RM "$lockfile"
  3559. fi
  3560. }
  3561. exit $EXIT_SUCCESS
  3562. }
  3563. $opt_help || {
  3564. test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
  3565. }
  3566. func_mode_help ()
  3567. {
  3568. # We need to display help for each of the modes.
  3569. case $opt_mode in
  3570. "")
  3571. # Generic help is extracted from the usage comments
  3572. # at the start of this file.
  3573. func_help
  3574. ;;
  3575. clean)
  3576. $ECHO \
  3577. "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  3578. Remove files from the build directory.
  3579. RM is the name of the program to use to delete files associated with each FILE
  3580. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3581. to RM.
  3582. If FILE is a libtool library, object or program, all the files associated
  3583. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  3584. ;;
  3585. compile)
  3586. $ECHO \
  3587. "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3588. Compile a source file into a libtool library object.
  3589. This mode accepts the following additional options:
  3590. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  3591. -no-suppress do not suppress compiler output for multiple passes
  3592. -prefer-pic try to build PIC objects only
  3593. -prefer-non-pic try to build non-PIC objects only
  3594. -shared do not build a '.o' file suitable for static linking
  3595. -static only build a '.o' file suitable for static linking
  3596. -Wc,FLAG pass FLAG directly to the compiler
  3597. COMPILE-COMMAND is a command to be used in creating a 'standard' object file
  3598. from the given SOURCEFILE.
  3599. The output file name is determined by removing the directory component from
  3600. SOURCEFILE, then substituting the C source code suffix '.c' with the
  3601. library object suffix, '.lo'."
  3602. ;;
  3603. execute)
  3604. $ECHO \
  3605. "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  3606. Automatically set library path, then run a program.
  3607. This mode accepts the following additional options:
  3608. -dlopen FILE add the directory containing FILE to the library path
  3609. This mode sets the library path environment variable according to '-dlopen'
  3610. flags.
  3611. If any of the ARGS are libtool executable wrappers, then they are translated
  3612. into their corresponding uninstalled binary, and any of their required library
  3613. directories are added to the library path.
  3614. Then, COMMAND is executed, with ARGS as arguments."
  3615. ;;
  3616. finish)
  3617. $ECHO \
  3618. "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  3619. Complete the installation of libtool libraries.
  3620. Each LIBDIR is a directory that contains libtool libraries.
  3621. The commands that this mode executes may require superuser privileges. Use
  3622. the '--dry-run' option if you just want to see what would be executed."
  3623. ;;
  3624. install)
  3625. $ECHO \
  3626. "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  3627. Install executables or libraries.
  3628. INSTALL-COMMAND is the installation command. The first component should be
  3629. either the 'install' or 'cp' program.
  3630. The following components of INSTALL-COMMAND are treated specially:
  3631. -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  3632. The rest of the components are interpreted as arguments to that command (only
  3633. BSD-compatible install options are recognized)."
  3634. ;;
  3635. link)
  3636. $ECHO \
  3637. "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  3638. Link object files or libraries together to form another library, or to
  3639. create an executable program.
  3640. LINK-COMMAND is a command using the C compiler that you would use to create
  3641. a program from several object files.
  3642. The following components of LINK-COMMAND are treated specially:
  3643. -all-static do not do any dynamic linking at all
  3644. -avoid-version do not add a version suffix if possible
  3645. -bindir BINDIR specify path to binaries directory (for systems where
  3646. libraries must be found in the PATH setting at runtime)
  3647. -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
  3648. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  3649. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  3650. -export-symbols SYMFILE
  3651. try to export only the symbols listed in SYMFILE
  3652. -export-symbols-regex REGEX
  3653. try to export only the symbols matching REGEX
  3654. -LLIBDIR search LIBDIR for required installed libraries
  3655. -lNAME OUTPUT-FILE requires the installed library libNAME
  3656. -module build a library that can dlopened
  3657. -no-fast-install disable the fast-install mode
  3658. -no-install link a not-installable executable
  3659. -no-undefined declare that a library does not refer to external symbols
  3660. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  3661. -objectlist FILE use a list of object files found in FILE to specify objects
  3662. -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
  3663. -precious-files-regex REGEX
  3664. don't remove output files matching REGEX
  3665. -release RELEASE specify package release information
  3666. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  3667. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  3668. -shared only do dynamic linking of libtool libraries
  3669. -shrext SUFFIX override the standard shared library file extension
  3670. -static do not do any dynamic linking of uninstalled libtool libraries
  3671. -static-libtool-libs
  3672. do not do any dynamic linking of libtool libraries
  3673. -version-info CURRENT[:REVISION[:AGE]]
  3674. specify library version info [each variable defaults to 0]
  3675. -weak LIBNAME declare that the target provides the LIBNAME interface
  3676. -Wc,FLAG
  3677. -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
  3678. -Wl,FLAG
  3679. -Xlinker FLAG pass linker-specific FLAG directly to the linker
  3680. -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
  3681. All other options (arguments beginning with '-') are ignored.
  3682. Every other argument is treated as a filename. Files ending in '.la' are
  3683. treated as uninstalled libtool libraries, other files are standard or library
  3684. object files.
  3685. If the OUTPUT-FILE ends in '.la', then a libtool library is created,
  3686. only library objects ('.lo' files) may be specified, and '-rpath' is
  3687. required, except when creating a convenience library.
  3688. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
  3689. using 'ar' and 'ranlib', or on Windows using 'lib'.
  3690. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
  3691. is created, otherwise an executable program is created."
  3692. ;;
  3693. uninstall)
  3694. $ECHO \
  3695. "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  3696. Remove libraries from an installation directory.
  3697. RM is the name of the program to use to delete files associated with each FILE
  3698. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3699. to RM.
  3700. If FILE is a libtool library, all the files associated with it are deleted.
  3701. Otherwise, only FILE itself is deleted using RM."
  3702. ;;
  3703. *)
  3704. func_fatal_help "invalid operation mode '$opt_mode'"
  3705. ;;
  3706. esac
  3707. echo
  3708. $ECHO "Try '$progname --help' for more information about other modes."
  3709. }
  3710. # Now that we've collected a possible --mode arg, show help if necessary
  3711. if $opt_help; then
  3712. if test : = "$opt_help"; then
  3713. func_mode_help
  3714. else
  3715. {
  3716. func_help noexit
  3717. for opt_mode in compile link execute install finish uninstall clean; do
  3718. func_mode_help
  3719. done
  3720. } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
  3721. {
  3722. func_help noexit
  3723. for opt_mode in compile link execute install finish uninstall clean; do
  3724. echo
  3725. func_mode_help
  3726. done
  3727. } |
  3728. $SED '1d
  3729. /^When reporting/,/^Report/{
  3730. H
  3731. d
  3732. }
  3733. $x
  3734. /information about other modes/d
  3735. /more detailed .*MODE/d
  3736. s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  3737. fi
  3738. exit $?
  3739. fi
  3740. # func_mode_execute arg...
  3741. func_mode_execute ()
  3742. {
  3743. $debug_cmd
  3744. # The first argument is the command name.
  3745. cmd=$nonopt
  3746. test -z "$cmd" && \
  3747. func_fatal_help "you must specify a COMMAND"
  3748. # Handle -dlopen flags immediately.
  3749. for file in $opt_dlopen; do
  3750. test -f "$file" \
  3751. || func_fatal_help "'$file' is not a file"
  3752. dir=
  3753. case $file in
  3754. *.la)
  3755. func_resolve_sysroot "$file"
  3756. file=$func_resolve_sysroot_result
  3757. # Check to see that this really is a libtool archive.
  3758. func_lalib_unsafe_p "$file" \
  3759. || func_fatal_help "'$lib' is not a valid libtool archive"
  3760. # Read the libtool library.
  3761. dlname=
  3762. library_names=
  3763. func_source "$file"
  3764. # Skip this library if it cannot be dlopened.
  3765. if test -z "$dlname"; then
  3766. # Warn if it was a shared library.
  3767. test -n "$library_names" && \
  3768. func_warning "'$file' was not linked with '-export-dynamic'"
  3769. continue
  3770. fi
  3771. func_dirname "$file" "" "."
  3772. dir=$func_dirname_result
  3773. if test -f "$dir/$objdir/$dlname"; then
  3774. func_append dir "/$objdir"
  3775. else
  3776. if test ! -f "$dir/$dlname"; then
  3777. func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
  3778. fi
  3779. fi
  3780. ;;
  3781. *.lo)
  3782. # Just add the directory containing the .lo file.
  3783. func_dirname "$file" "" "."
  3784. dir=$func_dirname_result
  3785. ;;
  3786. *)
  3787. func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
  3788. continue
  3789. ;;
  3790. esac
  3791. # Get the absolute pathname.
  3792. absdir=`cd "$dir" && pwd`
  3793. test -n "$absdir" && dir=$absdir
  3794. # Now add the directory to shlibpath_var.
  3795. if eval "test -z \"\$$shlibpath_var\""; then
  3796. eval "$shlibpath_var=\"\$dir\""
  3797. else
  3798. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3799. fi
  3800. done
  3801. # This variable tells wrapper scripts just to set shlibpath_var
  3802. # rather than running their programs.
  3803. libtool_execute_magic=$magic
  3804. # Check if any of the arguments is a wrapper script.
  3805. args=
  3806. for file
  3807. do
  3808. case $file in
  3809. -* | *.la | *.lo ) ;;
  3810. *)
  3811. # Do a test to see if this is really a libtool program.
  3812. if func_ltwrapper_script_p "$file"; then
  3813. func_source "$file"
  3814. # Transform arg to wrapped name.
  3815. file=$progdir/$program
  3816. elif func_ltwrapper_executable_p "$file"; then
  3817. func_ltwrapper_scriptname "$file"
  3818. func_source "$func_ltwrapper_scriptname_result"
  3819. # Transform arg to wrapped name.
  3820. file=$progdir/$program
  3821. fi
  3822. ;;
  3823. esac
  3824. # Quote arguments (to preserve shell metacharacters).
  3825. func_append_quoted args "$file"
  3826. done
  3827. if $opt_dry_run; then
  3828. # Display what would be done.
  3829. if test -n "$shlibpath_var"; then
  3830. eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  3831. echo "export $shlibpath_var"
  3832. fi
  3833. $ECHO "$cmd$args"
  3834. exit $EXIT_SUCCESS
  3835. else
  3836. if test -n "$shlibpath_var"; then
  3837. # Export the shlibpath_var.
  3838. eval "export $shlibpath_var"
  3839. fi
  3840. # Restore saved environment variables
  3841. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  3842. do
  3843. eval "if test \"\${save_$lt_var+set}\" = set; then
  3844. $lt_var=\$save_$lt_var; export $lt_var
  3845. else
  3846. $lt_unset $lt_var
  3847. fi"
  3848. done
  3849. # Now prepare to actually exec the command.
  3850. exec_cmd=\$cmd$args
  3851. fi
  3852. }
  3853. test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
  3854. # func_mode_finish arg...
  3855. func_mode_finish ()
  3856. {
  3857. $debug_cmd
  3858. libs=
  3859. libdirs=
  3860. admincmds=
  3861. for opt in "$nonopt" ${1+"$@"}
  3862. do
  3863. if test -d "$opt"; then
  3864. func_append libdirs " $opt"
  3865. elif test -f "$opt"; then
  3866. if func_lalib_unsafe_p "$opt"; then
  3867. func_append libs " $opt"
  3868. else
  3869. func_warning "'$opt' is not a valid libtool archive"
  3870. fi
  3871. else
  3872. func_fatal_error "invalid argument '$opt'"
  3873. fi
  3874. done
  3875. if test -n "$libs"; then
  3876. if test -n "$lt_sysroot"; then
  3877. sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
  3878. sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
  3879. else
  3880. sysroot_cmd=
  3881. fi
  3882. # Remove sysroot references
  3883. if $opt_dry_run; then
  3884. for lib in $libs; do
  3885. echo "removing references to $lt_sysroot and '=' prefixes from $lib"
  3886. done
  3887. else
  3888. tmpdir=`func_mktempdir`
  3889. for lib in $libs; do
  3890. $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
  3891. > $tmpdir/tmp-la
  3892. mv -f $tmpdir/tmp-la $lib
  3893. done
  3894. ${RM}r "$tmpdir"
  3895. fi
  3896. fi
  3897. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3898. for libdir in $libdirs; do
  3899. if test -n "$finish_cmds"; then
  3900. # Do each command in the finish commands.
  3901. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  3902. '"$cmd"'"'
  3903. fi
  3904. if test -n "$finish_eval"; then
  3905. # Do the single finish_eval.
  3906. eval cmds=\"$finish_eval\"
  3907. $opt_dry_run || eval "$cmds" || func_append admincmds "
  3908. $cmds"
  3909. fi
  3910. done
  3911. fi
  3912. # Exit here if they wanted silent mode.
  3913. $opt_quiet && exit $EXIT_SUCCESS
  3914. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3915. echo "----------------------------------------------------------------------"
  3916. echo "Libraries have been installed in:"
  3917. for libdir in $libdirs; do
  3918. $ECHO " $libdir"
  3919. done
  3920. echo
  3921. echo "If you ever happen to want to link against installed libraries"
  3922. echo "in a given directory, LIBDIR, you must either use libtool, and"
  3923. echo "specify the full pathname of the library, or use the '-LLIBDIR'"
  3924. echo "flag during linking and do at least one of the following:"
  3925. if test -n "$shlibpath_var"; then
  3926. echo " - add LIBDIR to the '$shlibpath_var' environment variable"
  3927. echo " during execution"
  3928. fi
  3929. if test -n "$runpath_var"; then
  3930. echo " - add LIBDIR to the '$runpath_var' environment variable"
  3931. echo " during linking"
  3932. fi
  3933. if test -n "$hardcode_libdir_flag_spec"; then
  3934. libdir=LIBDIR
  3935. eval flag=\"$hardcode_libdir_flag_spec\"
  3936. $ECHO " - use the '$flag' linker flag"
  3937. fi
  3938. if test -n "$admincmds"; then
  3939. $ECHO " - have your system administrator run these commands:$admincmds"
  3940. fi
  3941. if test -f /etc/ld.so.conf; then
  3942. echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
  3943. fi
  3944. echo
  3945. echo "See any operating system documentation about shared libraries for"
  3946. case $host in
  3947. solaris2.[6789]|solaris2.1[0-9])
  3948. echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  3949. echo "pages."
  3950. ;;
  3951. *)
  3952. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3953. ;;
  3954. esac
  3955. echo "----------------------------------------------------------------------"
  3956. fi
  3957. exit $EXIT_SUCCESS
  3958. }
  3959. test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
  3960. # func_mode_install arg...
  3961. func_mode_install ()
  3962. {
  3963. $debug_cmd
  3964. # There may be an optional sh(1) argument at the beginning of
  3965. # install_prog (especially on Windows NT).
  3966. if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
  3967. # Allow the use of GNU shtool's install command.
  3968. case $nonopt in *shtool*) :;; *) false;; esac
  3969. then
  3970. # Aesthetically quote it.
  3971. func_quote_arg pretty "$nonopt"
  3972. install_prog="$func_quote_arg_result "
  3973. arg=$1
  3974. shift
  3975. else
  3976. install_prog=
  3977. arg=$nonopt
  3978. fi
  3979. # The real first argument should be the name of the installation program.
  3980. # Aesthetically quote it.
  3981. func_quote_arg pretty "$arg"
  3982. func_append install_prog "$func_quote_arg_result"
  3983. install_shared_prog=$install_prog
  3984. case " $install_prog " in
  3985. *[\\\ /]cp\ *) install_cp=: ;;
  3986. *) install_cp=false ;;
  3987. esac
  3988. # We need to accept at least all the BSD install flags.
  3989. dest=
  3990. files=
  3991. opts=
  3992. prev=
  3993. install_type=
  3994. isdir=false
  3995. stripme=
  3996. no_mode=:
  3997. for arg
  3998. do
  3999. arg2=
  4000. if test -n "$dest"; then
  4001. func_append files " $dest"
  4002. dest=$arg
  4003. continue
  4004. fi
  4005. case $arg in
  4006. -d) isdir=: ;;
  4007. -f)
  4008. if $install_cp; then :; else
  4009. prev=$arg
  4010. fi
  4011. ;;
  4012. -g | -m | -o)
  4013. prev=$arg
  4014. ;;
  4015. -s)
  4016. stripme=" -s"
  4017. continue
  4018. ;;
  4019. -*)
  4020. ;;
  4021. *)
  4022. # If the previous option needed an argument, then skip it.
  4023. if test -n "$prev"; then
  4024. if test X-m = "X$prev" && test -n "$install_override_mode"; then
  4025. arg2=$install_override_mode
  4026. no_mode=false
  4027. fi
  4028. prev=
  4029. else
  4030. dest=$arg
  4031. continue
  4032. fi
  4033. ;;
  4034. esac
  4035. # Aesthetically quote the argument.
  4036. func_quote_arg pretty "$arg"
  4037. func_append install_prog " $func_quote_arg_result"
  4038. if test -n "$arg2"; then
  4039. func_quote_arg pretty "$arg2"
  4040. fi
  4041. func_append install_shared_prog " $func_quote_arg_result"
  4042. done
  4043. test -z "$install_prog" && \
  4044. func_fatal_help "you must specify an install program"
  4045. test -n "$prev" && \
  4046. func_fatal_help "the '$prev' option requires an argument"
  4047. if test -n "$install_override_mode" && $no_mode; then
  4048. if $install_cp; then :; else
  4049. func_quote_arg pretty "$install_override_mode"
  4050. func_append install_shared_prog " -m $func_quote_arg_result"
  4051. fi
  4052. fi
  4053. if test -z "$files"; then
  4054. if test -z "$dest"; then
  4055. func_fatal_help "no file or destination specified"
  4056. else
  4057. func_fatal_help "you must specify a destination"
  4058. fi
  4059. fi
  4060. # Strip any trailing slash from the destination.
  4061. func_stripname '' '/' "$dest"
  4062. dest=$func_stripname_result
  4063. # Check to see that the destination is a directory.
  4064. test -d "$dest" && isdir=:
  4065. if $isdir; then
  4066. destdir=$dest
  4067. destname=
  4068. else
  4069. func_dirname_and_basename "$dest" "" "."
  4070. destdir=$func_dirname_result
  4071. destname=$func_basename_result
  4072. # Not a directory, so check to see that there is only one file specified.
  4073. set dummy $files; shift
  4074. test "$#" -gt 1 && \
  4075. func_fatal_help "'$dest' is not a directory"
  4076. fi
  4077. case $destdir in
  4078. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4079. *)
  4080. for file in $files; do
  4081. case $file in
  4082. *.lo) ;;
  4083. *)
  4084. func_fatal_help "'$destdir' must be an absolute directory name"
  4085. ;;
  4086. esac
  4087. done
  4088. ;;
  4089. esac
  4090. # This variable tells wrapper scripts just to set variables rather
  4091. # than running their programs.
  4092. libtool_install_magic=$magic
  4093. staticlibs=
  4094. future_libdirs=
  4095. current_libdirs=
  4096. for file in $files; do
  4097. # Do each installation.
  4098. case $file in
  4099. *.$libext)
  4100. # Do the static libraries later.
  4101. func_append staticlibs " $file"
  4102. ;;
  4103. *.la)
  4104. func_resolve_sysroot "$file"
  4105. file=$func_resolve_sysroot_result
  4106. # Check to see that this really is a libtool archive.
  4107. func_lalib_unsafe_p "$file" \
  4108. || func_fatal_help "'$file' is not a valid libtool archive"
  4109. library_names=
  4110. old_library=
  4111. relink_command=
  4112. func_source "$file"
  4113. # Add the libdir to current_libdirs if it is the destination.
  4114. if test "X$destdir" = "X$libdir"; then
  4115. case "$current_libdirs " in
  4116. *" $libdir "*) ;;
  4117. *) func_append current_libdirs " $libdir" ;;
  4118. esac
  4119. else
  4120. # Note the libdir as a future libdir.
  4121. case "$future_libdirs " in
  4122. *" $libdir "*) ;;
  4123. *) func_append future_libdirs " $libdir" ;;
  4124. esac
  4125. fi
  4126. func_dirname "$file" "/" ""
  4127. dir=$func_dirname_result
  4128. func_append dir "$objdir"
  4129. if test -n "$relink_command"; then
  4130. # Determine the prefix the user has applied to our future dir.
  4131. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
  4132. # Don't allow the user to place us outside of our expected
  4133. # location b/c this prevents finding dependent libraries that
  4134. # are installed to the same prefix.
  4135. # At present, this check doesn't affect windows .dll's that
  4136. # are installed into $libdir/../bin (currently, that works fine)
  4137. # but it's something to keep an eye on.
  4138. test "$inst_prefix_dir" = "$destdir" && \
  4139. func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
  4140. if test -n "$inst_prefix_dir"; then
  4141. # Stick the inst_prefix_dir data into the link command.
  4142. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  4143. else
  4144. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  4145. fi
  4146. func_warning "relinking '$file'"
  4147. func_show_eval "$relink_command" \
  4148. 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
  4149. fi
  4150. # See the names of the shared library.
  4151. set dummy $library_names; shift
  4152. if test -n "$1"; then
  4153. realname=$1
  4154. shift
  4155. srcname=$realname
  4156. test -n "$relink_command" && srcname=${realname}T
  4157. # Install the shared library and build the symlinks.
  4158. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
  4159. 'exit $?'
  4160. tstripme=$stripme
  4161. case $host_os in
  4162. cygwin* | mingw* | pw32* | cegcc*)
  4163. case $realname in
  4164. *.dll.a)
  4165. tstripme=
  4166. ;;
  4167. esac
  4168. ;;
  4169. os2*)
  4170. case $realname in
  4171. *_dll.a)
  4172. tstripme=
  4173. ;;
  4174. esac
  4175. ;;
  4176. esac
  4177. if test -n "$tstripme" && test -n "$striplib"; then
  4178. func_show_eval "$striplib $destdir/$realname" 'exit $?'
  4179. fi
  4180. if test "$#" -gt 0; then
  4181. # Delete the old symlinks, and create new ones.
  4182. # Try 'ln -sf' first, because the 'ln' binary might depend on
  4183. # the symlink we replace! Solaris /bin/ln does not understand -f,
  4184. # so we also need to try rm && ln -s.
  4185. for linkname
  4186. do
  4187. test "$linkname" != "$realname" \
  4188. && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  4189. done
  4190. fi
  4191. # Do each command in the postinstall commands.
  4192. lib=$destdir/$realname
  4193. func_execute_cmds "$postinstall_cmds" 'exit $?'
  4194. fi
  4195. # Install the pseudo-library for information purposes.
  4196. func_basename "$file"
  4197. name=$func_basename_result
  4198. instname=$dir/${name}i
  4199. func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  4200. # Maybe install the static library, too.
  4201. test -n "$old_library" && func_append staticlibs " $dir/$old_library"
  4202. ;;
  4203. *.lo)
  4204. # Install (i.e. copy) a libtool object.
  4205. # Figure out destination file name, if it wasn't already specified.
  4206. if test -n "$destname"; then
  4207. destfile=$destdir/$destname
  4208. else
  4209. func_basename "$file"
  4210. destfile=$func_basename_result
  4211. destfile=$destdir/$destfile
  4212. fi
  4213. # Deduce the name of the destination old-style object file.
  4214. case $destfile in
  4215. *.lo)
  4216. func_lo2o "$destfile"
  4217. staticdest=$func_lo2o_result
  4218. ;;
  4219. *.$objext)
  4220. staticdest=$destfile
  4221. destfile=
  4222. ;;
  4223. *)
  4224. func_fatal_help "cannot copy a libtool object to '$destfile'"
  4225. ;;
  4226. esac
  4227. # Install the libtool object if requested.
  4228. test -n "$destfile" && \
  4229. func_show_eval "$install_prog $file $destfile" 'exit $?'
  4230. # Install the old object if enabled.
  4231. if test yes = "$build_old_libs"; then
  4232. # Deduce the name of the old-style object file.
  4233. func_lo2o "$file"
  4234. staticobj=$func_lo2o_result
  4235. func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  4236. fi
  4237. exit $EXIT_SUCCESS
  4238. ;;
  4239. *)
  4240. # Figure out destination file name, if it wasn't already specified.
  4241. if test -n "$destname"; then
  4242. destfile=$destdir/$destname
  4243. else
  4244. func_basename "$file"
  4245. destfile=$func_basename_result
  4246. destfile=$destdir/$destfile
  4247. fi
  4248. # If the file is missing, and there is a .exe on the end, strip it
  4249. # because it is most likely a libtool script we actually want to
  4250. # install
  4251. stripped_ext=
  4252. case $file in
  4253. *.exe)
  4254. if test ! -f "$file"; then
  4255. func_stripname '' '.exe' "$file"
  4256. file=$func_stripname_result
  4257. stripped_ext=.exe
  4258. fi
  4259. ;;
  4260. esac
  4261. # Do a test to see if this is really a libtool program.
  4262. case $host in
  4263. *cygwin* | *mingw*)
  4264. if func_ltwrapper_executable_p "$file"; then
  4265. func_ltwrapper_scriptname "$file"
  4266. wrapper=$func_ltwrapper_scriptname_result
  4267. else
  4268. func_stripname '' '.exe' "$file"
  4269. wrapper=$func_stripname_result
  4270. fi
  4271. ;;
  4272. *)
  4273. wrapper=$file
  4274. ;;
  4275. esac
  4276. if func_ltwrapper_script_p "$wrapper"; then
  4277. notinst_deplibs=
  4278. relink_command=
  4279. func_source "$wrapper"
  4280. # Check the variables that should have been set.
  4281. test -z "$generated_by_libtool_version" && \
  4282. func_fatal_error "invalid libtool wrapper script '$wrapper'"
  4283. finalize=:
  4284. for lib in $notinst_deplibs; do
  4285. # Check to see that each library is installed.
  4286. libdir=
  4287. if test -f "$lib"; then
  4288. func_source "$lib"
  4289. fi
  4290. libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
  4291. if test -n "$libdir" && test ! -f "$libfile"; then
  4292. func_warning "'$lib' has not been installed in '$libdir'"
  4293. finalize=false
  4294. fi
  4295. done
  4296. relink_command=
  4297. func_source "$wrapper"
  4298. outputname=
  4299. if test no = "$fast_install" && test -n "$relink_command"; then
  4300. $opt_dry_run || {
  4301. if $finalize; then
  4302. tmpdir=`func_mktempdir`
  4303. func_basename "$file$stripped_ext"
  4304. file=$func_basename_result
  4305. outputname=$tmpdir/$file
  4306. # Replace the output file specification.
  4307. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
  4308. $opt_quiet || {
  4309. func_quote_arg expand,pretty "$relink_command"
  4310. eval "func_echo $func_quote_arg_result"
  4311. }
  4312. if eval "$relink_command"; then :
  4313. else
  4314. func_error "error: relink '$file' with the above command before installing it"
  4315. $opt_dry_run || ${RM}r "$tmpdir"
  4316. continue
  4317. fi
  4318. file=$outputname
  4319. else
  4320. func_warning "cannot relink '$file'"
  4321. fi
  4322. }
  4323. else
  4324. # Install the binary that we compiled earlier.
  4325. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
  4326. fi
  4327. fi
  4328. # remove .exe since cygwin /usr/bin/install will append another
  4329. # one anyway
  4330. case $install_prog,$host in
  4331. */usr/bin/install*,*cygwin*)
  4332. case $file:$destfile in
  4333. *.exe:*.exe)
  4334. # this is ok
  4335. ;;
  4336. *.exe:*)
  4337. destfile=$destfile.exe
  4338. ;;
  4339. *:*.exe)
  4340. func_stripname '' '.exe' "$destfile"
  4341. destfile=$func_stripname_result
  4342. ;;
  4343. esac
  4344. ;;
  4345. esac
  4346. func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  4347. $opt_dry_run || if test -n "$outputname"; then
  4348. ${RM}r "$tmpdir"
  4349. fi
  4350. ;;
  4351. esac
  4352. done
  4353. for file in $staticlibs; do
  4354. func_basename "$file"
  4355. name=$func_basename_result
  4356. # Set up the ranlib parameters.
  4357. oldlib=$destdir/$name
  4358. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  4359. tool_oldlib=$func_to_tool_file_result
  4360. func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  4361. if test -n "$stripme" && test -n "$old_striplib"; then
  4362. func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
  4363. fi
  4364. # Do each command in the postinstall commands.
  4365. func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  4366. done
  4367. test -n "$future_libdirs" && \
  4368. func_warning "remember to run '$progname --finish$future_libdirs'"
  4369. if test -n "$current_libdirs"; then
  4370. # Maybe just do a dry run.
  4371. $opt_dry_run && current_libdirs=" -n$current_libdirs"
  4372. exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
  4373. else
  4374. exit $EXIT_SUCCESS
  4375. fi
  4376. }
  4377. test install = "$opt_mode" && func_mode_install ${1+"$@"}
  4378. # func_generate_dlsyms outputname originator pic_p
  4379. # Extract symbols from dlprefiles and create ${outputname}S.o with
  4380. # a dlpreopen symbol table.
  4381. func_generate_dlsyms ()
  4382. {
  4383. $debug_cmd
  4384. my_outputname=$1
  4385. my_originator=$2
  4386. my_pic_p=${3-false}
  4387. my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
  4388. my_dlsyms=
  4389. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  4390. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4391. my_dlsyms=${my_outputname}S.c
  4392. else
  4393. func_error "not configured to extract global symbols from dlpreopened files"
  4394. fi
  4395. fi
  4396. if test -n "$my_dlsyms"; then
  4397. case $my_dlsyms in
  4398. "") ;;
  4399. *.c)
  4400. # Discover the nlist of each of the dlfiles.
  4401. nlist=$output_objdir/$my_outputname.nm
  4402. func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  4403. # Parse the name list into a source file.
  4404. func_verbose "creating $output_objdir/$my_dlsyms"
  4405. $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  4406. /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
  4407. /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
  4408. #ifdef __cplusplus
  4409. extern \"C\" {
  4410. #endif
  4411. #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
  4412. #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
  4413. #endif
  4414. /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
  4415. #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
  4416. /* DATA imports from DLLs on WIN32 can't be const, because runtime
  4417. relocations are performed -- see ld's documentation on pseudo-relocs. */
  4418. # define LT_DLSYM_CONST
  4419. #elif defined __osf__
  4420. /* This system does not cope well with relocations in const data. */
  4421. # define LT_DLSYM_CONST
  4422. #else
  4423. # define LT_DLSYM_CONST const
  4424. #endif
  4425. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  4426. /* External symbol declarations for the compiler. */\
  4427. "
  4428. if test yes = "$dlself"; then
  4429. func_verbose "generating symbol list for '$output'"
  4430. $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  4431. # Add our own program objects to the symbol list.
  4432. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  4433. for progfile in $progfiles; do
  4434. func_to_tool_file "$progfile" func_convert_file_msys_to_w32
  4435. func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
  4436. $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
  4437. done
  4438. if test -n "$exclude_expsyms"; then
  4439. $opt_dry_run || {
  4440. eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4441. eval '$MV "$nlist"T "$nlist"'
  4442. }
  4443. fi
  4444. if test -n "$export_symbols_regex"; then
  4445. $opt_dry_run || {
  4446. eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4447. eval '$MV "$nlist"T "$nlist"'
  4448. }
  4449. fi
  4450. # Prepare the list of exported symbols
  4451. if test -z "$export_symbols"; then
  4452. export_symbols=$output_objdir/$outputname.exp
  4453. $opt_dry_run || {
  4454. $RM $export_symbols
  4455. eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4456. case $host in
  4457. *cygwin* | *mingw* | *cegcc* )
  4458. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4459. eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  4460. ;;
  4461. esac
  4462. }
  4463. else
  4464. $opt_dry_run || {
  4465. eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4466. eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4467. eval '$MV "$nlist"T "$nlist"'
  4468. case $host in
  4469. *cygwin* | *mingw* | *cegcc* )
  4470. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4471. eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  4472. ;;
  4473. esac
  4474. }
  4475. fi
  4476. fi
  4477. for dlprefile in $dlprefiles; do
  4478. func_verbose "extracting global C symbols from '$dlprefile'"
  4479. func_basename "$dlprefile"
  4480. name=$func_basename_result
  4481. case $host in
  4482. *cygwin* | *mingw* | *cegcc* )
  4483. # if an import library, we need to obtain dlname
  4484. if func_win32_import_lib_p "$dlprefile"; then
  4485. func_tr_sh "$dlprefile"
  4486. eval "curr_lafile=\$libfile_$func_tr_sh_result"
  4487. dlprefile_dlbasename=
  4488. if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
  4489. # Use subshell, to avoid clobbering current variable values
  4490. dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
  4491. if test -n "$dlprefile_dlname"; then
  4492. func_basename "$dlprefile_dlname"
  4493. dlprefile_dlbasename=$func_basename_result
  4494. else
  4495. # no lafile. user explicitly requested -dlpreopen <import library>.
  4496. $sharedlib_from_linklib_cmd "$dlprefile"
  4497. dlprefile_dlbasename=$sharedlib_from_linklib_result
  4498. fi
  4499. fi
  4500. $opt_dry_run || {
  4501. if test -n "$dlprefile_dlbasename"; then
  4502. eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
  4503. else
  4504. func_warning "Could not compute DLL name from $name"
  4505. eval '$ECHO ": $name " >> "$nlist"'
  4506. fi
  4507. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4508. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
  4509. $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
  4510. }
  4511. else # not an import lib
  4512. $opt_dry_run || {
  4513. eval '$ECHO ": $name " >> "$nlist"'
  4514. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4515. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4516. }
  4517. fi
  4518. ;;
  4519. *)
  4520. $opt_dry_run || {
  4521. eval '$ECHO ": $name " >> "$nlist"'
  4522. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4523. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4524. }
  4525. ;;
  4526. esac
  4527. done
  4528. $opt_dry_run || {
  4529. # Make sure we have at least an empty file.
  4530. test -f "$nlist" || : > "$nlist"
  4531. if test -n "$exclude_expsyms"; then
  4532. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4533. $MV "$nlist"T "$nlist"
  4534. fi
  4535. # Try sorting and uniquifying the output.
  4536. if $GREP -v "^: " < "$nlist" |
  4537. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4538. sort -k 3
  4539. else
  4540. sort +2
  4541. fi |
  4542. uniq > "$nlist"S; then
  4543. :
  4544. else
  4545. $GREP -v "^: " < "$nlist" > "$nlist"S
  4546. fi
  4547. if test -f "$nlist"S; then
  4548. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  4549. else
  4550. echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
  4551. fi
  4552. func_show_eval '$RM "${nlist}I"'
  4553. if test -n "$global_symbol_to_import"; then
  4554. eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
  4555. fi
  4556. echo >> "$output_objdir/$my_dlsyms" "\
  4557. /* The mapping between symbol names and symbols. */
  4558. typedef struct {
  4559. const char *name;
  4560. void *address;
  4561. } lt_dlsymlist;
  4562. extern LT_DLSYM_CONST lt_dlsymlist
  4563. lt_${my_prefix}_LTX_preloaded_symbols[];\
  4564. "
  4565. if test -s "$nlist"I; then
  4566. echo >> "$output_objdir/$my_dlsyms" "\
  4567. static void lt_syminit(void)
  4568. {
  4569. LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
  4570. for (; symbol->name; ++symbol)
  4571. {"
  4572. $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
  4573. echo >> "$output_objdir/$my_dlsyms" "\
  4574. }
  4575. }"
  4576. fi
  4577. echo >> "$output_objdir/$my_dlsyms" "\
  4578. LT_DLSYM_CONST lt_dlsymlist
  4579. lt_${my_prefix}_LTX_preloaded_symbols[] =
  4580. { {\"$my_originator\", (void *) 0},"
  4581. if test -s "$nlist"I; then
  4582. echo >> "$output_objdir/$my_dlsyms" "\
  4583. {\"@INIT@\", (void *) &lt_syminit},"
  4584. fi
  4585. case $need_lib_prefix in
  4586. no)
  4587. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4588. ;;
  4589. *)
  4590. eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4591. ;;
  4592. esac
  4593. echo >> "$output_objdir/$my_dlsyms" "\
  4594. {0, (void *) 0}
  4595. };
  4596. /* This works around a problem in FreeBSD linker */
  4597. #ifdef FREEBSD_WORKAROUND
  4598. static const void *lt_preloaded_setup() {
  4599. return lt_${my_prefix}_LTX_preloaded_symbols;
  4600. }
  4601. #endif
  4602. #ifdef __cplusplus
  4603. }
  4604. #endif\
  4605. "
  4606. } # !$opt_dry_run
  4607. pic_flag_for_symtable=
  4608. case "$compile_command " in
  4609. *" -static "*) ;;
  4610. *)
  4611. case $host in
  4612. # compiling the symbol table file with pic_flag works around
  4613. # a FreeBSD bug that causes programs to crash when -lm is
  4614. # linked before any other PIC object. But we must not use
  4615. # pic_flag when linking with -static. The problem exists in
  4616. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4617. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4618. pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  4619. *-*-hpux*)
  4620. pic_flag_for_symtable=" $pic_flag" ;;
  4621. *)
  4622. $my_pic_p && pic_flag_for_symtable=" $pic_flag"
  4623. ;;
  4624. esac
  4625. ;;
  4626. esac
  4627. symtab_cflags=
  4628. for arg in $LTCFLAGS; do
  4629. case $arg in
  4630. -pie | -fpie | -fPIE) ;;
  4631. *) func_append symtab_cflags " $arg" ;;
  4632. esac
  4633. done
  4634. # Now compile the dynamic symbol file.
  4635. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  4636. # Clean up the generated files.
  4637. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
  4638. # Transform the symbol file into the correct name.
  4639. symfileobj=$output_objdir/${my_outputname}S.$objext
  4640. case $host in
  4641. *cygwin* | *mingw* | *cegcc* )
  4642. if test -f "$output_objdir/$my_outputname.def"; then
  4643. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4644. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4645. else
  4646. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4647. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4648. fi
  4649. ;;
  4650. *)
  4651. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4652. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4653. ;;
  4654. esac
  4655. ;;
  4656. *)
  4657. func_fatal_error "unknown suffix for '$my_dlsyms'"
  4658. ;;
  4659. esac
  4660. else
  4661. # We keep going just in case the user didn't refer to
  4662. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4663. # really was required.
  4664. # Nullify the symbol file.
  4665. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
  4666. finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
  4667. fi
  4668. }
  4669. # func_cygming_gnu_implib_p ARG
  4670. # This predicate returns with zero status (TRUE) if
  4671. # ARG is a GNU/binutils-style import library. Returns
  4672. # with nonzero status (FALSE) otherwise.
  4673. func_cygming_gnu_implib_p ()
  4674. {
  4675. $debug_cmd
  4676. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4677. 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)$'`
  4678. test -n "$func_cygming_gnu_implib_tmp"
  4679. }
  4680. # func_cygming_ms_implib_p ARG
  4681. # This predicate returns with zero status (TRUE) if
  4682. # ARG is an MS-style import library. Returns
  4683. # with nonzero status (FALSE) otherwise.
  4684. func_cygming_ms_implib_p ()
  4685. {
  4686. $debug_cmd
  4687. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4688. func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  4689. test -n "$func_cygming_ms_implib_tmp"
  4690. }
  4691. # func_win32_libid arg
  4692. # return the library type of file 'arg'
  4693. #
  4694. # Need a lot of goo to handle *both* DLLs and import libs
  4695. # Has to be a shell function in order to 'eat' the argument
  4696. # that is supplied when $file_magic_command is called.
  4697. # Despite the name, also deal with 64 bit binaries.
  4698. func_win32_libid ()
  4699. {
  4700. $debug_cmd
  4701. win32_libid_type=unknown
  4702. win32_fileres=`file -L $1 2>/dev/null`
  4703. case $win32_fileres in
  4704. *ar\ archive\ import\ library*) # definitely import
  4705. win32_libid_type="x86 archive import"
  4706. ;;
  4707. *ar\ archive*) # could be an import, or static
  4708. # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
  4709. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  4710. $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
  4711. case $nm_interface in
  4712. "MS dumpbin")
  4713. if func_cygming_ms_implib_p "$1" ||
  4714. func_cygming_gnu_implib_p "$1"
  4715. then
  4716. win32_nmres=import
  4717. else
  4718. win32_nmres=
  4719. fi
  4720. ;;
  4721. *)
  4722. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4723. win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
  4724. $SED -n -e '
  4725. 1,100{
  4726. / I /{
  4727. s|.*|import|
  4728. p
  4729. q
  4730. }
  4731. }'`
  4732. ;;
  4733. esac
  4734. case $win32_nmres in
  4735. import*) win32_libid_type="x86 archive import";;
  4736. *) win32_libid_type="x86 archive static";;
  4737. esac
  4738. fi
  4739. ;;
  4740. *DLL*)
  4741. win32_libid_type="x86 DLL"
  4742. ;;
  4743. *executable*) # but shell scripts are "executable" too...
  4744. case $win32_fileres in
  4745. *MS\ Windows\ PE\ Intel*)
  4746. win32_libid_type="x86 DLL"
  4747. ;;
  4748. esac
  4749. ;;
  4750. esac
  4751. $ECHO "$win32_libid_type"
  4752. }
  4753. # func_cygming_dll_for_implib ARG
  4754. #
  4755. # Platform-specific function to extract the
  4756. # name of the DLL associated with the specified
  4757. # import library ARG.
  4758. # Invoked by eval'ing the libtool variable
  4759. # $sharedlib_from_linklib_cmd
  4760. # Result is available in the variable
  4761. # $sharedlib_from_linklib_result
  4762. func_cygming_dll_for_implib ()
  4763. {
  4764. $debug_cmd
  4765. sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
  4766. }
  4767. # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
  4768. #
  4769. # The is the core of a fallback implementation of a
  4770. # platform-specific function to extract the name of the
  4771. # DLL associated with the specified import library LIBNAME.
  4772. #
  4773. # SECTION_NAME is either .idata$6 or .idata$7, depending
  4774. # on the platform and compiler that created the implib.
  4775. #
  4776. # Echos the name of the DLL associated with the
  4777. # specified import library.
  4778. func_cygming_dll_for_implib_fallback_core ()
  4779. {
  4780. $debug_cmd
  4781. match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  4782. $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
  4783. $SED '/^Contents of section '"$match_literal"':/{
  4784. # Place marker at beginning of archive member dllname section
  4785. s/.*/====MARK====/
  4786. p
  4787. d
  4788. }
  4789. # These lines can sometimes be longer than 43 characters, but
  4790. # are always uninteresting
  4791. /:[ ]*file format pe[i]\{,1\}-/d
  4792. /^In archive [^:]*:/d
  4793. # Ensure marker is printed
  4794. /^====MARK====/p
  4795. # Remove all lines with less than 43 characters
  4796. /^.\{43\}/!d
  4797. # From remaining lines, remove first 43 characters
  4798. s/^.\{43\}//' |
  4799. $SED -n '
  4800. # Join marker and all lines until next marker into a single line
  4801. /^====MARK====/ b para
  4802. H
  4803. $ b para
  4804. b
  4805. :para
  4806. x
  4807. s/\n//g
  4808. # Remove the marker
  4809. s/^====MARK====//
  4810. # Remove trailing dots and whitespace
  4811. s/[\. \t]*$//
  4812. # Print
  4813. /./p' |
  4814. # we now have a list, one entry per line, of the stringified
  4815. # contents of the appropriate section of all members of the
  4816. # archive that possess that section. Heuristic: eliminate
  4817. # all those that have a first or second character that is
  4818. # a '.' (that is, objdump's representation of an unprintable
  4819. # character.) This should work for all archives with less than
  4820. # 0x302f exports -- but will fail for DLLs whose name actually
  4821. # begins with a literal '.' or a single character followed by
  4822. # a '.'.
  4823. #
  4824. # Of those that remain, print the first one.
  4825. $SED -e '/^\./d;/^.\./d;q'
  4826. }
  4827. # func_cygming_dll_for_implib_fallback ARG
  4828. # Platform-specific function to extract the
  4829. # name of the DLL associated with the specified
  4830. # import library ARG.
  4831. #
  4832. # This fallback implementation is for use when $DLLTOOL
  4833. # does not support the --identify-strict option.
  4834. # Invoked by eval'ing the libtool variable
  4835. # $sharedlib_from_linklib_cmd
  4836. # Result is available in the variable
  4837. # $sharedlib_from_linklib_result
  4838. func_cygming_dll_for_implib_fallback ()
  4839. {
  4840. $debug_cmd
  4841. if func_cygming_gnu_implib_p "$1"; then
  4842. # binutils import library
  4843. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  4844. elif func_cygming_ms_implib_p "$1"; then
  4845. # ms-generated import library
  4846. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  4847. else
  4848. # unknown
  4849. sharedlib_from_linklib_result=
  4850. fi
  4851. }
  4852. # func_extract_an_archive dir oldlib
  4853. func_extract_an_archive ()
  4854. {
  4855. $debug_cmd
  4856. f_ex_an_ar_dir=$1; shift
  4857. f_ex_an_ar_oldlib=$1
  4858. if test yes = "$lock_old_archive_extraction"; then
  4859. lockfile=$f_ex_an_ar_oldlib.lock
  4860. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  4861. func_echo "Waiting for $lockfile to be removed"
  4862. sleep 2
  4863. done
  4864. fi
  4865. func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
  4866. 'stat=$?; rm -f "$lockfile"; exit $stat'
  4867. if test yes = "$lock_old_archive_extraction"; then
  4868. $opt_dry_run || rm -f "$lockfile"
  4869. fi
  4870. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  4871. :
  4872. else
  4873. func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  4874. fi
  4875. }
  4876. # func_extract_archives gentop oldlib ...
  4877. func_extract_archives ()
  4878. {
  4879. $debug_cmd
  4880. my_gentop=$1; shift
  4881. my_oldlibs=${1+"$@"}
  4882. my_oldobjs=
  4883. my_xlib=
  4884. my_xabs=
  4885. my_xdir=
  4886. for my_xlib in $my_oldlibs; do
  4887. # Extract the objects.
  4888. case $my_xlib in
  4889. [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
  4890. *) my_xabs=`pwd`"/$my_xlib" ;;
  4891. esac
  4892. func_basename "$my_xlib"
  4893. my_xlib=$func_basename_result
  4894. my_xlib_u=$my_xlib
  4895. while :; do
  4896. case " $extracted_archives " in
  4897. *" $my_xlib_u "*)
  4898. func_arith $extracted_serial + 1
  4899. extracted_serial=$func_arith_result
  4900. my_xlib_u=lt$extracted_serial-$my_xlib ;;
  4901. *) break ;;
  4902. esac
  4903. done
  4904. extracted_archives="$extracted_archives $my_xlib_u"
  4905. my_xdir=$my_gentop/$my_xlib_u
  4906. func_mkdir_p "$my_xdir"
  4907. case $host in
  4908. *-darwin*)
  4909. func_verbose "Extracting $my_xabs"
  4910. # Do not bother doing anything if just a dry run
  4911. $opt_dry_run || {
  4912. darwin_orig_dir=`pwd`
  4913. cd $my_xdir || exit $?
  4914. darwin_archive=$my_xabs
  4915. darwin_curdir=`pwd`
  4916. func_basename "$darwin_archive"
  4917. darwin_base_archive=$func_basename_result
  4918. darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  4919. if test -n "$darwin_arches"; then
  4920. darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  4921. darwin_arch=
  4922. func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  4923. for darwin_arch in $darwin_arches; do
  4924. func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
  4925. $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
  4926. cd "unfat-$$/$darwin_base_archive-$darwin_arch"
  4927. func_extract_an_archive "`pwd`" "$darwin_base_archive"
  4928. cd "$darwin_curdir"
  4929. $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
  4930. done # $darwin_arches
  4931. ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  4932. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
  4933. darwin_file=
  4934. darwin_files=
  4935. for darwin_file in $darwin_filelist; do
  4936. darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  4937. $LIPO -create -output "$darwin_file" $darwin_files
  4938. done # $darwin_filelist
  4939. $RM -rf unfat-$$
  4940. cd "$darwin_orig_dir"
  4941. else
  4942. cd $darwin_orig_dir
  4943. func_extract_an_archive "$my_xdir" "$my_xabs"
  4944. fi # $darwin_arches
  4945. } # !$opt_dry_run
  4946. ;;
  4947. *)
  4948. func_extract_an_archive "$my_xdir" "$my_xabs"
  4949. ;;
  4950. esac
  4951. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  4952. done
  4953. func_extract_archives_result=$my_oldobjs
  4954. }
  4955. # func_emit_wrapper [arg=no]
  4956. #
  4957. # Emit a libtool wrapper script on stdout.
  4958. # Don't directly open a file because we may want to
  4959. # incorporate the script contents within a cygwin/mingw
  4960. # wrapper executable. Must ONLY be called from within
  4961. # func_mode_link because it depends on a number of variables
  4962. # set therein.
  4963. #
  4964. # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  4965. # variable will take. If 'yes', then the emitted script
  4966. # will assume that the directory where it is stored is
  4967. # the $objdir directory. This is a cygwin/mingw-specific
  4968. # behavior.
  4969. func_emit_wrapper ()
  4970. {
  4971. func_emit_wrapper_arg1=${1-no}
  4972. $ECHO "\
  4973. #! $SHELL
  4974. # $output - temporary wrapper script for $objdir/$outputname
  4975. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  4976. #
  4977. # The $output program cannot be directly executed until all the libtool
  4978. # libraries that it depends on are installed.
  4979. #
  4980. # This wrapper script should never be moved out of the build directory.
  4981. # If it is, it will not operate correctly.
  4982. # Sed substitution that helps us do robust quoting. It backslashifies
  4983. # metacharacters that are still active within double-quoted strings.
  4984. sed_quote_subst='$sed_quote_subst'
  4985. # Be Bourne compatible
  4986. if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  4987. emulate sh
  4988. NULLCMD=:
  4989. # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  4990. # is contrary to our usage. Disable this feature.
  4991. alias -g '\${1+\"\$@\"}'='\"\$@\"'
  4992. setopt NO_GLOB_SUBST
  4993. else
  4994. case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  4995. fi
  4996. BIN_SH=xpg4; export BIN_SH # for Tru64
  4997. DUALCASE=1; export DUALCASE # for MKS sh
  4998. # The HP-UX ksh and POSIX shell print the target directory to stdout
  4999. # if CDPATH is set.
  5000. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  5001. relink_command=\"$relink_command\"
  5002. # This environment variable determines our operation mode.
  5003. if test \"\$libtool_install_magic\" = \"$magic\"; then
  5004. # install mode needs the following variables:
  5005. generated_by_libtool_version='$macro_version'
  5006. notinst_deplibs='$notinst_deplibs'
  5007. else
  5008. # When we are sourced in execute mode, \$file and \$ECHO are already set.
  5009. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5010. file=\"\$0\""
  5011. func_quote_arg pretty "$ECHO"
  5012. qECHO=$func_quote_arg_result
  5013. $ECHO "\
  5014. # A function that is used when there is no print builtin or printf.
  5015. func_fallback_echo ()
  5016. {
  5017. eval 'cat <<_LTECHO_EOF
  5018. \$1
  5019. _LTECHO_EOF'
  5020. }
  5021. ECHO=$qECHO
  5022. fi
  5023. # Very basic option parsing. These options are (a) specific to
  5024. # the libtool wrapper, (b) are identical between the wrapper
  5025. # /script/ and the wrapper /executable/ that is used only on
  5026. # windows platforms, and (c) all begin with the string "--lt-"
  5027. # (application programs are unlikely to have options that match
  5028. # this pattern).
  5029. #
  5030. # There are only two supported options: --lt-debug and
  5031. # --lt-dump-script. There is, deliberately, no --lt-help.
  5032. #
  5033. # The first argument to this parsing function should be the
  5034. # script's $0 value, followed by "$@".
  5035. lt_option_debug=
  5036. func_parse_lt_options ()
  5037. {
  5038. lt_script_arg0=\$0
  5039. shift
  5040. for lt_opt
  5041. do
  5042. case \"\$lt_opt\" in
  5043. --lt-debug) lt_option_debug=1 ;;
  5044. --lt-dump-script)
  5045. lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
  5046. test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
  5047. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
  5048. cat \"\$lt_dump_D/\$lt_dump_F\"
  5049. exit 0
  5050. ;;
  5051. --lt-*)
  5052. \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
  5053. exit 1
  5054. ;;
  5055. esac
  5056. done
  5057. # Print the debug banner immediately:
  5058. if test -n \"\$lt_option_debug\"; then
  5059. echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  5060. fi
  5061. }
  5062. # Used when --lt-debug. Prints its arguments to stdout
  5063. # (redirection is the responsibility of the caller)
  5064. func_lt_dump_args ()
  5065. {
  5066. lt_dump_args_N=1;
  5067. for lt_arg
  5068. do
  5069. \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
  5070. lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  5071. done
  5072. }
  5073. # Core function for launching the target application
  5074. func_exec_program_core ()
  5075. {
  5076. "
  5077. case $host in
  5078. # Backslashes separate directories on plain windows
  5079. *-*-mingw | *-*-os2* | *-cegcc*)
  5080. $ECHO "\
  5081. if test -n \"\$lt_option_debug\"; then
  5082. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
  5083. func_lt_dump_args \${1+\"\$@\"} 1>&2
  5084. fi
  5085. exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  5086. "
  5087. ;;
  5088. *)
  5089. $ECHO "\
  5090. if test -n \"\$lt_option_debug\"; then
  5091. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
  5092. func_lt_dump_args \${1+\"\$@\"} 1>&2
  5093. fi
  5094. exec \"\$progdir/\$program\" \${1+\"\$@\"}
  5095. "
  5096. ;;
  5097. esac
  5098. $ECHO "\
  5099. \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  5100. exit 1
  5101. }
  5102. # A function to encapsulate launching the target application
  5103. # Strips options in the --lt-* namespace from \$@ and
  5104. # launches target application with the remaining arguments.
  5105. func_exec_program ()
  5106. {
  5107. case \" \$* \" in
  5108. *\\ --lt-*)
  5109. for lt_wr_arg
  5110. do
  5111. case \$lt_wr_arg in
  5112. --lt-*) ;;
  5113. *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
  5114. esac
  5115. shift
  5116. done ;;
  5117. esac
  5118. func_exec_program_core \${1+\"\$@\"}
  5119. }
  5120. # Parse options
  5121. func_parse_lt_options \"\$0\" \${1+\"\$@\"}
  5122. # Find the directory that this script lives in.
  5123. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
  5124. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  5125. # Follow symbolic links until we get to the real thisdir.
  5126. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
  5127. while test -n \"\$file\"; do
  5128. destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
  5129. # If there was a directory component, then change thisdir.
  5130. if test \"x\$destdir\" != \"x\$file\"; then
  5131. case \"\$destdir\" in
  5132. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  5133. *) thisdir=\"\$thisdir/\$destdir\" ;;
  5134. esac
  5135. fi
  5136. file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
  5137. file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
  5138. done
  5139. # Usually 'no', except on cygwin/mingw when embedded into
  5140. # the cwrapper.
  5141. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
  5142. if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  5143. # special case for '.'
  5144. if test \"\$thisdir\" = \".\"; then
  5145. thisdir=\`pwd\`
  5146. fi
  5147. # remove .libs from thisdir
  5148. case \"\$thisdir\" in
  5149. *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
  5150. $objdir ) thisdir=. ;;
  5151. esac
  5152. fi
  5153. # Try to get the absolute directory name.
  5154. absdir=\`cd \"\$thisdir\" && pwd\`
  5155. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  5156. "
  5157. if test yes = "$fast_install"; then
  5158. $ECHO "\
  5159. program=lt-'$outputname'$exeext
  5160. progdir=\"\$thisdir/$objdir\"
  5161. if test ! -f \"\$progdir/\$program\" ||
  5162. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
  5163. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  5164. file=\"\$\$-\$program\"
  5165. if test ! -d \"\$progdir\"; then
  5166. $MKDIR \"\$progdir\"
  5167. else
  5168. $RM \"\$progdir/\$file\"
  5169. fi"
  5170. $ECHO "\
  5171. # relink executable if necessary
  5172. if test -n \"\$relink_command\"; then
  5173. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  5174. else
  5175. \$ECHO \"\$relink_command_output\" >&2
  5176. $RM \"\$progdir/\$file\"
  5177. exit 1
  5178. fi
  5179. fi
  5180. $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  5181. { $RM \"\$progdir/\$program\";
  5182. $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  5183. $RM \"\$progdir/\$file\"
  5184. fi"
  5185. else
  5186. $ECHO "\
  5187. program='$outputname'
  5188. progdir=\"\$thisdir/$objdir\"
  5189. "
  5190. fi
  5191. $ECHO "\
  5192. if test -f \"\$progdir/\$program\"; then"
  5193. # fixup the dll searchpath if we need to.
  5194. #
  5195. # Fix the DLL searchpath if we need to. Do this before prepending
  5196. # to shlibpath, because on Windows, both are PATH and uninstalled
  5197. # libraries must come first.
  5198. if test -n "$dllsearchpath"; then
  5199. $ECHO "\
  5200. # Add the dll search path components to the executable PATH
  5201. PATH=$dllsearchpath:\$PATH
  5202. "
  5203. fi
  5204. # Export our shlibpath_var if we have one.
  5205. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5206. $ECHO "\
  5207. # Add our own library path to $shlibpath_var
  5208. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  5209. # Some systems cannot cope with colon-terminated $shlibpath_var
  5210. # The second colon is a workaround for a bug in BeOS R4 sed
  5211. $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
  5212. export $shlibpath_var
  5213. "
  5214. fi
  5215. $ECHO "\
  5216. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5217. # Run the actual program with our arguments.
  5218. func_exec_program \${1+\"\$@\"}
  5219. fi
  5220. else
  5221. # The program doesn't exist.
  5222. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
  5223. \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  5224. \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  5225. exit 1
  5226. fi
  5227. fi\
  5228. "
  5229. }
  5230. # func_emit_cwrapperexe_src
  5231. # emit the source code for a wrapper executable on stdout
  5232. # Must ONLY be called from within func_mode_link because
  5233. # it depends on a number of variable set therein.
  5234. func_emit_cwrapperexe_src ()
  5235. {
  5236. cat <<EOF
  5237. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  5238. Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  5239. The $output program cannot be directly executed until all the libtool
  5240. libraries that it depends on are installed.
  5241. This wrapper executable should never be moved out of the build directory.
  5242. If it is, it will not operate correctly.
  5243. */
  5244. EOF
  5245. cat <<"EOF"
  5246. #ifdef _MSC_VER
  5247. # define _CRT_SECURE_NO_DEPRECATE 1
  5248. #endif
  5249. #include <stdio.h>
  5250. #include <stdlib.h>
  5251. #ifdef _MSC_VER
  5252. # include <direct.h>
  5253. # include <process.h>
  5254. # include <io.h>
  5255. #else
  5256. # include <unistd.h>
  5257. # include <stdint.h>
  5258. # ifdef __CYGWIN__
  5259. # include <io.h>
  5260. # endif
  5261. #endif
  5262. #include <malloc.h>
  5263. #include <stdarg.h>
  5264. #include <assert.h>
  5265. #include <string.h>
  5266. #include <ctype.h>
  5267. #include <errno.h>
  5268. #include <fcntl.h>
  5269. #include <sys/stat.h>
  5270. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  5271. /* declarations of non-ANSI functions */
  5272. #if defined __MINGW32__
  5273. # ifdef __STRICT_ANSI__
  5274. int _putenv (const char *);
  5275. # endif
  5276. #elif defined __CYGWIN__
  5277. # ifdef __STRICT_ANSI__
  5278. char *realpath (const char *, char *);
  5279. int putenv (char *);
  5280. int setenv (const char *, const char *, int);
  5281. # endif
  5282. /* #elif defined other_platform || defined ... */
  5283. #endif
  5284. /* portability defines, excluding path handling macros */
  5285. #if defined _MSC_VER
  5286. # define setmode _setmode
  5287. # define stat _stat
  5288. # define chmod _chmod
  5289. # define getcwd _getcwd
  5290. # define putenv _putenv
  5291. # define S_IXUSR _S_IEXEC
  5292. #elif defined __MINGW32__
  5293. # define setmode _setmode
  5294. # define stat _stat
  5295. # define chmod _chmod
  5296. # define getcwd _getcwd
  5297. # define putenv _putenv
  5298. #elif defined __CYGWIN__
  5299. # define HAVE_SETENV
  5300. # define FOPEN_WB "wb"
  5301. /* #elif defined other platforms ... */
  5302. #endif
  5303. #if defined PATH_MAX
  5304. # define LT_PATHMAX PATH_MAX
  5305. #elif defined MAXPATHLEN
  5306. # define LT_PATHMAX MAXPATHLEN
  5307. #else
  5308. # define LT_PATHMAX 1024
  5309. #endif
  5310. #ifndef S_IXOTH
  5311. # define S_IXOTH 0
  5312. #endif
  5313. #ifndef S_IXGRP
  5314. # define S_IXGRP 0
  5315. #endif
  5316. /* path handling portability macros */
  5317. #ifndef DIR_SEPARATOR
  5318. # define DIR_SEPARATOR '/'
  5319. # define PATH_SEPARATOR ':'
  5320. #endif
  5321. #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
  5322. defined __OS2__
  5323. # define HAVE_DOS_BASED_FILE_SYSTEM
  5324. # define FOPEN_WB "wb"
  5325. # ifndef DIR_SEPARATOR_2
  5326. # define DIR_SEPARATOR_2 '\\'
  5327. # endif
  5328. # ifndef PATH_SEPARATOR_2
  5329. # define PATH_SEPARATOR_2 ';'
  5330. # endif
  5331. #endif
  5332. #ifndef DIR_SEPARATOR_2
  5333. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  5334. #else /* DIR_SEPARATOR_2 */
  5335. # define IS_DIR_SEPARATOR(ch) \
  5336. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  5337. #endif /* DIR_SEPARATOR_2 */
  5338. #ifndef PATH_SEPARATOR_2
  5339. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  5340. #else /* PATH_SEPARATOR_2 */
  5341. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  5342. #endif /* PATH_SEPARATOR_2 */
  5343. #ifndef FOPEN_WB
  5344. # define FOPEN_WB "w"
  5345. #endif
  5346. #ifndef _O_BINARY
  5347. # define _O_BINARY 0
  5348. #endif
  5349. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  5350. #define XFREE(stale) do { \
  5351. if (stale) { free (stale); stale = 0; } \
  5352. } while (0)
  5353. #if defined LT_DEBUGWRAPPER
  5354. static int lt_debug = 1;
  5355. #else
  5356. static int lt_debug = 0;
  5357. #endif
  5358. const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
  5359. void *xmalloc (size_t num);
  5360. char *xstrdup (const char *string);
  5361. const char *base_name (const char *name);
  5362. char *find_executable (const char *wrapper);
  5363. char *chase_symlinks (const char *pathspec);
  5364. int make_executable (const char *path);
  5365. int check_executable (const char *path);
  5366. char *strendzap (char *str, const char *pat);
  5367. void lt_debugprintf (const char *file, int line, const char *fmt, ...);
  5368. void lt_fatal (const char *file, int line, const char *message, ...);
  5369. static const char *nonnull (const char *s);
  5370. static const char *nonempty (const char *s);
  5371. void lt_setenv (const char *name, const char *value);
  5372. char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  5373. void lt_update_exe_path (const char *name, const char *value);
  5374. void lt_update_lib_path (const char *name, const char *value);
  5375. char **prepare_spawn (char **argv);
  5376. void lt_dump_script (FILE *f);
  5377. EOF
  5378. cat <<EOF
  5379. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  5380. # define externally_visible volatile
  5381. #else
  5382. # define externally_visible __attribute__((externally_visible)) volatile
  5383. #endif
  5384. externally_visible const char * MAGIC_EXE = "$magic_exe";
  5385. const char * LIB_PATH_VARNAME = "$shlibpath_var";
  5386. EOF
  5387. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5388. func_to_host_path "$temp_rpath"
  5389. cat <<EOF
  5390. const char * LIB_PATH_VALUE = "$func_to_host_path_result";
  5391. EOF
  5392. else
  5393. cat <<"EOF"
  5394. const char * LIB_PATH_VALUE = "";
  5395. EOF
  5396. fi
  5397. if test -n "$dllsearchpath"; then
  5398. func_to_host_path "$dllsearchpath:"
  5399. cat <<EOF
  5400. const char * EXE_PATH_VARNAME = "PATH";
  5401. const char * EXE_PATH_VALUE = "$func_to_host_path_result";
  5402. EOF
  5403. else
  5404. cat <<"EOF"
  5405. const char * EXE_PATH_VARNAME = "";
  5406. const char * EXE_PATH_VALUE = "";
  5407. EOF
  5408. fi
  5409. if test yes = "$fast_install"; then
  5410. cat <<EOF
  5411. const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  5412. EOF
  5413. else
  5414. cat <<EOF
  5415. const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  5416. EOF
  5417. fi
  5418. cat <<"EOF"
  5419. #define LTWRAPPER_OPTION_PREFIX "--lt-"
  5420. static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  5421. static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  5422. static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
  5423. int
  5424. main (int argc, char *argv[])
  5425. {
  5426. char **newargz;
  5427. int newargc;
  5428. char *tmp_pathspec;
  5429. char *actual_cwrapper_path;
  5430. char *actual_cwrapper_name;
  5431. char *target_name;
  5432. char *lt_argv_zero;
  5433. int rval = 127;
  5434. int i;
  5435. program_name = (char *) xstrdup (base_name (argv[0]));
  5436. newargz = XMALLOC (char *, (size_t) argc + 1);
  5437. /* very simple arg parsing; don't want to rely on getopt
  5438. * also, copy all non cwrapper options to newargz, except
  5439. * argz[0], which is handled differently
  5440. */
  5441. newargc=0;
  5442. for (i = 1; i < argc; i++)
  5443. {
  5444. if (STREQ (argv[i], dumpscript_opt))
  5445. {
  5446. EOF
  5447. case $host in
  5448. *mingw* | *cygwin* )
  5449. # make stdout use "unix" line endings
  5450. echo " setmode(1,_O_BINARY);"
  5451. ;;
  5452. esac
  5453. cat <<"EOF"
  5454. lt_dump_script (stdout);
  5455. return 0;
  5456. }
  5457. if (STREQ (argv[i], debug_opt))
  5458. {
  5459. lt_debug = 1;
  5460. continue;
  5461. }
  5462. if (STREQ (argv[i], ltwrapper_option_prefix))
  5463. {
  5464. /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  5465. namespace, but it is not one of the ones we know about and
  5466. have already dealt with, above (inluding dump-script), then
  5467. report an error. Otherwise, targets might begin to believe
  5468. they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  5469. namespace. The first time any user complains about this, we'll
  5470. need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  5471. or a configure.ac-settable value.
  5472. */
  5473. lt_fatal (__FILE__, __LINE__,
  5474. "unrecognized %s option: '%s'",
  5475. ltwrapper_option_prefix, argv[i]);
  5476. }
  5477. /* otherwise ... */
  5478. newargz[++newargc] = xstrdup (argv[i]);
  5479. }
  5480. newargz[++newargc] = NULL;
  5481. EOF
  5482. cat <<EOF
  5483. /* The GNU banner must be the first non-error debug message */
  5484. lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
  5485. EOF
  5486. cat <<"EOF"
  5487. lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  5488. lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
  5489. tmp_pathspec = find_executable (argv[0]);
  5490. if (tmp_pathspec == NULL)
  5491. lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  5492. lt_debugprintf (__FILE__, __LINE__,
  5493. "(main) found exe (before symlink chase) at: %s\n",
  5494. tmp_pathspec);
  5495. actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  5496. lt_debugprintf (__FILE__, __LINE__,
  5497. "(main) found exe (after symlink chase) at: %s\n",
  5498. actual_cwrapper_path);
  5499. XFREE (tmp_pathspec);
  5500. actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  5501. strendzap (actual_cwrapper_path, actual_cwrapper_name);
  5502. /* wrapper name transforms */
  5503. strendzap (actual_cwrapper_name, ".exe");
  5504. tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  5505. XFREE (actual_cwrapper_name);
  5506. actual_cwrapper_name = tmp_pathspec;
  5507. tmp_pathspec = 0;
  5508. /* target_name transforms -- use actual target program name; might have lt- prefix */
  5509. target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  5510. strendzap (target_name, ".exe");
  5511. tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  5512. XFREE (target_name);
  5513. target_name = tmp_pathspec;
  5514. tmp_pathspec = 0;
  5515. lt_debugprintf (__FILE__, __LINE__,
  5516. "(main) libtool target name: %s\n",
  5517. target_name);
  5518. EOF
  5519. cat <<EOF
  5520. newargz[0] =
  5521. XMALLOC (char, (strlen (actual_cwrapper_path) +
  5522. strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  5523. strcpy (newargz[0], actual_cwrapper_path);
  5524. strcat (newargz[0], "$objdir");
  5525. strcat (newargz[0], "/");
  5526. EOF
  5527. cat <<"EOF"
  5528. /* stop here, and copy so we don't have to do this twice */
  5529. tmp_pathspec = xstrdup (newargz[0]);
  5530. /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  5531. strcat (newargz[0], actual_cwrapper_name);
  5532. /* DO want the lt- prefix here if it exists, so use target_name */
  5533. lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  5534. XFREE (tmp_pathspec);
  5535. tmp_pathspec = NULL;
  5536. EOF
  5537. case $host_os in
  5538. mingw*)
  5539. cat <<"EOF"
  5540. {
  5541. char* p;
  5542. while ((p = strchr (newargz[0], '\\')) != NULL)
  5543. {
  5544. *p = '/';
  5545. }
  5546. while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  5547. {
  5548. *p = '/';
  5549. }
  5550. }
  5551. EOF
  5552. ;;
  5553. esac
  5554. cat <<"EOF"
  5555. XFREE (target_name);
  5556. XFREE (actual_cwrapper_path);
  5557. XFREE (actual_cwrapper_name);
  5558. lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  5559. lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  5560. /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
  5561. be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
  5562. because on Windows, both *_VARNAMEs are PATH but uninstalled
  5563. libraries must come first. */
  5564. lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  5565. lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  5566. lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
  5567. nonnull (lt_argv_zero));
  5568. for (i = 0; i < newargc; i++)
  5569. {
  5570. lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
  5571. i, nonnull (newargz[i]));
  5572. }
  5573. EOF
  5574. case $host_os in
  5575. mingw*)
  5576. cat <<"EOF"
  5577. /* execv doesn't actually work on mingw as expected on unix */
  5578. newargz = prepare_spawn (newargz);
  5579. rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  5580. if (rval == -1)
  5581. {
  5582. /* failed to start process */
  5583. lt_debugprintf (__FILE__, __LINE__,
  5584. "(main) failed to launch target \"%s\": %s\n",
  5585. lt_argv_zero, nonnull (strerror (errno)));
  5586. return 127;
  5587. }
  5588. return rval;
  5589. EOF
  5590. ;;
  5591. *)
  5592. cat <<"EOF"
  5593. execv (lt_argv_zero, newargz);
  5594. return rval; /* =127, but avoids unused variable warning */
  5595. EOF
  5596. ;;
  5597. esac
  5598. cat <<"EOF"
  5599. }
  5600. void *
  5601. xmalloc (size_t num)
  5602. {
  5603. void *p = (void *) malloc (num);
  5604. if (!p)
  5605. lt_fatal (__FILE__, __LINE__, "memory exhausted");
  5606. return p;
  5607. }
  5608. char *
  5609. xstrdup (const char *string)
  5610. {
  5611. return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  5612. string) : NULL;
  5613. }
  5614. const char *
  5615. base_name (const char *name)
  5616. {
  5617. const char *base;
  5618. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5619. /* Skip over the disk name in MSDOS pathnames. */
  5620. if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  5621. name += 2;
  5622. #endif
  5623. for (base = name; *name; name++)
  5624. if (IS_DIR_SEPARATOR (*name))
  5625. base = name + 1;
  5626. return base;
  5627. }
  5628. int
  5629. check_executable (const char *path)
  5630. {
  5631. struct stat st;
  5632. lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
  5633. nonempty (path));
  5634. if ((!path) || (!*path))
  5635. return 0;
  5636. if ((stat (path, &st) >= 0)
  5637. && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  5638. return 1;
  5639. else
  5640. return 0;
  5641. }
  5642. int
  5643. make_executable (const char *path)
  5644. {
  5645. int rval = 0;
  5646. struct stat st;
  5647. lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
  5648. nonempty (path));
  5649. if ((!path) || (!*path))
  5650. return 0;
  5651. if (stat (path, &st) >= 0)
  5652. {
  5653. rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  5654. }
  5655. return rval;
  5656. }
  5657. /* Searches for the full path of the wrapper. Returns
  5658. newly allocated full path name if found, NULL otherwise
  5659. Does not chase symlinks, even on platforms that support them.
  5660. */
  5661. char *
  5662. find_executable (const char *wrapper)
  5663. {
  5664. int has_slash = 0;
  5665. const char *p;
  5666. const char *p_next;
  5667. /* static buffer for getcwd */
  5668. char tmp[LT_PATHMAX + 1];
  5669. size_t tmp_len;
  5670. char *concat_name;
  5671. lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
  5672. nonempty (wrapper));
  5673. if ((wrapper == NULL) || (*wrapper == '\0'))
  5674. return NULL;
  5675. /* Absolute path? */
  5676. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5677. if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  5678. {
  5679. concat_name = xstrdup (wrapper);
  5680. if (check_executable (concat_name))
  5681. return concat_name;
  5682. XFREE (concat_name);
  5683. }
  5684. else
  5685. {
  5686. #endif
  5687. if (IS_DIR_SEPARATOR (wrapper[0]))
  5688. {
  5689. concat_name = xstrdup (wrapper);
  5690. if (check_executable (concat_name))
  5691. return concat_name;
  5692. XFREE (concat_name);
  5693. }
  5694. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5695. }
  5696. #endif
  5697. for (p = wrapper; *p; p++)
  5698. if (*p == '/')
  5699. {
  5700. has_slash = 1;
  5701. break;
  5702. }
  5703. if (!has_slash)
  5704. {
  5705. /* no slashes; search PATH */
  5706. const char *path = getenv ("PATH");
  5707. if (path != NULL)
  5708. {
  5709. for (p = path; *p; p = p_next)
  5710. {
  5711. const char *q;
  5712. size_t p_len;
  5713. for (q = p; *q; q++)
  5714. if (IS_PATH_SEPARATOR (*q))
  5715. break;
  5716. p_len = (size_t) (q - p);
  5717. p_next = (*q == '\0' ? q : q + 1);
  5718. if (p_len == 0)
  5719. {
  5720. /* empty path: current directory */
  5721. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5722. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5723. nonnull (strerror (errno)));
  5724. tmp_len = strlen (tmp);
  5725. concat_name =
  5726. XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5727. memcpy (concat_name, tmp, tmp_len);
  5728. concat_name[tmp_len] = '/';
  5729. strcpy (concat_name + tmp_len + 1, wrapper);
  5730. }
  5731. else
  5732. {
  5733. concat_name =
  5734. XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  5735. memcpy (concat_name, p, p_len);
  5736. concat_name[p_len] = '/';
  5737. strcpy (concat_name + p_len + 1, wrapper);
  5738. }
  5739. if (check_executable (concat_name))
  5740. return concat_name;
  5741. XFREE (concat_name);
  5742. }
  5743. }
  5744. /* not found in PATH; assume curdir */
  5745. }
  5746. /* Relative path | not found in path: prepend cwd */
  5747. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5748. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5749. nonnull (strerror (errno)));
  5750. tmp_len = strlen (tmp);
  5751. concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5752. memcpy (concat_name, tmp, tmp_len);
  5753. concat_name[tmp_len] = '/';
  5754. strcpy (concat_name + tmp_len + 1, wrapper);
  5755. if (check_executable (concat_name))
  5756. return concat_name;
  5757. XFREE (concat_name);
  5758. return NULL;
  5759. }
  5760. char *
  5761. chase_symlinks (const char *pathspec)
  5762. {
  5763. #ifndef S_ISLNK
  5764. return xstrdup (pathspec);
  5765. #else
  5766. char buf[LT_PATHMAX];
  5767. struct stat s;
  5768. char *tmp_pathspec = xstrdup (pathspec);
  5769. char *p;
  5770. int has_symlinks = 0;
  5771. while (strlen (tmp_pathspec) && !has_symlinks)
  5772. {
  5773. lt_debugprintf (__FILE__, __LINE__,
  5774. "checking path component for symlinks: %s\n",
  5775. tmp_pathspec);
  5776. if (lstat (tmp_pathspec, &s) == 0)
  5777. {
  5778. if (S_ISLNK (s.st_mode) != 0)
  5779. {
  5780. has_symlinks = 1;
  5781. break;
  5782. }
  5783. /* search backwards for last DIR_SEPARATOR */
  5784. p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  5785. while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5786. p--;
  5787. if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5788. {
  5789. /* no more DIR_SEPARATORS left */
  5790. break;
  5791. }
  5792. *p = '\0';
  5793. }
  5794. else
  5795. {
  5796. lt_fatal (__FILE__, __LINE__,
  5797. "error accessing file \"%s\": %s",
  5798. tmp_pathspec, nonnull (strerror (errno)));
  5799. }
  5800. }
  5801. XFREE (tmp_pathspec);
  5802. if (!has_symlinks)
  5803. {
  5804. return xstrdup (pathspec);
  5805. }
  5806. tmp_pathspec = realpath (pathspec, buf);
  5807. if (tmp_pathspec == 0)
  5808. {
  5809. lt_fatal (__FILE__, __LINE__,
  5810. "could not follow symlinks for %s", pathspec);
  5811. }
  5812. return xstrdup (tmp_pathspec);
  5813. #endif
  5814. }
  5815. char *
  5816. strendzap (char *str, const char *pat)
  5817. {
  5818. size_t len, patlen;
  5819. assert (str != NULL);
  5820. assert (pat != NULL);
  5821. len = strlen (str);
  5822. patlen = strlen (pat);
  5823. if (patlen <= len)
  5824. {
  5825. str += len - patlen;
  5826. if (STREQ (str, pat))
  5827. *str = '\0';
  5828. }
  5829. return str;
  5830. }
  5831. void
  5832. lt_debugprintf (const char *file, int line, const char *fmt, ...)
  5833. {
  5834. va_list args;
  5835. if (lt_debug)
  5836. {
  5837. (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
  5838. va_start (args, fmt);
  5839. (void) vfprintf (stderr, fmt, args);
  5840. va_end (args);
  5841. }
  5842. }
  5843. static void
  5844. lt_error_core (int exit_status, const char *file,
  5845. int line, const char *mode,
  5846. const char *message, va_list ap)
  5847. {
  5848. fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
  5849. vfprintf (stderr, message, ap);
  5850. fprintf (stderr, ".\n");
  5851. if (exit_status >= 0)
  5852. exit (exit_status);
  5853. }
  5854. void
  5855. lt_fatal (const char *file, int line, const char *message, ...)
  5856. {
  5857. va_list ap;
  5858. va_start (ap, message);
  5859. lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
  5860. va_end (ap);
  5861. }
  5862. static const char *
  5863. nonnull (const char *s)
  5864. {
  5865. return s ? s : "(null)";
  5866. }
  5867. static const char *
  5868. nonempty (const char *s)
  5869. {
  5870. return (s && !*s) ? "(empty)" : nonnull (s);
  5871. }
  5872. void
  5873. lt_setenv (const char *name, const char *value)
  5874. {
  5875. lt_debugprintf (__FILE__, __LINE__,
  5876. "(lt_setenv) setting '%s' to '%s'\n",
  5877. nonnull (name), nonnull (value));
  5878. {
  5879. #ifdef HAVE_SETENV
  5880. /* always make a copy, for consistency with !HAVE_SETENV */
  5881. char *str = xstrdup (value);
  5882. setenv (name, str, 1);
  5883. #else
  5884. size_t len = strlen (name) + 1 + strlen (value) + 1;
  5885. char *str = XMALLOC (char, len);
  5886. sprintf (str, "%s=%s", name, value);
  5887. if (putenv (str) != EXIT_SUCCESS)
  5888. {
  5889. XFREE (str);
  5890. }
  5891. #endif
  5892. }
  5893. }
  5894. char *
  5895. lt_extend_str (const char *orig_value, const char *add, int to_end)
  5896. {
  5897. char *new_value;
  5898. if (orig_value && *orig_value)
  5899. {
  5900. size_t orig_value_len = strlen (orig_value);
  5901. size_t add_len = strlen (add);
  5902. new_value = XMALLOC (char, add_len + orig_value_len + 1);
  5903. if (to_end)
  5904. {
  5905. strcpy (new_value, orig_value);
  5906. strcpy (new_value + orig_value_len, add);
  5907. }
  5908. else
  5909. {
  5910. strcpy (new_value, add);
  5911. strcpy (new_value + add_len, orig_value);
  5912. }
  5913. }
  5914. else
  5915. {
  5916. new_value = xstrdup (add);
  5917. }
  5918. return new_value;
  5919. }
  5920. void
  5921. lt_update_exe_path (const char *name, const char *value)
  5922. {
  5923. lt_debugprintf (__FILE__, __LINE__,
  5924. "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  5925. nonnull (name), nonnull (value));
  5926. if (name && *name && value && *value)
  5927. {
  5928. char *new_value = lt_extend_str (getenv (name), value, 0);
  5929. /* some systems can't cope with a ':'-terminated path #' */
  5930. size_t len = strlen (new_value);
  5931. while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  5932. {
  5933. new_value[--len] = '\0';
  5934. }
  5935. lt_setenv (name, new_value);
  5936. XFREE (new_value);
  5937. }
  5938. }
  5939. void
  5940. lt_update_lib_path (const char *name, const char *value)
  5941. {
  5942. lt_debugprintf (__FILE__, __LINE__,
  5943. "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  5944. nonnull (name), nonnull (value));
  5945. if (name && *name && value && *value)
  5946. {
  5947. char *new_value = lt_extend_str (getenv (name), value, 0);
  5948. lt_setenv (name, new_value);
  5949. XFREE (new_value);
  5950. }
  5951. }
  5952. EOF
  5953. case $host_os in
  5954. mingw*)
  5955. cat <<"EOF"
  5956. /* Prepares an argument vector before calling spawn().
  5957. Note that spawn() does not by itself call the command interpreter
  5958. (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
  5959. ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  5960. GetVersionEx(&v);
  5961. v.dwPlatformId == VER_PLATFORM_WIN32_NT;
  5962. }) ? "cmd.exe" : "command.com").
  5963. Instead it simply concatenates the arguments, separated by ' ', and calls
  5964. CreateProcess(). We must quote the arguments since Win32 CreateProcess()
  5965. interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
  5966. special way:
  5967. - Space and tab are interpreted as delimiters. They are not treated as
  5968. delimiters if they are surrounded by double quotes: "...".
  5969. - Unescaped double quotes are removed from the input. Their only effect is
  5970. that within double quotes, space and tab are treated like normal
  5971. characters.
  5972. - Backslashes not followed by double quotes are not special.
  5973. - But 2*n+1 backslashes followed by a double quote become
  5974. n backslashes followed by a double quote (n >= 0):
  5975. \" -> "
  5976. \\\" -> \"
  5977. \\\\\" -> \\"
  5978. */
  5979. #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"
  5980. #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"
  5981. char **
  5982. prepare_spawn (char **argv)
  5983. {
  5984. size_t argc;
  5985. char **new_argv;
  5986. size_t i;
  5987. /* Count number of arguments. */
  5988. for (argc = 0; argv[argc] != NULL; argc++)
  5989. ;
  5990. /* Allocate new argument vector. */
  5991. new_argv = XMALLOC (char *, argc + 1);
  5992. /* Put quoted arguments into the new argument vector. */
  5993. for (i = 0; i < argc; i++)
  5994. {
  5995. const char *string = argv[i];
  5996. if (string[0] == '\0')
  5997. new_argv[i] = xstrdup ("\"\"");
  5998. else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
  5999. {
  6000. int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
  6001. size_t length;
  6002. unsigned int backslashes;
  6003. const char *s;
  6004. char *quoted_string;
  6005. char *p;
  6006. length = 0;
  6007. backslashes = 0;
  6008. if (quote_around)
  6009. length++;
  6010. for (s = string; *s != '\0'; s++)
  6011. {
  6012. char c = *s;
  6013. if (c == '"')
  6014. length += backslashes + 1;
  6015. length++;
  6016. if (c == '\\')
  6017. backslashes++;
  6018. else
  6019. backslashes = 0;
  6020. }
  6021. if (quote_around)
  6022. length += backslashes + 1;
  6023. quoted_string = XMALLOC (char, length + 1);
  6024. p = quoted_string;
  6025. backslashes = 0;
  6026. if (quote_around)
  6027. *p++ = '"';
  6028. for (s = string; *s != '\0'; s++)
  6029. {
  6030. char c = *s;
  6031. if (c == '"')
  6032. {
  6033. unsigned int j;
  6034. for (j = backslashes + 1; j > 0; j--)
  6035. *p++ = '\\';
  6036. }
  6037. *p++ = c;
  6038. if (c == '\\')
  6039. backslashes++;
  6040. else
  6041. backslashes = 0;
  6042. }
  6043. if (quote_around)
  6044. {
  6045. unsigned int j;
  6046. for (j = backslashes; j > 0; j--)
  6047. *p++ = '\\';
  6048. *p++ = '"';
  6049. }
  6050. *p = '\0';
  6051. new_argv[i] = quoted_string;
  6052. }
  6053. else
  6054. new_argv[i] = (char *) string;
  6055. }
  6056. new_argv[argc] = NULL;
  6057. return new_argv;
  6058. }
  6059. EOF
  6060. ;;
  6061. esac
  6062. cat <<"EOF"
  6063. void lt_dump_script (FILE* f)
  6064. {
  6065. EOF
  6066. func_emit_wrapper yes |
  6067. $SED -n -e '
  6068. s/^\(.\{79\}\)\(..*\)/\1\
  6069. \2/
  6070. h
  6071. s/\([\\"]\)/\\\1/g
  6072. s/$/\\n/
  6073. s/\([^\n]*\).*/ fputs ("\1", f);/p
  6074. g
  6075. D'
  6076. cat <<"EOF"
  6077. }
  6078. EOF
  6079. }
  6080. # end: func_emit_cwrapperexe_src
  6081. # func_win32_import_lib_p ARG
  6082. # True if ARG is an import lib, as indicated by $file_magic_cmd
  6083. func_win32_import_lib_p ()
  6084. {
  6085. $debug_cmd
  6086. case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
  6087. *import*) : ;;
  6088. *) false ;;
  6089. esac
  6090. }
  6091. # func_suncc_cstd_abi
  6092. # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
  6093. # Several compiler flags select an ABI that is incompatible with the
  6094. # Cstd library. Avoid specifying it if any are in CXXFLAGS.
  6095. func_suncc_cstd_abi ()
  6096. {
  6097. $debug_cmd
  6098. case " $compile_command " in
  6099. *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
  6100. suncc_use_cstd_abi=no
  6101. ;;
  6102. *)
  6103. suncc_use_cstd_abi=yes
  6104. ;;
  6105. esac
  6106. }
  6107. # func_mode_link arg...
  6108. func_mode_link ()
  6109. {
  6110. $debug_cmd
  6111. case $host in
  6112. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6113. # It is impossible to link a dll without this setting, and
  6114. # we shouldn't force the makefile maintainer to figure out
  6115. # what system we are compiling for in order to pass an extra
  6116. # flag for every libtool invocation.
  6117. # allow_undefined=no
  6118. # FIXME: Unfortunately, there are problems with the above when trying
  6119. # to make a dll that has undefined symbols, in which case not
  6120. # even a static library is built. For now, we need to specify
  6121. # -no-undefined on the libtool link line when we can be certain
  6122. # that all symbols are satisfied, otherwise we get a static library.
  6123. allow_undefined=yes
  6124. ;;
  6125. *)
  6126. allow_undefined=yes
  6127. ;;
  6128. esac
  6129. libtool_args=$nonopt
  6130. base_compile="$nonopt $@"
  6131. compile_command=$nonopt
  6132. finalize_command=$nonopt
  6133. compile_rpath=
  6134. finalize_rpath=
  6135. compile_shlibpath=
  6136. finalize_shlibpath=
  6137. convenience=
  6138. old_convenience=
  6139. deplibs=
  6140. old_deplibs=
  6141. compiler_flags=
  6142. linker_flags=
  6143. dllsearchpath=
  6144. lib_search_path=`pwd`
  6145. inst_prefix_dir=
  6146. new_inherited_linker_flags=
  6147. avoid_version=no
  6148. bindir=
  6149. dlfiles=
  6150. dlprefiles=
  6151. dlself=no
  6152. export_dynamic=no
  6153. export_symbols=
  6154. export_symbols_regex=
  6155. generated=
  6156. libobjs=
  6157. ltlibs=
  6158. module=no
  6159. no_install=no
  6160. objs=
  6161. os2dllname=
  6162. non_pic_objects=
  6163. precious_files_regex=
  6164. prefer_static_libs=no
  6165. preload=false
  6166. prev=
  6167. prevarg=
  6168. release=
  6169. rpath=
  6170. xrpath=
  6171. perm_rpath=
  6172. temp_rpath=
  6173. thread_safe=no
  6174. vinfo=
  6175. vinfo_number=no
  6176. weak_libs=
  6177. single_module=$wl-single_module
  6178. func_infer_tag $base_compile
  6179. # We need to know -static, to get the right output filenames.
  6180. for arg
  6181. do
  6182. case $arg in
  6183. -shared)
  6184. test yes != "$build_libtool_libs" \
  6185. && func_fatal_configuration "cannot build a shared library"
  6186. build_old_libs=no
  6187. break
  6188. ;;
  6189. -all-static | -static | -static-libtool-libs)
  6190. case $arg in
  6191. -all-static)
  6192. if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  6193. func_warning "complete static linking is impossible in this configuration"
  6194. fi
  6195. if test -n "$link_static_flag"; then
  6196. dlopen_self=$dlopen_self_static
  6197. fi
  6198. prefer_static_libs=yes
  6199. ;;
  6200. -static)
  6201. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6202. dlopen_self=$dlopen_self_static
  6203. fi
  6204. prefer_static_libs=built
  6205. ;;
  6206. -static-libtool-libs)
  6207. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6208. dlopen_self=$dlopen_self_static
  6209. fi
  6210. prefer_static_libs=yes
  6211. ;;
  6212. esac
  6213. build_libtool_libs=no
  6214. build_old_libs=yes
  6215. break
  6216. ;;
  6217. esac
  6218. done
  6219. # See if our shared archives depend on static archives.
  6220. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  6221. # Go through the arguments, transforming them on the way.
  6222. while test "$#" -gt 0; do
  6223. arg=$1
  6224. shift
  6225. func_quote_arg pretty,unquoted "$arg"
  6226. qarg=$func_quote_arg_unquoted_result
  6227. func_append libtool_args " $func_quote_arg_result"
  6228. # If the previous option needs an argument, assign it.
  6229. if test -n "$prev"; then
  6230. case $prev in
  6231. output)
  6232. func_append compile_command " @OUTPUT@"
  6233. func_append finalize_command " @OUTPUT@"
  6234. ;;
  6235. esac
  6236. case $prev in
  6237. bindir)
  6238. bindir=$arg
  6239. prev=
  6240. continue
  6241. ;;
  6242. dlfiles|dlprefiles)
  6243. $preload || {
  6244. # Add the symbol object into the linking commands.
  6245. func_append compile_command " @SYMFILE@"
  6246. func_append finalize_command " @SYMFILE@"
  6247. preload=:
  6248. }
  6249. case $arg in
  6250. *.la | *.lo) ;; # We handle these cases below.
  6251. force)
  6252. if test no = "$dlself"; then
  6253. dlself=needless
  6254. export_dynamic=yes
  6255. fi
  6256. prev=
  6257. continue
  6258. ;;
  6259. self)
  6260. if test dlprefiles = "$prev"; then
  6261. dlself=yes
  6262. elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
  6263. dlself=yes
  6264. else
  6265. dlself=needless
  6266. export_dynamic=yes
  6267. fi
  6268. prev=
  6269. continue
  6270. ;;
  6271. *)
  6272. if test dlfiles = "$prev"; then
  6273. func_append dlfiles " $arg"
  6274. else
  6275. func_append dlprefiles " $arg"
  6276. fi
  6277. prev=
  6278. continue
  6279. ;;
  6280. esac
  6281. ;;
  6282. expsyms)
  6283. export_symbols=$arg
  6284. test -f "$arg" \
  6285. || func_fatal_error "symbol file '$arg' does not exist"
  6286. prev=
  6287. continue
  6288. ;;
  6289. expsyms_regex)
  6290. export_symbols_regex=$arg
  6291. prev=
  6292. continue
  6293. ;;
  6294. framework)
  6295. case $host in
  6296. *-*-darwin*)
  6297. case "$deplibs " in
  6298. *" $qarg.ltframework "*) ;;
  6299. *) func_append deplibs " $qarg.ltframework" # this is fixed later
  6300. ;;
  6301. esac
  6302. ;;
  6303. esac
  6304. prev=
  6305. continue
  6306. ;;
  6307. inst_prefix)
  6308. inst_prefix_dir=$arg
  6309. prev=
  6310. continue
  6311. ;;
  6312. mllvm)
  6313. # Clang does not use LLVM to link, so we can simply discard any
  6314. # '-mllvm $arg' options when doing the link step.
  6315. prev=
  6316. continue
  6317. ;;
  6318. objectlist)
  6319. if test -f "$arg"; then
  6320. save_arg=$arg
  6321. moreargs=
  6322. for fil in `cat "$save_arg"`
  6323. do
  6324. # func_append moreargs " $fil"
  6325. arg=$fil
  6326. # A libtool-controlled object.
  6327. # Check to see that this really is a libtool object.
  6328. if func_lalib_unsafe_p "$arg"; then
  6329. pic_object=
  6330. non_pic_object=
  6331. # Read the .lo file
  6332. func_source "$arg"
  6333. if test -z "$pic_object" ||
  6334. test -z "$non_pic_object" ||
  6335. test none = "$pic_object" &&
  6336. test none = "$non_pic_object"; then
  6337. func_fatal_error "cannot find name of object for '$arg'"
  6338. fi
  6339. # Extract subdirectory from the argument.
  6340. func_dirname "$arg" "/" ""
  6341. xdir=$func_dirname_result
  6342. if test none != "$pic_object"; then
  6343. # Prepend the subdirectory the object is found in.
  6344. pic_object=$xdir$pic_object
  6345. if test dlfiles = "$prev"; then
  6346. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6347. func_append dlfiles " $pic_object"
  6348. prev=
  6349. continue
  6350. else
  6351. # If libtool objects are unsupported, then we need to preload.
  6352. prev=dlprefiles
  6353. fi
  6354. fi
  6355. # CHECK ME: I think I busted this. -Ossama
  6356. if test dlprefiles = "$prev"; then
  6357. # Preload the old-style object.
  6358. func_append dlprefiles " $pic_object"
  6359. prev=
  6360. fi
  6361. # A PIC object.
  6362. func_append libobjs " $pic_object"
  6363. arg=$pic_object
  6364. fi
  6365. # Non-PIC object.
  6366. if test none != "$non_pic_object"; then
  6367. # Prepend the subdirectory the object is found in.
  6368. non_pic_object=$xdir$non_pic_object
  6369. # A standard non-PIC object
  6370. func_append non_pic_objects " $non_pic_object"
  6371. if test -z "$pic_object" || test none = "$pic_object"; then
  6372. arg=$non_pic_object
  6373. fi
  6374. else
  6375. # If the PIC object exists, use it instead.
  6376. # $xdir was prepended to $pic_object above.
  6377. non_pic_object=$pic_object
  6378. func_append non_pic_objects " $non_pic_object"
  6379. fi
  6380. else
  6381. # Only an error if not doing a dry-run.
  6382. if $opt_dry_run; then
  6383. # Extract subdirectory from the argument.
  6384. func_dirname "$arg" "/" ""
  6385. xdir=$func_dirname_result
  6386. func_lo2o "$arg"
  6387. pic_object=$xdir$objdir/$func_lo2o_result
  6388. non_pic_object=$xdir$func_lo2o_result
  6389. func_append libobjs " $pic_object"
  6390. func_append non_pic_objects " $non_pic_object"
  6391. else
  6392. func_fatal_error "'$arg' is not a valid libtool object"
  6393. fi
  6394. fi
  6395. done
  6396. else
  6397. func_fatal_error "link input file '$arg' does not exist"
  6398. fi
  6399. arg=$save_arg
  6400. prev=
  6401. continue
  6402. ;;
  6403. os2dllname)
  6404. os2dllname=$arg
  6405. prev=
  6406. continue
  6407. ;;
  6408. precious_regex)
  6409. precious_files_regex=$arg
  6410. prev=
  6411. continue
  6412. ;;
  6413. release)
  6414. release=-$arg
  6415. prev=
  6416. continue
  6417. ;;
  6418. rpath | xrpath)
  6419. # We need an absolute path.
  6420. case $arg in
  6421. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6422. *)
  6423. func_fatal_error "only absolute run-paths are allowed"
  6424. ;;
  6425. esac
  6426. if test rpath = "$prev"; then
  6427. case "$rpath " in
  6428. *" $arg "*) ;;
  6429. *) func_append rpath " $arg" ;;
  6430. esac
  6431. else
  6432. case "$xrpath " in
  6433. *" $arg "*) ;;
  6434. *) func_append xrpath " $arg" ;;
  6435. esac
  6436. fi
  6437. prev=
  6438. continue
  6439. ;;
  6440. shrext)
  6441. shrext_cmds=$arg
  6442. prev=
  6443. continue
  6444. ;;
  6445. weak)
  6446. func_append weak_libs " $arg"
  6447. prev=
  6448. continue
  6449. ;;
  6450. xcclinker)
  6451. func_append linker_flags " $qarg"
  6452. func_append compiler_flags " $qarg"
  6453. prev=
  6454. func_append compile_command " $qarg"
  6455. func_append finalize_command " $qarg"
  6456. continue
  6457. ;;
  6458. xcompiler)
  6459. func_append compiler_flags " $qarg"
  6460. prev=
  6461. func_append compile_command " $qarg"
  6462. func_append finalize_command " $qarg"
  6463. continue
  6464. ;;
  6465. xlinker)
  6466. func_append linker_flags " $qarg"
  6467. func_append compiler_flags " $wl$qarg"
  6468. prev=
  6469. func_append compile_command " $wl$qarg"
  6470. func_append finalize_command " $wl$qarg"
  6471. continue
  6472. ;;
  6473. *)
  6474. eval "$prev=\"\$arg\""
  6475. prev=
  6476. continue
  6477. ;;
  6478. esac
  6479. fi # test -n "$prev"
  6480. prevarg=$arg
  6481. case $arg in
  6482. -all-static)
  6483. if test -n "$link_static_flag"; then
  6484. # See comment for -static flag below, for more details.
  6485. func_append compile_command " $link_static_flag"
  6486. func_append finalize_command " $link_static_flag"
  6487. fi
  6488. continue
  6489. ;;
  6490. -allow-undefined)
  6491. # FIXME: remove this flag sometime in the future.
  6492. func_fatal_error "'-allow-undefined' must not be used because it is the default"
  6493. ;;
  6494. -avoid-version)
  6495. avoid_version=yes
  6496. continue
  6497. ;;
  6498. -bindir)
  6499. prev=bindir
  6500. continue
  6501. ;;
  6502. -dlopen)
  6503. prev=dlfiles
  6504. continue
  6505. ;;
  6506. -dlpreopen)
  6507. prev=dlprefiles
  6508. continue
  6509. ;;
  6510. -export-dynamic)
  6511. export_dynamic=yes
  6512. continue
  6513. ;;
  6514. -export-symbols | -export-symbols-regex)
  6515. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  6516. func_fatal_error "more than one -exported-symbols argument is not allowed"
  6517. fi
  6518. if test X-export-symbols = "X$arg"; then
  6519. prev=expsyms
  6520. else
  6521. prev=expsyms_regex
  6522. fi
  6523. continue
  6524. ;;
  6525. -framework)
  6526. prev=framework
  6527. continue
  6528. ;;
  6529. -inst-prefix-dir)
  6530. prev=inst_prefix
  6531. continue
  6532. ;;
  6533. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  6534. # so, if we see these flags be careful not to treat them like -L
  6535. -L[A-Z][A-Z]*:*)
  6536. case $with_gcc/$host in
  6537. no/*-*-irix* | /*-*-irix*)
  6538. func_append compile_command " $arg"
  6539. func_append finalize_command " $arg"
  6540. ;;
  6541. esac
  6542. continue
  6543. ;;
  6544. -L*)
  6545. func_stripname "-L" '' "$arg"
  6546. if test -z "$func_stripname_result"; then
  6547. if test "$#" -gt 0; then
  6548. func_fatal_error "require no space between '-L' and '$1'"
  6549. else
  6550. func_fatal_error "need path for '-L' option"
  6551. fi
  6552. fi
  6553. func_resolve_sysroot "$func_stripname_result"
  6554. dir=$func_resolve_sysroot_result
  6555. # We need an absolute path.
  6556. case $dir in
  6557. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6558. *)
  6559. absdir=`cd "$dir" && pwd`
  6560. test -z "$absdir" && \
  6561. func_fatal_error "cannot determine absolute directory name of '$dir'"
  6562. dir=$absdir
  6563. ;;
  6564. esac
  6565. case "$deplibs " in
  6566. *" -L$dir "* | *" $arg "*)
  6567. # Will only happen for absolute or sysroot arguments
  6568. ;;
  6569. *)
  6570. # Preserve sysroot, but never include relative directories
  6571. case $dir in
  6572. [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
  6573. *) func_append deplibs " -L$dir" ;;
  6574. esac
  6575. func_append lib_search_path " $dir"
  6576. ;;
  6577. esac
  6578. case $host in
  6579. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6580. testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
  6581. case :$dllsearchpath: in
  6582. *":$dir:"*) ;;
  6583. ::) dllsearchpath=$dir;;
  6584. *) func_append dllsearchpath ":$dir";;
  6585. esac
  6586. case :$dllsearchpath: in
  6587. *":$testbindir:"*) ;;
  6588. ::) dllsearchpath=$testbindir;;
  6589. *) func_append dllsearchpath ":$testbindir";;
  6590. esac
  6591. ;;
  6592. esac
  6593. continue
  6594. ;;
  6595. -l*)
  6596. if test X-lc = "X$arg" || test X-lm = "X$arg"; then
  6597. case $host in
  6598. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
  6599. # These systems don't actually have a C or math library (as such)
  6600. continue
  6601. ;;
  6602. *-*-os2*)
  6603. # These systems don't actually have a C library (as such)
  6604. test X-lc = "X$arg" && continue
  6605. ;;
  6606. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6607. # Do not include libc due to us having libc/libc_r.
  6608. test X-lc = "X$arg" && continue
  6609. ;;
  6610. *-*-rhapsody* | *-*-darwin1.[012])
  6611. # Rhapsody C and math libraries are in the System framework
  6612. func_append deplibs " System.ltframework"
  6613. continue
  6614. ;;
  6615. *-*-sco3.2v5* | *-*-sco5v6*)
  6616. # Causes problems with __ctype
  6617. test X-lc = "X$arg" && continue
  6618. ;;
  6619. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  6620. # Compiler inserts libc in the correct place for threads to work
  6621. test X-lc = "X$arg" && continue
  6622. ;;
  6623. esac
  6624. elif test X-lc_r = "X$arg"; then
  6625. case $host in
  6626. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6627. # Do not include libc_r directly, use -pthread flag.
  6628. continue
  6629. ;;
  6630. esac
  6631. fi
  6632. func_append deplibs " $arg"
  6633. continue
  6634. ;;
  6635. -mllvm)
  6636. prev=mllvm
  6637. continue
  6638. ;;
  6639. -module)
  6640. module=yes
  6641. continue
  6642. ;;
  6643. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  6644. # classes, name mangling, and exception handling.
  6645. # Darwin uses the -arch flag to determine output architecture.
  6646. -model|-arch|-isysroot|--sysroot)
  6647. func_append compiler_flags " $arg"
  6648. func_append compile_command " $arg"
  6649. func_append finalize_command " $arg"
  6650. prev=xcompiler
  6651. continue
  6652. ;;
  6653. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  6654. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  6655. func_append compiler_flags " $arg"
  6656. func_append compile_command " $arg"
  6657. func_append finalize_command " $arg"
  6658. case "$new_inherited_linker_flags " in
  6659. *" $arg "*) ;;
  6660. * ) func_append new_inherited_linker_flags " $arg" ;;
  6661. esac
  6662. continue
  6663. ;;
  6664. -multi_module)
  6665. single_module=$wl-multi_module
  6666. continue
  6667. ;;
  6668. -no-fast-install)
  6669. fast_install=no
  6670. continue
  6671. ;;
  6672. -no-install)
  6673. case $host in
  6674. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  6675. # The PATH hackery in wrapper scripts is required on Windows
  6676. # and Darwin in order for the loader to find any dlls it needs.
  6677. func_warning "'-no-install' is ignored for $host"
  6678. func_warning "assuming '-no-fast-install' instead"
  6679. fast_install=no
  6680. ;;
  6681. *) no_install=yes ;;
  6682. esac
  6683. continue
  6684. ;;
  6685. -no-undefined)
  6686. allow_undefined=no
  6687. continue
  6688. ;;
  6689. -objectlist)
  6690. prev=objectlist
  6691. continue
  6692. ;;
  6693. -os2dllname)
  6694. prev=os2dllname
  6695. continue
  6696. ;;
  6697. -o) prev=output ;;
  6698. -precious-files-regex)
  6699. prev=precious_regex
  6700. continue
  6701. ;;
  6702. -release)
  6703. prev=release
  6704. continue
  6705. ;;
  6706. -rpath)
  6707. prev=rpath
  6708. continue
  6709. ;;
  6710. -R)
  6711. prev=xrpath
  6712. continue
  6713. ;;
  6714. -R*)
  6715. func_stripname '-R' '' "$arg"
  6716. dir=$func_stripname_result
  6717. # We need an absolute path.
  6718. case $dir in
  6719. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6720. =*)
  6721. func_stripname '=' '' "$dir"
  6722. dir=$lt_sysroot$func_stripname_result
  6723. ;;
  6724. *)
  6725. func_fatal_error "only absolute run-paths are allowed"
  6726. ;;
  6727. esac
  6728. case "$xrpath " in
  6729. *" $dir "*) ;;
  6730. *) func_append xrpath " $dir" ;;
  6731. esac
  6732. continue
  6733. ;;
  6734. -shared)
  6735. # The effects of -shared are defined in a previous loop.
  6736. continue
  6737. ;;
  6738. -shrext)
  6739. prev=shrext
  6740. continue
  6741. ;;
  6742. -static | -static-libtool-libs)
  6743. # The effects of -static are defined in a previous loop.
  6744. # We used to do the same as -all-static on platforms that
  6745. # didn't have a PIC flag, but the assumption that the effects
  6746. # would be equivalent was wrong. It would break on at least
  6747. # Digital Unix and AIX.
  6748. continue
  6749. ;;
  6750. -thread-safe)
  6751. thread_safe=yes
  6752. continue
  6753. ;;
  6754. -version-info)
  6755. prev=vinfo
  6756. continue
  6757. ;;
  6758. -version-number)
  6759. prev=vinfo
  6760. vinfo_number=yes
  6761. continue
  6762. ;;
  6763. -weak)
  6764. prev=weak
  6765. continue
  6766. ;;
  6767. -Wc,*)
  6768. func_stripname '-Wc,' '' "$arg"
  6769. args=$func_stripname_result
  6770. arg=
  6771. save_ifs=$IFS; IFS=,
  6772. for flag in $args; do
  6773. IFS=$save_ifs
  6774. func_quote_arg pretty "$flag"
  6775. func_append arg " $func_quote_arg_result"
  6776. func_append compiler_flags " $func_quote_arg_result"
  6777. done
  6778. IFS=$save_ifs
  6779. func_stripname ' ' '' "$arg"
  6780. arg=$func_stripname_result
  6781. ;;
  6782. -Wl,*)
  6783. func_stripname '-Wl,' '' "$arg"
  6784. args=$func_stripname_result
  6785. arg=
  6786. save_ifs=$IFS; IFS=,
  6787. for flag in $args; do
  6788. IFS=$save_ifs
  6789. func_quote_arg pretty "$flag"
  6790. func_append arg " $wl$func_quote_arg_result"
  6791. func_append compiler_flags " $wl$func_quote_arg_result"
  6792. func_append linker_flags " $func_quote_arg_result"
  6793. done
  6794. IFS=$save_ifs
  6795. func_stripname ' ' '' "$arg"
  6796. arg=$func_stripname_result
  6797. ;;
  6798. -Xcompiler)
  6799. prev=xcompiler
  6800. continue
  6801. ;;
  6802. -Xlinker)
  6803. prev=xlinker
  6804. continue
  6805. ;;
  6806. -XCClinker)
  6807. prev=xcclinker
  6808. continue
  6809. ;;
  6810. # -msg_* for osf cc
  6811. -msg_*)
  6812. func_quote_arg pretty "$arg"
  6813. arg=$func_quote_arg_result
  6814. ;;
  6815. # Flags to be passed through unchanged, with rationale:
  6816. # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
  6817. # -r[0-9][0-9]* specify processor for the SGI compiler
  6818. # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  6819. # +DA*, +DD* enable 64-bit mode for the HP compiler
  6820. # -q* compiler args for the IBM compiler
  6821. # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  6822. # -F/path path to uninstalled frameworks, gcc on darwin
  6823. # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
  6824. # -fstack-protector* stack protector flags for GCC
  6825. # @file GCC response files
  6826. # -tp=* Portland pgcc target processor selection
  6827. # --sysroot=* for sysroot support
  6828. # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
  6829. # -specs=* GCC specs files
  6830. # -stdlib=* select c++ std lib with clang
  6831. # -fsanitize=* Clang/GCC memory and address sanitizer
  6832. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  6833. -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
  6834. -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
  6835. -specs=*|-fsanitize=*)
  6836. func_quote_arg pretty "$arg"
  6837. arg=$func_quote_arg_result
  6838. func_append compile_command " $arg"
  6839. func_append finalize_command " $arg"
  6840. func_append compiler_flags " $arg"
  6841. continue
  6842. ;;
  6843. -Z*)
  6844. if test os2 = "`expr $host : '.*\(os2\)'`"; then
  6845. # OS/2 uses -Zxxx to specify OS/2-specific options
  6846. compiler_flags="$compiler_flags $arg"
  6847. func_append compile_command " $arg"
  6848. func_append finalize_command " $arg"
  6849. case $arg in
  6850. -Zlinker | -Zstack)
  6851. prev=xcompiler
  6852. ;;
  6853. esac
  6854. continue
  6855. else
  6856. # Otherwise treat like 'Some other compiler flag' below
  6857. func_quote_arg pretty "$arg"
  6858. arg=$func_quote_arg_result
  6859. fi
  6860. ;;
  6861. # Some other compiler flag.
  6862. -* | +*)
  6863. func_quote_arg pretty "$arg"
  6864. arg=$func_quote_arg_result
  6865. ;;
  6866. *.$objext)
  6867. # A standard object.
  6868. func_append objs " $arg"
  6869. ;;
  6870. *.lo)
  6871. # A libtool-controlled object.
  6872. # Check to see that this really is a libtool object.
  6873. if func_lalib_unsafe_p "$arg"; then
  6874. pic_object=
  6875. non_pic_object=
  6876. # Read the .lo file
  6877. func_source "$arg"
  6878. if test -z "$pic_object" ||
  6879. test -z "$non_pic_object" ||
  6880. test none = "$pic_object" &&
  6881. test none = "$non_pic_object"; then
  6882. func_fatal_error "cannot find name of object for '$arg'"
  6883. fi
  6884. # Extract subdirectory from the argument.
  6885. func_dirname "$arg" "/" ""
  6886. xdir=$func_dirname_result
  6887. test none = "$pic_object" || {
  6888. # Prepend the subdirectory the object is found in.
  6889. pic_object=$xdir$pic_object
  6890. if test dlfiles = "$prev"; then
  6891. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6892. func_append dlfiles " $pic_object"
  6893. prev=
  6894. continue
  6895. else
  6896. # If libtool objects are unsupported, then we need to preload.
  6897. prev=dlprefiles
  6898. fi
  6899. fi
  6900. # CHECK ME: I think I busted this. -Ossama
  6901. if test dlprefiles = "$prev"; then
  6902. # Preload the old-style object.
  6903. func_append dlprefiles " $pic_object"
  6904. prev=
  6905. fi
  6906. # A PIC object.
  6907. func_append libobjs " $pic_object"
  6908. arg=$pic_object
  6909. }
  6910. # Non-PIC object.
  6911. if test none != "$non_pic_object"; then
  6912. # Prepend the subdirectory the object is found in.
  6913. non_pic_object=$xdir$non_pic_object
  6914. # A standard non-PIC object
  6915. func_append non_pic_objects " $non_pic_object"
  6916. if test -z "$pic_object" || test none = "$pic_object"; then
  6917. arg=$non_pic_object
  6918. fi
  6919. else
  6920. # If the PIC object exists, use it instead.
  6921. # $xdir was prepended to $pic_object above.
  6922. non_pic_object=$pic_object
  6923. func_append non_pic_objects " $non_pic_object"
  6924. fi
  6925. else
  6926. # Only an error if not doing a dry-run.
  6927. if $opt_dry_run; then
  6928. # Extract subdirectory from the argument.
  6929. func_dirname "$arg" "/" ""
  6930. xdir=$func_dirname_result
  6931. func_lo2o "$arg"
  6932. pic_object=$xdir$objdir/$func_lo2o_result
  6933. non_pic_object=$xdir$func_lo2o_result
  6934. func_append libobjs " $pic_object"
  6935. func_append non_pic_objects " $non_pic_object"
  6936. else
  6937. func_fatal_error "'$arg' is not a valid libtool object"
  6938. fi
  6939. fi
  6940. ;;
  6941. *.$libext)
  6942. # An archive.
  6943. func_append deplibs " $arg"
  6944. func_append old_deplibs " $arg"
  6945. continue
  6946. ;;
  6947. *.la)
  6948. # A libtool-controlled library.
  6949. func_resolve_sysroot "$arg"
  6950. if test dlfiles = "$prev"; then
  6951. # This library was specified with -dlopen.
  6952. func_append dlfiles " $func_resolve_sysroot_result"
  6953. prev=
  6954. elif test dlprefiles = "$prev"; then
  6955. # The library was specified with -dlpreopen.
  6956. func_append dlprefiles " $func_resolve_sysroot_result"
  6957. prev=
  6958. else
  6959. func_append deplibs " $func_resolve_sysroot_result"
  6960. fi
  6961. continue
  6962. ;;
  6963. # Some other compiler argument.
  6964. *)
  6965. # Unknown arguments in both finalize_command and compile_command need
  6966. # to be aesthetically quoted because they are evaled later.
  6967. func_quote_arg pretty "$arg"
  6968. arg=$func_quote_arg_result
  6969. ;;
  6970. esac # arg
  6971. # Now actually substitute the argument into the commands.
  6972. if test -n "$arg"; then
  6973. func_append compile_command " $arg"
  6974. func_append finalize_command " $arg"
  6975. fi
  6976. done # argument parsing loop
  6977. test -n "$prev" && \
  6978. func_fatal_help "the '$prevarg' option requires an argument"
  6979. if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
  6980. eval arg=\"$export_dynamic_flag_spec\"
  6981. func_append compile_command " $arg"
  6982. func_append finalize_command " $arg"
  6983. fi
  6984. oldlibs=
  6985. # calculate the name of the file, without its directory
  6986. func_basename "$output"
  6987. outputname=$func_basename_result
  6988. libobjs_save=$libobjs
  6989. if test -n "$shlibpath_var"; then
  6990. # get the directories listed in $shlibpath_var
  6991. eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
  6992. else
  6993. shlib_search_path=
  6994. fi
  6995. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  6996. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  6997. # Definition is injected by LT_CONFIG during libtool generation.
  6998. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
  6999. func_dirname "$output" "/" ""
  7000. output_objdir=$func_dirname_result$objdir
  7001. func_to_tool_file "$output_objdir/"
  7002. tool_output_objdir=$func_to_tool_file_result
  7003. # Create the object directory.
  7004. func_mkdir_p "$output_objdir"
  7005. # Determine the type of output
  7006. case $output in
  7007. "")
  7008. func_fatal_help "you must specify an output file"
  7009. ;;
  7010. *.$libext) linkmode=oldlib ;;
  7011. *.lo | *.$objext) linkmode=obj ;;
  7012. *.la) linkmode=lib ;;
  7013. *) linkmode=prog ;; # Anything else should be a program.
  7014. esac
  7015. specialdeplibs=
  7016. libs=
  7017. # Find all interdependent deplibs by searching for libraries
  7018. # that are linked more than once (e.g. -la -lb -la)
  7019. for deplib in $deplibs; do
  7020. if $opt_preserve_dup_deps; then
  7021. case "$libs " in
  7022. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7023. esac
  7024. fi
  7025. func_append libs " $deplib"
  7026. done
  7027. if test lib = "$linkmode"; then
  7028. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  7029. # Compute libraries that are listed more than once in $predeps
  7030. # $postdeps and mark them as special (i.e., whose duplicates are
  7031. # not to be eliminated).
  7032. pre_post_deps=
  7033. if $opt_duplicate_compiler_generated_deps; then
  7034. for pre_post_dep in $predeps $postdeps; do
  7035. case "$pre_post_deps " in
  7036. *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
  7037. esac
  7038. func_append pre_post_deps " $pre_post_dep"
  7039. done
  7040. fi
  7041. pre_post_deps=
  7042. fi
  7043. deplibs=
  7044. newdependency_libs=
  7045. newlib_search_path=
  7046. need_relink=no # whether we're linking any uninstalled libtool libraries
  7047. notinst_deplibs= # not-installed libtool libraries
  7048. notinst_path= # paths that contain not-installed libtool libraries
  7049. case $linkmode in
  7050. lib)
  7051. passes="conv dlpreopen link"
  7052. for file in $dlfiles $dlprefiles; do
  7053. case $file in
  7054. *.la) ;;
  7055. *)
  7056. func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
  7057. ;;
  7058. esac
  7059. done
  7060. ;;
  7061. prog)
  7062. compile_deplibs=
  7063. finalize_deplibs=
  7064. alldeplibs=false
  7065. newdlfiles=
  7066. newdlprefiles=
  7067. passes="conv scan dlopen dlpreopen link"
  7068. ;;
  7069. *) passes="conv"
  7070. ;;
  7071. esac
  7072. for pass in $passes; do
  7073. # The preopen pass in lib mode reverses $deplibs; put it back here
  7074. # so that -L comes before libs that need it for instance...
  7075. if test lib,link = "$linkmode,$pass"; then
  7076. ## FIXME: Find the place where the list is rebuilt in the wrong
  7077. ## order, and fix it there properly
  7078. tmp_deplibs=
  7079. for deplib in $deplibs; do
  7080. tmp_deplibs="$deplib $tmp_deplibs"
  7081. done
  7082. deplibs=$tmp_deplibs
  7083. fi
  7084. if test lib,link = "$linkmode,$pass" ||
  7085. test prog,scan = "$linkmode,$pass"; then
  7086. libs=$deplibs
  7087. deplibs=
  7088. fi
  7089. if test prog = "$linkmode"; then
  7090. case $pass in
  7091. dlopen) libs=$dlfiles ;;
  7092. dlpreopen) libs=$dlprefiles ;;
  7093. link)
  7094. libs="$deplibs %DEPLIBS%"
  7095. test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
  7096. ;;
  7097. esac
  7098. fi
  7099. if test lib,dlpreopen = "$linkmode,$pass"; then
  7100. # Collect and forward deplibs of preopened libtool libs
  7101. for lib in $dlprefiles; do
  7102. # Ignore non-libtool-libs
  7103. dependency_libs=
  7104. func_resolve_sysroot "$lib"
  7105. case $lib in
  7106. *.la) func_source "$func_resolve_sysroot_result" ;;
  7107. esac
  7108. # Collect preopened libtool deplibs, except any this library
  7109. # has declared as weak libs
  7110. for deplib in $dependency_libs; do
  7111. func_basename "$deplib"
  7112. deplib_base=$func_basename_result
  7113. case " $weak_libs " in
  7114. *" $deplib_base "*) ;;
  7115. *) func_append deplibs " $deplib" ;;
  7116. esac
  7117. done
  7118. done
  7119. libs=$dlprefiles
  7120. fi
  7121. if test dlopen = "$pass"; then
  7122. # Collect dlpreopened libraries
  7123. save_deplibs=$deplibs
  7124. deplibs=
  7125. fi
  7126. for deplib in $libs; do
  7127. lib=
  7128. found=false
  7129. case $deplib in
  7130. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  7131. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  7132. if test prog,link = "$linkmode,$pass"; then
  7133. compile_deplibs="$deplib $compile_deplibs"
  7134. finalize_deplibs="$deplib $finalize_deplibs"
  7135. else
  7136. func_append compiler_flags " $deplib"
  7137. if test lib = "$linkmode"; then
  7138. case "$new_inherited_linker_flags " in
  7139. *" $deplib "*) ;;
  7140. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7141. esac
  7142. fi
  7143. fi
  7144. continue
  7145. ;;
  7146. -l*)
  7147. if test lib != "$linkmode" && test prog != "$linkmode"; then
  7148. func_warning "'-l' is ignored for archives/objects"
  7149. continue
  7150. fi
  7151. func_stripname '-l' '' "$deplib"
  7152. name=$func_stripname_result
  7153. if test lib = "$linkmode"; then
  7154. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  7155. else
  7156. searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  7157. fi
  7158. for searchdir in $searchdirs; do
  7159. for search_ext in .la $std_shrext .so .a; do
  7160. # Search the libtool library
  7161. lib=$searchdir/lib$name$search_ext
  7162. if test -f "$lib"; then
  7163. if test .la = "$search_ext"; then
  7164. found=:
  7165. else
  7166. found=false
  7167. fi
  7168. break 2
  7169. fi
  7170. done
  7171. done
  7172. if $found; then
  7173. # deplib is a libtool library
  7174. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  7175. # We need to do some special things here, and not later.
  7176. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  7177. case " $predeps $postdeps " in
  7178. *" $deplib "*)
  7179. if func_lalib_p "$lib"; then
  7180. library_names=
  7181. old_library=
  7182. func_source "$lib"
  7183. for l in $old_library $library_names; do
  7184. ll=$l
  7185. done
  7186. if test "X$ll" = "X$old_library"; then # only static version available
  7187. found=false
  7188. func_dirname "$lib" "" "."
  7189. ladir=$func_dirname_result
  7190. lib=$ladir/$old_library
  7191. if test prog,link = "$linkmode,$pass"; then
  7192. compile_deplibs="$deplib $compile_deplibs"
  7193. finalize_deplibs="$deplib $finalize_deplibs"
  7194. else
  7195. deplibs="$deplib $deplibs"
  7196. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7197. fi
  7198. continue
  7199. fi
  7200. fi
  7201. ;;
  7202. *) ;;
  7203. esac
  7204. fi
  7205. else
  7206. # deplib doesn't seem to be a libtool library
  7207. if test prog,link = "$linkmode,$pass"; then
  7208. compile_deplibs="$deplib $compile_deplibs"
  7209. finalize_deplibs="$deplib $finalize_deplibs"
  7210. else
  7211. deplibs="$deplib $deplibs"
  7212. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7213. fi
  7214. continue
  7215. fi
  7216. ;; # -l
  7217. *.ltframework)
  7218. if test prog,link = "$linkmode,$pass"; then
  7219. compile_deplibs="$deplib $compile_deplibs"
  7220. finalize_deplibs="$deplib $finalize_deplibs"
  7221. else
  7222. deplibs="$deplib $deplibs"
  7223. if test lib = "$linkmode"; then
  7224. case "$new_inherited_linker_flags " in
  7225. *" $deplib "*) ;;
  7226. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7227. esac
  7228. fi
  7229. fi
  7230. continue
  7231. ;;
  7232. -L*)
  7233. case $linkmode in
  7234. lib)
  7235. deplibs="$deplib $deplibs"
  7236. test conv = "$pass" && continue
  7237. newdependency_libs="$deplib $newdependency_libs"
  7238. func_stripname '-L' '' "$deplib"
  7239. func_resolve_sysroot "$func_stripname_result"
  7240. func_append newlib_search_path " $func_resolve_sysroot_result"
  7241. ;;
  7242. prog)
  7243. if test conv = "$pass"; then
  7244. deplibs="$deplib $deplibs"
  7245. continue
  7246. fi
  7247. if test scan = "$pass"; then
  7248. deplibs="$deplib $deplibs"
  7249. else
  7250. compile_deplibs="$deplib $compile_deplibs"
  7251. finalize_deplibs="$deplib $finalize_deplibs"
  7252. fi
  7253. func_stripname '-L' '' "$deplib"
  7254. func_resolve_sysroot "$func_stripname_result"
  7255. func_append newlib_search_path " $func_resolve_sysroot_result"
  7256. ;;
  7257. *)
  7258. func_warning "'-L' is ignored for archives/objects"
  7259. ;;
  7260. esac # linkmode
  7261. continue
  7262. ;; # -L
  7263. -R*)
  7264. if test link = "$pass"; then
  7265. func_stripname '-R' '' "$deplib"
  7266. func_resolve_sysroot "$func_stripname_result"
  7267. dir=$func_resolve_sysroot_result
  7268. # Make sure the xrpath contains only unique directories.
  7269. case "$xrpath " in
  7270. *" $dir "*) ;;
  7271. *) func_append xrpath " $dir" ;;
  7272. esac
  7273. fi
  7274. deplibs="$deplib $deplibs"
  7275. continue
  7276. ;;
  7277. *.la)
  7278. func_resolve_sysroot "$deplib"
  7279. lib=$func_resolve_sysroot_result
  7280. ;;
  7281. *.$libext)
  7282. if test conv = "$pass"; then
  7283. deplibs="$deplib $deplibs"
  7284. continue
  7285. fi
  7286. case $linkmode in
  7287. lib)
  7288. # Linking convenience modules into shared libraries is allowed,
  7289. # but linking other static libraries is non-portable.
  7290. case " $dlpreconveniencelibs " in
  7291. *" $deplib "*) ;;
  7292. *)
  7293. valid_a_lib=false
  7294. case $deplibs_check_method in
  7295. match_pattern*)
  7296. set dummy $deplibs_check_method; shift
  7297. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  7298. if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  7299. | $EGREP "$match_pattern_regex" > /dev/null; then
  7300. valid_a_lib=:
  7301. fi
  7302. ;;
  7303. pass_all)
  7304. valid_a_lib=:
  7305. ;;
  7306. esac
  7307. if $valid_a_lib; then
  7308. echo
  7309. $ECHO "*** Warning: Linking the shared library $output against the"
  7310. $ECHO "*** static library $deplib is not portable!"
  7311. deplibs="$deplib $deplibs"
  7312. else
  7313. echo
  7314. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  7315. echo "*** I have the capability to make that library automatically link in when"
  7316. echo "*** you link to this library. But I can only do this if you have a"
  7317. echo "*** shared version of the library, which you do not appear to have"
  7318. echo "*** because the file extensions .$libext of this argument makes me believe"
  7319. echo "*** that it is just a static archive that I should not use here."
  7320. fi
  7321. ;;
  7322. esac
  7323. continue
  7324. ;;
  7325. prog)
  7326. if test link != "$pass"; then
  7327. deplibs="$deplib $deplibs"
  7328. else
  7329. compile_deplibs="$deplib $compile_deplibs"
  7330. finalize_deplibs="$deplib $finalize_deplibs"
  7331. fi
  7332. continue
  7333. ;;
  7334. esac # linkmode
  7335. ;; # *.$libext
  7336. *.lo | *.$objext)
  7337. if test conv = "$pass"; then
  7338. deplibs="$deplib $deplibs"
  7339. elif test prog = "$linkmode"; then
  7340. if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
  7341. # If there is no dlopen support or we're linking statically,
  7342. # we need to preload.
  7343. func_append newdlprefiles " $deplib"
  7344. compile_deplibs="$deplib $compile_deplibs"
  7345. finalize_deplibs="$deplib $finalize_deplibs"
  7346. else
  7347. func_append newdlfiles " $deplib"
  7348. fi
  7349. fi
  7350. continue
  7351. ;;
  7352. %DEPLIBS%)
  7353. alldeplibs=:
  7354. continue
  7355. ;;
  7356. esac # case $deplib
  7357. $found || test -f "$lib" \
  7358. || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
  7359. # Check to see that this really is a libtool archive.
  7360. func_lalib_unsafe_p "$lib" \
  7361. || func_fatal_error "'$lib' is not a valid libtool archive"
  7362. func_dirname "$lib" "" "."
  7363. ladir=$func_dirname_result
  7364. dlname=
  7365. dlopen=
  7366. dlpreopen=
  7367. libdir=
  7368. library_names=
  7369. old_library=
  7370. inherited_linker_flags=
  7371. # If the library was installed with an old release of libtool,
  7372. # it will not redefine variables installed, or shouldnotlink
  7373. installed=yes
  7374. shouldnotlink=no
  7375. avoidtemprpath=
  7376. # Read the .la file
  7377. func_source "$lib"
  7378. # Convert "-framework foo" to "foo.ltframework"
  7379. if test -n "$inherited_linker_flags"; then
  7380. tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  7381. for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  7382. case " $new_inherited_linker_flags " in
  7383. *" $tmp_inherited_linker_flag "*) ;;
  7384. *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
  7385. esac
  7386. done
  7387. fi
  7388. dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7389. if test lib,link = "$linkmode,$pass" ||
  7390. test prog,scan = "$linkmode,$pass" ||
  7391. { test prog != "$linkmode" && test lib != "$linkmode"; }; then
  7392. test -n "$dlopen" && func_append dlfiles " $dlopen"
  7393. test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
  7394. fi
  7395. if test conv = "$pass"; then
  7396. # Only check for convenience libraries
  7397. deplibs="$lib $deplibs"
  7398. if test -z "$libdir"; then
  7399. if test -z "$old_library"; then
  7400. func_fatal_error "cannot find name of link library for '$lib'"
  7401. fi
  7402. # It is a libtool convenience library, so add in its objects.
  7403. func_append convenience " $ladir/$objdir/$old_library"
  7404. func_append old_convenience " $ladir/$objdir/$old_library"
  7405. tmp_libs=
  7406. for deplib in $dependency_libs; do
  7407. deplibs="$deplib $deplibs"
  7408. if $opt_preserve_dup_deps; then
  7409. case "$tmp_libs " in
  7410. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7411. esac
  7412. fi
  7413. func_append tmp_libs " $deplib"
  7414. done
  7415. elif test prog != "$linkmode" && test lib != "$linkmode"; then
  7416. func_fatal_error "'$lib' is not a convenience library"
  7417. fi
  7418. continue
  7419. fi # $pass = conv
  7420. # Get the name of the library we link against.
  7421. linklib=
  7422. if test -n "$old_library" &&
  7423. { test yes = "$prefer_static_libs" ||
  7424. test built,no = "$prefer_static_libs,$installed"; }; then
  7425. linklib=$old_library
  7426. else
  7427. for l in $old_library $library_names; do
  7428. linklib=$l
  7429. done
  7430. fi
  7431. if test -z "$linklib"; then
  7432. func_fatal_error "cannot find name of link library for '$lib'"
  7433. fi
  7434. # This library was specified with -dlopen.
  7435. if test dlopen = "$pass"; then
  7436. test -z "$libdir" \
  7437. && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
  7438. if test -z "$dlname" ||
  7439. test yes != "$dlopen_support" ||
  7440. test no = "$build_libtool_libs"
  7441. then
  7442. # If there is no dlname, no dlopen support or we're linking
  7443. # statically, we need to preload. We also need to preload any
  7444. # dependent libraries so libltdl's deplib preloader doesn't
  7445. # bomb out in the load deplibs phase.
  7446. func_append dlprefiles " $lib $dependency_libs"
  7447. else
  7448. func_append newdlfiles " $lib"
  7449. fi
  7450. continue
  7451. fi # $pass = dlopen
  7452. # We need an absolute path.
  7453. case $ladir in
  7454. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
  7455. *)
  7456. abs_ladir=`cd "$ladir" && pwd`
  7457. if test -z "$abs_ladir"; then
  7458. func_warning "cannot determine absolute directory name of '$ladir'"
  7459. func_warning "passing it literally to the linker, although it might fail"
  7460. abs_ladir=$ladir
  7461. fi
  7462. ;;
  7463. esac
  7464. func_basename "$lib"
  7465. laname=$func_basename_result
  7466. # Find the relevant object directory and library name.
  7467. if test yes = "$installed"; then
  7468. if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7469. func_warning "library '$lib' was moved."
  7470. dir=$ladir
  7471. absdir=$abs_ladir
  7472. libdir=$abs_ladir
  7473. else
  7474. dir=$lt_sysroot$libdir
  7475. absdir=$lt_sysroot$libdir
  7476. fi
  7477. test yes = "$hardcode_automatic" && avoidtemprpath=yes
  7478. else
  7479. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7480. dir=$ladir
  7481. absdir=$abs_ladir
  7482. # Remove this search path later
  7483. func_append notinst_path " $abs_ladir"
  7484. else
  7485. dir=$ladir/$objdir
  7486. absdir=$abs_ladir/$objdir
  7487. # Remove this search path later
  7488. func_append notinst_path " $abs_ladir"
  7489. fi
  7490. fi # $installed = yes
  7491. func_stripname 'lib' '.la' "$laname"
  7492. name=$func_stripname_result
  7493. # This library was specified with -dlpreopen.
  7494. if test dlpreopen = "$pass"; then
  7495. if test -z "$libdir" && test prog = "$linkmode"; then
  7496. func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
  7497. fi
  7498. case $host in
  7499. # special handling for platforms with PE-DLLs.
  7500. *cygwin* | *mingw* | *cegcc* )
  7501. # Linker will automatically link against shared library if both
  7502. # static and shared are present. Therefore, ensure we extract
  7503. # symbols from the import library if a shared library is present
  7504. # (otherwise, the dlopen module name will be incorrect). We do
  7505. # this by putting the import library name into $newdlprefiles.
  7506. # We recover the dlopen module name by 'saving' the la file
  7507. # name in a special purpose variable, and (later) extracting the
  7508. # dlname from the la file.
  7509. if test -n "$dlname"; then
  7510. func_tr_sh "$dir/$linklib"
  7511. eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  7512. func_append newdlprefiles " $dir/$linklib"
  7513. else
  7514. func_append newdlprefiles " $dir/$old_library"
  7515. # Keep a list of preopened convenience libraries to check
  7516. # that they are being used correctly in the link pass.
  7517. test -z "$libdir" && \
  7518. func_append dlpreconveniencelibs " $dir/$old_library"
  7519. fi
  7520. ;;
  7521. * )
  7522. # Prefer using a static library (so that no silly _DYNAMIC symbols
  7523. # are required to link).
  7524. if test -n "$old_library"; then
  7525. func_append newdlprefiles " $dir/$old_library"
  7526. # Keep a list of preopened convenience libraries to check
  7527. # that they are being used correctly in the link pass.
  7528. test -z "$libdir" && \
  7529. func_append dlpreconveniencelibs " $dir/$old_library"
  7530. # Otherwise, use the dlname, so that lt_dlopen finds it.
  7531. elif test -n "$dlname"; then
  7532. func_append newdlprefiles " $dir/$dlname"
  7533. else
  7534. func_append newdlprefiles " $dir/$linklib"
  7535. fi
  7536. ;;
  7537. esac
  7538. fi # $pass = dlpreopen
  7539. if test -z "$libdir"; then
  7540. # Link the convenience library
  7541. if test lib = "$linkmode"; then
  7542. deplibs="$dir/$old_library $deplibs"
  7543. elif test prog,link = "$linkmode,$pass"; then
  7544. compile_deplibs="$dir/$old_library $compile_deplibs"
  7545. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  7546. else
  7547. deplibs="$lib $deplibs" # used for prog,scan pass
  7548. fi
  7549. continue
  7550. fi
  7551. if test prog = "$linkmode" && test link != "$pass"; then
  7552. func_append newlib_search_path " $ladir"
  7553. deplibs="$lib $deplibs"
  7554. linkalldeplibs=false
  7555. if test no != "$link_all_deplibs" || test -z "$library_names" ||
  7556. test no = "$build_libtool_libs"; then
  7557. linkalldeplibs=:
  7558. fi
  7559. tmp_libs=
  7560. for deplib in $dependency_libs; do
  7561. case $deplib in
  7562. -L*) func_stripname '-L' '' "$deplib"
  7563. func_resolve_sysroot "$func_stripname_result"
  7564. func_append newlib_search_path " $func_resolve_sysroot_result"
  7565. ;;
  7566. esac
  7567. # Need to link against all dependency_libs?
  7568. if $linkalldeplibs; then
  7569. deplibs="$deplib $deplibs"
  7570. else
  7571. # Need to hardcode shared library paths
  7572. # or/and link against static libraries
  7573. newdependency_libs="$deplib $newdependency_libs"
  7574. fi
  7575. if $opt_preserve_dup_deps; then
  7576. case "$tmp_libs " in
  7577. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7578. esac
  7579. fi
  7580. func_append tmp_libs " $deplib"
  7581. done # for deplib
  7582. continue
  7583. fi # $linkmode = prog...
  7584. if test prog,link = "$linkmode,$pass"; then
  7585. if test -n "$library_names" &&
  7586. { { test no = "$prefer_static_libs" ||
  7587. test built,yes = "$prefer_static_libs,$installed"; } ||
  7588. test -z "$old_library"; }; then
  7589. # We need to hardcode the library path
  7590. if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
  7591. # Make sure the rpath contains only unique directories.
  7592. case $temp_rpath: in
  7593. *"$absdir:"*) ;;
  7594. *) func_append temp_rpath "$absdir:" ;;
  7595. esac
  7596. fi
  7597. # Hardcode the library path.
  7598. # Skip directories that are in the system default run-time
  7599. # search path.
  7600. case " $sys_lib_dlsearch_path " in
  7601. *" $absdir "*) ;;
  7602. *)
  7603. case "$compile_rpath " in
  7604. *" $absdir "*) ;;
  7605. *) func_append compile_rpath " $absdir" ;;
  7606. esac
  7607. ;;
  7608. esac
  7609. case " $sys_lib_dlsearch_path " in
  7610. *" $libdir "*) ;;
  7611. *)
  7612. case "$finalize_rpath " in
  7613. *" $libdir "*) ;;
  7614. *) func_append finalize_rpath " $libdir" ;;
  7615. esac
  7616. ;;
  7617. esac
  7618. fi # $linkmode,$pass = prog,link...
  7619. if $alldeplibs &&
  7620. { test pass_all = "$deplibs_check_method" ||
  7621. { test yes = "$build_libtool_libs" &&
  7622. test -n "$library_names"; }; }; then
  7623. # We only need to search for static libraries
  7624. continue
  7625. fi
  7626. fi
  7627. link_static=no # Whether the deplib will be linked statically
  7628. use_static_libs=$prefer_static_libs
  7629. if test built = "$use_static_libs" && test yes = "$installed"; then
  7630. use_static_libs=no
  7631. fi
  7632. if test -n "$library_names" &&
  7633. { test no = "$use_static_libs" || test -z "$old_library"; }; then
  7634. case $host in
  7635. *cygwin* | *mingw* | *cegcc* | *os2*)
  7636. # No point in relinking DLLs because paths are not encoded
  7637. func_append notinst_deplibs " $lib"
  7638. need_relink=no
  7639. ;;
  7640. *)
  7641. if test no = "$installed"; then
  7642. func_append notinst_deplibs " $lib"
  7643. need_relink=yes
  7644. fi
  7645. ;;
  7646. esac
  7647. # This is a shared library
  7648. # Warn about portability, can't link against -module's on some
  7649. # systems (darwin). Don't bleat about dlopened modules though!
  7650. dlopenmodule=
  7651. for dlpremoduletest in $dlprefiles; do
  7652. if test "X$dlpremoduletest" = "X$lib"; then
  7653. dlopenmodule=$dlpremoduletest
  7654. break
  7655. fi
  7656. done
  7657. if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
  7658. echo
  7659. if test prog = "$linkmode"; then
  7660. $ECHO "*** Warning: Linking the executable $output against the loadable module"
  7661. else
  7662. $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  7663. fi
  7664. $ECHO "*** $linklib is not portable!"
  7665. fi
  7666. if test lib = "$linkmode" &&
  7667. test yes = "$hardcode_into_libs"; then
  7668. # Hardcode the library path.
  7669. # Skip directories that are in the system default run-time
  7670. # search path.
  7671. case " $sys_lib_dlsearch_path " in
  7672. *" $absdir "*) ;;
  7673. *)
  7674. case "$compile_rpath " in
  7675. *" $absdir "*) ;;
  7676. *) func_append compile_rpath " $absdir" ;;
  7677. esac
  7678. ;;
  7679. esac
  7680. case " $sys_lib_dlsearch_path " in
  7681. *" $libdir "*) ;;
  7682. *)
  7683. case "$finalize_rpath " in
  7684. *" $libdir "*) ;;
  7685. *) func_append finalize_rpath " $libdir" ;;
  7686. esac
  7687. ;;
  7688. esac
  7689. fi
  7690. if test -n "$old_archive_from_expsyms_cmds"; then
  7691. # figure out the soname
  7692. set dummy $library_names
  7693. shift
  7694. realname=$1
  7695. shift
  7696. libname=`eval "\\$ECHO \"$libname_spec\""`
  7697. # use dlname if we got it. it's perfectly good, no?
  7698. if test -n "$dlname"; then
  7699. soname=$dlname
  7700. elif test -n "$soname_spec"; then
  7701. # bleh windows
  7702. case $host in
  7703. *cygwin* | mingw* | *cegcc* | *os2*)
  7704. func_arith $current - $age
  7705. major=$func_arith_result
  7706. versuffix=-$major
  7707. ;;
  7708. esac
  7709. eval soname=\"$soname_spec\"
  7710. else
  7711. soname=$realname
  7712. fi
  7713. # Make a new name for the extract_expsyms_cmds to use
  7714. soroot=$soname
  7715. func_basename "$soroot"
  7716. soname=$func_basename_result
  7717. func_stripname 'lib' '.dll' "$soname"
  7718. newlib=libimp-$func_stripname_result.a
  7719. # If the library has no export list, then create one now
  7720. if test -f "$output_objdir/$soname-def"; then :
  7721. else
  7722. func_verbose "extracting exported symbol list from '$soname'"
  7723. func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  7724. fi
  7725. # Create $newlib
  7726. if test -f "$output_objdir/$newlib"; then :; else
  7727. func_verbose "generating import library for '$soname'"
  7728. func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  7729. fi
  7730. # make sure the library variables are pointing to the new library
  7731. dir=$output_objdir
  7732. linklib=$newlib
  7733. fi # test -n "$old_archive_from_expsyms_cmds"
  7734. if test prog = "$linkmode" || test relink != "$opt_mode"; then
  7735. add_shlibpath=
  7736. add_dir=
  7737. add=
  7738. lib_linked=yes
  7739. case $hardcode_action in
  7740. immediate | unsupported)
  7741. if test no = "$hardcode_direct"; then
  7742. add=$dir/$linklib
  7743. case $host in
  7744. *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
  7745. *-*-sysv4*uw2*) add_dir=-L$dir ;;
  7746. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  7747. *-*-unixware7*) add_dir=-L$dir ;;
  7748. *-*-darwin* )
  7749. # if the lib is a (non-dlopened) module then we cannot
  7750. # link against it, someone is ignoring the earlier warnings
  7751. if /usr/bin/file -L $add 2> /dev/null |
  7752. $GREP ": [^:]* bundle" >/dev/null; then
  7753. if test "X$dlopenmodule" != "X$lib"; then
  7754. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  7755. if test -z "$old_library"; then
  7756. echo
  7757. echo "*** And there doesn't seem to be a static archive available"
  7758. echo "*** The link will probably fail, sorry"
  7759. else
  7760. add=$dir/$old_library
  7761. fi
  7762. elif test -n "$old_library"; then
  7763. add=$dir/$old_library
  7764. fi
  7765. fi
  7766. esac
  7767. elif test no = "$hardcode_minus_L"; then
  7768. case $host in
  7769. *-*-sunos*) add_shlibpath=$dir ;;
  7770. esac
  7771. add_dir=-L$dir
  7772. add=-l$name
  7773. elif test no = "$hardcode_shlibpath_var"; then
  7774. add_shlibpath=$dir
  7775. add=-l$name
  7776. else
  7777. lib_linked=no
  7778. fi
  7779. ;;
  7780. relink)
  7781. if test yes = "$hardcode_direct" &&
  7782. test no = "$hardcode_direct_absolute"; then
  7783. add=$dir/$linklib
  7784. elif test yes = "$hardcode_minus_L"; then
  7785. add_dir=-L$absdir
  7786. # Try looking first in the location we're being installed to.
  7787. if test -n "$inst_prefix_dir"; then
  7788. case $libdir in
  7789. [\\/]*)
  7790. func_append add_dir " -L$inst_prefix_dir$libdir"
  7791. ;;
  7792. esac
  7793. fi
  7794. add=-l$name
  7795. elif test yes = "$hardcode_shlibpath_var"; then
  7796. add_shlibpath=$dir
  7797. add=-l$name
  7798. else
  7799. lib_linked=no
  7800. fi
  7801. ;;
  7802. *) lib_linked=no ;;
  7803. esac
  7804. if test yes != "$lib_linked"; then
  7805. func_fatal_configuration "unsupported hardcode properties"
  7806. fi
  7807. if test -n "$add_shlibpath"; then
  7808. case :$compile_shlibpath: in
  7809. *":$add_shlibpath:"*) ;;
  7810. *) func_append compile_shlibpath "$add_shlibpath:" ;;
  7811. esac
  7812. fi
  7813. if test prog = "$linkmode"; then
  7814. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  7815. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  7816. else
  7817. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7818. test -n "$add" && deplibs="$add $deplibs"
  7819. if test yes != "$hardcode_direct" &&
  7820. test yes != "$hardcode_minus_L" &&
  7821. test yes = "$hardcode_shlibpath_var"; then
  7822. case :$finalize_shlibpath: in
  7823. *":$libdir:"*) ;;
  7824. *) func_append finalize_shlibpath "$libdir:" ;;
  7825. esac
  7826. fi
  7827. fi
  7828. fi
  7829. if test prog = "$linkmode" || test relink = "$opt_mode"; then
  7830. add_shlibpath=
  7831. add_dir=
  7832. add=
  7833. # Finalize command for both is simple: just hardcode it.
  7834. if test yes = "$hardcode_direct" &&
  7835. test no = "$hardcode_direct_absolute"; then
  7836. add=$libdir/$linklib
  7837. elif test yes = "$hardcode_minus_L"; then
  7838. add_dir=-L$libdir
  7839. add=-l$name
  7840. elif test yes = "$hardcode_shlibpath_var"; then
  7841. case :$finalize_shlibpath: in
  7842. *":$libdir:"*) ;;
  7843. *) func_append finalize_shlibpath "$libdir:" ;;
  7844. esac
  7845. add=-l$name
  7846. elif test yes = "$hardcode_automatic"; then
  7847. if test -n "$inst_prefix_dir" &&
  7848. test -f "$inst_prefix_dir$libdir/$linklib"; then
  7849. add=$inst_prefix_dir$libdir/$linklib
  7850. else
  7851. add=$libdir/$linklib
  7852. fi
  7853. else
  7854. # We cannot seem to hardcode it, guess we'll fake it.
  7855. add_dir=-L$libdir
  7856. # Try looking first in the location we're being installed to.
  7857. if test -n "$inst_prefix_dir"; then
  7858. case $libdir in
  7859. [\\/]*)
  7860. func_append add_dir " -L$inst_prefix_dir$libdir"
  7861. ;;
  7862. esac
  7863. fi
  7864. add=-l$name
  7865. fi
  7866. if test prog = "$linkmode"; then
  7867. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  7868. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  7869. else
  7870. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7871. test -n "$add" && deplibs="$add $deplibs"
  7872. fi
  7873. fi
  7874. elif test prog = "$linkmode"; then
  7875. # Here we assume that one of hardcode_direct or hardcode_minus_L
  7876. # is not unsupported. This is valid on all known static and
  7877. # shared platforms.
  7878. if test unsupported != "$hardcode_direct"; then
  7879. test -n "$old_library" && linklib=$old_library
  7880. compile_deplibs="$dir/$linklib $compile_deplibs"
  7881. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  7882. else
  7883. compile_deplibs="-l$name -L$dir $compile_deplibs"
  7884. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  7885. fi
  7886. elif test yes = "$build_libtool_libs"; then
  7887. # Not a shared library
  7888. if test pass_all != "$deplibs_check_method"; then
  7889. # We're trying link a shared library against a static one
  7890. # but the system doesn't support it.
  7891. # Just print a warning and add the library to dependency_libs so
  7892. # that the program can be linked against the static library.
  7893. echo
  7894. $ECHO "*** Warning: This system cannot link to static lib archive $lib."
  7895. echo "*** I have the capability to make that library automatically link in when"
  7896. echo "*** you link to this library. But I can only do this if you have a"
  7897. echo "*** shared version of the library, which you do not appear to have."
  7898. if test yes = "$module"; then
  7899. echo "*** But as you try to build a module library, libtool will still create "
  7900. echo "*** a static module, that should work as long as the dlopening application"
  7901. echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  7902. if test -z "$global_symbol_pipe"; then
  7903. echo
  7904. echo "*** However, this would only work if libtool was able to extract symbol"
  7905. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  7906. echo "*** not find such a program. So, this module is probably useless."
  7907. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  7908. fi
  7909. if test no = "$build_old_libs"; then
  7910. build_libtool_libs=module
  7911. build_old_libs=yes
  7912. else
  7913. build_libtool_libs=no
  7914. fi
  7915. fi
  7916. else
  7917. deplibs="$dir/$old_library $deplibs"
  7918. link_static=yes
  7919. fi
  7920. fi # link shared/static library?
  7921. if test lib = "$linkmode"; then
  7922. if test -n "$dependency_libs" &&
  7923. { test yes != "$hardcode_into_libs" ||
  7924. test yes = "$build_old_libs" ||
  7925. test yes = "$link_static"; }; then
  7926. # Extract -R from dependency_libs
  7927. temp_deplibs=
  7928. for libdir in $dependency_libs; do
  7929. case $libdir in
  7930. -R*) func_stripname '-R' '' "$libdir"
  7931. temp_xrpath=$func_stripname_result
  7932. case " $xrpath " in
  7933. *" $temp_xrpath "*) ;;
  7934. *) func_append xrpath " $temp_xrpath";;
  7935. esac;;
  7936. *) func_append temp_deplibs " $libdir";;
  7937. esac
  7938. done
  7939. dependency_libs=$temp_deplibs
  7940. fi
  7941. func_append newlib_search_path " $absdir"
  7942. # Link against this library
  7943. test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  7944. # ... and its dependency_libs
  7945. tmp_libs=
  7946. for deplib in $dependency_libs; do
  7947. newdependency_libs="$deplib $newdependency_libs"
  7948. case $deplib in
  7949. -L*) func_stripname '-L' '' "$deplib"
  7950. func_resolve_sysroot "$func_stripname_result";;
  7951. *) func_resolve_sysroot "$deplib" ;;
  7952. esac
  7953. if $opt_preserve_dup_deps; then
  7954. case "$tmp_libs " in
  7955. *" $func_resolve_sysroot_result "*)
  7956. func_append specialdeplibs " $func_resolve_sysroot_result" ;;
  7957. esac
  7958. fi
  7959. func_append tmp_libs " $func_resolve_sysroot_result"
  7960. done
  7961. if test no != "$link_all_deplibs"; then
  7962. # Add the search paths of all dependency libraries
  7963. for deplib in $dependency_libs; do
  7964. path=
  7965. case $deplib in
  7966. -L*) path=$deplib ;;
  7967. *.la)
  7968. func_resolve_sysroot "$deplib"
  7969. deplib=$func_resolve_sysroot_result
  7970. func_dirname "$deplib" "" "."
  7971. dir=$func_dirname_result
  7972. # We need an absolute path.
  7973. case $dir in
  7974. [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
  7975. *)
  7976. absdir=`cd "$dir" && pwd`
  7977. if test -z "$absdir"; then
  7978. func_warning "cannot determine absolute directory name of '$dir'"
  7979. absdir=$dir
  7980. fi
  7981. ;;
  7982. esac
  7983. if $GREP "^installed=no" $deplib > /dev/null; then
  7984. case $host in
  7985. *-*-darwin*)
  7986. depdepl=
  7987. eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  7988. if test -n "$deplibrary_names"; then
  7989. for tmp in $deplibrary_names; do
  7990. depdepl=$tmp
  7991. done
  7992. if test -f "$absdir/$objdir/$depdepl"; then
  7993. depdepl=$absdir/$objdir/$depdepl
  7994. darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  7995. if test -z "$darwin_install_name"; then
  7996. darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  7997. fi
  7998. func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
  7999. func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
  8000. path=
  8001. fi
  8002. fi
  8003. ;;
  8004. *)
  8005. path=-L$absdir/$objdir
  8006. ;;
  8007. esac
  8008. else
  8009. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  8010. test -z "$libdir" && \
  8011. func_fatal_error "'$deplib' is not a valid libtool archive"
  8012. test "$absdir" != "$libdir" && \
  8013. func_warning "'$deplib' seems to be moved"
  8014. path=-L$absdir
  8015. fi
  8016. ;;
  8017. esac
  8018. case " $deplibs " in
  8019. *" $path "*) ;;
  8020. *) deplibs="$path $deplibs" ;;
  8021. esac
  8022. done
  8023. fi # link_all_deplibs != no
  8024. fi # linkmode = lib
  8025. done # for deplib in $libs
  8026. if test link = "$pass"; then
  8027. if test prog = "$linkmode"; then
  8028. compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  8029. finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  8030. else
  8031. compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8032. fi
  8033. fi
  8034. dependency_libs=$newdependency_libs
  8035. if test dlpreopen = "$pass"; then
  8036. # Link the dlpreopened libraries before other libraries
  8037. for deplib in $save_deplibs; do
  8038. deplibs="$deplib $deplibs"
  8039. done
  8040. fi
  8041. if test dlopen != "$pass"; then
  8042. test conv = "$pass" || {
  8043. # Make sure lib_search_path contains only unique directories.
  8044. lib_search_path=
  8045. for dir in $newlib_search_path; do
  8046. case "$lib_search_path " in
  8047. *" $dir "*) ;;
  8048. *) func_append lib_search_path " $dir" ;;
  8049. esac
  8050. done
  8051. newlib_search_path=
  8052. }
  8053. if test prog,link = "$linkmode,$pass"; then
  8054. vars="compile_deplibs finalize_deplibs"
  8055. else
  8056. vars=deplibs
  8057. fi
  8058. for var in $vars dependency_libs; do
  8059. # Add libraries to $var in reverse order
  8060. eval tmp_libs=\"\$$var\"
  8061. new_libs=
  8062. for deplib in $tmp_libs; do
  8063. # FIXME: Pedantically, this is the right thing to do, so
  8064. # that some nasty dependency loop isn't accidentally
  8065. # broken:
  8066. #new_libs="$deplib $new_libs"
  8067. # Pragmatically, this seems to cause very few problems in
  8068. # practice:
  8069. case $deplib in
  8070. -L*) new_libs="$deplib $new_libs" ;;
  8071. -R*) ;;
  8072. *)
  8073. # And here is the reason: when a library appears more
  8074. # than once as an explicit dependence of a library, or
  8075. # is implicitly linked in more than once by the
  8076. # compiler, it is considered special, and multiple
  8077. # occurrences thereof are not removed. Compare this
  8078. # with having the same library being listed as a
  8079. # dependency of multiple other libraries: in this case,
  8080. # we know (pedantically, we assume) the library does not
  8081. # need to be listed more than once, so we keep only the
  8082. # last copy. This is not always right, but it is rare
  8083. # enough that we require users that really mean to play
  8084. # such unportable linking tricks to link the library
  8085. # using -Wl,-lname, so that libtool does not consider it
  8086. # for duplicate removal.
  8087. case " $specialdeplibs " in
  8088. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  8089. *)
  8090. case " $new_libs " in
  8091. *" $deplib "*) ;;
  8092. *) new_libs="$deplib $new_libs" ;;
  8093. esac
  8094. ;;
  8095. esac
  8096. ;;
  8097. esac
  8098. done
  8099. tmp_libs=
  8100. for deplib in $new_libs; do
  8101. case $deplib in
  8102. -L*)
  8103. case " $tmp_libs " in
  8104. *" $deplib "*) ;;
  8105. *) func_append tmp_libs " $deplib" ;;
  8106. esac
  8107. ;;
  8108. *) func_append tmp_libs " $deplib" ;;
  8109. esac
  8110. done
  8111. eval $var=\"$tmp_libs\"
  8112. done # for var
  8113. fi
  8114. # Add Sun CC postdeps if required:
  8115. test CXX = "$tagname" && {
  8116. case $host_os in
  8117. linux*)
  8118. case `$CC -V 2>&1 | sed 5q` in
  8119. *Sun\ C*) # Sun C++ 5.9
  8120. func_suncc_cstd_abi
  8121. if test no != "$suncc_use_cstd_abi"; then
  8122. func_append postdeps ' -library=Cstd -library=Crun'
  8123. fi
  8124. ;;
  8125. esac
  8126. ;;
  8127. solaris*)
  8128. func_cc_basename "$CC"
  8129. case $func_cc_basename_result in
  8130. CC* | sunCC*)
  8131. func_suncc_cstd_abi
  8132. if test no != "$suncc_use_cstd_abi"; then
  8133. func_append postdeps ' -library=Cstd -library=Crun'
  8134. fi
  8135. ;;
  8136. esac
  8137. ;;
  8138. esac
  8139. }
  8140. # Last step: remove runtime libs from dependency_libs
  8141. # (they stay in deplibs)
  8142. tmp_libs=
  8143. for i in $dependency_libs; do
  8144. case " $predeps $postdeps $compiler_lib_search_path " in
  8145. *" $i "*)
  8146. i=
  8147. ;;
  8148. esac
  8149. if test -n "$i"; then
  8150. func_append tmp_libs " $i"
  8151. fi
  8152. done
  8153. dependency_libs=$tmp_libs
  8154. done # for pass
  8155. if test prog = "$linkmode"; then
  8156. dlfiles=$newdlfiles
  8157. fi
  8158. if test prog = "$linkmode" || test lib = "$linkmode"; then
  8159. dlprefiles=$newdlprefiles
  8160. fi
  8161. case $linkmode in
  8162. oldlib)
  8163. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  8164. func_warning "'-dlopen' is ignored for archives"
  8165. fi
  8166. case " $deplibs" in
  8167. *\ -l* | *\ -L*)
  8168. func_warning "'-l' and '-L' are ignored for archives" ;;
  8169. esac
  8170. test -n "$rpath" && \
  8171. func_warning "'-rpath' is ignored for archives"
  8172. test -n "$xrpath" && \
  8173. func_warning "'-R' is ignored for archives"
  8174. test -n "$vinfo" && \
  8175. func_warning "'-version-info/-version-number' is ignored for archives"
  8176. test -n "$release" && \
  8177. func_warning "'-release' is ignored for archives"
  8178. test -n "$export_symbols$export_symbols_regex" && \
  8179. func_warning "'-export-symbols' is ignored for archives"
  8180. # Now set the variables for building old libraries.
  8181. build_libtool_libs=no
  8182. oldlibs=$output
  8183. func_append objs "$old_deplibs"
  8184. ;;
  8185. lib)
  8186. # Make sure we only generate libraries of the form 'libNAME.la'.
  8187. case $outputname in
  8188. lib*)
  8189. func_stripname 'lib' '.la' "$outputname"
  8190. name=$func_stripname_result
  8191. eval shared_ext=\"$shrext_cmds\"
  8192. eval libname=\"$libname_spec\"
  8193. ;;
  8194. *)
  8195. test no = "$module" \
  8196. && func_fatal_help "libtool library '$output' must begin with 'lib'"
  8197. if test no != "$need_lib_prefix"; then
  8198. # Add the "lib" prefix for modules if required
  8199. func_stripname '' '.la' "$outputname"
  8200. name=$func_stripname_result
  8201. eval shared_ext=\"$shrext_cmds\"
  8202. eval libname=\"$libname_spec\"
  8203. else
  8204. func_stripname '' '.la' "$outputname"
  8205. libname=$func_stripname_result
  8206. fi
  8207. ;;
  8208. esac
  8209. if test -n "$objs"; then
  8210. if test pass_all != "$deplibs_check_method"; then
  8211. func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
  8212. else
  8213. echo
  8214. $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  8215. $ECHO "*** objects $objs is not portable!"
  8216. func_append libobjs " $objs"
  8217. fi
  8218. fi
  8219. test no = "$dlself" \
  8220. || func_warning "'-dlopen self' is ignored for libtool libraries"
  8221. set dummy $rpath
  8222. shift
  8223. test 1 -lt "$#" \
  8224. && func_warning "ignoring multiple '-rpath's for a libtool library"
  8225. install_libdir=$1
  8226. oldlibs=
  8227. if test -z "$rpath"; then
  8228. if test yes = "$build_libtool_libs"; then
  8229. # Building a libtool convenience library.
  8230. # Some compilers have problems with a '.al' extension so
  8231. # convenience libraries should have the same extension an
  8232. # archive normally would.
  8233. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  8234. build_libtool_libs=convenience
  8235. build_old_libs=yes
  8236. fi
  8237. test -n "$vinfo" && \
  8238. func_warning "'-version-info/-version-number' is ignored for convenience libraries"
  8239. test -n "$release" && \
  8240. func_warning "'-release' is ignored for convenience libraries"
  8241. else
  8242. # Parse the version information argument.
  8243. save_ifs=$IFS; IFS=:
  8244. set dummy $vinfo 0 0 0
  8245. shift
  8246. IFS=$save_ifs
  8247. test -n "$7" && \
  8248. func_fatal_help "too many parameters to '-version-info'"
  8249. # convert absolute version numbers to libtool ages
  8250. # this retains compatibility with .la files and attempts
  8251. # to make the code below a bit more comprehensible
  8252. case $vinfo_number in
  8253. yes)
  8254. number_major=$1
  8255. number_minor=$2
  8256. number_revision=$3
  8257. #
  8258. # There are really only two kinds -- those that
  8259. # use the current revision as the major version
  8260. # and those that subtract age and use age as
  8261. # a minor version. But, then there is irix
  8262. # that has an extra 1 added just for fun
  8263. #
  8264. case $version_type in
  8265. # correct linux to gnu/linux during the next big refactor
  8266. darwin|freebsd-elf|linux|osf|windows|none)
  8267. func_arith $number_major + $number_minor
  8268. current=$func_arith_result
  8269. age=$number_minor
  8270. revision=$number_revision
  8271. ;;
  8272. freebsd-aout|qnx|sunos)
  8273. current=$number_major
  8274. revision=$number_minor
  8275. age=0
  8276. ;;
  8277. irix|nonstopux)
  8278. func_arith $number_major + $number_minor
  8279. current=$func_arith_result
  8280. age=$number_minor
  8281. revision=$number_minor
  8282. lt_irix_increment=no
  8283. ;;
  8284. *)
  8285. func_fatal_configuration "$modename: unknown library version type '$version_type'"
  8286. ;;
  8287. esac
  8288. ;;
  8289. no)
  8290. current=$1
  8291. revision=$2
  8292. age=$3
  8293. ;;
  8294. esac
  8295. # Check that each of the things are valid numbers.
  8296. case $current in
  8297. 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]) ;;
  8298. *)
  8299. func_error "CURRENT '$current' must be a nonnegative integer"
  8300. func_fatal_error "'$vinfo' is not valid version information"
  8301. ;;
  8302. esac
  8303. case $revision in
  8304. 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]) ;;
  8305. *)
  8306. func_error "REVISION '$revision' must be a nonnegative integer"
  8307. func_fatal_error "'$vinfo' is not valid version information"
  8308. ;;
  8309. esac
  8310. case $age in
  8311. 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]) ;;
  8312. *)
  8313. func_error "AGE '$age' must be a nonnegative integer"
  8314. func_fatal_error "'$vinfo' is not valid version information"
  8315. ;;
  8316. esac
  8317. if test "$age" -gt "$current"; then
  8318. func_error "AGE '$age' is greater than the current interface number '$current'"
  8319. func_fatal_error "'$vinfo' is not valid version information"
  8320. fi
  8321. # Calculate the version variables.
  8322. major=
  8323. versuffix=
  8324. verstring=
  8325. case $version_type in
  8326. none) ;;
  8327. darwin)
  8328. # Like Linux, but with the current version available in
  8329. # verstring for coding it into the library header
  8330. func_arith $current - $age
  8331. major=.$func_arith_result
  8332. versuffix=$major.$age.$revision
  8333. # Darwin ld doesn't like 0 for these options...
  8334. func_arith $current + 1
  8335. minor_current=$func_arith_result
  8336. xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8337. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8338. # On Darwin other compilers
  8339. case $CC in
  8340. nagfor*)
  8341. verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8342. ;;
  8343. *)
  8344. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8345. ;;
  8346. esac
  8347. ;;
  8348. freebsd-aout)
  8349. major=.$current
  8350. versuffix=.$current.$revision
  8351. ;;
  8352. freebsd-elf)
  8353. func_arith $current - $age
  8354. major=.$func_arith_result
  8355. versuffix=$major.$age.$revision
  8356. ;;
  8357. irix | nonstopux)
  8358. if test no = "$lt_irix_increment"; then
  8359. func_arith $current - $age
  8360. else
  8361. func_arith $current - $age + 1
  8362. fi
  8363. major=$func_arith_result
  8364. case $version_type in
  8365. nonstopux) verstring_prefix=nonstopux ;;
  8366. *) verstring_prefix=sgi ;;
  8367. esac
  8368. verstring=$verstring_prefix$major.$revision
  8369. # Add in all the interfaces that we are compatible with.
  8370. loop=$revision
  8371. while test 0 -ne "$loop"; do
  8372. func_arith $revision - $loop
  8373. iface=$func_arith_result
  8374. func_arith $loop - 1
  8375. loop=$func_arith_result
  8376. verstring=$verstring_prefix$major.$iface:$verstring
  8377. done
  8378. # Before this point, $major must not contain '.'.
  8379. major=.$major
  8380. versuffix=$major.$revision
  8381. ;;
  8382. linux) # correct to gnu/linux during the next big refactor
  8383. func_arith $current - $age
  8384. major=.$func_arith_result
  8385. versuffix=$major.$age.$revision
  8386. ;;
  8387. osf)
  8388. func_arith $current - $age
  8389. major=.$func_arith_result
  8390. versuffix=.$current.$age.$revision
  8391. verstring=$current.$age.$revision
  8392. # Add in all the interfaces that we are compatible with.
  8393. loop=$age
  8394. while test 0 -ne "$loop"; do
  8395. func_arith $current - $loop
  8396. iface=$func_arith_result
  8397. func_arith $loop - 1
  8398. loop=$func_arith_result
  8399. verstring=$verstring:$iface.0
  8400. done
  8401. # Make executables depend on our current version.
  8402. func_append verstring ":$current.0"
  8403. ;;
  8404. qnx)
  8405. major=.$current
  8406. versuffix=.$current
  8407. ;;
  8408. sco)
  8409. major=.$current
  8410. versuffix=.$current
  8411. ;;
  8412. sunos)
  8413. major=.$current
  8414. versuffix=.$current.$revision
  8415. ;;
  8416. windows)
  8417. # Use '-' rather than '.', since we only want one
  8418. # extension on DOS 8.3 file systems.
  8419. func_arith $current - $age
  8420. major=$func_arith_result
  8421. versuffix=-$major
  8422. ;;
  8423. *)
  8424. func_fatal_configuration "unknown library version type '$version_type'"
  8425. ;;
  8426. esac
  8427. # Clear the version info if we defaulted, and they specified a release.
  8428. if test -z "$vinfo" && test -n "$release"; then
  8429. major=
  8430. case $version_type in
  8431. darwin)
  8432. # we can't check for "0.0" in archive_cmds due to quoting
  8433. # problems, so we reset it completely
  8434. verstring=
  8435. ;;
  8436. *)
  8437. verstring=0.0
  8438. ;;
  8439. esac
  8440. if test no = "$need_version"; then
  8441. versuffix=
  8442. else
  8443. versuffix=.0.0
  8444. fi
  8445. fi
  8446. # Remove version info from name if versioning should be avoided
  8447. if test yes,no = "$avoid_version,$need_version"; then
  8448. major=
  8449. versuffix=
  8450. verstring=
  8451. fi
  8452. # Check to see if the archive will have undefined symbols.
  8453. if test yes = "$allow_undefined"; then
  8454. if test unsupported = "$allow_undefined_flag"; then
  8455. if test yes = "$build_old_libs"; then
  8456. func_warning "undefined symbols not allowed in $host shared libraries; building static only"
  8457. build_libtool_libs=no
  8458. else
  8459. func_fatal_error "can't build $host shared library unless -no-undefined is specified"
  8460. fi
  8461. fi
  8462. else
  8463. # Don't allow undefined symbols.
  8464. allow_undefined_flag=$no_undefined_flag
  8465. fi
  8466. fi
  8467. func_generate_dlsyms "$libname" "$libname" :
  8468. func_append libobjs " $symfileobj"
  8469. test " " = "$libobjs" && libobjs=
  8470. if test relink != "$opt_mode"; then
  8471. # Remove our outputs, but don't remove object files since they
  8472. # may have been created when compiling PIC objects.
  8473. removelist=
  8474. tempremovelist=`$ECHO "$output_objdir/*"`
  8475. for p in $tempremovelist; do
  8476. case $p in
  8477. *.$objext | *.gcno)
  8478. ;;
  8479. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
  8480. if test -n "$precious_files_regex"; then
  8481. if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  8482. then
  8483. continue
  8484. fi
  8485. fi
  8486. func_append removelist " $p"
  8487. ;;
  8488. *) ;;
  8489. esac
  8490. done
  8491. test -n "$removelist" && \
  8492. func_show_eval "${RM}r \$removelist"
  8493. fi
  8494. # Now set the variables for building old libraries.
  8495. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
  8496. func_append oldlibs " $output_objdir/$libname.$libext"
  8497. # Transform .lo files to .o files.
  8498. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
  8499. fi
  8500. # Eliminate all temporary directories.
  8501. #for path in $notinst_path; do
  8502. # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  8503. # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  8504. # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  8505. #done
  8506. if test -n "$xrpath"; then
  8507. # If the user specified any rpath flags, then add them.
  8508. temp_xrpath=
  8509. for libdir in $xrpath; do
  8510. func_replace_sysroot "$libdir"
  8511. func_append temp_xrpath " -R$func_replace_sysroot_result"
  8512. case "$finalize_rpath " in
  8513. *" $libdir "*) ;;
  8514. *) func_append finalize_rpath " $libdir" ;;
  8515. esac
  8516. done
  8517. if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
  8518. dependency_libs="$temp_xrpath $dependency_libs"
  8519. fi
  8520. fi
  8521. # Make sure dlfiles contains only unique files that won't be dlpreopened
  8522. old_dlfiles=$dlfiles
  8523. dlfiles=
  8524. for lib in $old_dlfiles; do
  8525. case " $dlprefiles $dlfiles " in
  8526. *" $lib "*) ;;
  8527. *) func_append dlfiles " $lib" ;;
  8528. esac
  8529. done
  8530. # Make sure dlprefiles contains only unique files
  8531. old_dlprefiles=$dlprefiles
  8532. dlprefiles=
  8533. for lib in $old_dlprefiles; do
  8534. case "$dlprefiles " in
  8535. *" $lib "*) ;;
  8536. *) func_append dlprefiles " $lib" ;;
  8537. esac
  8538. done
  8539. if test yes = "$build_libtool_libs"; then
  8540. if test -n "$rpath"; then
  8541. case $host in
  8542. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  8543. # these systems don't actually have a c library (as such)!
  8544. ;;
  8545. *-*-rhapsody* | *-*-darwin1.[012])
  8546. # Rhapsody C library is in the System framework
  8547. func_append deplibs " System.ltframework"
  8548. ;;
  8549. *-*-netbsd*)
  8550. # Don't link with libc until the a.out ld.so is fixed.
  8551. ;;
  8552. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  8553. # Do not include libc due to us having libc/libc_r.
  8554. ;;
  8555. *-*-sco3.2v5* | *-*-sco5v6*)
  8556. # Causes problems with __ctype
  8557. ;;
  8558. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  8559. # Compiler inserts libc in the correct place for threads to work
  8560. ;;
  8561. *)
  8562. # Add libc to deplibs on all other systems if necessary.
  8563. if test yes = "$build_libtool_need_lc"; then
  8564. func_append deplibs " -lc"
  8565. fi
  8566. ;;
  8567. esac
  8568. fi
  8569. # Transform deplibs into only deplibs that can be linked in shared.
  8570. name_save=$name
  8571. libname_save=$libname
  8572. release_save=$release
  8573. versuffix_save=$versuffix
  8574. major_save=$major
  8575. # I'm not sure if I'm treating the release correctly. I think
  8576. # release should show up in the -l (ie -lgmp5) so we don't want to
  8577. # add it in twice. Is that correct?
  8578. release=
  8579. versuffix=
  8580. major=
  8581. newdeplibs=
  8582. droppeddeps=no
  8583. case $deplibs_check_method in
  8584. pass_all)
  8585. # Don't check for shared/static. Everything works.
  8586. # This might be a little naive. We might want to check
  8587. # whether the library exists or not. But this is on
  8588. # osf3 & osf4 and I'm not really sure... Just
  8589. # implementing what was already the behavior.
  8590. newdeplibs=$deplibs
  8591. ;;
  8592. test_compile)
  8593. # This code stresses the "libraries are programs" paradigm to its
  8594. # limits. Maybe even breaks it. We compile a program, linking it
  8595. # against the deplibs as a proxy for the library. Then we can check
  8596. # whether they linked in statically or dynamically with ldd.
  8597. $opt_dry_run || $RM conftest.c
  8598. cat > conftest.c <<EOF
  8599. int main() { return 0; }
  8600. EOF
  8601. $opt_dry_run || $RM conftest
  8602. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  8603. ldd_output=`ldd conftest`
  8604. for i in $deplibs; do
  8605. case $i in
  8606. -l*)
  8607. func_stripname -l '' "$i"
  8608. name=$func_stripname_result
  8609. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8610. case " $predeps $postdeps " in
  8611. *" $i "*)
  8612. func_append newdeplibs " $i"
  8613. i=
  8614. ;;
  8615. esac
  8616. fi
  8617. if test -n "$i"; then
  8618. libname=`eval "\\$ECHO \"$libname_spec\""`
  8619. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8620. set dummy $deplib_matches; shift
  8621. deplib_match=$1
  8622. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8623. func_append newdeplibs " $i"
  8624. else
  8625. droppeddeps=yes
  8626. echo
  8627. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8628. echo "*** I have the capability to make that library automatically link in when"
  8629. echo "*** you link to this library. But I can only do this if you have a"
  8630. echo "*** shared version of the library, which I believe you do not have"
  8631. echo "*** because a test_compile did reveal that the linker did not use it for"
  8632. echo "*** its dynamic dependency list that programs get resolved with at runtime."
  8633. fi
  8634. fi
  8635. ;;
  8636. *)
  8637. func_append newdeplibs " $i"
  8638. ;;
  8639. esac
  8640. done
  8641. else
  8642. # Error occurred in the first compile. Let's try to salvage
  8643. # the situation: Compile a separate program for each library.
  8644. for i in $deplibs; do
  8645. case $i in
  8646. -l*)
  8647. func_stripname -l '' "$i"
  8648. name=$func_stripname_result
  8649. $opt_dry_run || $RM conftest
  8650. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  8651. ldd_output=`ldd conftest`
  8652. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8653. case " $predeps $postdeps " in
  8654. *" $i "*)
  8655. func_append newdeplibs " $i"
  8656. i=
  8657. ;;
  8658. esac
  8659. fi
  8660. if test -n "$i"; then
  8661. libname=`eval "\\$ECHO \"$libname_spec\""`
  8662. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8663. set dummy $deplib_matches; shift
  8664. deplib_match=$1
  8665. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8666. func_append newdeplibs " $i"
  8667. else
  8668. droppeddeps=yes
  8669. echo
  8670. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8671. echo "*** I have the capability to make that library automatically link in when"
  8672. echo "*** you link to this library. But I can only do this if you have a"
  8673. echo "*** shared version of the library, which you do not appear to have"
  8674. echo "*** because a test_compile did reveal that the linker did not use this one"
  8675. echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  8676. fi
  8677. fi
  8678. else
  8679. droppeddeps=yes
  8680. echo
  8681. $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  8682. echo "*** make it link in! You will probably need to install it or some"
  8683. echo "*** library that it depends on before this library will be fully"
  8684. echo "*** functional. Installing it before continuing would be even better."
  8685. fi
  8686. ;;
  8687. *)
  8688. func_append newdeplibs " $i"
  8689. ;;
  8690. esac
  8691. done
  8692. fi
  8693. ;;
  8694. file_magic*)
  8695. set dummy $deplibs_check_method; shift
  8696. file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8697. for a_deplib in $deplibs; do
  8698. case $a_deplib in
  8699. -l*)
  8700. func_stripname -l '' "$a_deplib"
  8701. name=$func_stripname_result
  8702. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8703. case " $predeps $postdeps " in
  8704. *" $a_deplib "*)
  8705. func_append newdeplibs " $a_deplib"
  8706. a_deplib=
  8707. ;;
  8708. esac
  8709. fi
  8710. if test -n "$a_deplib"; then
  8711. libname=`eval "\\$ECHO \"$libname_spec\""`
  8712. if test -n "$file_magic_glob"; then
  8713. libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  8714. else
  8715. libnameglob=$libname
  8716. fi
  8717. test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
  8718. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8719. if test yes = "$want_nocaseglob"; then
  8720. shopt -s nocaseglob
  8721. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8722. $nocaseglob
  8723. else
  8724. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8725. fi
  8726. for potent_lib in $potential_libs; do
  8727. # Follow soft links.
  8728. if ls -lLd "$potent_lib" 2>/dev/null |
  8729. $GREP " -> " >/dev/null; then
  8730. continue
  8731. fi
  8732. # The statement above tries to avoid entering an
  8733. # endless loop below, in case of cyclic links.
  8734. # We might still enter an endless loop, since a link
  8735. # loop can be closed while we follow links,
  8736. # but so what?
  8737. potlib=$potent_lib
  8738. while test -h "$potlib" 2>/dev/null; do
  8739. potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
  8740. case $potliblink in
  8741. [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
  8742. *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
  8743. esac
  8744. done
  8745. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  8746. $SED -e 10q |
  8747. $EGREP "$file_magic_regex" > /dev/null; then
  8748. func_append newdeplibs " $a_deplib"
  8749. a_deplib=
  8750. break 2
  8751. fi
  8752. done
  8753. done
  8754. fi
  8755. if test -n "$a_deplib"; then
  8756. droppeddeps=yes
  8757. echo
  8758. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8759. echo "*** I have the capability to make that library automatically link in when"
  8760. echo "*** you link to this library. But I can only do this if you have a"
  8761. echo "*** shared version of the library, which you do not appear to have"
  8762. echo "*** because I did check the linker path looking for a file starting"
  8763. if test -z "$potlib"; then
  8764. $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  8765. else
  8766. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8767. $ECHO "*** using a file magic. Last file checked: $potlib"
  8768. fi
  8769. fi
  8770. ;;
  8771. *)
  8772. # Add a -L argument.
  8773. func_append newdeplibs " $a_deplib"
  8774. ;;
  8775. esac
  8776. done # Gone through all deplibs.
  8777. ;;
  8778. match_pattern*)
  8779. set dummy $deplibs_check_method; shift
  8780. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8781. for a_deplib in $deplibs; do
  8782. case $a_deplib in
  8783. -l*)
  8784. func_stripname -l '' "$a_deplib"
  8785. name=$func_stripname_result
  8786. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8787. case " $predeps $postdeps " in
  8788. *" $a_deplib "*)
  8789. func_append newdeplibs " $a_deplib"
  8790. a_deplib=
  8791. ;;
  8792. esac
  8793. fi
  8794. if test -n "$a_deplib"; then
  8795. libname=`eval "\\$ECHO \"$libname_spec\""`
  8796. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8797. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  8798. for potent_lib in $potential_libs; do
  8799. potlib=$potent_lib # see symlink-check above in file_magic test
  8800. if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  8801. $EGREP "$match_pattern_regex" > /dev/null; then
  8802. func_append newdeplibs " $a_deplib"
  8803. a_deplib=
  8804. break 2
  8805. fi
  8806. done
  8807. done
  8808. fi
  8809. if test -n "$a_deplib"; then
  8810. droppeddeps=yes
  8811. echo
  8812. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8813. echo "*** I have the capability to make that library automatically link in when"
  8814. echo "*** you link to this library. But I can only do this if you have a"
  8815. echo "*** shared version of the library, which you do not appear to have"
  8816. echo "*** because I did check the linker path looking for a file starting"
  8817. if test -z "$potlib"; then
  8818. $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  8819. else
  8820. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8821. $ECHO "*** using a regex pattern. Last file checked: $potlib"
  8822. fi
  8823. fi
  8824. ;;
  8825. *)
  8826. # Add a -L argument.
  8827. func_append newdeplibs " $a_deplib"
  8828. ;;
  8829. esac
  8830. done # Gone through all deplibs.
  8831. ;;
  8832. none | unknown | *)
  8833. newdeplibs=
  8834. tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  8835. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8836. for i in $predeps $postdeps; do
  8837. # can't use Xsed below, because $i might contain '/'
  8838. tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
  8839. done
  8840. fi
  8841. case $tmp_deplibs in
  8842. *[!\ \ ]*)
  8843. echo
  8844. if test none = "$deplibs_check_method"; then
  8845. echo "*** Warning: inter-library dependencies are not supported in this platform."
  8846. else
  8847. echo "*** Warning: inter-library dependencies are not known to be supported."
  8848. fi
  8849. echo "*** All declared inter-library dependencies are being dropped."
  8850. droppeddeps=yes
  8851. ;;
  8852. esac
  8853. ;;
  8854. esac
  8855. versuffix=$versuffix_save
  8856. major=$major_save
  8857. release=$release_save
  8858. libname=$libname_save
  8859. name=$name_save
  8860. case $host in
  8861. *-*-rhapsody* | *-*-darwin1.[012])
  8862. # On Rhapsody replace the C library with the System framework
  8863. newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  8864. ;;
  8865. esac
  8866. if test yes = "$droppeddeps"; then
  8867. if test yes = "$module"; then
  8868. echo
  8869. echo "*** Warning: libtool could not satisfy all declared inter-library"
  8870. $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  8871. echo "*** a static module, that should work as long as the dlopening"
  8872. echo "*** application is linked with the -dlopen flag."
  8873. if test -z "$global_symbol_pipe"; then
  8874. echo
  8875. echo "*** However, this would only work if libtool was able to extract symbol"
  8876. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  8877. echo "*** not find such a program. So, this module is probably useless."
  8878. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  8879. fi
  8880. if test no = "$build_old_libs"; then
  8881. oldlibs=$output_objdir/$libname.$libext
  8882. build_libtool_libs=module
  8883. build_old_libs=yes
  8884. else
  8885. build_libtool_libs=no
  8886. fi
  8887. else
  8888. echo "*** The inter-library dependencies that have been dropped here will be"
  8889. echo "*** automatically added whenever a program is linked with this library"
  8890. echo "*** or is declared to -dlopen it."
  8891. if test no = "$allow_undefined"; then
  8892. echo
  8893. echo "*** Since this library must not contain undefined symbols,"
  8894. echo "*** because either the platform does not support them or"
  8895. echo "*** it was explicitly requested with -no-undefined,"
  8896. echo "*** libtool will only create a static version of it."
  8897. if test no = "$build_old_libs"; then
  8898. oldlibs=$output_objdir/$libname.$libext
  8899. build_libtool_libs=module
  8900. build_old_libs=yes
  8901. else
  8902. build_libtool_libs=no
  8903. fi
  8904. fi
  8905. fi
  8906. fi
  8907. # Done checking deplibs!
  8908. deplibs=$newdeplibs
  8909. fi
  8910. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  8911. case $host in
  8912. *-*-darwin*)
  8913. newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8914. new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8915. deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8916. ;;
  8917. esac
  8918. # move library search paths that coincide with paths to not yet
  8919. # installed libraries to the beginning of the library search list
  8920. new_libs=
  8921. for path in $notinst_path; do
  8922. case " $new_libs " in
  8923. *" -L$path/$objdir "*) ;;
  8924. *)
  8925. case " $deplibs " in
  8926. *" -L$path/$objdir "*)
  8927. func_append new_libs " -L$path/$objdir" ;;
  8928. esac
  8929. ;;
  8930. esac
  8931. done
  8932. for deplib in $deplibs; do
  8933. case $deplib in
  8934. -L*)
  8935. case " $new_libs " in
  8936. *" $deplib "*) ;;
  8937. *) func_append new_libs " $deplib" ;;
  8938. esac
  8939. ;;
  8940. *) func_append new_libs " $deplib" ;;
  8941. esac
  8942. done
  8943. deplibs=$new_libs
  8944. # All the library-specific variables (install_libdir is set above).
  8945. library_names=
  8946. old_library=
  8947. dlname=
  8948. # Test again, we may have decided not to build it any more
  8949. if test yes = "$build_libtool_libs"; then
  8950. # Remove $wl instances when linking with ld.
  8951. # FIXME: should test the right _cmds variable.
  8952. case $archive_cmds in
  8953. *\$LD\ *) wl= ;;
  8954. esac
  8955. if test yes = "$hardcode_into_libs"; then
  8956. # Hardcode the library paths
  8957. hardcode_libdirs=
  8958. dep_rpath=
  8959. rpath=$finalize_rpath
  8960. test relink = "$opt_mode" || rpath=$compile_rpath$rpath
  8961. for libdir in $rpath; do
  8962. if test -n "$hardcode_libdir_flag_spec"; then
  8963. if test -n "$hardcode_libdir_separator"; then
  8964. func_replace_sysroot "$libdir"
  8965. libdir=$func_replace_sysroot_result
  8966. if test -z "$hardcode_libdirs"; then
  8967. hardcode_libdirs=$libdir
  8968. else
  8969. # Just accumulate the unique libdirs.
  8970. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  8971. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  8972. ;;
  8973. *)
  8974. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  8975. ;;
  8976. esac
  8977. fi
  8978. else
  8979. eval flag=\"$hardcode_libdir_flag_spec\"
  8980. func_append dep_rpath " $flag"
  8981. fi
  8982. elif test -n "$runpath_var"; then
  8983. case "$perm_rpath " in
  8984. *" $libdir "*) ;;
  8985. *) func_append perm_rpath " $libdir" ;;
  8986. esac
  8987. fi
  8988. done
  8989. # Substitute the hardcoded libdirs into the rpath.
  8990. if test -n "$hardcode_libdir_separator" &&
  8991. test -n "$hardcode_libdirs"; then
  8992. libdir=$hardcode_libdirs
  8993. eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
  8994. fi
  8995. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  8996. # We should set the runpath_var.
  8997. rpath=
  8998. for dir in $perm_rpath; do
  8999. func_append rpath "$dir:"
  9000. done
  9001. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  9002. fi
  9003. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  9004. fi
  9005. shlibpath=$finalize_shlibpath
  9006. test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
  9007. if test -n "$shlibpath"; then
  9008. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  9009. fi
  9010. # Get the real and link names of the library.
  9011. eval shared_ext=\"$shrext_cmds\"
  9012. eval library_names=\"$library_names_spec\"
  9013. set dummy $library_names
  9014. shift
  9015. realname=$1
  9016. shift
  9017. if test -n "$soname_spec"; then
  9018. eval soname=\"$soname_spec\"
  9019. else
  9020. soname=$realname
  9021. fi
  9022. if test -z "$dlname"; then
  9023. dlname=$soname
  9024. fi
  9025. lib=$output_objdir/$realname
  9026. linknames=
  9027. for link
  9028. do
  9029. func_append linknames " $link"
  9030. done
  9031. # Use standard objects if they are pic
  9032. test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9033. test "X$libobjs" = "X " && libobjs=
  9034. delfiles=
  9035. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9036. $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  9037. export_symbols=$output_objdir/$libname.uexp
  9038. func_append delfiles " $export_symbols"
  9039. fi
  9040. orig_export_symbols=
  9041. case $host_os in
  9042. cygwin* | mingw* | cegcc*)
  9043. if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  9044. # exporting using user supplied symfile
  9045. func_dll_def_p "$export_symbols" || {
  9046. # and it's NOT already a .def file. Must figure out
  9047. # which of the given symbols are data symbols and tag
  9048. # them as such. So, trigger use of export_symbols_cmds.
  9049. # export_symbols gets reassigned inside the "prepare
  9050. # the list of exported symbols" if statement, so the
  9051. # include_expsyms logic still works.
  9052. orig_export_symbols=$export_symbols
  9053. export_symbols=
  9054. always_export_symbols=yes
  9055. }
  9056. fi
  9057. ;;
  9058. esac
  9059. # Prepare the list of exported symbols
  9060. if test -z "$export_symbols"; then
  9061. if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
  9062. func_verbose "generating symbol list for '$libname.la'"
  9063. export_symbols=$output_objdir/$libname.exp
  9064. $opt_dry_run || $RM $export_symbols
  9065. cmds=$export_symbols_cmds
  9066. save_ifs=$IFS; IFS='~'
  9067. for cmd1 in $cmds; do
  9068. IFS=$save_ifs
  9069. # Take the normal branch if the nm_file_list_spec branch
  9070. # doesn't work or if tool conversion is not needed.
  9071. case $nm_file_list_spec~$to_tool_file_cmd in
  9072. *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
  9073. try_normal_branch=yes
  9074. eval cmd=\"$cmd1\"
  9075. func_len " $cmd"
  9076. len=$func_len_result
  9077. ;;
  9078. *)
  9079. try_normal_branch=no
  9080. ;;
  9081. esac
  9082. if test yes = "$try_normal_branch" \
  9083. && { test "$len" -lt "$max_cmd_len" \
  9084. || test "$max_cmd_len" -le -1; }
  9085. then
  9086. func_show_eval "$cmd" 'exit $?'
  9087. skipped_export=false
  9088. elif test -n "$nm_file_list_spec"; then
  9089. func_basename "$output"
  9090. output_la=$func_basename_result
  9091. save_libobjs=$libobjs
  9092. save_output=$output
  9093. output=$output_objdir/$output_la.nm
  9094. func_to_tool_file "$output"
  9095. libobjs=$nm_file_list_spec$func_to_tool_file_result
  9096. func_append delfiles " $output"
  9097. func_verbose "creating $NM input file list: $output"
  9098. for obj in $save_libobjs; do
  9099. func_to_tool_file "$obj"
  9100. $ECHO "$func_to_tool_file_result"
  9101. done > "$output"
  9102. eval cmd=\"$cmd1\"
  9103. func_show_eval "$cmd" 'exit $?'
  9104. output=$save_output
  9105. libobjs=$save_libobjs
  9106. skipped_export=false
  9107. else
  9108. # The command line is too long to execute in one step.
  9109. func_verbose "using reloadable object file for export list..."
  9110. skipped_export=:
  9111. # Break out early, otherwise skipped_export may be
  9112. # set to false by a later but shorter cmd.
  9113. break
  9114. fi
  9115. done
  9116. IFS=$save_ifs
  9117. if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
  9118. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9119. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9120. fi
  9121. fi
  9122. fi
  9123. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9124. tmp_export_symbols=$export_symbols
  9125. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9126. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9127. fi
  9128. if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
  9129. # The given exports_symbols file has to be filtered, so filter it.
  9130. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9131. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9132. # 's' commands, which not all seds can handle. GNU sed should be fine
  9133. # though. Also, the filter scales superlinearly with the number of
  9134. # global variables. join(1) would be nice here, but unfortunately
  9135. # isn't a blessed tool.
  9136. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9137. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9138. export_symbols=$output_objdir/$libname.def
  9139. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9140. fi
  9141. tmp_deplibs=
  9142. for test_deplib in $deplibs; do
  9143. case " $convenience " in
  9144. *" $test_deplib "*) ;;
  9145. *)
  9146. func_append tmp_deplibs " $test_deplib"
  9147. ;;
  9148. esac
  9149. done
  9150. deplibs=$tmp_deplibs
  9151. if test -n "$convenience"; then
  9152. if test -n "$whole_archive_flag_spec" &&
  9153. test yes = "$compiler_needs_object" &&
  9154. test -z "$libobjs"; then
  9155. # extract the archives, so we have objects to list.
  9156. # TODO: could optimize this to just extract one archive.
  9157. whole_archive_flag_spec=
  9158. fi
  9159. if test -n "$whole_archive_flag_spec"; then
  9160. save_libobjs=$libobjs
  9161. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9162. test "X$libobjs" = "X " && libobjs=
  9163. else
  9164. gentop=$output_objdir/${outputname}x
  9165. func_append generated " $gentop"
  9166. func_extract_archives $gentop $convenience
  9167. func_append libobjs " $func_extract_archives_result"
  9168. test "X$libobjs" = "X " && libobjs=
  9169. fi
  9170. fi
  9171. if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
  9172. eval flag=\"$thread_safe_flag_spec\"
  9173. func_append linker_flags " $flag"
  9174. fi
  9175. # Make a backup of the uninstalled library when relinking
  9176. if test relink = "$opt_mode"; then
  9177. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  9178. fi
  9179. # Do each of the archive commands.
  9180. if test yes = "$module" && test -n "$module_cmds"; then
  9181. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9182. eval test_cmds=\"$module_expsym_cmds\"
  9183. cmds=$module_expsym_cmds
  9184. else
  9185. eval test_cmds=\"$module_cmds\"
  9186. cmds=$module_cmds
  9187. fi
  9188. else
  9189. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9190. eval test_cmds=\"$archive_expsym_cmds\"
  9191. cmds=$archive_expsym_cmds
  9192. else
  9193. eval test_cmds=\"$archive_cmds\"
  9194. cmds=$archive_cmds
  9195. fi
  9196. fi
  9197. if test : != "$skipped_export" &&
  9198. func_len " $test_cmds" &&
  9199. len=$func_len_result &&
  9200. test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9201. :
  9202. else
  9203. # The command line is too long to link in one step, link piecewise
  9204. # or, if using GNU ld and skipped_export is not :, use a linker
  9205. # script.
  9206. # Save the value of $output and $libobjs because we want to
  9207. # use them later. If we have whole_archive_flag_spec, we
  9208. # want to use save_libobjs as it was before
  9209. # whole_archive_flag_spec was expanded, because we can't
  9210. # assume the linker understands whole_archive_flag_spec.
  9211. # This may have to be revisited, in case too many
  9212. # convenience libraries get linked in and end up exceeding
  9213. # the spec.
  9214. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  9215. save_libobjs=$libobjs
  9216. fi
  9217. save_output=$output
  9218. func_basename "$output"
  9219. output_la=$func_basename_result
  9220. # Clear the reloadable object creation command queue and
  9221. # initialize k to one.
  9222. test_cmds=
  9223. concat_cmds=
  9224. objlist=
  9225. last_robj=
  9226. k=1
  9227. if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
  9228. output=$output_objdir/$output_la.lnkscript
  9229. func_verbose "creating GNU ld script: $output"
  9230. echo 'INPUT (' > $output
  9231. for obj in $save_libobjs
  9232. do
  9233. func_to_tool_file "$obj"
  9234. $ECHO "$func_to_tool_file_result" >> $output
  9235. done
  9236. echo ')' >> $output
  9237. func_append delfiles " $output"
  9238. func_to_tool_file "$output"
  9239. output=$func_to_tool_file_result
  9240. elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
  9241. output=$output_objdir/$output_la.lnk
  9242. func_verbose "creating linker input file list: $output"
  9243. : > $output
  9244. set x $save_libobjs
  9245. shift
  9246. firstobj=
  9247. if test yes = "$compiler_needs_object"; then
  9248. firstobj="$1 "
  9249. shift
  9250. fi
  9251. for obj
  9252. do
  9253. func_to_tool_file "$obj"
  9254. $ECHO "$func_to_tool_file_result" >> $output
  9255. done
  9256. func_append delfiles " $output"
  9257. func_to_tool_file "$output"
  9258. output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
  9259. else
  9260. if test -n "$save_libobjs"; then
  9261. func_verbose "creating reloadable object files..."
  9262. output=$output_objdir/$output_la-$k.$objext
  9263. eval test_cmds=\"$reload_cmds\"
  9264. func_len " $test_cmds"
  9265. len0=$func_len_result
  9266. len=$len0
  9267. # Loop over the list of objects to be linked.
  9268. for obj in $save_libobjs
  9269. do
  9270. func_len " $obj"
  9271. func_arith $len + $func_len_result
  9272. len=$func_arith_result
  9273. if test -z "$objlist" ||
  9274. test "$len" -lt "$max_cmd_len"; then
  9275. func_append objlist " $obj"
  9276. else
  9277. # The command $test_cmds is almost too long, add a
  9278. # command to the queue.
  9279. if test 1 -eq "$k"; then
  9280. # The first file doesn't have a previous command to add.
  9281. reload_objs=$objlist
  9282. eval concat_cmds=\"$reload_cmds\"
  9283. else
  9284. # All subsequent reloadable object files will link in
  9285. # the last one created.
  9286. reload_objs="$objlist $last_robj"
  9287. eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
  9288. fi
  9289. last_robj=$output_objdir/$output_la-$k.$objext
  9290. func_arith $k + 1
  9291. k=$func_arith_result
  9292. output=$output_objdir/$output_la-$k.$objext
  9293. objlist=" $obj"
  9294. func_len " $last_robj"
  9295. func_arith $len0 + $func_len_result
  9296. len=$func_arith_result
  9297. fi
  9298. done
  9299. # Handle the remaining objects by creating one last
  9300. # reloadable object file. All subsequent reloadable object
  9301. # files will link in the last one created.
  9302. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9303. reload_objs="$objlist $last_robj"
  9304. eval concat_cmds=\"\$concat_cmds$reload_cmds\"
  9305. if test -n "$last_robj"; then
  9306. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9307. fi
  9308. func_append delfiles " $output"
  9309. else
  9310. output=
  9311. fi
  9312. ${skipped_export-false} && {
  9313. func_verbose "generating symbol list for '$libname.la'"
  9314. export_symbols=$output_objdir/$libname.exp
  9315. $opt_dry_run || $RM $export_symbols
  9316. libobjs=$output
  9317. # Append the command to create the export file.
  9318. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9319. eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  9320. if test -n "$last_robj"; then
  9321. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9322. fi
  9323. }
  9324. test -n "$save_libobjs" &&
  9325. func_verbose "creating a temporary reloadable object file: $output"
  9326. # Loop through the commands generated above and execute them.
  9327. save_ifs=$IFS; IFS='~'
  9328. for cmd in $concat_cmds; do
  9329. IFS=$save_ifs
  9330. $opt_quiet || {
  9331. func_quote_arg expand,pretty "$cmd"
  9332. eval "func_echo $func_quote_arg_result"
  9333. }
  9334. $opt_dry_run || eval "$cmd" || {
  9335. lt_exit=$?
  9336. # Restore the uninstalled library and exit
  9337. if test relink = "$opt_mode"; then
  9338. ( cd "$output_objdir" && \
  9339. $RM "${realname}T" && \
  9340. $MV "${realname}U" "$realname" )
  9341. fi
  9342. exit $lt_exit
  9343. }
  9344. done
  9345. IFS=$save_ifs
  9346. if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  9347. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9348. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9349. fi
  9350. fi
  9351. ${skipped_export-false} && {
  9352. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9353. tmp_export_symbols=$export_symbols
  9354. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9355. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9356. fi
  9357. if test -n "$orig_export_symbols"; then
  9358. # The given exports_symbols file has to be filtered, so filter it.
  9359. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9360. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9361. # 's' commands, which not all seds can handle. GNU sed should be fine
  9362. # though. Also, the filter scales superlinearly with the number of
  9363. # global variables. join(1) would be nice here, but unfortunately
  9364. # isn't a blessed tool.
  9365. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9366. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9367. export_symbols=$output_objdir/$libname.def
  9368. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9369. fi
  9370. }
  9371. libobjs=$output
  9372. # Restore the value of output.
  9373. output=$save_output
  9374. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  9375. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9376. test "X$libobjs" = "X " && libobjs=
  9377. fi
  9378. # Expand the library linking commands again to reset the
  9379. # value of $libobjs for piecewise linking.
  9380. # Do each of the archive commands.
  9381. if test yes = "$module" && test -n "$module_cmds"; then
  9382. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9383. cmds=$module_expsym_cmds
  9384. else
  9385. cmds=$module_cmds
  9386. fi
  9387. else
  9388. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9389. cmds=$archive_expsym_cmds
  9390. else
  9391. cmds=$archive_cmds
  9392. fi
  9393. fi
  9394. fi
  9395. if test -n "$delfiles"; then
  9396. # Append the command to remove temporary files to $cmds.
  9397. eval cmds=\"\$cmds~\$RM $delfiles\"
  9398. fi
  9399. # Add any objects from preloaded convenience libraries
  9400. if test -n "$dlprefiles"; then
  9401. gentop=$output_objdir/${outputname}x
  9402. func_append generated " $gentop"
  9403. func_extract_archives $gentop $dlprefiles
  9404. func_append libobjs " $func_extract_archives_result"
  9405. test "X$libobjs" = "X " && libobjs=
  9406. fi
  9407. save_ifs=$IFS; IFS='~'
  9408. for cmd in $cmds; do
  9409. IFS=$sp$nl
  9410. eval cmd=\"$cmd\"
  9411. IFS=$save_ifs
  9412. $opt_quiet || {
  9413. func_quote_arg expand,pretty "$cmd"
  9414. eval "func_echo $func_quote_arg_result"
  9415. }
  9416. $opt_dry_run || eval "$cmd" || {
  9417. lt_exit=$?
  9418. # Restore the uninstalled library and exit
  9419. if test relink = "$opt_mode"; then
  9420. ( cd "$output_objdir" && \
  9421. $RM "${realname}T" && \
  9422. $MV "${realname}U" "$realname" )
  9423. fi
  9424. exit $lt_exit
  9425. }
  9426. done
  9427. IFS=$save_ifs
  9428. # Restore the uninstalled library and exit
  9429. if test relink = "$opt_mode"; then
  9430. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  9431. if test -n "$convenience"; then
  9432. if test -z "$whole_archive_flag_spec"; then
  9433. func_show_eval '${RM}r "$gentop"'
  9434. fi
  9435. fi
  9436. exit $EXIT_SUCCESS
  9437. fi
  9438. # Create links to the real library.
  9439. for linkname in $linknames; do
  9440. if test "$realname" != "$linkname"; then
  9441. func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  9442. fi
  9443. done
  9444. # If -module or -export-dynamic was specified, set the dlname.
  9445. if test yes = "$module" || test yes = "$export_dynamic"; then
  9446. # On all known operating systems, these are identical.
  9447. dlname=$soname
  9448. fi
  9449. fi
  9450. ;;
  9451. obj)
  9452. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  9453. func_warning "'-dlopen' is ignored for objects"
  9454. fi
  9455. case " $deplibs" in
  9456. *\ -l* | *\ -L*)
  9457. func_warning "'-l' and '-L' are ignored for objects" ;;
  9458. esac
  9459. test -n "$rpath" && \
  9460. func_warning "'-rpath' is ignored for objects"
  9461. test -n "$xrpath" && \
  9462. func_warning "'-R' is ignored for objects"
  9463. test -n "$vinfo" && \
  9464. func_warning "'-version-info' is ignored for objects"
  9465. test -n "$release" && \
  9466. func_warning "'-release' is ignored for objects"
  9467. case $output in
  9468. *.lo)
  9469. test -n "$objs$old_deplibs" && \
  9470. func_fatal_error "cannot build library object '$output' from non-libtool objects"
  9471. libobj=$output
  9472. func_lo2o "$libobj"
  9473. obj=$func_lo2o_result
  9474. ;;
  9475. *)
  9476. libobj=
  9477. obj=$output
  9478. ;;
  9479. esac
  9480. # Delete the old objects.
  9481. $opt_dry_run || $RM $obj $libobj
  9482. # Objects from convenience libraries. This assumes
  9483. # single-version convenience libraries. Whenever we create
  9484. # different ones for PIC/non-PIC, this we'll have to duplicate
  9485. # the extraction.
  9486. reload_conv_objs=
  9487. gentop=
  9488. # if reload_cmds runs $LD directly, get rid of -Wl from
  9489. # whole_archive_flag_spec and hope we can get by with turning comma
  9490. # into space.
  9491. case $reload_cmds in
  9492. *\$LD[\ \$]*) wl= ;;
  9493. esac
  9494. if test -n "$convenience"; then
  9495. if test -n "$whole_archive_flag_spec"; then
  9496. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  9497. test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
  9498. reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
  9499. else
  9500. gentop=$output_objdir/${obj}x
  9501. func_append generated " $gentop"
  9502. func_extract_archives $gentop $convenience
  9503. reload_conv_objs="$reload_objs $func_extract_archives_result"
  9504. fi
  9505. fi
  9506. # If we're not building shared, we need to use non_pic_objs
  9507. test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
  9508. # Create the old-style object.
  9509. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
  9510. output=$obj
  9511. func_execute_cmds "$reload_cmds" 'exit $?'
  9512. # Exit if we aren't doing a library object file.
  9513. if test -z "$libobj"; then
  9514. if test -n "$gentop"; then
  9515. func_show_eval '${RM}r "$gentop"'
  9516. fi
  9517. exit $EXIT_SUCCESS
  9518. fi
  9519. test yes = "$build_libtool_libs" || {
  9520. if test -n "$gentop"; then
  9521. func_show_eval '${RM}r "$gentop"'
  9522. fi
  9523. # Create an invalid libtool object if no PIC, so that we don't
  9524. # accidentally link it into a program.
  9525. # $show "echo timestamp > $libobj"
  9526. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  9527. exit $EXIT_SUCCESS
  9528. }
  9529. if test -n "$pic_flag" || test default != "$pic_mode"; then
  9530. # Only do commands if we really have different PIC objects.
  9531. reload_objs="$libobjs $reload_conv_objs"
  9532. output=$libobj
  9533. func_execute_cmds "$reload_cmds" 'exit $?'
  9534. fi
  9535. if test -n "$gentop"; then
  9536. func_show_eval '${RM}r "$gentop"'
  9537. fi
  9538. exit $EXIT_SUCCESS
  9539. ;;
  9540. prog)
  9541. case $host in
  9542. *cygwin*) func_stripname '' '.exe' "$output"
  9543. output=$func_stripname_result.exe;;
  9544. esac
  9545. test -n "$vinfo" && \
  9546. func_warning "'-version-info' is ignored for programs"
  9547. test -n "$release" && \
  9548. func_warning "'-release' is ignored for programs"
  9549. $preload \
  9550. && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
  9551. && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
  9552. case $host in
  9553. *-*-rhapsody* | *-*-darwin1.[012])
  9554. # On Rhapsody replace the C library is the System framework
  9555. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9556. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9557. ;;
  9558. esac
  9559. case $host in
  9560. *-*-darwin*)
  9561. # Don't allow lazy linking, it breaks C++ global constructors
  9562. # But is supposedly fixed on 10.4 or later (yay!).
  9563. if test CXX = "$tagname"; then
  9564. case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  9565. 10.[0123])
  9566. func_append compile_command " $wl-bind_at_load"
  9567. func_append finalize_command " $wl-bind_at_load"
  9568. ;;
  9569. esac
  9570. fi
  9571. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  9572. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9573. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9574. ;;
  9575. esac
  9576. # move library search paths that coincide with paths to not yet
  9577. # installed libraries to the beginning of the library search list
  9578. new_libs=
  9579. for path in $notinst_path; do
  9580. case " $new_libs " in
  9581. *" -L$path/$objdir "*) ;;
  9582. *)
  9583. case " $compile_deplibs " in
  9584. *" -L$path/$objdir "*)
  9585. func_append new_libs " -L$path/$objdir" ;;
  9586. esac
  9587. ;;
  9588. esac
  9589. done
  9590. for deplib in $compile_deplibs; do
  9591. case $deplib in
  9592. -L*)
  9593. case " $new_libs " in
  9594. *" $deplib "*) ;;
  9595. *) func_append new_libs " $deplib" ;;
  9596. esac
  9597. ;;
  9598. *) func_append new_libs " $deplib" ;;
  9599. esac
  9600. done
  9601. compile_deplibs=$new_libs
  9602. func_append compile_command " $compile_deplibs"
  9603. func_append finalize_command " $finalize_deplibs"
  9604. if test -n "$rpath$xrpath"; then
  9605. # If the user specified any rpath flags, then add them.
  9606. for libdir in $rpath $xrpath; do
  9607. # This is the magic to use -rpath.
  9608. case "$finalize_rpath " in
  9609. *" $libdir "*) ;;
  9610. *) func_append finalize_rpath " $libdir" ;;
  9611. esac
  9612. done
  9613. fi
  9614. # Now hardcode the library paths
  9615. rpath=
  9616. hardcode_libdirs=
  9617. for libdir in $compile_rpath $finalize_rpath; do
  9618. if test -n "$hardcode_libdir_flag_spec"; then
  9619. if test -n "$hardcode_libdir_separator"; then
  9620. if test -z "$hardcode_libdirs"; then
  9621. hardcode_libdirs=$libdir
  9622. else
  9623. # Just accumulate the unique libdirs.
  9624. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9625. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9626. ;;
  9627. *)
  9628. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9629. ;;
  9630. esac
  9631. fi
  9632. else
  9633. eval flag=\"$hardcode_libdir_flag_spec\"
  9634. func_append rpath " $flag"
  9635. fi
  9636. elif test -n "$runpath_var"; then
  9637. case "$perm_rpath " in
  9638. *" $libdir "*) ;;
  9639. *) func_append perm_rpath " $libdir" ;;
  9640. esac
  9641. fi
  9642. case $host in
  9643. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  9644. testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
  9645. case :$dllsearchpath: in
  9646. *":$libdir:"*) ;;
  9647. ::) dllsearchpath=$libdir;;
  9648. *) func_append dllsearchpath ":$libdir";;
  9649. esac
  9650. case :$dllsearchpath: in
  9651. *":$testbindir:"*) ;;
  9652. ::) dllsearchpath=$testbindir;;
  9653. *) func_append dllsearchpath ":$testbindir";;
  9654. esac
  9655. ;;
  9656. esac
  9657. done
  9658. # Substitute the hardcoded libdirs into the rpath.
  9659. if test -n "$hardcode_libdir_separator" &&
  9660. test -n "$hardcode_libdirs"; then
  9661. libdir=$hardcode_libdirs
  9662. eval rpath=\" $hardcode_libdir_flag_spec\"
  9663. fi
  9664. compile_rpath=$rpath
  9665. rpath=
  9666. hardcode_libdirs=
  9667. for libdir in $finalize_rpath; do
  9668. if test -n "$hardcode_libdir_flag_spec"; then
  9669. if test -n "$hardcode_libdir_separator"; then
  9670. if test -z "$hardcode_libdirs"; then
  9671. hardcode_libdirs=$libdir
  9672. else
  9673. # Just accumulate the unique libdirs.
  9674. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9675. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9676. ;;
  9677. *)
  9678. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9679. ;;
  9680. esac
  9681. fi
  9682. else
  9683. eval flag=\"$hardcode_libdir_flag_spec\"
  9684. func_append rpath " $flag"
  9685. fi
  9686. elif test -n "$runpath_var"; then
  9687. case "$finalize_perm_rpath " in
  9688. *" $libdir "*) ;;
  9689. *) func_append finalize_perm_rpath " $libdir" ;;
  9690. esac
  9691. fi
  9692. done
  9693. # Substitute the hardcoded libdirs into the rpath.
  9694. if test -n "$hardcode_libdir_separator" &&
  9695. test -n "$hardcode_libdirs"; then
  9696. libdir=$hardcode_libdirs
  9697. eval rpath=\" $hardcode_libdir_flag_spec\"
  9698. fi
  9699. finalize_rpath=$rpath
  9700. if test -n "$libobjs" && test yes = "$build_old_libs"; then
  9701. # Transform all the library objects into standard objects.
  9702. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9703. finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9704. fi
  9705. func_generate_dlsyms "$outputname" "@PROGRAM@" false
  9706. # template prelinking step
  9707. if test -n "$prelink_cmds"; then
  9708. func_execute_cmds "$prelink_cmds" 'exit $?'
  9709. fi
  9710. wrappers_required=:
  9711. case $host in
  9712. *cegcc* | *mingw32ce*)
  9713. # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
  9714. wrappers_required=false
  9715. ;;
  9716. *cygwin* | *mingw* )
  9717. test yes = "$build_libtool_libs" || wrappers_required=false
  9718. ;;
  9719. *)
  9720. if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
  9721. wrappers_required=false
  9722. fi
  9723. ;;
  9724. esac
  9725. $wrappers_required || {
  9726. # Replace the output file specification.
  9727. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9728. link_command=$compile_command$compile_rpath
  9729. # We have no uninstalled library dependencies, so finalize right now.
  9730. exit_status=0
  9731. func_show_eval "$link_command" 'exit_status=$?'
  9732. if test -n "$postlink_cmds"; then
  9733. func_to_tool_file "$output"
  9734. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9735. func_execute_cmds "$postlink_cmds" 'exit $?'
  9736. fi
  9737. # Delete the generated files.
  9738. if test -f "$output_objdir/${outputname}S.$objext"; then
  9739. func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
  9740. fi
  9741. exit $exit_status
  9742. }
  9743. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  9744. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  9745. fi
  9746. if test -n "$finalize_shlibpath"; then
  9747. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  9748. fi
  9749. compile_var=
  9750. finalize_var=
  9751. if test -n "$runpath_var"; then
  9752. if test -n "$perm_rpath"; then
  9753. # We should set the runpath_var.
  9754. rpath=
  9755. for dir in $perm_rpath; do
  9756. func_append rpath "$dir:"
  9757. done
  9758. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9759. fi
  9760. if test -n "$finalize_perm_rpath"; then
  9761. # We should set the runpath_var.
  9762. rpath=
  9763. for dir in $finalize_perm_rpath; do
  9764. func_append rpath "$dir:"
  9765. done
  9766. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9767. fi
  9768. fi
  9769. if test yes = "$no_install"; then
  9770. # We don't need to create a wrapper script.
  9771. link_command=$compile_var$compile_command$compile_rpath
  9772. # Replace the output file specification.
  9773. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9774. # Delete the old output file.
  9775. $opt_dry_run || $RM $output
  9776. # Link the executable and exit
  9777. func_show_eval "$link_command" 'exit $?'
  9778. if test -n "$postlink_cmds"; then
  9779. func_to_tool_file "$output"
  9780. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9781. func_execute_cmds "$postlink_cmds" 'exit $?'
  9782. fi
  9783. exit $EXIT_SUCCESS
  9784. fi
  9785. case $hardcode_action,$fast_install in
  9786. relink,*)
  9787. # Fast installation is not supported
  9788. link_command=$compile_var$compile_command$compile_rpath
  9789. relink_command=$finalize_var$finalize_command$finalize_rpath
  9790. func_warning "this platform does not like uninstalled shared libraries"
  9791. func_warning "'$output' will be relinked during installation"
  9792. ;;
  9793. *,yes)
  9794. link_command=$finalize_var$compile_command$finalize_rpath
  9795. relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
  9796. ;;
  9797. *,no)
  9798. link_command=$compile_var$compile_command$compile_rpath
  9799. relink_command=$finalize_var$finalize_command$finalize_rpath
  9800. ;;
  9801. *,needless)
  9802. link_command=$finalize_var$compile_command$finalize_rpath
  9803. relink_command=
  9804. ;;
  9805. esac
  9806. # Replace the output file specification.
  9807. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  9808. # Delete the old output files.
  9809. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  9810. func_show_eval "$link_command" 'exit $?'
  9811. if test -n "$postlink_cmds"; then
  9812. func_to_tool_file "$output_objdir/$outputname"
  9813. 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'`
  9814. func_execute_cmds "$postlink_cmds" 'exit $?'
  9815. fi
  9816. # Now create the wrapper script.
  9817. func_verbose "creating $output"
  9818. # Quote the relink command for shipping.
  9819. if test -n "$relink_command"; then
  9820. # Preserve any variables that may affect compiler behavior
  9821. for var in $variables_saved_for_relink; do
  9822. if eval test -z \"\${$var+set}\"; then
  9823. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  9824. elif eval var_value=\$$var; test -z "$var_value"; then
  9825. relink_command="$var=; export $var; $relink_command"
  9826. else
  9827. func_quote_arg pretty "$var_value"
  9828. relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
  9829. fi
  9830. done
  9831. func_quote_arg pretty,unquoted "(cd `pwd`; $relink_command)"
  9832. relink_command=$func_quote_arg_unquoted_result
  9833. fi
  9834. # Only actually do things if not in dry run mode.
  9835. $opt_dry_run || {
  9836. # win32 will think the script is a binary if it has
  9837. # a .exe suffix, so we strip it off here.
  9838. case $output in
  9839. *.exe) func_stripname '' '.exe' "$output"
  9840. output=$func_stripname_result ;;
  9841. esac
  9842. # test for cygwin because mv fails w/o .exe extensions
  9843. case $host in
  9844. *cygwin*)
  9845. exeext=.exe
  9846. func_stripname '' '.exe' "$outputname"
  9847. outputname=$func_stripname_result ;;
  9848. *) exeext= ;;
  9849. esac
  9850. case $host in
  9851. *cygwin* | *mingw* )
  9852. func_dirname_and_basename "$output" "" "."
  9853. output_name=$func_basename_result
  9854. output_path=$func_dirname_result
  9855. cwrappersource=$output_path/$objdir/lt-$output_name.c
  9856. cwrapper=$output_path/$output_name.exe
  9857. $RM $cwrappersource $cwrapper
  9858. trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  9859. func_emit_cwrapperexe_src > $cwrappersource
  9860. # The wrapper executable is built using the $host compiler,
  9861. # because it contains $host paths and files. If cross-
  9862. # compiling, it, like the target executable, must be
  9863. # executed on the $host or under an emulation environment.
  9864. $opt_dry_run || {
  9865. $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  9866. $STRIP $cwrapper
  9867. }
  9868. # Now, create the wrapper script for func_source use:
  9869. func_ltwrapper_scriptname $cwrapper
  9870. $RM $func_ltwrapper_scriptname_result
  9871. trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  9872. $opt_dry_run || {
  9873. # note: this script will not be executed, so do not chmod.
  9874. if test "x$build" = "x$host"; then
  9875. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  9876. else
  9877. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  9878. fi
  9879. }
  9880. ;;
  9881. * )
  9882. $RM $output
  9883. trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  9884. func_emit_wrapper no > $output
  9885. chmod +x $output
  9886. ;;
  9887. esac
  9888. }
  9889. exit $EXIT_SUCCESS
  9890. ;;
  9891. esac
  9892. # See if we need to build an old-fashioned archive.
  9893. for oldlib in $oldlibs; do
  9894. case $build_libtool_libs in
  9895. convenience)
  9896. oldobjs="$libobjs_save $symfileobj"
  9897. addlibs=$convenience
  9898. build_libtool_libs=no
  9899. ;;
  9900. module)
  9901. oldobjs=$libobjs_save
  9902. addlibs=$old_convenience
  9903. build_libtool_libs=no
  9904. ;;
  9905. *)
  9906. oldobjs="$old_deplibs $non_pic_objects"
  9907. $preload && test -f "$symfileobj" \
  9908. && func_append oldobjs " $symfileobj"
  9909. addlibs=$old_convenience
  9910. ;;
  9911. esac
  9912. if test -n "$addlibs"; then
  9913. gentop=$output_objdir/${outputname}x
  9914. func_append generated " $gentop"
  9915. func_extract_archives $gentop $addlibs
  9916. func_append oldobjs " $func_extract_archives_result"
  9917. fi
  9918. # Do each command in the archive commands.
  9919. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
  9920. cmds=$old_archive_from_new_cmds
  9921. else
  9922. # Add any objects from preloaded convenience libraries
  9923. if test -n "$dlprefiles"; then
  9924. gentop=$output_objdir/${outputname}x
  9925. func_append generated " $gentop"
  9926. func_extract_archives $gentop $dlprefiles
  9927. func_append oldobjs " $func_extract_archives_result"
  9928. fi
  9929. # POSIX demands no paths to be encoded in archives. We have
  9930. # to avoid creating archives with duplicate basenames if we
  9931. # might have to extract them afterwards, e.g., when creating a
  9932. # static archive out of a convenience library, or when linking
  9933. # the entirety of a libtool archive into another (currently
  9934. # not supported by libtool).
  9935. if (for obj in $oldobjs
  9936. do
  9937. func_basename "$obj"
  9938. $ECHO "$func_basename_result"
  9939. done | sort | sort -uc >/dev/null 2>&1); then
  9940. :
  9941. else
  9942. echo "copying selected object files to avoid basename conflicts..."
  9943. gentop=$output_objdir/${outputname}x
  9944. func_append generated " $gentop"
  9945. func_mkdir_p "$gentop"
  9946. save_oldobjs=$oldobjs
  9947. oldobjs=
  9948. counter=1
  9949. for obj in $save_oldobjs
  9950. do
  9951. func_basename "$obj"
  9952. objbase=$func_basename_result
  9953. case " $oldobjs " in
  9954. " ") oldobjs=$obj ;;
  9955. *[\ /]"$objbase "*)
  9956. while :; do
  9957. # Make sure we don't pick an alternate name that also
  9958. # overlaps.
  9959. newobj=lt$counter-$objbase
  9960. func_arith $counter + 1
  9961. counter=$func_arith_result
  9962. case " $oldobjs " in
  9963. *[\ /]"$newobj "*) ;;
  9964. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  9965. esac
  9966. done
  9967. func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  9968. func_append oldobjs " $gentop/$newobj"
  9969. ;;
  9970. *) func_append oldobjs " $obj" ;;
  9971. esac
  9972. done
  9973. fi
  9974. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  9975. tool_oldlib=$func_to_tool_file_result
  9976. eval cmds=\"$old_archive_cmds\"
  9977. func_len " $cmds"
  9978. len=$func_len_result
  9979. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9980. cmds=$old_archive_cmds
  9981. elif test -n "$archiver_list_spec"; then
  9982. func_verbose "using command file archive linking..."
  9983. for obj in $oldobjs
  9984. do
  9985. func_to_tool_file "$obj"
  9986. $ECHO "$func_to_tool_file_result"
  9987. done > $output_objdir/$libname.libcmd
  9988. func_to_tool_file "$output_objdir/$libname.libcmd"
  9989. oldobjs=" $archiver_list_spec$func_to_tool_file_result"
  9990. cmds=$old_archive_cmds
  9991. else
  9992. # the command line is too long to link in one step, link in parts
  9993. func_verbose "using piecewise archive linking..."
  9994. save_RANLIB=$RANLIB
  9995. RANLIB=:
  9996. objlist=
  9997. concat_cmds=
  9998. save_oldobjs=$oldobjs
  9999. oldobjs=
  10000. # Is there a better way of finding the last object in the list?
  10001. for obj in $save_oldobjs
  10002. do
  10003. last_oldobj=$obj
  10004. done
  10005. eval test_cmds=\"$old_archive_cmds\"
  10006. func_len " $test_cmds"
  10007. len0=$func_len_result
  10008. len=$len0
  10009. for obj in $save_oldobjs
  10010. do
  10011. func_len " $obj"
  10012. func_arith $len + $func_len_result
  10013. len=$func_arith_result
  10014. func_append objlist " $obj"
  10015. if test "$len" -lt "$max_cmd_len"; then
  10016. :
  10017. else
  10018. # the above command should be used before it gets too long
  10019. oldobjs=$objlist
  10020. if test "$obj" = "$last_oldobj"; then
  10021. RANLIB=$save_RANLIB
  10022. fi
  10023. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  10024. eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
  10025. objlist=
  10026. len=$len0
  10027. fi
  10028. done
  10029. RANLIB=$save_RANLIB
  10030. oldobjs=$objlist
  10031. if test -z "$oldobjs"; then
  10032. eval cmds=\"\$concat_cmds\"
  10033. else
  10034. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  10035. fi
  10036. fi
  10037. fi
  10038. func_execute_cmds "$cmds" 'exit $?'
  10039. done
  10040. test -n "$generated" && \
  10041. func_show_eval "${RM}r$generated"
  10042. # Now create the libtool archive.
  10043. case $output in
  10044. *.la)
  10045. old_library=
  10046. test yes = "$build_old_libs" && old_library=$libname.$libext
  10047. func_verbose "creating $output"
  10048. # Preserve any variables that may affect compiler behavior
  10049. for var in $variables_saved_for_relink; do
  10050. if eval test -z \"\${$var+set}\"; then
  10051. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  10052. elif eval var_value=\$$var; test -z "$var_value"; then
  10053. relink_command="$var=; export $var; $relink_command"
  10054. else
  10055. func_quote_arg pretty,unquoted "$var_value"
  10056. relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
  10057. fi
  10058. done
  10059. # Quote the link command for shipping.
  10060. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  10061. func_quote_arg pretty,unquoted "$relink_command"
  10062. relink_command=$func_quote_arg_unquoted_result
  10063. if test yes = "$hardcode_automatic"; then
  10064. relink_command=
  10065. fi
  10066. # Only create the output if not a dry run.
  10067. $opt_dry_run || {
  10068. for installed in no yes; do
  10069. if test yes = "$installed"; then
  10070. if test -z "$install_libdir"; then
  10071. break
  10072. fi
  10073. output=$output_objdir/${outputname}i
  10074. # Replace all uninstalled libtool libraries with the installed ones
  10075. newdependency_libs=
  10076. for deplib in $dependency_libs; do
  10077. case $deplib in
  10078. *.la)
  10079. func_basename "$deplib"
  10080. name=$func_basename_result
  10081. func_resolve_sysroot "$deplib"
  10082. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
  10083. test -z "$libdir" && \
  10084. func_fatal_error "'$deplib' is not a valid libtool archive"
  10085. func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
  10086. ;;
  10087. -L*)
  10088. func_stripname -L '' "$deplib"
  10089. func_replace_sysroot "$func_stripname_result"
  10090. func_append newdependency_libs " -L$func_replace_sysroot_result"
  10091. ;;
  10092. -R*)
  10093. func_stripname -R '' "$deplib"
  10094. func_replace_sysroot "$func_stripname_result"
  10095. func_append newdependency_libs " -R$func_replace_sysroot_result"
  10096. ;;
  10097. *) func_append newdependency_libs " $deplib" ;;
  10098. esac
  10099. done
  10100. dependency_libs=$newdependency_libs
  10101. newdlfiles=
  10102. for lib in $dlfiles; do
  10103. case $lib in
  10104. *.la)
  10105. func_basename "$lib"
  10106. name=$func_basename_result
  10107. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  10108. test -z "$libdir" && \
  10109. func_fatal_error "'$lib' is not a valid libtool archive"
  10110. func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
  10111. ;;
  10112. *) func_append newdlfiles " $lib" ;;
  10113. esac
  10114. done
  10115. dlfiles=$newdlfiles
  10116. newdlprefiles=
  10117. for lib in $dlprefiles; do
  10118. case $lib in
  10119. *.la)
  10120. # Only pass preopened files to the pseudo-archive (for
  10121. # eventual linking with the app. that links it) if we
  10122. # didn't already link the preopened objects directly into
  10123. # the library:
  10124. func_basename "$lib"
  10125. name=$func_basename_result
  10126. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  10127. test -z "$libdir" && \
  10128. func_fatal_error "'$lib' is not a valid libtool archive"
  10129. func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
  10130. ;;
  10131. esac
  10132. done
  10133. dlprefiles=$newdlprefiles
  10134. else
  10135. newdlfiles=
  10136. for lib in $dlfiles; do
  10137. case $lib in
  10138. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  10139. *) abs=`pwd`"/$lib" ;;
  10140. esac
  10141. func_append newdlfiles " $abs"
  10142. done
  10143. dlfiles=$newdlfiles
  10144. newdlprefiles=
  10145. for lib in $dlprefiles; do
  10146. case $lib in
  10147. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  10148. *) abs=`pwd`"/$lib" ;;
  10149. esac
  10150. func_append newdlprefiles " $abs"
  10151. done
  10152. dlprefiles=$newdlprefiles
  10153. fi
  10154. $RM $output
  10155. # place dlname in correct position for cygwin
  10156. # In fact, it would be nice if we could use this code for all target
  10157. # systems that can't hard-code library paths into their executables
  10158. # and that have no shared library path variable independent of PATH,
  10159. # but it turns out we can't easily determine that from inspecting
  10160. # libtool variables, so we have to hard-code the OSs to which it
  10161. # applies here; at the moment, that means platforms that use the PE
  10162. # object format with DLL files. See the long comment at the top of
  10163. # tests/bindir.at for full details.
  10164. tdlname=$dlname
  10165. case $host,$output,$installed,$module,$dlname in
  10166. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
  10167. # If a -bindir argument was supplied, place the dll there.
  10168. if test -n "$bindir"; then
  10169. func_relative_path "$install_libdir" "$bindir"
  10170. tdlname=$func_relative_path_result/$dlname
  10171. else
  10172. # Otherwise fall back on heuristic.
  10173. tdlname=../bin/$dlname
  10174. fi
  10175. ;;
  10176. esac
  10177. $ECHO > $output "\
  10178. # $outputname - a libtool library file
  10179. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  10180. #
  10181. # Please DO NOT delete this file!
  10182. # It is necessary for linking the library.
  10183. # The name that we can dlopen(3).
  10184. dlname='$tdlname'
  10185. # Names of this library.
  10186. library_names='$library_names'
  10187. # The name of the static archive.
  10188. old_library='$old_library'
  10189. # Linker flags that cannot go in dependency_libs.
  10190. inherited_linker_flags='$new_inherited_linker_flags'
  10191. # Libraries that this one depends upon.
  10192. dependency_libs='$dependency_libs'
  10193. # Names of additional weak libraries provided by this library
  10194. weak_library_names='$weak_libs'
  10195. # Version information for $libname.
  10196. current=$current
  10197. age=$age
  10198. revision=$revision
  10199. # Is this an already installed library?
  10200. installed=$installed
  10201. # Should we warn about portability when linking against -modules?
  10202. shouldnotlink=$module
  10203. # Files to dlopen/dlpreopen
  10204. dlopen='$dlfiles'
  10205. dlpreopen='$dlprefiles'
  10206. # Directory that this library needs to be installed in:
  10207. libdir='$install_libdir'"
  10208. if test no,yes = "$installed,$need_relink"; then
  10209. $ECHO >> $output "\
  10210. relink_command=\"$relink_command\""
  10211. fi
  10212. done
  10213. }
  10214. # Do a symbolic link so that the libtool archive can be found in
  10215. # LD_LIBRARY_PATH before the program is installed.
  10216. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  10217. ;;
  10218. esac
  10219. exit $EXIT_SUCCESS
  10220. }
  10221. if test link = "$opt_mode" || test relink = "$opt_mode"; then
  10222. func_mode_link ${1+"$@"}
  10223. fi
  10224. # func_mode_uninstall arg...
  10225. func_mode_uninstall ()
  10226. {
  10227. $debug_cmd
  10228. RM=$nonopt
  10229. files=
  10230. rmforce=false
  10231. exit_status=0
  10232. # This variable tells wrapper scripts just to set variables rather
  10233. # than running their programs.
  10234. libtool_install_magic=$magic
  10235. for arg
  10236. do
  10237. case $arg in
  10238. -f) func_append RM " $arg"; rmforce=: ;;
  10239. -*) func_append RM " $arg" ;;
  10240. *) func_append files " $arg" ;;
  10241. esac
  10242. done
  10243. test -z "$RM" && \
  10244. func_fatal_help "you must specify an RM program"
  10245. rmdirs=
  10246. for file in $files; do
  10247. func_dirname "$file" "" "."
  10248. dir=$func_dirname_result
  10249. if test . = "$dir"; then
  10250. odir=$objdir
  10251. else
  10252. odir=$dir/$objdir
  10253. fi
  10254. func_basename "$file"
  10255. name=$func_basename_result
  10256. test uninstall = "$opt_mode" && odir=$dir
  10257. # Remember odir for removal later, being careful to avoid duplicates
  10258. if test clean = "$opt_mode"; then
  10259. case " $rmdirs " in
  10260. *" $odir "*) ;;
  10261. *) func_append rmdirs " $odir" ;;
  10262. esac
  10263. fi
  10264. # Don't error if the file doesn't exist and rm -f was used.
  10265. if { test -L "$file"; } >/dev/null 2>&1 ||
  10266. { test -h "$file"; } >/dev/null 2>&1 ||
  10267. test -f "$file"; then
  10268. :
  10269. elif test -d "$file"; then
  10270. exit_status=1
  10271. continue
  10272. elif $rmforce; then
  10273. continue
  10274. fi
  10275. rmfiles=$file
  10276. case $name in
  10277. *.la)
  10278. # Possibly a libtool archive, so verify it.
  10279. if func_lalib_p "$file"; then
  10280. func_source $dir/$name
  10281. # Delete the libtool libraries and symlinks.
  10282. for n in $library_names; do
  10283. func_append rmfiles " $odir/$n"
  10284. done
  10285. test -n "$old_library" && func_append rmfiles " $odir/$old_library"
  10286. case $opt_mode in
  10287. clean)
  10288. case " $library_names " in
  10289. *" $dlname "*) ;;
  10290. *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
  10291. esac
  10292. test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
  10293. ;;
  10294. uninstall)
  10295. if test -n "$library_names"; then
  10296. # Do each command in the postuninstall commands.
  10297. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
  10298. fi
  10299. if test -n "$old_library"; then
  10300. # Do each command in the old_postuninstall commands.
  10301. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
  10302. fi
  10303. # FIXME: should reinstall the best remaining shared library.
  10304. ;;
  10305. esac
  10306. fi
  10307. ;;
  10308. *.lo)
  10309. # Possibly a libtool object, so verify it.
  10310. if func_lalib_p "$file"; then
  10311. # Read the .lo file
  10312. func_source $dir/$name
  10313. # Add PIC object to the list of files to remove.
  10314. if test -n "$pic_object" && test none != "$pic_object"; then
  10315. func_append rmfiles " $dir/$pic_object"
  10316. fi
  10317. # Add non-PIC object to the list of files to remove.
  10318. if test -n "$non_pic_object" && test none != "$non_pic_object"; then
  10319. func_append rmfiles " $dir/$non_pic_object"
  10320. fi
  10321. fi
  10322. ;;
  10323. *)
  10324. if test clean = "$opt_mode"; then
  10325. noexename=$name
  10326. case $file in
  10327. *.exe)
  10328. func_stripname '' '.exe' "$file"
  10329. file=$func_stripname_result
  10330. func_stripname '' '.exe' "$name"
  10331. noexename=$func_stripname_result
  10332. # $file with .exe has already been added to rmfiles,
  10333. # add $file without .exe
  10334. func_append rmfiles " $file"
  10335. ;;
  10336. esac
  10337. # Do a test to see if this is a libtool program.
  10338. if func_ltwrapper_p "$file"; then
  10339. if func_ltwrapper_executable_p "$file"; then
  10340. func_ltwrapper_scriptname "$file"
  10341. relink_command=
  10342. func_source $func_ltwrapper_scriptname_result
  10343. func_append rmfiles " $func_ltwrapper_scriptname_result"
  10344. else
  10345. relink_command=
  10346. func_source $dir/$noexename
  10347. fi
  10348. # note $name still contains .exe if it was in $file originally
  10349. # as does the version of $file that was added into $rmfiles
  10350. func_append rmfiles " $odir/$name $odir/${name}S.$objext"
  10351. if test yes = "$fast_install" && test -n "$relink_command"; then
  10352. func_append rmfiles " $odir/lt-$name"
  10353. fi
  10354. if test "X$noexename" != "X$name"; then
  10355. func_append rmfiles " $odir/lt-$noexename.c"
  10356. fi
  10357. fi
  10358. fi
  10359. ;;
  10360. esac
  10361. func_show_eval "$RM $rmfiles" 'exit_status=1'
  10362. done
  10363. # Try to remove the $objdir's in the directories where we deleted files
  10364. for dir in $rmdirs; do
  10365. if test -d "$dir"; then
  10366. func_show_eval "rmdir $dir >/dev/null 2>&1"
  10367. fi
  10368. done
  10369. exit $exit_status
  10370. }
  10371. if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
  10372. func_mode_uninstall ${1+"$@"}
  10373. fi
  10374. test -z "$opt_mode" && {
  10375. help=$generic_help
  10376. func_fatal_help "you must specify a MODE"
  10377. }
  10378. test -z "$exec_cmd" && \
  10379. func_fatal_help "invalid operation mode '$opt_mode'"
  10380. if test -n "$exec_cmd"; then
  10381. eval exec "$exec_cmd"
  10382. exit $EXIT_FAILURE
  10383. fi
  10384. exit $exit_status
  10385. # The TAGs below are defined such that we never get into a situation
  10386. # where we disable both kinds of libraries. Given conflicting
  10387. # choices, we go for a static library, that is the most portable,
  10388. # since we can't tell whether shared libraries were disabled because
  10389. # the user asked for that or because the platform doesn't support
  10390. # them. This is particularly important on AIX, because we don't
  10391. # support having both static and shared libraries enabled at the same
  10392. # time on that platform, so we default to a shared-only configuration.
  10393. # If a disable-shared tag is given, we'll fallback to a static-only
  10394. # configuration. But we'll never go from static-only to shared-only.
  10395. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  10396. build_libtool_libs=no
  10397. build_old_libs=yes
  10398. # ### END LIBTOOL TAG CONFIG: disable-shared
  10399. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  10400. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  10401. # ### END LIBTOOL TAG CONFIG: disable-static
  10402. # Local Variables:
  10403. # mode:shell-script
  10404. # sh-indentation:2
  10405. # End:
  10406. # ### BEGIN LIBTOOL TAG CONFIG: CXX
  10407. # The linker used to build libraries.
  10408. LD="/usr/bin/x86_64-linux-gnu-ld -m elf_x86_64"
  10409. # How to create reloadable object files.
  10410. reload_flag=" -r"
  10411. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10412. # Commands used to build an old-style archive.
  10413. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10414. # A language specific compiler.
  10415. CC="g++"
  10416. # Is the compiler the GNU compiler?
  10417. with_gcc=yes
  10418. # Compiler flag to turn off builtin functions.
  10419. no_builtin_flag=" -fno-builtin"
  10420. # Additional compiler flags for building library objects.
  10421. pic_flag=" -fPIC -DPIC"
  10422. # How to pass a linker flag through the compiler.
  10423. wl="-Wl,"
  10424. # Compiler flag to prevent dynamic linking.
  10425. link_static_flag="-static"
  10426. # Does compiler simultaneously support -c and -o options?
  10427. compiler_c_o="yes"
  10428. # Whether or not to add -lc for building shared libraries.
  10429. build_libtool_need_lc=no
  10430. # Whether or not to disallow shared libs when runtime libs are static.
  10431. allow_libtool_libs_with_static_runtimes=no
  10432. # Compiler flag to allow reflexive dlopens.
  10433. export_dynamic_flag_spec="\$wl--export-dynamic"
  10434. # Compiler flag to generate shared objects directly from archives.
  10435. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  10436. # Whether the compiler copes with passing no objects directly.
  10437. compiler_needs_object="no"
  10438. # Create an old-style archive from a shared archive.
  10439. old_archive_from_new_cmds=""
  10440. # Create a temporary old-style archive to link instead of a shared archive.
  10441. old_archive_from_expsyms_cmds=""
  10442. # Commands used to build a shared archive.
  10443. archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  10444. 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"
  10445. # Commands used to build a loadable module if different from building
  10446. # a shared archive.
  10447. module_cmds=""
  10448. module_expsym_cmds=""
  10449. # Whether we are building with GNU ld or not.
  10450. with_gnu_ld="yes"
  10451. # Flag that allows shared libraries with undefined symbols to be built.
  10452. allow_undefined_flag=""
  10453. # Flag that enforces no undefined symbols.
  10454. no_undefined_flag=""
  10455. # Flag to hardcode $libdir into a binary during linking.
  10456. # This must work even if $libdir does not exist
  10457. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  10458. # Whether we need a single "-rpath" flag with a separated argument.
  10459. hardcode_libdir_separator=""
  10460. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10461. # DIR into the resulting binary.
  10462. hardcode_direct=no
  10463. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10464. # DIR into the resulting binary and the resulting library dependency is
  10465. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10466. # library is relocated.
  10467. hardcode_direct_absolute=no
  10468. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10469. # into the resulting binary.
  10470. hardcode_minus_L=no
  10471. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10472. # into the resulting binary.
  10473. hardcode_shlibpath_var=unsupported
  10474. # Set to "yes" if building a shared library automatically hardcodes DIR
  10475. # into the library and all subsequent libraries and executables linked
  10476. # against it.
  10477. hardcode_automatic=no
  10478. # Set to yes if linker adds runtime paths of dependent libraries
  10479. # to runtime path list.
  10480. inherit_rpath=no
  10481. # Whether libtool must link a program against all its dependency libraries.
  10482. link_all_deplibs=no
  10483. # Set to "yes" if exported symbols are required.
  10484. always_export_symbols=no
  10485. # The commands to list exported symbols.
  10486. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  10487. # Symbols that should not be listed in the preloaded symbols.
  10488. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  10489. # Symbols that must always be exported.
  10490. include_expsyms=""
  10491. # Commands necessary for linking programs (against libraries) with templates.
  10492. prelink_cmds=""
  10493. # Commands necessary for finishing linking programs.
  10494. postlink_cmds=""
  10495. # Specify filename containing input files.
  10496. file_list_spec=""
  10497. # How to hardcode a shared library path into an executable.
  10498. hardcode_action=immediate
  10499. # The directories searched by this compiler when creating a shared library.
  10500. compiler_lib_search_dirs="/usr/lib/gcc/x86_64-linux-gnu/7 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/7/../../.."
  10501. # Dependencies to place before and after the objects being linked to
  10502. # create a shared library.
  10503. predep_objects="/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o"
  10504. postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o"
  10505. predeps=""
  10506. postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
  10507. # The library search path used internally by the compiler when linking
  10508. # a shared library.
  10509. compiler_lib_search_path="-L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.."
  10510. # ### END LIBTOOL TAG CONFIG: CXX