libtool 292 KB

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