libtool 257 KB

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