fakeroot-revert-ltmain.patch 271 KB

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