123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937 |
- --- fakeroot-1.8.1/ltmain.sh 2007-10-08 02:27:58.000000000 +0200
- +++ fakeroot-1.8.1.works/ltmain.sh 2007-10-10 09:46:24.000000000 +0200
- @@ -1,32 +1,30 @@
- # Generated from ltmain.m4sh; do not edit by hand
-
- -# ltmain.sh (GNU libtool 1.2460 2007/05/10 17:30:29) 2.1a
- +# ltmain.sh (GNU libtool 1.2237 2005/12/21 11:40:47) 2.1a
- # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
- +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
- # This is free software; see the source for copying conditions. There is NO
- # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- -# GNU Libtool is free software; you can redistribute it and/or modify
- +# This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- -# As a special exception to the GNU General Public License,
- -# if you distribute this file as part of a program or library that
- -# is built using GNU Libtool, you may include this file under the
- -# same distribution terms that you use for the rest of that program.
- -#
- -# GNU Libtool is distributed in the hope that it will be useful, but
- +# This program is distributed in the hope that it will be useful, but
- # WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- # General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- -# along with GNU Libtool; see the file COPYING. If not, a copy
- -# can be downloaded from http://www.gnu.org/licenses/gpl.html,
- -# or obtained by writing to the Free Software Foundation, Inc.,
- -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- +# along with this program; if not, write to the Free Software
- +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- +#
- +# As a special exception to the GNU General Public License, if you
- +# distribute this file as part of a program that contains a
- +# configuration script generated by Autoconf, you may include it under
- +# the same distribution terms that you use for the rest of that program.
-
- # Usage: $progname [OPTION]... [MODE-ARG]...
- #
- @@ -60,12 +58,12 @@
- # When reporting a bug, please describe a test case to reproduce it and
- # include the following information:
- #
- -# host-triplet: $host
- +# host-triplet: i486-pc-linux-gnu
- # shell: $SHELL
- # compiler: $LTCC
- # compiler flags: $LTCFLAGS
- # linker: $LD (gnu? $with_gnu_ld)
- -# $progname: (GNU libtool 1.2460 2007/05/10 17:30:29) 2.1a Debian-1
- +# $progname: (GNU libtool 1.2237 2005/12/21 11:40:47) 2.1a
- # automake: $automake_version
- # autoconf: $autoconf_version
- #
- @@ -73,10 +71,14 @@
-
- PROGRAM=ltmain.sh
- PACKAGE=libtool
- -VERSION="2.1a Debian-1"
- -TIMESTAMP=" 1.2460 2007/05/10 17:30:29"
- +VERSION="2.1a"
- +TIMESTAMP=" 1.2460 2005/12/21 11:40:47"
- package_revision=1.2460
-
- +## --------------------- ##
- +## M4sh Initialization. ##
- +## --------------------- ##
- +
- # Be Bourne compatible
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- @@ -84,37 +86,74 @@ if test -n "${ZSH_VERSION+set}" && (emul
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- - setopt NO_GLOB_SUBST
- -else
- - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
- +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- + set -o posix
- fi
- -BIN_SH=xpg4; export BIN_SH # for Tru64
- DUALCASE=1; export DUALCASE # for MKS sh
-
- -# NLS nuisances: We save the old values to restore during execute mode.
- -# Only set LANG and LC_ALL to C if already set.
- -# These must not be set unconditionally because not all systems understand
- -# e.g. LANG=C (notably SCO).
- -for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- +# Support unset when possible.
- +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- + as_unset=unset
- +else
- + as_unset=false
- +fi
- +
- +
- +# Work around bugs in pre-3.0 UWIN ksh.
- +$as_unset ENV MAIL MAILPATH
- +PS1='$ '
- +PS2='> '
- +PS4='+ '
- +
- +# NLS nuisances.
- +for as_var in \
- + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
- + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
- + LC_TELEPHONE LC_TIME
- do
- - eval "if test \"\${$lt_var+set}\" = set; then
- - save_$lt_var=\$$lt_var
- - $lt_var=C
- - export $lt_var
- - fi"
- + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
- + eval $as_var=C; export $as_var
- + else
- + $as_unset $as_var
- + fi
- done
-
- -$lt_unset CDPATH
- +# Required to use basename.
- +if expr a : '\(a\)' >/dev/null 2>&1; then
- + as_expr=expr
- +else
- + as_expr=false
- +fi
- +
- +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
- + as_basename=basename
- +else
- + as_basename=false
- +fi
- +
-
- +# Name of the executable.
- +as_me=`$as_basename "$0" ||
- +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- + X"$0" : 'X\(//\)$' \| \
- + X"$0" : 'X\(/\)$' \| \
- + . : '\(.\)' 2>/dev/null ||
- +echo X/"$0" |
- + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- + /^X\/\(\/\/\)$/{ s//\1/; q; }
- + /^X\/\(\/\).*/{ s//\1/; q; }
- + s/.*/./; q'`
-
-
- +$as_unset CDPATH
- +
-
-
- : ${CP="cp -f"}
- : ${ECHO="echo"}
- -: ${EGREP="/bin/grep -E"}
- -: ${FGREP="/bin/grep -F"}
- -: ${GREP="/bin/grep"}
- +: ${EGREP="grep -E"}
- +: ${FGREP="grep -F"}
- +: ${GREP="grep"}
- : ${LN_S="ln -s"}
- : ${MAKE="make"}
- : ${MKDIR="mkdir"}
- @@ -185,17 +224,23 @@ double_quote_subst='s/\(["`\\]\)/\\\1/g'
- # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
- # in input to double_quote_subst, that '$' was protected from expansion.
- # Since each input `\' is now two `\'s, look for any number of runs of
- -# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
- -bs='\\'
- -bs2='\\\\'
- -bs4='\\\\\\\\'
- -dollar='\$'
- -sed_double_backslash="\
- - s/$bs4/&\\
- -/g
- - s/^$bs2$dollar/$bs&/
- - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- - s/\n//g"
- +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. Note
- +# that the embedded single quotes serve only to enhance readability.
- +sed_double_backslash='s/^\(\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/;
- + s/\([^\\]\(''\\\\''\\\\''\)*''\\\\''\)\$/\1\\$/g'
- +
- +# test EBCDIC or ASCII
- +case `echo X|tr X '\101'` in
- + A) # ASCII based system
- + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- + SP2NL='tr \040 \012'
- + NL2SP='tr \015\012 \040\040'
- + ;;
- + *) # EBCDIC based system
- + SP2NL='tr \100 \n'
- + NL2SP='tr \r\n \100\100'
- + ;;
- +esac
-
- # Standard options:
- opt_dry_run=false
- @@ -208,7 +253,7 @@ opt_verbose=false
- # name if it has been set yet.
- func_echo ()
- {
- - $ECHO "$progname${mode+: }$mode: $*"
- + $ECHO "$progname${mode+: }$mode: "${1+"$@"}
- }
-
- # func_verbose arg...
- @@ -425,18 +470,14 @@ func_show_eval ()
- }
-
-
- -
- -
- -
- # func_version
- # Echo version message to standard output and exit.
- func_version ()
- {
- $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
- - s/^# //
- - s/^# *$//
- - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- - p
- + s/^# //; s/^# *$//;
- + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/;
- + p;
- }' < "$progpath"
- exit $?
- }
- @@ -446,10 +487,9 @@ func_version ()
- func_usage ()
- {
- $SED -n '/^# Usage:/,/# -h/ {
- - s/^# //
- - s/^# *$//
- - s/\$progname/'$progname'/
- - p
- + s/^# //; s/^# *$//;
- + s/\$progname/'$progname'/;
- + p;
- }' < "$progpath"
- $ECHO
- $ECHO "run \`$progname --help | more' for full usage"
- @@ -461,18 +501,16 @@ func_usage ()
- func_help ()
- {
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- - s/^# //
- - s/^# *$//
- - s*\$progname*'$progname'*
- - s*\$host*'"$host"'*
- - s*\$SHELL*'"$SHELL"'*
- - s*\$LTCC*'"$LTCC"'*
- - s*\$LTCFLAGS*'"$LTCFLAGS"'*
- - s*\$LD*'"$LD"'*
- - s/\$with_gnu_ld/'"$with_gnu_ld"'/
- - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
- - p
- + s/^# //; s/^# *$//;
- + s*\$progname*'$progname'*;
- + s*\$SHELL*'"$SHELL"'*;
- + s*\$LTCC*'"$LTCC"'*;
- + s*\$LTCFLAGS*'"$LTCFLAGS"'*;
- + s*\$LD*'"$LD"'*;
- + s/\$with_gnu_ld/'"$with_gnu_ld"'/;
- + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/;
- + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/;
- + p;
- }' < "$progpath"
- exit $?
- }
- @@ -489,9 +527,6 @@ func_missing_arg ()
- exit_cmd=:
-
-
- -
- -
- -
- # Check that we have a working $ECHO.
- if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- @@ -526,8 +561,6 @@ execute_dlfiles=
- preserve_args=
- lo2o="s/\\.lo\$/.${objext}/"
- o2lo="s/\\.${objext}\$/.lo/"
- -extracted_archives=
- -extracted_serial=0
-
- opt_dry_run=false
- opt_duplicate_deps=false
- @@ -743,9 +776,9 @@ The following components of LINK-COMMAND
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- - try to export only the symbols listed in SYMFILE
- + try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- - try to export only the symbols matching REGEX
- + try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- @@ -761,11 +794,9 @@ The following components of LINK-COMMAND
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -shared only do dynamic linking of libtool libraries
- -shrext SUFFIX override the standard shared library file extension
- - -static do not do any dynamic linking of uninstalled libtool libraries
- - -static-libtool-libs
- - do not do any dynamic linking of libtool libraries
- + -static do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- - specify library version info [each variable defaults to 0]
- + specify library version info [each variable defaults to 0]
- -weak LIBNAME declare that the target provides the LIBNAME interface
-
- All other options (arguments beginning with \`-') are ignored.
- @@ -810,12 +841,15 @@ Otherwise, only FILE itself is deleted u
- exit $?
- }
-
- -# Generated shell functions inserted here.
- -
- -
- +# TEST SUITE MARKER ## NON-FUNCTION
- # Parse options once, thoroughly. This comes as soon as possible in
- # the script to make things like `libtool --version' happen quickly.
- {
- + # sed scripts:
- + my_sed_single_opt='1s/^\(..\).*$/\1/;q'
- + my_sed_single_rest='1s/^..\(.*\)$/\1/;q'
- + my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
- + my_sed_long_arg='1s/^-[^=]*=//'
-
- # Shorthand for --mode=foo, only valid as the first argument
- case $1 in
- @@ -907,11 +941,28 @@ Otherwise, only FILE itself is deleted u
-
- # Separate optargs to long options:
- -dlopen=*|--mode=*|--tag=*)
- - func_opt_split "$opt"
- - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
- + arg=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_arg"`
- + opt=`$ECHO "X$opt" | $Xsed -e "$my_sed_long_opt"`
- + set dummy "$opt" "$arg" ${1+"$@"}
- shift
- ;;
-
- + # Separate optargs to short options:
- +# -x*|-y*)
- +# arg=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
- +# opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
- +# set dummy "$opt" "$arg" ${1+"$@"}
- +# shift
- +# ;;
- +
- + # Separate non-argument short options:
- +# -z*|-z*|-y*)
- +# rest=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_rest"`
- +# opt=`$ECHO "X$opt" |$Xsed -e "$my_sed_single_opt"`
- +# set dummy "$opt" "-$rest" ${1+"$@"}
- +# shift
- +# ;;
- +
- -\?|-h) func_usage ;;
- --help) opt_help=: ;;
- --version) func_version ;;
- @@ -941,6 +992,7 @@ Otherwise, only FILE itself is deleted u
- # anything was wrong.
- $exit_cmd $EXIT_FAILURE
- }
- +# TEST SUITE MARKER ## BEGIN SOURCABLE
-
- # func_check_version_match
- # Ensure that we are using m4 macros, and libtool script from the same
- @@ -978,38 +1030,6 @@ _LT_EOF
- }
-
-
- -## ----------- ##
- -## Main. ##
- -## ----------- ##
- -
- -{
- - # Sanity checks first:
- - func_check_version_match
- -
- - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- - func_fatal_configuration "not configured to build any kind of library"
- - fi
- -
- - test -z "$mode" && func_fatal_error "error: you must specify a MODE."
- -
- -
- - # Darwin sucks
- - eval std_shrext=\"$shrext_cmds\"
- -
- -
- - # Only execute mode is allowed to have -dlopen flags.
- - if test -n "$execute_dlfiles" && test "$mode" != execute; then
- - func_error "unrecognized option \`-dlopen'"
- - $ECHO "$help" 1>&2
- - exit $EXIT_FAILURE
- - fi
- -
- - # Change the help message to a mode-specific one.
- - generic_help="$help"
- - help="Try \`$progname --help --mode=$mode' for more information."
- -}
- -
- -
- # func_lalib_p file
- # True iff FILE is a libtool `.la' library or `.lo' object file.
- # This function is only a basic sanity check; it will hardly flush out
- @@ -1086,6 +1106,9 @@ func_source ()
- }
-
-
- +# Generated shell functions inserted here.
- +
- +
- # func_win32_libid arg
- # return the library type of file 'arg'
- #
- @@ -1105,14 +1128,7 @@ func_win32_libid ()
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 |
- - $SED -n -e '
- - 1,100{
- - / I /{
- - s,.*,import,
- - p
- - q
- - }
- - }'`
- + $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- @@ -1332,33 +1348,31 @@ extern \"C\" {
- $ECHO >> "$output_objdir/$my_dlsyms" "\
-
- /* The mapping between symbol names and symbols. */
- -typedef struct {
- - const char *name;
- - void *address;
- -} lt_dlsymlist;
- "
- case $host in
- *cygwin* | *mingw* )
- $ECHO >> "$output_objdir/$my_dlsyms" "\
- /* DATA imports from DLLs on WIN32 con't be const, because
- runtime relocations are performed -- see ld's documentation
- - on pseudo-relocs. */"
- - lt_dlsym_const= ;;
- - *osf5*)
- - echo >> "$output_objdir/$my_dlsyms" "\
- -/* This system does not cope well with relocations in const data */"
- - lt_dlsym_const= ;;
- + on pseudo-relocs. */
- + struct {
- +"
- + ;;
- *)
- - lt_dlsym_const=const ;;
- + $ECHO >> "$output_objdir/$my_dlsyms" "\
- +const struct {
- +"
- + ;;
- esac
-
- $ECHO >> "$output_objdir/$my_dlsyms" "\
- -extern $lt_dlsym_const lt_dlsymlist
- -lt_${my_prefix}_LTX_preloaded_symbols[];
- -$lt_dlsym_const lt_dlsymlist
- + const char *name;
- + void *address;
- +}
- lt_${my_prefix}_LTX_preloaded_symbols[] =
- {\
- - { \"$my_originator\", (void *) 0 },"
- + { \"$my_originator\", (void *) 0 },
- +"
-
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
-
- @@ -1482,17 +1496,7 @@ func_extract_archives ()
- esac
- func_basename "$my_xlib"
- my_xlib="$func_basename_result"
- - my_xlib_u=$my_xlib
- - while :; do
- - case " $extracted_archives " in
- - *" $my_xlib_u "*)
- - extracted_serial=`expr $extracted_serial + 1`
- - my_xlib_u=lt$extracted_serial-$my_xlib ;;
- - *) break ;;
- - esac
- - done
- - extracted_archives="$extracted_archives $my_xlib_u"
- - my_xdir="$my_gentop/$my_xlib_u"
- + my_xdir="$my_gentop/$my_xlib"
-
- func_mkdir_p "$my_xdir"
-
- @@ -1546,44 +1550,6 @@ func_extract_archives ()
- }
-
-
- -
- -# func_write_libtool_object output_name pic_name nonpic_name
- -# Create a libtool object file (analogous to a ".la" file),
- -# but don't create it if we're doing a dry run.
- -func_write_libtool_object ()
- -{
- - write_libobj=${1}
- - if test "$build_libtool_libs" = yes; then
- - write_lobj=\'${2}\'
- - else
- - write_lobj=none
- - fi
- -
- - if test "$build_old_libs" = yes; then
- - write_oldobj=\'${3}\'
- - else
- - write_oldobj=none
- - fi
- -
- - $opt_dry_run || {
- - cat >${write_libobj}T <<EOF
- -# $write_libobj - a libtool object file
- -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
- -#
- -# Please DO NOT delete this file!
- -# It is necessary for linking the library.
- -
- -# Name of the PIC object.
- -pic_object=$write_lobj
- -
- -# Name of the non-PIC object
- -non_pic_object=$write_oldobj
- -
- -EOF
- - mv -f "${write_libobj}T" "${write_libobj}"
- - }
- -}
- -
- # func_mode_compile arg...
- func_mode_compile ()
- {
- @@ -1708,16 +1674,15 @@ func_mode_compile ()
- *.class) xform=class ;;
- *.cpp) xform=cpp ;;
- *.cxx) xform=cxx ;;
- - *.[fF][09]?) xform='[fF][09].' ;;
- + *.f90) xform=f90 ;;
- *.for) xform=for ;;
- *.java) xform=java ;;
- - *.obj) xform=obj ;;
- esac
-
- libobj=`$ECHO "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
- case $libobj in
- - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
- + *.lo) obj=`$ECHO "X$libobj" | $Xsed -e "$lo2o"` ;;
- *)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
- ;;
- @@ -1833,6 +1798,18 @@ compiler."
-
- $opt_dry_run || $RM "$libobj" "${libobj}T"
-
- + # Create a libtool object file (analogous to a ".la" file),
- + # but don't create it if we're doing a dry run.
- + $opt_dry_run || cat > ${libobj}T <<EOF
- +# $libobj - a libtool object file
- +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
- +#
- +# Please DO NOT delete this file!
- +# It is necessary for linking the library.
- +
- +# Name of the PIC object.
- +EOF
- +
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- @@ -1883,10 +1860,23 @@ compiler."
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
-
- + # Append the name of the PIC object to the libtool object file.
- + $opt_dry_run || cat >> ${libobj}T <<EOF
- +pic_object='$objdir/$objname'
- +
- +EOF
- +
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- + else
- + # No PIC object so indicate it doesn't exist in the libtool
- + # object file.
- + $opt_dry_run || cat >> ${libobj}T <<EOF
- +pic_object=none
- +
- +EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- @@ -1932,10 +1922,26 @@ compiler."
- func_show_eval '$MV "$output_obj" "$obj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
- +
- + # Append the name of the non-PIC object the libtool object file.
- + # Only append if the libtool object file exists.
- + $opt_dry_run || cat >> ${libobj}T <<EOF
- +# Name of the non-PIC object.
- +non_pic_object='$objname'
- +
- +EOF
- + else
- + # Append the name of the non-PIC object the libtool object file.
- + # Only append if the libtool object file exists.
- + $opt_dry_run || cat >> ${libobj}T <<EOF
- +# Name of the non-PIC object.
- +non_pic_object=none
- +
- +EOF
- fi
-
- $opt_dry_run || {
- - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
- + $MV "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- @@ -1946,8 +1952,6 @@ compiler."
- exit $EXIT_SUCCESS
- }
-
- -test "$mode" = compile && func_mode_compile ${1+"$@"}
- -
-
- # func_mode_execute arg...
- func_mode_execute ()
- @@ -1989,9 +1993,7 @@ func_mode_execute ()
- if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
- else
- - if test ! -f "$dir/$dlname"; then
- - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
- - fi
- + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
- fi
- ;;
-
- @@ -2051,14 +2053,12 @@ func_mode_execute ()
- fi
-
- # Restore saved environment variables
- - for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- - do
- - eval "if test \"\${save_$lt_var+set}\" = set; then
- - $lt_var=\$save_$lt_var; export $lt_var
- - else
- - $lt_unset $lt_var
- - fi"
- - done
- + if test "${save_LC_ALL+set}" = set; then
- + LC_ALL="$save_LC_ALL"; export LC_ALL
- + fi
- + if test "${save_LANG+set}" = set; then
- + LANG="$save_LANG"; export LANG
- + fi
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- @@ -2073,8 +2073,6 @@ func_mode_execute ()
- fi
- }
-
- -test "$mode" = execute && func_mode_execute ${1+"$@"}
- -
-
- # func_mode_finish arg...
- func_mode_finish ()
- @@ -2153,8 +2151,6 @@ func_mode_finish ()
- exit $EXIT_SUCCESS
- }
-
- -test "$mode" = finish && func_mode_finish ${1+"$@"}
- -
-
- # func_mode_install arg...
- func_mode_install ()
- @@ -2414,8 +2410,7 @@ func_mode_install ()
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- - func_lo2o "$destfile"
- - staticdest=$func_lo2o_result
- + staticdest=`$ECHO "X$destfile" | $Xsed -e "$lo2o"`
- ;;
- *.$objext)
- staticdest="$destfile"
- @@ -2433,8 +2428,7 @@ func_mode_install ()
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- - func_lo2o "$file"
- - staticobj=$func_lo2o_result
- + staticobj=`$ECHO "X$file" | $Xsed -e "$lo2o"`
- func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
- fi
- exit $EXIT_SUCCESS
- @@ -2588,3330 +2582,3377 @@ func_mode_install ()
- fi
- }
-
- -test "$mode" = install && func_mode_install ${1+"$@"}
-
- -
- -# func_emit_libtool_wrapper_script
- -# emit a libtool wrapper script on stdout
- -# don't directly open a file because we may want to
- -# incorporate the script contents within a cygwin/mingw
- -# wrapper executable. Must ONLY be called from within
- -# func_mode_link because it depends on a number of variable
- -# set therein.
- -func_emit_libtool_wrapper_script ()
- +# func_mode_link arg...
- +func_mode_link ()
- {
- - $ECHO "\
- -#! $SHELL
- + $opt_debug
- + case $host in
- + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- + # It is impossible to link a dll without this setting, and
- + # we shouldn't force the makefile maintainer to figure out
- + # which system we are compiling for in order to pass an extra
- + # flag for every libtool invocation.
- + # allow_undefined=no
-
- -# $output - temporary wrapper script for $objdir/$outputname
- -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
- -#
- -# The $output program cannot be directly executed until all the libtool
- -# libraries that it depends on are installed.
- -#
- -# This wrapper script should never be moved out of the build directory.
- -# If it is, it will not operate correctly.
- + # FIXME: Unfortunately, there are problems with the above when trying
- + # to make a dll which has undefined symbols, in which case not
- + # even a static library is built. For now, we need to specify
- + # -no-undefined on the libtool link line when we can be certain
- + # that all symbols are satisfied, otherwise we get a static library.
- + allow_undefined=yes
- + ;;
- + *)
- + allow_undefined=yes
- + ;;
- + esac
- + libtool_args="$nonopt"
- + base_compile="$nonopt $@"
- + compile_command="$nonopt"
- + finalize_command="$nonopt"
-
- -# Sed substitution that helps us do robust quoting. It backslashifies
- -# metacharacters that are still active within double-quoted strings.
- -Xsed='${SED} -e 1s/^X//'
- -sed_quote_subst='$sed_quote_subst'
- + compile_rpath=
- + finalize_rpath=
- + compile_shlibpath=
- + finalize_shlibpath=
- + convenience=
- + old_convenience=
- + deplibs=
- + old_deplibs=
- + compiler_flags=
- + linker_flags=
- + dllsearchpath=
- + lib_search_path=`pwd`
- + inst_prefix_dir=
- + new_inherited_linker_flags=
-
- -# Be Bourne compatible
- -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- - emulate sh
- - NULLCMD=:
- - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- - # is contrary to our usage. Disable this feature.
- - alias -g '\${1+\"\$@\"}'='\"\$@\"'
- - setopt NO_GLOB_SUBST
- -else
- - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
- -fi
- -BIN_SH=xpg4; export BIN_SH # for Tru64
- -DUALCASE=1; export DUALCASE # for MKS sh
- + avoid_version=no
- + dlfiles=
- + dlprefiles=
- + dlself=no
- + export_dynamic=no
- + export_symbols=
- + export_symbols_regex=
- + generated=
- + libobjs=
- + ltlibs=
- + module=no
- + no_install=no
- + objs=
- + non_pic_objects=
- + precious_files_regex=
- + prefer_static_libs=no
- + preload=no
- + prev=
- + prevarg=
- + release=
- + rpath=
- + xrpath=
- + perm_rpath=
- + temp_rpath=
- + thread_safe=no
- + vinfo=
- + vinfo_number=no
- + weak_libs=
- + single_module="${wl}-single_module"
- + func_infer_tag $base_compile
-
- -# The HP-UX ksh and POSIX shell print the target directory to stdout
- -# if CDPATH is set.
- -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
- + # We need to know -static, to get the right output filenames.
- + for arg
- + do
- + case $arg in
- + -shared)
- + test "$build_libtool_libs" != yes && \
- + func_fatal_configuration "can not build a shared library"
- + build_old_libs=no
- + break
- + ;;
- + -all-static | -static)
- + if test "X$arg" = "X-all-static"; then
- + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- + func_warning "complete static linking is impossible in this configuration"
- + fi
- + if test -n "$link_static_flag"; then
- + dlopen_self=$dlopen_self_static
- + # See comment for -static flag below, for more details.
- + compile_command="$compile_command $link_static_flag"
- + finalize_command="$finalize_command $link_static_flag"
- + fi
- + prefer_static_libs=yes
- + else
- + if test -z "$pic_flag" && test -n "$link_static_flag"; then
- + dlopen_self=$dlopen_self_static
- + fi
- + prefer_static_libs=built
- + fi
- + build_libtool_libs=no
- + build_old_libs=yes
- + break
- + ;;
- + esac
- + done
-
- -relink_command=\"$relink_command\"
- + # See if our shared archives depend on static archives.
- + test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- -# This environment variable determines our operation mode.
- -if test \"\$libtool_install_magic\" = \"$magic\"; then
- - # install mode needs the following variables:
- - generated_by_libtool_version='$macro_version'
- - notinst_deplibs='$notinst_deplibs'
- -else
- - # When we are sourced in execute mode, \$file and \$ECHO are already set.
- - if test \"\$libtool_execute_magic\" != \"$magic\"; then
- - ECHO=\"$qecho\"
- - file=\"\$0\"
- - # Make sure echo works.
- - if test \"X\$1\" = X--no-reexec; then
- - # Discard the --no-reexec flag, and continue.
- + # Go through the arguments, transforming them on the way.
- + while test "$#" -gt 0; do
- + arg="$1"
- shift
- - elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
- - # Yippee, \$ECHO works!
- - :
- - else
- - # Restart under the correct shell, and then maybe \$ECHO will work.
- - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- - fi
- - fi\
- -"
- - $ECHO "\
- -
- - # Find the directory that this script lives in.
- - thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
- - test \"x\$thisdir\" = \"x\$file\" && thisdir=.
- -
- - # Follow symbolic links until we get to the real thisdir.
- - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
- - while test -n \"\$file\"; do
- - destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
- -
- - # If there was a directory component, then change thisdir.
- - if test \"x\$destdir\" != \"x\$file\"; then
- - case \"\$destdir\" in
- - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- - *) thisdir=\"\$thisdir/\$destdir\" ;;
- - esac
- - fi
- -
- - file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
- - done
- -
- - # Try to get the absolute directory name.
- - absdir=\`cd \"\$thisdir\" && pwd\`
- - test -n \"\$absdir\" && thisdir=\"\$absdir\"
- -"
- -
- - if test "$fast_install" = yes; then
- - $ECHO "\
- - program=lt-'$outputname'$exeext
- - progdir=\"\$thisdir/$objdir\"
- + func_quote_for_eval "$arg"
- + qarg="$func_quote_for_eval_unquoted_result"
- + libtool_args="$libtool_args $func_quote_for_eval_result"
-
- - if test ! -f \"\$progdir/\$program\" ||
- - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- - test \"X\$file\" != \"X\$progdir/\$program\"; }; then
- + # If the previous option needs an argument, assign it.
- + if test -n "$prev"; then
- + case $prev in
- + output)
- + compile_command="$compile_command @OUTPUT@"
- + finalize_command="$finalize_command @OUTPUT@"
- + ;;
- + esac
-
- - file=\"\$\$-\$program\"
- + case $prev in
- + dlfiles|dlprefiles)
- + if test "$preload" = no; then
- + # Add the symbol object into the linking commands.
- + compile_command="$compile_command @SYMFILE@"
- + finalize_command="$finalize_command @SYMFILE@"
- + preload=yes
- + fi
- + case $arg in
- + *.la | *.lo) ;; # We handle these cases below.
- + force)
- + if test "$dlself" = no; then
- + dlself=needless
- + export_dynamic=yes
- + fi
- + prev=
- + continue
- + ;;
- + self)
- + if test "$prev" = dlprefiles; then
- + dlself=yes
- + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- + dlself=yes
- + else
- + dlself=needless
- + export_dynamic=yes
- + fi
- + prev=
- + continue
- + ;;
- + *)
- + if test "$prev" = dlfiles; then
- + dlfiles="$dlfiles $arg"
- + else
- + dlprefiles="$dlprefiles $arg"
- + fi
- + prev=
- + continue
- + ;;
- + esac
- + ;;
- + expsyms)
- + export_symbols="$arg"
- + test -f "$arg" \
- + || func_fatal_error "symbol file \`$arg' does not exist"
- + prev=
- + continue
- + ;;
- + expsyms_regex)
- + export_symbols_regex="$arg"
- + prev=
- + continue
- + ;;
- + framework)
- + case $host in
- + *-*-darwin*)
- + case "$deplibs " in
- + *" $qarg.ltframework "*) ;;
- + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
- + ;;
- + esac
- + ;;
- + esac
- + prev=
- + continue
- + ;;
- + inst_prefix)
- + inst_prefix_dir="$arg"
- + prev=
- + continue
- + ;;
- + objectlist)
- + if test -f "$arg"; then
- + save_arg=$arg
- + moreargs=
- + for fil in `cat "$save_arg"`
- + do
- +# moreargs="$moreargs $fil"
- + arg=$fil
- + # A libtool-controlled object.
-
- - if test ! -d \"\$progdir\"; then
- - $MKDIR \"\$progdir\"
- - else
- - $RM \"\$progdir/\$file\"
- - fi"
- + # Check to see that this really is a libtool object.
- + if func_lalib_unsafe_p "$arg"; then
- + pic_object=
- + non_pic_object=
-
- - $ECHO "\
- + # Read the .lo file
- + func_source "$arg"
-
- - # relink executable if necessary
- - if test -n \"\$relink_command\"; then
- - if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- - else
- - $ECHO \"\$relink_command_output\" >&2
- - $RM \"\$progdir/\$file\"
- - exit 1
- - fi
- - fi
- + if test -z "$pic_object" ||
- + test -z "$non_pic_object" ||
- + test "$pic_object" = none &&
- + test "$non_pic_object" = none; then
- + func_fatal_error "cannot find name of object for \`$arg'"
- + fi
-
- - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- - { $RM \"\$progdir/\$program\";
- - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- - $RM \"\$progdir/\$file\"
- - fi"
- - else
- - $ECHO "\
- - program='$outputname'
- - progdir=\"\$thisdir/$objdir\"
- -"
- - fi
- + # Extract subdirectory from the argument.
- + func_dirname "$arg" "/" ""
- + xdir="$func_dirname_result"
-
- - $ECHO "\
- + if test "$pic_object" != none; then
- + # Prepend the subdirectory the object is found in.
- + pic_object="$xdir$pic_object"
-
- - if test -f \"\$progdir/\$program\"; then"
- + if test "$prev" = dlfiles; then
- + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- + dlfiles="$dlfiles $pic_object"
- + prev=
- + continue
- + else
- + # If libtool objects are unsupported, then we need to preload.
- + prev=dlprefiles
- + fi
- + fi
-
- - # Export our shlibpath_var if we have one.
- - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- - $ECHO "\
- - # Add our own library path to $shlibpath_var
- - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
- + # CHECK ME: I think I busted this. -Ossama
- + if test "$prev" = dlprefiles; then
- + # Preload the old-style object.
- + dlprefiles="$dlprefiles $pic_object"
- + prev=
- + fi
-
- - # Some systems cannot cope with colon-terminated $shlibpath_var
- - # The second colon is a workaround for a bug in BeOS R4 sed
- - $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
- + # A PIC object.
- + libobjs="$libobjs $pic_object"
- + arg="$pic_object"
- + fi
-
- - export $shlibpath_var
- -"
- - fi
- + # Non-PIC object.
- + if test "$non_pic_object" != none; then
- + # Prepend the subdirectory the object is found in.
- + non_pic_object="$xdir$non_pic_object"
-
- - # fixup the dll searchpath if we need to.
- - if test -n "$dllsearchpath"; then
- - $ECHO "\
- - # Add the dll search path components to the executable PATH
- - PATH=$dllsearchpath:\$PATH
- -"
- - fi
- + # A standard non-PIC object
- + non_pic_objects="$non_pic_objects $non_pic_object"
- + if test -z "$pic_object" || test "$pic_object" = none ; then
- + arg="$non_pic_object"
- + fi
- + else
- + # If the PIC object exists, use it instead.
- + # $xdir was prepended to $pic_object above.
- + non_pic_object="$pic_object"
- + non_pic_objects="$non_pic_objects $non_pic_object"
- + fi
- + else
- + # Only an error if not doing a dry-run.
- + if $opt_dry_run; then
- + # Extract subdirectory from the argument.
- + func_dirname "$arg" "/" ""
- + xdir="$func_dirname_result"
-
- - $ECHO "\
- - if test \"\$libtool_execute_magic\" != \"$magic\"; then
- - # Run the actual program with our arguments.
- -"
- - case $host in
- - # Backslashes separate directories on plain windows
- - *-*-mingw | *-*-os2*)
- - $ECHO "\
- - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
- -"
- + pic_object=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- + non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- + libobjs="$libobjs $pic_object"
- + non_pic_objects="$non_pic_objects $non_pic_object"
- + else
- + func_fatal_error "\`$arg' is not a valid libtool object"
- + fi
- + fi
- + done
- + else
- + func_fatal_error "link input file \`$arg' does not exist"
- + fi
- + arg=$save_arg
- + prev=
- + continue
- + ;;
- + precious_regex)
- + precious_files_regex="$arg"
- + prev=
- + continue
- + ;;
- + release)
- + release="-$arg"
- + prev=
- + continue
- + ;;
- + rpath | xrpath)
- + # We need an absolute path.
- + case $arg in
- + [\\/]* | [A-Za-z]:[\\/]*) ;;
- + *)
- + func_fatal_error "only absolute run-paths are allowed"
- + ;;
- + esac
- + if test "$prev" = rpath; then
- + case "$rpath " in
- + *" $arg "*) ;;
- + *) rpath="$rpath $arg" ;;
- + esac
- + else
- + case "$xrpath " in
- + *" $arg "*) ;;
- + *) xrpath="$xrpath $arg" ;;
- + esac
- + fi
- + prev=
- + continue
- + ;;
- + shrext)
- + shrext_cmds="$arg"
- + prev=
- + continue
- + ;;
- + weak)
- + weak_libs="$weak_libs $arg"
- + prev=
- + continue
- + ;;
- + xcclinker)
- + linker_flags="$linker_flags $qarg"
- + compiler_flags="$compiler_flags $qarg"
- + prev=
- + compile_command="$compile_command $qarg"
- + finalize_command="$finalize_command $qarg"
- + continue
- + ;;
- + xcompiler)
- + compiler_flags="$compiler_flags $qarg"
- + prev=
- + compile_command="$compile_command $qarg"
- + finalize_command="$finalize_command $qarg"
- + continue
- + ;;
- + xlinker)
- + linker_flags="$linker_flags $qarg"
- + compiler_flags="$compiler_flags $wl$qarg"
- + prev=
- + compile_command="$compile_command $wl$qarg"
- + finalize_command="$finalize_command $wl$qarg"
- + continue
- ;;
- -
- *)
- - $ECHO "\
- - exec \"\$progdir/\$program\" \${1+\"\$@\"}
- -"
- + eval "$prev=\"\$arg\""
- + prev=
- + continue
- ;;
- esac
- - $ECHO "\
- - \$ECHO \"\$0: cannot exec \$program \$*\"
- - exit 1
- - fi
- - else
- - # The program doesn't exist.
- - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- - $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- - exit 1
- - fi
- -fi\
- -"
- -}
- -# end: func_emit_libtool_wrapper_script
- -
- -# func_emit_libtool_cwrapperexe_source
- -# emit the source code for a wrapper executable on stdout
- -# Must ONLY be called from within func_mode_link because
- -# it depends on a number of variable set therein.
- -func_emit_libtool_cwrapperexe_source ()
- -{
- - cat <<EOF
- -
- -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- - Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
- -
- - The $output program cannot be directly executed until all the libtool
- - libraries that it depends on are installed.
- -
- - This wrapper executable should never be moved out of the build directory.
- - If it is, it will not operate correctly.
- -
- - Currently, it simply execs the wrapper *script* "/bin/sh $output",
- - but could eventually absorb all of the scripts functionality and
- - exec $objdir/$outputname directly.
- -*/
- -EOF
- - cat <<"EOF"
- -#include <stdio.h>
- -#include <stdlib.h>
- -#include <unistd.h>
- -#include <malloc.h>
- -#include <stdarg.h>
- -#include <assert.h>
- -#include <string.h>
- -#include <ctype.h>
- -#include <sys/stat.h>
- + fi # test -n "$prev"
-
- -#if defined(PATH_MAX)
- -# define LT_PATHMAX PATH_MAX
- -#elif defined(MAXPATHLEN)
- -# define LT_PATHMAX MAXPATHLEN
- -#else
- -# define LT_PATHMAX 1024
- -#endif
- + prevarg="$arg"
-
- -#ifndef DIR_SEPARATOR
- -# define DIR_SEPARATOR '/'
- -# define PATH_SEPARATOR ':'
- -#endif
- + case $arg in
- + -all-static)
- + # The effects of -all-static are defined in a previous loop.
- + continue
- + ;;
-
- -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- - defined (__OS2__)
- -# define HAVE_DOS_BASED_FILE_SYSTEM
- -# ifndef DIR_SEPARATOR_2
- -# define DIR_SEPARATOR_2 '\\'
- -# endif
- -# ifndef PATH_SEPARATOR_2
- -# define PATH_SEPARATOR_2 ';'
- -# endif
- -#endif
- + -allow-undefined)
- + # FIXME: remove this flag sometime in the future.
- + func_fatal_error "\`-allow-undefined' must not be used because it is the default"
- + ;;
-
- -#ifndef DIR_SEPARATOR_2
- -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
- -#else /* DIR_SEPARATOR_2 */
- -# define IS_DIR_SEPARATOR(ch) \
- - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
- -#endif /* DIR_SEPARATOR_2 */
- + -avoid-version)
- + avoid_version=yes
- + continue
- + ;;
-
- -#ifndef PATH_SEPARATOR_2
- -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
- -#else /* PATH_SEPARATOR_2 */
- -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
- -#endif /* PATH_SEPARATOR_2 */
- + -dlopen)
- + prev=dlfiles
- + continue
- + ;;
-
- -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
- -#define XFREE(stale) do { \
- - if (stale) { free ((void *) stale); stale = 0; } \
- -} while (0)
- + -dlpreopen)
- + prev=dlprefiles
- + continue
- + ;;
-
- -/* -DDEBUG is fairly common in CFLAGS. */
- -#undef DEBUG
- -#if defined DEBUGWRAPPER
- -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
- -#else
- -# define DEBUG(format, ...)
- -#endif
- + -export-dynamic)
- + export_dynamic=yes
- + continue
- + ;;
-
- -const char *program_name = NULL;
- + -export-symbols | -export-symbols-regex)
- + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- + func_fatal_error "more than one -exported-symbols argument is not allowed"
- + fi
- + if test "X$arg" = "X-export-symbols"; then
- + prev=expsyms
- + else
- + prev=expsyms_regex
- + fi
- + continue
- + ;;
-
- -void * xmalloc (size_t num);
- -char * xstrdup (const char *string);
- -const char * base_name (const char *name);
- -char * find_executable(const char *wrapper);
- -int check_executable(const char *path);
- -char * strendzap(char *str, const char *pat);
- -void lt_fatal (const char *message, ...);
- + -framework)
- + prev=framework
- + continue
- + ;;
-
- -int
- -main (int argc, char *argv[])
- -{
- - char **newargz;
- - int i;
- + -inst-prefix-dir)
- + prev=inst_prefix
- + continue
- + ;;
-
- - program_name = (char *) xstrdup (base_name (argv[0]));
- - DEBUG("(main) argv[0] : %s\n",argv[0]);
- - DEBUG("(main) program_name : %s\n",program_name);
- - newargz = XMALLOC(char *, argc+2);
- -EOF
- + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- + # so, if we see these flags be careful not to treat them like -L
- + -L[A-Z][A-Z]*:*)
- + case $with_gcc/$host in
- + no/*-*-irix* | /*-*-irix*)
- + compile_command="$compile_command $arg"
- + finalize_command="$finalize_command $arg"
- + ;;
- + esac
- + continue
- + ;;
-
- - cat <<EOF
- - newargz[0] = (char *) xstrdup("$SHELL");
- -EOF
- + -L*)
- + func_stripname '-L' '' "$arg"
- + dir=$func_stripname_result
- + # We need an absolute path.
- + case $dir in
- + [\\/]* | [A-Za-z]:[\\/]*) ;;
- + *)
- + absdir=`cd "$dir" && pwd`
- + test -z "$absdir" && \
- + func_fatal_error "cannot determine absolute directory name of \`$dir'"
- + dir="$absdir"
- + ;;
- + esac
- + case "$deplibs " in
- + *" -L$dir "*) ;;
- + *)
- + deplibs="$deplibs -L$dir"
- + lib_search_path="$lib_search_path $dir"
- + ;;
- + esac
- + case $host in
- + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- + case :$dllsearchpath: in
- + *":$dir:"*) ;;
- + *) dllsearchpath="$dllsearchpath:$dir";;
- + esac
- + case :$dllsearchpath: in
- + *":$testbindir:"*) ;;
- + *) dllsearchpath="$dllsearchpath:$testbindir";;
- + esac
- + ;;
- + esac
- + continue
- + ;;
-
- - cat <<"EOF"
- - newargz[1] = find_executable(argv[0]);
- - if (newargz[1] == NULL)
- - lt_fatal("Couldn't find %s", argv[0]);
- - DEBUG("(main) found exe at : %s\n",newargz[1]);
- - /* we know the script has the same name, without the .exe */
- - /* so make sure newargz[1] doesn't end in .exe */
- - strendzap(newargz[1],".exe");
- - for (i = 1; i < argc; i++)
- - newargz[i+1] = xstrdup(argv[i]);
- - newargz[argc+1] = NULL;
- + -l*)
- + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- + case $host in
- + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
- + # These systems don't actually have a C or math library (as such)
- + continue
- + ;;
- + *-*-os2*)
- + # These systems don't actually have a C library (as such)
- + test "X$arg" = "X-lc" && continue
- + ;;
- + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- + # Do not include libc due to us having libc/libc_r.
- + test "X$arg" = "X-lc" && continue
- + ;;
- + *-*-rhapsody* | *-*-darwin1.[012])
- + # Rhapsody C and math libraries are in the System framework
- + deplibs="$deplibs System.ltframework"
- + continue
- + ;;
- + *-*-sco3.2v5* | *-*-sco5v6*)
- + # Causes problems with __ctype
- + test "X$arg" = "X-lc" && continue
- + ;;
- + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- + # Compiler inserts libc in the correct place for threads to work
- + test "X$arg" = "X-lc" && continue
- + ;;
- + esac
- + elif test "X$arg" = "X-lc_r"; then
- + case $host in
- + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- + # Do not include libc_r directly, use -pthread flag.
- + continue
- + ;;
- + esac
- + fi
- + deplibs="$deplibs $arg"
- + continue
- + ;;
-
- - for (i=0; i<argc+1; i++)
- - {
- - DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- - ;
- - }
- + -module)
- + module=yes
- + continue
- + ;;
-
- -EOF
- + # Tru64 UNIX uses -model [arg] to determine the layout of C++
- + # classes, name mangling, and exception handling.
- + # Darwin uses the -arch flag to determine output architecture.
- + -model|-arch|-isysroot)
- + compile_command="$compile_command $arg"
- + compiler_flags="$compiler_flags $arg"
- + finalize_command="$finalize_command $arg"
- + prev=xcompiler
- + continue
- + ;;
-
- - case $host_os in
- - mingw*)
- - cat <<EOF
- - execv("$SHELL",(char const **)newargz);
- -EOF
- - ;;
- - *)
- - cat <<EOF
- - execv("$SHELL",newargz);
- -EOF
- - ;;
- - esac
- + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- + compiler_flags="$compiler_flags $arg"
- + compile_command="$compile_command $arg"
- + finalize_command="$finalize_command $arg"
- + case "$new_inherited_linker_flags " in
- + *" $arg "*) ;;
- + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
- + esac
- + continue
- + ;;
-
- - cat <<"EOF"
- - return 127;
- -}
- + -multi_module)
- + single_module="${wl}-multi_module"
- + continue
- + ;;
-
- -void *
- -xmalloc (size_t num)
- -{
- - void * p = (void *) malloc (num);
- - if (!p)
- - lt_fatal ("Memory exhausted");
- + -no-fast-install)
- + fast_install=no
- + continue
- + ;;
-
- - return p;
- -}
- + -no-install)
- + case $host in
- + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- + # The PATH hackery in wrapper scripts is required on Windows
- + # in order for the loader to find any dlls it needs.
- + func_warning "\`-no-install' is ignored for $host"
- + func_warning "assuming \`-no-fast-install' instead"
- + fast_install=no
- + ;;
- + *) no_install=yes ;;
- + esac
- + continue
- + ;;
-
- -char *
- -xstrdup (const char *string)
- -{
- - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
- -;
- -}
- + -no-undefined)
- + allow_undefined=no
- + continue
- + ;;
-
- -const char *
- -base_name (const char *name)
- -{
- - const char *base;
- + -objectlist)
- + prev=objectlist
- + continue
- + ;;
-
- -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- - /* Skip over the disk name in MSDOS pathnames. */
- - if (isalpha ((unsigned char)name[0]) && name[1] == ':')
- - name += 2;
- -#endif
- + -o) prev=output ;;
-
- - for (base = name; *name; name++)
- - if (IS_DIR_SEPARATOR (*name))
- - base = name + 1;
- - return base;
- -}
- + -precious-files-regex)
- + prev=precious_regex
- + continue
- + ;;
-
- -int
- -check_executable(const char * path)
- -{
- - struct stat st;
- + -release)
- + prev=release
- + continue
- + ;;
-
- - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
- - if ((!path) || (!*path))
- - return 0;
- + -rpath)
- + prev=rpath
- + continue
- + ;;
-
- - if ((stat (path, &st) >= 0) &&
- - (
- - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
- -#if defined (S_IXOTH)
- - ((st.st_mode & S_IXOTH) == S_IXOTH) ||
- -#endif
- -#if defined (S_IXGRP)
- - ((st.st_mode & S_IXGRP) == S_IXGRP) ||
- -#endif
- - ((st.st_mode & S_IXUSR) == S_IXUSR))
- - )
- - return 1;
- - else
- - return 0;
- -}
- + -R)
- + prev=xrpath
- + continue
- + ;;
-
- -/* Searches for the full path of the wrapper. Returns
- - newly allocated full path name if found, NULL otherwise */
- -char *
- -find_executable (const char* wrapper)
- -{
- - int has_slash = 0;
- - const char* p;
- - const char* p_next;
- - /* static buffer for getcwd */
- - char tmp[LT_PATHMAX + 1];
- - int tmp_len;
- - char* concat_name;
- + -R*)
- + func_stripname '-R' '' "$arg"
- + dir=$func_stripname_result
- + # We need an absolute path.
- + case $dir in
- + [\\/]* | [A-Za-z]:[\\/]*) ;;
- + *)
- + func_fatal_error "only absolute run-paths are allowed"
- + ;;
- + esac
- + case "$xrpath " in
- + *" $dir "*) ;;
- + *) xrpath="$xrpath $dir" ;;
- + esac
- + continue
- + ;;
-
- - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
- + -shared)
- + # The effects of -shared are defined in a previous loop.
- + continue
- + ;;
-
- - if ((wrapper == NULL) || (*wrapper == '\0'))
- - return NULL;
- + -shrext)
- + prev=shrext
- + continue
- + ;;
-
- - /* Absolute path? */
- -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
- - {
- - concat_name = xstrdup (wrapper);
- - if (check_executable(concat_name))
- - return concat_name;
- - XFREE(concat_name);
- - }
- - else
- - {
- -#endif
- - if (IS_DIR_SEPARATOR (wrapper[0]))
- - {
- - concat_name = xstrdup (wrapper);
- - if (check_executable(concat_name))
- - return concat_name;
- - XFREE(concat_name);
- - }
- -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- - }
- -#endif
- + -static)
- + # The effects of -static are defined in a previous loop.
- + # We used to do the same as -all-static on platforms that
- + # didn't have a PIC flag, but the assumption that the effects
- + # would be equivalent was wrong. It would break on at least
- + # Digital Unix and AIX.
- + continue
- + ;;
-
- - for (p = wrapper; *p; p++)
- - if (*p == '/')
- - {
- - has_slash = 1;
- - break;
- - }
- - if (!has_slash)
- - {
- - /* no slashes; search PATH */
- - const char* path = getenv ("PATH");
- - if (path != NULL)
- - {
- - for (p = path; *p; p = p_next)
- - {
- - const char* q;
- - size_t p_len;
- - for (q = p; *q; q++)
- - if (IS_PATH_SEPARATOR(*q))
- - break;
- - p_len = q - p;
- - p_next = (*q == '\0' ? q : q + 1);
- - if (p_len == 0)
- - {
- - /* empty path: current directory */
- - if (getcwd (tmp, LT_PATHMAX) == NULL)
- - lt_fatal ("getcwd failed");
- - tmp_len = strlen(tmp);
- - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- - memcpy (concat_name, tmp, tmp_len);
- - concat_name[tmp_len] = '/';
- - strcpy (concat_name + tmp_len + 1, wrapper);
- - }
- - else
- - {
- - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
- - memcpy (concat_name, p, p_len);
- - concat_name[p_len] = '/';
- - strcpy (concat_name + p_len + 1, wrapper);
- - }
- - if (check_executable(concat_name))
- - return concat_name;
- - XFREE(concat_name);
- - }
- - }
- - /* not found in PATH; assume curdir */
- - }
- - /* Relative path | not found in path: prepend cwd */
- - if (getcwd (tmp, LT_PATHMAX) == NULL)
- - lt_fatal ("getcwd failed");
- - tmp_len = strlen(tmp);
- - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- - memcpy (concat_name, tmp, tmp_len);
- - concat_name[tmp_len] = '/';
- - strcpy (concat_name + tmp_len + 1, wrapper);
- + -thread-safe)
- + thread_safe=yes
- + continue
- + ;;
-
- - if (check_executable(concat_name))
- - return concat_name;
- - XFREE(concat_name);
- - return NULL;
- -}
- + -version-info)
- + prev=vinfo
- + continue
- + ;;
-
- -char *
- -strendzap(char *str, const char *pat)
- -{
- - size_t len, patlen;
- + -version-number)
- + prev=vinfo
- + vinfo_number=yes
- + continue
- + ;;
-
- - assert(str != NULL);
- - assert(pat != NULL);
- + -weak)
- + prev=weak
- + continue
- + ;;
-
- - len = strlen(str);
- - patlen = strlen(pat);
- + -Wc,*)
- + func_stripname '-Wc,' '' "$arg"
- + args=$func_stripname_result
- + arg=
- + save_ifs="$IFS"; IFS=','
- + for flag in $args; do
- + IFS="$save_ifs"
- + func_quote_for_eval "$flag"
- + arg="$arg $wl$func_quote_for_eval_result"
- + compiler_flags="$compiler_flags $func_quote_for_eval_result"
- + done
- + IFS="$save_ifs"
- + func_stripname ' ' '' "$arg"
- + arg=$func_stripname_result
- + ;;
-
- - if (patlen <= len)
- - {
- - str += len - patlen;
- - if (strcmp(str, pat) == 0)
- - *str = '\0';
- - }
- - return str;
- -}
- + -Wl,*)
- + func_stripname '-Wl,' '' "$arg"
- + args=$func_stripname_result
- + arg=
- + save_ifs="$IFS"; IFS=','
- + for flag in $args; do
- + IFS="$save_ifs"
- + func_quote_for_eval "$flag"
- + arg="$arg $wl$func_quote_for_eval_result"
- + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
- + linker_flags="$linker_flags $func_quote_for_eval_result"
- + done
- + IFS="$save_ifs"
- + func_stripname ' ' '' "$arg"
- + arg=$func_stripname_result
- + ;;
-
- -static void
- -lt_error_core (int exit_status, const char * mode,
- - const char * message, va_list ap)
- -{
- - fprintf (stderr, "%s: %s: ", program_name, mode);
- - vfprintf (stderr, message, ap);
- - fprintf (stderr, ".\n");
- + -Xcompiler)
- + prev=xcompiler
- + continue
- + ;;
-
- - if (exit_status >= 0)
- - exit (exit_status);
- -}
- + -Xlinker)
- + prev=xlinker
- + continue
- + ;;
-
- -void
- -lt_fatal (const char *message, ...)
- -{
- - va_list ap;
- - va_start (ap, message);
- - lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
- - va_end (ap);
- -}
- -EOF
- -}
- -# end: func_emit_libtool_cwrapperexe_source
- + -XCClinker)
- + prev=xcclinker
- + continue
- + ;;
-
- -# func_mode_link arg...
- -func_mode_link ()
- -{
- - $opt_debug
- - case $host in
- - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- - # It is impossible to link a dll without this setting, and
- - # we shouldn't force the makefile maintainer to figure out
- - # which system we are compiling for in order to pass an extra
- - # flag for every libtool invocation.
- - # allow_undefined=no
- + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- + # -r[0-9][0-9]* specifies the processor on the SGI compiler
- + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- + # +DA*, +DD* enable 64-bit mode on the HP compiler
- + # -q* pass through compiler args for the IBM compiler
- + # -m*, -t[45]*, -txscale* pass through architecture-specific
- + # compiler args for GCC
- + # @file GCC response files
- + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- + -t[45]*|-txscale*|@*)
- + func_quote_for_eval "$arg"
- + arg="$func_quote_for_eval_result"
- + compile_command="$compile_command $arg"
- + finalize_command="$finalize_command $arg"
- + compiler_flags="$compiler_flags $arg"
- + continue
- + ;;
-
- - # FIXME: Unfortunately, there are problems with the above when trying
- - # to make a dll which has undefined symbols, in which case not
- - # even a static library is built. For now, we need to specify
- - # -no-undefined on the libtool link line when we can be certain
- - # that all symbols are satisfied, otherwise we get a static library.
- - allow_undefined=yes
- - ;;
- - *)
- - allow_undefined=yes
- - ;;
- - esac
- - libtool_args=$nonopt
- - base_compile="$nonopt $@"
- - compile_command=$nonopt
- - finalize_command=$nonopt
- + # Some other compiler flag.
- + -* | +*)
- + func_quote_for_eval "$arg"
- + arg="$func_quote_for_eval_result"
- + ;;
-
- - compile_rpath=
- - finalize_rpath=
- - compile_shlibpath=
- - finalize_shlibpath=
- - convenience=
- - old_convenience=
- - deplibs=
- - old_deplibs=
- - compiler_flags=
- - linker_flags=
- - dllsearchpath=
- - lib_search_path=`pwd`
- - inst_prefix_dir=
- - new_inherited_linker_flags=
- + *.$objext)
- + # A standard object.
- + objs="$objs $arg"
- + ;;
-
- - avoid_version=no
- - dlfiles=
- - dlprefiles=
- - dlself=no
- - export_dynamic=no
- - export_symbols=
- - export_symbols_regex=
- - generated=
- - libobjs=
- - ltlibs=
- - module=no
- - no_install=no
- - objs=
- - non_pic_objects=
- - precious_files_regex=
- - prefer_static_libs=no
- - preload=no
- - prev=
- - prevarg=
- - release=
- - rpath=
- - xrpath=
- - perm_rpath=
- - temp_rpath=
- - thread_safe=no
- - vinfo=
- - vinfo_number=no
- - weak_libs=
- - single_module="${wl}-single_module"
- - func_infer_tag $base_compile
- + *.lo)
- + # A libtool-controlled object.
-
- - # We need to know -static, to get the right output filenames.
- - for arg
- - do
- - case $arg in
- - -shared)
- - test "$build_libtool_libs" != yes && \
- - func_fatal_configuration "can not build a shared library"
- - build_old_libs=no
- - break
- - ;;
- - -all-static | -static | -static-libtool-libs)
- - case $arg in
- - -all-static)
- - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- - func_warning "complete static linking is impossible in this configuration"
- - fi
- - if test -n "$link_static_flag"; then
- - dlopen_self=$dlopen_self_static
- - # See comment for -static flag below, for more details.
- - func_append compile_command " $link_static_flag"
- - func_append finalize_command " $link_static_flag"
- - fi
- - prefer_static_libs=yes
- - ;;
- - -static)
- - if test -z "$pic_flag" && test -n "$link_static_flag"; then
- - dlopen_self=$dlopen_self_static
- - fi
- - prefer_static_libs=built
- - ;;
- - -static-libtool-libs)
- - if test -z "$pic_flag" && test -n "$link_static_flag"; then
- - dlopen_self=$dlopen_self_static
- - fi
- - prefer_static_libs=yes
- - ;;
- - esac
- - build_libtool_libs=no
- - build_old_libs=yes
- - break
- - ;;
- - esac
- - done
- + # Check to see that this really is a libtool object.
- + if func_lalib_unsafe_p "$arg"; then
- + pic_object=
- + non_pic_object=
-
- - # See if our shared archives depend on static archives.
- - test -n "$old_archive_from_new_cmds" && build_old_libs=yes
- + # Read the .lo file
- + func_source "$arg"
-
- - # Go through the arguments, transforming them on the way.
- - while test "$#" -gt 0; do
- - arg="$1"
- - shift
- - func_quote_for_eval "$arg"
- - qarg=$func_quote_for_eval_unquoted_result
- - func_append libtool_args " $func_quote_for_eval_result"
- + if test -z "$pic_object" ||
- + test -z "$non_pic_object" ||
- + test "$pic_object" = none &&
- + test "$non_pic_object" = none; then
- + func_fatal_error "cannot find name of object for \`$arg'"
- + fi
-
- - # If the previous option needs an argument, assign it.
- - if test -n "$prev"; then
- - case $prev in
- - output)
- - func_append compile_command " @OUTPUT@"
- - func_append finalize_command " @OUTPUT@"
- - ;;
- - esac
- + # Extract subdirectory from the argument.
- + func_dirname "$arg" "/" ""
- + xdir="$func_dirname_result"
-
- - case $prev in
- - dlfiles|dlprefiles)
- - if test "$preload" = no; then
- - # Add the symbol object into the linking commands.
- - func_append compile_command " @SYMFILE@"
- - func_append finalize_command " @SYMFILE@"
- - preload=yes
- - fi
- - case $arg in
- - *.la | *.lo) ;; # We handle these cases below.
- - force)
- - if test "$dlself" = no; then
- - dlself=needless
- - export_dynamic=yes
- + if test "$pic_object" != none; then
- + # Prepend the subdirectory the object is found in.
- + pic_object="$xdir$pic_object"
- +
- + if test "$prev" = dlfiles; then
- + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- + dlfiles="$dlfiles $pic_object"
- + prev=
- + continue
- + else
- + # If libtool objects are unsupported, then we need to preload.
- + prev=dlprefiles
- + fi
- fi
- - prev=
- - continue
- - ;;
- - self)
- +
- + # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- - dlself=yes
- - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- - dlself=yes
- - else
- - dlself=needless
- - export_dynamic=yes
- + # Preload the old-style object.
- + dlprefiles="$dlprefiles $pic_object"
- + prev=
- fi
- - prev=
- - continue
- - ;;
- - *)
- - if test "$prev" = dlfiles; then
- - dlfiles="$dlfiles $arg"
- - else
- - dlprefiles="$dlprefiles $arg"
- +
- + # A PIC object.
- + libobjs="$libobjs $pic_object"
- + arg="$pic_object"
- + fi
- +
- + # Non-PIC object.
- + if test "$non_pic_object" != none; then
- + # Prepend the subdirectory the object is found in.
- + non_pic_object="$xdir$non_pic_object"
- +
- + # A standard non-PIC object
- + non_pic_objects="$non_pic_objects $non_pic_object"
- + if test -z "$pic_object" || test "$pic_object" = none ; then
- + arg="$non_pic_object"
- fi
- - prev=
- - continue
- - ;;
- - esac
- - ;;
- - expsyms)
- - export_symbols="$arg"
- - test -f "$arg" \
- - || func_fatal_error "symbol file \`$arg' does not exist"
- - prev=
- - continue
- - ;;
- - expsyms_regex)
- - export_symbols_regex="$arg"
- - prev=
- - continue
- - ;;
- - framework)
- - case $host in
- - *-*-darwin*)
- - case "$deplibs " in
- - *" $qarg.ltframework "*) ;;
- - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
- - ;;
- - esac
- - ;;
- - esac
- - prev=
- - continue
- - ;;
- - inst_prefix)
- - inst_prefix_dir="$arg"
- - prev=
- - continue
- - ;;
- - objectlist)
- - if test -f "$arg"; then
- - save_arg=$arg
- - moreargs=
- - for fil in `cat "$save_arg"`
- - do
- -# moreargs="$moreargs $fil"
- - arg=$fil
- - # A libtool-controlled object.
- + else
- + # If the PIC object exists, use it instead.
- + # $xdir was prepended to $pic_object above.
- + non_pic_object="$pic_object"
- + non_pic_objects="$non_pic_objects $non_pic_object"
- + fi
- + else
- + # Only an error if not doing a dry-run.
- + if $opt_dry_run; then
- + # Extract subdirectory from the argument.
- + func_dirname "$arg" "/" ""
- + xdir="$func_dirname_result"
-
- - # Check to see that this really is a libtool object.
- - if func_lalib_unsafe_p "$arg"; then
- - pic_object=
- - non_pic_object=
- + pic_object=`$ECHO "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- + non_pic_object=`$ECHO "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- + libobjs="$libobjs $pic_object"
- + non_pic_objects="$non_pic_objects $non_pic_object"
- + else
- + func_fatal_error "\`$arg' is not a valid libtool object"
- + fi
- + fi
- + ;;
-
- - # Read the .lo file
- - func_source "$arg"
- + *.$libext)
- + # An archive.
- + deplibs="$deplibs $arg"
- + old_deplibs="$old_deplibs $arg"
- + continue
- + ;;
-
- - if test -z "$pic_object" ||
- - test -z "$non_pic_object" ||
- - test "$pic_object" = none &&
- - test "$non_pic_object" = none; then
- - func_fatal_error "cannot find name of object for \`$arg'"
- - fi
- + *.la)
- + # A libtool-controlled library.
-
- - # Extract subdirectory from the argument.
- - func_dirname "$arg" "/" ""
- - xdir="$func_dirname_result"
- + if test "$prev" = dlfiles; then
- + # This library was specified with -dlopen.
- + dlfiles="$dlfiles $arg"
- + prev=
- + elif test "$prev" = dlprefiles; then
- + # The library was specified with -dlpreopen.
- + dlprefiles="$dlprefiles $arg"
- + prev=
- + else
- + deplibs="$deplibs $arg"
- + fi
- + continue
- + ;;
-
- - if test "$pic_object" != none; then
- - # Prepend the subdirectory the object is found in.
- - pic_object="$xdir$pic_object"
- + # Some other compiler argument.
- + *)
- + # Unknown arguments in both finalize_command and compile_command need
- + # to be aesthetically quoted because they are evaled later.
- + func_quote_for_eval "$arg"
- + arg="$func_quote_for_eval_result"
- + ;;
- + esac # arg
-
- - if test "$prev" = dlfiles; then
- - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- - dlfiles="$dlfiles $pic_object"
- - prev=
- - continue
- - else
- - # If libtool objects are unsupported, then we need to preload.
- - prev=dlprefiles
- - fi
- - fi
- + # Now actually substitute the argument into the commands.
- + if test -n "$arg"; then
- + compile_command="$compile_command $arg"
- + finalize_command="$finalize_command $arg"
- + fi
- + done # argument parsing loop
-
- - # CHECK ME: I think I busted this. -Ossama
- - if test "$prev" = dlprefiles; then
- - # Preload the old-style object.
- - dlprefiles="$dlprefiles $pic_object"
- - prev=
- - fi
- + test -n "$prev" && \
- + func_fatal_help "the \`$prevarg' option requires an argument"
-
- - # A PIC object.
- - func_append libobjs " $pic_object"
- - arg="$pic_object"
- - fi
- + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- + eval arg=\"$export_dynamic_flag_spec\"
- + compile_command="$compile_command $arg"
- + finalize_command="$finalize_command $arg"
- + fi
-
- - # Non-PIC object.
- - if test "$non_pic_object" != none; then
- - # Prepend the subdirectory the object is found in.
- - non_pic_object="$xdir$non_pic_object"
- + oldlibs=
- + # calculate the name of the file, without its directory
- + func_basename "$output"
- + outputname="$func_basename_result"
- + libobjs_save="$libobjs"
-
- - # A standard non-PIC object
- - func_append non_pic_objects " $non_pic_object"
- - if test -z "$pic_object" || test "$pic_object" = none ; then
- - arg="$non_pic_object"
- - fi
- - else
- - # If the PIC object exists, use it instead.
- - # $xdir was prepended to $pic_object above.
- - non_pic_object="$pic_object"
- - func_append non_pic_objects " $non_pic_object"
- - fi
- - else
- - # Only an error if not doing a dry-run.
- - if $opt_dry_run; then
- - # Extract subdirectory from the argument.
- - func_dirname "$arg" "/" ""
- - xdir="$func_dirname_result"
- + if test -n "$shlibpath_var"; then
- + # get the directories listed in $shlibpath_var
- + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- + else
- + shlib_search_path=
- + fi
- + eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- - func_lo2o "$arg"
- - pic_object=$xdir$objdir/$func_lo2o_result
- - non_pic_object=$xdir$func_lo2o_result
- - func_append libobjs " $pic_object"
- - func_append non_pic_objects " $non_pic_object"
- - else
- - func_fatal_error "\`$arg' is not a valid libtool object"
- - fi
- - fi
- - done
- - else
- - func_fatal_error "link input file \`$arg' does not exist"
- - fi
- - arg=$save_arg
- - prev=
- - continue
- - ;;
- - precious_regex)
- - precious_files_regex="$arg"
- - prev=
- - continue
- - ;;
- - release)
- - release="-$arg"
- - prev=
- - continue
- - ;;
- - rpath | xrpath)
- - # We need an absolute path.
- - case $arg in
- - [\\/]* | [A-Za-z]:[\\/]*) ;;
- - *)
- - func_fatal_error "only absolute run-paths are allowed"
- - ;;
- - esac
- - if test "$prev" = rpath; then
- - case "$rpath " in
- - *" $arg "*) ;;
- - *) rpath="$rpath $arg" ;;
- - esac
- - else
- - case "$xrpath " in
- - *" $arg "*) ;;
- - *) xrpath="$xrpath $arg" ;;
- - esac
- - fi
- - prev=
- - continue
- - ;;
- - shrext)
- - shrext_cmds="$arg"
- - prev=
- - continue
- - ;;
- - weak)
- - weak_libs="$weak_libs $arg"
- - prev=
- - continue
- - ;;
- - xcclinker)
- - linker_flags="$linker_flags $qarg"
- - compiler_flags="$compiler_flags $qarg"
- - prev=
- - func_append compile_command " $qarg"
- - func_append finalize_command " $qarg"
- - continue
- - ;;
- - xcompiler)
- - compiler_flags="$compiler_flags $qarg"
- - prev=
- - func_append compile_command " $qarg"
- - func_append finalize_command " $qarg"
- - continue
- - ;;
- - xlinker)
- - linker_flags="$linker_flags $qarg"
- - compiler_flags="$compiler_flags $wl$qarg"
- - prev=
- - func_append compile_command " $wl$qarg"
- - func_append finalize_command " $wl$qarg"
- - continue
- - ;;
- - *)
- - eval "$prev=\"\$arg\""
- - prev=
- - continue
- - ;;
- - esac
- - fi # test -n "$prev"
- + func_dirname "$output" "/" ""
- + output_objdir="$func_dirname_result$objdir"
- + # Create the object directory.
- + func_mkdir_p "$output_objdir"
-
- - prevarg="$arg"
- + # Determine the type of output
- + case $output in
- + "")
- + func_fatal_help "you must specify an output file"
- + ;;
- + *.$libext) linkmode=oldlib ;;
- + *.lo | *.$objext) linkmode=obj ;;
- + *.la) linkmode=lib ;;
- + *) linkmode=prog ;; # Anything else should be a program.
- + esac
-
- - case $arg in
- - -all-static)
- - # The effects of -all-static are defined in a previous loop.
- - continue
- - ;;
- + specialdeplibs=
-
- - -allow-undefined)
- - # FIXME: remove this flag sometime in the future.
- - func_fatal_error "\`-allow-undefined' must not be used because it is the default"
- - ;;
- + libs=
- + # Find all interdependent deplibs by searching for libraries
- + # that are linked more than once (e.g. -la -lb -la)
- + for deplib in $deplibs; do
- + if $opt_duplicate_deps ; then
- + case "$libs " in
- + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- + esac
- + fi
- + libs="$libs $deplib"
- + done
-
- - -avoid-version)
- - avoid_version=yes
- - continue
- - ;;
- + if test "$linkmode" = lib; then
- + libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- - -dlopen)
- - prev=dlfiles
- - continue
- - ;;
- + # Compute libraries that are listed more than once in $predeps
- + # $postdeps and mark them as special (i.e., whose duplicates are
- + # not to be eliminated).
- + pre_post_deps=
- + if $opt_duplicate_compiler_generated_deps; then
- + for pre_post_dep in $predeps $postdeps; do
- + case "$pre_post_deps " in
- + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- + esac
- + pre_post_deps="$pre_post_deps $pre_post_dep"
- + done
- + fi
- + pre_post_deps=
- + fi
-
- - -dlpreopen)
- - prev=dlprefiles
- - continue
- - ;;
- + deplibs=
- + newdependency_libs=
- + newlib_search_path=
- + need_relink=no # whether we're linking any uninstalled libtool libraries
- + notinst_deplibs= # not-installed libtool libraries
- + notinst_path= # paths that contain not-installed libtool libraries
-
- - -export-dynamic)
- - export_dynamic=yes
- - continue
- + case $linkmode in
- + lib)
- + passes="conv dlpreopen link"
- + for file in $dlfiles $dlprefiles; do
- + case $file in
- + *.la) ;;
- + *)
- + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
- + ;;
- + esac
- + done
- ;;
- -
- - -export-symbols | -export-symbols-regex)
- - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- - func_fatal_error "more than one -exported-symbols argument is not allowed"
- - fi
- - if test "X$arg" = "X-export-symbols"; then
- - prev=expsyms
- - else
- - prev=expsyms_regex
- - fi
- - continue
- + prog)
- + compile_deplibs=
- + finalize_deplibs=
- + alldeplibs=no
- + newdlfiles=
- + newdlprefiles=
- + passes="conv scan dlopen dlpreopen link"
- ;;
- -
- - -framework)
- - prev=framework
- - continue
- + *) passes="conv"
- ;;
- + esac
-
- - -inst-prefix-dir)
- - prev=inst_prefix
- - continue
- - ;;
- + for pass in $passes; do
- + # The preopen pass in lib mode reverses $deplibs; put it back here
- + # so that -L comes before libs that need it for instance...
- + if test "$linkmode,$pass" = "lib,link"; then
- + ## FIXME: Find the place where the list is rebuilt in the wrong
- + ## order, and fix it there properly
- + tmp_deplibs=
- + for deplib in $deplibs; do
- + tmp_deplibs="$deplib $tmp_deplibs"
- + done
- + deplibs="$tmp_deplibs"
- + fi
-
- - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- - # so, if we see these flags be careful not to treat them like -L
- - -L[A-Z][A-Z]*:*)
- - case $with_gcc/$host in
- - no/*-*-irix* | /*-*-irix*)
- - func_append compile_command " $arg"
- - func_append finalize_command " $arg"
- + if test "$linkmode,$pass" = "lib,link" ||
- + test "$linkmode,$pass" = "prog,scan"; then
- + libs="$deplibs"
- + deplibs=
- + fi
- + if test "$linkmode" = prog; then
- + case $pass in
- + dlopen) libs="$dlfiles" ;;
- + dlpreopen) libs="$dlprefiles" ;;
- + link)
- + libs="$deplibs %DEPLIBS%"
- + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
- esac
- - continue
- - ;;
- + fi
- + if test "$linkmode,$pass" = "lib,dlpreopen"; then
- + # Collect and forward deplibs of preopened libtool libs
- + for lib in $dlprefiles; do
- + # Ignore non-libtool-libs
- + dependency_libs=
- + case $lib in
- + *.la) func_source "$lib" ;;
- + esac
-
- - -L*)
- - func_stripname '-L' '' "$arg"
- - dir=$func_stripname_result
- - # We need an absolute path.
- - case $dir in
- - [\\/]* | [A-Za-z]:[\\/]*) ;;
- - *)
- - absdir=`cd "$dir" && pwd`
- - test -z "$absdir" && \
- - func_fatal_error "cannot determine absolute directory name of \`$dir'"
- - dir="$absdir"
- - ;;
- - esac
- - case "$deplibs " in
- - *" -L$dir "*) ;;
- - *)
- - deplibs="$deplibs -L$dir"
- - lib_search_path="$lib_search_path $dir"
- - ;;
- - esac
- - case $host in
- - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- - testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- - case :$dllsearchpath: in
- - *":$dir:"*) ;;
- - *) dllsearchpath="$dllsearchpath:$dir";;
- - esac
- - case :$dllsearchpath: in
- - *":$testbindir:"*) ;;
- - *) dllsearchpath="$dllsearchpath:$testbindir";;
- - esac
- - ;;
- - esac
- - continue
- - ;;
- + # Collect preopened libtool deplibs, except any this library
- + # has declared as weak libs
- + for deplib in $dependency_libs; do
- + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
- + case " $weak_libs " in
- + *" $deplib_base "*) ;;
- + *) deplibs="$deplibs $deplib" ;;
- + esac
- + done
- + done
- + libs="$dlprefiles"
- + fi
- + if test "$pass" = dlopen; then
- + # Collect dlpreopened libraries
- + save_deplibs="$deplibs"
- + deplibs=
- + fi
-
- - -l*)
- - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- - case $host in
- - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
- - # These systems don't actually have a C or math library (as such)
- + for deplib in $libs; do
- + lib=
- + found=no
- + case $deplib in
- + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- + if test "$linkmode,$pass" = "prog,link"; then
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + else
- + compiler_flags="$compiler_flags $deplib"
- + if test "$linkmode" = lib ; then
- + case "$new_inherited_linker_flags " in
- + *" $deplib "*) ;;
- + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
- + esac
- + fi
- + fi
- + continue
- + ;;
- + -l*)
- + if test "$linkmode" != lib && test "$linkmode" != prog; then
- + func_warning "\`-l' is ignored for archives/objects"
- + continue
- + fi
- + func_stripname '-l' '' "$deplib"
- + name=$func_stripname_result
- + for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
- + for search_ext in .la $std_shrext .so .a; do
- + # Search the libtool library
- + lib="$searchdir/lib${name}${search_ext}"
- + if test -f "$lib"; then
- + if test "$search_ext" = ".la"; then
- + found=yes
- + else
- + found=no
- + fi
- + break 2
- + fi
- + done
- + done
- + if test "$found" != yes; then
- + # deplib doesn't seem to be a libtool library
- + if test "$linkmode,$pass" = "prog,link"; then
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + else
- + deplibs="$deplib $deplibs"
- + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- + fi
- continue
- + else # deplib is a libtool library
- + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- + # We need to do some special things here, and not later.
- + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- + case " $predeps $postdeps " in
- + *" $deplib "*)
- + if func_lalib_p "$lib"; then
- + library_names=
- + old_library=
- + func_source "$lib"
- + for l in $old_library $library_names; do
- + ll="$l"
- + done
- + if test "X$ll" = "X$old_library" ; then # only static version available
- + found=no
- + func_dirname "$lib" "" "."
- + ladir="$func_dirname_result"
- + lib=$ladir/$old_library
- + if test "$linkmode,$pass" = "prog,link"; then
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + else
- + deplibs="$deplib $deplibs"
- + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- + fi
- + continue
- + fi
- + fi
- + ;;
- + *) ;;
- + esac
- + fi
- + fi
- + ;; # -l
- + *.ltframework)
- + if test "$linkmode,$pass" = "prog,link"; then
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + else
- + deplibs="$deplib $deplibs"
- + if test "$linkmode" = lib ; then
- + case "$new_inherited_linker_flags " in
- + *" $deplib "*) ;;
- + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
- + esac
- + fi
- + fi
- + continue
- + ;;
- + -L*)
- + case $linkmode in
- + lib)
- + deplibs="$deplib $deplibs"
- + test "$pass" = conv && continue
- + newdependency_libs="$deplib $newdependency_libs"
- + func_stripname '-L' '' "$deplib"
- + newlib_search_path="$newlib_search_path $func_stripname_result"
- ;;
- - *-*-os2*)
- - # These systems don't actually have a C library (as such)
- - test "X$arg" = "X-lc" && continue
- + prog)
- + if test "$pass" = conv; then
- + deplibs="$deplib $deplibs"
- + continue
- + fi
- + if test "$pass" = scan; then
- + deplibs="$deplib $deplibs"
- + else
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + fi
- + func_stripname '-L' '' "$deplib"
- + newlib_search_path="$newlib_search_path $func_stripname_result"
- ;;
- - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- - # Do not include libc due to us having libc/libc_r.
- - test "X$arg" = "X-lc" && continue
- + *)
- + func_warning "\`-L' is ignored for archives/objects"
- ;;
- - *-*-rhapsody* | *-*-darwin1.[012])
- - # Rhapsody C and math libraries are in the System framework
- - deplibs="$deplibs System.ltframework"
- + esac # linkmode
- + continue
- + ;; # -L
- + -R*)
- + if test "$pass" = link; then
- + func_stripname '-R' '' "$deplib"
- + dir=$func_stripname_result
- + # Make sure the xrpath contains only unique directories.
- + case "$xrpath " in
- + *" $dir "*) ;;
- + *) xrpath="$xrpath $dir" ;;
- + esac
- + fi
- + deplibs="$deplib $deplibs"
- + continue
- + ;;
- + *.la) lib="$deplib" ;;
- + *.$libext)
- + if test "$pass" = conv; then
- + deplibs="$deplib $deplibs"
- + continue
- + fi
- + case $linkmode in
- + lib)
- + # Linking convenience modules into shared libraries is allowed,
- + # but linking other static libraries is non-portable.
- + case " $dlpreconveniencelibs " in
- + *" $lib "*) ;;
- + *)
- + valid_a_lib=no
- + case $deplibs_check_method in
- + match_pattern*)
- + set dummy $deplibs_check_method; shift
- + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
- + | $EGREP "$match_pattern_regex" > /dev/null; then
- + valid_a_lib=yes
- + fi
- + ;;
- + pass_all)
- + valid_a_lib=yes
- + ;;
- + esac
- + if test "$valid_a_lib" != yes; then
- + $ECHO
- + $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- + $ECHO "*** I have the capability to make that library automatically link in when"
- + $ECHO "*** you link to this library. But I can only do this if you have a"
- + $ECHO "*** shared version of the library, which you do not appear to have"
- + $ECHO "*** because the file extensions .$libext of this argument makes me believe"
- + $ECHO "*** that it is just a static archive that I should not use here."
- + else
- + $ECHO
- + $ECHO "*** Warning: Linking the shared library $output against the"
- + $ECHO "*** static library $deplib is not portable!"
- + deplibs="$deplib $deplibs"
- + fi
- + ;;
- + esac
- continue
- ;;
- - *-*-sco3.2v5* | *-*-sco5v6*)
- - # Causes problems with __ctype
- - test "X$arg" = "X-lc" && continue
- - ;;
- - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- - # Compiler inserts libc in the correct place for threads to work
- - test "X$arg" = "X-lc" && continue
- + prog)
- + if test "$pass" != link; then
- + deplibs="$deplib $deplibs"
- + else
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + fi
- + continue
- ;;
- - esac
- - elif test "X$arg" = "X-lc_r"; then
- - case $host in
- - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- - # Do not include libc_r directly, use -pthread flag.
- - continue
- - ;;
- - esac
- - fi
- - deplibs="$deplibs $arg"
- - continue
- - ;;
- -
- - -module)
- - module=yes
- - continue
- - ;;
- -
- - # Tru64 UNIX uses -model [arg] to determine the layout of C++
- - # classes, name mangling, and exception handling.
- - # Darwin uses the -arch flag to determine output architecture.
- - -model|-arch|-isysroot)
- - compiler_flags="$compiler_flags $arg"
- - func_append compile_command " $arg"
- - func_append finalize_command " $arg"
- - prev=xcompiler
- - continue
- - ;;
- + esac # linkmode
- + ;; # *.$libext
- + *.lo | *.$objext)
- + if test "$pass" = conv; then
- + deplibs="$deplib $deplibs"
- + elif test "$linkmode" = prog; then
- + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- + # If there is no dlopen support or we're linking statically,
- + # we need to preload.
- + newdlprefiles="$newdlprefiles $deplib"
- + compile_deplibs="$deplib $compile_deplibs"
- + finalize_deplibs="$deplib $finalize_deplibs"
- + else
- + newdlfiles="$newdlfiles $deplib"
- + fi
- + fi
- + continue
- + ;;
- + %DEPLIBS%)
- + alldeplibs=yes
- + continue
- + ;;
- + esac # case $deplib
-
- - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- - compiler_flags="$compiler_flags $arg"
- - func_append compile_command " $arg"
- - func_append finalize_command " $arg"
- - case "$new_inherited_linker_flags " in
- - *" $arg "*) ;;
- - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
- - esac
- - continue
- - ;;
- + if test "$found" = yes || test -f "$lib"; then :
- + else
- + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- + fi
-
- - -multi_module)
- - single_module="${wl}-multi_module"
- - continue
- - ;;
- + # Check to see that this really is a libtool archive.
- + func_lalib_unsafe_p "$lib" \
- + || func_fatal_error "\`$lib' is not a valid libtool archive"
-
- - -no-fast-install)
- - fast_install=no
- - continue
- - ;;
- + func_dirname "$lib" "" "."
- + ladir="$func_dirname_result"
-
- - -no-install)
- - case $host in
- - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
- - # The PATH hackery in wrapper scripts is required on Windows
- - # and Darwin in order for the loader to find any dlls it needs.
- - func_warning "\`-no-install' is ignored for $host"
- - func_warning "assuming \`-no-fast-install' instead"
- - fast_install=no
- - ;;
- - *) no_install=yes ;;
- - esac
- - continue
- - ;;
- + dlname=
- + dlopen=
- + dlpreopen=
- + libdir=
- + library_names=
- + old_library=
- + inherited_linker_flags=
- + # If the library was installed with an old release of libtool,
- + # it will not redefine variables installed, or shouldnotlink
- + installed=yes
- + shouldnotlink=no
- + avoidtemprpath=
-
- - -no-undefined)
- - allow_undefined=no
- - continue
- - ;;
-
- - -objectlist)
- - prev=objectlist
- - continue
- - ;;
- + # Read the .la file
- + func_source "$lib"
-
- - -o) prev=output ;;
- + # Convert "-framework foo" to "foo.ltframework"
- + if test -n "$inherited_linker_flags"; then
- + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
- + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- + case " $new_inherited_linker_flags " in
- + *" $tmp_inherited_linker_flag "*) ;;
- + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
- + esac
- + done
- + fi
- + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- + if test "$linkmode,$pass" = "prog,link"; then
- + compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- + else
- + compiler_flags="$compiler_flags $inherited_linker_flags"
- + fi
- + if test "$linkmode,$pass" = "lib,link" ||
- + test "$linkmode,$pass" = "prog,scan" ||
- + { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- + test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- + fi
-
- - -precious-files-regex)
- - prev=precious_regex
- - continue
- - ;;
- + if test "$pass" = conv; then
- + # Only check for convenience libraries
- + deplibs="$lib $deplibs"
- + if test -z "$libdir"; then
- + if test -z "$old_library"; then
- + func_fatal_error "cannot find name of link library for \`$lib'"
- + fi
- + # It is a libtool convenience library, so add in its objects.
- + convenience="$convenience $ladir/$objdir/$old_library"
- + old_convenience="$old_convenience $ladir/$objdir/$old_library"
- + elif test "$linkmode" != prog && test "$linkmode" != lib; then
- + func_fatal_error "\`$lib' is not a convenience library"
- + fi
- + tmp_libs=
- + for deplib in $dependency_libs; do
- + deplibs="$deplib $deplibs"
- + if $opt_duplicate_deps ; then
- + case "$tmp_libs " in
- + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- + esac
- + fi
- + tmp_libs="$tmp_libs $deplib"
- + done
- + continue
- + fi # $pass = conv
-
- - -release)
- - prev=release
- - continue
- - ;;
-
- - -rpath)
- - prev=rpath
- - continue
- - ;;
- + # Get the name of the library we link against.
- + linklib=
- + for l in $old_library $library_names; do
- + linklib="$l"
- + done
- + if test -z "$linklib"; then
- + func_fatal_error "cannot find name of link library for \`$lib'"
- + fi
-
- - -R)
- - prev=xrpath
- - continue
- - ;;
- + # This library was specified with -dlopen.
- + if test "$pass" = dlopen; then
- + if test -z "$libdir"; then
- + func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- + fi
- + if test -z "$dlname" ||
- + test "$dlopen_support" != yes ||
- + test "$build_libtool_libs" = no; then
- + # If there is no dlname, no dlopen support or we're linking
- + # statically, we need to preload. We also need to preload any
- + # dependent libraries so libltdl's deplib preloader doesn't
- + # bomb out in the load deplibs phase.
- + dlprefiles="$dlprefiles $lib $dependency_libs"
- + else
- + newdlfiles="$newdlfiles $lib"
- + fi
- + continue
- + fi # $pass = dlopen
-
- - -R*)
- - func_stripname '-R' '' "$arg"
- - dir=$func_stripname_result
- # We need an absolute path.
- - case $dir in
- - [\\/]* | [A-Za-z]:[\\/]*) ;;
- + case $ladir in
- + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- - func_fatal_error "only absolute run-paths are allowed"
- + abs_ladir=`cd "$ladir" && pwd`
- + if test -z "$abs_ladir"; then
- + func_warning "cannot determine absolute directory name of \`$ladir'"
- + func_warning "passing it literally to the linker, although it might fail"
- + abs_ladir="$ladir"
- + fi
- ;;
- esac
- - case "$xrpath " in
- - *" $dir "*) ;;
- - *) xrpath="$xrpath $dir" ;;
- - esac
- - continue
- - ;;
- -
- - -shared)
- - # The effects of -shared are defined in a previous loop.
- - continue
- - ;;
- + func_basename "$lib"
- + laname="$func_basename_result"
-
- - -shrext)
- - prev=shrext
- - continue
- - ;;
- + # Find the relevant object directory and library name.
- + if test "X$installed" = Xyes; then
- + if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- + func_warning "library \`$lib' was moved."
- + dir="$ladir"
- + absdir="$abs_ladir"
- + libdir="$abs_ladir"
- + else
- + dir="$libdir"
- + absdir="$libdir"
- + fi
- + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- + else
- + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- + dir="$ladir"
- + absdir="$abs_ladir"
- + # Remove this search path later
- + notinst_path="$notinst_path $abs_ladir"
- + else
- + dir="$ladir/$objdir"
- + absdir="$abs_ladir/$objdir"
- + # Remove this search path later
- + notinst_path="$notinst_path $abs_ladir"
- + fi
- + fi # $installed = yes
- + func_stripname 'lib' '.la' "$laname"
- + name=$func_stripname_result
-
- - -static | -static-libtool-libs)
- - # The effects of -static are defined in a previous loop.
- - # We used to do the same as -all-static on platforms that
- - # didn't have a PIC flag, but the assumption that the effects
- - # would be equivalent was wrong. It would break on at least
- - # Digital Unix and AIX.
- - continue
- - ;;
- -
- - -thread-safe)
- - thread_safe=yes
- - continue
- - ;;
- -
- - -version-info)
- - prev=vinfo
- - continue
- - ;;
- -
- - -version-number)
- - prev=vinfo
- - vinfo_number=yes
- - continue
- - ;;
- -
- - -weak)
- - prev=weak
- - continue
- - ;;
- -
- - -Wc,*)
- - func_stripname '-Wc,' '' "$arg"
- - args=$func_stripname_result
- - arg=
- - save_ifs="$IFS"; IFS=','
- - for flag in $args; do
- - IFS="$save_ifs"
- - func_quote_for_eval "$flag"
- - arg="$arg $wl$func_quote_for_eval_result"
- - compiler_flags="$compiler_flags $func_quote_for_eval_result"
- - done
- - IFS="$save_ifs"
- - func_stripname ' ' '' "$arg"
- - arg=$func_stripname_result
- - ;;
- -
- - -Wl,*)
- - func_stripname '-Wl,' '' "$arg"
- - args=$func_stripname_result
- - arg=
- - save_ifs="$IFS"; IFS=','
- - for flag in $args; do
- - IFS="$save_ifs"
- - func_quote_for_eval "$flag"
- - arg="$arg $wl$func_quote_for_eval_result"
- - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
- - linker_flags="$linker_flags $func_quote_for_eval_result"
- - done
- - IFS="$save_ifs"
- - func_stripname ' ' '' "$arg"
- - arg=$func_stripname_result
- - ;;
- -
- - -Xcompiler)
- - prev=xcompiler
- - continue
- - ;;
- -
- - -Xlinker)
- - prev=xlinker
- - continue
- - ;;
- -
- - -XCClinker)
- - prev=xcclinker
- - continue
- - ;;
- -
- - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- - # -r[0-9][0-9]* specifies the processor on the SGI compiler
- - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- - # +DA*, +DD* enable 64-bit mode on the HP compiler
- - # -q* pass through compiler args for the IBM compiler
- - # -m*, -t[45]*, -txscale* pass through architecture-specific
- - # compiler args for GCC
- - # -F/path gives path to uninstalled frameworks, gcc on darwin
- - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
- - # @file GCC response files
- - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
- - func_quote_for_eval "$arg"
- - arg="$func_quote_for_eval_result"
- - func_append compile_command " $arg"
- - func_append finalize_command " $arg"
- - compiler_flags="$compiler_flags $arg"
- - continue
- - ;;
- -
- - # Some other compiler flag.
- - -* | +*)
- - func_quote_for_eval "$arg"
- - arg="$func_quote_for_eval_result"
- - ;;
- -
- - *.$objext)
- - # A standard object.
- - objs="$objs $arg"
- - ;;
- + # This library was specified with -dlpreopen.
- + if test "$pass" = dlpreopen; then
- + if test -z "$libdir" && test "$linkmode" = prog; then
- + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- + fi
- + # Prefer using a static library (so that no silly _DYNAMIC symbols
- + # are required to link).
- + if test -n "$old_library"; then
- + newdlprefiles="$newdlprefiles $dir/$old_library"
- + # Keep a list of preopened convenience libraries to check
- + # that they are being used correctly in the link pass.
- + test -z "$libdir" && \
- + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
- + # Otherwise, use the dlname, so that lt_dlopen finds it.
- + elif test -n "$dlname"; then
- + newdlprefiles="$newdlprefiles $dir/$dlname"
- + else
- + newdlprefiles="$newdlprefiles $dir/$linklib"
- + fi
- + fi # $pass = dlpreopen
-
- - *.lo)
- - # A libtool-controlled object.
- + if test -z "$libdir"; then
- + # Link the convenience library
- + if test "$linkmode" = lib; then
- + deplibs="$dir/$old_library $deplibs"
- + elif test "$linkmode,$pass" = "prog,link"; then
- + compile_deplibs="$dir/$old_library $compile_deplibs"
- + finalize_deplibs="$dir/$old_library $finalize_deplibs"
- + else
- + deplibs="$lib $deplibs" # used for prog,scan pass
- + fi
- + continue
- + fi
-
- - # Check to see that this really is a libtool object.
- - if func_lalib_unsafe_p "$arg"; then
- - pic_object=
- - non_pic_object=
-
- - # Read the .lo file
- - func_source "$arg"
- + if test "$linkmode" = prog && test "$pass" != link; then
- + newlib_search_path="$newlib_search_path $ladir"
- + deplibs="$lib $deplibs"
-
- - if test -z "$pic_object" ||
- - test -z "$non_pic_object" ||
- - test "$pic_object" = none &&
- - test "$non_pic_object" = none; then
- - func_fatal_error "cannot find name of object for \`$arg'"
- + linkalldeplibs=no
- + if test "$link_all_deplibs" != no || test -z "$library_names" ||
- + test "$build_libtool_libs" = no; then
- + linkalldeplibs=yes
- fi
-
- - # Extract subdirectory from the argument.
- - func_dirname "$arg" "/" ""
- - xdir="$func_dirname_result"
- -
- - if test "$pic_object" != none; then
- - # Prepend the subdirectory the object is found in.
- - pic_object="$xdir$pic_object"
- -
- - if test "$prev" = dlfiles; then
- - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- - dlfiles="$dlfiles $pic_object"
- - prev=
- - continue
- - else
- - # If libtool objects are unsupported, then we need to preload.
- - prev=dlprefiles
- - fi
- + tmp_libs=
- + for deplib in $dependency_libs; do
- + case $deplib in
- + -L*) func_stripname '-L' '' "$deplib"
- + newlib_search_path="$newlib_search_path $func_stripname_result"
- + ;;
- + esac
- + # Need to link against all dependency_libs?
- + if test "$linkalldeplibs" = yes; then
- + deplibs="$deplib $deplibs"
- + else
- + # Need to hardcode shared library paths
- + # or/and link against static libraries
- + newdependency_libs="$deplib $newdependency_libs"
- fi
- -
- - # CHECK ME: I think I busted this. -Ossama
- - if test "$prev" = dlprefiles; then
- - # Preload the old-style object.
- - dlprefiles="$dlprefiles $pic_object"
- - prev=
- + if $opt_duplicate_deps ; then
- + case "$tmp_libs " in
- + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- + esac
- fi
- + tmp_libs="$tmp_libs $deplib"
- + done # for deplib
- + continue
- + fi # $linkmode = prog...
-
- - # A PIC object.
- - func_append libobjs " $pic_object"
- - arg="$pic_object"
- - fi
- + if test "$linkmode,$pass" = "prog,link"; then
- + if test -n "$library_names" &&
- + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
- + # We need to hardcode the library path
- + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- + # Make sure the rpath contains only unique directories.
- + case "$temp_rpath " in
- + *"$absdir:"*) ;;
- + *) temp_rpath="$temp_rpath:$absdir" ;;
- + esac
- + fi
-
- - # Non-PIC object.
- - if test "$non_pic_object" != none; then
- - # Prepend the subdirectory the object is found in.
- - non_pic_object="$xdir$non_pic_object"
- + # Hardcode the library path.
- + # Skip directories that are in the system default run-time
- + # search path.
- + case " $sys_lib_dlsearch_path " in
- + *" $absdir "*) ;;
- + *)
- + case "$compile_rpath " in
- + *" $absdir "*) ;;
- + *) compile_rpath="$compile_rpath $absdir"
- + esac
- + ;;
- + esac
- + case " $sys_lib_dlsearch_path " in
- + *" $libdir "*) ;;
- + *)
- + case "$finalize_rpath " in
- + *" $libdir "*) ;;
- + *) finalize_rpath="$finalize_rpath $libdir"
- + esac
- + ;;
- + esac
- + fi # $linkmode,$pass = prog,link...
-
- - # A standard non-PIC object
- - func_append non_pic_objects " $non_pic_object"
- - if test -z "$pic_object" || test "$pic_object" = none ; then
- - arg="$non_pic_object"
- - fi
- - else
- - # If the PIC object exists, use it instead.
- - # $xdir was prepended to $pic_object above.
- - non_pic_object="$pic_object"
- - func_append non_pic_objects " $non_pic_object"
- + if test "$alldeplibs" = yes &&
- + { test "$deplibs_check_method" = pass_all ||
- + { test "$build_libtool_libs" = yes &&
- + test -n "$library_names"; }; }; then
- + # We only need to search for static libraries
- + continue
- fi
- - else
- - # Only an error if not doing a dry-run.
- - if $opt_dry_run; then
- - # Extract subdirectory from the argument.
- - func_dirname "$arg" "/" ""
- - xdir="$func_dirname_result"
- + fi
-
- - func_lo2o "$arg"
- - pic_object=$xdir$objdir/$func_lo2o_result
- - non_pic_object=$xdir$func_lo2o_result
- - func_append libobjs " $pic_object"
- - func_append non_pic_objects " $non_pic_object"
- - else
- - func_fatal_error "\`$arg' is not a valid libtool object"
- - fi
- + link_static=no # Whether the deplib will be linked statically
- + use_static_libs=$prefer_static_libs
- + if test "$use_static_libs" = built && test "$installed" = yes; then
- + use_static_libs=no
- fi
- - ;;
- -
- - *.$libext)
- - # An archive.
- - deplibs="$deplibs $arg"
- - old_deplibs="$old_deplibs $arg"
- - continue
- - ;;
- + if test -n "$library_names" &&
- + { test "$use_static_libs" = no || test -z "$old_library"; }; then
- + case $host in
- + *cygwin* | *mingw*)
- + # No point in relinking DLLs because paths are not encoded
- + notinst_deplibs="$notinst_deplibs $lib"
- + need_relink=no
- + ;;
- + *)
- + if test "$installed" = no; then
- + notinst_deplibs="$notinst_deplibs $lib"
- + need_relink=yes
- + fi
- + ;;
- + esac
- + # This is a shared library
-
- - *.la)
- - # A libtool-controlled library.
- + # Warn about portability, can't link against -module's on some
- + # systems (darwin). Don't bleat about dlopened modules though!
- + dlopenmodule=""
- + for dlpremoduletest in $dlprefiles; do
- + if test "X$dlpremoduletest" = "X$lib"; then
- + dlopenmodule="$dlpremoduletest"
- + break
- + fi
- + done
- + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- + $ECHO
- + if test "$linkmode" = prog; then
- + $ECHO "*** Warning: Linking the executable $output against the loadable module"
- + else
- + $ECHO "*** Warning: Linking the shared library $output against the loadable module"
- + fi
- + $ECHO "*** $linklib is not portable!"
- + fi
- + if test "$linkmode" = lib &&
- + test "$hardcode_into_libs" = yes; then
- + # Hardcode the library path.
- + # Skip directories that are in the system default run-time
- + # search path.
- + case " $sys_lib_dlsearch_path " in
- + *" $absdir "*) ;;
- + *)
- + case "$compile_rpath " in
- + *" $absdir "*) ;;
- + *) compile_rpath="$compile_rpath $absdir"
- + esac
- + ;;
- + esac
- + case " $sys_lib_dlsearch_path " in
- + *" $libdir "*) ;;
- + *)
- + case "$finalize_rpath " in
- + *" $libdir "*) ;;
- + *) finalize_rpath="$finalize_rpath $libdir"
- + esac
- + ;;
- + esac
- + fi
-
- - if test "$prev" = dlfiles; then
- - # This library was specified with -dlopen.
- - dlfiles="$dlfiles $arg"
- - prev=
- - elif test "$prev" = dlprefiles; then
- - # The library was specified with -dlpreopen.
- - dlprefiles="$dlprefiles $arg"
- - prev=
- - else
- - deplibs="$deplibs $arg"
- - fi
- - continue
- - ;;
- + if test -n "$old_archive_from_expsyms_cmds"; then
- + # figure out the soname
- + set dummy $library_names
- + shift
- + realname="$1"
- + shift
- + libname=`eval "\\$ECHO \"$libname_spec\""`
- + # use dlname if we got it. it's perfectly good, no?
- + if test -n "$dlname"; then
- + soname="$dlname"
- + elif test -n "$soname_spec"; then
- + # bleh windows
- + case $host in
- + *cygwin* | mingw*)
- + major=`expr $current - $age`
- + versuffix="-$major"
- + ;;
- + esac
- + eval soname=\"$soname_spec\"
- + else
- + soname="$realname"
- + fi
-
- - # Some other compiler argument.
- - *)
- - # Unknown arguments in both finalize_command and compile_command need
- - # to be aesthetically quoted because they are evaled later.
- - func_quote_for_eval "$arg"
- - arg="$func_quote_for_eval_result"
- - ;;
- - esac # arg
- + # Make a new name for the extract_expsyms_cmds to use
- + soroot="$soname"
- + func_basename "$soroot"
- + soname="$func_basename_result"
- + func_stripname 'lib' '.dll' "$soname"
- + newlib=libimp-$func_stripname_result.a
-
- - # Now actually substitute the argument into the commands.
- - if test -n "$arg"; then
- - func_append compile_command " $arg"
- - func_append finalize_command " $arg"
- - fi
- - done # argument parsing loop
- + # If the library has no export list, then create one now
- + if test -f "$output_objdir/$soname-def"; then :
- + else
- + func_echo "extracting exported symbol list from \`$soname'"
- + func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
- + fi
-
- - test -n "$prev" && \
- - func_fatal_help "the \`$prevarg' option requires an argument"
- + # Create $newlib
- + if test -f "$output_objdir/$newlib"; then :; else
- + func_echo "generating import library for \`$soname'"
- + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
- + fi
- + # make sure the library variables are pointing to the new library
- + dir=$output_objdir
- + linklib=$newlib
- + fi # test -n "$old_archive_from_expsyms_cmds"
-
- - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- - eval arg=\"$export_dynamic_flag_spec\"
- - func_append compile_command " $arg"
- - func_append finalize_command " $arg"
- - fi
- + if test "$linkmode" = prog || test "$mode" != relink; then
- + add_shlibpath=
- + add_dir=
- + add=
- + lib_linked=yes
- + case $hardcode_action in
- + immediate | unsupported)
- + if test "$hardcode_direct" = no; then
- + add="$dir/$linklib"
- + case $host in
- + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- + *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- + *-*-unixware7*) add_dir="-L$dir" ;;
- + *-*-darwin* )
- + # if the lib is a (non-dlopened) module then we can not
- + # link against it, someone is ignoring the earlier warnings
- + if /usr/bin/file -L $add 2> /dev/null |
- + $GREP ": [^:]* bundle" >/dev/null ; then
- + if test "X$dlopenmodule" != "X$lib"; then
- + $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- + if test -z "$old_library" ; then
- + $ECHO
- + $ECHO "*** And there doesn't seem to be a static archive available"
- + $ECHO "*** The link will probably fail, sorry"
- + else
- + add="$dir/$old_library"
- + fi
- + elif test -n "$old_library"; then
- + add="$dir/$old_library"
- + fi
- + fi
- + esac
- + elif test "$hardcode_minus_L" = no; then
- + case $host in
- + *-*-sunos*) add_shlibpath="$dir" ;;
- + esac
- + add_dir="-L$dir"
- + add="-l$name"
- + elif test "$hardcode_shlibpath_var" = no; then
- + add_shlibpath="$dir"
- + add="-l$name"
- + else
- + lib_linked=no
- + fi
- + ;;
- + relink)
- + if test "$hardcode_direct" = yes; then
- + add="$dir/$linklib"
- + elif test "$hardcode_minus_L" = yes; then
- + add_dir="-L$dir"
- + # Try looking first in the location we're being installed to.
- + if test -n "$inst_prefix_dir"; then
- + case $libdir in
- + [\\/]*)
- + add_dir="$add_dir -L$inst_prefix_dir$libdir"
- + ;;
- + esac
- + fi
- + add="-l$name"
- + elif test "$hardcode_shlibpath_var" = yes; then
- + add_shlibpath="$dir"
- + add="-l$name"
- + else
- + lib_linked=no
- + fi
- + ;;
- + *) lib_linked=no ;;
- + esac
-
- - oldlibs=
- - # calculate the name of the file, without its directory
- - func_basename "$output"
- - outputname="$func_basename_result"
- - libobjs_save="$libobjs"
- + if test "$lib_linked" != yes; then
- + func_fatal_configuration "unsupported hardcode properties"
- + fi
-
- - if test -n "$shlibpath_var"; then
- - # get the directories listed in $shlibpath_var
- - eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- - else
- - shlib_search_path=
- - fi
- - eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
- + if test -n "$add_shlibpath"; then
- + case :$compile_shlibpath: in
- + *":$add_shlibpath:"*) ;;
- + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- + esac
- + fi
- + if test "$linkmode" = prog; then
- + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- + test -n "$add" && compile_deplibs="$add $compile_deplibs"
- + else
- + test -n "$add_dir" && deplibs="$add_dir $deplibs"
- + test -n "$add" && deplibs="$add $deplibs"
- + if test "$hardcode_direct" != yes &&
- + test "$hardcode_minus_L" != yes &&
- + test "$hardcode_shlibpath_var" = yes; then
- + case :$finalize_shlibpath: in
- + *":$libdir:"*) ;;
- + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- + esac
- + fi
- + fi
- + fi
-
- - func_dirname "$output" "/" ""
- - output_objdir="$func_dirname_result$objdir"
- - # Create the object directory.
- - func_mkdir_p "$output_objdir"
- + if test "$linkmode" = prog || test "$mode" = relink; then
- + add_shlibpath=
- + add_dir=
- + add=
- + # Finalize command for both is simple: just hardcode it.
- + if test "$hardcode_direct" = yes; then
- + add="$libdir/$linklib"
- + elif test "$hardcode_minus_L" = yes; then
- + add_dir="-L$libdir"
- + add="-l$name"
- + elif test "$hardcode_shlibpath_var" = yes; then
- + case :$finalize_shlibpath: in
- + *":$libdir:"*) ;;
- + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- + esac
- + add="-l$name"
- + elif test "$hardcode_automatic" = yes; then
- + if test -n "$inst_prefix_dir" &&
- + test -f "$inst_prefix_dir$libdir/$linklib" ; then
- + add="$inst_prefix_dir$libdir/$linklib"
- + else
- + add="$libdir/$linklib"
- + fi
- + else
- + # We cannot seem to hardcode it, guess we'll fake it.
- + add_dir="-L$libdir"
- + # Try looking first in the location we're being installed to.
- + if test -n "$inst_prefix_dir"; then
- + case $libdir in
- + [\\/]*)
- + add_dir="$add_dir -L$inst_prefix_dir$libdir"
- + ;;
- + esac
- + fi
- + add="-l$name"
- + fi
-
- - # Determine the type of output
- - case $output in
- - "")
- - func_fatal_help "you must specify an output file"
- - ;;
- - *.$libext) linkmode=oldlib ;;
- - *.lo | *.$objext) linkmode=obj ;;
- - *.la) linkmode=lib ;;
- - *) linkmode=prog ;; # Anything else should be a program.
- - esac
- + if test "$linkmode" = prog; then
- + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- + test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- + else
- + test -n "$add_dir" && deplibs="$add_dir $deplibs"
- + test -n "$add" && deplibs="$add $deplibs"
- + fi
- + fi
- + elif test "$linkmode" = prog; then
- + # Here we assume that one of hardcode_direct or hardcode_minus_L
- + # is not unsupported. This is valid on all known static and
- + # shared platforms.
- + if test "$hardcode_direct" != unsupported; then
- + test -n "$old_library" && linklib="$old_library"
- + compile_deplibs="$dir/$linklib $compile_deplibs"
- + finalize_deplibs="$dir/$linklib $finalize_deplibs"
- + else
- + compile_deplibs="-l$name -L$dir $compile_deplibs"
- + finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- + fi
- + elif test "$build_libtool_libs" = yes; then
- + # Not a shared library
- + if test "$deplibs_check_method" != pass_all; then
- + # We're trying link a shared library against a static one
- + # but the system doesn't support it.
-
- - specialdeplibs=
- + # Just print a warning and add the library to dependency_libs so
- + # that the program can be linked against the static library.
- + $ECHO
- + $ECHO "*** Warning: This system can not link to static lib archive $lib."
- + $ECHO "*** I have the capability to make that library automatically link in when"
- + $ECHO "*** you link to this library. But I can only do this if you have a"
- + $ECHO "*** shared version of the library, which you do not appear to have."
- + if test "$module" = yes; then
- + $ECHO "*** But as you try to build a module library, libtool will still create "
- + $ECHO "*** a static module, that should work as long as the dlopening application"
- + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
- + if test -z "$global_symbol_pipe"; then
- + $ECHO
- + $ECHO "*** However, this would only work if libtool was able to extract symbol"
- + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- + $ECHO "*** not find such a program. So, this module is probably useless."
- + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
- + fi
- + if test "$build_old_libs" = no; then
- + build_libtool_libs=module
- + build_old_libs=yes
- + else
- + build_libtool_libs=no
- + fi
- + fi
- + else
- + deplibs="$dir/$old_library $deplibs"
- + link_static=yes
- + fi
- + fi # link shared/static library?
-
- - libs=
- - # Find all interdependent deplibs by searching for libraries
- - # that are linked more than once (e.g. -la -lb -la)
- - for deplib in $deplibs; do
- - if $opt_duplicate_deps ; then
- - case "$libs " in
- - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- - esac
- - fi
- - libs="$libs $deplib"
- - done
- + if test "$linkmode" = lib; then
- + if test -n "$dependency_libs" &&
- + { test "$hardcode_into_libs" != yes ||
- + test "$build_old_libs" = yes ||
- + test "$link_static" = yes; }; then
- + # Extract -R from dependency_libs
- + temp_deplibs=
- + for libdir in $dependency_libs; do
- + case $libdir in
- + -R*) func_stripname '-R' '' "$libdir"
- + temp_xrpath=$func_stripname_result
- + case " $xrpath " in
- + *" $temp_xrpath "*) ;;
- + *) xrpath="$xrpath $temp_xrpath";;
- + esac;;
- + *) temp_deplibs="$temp_deplibs $libdir";;
- + esac
- + done
- + dependency_libs="$temp_deplibs"
- + fi
-
- - if test "$linkmode" = lib; then
- - libs="$predeps $libs $compiler_lib_search_path $postdeps"
- + newlib_search_path="$newlib_search_path $absdir"
- + # Link against this library
- + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- + # ... and its dependency_libs
- + tmp_libs=
- + for deplib in $dependency_libs; do
- + newdependency_libs="$deplib $newdependency_libs"
- + if $opt_duplicate_deps ; then
- + case "$tmp_libs " in
- + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- + esac
- + fi
- + tmp_libs="$tmp_libs $deplib"
- + done
-
- - # Compute libraries that are listed more than once in $predeps
- - # $postdeps and mark them as special (i.e., whose duplicates are
- - # not to be eliminated).
- - pre_post_deps=
- - if $opt_duplicate_compiler_generated_deps; then
- - for pre_post_dep in $predeps $postdeps; do
- - case "$pre_post_deps " in
- - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- - esac
- - pre_post_deps="$pre_post_deps $pre_post_dep"
- + if test "$link_all_deplibs" != no; then
- + # Add the search paths of all dependency libraries
- + for deplib in $dependency_libs; do
- + case $deplib in
- + -L*) path="$deplib" ;;
- + *.la)
- + func_dirname "$deplib" "" "."
- + dir="$func_dirname_result"
- + # We need an absolute path.
- + case $dir in
- + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- + *)
- + absdir=`cd "$dir" && pwd`
- + if test -z "$absdir"; then
- + func_warning "cannot determine absolute directory name of \`$dir'"
- + absdir="$dir"
- + fi
- + ;;
- + esac
- + if $GREP "^installed=no" $deplib > /dev/null; then
- + case $host in
- + *-*-darwin*)
- + depdepl=
- + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- + if test -n "$deplibrary_names" ; then
- + for tmp in $deplibrary_names ; do
- + depdepl=$tmp
- + done
- + if test -f "$absdir/$objdir/$depdepl" ; then
- + depdepl="$absdir/$objdir/$depdepl"
- + darwin_install_name=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
- + darwin_install_name=`$ECHO $darwin_install_name`
- + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
- + path=
- + fi
- + fi
- + ;;
- + *)
- + path="-L$absdir/$objdir"
- + ;;
- + esac
- + else
- + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- + test -z "$libdir" && \
- + func_fatal_error "\`$deplib' is not a valid libtool archive"
- + test "$absdir" != "$libdir" && \
- + func_warning "\`$deplib' seems to be moved"
- +
- + path="-L$absdir"
- + fi
- + ;;
- + esac
- + case " $deplibs " in
- + *" $path "*) ;;
- + *) deplibs="$path $deplibs" ;;
- + esac
- + done
- + fi # link_all_deplibs != no
- + fi # linkmode = lib
- + done # for deplib in $libs
- + dependency_libs="$newdependency_libs"
- + if test "$pass" = dlpreopen; then
- + # Link the dlpreopened libraries before other libraries
- + for deplib in $save_deplibs; do
- + deplibs="$deplib $deplibs"
- done
- fi
- - pre_post_deps=
- - fi
- -
- - deplibs=
- - newdependency_libs=
- - newlib_search_path=
- - need_relink=no # whether we're linking any uninstalled libtool libraries
- - notinst_deplibs= # not-installed libtool libraries
- - notinst_path= # paths that contain not-installed libtool libraries
- + if test "$pass" != dlopen; then
- + if test "$pass" != conv; then
- + # Make sure lib_search_path contains only unique directories.
- + lib_search_path=
- + for dir in $newlib_search_path; do
- + case "$lib_search_path " in
- + *" $dir "*) ;;
- + *) lib_search_path="$lib_search_path $dir" ;;
- + esac
- + done
- + newlib_search_path=
- + fi
-
- - case $linkmode in
- - lib)
- - passes="conv dlpreopen link"
- - for file in $dlfiles $dlprefiles; do
- - case $file in
- - *.la) ;;
- - *)
- - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
- - ;;
- - esac
- - done
- - ;;
- - prog)
- - compile_deplibs=
- - finalize_deplibs=
- - alldeplibs=no
- - newdlfiles=
- - newdlprefiles=
- - passes="conv scan dlopen dlpreopen link"
- - ;;
- - *) passes="conv"
- - ;;
- - esac
- -
- - for pass in $passes; do
- - # The preopen pass in lib mode reverses $deplibs; put it back here
- - # so that -L comes before libs that need it for instance...
- - if test "$linkmode,$pass" = "lib,link"; then
- - ## FIXME: Find the place where the list is rebuilt in the wrong
- - ## order, and fix it there properly
- - tmp_deplibs=
- - for deplib in $deplibs; do
- - tmp_deplibs="$deplib $tmp_deplibs"
- - done
- - deplibs="$tmp_deplibs"
- - fi
- -
- - if test "$linkmode,$pass" = "lib,link" ||
- - test "$linkmode,$pass" = "prog,scan"; then
- - libs="$deplibs"
- - deplibs=
- + if test "$linkmode,$pass" != "prog,link"; then
- + vars="deplibs"
- + else
- + vars="compile_deplibs finalize_deplibs"
- + fi
- + for var in $vars dependency_libs; do
- + # Add libraries to $var in reverse order
- + eval tmp_libs=\"\$$var\"
- + new_libs=
- + for deplib in $tmp_libs; do
- + # FIXME: Pedantically, this is the right thing to do, so
- + # that some nasty dependency loop isn't accidentally
- + # broken:
- + #new_libs="$deplib $new_libs"
- + # Pragmatically, this seems to cause very few problems in
- + # practice:
- + case $deplib in
- + -L*) new_libs="$deplib $new_libs" ;;
- + -R*) ;;
- + *)
- + # And here is the reason: when a library appears more
- + # than once as an explicit dependence of a library, or
- + # is implicitly linked in more than once by the
- + # compiler, it is considered special, and multiple
- + # occurrences thereof are not removed. Compare this
- + # with having the same library being listed as a
- + # dependency of multiple other libraries: in this case,
- + # we know (pedantically, we assume) the library does not
- + # need to be listed more than once, so we keep only the
- + # last copy. This is not always right, but it is rare
- + # enough that we require users that really mean to play
- + # such unportable linking tricks to link the library
- + # using -Wl,-lname, so that libtool does not consider it
- + # for duplicate removal.
- + case " $specialdeplibs " in
- + *" $deplib "*) new_libs="$deplib $new_libs" ;;
- + *)
- + case " $new_libs " in
- + *" $deplib "*) ;;
- + *) new_libs="$deplib $new_libs" ;;
- + esac
- + ;;
- + esac
- + ;;
- + esac
- + done
- + tmp_libs=
- + for deplib in $new_libs; do
- + case $deplib in
- + -L*)
- + case " $tmp_libs " in
- + *" $deplib "*) ;;
- + *) tmp_libs="$tmp_libs $deplib" ;;
- + esac
- + ;;
- + *) tmp_libs="$tmp_libs $deplib" ;;
- + esac
- + done
- + eval $var=\"$tmp_libs\"
- + done # for var
- fi
- - if test "$linkmode" = prog; then
- - case $pass in
- - dlopen) libs="$dlfiles" ;;
- - dlpreopen) libs="$dlprefiles" ;;
- - link)
- - libs="$deplibs %DEPLIBS%"
- - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- + # Last step: remove runtime libs from dependency_libs
- + # (they stay in deplibs)
- + tmp_libs=
- + for i in $dependency_libs ; do
- + case " $predeps $postdeps $compiler_lib_search_path " in
- + *" $i "*)
- + i=""
- ;;
- esac
- - fi
- - if test "$linkmode,$pass" = "lib,dlpreopen"; then
- - # Collect and forward deplibs of preopened libtool libs
- - for lib in $dlprefiles; do
- - # Ignore non-libtool-libs
- - dependency_libs=
- - case $lib in
- - *.la) func_source "$lib" ;;
- - esac
- + if test -n "$i" ; then
- + tmp_libs="$tmp_libs $i"
- + fi
- + done
- + dependency_libs=$tmp_libs
- + done # for pass
- + if test "$linkmode" = prog; then
- + dlfiles="$newdlfiles"
- + fi
- + if test "$linkmode" = prog || test "$linkmode" = lib; then
- + dlprefiles="$newdlprefiles"
- + fi
-
- - # Collect preopened libtool deplibs, except any this library
- - # has declared as weak libs
- - for deplib in $dependency_libs; do
- - deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
- - case " $weak_libs " in
- - *" $deplib_base "*) ;;
- - *) deplibs="$deplibs $deplib" ;;
- - esac
- - done
- - done
- - libs="$dlprefiles"
- - fi
- - if test "$pass" = dlopen; then
- - # Collect dlpreopened libraries
- - save_deplibs="$deplibs"
- - deplibs=
- + case $linkmode in
- + oldlib)
- + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- + func_warning "\`-dlopen' is ignored for archives"
- fi
-
- - for deplib in $libs; do
- - lib=
- - found=no
- - case $deplib in
- - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- - if test "$linkmode,$pass" = "prog,link"; then
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - else
- - compiler_flags="$compiler_flags $deplib"
- - if test "$linkmode" = lib ; then
- - case "$new_inherited_linker_flags " in
- - *" $deplib "*) ;;
- - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
- - esac
- - fi
- - fi
- - continue
- - ;;
- - -l*)
- - if test "$linkmode" != lib && test "$linkmode" != prog; then
- - func_warning "\`-l' is ignored for archives/objects"
- - continue
- - fi
- - func_stripname '-l' '' "$deplib"
- + test -n "$deplibs" && \
- + func_warning "\`-l' and \`-L' are ignored for archives"
- +
- +
- + test -n "$rpath" && \
- + func_warning "\`-rpath' is ignored for archives"
- +
- + test -n "$xrpath" && \
- + func_warning "\`-R' is ignored for archives"
- +
- + test -n "$vinfo" && \
- + func_warning "\`-version-info/-version-number' is ignored for archives"
- +
- + test -n "$release" && \
- + func_warning "\`-release' is ignored for archives"
- +
- + test -n "$export_symbols$export_symbols_regex" && \
- + func_warning "\`-export-symbols' is ignored for archives"
- +
- + # Now set the variables for building old libraries.
- + build_libtool_libs=no
- + oldlibs="$output"
- + objs="$objs$old_deplibs"
- + ;;
- +
- + lib)
- + # Make sure we only generate libraries of the form `libNAME.la'.
- + case $outputname in
- + lib*)
- + func_stripname 'lib' '.la' "$outputname"
- + name=$func_stripname_result
- + eval shared_ext=\"$shrext_cmds\"
- + eval libname=\"$libname_spec\"
- + ;;
- + *)
- + test "$module" = no && \
- + func_fatal_help "libtool library \`$output' must begin with \`lib'"
- +
- + if test "$need_lib_prefix" != no; then
- + # Add the "lib" prefix for modules if required
- + func_stripname '' '.la' "$outputname"
- name=$func_stripname_result
- - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
- - for search_ext in .la $std_shrext .so .a; do
- - # Search the libtool library
- - lib="$searchdir/lib${name}${search_ext}"
- - if test -f "$lib"; then
- - if test "$search_ext" = ".la"; then
- - found=yes
- - else
- - found=no
- - fi
- - break 2
- - fi
- - done
- - done
- - if test "$found" != yes; then
- - # deplib doesn't seem to be a libtool library
- - if test "$linkmode,$pass" = "prog,link"; then
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - else
- - deplibs="$deplib $deplibs"
- - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- - fi
- - continue
- - else # deplib is a libtool library
- - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- - # We need to do some special things here, and not later.
- - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- - case " $predeps $postdeps " in
- - *" $deplib "*)
- - if func_lalib_p "$lib"; then
- - library_names=
- - old_library=
- - func_source "$lib"
- - for l in $old_library $library_names; do
- - ll="$l"
- - done
- - if test "X$ll" = "X$old_library" ; then # only static version available
- - found=no
- - func_dirname "$lib" "" "."
- - ladir="$func_dirname_result"
- - lib=$ladir/$old_library
- - if test "$linkmode,$pass" = "prog,link"; then
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - else
- - deplibs="$deplib $deplibs"
- - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- - fi
- - continue
- - fi
- - fi
- - ;;
- - *) ;;
- - esac
- - fi
- - fi
- - ;; # -l
- - *.ltframework)
- - if test "$linkmode,$pass" = "prog,link"; then
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - else
- - deplibs="$deplib $deplibs"
- - if test "$linkmode" = lib ; then
- - case "$new_inherited_linker_flags " in
- - *" $deplib "*) ;;
- - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
- - esac
- - fi
- - fi
- - continue
- - ;;
- - -L*)
- - case $linkmode in
- - lib)
- - deplibs="$deplib $deplibs"
- - test "$pass" = conv && continue
- - newdependency_libs="$deplib $newdependency_libs"
- - func_stripname '-L' '' "$deplib"
- - newlib_search_path="$newlib_search_path $func_stripname_result"
- - ;;
- - prog)
- - if test "$pass" = conv; then
- - deplibs="$deplib $deplibs"
- - continue
- - fi
- - if test "$pass" = scan; then
- - deplibs="$deplib $deplibs"
- - else
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - fi
- - func_stripname '-L' '' "$deplib"
- - newlib_search_path="$newlib_search_path $func_stripname_result"
- - ;;
- - *)
- - func_warning "\`-L' is ignored for archives/objects"
- - ;;
- - esac # linkmode
- - continue
- - ;; # -L
- - -R*)
- - if test "$pass" = link; then
- - func_stripname '-R' '' "$deplib"
- - dir=$func_stripname_result
- - # Make sure the xrpath contains only unique directories.
- - case "$xrpath " in
- - *" $dir "*) ;;
- - *) xrpath="$xrpath $dir" ;;
- - esac
- - fi
- - deplibs="$deplib $deplibs"
- - continue
- - ;;
- - *.la) lib="$deplib" ;;
- - *.$libext)
- - if test "$pass" = conv; then
- - deplibs="$deplib $deplibs"
- - continue
- - fi
- - case $linkmode in
- - lib)
- - # Linking convenience modules into shared libraries is allowed,
- - # but linking other static libraries is non-portable.
- - case " $dlpreconveniencelibs " in
- - *" $deplib "*) ;;
- - *)
- - valid_a_lib=no
- - case $deplibs_check_method in
- - match_pattern*)
- - set dummy $deplibs_check_method; shift
- - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- - if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
- - | $EGREP "$match_pattern_regex" > /dev/null; then
- - valid_a_lib=yes
- - fi
- - ;;
- - pass_all)
- - valid_a_lib=yes
- - ;;
- - esac
- - if test "$valid_a_lib" != yes; then
- - $ECHO
- - $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- - $ECHO "*** I have the capability to make that library automatically link in when"
- - $ECHO "*** you link to this library. But I can only do this if you have a"
- - $ECHO "*** shared version of the library, which you do not appear to have"
- - $ECHO "*** because the file extensions .$libext of this argument makes me believe"
- - $ECHO "*** that it is just a static archive that I should not use here."
- - else
- - $ECHO
- - $ECHO "*** Warning: Linking the shared library $output against the"
- - $ECHO "*** static library $deplib is not portable!"
- - deplibs="$deplib $deplibs"
- - fi
- - ;;
- - esac
- - continue
- - ;;
- - prog)
- - if test "$pass" != link; then
- - deplibs="$deplib $deplibs"
- - else
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - fi
- - continue
- - ;;
- - esac # linkmode
- - ;; # *.$libext
- - *.lo | *.$objext)
- - if test "$pass" = conv; then
- - deplibs="$deplib $deplibs"
- - elif test "$linkmode" = prog; then
- - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- - # If there is no dlopen support or we're linking statically,
- - # we need to preload.
- - newdlprefiles="$newdlprefiles $deplib"
- - compile_deplibs="$deplib $compile_deplibs"
- - finalize_deplibs="$deplib $finalize_deplibs"
- - else
- - newdlfiles="$newdlfiles $deplib"
- - fi
- - fi
- - continue
- - ;;
- - %DEPLIBS%)
- - alldeplibs=yes
- - continue
- - ;;
- - esac # case $deplib
- + eval shared_ext=\"$shrext_cmds\"
- + eval libname=\"$libname_spec\"
- + else
- + func_stripname '' '.la' "$outputname"
- + libname=$func_stripname_result
- + fi
- + ;;
- + esac
-
- - if test "$found" = yes || test -f "$lib"; then :
- + if test -n "$objs"; then
- + if test "$deplibs_check_method" != pass_all; then
- + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
- else
- - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- + $ECHO
- + $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- + $ECHO "*** objects $objs is not portable!"
- + libobjs="$libobjs $objs"
- fi
- + fi
-
- - # Check to see that this really is a libtool archive.
- - func_lalib_unsafe_p "$lib" \
- - || func_fatal_error "\`$lib' is not a valid libtool archive"
- + test "$dlself" != no && \
- + func_warning "\`-dlopen self' is ignored for libtool libraries"
-
- - func_dirname "$lib" "" "."
- - ladir="$func_dirname_result"
- + set dummy $rpath
- + shift
- + test "$#" -gt 1 && \
- + func_warning "ignoring multiple \`-rpath's for a libtool library"
-
- - dlname=
- - dlopen=
- - dlpreopen=
- - libdir=
- - library_names=
- - old_library=
- - inherited_linker_flags=
- - # If the library was installed with an old release of libtool,
- - # it will not redefine variables installed, or shouldnotlink
- - installed=yes
- - shouldnotlink=no
- - avoidtemprpath=
- + install_libdir="$1"
-
- + oldlibs=
- + if test -z "$rpath"; then
- + if test "$build_libtool_libs" = yes; then
- + # Building a libtool convenience library.
- + # Some compilers have problems with a `.al' extension so
- + # convenience libraries should have the same extension an
- + # archive normally would.
- + oldlibs="$output_objdir/$libname.$libext $oldlibs"
- + build_libtool_libs=convenience
- + build_old_libs=yes
- + fi
-
- - # Read the .la file
- - func_source "$lib"
- + test -n "$vinfo" && \
- + func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
- - # Convert "-framework foo" to "foo.ltframework"
- - if test -n "$inherited_linker_flags"; then
- - tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
- - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- - case " $new_inherited_linker_flags " in
- - *" $tmp_inherited_linker_flag "*) ;;
- - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
- - esac
- - done
- - fi
- - dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - if test "$linkmode,$pass" = "lib,link" ||
- - test "$linkmode,$pass" = "prog,scan" ||
- - { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- - test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- - fi
- + test -n "$release" && \
- + func_warning "\`-release' is ignored for convenience libraries"
- + else
-
- - if test "$pass" = conv; then
- - # Only check for convenience libraries
- - deplibs="$lib $deplibs"
- - if test -z "$libdir"; then
- - if test -z "$old_library"; then
- - func_fatal_error "cannot find name of link library for \`$lib'"
- - fi
- - # It is a libtool convenience library, so add in its objects.
- - convenience="$convenience $ladir/$objdir/$old_library"
- - old_convenience="$old_convenience $ladir/$objdir/$old_library"
- - elif test "$linkmode" != prog && test "$linkmode" != lib; then
- - func_fatal_error "\`$lib' is not a convenience library"
- - fi
- - tmp_libs=
- - for deplib in $dependency_libs; do
- - deplibs="$deplib $deplibs"
- - if $opt_duplicate_deps ; then
- - case "$tmp_libs " in
- - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- - esac
- - fi
- - tmp_libs="$tmp_libs $deplib"
- - done
- - continue
- - fi # $pass = conv
- + # Parse the version information argument.
- + save_ifs="$IFS"; IFS=':'
- + set dummy $vinfo 0 0 0
- + shift
- + IFS="$save_ifs"
-
- + test -n "$7" && \
- + func_fatal_help "too many parameters to \`-version-info'"
-
- - # Get the name of the library we link against.
- - linklib=
- - for l in $old_library $library_names; do
- - linklib="$l"
- - done
- - if test -z "$linklib"; then
- - func_fatal_error "cannot find name of link library for \`$lib'"
- - fi
- + # convert absolute version numbers to libtool ages
- + # this retains compatibility with .la files and attempts
- + # to make the code below a bit more comprehensible
-
- - # This library was specified with -dlopen.
- - if test "$pass" = dlopen; then
- - if test -z "$libdir"; then
- - func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- - fi
- - if test -z "$dlname" ||
- - test "$dlopen_support" != yes ||
- - test "$build_libtool_libs" = no; then
- - # If there is no dlname, no dlopen support or we're linking
- - # statically, we need to preload. We also need to preload any
- - # dependent libraries so libltdl's deplib preloader doesn't
- - # bomb out in the load deplibs phase.
- - dlprefiles="$dlprefiles $lib $dependency_libs"
- - else
- - newdlfiles="$newdlfiles $lib"
- - fi
- - continue
- - fi # $pass = dlopen
- + case $vinfo_number in
- + yes)
- + number_major="$1"
- + number_minor="$2"
- + number_revision="$3"
- + #
- + # There are really only two kinds -- those that
- + # use the current revision as the major version
- + # and those that subtract age and use age as
- + # a minor version. But, then there is irix
- + # which has an extra 1 added just for fun
- + #
- + case $version_type in
- + darwin|linux|osf|windows)
- + current=`expr $number_major + $number_minor`
- + age="$number_minor"
- + revision="$number_revision"
- + ;;
- + freebsd-aout|freebsd-elf|sunos)
- + current="$number_major"
- + revision="$number_minor"
- + age="0"
- + ;;
- + irix|nonstopux)
- + current=`expr $number_major + $number_minor - 1`
- + age="$number_minor"
- + revision="$number_minor"
- + ;;
- + *)
- + $echo "$modename: unknown library version type \`$version_type'" 1>&2
- + $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- + exit $EXIT_FAILURE
- + ;;
- + esac
- + ;;
- + no)
- + current="$1"
- + revision="$2"
- + age="$3"
- + ;;
- + esac
-
- - # We need an absolute path.
- - case $ladir in
- - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- + # Check that each of the things are valid numbers.
- + case $current in
- + 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]) ;;
- *)
- - abs_ladir=`cd "$ladir" && pwd`
- - if test -z "$abs_ladir"; then
- - func_warning "cannot determine absolute directory name of \`$ladir'"
- - func_warning "passing it literally to the linker, although it might fail"
- - abs_ladir="$ladir"
- - fi
- + func_error "CURRENT \`$current' must be a nonnegative integer"
- + func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
- - func_basename "$lib"
- - laname="$func_basename_result"
-
- - # Find the relevant object directory and library name.
- - if test "X$installed" = Xyes; then
- - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- - func_warning "library \`$lib' was moved."
- - dir="$ladir"
- - absdir="$abs_ladir"
- - libdir="$abs_ladir"
- - else
- - dir="$libdir"
- - absdir="$libdir"
- - fi
- - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- - else
- - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- - dir="$ladir"
- - absdir="$abs_ladir"
- - # Remove this search path later
- - notinst_path="$notinst_path $abs_ladir"
- - else
- - dir="$ladir/$objdir"
- - absdir="$abs_ladir/$objdir"
- - # Remove this search path later
- - notinst_path="$notinst_path $abs_ladir"
- - fi
- - fi # $installed = yes
- - func_stripname 'lib' '.la' "$laname"
- - name=$func_stripname_result
- + case $revision in
- + 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]) ;;
- + *)
- + func_error "REVISION \`$revision' must be a nonnegative integer"
- + func_fatal_error "\`$vinfo' is not valid version information"
- + ;;
- + esac
-
- - # This library was specified with -dlpreopen.
- - if test "$pass" = dlpreopen; then
- - if test -z "$libdir" && test "$linkmode" = prog; then
- - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- - fi
- - # Prefer using a static library (so that no silly _DYNAMIC symbols
- - # are required to link).
- - if test -n "$old_library"; then
- - newdlprefiles="$newdlprefiles $dir/$old_library"
- - # Keep a list of preopened convenience libraries to check
- - # that they are being used correctly in the link pass.
- - test -z "$libdir" && \
- - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
- - # Otherwise, use the dlname, so that lt_dlopen finds it.
- - elif test -n "$dlname"; then
- - newdlprefiles="$newdlprefiles $dir/$dlname"
- - else
- - newdlprefiles="$newdlprefiles $dir/$linklib"
- - fi
- - fi # $pass = dlpreopen
- + case $age in
- + 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]) ;;
- + *)
- + func_error "AGE \`$age' must be a nonnegative integer"
- + func_fatal_error "\`$vinfo' is not valid version information"
- + ;;
- + esac
-
- - if test -z "$libdir"; then
- - # Link the convenience library
- - if test "$linkmode" = lib; then
- - deplibs="$dir/$old_library $deplibs"
- - elif test "$linkmode,$pass" = "prog,link"; then
- - compile_deplibs="$dir/$old_library $compile_deplibs"
- - finalize_deplibs="$dir/$old_library $finalize_deplibs"
- - else
- - deplibs="$lib $deplibs" # used for prog,scan pass
- - fi
- - continue
- + if test "$age" -gt "$current"; then
- + func_error "AGE \`$age' is greater than the current interface number \`$current'"
- + func_fatal_error "\`$vinfo' is not valid version information"
- fi
-
- + # Calculate the version variables.
- + major=
- + versuffix=
- + verstring=
- + case $version_type in
- + none) ;;
-
- - if test "$linkmode" = prog && test "$pass" != link; then
- - newlib_search_path="$newlib_search_path $ladir"
- - deplibs="$lib $deplibs"
- + darwin)
- + # Like Linux, but with the current version available in
- + # verstring for coding it into the library header
- + major=.`expr $current - $age`
- + versuffix="$major.$age.$revision"
- + # Darwin ld doesn't like 0 for these options...
- + minor_current=`expr $current + 1`
- + verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- + ;;
-
- - linkalldeplibs=no
- - if test "$link_all_deplibs" != no || test -z "$library_names" ||
- - test "$build_libtool_libs" = no; then
- - linkalldeplibs=yes
- - fi
- + freebsd-aout)
- + major=".$current"
- + versuffix=".$current.$revision";
- + ;;
-
- - tmp_libs=
- - for deplib in $dependency_libs; do
- - case $deplib in
- - -L*) func_stripname '-L' '' "$deplib"
- - newlib_search_path="$newlib_search_path $func_stripname_result"
- - ;;
- - esac
- - # Need to link against all dependency_libs?
- - if test "$linkalldeplibs" = yes; then
- - deplibs="$deplib $deplibs"
- - else
- - # Need to hardcode shared library paths
- - # or/and link against static libraries
- - newdependency_libs="$deplib $newdependency_libs"
- - fi
- - if $opt_duplicate_deps ; then
- - case "$tmp_libs " in
- - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- - esac
- - fi
- - tmp_libs="$tmp_libs $deplib"
- - done # for deplib
- - continue
- - fi # $linkmode = prog...
- + freebsd-elf)
- + major=".$current"
- + versuffix=".$current"
- + ;;
-
- - if test "$linkmode,$pass" = "prog,link"; then
- - if test -n "$library_names" &&
- - { { test "$prefer_static_libs" = no ||
- - test "$prefer_static_libs,$installed" = "built,yes"; } ||
- - test -z "$old_library"; }; then
- - # We need to hardcode the library path
- - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- - # Make sure the rpath contains only unique directories.
- - case "$temp_rpath:" in
- - *"$absdir:"*) ;;
- - *) temp_rpath="$temp_rpath$absdir:" ;;
- - esac
- - fi
- + irix | nonstopux)
- + major=`expr $current - $age + 1`
-
- - # Hardcode the library path.
- - # Skip directories that are in the system default run-time
- - # search path.
- - case " $sys_lib_dlsearch_path " in
- - *" $absdir "*) ;;
- - *)
- - case "$compile_rpath " in
- - *" $absdir "*) ;;
- - *) compile_rpath="$compile_rpath $absdir"
- - esac
- - ;;
- - esac
- - case " $sys_lib_dlsearch_path " in
- - *" $libdir "*) ;;
- - *)
- - case "$finalize_rpath " in
- - *" $libdir "*) ;;
- - *) finalize_rpath="$finalize_rpath $libdir"
- - esac
- - ;;
- - esac
- - fi # $linkmode,$pass = prog,link...
- + case $version_type in
- + nonstopux) verstring_prefix=nonstopux ;;
- + *) verstring_prefix=sgi ;;
- + esac
- + verstring="$verstring_prefix$major.$revision"
-
- - if test "$alldeplibs" = yes &&
- - { test "$deplibs_check_method" = pass_all ||
- - { test "$build_libtool_libs" = yes &&
- - test -n "$library_names"; }; }; then
- - # We only need to search for static libraries
- - continue
- - fi
- - fi
- + # Add in all the interfaces that we are compatible with.
- + loop=$revision
- + while test "$loop" -ne 0; do
- + iface=`expr $revision - $loop`
- + loop=`expr $loop - 1`
- + verstring="$verstring_prefix$major.$iface:$verstring"
- + done
-
- - link_static=no # Whether the deplib will be linked statically
- - use_static_libs=$prefer_static_libs
- - if test "$use_static_libs" = built && test "$installed" = yes; then
- - use_static_libs=no
- - fi
- - if test -n "$library_names" &&
- - { test "$use_static_libs" = no || test -z "$old_library"; }; then
- - case $host in
- - *cygwin* | *mingw*)
- - # No point in relinking DLLs because paths are not encoded
- - notinst_deplibs="$notinst_deplibs $lib"
- - need_relink=no
- + # Before this point, $major must not contain `.'.
- + major=.$major
- + versuffix="$major.$revision"
- + ;;
- +
- + linux)
- + major=.`expr $current - $age`
- + versuffix="$major.$age.$revision"
- + ;;
- +
- + osf)
- + major=.`expr $current - $age`
- + versuffix=".$current.$age.$revision"
- + verstring="$current.$age.$revision"
- +
- + # Add in all the interfaces that we are compatible with.
- + loop=$age
- + while test "$loop" -ne 0; do
- + iface=`expr $current - $loop`
- + loop=`expr $loop - 1`
- + verstring="$verstring:${iface}.0"
- + done
- +
- + # Make executables depend on our current version.
- + verstring="$verstring:${current}.0"
- + ;;
- +
- + qnx)
- + major=".$current"
- + versuffix=".$current"
- + ;;
- +
- + sunos)
- + major=".$current"
- + versuffix=".$current.$revision"
- + ;;
- +
- + windows)
- + # Use '-' rather than '.', since we only want one
- + # extension on DOS 8.3 filesystems.
- + major=`expr $current - $age`
- + versuffix="-$major"
- + ;;
- +
- + *)
- + func_fatal_configuration "unknown library version type \`$version_type'"
- + ;;
- + esac
- +
- + # Clear the version info if we defaulted, and they specified a release.
- + if test -z "$vinfo" && test -n "$release"; then
- + major=
- + case $version_type in
- + darwin)
- + # we can't check for "0.0" in archive_cmds due to quoting
- + # problems, so we reset it completely
- + verstring=
- ;;
- *)
- - if test "$installed" = no; then
- - notinst_deplibs="$notinst_deplibs $lib"
- - need_relink=yes
- - fi
- + verstring="0.0"
- ;;
- esac
- - # This is a shared library
- -
- - # Warn about portability, can't link against -module's on some
- - # systems (darwin). Don't bleat about dlopened modules though!
- - dlopenmodule=""
- - for dlpremoduletest in $dlprefiles; do
- - if test "X$dlpremoduletest" = "X$lib"; then
- - dlopenmodule="$dlpremoduletest"
- - break
- - fi
- - done
- - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- - $ECHO
- - if test "$linkmode" = prog; then
- - $ECHO "*** Warning: Linking the executable $output against the loadable module"
- - else
- - $ECHO "*** Warning: Linking the shared library $output against the loadable module"
- - fi
- - $ECHO "*** $linklib is not portable!"
- + if test "$need_version" = no; then
- + versuffix=
- + else
- + versuffix=".0.0"
- fi
- - if test "$linkmode" = lib &&
- - test "$hardcode_into_libs" = yes; then
- - # Hardcode the library path.
- - # Skip directories that are in the system default run-time
- - # search path.
- - case " $sys_lib_dlsearch_path " in
- - *" $absdir "*) ;;
- - *)
- - case "$compile_rpath " in
- - *" $absdir "*) ;;
- - *) compile_rpath="$compile_rpath $absdir"
- - esac
- - ;;
- - esac
- - case " $sys_lib_dlsearch_path " in
- - *" $libdir "*) ;;
- - *)
- - case "$finalize_rpath " in
- - *" $libdir "*) ;;
- - *) finalize_rpath="$finalize_rpath $libdir"
- - esac
- - ;;
- - esac
- + fi
- +
- + # Remove version info from name if versioning should be avoided
- + if test "$avoid_version" = yes && test "$need_version" = no; then
- + major=
- + versuffix=
- + verstring=""
- + fi
- +
- + # Check to see if the archive will have undefined symbols.
- + if test "$allow_undefined" = yes; then
- + if test "$allow_undefined_flag" = unsupported; then
- + func_warning "undefined symbols not allowed in $host shared libraries"
- + build_libtool_libs=no
- + build_old_libs=yes
- fi
- + else
- + # Don't allow undefined symbols.
- + allow_undefined_flag="$no_undefined_flag"
- + fi
-
- - if test -n "$old_archive_from_expsyms_cmds"; then
- - # figure out the soname
- - set dummy $library_names
- - shift
- - realname="$1"
- - shift
- - libname=`eval "\\$ECHO \"$libname_spec\""`
- - # use dlname if we got it. it's perfectly good, no?
- - if test -n "$dlname"; then
- - soname="$dlname"
- - elif test -n "$soname_spec"; then
- - # bleh windows
- - case $host in
- - *cygwin* | mingw*)
- - major=`expr $current - $age`
- - versuffix="-$major"
- - ;;
- - esac
- - eval soname=\"$soname_spec\"
- - else
- - soname="$realname"
- - fi
- + fi
-
- - # Make a new name for the extract_expsyms_cmds to use
- - soroot="$soname"
- - func_basename "$soroot"
- - soname="$func_basename_result"
- - func_stripname 'lib' '.dll' "$soname"
- - newlib=libimp-$func_stripname_result.a
- + func_generate_dlsyms "$libname" "$libname" "yes"
- + libobjs="$libobjs $symfileobj"
-
- - # If the library has no export list, then create one now
- - if test -f "$output_objdir/$soname-def"; then :
- - else
- - func_echo "extracting exported symbol list from \`$soname'"
- - func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
- - fi
- + if test "$mode" != relink; then
- + # Remove our outputs, but don't remove object files since they
- + # may have been created when compiling PIC objects.
- + removelist=
- + tempremovelist=`$ECHO "$output_objdir/*"`
- + for p in $tempremovelist; do
- + case $p in
- + *.$objext)
- + ;;
- + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- + if test "X$precious_files_regex" != "X"; then
- + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- + then
- + continue
- + fi
- + fi
- + removelist="$removelist $p"
- + ;;
- + *) ;;
- + esac
- + done
- + test -n "$removelist" && \
- + func_show_eval "${RM}r \$removelist"
- + fi
-
- - # Create $newlib
- - if test -f "$output_objdir/$newlib"; then :; else
- - func_echo "generating import library for \`$soname'"
- - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
- - fi
- - # make sure the library variables are pointing to the new library
- - dir=$output_objdir
- - linklib=$newlib
- - fi # test -n "$old_archive_from_expsyms_cmds"
- + # Now set the variables for building old libraries.
- + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- + oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
- - if test "$linkmode" = prog || test "$mode" != relink; then
- - add_shlibpath=
- - add_dir=
- - add=
- - lib_linked=yes
- - case $hardcode_action in
- - immediate | unsupported)
- - if test "$hardcode_direct" = no; then
- - add="$dir/$linklib"
- - case $host in
- - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- - *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- - *-*-unixware7*) add_dir="-L$dir" ;;
- - *-*-darwin* )
- - # if the lib is a (non-dlopened) module then we can not
- - # link against it, someone is ignoring the earlier warnings
- - if /usr/bin/file -L $add 2> /dev/null |
- - $GREP ": [^:]* bundle" >/dev/null ; then
- - if test "X$dlopenmodule" != "X$lib"; then
- - $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- - if test -z "$old_library" ; then
- - $ECHO
- - $ECHO "*** And there doesn't seem to be a static archive available"
- - $ECHO "*** The link will probably fail, sorry"
- - else
- - add="$dir/$old_library"
- - fi
- - elif test -n "$old_library"; then
- - add="$dir/$old_library"
- - fi
- - fi
- - esac
- - elif test "$hardcode_minus_L" = no; then
- - case $host in
- - *-*-sunos*) add_shlibpath="$dir" ;;
- - esac
- - add_dir="-L$dir"
- - add="-l$name"
- - elif test "$hardcode_shlibpath_var" = no; then
- - add_shlibpath="$dir"
- - add="-l$name"
- + # Transform .lo files to .o files.
- + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
- + fi
- +
- + # Eliminate all temporary directories.
- + for path in $notinst_path; do
- + lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e 's% $path % %g'`
- + deplibs=`$ECHO "X$deplibs " | $Xsed -e 's% -L$path % %g'`
- + dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e 's% -L$path % %g'`
- + done
- +
- + if test -n "$xrpath"; then
- + # If the user specified any rpath flags, then add them.
- + temp_xrpath=
- + for libdir in $xrpath; do
- + temp_xrpath="$temp_xrpath -R$libdir"
- + case "$finalize_rpath " in
- + *" $libdir "*) ;;
- + *) finalize_rpath="$finalize_rpath $libdir" ;;
- + esac
- + done
- + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- + dependency_libs="$temp_xrpath $dependency_libs"
- + fi
- + fi
- +
- + # Make sure dlfiles contains only unique files that won't be dlpreopened
- + old_dlfiles="$dlfiles"
- + dlfiles=
- + for lib in $old_dlfiles; do
- + case " $dlprefiles $dlfiles " in
- + *" $lib "*) ;;
- + *) dlfiles="$dlfiles $lib" ;;
- + esac
- + done
- +
- + # Make sure dlprefiles contains only unique files
- + old_dlprefiles="$dlprefiles"
- + dlprefiles=
- + for lib in $old_dlprefiles; do
- + case "$dlprefiles " in
- + *" $lib "*) ;;
- + *) dlprefiles="$dlprefiles $lib" ;;
- + esac
- + done
- +
- + if test "$build_libtool_libs" = yes; then
- + if test -n "$rpath"; then
- + case $host in
- + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
- + # these systems don't actually have a c library (as such)!
- + ;;
- + *-*-rhapsody* | *-*-darwin1.[012])
- + # Rhapsody C library is in the System framework
- + deplibs="$deplibs System.ltframework"
- + ;;
- + *-*-netbsd*)
- + # Don't link with libc until the a.out ld.so is fixed.
- + ;;
- + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- + # Do not include libc due to us having libc/libc_r.
- + ;;
- + *-*-sco3.2v5* | *-*-sco5v6*)
- + # Causes problems with __ctype
- + ;;
- + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- + # Compiler inserts libc in the correct place for threads to work
- + ;;
- + *)
- + # Add libc to deplibs on all other systems if necessary.
- + if test "$build_libtool_need_lc" = "yes"; then
- + deplibs="$deplibs -lc"
- + fi
- + ;;
- + esac
- + fi
- +
- + # Transform deplibs into only deplibs that can be linked in shared.
- + name_save=$name
- + libname_save=$libname
- + release_save=$release
- + versuffix_save=$versuffix
- + major_save=$major
- + # I'm not sure if I'm treating the release correctly. I think
- + # release should show up in the -l (ie -lgmp5) so we don't want to
- + # add it in twice. Is that correct?
- + release=""
- + versuffix=""
- + major=""
- + newdeplibs=
- + droppeddeps=no
- + case $deplibs_check_method in
- + pass_all)
- + # Don't check for shared/static. Everything works.
- + # This might be a little naive. We might want to check
- + # whether the library exists or not. But this is on
- + # osf3 & osf4 and I'm not really sure... Just
- + # implementing what was already the behavior.
- + newdeplibs=$deplibs
- + ;;
- + test_compile)
- + # This code stresses the "libraries are programs" paradigm to its
- + # limits. Maybe even breaks it. We compile a program, linking it
- + # against the deplibs as a proxy for the library. Then we can check
- + # whether they linked in statically or dynamically with ldd.
- + $opt_dry_run || $RM conftest.c
- + cat > conftest.c <<EOF
- + int main() { return 0; }
- +EOF
- + $opt_dry_run || $RM conftest
- + $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
- + if test "$?" -eq 0 ; then
- + ldd_output=`ldd conftest`
- + for i in $deplibs; do
- + name=`expr $i : '-l\(.*\)'`
- + # If $name is empty we are operating on a -L argument.
- + if test "$name" != "" && test "$name" -ne "0"; then
- + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- + case " $predeps $postdeps " in
- + *" $i "*)
- + newdeplibs="$newdeplibs $i"
- + i=""
- + ;;
- + esac
- + fi
- + if test -n "$i" ; then
- + libname=`eval "\\$ECHO \"$libname_spec\""`
- + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- + set dummy $deplib_matches; shift
- + deplib_match=$1
- + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- + newdeplibs="$newdeplibs $i"
- + else
- + droppeddeps=yes
- + $ECHO
- + $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- + $ECHO "*** I have the capability to make that library automatically link in when"
- + $ECHO "*** you link to this library. But I can only do this if you have a"
- + $ECHO "*** shared version of the library, which I believe you do not have"
- + $ECHO "*** because a test_compile did reveal that the linker did not use it for"
- + $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
- + fi
- + fi
- else
- - lib_linked=no
- + newdeplibs="$newdeplibs $i"
- fi
- - ;;
- - relink)
- - if test "$hardcode_direct" = yes &&
- - test "$hardcode_direct_absolute" = no; then
- - add="$dir/$linklib"
- - elif test "$hardcode_minus_L" = yes; then
- - add_dir="-L$dir"
- - # Try looking first in the location we're being installed to.
- - if test -n "$inst_prefix_dir"; then
- - case $libdir in
- - [\\/]*)
- - add_dir="$add_dir -L$inst_prefix_dir$libdir"
- + done
- + else
- + # Error occurred in the first compile. Let's try to salvage
- + # the situation: Compile a separate program for each library.
- + for i in $deplibs; do
- + name=`expr $i : '-l\(.*\)'`
- + # If $name is empty we are operating on a -L argument.
- + if test "$name" != "" && test "$name" != "0"; then
- + $opt_dry_run || $RM conftest
- + $LTCC $LTCFLAGS -o conftest conftest.c $i
- + # Did it work?
- + if test "$?" -eq 0 ; then
- + ldd_output=`ldd conftest`
- + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- + case " $predeps $postdeps " in
- + *" $i "*)
- + newdeplibs="$newdeplibs $i"
- + i=""
- ;;
- - esac
- + esac
- + fi
- + if test -n "$i" ; then
- + libname=`eval "\\$ECHO \"$libname_spec\""`
- + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- + set dummy $deplib_matches; shift
- + deplib_match=$1
- + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- + newdeplibs="$newdeplibs $i"
- + else
- + droppeddeps=yes
- + $ECHO
- + $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- + $ECHO "*** I have the capability to make that library automatically link in when"
- + $ECHO "*** you link to this library. But I can only do this if you have a"
- + $ECHO "*** shared version of the library, which you do not appear to have"
- + $ECHO "*** because a test_compile did reveal that the linker did not use this one"
- + $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
- + fi
- + fi
- + else
- + droppeddeps=yes
- + $ECHO
- + $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- + $ECHO "*** make it link in! You will probably need to install it or some"
- + $ECHO "*** library that it depends on before this library will be fully"
- + $ECHO "*** functional. Installing it before continuing would be even better."
- fi
- - add="-l$name"
- - elif test "$hardcode_shlibpath_var" = yes; then
- - add_shlibpath="$dir"
- - add="-l$name"
- else
- - lib_linked=no
- + newdeplibs="$newdeplibs $i"
- fi
- - ;;
- - *) lib_linked=no ;;
- - esac
- -
- - if test "$lib_linked" != yes; then
- - func_fatal_configuration "unsupported hardcode properties"
- - fi
- -
- - if test -n "$add_shlibpath"; then
- - case :$compile_shlibpath: in
- - *":$add_shlibpath:"*) ;;
- - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- - esac
- - fi
- - if test "$linkmode" = prog; then
- - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- - test -n "$add" && compile_deplibs="$add $compile_deplibs"
- - else
- - test -n "$add_dir" && deplibs="$add_dir $deplibs"
- - test -n "$add" && deplibs="$add $deplibs"
- - if test "$hardcode_direct" != yes &&
- - test "$hardcode_minus_L" != yes &&
- - test "$hardcode_shlibpath_var" = yes; then
- - case :$finalize_shlibpath: in
- - *":$libdir:"*) ;;
- - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- + done
- + fi
- + ;;
- + file_magic*)
- + set dummy $deplibs_check_method; shift
- + file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- + for a_deplib in $deplibs; do
- + name=`expr $a_deplib : '-l\(.*\)'`
- + # If $name is empty we are operating on a -L argument.
- + if test "$name" != "" && test "$name" != "0"; then
- + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- + case " $predeps $postdeps " in
- + *" $a_deplib "*)
- + newdeplibs="$newdeplibs $a_deplib"
- + a_deplib=""
- + ;;
- esac
- fi
- - fi
- - fi
- -
- - if test "$linkmode" = prog || test "$mode" = relink; then
- - add_shlibpath=
- - add_dir=
- - add=
- - # Finalize command for both is simple: just hardcode it.
- - if test "$hardcode_direct" = yes &&
- - test "$hardcode_direct_absolute" = no; then
- - add="$libdir/$linklib"
- - elif test "$hardcode_minus_L" = yes; then
- - add_dir="-L$libdir"
- - add="-l$name"
- - elif test "$hardcode_shlibpath_var" = yes; then
- - case :$finalize_shlibpath: in
- - *":$libdir:"*) ;;
- - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- - esac
- - add="-l$name"
- - elif test "$hardcode_automatic" = yes; then
- - if test -n "$inst_prefix_dir" &&
- - test -f "$inst_prefix_dir$libdir/$linklib" ; then
- - add="$inst_prefix_dir$libdir/$linklib"
- - else
- - add="$libdir/$linklib"
- + if test -n "$a_deplib" ; then
- + libname=`eval "\\$ECHO \"$libname_spec\""`
- + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- + for potent_lib in $potential_libs; do
- + # Follow soft links.
- + if ls -lLd "$potent_lib" 2>/dev/null |
- + $GREP " -> " >/dev/null; then
- + continue
- + fi
- + # The statement above tries to avoid entering an
- + # endless loop below, in case of cyclic links.
- + # We might still enter an endless loop, since a link
- + # loop can be closed while we follow links,
- + # but so what?
- + potlib="$potent_lib"
- + while test -h "$potlib" 2>/dev/null; do
- + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- + case $potliblink in
- + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
- + esac
- + done
- + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- + $SED -e 10q |
- + $EGREP "$file_magic_regex" > /dev/null; then
- + newdeplibs="$newdeplibs $a_deplib"
- + a_deplib=""
- + break 2
- + fi
- + done
- + done
- fi
- - else
- - # We cannot seem to hardcode it, guess we'll fake it.
- - add_dir="-L$libdir"
- - # Try looking first in the location we're being installed to.
- - if test -n "$inst_prefix_dir"; then
- - case $libdir in
- - [\\/]*)
- - add_dir="$add_dir -L$inst_prefix_dir$libdir"
- - ;;
- - esac
- + if test -n "$a_deplib" ; then
- + droppeddeps=yes
- + $ECHO
- + $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- + $ECHO "*** I have the capability to make that library automatically link in when"
- + $ECHO "*** you link to this library. But I can only do this if you have a"
- + $ECHO "*** shared version of the library, which you do not appear to have"
- + $ECHO "*** because I did check the linker path looking for a file starting"
- + if test -z "$potlib" ; then
- + $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
- + else
- + $ECHO "*** with $libname and none of the candidates passed a file format test"
- + $ECHO "*** using a file magic. Last file checked: $potlib"
- + fi
- fi
- - add="-l$name"
- - fi
- -
- - if test "$linkmode" = prog; then
- - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- - test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- - test -n "$add_dir" && deplibs="$add_dir $deplibs"
- - test -n "$add" && deplibs="$add $deplibs"
- + # Add a -L argument.
- + newdeplibs="$newdeplibs $a_deplib"
- fi
- - fi
- - elif test "$linkmode" = prog; then
- - # Here we assume that one of hardcode_direct or hardcode_minus_L
- - # is not unsupported. This is valid on all known static and
- - # shared platforms.
- - if test "$hardcode_direct" != unsupported; then
- - test -n "$old_library" && linklib="$old_library"
- - compile_deplibs="$dir/$linklib $compile_deplibs"
- - finalize_deplibs="$dir/$linklib $finalize_deplibs"
- - else
- - compile_deplibs="-l$name -L$dir $compile_deplibs"
- - finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- - fi
- - elif test "$build_libtool_libs" = yes; then
- - # Not a shared library
- - if test "$deplibs_check_method" != pass_all; then
- - # We're trying link a shared library against a static one
- - # but the system doesn't support it.
- -
- - # Just print a warning and add the library to dependency_libs so
- - # that the program can be linked against the static library.
- - $ECHO
- - $ECHO "*** Warning: This system can not link to static lib archive $lib."
- - $ECHO "*** I have the capability to make that library automatically link in when"
- - $ECHO "*** you link to this library. But I can only do this if you have a"
- - $ECHO "*** shared version of the library, which you do not appear to have."
- - if test "$module" = yes; then
- - $ECHO "*** But as you try to build a module library, libtool will still create "
- - $ECHO "*** a static module, that should work as long as the dlopening application"
- - $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
- - if test -z "$global_symbol_pipe"; then
- - $ECHO
- - $ECHO "*** However, this would only work if libtool was able to extract symbol"
- - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- - $ECHO "*** not find such a program. So, this module is probably useless."
- - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
- + done # Gone through all deplibs.
- + ;;
- + match_pattern*)
- + set dummy $deplibs_check_method; shift
- + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- + for a_deplib in $deplibs; do
- + name=`expr $a_deplib : '-l\(.*\)'`
- + # If $name is empty we are operating on a -L argument.
- + if test -n "$name" && test "$name" != "0"; then
- + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- + case " $predeps $postdeps " in
- + *" $a_deplib "*)
- + newdeplibs="$newdeplibs $a_deplib"
- + a_deplib=""
- + ;;
- + esac
- fi
- - if test "$build_old_libs" = no; then
- - build_libtool_libs=module
- - build_old_libs=yes
- - else
- - build_libtool_libs=no
- + if test -n "$a_deplib" ; then
- + libname=`eval "\\$ECHO \"$libname_spec\""`
- + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- + potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- + for potent_lib in $potential_libs; do
- + potlib="$potent_lib" # see symlink-check above in file_magic test
- + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
- + $EGREP "$match_pattern_regex" > /dev/null; then
- + newdeplibs="$newdeplibs $a_deplib"
- + a_deplib=""
- + break 2
- + fi
- + done
- + done
- + fi
- + if test -n "$a_deplib" ; then
- + droppeddeps=yes
- + $ECHO
- + $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- + $ECHO "*** I have the capability to make that library automatically link in when"
- + $ECHO "*** you link to this library. But I can only do this if you have a"
- + $ECHO "*** shared version of the library, which you do not appear to have"
- + $ECHO "*** because I did check the linker path looking for a file starting"
- + if test -z "$potlib" ; then
- + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
- + else
- + $ECHO "*** with $libname and none of the candidates passed a file format test"
- + $ECHO "*** using a regex pattern. Last file checked: $potlib"
- + fi
- fi
- + else
- + # Add a -L argument.
- + newdeplibs="$newdeplibs $a_deplib"
- fi
- - else
- - deplibs="$dir/$old_library $deplibs"
- - link_static=yes
- - fi
- - fi # link shared/static library?
- -
- - if test "$linkmode" = lib; then
- - if test -n "$dependency_libs" &&
- - { test "$hardcode_into_libs" != yes ||
- - test "$build_old_libs" = yes ||
- - test "$link_static" = yes; }; then
- - # Extract -R from dependency_libs
- - temp_deplibs=
- - for libdir in $dependency_libs; do
- - case $libdir in
- - -R*) func_stripname '-R' '' "$libdir"
- - temp_xrpath=$func_stripname_result
- - case " $xrpath " in
- - *" $temp_xrpath "*) ;;
- - *) xrpath="$xrpath $temp_xrpath";;
- - esac;;
- - *) temp_deplibs="$temp_deplibs $libdir";;
- - esac
- + done # Gone through all deplibs.
- + ;;
- + none | unknown | *)
- + newdeplibs=""
- + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
- + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
- + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- + for i in $predeps $postdeps ; do
- + # can't use Xsed below, because $i might contain '/'
- + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
- done
- - dependency_libs="$temp_deplibs"
- fi
- -
- - newlib_search_path="$newlib_search_path $absdir"
- - # Link against this library
- - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- - # ... and its dependency_libs
- - tmp_libs=
- - for deplib in $dependency_libs; do
- - newdependency_libs="$deplib $newdependency_libs"
- - if $opt_duplicate_deps ; then
- - case "$tmp_libs " in
- - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- - esac
- + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
- + $GREP . >/dev/null; then
- + $ECHO
- + if test "X$deplibs_check_method" = "Xnone"; then
- + $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
- + else
- + $ECHO "*** Warning: inter-library dependencies are not known to be supported."
- fi
- - tmp_libs="$tmp_libs $deplib"
- - done
- -
- - if test "$link_all_deplibs" != no; then
- - # Add the search paths of all dependency libraries
- - for deplib in $dependency_libs; do
- - case $deplib in
- - -L*) path="$deplib" ;;
- - *.la)
- - func_dirname "$deplib" "" "."
- - dir="$func_dirname_result"
- - # We need an absolute path.
- - case $dir in
- - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- - *)
- - absdir=`cd "$dir" && pwd`
- - if test -z "$absdir"; then
- - func_warning "cannot determine absolute directory name of \`$dir'"
- - absdir="$dir"
- - fi
- - ;;
- - esac
- - if $GREP "^installed=no" $deplib > /dev/null; then
- - case $host in
- - *-*-darwin*)
- - depdepl=
- - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- - if test -n "$deplibrary_names" ; then
- - for tmp in $deplibrary_names ; do
- - depdepl=$tmp
- - done
- - if test -f "$absdir/$objdir/$depdepl" ; then
- - depdepl="$absdir/$objdir/$depdepl"
- - darwin_install_name=`otool -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
- - darwin_install_name=`$ECHO $darwin_install_name`
- - if test -z "$darwin_install_name"; then
- - darwin_install_name=`otool64 -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'`
- - darwin_install_name=`$ECHO $darwin_install_name`
- - fi
- - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
- - path=
- - fi
- - fi
- - ;;
- - *)
- - path="-L$absdir/$objdir"
- - ;;
- - esac
- - else
- - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- - test -z "$libdir" && \
- - func_fatal_error "\`$deplib' is not a valid libtool archive"
- - test "$absdir" != "$libdir" && \
- - func_warning "\`$deplib' seems to be moved"
- -
- - path="-L$absdir"
- - fi
- - ;;
- - esac
- - case " $deplibs " in
- - *" $path "*) ;;
- - *) deplibs="$path $deplibs" ;;
- - esac
- - done
- - fi # link_all_deplibs != no
- - fi # linkmode = lib
- - done # for deplib in $libs
- - if test "$pass" = link; then
- - if test "$linkmode" = "prog"; then
- - compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- - else
- - compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - fi
- - fi
- - dependency_libs="$newdependency_libs"
- - if test "$pass" = dlpreopen; then
- - # Link the dlpreopened libraries before other libraries
- - for deplib in $save_deplibs; do
- - deplibs="$deplib $deplibs"
- - done
- - fi
- - if test "$pass" != dlopen; then
- - if test "$pass" != conv; then
- - # Make sure lib_search_path contains only unique directories.
- - lib_search_path=
- - for dir in $newlib_search_path; do
- - case "$lib_search_path " in
- - *" $dir "*) ;;
- - *) lib_search_path="$lib_search_path $dir" ;;
- - esac
- - done
- - newlib_search_path=
- - fi
- -
- - if test "$linkmode,$pass" != "prog,link"; then
- - vars="deplibs"
- - else
- - vars="compile_deplibs finalize_deplibs"
- - fi
- - for var in $vars dependency_libs; do
- - # Add libraries to $var in reverse order
- - eval tmp_libs=\"\$$var\"
- - new_libs=
- - for deplib in $tmp_libs; do
- - # FIXME: Pedantically, this is the right thing to do, so
- - # that some nasty dependency loop isn't accidentally
- - # broken:
- - #new_libs="$deplib $new_libs"
- - # Pragmatically, this seems to cause very few problems in
- - # practice:
- - case $deplib in
- - -L*) new_libs="$deplib $new_libs" ;;
- - -R*) ;;
- - *)
- - # And here is the reason: when a library appears more
- - # than once as an explicit dependence of a library, or
- - # is implicitly linked in more than once by the
- - # compiler, it is considered special, and multiple
- - # occurrences thereof are not removed. Compare this
- - # with having the same library being listed as a
- - # dependency of multiple other libraries: in this case,
- - # we know (pedantically, we assume) the library does not
- - # need to be listed more than once, so we keep only the
- - # last copy. This is not always right, but it is rare
- - # enough that we require users that really mean to play
- - # such unportable linking tricks to link the library
- - # using -Wl,-lname, so that libtool does not consider it
- - # for duplicate removal.
- - case " $specialdeplibs " in
- - *" $deplib "*) new_libs="$deplib $new_libs" ;;
- - *)
- - case " $new_libs " in
- - *" $deplib "*) ;;
- - *) new_libs="$deplib $new_libs" ;;
- - esac
- - ;;
- - esac
- - ;;
- - esac
- - done
- - tmp_libs=
- - for deplib in $new_libs; do
- - case $deplib in
- - -L*)
- - case " $tmp_libs " in
- - *" $deplib "*) ;;
- - *) tmp_libs="$tmp_libs $deplib" ;;
- - esac
- - ;;
- - *) tmp_libs="$tmp_libs $deplib" ;;
- - esac
- - done
- - eval $var=\"$tmp_libs\"
- - done # for var
- - fi
- - # Last step: remove runtime libs from dependency_libs
- - # (they stay in deplibs)
- - tmp_libs=
- - for i in $dependency_libs ; do
- - case " $predeps $postdeps $compiler_lib_search_path " in
- - *" $i "*)
- - i=""
- - ;;
- - esac
- - if test -n "$i" ; then
- - tmp_libs="$tmp_libs $i"
- - fi
- - done
- - dependency_libs=$tmp_libs
- - done # for pass
- - if test "$linkmode" = prog; then
- - dlfiles="$newdlfiles"
- - fi
- - if test "$linkmode" = prog || test "$linkmode" = lib; then
- - dlprefiles="$newdlprefiles"
- - fi
- -
- - case $linkmode in
- - oldlib)
- - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- - func_warning "\`-dlopen' is ignored for archives"
- - fi
- -
- - test -n "$deplibs" && \
- - func_warning "\`-l' and \`-L' are ignored for archives"
- -
- -
- - test -n "$rpath" && \
- - func_warning "\`-rpath' is ignored for archives"
- -
- - test -n "$xrpath" && \
- - func_warning "\`-R' is ignored for archives"
- -
- - test -n "$vinfo" && \
- - func_warning "\`-version-info/-version-number' is ignored for archives"
- -
- - test -n "$release" && \
- - func_warning "\`-release' is ignored for archives"
- -
- - test -n "$export_symbols$export_symbols_regex" && \
- - func_warning "\`-export-symbols' is ignored for archives"
- -
- - # Now set the variables for building old libraries.
- - build_libtool_libs=no
- - oldlibs="$output"
- - objs="$objs$old_deplibs"
- - ;;
- -
- - lib)
- - # Make sure we only generate libraries of the form `libNAME.la'.
- - case $outputname in
- - lib*)
- - func_stripname 'lib' '.la' "$outputname"
- - name=$func_stripname_result
- - eval shared_ext=\"$shrext_cmds\"
- - eval libname=\"$libname_spec\"
- - ;;
- - *)
- - test "$module" = no && \
- - func_fatal_help "libtool library \`$output' must begin with \`lib'"
- -
- - if test "$need_lib_prefix" != no; then
- - # Add the "lib" prefix for modules if required
- - func_stripname '' '.la' "$outputname"
- - name=$func_stripname_result
- - eval shared_ext=\"$shrext_cmds\"
- - eval libname=\"$libname_spec\"
- - else
- - func_stripname '' '.la' "$outputname"
- - libname=$func_stripname_result
- - fi
- - ;;
- - esac
- -
- - if test -n "$objs"; then
- - if test "$deplibs_check_method" != pass_all; then
- - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
- - else
- - $ECHO
- - $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- - $ECHO "*** objects $objs is not portable!"
- - libobjs="$libobjs $objs"
- - fi
- - fi
- -
- - test "$dlself" != no && \
- - func_warning "\`-dlopen self' is ignored for libtool libraries"
- -
- - set dummy $rpath
- - shift
- - test "$#" -gt 1 && \
- - func_warning "ignoring multiple \`-rpath's for a libtool library"
- -
- - install_libdir="$1"
- -
- - oldlibs=
- - if test -z "$rpath"; then
- - if test "$build_libtool_libs" = yes; then
- - # Building a libtool convenience library.
- - # Some compilers have problems with a `.al' extension so
- - # convenience libraries should have the same extension an
- - # archive normally would.
- - oldlibs="$output_objdir/$libname.$libext $oldlibs"
- - build_libtool_libs=convenience
- - build_old_libs=yes
- - fi
- -
- - test -n "$vinfo" && \
- - func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
- -
- - test -n "$release" && \
- - func_warning "\`-release' is ignored for convenience libraries"
- - else
- -
- - # Parse the version information argument.
- - save_ifs="$IFS"; IFS=':'
- - set dummy $vinfo 0 0 0
- - shift
- - IFS="$save_ifs"
- -
- - test -n "$7" && \
- - func_fatal_help "too many parameters to \`-version-info'"
- -
- - # convert absolute version numbers to libtool ages
- - # this retains compatibility with .la files and attempts
- - # to make the code below a bit more comprehensible
- -
- - case $vinfo_number in
- - yes)
- - number_major="$1"
- - number_minor="$2"
- - number_revision="$3"
- - #
- - # There are really only two kinds -- those that
- - # use the current revision as the major version
- - # and those that subtract age and use age as
- - # a minor version. But, then there is irix
- - # which has an extra 1 added just for fun
- - #
- - case $version_type in
- - darwin|linux|osf|windows|none)
- - current=`expr $number_major + $number_minor`
- - age="$number_minor"
- - revision="$number_revision"
- - ;;
- - freebsd-aout|freebsd-elf|sunos)
- - current="$number_major"
- - revision="$number_minor"
- - age="0"
- - ;;
- - irix|nonstopux)
- - current=`expr $number_major + $number_minor - 1`
- - age="$number_minor"
- - revision="$number_minor"
- - ;;
- - *)
- - func_fatal_configuration "$modename: unknown library version type \`$version_type'"
- - ;;
- - esac
- - ;;
- - no)
- - current="$1"
- - revision="$2"
- - age="$3"
- - ;;
- - esac
- -
- - # Check that each of the things are valid numbers.
- - case $current in
- - 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]) ;;
- - *)
- - func_error "CURRENT \`$current' must be a nonnegative integer"
- - func_fatal_error "\`$vinfo' is not valid version information"
- - ;;
- - esac
- -
- - case $revision in
- - 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]) ;;
- - *)
- - func_error "REVISION \`$revision' must be a nonnegative integer"
- - func_fatal_error "\`$vinfo' is not valid version information"
- - ;;
- - esac
- -
- - case $age in
- - 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]) ;;
- - *)
- - func_error "AGE \`$age' must be a nonnegative integer"
- - func_fatal_error "\`$vinfo' is not valid version information"
- + $ECHO "*** All declared inter-library dependencies are being dropped."
- + droppeddeps=yes
- + fi
- ;;
- esac
- + versuffix=$versuffix_save
- + major=$major_save
- + release=$release_save
- + libname=$libname_save
- + name=$name_save
-
- - if test "$age" -gt "$current"; then
- - func_error "AGE \`$age' is greater than the current interface number \`$current'"
- - func_fatal_error "\`$vinfo' is not valid version information"
- - fi
- -
- - # Calculate the version variables.
- - major=
- - versuffix=
- - verstring=
- - case $version_type in
- - none) ;;
- -
- - darwin)
- - # Like Linux, but with the current version available in
- - # verstring for coding it into the library header
- - major=.`expr $current - $age`
- - versuffix="$major.$age.$revision"
- - # Darwin ld doesn't like 0 for these options...
- - minor_current=`expr $current + 1`
- - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- + case $host in
- + *-*-rhapsody* | *-*-darwin1.[012])
- + # On Rhapsody replace the C library with the System framework
- + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- ;;
- + esac
-
- - freebsd-aout)
- - major=".$current"
- - versuffix=".$current.$revision";
- - ;;
- + if test "$droppeddeps" = yes; then
- + if test "$module" = yes; then
- + $ECHO
- + $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
- + $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- + $ECHO "*** a static module, that should work as long as the dlopening"
- + $ECHO "*** application is linked with the -dlopen flag."
- + if test -z "$global_symbol_pipe"; then
- + $ECHO
- + $ECHO "*** However, this would only work if libtool was able to extract symbol"
- + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- + $ECHO "*** not find such a program. So, this module is probably useless."
- + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
- + fi
- + if test "$build_old_libs" = no; then
- + oldlibs="$output_objdir/$libname.$libext"
- + build_libtool_libs=module
- + build_old_libs=yes
- + else
- + build_libtool_libs=no
- + fi
- + else
- + $ECHO "*** The inter-library dependencies that have been dropped here will be"
- + $ECHO "*** automatically added whenever a program is linked with this library"
- + $ECHO "*** or is declared to -dlopen it."
-
- - freebsd-elf)
- - major=".$current"
- - versuffix=".$current"
- + if test "$allow_undefined" = no; then
- + $ECHO
- + $ECHO "*** Since this library must not contain undefined symbols,"
- + $ECHO "*** because either the platform does not support them or"
- + $ECHO "*** it was explicitly requested with -no-undefined,"
- + $ECHO "*** libtool will only create a static version of it."
- + if test "$build_old_libs" = no; then
- + oldlibs="$output_objdir/$libname.$libext"
- + build_libtool_libs=module
- + build_old_libs=yes
- + else
- + build_libtool_libs=no
- + fi
- + fi
- + fi
- + fi
- + # Done checking deplibs!
- + deplibs=$newdeplibs
- + fi
- + # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- + case $host in
- + *-*-darwin*)
- + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- + esac
-
- - irix | nonstopux)
- - major=`expr $current - $age + 1`
- -
- - case $version_type in
- - nonstopux) verstring_prefix=nonstopux ;;
- - *) verstring_prefix=sgi ;;
- + # move library search paths that coincide with paths to not yet
- + # installed libraries to the beginning of the library search list
- + new_libs=
- + for path in $notinst_path; do
- + case " $new_libs " in
- + *" -L$path/$objdir "*) ;;
- + *)
- + case " $deplibs " in
- + *" -L$path/$objdir "*)
- + new_libs="$new_libs -L$path/$objdir" ;;
- esac
- - verstring="$verstring_prefix$major.$revision"
- -
- - # Add in all the interfaces that we are compatible with.
- - loop=$revision
- - while test "$loop" -ne 0; do
- - iface=`expr $revision - $loop`
- - loop=`expr $loop - 1`
- - verstring="$verstring_prefix$major.$iface:$verstring"
- - done
- -
- - # Before this point, $major must not contain `.'.
- - major=.$major
- - versuffix="$major.$revision"
- ;;
- -
- - linux)
- - major=.`expr $current - $age`
- - versuffix="$major.$age.$revision"
- + esac
- + done
- + for deplib in $deplibs; do
- + case $deplib in
- + -L*)
- + case " $new_libs " in
- + *" $deplib "*) ;;
- + *) new_libs="$new_libs $deplib" ;;
- + esac
- ;;
- + *) new_libs="$new_libs $deplib" ;;
- + esac
- + done
- + deplibs="$new_libs"
-
- - osf)
- - major=.`expr $current - $age`
- - versuffix=".$current.$age.$revision"
- - verstring="$current.$age.$revision"
- + # All the library-specific variables (install_libdir is set above).
- + library_names=
- + old_library=
- + dlname=
-
- - # Add in all the interfaces that we are compatible with.
- - loop=$age
- - while test "$loop" -ne 0; do
- - iface=`expr $current - $loop`
- - loop=`expr $loop - 1`
- - verstring="$verstring:${iface}.0"
- + # Test again, we may have decided not to build it any more
- + if test "$build_libtool_libs" = yes; then
- + if test "$hardcode_into_libs" = yes; then
- + # Hardcode the library paths
- + hardcode_libdirs=
- + dep_rpath=
- + rpath="$finalize_rpath"
- + test "$mode" != relink && rpath="$compile_rpath$rpath"
- + for libdir in $rpath; do
- + if test -n "$hardcode_libdir_flag_spec"; then
- + if test -n "$hardcode_libdir_separator"; then
- + if test -z "$hardcode_libdirs"; then
- + hardcode_libdirs="$libdir"
- + else
- + # Just accumulate the unique libdirs.
- + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- + ;;
- + *)
- + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- + ;;
- + esac
- + fi
- + else
- + eval flag=\"$hardcode_libdir_flag_spec\"
- + dep_rpath="$dep_rpath $flag"
- + fi
- + elif test -n "$runpath_var"; then
- + case "$perm_rpath " in
- + *" $libdir "*) ;;
- + *) perm_rpath="$perm_rpath $libdir" ;;
- + esac
- + fi
- done
- + # Substitute the hardcoded libdirs into the rpath.
- + if test -n "$hardcode_libdir_separator" &&
- + test -n "$hardcode_libdirs"; then
- + libdir="$hardcode_libdirs"
- + if test -n "$hardcode_libdir_flag_spec_ld"; then
- + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- + else
- + eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- + fi
- + fi
- + if test -n "$runpath_var" && test -n "$perm_rpath"; then
- + # We should set the runpath_var.
- + rpath=
- + for dir in $perm_rpath; do
- + rpath="$rpath$dir:"
- + done
- + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- + fi
- + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- + fi
-
- - # Make executables depend on our current version.
- - verstring="$verstring:${current}.0"
- - ;;
- + shlibpath="$finalize_shlibpath"
- + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- + if test -n "$shlibpath"; then
- + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- + fi
-
- - qnx)
- - major=".$current"
- - versuffix=".$current"
- - ;;
- + # Get the real and link names of the library.
- + eval shared_ext=\"$shrext_cmds\"
- + eval library_names=\"$library_names_spec\"
- + set dummy $library_names
- + shift
- + realname="$1"
- + shift
-
- - sunos)
- - major=".$current"
- - versuffix=".$current.$revision"
- - ;;
- + if test -n "$soname_spec"; then
- + eval soname=\"$soname_spec\"
- + else
- + soname="$realname"
- + fi
- + if test -z "$dlname"; then
- + dlname=$soname
- + fi
-
- - windows)
- - # Use '-' rather than '.', since we only want one
- - # extension on DOS 8.3 filesystems.
- - major=`expr $current - $age`
- - versuffix="-$major"
- - ;;
- + lib="$output_objdir/$realname"
- + linknames=
- + for link
- + do
- + linknames="$linknames $link"
- + done
-
- - *)
- - func_fatal_configuration "unknown library version type \`$version_type'"
- + # Use standard objects if they are pic
- + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- +
- + delfiles=
- + if test -n "$export_symbols" && test -n "$include_expsyms"; then
- + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- + export_symbols="$output_objdir/$libname.uexp"
- + delfiles="$delfiles $export_symbols"
- + fi
- +
- + orig_export_symbols=
- + case $host_os in
- + cygwin* | mingw*)
- + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- + # exporting using user supplied symfile
- + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
- + # and it's NOT already a .def file. Must figure out
- + # which of the given symbols are data symbols and tag
- + # them as such. So, trigger use of export_symbols_cmds.
- + # export_symbols gets reassigned inside the "prepare
- + # the list of exported symbols" if statement, so the
- + # include_expsyms logic still works.
- + orig_export_symbols="$export_symbols"
- + export_symbols=
- + always_export_symbols=yes
- + fi
- + fi
- ;;
- esac
-
- - # Clear the version info if we defaulted, and they specified a release.
- - if test -z "$vinfo" && test -n "$release"; then
- - major=
- - case $version_type in
- - darwin)
- - # we can't check for "0.0" in archive_cmds due to quoting
- - # problems, so we reset it completely
- - verstring=
- - ;;
- - *)
- - verstring="0.0"
- - ;;
- - esac
- - if test "$need_version" = no; then
- - versuffix=
- - else
- - versuffix=".0.0"
- + # Prepare the list of exported symbols
- + if test -z "$export_symbols"; then
- + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- + func_echo "generating symbol list for \`$libname.la'"
- + export_symbols="$output_objdir/$libname.exp"
- + $opt_dry_run || $RM $export_symbols
- + cmds=$export_symbols_cmds
- + save_ifs="$IFS"; IFS='~'
- + for cmd in $cmds; do
- + IFS="$save_ifs"
- + eval cmd=\"$cmd\"
- + if len=`expr "X$cmd" : ".*"` &&
- + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- + func_show_eval "$cmd" 'exit $?'
- + skipped_export=false
- + else
- + # The command line is too long to execute in one step.
- + func_echo "using reloadable object file for export list..."
- + skipped_export=:
- + # Break out early, otherwise skipped_export may be
- + # set to false by a later but shorter cmd.
- + break
- + fi
- + done
- + IFS="$save_ifs"
- + if test -n "$export_symbols_regex"; then
- + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- + func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- + fi
- fi
- fi
-
- - # Remove version info from name if versioning should be avoided
- - if test "$avoid_version" = yes && test "$need_version" = no; then
- - major=
- - versuffix=
- - verstring=""
- + if test -n "$export_symbols" && test -n "$include_expsyms"; then
- + tmp_export_symbols="$export_symbols"
- + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- - # Check to see if the archive will have undefined symbols.
- - if test "$allow_undefined" = yes; then
- - if test "$allow_undefined_flag" = unsupported; then
- - func_warning "undefined symbols not allowed in $host shared libraries"
- - build_libtool_libs=no
- - build_old_libs=yes
- - fi
- - else
- - # Don't allow undefined symbols.
- - allow_undefined_flag="$no_undefined_flag"
- + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
- + # The given exports_symbols file has to be filtered, so filter it.
- + func_echo "filter symbol list for \`$libname.la' to tag DATA exports"
- + # FIXME: $output_objdir/$libname.filter potentially contains lots of
- + # 's' commands which not all seds can handle. GNU sed should be fine
- + # though. Also, the filter scales superlinearly with the number of
- + # global variables. join(1) would be nice here, but unfortunately
- + # isn't a blessed tool.
- + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
- + export_symbols=$output_objdir/$libname.def
- + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
-
- - fi
- -
- - func_generate_dlsyms "$libname" "$libname" "yes"
- - libobjs="$libobjs $symfileobj"
- - test "X$libobjs" = "X " && libobjs=
- -
- - if test "$mode" != relink; then
- - # Remove our outputs, but don't remove object files since they
- - # may have been created when compiling PIC objects.
- - removelist=
- - tempremovelist=`$ECHO "$output_objdir/*"`
- - for p in $tempremovelist; do
- - case $p in
- - *.$objext)
- - ;;
- - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- - if test "X$precious_files_regex" != "X"; then
- - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- - then
- - continue
- - fi
- - fi
- - removelist="$removelist $p"
- - ;;
- - *) ;;
- + tmp_deplibs=
- + for test_deplib in $deplibs; do
- + case " $convenience " in
- + *" $test_deplib "*) ;;
- + *)
- + tmp_deplibs="$tmp_deplibs $test_deplib"
- + ;;
- esac
- done
- - test -n "$removelist" && \
- - func_show_eval "${RM}r \$removelist"
- - fi
- + deplibs="$tmp_deplibs"
-
- - # Now set the variables for building old libraries.
- - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- - oldlibs="$oldlibs $output_objdir/$libname.$libext"
- + if test -n "$convenience"; then
- + if test -n "$whole_archive_flag_spec"; then
- + save_libobjs=$libobjs
- + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- + else
- + gentop="$output_objdir/${outputname}x"
- + generated="$generated $gentop"
-
- - # Transform .lo files to .o files.
- - oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
- - fi
- + func_extract_archives $gentop $convenience
- + libobjs="$libobjs $func_extract_archives_result"
- + fi
- + fi
-
- - # Eliminate all temporary directories.
- - #for path in $notinst_path; do
- - # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
- - # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
- - # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
- - #done
- + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- + eval flag=\"$thread_safe_flag_spec\"
- + linker_flags="$linker_flags $flag"
- + fi
-
- - if test -n "$xrpath"; then
- - # If the user specified any rpath flags, then add them.
- - temp_xrpath=
- - for libdir in $xrpath; do
- - temp_xrpath="$temp_xrpath -R$libdir"
- - case "$finalize_rpath " in
- - *" $libdir "*) ;;
- - *) finalize_rpath="$finalize_rpath $libdir" ;;
- - esac
- - done
- - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- - dependency_libs="$temp_xrpath $dependency_libs"
- + # Make a backup of the uninstalled library when relinking
- + if test "$mode" = relink; then
- + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- fi
- - fi
-
- - # Make sure dlfiles contains only unique files that won't be dlpreopened
- - old_dlfiles="$dlfiles"
- - dlfiles=
- - for lib in $old_dlfiles; do
- - case " $dlprefiles $dlfiles " in
- - *" $lib "*) ;;
- - *) dlfiles="$dlfiles $lib" ;;
- - esac
- - done
- + # Do each of the archive commands.
- + if test "$module" = yes && test -n "$module_cmds" ; then
- + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- + eval test_cmds=\"$module_expsym_cmds\"
- + cmds=$module_expsym_cmds
- + else
- + eval test_cmds=\"$module_cmds\"
- + cmds=$module_cmds
- + fi
- + else
- + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- + eval test_cmds=\"$archive_expsym_cmds\"
- + cmds=$archive_expsym_cmds
- + else
- + eval test_cmds=\"$archive_cmds\"
- + cmds=$archive_cmds
- + fi
- + fi
-
- - # Make sure dlprefiles contains only unique files
- - old_dlprefiles="$dlprefiles"
- - dlprefiles=
- - for lib in $old_dlprefiles; do
- - case "$dlprefiles " in
- - *" $lib "*) ;;
- - *) dlprefiles="$dlprefiles $lib" ;;
- - esac
- - done
- + if test "X$skipped_export" != "X:" &&
- + len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- + :
- + else
- + # The command line is too long to link in one step, link piecewise
- + # or, if using GNU ld and skipped_export is not :, use a linker
- + # script.
-
- - if test "$build_libtool_libs" = yes; then
- - if test -n "$rpath"; then
- - case $host in
- - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
- - # these systems don't actually have a c library (as such)!
- - ;;
- - *-*-rhapsody* | *-*-darwin1.[012])
- - # Rhapsody C library is in the System framework
- - deplibs="$deplibs System.ltframework"
- - ;;
- - *-*-netbsd*)
- - # Don't link with libc until the a.out ld.so is fixed.
- - ;;
- - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- - # Do not include libc due to us having libc/libc_r.
- - ;;
- - *-*-sco3.2v5* | *-*-sco5v6*)
- - # Causes problems with __ctype
- - ;;
- - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- - # Compiler inserts libc in the correct place for threads to work
- - ;;
- - *)
- - # Add libc to deplibs on all other systems if necessary.
- - if test "$build_libtool_need_lc" = "yes"; then
- - deplibs="$deplibs -lc"
- - fi
- - ;;
- - esac
- - fi
- + # Save the value of $output and $libobjs because we want to
- + # use them later. If we have whole_archive_flag_spec, we
- + # want to use save_libobjs as it was before
- + # whole_archive_flag_spec was expanded, because we can't
- + # assume the linker understands whole_archive_flag_spec.
- + # This may have to be revisited, in case too many
- + # convenience libraries get linked in and end up exceeding
- + # the spec.
- + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- + save_libobjs=$libobjs
- + fi
- + save_output=$output
- + output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
- +
- + # Clear the reloadable object creation command queue and
- + # initialize k to one.
- + test_cmds=
- + concat_cmds=
- + objlist=
- + last_robj=
- + k=1
-
- - # Transform deplibs into only deplibs that can be linked in shared.
- - name_save=$name
- - libname_save=$libname
- - release_save=$release
- - versuffix_save=$versuffix
- - major_save=$major
- - # I'm not sure if I'm treating the release correctly. I think
- - # release should show up in the -l (ie -lgmp5) so we don't want to
- - # add it in twice. Is that correct?
- - release=""
- - versuffix=""
- - major=""
- - newdeplibs=
- - droppeddeps=no
- - case $deplibs_check_method in
- - pass_all)
- - # Don't check for shared/static. Everything works.
- - # This might be a little naive. We might want to check
- - # whether the library exists or not. But this is on
- - # osf3 & osf4 and I'm not really sure... Just
- - # implementing what was already the behavior.
- - newdeplibs=$deplibs
- - ;;
- - test_compile)
- - # This code stresses the "libraries are programs" paradigm to its
- - # limits. Maybe even breaks it. We compile a program, linking it
- - # against the deplibs as a proxy for the library. Then we can check
- - # whether they linked in statically or dynamically with ldd.
- - $opt_dry_run || $RM conftest.c
- - cat > conftest.c <<EOF
- - int main() { return 0; }
- -EOF
- - $opt_dry_run || $RM conftest
- - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- - ldd_output=`ldd conftest`
- - for i in $deplibs; do
- - name=`expr $i : '-l\(.*\)'`
- - # If $name is empty we are operating on a -L argument.
- - if test "$name" != "" && test "$name" != "0"; then
- - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- - case " $predeps $postdeps " in
- - *" $i "*)
- - newdeplibs="$newdeplibs $i"
- - i=""
- - ;;
- - esac
- - fi
- - if test -n "$i" ; then
- - libname=`eval "\\$ECHO \"$libname_spec\""`
- - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- - set dummy $deplib_matches; shift
- - deplib_match=$1
- - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- - newdeplibs="$newdeplibs $i"
- - else
- - droppeddeps=yes
- - $ECHO
- - $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- - $ECHO "*** I have the capability to make that library automatically link in when"
- - $ECHO "*** you link to this library. But I can only do this if you have a"
- - $ECHO "*** shared version of the library, which I believe you do not have"
- - $ECHO "*** because a test_compile did reveal that the linker did not use it for"
- - $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
- - fi
- - fi
- - else
- - newdeplibs="$newdeplibs $i"
- - fi
- + if test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- + output=${output_objdir}/${output_la}.lnkscript
- + func_echo "creating GNU ld script: $output"
- + $ECHO 'INPUT (' > $output
- + for obj in $save_libobjs
- + do
- + $ECHO \""$obj"\" >> $output
- + done
- + $ECHO ')' >> $output
- + delfiles="$delfiles $output"
- + elif test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- + output=${output_objdir}/${output_la}.lnk
- + func_echo "creating linker input file list: $output"
- + : > $output
- + for obj in $save_libobjs
- + do
- + $ECHO "$obj" >> $output
- done
- + delfiles="$delfiles $output"
- + output=\"$file_list_spec$output\"
- else
- - # Error occurred in the first compile. Let's try to salvage
- - # the situation: Compile a separate program for each library.
- - for i in $deplibs; do
- - name=`expr $i : '-l\(.*\)'`
- - # If $name is empty we are operating on a -L argument.
- - if test "$name" != "" && test "$name" != "0"; then
- - $opt_dry_run || $RM conftest
- - if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- - ldd_output=`ldd conftest`
- - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- - case " $predeps $postdeps " in
- - *" $i "*)
- - newdeplibs="$newdeplibs $i"
- - i=""
- - ;;
- - esac
- - fi
- - if test -n "$i" ; then
- - libname=`eval "\\$ECHO \"$libname_spec\""`
- - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- - set dummy $deplib_matches; shift
- - deplib_match=$1
- - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- - newdeplibs="$newdeplibs $i"
- - else
- - droppeddeps=yes
- - $ECHO
- - $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- - $ECHO "*** I have the capability to make that library automatically link in when"
- - $ECHO "*** you link to this library. But I can only do this if you have a"
- - $ECHO "*** shared version of the library, which you do not appear to have"
- - $ECHO "*** because a test_compile did reveal that the linker did not use this one"
- - $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
- - fi
- - fi
- - else
- - droppeddeps=yes
- - $ECHO
- - $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- - $ECHO "*** make it link in! You will probably need to install it or some"
- - $ECHO "*** library that it depends on before this library will be fully"
- - $ECHO "*** functional. Installing it before continuing would be even better."
- - fi
- + func_echo "creating reloadable object files..."
- + output=$output_objdir/$output_la-${k}.$objext
- + # Loop over the list of objects to be linked.
- + for obj in $save_libobjs
- + do
- + eval test_cmds=\"$reload_cmds $objlist $last_robj\"
- + if test "X$objlist" = X ||
- + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- + test "$len" -le "$max_cmd_len"; }; then
- + objlist="$objlist $obj"
- else
- - newdeplibs="$newdeplibs $i"
- - fi
- - done
- - fi
- - ;;
- - file_magic*)
- - set dummy $deplibs_check_method; shift
- - file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- - for a_deplib in $deplibs; do
- - name=`expr $a_deplib : '-l\(.*\)'`
- - # If $name is empty we are operating on a -L argument.
- - if test "$name" != "" && test "$name" != "0"; then
- - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- - case " $predeps $postdeps " in
- - *" $a_deplib "*)
- - newdeplibs="$newdeplibs $a_deplib"
- - a_deplib=""
- - ;;
- - esac
- - fi
- - if test -n "$a_deplib" ; then
- - libname=`eval "\\$ECHO \"$libname_spec\""`
- - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- - potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- - for potent_lib in $potential_libs; do
- - # Follow soft links.
- - if ls -lLd "$potent_lib" 2>/dev/null |
- - $GREP " -> " >/dev/null; then
- - continue
- - fi
- - # The statement above tries to avoid entering an
- - # endless loop below, in case of cyclic links.
- - # We might still enter an endless loop, since a link
- - # loop can be closed while we follow links,
- - # but so what?
- - potlib="$potent_lib"
- - while test -h "$potlib" 2>/dev/null; do
- - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- - case $potliblink in
- - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- - *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
- - esac
- - done
- - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- - $SED -e 10q |
- - $EGREP "$file_magic_regex" > /dev/null; then
- - newdeplibs="$newdeplibs $a_deplib"
- - a_deplib=""
- - break 2
- - fi
- - done
- - done
- - fi
- - if test -n "$a_deplib" ; then
- - droppeddeps=yes
- - $ECHO
- - $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- - $ECHO "*** I have the capability to make that library automatically link in when"
- - $ECHO "*** you link to this library. But I can only do this if you have a"
- - $ECHO "*** shared version of the library, which you do not appear to have"
- - $ECHO "*** because I did check the linker path looking for a file starting"
- - if test -z "$potlib" ; then
- - $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
- + # The command $test_cmds is almost too long, add a
- + # command to the queue.
- + if test "$k" -eq 1 ; then
- + # The first file doesn't have a previous command to add.
- + eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
- else
- - $ECHO "*** with $libname and none of the candidates passed a file format test"
- - $ECHO "*** using a file magic. Last file checked: $potlib"
- + # All subsequent reloadable object files will link in
- + # the last one created.
- + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
- fi
- + last_robj=$output_objdir/$output_la-${k}.$objext
- + k=`expr $k + 1`
- + output=$output_objdir/$output_la-${k}.$objext
- + objlist=$obj
- + len=1
- fi
- - else
- - # Add a -L argument.
- - newdeplibs="$newdeplibs $a_deplib"
- + done
- + # Handle the remaining objects by creating one last
- + # reloadable object file. All subsequent reloadable object
- + # files will link in the last one created.
- + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
- +
- + if ${skipped_export-false}; then
- + func_echo "generating symbol list for \`$libname.la'"
- + export_symbols="$output_objdir/$libname.exp"
- + $opt_dry_run || $RM $export_symbols
- + libobjs=$output
- + # Append the command to create the export file.
- + eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
- fi
- - done # Gone through all deplibs.
- - ;;
- - match_pattern*)
- - set dummy $deplibs_check_method; shift
- - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- - for a_deplib in $deplibs; do
- - name=`expr $a_deplib : '-l\(.*\)'`
- - # If $name is empty we are operating on a -L argument.
- - if test -n "$name" && test "$name" != "0"; then
- - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- - case " $predeps $postdeps " in
- - *" $a_deplib "*)
- - newdeplibs="$newdeplibs $a_deplib"
- - a_deplib=""
- - ;;
- - esac
- - fi
- - if test -n "$a_deplib" ; then
- - libname=`eval "\\$ECHO \"$libname_spec\""`
- - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- - potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- - for potent_lib in $potential_libs; do
- - potlib="$potent_lib" # see symlink-check above in file_magic test
- - if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
- - $EGREP "$match_pattern_regex" > /dev/null; then
- - newdeplibs="$newdeplibs $a_deplib"
- - a_deplib=""
- - break 2
- - fi
- - done
- - done
- - fi
- - if test -n "$a_deplib" ; then
- - droppeddeps=yes
- - $ECHO
- - $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- - $ECHO "*** I have the capability to make that library automatically link in when"
- - $ECHO "*** you link to this library. But I can only do this if you have a"
- - $ECHO "*** shared version of the library, which you do not appear to have"
- - $ECHO "*** because I did check the linker path looking for a file starting"
- - if test -z "$potlib" ; then
- - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
- - else
- - $ECHO "*** with $libname and none of the candidates passed a file format test"
- - $ECHO "*** using a regex pattern. Last file checked: $potlib"
- +
- + # Set up a command to remove the reloadable object files
- + # after they are used.
- + i=0
- + while test "$i" -lt "$k"
- + do
- + i=`expr $i + 1`
- + delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
- + done
- +
- + func_echo "creating a temporary reloadable object file: $output"
- +
- + # Loop through the commands generated above and execute them.
- + save_ifs="$IFS"; IFS='~'
- + for cmd in $concat_cmds; do
- + IFS="$save_ifs"
- + $opt_silent || {
- + func_quote_for_expand "$cmd"
- + eval "func_echo $func_quote_for_expand_result"
- + }
- + $opt_dry_run || eval "$cmd" || {
- + lt_exit=$?
- +
- + # Restore the uninstalled library and exit
- + if test "$mode" = relink; then
- + ( cd "$output_objdir" && \
- + $RM "${realname}T" && \
- + $MV "${realname}U" "$realname" )
- fi
- - fi
- - else
- - # Add a -L argument.
- - newdeplibs="$newdeplibs $a_deplib"
- - fi
- - done # Gone through all deplibs.
- - ;;
- - none | unknown | *)
- - newdeplibs=""
- - tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
- - -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
- - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- - for i in $predeps $postdeps ; do
- - # can't use Xsed below, because $i might contain '/'
- - tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
- +
- + exit $lt_exit
- + }
- done
- + IFS="$save_ifs"
- fi
- - if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
- - $GREP . >/dev/null; then
- - $ECHO
- - if test "X$deplibs_check_method" = "Xnone"; then
- - $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
- +
- + libobjs=$output
- + # Restore the value of output.
- + output=$save_output
- +
- + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- + eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- + fi
- + # Expand the library linking commands again to reset the
- + # value of $libobjs for piecewise linking.
- +
- + # Do each of the archive commands.
- + if test "$module" = yes && test -n "$module_cmds" ; then
- + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- + cmds=$module_expsym_cmds
- else
- - $ECHO "*** Warning: inter-library dependencies are not known to be supported."
- + cmds=$module_cmds
- + fi
- + else
- + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- + cmds=$archive_expsym_cmds
- + else
- + cmds=$archive_cmds
- fi
- - $ECHO "*** All declared inter-library dependencies are being dropped."
- - droppeddeps=yes
- fi
- - ;;
- - esac
- - versuffix=$versuffix_save
- - major=$major_save
- - release=$release_save
- - libname=$libname_save
- - name=$name_save
- + fi
-
- - case $host in
- - *-*-rhapsody* | *-*-darwin1.[012])
- - # On Rhapsody replace the C library with the System framework
- - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- - ;;
- - esac
- + if test -n "$delfiles"; then
- + # Append the command to remove temporary files to $cmds.
- + eval cmds=\"\$cmds~\$RM $delfiles\"
- + fi
-
- - if test "$droppeddeps" = yes; then
- - if test "$module" = yes; then
- - $ECHO
- - $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
- - $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- - $ECHO "*** a static module, that should work as long as the dlopening"
- - $ECHO "*** application is linked with the -dlopen flag."
- - if test -z "$global_symbol_pipe"; then
- - $ECHO
- - $ECHO "*** However, this would only work if libtool was able to extract symbol"
- - $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- - $ECHO "*** not find such a program. So, this module is probably useless."
- - $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
- - fi
- - if test "$build_old_libs" = no; then
- - oldlibs="$output_objdir/$libname.$libext"
- - build_libtool_libs=module
- - build_old_libs=yes
- - else
- - build_libtool_libs=no
- + # Add any objects from preloaded convenience libraries
- + if test -n "$dlprefiles"; then
- + gentop="$output_objdir/${outputname}x"
- + generated="$generated $gentop"
- +
- + func_extract_archives $gentop $dlprefiles
- + libobjs="$libobjs $func_extract_archives_result"
- + fi
- +
- + save_ifs="$IFS"; IFS='~'
- + for cmd in $cmds; do
- + IFS="$save_ifs"
- + eval cmd=\"$cmd\"
- + $opt_silent || {
- + func_quote_for_expand "$cmd"
- + eval "func_echo $func_quote_for_expand_result"
- + }
- + $opt_dry_run || eval "$cmd" || {
- + lt_exit=$?
- +
- + # Restore the uninstalled library and exit
- + if test "$mode" = relink; then
- + ( cd "$output_objdir" && \
- + $RM "${realname}T" && \
- + $MV "${realname}U" "$realname" )
- fi
- - else
- - $ECHO "*** The inter-library dependencies that have been dropped here will be"
- - $ECHO "*** automatically added whenever a program is linked with this library"
- - $ECHO "*** or is declared to -dlopen it."
-
- - if test "$allow_undefined" = no; then
- - $ECHO
- - $ECHO "*** Since this library must not contain undefined symbols,"
- - $ECHO "*** because either the platform does not support them or"
- - $ECHO "*** it was explicitly requested with -no-undefined,"
- - $ECHO "*** libtool will only create a static version of it."
- - if test "$build_old_libs" = no; then
- - oldlibs="$output_objdir/$libname.$libext"
- - build_libtool_libs=module
- - build_old_libs=yes
- - else
- - build_libtool_libs=no
- - fi
- + exit $lt_exit
- + }
- + done
- + IFS="$save_ifs"
- +
- + # Restore the uninstalled library and exit
- + if test "$mode" = relink; then
- + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
- +
- + if test -n "$convenience"; then
- + if test -z "$whole_archive_flag_spec"; then
- + func_show_eval '${RM}r "$gentop"'
- fi
- fi
- +
- + exit $EXIT_SUCCESS
- fi
- - # Done checking deplibs!
- - deplibs=$newdeplibs
- +
- + # Create links to the real library.
- + for linkname in $linknames; do
- + if test "$realname" != "$linkname"; then
- + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
- + fi
- + done
- +
- + # If -module or -export-dynamic was specified, set the dlname.
- + if test "$module" = yes || test "$export_dynamic" = yes; then
- + # On all known operating systems, these are identical.
- + dlname="$soname"
- + fi
- + fi
- + ;;
- +
- + obj)
- + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- + func_warning "\`-dlopen' is ignored for objects"
- + fi
- +
- + test -n "$deplibs" && \
- + func_warning "\`-l' and \`-L' are ignored for objects"
- +
- + test -n "$rpath" && \
- + func_warning "\`-rpath' is ignored for objects"
- +
- + test -n "$xrpath" && \
- + func_warning "\`-R' is ignored for objects"
- +
- + test -n "$vinfo" && \
- + func_warning "\`-version-info' is ignored for objects"
- +
- + test -n "$release" && \
- + func_warning "\`-release' is ignored for objects"
- +
- + case $output in
- + *.lo)
- + test -n "$objs$old_deplibs" && \
- + func_fatal_error "cannot build library object \`$output' from non-libtool objects"
- +
- + libobj="$output"
- + obj=`$ECHO "X$output" | $Xsed -e "$lo2o"`
- + ;;
- + *)
- + libobj=
- + obj="$output"
- + ;;
- + esac
- +
- + # Delete the old objects.
- + $opt_dry_run || $RM $obj $libobj
- +
- + # Objects from convenience libraries. This assumes
- + # single-version convenience libraries. Whenever we create
- + # different ones for PIC/non-PIC, this we'll have to duplicate
- + # the extraction.
- + reload_conv_objs=
- + gentop=
- + # reload_cmds runs $LD directly, so let us get rid of
- + # -Wl from whole_archive_flag_spec
- + wl=
- +
- + if test -n "$convenience"; then
- + if test -n "$whole_archive_flag_spec"; then
- + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
- + else
- + gentop="$output_objdir/${obj}x"
- + generated="$generated $gentop"
- +
- + func_extract_archives $gentop $convenience
- + reload_conv_objs="$reload_objs $func_extract_archives_result"
- + fi
- + fi
- +
- + # Create the old-style object.
- + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
- +
- + output="$obj"
- + func_execute_cmds "$reload_cmds" 'exit $?'
- +
- + # Exit if we aren't doing a library object file.
- + if test -z "$libobj"; then
- + if test -n "$gentop"; then
- + func_show_eval '${RM}r "$gentop"'
- + fi
- +
- + exit $EXIT_SUCCESS
- + fi
- +
- + if test "$build_libtool_libs" != yes; then
- + if test -n "$gentop"; then
- + func_show_eval '${RM}r "$gentop"'
- + fi
- +
- + # Create an invalid libtool object if no PIC, so that we don't
- + # accidentally link it into a program.
- + # $show "echo timestamp > $libobj"
- + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- + exit $EXIT_SUCCESS
- fi
- - # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- +
- + if test -n "$pic_flag" || test "$pic_mode" != default; then
- + # Only do commands if we really have different PIC objects.
- + reload_objs="$libobjs $reload_conv_objs"
- + output="$libobj"
- + func_execute_cmds "$reload_cmds" 'exit $?'
- + fi
- +
- + if test -n "$gentop"; then
- + func_show_eval '${RM}r "$gentop"'
- + fi
- +
- + exit $EXIT_SUCCESS
- + ;;
- +
- + prog)
- case $host in
- - *-*-darwin*)
- - newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - ;;
- + *cygwin*) func_stripname '' '.exe' "$output"
- + output=$func_stripname_result.exe;;
- + esac
- + test -n "$vinfo" && \
- + func_warning "\`-version-info' is ignored for programs"
- +
- + test -n "$release" && \
- + func_warning "\`-release' is ignored for programs"
- +
- + test "$preload" = yes \
- + && test "$dlopen_support" = unknown \
- + && test "$dlopen_self" = unknown \
- + && test "$dlopen_self_static" = unknown && \
- + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
- +
- + case $host in
- + *-*-rhapsody* | *-*-darwin1.[012])
- + # On Rhapsody replace the C library is the System framework
- + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- + ;;
- + esac
- +
- + case $host in
- + *-*-darwin*)
- + # Don't allow lazy linking, it breaks C++ global constructors
- + # But is supposedly fixed on 10.4 or later (yay!).
- + if test "$tagname" = CXX ; then
- + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- + 10.[0123])
- + compile_command="$compile_command ${wl}-bind_at_load"
- + finalize_command="$finalize_command ${wl}-bind_at_load"
- + ;;
- + esac
- + fi
- + # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- + ;;
- esac
-
- +
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- @@ -5919,14 +5960,14 @@ EOF
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- - case " $deplibs " in
- + case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- - for deplib in $deplibs; do
- + for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- @@ -5937,964 +5978,803 @@ EOF
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- - deplibs="$new_libs"
- -
- - # All the library-specific variables (install_libdir is set above).
- - library_names=
- - old_library=
- - dlname=
- -
- - # Test again, we may have decided not to build it any more
- - if test "$build_libtool_libs" = yes; then
- - if test "$hardcode_into_libs" = yes; then
- - # Hardcode the library paths
- - hardcode_libdirs=
- - dep_rpath=
- - rpath="$finalize_rpath"
- - test "$mode" != relink && rpath="$compile_rpath$rpath"
- - for libdir in $rpath; do
- - if test -n "$hardcode_libdir_flag_spec"; then
- - if test -n "$hardcode_libdir_separator"; then
- - if test -z "$hardcode_libdirs"; then
- - hardcode_libdirs="$libdir"
- - else
- - # Just accumulate the unique libdirs.
- - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- - ;;
- - *)
- - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- - ;;
- - esac
- - fi
- - else
- - eval flag=\"$hardcode_libdir_flag_spec\"
- - dep_rpath="$dep_rpath $flag"
- - fi
- - elif test -n "$runpath_var"; then
- - case "$perm_rpath " in
- - *" $libdir "*) ;;
- - *) perm_rpath="$perm_rpath $libdir" ;;
- - esac
- - fi
- - done
- - # Substitute the hardcoded libdirs into the rpath.
- - if test -n "$hardcode_libdir_separator" &&
- - test -n "$hardcode_libdirs"; then
- - libdir="$hardcode_libdirs"
- - if test -n "$hardcode_libdir_flag_spec_ld"; then
- - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- - else
- - eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- - fi
- - fi
- - if test -n "$runpath_var" && test -n "$perm_rpath"; then
- - # We should set the runpath_var.
- - rpath=
- - for dir in $perm_rpath; do
- - rpath="$rpath$dir:"
- - done
- - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- - fi
- - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- - fi
- -
- - shlibpath="$finalize_shlibpath"
- - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- - if test -n "$shlibpath"; then
- - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- - fi
- + compile_deplibs="$new_libs"
-
- - # Get the real and link names of the library.
- - eval shared_ext=\"$shrext_cmds\"
- - eval library_names=\"$library_names_spec\"
- - set dummy $library_names
- - shift
- - realname="$1"
- - shift
-
- - if test -n "$soname_spec"; then
- - eval soname=\"$soname_spec\"
- - else
- - soname="$realname"
- - fi
- - if test -z "$dlname"; then
- - dlname=$soname
- - fi
- + compile_command="$compile_command $compile_deplibs"
- + finalize_command="$finalize_command $finalize_deplibs"
-
- - lib="$output_objdir/$realname"
- - linknames=
- - for link
- - do
- - linknames="$linknames $link"
- + if test -n "$rpath$xrpath"; then
- + # If the user specified any rpath flags, then add them.
- + for libdir in $rpath $xrpath; do
- + # This is the magic to use -rpath.
- + case "$finalize_rpath " in
- + *" $libdir "*) ;;
- + *) finalize_rpath="$finalize_rpath $libdir" ;;
- + esac
- done
- + fi
-
- - # Use standard objects if they are pic
- - test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- - test "X$libobjs" = "X " && libobjs=
- -
- - delfiles=
- - if test -n "$export_symbols" && test -n "$include_expsyms"; then
- - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- - export_symbols="$output_objdir/$libname.uexp"
- - delfiles="$delfiles $export_symbols"
- - fi
- -
- - orig_export_symbols=
- - case $host_os in
- - cygwin* | mingw*)
- - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- - # exporting using user supplied symfile
- - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
- - # and it's NOT already a .def file. Must figure out
- - # which of the given symbols are data symbols and tag
- - # them as such. So, trigger use of export_symbols_cmds.
- - # export_symbols gets reassigned inside the "prepare
- - # the list of exported symbols" if statement, so the
- - # include_expsyms logic still works.
- - orig_export_symbols="$export_symbols"
- - export_symbols=
- - always_export_symbols=yes
- + # Now hardcode the library paths
- + rpath=
- + hardcode_libdirs=
- + for libdir in $compile_rpath $finalize_rpath; do
- + if test -n "$hardcode_libdir_flag_spec"; then
- + if test -n "$hardcode_libdir_separator"; then
- + if test -z "$hardcode_libdirs"; then
- + hardcode_libdirs="$libdir"
- + else
- + # Just accumulate the unique libdirs.
- + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- + ;;
- + *)
- + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- + ;;
- + esac
- fi
- + else
- + eval flag=\"$hardcode_libdir_flag_spec\"
- + rpath="$rpath $flag"
- fi
- + elif test -n "$runpath_var"; then
- + case "$perm_rpath " in
- + *" $libdir "*) ;;
- + *) perm_rpath="$perm_rpath $libdir" ;;
- + esac
- + fi
- + case $host in
- + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
- + case :$dllsearchpath: in
- + *":$libdir:"*) ;;
- + *) dllsearchpath="$dllsearchpath:$libdir";;
- + esac
- + case :$dllsearchpath: in
- + *":$testbindir:"*) ;;
- + *) dllsearchpath="$dllsearchpath:$testbindir";;
- + esac
- ;;
- - esac
- -
- - # Prepare the list of exported symbols
- - if test -z "$export_symbols"; then
- - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- - func_echo "generating symbol list for \`$libname.la'"
- - export_symbols="$output_objdir/$libname.exp"
- - $opt_dry_run || $RM $export_symbols
- - cmds=$export_symbols_cmds
- - save_ifs="$IFS"; IFS='~'
- - for cmd in $cmds; do
- - IFS="$save_ifs"
- - eval cmd=\"$cmd\"
- - if len=`expr "X$cmd" : ".*"` &&
- - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- - func_show_eval "$cmd" 'exit $?'
- - skipped_export=false
- - else
- - # The command line is too long to execute in one step.
- - func_echo "using reloadable object file for export list..."
- - skipped_export=:
- - # Break out early, otherwise skipped_export may be
- - # set to false by a later but shorter cmd.
- - break
- - fi
- - done
- - IFS="$save_ifs"
- - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
- - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- - func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- + esac
- + done
- + # Substitute the hardcoded libdirs into the rpath.
- + if test -n "$hardcode_libdir_separator" &&
- + test -n "$hardcode_libdirs"; then
- + libdir="$hardcode_libdirs"
- + eval rpath=\" $hardcode_libdir_flag_spec\"
- + fi
- + compile_rpath="$rpath"
- +
- + rpath=
- + hardcode_libdirs=
- + for libdir in $finalize_rpath; do
- + if test -n "$hardcode_libdir_flag_spec"; then
- + if test -n "$hardcode_libdir_separator"; then
- + if test -z "$hardcode_libdirs"; then
- + hardcode_libdirs="$libdir"
- + else
- + # Just accumulate the unique libdirs.
- + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- + ;;
- + *)
- + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- + ;;
- + esac
- fi
- + else
- + eval flag=\"$hardcode_libdir_flag_spec\"
- + rpath="$rpath $flag"
- fi
- + elif test -n "$runpath_var"; then
- + case "$finalize_perm_rpath " in
- + *" $libdir "*) ;;
- + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
- + esac
- fi
- + done
- + # Substitute the hardcoded libdirs into the rpath.
- + if test -n "$hardcode_libdir_separator" &&
- + test -n "$hardcode_libdirs"; then
- + libdir="$hardcode_libdirs"
- + eval rpath=\" $hardcode_libdir_flag_spec\"
- + fi
- + finalize_rpath="$rpath"
-
- - if test -n "$export_symbols" && test -n "$include_expsyms"; then
- - tmp_export_symbols="$export_symbols"
- - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
- - fi
- + if test -n "$libobjs" && test "$build_old_libs" = yes; then
- + # Transform all the library objects into standard objects.
- + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- + fi
-
- - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
- - # The given exports_symbols file has to be filtered, so filter it.
- - func_echo "filter symbol list for \`$libname.la' to tag DATA exports"
- - # FIXME: $output_objdir/$libname.filter potentially contains lots of
- - # 's' commands which not all seds can handle. GNU sed should be fine
- - # though. Also, the filter scales superlinearly with the number of
- - # global variables. join(1) would be nice here, but unfortunately
- - # isn't a blessed tool.
- - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
- - export_symbols=$output_objdir/$libname.def
- - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- - fi
- + func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
- - tmp_deplibs=
- - for test_deplib in $deplibs; do
- - case " $convenience " in
- - *" $test_deplib "*) ;;
- - *)
- - tmp_deplibs="$tmp_deplibs $test_deplib"
- - ;;
- - esac
- - done
- - deplibs="$tmp_deplibs"
- + # template prelinking step
- + if test -n "$prelink_cmds"; then
- + func_execute_cmds "$prelink_cmds" 'exit $?'
- + fi
-
- - if test -n "$convenience"; then
- - if test -n "$whole_archive_flag_spec" &&
- - test "$compiler_needs_object" = yes &&
- - test -z "$libobjs"; then
- - # extract the archives, so we have objects to list.
- - # TODO: could optimize this to just extract one archive.
- - whole_archive_flag_spec=
- - fi
- - if test -n "$whole_archive_flag_spec"; then
- - save_libobjs=$libobjs
- - eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- - test "X$libobjs" = "X " && libobjs=
- - else
- - gentop="$output_objdir/${outputname}x"
- - generated="$generated $gentop"
- + wrappers_required=yes
- + case $host in
- + *cygwin* | *mingw* )
- + if test "$build_libtool_libs" != yes; then
- + wrappers_required=no
- + fi
- + ;;
- + *)
- + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- + wrappers_required=no
- + fi
- + ;;
- + esac
- + if test "$wrappers_required" = no; then
- + # Replace the output file specification.
- + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- + link_command="$compile_command$compile_rpath"
-
- - func_extract_archives $gentop $convenience
- - libobjs="$libobjs $func_extract_archives_result"
- - test "X$libobjs" = "X " && libobjs=
- - fi
- - fi
- + # We have no uninstalled library dependencies, so finalize right now.
- + exit_status=0
- + func_show_eval "$link_command" 'exit_status=$?'
-
- - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- - eval flag=\"$thread_safe_flag_spec\"
- - linker_flags="$linker_flags $flag"
- + # Delete the generated files.
- + if test -f "$output_objdir/${outputname}S.${objext}"; then
- + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
- fi
-
- - # Make a backup of the uninstalled library when relinking
- - if test "$mode" = relink; then
- - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- - fi
- + exit $exit_status
- + fi
-
- - # Do each of the archive commands.
- - if test "$module" = yes && test -n "$module_cmds" ; then
- - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- - eval test_cmds=\"$module_expsym_cmds\"
- - cmds=$module_expsym_cmds
- - else
- - eval test_cmds=\"$module_cmds\"
- - cmds=$module_cmds
- - fi
- - else
- - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- - eval test_cmds=\"$archive_expsym_cmds\"
- - cmds=$archive_expsym_cmds
- - else
- - eval test_cmds=\"$archive_cmds\"
- - cmds=$archive_cmds
- - fi
- - fi
- + if test -n "$compile_shlibpath$finalize_shlibpath"; then
- + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- + fi
- + if test -n "$finalize_shlibpath"; then
- + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- + fi
-
- - if test "X$skipped_export" != "X:" &&
- - len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- - :
- - else
- - # The command line is too long to link in one step, link piecewise
- - # or, if using GNU ld and skipped_export is not :, use a linker
- - # script.
- + compile_var=
- + finalize_var=
- + if test -n "$runpath_var"; then
- + if test -n "$perm_rpath"; then
- + # We should set the runpath_var.
- + rpath=
- + for dir in $perm_rpath; do
- + rpath="$rpath$dir:"
- + done
- + compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- + fi
- + if test -n "$finalize_perm_rpath"; then
- + # We should set the runpath_var.
- + rpath=
- + for dir in $finalize_perm_rpath; do
- + rpath="$rpath$dir:"
- + done
- + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- + fi
- + fi
-
- - # Save the value of $output and $libobjs because we want to
- - # use them later. If we have whole_archive_flag_spec, we
- - # want to use save_libobjs as it was before
- - # whole_archive_flag_spec was expanded, because we can't
- - # assume the linker understands whole_archive_flag_spec.
- - # This may have to be revisited, in case too many
- - # convenience libraries get linked in and end up exceeding
- - # the spec.
- - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- - save_libobjs=$libobjs
- - fi
- - save_output=$output
- - output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
- + if test "$no_install" = yes; then
- + # We don't need to create a wrapper script.
- + link_command="$compile_var$compile_command$compile_rpath"
- + # Replace the output file specification.
- + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- + # Delete the old output file.
- + $opt_dry_run || $RM $output
- + # Link the executable and exit
- + func_show_eval "$link_command" 'exit $?'
- + exit $EXIT_SUCCESS
- + fi
-
- - # Clear the reloadable object creation command queue and
- - # initialize k to one.
- - test_cmds=
- - concat_cmds=
- - objlist=
- - last_robj=
- - k=1
- + if test "$hardcode_action" = relink; then
- + # Fast installation is not supported
- + link_command="$compile_var$compile_command$compile_rpath"
- + relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- - output=${output_objdir}/${output_la}.lnkscript
- - func_echo "creating GNU ld script: $output"
- - $ECHO 'INPUT (' > $output
- - for obj in $save_libobjs
- - do
- - $ECHO "$obj" >> $output
- - done
- - $ECHO ')' >> $output
- - delfiles="$delfiles $output"
- - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- - output=${output_objdir}/${output_la}.lnk
- - func_echo "creating linker input file list: $output"
- - : > $output
- - set x $save_libobjs
- - shift
- - firstobj=
- - if test "$compiler_needs_object" = yes; then
- - firstobj="$1 "
- - shift
- - fi
- - for obj
- - do
- - $ECHO "$obj" >> $output
- - done
- - delfiles="$delfiles $output"
- - output=$firstobj\"$file_list_spec$output\"
- + func_warning "this platform does not like uninstalled shared libraries"
- + func_warning "\`$output' will be relinked during installation"
- + else
- + if test "$fast_install" != no; then
- + link_command="$finalize_var$compile_command$finalize_rpath"
- + if test "$fast_install" = yes; then
- + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- - if test -n "$save_libobjs"; then
- - func_echo "creating reloadable object files..."
- - output=$output_objdir/$output_la-${k}.$objext
- - # Loop over the list of objects to be linked.
- - for obj in $save_libobjs
- - do
- - eval test_cmds=\"$reload_cmds $objlist $last_robj\"
- - if test "X$objlist" = X ||
- - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- - test "$len" -le "$max_cmd_len"; }; then
- - objlist="$objlist $obj"
- - else
- - # The command $test_cmds is almost too long, add a
- - # command to the queue.
- - if test "$k" -eq 1 ; then
- - # The first file doesn't have a previous command to add.
- - eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
- - else
- - # All subsequent reloadable object files will link in
- - # the last one created.
- - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
- - fi
- - last_robj=$output_objdir/$output_la-${k}.$objext
- - k=`expr $k + 1`
- - output=$output_objdir/$output_la-${k}.$objext
- - objlist=$obj
- - len=1
- - fi
- - done
- - # Handle the remaining objects by creating one last
- - # reloadable object file. All subsequent reloadable object
- - # files will link in the last one created.
- - test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
- -
- - # Set up a command to remove the reloadable object files
- - # after they are used.
- - i=0
- - while test "$i" -lt "$k"
- - do
- - i=`expr $i + 1`
- - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
- - done
- - else
- - output=
- - fi
- -
- - if ${skipped_export-false}; then
- - func_echo "generating symbol list for \`$libname.la'"
- - export_symbols="$output_objdir/$libname.exp"
- - $opt_dry_run || $RM $export_symbols
- - libobjs=$output
- - # Append the command to create the export file.
- - test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- - fi
- + # fast_install is set to needless
- + relink_command=
- + fi
- + else
- + link_command="$compile_var$compile_command$compile_rpath"
- + relink_command="$finalize_var$finalize_command$finalize_rpath"
- + fi
- + fi
-
- - test -n "$save_libobjs" &&
- - func_echo "creating a temporary reloadable object file: $output"
- + # Replace the output file specification.
- + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- - # Loop through the commands generated above and execute them.
- - save_ifs="$IFS"; IFS='~'
- - for cmd in $concat_cmds; do
- - IFS="$save_ifs"
- - $opt_silent || {
- - func_quote_for_expand "$cmd"
- - eval "func_echo $func_quote_for_expand_result"
- - }
- - $opt_dry_run || eval "$cmd" || {
- - lt_exit=$?
- + # Delete the old output files.
- + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- - # Restore the uninstalled library and exit
- - if test "$mode" = relink; then
- - ( cd "$output_objdir" && \
- - $RM "${realname}T" && \
- - $MV "${realname}U" "$realname" )
- - fi
- + func_show_eval "$link_command" 'exit $?'
-
- - exit $lt_exit
- - }
- - done
- - IFS="$save_ifs"
- + # Now create the wrapper script.
- + func_echo "creating $output"
-
- - if test -n "$export_symbols_regex" && ${skipped_export-false}; then
- - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- - func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- - fi
- + # Quote the relink command for shipping.
- + if test -n "$relink_command"; then
- + # Preserve any variables that may affect compiler behavior
- + for var in $variables_saved_for_relink; do
- + if eval test -z \"\${$var+set}\"; then
- + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- + elif eval var_value=\$$var; test -z "$var_value"; then
- + relink_command="$var=; export $var; $relink_command"
- + else
- + func_quote_for_eval "$var_value"
- + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- + done
- + relink_command="(cd `pwd`; $relink_command)"
- + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- + fi
-
- - if ${skipped_export-false}; then
- - if test -n "$export_symbols" && test -n "$include_expsyms"; then
- - tmp_export_symbols="$export_symbols"
- - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- - $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
- - fi
- -
- - if test -n "$orig_export_symbols"; then
- - # The given exports_symbols file has to be filtered, so filter it.
- - func_echo "filter symbol list for \`$libname.la' to tag DATA exports"
- - # FIXME: $output_objdir/$libname.filter potentially contains lots of
- - # 's' commands which not all seds can handle. GNU sed should be fine
- - # though. Also, the filter scales superlinearly with the number of
- - # global variables. join(1) would be nice here, but unfortunately
- - # isn't a blessed tool.
- - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
- - export_symbols=$output_objdir/$libname.def
- - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- - fi
- - fi
- + # Quote $ECHO for shipping.
- + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
- + case $progpath in
- + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- + esac
- + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
- + else
- + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
- + fi
-
- - libobjs=$output
- - # Restore the value of output.
- - output=$save_output
- + # Only actually do things if not in dry run mode.
- + $opt_dry_run || {
- + # win32 will think the script is a binary if it has
- + # a .exe suffix, so we strip it off here.
- + case $output in
- + *.exe) func_stripname '' '.exe' "$output"
- + output=$func_stripname_result ;;
- + esac
- + # test for cygwin because mv fails w/o .exe extensions
- + case $host in
- + *cygwin*)
- + exeext=.exe
- + func_stripname '' '.exe' "$outputname"
- + outputname=$func_stripname_result ;;
- + *) exeext= ;;
- + esac
- + case $host in
- + *cygwin* | *mingw* )
- + output_name=`basename $output`
- + output_path=`dirname $output`
- + cwrappersource="$output_path/$objdir/lt-$output_name.c"
- + cwrapper="$output_path/$output_name.exe"
- + $RM $cwrappersource $cwrapper
- + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- - eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- - test "X$libobjs" = "X " && libobjs=
- - fi
- - # Expand the library linking commands again to reset the
- - # value of $libobjs for piecewise linking.
- + cat > $cwrappersource <<EOF
-
- - # Do each of the archive commands.
- - if test "$module" = yes && test -n "$module_cmds" ; then
- - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- - cmds=$module_expsym_cmds
- - else
- - cmds=$module_cmds
- - fi
- - else
- - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- - cmds=$archive_expsym_cmds
- - else
- - cmds=$archive_cmds
- - fi
- - fi
- - fi
- +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- + Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
- - if test -n "$delfiles"; then
- - # Append the command to remove temporary files to $cmds.
- - eval cmds=\"\$cmds~\$RM $delfiles\"
- - fi
- + The $output program cannot be directly executed until all the libtool
- + libraries that it depends on are installed.
-
- - # Add any objects from preloaded convenience libraries
- - if test -n "$dlprefiles"; then
- - gentop="$output_objdir/${outputname}x"
- - generated="$generated $gentop"
- + This wrapper executable should never be moved out of the build directory.
- + If it is, it will not operate correctly.
-
- - func_extract_archives $gentop $dlprefiles
- - libobjs="$libobjs $func_extract_archives_result"
- - test "X$libobjs" = "X " && libobjs=
- - fi
- + Currently, it simply execs the wrapper *script* "/bin/sh $output",
- + but could eventually absorb all of the scripts functionality and
- + exec $objdir/$outputname directly.
- +*/
- +EOF
- + cat >> $cwrappersource<<"EOF"
- +#include <stdio.h>
- +#include <stdlib.h>
- +#include <unistd.h>
- +#include <malloc.h>
- +#include <stdarg.h>
- +#include <assert.h>
- +#include <string.h>
- +#include <ctype.h>
- +#include <sys/stat.h>
-
- - save_ifs="$IFS"; IFS='~'
- - for cmd in $cmds; do
- - IFS="$save_ifs"
- - eval cmd=\"$cmd\"
- - $opt_silent || {
- - func_quote_for_expand "$cmd"
- - eval "func_echo $func_quote_for_expand_result"
- - }
- - $opt_dry_run || eval "$cmd" || {
- - lt_exit=$?
- +#if defined(PATH_MAX)
- +# define LT_PATHMAX PATH_MAX
- +#elif defined(MAXPATHLEN)
- +# define LT_PATHMAX MAXPATHLEN
- +#else
- +# define LT_PATHMAX 1024
- +#endif
-
- - # Restore the uninstalled library and exit
- - if test "$mode" = relink; then
- - ( cd "$output_objdir" && \
- - $RM "${realname}T" && \
- - $MV "${realname}U" "$realname" )
- - fi
- +#ifndef DIR_SEPARATOR
- +# define DIR_SEPARATOR '/'
- +# define PATH_SEPARATOR ':'
- +#endif
-
- - exit $lt_exit
- - }
- - done
- - IFS="$save_ifs"
- +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- + defined (__OS2__)
- +# define HAVE_DOS_BASED_FILE_SYSTEM
- +# ifndef DIR_SEPARATOR_2
- +# define DIR_SEPARATOR_2 '\\'
- +# endif
- +# ifndef PATH_SEPARATOR_2
- +# define PATH_SEPARATOR_2 ';'
- +# endif
- +#endif
-
- - # Restore the uninstalled library and exit
- - if test "$mode" = relink; then
- - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
- +#ifndef DIR_SEPARATOR_2
- +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
- +#else /* DIR_SEPARATOR_2 */
- +# define IS_DIR_SEPARATOR(ch) \
- + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
- +#endif /* DIR_SEPARATOR_2 */
-
- - if test -n "$convenience"; then
- - if test -z "$whole_archive_flag_spec"; then
- - func_show_eval '${RM}r "$gentop"'
- - fi
- - fi
- +#ifndef PATH_SEPARATOR_2
- +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
- +#else /* PATH_SEPARATOR_2 */
- +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
- +#endif /* PATH_SEPARATOR_2 */
-
- - exit $EXIT_SUCCESS
- - fi
- +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
- +#define XFREE(stale) do { \
- + if (stale) { free ((void *) stale); stale = 0; } \
- +} while (0)
-
- - # Create links to the real library.
- - for linkname in $linknames; do
- - if test "$realname" != "$linkname"; then
- - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
- - fi
- - done
- +/* -DDEBUG is fairly common in CFLAGS. */
- +#undef DEBUG
- +#if defined DEBUGWRAPPER
- +# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
- +#else
- +# define DEBUG(format, ...)
- +#endif
-
- - # If -module or -export-dynamic was specified, set the dlname.
- - if test "$module" = yes || test "$export_dynamic" = yes; then
- - # On all known operating systems, these are identical.
- - dlname="$soname"
- - fi
- - fi
- - ;;
- +const char *program_name = NULL;
-
- - obj)
- - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- - func_warning "\`-dlopen' is ignored for objects"
- - fi
- +void * xmalloc (size_t num);
- +char * xstrdup (const char *string);
- +const char * base_name (const char *name);
- +char * find_executable(const char *wrapper);
- +int check_executable(const char *path);
- +char * strendzap(char *str, const char *pat);
- +void lt_fatal (const char *message, ...);
-
- - test -n "$deplibs" && \
- - func_warning "\`-l' and \`-L' are ignored for objects"
- +int
- +main (int argc, char *argv[])
- +{
- + char **newargz;
- + int i;
- +
- + program_name = (char *) xstrdup (base_name (argv[0]));
- + DEBUG("(main) argv[0] : %s\n",argv[0]);
- + DEBUG("(main) program_name : %s\n",program_name);
- + newargz = XMALLOC(char *, argc+2);
- +EOF
- +
- + cat >> $cwrappersource <<EOF
- + newargz[0] = (char *) xstrdup("$SHELL");
- +EOF
- +
- + cat >> $cwrappersource <<"EOF"
- + newargz[1] = find_executable(argv[0]);
- + if (newargz[1] == NULL)
- + lt_fatal("Couldn't find %s", argv[0]);
- + DEBUG("(main) found exe at : %s\n",newargz[1]);
- + /* we know the script has the same name, without the .exe */
- + /* so make sure newargz[1] doesn't end in .exe */
- + strendzap(newargz[1],".exe");
- + for (i = 1; i < argc; i++)
- + newargz[i+1] = xstrdup(argv[i]);
- + newargz[argc+1] = NULL;
-
- - test -n "$rpath" && \
- - func_warning "\`-rpath' is ignored for objects"
- + for (i=0; i<argc+1; i++)
- + {
- + DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- + ;
- + }
-
- - test -n "$xrpath" && \
- - func_warning "\`-R' is ignored for objects"
- +EOF
-
- - test -n "$vinfo" && \
- - func_warning "\`-version-info' is ignored for objects"
- + case $host_os in
- + mingw*)
- + cat >> $cwrappersource <<EOF
- + execv("$SHELL",(char const **)newargz);
- +EOF
- + ;;
- + *)
- + cat >> $cwrappersource <<EOF
- + execv("$SHELL",newargz);
- +EOF
- + ;;
- + esac
-
- - test -n "$release" && \
- - func_warning "\`-release' is ignored for objects"
- + cat >> $cwrappersource <<"EOF"
- + return 127;
- +}
-
- - case $output in
- - *.lo)
- - test -n "$objs$old_deplibs" && \
- - func_fatal_error "cannot build library object \`$output' from non-libtool objects"
- +void *
- +xmalloc (size_t num)
- +{
- + void * p = (void *) malloc (num);
- + if (!p)
- + lt_fatal ("Memory exhausted");
-
- - libobj=$output
- - func_lo2o "$libobj"
- - obj=$func_lo2o_result
- - ;;
- - *)
- - libobj=
- - obj="$output"
- - ;;
- - esac
- + return p;
- +}
-
- - # Delete the old objects.
- - $opt_dry_run || $RM $obj $libobj
- +char *
- +xstrdup (const char *string)
- +{
- + return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
- +;
- +}
-
- - # Objects from convenience libraries. This assumes
- - # single-version convenience libraries. Whenever we create
- - # different ones for PIC/non-PIC, this we'll have to duplicate
- - # the extraction.
- - reload_conv_objs=
- - gentop=
- - # reload_cmds runs $LD directly, so let us get rid of
- - # -Wl from whole_archive_flag_spec and hope we can get by with
- - # turning comma into space..
- - wl=
- +const char *
- +base_name (const char *name)
- +{
- + const char *base;
-
- - if test -n "$convenience"; then
- - if test -n "$whole_archive_flag_spec"; then
- - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- - reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
- - else
- - gentop="$output_objdir/${obj}x"
- - generated="$generated $gentop"
- +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- + /* Skip over the disk name in MSDOS pathnames. */
- + if (isalpha ((unsigned char)name[0]) && name[1] == ':')
- + name += 2;
- +#endif
-
- - func_extract_archives $gentop $convenience
- - reload_conv_objs="$reload_objs $func_extract_archives_result"
- - fi
- - fi
- + for (base = name; *name; name++)
- + if (IS_DIR_SEPARATOR (*name))
- + base = name + 1;
- + return base;
- +}
-
- - # Create the old-style object.
- - reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
- +int
- +check_executable(const char * path)
- +{
- + struct stat st;
-
- - output="$obj"
- - func_execute_cmds "$reload_cmds" 'exit $?'
- + DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
- + if ((!path) || (!*path))
- + return 0;
-
- - # Exit if we aren't doing a library object file.
- - if test -z "$libobj"; then
- - if test -n "$gentop"; then
- - func_show_eval '${RM}r "$gentop"'
- - fi
- + if ((stat (path, &st) >= 0) &&
- + (
- + /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
- +#if defined (S_IXOTH)
- + ((st.st_mode & S_IXOTH) == S_IXOTH) ||
- +#endif
- +#if defined (S_IXGRP)
- + ((st.st_mode & S_IXGRP) == S_IXGRP) ||
- +#endif
- + ((st.st_mode & S_IXUSR) == S_IXUSR))
- + )
- + return 1;
- + else
- + return 0;
- +}
-
- - exit $EXIT_SUCCESS
- - fi
- +/* Searches for the full path of the wrapper. Returns
- + newly allocated full path name if found, NULL otherwise */
- +char *
- +find_executable (const char* wrapper)
- +{
- + int has_slash = 0;
- + const char* p;
- + const char* p_next;
- + /* static buffer for getcwd */
- + char tmp[LT_PATHMAX + 1];
- + int tmp_len;
- + char* concat_name;
-
- - if test "$build_libtool_libs" != yes; then
- - if test -n "$gentop"; then
- - func_show_eval '${RM}r "$gentop"'
- - fi
- + DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
- - # Create an invalid libtool object if no PIC, so that we don't
- - # accidentally link it into a program.
- - # $show "echo timestamp > $libobj"
- - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- - exit $EXIT_SUCCESS
- - fi
- + if ((wrapper == NULL) || (*wrapper == '\0'))
- + return NULL;
-
- - if test -n "$pic_flag" || test "$pic_mode" != default; then
- - # Only do commands if we really have different PIC objects.
- - reload_objs="$libobjs $reload_conv_objs"
- - output="$libobj"
- - func_execute_cmds "$reload_cmds" 'exit $?'
- - fi
- + /* Absolute path? */
- +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- + if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
- + {
- + concat_name = xstrdup (wrapper);
- + if (check_executable(concat_name))
- + return concat_name;
- + XFREE(concat_name);
- + }
- + else
- + {
- +#endif
- + if (IS_DIR_SEPARATOR (wrapper[0]))
- + {
- + concat_name = xstrdup (wrapper);
- + if (check_executable(concat_name))
- + return concat_name;
- + XFREE(concat_name);
- + }
- +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- + }
- +#endif
-
- - if test -n "$gentop"; then
- - func_show_eval '${RM}r "$gentop"'
- - fi
- + for (p = wrapper; *p; p++)
- + if (*p == '/')
- + {
- + has_slash = 1;
- + break;
- + }
- + if (!has_slash)
- + {
- + /* no slashes; search PATH */
- + const char* path = getenv ("PATH");
- + if (path != NULL)
- + {
- + for (p = path; *p; p = p_next)
- + {
- + const char* q;
- + size_t p_len;
- + for (q = p; *q; q++)
- + if (IS_PATH_SEPARATOR(*q))
- + break;
- + p_len = q - p;
- + p_next = (*q == '\0' ? q : q + 1);
- + if (p_len == 0)
- + {
- + /* empty path: current directory */
- + if (getcwd (tmp, LT_PATHMAX) == NULL)
- + lt_fatal ("getcwd failed");
- + tmp_len = strlen(tmp);
- + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- + memcpy (concat_name, tmp, tmp_len);
- + concat_name[tmp_len] = '/';
- + strcpy (concat_name + tmp_len + 1, wrapper);
- + }
- + else
- + {
- + concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
- + memcpy (concat_name, p, p_len);
- + concat_name[p_len] = '/';
- + strcpy (concat_name + p_len + 1, wrapper);
- + }
- + if (check_executable(concat_name))
- + return concat_name;
- + XFREE(concat_name);
- + }
- + }
- + /* not found in PATH; assume curdir */
- + }
- + /* Relative path | not found in path: prepend cwd */
- + if (getcwd (tmp, LT_PATHMAX) == NULL)
- + lt_fatal ("getcwd failed");
- + tmp_len = strlen(tmp);
- + concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- + memcpy (concat_name, tmp, tmp_len);
- + concat_name[tmp_len] = '/';
- + strcpy (concat_name + tmp_len + 1, wrapper);
-
- - exit $EXIT_SUCCESS
- - ;;
- + if (check_executable(concat_name))
- + return concat_name;
- + XFREE(concat_name);
- + return NULL;
- +}
-
- - prog)
- - case $host in
- - *cygwin*) func_stripname '' '.exe' "$output"
- - output=$func_stripname_result.exe;;
- - esac
- - test -n "$vinfo" && \
- - func_warning "\`-version-info' is ignored for programs"
- +char *
- +strendzap(char *str, const char *pat)
- +{
- + size_t len, patlen;
-
- - test -n "$release" && \
- - func_warning "\`-release' is ignored for programs"
- + assert(str != NULL);
- + assert(pat != NULL);
-
- - test "$preload" = yes \
- - && test "$dlopen_support" = unknown \
- - && test "$dlopen_self" = unknown \
- - && test "$dlopen_self_static" = unknown && \
- - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
- + len = strlen(str);
- + patlen = strlen(pat);
-
- - case $host in
- - *-*-rhapsody* | *-*-darwin1.[012])
- - # On Rhapsody replace the C library is the System framework
- - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- - ;;
- - esac
- + if (patlen <= len)
- + {
- + str += len - patlen;
- + if (strcmp(str, pat) == 0)
- + *str = '\0';
- + }
- + return str;
- +}
-
- - case $host in
- - *-*-darwin*)
- - # Don't allow lazy linking, it breaks C++ global constructors
- - # But is supposedly fixed on 10.4 or later (yay!).
- - if test "$tagname" = CXX ; then
- - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- - 10.[0123])
- - compile_command="$compile_command ${wl}-bind_at_load"
- - finalize_command="$finalize_command ${wl}-bind_at_load"
- - ;;
- - esac
- - fi
- - # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- - compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- - ;;
- - esac
- +static void
- +lt_error_core (int exit_status, const char * mode,
- + const char * message, va_list ap)
- +{
- + fprintf (stderr, "%s: %s: ", program_name, mode);
- + vfprintf (stderr, message, ap);
- + fprintf (stderr, ".\n");
-
- + if (exit_status >= 0)
- + exit (exit_status);
- +}
-
- - # move library search paths that coincide with paths to not yet
- - # installed libraries to the beginning of the library search list
- - new_libs=
- - for path in $notinst_path; do
- - case " $new_libs " in
- - *" -L$path/$objdir "*) ;;
- - *)
- - case " $compile_deplibs " in
- - *" -L$path/$objdir "*)
- - new_libs="$new_libs -L$path/$objdir" ;;
- - esac
- - ;;
- - esac
- - done
- - for deplib in $compile_deplibs; do
- - case $deplib in
- - -L*)
- - case " $new_libs " in
- - *" $deplib "*) ;;
- - *) new_libs="$new_libs $deplib" ;;
- - esac
- +void
- +lt_fatal (const char *message, ...)
- +{
- + va_list ap;
- + va_start (ap, message);
- + lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
- + va_end (ap);
- +}
- +EOF
- + # we should really use a build-platform specific compiler
- + # here, but OTOH, the wrappers (shell script and this C one)
- + # are only useful if you want to execute the "real" binary.
- + # Since the "real" binary is built for $host, then this
- + # wrapper might as well be built for $host, too.
- + $opt_dry_run || $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
- ;;
- - *) new_libs="$new_libs $deplib" ;;
- esac
- - done
- - compile_deplibs="$new_libs"
- -
- + $RM $output
- + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
- - compile_command="$compile_command $compile_deplibs"
- - finalize_command="$finalize_command $finalize_deplibs"
- + $ECHO > $output "\
- +#! $SHELL
-
- - if test -n "$rpath$xrpath"; then
- - # If the user specified any rpath flags, then add them.
- - for libdir in $rpath $xrpath; do
- - # This is the magic to use -rpath.
- - case "$finalize_rpath " in
- - *" $libdir "*) ;;
- - *) finalize_rpath="$finalize_rpath $libdir" ;;
- - esac
- - done
- - fi
- +# $output - temporary wrapper script for $objdir/$outputname
- +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
- +#
- +# The $output program cannot be directly executed until all the libtool
- +# libraries that it depends on are installed.
- +#
- +# This wrapper script should never be moved out of the build directory.
- +# If it is, it will not operate correctly.
-
- - # Now hardcode the library paths
- - rpath=
- - hardcode_libdirs=
- - for libdir in $compile_rpath $finalize_rpath; do
- - if test -n "$hardcode_libdir_flag_spec"; then
- - if test -n "$hardcode_libdir_separator"; then
- - if test -z "$hardcode_libdirs"; then
- - hardcode_libdirs="$libdir"
- - else
- - # Just accumulate the unique libdirs.
- - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- - ;;
- - *)
- - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- - ;;
- - esac
- - fi
- - else
- - eval flag=\"$hardcode_libdir_flag_spec\"
- - rpath="$rpath $flag"
- - fi
- - elif test -n "$runpath_var"; then
- - case "$perm_rpath " in
- - *" $libdir "*) ;;
- - *) perm_rpath="$perm_rpath $libdir" ;;
- - esac
- - fi
- - case $host in
- - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
- - case :$dllsearchpath: in
- - *":$libdir:"*) ;;
- - *) dllsearchpath="$dllsearchpath:$libdir";;
- - esac
- - case :$dllsearchpath: in
- - *":$testbindir:"*) ;;
- - *) dllsearchpath="$dllsearchpath:$testbindir";;
- - esac
- - ;;
- - esac
- - done
- - # Substitute the hardcoded libdirs into the rpath.
- - if test -n "$hardcode_libdir_separator" &&
- - test -n "$hardcode_libdirs"; then
- - libdir="$hardcode_libdirs"
- - eval rpath=\" $hardcode_libdir_flag_spec\"
- - fi
- - compile_rpath="$rpath"
- +# Sed substitution that helps us do robust quoting. It backslashifies
- +# metacharacters that are still active within double-quoted strings.
- +Xsed='${SED} -e 1s/^X//'
- +sed_quote_subst='$sed_quote_subst'
-
- - rpath=
- - hardcode_libdirs=
- - for libdir in $finalize_rpath; do
- - if test -n "$hardcode_libdir_flag_spec"; then
- - if test -n "$hardcode_libdir_separator"; then
- - if test -z "$hardcode_libdirs"; then
- - hardcode_libdirs="$libdir"
- - else
- - # Just accumulate the unique libdirs.
- - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- - ;;
- - *)
- - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- - ;;
- - esac
- - fi
- - else
- - eval flag=\"$hardcode_libdir_flag_spec\"
- - rpath="$rpath $flag"
- - fi
- - elif test -n "$runpath_var"; then
- - case "$finalize_perm_rpath " in
- - *" $libdir "*) ;;
- - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
- - esac
- - fi
- - done
- - # Substitute the hardcoded libdirs into the rpath.
- - if test -n "$hardcode_libdir_separator" &&
- - test -n "$hardcode_libdirs"; then
- - libdir="$hardcode_libdirs"
- - eval rpath=\" $hardcode_libdir_flag_spec\"
- - fi
- - finalize_rpath="$rpath"
- +# The HP-UX ksh and POSIX shell print the target directory to stdout
- +# if CDPATH is set.
- +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
- - if test -n "$libobjs" && test "$build_old_libs" = yes; then
- - # Transform all the library objects into standard objects.
- - compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- - finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- - fi
- +relink_command=\"$relink_command\"
-
- - func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
- +# This environment variable determines our operation mode.
- +if test \"\$libtool_install_magic\" = \"$magic\"; then
- + # install mode needs the following variables:
- + generated_by_libtool_version='$macro_version'
- + notinst_deplibs='$notinst_deplibs'
- +else
- + # When we are sourced in execute mode, \$file and \$ECHO are already set.
- + if test \"\$libtool_execute_magic\" != \"$magic\"; then
- + ECHO=\"$qecho\"
- + file=\"\$0\"
- + # Make sure echo works.
- + if test \"X\$1\" = X--no-reexec; then
- + # Discard the --no-reexec flag, and continue.
- + shift
- + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
- + # Yippee, \$ECHO works!
- + :
- + else
- + # Restart under the correct shell, and then maybe \$ECHO will work.
- + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- + fi
- + fi\
- +"
- + $ECHO >> $output "\
-
- - # template prelinking step
- - if test -n "$prelink_cmds"; then
- - func_execute_cmds "$prelink_cmds" 'exit $?'
- - fi
- + # Find the directory that this script lives in.
- + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
- + test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- - wrappers_required=yes
- - case $host in
- - *cygwin* | *mingw* )
- - if test "$build_libtool_libs" != yes; then
- - wrappers_required=no
- - fi
- - ;;
- - *)
- - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- - wrappers_required=no
- - fi
- - ;;
- + # Follow symbolic links until we get to the real thisdir.
- + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
- + while test -n \"\$file\"; do
- + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
- +
- + # If there was a directory component, then change thisdir.
- + if test \"x\$destdir\" != \"x\$file\"; then
- + case \"\$destdir\" in
- + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- + *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- - if test "$wrappers_required" = no; then
- - # Replace the output file specification.
- - compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- - link_command="$compile_command$compile_rpath"
- + fi
-
- - # We have no uninstalled library dependencies, so finalize right now.
- - exit_status=0
- - func_show_eval "$link_command" 'exit_status=$?'
- + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
- + done
-
- - # Delete the generated files.
- - if test -f "$output_objdir/${outputname}S.${objext}"; then
- - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
- - fi
- + # Try to get the absolute directory name.
- + absdir=\`cd \"\$thisdir\" && pwd\`
- + test -n \"\$absdir\" && thisdir=\"\$absdir\"
- +"
-
- - exit $exit_status
- - fi
- + if test "$fast_install" = yes; then
- + $ECHO >> $output "\
- + program=lt-'$outputname'$exeext
- + progdir=\"\$thisdir/$objdir\"
-
- - if test -n "$compile_shlibpath$finalize_shlibpath"; then
- - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- - fi
- - if test -n "$finalize_shlibpath"; then
- - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- - fi
- + if test ! -f \"\$progdir/\$program\" ||
- + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- + test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- - compile_var=
- - finalize_var=
- - if test -n "$runpath_var"; then
- - if test -n "$perm_rpath"; then
- - # We should set the runpath_var.
- - rpath=
- - for dir in $perm_rpath; do
- - rpath="$rpath$dir:"
- - done
- - compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- - fi
- - if test -n "$finalize_perm_rpath"; then
- - # We should set the runpath_var.
- - rpath=
- - for dir in $finalize_perm_rpath; do
- - rpath="$rpath$dir:"
- - done
- - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- - fi
- - fi
- + file=\"\$\$-\$program\"
-
- - if test "$no_install" = yes; then
- - # We don't need to create a wrapper script.
- - link_command="$compile_var$compile_command$compile_rpath"
- - # Replace the output file specification.
- - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- - # Delete the old output file.
- - $opt_dry_run || $RM $output
- - # Link the executable and exit
- - func_show_eval "$link_command" 'exit $?'
- - exit $EXIT_SUCCESS
- - fi
- + if test ! -d \"\$progdir\"; then
- + $MKDIR \"\$progdir\"
- + else
- + $RM \"\$progdir/\$file\"
- + fi"
-
- - if test "$hardcode_action" = relink; then
- - # Fast installation is not supported
- - link_command="$compile_var$compile_command$compile_rpath"
- - relink_command="$finalize_var$finalize_command$finalize_rpath"
- + $ECHO >> $output "\
-
- - func_warning "this platform does not like uninstalled shared libraries"
- - func_warning "\`$output' will be relinked during installation"
- + # relink executable if necessary
- + if test -n \"\$relink_command\"; then
- + if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- - if test "$fast_install" != no; then
- - link_command="$finalize_var$compile_command$finalize_rpath"
- - if test "$fast_install" = yes; then
- - relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
- - else
- - # fast_install is set to needless
- - relink_command=
- - fi
- + $ECHO \"\$relink_command_output\" >&2
- + $RM \"\$progdir/\$file\"
- + exit 1
- + fi
- + fi
- +
- + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- + { $RM \"\$progdir/\$program\";
- + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- + $RM \"\$progdir/\$file\"
- + fi"
- else
- - link_command="$compile_var$compile_command$compile_rpath"
- - relink_command="$finalize_var$finalize_command$finalize_rpath"
- + $ECHO >> $output "\
- + program='$outputname'
- + progdir=\"\$thisdir/$objdir\"
- +"
- fi
- - fi
-
- - # Replace the output file specification.
- - link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
- + $ECHO >> $output "\
-
- - # Delete the old output files.
- - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
- + if test -f \"\$progdir/\$program\"; then"
-
- - func_show_eval "$link_command" 'exit $?'
- + # Export our shlibpath_var if we have one.
- + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- + $ECHO >> $output "\
- + # Add our own library path to $shlibpath_var
- + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- - # Now create the wrapper script.
- - func_echo "creating $output"
- + # Some systems cannot cope with colon-terminated $shlibpath_var
- + # The second colon is a workaround for a bug in BeOS R4 sed
- + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
- - # Quote the relink command for shipping.
- - if test -n "$relink_command"; then
- - # Preserve any variables that may affect compiler behavior
- - for var in $variables_saved_for_relink; do
- - if eval test -z \"\${$var+set}\"; then
- - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- - elif eval var_value=\$$var; test -z "$var_value"; then
- - relink_command="$var=; export $var; $relink_command"
- - else
- - func_quote_for_eval "$var_value"
- - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- - fi
- - done
- - relink_command="(cd `pwd`; $relink_command)"
- - relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- - fi
- + export $shlibpath_var
- +"
- + fi
-
- - # Quote $ECHO for shipping.
- - if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
- - case $progpath in
- - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- - esac
- - qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
- - else
- - qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
- - fi
- + # fixup the dll searchpath if we need to.
- + if test -n "$dllsearchpath"; then
- + $ECHO >> $output "\
- + # Add the dll search path components to the executable PATH
- + PATH=$dllsearchpath:\$PATH
- +"
- + fi
-
- - # Only actually do things if not in dry run mode.
- - $opt_dry_run || {
- - # win32 will think the script is a binary if it has
- - # a .exe suffix, so we strip it off here.
- - case $output in
- - *.exe) func_stripname '' '.exe' "$output"
- - output=$func_stripname_result ;;
- - esac
- - # test for cygwin because mv fails w/o .exe extensions
- - case $host in
- - *cygwin*)
- - exeext=.exe
- - func_stripname '' '.exe' "$outputname"
- - outputname=$func_stripname_result ;;
- - *) exeext= ;;
- - esac
- + $ECHO >> $output "\
- + if test \"\$libtool_execute_magic\" != \"$magic\"; then
- + # Run the actual program with our arguments.
- +"
- case $host in
- - *cygwin* | *mingw* )
- - output_name=`basename $output`
- - output_path=`dirname $output`
- - cwrappersource="$output_path/$objdir/lt-$output_name.c"
- - cwrapper="$output_path/$output_name.exe"
- - $RM $cwrappersource $cwrapper
- - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
- -
- - func_emit_libtool_cwrapperexe_source > $cwrappersource
- + # Backslashes separate directories on plain windows
- + *-*-mingw | *-*-os2*)
- + $ECHO >> $output "\
- + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
- +"
- + ;;
-
- - # we should really use a build-platform specific compiler
- - # here, but OTOH, the wrappers (shell script and this C one)
- - # are only useful if you want to execute the "real" binary.
- - # Since the "real" binary is built for $host, then this
- - # wrapper might as well be built for $host, too.
- - $opt_dry_run || $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
- + *)
- + $ECHO >> $output "\
- + exec \"\$progdir/\$program\" \${1+\"\$@\"}
- +"
- ;;
- esac
- - $RM $output
- - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
- -
- - func_emit_libtool_wrapper_script > $output
- + $ECHO >> $output "\
- + \$ECHO \"\$0: cannot exec \$program \${1+\"\$@\"}\"
- + exit 1
- + fi
- + else
- + # The program doesn't exist.
- + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- + exit 1
- + fi
- +fi\
- +"
- chmod +x $output
- }
- exit $EXIT_SUCCESS
- @@ -7049,7 +6929,7 @@ EOF
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- + relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- @@ -7205,9 +7085,6 @@ relink_command=\"$relink_command\""
- exit $EXIT_SUCCESS
- }
-
- -{ test "$mode" = link || test "$mode" = relink; } &&
- - func_mode_link ${1+"$@"}
- -
-
- # func_mode_uninstall arg...
- func_mode_uninstall ()
- @@ -7275,7 +7152,7 @@ func_mode_uninstall ()
- *.la)
- # Possibly a libtool archive, so verify it.
- if func_lalib_p "$file"; then
- - func_source $dir/$name
- + . $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- @@ -7313,7 +7190,7 @@ func_mode_uninstall ()
- if func_lalib_p "$file"; then
-
- # Read the .lo file
- - func_source $dir/$name
- + . $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- @@ -7346,7 +7223,7 @@ func_mode_uninstall ()
- # Do a test to see if this is a libtool program.
- if func_ltwrapper_p "$file"; then
- relink_command=
- - func_source $dir/$noexename
- + . $dir/$noexename
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- @@ -7375,21 +7252,59 @@ func_mode_uninstall ()
- exit $exit_status
- }
-
- -{ test "$mode" = uninstall || test "$mode" = clean; } &&
- - func_mode_uninstall ${1+"$@"}
-
- -test -z "$mode" && {
- - help="$generic_help"
- - func_fatal_help "you must specify a MODE"
- -}
- +# TEST SUITE MARKER ## NON-FUNCTION
- +## ----------- ##
- +## Main. ##
- +## ----------- ##
-
- -test -z "$exec_cmd" && \
- - func_fatal_help "invalid operation mode \`$mode'"
- +{
- + # Sanity checks first:
- + func_check_version_match
-
- -if test -n "$exec_cmd"; then
- - eval exec "$exec_cmd"
- - exit $EXIT_FAILURE
- -fi
- + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- + func_fatal_configuration "not configured to build any kind of library"
- + fi
- +
- + test -z "$mode" && func_fatal_error "error: you must specify a MODE."
- +
- +
- + # Darwin sucks
- + eval std_shrext=\"$shrext_cmds\"
- +
- +
- + # Only execute mode is allowed to have -dlopen flags.
- + if test -n "$execute_dlfiles" && test "$mode" != execute; then
- + func_error "unrecognized option \`-dlopen'"
- + $ECHO "$help" 1>&2
- + exit $EXIT_FAILURE
- + fi
- +
- + # Change the help message to a mode-specific one.
- + generic_help="$help"
- + help="Try \`$progname --help --mode=$mode' for more information."
- +
- + case $mode in
- + compile) func_mode_compile ${1+"$@"} ;;
- + execute) func_mode_execute ${1+"$@"} ;;
- + finish) func_mode_finish ${1+"$@"} ;;
- + install) func_mode_install ${1+"$@"} ;;
- + link|relink) func_mode_link ${1+"$@"} ;;
- + uninstall|clean) func_mode_uninstall ${1+"$@"} ;;
- +
- + "") help="$generic_help"
- + func_fatal_help "you must specify a MODE"
- + ;;
- + esac
- +
- + test -z "$exec_cmd" && \
- + func_fatal_help "invalid operation mode \`$mode'"
- +
- + if test -n "$exec_cmd"; then
- + eval exec "$exec_cmd"
- + exit $EXIT_FAILURE
- + fi
- +}
-
- exit $exit_status
-
- @@ -7418,6 +7333,3 @@ build_old_libs=`case $build_libtool_libs
- # mode:shell-script
- # sh-indentation:2
- # End:
- -# vi:sw=2
- -
- -
|