libtool 304 KB

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