libtool 286 KB

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