patch-libtool 263 KB

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