ltmain.sh 184 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594
  1. # ltmain.sh - Provide generalized library-building support services.
  2. # NOTE: Changing this file will not affect anything until you rerun configure.
  3. #
  4. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
  5. # Free Software Foundation, Inc.
  6. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful, but
  14. # WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. # General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  21. #
  22. # As a special exception to the GNU General Public License, if you
  23. # distribute this file as part of a program that contains a
  24. # configuration script generated by Autoconf, you may include it under
  25. # the same distribution terms that you use for the rest of that program.
  26. basename="s,^.*/,,g"
  27. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  28. # is ksh but when the shell is invoked as "sh" and the current value of
  29. # the _XPG environment variable is not equal to 1 (one), the special
  30. # positional parameter $0, within a function call, is the name of the
  31. # function.
  32. progpath="$0"
  33. # The name of this program:
  34. progname=`echo "$progpath" | $SED $basename`
  35. modename="$progname"
  36. # Global variables:
  37. EXIT_SUCCESS=0
  38. EXIT_FAILURE=1
  39. PROGRAM=ltmain.sh
  40. PACKAGE=libtool
  41. VERSION=1.5.18
  42. TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)"
  43. # See if we are running on zsh, and set the options which allow our
  44. # commands through without removal of \ escapes.
  45. if test -n "${ZSH_VERSION+set}" ; then
  46. setopt NO_GLOB_SUBST
  47. fi
  48. # Check that we have a working $echo.
  49. if test "X$1" = X--no-reexec; then
  50. # Discard the --no-reexec flag, and continue.
  51. shift
  52. elif test "X$1" = X--fallback-echo; then
  53. # Avoid inline document here, it may be left over
  54. :
  55. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  56. # Yippee, $echo works!
  57. :
  58. else
  59. # Restart under the correct shell, and then maybe $echo will work.
  60. exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  61. fi
  62. if test "X$1" = X--fallback-echo; then
  63. # used as fallback echo
  64. shift
  65. cat <<EOF
  66. $*
  67. EOF
  68. exit $EXIT_SUCCESS
  69. fi
  70. default_mode=
  71. help="Try \`$progname --help' for more information."
  72. magic="%%%MAGIC variable%%%"
  73. mkdir="mkdir"
  74. mv="mv -f"
  75. rm="rm -f"
  76. # Sed substitution that helps us do robust quoting. It backslashifies
  77. # metacharacters that are still active within double-quoted strings.
  78. Xsed="${SED}"' -e 1s/^X//'
  79. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  80. # test EBCDIC or ASCII
  81. case `echo A|tr A '\301'` in
  82. A) # EBCDIC based system
  83. SP2NL="tr '\100' '\n'"
  84. NL2SP="tr '\r\n' '\100\100'"
  85. ;;
  86. *) # Assume ASCII based system
  87. SP2NL="tr '\040' '\012'"
  88. NL2SP="tr '\015\012' '\040\040'"
  89. ;;
  90. esac
  91. # NLS nuisances.
  92. # Only set LANG and LC_ALL to C if already set.
  93. # These must not be set unconditionally because not all systems understand
  94. # e.g. LANG=C (notably SCO).
  95. # We save the old values to restore during execute mode.
  96. if test "${LC_ALL+set}" = set; then
  97. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  98. fi
  99. if test "${LANG+set}" = set; then
  100. save_LANG="$LANG"; LANG=C; export LANG
  101. fi
  102. # Make sure IFS has a sensible default
  103. lt_nl='
  104. '
  105. IFS=" $lt_nl"
  106. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  107. $echo "$modename: not configured to build any kind of library" 1>&2
  108. $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  109. exit $EXIT_FAILURE
  110. fi
  111. # Global variables.
  112. mode=$default_mode
  113. nonopt=
  114. prev=
  115. prevopt=
  116. run=
  117. show="$echo"
  118. show_help=
  119. execute_dlfiles=
  120. lo2o="s/\\.lo\$/.${objext}/"
  121. o2lo="s/\\.${objext}\$/.lo/"
  122. quote_scanset='[[~#^*{};<>?'"'"' ]'
  123. #####################################
  124. # Shell function definitions:
  125. # This seems to be the best place for them
  126. # func_win32_libid arg
  127. # return the library type of file 'arg'
  128. #
  129. # Need a lot of goo to handle *both* DLLs and import libs
  130. # Has to be a shell function in order to 'eat' the argument
  131. # that is supplied when $file_magic_command is called.
  132. func_win32_libid ()
  133. {
  134. win32_libid_type="unknown"
  135. win32_fileres=`file -L $1 2>/dev/null`
  136. case $win32_fileres in
  137. *ar\ archive\ import\ library*) # definitely import
  138. win32_libid_type="x86 archive import"
  139. ;;
  140. *ar\ archive*) # could be an import, or static
  141. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
  142. $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  143. win32_nmres=`eval $NM -f posix -A $1 | \
  144. sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
  145. if test "X$win32_nmres" = "Ximport" ; then
  146. win32_libid_type="x86 archive import"
  147. else
  148. win32_libid_type="x86 archive static"
  149. fi
  150. fi
  151. ;;
  152. *DLL*)
  153. win32_libid_type="x86 DLL"
  154. ;;
  155. *executable*) # but shell scripts are "executable" too...
  156. case $win32_fileres in
  157. *MS\ Windows\ PE\ Intel*)
  158. win32_libid_type="x86 DLL"
  159. ;;
  160. esac
  161. ;;
  162. esac
  163. $echo $win32_libid_type
  164. }
  165. # func_infer_tag arg
  166. # Infer tagged configuration to use if any are available and
  167. # if one wasn't chosen via the "--tag" command line option.
  168. # Only attempt this if the compiler in the base compile
  169. # command doesn't match the default compiler.
  170. # arg is usually of the form 'gcc ...'
  171. func_infer_tag ()
  172. {
  173. # Set the commonly-used compilers for some tags.
  174. tag_compilers_CC="*cc *xlc"
  175. tag_compilers_CXX="*++ *CC"
  176. tag_compilers_F77="*77 *fort"
  177. base_compiler=`set -- "$@"; $echo $1`
  178. # If $tagname still isn't set, then try to infer if the default
  179. # "CC" tag applies by matching up the base compile command to some
  180. # compilers commonly used for the "CC" tag.
  181. if test -z "$tagname"; then
  182. z=CC
  183. eval "tag_compilers=\$tag_compilers_${z}"
  184. if test -n "$tag_compilers"; then
  185. for zp in $tag_compilers; do
  186. case $base_compiler in
  187. $zp)
  188. # The compiler in the base compile command matches
  189. # one of the common compilers for the current tag.
  190. # Assume this is the tagged configuration we want.
  191. tagname=$z
  192. break
  193. ;;
  194. esac
  195. done
  196. fi
  197. fi
  198. if test -n "$available_tags" && test -z "$tagname"; then
  199. CC_quoted=
  200. for arg in $CC; do
  201. case $arg in
  202. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  203. arg="\"$arg\""
  204. ;;
  205. esac
  206. CC_quoted="$CC_quoted $arg"
  207. done
  208. case $@ in
  209. # Blanks in the command may have been stripped by the calling shell,
  210. # but not from the CC environment variable when configure was run.
  211. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
  212. # Blanks at the start of $base_compile will cause this to fail
  213. # if we don't check for them as well.
  214. *)
  215. for z in $available_tags; do
  216. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  217. # Evaluate the configuration.
  218. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  219. CC_quoted=
  220. for arg in $CC; do
  221. # Double-quote args containing other shell metacharacters.
  222. case $arg in
  223. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  224. arg="\"$arg\""
  225. ;;
  226. esac
  227. CC_quoted="$CC_quoted $arg"
  228. done
  229. case "$@ " in
  230. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
  231. # The compiler in the base compile command matches
  232. # the one in the tagged configuration.
  233. # Assume this is the tagged configuration we want.
  234. tagname=$z
  235. break
  236. ;;
  237. esac
  238. # If $tagname still isn't set, then try to infer it by
  239. # matching up the base compile command to some compilers
  240. # commonly used for certain tags.
  241. base_compiler=`set -- "$@"; $echo $1`
  242. eval "tag_compilers=\$tag_compilers_${z}"
  243. if test -n "$tag_compilers"; then
  244. for zp in $tag_compilers; do
  245. case $base_compiler in
  246. $zp)
  247. # The compiler in the base compile command matches
  248. # one of the common compilers for the current tag.
  249. # Assume this is the tagged configuration we want.
  250. tagname=$z
  251. break
  252. ;;
  253. esac
  254. done
  255. if test -n "$tagname"; then
  256. break
  257. fi
  258. fi
  259. fi
  260. done
  261. # If $tagname still isn't set, then no tagged configuration
  262. # was found and let the user know that the "--tag" command
  263. # line option must be used.
  264. if test -z "$tagname"; then
  265. $echo "$modename: unable to infer tagged configuration"
  266. $echo "$modename: specify a tag with \`--tag'" 1>&2
  267. exit $EXIT_FAILURE
  268. # else
  269. # $echo "$modename: using $tagname tagged configuration"
  270. fi
  271. ;;
  272. esac
  273. fi
  274. }
  275. # func_extract_an_archive dir oldlib
  276. func_extract_an_archive ()
  277. {
  278. f_ex_an_ar_dir="$1"; shift
  279. f_ex_an_ar_oldlib="$1"
  280. $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
  281. $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
  282. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  283. :
  284. else
  285. $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
  286. exit $EXIT_FAILURE
  287. fi
  288. }
  289. # func_extract_archives gentop oldlib ...
  290. func_extract_archives ()
  291. {
  292. my_gentop="$1"; shift
  293. my_oldlibs=${1+"$@"}
  294. my_oldobjs=""
  295. my_xlib=""
  296. my_xabs=""
  297. my_xdir=""
  298. my_status=""
  299. $show "${rm}r $my_gentop"
  300. $run ${rm}r "$my_gentop"
  301. $show "$mkdir $my_gentop"
  302. $run $mkdir "$my_gentop"
  303. my_status=$?
  304. if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
  305. exit $my_status
  306. fi
  307. for my_xlib in $my_oldlibs; do
  308. # Extract the objects.
  309. case $my_xlib in
  310. [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  311. *) my_xabs=`pwd`"/$my_xlib" ;;
  312. esac
  313. my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
  314. my_xdir="$my_gentop/$my_xlib"
  315. $show "${rm}r $my_xdir"
  316. $run ${rm}r "$my_xdir"
  317. $show "$mkdir $my_xdir"
  318. $run $mkdir "$my_xdir"
  319. status=$?
  320. if test "$status" -ne 0 && test ! -d "$my_xdir"; then
  321. exit $status
  322. fi
  323. case $host in
  324. *-darwin*)
  325. $show "Extracting $my_xabs"
  326. # Do not bother doing anything if just a dry run
  327. if test -z "$run"; then
  328. darwin_orig_dir=`pwd`
  329. cd $my_xdir || exit $?
  330. darwin_archive=$my_xabs
  331. darwin_curdir=`pwd`
  332. darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
  333. darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
  334. if test -n "$darwin_arches"; then
  335. darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
  336. darwin_arch=
  337. $show "$darwin_base_archive has multiple architectures $darwin_arches"
  338. for darwin_arch in $darwin_arches ; do
  339. mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  340. lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  341. cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  342. func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  343. cd "$darwin_curdir"
  344. $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  345. done # $darwin_arches
  346. ## Okay now we have a bunch of thin objects, gotta fatten them up :)
  347. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
  348. darwin_file=
  349. darwin_files=
  350. for darwin_file in $darwin_filelist; do
  351. darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  352. lipo -create -output "$darwin_file" $darwin_files
  353. done # $darwin_filelist
  354. ${rm}r unfat-$$
  355. cd "$darwin_orig_dir"
  356. else
  357. cd "$darwin_orig_dir"
  358. func_extract_an_archive "$my_xdir" "$my_xabs"
  359. fi # $darwin_arches
  360. fi # $run
  361. ;;
  362. *)
  363. func_extract_an_archive "$my_xdir" "$my_xabs"
  364. ;;
  365. esac
  366. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  367. done
  368. func_extract_archives_result="$my_oldobjs"
  369. }
  370. # End of Shell function definitions
  371. #####################################
  372. # Darwin sucks
  373. eval std_shrext=\"$shrext_cmds\"
  374. # Parse our command line options once, thoroughly.
  375. while test "$#" -gt 0
  376. do
  377. arg="$1"
  378. shift
  379. case $arg in
  380. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  381. *) optarg= ;;
  382. esac
  383. # If the previous option needs an argument, assign it.
  384. if test -n "$prev"; then
  385. case $prev in
  386. execute_dlfiles)
  387. execute_dlfiles="$execute_dlfiles $arg"
  388. ;;
  389. tag)
  390. tagname="$arg"
  391. preserve_args="${preserve_args}=$arg"
  392. # Check whether tagname contains only valid characters
  393. case $tagname in
  394. *[!-_A-Za-z0-9,/]*)
  395. $echo "$progname: invalid tag name: $tagname" 1>&2
  396. exit $EXIT_FAILURE
  397. ;;
  398. esac
  399. case $tagname in
  400. CC)
  401. # Don't test for the "default" C tag, as we know, it's there, but
  402. # not specially marked.
  403. ;;
  404. *)
  405. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
  406. taglist="$taglist $tagname"
  407. # Evaluate the configuration.
  408. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
  409. else
  410. $echo "$progname: ignoring unknown tag $tagname" 1>&2
  411. fi
  412. ;;
  413. esac
  414. ;;
  415. *)
  416. eval "$prev=\$arg"
  417. ;;
  418. esac
  419. prev=
  420. prevopt=
  421. continue
  422. fi
  423. # Have we seen a non-optional argument yet?
  424. case $arg in
  425. --help)
  426. show_help=yes
  427. ;;
  428. --version)
  429. $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  430. $echo
  431. $echo "Copyright (C) 2005 Free Software Foundation, Inc."
  432. $echo "This is free software; see the source for copying conditions. There is NO"
  433. $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  434. exit $?
  435. ;;
  436. --config)
  437. ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
  438. # Now print the configurations for the tags.
  439. for tagname in $taglist; do
  440. ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
  441. done
  442. exit $?
  443. ;;
  444. --debug)
  445. $echo "$progname: enabling shell trace mode"
  446. set -x
  447. preserve_args="$preserve_args $arg"
  448. ;;
  449. --dry-run | -n)
  450. run=:
  451. ;;
  452. --features)
  453. $echo "host: $host"
  454. if test "$build_libtool_libs" = yes; then
  455. $echo "enable shared libraries"
  456. else
  457. $echo "disable shared libraries"
  458. fi
  459. if test "$build_old_libs" = yes; then
  460. $echo "enable static libraries"
  461. else
  462. $echo "disable static libraries"
  463. fi
  464. exit $?
  465. ;;
  466. --finish) mode="finish" ;;
  467. --mode) prevopt="--mode" prev=mode ;;
  468. --mode=*) mode="$optarg" ;;
  469. --preserve-dup-deps) duplicate_deps="yes" ;;
  470. --quiet | --silent)
  471. show=:
  472. preserve_args="$preserve_args $arg"
  473. ;;
  474. --tag) prevopt="--tag" prev=tag ;;
  475. --tag=*)
  476. set tag "$optarg" ${1+"$@"}
  477. shift
  478. prev=tag
  479. preserve_args="$preserve_args --tag"
  480. ;;
  481. -dlopen)
  482. prevopt="-dlopen"
  483. prev=execute_dlfiles
  484. ;;
  485. -*)
  486. $echo "$modename: unrecognized option \`$arg'" 1>&2
  487. $echo "$help" 1>&2
  488. exit $EXIT_FAILURE
  489. ;;
  490. *)
  491. nonopt="$arg"
  492. break
  493. ;;
  494. esac
  495. done
  496. if test -n "$prevopt"; then
  497. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  498. $echo "$help" 1>&2
  499. exit $EXIT_FAILURE
  500. fi
  501. # If this variable is set in any of the actions, the command in it
  502. # will be execed at the end. This prevents here-documents from being
  503. # left over by shells.
  504. exec_cmd=
  505. if test -z "$show_help"; then
  506. # Infer the operation mode.
  507. if test -z "$mode"; then
  508. $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
  509. $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
  510. case $nonopt in
  511. *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc* | *CC)
  512. mode=link
  513. for arg
  514. do
  515. case $arg in
  516. -c)
  517. mode=compile
  518. break
  519. ;;
  520. esac
  521. done
  522. ;;
  523. *db | *dbx | *strace | *truss)
  524. mode=execute
  525. ;;
  526. *install*|cp|mv)
  527. mode=install
  528. ;;
  529. *rm)
  530. mode=uninstall
  531. ;;
  532. *)
  533. # If we have no mode, but dlfiles were specified, then do execute mode.
  534. test -n "$execute_dlfiles" && mode=execute
  535. # Just use the default operation mode.
  536. if test -z "$mode"; then
  537. if test -n "$nonopt"; then
  538. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  539. else
  540. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  541. fi
  542. fi
  543. ;;
  544. esac
  545. fi
  546. # Only execute mode is allowed to have -dlopen flags.
  547. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  548. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  549. $echo "$help" 1>&2
  550. exit $EXIT_FAILURE
  551. fi
  552. # Change the help message to a mode-specific one.
  553. generic_help="$help"
  554. help="Try \`$modename --help --mode=$mode' for more information."
  555. # These modes are in order of execution frequency so that they run quickly.
  556. case $mode in
  557. # libtool compile mode
  558. compile)
  559. modename="$modename: compile"
  560. # Get the compilation command and the source file.
  561. base_compile=
  562. srcfile="$nonopt" # always keep a non-empty value in "srcfile"
  563. suppress_opt=yes
  564. suppress_output=
  565. arg_mode=normal
  566. libobj=
  567. later=
  568. for arg
  569. do
  570. case "$arg_mode" in
  571. arg )
  572. # do not "continue". Instead, add this to base_compile
  573. lastarg="$arg"
  574. arg_mode=normal
  575. ;;
  576. target )
  577. libobj="$arg"
  578. arg_mode=normal
  579. continue
  580. ;;
  581. normal )
  582. # Accept any command-line options.
  583. case $arg in
  584. -o)
  585. if test -n "$libobj" ; then
  586. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  587. exit $EXIT_FAILURE
  588. fi
  589. arg_mode=target
  590. continue
  591. ;;
  592. -static | -prefer-pic | -prefer-non-pic)
  593. later="$later $arg"
  594. continue
  595. ;;
  596. -no-suppress)
  597. suppress_opt=no
  598. continue
  599. ;;
  600. -Xcompiler)
  601. arg_mode=arg # the next one goes into the "base_compile" arg list
  602. continue # The current "srcfile" will either be retained or
  603. ;; # replaced later. I would guess that would be a bug.
  604. -Wc,*)
  605. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  606. lastarg=
  607. save_ifs="$IFS"; IFS=','
  608. for arg in $args; do
  609. IFS="$save_ifs"
  610. # Double-quote args containing other shell metacharacters.
  611. # Many Bourne shells cannot handle close brackets correctly
  612. # in scan sets, so we specify it separately.
  613. case $arg in
  614. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  615. arg="\"$arg\""
  616. ;;
  617. esac
  618. lastarg="$lastarg $arg"
  619. done
  620. IFS="$save_ifs"
  621. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  622. # Add the arguments to base_compile.
  623. base_compile="$base_compile $lastarg"
  624. continue
  625. ;;
  626. * )
  627. # Accept the current argument as the source file.
  628. # The previous "srcfile" becomes the current argument.
  629. #
  630. lastarg="$srcfile"
  631. srcfile="$arg"
  632. ;;
  633. esac # case $arg
  634. ;;
  635. esac # case $arg_mode
  636. # Aesthetically quote the previous argument.
  637. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  638. case $lastarg in
  639. # Double-quote args containing other shell metacharacters.
  640. # Many Bourne shells cannot handle close brackets correctly
  641. # in scan sets, and some SunOS ksh mistreat backslash-escaping
  642. # in scan sets (worked around with variable expansion),
  643. # and furthermore cannot handle '|' '&' '(' ')' in scan sets
  644. # at all, so we specify them separately.
  645. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  646. lastarg="\"$lastarg\""
  647. ;;
  648. esac
  649. base_compile="$base_compile $lastarg"
  650. done # for arg
  651. case $arg_mode in
  652. arg)
  653. $echo "$modename: you must specify an argument for -Xcompile"
  654. exit $EXIT_FAILURE
  655. ;;
  656. target)
  657. $echo "$modename: you must specify a target with \`-o'" 1>&2
  658. exit $EXIT_FAILURE
  659. ;;
  660. *)
  661. # Get the name of the library object.
  662. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  663. ;;
  664. esac
  665. # Recognize several different file suffixes.
  666. # If the user specifies -o file.o, it is replaced with file.lo
  667. xform='[cCFSifmso]'
  668. case $libobj in
  669. *.ada) xform=ada ;;
  670. *.adb) xform=adb ;;
  671. *.ads) xform=ads ;;
  672. *.asm) xform=asm ;;
  673. *.c++) xform=c++ ;;
  674. *.cc) xform=cc ;;
  675. *.ii) xform=ii ;;
  676. *.class) xform=class ;;
  677. *.cpp) xform=cpp ;;
  678. *.cxx) xform=cxx ;;
  679. *.f90) xform=f90 ;;
  680. *.for) xform=for ;;
  681. *.java) xform=java ;;
  682. esac
  683. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  684. case $libobj in
  685. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  686. *)
  687. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  688. exit $EXIT_FAILURE
  689. ;;
  690. esac
  691. func_infer_tag $base_compile
  692. for arg in $later; do
  693. case $arg in
  694. -static)
  695. build_old_libs=yes
  696. continue
  697. ;;
  698. -prefer-pic)
  699. pic_mode=yes
  700. continue
  701. ;;
  702. -prefer-non-pic)
  703. pic_mode=no
  704. continue
  705. ;;
  706. esac
  707. done
  708. qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
  709. case $qlibobj in
  710. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  711. qlibobj="\"$qlibobj\"" ;;
  712. esac
  713. if test "X$libobj" != "X$qlibobj"; then
  714. $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
  715. exit $EXIT_FAILURE
  716. fi
  717. objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  718. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  719. if test "X$xdir" = "X$obj"; then
  720. xdir=
  721. else
  722. xdir=$xdir/
  723. fi
  724. lobj=${xdir}$objdir/$objname
  725. if test -z "$base_compile"; then
  726. $echo "$modename: you must specify a compilation command" 1>&2
  727. $echo "$help" 1>&2
  728. exit $EXIT_FAILURE
  729. fi
  730. # Delete any leftover library objects.
  731. if test "$build_old_libs" = yes; then
  732. removelist="$obj $lobj $libobj ${libobj}T"
  733. else
  734. removelist="$lobj $libobj ${libobj}T"
  735. fi
  736. $run $rm $removelist
  737. trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  738. # On Cygwin there's no "real" PIC flag so we must build both object types
  739. case $host_os in
  740. cygwin* | mingw* | pw32* | os2*)
  741. pic_mode=default
  742. ;;
  743. esac
  744. if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  745. # non-PIC code in shared libraries is not supported
  746. pic_mode=default
  747. fi
  748. # Calculate the filename of the output object if compiler does
  749. # not support -o with -c
  750. if test "$compiler_c_o" = no; then
  751. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  752. lockfile="$output_obj.lock"
  753. removelist="$removelist $output_obj $lockfile"
  754. trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  755. else
  756. output_obj=
  757. need_locks=no
  758. lockfile=
  759. fi
  760. # Lock this critical section if it is needed
  761. # We use this script file to make the link, it avoids creating a new file
  762. if test "$need_locks" = yes; then
  763. until $run ln "$progpath" "$lockfile" 2>/dev/null; do
  764. $show "Waiting for $lockfile to be removed"
  765. sleep 2
  766. done
  767. elif test "$need_locks" = warn; then
  768. if test -f "$lockfile"; then
  769. $echo "\
  770. *** ERROR, $lockfile exists and contains:
  771. `cat $lockfile 2>/dev/null`
  772. This indicates that another process is trying to use the same
  773. temporary object file, and libtool could not work around it because
  774. your compiler does not support \`-c' and \`-o' together. If you
  775. repeat this compilation, it may succeed, by chance, but you had better
  776. avoid parallel builds (make -j) in this platform, or get a better
  777. compiler."
  778. $run $rm $removelist
  779. exit $EXIT_FAILURE
  780. fi
  781. $echo "$srcfile" > "$lockfile"
  782. fi
  783. if test -n "$fix_srcfile_path"; then
  784. eval srcfile=\"$fix_srcfile_path\"
  785. fi
  786. qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
  787. case $qsrcfile in
  788. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  789. qsrcfile="\"$qsrcfile\"" ;;
  790. esac
  791. $run $rm "$libobj" "${libobj}T"
  792. # Create a libtool object file (analogous to a ".la" file),
  793. # but don't create it if we're doing a dry run.
  794. test -z "$run" && cat > ${libobj}T <<EOF
  795. # $libobj - a libtool object file
  796. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  797. #
  798. # Please DO NOT delete this file!
  799. # It is necessary for linking the library.
  800. # Name of the PIC object.
  801. EOF
  802. # Only build a PIC object if we are building libtool libraries.
  803. if test "$build_libtool_libs" = yes; then
  804. # Without this assignment, base_compile gets emptied.
  805. fbsd_hideous_sh_bug=$base_compile
  806. if test "$pic_mode" != no; then
  807. command="$base_compile $qsrcfile $pic_flag"
  808. else
  809. # Don't build PIC code
  810. command="$base_compile $qsrcfile"
  811. fi
  812. if test ! -d "${xdir}$objdir"; then
  813. $show "$mkdir ${xdir}$objdir"
  814. $run $mkdir ${xdir}$objdir
  815. status=$?
  816. if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
  817. exit $status
  818. fi
  819. fi
  820. if test -z "$output_obj"; then
  821. # Place PIC objects in $objdir
  822. command="$command -o $lobj"
  823. fi
  824. $run $rm "$lobj" "$output_obj"
  825. $show "$command"
  826. if $run eval "$command"; then :
  827. else
  828. test -n "$output_obj" && $run $rm $removelist
  829. exit $EXIT_FAILURE
  830. fi
  831. if test "$need_locks" = warn &&
  832. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  833. $echo "\
  834. *** ERROR, $lockfile contains:
  835. `cat $lockfile 2>/dev/null`
  836. but it should contain:
  837. $srcfile
  838. This indicates that another process is trying to use the same
  839. temporary object file, and libtool could not work around it because
  840. your compiler does not support \`-c' and \`-o' together. If you
  841. repeat this compilation, it may succeed, by chance, but you had better
  842. avoid parallel builds (make -j) in this platform, or get a better
  843. compiler."
  844. $run $rm $removelist
  845. exit $EXIT_FAILURE
  846. fi
  847. # Just move the object if needed, then go on to compile the next one
  848. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  849. $show "$mv $output_obj $lobj"
  850. if $run $mv $output_obj $lobj; then :
  851. else
  852. error=$?
  853. $run $rm $removelist
  854. exit $error
  855. fi
  856. fi
  857. # Append the name of the PIC object to the libtool object file.
  858. test -z "$run" && cat >> ${libobj}T <<EOF
  859. pic_object='$objdir/$objname'
  860. EOF
  861. # Allow error messages only from the first compilation.
  862. if test "$suppress_opt" = yes; then
  863. suppress_output=' >/dev/null 2>&1'
  864. fi
  865. else
  866. # No PIC object so indicate it doesn't exist in the libtool
  867. # object file.
  868. test -z "$run" && cat >> ${libobj}T <<EOF
  869. pic_object=none
  870. EOF
  871. fi
  872. # Only build a position-dependent object if we build old libraries.
  873. if test "$build_old_libs" = yes; then
  874. if test "$pic_mode" != yes; then
  875. # Don't build PIC code
  876. command="$base_compile $qsrcfile"
  877. else
  878. command="$base_compile $qsrcfile $pic_flag"
  879. fi
  880. if test "$compiler_c_o" = yes; then
  881. command="$command -o $obj"
  882. fi
  883. # Suppress compiler output if we already did a PIC compilation.
  884. command="$command$suppress_output"
  885. $run $rm "$obj" "$output_obj"
  886. $show "$command"
  887. if $run eval "$command"; then :
  888. else
  889. $run $rm $removelist
  890. exit $EXIT_FAILURE
  891. fi
  892. if test "$need_locks" = warn &&
  893. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  894. $echo "\
  895. *** ERROR, $lockfile contains:
  896. `cat $lockfile 2>/dev/null`
  897. but it should contain:
  898. $srcfile
  899. This indicates that another process is trying to use the same
  900. temporary object file, and libtool could not work around it because
  901. your compiler does not support \`-c' and \`-o' together. If you
  902. repeat this compilation, it may succeed, by chance, but you had better
  903. avoid parallel builds (make -j) in this platform, or get a better
  904. compiler."
  905. $run $rm $removelist
  906. exit $EXIT_FAILURE
  907. fi
  908. # Just move the object if needed
  909. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  910. $show "$mv $output_obj $obj"
  911. if $run $mv $output_obj $obj; then :
  912. else
  913. error=$?
  914. $run $rm $removelist
  915. exit $error
  916. fi
  917. fi
  918. # Append the name of the non-PIC object the libtool object file.
  919. # Only append if the libtool object file exists.
  920. test -z "$run" && cat >> ${libobj}T <<EOF
  921. # Name of the non-PIC object.
  922. non_pic_object='$objname'
  923. EOF
  924. else
  925. # Append the name of the non-PIC object the libtool object file.
  926. # Only append if the libtool object file exists.
  927. test -z "$run" && cat >> ${libobj}T <<EOF
  928. # Name of the non-PIC object.
  929. non_pic_object=none
  930. EOF
  931. fi
  932. $run $mv "${libobj}T" "${libobj}"
  933. # Unlock the critical section if it was locked
  934. if test "$need_locks" != no; then
  935. $run $rm "$lockfile"
  936. fi
  937. exit $EXIT_SUCCESS
  938. ;;
  939. # libtool link mode
  940. link | relink)
  941. modename="$modename: link"
  942. case $host in
  943. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  944. # It is impossible to link a dll without this setting, and
  945. # we shouldn't force the makefile maintainer to figure out
  946. # which system we are compiling for in order to pass an extra
  947. # flag for every libtool invocation.
  948. # allow_undefined=no
  949. # FIXME: Unfortunately, there are problems with the above when trying
  950. # to make a dll which has undefined symbols, in which case not
  951. # even a static library is built. For now, we need to specify
  952. # -no-undefined on the libtool link line when we can be certain
  953. # that all symbols are satisfied, otherwise we get a static library.
  954. allow_undefined=yes
  955. ;;
  956. *)
  957. allow_undefined=yes
  958. ;;
  959. esac
  960. libtool_args="$nonopt"
  961. base_compile="$nonopt $@"
  962. compile_command="$nonopt"
  963. finalize_command="$nonopt"
  964. compile_rpath=
  965. finalize_rpath=
  966. compile_shlibpath=
  967. finalize_shlibpath=
  968. convenience=
  969. old_convenience=
  970. deplibs=
  971. old_deplibs=
  972. compiler_flags=
  973. linker_flags=
  974. dllsearchpath=
  975. lib_search_path=`pwd`
  976. inst_prefix_dir=
  977. avoid_version=no
  978. dlfiles=
  979. dlprefiles=
  980. dlself=no
  981. export_dynamic=no
  982. export_symbols=
  983. export_symbols_regex=
  984. generated=
  985. libobjs=
  986. ltlibs=
  987. module=no
  988. no_install=no
  989. objs=
  990. non_pic_objects=
  991. precious_files_regex=
  992. prefer_static_libs=no
  993. preload=no
  994. prev=
  995. prevarg=
  996. release=
  997. rpath=
  998. xrpath=
  999. perm_rpath=
  1000. temp_rpath=
  1001. thread_safe=no
  1002. vinfo=
  1003. vinfo_number=no
  1004. func_infer_tag $base_compile
  1005. # We need to know -static, to get the right output filenames.
  1006. for arg
  1007. do
  1008. case $arg in
  1009. -all-static | -static)
  1010. if test "X$arg" = "X-all-static"; then
  1011. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  1012. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  1013. fi
  1014. if test -n "$link_static_flag"; then
  1015. dlopen_self=$dlopen_self_static
  1016. fi
  1017. else
  1018. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1019. dlopen_self=$dlopen_self_static
  1020. fi
  1021. fi
  1022. build_libtool_libs=no
  1023. build_old_libs=yes
  1024. prefer_static_libs=yes
  1025. break
  1026. ;;
  1027. esac
  1028. done
  1029. # See if our shared archives depend on static archives.
  1030. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1031. # Go through the arguments, transforming them on the way.
  1032. while test "$#" -gt 0; do
  1033. arg="$1"
  1034. shift
  1035. case $arg in
  1036. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1037. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  1038. ;;
  1039. *) qarg=$arg ;;
  1040. esac
  1041. libtool_args="$libtool_args $qarg"
  1042. # If the previous option needs an argument, assign it.
  1043. if test -n "$prev"; then
  1044. case $prev in
  1045. output)
  1046. compile_command="$compile_command @OUTPUT@"
  1047. finalize_command="$finalize_command @OUTPUT@"
  1048. ;;
  1049. esac
  1050. case $prev in
  1051. dlfiles|dlprefiles)
  1052. if test "$preload" = no; then
  1053. # Add the symbol object into the linking commands.
  1054. compile_command="$compile_command @SYMFILE@"
  1055. finalize_command="$finalize_command @SYMFILE@"
  1056. preload=yes
  1057. fi
  1058. case $arg in
  1059. *.la | *.lo) ;; # We handle these cases below.
  1060. force)
  1061. if test "$dlself" = no; then
  1062. dlself=needless
  1063. export_dynamic=yes
  1064. fi
  1065. prev=
  1066. continue
  1067. ;;
  1068. self)
  1069. if test "$prev" = dlprefiles; then
  1070. dlself=yes
  1071. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1072. dlself=yes
  1073. else
  1074. dlself=needless
  1075. export_dynamic=yes
  1076. fi
  1077. prev=
  1078. continue
  1079. ;;
  1080. *)
  1081. if test "$prev" = dlfiles; then
  1082. dlfiles="$dlfiles $arg"
  1083. else
  1084. dlprefiles="$dlprefiles $arg"
  1085. fi
  1086. prev=
  1087. continue
  1088. ;;
  1089. esac
  1090. ;;
  1091. expsyms)
  1092. export_symbols="$arg"
  1093. if test ! -f "$arg"; then
  1094. $echo "$modename: symbol file \`$arg' does not exist"
  1095. exit $EXIT_FAILURE
  1096. fi
  1097. prev=
  1098. continue
  1099. ;;
  1100. expsyms_regex)
  1101. export_symbols_regex="$arg"
  1102. prev=
  1103. continue
  1104. ;;
  1105. inst_prefix)
  1106. inst_prefix_dir="$arg"
  1107. prev=
  1108. continue
  1109. ;;
  1110. precious_regex)
  1111. precious_files_regex="$arg"
  1112. prev=
  1113. continue
  1114. ;;
  1115. release)
  1116. release="-$arg"
  1117. prev=
  1118. continue
  1119. ;;
  1120. objectlist)
  1121. if test -f "$arg"; then
  1122. save_arg=$arg
  1123. moreargs=
  1124. for fil in `cat $save_arg`
  1125. do
  1126. # moreargs="$moreargs $fil"
  1127. arg=$fil
  1128. # A libtool-controlled object.
  1129. # Check to see that this really is a libtool object.
  1130. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1131. pic_object=
  1132. non_pic_object=
  1133. # Read the .lo file
  1134. # If there is no directory component, then add one.
  1135. case $arg in
  1136. */* | *\\*) . $arg ;;
  1137. *) . ./$arg ;;
  1138. esac
  1139. if test -z "$pic_object" || \
  1140. test -z "$non_pic_object" ||
  1141. test "$pic_object" = none && \
  1142. test "$non_pic_object" = none; then
  1143. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1144. exit $EXIT_FAILURE
  1145. fi
  1146. # Extract subdirectory from the argument.
  1147. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1148. if test "X$xdir" = "X$arg"; then
  1149. xdir=
  1150. else
  1151. xdir="$xdir/"
  1152. fi
  1153. if test "$pic_object" != none; then
  1154. # Prepend the subdirectory the object is found in.
  1155. pic_object="$xdir$pic_object"
  1156. if test "$prev" = dlfiles; then
  1157. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1158. dlfiles="$dlfiles $pic_object"
  1159. prev=
  1160. continue
  1161. else
  1162. # If libtool objects are unsupported, then we need to preload.
  1163. prev=dlprefiles
  1164. fi
  1165. fi
  1166. # CHECK ME: I think I busted this. -Ossama
  1167. if test "$prev" = dlprefiles; then
  1168. # Preload the old-style object.
  1169. dlprefiles="$dlprefiles $pic_object"
  1170. prev=
  1171. fi
  1172. # A PIC object.
  1173. libobjs="$libobjs $pic_object"
  1174. arg="$pic_object"
  1175. fi
  1176. # Non-PIC object.
  1177. if test "$non_pic_object" != none; then
  1178. # Prepend the subdirectory the object is found in.
  1179. non_pic_object="$xdir$non_pic_object"
  1180. # A standard non-PIC object
  1181. non_pic_objects="$non_pic_objects $non_pic_object"
  1182. if test -z "$pic_object" || test "$pic_object" = none ; then
  1183. arg="$non_pic_object"
  1184. fi
  1185. fi
  1186. else
  1187. # Only an error if not doing a dry-run.
  1188. if test -z "$run"; then
  1189. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1190. exit $EXIT_FAILURE
  1191. else
  1192. # Dry-run case.
  1193. # Extract subdirectory from the argument.
  1194. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1195. if test "X$xdir" = "X$arg"; then
  1196. xdir=
  1197. else
  1198. xdir="$xdir/"
  1199. fi
  1200. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1201. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1202. libobjs="$libobjs $pic_object"
  1203. non_pic_objects="$non_pic_objects $non_pic_object"
  1204. fi
  1205. fi
  1206. done
  1207. else
  1208. $echo "$modename: link input file \`$save_arg' does not exist"
  1209. exit $EXIT_FAILURE
  1210. fi
  1211. arg=$save_arg
  1212. prev=
  1213. continue
  1214. ;;
  1215. rpath | xrpath)
  1216. # We need an absolute path.
  1217. case $arg in
  1218. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1219. *)
  1220. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1221. exit $EXIT_FAILURE
  1222. ;;
  1223. esac
  1224. # Canonicalise the pathname
  1225. tmp=""
  1226. while test "$arg" != "$tmp"
  1227. do
  1228. tmp=$arg
  1229. arg=`$echo "X$arg" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'`
  1230. done
  1231. if test "$prev" = rpath; then
  1232. case "$rpath " in
  1233. *" $arg "*) ;;
  1234. *) rpath="$rpath $arg" ;;
  1235. esac
  1236. else
  1237. case "$xrpath " in
  1238. *" $arg "*) ;;
  1239. *) xrpath="$xrpath $arg" ;;
  1240. esac
  1241. fi
  1242. prev=
  1243. continue
  1244. ;;
  1245. xcompiler)
  1246. compiler_flags="$compiler_flags $qarg"
  1247. prev=
  1248. compile_command="$compile_command $qarg"
  1249. finalize_command="$finalize_command $qarg"
  1250. continue
  1251. ;;
  1252. xlinker)
  1253. linker_flags="$linker_flags $qarg"
  1254. compiler_flags="$compiler_flags $wl$qarg"
  1255. prev=
  1256. compile_command="$compile_command $wl$qarg"
  1257. finalize_command="$finalize_command $wl$qarg"
  1258. continue
  1259. ;;
  1260. xcclinker)
  1261. linker_flags="$linker_flags $qarg"
  1262. compiler_flags="$compiler_flags $qarg"
  1263. prev=
  1264. compile_command="$compile_command $qarg"
  1265. finalize_command="$finalize_command $qarg"
  1266. continue
  1267. ;;
  1268. shrext)
  1269. shrext_cmds="$arg"
  1270. prev=
  1271. continue
  1272. ;;
  1273. darwin_framework)
  1274. compiler_flags="$compiler_flags $arg"
  1275. compile_command="$compile_command $arg"
  1276. finalize_command="$finalize_command $arg"
  1277. prev=
  1278. continue
  1279. ;;
  1280. *)
  1281. eval "$prev=\"\$arg\""
  1282. prev=
  1283. continue
  1284. ;;
  1285. esac
  1286. fi # test -n "$prev"
  1287. prevarg="$arg"
  1288. case $arg in
  1289. -all-static)
  1290. if test -n "$link_static_flag"; then
  1291. compile_command="$compile_command $link_static_flag"
  1292. finalize_command="$finalize_command $link_static_flag"
  1293. fi
  1294. continue
  1295. ;;
  1296. -allow-undefined)
  1297. # FIXME: remove this flag sometime in the future.
  1298. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1299. continue
  1300. ;;
  1301. -avoid-version)
  1302. avoid_version=yes
  1303. continue
  1304. ;;
  1305. -dlopen)
  1306. prev=dlfiles
  1307. continue
  1308. ;;
  1309. -dlpreopen)
  1310. prev=dlprefiles
  1311. continue
  1312. ;;
  1313. -export-dynamic)
  1314. export_dynamic=yes
  1315. continue
  1316. ;;
  1317. -export-symbols | -export-symbols-regex)
  1318. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1319. $echo "$modename: more than one -exported-symbols argument is not allowed"
  1320. exit $EXIT_FAILURE
  1321. fi
  1322. if test "X$arg" = "X-export-symbols"; then
  1323. prev=expsyms
  1324. else
  1325. prev=expsyms_regex
  1326. fi
  1327. continue
  1328. ;;
  1329. -framework)
  1330. prev=darwin_framework
  1331. compiler_flags="$compiler_flags $arg"
  1332. compile_command="$compile_command $arg"
  1333. finalize_command="$finalize_command $arg"
  1334. continue
  1335. ;;
  1336. -inst-prefix-dir)
  1337. prev=inst_prefix
  1338. continue
  1339. ;;
  1340. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1341. # so, if we see these flags be careful not to treat them like -L
  1342. -L[A-Z][A-Z]*:*)
  1343. case $with_gcc/$host in
  1344. no/*-*-irix* | /*-*-irix*)
  1345. compile_command="$compile_command $arg"
  1346. finalize_command="$finalize_command $arg"
  1347. ;;
  1348. esac
  1349. continue
  1350. ;;
  1351. -L*)
  1352. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1353. # We need an absolute path.
  1354. case $dir in
  1355. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1356. *)
  1357. absdir=`cd "$dir" && pwd`
  1358. if test -z "$absdir"; then
  1359. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1360. exit $EXIT_FAILURE
  1361. fi
  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. case :$dllsearchpath: in
  1375. *":$dir:"*) ;;
  1376. *) dllsearchpath="$dllsearchpath:$dir";;
  1377. esac
  1378. ;;
  1379. esac
  1380. continue
  1381. ;;
  1382. -l*)
  1383. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1384. case $host in
  1385. *-*-cygwin* | *-*-pw32* | *-*-beos*)
  1386. # These systems don't actually have a C or math library (as such)
  1387. continue
  1388. ;;
  1389. *-*-mingw* | *-*-os2*)
  1390. # These systems don't actually have a C library (as such)
  1391. test "X$arg" = "X-lc" && continue
  1392. ;;
  1393. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1394. # Do not include libc due to us having libc/libc_r.
  1395. test "X$arg" = "X-lc" && continue
  1396. ;;
  1397. *-*-rhapsody* | *-*-darwin1.[012])
  1398. # Rhapsody C and math libraries are in the System framework
  1399. deplibs="$deplibs -framework System"
  1400. continue
  1401. esac
  1402. elif test "X$arg" = "X-lc_r"; then
  1403. case $host in
  1404. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1405. # Do not include libc_r directly, use -pthread flag.
  1406. continue
  1407. ;;
  1408. esac
  1409. fi
  1410. deplibs="$deplibs $arg"
  1411. continue
  1412. ;;
  1413. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  1414. # classes, name mangling, and exception handling.
  1415. -model)
  1416. compile_command="$compile_command $arg"
  1417. compiler_flags="$compiler_flags $arg"
  1418. finalize_command="$finalize_command $arg"
  1419. prev=xcompiler
  1420. continue
  1421. ;;
  1422. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1423. compiler_flags="$compiler_flags $arg"
  1424. compile_command="$compile_command $arg"
  1425. finalize_command="$finalize_command $arg"
  1426. case $host:$arg in
  1427. *-*-dragonfly*:-pthread)
  1428. # pkgsrc hack to use -pthread in .la file for final linking
  1429. deplibs="$deplibs $arg"
  1430. ;;
  1431. esac
  1432. continue
  1433. ;;
  1434. -module)
  1435. module=yes
  1436. continue
  1437. ;;
  1438. # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  1439. # -r[0-9][0-9]* specifies the processor on the SGI compiler
  1440. # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  1441. # +DA*, +DD* enable 64-bit mode on the HP compiler
  1442. # -q* pass through compiler args for the IBM compiler
  1443. # -m* pass through architecture-specific compiler args for GCC
  1444. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
  1445. # Unknown arguments in both finalize_command and compile_command need
  1446. # to be aesthetically quoted because they are evaled later.
  1447. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1448. case $arg in
  1449. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1450. arg="\"$arg\""
  1451. ;;
  1452. esac
  1453. compile_command="$compile_command $arg"
  1454. finalize_command="$finalize_command $arg"
  1455. if test "$with_gcc" = "yes" ; then
  1456. compiler_flags="$compiler_flags $arg"
  1457. fi
  1458. continue
  1459. ;;
  1460. -shrext)
  1461. prev=shrext
  1462. continue
  1463. ;;
  1464. -no-fast-install)
  1465. fast_install=no
  1466. continue
  1467. ;;
  1468. -no-install)
  1469. case $host in
  1470. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1471. # The PATH hackery in wrapper scripts is required on Windows
  1472. # in order for the loader to find any dlls it needs.
  1473. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1474. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1475. fast_install=no
  1476. ;;
  1477. *) no_install=yes ;;
  1478. esac
  1479. continue
  1480. ;;
  1481. -no-undefined)
  1482. allow_undefined=no
  1483. continue
  1484. ;;
  1485. -objectlist)
  1486. prev=objectlist
  1487. continue
  1488. ;;
  1489. -o) prev=output ;;
  1490. -precious-files-regex)
  1491. prev=precious_regex
  1492. continue
  1493. ;;
  1494. -release)
  1495. prev=release
  1496. continue
  1497. ;;
  1498. -rpath)
  1499. prev=rpath
  1500. continue
  1501. ;;
  1502. -R)
  1503. prev=xrpath
  1504. continue
  1505. ;;
  1506. -R*)
  1507. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1508. # We need an absolute path.
  1509. case $dir in
  1510. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1511. *)
  1512. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1513. exit $EXIT_FAILURE
  1514. ;;
  1515. esac
  1516. case "$xrpath " in
  1517. *" $dir "*) ;;
  1518. *) xrpath="$xrpath $dir" ;;
  1519. esac
  1520. continue
  1521. ;;
  1522. -static)
  1523. # The effects of -static are defined in a previous loop.
  1524. # We used to do the same as -all-static on platforms that
  1525. # didn't have a PIC flag, but the assumption that the effects
  1526. # would be equivalent was wrong. It would break on at least
  1527. # Digital Unix and AIX.
  1528. continue
  1529. ;;
  1530. -thread-safe)
  1531. thread_safe=yes
  1532. continue
  1533. ;;
  1534. -version-info)
  1535. prev=vinfo
  1536. continue
  1537. ;;
  1538. -version-number)
  1539. prev=vinfo
  1540. vinfo_number=yes
  1541. continue
  1542. ;;
  1543. -Wc,*)
  1544. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1545. arg=
  1546. save_ifs="$IFS"; IFS=','
  1547. for flag in $args; do
  1548. IFS="$save_ifs"
  1549. case $flag in
  1550. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1551. flag="\"$flag\""
  1552. ;;
  1553. esac
  1554. arg="$arg $wl$flag"
  1555. compiler_flags="$compiler_flags $flag"
  1556. done
  1557. IFS="$save_ifs"
  1558. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1559. ;;
  1560. -Wl,*)
  1561. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1562. arg=
  1563. save_ifs="$IFS"; IFS=','
  1564. for flag in $args; do
  1565. IFS="$save_ifs"
  1566. case $flag in
  1567. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1568. flag="\"$flag\""
  1569. ;;
  1570. esac
  1571. arg="$arg $wl$flag"
  1572. compiler_flags="$compiler_flags $wl$flag"
  1573. linker_flags="$linker_flags $flag"
  1574. done
  1575. IFS="$save_ifs"
  1576. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1577. ;;
  1578. -Xcompiler)
  1579. prev=xcompiler
  1580. continue
  1581. ;;
  1582. -Xlinker)
  1583. prev=xlinker
  1584. continue
  1585. ;;
  1586. -XCClinker)
  1587. prev=xcclinker
  1588. continue
  1589. ;;
  1590. # Some other compiler flag.
  1591. -* | +*)
  1592. # Unknown arguments in both finalize_command and compile_command need
  1593. # to be aesthetically quoted because they are evaled later.
  1594. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1595. case $arg in
  1596. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1597. arg="\"$arg\""
  1598. ;;
  1599. esac
  1600. ;;
  1601. *.$objext)
  1602. # A standard object.
  1603. objs="$objs $arg"
  1604. ;;
  1605. *.lo)
  1606. # A libtool-controlled object.
  1607. # Check to see that this really is a libtool object.
  1608. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1609. pic_object=
  1610. non_pic_object=
  1611. # Read the .lo file
  1612. # If there is no directory component, then add one.
  1613. case $arg in
  1614. */* | *\\*) . $arg ;;
  1615. *) . ./$arg ;;
  1616. esac
  1617. if test -z "$pic_object" || \
  1618. test -z "$non_pic_object" ||
  1619. test "$pic_object" = none && \
  1620. test "$non_pic_object" = none; then
  1621. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1622. exit $EXIT_FAILURE
  1623. fi
  1624. # Extract subdirectory from the argument.
  1625. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1626. if test "X$xdir" = "X$arg"; then
  1627. xdir=
  1628. else
  1629. xdir="$xdir/"
  1630. fi
  1631. if test "$pic_object" != none; then
  1632. # Prepend the subdirectory the object is found in.
  1633. pic_object="$xdir$pic_object"
  1634. if test "$prev" = dlfiles; then
  1635. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1636. dlfiles="$dlfiles $pic_object"
  1637. prev=
  1638. continue
  1639. else
  1640. # If libtool objects are unsupported, then we need to preload.
  1641. prev=dlprefiles
  1642. fi
  1643. fi
  1644. # CHECK ME: I think I busted this. -Ossama
  1645. if test "$prev" = dlprefiles; then
  1646. # Preload the old-style object.
  1647. dlprefiles="$dlprefiles $pic_object"
  1648. prev=
  1649. fi
  1650. # A PIC object.
  1651. libobjs="$libobjs $pic_object"
  1652. arg="$pic_object"
  1653. fi
  1654. # Non-PIC object.
  1655. if test "$non_pic_object" != none; then
  1656. # Prepend the subdirectory the object is found in.
  1657. non_pic_object="$xdir$non_pic_object"
  1658. # A standard non-PIC object
  1659. non_pic_objects="$non_pic_objects $non_pic_object"
  1660. if test -z "$pic_object" || test "$pic_object" = none ; then
  1661. arg="$non_pic_object"
  1662. fi
  1663. fi
  1664. else
  1665. # Only an error if not doing a dry-run.
  1666. if test -z "$run"; then
  1667. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1668. exit $EXIT_FAILURE
  1669. else
  1670. # Dry-run case.
  1671. # Extract subdirectory from the argument.
  1672. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1673. if test "X$xdir" = "X$arg"; then
  1674. xdir=
  1675. else
  1676. xdir="$xdir/"
  1677. fi
  1678. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1679. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1680. libobjs="$libobjs $pic_object"
  1681. non_pic_objects="$non_pic_objects $non_pic_object"
  1682. fi
  1683. fi
  1684. ;;
  1685. *.$libext)
  1686. # An archive.
  1687. deplibs="$deplibs $arg"
  1688. old_deplibs="$old_deplibs $arg"
  1689. continue
  1690. ;;
  1691. *.la)
  1692. # A libtool-controlled library.
  1693. if test "$prev" = dlfiles; then
  1694. # This library was specified with -dlopen.
  1695. dlfiles="$dlfiles $arg"
  1696. prev=
  1697. elif test "$prev" = dlprefiles; then
  1698. # The library was specified with -dlpreopen.
  1699. dlprefiles="$dlprefiles $arg"
  1700. prev=
  1701. else
  1702. deplibs="$deplibs $arg"
  1703. fi
  1704. continue
  1705. ;;
  1706. # Some other compiler argument.
  1707. *)
  1708. # Unknown arguments in both finalize_command and compile_command need
  1709. # to be aesthetically quoted because they are evaled later.
  1710. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1711. case $arg in
  1712. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  1713. arg="\"$arg\""
  1714. ;;
  1715. esac
  1716. ;;
  1717. esac # arg
  1718. # Now actually substitute the argument into the commands.
  1719. if test -n "$arg"; then
  1720. compile_command="$compile_command $arg"
  1721. finalize_command="$finalize_command $arg"
  1722. fi
  1723. done # argument parsing loop
  1724. if test -n "$prev"; then
  1725. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1726. $echo "$help" 1>&2
  1727. exit $EXIT_FAILURE
  1728. fi
  1729. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  1730. eval arg=\"$export_dynamic_flag_spec\"
  1731. compile_command="$compile_command $arg"
  1732. finalize_command="$finalize_command $arg"
  1733. fi
  1734. oldlibs=
  1735. # calculate the name of the file, without its directory
  1736. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1737. libobjs_save="$libobjs"
  1738. if test -n "$shlibpath_var"; then
  1739. # get the directories listed in $shlibpath_var
  1740. eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  1741. else
  1742. shlib_search_path=
  1743. fi
  1744. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  1745. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  1746. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1747. if test "X$output_objdir" = "X$output"; then
  1748. output_objdir="$objdir"
  1749. else
  1750. output_objdir="$output_objdir/$objdir"
  1751. fi
  1752. # Create the object directory.
  1753. if test ! -d "$output_objdir"; then
  1754. $show "$mkdir $output_objdir"
  1755. $run $mkdir $output_objdir
  1756. status=$?
  1757. if test "$status" -ne 0 && test ! -d "$output_objdir"; then
  1758. exit $status
  1759. fi
  1760. fi
  1761. # Determine the type of output
  1762. case $output in
  1763. "")
  1764. $echo "$modename: you must specify an output file" 1>&2
  1765. $echo "$help" 1>&2
  1766. exit $EXIT_FAILURE
  1767. ;;
  1768. *.$libext) linkmode=oldlib ;;
  1769. *.lo | *.$objext) linkmode=obj ;;
  1770. *.la) linkmode=lib ;;
  1771. *) linkmode=prog ;; # Anything else should be a program.
  1772. esac
  1773. case $host in
  1774. *cygwin* | *mingw* | *pw32*)
  1775. # don't eliminate duplications in $postdeps and $predeps
  1776. duplicate_compiler_generated_deps=yes
  1777. ;;
  1778. *)
  1779. duplicate_compiler_generated_deps=$duplicate_deps
  1780. ;;
  1781. esac
  1782. specialdeplibs=
  1783. libs=
  1784. # Find all interdependent deplibs by searching for libraries
  1785. # that are linked more than once (e.g. -la -lb -la)
  1786. for deplib in $deplibs; do
  1787. if test "X$duplicate_deps" = "Xyes" ; then
  1788. case "$libs " in
  1789. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  1790. esac
  1791. fi
  1792. libs="$libs $deplib"
  1793. done
  1794. if test "$linkmode" = lib; then
  1795. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  1796. # Compute libraries that are listed more than once in $predeps
  1797. # $postdeps and mark them as special (i.e., whose duplicates are
  1798. # not to be eliminated).
  1799. pre_post_deps=
  1800. if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
  1801. for pre_post_dep in $predeps $postdeps; do
  1802. case "$pre_post_deps " in
  1803. *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  1804. esac
  1805. pre_post_deps="$pre_post_deps $pre_post_dep"
  1806. done
  1807. fi
  1808. pre_post_deps=
  1809. fi
  1810. deplibs=
  1811. newdependency_libs=
  1812. newlib_search_path=
  1813. need_relink=no # whether we're linking any uninstalled libtool libraries
  1814. notinst_deplibs= # not-installed libtool libraries
  1815. notinst_path= # paths that contain not-installed libtool libraries
  1816. case $linkmode in
  1817. lib)
  1818. passes="conv link"
  1819. for file in $dlfiles $dlprefiles; do
  1820. case $file in
  1821. *.la) ;;
  1822. *)
  1823. $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  1824. exit $EXIT_FAILURE
  1825. ;;
  1826. esac
  1827. done
  1828. ;;
  1829. prog)
  1830. compile_deplibs=
  1831. finalize_deplibs=
  1832. alldeplibs=no
  1833. newdlfiles=
  1834. newdlprefiles=
  1835. passes="conv scan dlopen dlpreopen link"
  1836. ;;
  1837. *) passes="conv"
  1838. ;;
  1839. esac
  1840. for pass in $passes; do
  1841. if test "$linkmode,$pass" = "lib,link" ||
  1842. test "$linkmode,$pass" = "prog,scan"; then
  1843. libs="$deplibs"
  1844. deplibs=
  1845. fi
  1846. if test "$linkmode" = prog; then
  1847. case $pass in
  1848. dlopen) libs="$dlfiles" ;;
  1849. dlpreopen) libs="$dlprefiles" ;;
  1850. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  1851. esac
  1852. fi
  1853. if test "$pass" = dlopen; then
  1854. # Collect dlpreopened libraries
  1855. save_deplibs="$deplibs"
  1856. deplibs=
  1857. fi
  1858. for deplib in $libs; do
  1859. lib=
  1860. found=no
  1861. case $deplib in
  1862. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1863. if test "$linkmode,$pass" = "prog,link"; then
  1864. compile_deplibs="$deplib $compile_deplibs"
  1865. finalize_deplibs="$deplib $finalize_deplibs"
  1866. else
  1867. compiler_flags="$compiler_flags $deplib"
  1868. fi
  1869. case $host:$deplib in
  1870. *-*-dragonfly*:-pthread)
  1871. # pkgsrc hack to use -pthread in .la file for final linking
  1872. case $linkmode in
  1873. lib)
  1874. deplibs="$deplib $deplibs"
  1875. test "$pass" = conv && continue
  1876. newdependency_libs="$deplib $newdependency_libs"
  1877. ;;
  1878. prog)
  1879. if test "$pass" = conv; then
  1880. deplibs="$deplib $deplibs"
  1881. continue
  1882. fi
  1883. if test "$pass" = scan; then
  1884. deplibs="$deplib $deplibs"
  1885. else
  1886. compile_deplibs="$deplib $compile_deplibs"
  1887. finalize_deplibs="$deplib $finalize_deplibs"
  1888. fi
  1889. ;;
  1890. esac
  1891. ;;
  1892. esac
  1893. continue
  1894. ;;
  1895. -l*)
  1896. if test "$linkmode" != lib && test "$linkmode" != prog; then
  1897. $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  1898. continue
  1899. fi
  1900. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  1901. for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  1902. for search_ext in .la $std_shrext .so .a; do
  1903. # Search the libtool library
  1904. lib="$searchdir/lib${name}${search_ext}"
  1905. if test -f "$lib"; then
  1906. if test "$search_ext" = ".la"; then
  1907. found=yes
  1908. else
  1909. found=no
  1910. fi
  1911. break 2
  1912. fi
  1913. done
  1914. done
  1915. if test "$found" != yes; then
  1916. # deplib doesn't seem to be a libtool library
  1917. if test "$linkmode,$pass" = "prog,link"; then
  1918. compile_deplibs="$deplib $compile_deplibs"
  1919. finalize_deplibs="$deplib $finalize_deplibs"
  1920. else
  1921. deplibs="$deplib $deplibs"
  1922. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1923. fi
  1924. continue
  1925. else # deplib is a libtool library
  1926. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  1927. # We need to do some special things here, and not later.
  1928. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  1929. case " $predeps $postdeps " in
  1930. *" $deplib "*)
  1931. if (${SED} -e '2q' $lib |
  1932. grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1933. library_names=
  1934. old_library=
  1935. case $lib in
  1936. */* | *\\*) . $lib ;;
  1937. *) . ./$lib ;;
  1938. esac
  1939. for l in $old_library $library_names; do
  1940. ll="$l"
  1941. done
  1942. if test "X$ll" = "X$old_library" ; then # only static version available
  1943. found=no
  1944. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  1945. test "X$ladir" = "X$lib" && ladir="."
  1946. lib=$ladir/$old_library
  1947. if test "$linkmode,$pass" = "prog,link"; then
  1948. compile_deplibs="$deplib $compile_deplibs"
  1949. finalize_deplibs="$deplib $finalize_deplibs"
  1950. else
  1951. deplibs="$deplib $deplibs"
  1952. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  1953. fi
  1954. continue
  1955. fi
  1956. fi
  1957. ;;
  1958. *) ;;
  1959. esac
  1960. fi
  1961. fi
  1962. ;; # -l
  1963. -L*)
  1964. case $linkmode in
  1965. lib)
  1966. deplibs="$deplib $deplibs"
  1967. test "$pass" = conv && continue
  1968. newdependency_libs="$deplib $newdependency_libs"
  1969. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1970. ;;
  1971. prog)
  1972. if test "$pass" = conv; then
  1973. deplibs="$deplib $deplibs"
  1974. continue
  1975. fi
  1976. if test "$pass" = scan; then
  1977. deplibs="$deplib $deplibs"
  1978. else
  1979. compile_deplibs="$deplib $compile_deplibs"
  1980. finalize_deplibs="$deplib $finalize_deplibs"
  1981. fi
  1982. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  1983. ;;
  1984. *)
  1985. $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  1986. ;;
  1987. esac # linkmode
  1988. continue
  1989. ;; # -L
  1990. -R*)
  1991. if test "$pass" = link; then
  1992. dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1993. # Make sure the xrpath contains only unique directories.
  1994. case "$xrpath " in
  1995. *" $dir "*) ;;
  1996. *) xrpath="$xrpath $dir" ;;
  1997. esac
  1998. fi
  1999. deplibs="$deplib $deplibs"
  2000. continue
  2001. ;;
  2002. *.la) lib="$deplib" ;;
  2003. *.$libext)
  2004. if test "$pass" = conv; then
  2005. deplibs="$deplib $deplibs"
  2006. continue
  2007. fi
  2008. case $linkmode in
  2009. lib)
  2010. valid_a_lib=no
  2011. case $deplibs_check_method in
  2012. match_pattern*)
  2013. set dummy $deplibs_check_method
  2014. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  2015. if eval $echo \"$deplib\" 2>/dev/null \
  2016. | $SED 10q \
  2017. | $EGREP "$match_pattern_regex" > /dev/null; then
  2018. valid_a_lib=yes
  2019. fi
  2020. ;;
  2021. pass_all)
  2022. valid_a_lib=yes
  2023. ;;
  2024. esac
  2025. if test "$valid_a_lib" != yes; then
  2026. $echo
  2027. $echo "*** Warning: Trying to link with static lib archive $deplib."
  2028. $echo "*** I have the capability to make that library automatically link in when"
  2029. $echo "*** you link to this library. But I can only do this if you have a"
  2030. $echo "*** shared version of the library, which you do not appear to have"
  2031. $echo "*** because the file extensions .$libext of this argument makes me believe"
  2032. $echo "*** that it is just a static archive that I should not used here."
  2033. else
  2034. $echo
  2035. $echo "*** Warning: Linking the shared library $output against the"
  2036. $echo "*** static library $deplib is not portable!"
  2037. deplibs="$deplib $deplibs"
  2038. fi
  2039. continue
  2040. ;;
  2041. prog)
  2042. if test "$pass" != link; then
  2043. deplibs="$deplib $deplibs"
  2044. else
  2045. compile_deplibs="$deplib $compile_deplibs"
  2046. finalize_deplibs="$deplib $finalize_deplibs"
  2047. fi
  2048. continue
  2049. ;;
  2050. esac # linkmode
  2051. ;; # *.$libext
  2052. *.lo | *.$objext)
  2053. if test "$pass" = conv; then
  2054. deplibs="$deplib $deplibs"
  2055. elif test "$linkmode" = prog; then
  2056. if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  2057. # If there is no dlopen support or we're linking statically,
  2058. # we need to preload.
  2059. newdlprefiles="$newdlprefiles $deplib"
  2060. compile_deplibs="$deplib $compile_deplibs"
  2061. finalize_deplibs="$deplib $finalize_deplibs"
  2062. else
  2063. newdlfiles="$newdlfiles $deplib"
  2064. fi
  2065. fi
  2066. continue
  2067. ;;
  2068. %DEPLIBS%)
  2069. alldeplibs=yes
  2070. continue
  2071. ;;
  2072. esac # case $deplib
  2073. if test "$found" = yes || test -f "$lib"; then :
  2074. else
  2075. $echo "$modename: cannot find the library \`$lib'" 1>&2
  2076. exit $EXIT_FAILURE
  2077. fi
  2078. # Check to see that this really is a libtool archive.
  2079. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2080. else
  2081. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2082. exit $EXIT_FAILURE
  2083. fi
  2084. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2085. test "X$ladir" = "X$lib" && ladir="."
  2086. dlname=
  2087. dlopen=
  2088. dlpreopen=
  2089. libdir=
  2090. library_names=
  2091. old_library=
  2092. # If the library was installed with an old release of libtool,
  2093. # it will not redefine variables installed, or shouldnotlink
  2094. installed=yes
  2095. shouldnotlink=no
  2096. avoidtemprpath=
  2097. # Read the .la file
  2098. case $lib in
  2099. */* | *\\*) . $lib ;;
  2100. *) . ./$lib ;;
  2101. esac
  2102. if test "$linkmode,$pass" = "lib,link" ||
  2103. test "$linkmode,$pass" = "prog,scan" ||
  2104. { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  2105. test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  2106. test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  2107. fi
  2108. if test "$pass" = conv; then
  2109. # Only check for convenience libraries
  2110. deplibs="$lib $deplibs"
  2111. if test -z "$libdir"; then
  2112. if test -z "$old_library"; then
  2113. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2114. exit $EXIT_FAILURE
  2115. fi
  2116. # It is a libtool convenience library, so add in its objects.
  2117. convenience="$convenience $ladir/$objdir/$old_library"
  2118. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  2119. tmp_libs=
  2120. for deplib in $dependency_libs; do
  2121. deplibs="$deplib $deplibs"
  2122. if test "X$duplicate_deps" = "Xyes" ; then
  2123. case "$tmp_libs " in
  2124. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2125. esac
  2126. fi
  2127. tmp_libs="$tmp_libs $deplib"
  2128. done
  2129. elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2130. $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2131. exit $EXIT_FAILURE
  2132. fi
  2133. continue
  2134. fi # $pass = conv
  2135. # Get the name of the library we link against.
  2136. linklib=
  2137. for l in $old_library $library_names; do
  2138. linklib="$l"
  2139. done
  2140. if test -z "$linklib"; then
  2141. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2142. exit $EXIT_FAILURE
  2143. fi
  2144. # This library was specified with -dlopen.
  2145. if test "$pass" = dlopen; then
  2146. if test -z "$libdir"; then
  2147. $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2148. exit $EXIT_FAILURE
  2149. fi
  2150. if test -z "$dlname" ||
  2151. test "$dlopen_support" != yes ||
  2152. test "$build_libtool_libs" = no; then
  2153. # If there is no dlname, no dlopen support or we're linking
  2154. # statically, we need to preload. We also need to preload any
  2155. # dependent libraries so libltdl's deplib preloader doesn't
  2156. # bomb out in the load deplibs phase.
  2157. dlprefiles="$dlprefiles $lib $dependency_libs"
  2158. else
  2159. newdlfiles="$newdlfiles $lib"
  2160. fi
  2161. continue
  2162. fi # $pass = dlopen
  2163. # We need an absolute path.
  2164. case $ladir in
  2165. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  2166. *)
  2167. abs_ladir=`cd "$ladir" && pwd`
  2168. if test -z "$abs_ladir"; then
  2169. $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  2170. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  2171. abs_ladir="$ladir"
  2172. fi
  2173. ;;
  2174. esac
  2175. laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  2176. # Find the relevant object directory and library name.
  2177. if test "X$installed" = Xyes; then
  2178. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2179. $echo "$modename: warning: library \`$lib' was moved." 1>&2
  2180. dir="$ladir"
  2181. absdir="$abs_ladir"
  2182. libdir="$abs_ladir"
  2183. else
  2184. dir="$libdir"
  2185. absdir="$libdir"
  2186. fi
  2187. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  2188. else
  2189. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2190. dir="$ladir"
  2191. absdir="$abs_ladir"
  2192. # Remove this search path later
  2193. notinst_path="$notinst_path $abs_ladir"
  2194. else
  2195. dir="$ladir/$objdir"
  2196. absdir="$abs_ladir/$objdir"
  2197. # Remove this search path later
  2198. notinst_path="$notinst_path $abs_ladir"
  2199. fi
  2200. fi # $installed = yes
  2201. name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2202. # This library was specified with -dlpreopen.
  2203. if test "$pass" = dlpreopen; then
  2204. if test -z "$libdir"; then
  2205. $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2206. exit $EXIT_FAILURE
  2207. fi
  2208. # Prefer using a static library (so that no silly _DYNAMIC symbols
  2209. # are required to link).
  2210. if test -n "$old_library"; then
  2211. newdlprefiles="$newdlprefiles $dir/$old_library"
  2212. # Otherwise, use the dlname, so that lt_dlopen finds it.
  2213. elif test -n "$dlname"; then
  2214. newdlprefiles="$newdlprefiles $dir/$dlname"
  2215. else
  2216. newdlprefiles="$newdlprefiles $dir/$linklib"
  2217. fi
  2218. fi # $pass = dlpreopen
  2219. if test -z "$libdir"; then
  2220. # Link the convenience library
  2221. if test "$linkmode" = lib; then
  2222. deplibs="$dir/$old_library $deplibs"
  2223. elif test "$linkmode,$pass" = "prog,link"; then
  2224. compile_deplibs="$dir/$old_library $compile_deplibs"
  2225. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  2226. else
  2227. deplibs="$lib $deplibs" # used for prog,scan pass
  2228. fi
  2229. continue
  2230. fi
  2231. if test "$linkmode" = prog && test "$pass" != link; then
  2232. newlib_search_path="$newlib_search_path $ladir"
  2233. deplibs="$lib $deplibs"
  2234. linkalldeplibs=no
  2235. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  2236. test "$build_libtool_libs" = no; then
  2237. linkalldeplibs=yes
  2238. fi
  2239. tmp_libs=
  2240. for deplib in $dependency_libs; do
  2241. case $deplib in
  2242. -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  2243. esac
  2244. # Need to link against all dependency_libs?
  2245. if test "$linkalldeplibs" = yes; then
  2246. deplibs="$deplib $deplibs"
  2247. else
  2248. # Need to hardcode shared library paths
  2249. # or/and link against static libraries
  2250. newdependency_libs="$deplib $newdependency_libs"
  2251. fi
  2252. if test "X$duplicate_deps" = "Xyes" ; then
  2253. case "$tmp_libs " in
  2254. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2255. esac
  2256. fi
  2257. tmp_libs="$tmp_libs $deplib"
  2258. done # for deplib
  2259. continue
  2260. fi # $linkmode = prog...
  2261. if test "$linkmode,$pass" = "prog,link"; then
  2262. if test -n "$library_names" &&
  2263. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2264. # We need to hardcode the library path
  2265. if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  2266. # Make sure the rpath contains only unique directories.
  2267. case "$temp_rpath " in
  2268. *" $dir "*) ;;
  2269. *" $absdir "*) ;;
  2270. *) temp_rpath="$temp_rpath $dir" ;;
  2271. esac
  2272. fi
  2273. # Hardcode the library path.
  2274. # Skip directories that are in the system default run-time
  2275. # search path.
  2276. case " $sys_lib_dlsearch_path " in
  2277. *" $absdir "*) ;;
  2278. *)
  2279. case "$compile_rpath " in
  2280. *" $absdir "*) ;;
  2281. *) compile_rpath="$compile_rpath $absdir"
  2282. esac
  2283. ;;
  2284. esac
  2285. case " $sys_lib_dlsearch_path " in
  2286. *" $libdir "*) ;;
  2287. *)
  2288. case "$finalize_rpath " in
  2289. *" $libdir "*) ;;
  2290. *) finalize_rpath="$finalize_rpath $libdir"
  2291. esac
  2292. ;;
  2293. esac
  2294. fi # $linkmode,$pass = prog,link...
  2295. if test "$alldeplibs" = yes &&
  2296. { test "$deplibs_check_method" = pass_all ||
  2297. { test "$build_libtool_libs" = yes &&
  2298. test -n "$library_names"; }; }; then
  2299. # We only need to search for static libraries
  2300. continue
  2301. fi
  2302. fi
  2303. link_static=no # Whether the deplib will be linked statically
  2304. if test -n "$library_names" &&
  2305. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2306. if test "$installed" = no; then
  2307. notinst_deplibs="$notinst_deplibs $lib"
  2308. need_relink=yes
  2309. fi
  2310. # This is a shared library
  2311. # Warn about portability, can't link against -module's on
  2312. # some systems (darwin)
  2313. if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2314. $echo
  2315. if test "$linkmode" = prog; then
  2316. $echo "*** Warning: Linking the executable $output against the loadable module"
  2317. else
  2318. $echo "*** Warning: Linking the shared library $output against the loadable module"
  2319. fi
  2320. $echo "*** $linklib is not portable!"
  2321. fi
  2322. if test "$linkmode" = lib &&
  2323. test "$hardcode_into_libs" = yes; then
  2324. # Hardcode the library path.
  2325. # Skip directories that are in the system default run-time
  2326. # search path.
  2327. case " $sys_lib_dlsearch_path " in
  2328. *" $absdir "*) ;;
  2329. *)
  2330. case "$compile_rpath " in
  2331. *" $absdir "*) ;;
  2332. *) compile_rpath="$compile_rpath $absdir"
  2333. esac
  2334. ;;
  2335. esac
  2336. case " $sys_lib_dlsearch_path " in
  2337. *" $libdir "*) ;;
  2338. *)
  2339. case "$finalize_rpath " in
  2340. *" $libdir "*) ;;
  2341. *) finalize_rpath="$finalize_rpath $libdir"
  2342. esac
  2343. ;;
  2344. esac
  2345. fi
  2346. if test -n "$old_archive_from_expsyms_cmds"; then
  2347. # figure out the soname
  2348. set dummy $library_names
  2349. realname="$2"
  2350. shift; shift
  2351. libname=`eval \\$echo \"$libname_spec\"`
  2352. # use dlname if we got it. it's perfectly good, no?
  2353. if test -n "$dlname"; then
  2354. soname="$dlname"
  2355. elif test -n "$soname_spec"; then
  2356. # bleh windows
  2357. case $host in
  2358. *cygwin* | mingw*)
  2359. major=`expr $current - $age`
  2360. versuffix="-$major"
  2361. ;;
  2362. esac
  2363. eval soname=\"$soname_spec\"
  2364. else
  2365. soname="$realname"
  2366. fi
  2367. # Make a new name for the extract_expsyms_cmds to use
  2368. soroot="$soname"
  2369. soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
  2370. newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  2371. # If the library has no export list, then create one now
  2372. if test -f "$output_objdir/$soname-def"; then :
  2373. else
  2374. $show "extracting exported symbol list from \`$soname'"
  2375. save_ifs="$IFS"; IFS='~'
  2376. cmds=$extract_expsyms_cmds
  2377. for cmd in $cmds; do
  2378. IFS="$save_ifs"
  2379. eval cmd=\"$cmd\"
  2380. $show "$cmd"
  2381. $run eval "$cmd" || exit $?
  2382. done
  2383. IFS="$save_ifs"
  2384. fi
  2385. # Create $newlib
  2386. if test -f "$output_objdir/$newlib"; then :; else
  2387. $show "generating import library for \`$soname'"
  2388. save_ifs="$IFS"; IFS='~'
  2389. cmds=$old_archive_from_expsyms_cmds
  2390. for cmd in $cmds; do
  2391. IFS="$save_ifs"
  2392. eval cmd=\"$cmd\"
  2393. $show "$cmd"
  2394. $run eval "$cmd" || exit $?
  2395. done
  2396. IFS="$save_ifs"
  2397. fi
  2398. # make sure the library variables are pointing to the new library
  2399. dir=$output_objdir
  2400. linklib=$newlib
  2401. fi # test -n "$old_archive_from_expsyms_cmds"
  2402. if test "$linkmode" = prog || test "$mode" != relink; then
  2403. add_shlibpath=
  2404. add_dir=
  2405. add=
  2406. lib_linked=yes
  2407. case $hardcode_action in
  2408. immediate | unsupported)
  2409. if test "$hardcode_direct" = no; then
  2410. add="$dir/$linklib"
  2411. case $host in
  2412. *-*-sco3.2v5* ) add_dir="-L$dir" ;;
  2413. *-*-darwin* )
  2414. # if the lib is a module then we can not link against
  2415. # it, someone is ignoring the new warnings I added
  2416. if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
  2417. $echo "** Warning, lib $linklib is a module, not a shared library"
  2418. if test -z "$old_library" ; then
  2419. $echo
  2420. $echo "** And there doesn't seem to be a static archive available"
  2421. $echo "** The link will probably fail, sorry"
  2422. else
  2423. add="$dir/$old_library"
  2424. fi
  2425. fi
  2426. esac
  2427. elif test "$hardcode_minus_L" = no; then
  2428. case $host in
  2429. *-*-sunos*) add_shlibpath="$dir" ;;
  2430. esac
  2431. add_dir="-L$dir"
  2432. add="-l$name"
  2433. elif test "$hardcode_shlibpath_var" = no; then
  2434. add_shlibpath="$dir"
  2435. add="-l$name"
  2436. else
  2437. lib_linked=no
  2438. fi
  2439. ;;
  2440. relink)
  2441. if test "$hardcode_direct" = yes; then
  2442. add="$dir/$linklib"
  2443. elif test "$hardcode_minus_L" = yes; then
  2444. add_dir="-L$dir"
  2445. # Try looking first in the location we're being installed to.
  2446. if test -n "$inst_prefix_dir"; then
  2447. case "$libdir" in
  2448. [\\/]*)
  2449. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2450. ;;
  2451. esac
  2452. fi
  2453. add="-l$name"
  2454. elif test "$hardcode_shlibpath_var" = yes; then
  2455. add_shlibpath="$dir"
  2456. add="-l$name"
  2457. else
  2458. lib_linked=no
  2459. fi
  2460. ;;
  2461. *) lib_linked=no ;;
  2462. esac
  2463. if test "$lib_linked" != yes; then
  2464. $echo "$modename: configuration error: unsupported hardcode properties"
  2465. exit $EXIT_FAILURE
  2466. fi
  2467. if test -n "$add_shlibpath"; then
  2468. case :$compile_shlibpath: in
  2469. *":$add_shlibpath:"*) ;;
  2470. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  2471. esac
  2472. fi
  2473. if test "$linkmode" = prog; then
  2474. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  2475. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  2476. else
  2477. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2478. test -n "$add" && deplibs="$add $deplibs"
  2479. if test "$hardcode_direct" != yes && \
  2480. test "$hardcode_minus_L" != yes && \
  2481. test "$hardcode_shlibpath_var" = yes; then
  2482. case :$finalize_shlibpath: in
  2483. *":$libdir:"*) ;;
  2484. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2485. esac
  2486. fi
  2487. fi
  2488. fi
  2489. if test "$linkmode" = prog || test "$mode" = relink; then
  2490. add_shlibpath=
  2491. add_dir=
  2492. add=
  2493. # Finalize command for both is simple: just hardcode it.
  2494. if test "$hardcode_direct" = yes; then
  2495. add="$libdir/$linklib"
  2496. elif test "$hardcode_minus_L" = yes; then
  2497. add_dir="-L$libdir"
  2498. add="-l$name"
  2499. elif test "$hardcode_shlibpath_var" = yes; then
  2500. case :$finalize_shlibpath: in
  2501. *":$libdir:"*) ;;
  2502. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2503. esac
  2504. add="-l$name"
  2505. elif test "$hardcode_automatic" = yes; then
  2506. if test -n "$inst_prefix_dir" &&
  2507. test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2508. add="$inst_prefix_dir$libdir/$linklib"
  2509. else
  2510. add="$libdir/$linklib"
  2511. fi
  2512. else
  2513. # We cannot seem to hardcode it, guess we'll fake it.
  2514. add_dir="-L$libdir"
  2515. # Try looking first in the location we're being installed to.
  2516. if test -n "$inst_prefix_dir"; then
  2517. case "$libdir" in
  2518. [\\/]*)
  2519. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2520. ;;
  2521. esac
  2522. fi
  2523. add="-l$name"
  2524. fi
  2525. if test "$linkmode" = prog; then
  2526. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  2527. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  2528. else
  2529. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2530. test -n "$add" && deplibs="$add $deplibs"
  2531. fi
  2532. fi
  2533. elif test "$linkmode" = prog; then
  2534. # Here we assume that one of hardcode_direct or hardcode_minus_L
  2535. # is not unsupported. This is valid on all known static and
  2536. # shared platforms.
  2537. if test "$hardcode_direct" != unsupported; then
  2538. test -n "$old_library" && linklib="$old_library"
  2539. compile_deplibs="$dir/$linklib $compile_deplibs"
  2540. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  2541. else
  2542. compile_deplibs="-l$name -L$dir $compile_deplibs"
  2543. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  2544. fi
  2545. elif test "$build_libtool_libs" = yes; then
  2546. # Not a shared library
  2547. if test "$deplibs_check_method" != pass_all; then
  2548. # We're trying link a shared library against a static one
  2549. # but the system doesn't support it.
  2550. # Just print a warning and add the library to dependency_libs so
  2551. # that the program can be linked against the static library.
  2552. $echo
  2553. $echo "*** Warning: This system can not link to static lib archive $lib."
  2554. $echo "*** I have the capability to make that library automatically link in when"
  2555. $echo "*** you link to this library. But I can only do this if you have a"
  2556. $echo "*** shared version of the library, which you do not appear to have."
  2557. if test "$module" = yes; then
  2558. $echo "*** But as you try to build a module library, libtool will still create "
  2559. $echo "*** a static module, that should work as long as the dlopening application"
  2560. $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  2561. if test -z "$global_symbol_pipe"; then
  2562. $echo
  2563. $echo "*** However, this would only work if libtool was able to extract symbol"
  2564. $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2565. $echo "*** not find such a program. So, this module is probably useless."
  2566. $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2567. fi
  2568. if test "$build_old_libs" = no; then
  2569. build_libtool_libs=module
  2570. build_old_libs=yes
  2571. else
  2572. build_libtool_libs=no
  2573. fi
  2574. fi
  2575. else
  2576. convenience="$convenience $dir/$old_library"
  2577. old_convenience="$old_convenience $dir/$old_library"
  2578. deplibs="$dir/$old_library $deplibs"
  2579. link_static=yes
  2580. fi
  2581. fi # link shared/static library?
  2582. if test "$linkmode" = lib; then
  2583. if test -n "$dependency_libs" &&
  2584. { test "$hardcode_into_libs" != yes ||
  2585. test "$build_old_libs" = yes ||
  2586. test "$link_static" = yes; }; then
  2587. # Extract -R from dependency_libs
  2588. temp_deplibs=
  2589. for libdir in $dependency_libs; do
  2590. case $libdir in
  2591. -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  2592. case " $xrpath " in
  2593. *" $temp_xrpath "*) ;;
  2594. *) xrpath="$xrpath $temp_xrpath";;
  2595. esac;;
  2596. *) temp_deplibs="$temp_deplibs $libdir";;
  2597. esac
  2598. done
  2599. dependency_libs="$temp_deplibs"
  2600. fi
  2601. newlib_search_path="$newlib_search_path $absdir"
  2602. # Link against this library
  2603. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  2604. # ... and its dependency_libs
  2605. tmp_libs=
  2606. for deplib in $dependency_libs; do
  2607. newdependency_libs="$deplib $newdependency_libs"
  2608. if test "X$duplicate_deps" = "Xyes" ; then
  2609. case "$tmp_libs " in
  2610. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2611. esac
  2612. fi
  2613. tmp_libs="$tmp_libs $deplib"
  2614. done
  2615. if test "$link_all_deplibs" != no; then
  2616. # Add the search paths of all dependency libraries
  2617. for deplib in $dependency_libs; do
  2618. case $deplib in
  2619. -L*) path="$deplib" ;;
  2620. *.la)
  2621. dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  2622. test "X$dir" = "X$deplib" && dir="."
  2623. # We need an absolute path.
  2624. case $dir in
  2625. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  2626. *)
  2627. absdir=`cd "$dir" && pwd`
  2628. if test -z "$absdir"; then
  2629. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  2630. absdir="$dir"
  2631. fi
  2632. ;;
  2633. esac
  2634. if grep "^installed=no" $deplib > /dev/null; then
  2635. path="$absdir/$objdir"
  2636. else
  2637. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2638. if test -z "$libdir"; then
  2639. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2640. exit $EXIT_FAILURE
  2641. fi
  2642. if test "$absdir" != "$libdir"; then
  2643. $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2644. fi
  2645. path="$absdir"
  2646. fi
  2647. depdepl=
  2648. case $host in
  2649. *-*-darwin*)
  2650. # we do not want to link against static libs,
  2651. # but need to link against shared
  2652. eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2653. if test -n "$deplibrary_names" ; then
  2654. for tmp in $deplibrary_names ; do
  2655. depdepl=$tmp
  2656. done
  2657. if test -f "$path/$depdepl" ; then
  2658. depdepl="$path/$depdepl"
  2659. fi
  2660. # do not add paths which are already there
  2661. case " $newlib_search_path " in
  2662. *" $path "*) ;;
  2663. *) newlib_search_path="$newlib_search_path $path";;
  2664. esac
  2665. fi
  2666. path=""
  2667. ;;
  2668. *)
  2669. path="-L$path"
  2670. ;;
  2671. esac
  2672. ;;
  2673. -l*)
  2674. case $host in
  2675. *-*-darwin*)
  2676. # Again, we only want to link against shared libraries
  2677. eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2678. for tmp in $newlib_search_path ; do
  2679. if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2680. eval depdepl="$tmp/lib$tmp_libs.dylib"
  2681. break
  2682. fi
  2683. done
  2684. path=""
  2685. ;;
  2686. *) continue ;;
  2687. esac
  2688. ;;
  2689. *) continue ;;
  2690. esac
  2691. case " $deplibs " in
  2692. *" $path "*) ;;
  2693. *) deplibs="$path $deplibs" ;;
  2694. esac
  2695. case " $deplibs " in
  2696. *" $depdepl "*) ;;
  2697. *) deplibs="$depdepl $deplibs" ;;
  2698. esac
  2699. done
  2700. fi # link_all_deplibs != no
  2701. fi # linkmode = lib
  2702. done # for deplib in $libs
  2703. dependency_libs="$newdependency_libs"
  2704. if test "$pass" = dlpreopen; then
  2705. # Link the dlpreopened libraries before other libraries
  2706. for deplib in $save_deplibs; do
  2707. deplibs="$deplib $deplibs"
  2708. done
  2709. fi
  2710. if test "$pass" != dlopen; then
  2711. if test "$pass" != conv; then
  2712. # Make sure lib_search_path contains only unique directories.
  2713. lib_search_path=
  2714. for dir in $newlib_search_path; do
  2715. case "$lib_search_path " in
  2716. *" $dir "*) ;;
  2717. *) lib_search_path="$lib_search_path $dir" ;;
  2718. esac
  2719. done
  2720. newlib_search_path=
  2721. fi
  2722. if test "$linkmode,$pass" != "prog,link"; then
  2723. vars="deplibs"
  2724. else
  2725. vars="compile_deplibs finalize_deplibs"
  2726. fi
  2727. for var in $vars dependency_libs; do
  2728. # Add libraries to $var in reverse order
  2729. eval tmp_libs=\"\$$var\"
  2730. new_libs=
  2731. for deplib in $tmp_libs; do
  2732. # FIXME: Pedantically, this is the right thing to do, so
  2733. # that some nasty dependency loop isn't accidentally
  2734. # broken:
  2735. #new_libs="$deplib $new_libs"
  2736. # Pragmatically, this seems to cause very few problems in
  2737. # practice:
  2738. case $deplib in
  2739. -L*) new_libs="$deplib $new_libs" ;;
  2740. -R*) ;;
  2741. *)
  2742. # And here is the reason: when a library appears more
  2743. # than once as an explicit dependence of a library, or
  2744. # is implicitly linked in more than once by the
  2745. # compiler, it is considered special, and multiple
  2746. # occurrences thereof are not removed. Compare this
  2747. # with having the same library being listed as a
  2748. # dependency of multiple other libraries: in this case,
  2749. # we know (pedantically, we assume) the library does not
  2750. # need to be listed more than once, so we keep only the
  2751. # last copy. This is not always right, but it is rare
  2752. # enough that we require users that really mean to play
  2753. # such unportable linking tricks to link the library
  2754. # using -Wl,-lname, so that libtool does not consider it
  2755. # for duplicate removal.
  2756. case " $specialdeplibs " in
  2757. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  2758. *)
  2759. case " $new_libs " in
  2760. *" $deplib "*) ;;
  2761. *) new_libs="$deplib $new_libs" ;;
  2762. esac
  2763. ;;
  2764. esac
  2765. ;;
  2766. esac
  2767. done
  2768. tmp_libs=
  2769. for deplib in $new_libs; do
  2770. case $deplib in
  2771. -L*)
  2772. case " $tmp_libs " in
  2773. *" $deplib "*) ;;
  2774. *) tmp_libs="$tmp_libs $deplib" ;;
  2775. esac
  2776. ;;
  2777. *) tmp_libs="$tmp_libs $deplib" ;;
  2778. esac
  2779. done
  2780. eval $var=\"$tmp_libs\"
  2781. done # for var
  2782. fi
  2783. # Last step: remove runtime libs from dependency_libs
  2784. # (they stay in deplibs)
  2785. tmp_libs=
  2786. for i in $dependency_libs ; do
  2787. case " $predeps $postdeps $compiler_lib_search_path " in
  2788. *" $i "*)
  2789. i=""
  2790. ;;
  2791. esac
  2792. if test -n "$i" ; then
  2793. tmp_libs="$tmp_libs $i"
  2794. fi
  2795. done
  2796. dependency_libs=$tmp_libs
  2797. done # for pass
  2798. if test "$linkmode" = prog; then
  2799. dlfiles="$newdlfiles"
  2800. dlprefiles="$newdlprefiles"
  2801. fi
  2802. case $linkmode in
  2803. oldlib)
  2804. if test -n "$deplibs"; then
  2805. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  2806. fi
  2807. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2808. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  2809. fi
  2810. if test -n "$rpath"; then
  2811. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  2812. fi
  2813. if test -n "$xrpath"; then
  2814. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  2815. fi
  2816. if test -n "$vinfo"; then
  2817. $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
  2818. fi
  2819. if test -n "$release"; then
  2820. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  2821. fi
  2822. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  2823. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  2824. fi
  2825. # Now set the variables for building old libraries.
  2826. build_libtool_libs=no
  2827. oldlibs="$output"
  2828. objs="$objs$old_deplibs"
  2829. ;;
  2830. lib)
  2831. # Make sure we only generate libraries of the form `libNAME.la'.
  2832. case $outputname in
  2833. lib*)
  2834. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2835. eval shared_ext=\"$shrext_cmds\"
  2836. eval libname=\"$libname_spec\"
  2837. ;;
  2838. *)
  2839. if test "$module" = no; then
  2840. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  2841. $echo "$help" 1>&2
  2842. exit $EXIT_FAILURE
  2843. fi
  2844. if test "$need_lib_prefix" != no; then
  2845. # Add the "lib" prefix for modules if required
  2846. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2847. eval shared_ext=\"$shrext_cmds\"
  2848. eval libname=\"$libname_spec\"
  2849. else
  2850. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  2851. fi
  2852. ;;
  2853. esac
  2854. if test -n "$objs"; then
  2855. if test "$deplibs_check_method" != pass_all; then
  2856. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  2857. exit $EXIT_FAILURE
  2858. else
  2859. $echo
  2860. $echo "*** Warning: Linking the shared library $output against the non-libtool"
  2861. $echo "*** objects $objs is not portable!"
  2862. libobjs="$libobjs $objs"
  2863. fi
  2864. fi
  2865. if test "$dlself" != no; then
  2866. $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  2867. fi
  2868. set dummy $rpath
  2869. if test "$#" -gt 2; then
  2870. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  2871. fi
  2872. install_libdir="$2"
  2873. oldlibs=
  2874. if test -z "$rpath"; then
  2875. if test "$build_libtool_libs" = yes; then
  2876. # Building a libtool convenience library.
  2877. # Some compilers have problems with a `.al' extension so
  2878. # convenience libraries should have the same extension an
  2879. # archive normally would.
  2880. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  2881. build_libtool_libs=convenience
  2882. build_old_libs=yes
  2883. fi
  2884. if test -n "$vinfo"; then
  2885. $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
  2886. fi
  2887. if test -n "$release"; then
  2888. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  2889. fi
  2890. else
  2891. # Parse the version information argument.
  2892. save_ifs="$IFS"; IFS=':'
  2893. set dummy $vinfo 0 0 0
  2894. IFS="$save_ifs"
  2895. if test -n "$8"; then
  2896. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  2897. $echo "$help" 1>&2
  2898. exit $EXIT_FAILURE
  2899. fi
  2900. # convert absolute version numbers to libtool ages
  2901. # this retains compatibility with .la files and attempts
  2902. # to make the code below a bit more comprehensible
  2903. case $vinfo_number in
  2904. yes)
  2905. number_major="$2"
  2906. number_minor="$3"
  2907. number_revision="$4"
  2908. #
  2909. # There are really only two kinds -- those that
  2910. # use the current revision as the major version
  2911. # and those that subtract age and use age as
  2912. # a minor version. But, then there is irix
  2913. # which has an extra 1 added just for fun
  2914. #
  2915. case $version_type in
  2916. darwin|linux|osf|windows)
  2917. current=`expr $number_major + $number_minor`
  2918. age="$number_minor"
  2919. revision="$number_revision"
  2920. ;;
  2921. freebsd-aout|freebsd-elf|sunos)
  2922. current="$number_major"
  2923. revision="$number_minor"
  2924. age="0"
  2925. ;;
  2926. irix|nonstopux)
  2927. current=`expr $number_major + $number_minor - 1`
  2928. age="$number_minor"
  2929. revision="$number_minor"
  2930. ;;
  2931. esac
  2932. ;;
  2933. no)
  2934. current="$2"
  2935. revision="$3"
  2936. age="$4"
  2937. ;;
  2938. esac
  2939. # Check that each of the things are valid numbers.
  2940. case $current in
  2941. 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]) ;;
  2942. *)
  2943. $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
  2944. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2945. exit $EXIT_FAILURE
  2946. ;;
  2947. esac
  2948. case $revision in
  2949. 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]) ;;
  2950. *)
  2951. $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
  2952. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2953. exit $EXIT_FAILURE
  2954. ;;
  2955. esac
  2956. case $age in
  2957. 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]) ;;
  2958. *)
  2959. $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
  2960. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2961. exit $EXIT_FAILURE
  2962. ;;
  2963. esac
  2964. if test "$age" -gt "$current"; then
  2965. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  2966. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  2967. exit $EXIT_FAILURE
  2968. fi
  2969. # Calculate the version variables.
  2970. major=
  2971. versuffix=
  2972. versuffix2=
  2973. verstring=
  2974. case $version_type in
  2975. none) ;;
  2976. darwin)
  2977. # Like Linux, but with the current version available in
  2978. # verstring for coding it into the library header
  2979. major=.`expr $current - $age`
  2980. versuffix="$major.$age.$revision"
  2981. # Darwin ld doesn't like 0 for these options...
  2982. minor_current=`expr $current + 1`
  2983. verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  2984. ;;
  2985. freebsd-aout)
  2986. major=".$current"
  2987. versuffix=".$current.$revision";
  2988. ;;
  2989. freebsd-elf)
  2990. major=".$current"
  2991. versuffix=".$current";
  2992. ;;
  2993. irix | nonstopux)
  2994. major=`expr $current - $age + 1`
  2995. case $version_type in
  2996. nonstopux) verstring_prefix=nonstopux ;;
  2997. *) verstring_prefix=sgi ;;
  2998. esac
  2999. verstring="$verstring_prefix$major.$revision"
  3000. # Add in all the interfaces that we are compatible with.
  3001. loop=$revision
  3002. while test "$loop" -ne 0; do
  3003. iface=`expr $revision - $loop`
  3004. loop=`expr $loop - 1`
  3005. verstring="$verstring_prefix$major.$iface:$verstring"
  3006. done
  3007. # Before this point, $major must not contain `.'.
  3008. major=.$major
  3009. versuffix="$major.$revision"
  3010. ;;
  3011. linux)
  3012. major=.`expr $current - $age`
  3013. versuffix="$major.$age.$revision"
  3014. versuffix2="$major.$age"
  3015. ;;
  3016. osf)
  3017. major=.`expr $current - $age`
  3018. versuffix=".$current.$age.$revision"
  3019. verstring="$current.$age.$revision"
  3020. # Add in all the interfaces that we are compatible with.
  3021. loop=$age
  3022. while test "$loop" -ne 0; do
  3023. iface=`expr $current - $loop`
  3024. loop=`expr $loop - 1`
  3025. verstring="$verstring:${iface}.0"
  3026. done
  3027. # Make executables depend on our current version.
  3028. verstring="$verstring:${current}.0"
  3029. ;;
  3030. sunos)
  3031. major=".$current"
  3032. versuffix=".$current.$revision"
  3033. ;;
  3034. windows)
  3035. # Use '-' rather than '.', since we only want one
  3036. # extension on DOS 8.3 filesystems.
  3037. major=`expr $current - $age`
  3038. versuffix="-$major"
  3039. ;;
  3040. *)
  3041. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  3042. $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  3043. exit $EXIT_FAILURE
  3044. ;;
  3045. esac
  3046. # Clear the version info if we defaulted, and they specified a release.
  3047. if test -z "$vinfo" && test -n "$release"; then
  3048. major=
  3049. case $version_type in
  3050. darwin)
  3051. # we can't check for "0.0" in archive_cmds due to quoting
  3052. # problems, so we reset it completely
  3053. verstring=
  3054. ;;
  3055. *)
  3056. verstring="0.0"
  3057. ;;
  3058. esac
  3059. if test "$need_version" = no; then
  3060. versuffix=
  3061. else
  3062. versuffix=".0.0"
  3063. fi
  3064. fi
  3065. # Remove version info from name if versioning should be avoided
  3066. if test "$avoid_version" = yes && test "$need_version" = no; then
  3067. major=
  3068. versuffix=
  3069. versuffix2=
  3070. verstring=""
  3071. fi
  3072. # Check to see if the archive will have undefined symbols.
  3073. if test "$allow_undefined" = yes; then
  3074. if test "$allow_undefined_flag" = unsupported; then
  3075. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  3076. build_libtool_libs=no
  3077. build_old_libs=yes
  3078. fi
  3079. else
  3080. # Don't allow undefined symbols.
  3081. allow_undefined_flag="$no_undefined_flag"
  3082. fi
  3083. fi
  3084. if test "$mode" != relink; then
  3085. # Remove our outputs, but don't remove object files since they
  3086. # may have been created when compiling PIC objects.
  3087. removelist=
  3088. tempremovelist=`$echo "$output_objdir/*"`
  3089. for p in $tempremovelist; do
  3090. case $p in
  3091. *.$objext)
  3092. ;;
  3093. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  3094. if test "X$precious_files_regex" != "X"; then
  3095. if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  3096. then
  3097. continue
  3098. fi
  3099. fi
  3100. removelist="$removelist $p"
  3101. ;;
  3102. *) ;;
  3103. esac
  3104. done
  3105. if test -n "$removelist"; then
  3106. $show "${rm}r $removelist"
  3107. $run ${rm}r $removelist
  3108. fi
  3109. fi
  3110. # Now set the variables for building old libraries.
  3111. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  3112. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  3113. # Transform .lo files to .o files.
  3114. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  3115. fi
  3116. # Eliminate all temporary directories.
  3117. for path in $notinst_path; do
  3118. lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
  3119. deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
  3120. dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
  3121. done
  3122. if test -n "$xrpath"; then
  3123. # If the user specified any rpath flags, then add them.
  3124. temp_xrpath=
  3125. for libdir in $xrpath; do
  3126. temp_xrpath="$temp_xrpath -R$libdir"
  3127. case "$finalize_rpath " in
  3128. *" $libdir "*) ;;
  3129. *) finalize_rpath="$finalize_rpath $libdir" ;;
  3130. esac
  3131. done
  3132. if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  3133. dependency_libs="$temp_xrpath $dependency_libs"
  3134. fi
  3135. fi
  3136. # Make sure dlfiles contains only unique files that won't be dlpreopened
  3137. old_dlfiles="$dlfiles"
  3138. dlfiles=
  3139. for lib in $old_dlfiles; do
  3140. case " $dlprefiles $dlfiles " in
  3141. *" $lib "*) ;;
  3142. *) dlfiles="$dlfiles $lib" ;;
  3143. esac
  3144. done
  3145. # Make sure dlprefiles contains only unique files
  3146. old_dlprefiles="$dlprefiles"
  3147. dlprefiles=
  3148. for lib in $old_dlprefiles; do
  3149. case "$dlprefiles " in
  3150. *" $lib "*) ;;
  3151. *) dlprefiles="$dlprefiles $lib" ;;
  3152. esac
  3153. done
  3154. if test "$build_libtool_libs" = yes; then
  3155. if test -n "$rpath"; then
  3156. case $host in
  3157. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  3158. # these systems don't actually have a c library (as such)!
  3159. ;;
  3160. *-*-rhapsody* | *-*-darwin1.[012])
  3161. # Rhapsody C library is in the System framework
  3162. deplibs="$deplibs -framework System"
  3163. ;;
  3164. *-*-netbsd*)
  3165. # Don't link with libc until the a.out ld.so is fixed.
  3166. ;;
  3167. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  3168. # Do not include libc due to us having libc/libc_r.
  3169. test "X$arg" = "X-lc" && continue
  3170. ;;
  3171. *)
  3172. # Add libc to deplibs on all other systems if necessary.
  3173. if test "$build_libtool_need_lc" = "yes"; then
  3174. deplibs="$deplibs -lc"
  3175. fi
  3176. ;;
  3177. esac
  3178. fi
  3179. # Transform deplibs into only deplibs that can be linked in shared.
  3180. name_save=$name
  3181. libname_save=$libname
  3182. release_save=$release
  3183. versuffix_save=$versuffix
  3184. major_save=$major
  3185. # I'm not sure if I'm treating the release correctly. I think
  3186. # release should show up in the -l (ie -lgmp5) so we don't want to
  3187. # add it in twice. Is that correct?
  3188. release=""
  3189. versuffix=""
  3190. major=""
  3191. newdeplibs=
  3192. droppeddeps=no
  3193. case $deplibs_check_method in
  3194. pass_all)
  3195. # Don't check for shared/static. Everything works.
  3196. # This might be a little naive. We might want to check
  3197. # whether the library exists or not. But this is on
  3198. # osf3 & osf4 and I'm not really sure... Just
  3199. # implementing what was already the behavior.
  3200. newdeplibs=$deplibs
  3201. ;;
  3202. test_compile)
  3203. # This code stresses the "libraries are programs" paradigm to its
  3204. # limits. Maybe even breaks it. We compile a program, linking it
  3205. # against the deplibs as a proxy for the library. Then we can check
  3206. # whether they linked in statically or dynamically with ldd.
  3207. $rm conftest.c
  3208. cat > conftest.c <<EOF
  3209. int main() { return 0; }
  3210. EOF
  3211. $rm conftest
  3212. $LTCC -o conftest conftest.c $deplibs
  3213. if test "$?" -eq 0 ; then
  3214. ldd_output=`ldd conftest`
  3215. for i in $deplibs; do
  3216. name="`expr $i : '-l\(.*\)'`"
  3217. # If $name is empty we are operating on a -L argument.
  3218. if test "$name" != "" && test "$name" -ne "0"; then
  3219. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3220. case " $predeps $postdeps " in
  3221. *" $i "*)
  3222. newdeplibs="$newdeplibs $i"
  3223. i=""
  3224. ;;
  3225. esac
  3226. fi
  3227. if test -n "$i" ; then
  3228. libname=`eval \\$echo \"$libname_spec\"`
  3229. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3230. set dummy $deplib_matches
  3231. deplib_match=$2
  3232. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3233. newdeplibs="$newdeplibs $i"
  3234. else
  3235. droppeddeps=yes
  3236. $echo
  3237. $echo "*** Warning: dynamic linker does not accept needed library $i."
  3238. $echo "*** I have the capability to make that library automatically link in when"
  3239. $echo "*** you link to this library. But I can only do this if you have a"
  3240. $echo "*** shared version of the library, which I believe you do not have"
  3241. $echo "*** because a test_compile did reveal that the linker did not use it for"
  3242. $echo "*** its dynamic dependency list that programs get resolved with at runtime."
  3243. fi
  3244. fi
  3245. else
  3246. newdeplibs="$newdeplibs $i"
  3247. fi
  3248. done
  3249. else
  3250. # Error occurred in the first compile. Let's try to salvage
  3251. # the situation: Compile a separate program for each library.
  3252. for i in $deplibs; do
  3253. name="`expr $i : '-l\(.*\)'`"
  3254. # If $name is empty we are operating on a -L argument.
  3255. if test "$name" != "" && test "$name" != "0"; then
  3256. $rm conftest
  3257. $LTCC -o conftest conftest.c $i
  3258. # Did it work?
  3259. if test "$?" -eq 0 ; then
  3260. ldd_output=`ldd conftest`
  3261. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3262. case " $predeps $postdeps " in
  3263. *" $i "*)
  3264. newdeplibs="$newdeplibs $i"
  3265. i=""
  3266. ;;
  3267. esac
  3268. fi
  3269. if test -n "$i" ; then
  3270. libname=`eval \\$echo \"$libname_spec\"`
  3271. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3272. set dummy $deplib_matches
  3273. deplib_match=$2
  3274. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3275. newdeplibs="$newdeplibs $i"
  3276. else
  3277. droppeddeps=yes
  3278. $echo
  3279. $echo "*** Warning: dynamic linker does not accept needed library $i."
  3280. $echo "*** I have the capability to make that library automatically link in when"
  3281. $echo "*** you link to this library. But I can only do this if you have a"
  3282. $echo "*** shared version of the library, which you do not appear to have"
  3283. $echo "*** because a test_compile did reveal that the linker did not use this one"
  3284. $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  3285. fi
  3286. fi
  3287. else
  3288. droppeddeps=yes
  3289. $echo
  3290. $echo "*** Warning! Library $i is needed by this library but I was not able to"
  3291. $echo "*** make it link in! You will probably need to install it or some"
  3292. $echo "*** library that it depends on before this library will be fully"
  3293. $echo "*** functional. Installing it before continuing would be even better."
  3294. fi
  3295. else
  3296. newdeplibs="$newdeplibs $i"
  3297. fi
  3298. done
  3299. fi
  3300. ;;
  3301. file_magic*)
  3302. set dummy $deplibs_check_method
  3303. file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3304. for a_deplib in $deplibs; do
  3305. name="`expr $a_deplib : '-l\(.*\)'`"
  3306. # If $name is empty we are operating on a -L argument.
  3307. if test "$name" != "" && test "$name" != "0"; then
  3308. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3309. case " $predeps $postdeps " in
  3310. *" $a_deplib "*)
  3311. newdeplibs="$newdeplibs $a_deplib"
  3312. a_deplib=""
  3313. ;;
  3314. esac
  3315. fi
  3316. if test -n "$a_deplib" ; then
  3317. libname=`eval \\$echo \"$libname_spec\"`
  3318. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3319. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3320. for potent_lib in $potential_libs; do
  3321. # Follow soft links.
  3322. if ls -lLd "$potent_lib" 2>/dev/null \
  3323. | grep " -> " >/dev/null; then
  3324. continue
  3325. fi
  3326. # The statement above tries to avoid entering an
  3327. # endless loop below, in case of cyclic links.
  3328. # We might still enter an endless loop, since a link
  3329. # loop can be closed while we follow links,
  3330. # but so what?
  3331. potlib="$potent_lib"
  3332. while test -h "$potlib" 2>/dev/null; do
  3333. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  3334. case $potliblink in
  3335. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  3336. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  3337. esac
  3338. done
  3339. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  3340. | ${SED} 10q \
  3341. | $EGREP "$file_magic_regex" > /dev/null; then
  3342. newdeplibs="$newdeplibs $a_deplib"
  3343. a_deplib=""
  3344. break 2
  3345. fi
  3346. done
  3347. done
  3348. fi
  3349. if test -n "$a_deplib" ; then
  3350. droppeddeps=yes
  3351. $echo
  3352. $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3353. $echo "*** I have the capability to make that library automatically link in when"
  3354. $echo "*** you link to this library. But I can only do this if you have a"
  3355. $echo "*** shared version of the library, which you do not appear to have"
  3356. $echo "*** because I did check the linker path looking for a file starting"
  3357. if test -z "$potlib" ; then
  3358. $echo "*** with $libname but no candidates were found. (...for file magic test)"
  3359. else
  3360. $echo "*** with $libname and none of the candidates passed a file format test"
  3361. $echo "*** using a file magic. Last file checked: $potlib"
  3362. fi
  3363. fi
  3364. else
  3365. # Add a -L argument.
  3366. newdeplibs="$newdeplibs $a_deplib"
  3367. fi
  3368. done # Gone through all deplibs.
  3369. ;;
  3370. match_pattern*)
  3371. set dummy $deplibs_check_method
  3372. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3373. for a_deplib in $deplibs; do
  3374. name="`expr $a_deplib : '-l\(.*\)'`"
  3375. # If $name is empty we are operating on a -L argument.
  3376. if test -n "$name" && test "$name" != "0"; then
  3377. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3378. case " $predeps $postdeps " in
  3379. *" $a_deplib "*)
  3380. newdeplibs="$newdeplibs $a_deplib"
  3381. a_deplib=""
  3382. ;;
  3383. esac
  3384. fi
  3385. if test -n "$a_deplib" ; then
  3386. libname=`eval \\$echo \"$libname_spec\"`
  3387. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3388. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3389. for potent_lib in $potential_libs; do
  3390. potlib="$potent_lib" # see symlink-check above in file_magic test
  3391. if eval $echo \"$potent_lib\" 2>/dev/null \
  3392. | ${SED} 10q \
  3393. | $EGREP "$match_pattern_regex" > /dev/null; then
  3394. newdeplibs="$newdeplibs $a_deplib"
  3395. a_deplib=""
  3396. break 2
  3397. fi
  3398. done
  3399. done
  3400. fi
  3401. if test -n "$a_deplib" ; then
  3402. droppeddeps=yes
  3403. $echo
  3404. $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3405. $echo "*** I have the capability to make that library automatically link in when"
  3406. $echo "*** you link to this library. But I can only do this if you have a"
  3407. $echo "*** shared version of the library, which you do not appear to have"
  3408. $echo "*** because I did check the linker path looking for a file starting"
  3409. if test -z "$potlib" ; then
  3410. $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  3411. else
  3412. $echo "*** with $libname and none of the candidates passed a file format test"
  3413. $echo "*** using a regex pattern. Last file checked: $potlib"
  3414. fi
  3415. fi
  3416. else
  3417. # Add a -L argument.
  3418. newdeplibs="$newdeplibs $a_deplib"
  3419. fi
  3420. done # Gone through all deplibs.
  3421. ;;
  3422. none | unknown | *)
  3423. newdeplibs=""
  3424. tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  3425. -e 's/ -[LR][^ ]*//g'`
  3426. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3427. for i in $predeps $postdeps ; do
  3428. # can't use Xsed below, because $i might contain '/'
  3429. tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
  3430. done
  3431. fi
  3432. if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
  3433. | grep . >/dev/null; then
  3434. $echo
  3435. if test "X$deplibs_check_method" = "Xnone"; then
  3436. $echo "*** Warning: inter-library dependencies are not supported in this platform."
  3437. else
  3438. $echo "*** Warning: inter-library dependencies are not known to be supported."
  3439. fi
  3440. $echo "*** All declared inter-library dependencies are being dropped."
  3441. droppeddeps=yes
  3442. fi
  3443. ;;
  3444. esac
  3445. versuffix=$versuffix_save
  3446. major=$major_save
  3447. release=$release_save
  3448. libname=$libname_save
  3449. name=$name_save
  3450. case $host in
  3451. *-*-rhapsody* | *-*-darwin1.[012])
  3452. # On Rhapsody replace the C library is the System framework
  3453. newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3454. ;;
  3455. esac
  3456. if test "$droppeddeps" = yes; then
  3457. if test "$module" = yes; then
  3458. $echo
  3459. $echo "*** Warning: libtool could not satisfy all declared inter-library"
  3460. $echo "*** dependencies of module $libname. Therefore, libtool will create"
  3461. $echo "*** a static module, that should work as long as the dlopening"
  3462. $echo "*** application is linked with the -dlopen flag."
  3463. if test -z "$global_symbol_pipe"; then
  3464. $echo
  3465. $echo "*** However, this would only work if libtool was able to extract symbol"
  3466. $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  3467. $echo "*** not find such a program. So, this module is probably useless."
  3468. $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  3469. fi
  3470. if test "$build_old_libs" = no; then
  3471. oldlibs="$output_objdir/$libname.$libext"
  3472. build_libtool_libs=module
  3473. build_old_libs=yes
  3474. else
  3475. build_libtool_libs=no
  3476. fi
  3477. else
  3478. $echo "*** The inter-library dependencies that have been dropped here will be"
  3479. $echo "*** automatically added whenever a program is linked with this library"
  3480. $echo "*** or is declared to -dlopen it."
  3481. if test "$allow_undefined" = no; then
  3482. $echo
  3483. $echo "*** Since this library must not contain undefined symbols,"
  3484. $echo "*** because either the platform does not support them or"
  3485. $echo "*** it was explicitly requested with -no-undefined,"
  3486. $echo "*** libtool will only create a static version of it."
  3487. if test "$build_old_libs" = no; then
  3488. oldlibs="$output_objdir/$libname.$libext"
  3489. build_libtool_libs=module
  3490. build_old_libs=yes
  3491. else
  3492. build_libtool_libs=no
  3493. fi
  3494. fi
  3495. fi
  3496. fi
  3497. # Done checking deplibs!
  3498. deplibs=$newdeplibs
  3499. fi
  3500. # All the library-specific variables (install_libdir is set above).
  3501. library_names=
  3502. old_library=
  3503. dlname=
  3504. # Test again, we may have decided not to build it any more
  3505. if test "$build_libtool_libs" = yes; then
  3506. if test "$hardcode_into_libs" = yes; then
  3507. # Hardcode the library paths
  3508. hardcode_libdirs=
  3509. dep_rpath=
  3510. rpath="$finalize_rpath"
  3511. test "$mode" != relink && rpath="$compile_rpath$rpath"
  3512. for libdir in $rpath; do
  3513. if test -n "$hardcode_libdir_flag_spec"; then
  3514. if test -n "$hardcode_libdir_separator"; then
  3515. if test -z "$hardcode_libdirs"; then
  3516. hardcode_libdirs="$libdir"
  3517. else
  3518. # Just accumulate the unique libdirs.
  3519. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3520. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3521. ;;
  3522. *)
  3523. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3524. ;;
  3525. esac
  3526. fi
  3527. else
  3528. eval flag=\"$hardcode_libdir_flag_spec\"
  3529. dep_rpath="$dep_rpath $flag"
  3530. fi
  3531. elif test -n "$runpath_var"; then
  3532. case "$perm_rpath " in
  3533. *" $libdir "*) ;;
  3534. *) perm_rpath="$perm_rpath $libdir" ;;
  3535. esac
  3536. fi
  3537. done
  3538. # Substitute the hardcoded libdirs into the rpath.
  3539. if test -n "$hardcode_libdir_separator" &&
  3540. test -n "$hardcode_libdirs"; then
  3541. libdir="$hardcode_libdirs"
  3542. if test -n "$hardcode_libdir_flag_spec_ld"; then
  3543. eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  3544. else
  3545. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  3546. fi
  3547. fi
  3548. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  3549. # We should set the runpath_var.
  3550. rpath=
  3551. for dir in $perm_rpath; do
  3552. rpath="$rpath$dir:"
  3553. done
  3554. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  3555. fi
  3556. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  3557. fi
  3558. shlibpath="$finalize_shlibpath"
  3559. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  3560. if test -n "$shlibpath"; then
  3561. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  3562. fi
  3563. # Get the real and link names of the library.
  3564. eval shared_ext=\"$shrext_cmds\"
  3565. eval library_names=\"$library_names_spec\"
  3566. set dummy $library_names
  3567. realname="$2"
  3568. shift; shift
  3569. if test -n "$soname_spec"; then
  3570. eval soname=\"$soname_spec\"
  3571. else
  3572. soname="$realname"
  3573. fi
  3574. if test -z "$dlname"; then
  3575. dlname=$soname
  3576. fi
  3577. lib="$output_objdir/$realname"
  3578. for link
  3579. do
  3580. linknames="$linknames $link"
  3581. done
  3582. # Use standard objects if they are pic
  3583. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3584. # Prepare the list of exported symbols
  3585. if test -z "$export_symbols"; then
  3586. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  3587. $show "generating symbol list for \`$libname.la'"
  3588. export_symbols="$output_objdir/$libname.exp"
  3589. $run $rm $export_symbols
  3590. cmds=$export_symbols_cmds
  3591. save_ifs="$IFS"; IFS='~'
  3592. for cmd in $cmds; do
  3593. IFS="$save_ifs"
  3594. eval cmd=\"$cmd\"
  3595. if len=`expr "X$cmd" : ".*"` &&
  3596. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3597. $show "$cmd"
  3598. $run eval "$cmd" || exit $?
  3599. skipped_export=false
  3600. else
  3601. # The command line is too long to execute in one step.
  3602. $show "using reloadable object file for export list..."
  3603. skipped_export=:
  3604. fi
  3605. done
  3606. IFS="$save_ifs"
  3607. if test -n "$export_symbols_regex"; then
  3608. $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  3609. $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  3610. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  3611. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  3612. fi
  3613. fi
  3614. fi
  3615. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  3616. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  3617. fi
  3618. tmp_deplibs=
  3619. for test_deplib in $deplibs; do
  3620. case " $convenience " in
  3621. *" $test_deplib "*) ;;
  3622. *)
  3623. tmp_deplibs="$tmp_deplibs $test_deplib"
  3624. ;;
  3625. esac
  3626. done
  3627. deplibs="$tmp_deplibs"
  3628. if test -n "$convenience"; then
  3629. if test -n "$whole_archive_flag_spec"; then
  3630. save_libobjs=$libobjs
  3631. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3632. else
  3633. gentop="$output_objdir/${outputname}x"
  3634. generated="$generated $gentop"
  3635. func_extract_archives $gentop $convenience
  3636. libobjs="$libobjs $func_extract_archives_result"
  3637. fi
  3638. fi
  3639. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  3640. eval flag=\"$thread_safe_flag_spec\"
  3641. linker_flags="$linker_flags $flag"
  3642. fi
  3643. # Make a backup of the uninstalled library when relinking
  3644. if test "$mode" = relink; then
  3645. $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  3646. fi
  3647. # Do each of the archive commands.
  3648. if test "$module" = yes && test -n "$module_cmds" ; then
  3649. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3650. eval test_cmds=\"$module_expsym_cmds\"
  3651. cmds=$module_expsym_cmds
  3652. else
  3653. eval test_cmds=\"$module_cmds\"
  3654. cmds=$module_cmds
  3655. fi
  3656. else
  3657. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3658. eval test_cmds=\"$archive_expsym_cmds\"
  3659. cmds=$archive_expsym_cmds
  3660. else
  3661. eval test_cmds=\"$archive_cmds\"
  3662. cmds=$archive_cmds
  3663. fi
  3664. fi
  3665. if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
  3666. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3667. :
  3668. else
  3669. # The command line is too long to link in one step, link piecewise.
  3670. $echo "creating reloadable object files..."
  3671. # Save the value of $output and $libobjs because we want to
  3672. # use them later. If we have whole_archive_flag_spec, we
  3673. # want to use save_libobjs as it was before
  3674. # whole_archive_flag_spec was expanded, because we can't
  3675. # assume the linker understands whole_archive_flag_spec.
  3676. # This may have to be revisited, in case too many
  3677. # convenience libraries get linked in and end up exceeding
  3678. # the spec.
  3679. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  3680. save_libobjs=$libobjs
  3681. fi
  3682. save_output=$output
  3683. output_la=`$echo "X$output" | $Xsed -e "$basename"`
  3684. # Clear the reloadable object creation command queue and
  3685. # initialize k to one.
  3686. test_cmds=
  3687. concat_cmds=
  3688. objlist=
  3689. delfiles=
  3690. last_robj=
  3691. k=1
  3692. output=$output_objdir/$output_la-${k}.$objext
  3693. # Loop over the list of objects to be linked.
  3694. for obj in $save_libobjs
  3695. do
  3696. eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  3697. if test "X$objlist" = X ||
  3698. { len=`expr "X$test_cmds" : ".*"` &&
  3699. test "$len" -le "$max_cmd_len"; }; then
  3700. objlist="$objlist $obj"
  3701. else
  3702. # The command $test_cmds is almost too long, add a
  3703. # command to the queue.
  3704. if test "$k" -eq 1 ; then
  3705. # The first file doesn't have a previous command to add.
  3706. eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  3707. else
  3708. # All subsequent reloadable object files will link in
  3709. # the last one created.
  3710. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  3711. fi
  3712. last_robj=$output_objdir/$output_la-${k}.$objext
  3713. k=`expr $k + 1`
  3714. output=$output_objdir/$output_la-${k}.$objext
  3715. objlist=$obj
  3716. len=1
  3717. fi
  3718. done
  3719. # Handle the remaining objects by creating one last
  3720. # reloadable object file. All subsequent reloadable object
  3721. # files will link in the last one created.
  3722. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  3723. eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  3724. if ${skipped_export-false}; then
  3725. $show "generating symbol list for \`$libname.la'"
  3726. export_symbols="$output_objdir/$libname.exp"
  3727. $run $rm $export_symbols
  3728. libobjs=$output
  3729. # Append the command to create the export file.
  3730. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
  3731. fi
  3732. # Set up a command to remove the reloadable object files
  3733. # after they are used.
  3734. i=0
  3735. while test "$i" -lt "$k"
  3736. do
  3737. i=`expr $i + 1`
  3738. delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
  3739. done
  3740. $echo "creating a temporary reloadable object file: $output"
  3741. # Loop through the commands generated above and execute them.
  3742. save_ifs="$IFS"; IFS='~'
  3743. for cmd in $concat_cmds; do
  3744. IFS="$save_ifs"
  3745. $show "$cmd"
  3746. $run eval "$cmd" || exit $?
  3747. done
  3748. IFS="$save_ifs"
  3749. libobjs=$output
  3750. # Restore the value of output.
  3751. output=$save_output
  3752. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  3753. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3754. fi
  3755. # Expand the library linking commands again to reset the
  3756. # value of $libobjs for piecewise linking.
  3757. # Do each of the archive commands.
  3758. if test "$module" = yes && test -n "$module_cmds" ; then
  3759. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3760. cmds=$module_expsym_cmds
  3761. else
  3762. cmds=$module_cmds
  3763. fi
  3764. else
  3765. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3766. cmds=$archive_expsym_cmds
  3767. else
  3768. cmds=$archive_cmds
  3769. fi
  3770. fi
  3771. # Append the command to remove the reloadable object files
  3772. # to the just-reset $cmds.
  3773. eval cmds=\"\$cmds~\$rm $delfiles\"
  3774. fi
  3775. save_ifs="$IFS"; IFS='~'
  3776. for cmd in $cmds; do
  3777. IFS="$save_ifs"
  3778. eval cmd=\"$cmd\"
  3779. $show "$cmd"
  3780. $run eval "$cmd" || exit $?
  3781. done
  3782. IFS="$save_ifs"
  3783. # Restore the uninstalled library and exit
  3784. if test "$mode" = relink; then
  3785. $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  3786. exit $EXIT_SUCCESS
  3787. fi
  3788. # Create links to the real library.
  3789. for linkname in $linknames; do
  3790. if test "$realname" != "$linkname"; then
  3791. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  3792. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  3793. fi
  3794. done
  3795. # If -module or -export-dynamic was specified, set the dlname.
  3796. if test "$module" = yes || test "$export_dynamic" = yes; then
  3797. # On all known operating systems, these are identical.
  3798. dlname="$soname"
  3799. fi
  3800. fi
  3801. ;;
  3802. obj)
  3803. if test -n "$deplibs"; then
  3804. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  3805. fi
  3806. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3807. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  3808. fi
  3809. if test -n "$rpath"; then
  3810. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  3811. fi
  3812. if test -n "$xrpath"; then
  3813. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  3814. fi
  3815. if test -n "$vinfo"; then
  3816. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  3817. fi
  3818. if test -n "$release"; then
  3819. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  3820. fi
  3821. case $output in
  3822. *.lo)
  3823. if test -n "$objs$old_deplibs"; then
  3824. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  3825. exit $EXIT_FAILURE
  3826. fi
  3827. libobj="$output"
  3828. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  3829. ;;
  3830. *)
  3831. libobj=
  3832. obj="$output"
  3833. ;;
  3834. esac
  3835. # Delete the old objects.
  3836. $run $rm $obj $libobj
  3837. # Objects from convenience libraries. This assumes
  3838. # single-version convenience libraries. Whenever we create
  3839. # different ones for PIC/non-PIC, this we'll have to duplicate
  3840. # the extraction.
  3841. reload_conv_objs=
  3842. gentop=
  3843. # reload_cmds runs $LD directly, so let us get rid of
  3844. # -Wl from whole_archive_flag_spec
  3845. wl=
  3846. if test -n "$convenience"; then
  3847. if test -n "$whole_archive_flag_spec"; then
  3848. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  3849. else
  3850. gentop="$output_objdir/${obj}x"
  3851. generated="$generated $gentop"
  3852. func_extract_archives $gentop $convenience
  3853. reload_conv_objs="$reload_objs $func_extract_archives_result"
  3854. fi
  3855. fi
  3856. # Create the old-style object.
  3857. 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
  3858. output="$obj"
  3859. cmds=$reload_cmds
  3860. save_ifs="$IFS"; IFS='~'
  3861. for cmd in $cmds; do
  3862. IFS="$save_ifs"
  3863. eval cmd=\"$cmd\"
  3864. $show "$cmd"
  3865. $run eval "$cmd" || exit $?
  3866. done
  3867. IFS="$save_ifs"
  3868. # Exit if we aren't doing a library object file.
  3869. if test -z "$libobj"; then
  3870. if test -n "$gentop"; then
  3871. $show "${rm}r $gentop"
  3872. $run ${rm}r $gentop
  3873. fi
  3874. exit $EXIT_SUCCESS
  3875. fi
  3876. if test "$build_libtool_libs" != yes; then
  3877. if test -n "$gentop"; then
  3878. $show "${rm}r $gentop"
  3879. $run ${rm}r $gentop
  3880. fi
  3881. # Create an invalid libtool object if no PIC, so that we don't
  3882. # accidentally link it into a program.
  3883. # $show "echo timestamp > $libobj"
  3884. # $run eval "echo timestamp > $libobj" || exit $?
  3885. exit $EXIT_SUCCESS
  3886. fi
  3887. if test -n "$pic_flag" || test "$pic_mode" != default; then
  3888. # Only do commands if we really have different PIC objects.
  3889. reload_objs="$libobjs $reload_conv_objs"
  3890. output="$libobj"
  3891. cmds=$reload_cmds
  3892. save_ifs="$IFS"; IFS='~'
  3893. for cmd in $cmds; do
  3894. IFS="$save_ifs"
  3895. eval cmd=\"$cmd\"
  3896. $show "$cmd"
  3897. $run eval "$cmd" || exit $?
  3898. done
  3899. IFS="$save_ifs"
  3900. fi
  3901. if test -n "$gentop"; then
  3902. $show "${rm}r $gentop"
  3903. $run ${rm}r $gentop
  3904. fi
  3905. exit $EXIT_SUCCESS
  3906. ;;
  3907. prog)
  3908. case $host in
  3909. *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  3910. esac
  3911. if test -n "$vinfo"; then
  3912. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  3913. fi
  3914. if test -n "$release"; then
  3915. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  3916. fi
  3917. if test "$preload" = yes; then
  3918. if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  3919. test "$dlopen_self_static" = unknown; then
  3920. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  3921. fi
  3922. fi
  3923. case $host in
  3924. *-*-rhapsody* | *-*-darwin1.[012])
  3925. # On Rhapsody replace the C library is the System framework
  3926. compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3927. finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3928. ;;
  3929. esac
  3930. case $host in
  3931. *darwin*)
  3932. # Don't allow lazy linking, it breaks C++ global constructors
  3933. if test "$tagname" = CXX ; then
  3934. compile_command="$compile_command ${wl}-bind_at_load"
  3935. finalize_command="$finalize_command ${wl}-bind_at_load"
  3936. fi
  3937. ;;
  3938. esac
  3939. compile_command="$compile_command $compile_deplibs"
  3940. finalize_command="$finalize_command $finalize_deplibs"
  3941. if test -n "$rpath$xrpath"; then
  3942. # If the user specified any rpath flags, then add them.
  3943. for libdir in $rpath $xrpath; do
  3944. # This is the magic to use -rpath.
  3945. case "$finalize_rpath " in
  3946. *" $libdir "*) ;;
  3947. *) finalize_rpath="$finalize_rpath $libdir" ;;
  3948. esac
  3949. done
  3950. fi
  3951. # Now hardcode the library paths
  3952. rpath=
  3953. hardcode_libdirs=
  3954. for libdir in $compile_rpath $finalize_rpath; do
  3955. if test -n "$hardcode_libdir_flag_spec"; then
  3956. if test -n "$hardcode_libdir_separator"; then
  3957. if test -z "$hardcode_libdirs"; then
  3958. hardcode_libdirs="$libdir"
  3959. else
  3960. # Just accumulate the unique libdirs.
  3961. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3962. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3963. ;;
  3964. *)
  3965. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3966. ;;
  3967. esac
  3968. fi
  3969. else
  3970. eval flag=\"$hardcode_libdir_flag_spec\"
  3971. rpath="$rpath $flag"
  3972. fi
  3973. elif test -n "$runpath_var"; then
  3974. case "$perm_rpath " in
  3975. *" $libdir "*) ;;
  3976. *) perm_rpath="$perm_rpath $libdir" ;;
  3977. esac
  3978. fi
  3979. case $host in
  3980. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  3981. case :$dllsearchpath: in
  3982. *":$libdir:"*) ;;
  3983. *) dllsearchpath="$dllsearchpath:$libdir";;
  3984. esac
  3985. ;;
  3986. esac
  3987. done
  3988. # Substitute the hardcoded libdirs into the rpath.
  3989. if test -n "$hardcode_libdir_separator" &&
  3990. test -n "$hardcode_libdirs"; then
  3991. libdir="$hardcode_libdirs"
  3992. eval rpath=\" $hardcode_libdir_flag_spec\"
  3993. fi
  3994. compile_rpath="$rpath"
  3995. rpath=
  3996. hardcode_libdirs=
  3997. for libdir in $finalize_rpath; do
  3998. if test -n "$hardcode_libdir_flag_spec"; then
  3999. if test -n "$hardcode_libdir_separator"; then
  4000. if test -z "$hardcode_libdirs"; then
  4001. hardcode_libdirs="$libdir"
  4002. else
  4003. # Just accumulate the unique libdirs.
  4004. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  4005. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  4006. ;;
  4007. *)
  4008. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  4009. ;;
  4010. esac
  4011. fi
  4012. else
  4013. eval flag=\"$hardcode_libdir_flag_spec\"
  4014. rpath="$rpath $flag"
  4015. fi
  4016. elif test -n "$runpath_var"; then
  4017. case "$finalize_perm_rpath " in
  4018. *" $libdir "*) ;;
  4019. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  4020. esac
  4021. fi
  4022. done
  4023. # Substitute the hardcoded libdirs into the rpath.
  4024. if test -n "$hardcode_libdir_separator" &&
  4025. test -n "$hardcode_libdirs"; then
  4026. libdir="$hardcode_libdirs"
  4027. eval rpath=\" $hardcode_libdir_flag_spec\"
  4028. fi
  4029. finalize_rpath="$rpath"
  4030. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  4031. # Transform all the library objects into standard objects.
  4032. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4033. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4034. fi
  4035. dlsyms=
  4036. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  4037. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4038. dlsyms="${outputname}S.c"
  4039. else
  4040. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  4041. fi
  4042. fi
  4043. if test -n "$dlsyms"; then
  4044. case $dlsyms in
  4045. "") ;;
  4046. *.c)
  4047. # Discover the nlist of each of the dlfiles.
  4048. nlist="$output_objdir/${outputname}.nm"
  4049. $show "$rm $nlist ${nlist}S ${nlist}T"
  4050. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  4051. # Parse the name list into a source file.
  4052. $show "creating $output_objdir/$dlsyms"
  4053. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  4054. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  4055. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  4056. #ifdef __cplusplus
  4057. extern \"C\" {
  4058. #endif
  4059. /* Prevent the only kind of declaration conflicts we can make. */
  4060. #define lt_preloaded_symbols some_other_symbol
  4061. /* External symbol declarations for the compiler. */\
  4062. "
  4063. if test "$dlself" = yes; then
  4064. $show "generating symbol list for \`$output'"
  4065. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  4066. # Add our own program objects to the symbol list.
  4067. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4068. for arg in $progfiles; do
  4069. $show "extracting global C symbols from \`$arg'"
  4070. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4071. done
  4072. if test -n "$exclude_expsyms"; then
  4073. $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4074. $run eval '$mv "$nlist"T "$nlist"'
  4075. fi
  4076. if test -n "$export_symbols_regex"; then
  4077. $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4078. $run eval '$mv "$nlist"T "$nlist"'
  4079. fi
  4080. # Prepare the list of exported symbols
  4081. if test -z "$export_symbols"; then
  4082. export_symbols="$output_objdir/$outputname.exp"
  4083. $run $rm $export_symbols
  4084. $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4085. else
  4086. $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4087. $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4088. $run eval 'mv "$nlist"T "$nlist"'
  4089. fi
  4090. fi
  4091. for arg in $dlprefiles; do
  4092. $show "extracting global C symbols from \`$arg'"
  4093. name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
  4094. $run eval '$echo ": $name " >> "$nlist"'
  4095. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4096. done
  4097. if test -z "$run"; then
  4098. # Make sure we have at least an empty file.
  4099. test -f "$nlist" || : > "$nlist"
  4100. if test -n "$exclude_expsyms"; then
  4101. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4102. $mv "$nlist"T "$nlist"
  4103. fi
  4104. # Try sorting and uniquifying the output.
  4105. if grep -v "^: " < "$nlist" |
  4106. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4107. sort -k 3
  4108. else
  4109. sort +2
  4110. fi |
  4111. uniq > "$nlist"S; then
  4112. :
  4113. else
  4114. grep -v "^: " < "$nlist" > "$nlist"S
  4115. fi
  4116. if test -f "$nlist"S; then
  4117. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  4118. else
  4119. $echo '/* NONE */' >> "$output_objdir/$dlsyms"
  4120. fi
  4121. $echo >> "$output_objdir/$dlsyms" "\
  4122. #undef lt_preloaded_symbols
  4123. #if defined (__STDC__) && __STDC__
  4124. # define lt_ptr void *
  4125. #else
  4126. # define lt_ptr char *
  4127. # define const
  4128. #endif
  4129. /* The mapping between symbol names and symbols. */
  4130. "
  4131. case $host in
  4132. *cygwin* | *mingw* )
  4133. $echo >> "$output_objdir/$dlsyms" "\
  4134. /* DATA imports from DLLs on WIN32 can't be const, because
  4135. runtime relocations are performed -- see ld's documentation
  4136. on pseudo-relocs */
  4137. struct {
  4138. "
  4139. ;;
  4140. * )
  4141. $echo >> "$output_objdir/$dlsyms" "\
  4142. const struct {
  4143. "
  4144. ;;
  4145. esac
  4146. $echo >> "$output_objdir/$dlsyms" "\
  4147. const char *name;
  4148. lt_ptr address;
  4149. }
  4150. lt_preloaded_symbols[] =
  4151. {\
  4152. "
  4153. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  4154. $echo >> "$output_objdir/$dlsyms" "\
  4155. {0, (lt_ptr) 0}
  4156. };
  4157. /* This works around a problem in FreeBSD linker */
  4158. #ifdef FREEBSD_WORKAROUND
  4159. static const void *lt_preloaded_setup() {
  4160. return lt_preloaded_symbols;
  4161. }
  4162. #endif
  4163. #ifdef __cplusplus
  4164. }
  4165. #endif\
  4166. "
  4167. fi
  4168. pic_flag_for_symtable=
  4169. case $host in
  4170. # compiling the symbol table file with pic_flag works around
  4171. # a FreeBSD bug that causes programs to crash when -lm is
  4172. # linked before any other PIC object. But we must not use
  4173. # pic_flag when linking with -static. The problem exists in
  4174. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4175. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4176. case "$compile_command " in
  4177. *" -static "*) ;;
  4178. *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  4179. esac;;
  4180. *-*-hpux*)
  4181. case "$compile_command " in
  4182. *" -static "*) ;;
  4183. *) pic_flag_for_symtable=" $pic_flag";;
  4184. esac
  4185. esac
  4186. # Now compile the dynamic symbol file.
  4187. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  4188. $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  4189. # Clean up the generated files.
  4190. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  4191. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  4192. # Transform the symbol file into the correct name.
  4193. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4194. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4195. ;;
  4196. *)
  4197. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  4198. exit $EXIT_FAILURE
  4199. ;;
  4200. esac
  4201. else
  4202. # We keep going just in case the user didn't refer to
  4203. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4204. # really was required.
  4205. # Nullify the symbol file.
  4206. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  4207. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  4208. fi
  4209. if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  4210. # Replace the output file specification.
  4211. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4212. link_command="$compile_command$compile_rpath"
  4213. # We have no uninstalled library dependencies, so finalize right now.
  4214. $show "$link_command"
  4215. $run eval "$link_command"
  4216. status=$?
  4217. # Delete the generated files.
  4218. if test -n "$dlsyms"; then
  4219. $show "$rm $output_objdir/${outputname}S.${objext}"
  4220. $run $rm "$output_objdir/${outputname}S.${objext}"
  4221. fi
  4222. exit $status
  4223. fi
  4224. if test -n "$shlibpath_var"; then
  4225. # We should set the shlibpath_var
  4226. rpath=
  4227. for dir in $temp_rpath; do
  4228. case $dir in
  4229. [\\/]* | [A-Za-z]:[\\/]*)
  4230. # Absolute path.
  4231. rpath="$rpath$dir:"
  4232. ;;
  4233. *)
  4234. # Relative path: add a thisdir entry.
  4235. rpath="$rpath\$thisdir/$dir:"
  4236. ;;
  4237. esac
  4238. done
  4239. temp_rpath="$rpath"
  4240. fi
  4241. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  4242. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  4243. fi
  4244. if test -n "$finalize_shlibpath"; then
  4245. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  4246. fi
  4247. compile_var=
  4248. finalize_var=
  4249. if test -n "$runpath_var"; then
  4250. if test -n "$perm_rpath"; then
  4251. # We should set the runpath_var.
  4252. rpath=
  4253. for dir in $perm_rpath; do
  4254. rpath="$rpath$dir:"
  4255. done
  4256. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4257. fi
  4258. if test -n "$finalize_perm_rpath"; then
  4259. # We should set the runpath_var.
  4260. rpath=
  4261. for dir in $finalize_perm_rpath; do
  4262. rpath="$rpath$dir:"
  4263. done
  4264. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4265. fi
  4266. fi
  4267. if test "$no_install" = yes; then
  4268. # We don't need to create a wrapper script.
  4269. link_command="$compile_var$compile_command$compile_rpath"
  4270. # Replace the output file specification.
  4271. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4272. # Delete the old output file.
  4273. $run $rm $output
  4274. # Link the executable and exit
  4275. $show "$link_command"
  4276. $run eval "$link_command" || exit $?
  4277. exit $EXIT_SUCCESS
  4278. fi
  4279. if test "$hardcode_action" = relink; then
  4280. # Fast installation is not supported
  4281. link_command="$compile_var$compile_command$compile_rpath"
  4282. relink_command="$finalize_var$finalize_command$finalize_rpath"
  4283. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  4284. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  4285. else
  4286. if test "$fast_install" != no; then
  4287. link_command="$finalize_var$compile_command$finalize_rpath"
  4288. if test "$fast_install" = yes; then
  4289. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  4290. else
  4291. # fast_install is set to needless
  4292. relink_command=
  4293. fi
  4294. else
  4295. link_command="$compile_var$compile_command$compile_rpath"
  4296. relink_command="$finalize_var$finalize_command$finalize_rpath"
  4297. fi
  4298. fi
  4299. # Replace the output file specification.
  4300. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  4301. # Delete the old output files.
  4302. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  4303. $show "$link_command"
  4304. $run eval "$link_command" || exit $?
  4305. # Now create the wrapper script.
  4306. $show "creating $output"
  4307. # Quote the relink command for shipping.
  4308. if test -n "$relink_command"; then
  4309. # Preserve any variables that may affect compiler behavior
  4310. for var in $variables_saved_for_relink; do
  4311. if eval test -z \"\${$var+set}\"; then
  4312. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  4313. elif eval var_value=\$$var; test -z "$var_value"; then
  4314. relink_command="$var=; export $var; $relink_command"
  4315. else
  4316. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  4317. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  4318. fi
  4319. done
  4320. relink_command="(cd `pwd`; $relink_command)"
  4321. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4322. fi
  4323. # Quote $echo for shipping.
  4324. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  4325. case $progpath in
  4326. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  4327. *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  4328. esac
  4329. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  4330. else
  4331. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  4332. fi
  4333. # Only actually do things if our run command is non-null.
  4334. if test -z "$run"; then
  4335. # win32 will think the script is a binary if it has
  4336. # a .exe suffix, so we strip it off here.
  4337. case $output in
  4338. *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
  4339. esac
  4340. # test for cygwin because mv fails w/o .exe extensions
  4341. case $host in
  4342. *cygwin*)
  4343. exeext=.exe
  4344. outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
  4345. *) exeext= ;;
  4346. esac
  4347. case $host in
  4348. *cygwin* | *mingw* )
  4349. cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
  4350. cwrapper=`$echo ${output}.exe`
  4351. $rm $cwrappersource $cwrapper
  4352. trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  4353. cat > $cwrappersource <<EOF
  4354. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  4355. Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4356. The $output program cannot be directly executed until all the libtool
  4357. libraries that it depends on are installed.
  4358. This wrapper executable should never be moved out of the build directory.
  4359. If it is, it will not operate correctly.
  4360. Currently, it simply execs the wrapper *script* "/bin/sh $output",
  4361. but could eventually absorb all of the scripts functionality and
  4362. exec $objdir/$outputname directly.
  4363. */
  4364. EOF
  4365. cat >> $cwrappersource<<"EOF"
  4366. #include <stdio.h>
  4367. #include <stdlib.h>
  4368. #include <unistd.h>
  4369. #include <malloc.h>
  4370. #include <stdarg.h>
  4371. #include <assert.h>
  4372. #if defined(PATH_MAX)
  4373. # define LT_PATHMAX PATH_MAX
  4374. #elif defined(MAXPATHLEN)
  4375. # define LT_PATHMAX MAXPATHLEN
  4376. #else
  4377. # define LT_PATHMAX 1024
  4378. #endif
  4379. #ifndef DIR_SEPARATOR
  4380. #define DIR_SEPARATOR '/'
  4381. #endif
  4382. #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  4383. defined (__OS2__)
  4384. #define HAVE_DOS_BASED_FILE_SYSTEM
  4385. #ifndef DIR_SEPARATOR_2
  4386. #define DIR_SEPARATOR_2 '\\'
  4387. #endif
  4388. #endif
  4389. #ifndef DIR_SEPARATOR_2
  4390. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  4391. #else /* DIR_SEPARATOR_2 */
  4392. # define IS_DIR_SEPARATOR(ch) \
  4393. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  4394. #endif /* DIR_SEPARATOR_2 */
  4395. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  4396. #define XFREE(stale) do { \
  4397. if (stale) { free ((void *) stale); stale = 0; } \
  4398. } while (0)
  4399. const char *program_name = NULL;
  4400. void * xmalloc (size_t num);
  4401. char * xstrdup (const char *string);
  4402. char * basename (const char *name);
  4403. char * fnqualify(const char *path);
  4404. char * strendzap(char *str, const char *pat);
  4405. void lt_fatal (const char *message, ...);
  4406. int
  4407. main (int argc, char *argv[])
  4408. {
  4409. char **newargz;
  4410. int i;
  4411. program_name = (char *) xstrdup ((char *) basename (argv[0]));
  4412. newargz = XMALLOC(char *, argc+2);
  4413. EOF
  4414. cat >> $cwrappersource <<EOF
  4415. newargz[0] = "$SHELL";
  4416. EOF
  4417. cat >> $cwrappersource <<"EOF"
  4418. newargz[1] = fnqualify(argv[0]);
  4419. /* we know the script has the same name, without the .exe */
  4420. /* so make sure newargz[1] doesn't end in .exe */
  4421. strendzap(newargz[1],".exe");
  4422. for (i = 1; i < argc; i++)
  4423. newargz[i+1] = xstrdup(argv[i]);
  4424. newargz[argc+1] = NULL;
  4425. EOF
  4426. cat >> $cwrappersource <<EOF
  4427. execv("$SHELL",newargz);
  4428. EOF
  4429. cat >> $cwrappersource <<"EOF"
  4430. }
  4431. void *
  4432. xmalloc (size_t num)
  4433. {
  4434. void * p = (void *) malloc (num);
  4435. if (!p)
  4436. lt_fatal ("Memory exhausted");
  4437. return p;
  4438. }
  4439. char *
  4440. xstrdup (const char *string)
  4441. {
  4442. return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  4443. ;
  4444. }
  4445. char *
  4446. basename (const char *name)
  4447. {
  4448. const char *base;
  4449. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4450. /* Skip over the disk name in MSDOS pathnames. */
  4451. if (isalpha (name[0]) && name[1] == ':')
  4452. name += 2;
  4453. #endif
  4454. for (base = name; *name; name++)
  4455. if (IS_DIR_SEPARATOR (*name))
  4456. base = name + 1;
  4457. return (char *) base;
  4458. }
  4459. char *
  4460. fnqualify(const char *path)
  4461. {
  4462. size_t size;
  4463. char *p;
  4464. char tmp[LT_PATHMAX + 1];
  4465. assert(path != NULL);
  4466. /* Is it qualified already? */
  4467. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4468. if (isalpha (path[0]) && path[1] == ':')
  4469. return xstrdup (path);
  4470. #endif
  4471. if (IS_DIR_SEPARATOR (path[0]))
  4472. return xstrdup (path);
  4473. /* prepend the current directory */
  4474. /* doesn't handle '~' */
  4475. if (getcwd (tmp, LT_PATHMAX) == NULL)
  4476. lt_fatal ("getcwd failed");
  4477. size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
  4478. p = XMALLOC(char, size);
  4479. sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
  4480. return p;
  4481. }
  4482. char *
  4483. strendzap(char *str, const char *pat)
  4484. {
  4485. size_t len, patlen;
  4486. assert(str != NULL);
  4487. assert(pat != NULL);
  4488. len = strlen(str);
  4489. patlen = strlen(pat);
  4490. if (patlen <= len)
  4491. {
  4492. str += len - patlen;
  4493. if (strcmp(str, pat) == 0)
  4494. *str = '\0';
  4495. }
  4496. return str;
  4497. }
  4498. static void
  4499. lt_error_core (int exit_status, const char * mode,
  4500. const char * message, va_list ap)
  4501. {
  4502. fprintf (stderr, "%s: %s: ", program_name, mode);
  4503. vfprintf (stderr, message, ap);
  4504. fprintf (stderr, ".\n");
  4505. if (exit_status >= 0)
  4506. exit (exit_status);
  4507. }
  4508. void
  4509. lt_fatal (const char *message, ...)
  4510. {
  4511. va_list ap;
  4512. va_start (ap, message);
  4513. lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  4514. va_end (ap);
  4515. }
  4516. EOF
  4517. # we should really use a build-platform specific compiler
  4518. # here, but OTOH, the wrappers (shell script and this C one)
  4519. # are only useful if you want to execute the "real" binary.
  4520. # Since the "real" binary is built for $host, then this
  4521. # wrapper might as well be built for $host, too.
  4522. $run $LTCC -s -o $cwrapper $cwrappersource
  4523. ;;
  4524. esac
  4525. $rm $output
  4526. trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  4527. $echo > $output "\
  4528. #! $SHELL
  4529. # $output - temporary wrapper script for $objdir/$outputname
  4530. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4531. #
  4532. # The $output program cannot be directly executed until all the libtool
  4533. # libraries that it depends on are installed.
  4534. #
  4535. # This wrapper script should never be moved out of the build directory.
  4536. # If it is, it will not operate correctly.
  4537. # Sed substitution that helps us do robust quoting. It backslashifies
  4538. # metacharacters that are still active within double-quoted strings.
  4539. Xsed='${SED} -e 1s/^X//'
  4540. sed_quote_subst='$sed_quote_subst'
  4541. # The HP-UX ksh and POSIX shell print the target directory to stdout
  4542. # if CDPATH is set.
  4543. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  4544. relink_command=\"$relink_command\"
  4545. # This environment variable determines our operation mode.
  4546. if test \"\$libtool_install_magic\" = \"$magic\"; then
  4547. # install mode needs the following variable:
  4548. notinst_deplibs='$notinst_deplibs'
  4549. else
  4550. # When we are sourced in execute mode, \$file and \$echo are already set.
  4551. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4552. echo=\"$qecho\"
  4553. file=\"\$0\"
  4554. # Make sure echo works.
  4555. if test \"X\$1\" = X--no-reexec; then
  4556. # Discard the --no-reexec flag, and continue.
  4557. shift
  4558. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  4559. # Yippee, \$echo works!
  4560. :
  4561. else
  4562. # Restart under the correct shell, and then maybe \$echo will work.
  4563. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  4564. fi
  4565. fi\
  4566. "
  4567. $echo >> $output "\
  4568. # Find the directory that this script lives in.
  4569. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  4570. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  4571. # Follow symbolic links until we get to the real thisdir.
  4572. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  4573. while test -n \"\$file\"; do
  4574. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  4575. # If there was a directory component, then change thisdir.
  4576. if test \"x\$destdir\" != \"x\$file\"; then
  4577. case \"\$destdir\" in
  4578. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  4579. *) thisdir=\"\$thisdir/\$destdir\" ;;
  4580. esac
  4581. fi
  4582. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  4583. file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  4584. done
  4585. # Try to get the absolute directory name.
  4586. absdir=\`cd \"\$thisdir\" && pwd\`
  4587. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  4588. "
  4589. if test "$fast_install" = yes; then
  4590. $echo >> $output "\
  4591. program=lt-'$outputname'$exeext
  4592. progdir=\"\$thisdir/$objdir\"
  4593. if test ! -f \"\$progdir/\$program\" || \\
  4594. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  4595. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  4596. file=\"\$\$-\$program\"
  4597. if test ! -d \"\$progdir\"; then
  4598. $mkdir \"\$progdir\"
  4599. else
  4600. $rm \"\$progdir/\$file\"
  4601. fi"
  4602. $echo >> $output "\
  4603. # relink executable if necessary
  4604. if test -n \"\$relink_command\"; then
  4605. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  4606. else
  4607. $echo \"\$relink_command_output\" >&2
  4608. $rm \"\$progdir/\$file\"
  4609. exit $EXIT_FAILURE
  4610. fi
  4611. fi
  4612. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  4613. { $rm \"\$progdir/\$program\";
  4614. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  4615. $rm \"\$progdir/\$file\"
  4616. fi"
  4617. else
  4618. $echo >> $output "\
  4619. program='$outputname'
  4620. progdir=\"\$thisdir/$objdir\"
  4621. "
  4622. fi
  4623. $echo >> $output "\
  4624. if test -f \"\$progdir/\$program\"; then"
  4625. # Export our shlibpath_var if we have one.
  4626. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  4627. $echo >> $output "\
  4628. # Add our own library path to $shlibpath_var
  4629. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  4630. # Some systems cannot cope with colon-terminated $shlibpath_var
  4631. # The second colon is a workaround for a bug in BeOS R4 sed
  4632. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  4633. export $shlibpath_var
  4634. "
  4635. fi
  4636. # fixup the dll searchpath if we need to.
  4637. if test -n "$dllsearchpath"; then
  4638. $echo >> $output "\
  4639. # Add the dll search path components to the executable PATH
  4640. PATH=$dllsearchpath:\$PATH
  4641. "
  4642. fi
  4643. $echo >> $output "\
  4644. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4645. # Run the actual program with our arguments.
  4646. "
  4647. case $host in
  4648. # Backslashes separate directories on plain windows
  4649. *-*-mingw | *-*-os2*)
  4650. $echo >> $output "\
  4651. exec \$progdir\\\\\$program \${1+\"\$@\"}
  4652. "
  4653. ;;
  4654. *)
  4655. $echo >> $output "\
  4656. exec \$progdir/\$program \${1+\"\$@\"}
  4657. "
  4658. ;;
  4659. esac
  4660. $echo >> $output "\
  4661. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  4662. exit $EXIT_FAILURE
  4663. fi
  4664. else
  4665. # The program doesn't exist.
  4666. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  4667. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  4668. $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  4669. exit $EXIT_FAILURE
  4670. fi
  4671. fi\
  4672. "
  4673. chmod +x $output
  4674. fi
  4675. exit $EXIT_SUCCESS
  4676. ;;
  4677. esac
  4678. # See if we need to build an old-fashioned archive.
  4679. for oldlib in $oldlibs; do
  4680. if test "$build_libtool_libs" = convenience; then
  4681. oldobjs="$libobjs_save"
  4682. addlibs="$convenience"
  4683. build_libtool_libs=no
  4684. else
  4685. if test "$build_libtool_libs" = module; then
  4686. oldobjs="$libobjs_save"
  4687. build_libtool_libs=no
  4688. else
  4689. oldobjs="$old_deplibs $non_pic_objects"
  4690. fi
  4691. addlibs="$old_convenience"
  4692. fi
  4693. if test -n "$addlibs"; then
  4694. gentop="$output_objdir/${outputname}x"
  4695. generated="$generated $gentop"
  4696. func_extract_archives $gentop $addlibs
  4697. oldobjs="$oldobjs $func_extract_archives_result"
  4698. fi
  4699. # Do each command in the archive commands.
  4700. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  4701. cmds=$old_archive_from_new_cmds
  4702. else
  4703. # POSIX demands no paths to be encoded in archives. We have
  4704. # to avoid creating archives with duplicate basenames if we
  4705. # might have to extract them afterwards, e.g., when creating a
  4706. # static archive out of a convenience library, or when linking
  4707. # the entirety of a libtool archive into another (currently
  4708. # not supported by libtool).
  4709. if (for obj in $oldobjs
  4710. do
  4711. $echo "X$obj" | $Xsed -e 's%^.*/%%'
  4712. done | sort | sort -uc >/dev/null 2>&1); then
  4713. :
  4714. else
  4715. $echo "copying selected object files to avoid basename conflicts..."
  4716. if test -z "$gentop"; then
  4717. gentop="$output_objdir/${outputname}x"
  4718. generated="$generated $gentop"
  4719. $show "${rm}r $gentop"
  4720. $run ${rm}r "$gentop"
  4721. $show "$mkdir $gentop"
  4722. $run $mkdir "$gentop"
  4723. status=$?
  4724. if test "$status" -ne 0 && test ! -d "$gentop"; then
  4725. exit $status
  4726. fi
  4727. fi
  4728. save_oldobjs=$oldobjs
  4729. oldobjs=
  4730. counter=1
  4731. for obj in $save_oldobjs
  4732. do
  4733. objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  4734. case " $oldobjs " in
  4735. " ") oldobjs=$obj ;;
  4736. *[\ /]"$objbase "*)
  4737. while :; do
  4738. # Make sure we don't pick an alternate name that also
  4739. # overlaps.
  4740. newobj=lt$counter-$objbase
  4741. counter=`expr $counter + 1`
  4742. case " $oldobjs " in
  4743. *[\ /]"$newobj "*) ;;
  4744. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  4745. esac
  4746. done
  4747. $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  4748. $run ln "$obj" "$gentop/$newobj" ||
  4749. $run cp "$obj" "$gentop/$newobj"
  4750. oldobjs="$oldobjs $gentop/$newobj"
  4751. ;;
  4752. *) oldobjs="$oldobjs $obj" ;;
  4753. esac
  4754. done
  4755. fi
  4756. eval cmds=\"$old_archive_cmds\"
  4757. if len=`expr "X$cmds" : ".*"` &&
  4758. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  4759. cmds=$old_archive_cmds
  4760. else
  4761. # the command line is too long to link in one step, link in parts
  4762. $echo "using piecewise archive linking..."
  4763. save_RANLIB=$RANLIB
  4764. RANLIB=:
  4765. objlist=
  4766. concat_cmds=
  4767. save_oldobjs=$oldobjs
  4768. # Is there a better way of finding the last object in the list?
  4769. for obj in $save_oldobjs
  4770. do
  4771. last_oldobj=$obj
  4772. done
  4773. for obj in $save_oldobjs
  4774. do
  4775. oldobjs="$objlist $obj"
  4776. objlist="$objlist $obj"
  4777. eval test_cmds=\"$old_archive_cmds\"
  4778. if len=`expr "X$test_cmds" : ".*"` &&
  4779. test "$len" -le "$max_cmd_len"; then
  4780. :
  4781. else
  4782. # the above command should be used before it gets too long
  4783. oldobjs=$objlist
  4784. if test "$obj" = "$last_oldobj" ; then
  4785. RANLIB=$save_RANLIB
  4786. fi
  4787. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  4788. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  4789. objlist=
  4790. fi
  4791. done
  4792. RANLIB=$save_RANLIB
  4793. oldobjs=$objlist
  4794. if test "X$oldobjs" = "X" ; then
  4795. eval cmds=\"\$concat_cmds\"
  4796. else
  4797. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  4798. fi
  4799. fi
  4800. fi
  4801. save_ifs="$IFS"; IFS='~'
  4802. for cmd in $cmds; do
  4803. eval cmd=\"$cmd\"
  4804. IFS="$save_ifs"
  4805. $show "$cmd"
  4806. $run eval "$cmd" || exit $?
  4807. done
  4808. IFS="$save_ifs"
  4809. done
  4810. if test -n "$generated"; then
  4811. $show "${rm}r$generated"
  4812. $run ${rm}r$generated
  4813. fi
  4814. # Now create the libtool archive.
  4815. case $output in
  4816. *.la)
  4817. old_library=
  4818. test "$build_old_libs" = yes && old_library="$libname.$libext"
  4819. $show "creating $output"
  4820. # Preserve any variables that may affect compiler behavior
  4821. for var in $variables_saved_for_relink; do
  4822. if eval test -z \"\${$var+set}\"; then
  4823. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  4824. elif eval var_value=\$$var; test -z "$var_value"; then
  4825. relink_command="$var=; export $var; $relink_command"
  4826. else
  4827. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  4828. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  4829. fi
  4830. done
  4831. # Quote the link command for shipping.
  4832. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  4833. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4834. if test "$hardcode_automatic" = yes ; then
  4835. relink_command=
  4836. fi
  4837. # Only create the output if not a dry run.
  4838. if test -z "$run"; then
  4839. for installed in no yes; do
  4840. if test "$installed" = yes; then
  4841. if test -z "$install_libdir"; then
  4842. break
  4843. fi
  4844. output="$output_objdir/$outputname"i
  4845. # Replace all uninstalled libtool libraries with the installed ones
  4846. newdependency_libs=
  4847. for deplib in $dependency_libs; do
  4848. case $deplib in
  4849. *.la)
  4850. name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  4851. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  4852. if test -z "$libdir"; then
  4853. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  4854. exit $EXIT_FAILURE
  4855. fi
  4856. newdependency_libs="$newdependency_libs $libdir/$name"
  4857. ;;
  4858. *) newdependency_libs="$newdependency_libs $deplib" ;;
  4859. esac
  4860. done
  4861. dependency_libs="$newdependency_libs"
  4862. newdlfiles=
  4863. for lib in $dlfiles; do
  4864. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  4865. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  4866. if test -z "$libdir"; then
  4867. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4868. exit $EXIT_FAILURE
  4869. fi
  4870. newdlfiles="$newdlfiles $libdir/$name"
  4871. done
  4872. dlfiles="$newdlfiles"
  4873. newdlprefiles=
  4874. for lib in $dlprefiles; do
  4875. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  4876. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  4877. if test -z "$libdir"; then
  4878. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4879. exit $EXIT_FAILURE
  4880. fi
  4881. newdlprefiles="$newdlprefiles $libdir/$name"
  4882. done
  4883. dlprefiles="$newdlprefiles"
  4884. else
  4885. newdlfiles=
  4886. for lib in $dlfiles; do
  4887. case $lib in
  4888. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  4889. *) abs=`pwd`"/$lib" ;;
  4890. esac
  4891. newdlfiles="$newdlfiles $abs"
  4892. done
  4893. dlfiles="$newdlfiles"
  4894. newdlprefiles=
  4895. for lib in $dlprefiles; do
  4896. case $lib in
  4897. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  4898. *) abs=`pwd`"/$lib" ;;
  4899. esac
  4900. newdlprefiles="$newdlprefiles $abs"
  4901. done
  4902. dlprefiles="$newdlprefiles"
  4903. fi
  4904. $rm $output
  4905. # place dlname in correct position for cygwin
  4906. tdlname=$dlname
  4907. case $host,$output,$installed,$module,$dlname in
  4908. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  4909. esac
  4910. $echo > $output "\
  4911. # $outputname - a libtool library file
  4912. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4913. #
  4914. # Please DO NOT delete this file!
  4915. # It is necessary for linking the library.
  4916. # The name that we can dlopen(3).
  4917. dlname='$tdlname'
  4918. # Names of this library.
  4919. library_names='$library_names'
  4920. # The name of the static archive.
  4921. old_library='$old_library'
  4922. # Libraries that this one depends upon.
  4923. dependency_libs='$dependency_libs'
  4924. # Version information for $libname.
  4925. current=$current
  4926. age=$age
  4927. revision=$revision
  4928. # Is this an already installed library?
  4929. installed=$installed
  4930. # Should we warn about portability when linking against -modules?
  4931. shouldnotlink=$module
  4932. # Files to dlopen/dlpreopen
  4933. dlopen='$dlfiles'
  4934. dlpreopen='$dlprefiles'
  4935. # Directory that this library needs to be installed in:
  4936. libdir='$install_libdir'"
  4937. if test "$installed" = no && test "$need_relink" = yes; then
  4938. $echo >> $output "\
  4939. relink_command=\"$relink_command\""
  4940. fi
  4941. done
  4942. fi
  4943. # Do a symbolic link so that the libtool archive can be found in
  4944. # LD_LIBRARY_PATH before the program is installed.
  4945. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  4946. $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  4947. ;;
  4948. esac
  4949. exit $EXIT_SUCCESS
  4950. ;;
  4951. # libtool install mode
  4952. install)
  4953. modename="$modename: install"
  4954. # There may be an optional sh(1) argument at the beginning of
  4955. # install_prog (especially on Windows NT).
  4956. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  4957. # Allow the use of GNU shtool's install command.
  4958. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
  4959. # Aesthetically quote it.
  4960. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  4961. case $arg in
  4962. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  4963. arg="\"$arg\""
  4964. ;;
  4965. esac
  4966. install_prog="$arg "
  4967. arg="$1"
  4968. shift
  4969. else
  4970. install_prog=
  4971. arg="$nonopt"
  4972. fi
  4973. # The real first argument should be the name of the installation program.
  4974. # Aesthetically quote it.
  4975. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  4976. case $arg in
  4977. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  4978. arg="\"$arg\""
  4979. ;;
  4980. esac
  4981. install_prog="$install_prog$arg"
  4982. # We need to accept at least all the BSD install flags.
  4983. dest=
  4984. files=
  4985. opts=
  4986. prev=
  4987. install_type=
  4988. isdir=no
  4989. stripme=
  4990. for arg
  4991. do
  4992. if test -n "$dest"; then
  4993. files="$files $dest"
  4994. dest="$arg"
  4995. continue
  4996. fi
  4997. case $arg in
  4998. -d) isdir=yes ;;
  4999. -f) prev="-f" ;;
  5000. -g) prev="-g" ;;
  5001. -m) prev="-m" ;;
  5002. -o) prev="-o" ;;
  5003. -s)
  5004. stripme=" -s"
  5005. continue
  5006. ;;
  5007. -*) ;;
  5008. *)
  5009. # If the previous option needed an argument, then skip it.
  5010. if test -n "$prev"; then
  5011. prev=
  5012. else
  5013. dest="$arg"
  5014. continue
  5015. fi
  5016. ;;
  5017. esac
  5018. # Aesthetically quote the argument.
  5019. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5020. case $arg in
  5021. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "")
  5022. arg="\"$arg\""
  5023. ;;
  5024. esac
  5025. install_prog="$install_prog $arg"
  5026. done
  5027. if test -z "$install_prog"; then
  5028. $echo "$modename: you must specify an install program" 1>&2
  5029. $echo "$help" 1>&2
  5030. exit $EXIT_FAILURE
  5031. fi
  5032. if test -n "$prev"; then
  5033. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  5034. $echo "$help" 1>&2
  5035. exit $EXIT_FAILURE
  5036. fi
  5037. if test -z "$files"; then
  5038. if test -z "$dest"; then
  5039. $echo "$modename: no file or destination specified" 1>&2
  5040. else
  5041. $echo "$modename: you must specify a destination" 1>&2
  5042. fi
  5043. $echo "$help" 1>&2
  5044. exit $EXIT_FAILURE
  5045. fi
  5046. # Canonicalise the pathname:
  5047. # - remove foo/../
  5048. # - replace //
  5049. # - remove /./
  5050. # - strip any trailing /
  5051. tmp=""
  5052. while test "$dest" != "$tmp"; do
  5053. tmp=$dest
  5054. dest=`$echo "X$dest" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'`
  5055. done
  5056. # Check to see that the destination is a directory.
  5057. test -d "$dest" && isdir=yes
  5058. if test "$isdir" = yes; then
  5059. destdir="$dest"
  5060. destname=
  5061. else
  5062. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  5063. test "X$destdir" = "X$dest" && destdir=.
  5064. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  5065. # Not a directory, so check to see that there is only one file specified.
  5066. set dummy $files
  5067. if test "$#" -gt 2; then
  5068. $echo "$modename: \`$dest' is not a directory" 1>&2
  5069. $echo "$help" 1>&2
  5070. exit $EXIT_FAILURE
  5071. fi
  5072. fi
  5073. case $destdir in
  5074. [\\/]* | [A-Za-z]:[\\/]*) ;;
  5075. *)
  5076. for file in $files; do
  5077. case $file in
  5078. *.lo) ;;
  5079. *)
  5080. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  5081. $echo "$help" 1>&2
  5082. exit $EXIT_FAILURE
  5083. ;;
  5084. esac
  5085. done
  5086. ;;
  5087. esac
  5088. # This variable tells wrapper scripts just to set variables rather
  5089. # than running their programs.
  5090. libtool_install_magic="$magic"
  5091. staticlibs=
  5092. future_libdirs=
  5093. current_libdirs=
  5094. for file in $files; do
  5095. # Do each installation.
  5096. case $file in
  5097. *.$libext)
  5098. # Do the static libraries later.
  5099. staticlibs="$staticlibs $file"
  5100. ;;
  5101. *.la)
  5102. # Check to see that this really is a libtool archive.
  5103. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5104. else
  5105. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  5106. $echo "$help" 1>&2
  5107. exit $EXIT_FAILURE
  5108. fi
  5109. library_names=
  5110. old_library=
  5111. relink_command=
  5112. # If there is no directory component, then add one.
  5113. case $file in
  5114. */* | *\\*) . $file ;;
  5115. *) . ./$file ;;
  5116. esac
  5117. # Add the libdir to current_libdirs if it is the destination.
  5118. if test "X$destdir" = "X$libdir"; then
  5119. case "$current_libdirs " in
  5120. *" $libdir "*) ;;
  5121. *) current_libdirs="$current_libdirs $libdir" ;;
  5122. esac
  5123. else
  5124. # Note the libdir as a future libdir.
  5125. case "$future_libdirs " in
  5126. *" $libdir "*) ;;
  5127. *) future_libdirs="$future_libdirs $libdir" ;;
  5128. esac
  5129. fi
  5130. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  5131. test "X$dir" = "X$file/" && dir=
  5132. dir="$dir$objdir"
  5133. if test -n "$relink_command"; then
  5134. # Determine the prefix the user has applied to our future dir.
  5135. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
  5136. # Don't allow the user to place us outside of our expected
  5137. # location b/c this prevents finding dependent libraries that
  5138. # are installed to the same prefix.
  5139. # At present, this check doesn't affect windows .dll's that
  5140. # are installed into $libdir/../bin (currently, that works fine)
  5141. # but it's something to keep an eye on.
  5142. if test "$inst_prefix_dir" = "$destdir"; then
  5143. $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  5144. exit $EXIT_FAILURE
  5145. fi
  5146. if test -n "$inst_prefix_dir"; then
  5147. # Stick the inst_prefix_dir data into the link command.
  5148. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  5149. else
  5150. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  5151. fi
  5152. $echo "$modename: warning: relinking \`$file'" 1>&2
  5153. $show "$relink_command"
  5154. if $run eval "$relink_command"; then :
  5155. else
  5156. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5157. exit $EXIT_FAILURE
  5158. fi
  5159. fi
  5160. # See the names of the shared library.
  5161. set dummy $library_names
  5162. if test -n "$2"; then
  5163. realname="$2"
  5164. shift
  5165. shift
  5166. srcname="$realname"
  5167. test -n "$relink_command" && srcname="$realname"T
  5168. # Install the shared library and build the symlinks.
  5169. $show "$install_prog $dir/$srcname $destdir/$realname"
  5170. $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  5171. if test -n "$stripme" && test -n "$striplib"; then
  5172. $show "$striplib $destdir/$realname"
  5173. $run eval "$striplib $destdir/$realname" || exit $?
  5174. fi
  5175. if test "$#" -gt 0; then
  5176. # Delete the old symlinks, and create new ones.
  5177. for linkname
  5178. do
  5179. if test "$linkname" != "$realname"; then
  5180. $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  5181. $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  5182. fi
  5183. done
  5184. fi
  5185. # Do each command in the postinstall commands.
  5186. lib="$destdir/$realname"
  5187. cmds=$postinstall_cmds
  5188. save_ifs="$IFS"; IFS='~'
  5189. for cmd in $cmds; do
  5190. IFS="$save_ifs"
  5191. eval cmd=\"$cmd\"
  5192. $show "$cmd"
  5193. $run eval "$cmd" || exit $?
  5194. done
  5195. IFS="$save_ifs"
  5196. fi
  5197. # Install the pseudo-library for information purposes.
  5198. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5199. instname="$dir/$name"i
  5200. $show "$install_prog $instname $destdir/$name"
  5201. $run eval "$install_prog $instname $destdir/$name" || exit $?
  5202. # Maybe install the static library, too.
  5203. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  5204. ;;
  5205. *.lo)
  5206. # Install (i.e. copy) a libtool object.
  5207. # Figure out destination file name, if it wasn't already specified.
  5208. if test -n "$destname"; then
  5209. destfile="$destdir/$destname"
  5210. else
  5211. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5212. destfile="$destdir/$destfile"
  5213. fi
  5214. # Deduce the name of the destination old-style object file.
  5215. case $destfile in
  5216. *.lo)
  5217. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  5218. ;;
  5219. *.$objext)
  5220. staticdest="$destfile"
  5221. destfile=
  5222. ;;
  5223. *)
  5224. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  5225. $echo "$help" 1>&2
  5226. exit $EXIT_FAILURE
  5227. ;;
  5228. esac
  5229. # Install the libtool object if requested.
  5230. if test -n "$destfile"; then
  5231. $show "$install_prog $file $destfile"
  5232. $run eval "$install_prog $file $destfile" || exit $?
  5233. fi
  5234. # Install the old object if enabled.
  5235. if test "$build_old_libs" = yes; then
  5236. # Deduce the name of the old-style object file.
  5237. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  5238. $show "$install_prog $staticobj $staticdest"
  5239. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  5240. fi
  5241. exit $EXIT_SUCCESS
  5242. ;;
  5243. *)
  5244. # Figure out destination file name, if it wasn't already specified.
  5245. if test -n "$destname"; then
  5246. destfile="$destdir/$destname"
  5247. else
  5248. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5249. destfile="$destdir/$destfile"
  5250. fi
  5251. # If the file is missing, and there is a .exe on the end, strip it
  5252. # because it is most likely a libtool script we actually want to
  5253. # install
  5254. stripped_ext=""
  5255. case $file in
  5256. *.exe)
  5257. if test ! -f "$file"; then
  5258. file=`$echo $file|${SED} 's,.exe$,,'`
  5259. stripped_ext=".exe"
  5260. fi
  5261. ;;
  5262. esac
  5263. # Do a test to see if this is really a libtool program.
  5264. case $host in
  5265. *cygwin*|*mingw*)
  5266. wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
  5267. ;;
  5268. *)
  5269. wrapper=$file
  5270. ;;
  5271. esac
  5272. if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  5273. notinst_deplibs=
  5274. relink_command=
  5275. # To insure that "foo" is sourced, and not "foo.exe",
  5276. # finese the cygwin/MSYS system by explicitly sourcing "foo."
  5277. # which disallows the automatic-append-.exe behavior.
  5278. case $build in
  5279. *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
  5280. *) wrapperdot=${wrapper} ;;
  5281. esac
  5282. # If there is no directory component, then add one.
  5283. case $file in
  5284. */* | *\\*) . ${wrapperdot} ;;
  5285. *) . ./${wrapperdot} ;;
  5286. esac
  5287. # Check the variables that should have been set.
  5288. if test -z "$notinst_deplibs"; then
  5289. $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  5290. exit $EXIT_FAILURE
  5291. fi
  5292. finalize=yes
  5293. for lib in $notinst_deplibs; do
  5294. # Check to see that each library is installed.
  5295. libdir=
  5296. if test -f "$lib"; then
  5297. # If there is no directory component, then add one.
  5298. case $lib in
  5299. */* | *\\*) . $lib ;;
  5300. *) . ./$lib ;;
  5301. esac
  5302. fi
  5303. libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  5304. if test -n "$libdir" && test ! -f "$libfile"; then
  5305. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  5306. finalize=no
  5307. fi
  5308. done
  5309. relink_command=
  5310. # To insure that "foo" is sourced, and not "foo.exe",
  5311. # finese the cygwin/MSYS system by explicitly sourcing "foo."
  5312. # which disallows the automatic-append-.exe behavior.
  5313. case $build in
  5314. *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
  5315. *) wrapperdot=${wrapper} ;;
  5316. esac
  5317. # If there is no directory component, then add one.
  5318. case $file in
  5319. */* | *\\*) . ${wrapperdot} ;;
  5320. *) . ./${wrapperdot} ;;
  5321. esac
  5322. outputname=
  5323. if test "$fast_install" = no && test -n "$relink_command"; then
  5324. if test "$finalize" = yes && test -z "$run"; then
  5325. tmpdir="/tmp"
  5326. test -n "$TMPDIR" && tmpdir="$TMPDIR"
  5327. tmpdir="$tmpdir/libtool-$$"
  5328. save_umask=`umask`
  5329. umask 0077
  5330. if $mkdir "$tmpdir"; then
  5331. umask $save_umask
  5332. else
  5333. umask $save_umask
  5334. $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
  5335. continue
  5336. fi
  5337. file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  5338. outputname="$tmpdir/$file"
  5339. # Replace the output file specification.
  5340. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  5341. $show "$relink_command"
  5342. if $run eval "$relink_command"; then :
  5343. else
  5344. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5345. ${rm}r "$tmpdir"
  5346. continue
  5347. fi
  5348. file="$outputname"
  5349. else
  5350. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  5351. fi
  5352. else
  5353. # Install the binary that we compiled earlier.
  5354. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  5355. fi
  5356. fi
  5357. # remove .exe since cygwin /usr/bin/install will append another
  5358. # one anyways
  5359. case $install_prog,$host in
  5360. */usr/bin/install*,*cygwin*)
  5361. case $file:$destfile in
  5362. *.exe:*.exe)
  5363. # this is ok
  5364. ;;
  5365. *.exe:*)
  5366. destfile=$destfile.exe
  5367. ;;
  5368. *:*.exe)
  5369. destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
  5370. ;;
  5371. esac
  5372. ;;
  5373. esac
  5374. $show "$install_prog$stripme $file $destfile"
  5375. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  5376. test -n "$outputname" && ${rm}r "$tmpdir"
  5377. ;;
  5378. esac
  5379. done
  5380. for file in $staticlibs; do
  5381. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5382. # Set up the ranlib parameters.
  5383. oldlib="$destdir/$name"
  5384. $show "$install_prog $file $oldlib"
  5385. $run eval "$install_prog \$file \$oldlib" || exit $?
  5386. if test -n "$stripme" && test -n "$old_striplib"; then
  5387. $show "$old_striplib $oldlib"
  5388. $run eval "$old_striplib $oldlib" || exit $?
  5389. fi
  5390. # Do each command in the postinstall commands.
  5391. cmds=$old_postinstall_cmds
  5392. save_ifs="$IFS"; IFS='~'
  5393. for cmd in $cmds; do
  5394. IFS="$save_ifs"
  5395. eval cmd=\"$cmd\"
  5396. $show "$cmd"
  5397. $run eval "$cmd" || exit $?
  5398. done
  5399. IFS="$save_ifs"
  5400. done
  5401. if test -n "$future_libdirs"; then
  5402. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  5403. fi
  5404. if test -n "$current_libdirs"; then
  5405. # Maybe just do a dry run.
  5406. test -n "$run" && current_libdirs=" -n$current_libdirs"
  5407. exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  5408. else
  5409. exit $EXIT_SUCCESS
  5410. fi
  5411. ;;
  5412. # libtool finish mode
  5413. finish)
  5414. modename="$modename: finish"
  5415. libdirs="$nonopt"
  5416. admincmds=
  5417. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  5418. for dir
  5419. do
  5420. libdirs="$libdirs $dir"
  5421. done
  5422. for libdir in $libdirs; do
  5423. if test -n "$finish_cmds"; then
  5424. # Do each command in the finish commands.
  5425. cmds=$finish_cmds
  5426. save_ifs="$IFS"; IFS='~'
  5427. for cmd in $cmds; do
  5428. IFS="$save_ifs"
  5429. eval cmd=\"$cmd\"
  5430. $show "$cmd"
  5431. $run eval "$cmd" || admincmds="$admincmds
  5432. $cmd"
  5433. done
  5434. IFS="$save_ifs"
  5435. fi
  5436. if test -n "$finish_eval"; then
  5437. # Do the single finish_eval.
  5438. eval cmds=\"$finish_eval\"
  5439. $run eval "$cmds" || admincmds="$admincmds
  5440. $cmds"
  5441. fi
  5442. done
  5443. fi
  5444. # Exit here if they wanted silent mode.
  5445. test "$show" = : && exit $EXIT_SUCCESS
  5446. $echo "----------------------------------------------------------------------"
  5447. $echo "Libraries have been installed in:"
  5448. for libdir in $libdirs; do
  5449. $echo " $libdir"
  5450. done
  5451. $echo
  5452. $echo "If you ever happen to want to link against installed libraries"
  5453. $echo "in a given directory, LIBDIR, you must either use libtool, and"
  5454. $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  5455. $echo "flag during linking and do at least one of the following:"
  5456. if test -n "$shlibpath_var"; then
  5457. $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  5458. $echo " during execution"
  5459. fi
  5460. if test -n "$runpath_var"; then
  5461. $echo " - add LIBDIR to the \`$runpath_var' environment variable"
  5462. $echo " during linking"
  5463. fi
  5464. if test -n "$hardcode_libdir_flag_spec"; then
  5465. libdir=LIBDIR
  5466. eval flag=\"$hardcode_libdir_flag_spec\"
  5467. $echo " - use the \`$flag' linker flag"
  5468. fi
  5469. if test -n "$admincmds"; then
  5470. $echo " - have your system administrator run these commands:$admincmds"
  5471. fi
  5472. if test -f /etc/ld.so.conf; then
  5473. $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  5474. fi
  5475. $echo
  5476. $echo "See any operating system documentation about shared libraries for"
  5477. $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  5478. $echo "----------------------------------------------------------------------"
  5479. exit $EXIT_SUCCESS
  5480. ;;
  5481. # libtool execute mode
  5482. execute)
  5483. modename="$modename: execute"
  5484. # The first argument is the command name.
  5485. cmd="$nonopt"
  5486. if test -z "$cmd"; then
  5487. $echo "$modename: you must specify a COMMAND" 1>&2
  5488. $echo "$help"
  5489. exit $EXIT_FAILURE
  5490. fi
  5491. # Handle -dlopen flags immediately.
  5492. for file in $execute_dlfiles; do
  5493. if test ! -f "$file"; then
  5494. $echo "$modename: \`$file' is not a file" 1>&2
  5495. $echo "$help" 1>&2
  5496. exit $EXIT_FAILURE
  5497. fi
  5498. dir=
  5499. case $file in
  5500. *.la)
  5501. # Check to see that this really is a libtool archive.
  5502. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5503. else
  5504. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5505. $echo "$help" 1>&2
  5506. exit $EXIT_FAILURE
  5507. fi
  5508. # Read the libtool library.
  5509. dlname=
  5510. library_names=
  5511. # If there is no directory component, then add one.
  5512. case $file in
  5513. */* | *\\*) . $file ;;
  5514. *) . ./$file ;;
  5515. esac
  5516. # Skip this library if it cannot be dlopened.
  5517. if test -z "$dlname"; then
  5518. # Warn if it was a shared library.
  5519. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  5520. continue
  5521. fi
  5522. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5523. test "X$dir" = "X$file" && dir=.
  5524. if test -f "$dir/$objdir/$dlname"; then
  5525. dir="$dir/$objdir"
  5526. else
  5527. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  5528. exit $EXIT_FAILURE
  5529. fi
  5530. ;;
  5531. *.lo)
  5532. # Just add the directory containing the .lo file.
  5533. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5534. test "X$dir" = "X$file" && dir=.
  5535. ;;
  5536. *)
  5537. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  5538. continue
  5539. ;;
  5540. esac
  5541. # Get the absolute pathname.
  5542. absdir=`cd "$dir" && pwd`
  5543. test -n "$absdir" && dir="$absdir"
  5544. # Now add the directory to shlibpath_var.
  5545. if eval "test -z \"\$$shlibpath_var\""; then
  5546. eval "$shlibpath_var=\"\$dir\""
  5547. else
  5548. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  5549. fi
  5550. done
  5551. # This variable tells wrapper scripts just to set shlibpath_var
  5552. # rather than running their programs.
  5553. libtool_execute_magic="$magic"
  5554. # Check if any of the arguments is a wrapper script.
  5555. args=
  5556. for file
  5557. do
  5558. case $file in
  5559. -*) ;;
  5560. *)
  5561. # Do a test to see if this is really a libtool program.
  5562. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5563. # If there is no directory component, then add one.
  5564. case $file in
  5565. */* | *\\*) . $file ;;
  5566. *) . ./$file ;;
  5567. esac
  5568. # Transform arg to wrapped name.
  5569. file="$progdir/$program"
  5570. fi
  5571. ;;
  5572. esac
  5573. # Quote arguments (to preserve shell metacharacters).
  5574. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  5575. args="$args \"$file\""
  5576. done
  5577. if test -z "$run"; then
  5578. if test -n "$shlibpath_var"; then
  5579. # Export the shlibpath_var.
  5580. eval "export $shlibpath_var"
  5581. fi
  5582. # Restore saved environment variables
  5583. if test "${save_LC_ALL+set}" = set; then
  5584. LC_ALL="$save_LC_ALL"; export LC_ALL
  5585. fi
  5586. if test "${save_LANG+set}" = set; then
  5587. LANG="$save_LANG"; export LANG
  5588. fi
  5589. # Now prepare to actually exec the command.
  5590. exec_cmd="\$cmd$args"
  5591. else
  5592. # Display what would be done.
  5593. if test -n "$shlibpath_var"; then
  5594. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  5595. $echo "export $shlibpath_var"
  5596. fi
  5597. $echo "$cmd$args"
  5598. exit $EXIT_SUCCESS
  5599. fi
  5600. ;;
  5601. # libtool clean and uninstall mode
  5602. clean | uninstall)
  5603. modename="$modename: $mode"
  5604. rm="$nonopt"
  5605. files=
  5606. rmforce=
  5607. exit_status=0
  5608. # This variable tells wrapper scripts just to set variables rather
  5609. # than running their programs.
  5610. libtool_install_magic="$magic"
  5611. for arg
  5612. do
  5613. case $arg in
  5614. -f) rm="$rm $arg"; rmforce=yes ;;
  5615. -*) rm="$rm $arg" ;;
  5616. *) files="$files $arg" ;;
  5617. esac
  5618. done
  5619. if test -z "$rm"; then
  5620. $echo "$modename: you must specify an RM program" 1>&2
  5621. $echo "$help" 1>&2
  5622. exit $EXIT_FAILURE
  5623. fi
  5624. rmdirs=
  5625. origobjdir="$objdir"
  5626. for file in $files; do
  5627. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  5628. if test "X$dir" = "X$file"; then
  5629. dir=.
  5630. objdir="$origobjdir"
  5631. else
  5632. objdir="$dir/$origobjdir"
  5633. fi
  5634. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5635. test "$mode" = uninstall && objdir="$dir"
  5636. # Remember objdir for removal later, being careful to avoid duplicates
  5637. if test "$mode" = clean; then
  5638. case " $rmdirs " in
  5639. *" $objdir "*) ;;
  5640. *) rmdirs="$rmdirs $objdir" ;;
  5641. esac
  5642. fi
  5643. # Don't error if the file doesn't exist and rm -f was used.
  5644. if (test -L "$file") >/dev/null 2>&1 \
  5645. || (test -h "$file") >/dev/null 2>&1 \
  5646. || test -f "$file"; then
  5647. :
  5648. elif test -d "$file"; then
  5649. exit_status=1
  5650. continue
  5651. elif test "$rmforce" = yes; then
  5652. continue
  5653. fi
  5654. rmfiles="$file"
  5655. case $name in
  5656. *.la)
  5657. # Possibly a libtool archive, so verify it.
  5658. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5659. . $dir/$name
  5660. # Delete the libtool libraries and symlinks.
  5661. for n in $library_names; do
  5662. rmfiles="$rmfiles $objdir/$n"
  5663. done
  5664. test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  5665. test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  5666. if test "$mode" = uninstall; then
  5667. if test -n "$library_names"; then
  5668. # Do each command in the postuninstall commands.
  5669. cmds=$postuninstall_cmds
  5670. save_ifs="$IFS"; IFS='~'
  5671. for cmd in $cmds; do
  5672. IFS="$save_ifs"
  5673. eval cmd=\"$cmd\"
  5674. $show "$cmd"
  5675. $run eval "$cmd"
  5676. if test "$?" -ne 0 && test "$rmforce" != yes; then
  5677. exit_status=1
  5678. fi
  5679. done
  5680. IFS="$save_ifs"
  5681. fi
  5682. if test -n "$old_library"; then
  5683. # Do each command in the old_postuninstall commands.
  5684. cmds=$old_postuninstall_cmds
  5685. save_ifs="$IFS"; IFS='~'
  5686. for cmd in $cmds; do
  5687. IFS="$save_ifs"
  5688. eval cmd=\"$cmd\"
  5689. $show "$cmd"
  5690. $run eval "$cmd"
  5691. if test "$?" -ne 0 && test "$rmforce" != yes; then
  5692. exit_status=1
  5693. fi
  5694. done
  5695. IFS="$save_ifs"
  5696. fi
  5697. # FIXME: should reinstall the best remaining shared library.
  5698. fi
  5699. fi
  5700. ;;
  5701. *.lo)
  5702. # Possibly a libtool object, so verify it.
  5703. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5704. # Read the .lo file
  5705. . $dir/$name
  5706. # Add PIC object to the list of files to remove.
  5707. if test -n "$pic_object" \
  5708. && test "$pic_object" != none; then
  5709. rmfiles="$rmfiles $dir/$pic_object"
  5710. fi
  5711. # Add non-PIC object to the list of files to remove.
  5712. if test -n "$non_pic_object" \
  5713. && test "$non_pic_object" != none; then
  5714. rmfiles="$rmfiles $dir/$non_pic_object"
  5715. fi
  5716. fi
  5717. ;;
  5718. *)
  5719. if test "$mode" = clean ; then
  5720. noexename=$name
  5721. case $file in
  5722. *.exe)
  5723. file=`$echo $file|${SED} 's,.exe$,,'`
  5724. noexename=`$echo $name|${SED} 's,.exe$,,'`
  5725. # $file with .exe has already been added to rmfiles,
  5726. # add $file without .exe
  5727. rmfiles="$rmfiles $file"
  5728. ;;
  5729. esac
  5730. # Do a test to see if this is a libtool program.
  5731. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5732. relink_command=
  5733. . $dir/$noexename
  5734. # note $name still contains .exe if it was in $file originally
  5735. # as does the version of $file that was added into $rmfiles
  5736. rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  5737. if test "$fast_install" = yes && test -n "$relink_command"; then
  5738. rmfiles="$rmfiles $objdir/lt-$name"
  5739. fi
  5740. if test "X$noexename" != "X$name" ; then
  5741. rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  5742. fi
  5743. fi
  5744. fi
  5745. ;;
  5746. esac
  5747. $show "$rm $rmfiles"
  5748. $run $rm $rmfiles || exit_status=1
  5749. done
  5750. objdir="$origobjdir"
  5751. # Try to remove the ${objdir}s in the directories where we deleted files
  5752. for dir in $rmdirs; do
  5753. if test -d "$dir"; then
  5754. $show "rmdir $dir"
  5755. $run rmdir $dir >/dev/null 2>&1
  5756. fi
  5757. done
  5758. exit $exit_status
  5759. ;;
  5760. "")
  5761. $echo "$modename: you must specify a MODE" 1>&2
  5762. $echo "$generic_help" 1>&2
  5763. exit $EXIT_FAILURE
  5764. ;;
  5765. esac
  5766. if test -z "$exec_cmd"; then
  5767. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  5768. $echo "$generic_help" 1>&2
  5769. exit $EXIT_FAILURE
  5770. fi
  5771. fi # test -z "$show_help"
  5772. if test -n "$exec_cmd"; then
  5773. eval exec $exec_cmd
  5774. exit $EXIT_FAILURE
  5775. fi
  5776. # We need to display help for each of the modes.
  5777. case $mode in
  5778. "") $echo \
  5779. "Usage: $modename [OPTION]... [MODE-ARG]...
  5780. Provide generalized library-building support services.
  5781. --config show all configuration variables
  5782. --debug enable verbose shell tracing
  5783. -n, --dry-run display commands without modifying any files
  5784. --features display basic configuration information and exit
  5785. --finish same as \`--mode=finish'
  5786. --help display this help message and exit
  5787. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  5788. --quiet same as \`--silent'
  5789. --silent don't print informational messages
  5790. --tag=TAG use configuration variables from tag TAG
  5791. --version print version information
  5792. MODE must be one of the following:
  5793. clean remove files from the build directory
  5794. compile compile a source file into a libtool object
  5795. execute automatically set library path, then run a program
  5796. finish complete the installation of libtool libraries
  5797. install install libraries or executables
  5798. link create a library or an executable
  5799. uninstall remove libraries from an installed directory
  5800. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  5801. a more detailed description of MODE.
  5802. Report bugs to <bug-libtool@gnu.org>."
  5803. exit $EXIT_SUCCESS
  5804. ;;
  5805. clean)
  5806. $echo \
  5807. "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  5808. Remove files from the build directory.
  5809. RM is the name of the program to use to delete files associated with each FILE
  5810. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  5811. to RM.
  5812. If FILE is a libtool library, object or program, all the files associated
  5813. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  5814. ;;
  5815. compile)
  5816. $echo \
  5817. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  5818. Compile a source file into a libtool library object.
  5819. This mode accepts the following additional options:
  5820. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  5821. -prefer-pic try to building PIC objects only
  5822. -prefer-non-pic try to building non-PIC objects only
  5823. -static always build a \`.o' file suitable for static linking
  5824. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  5825. from the given SOURCEFILE.
  5826. The output file name is determined by removing the directory component from
  5827. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  5828. library object suffix, \`.lo'."
  5829. ;;
  5830. execute)
  5831. $echo \
  5832. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  5833. Automatically set library path, then run a program.
  5834. This mode accepts the following additional options:
  5835. -dlopen FILE add the directory containing FILE to the library path
  5836. This mode sets the library path environment variable according to \`-dlopen'
  5837. flags.
  5838. If any of the ARGS are libtool executable wrappers, then they are translated
  5839. into their corresponding uninstalled binary, and any of their required library
  5840. directories are added to the library path.
  5841. Then, COMMAND is executed, with ARGS as arguments."
  5842. ;;
  5843. finish)
  5844. $echo \
  5845. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  5846. Complete the installation of libtool libraries.
  5847. Each LIBDIR is a directory that contains libtool libraries.
  5848. The commands that this mode executes may require superuser privileges. Use
  5849. the \`--dry-run' option if you just want to see what would be executed."
  5850. ;;
  5851. install)
  5852. $echo \
  5853. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  5854. Install executables or libraries.
  5855. INSTALL-COMMAND is the installation command. The first component should be
  5856. either the \`install' or \`cp' program.
  5857. The rest of the components are interpreted as arguments to that command (only
  5858. BSD-compatible install options are recognized)."
  5859. ;;
  5860. link)
  5861. $echo \
  5862. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  5863. Link object files or libraries together to form another library, or to
  5864. create an executable program.
  5865. LINK-COMMAND is a command using the C compiler that you would use to create
  5866. a program from several object files.
  5867. The following components of LINK-COMMAND are treated specially:
  5868. -all-static do not do any dynamic linking at all
  5869. -avoid-version do not add a version suffix if possible
  5870. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  5871. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  5872. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  5873. -export-symbols SYMFILE
  5874. try to export only the symbols listed in SYMFILE
  5875. -export-symbols-regex REGEX
  5876. try to export only the symbols matching REGEX
  5877. -LLIBDIR search LIBDIR for required installed libraries
  5878. -lNAME OUTPUT-FILE requires the installed library libNAME
  5879. -module build a library that can dlopened
  5880. -no-fast-install disable the fast-install mode
  5881. -no-install link a not-installable executable
  5882. -no-undefined declare that a library does not refer to external symbols
  5883. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  5884. -objectlist FILE Use a list of object files found in FILE to specify objects
  5885. -precious-files-regex REGEX
  5886. don't remove output files matching REGEX
  5887. -release RELEASE specify package release information
  5888. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  5889. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  5890. -static do not do any dynamic linking of libtool libraries
  5891. -version-info CURRENT[:REVISION[:AGE]]
  5892. specify library version info [each variable defaults to 0]
  5893. All other options (arguments beginning with \`-') are ignored.
  5894. Every other argument is treated as a filename. Files ending in \`.la' are
  5895. treated as uninstalled libtool libraries, other files are standard or library
  5896. object files.
  5897. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  5898. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  5899. required, except when creating a convenience library.
  5900. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  5901. using \`ar' and \`ranlib', or on Windows using \`lib'.
  5902. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  5903. is created, otherwise an executable program is created."
  5904. ;;
  5905. uninstall)
  5906. $echo \
  5907. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  5908. Remove libraries from an installation directory.
  5909. RM is the name of the program to use to delete files associated with each FILE
  5910. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  5911. to RM.
  5912. If FILE is a libtool library, all the files associated with it are deleted.
  5913. Otherwise, only FILE itself is deleted using RM."
  5914. ;;
  5915. *)
  5916. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  5917. $echo "$help" 1>&2
  5918. exit $EXIT_FAILURE
  5919. ;;
  5920. esac
  5921. $echo
  5922. $echo "Try \`$modename --help' for more information about other modes."
  5923. exit $?
  5924. # The TAGs below are defined such that we never get into a situation
  5925. # in which we disable both kinds of libraries. Given conflicting
  5926. # choices, we go for a static library, that is the most portable,
  5927. # since we can't tell whether shared libraries were disabled because
  5928. # the user asked for that or because the platform doesn't support
  5929. # them. This is particularly important on AIX, because we don't
  5930. # support having both static and shared libraries enabled at the same
  5931. # time on that platform, so we default to a shared-only configuration.
  5932. # If a disable-shared tag is given, we'll fallback to a static-only
  5933. # configuration. But we'll never go from static-only to shared-only.
  5934. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  5935. build_libtool_libs=no
  5936. build_old_libs=yes
  5937. # ### END LIBTOOL TAG CONFIG: disable-shared
  5938. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  5939. build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
  5940. # ### END LIBTOOL TAG CONFIG: disable-static
  5941. # Local Variables:
  5942. # mode:shell-script
  5943. # sh-indentation:2
  5944. # End: