libtool 288 KB

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