libtool 286 KB

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