libtool 292 KB

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