libtool 345 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118
  1. #! /bin/bash
  2. # Generated automatically by config.status (starpu) 1.3.99
  3. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  4. # Provide generalized library-building support services.
  5. # Written by Gordon Matzigkeit, 1996
  6. # Copyright (C) 2014 Free Software Foundation, Inc.
  7. # This is free software; see the source for copying conditions. There is NO
  8. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. # GNU Libtool is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of of the License, or
  12. # (at your option) any later version.
  13. #
  14. # As a special exception to the GNU General Public License, if you
  15. # distribute this file as part of a program or library that is built
  16. # using GNU Libtool, you may include this file under the same
  17. # distribution terms that you use for the rest of that program.
  18. #
  19. # GNU Libtool is distributed in the hope that it will be useful, but
  20. # WITHOUT ANY WARRANTY; without even the implied warranty of
  21. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. # GNU General Public License for more details.
  23. #
  24. # You should have received a copy of the GNU General Public License
  25. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. # The names of the tagged configurations supported by this script.
  27. available_tags='CXX F77 FC '
  28. # Configured defaults for sys_lib_dlsearch_path munging.
  29. : ${LT_SYS_LIBRARY_PATH=""}
  30. # ### BEGIN LIBTOOL CONFIG
  31. # Which release of libtool.m4 was used?
  32. macro_version=2.4.6
  33. macro_revision=2.4.6
  34. # Assembler program.
  35. AS="as"
  36. # DLL creation program.
  37. DLLTOOL="false"
  38. # Object dumper program.
  39. OBJDUMP="objdump"
  40. # Whether or not to build shared libraries.
  41. build_libtool_libs=yes
  42. # Whether or not to build static libraries.
  43. build_old_libs=yes
  44. # What type of objects to build.
  45. pic_mode=default
  46. # Whether or not to optimize for fast installation.
  47. fast_install=needless
  48. # Shared archive member basename,for filename based shared library versioning on AIX.
  49. shared_archive_member_spec=
  50. # Shell to use when invoking shell scripts.
  51. SHELL="/bin/bash"
  52. # An echo program that protects backslashes.
  53. ECHO="printf %s\\n"
  54. # The PATH separator for the build system.
  55. PATH_SEPARATOR=":"
  56. # The host system.
  57. host_alias=
  58. host=x86_64-pc-linux-gnu
  59. host_os=linux-gnu
  60. # The build system.
  61. build_alias=
  62. build=x86_64-pc-linux-gnu
  63. build_os=linux-gnu
  64. # A sed program that does not truncate output.
  65. SED="/bin/sed"
  66. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  67. Xsed="$SED -e 1s/^X//"
  68. # A grep program that handles long lines.
  69. GREP="/bin/grep"
  70. # An ERE matcher.
  71. EGREP="/bin/grep -E"
  72. # A literal string matcher.
  73. FGREP="/bin/grep -F"
  74. # A BSD- or MS-compatible name lister.
  75. NM="/usr/bin/nm -B"
  76. # Whether we need soft or hard links.
  77. LN_S="ln -s"
  78. # What is the maximum length of a command?
  79. max_cmd_len=1572864
  80. # Object file suffix (normally "o").
  81. objext=o
  82. # Executable file suffix (normally "").
  83. exeext=
  84. # whether the shell understands "unset".
  85. lt_unset=unset
  86. # turn spaces into newlines.
  87. SP2NL="tr \\040 \\012"
  88. # turn newlines into spaces.
  89. NL2SP="tr \\015\\012 \\040\\040"
  90. # convert $build file names to $host format.
  91. to_host_file_cmd=func_convert_file_noop
  92. # convert $build files to toolchain format.
  93. to_tool_file_cmd=func_convert_file_noop
  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. # Command to associate shared and link libraries.
  103. sharedlib_from_linklib_cmd="printf %s\\n"
  104. # The archiver.
  105. AR="ar"
  106. # Flags to create an archive.
  107. AR_FLAGS="cru"
  108. # How to feed a file listing to the archiver.
  109. archiver_list_spec="@"
  110. # A symbol stripping program.
  111. STRIP="strip"
  112. # Commands used to install an old-style archive.
  113. RANLIB="ranlib"
  114. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
  115. old_postuninstall_cmds=""
  116. # Whether to use a lock for old archive extraction.
  117. lock_old_archive_extraction=no
  118. # A C compiler.
  119. LTCC="gcc"
  120. # LTCC compiler flags.
  121. LTCFLAGS="-O3 -g -O2 -gdwarf-2 -g3 -g "
  122. # Take the output of nm and produce a listing of raw symbols and C names.
  123. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
  124. # Transform the output of nm in a proper C declaration.
  125. global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
  126. # Transform the output of nm into a list of symbols to manually relocate.
  127. global_symbol_to_import=""
  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][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"\\1\", (void *) \\&\\1},/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][ABCDGIRSTW]* .* \\(lib.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"lib\\1\", (void *) \\&\\1},/p'"
  132. # The name lister interface.
  133. nm_interface="BSD nm"
  134. # Specify filename containing input files for $NM.
  135. nm_file_list_spec="@"
  136. # The root where to search for dependent libraries,and where our libraries should be installed.
  137. lt_sysroot=
  138. # Command to truncate a binary pipe.
  139. lt_truncate_bin="/bin/dd bs=4096 count=1"
  140. # The name of the directory that contains temporary libtool files.
  141. objdir=.libs
  142. # Used to examine libraries when file_magic_cmd begins with "file".
  143. MAGIC_CMD=file
  144. # Must we lock files when doing compilation?
  145. need_locks="no"
  146. # Manifest tool.
  147. MANIFEST_TOOL=":"
  148. # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
  149. DSYMUTIL=""
  150. # Tool to change global to local symbols on Mac OS X.
  151. NMEDIT=""
  152. # Tool to manipulate fat objects and archives on Mac OS X.
  153. LIPO=""
  154. # ldd/readelf like tool for Mach-O binaries on Mac OS X.
  155. OTOOL=""
  156. # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
  157. OTOOL64=""
  158. # Old archive suffix (normally "a").
  159. libext=a
  160. # Shared library suffix (normally ".so").
  161. shrext_cmds=".so"
  162. # The commands to extract the exported symbol list from a shared archive.
  163. extract_expsyms_cmds=""
  164. # Variables whose values should be saved in libtool wrapper scripts and
  165. # restored at link time.
  166. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  167. # Do we need the "lib" prefix for modules?
  168. need_lib_prefix=no
  169. # Do we need a version for libraries?
  170. need_version=no
  171. # Library versioning type.
  172. version_type=linux
  173. # Shared library runtime path variable.
  174. runpath_var=LD_RUN_PATH
  175. # Shared library path variable.
  176. shlibpath_var=LD_LIBRARY_PATH
  177. # Is shlibpath searched before the hard-coded library search path?
  178. shlibpath_overrides_runpath=yes
  179. # Format of library name prefix.
  180. libname_spec="lib\$name"
  181. # List of archive names. First name is the real one, the rest are links.
  182. # The last name is the one that the linker finds with -lNAME
  183. library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
  184. # The coded name of the library, if different from the real name.
  185. soname_spec="\$libname\$release\$shared_ext\$major"
  186. # Permission mode override for installation of shared libraries.
  187. install_override_mode=""
  188. # Command to use after installation of a shared archive.
  189. postinstall_cmds=""
  190. # Command to use after uninstallation of a shared archive.
  191. postuninstall_cmds=""
  192. # Commands used to finish a libtool library installation in a directory.
  193. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  194. # As "finish_cmds", except a single script fragment to be evaled but
  195. # not shown.
  196. finish_eval=""
  197. # Whether we should hardcode library paths into libraries.
  198. hardcode_into_libs=yes
  199. # Compile-time system search path for libraries.
  200. sys_lib_search_path_spec="/home/makni/starpu/lib /usr/lib/gcc/x86_64-linux-gnu/7 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib "
  201. # Detected run-time system search path for libraries.
  202. sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/local/cuda-10.1/targets/x86_64-linux/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu "
  203. # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
  204. configure_time_lt_sys_library_path=""
  205. # Whether dlopen is supported.
  206. dlopen_support=unknown
  207. # Whether dlopen of programs is supported.
  208. dlopen_self=unknown
  209. # Whether dlopen of statically linked programs is supported.
  210. dlopen_self_static=unknown
  211. # Commands to strip libraries.
  212. old_striplib="strip --strip-debug"
  213. striplib="strip --strip-unneeded"
  214. # The linker used to build libraries.
  215. LD="/usr/bin/ld -m elf_x86_64"
  216. # How to create reloadable object files.
  217. reload_flag=" -r"
  218. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  219. # Commands used to build an old-style archive.
  220. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  221. # A language specific compiler.
  222. CC="gcc"
  223. # Is the compiler the GNU compiler?
  224. with_gcc=yes
  225. # Compiler flag to turn off builtin functions.
  226. no_builtin_flag=" -fno-builtin"
  227. # Additional compiler flags for building library objects.
  228. pic_flag=" -fPIC -DPIC"
  229. # How to pass a linker flag through the compiler.
  230. wl="-Wl,"
  231. # Compiler flag to prevent dynamic linking.
  232. link_static_flag="-static"
  233. # Does compiler simultaneously support -c and -o options?
  234. compiler_c_o="yes"
  235. # Whether or not to add -lc for building shared libraries.
  236. build_libtool_need_lc=no
  237. # Whether or not to disallow shared libs when runtime libs are static.
  238. allow_libtool_libs_with_static_runtimes=no
  239. # Compiler flag to allow reflexive dlopens.
  240. export_dynamic_flag_spec="\$wl--export-dynamic"
  241. # Compiler flag to generate shared objects directly from archives.
  242. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  243. # Whether the compiler copes with passing no objects directly.
  244. compiler_needs_object="no"
  245. # Create an old-style archive from a shared archive.
  246. old_archive_from_new_cmds=""
  247. # Create a temporary old-style archive to link instead of a shared archive.
  248. old_archive_from_expsyms_cmds=""
  249. # Commands used to build a shared archive.
  250. archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  251. archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  252. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  253. echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  254. \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
  255. # Commands used to build a loadable module if different from building
  256. # a shared archive.
  257. module_cmds=""
  258. module_expsym_cmds=""
  259. # Whether we are building with GNU ld or not.
  260. with_gnu_ld="yes"
  261. # Flag that allows shared libraries with undefined symbols to be built.
  262. allow_undefined_flag=""
  263. # Flag that enforces no undefined symbols.
  264. no_undefined_flag=""
  265. # Flag to hardcode $libdir into a binary during linking.
  266. # This must work even if $libdir does not exist
  267. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  268. # Whether we need a single "-rpath" flag with a separated argument.
  269. hardcode_libdir_separator=""
  270. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  271. # DIR into the resulting binary.
  272. hardcode_direct=no
  273. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  274. # DIR into the resulting binary and the resulting library dependency is
  275. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  276. # library is relocated.
  277. hardcode_direct_absolute=no
  278. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  279. # into the resulting binary.
  280. hardcode_minus_L=no
  281. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  282. # into the resulting binary.
  283. hardcode_shlibpath_var=unsupported
  284. # Set to "yes" if building a shared library automatically hardcodes DIR
  285. # into the library and all subsequent libraries and executables linked
  286. # against it.
  287. hardcode_automatic=no
  288. # Set to yes if linker adds runtime paths of dependent libraries
  289. # to runtime path list.
  290. inherit_rpath=no
  291. # Whether libtool must link a program against all its dependency libraries.
  292. link_all_deplibs=no
  293. # Set to "yes" if exported symbols are required.
  294. always_export_symbols=no
  295. # The commands to list exported symbols.
  296. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  297. # Symbols that should not be listed in the preloaded symbols.
  298. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  299. # Symbols that must always be exported.
  300. include_expsyms=""
  301. # Commands necessary for linking programs (against libraries) with templates.
  302. prelink_cmds=""
  303. # Commands necessary for finishing linking programs.
  304. postlink_cmds=""
  305. # Specify filename containing input files.
  306. file_list_spec=""
  307. # How to hardcode a shared library path into an executable.
  308. hardcode_action=immediate
  309. # The directories searched by this compiler when creating a shared library.
  310. compiler_lib_search_dirs=""
  311. # Dependencies to place before and after the objects being linked to
  312. # create a shared library.
  313. predep_objects=""
  314. postdep_objects=""
  315. predeps=""
  316. postdeps=""
  317. # The library search path used internally by the compiler when linking
  318. # a shared library.
  319. compiler_lib_search_path=""
  320. # ### END LIBTOOL CONFIG
  321. # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
  322. # func_munge_path_list VARIABLE PATH
  323. # -----------------------------------
  324. # VARIABLE is name of variable containing _space_ separated list of
  325. # directories to be munged by the contents of PATH, which is string
  326. # having a format:
  327. # "DIR[:DIR]:"
  328. # string "DIR[ DIR]" will be prepended to VARIABLE
  329. # ":DIR[:DIR]"
  330. # string "DIR[ DIR]" will be appended to VARIABLE
  331. # "DIRP[:DIRP]::[DIRA:]DIRA"
  332. # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
  333. # "DIRA[ DIRA]" will be appended to VARIABLE
  334. # "DIR[:DIR]"
  335. # VARIABLE will be replaced by "DIR[ DIR]"
  336. func_munge_path_list ()
  337. {
  338. case x$2 in
  339. x)
  340. ;;
  341. *:)
  342. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
  343. ;;
  344. x:*)
  345. eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
  346. ;;
  347. *::*)
  348. eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
  349. eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
  350. ;;
  351. *)
  352. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
  353. ;;
  354. esac
  355. }
  356. # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
  357. func_cc_basename ()
  358. {
  359. for cc_temp in $*""; do
  360. case $cc_temp in
  361. compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
  362. distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
  363. \-*) ;;
  364. *) break;;
  365. esac
  366. done
  367. func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
  368. }
  369. # ### END FUNCTIONS SHARED WITH CONFIGURE
  370. #! /bin/sh
  371. ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
  372. ## by inline-source v2014-01-03.01
  373. # libtool (GNU libtool) 2.4.6
  374. # Provide generalized library-building support services.
  375. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  376. # Copyright (C) 1996-2015 Free Software Foundation, Inc.
  377. # This is free software; see the source for copying conditions. There is NO
  378. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  379. # GNU Libtool is free software; you can redistribute it and/or modify
  380. # it under the terms of the GNU General Public License as published by
  381. # the Free Software Foundation; either version 2 of the License, or
  382. # (at your option) any later version.
  383. #
  384. # As a special exception to the GNU General Public License,
  385. # if you distribute this file as part of a program or library that
  386. # is built using GNU Libtool, you may include this file under the
  387. # same distribution terms that you use for the rest of that program.
  388. #
  389. # GNU Libtool is distributed in the hope that it will be useful, but
  390. # WITHOUT ANY WARRANTY; without even the implied warranty of
  391. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  392. # General Public License for more details.
  393. #
  394. # You should have received a copy of the GNU General Public License
  395. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  396. PROGRAM=libtool
  397. PACKAGE=libtool
  398. VERSION="2.4.6 Debian-2.4.6-2"
  399. package_revision=2.4.6
  400. ## ------ ##
  401. ## Usage. ##
  402. ## ------ ##
  403. # Run './libtool --help' for help with using this script from the
  404. # command line.
  405. ## ------------------------------- ##
  406. ## User overridable command paths. ##
  407. ## ------------------------------- ##
  408. # After configure completes, it has a better idea of some of the
  409. # shell tools we need than the defaults used by the functions shared
  410. # with bootstrap, so set those here where they can still be over-
  411. # ridden by the user, but otherwise take precedence.
  412. : ${AUTOCONF="autoconf"}
  413. : ${AUTOMAKE="automake"}
  414. ## -------------------------- ##
  415. ## Source external libraries. ##
  416. ## -------------------------- ##
  417. # Much of our low-level functionality needs to be sourced from external
  418. # libraries, which are installed to $pkgauxdir.
  419. # Set a version string for this script.
  420. scriptversion=2015-01-20.17; # UTC
  421. # General shell script boiler plate, and helper functions.
  422. # Written by Gary V. Vaughan, 2004
  423. # Copyright (C) 2004-2015 Free Software Foundation, Inc.
  424. # This is free software; see the source for copying conditions. There is NO
  425. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  426. # This program is free software; you can redistribute it and/or modify
  427. # it under the terms of the GNU General Public License as published by
  428. # the Free Software Foundation; either version 3 of the License, or
  429. # (at your option) any later version.
  430. # As a special exception to the GNU General Public License, if you distribute
  431. # this file as part of a program or library that is built using GNU Libtool,
  432. # you may include this file under the same distribution terms that you use
  433. # for the rest of that program.
  434. # This program is distributed in the hope that it will be useful,
  435. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  436. # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
  437. # General Public License for more details.
  438. # You should have received a copy of the GNU General Public License
  439. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  440. # Please report bugs or propose patches to gary@gnu.org.
  441. ## ------ ##
  442. ## Usage. ##
  443. ## ------ ##
  444. # Evaluate this file near the top of your script to gain access to
  445. # the functions and variables defined here:
  446. #
  447. # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
  448. #
  449. # If you need to override any of the default environment variable
  450. # settings, do that before evaluating this file.
  451. ## -------------------- ##
  452. ## Shell normalisation. ##
  453. ## -------------------- ##
  454. # Some shells need a little help to be as Bourne compatible as possible.
  455. # Before doing anything else, make sure all that help has been provided!
  456. DUALCASE=1; export DUALCASE # for MKS sh
  457. if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  458. emulate sh
  459. NULLCMD=:
  460. # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  461. # is contrary to our usage. Disable this feature.
  462. alias -g '${1+"$@"}'='"$@"'
  463. setopt NO_GLOB_SUBST
  464. else
  465. case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
  466. fi
  467. # NLS nuisances: We save the old values in case they are required later.
  468. _G_user_locale=
  469. _G_safe_locale=
  470. for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  471. do
  472. eval "if test set = \"\${$_G_var+set}\"; then
  473. save_$_G_var=\$$_G_var
  474. $_G_var=C
  475. export $_G_var
  476. _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
  477. _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
  478. fi"
  479. done
  480. # CDPATH.
  481. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  482. # Make sure IFS has a sensible default
  483. sp=' '
  484. nl='
  485. '
  486. IFS="$sp $nl"
  487. # There are apparently some retarded systems that use ';' as a PATH separator!
  488. if test "${PATH_SEPARATOR+set}" != set; then
  489. PATH_SEPARATOR=:
  490. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
  491. (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
  492. PATH_SEPARATOR=';'
  493. }
  494. fi
  495. ## ------------------------- ##
  496. ## Locate command utilities. ##
  497. ## ------------------------- ##
  498. # func_executable_p FILE
  499. # ----------------------
  500. # Check that FILE is an executable regular file.
  501. func_executable_p ()
  502. {
  503. test -f "$1" && test -x "$1"
  504. }
  505. # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
  506. # --------------------------------------------
  507. # Search for either a program that responds to --version with output
  508. # containing "GNU", or else returned by CHECK_FUNC otherwise, by
  509. # trying all the directories in PATH with each of the elements of
  510. # PROGS_LIST.
  511. #
  512. # CHECK_FUNC should accept the path to a candidate program, and
  513. # set $func_check_prog_result if it truncates its output less than
  514. # $_G_path_prog_max characters.
  515. func_path_progs ()
  516. {
  517. _G_progs_list=$1
  518. _G_check_func=$2
  519. _G_PATH=${3-"$PATH"}
  520. _G_path_prog_max=0
  521. _G_path_prog_found=false
  522. _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
  523. for _G_dir in $_G_PATH; do
  524. IFS=$_G_save_IFS
  525. test -z "$_G_dir" && _G_dir=.
  526. for _G_prog_name in $_G_progs_list; do
  527. for _exeext in '' .EXE; do
  528. _G_path_prog=$_G_dir/$_G_prog_name$_exeext
  529. func_executable_p "$_G_path_prog" || continue
  530. case `"$_G_path_prog" --version 2>&1` in
  531. *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
  532. *) $_G_check_func $_G_path_prog
  533. func_path_progs_result=$func_check_prog_result
  534. ;;
  535. esac
  536. $_G_path_prog_found && break 3
  537. done
  538. done
  539. done
  540. IFS=$_G_save_IFS
  541. test -z "$func_path_progs_result" && {
  542. echo "no acceptable sed could be found in \$PATH" >&2
  543. exit 1
  544. }
  545. }
  546. # We want to be able to use the functions in this file before configure
  547. # has figured out where the best binaries are kept, which means we have
  548. # to search for them ourselves - except when the results are already set
  549. # where we skip the searches.
  550. # Unless the user overrides by setting SED, search the path for either GNU
  551. # sed, or the sed that truncates its output the least.
  552. test -z "$SED" && {
  553. _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
  554. for _G_i in 1 2 3 4 5 6 7; do
  555. _G_sed_script=$_G_sed_script$nl$_G_sed_script
  556. done
  557. echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
  558. _G_sed_script=
  559. func_check_prog_sed ()
  560. {
  561. _G_path_prog=$1
  562. _G_count=0
  563. printf 0123456789 >conftest.in
  564. while :
  565. do
  566. cat conftest.in conftest.in >conftest.tmp
  567. mv conftest.tmp conftest.in
  568. cp conftest.in conftest.nl
  569. echo '' >> conftest.nl
  570. "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
  571. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  572. _G_count=`expr $_G_count + 1`
  573. if test "$_G_count" -gt "$_G_path_prog_max"; then
  574. # Best one so far, save it but keep looking for a better one
  575. func_check_prog_result=$_G_path_prog
  576. _G_path_prog_max=$_G_count
  577. fi
  578. # 10*(2^10) chars as input seems more than enough
  579. test 10 -lt "$_G_count" && break
  580. done
  581. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  582. }
  583. func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
  584. rm -f conftest.sed
  585. SED=$func_path_progs_result
  586. }
  587. # Unless the user overrides by setting GREP, search the path for either GNU
  588. # grep, or the grep that truncates its output the least.
  589. test -z "$GREP" && {
  590. func_check_prog_grep ()
  591. {
  592. _G_path_prog=$1
  593. _G_count=0
  594. _G_path_prog_max=0
  595. printf 0123456789 >conftest.in
  596. while :
  597. do
  598. cat conftest.in conftest.in >conftest.tmp
  599. mv conftest.tmp conftest.in
  600. cp conftest.in conftest.nl
  601. echo 'GREP' >> conftest.nl
  602. "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
  603. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  604. _G_count=`expr $_G_count + 1`
  605. if test "$_G_count" -gt "$_G_path_prog_max"; then
  606. # Best one so far, save it but keep looking for a better one
  607. func_check_prog_result=$_G_path_prog
  608. _G_path_prog_max=$_G_count
  609. fi
  610. # 10*(2^10) chars as input seems more than enough
  611. test 10 -lt "$_G_count" && break
  612. done
  613. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  614. }
  615. func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
  616. GREP=$func_path_progs_result
  617. }
  618. ## ------------------------------- ##
  619. ## User overridable command paths. ##
  620. ## ------------------------------- ##
  621. # All uppercase variable names are used for environment variables. These
  622. # variables can be overridden by the user before calling a script that
  623. # uses them if a suitable command of that name is not already available
  624. # in the command search PATH.
  625. : ${CP="cp -f"}
  626. : ${ECHO="printf %s\n"}
  627. : ${EGREP="$GREP -E"}
  628. : ${FGREP="$GREP -F"}
  629. : ${LN_S="ln -s"}
  630. : ${MAKE="make"}
  631. : ${MKDIR="mkdir"}
  632. : ${MV="mv -f"}
  633. : ${RM="rm -f"}
  634. : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  635. ## -------------------- ##
  636. ## Useful sed snippets. ##
  637. ## -------------------- ##
  638. sed_dirname='s|/[^/]*$||'
  639. sed_basename='s|^.*/||'
  640. # Sed substitution that helps us do robust quoting. It backslashifies
  641. # metacharacters that are still active within double-quoted strings.
  642. sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
  643. # Same as above, but do not quote variable references.
  644. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
  645. # Sed substitution that turns a string into a regex matching for the
  646. # string literally.
  647. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
  648. # Sed substitution that converts a w32 file name or path
  649. # that contains forward slashes, into one that contains
  650. # (escaped) backslashes. A very naive implementation.
  651. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  652. # Re-'\' parameter expansions in output of sed_double_quote_subst that
  653. # were '\'-ed in input to the same. If an odd number of '\' preceded a
  654. # '$' in input to sed_double_quote_subst, that '$' was protected from
  655. # expansion. Since each input '\' is now two '\'s, look for any number
  656. # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
  657. _G_bs='\\'
  658. _G_bs2='\\\\'
  659. _G_bs4='\\\\\\\\'
  660. _G_dollar='\$'
  661. sed_double_backslash="\
  662. s/$_G_bs4/&\\
  663. /g
  664. s/^$_G_bs2$_G_dollar/$_G_bs&/
  665. s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
  666. s/\n//g"
  667. ## ----------------- ##
  668. ## Global variables. ##
  669. ## ----------------- ##
  670. # Except for the global variables explicitly listed below, the following
  671. # functions in the '^func_' namespace, and the '^require_' namespace
  672. # variables initialised in the 'Resource management' section, sourcing
  673. # this file will not pollute your global namespace with anything
  674. # else. There's no portable way to scope variables in Bourne shell
  675. # though, so actually running these functions will sometimes place
  676. # results into a variable named after the function, and often use
  677. # temporary variables in the '^_G_' namespace. If you are careful to
  678. # avoid using those namespaces casually in your sourcing script, things
  679. # should continue to work as you expect. And, of course, you can freely
  680. # overwrite any of the functions or variables defined here before
  681. # calling anything to customize them.
  682. EXIT_SUCCESS=0
  683. EXIT_FAILURE=1
  684. EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  685. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  686. # Allow overriding, eg assuming that you follow the convention of
  687. # putting '$debug_cmd' at the start of all your functions, you can get
  688. # bash to show function call trace with:
  689. #
  690. # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
  691. debug_cmd=${debug_cmd-":"}
  692. exit_cmd=:
  693. # By convention, finish your script with:
  694. #
  695. # exit $exit_status
  696. #
  697. # so that you can set exit_status to non-zero if you want to indicate
  698. # something went wrong during execution without actually bailing out at
  699. # the point of failure.
  700. exit_status=$EXIT_SUCCESS
  701. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  702. # is ksh but when the shell is invoked as "sh" and the current value of
  703. # the _XPG environment variable is not equal to 1 (one), the special
  704. # positional parameter $0, within a function call, is the name of the
  705. # function.
  706. progpath=$0
  707. # The name of this program.
  708. progname=`$ECHO "$progpath" |$SED "$sed_basename"`
  709. # Make sure we have an absolute progpath for reexecution:
  710. case $progpath in
  711. [\\/]*|[A-Za-z]:\\*) ;;
  712. *[\\/]*)
  713. progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
  714. progdir=`cd "$progdir" && pwd`
  715. progpath=$progdir/$progname
  716. ;;
  717. *)
  718. _G_IFS=$IFS
  719. IFS=${PATH_SEPARATOR-:}
  720. for progdir in $PATH; do
  721. IFS=$_G_IFS
  722. test -x "$progdir/$progname" && break
  723. done
  724. IFS=$_G_IFS
  725. test -n "$progdir" || progdir=`pwd`
  726. progpath=$progdir/$progname
  727. ;;
  728. esac
  729. ## ----------------- ##
  730. ## Standard options. ##
  731. ## ----------------- ##
  732. # The following options affect the operation of the functions defined
  733. # below, and should be set appropriately depending on run-time para-
  734. # meters passed on the command line.
  735. opt_dry_run=false
  736. opt_quiet=false
  737. opt_verbose=false
  738. # Categories 'all' and 'none' are always available. Append any others
  739. # you will pass as the first argument to func_warning from your own
  740. # code.
  741. warning_categories=
  742. # By default, display warnings according to 'opt_warning_types'. Set
  743. # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
  744. # treat the next displayed warning as a fatal error.
  745. warning_func=func_warn_and_continue
  746. # Set to 'all' to display all warnings, 'none' to suppress all
  747. # warnings, or a space delimited list of some subset of
  748. # 'warning_categories' to display only the listed warnings.
  749. opt_warning_types=all
  750. ## -------------------- ##
  751. ## Resource management. ##
  752. ## -------------------- ##
  753. # This section contains definitions for functions that each ensure a
  754. # particular resource (a file, or a non-empty configuration variable for
  755. # example) is available, and if appropriate to extract default values
  756. # from pertinent package files. Call them using their associated
  757. # 'require_*' variable to ensure that they are executed, at most, once.
  758. #
  759. # It's entirely deliberate that calling these functions can set
  760. # variables that don't obey the namespace limitations obeyed by the rest
  761. # of this file, in order that that they be as useful as possible to
  762. # callers.
  763. # require_term_colors
  764. # -------------------
  765. # Allow display of bold text on terminals that support it.
  766. require_term_colors=func_require_term_colors
  767. func_require_term_colors ()
  768. {
  769. $debug_cmd
  770. test -t 1 && {
  771. # COLORTERM and USE_ANSI_COLORS environment variables take
  772. # precedence, because most terminfo databases neglect to describe
  773. # whether color sequences are supported.
  774. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
  775. if test 1 = "$USE_ANSI_COLORS"; then
  776. # Standard ANSI escape sequences
  777. tc_reset=''
  778. tc_bold=''; tc_standout=''
  779. tc_red=''; tc_green=''
  780. tc_blue=''; tc_cyan=''
  781. else
  782. # Otherwise trust the terminfo database after all.
  783. test -n "`tput sgr0 2>/dev/null`" && {
  784. tc_reset=`tput sgr0`
  785. test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
  786. tc_standout=$tc_bold
  787. test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
  788. test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
  789. test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
  790. test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
  791. test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
  792. }
  793. fi
  794. }
  795. require_term_colors=:
  796. }
  797. ## ----------------- ##
  798. ## Function library. ##
  799. ## ----------------- ##
  800. # This section contains a variety of useful functions to call in your
  801. # scripts. Take note of the portable wrappers for features provided by
  802. # some modern shells, which will fall back to slower equivalents on
  803. # less featureful shells.
  804. # func_append VAR VALUE
  805. # ---------------------
  806. # Append VALUE onto the existing contents of VAR.
  807. # We should try to minimise forks, especially on Windows where they are
  808. # unreasonably slow, so skip the feature probes when bash or zsh are
  809. # being used:
  810. if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
  811. : ${_G_HAVE_ARITH_OP="yes"}
  812. : ${_G_HAVE_XSI_OPS="yes"}
  813. # The += operator was introduced in bash 3.1
  814. case $BASH_VERSION in
  815. [12].* | 3.0 | 3.0*) ;;
  816. *)
  817. : ${_G_HAVE_PLUSEQ_OP="yes"}
  818. ;;
  819. esac
  820. fi
  821. # _G_HAVE_PLUSEQ_OP
  822. # Can be empty, in which case the shell is probed, "yes" if += is
  823. # useable or anything else if it does not work.
  824. test -z "$_G_HAVE_PLUSEQ_OP" \
  825. && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
  826. && _G_HAVE_PLUSEQ_OP=yes
  827. if test yes = "$_G_HAVE_PLUSEQ_OP"
  828. then
  829. # This is an XSI compatible shell, allowing a faster implementation...
  830. eval 'func_append ()
  831. {
  832. $debug_cmd
  833. eval "$1+=\$2"
  834. }'
  835. else
  836. # ...otherwise fall back to using expr, which is often a shell builtin.
  837. func_append ()
  838. {
  839. $debug_cmd
  840. eval "$1=\$$1\$2"
  841. }
  842. fi
  843. # func_append_quoted VAR VALUE
  844. # ----------------------------
  845. # Quote VALUE and append to the end of shell variable VAR, separated
  846. # by a space.
  847. if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  848. eval 'func_append_quoted ()
  849. {
  850. $debug_cmd
  851. func_quote_for_eval "$2"
  852. eval "$1+=\\ \$func_quote_for_eval_result"
  853. }'
  854. else
  855. func_append_quoted ()
  856. {
  857. $debug_cmd
  858. func_quote_for_eval "$2"
  859. eval "$1=\$$1\\ \$func_quote_for_eval_result"
  860. }
  861. fi
  862. # func_append_uniq VAR VALUE
  863. # --------------------------
  864. # Append unique VALUE onto the existing contents of VAR, assuming
  865. # entries are delimited by the first character of VALUE. For example:
  866. #
  867. # func_append_uniq options " --another-option option-argument"
  868. #
  869. # will only append to $options if " --another-option option-argument "
  870. # is not already present somewhere in $options already (note spaces at
  871. # each end implied by leading space in second argument).
  872. func_append_uniq ()
  873. {
  874. $debug_cmd
  875. eval _G_current_value='`$ECHO $'$1'`'
  876. _G_delim=`expr "$2" : '\(.\)'`
  877. case $_G_delim$_G_current_value$_G_delim in
  878. *"$2$_G_delim"*) ;;
  879. *) func_append "$@" ;;
  880. esac
  881. }
  882. # func_arith TERM...
  883. # ------------------
  884. # Set func_arith_result to the result of evaluating TERMs.
  885. test -z "$_G_HAVE_ARITH_OP" \
  886. && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
  887. && _G_HAVE_ARITH_OP=yes
  888. if test yes = "$_G_HAVE_ARITH_OP"; then
  889. eval 'func_arith ()
  890. {
  891. $debug_cmd
  892. func_arith_result=$(( $* ))
  893. }'
  894. else
  895. func_arith ()
  896. {
  897. $debug_cmd
  898. func_arith_result=`expr "$@"`
  899. }
  900. fi
  901. # func_basename FILE
  902. # ------------------
  903. # Set func_basename_result to FILE with everything up to and including
  904. # the last / stripped.
  905. if test yes = "$_G_HAVE_XSI_OPS"; then
  906. # If this shell supports suffix pattern removal, then use it to avoid
  907. # forking. Hide the definitions single quotes in case the shell chokes
  908. # on unsupported syntax...
  909. _b='func_basename_result=${1##*/}'
  910. _d='case $1 in
  911. */*) func_dirname_result=${1%/*}$2 ;;
  912. * ) func_dirname_result=$3 ;;
  913. esac'
  914. else
  915. # ...otherwise fall back to using sed.
  916. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
  917. _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
  918. if test "X$func_dirname_result" = "X$1"; then
  919. func_dirname_result=$3
  920. else
  921. func_append func_dirname_result "$2"
  922. fi'
  923. fi
  924. eval 'func_basename ()
  925. {
  926. $debug_cmd
  927. '"$_b"'
  928. }'
  929. # func_dirname FILE APPEND NONDIR_REPLACEMENT
  930. # -------------------------------------------
  931. # Compute the dirname of FILE. If nonempty, add APPEND to the result,
  932. # otherwise set result to NONDIR_REPLACEMENT.
  933. eval 'func_dirname ()
  934. {
  935. $debug_cmd
  936. '"$_d"'
  937. }'
  938. # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
  939. # --------------------------------------------------------
  940. # Perform func_basename and func_dirname in a single function
  941. # call:
  942. # dirname: Compute the dirname of FILE. If nonempty,
  943. # add APPEND to the result, otherwise set result
  944. # to NONDIR_REPLACEMENT.
  945. # value returned in "$func_dirname_result"
  946. # basename: Compute filename of FILE.
  947. # value retuned in "$func_basename_result"
  948. # For efficiency, we do not delegate to the functions above but instead
  949. # duplicate the functionality here.
  950. eval 'func_dirname_and_basename ()
  951. {
  952. $debug_cmd
  953. '"$_b"'
  954. '"$_d"'
  955. }'
  956. # func_echo ARG...
  957. # ----------------
  958. # Echo program name prefixed message.
  959. func_echo ()
  960. {
  961. $debug_cmd
  962. _G_message=$*
  963. func_echo_IFS=$IFS
  964. IFS=$nl
  965. for _G_line in $_G_message; do
  966. IFS=$func_echo_IFS
  967. $ECHO "$progname: $_G_line"
  968. done
  969. IFS=$func_echo_IFS
  970. }
  971. # func_echo_all ARG...
  972. # --------------------
  973. # Invoke $ECHO with all args, space-separated.
  974. func_echo_all ()
  975. {
  976. $ECHO "$*"
  977. }
  978. # func_echo_infix_1 INFIX ARG...
  979. # ------------------------------
  980. # Echo program name, followed by INFIX on the first line, with any
  981. # additional lines not showing INFIX.
  982. func_echo_infix_1 ()
  983. {
  984. $debug_cmd
  985. $require_term_colors
  986. _G_infix=$1; shift
  987. _G_indent=$_G_infix
  988. _G_prefix="$progname: $_G_infix: "
  989. _G_message=$*
  990. # Strip color escape sequences before counting printable length
  991. for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
  992. do
  993. test -n "$_G_tc" && {
  994. _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
  995. _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
  996. }
  997. done
  998. _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
  999. func_echo_infix_1_IFS=$IFS
  1000. IFS=$nl
  1001. for _G_line in $_G_message; do
  1002. IFS=$func_echo_infix_1_IFS
  1003. $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
  1004. _G_prefix=$_G_indent
  1005. done
  1006. IFS=$func_echo_infix_1_IFS
  1007. }
  1008. # func_error ARG...
  1009. # -----------------
  1010. # Echo program name prefixed message to standard error.
  1011. func_error ()
  1012. {
  1013. $debug_cmd
  1014. $require_term_colors
  1015. func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
  1016. }
  1017. # func_fatal_error ARG...
  1018. # -----------------------
  1019. # Echo program name prefixed message to standard error, and exit.
  1020. func_fatal_error ()
  1021. {
  1022. $debug_cmd
  1023. func_error "$*"
  1024. exit $EXIT_FAILURE
  1025. }
  1026. # func_grep EXPRESSION FILENAME
  1027. # -----------------------------
  1028. # Check whether EXPRESSION matches any line of FILENAME, without output.
  1029. func_grep ()
  1030. {
  1031. $debug_cmd
  1032. $GREP "$1" "$2" >/dev/null 2>&1
  1033. }
  1034. # func_len STRING
  1035. # ---------------
  1036. # Set func_len_result to the length of STRING. STRING may not
  1037. # start with a hyphen.
  1038. test -z "$_G_HAVE_XSI_OPS" \
  1039. && (eval 'x=a/b/c;
  1040. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1041. && _G_HAVE_XSI_OPS=yes
  1042. if test yes = "$_G_HAVE_XSI_OPS"; then
  1043. eval 'func_len ()
  1044. {
  1045. $debug_cmd
  1046. func_len_result=${#1}
  1047. }'
  1048. else
  1049. func_len ()
  1050. {
  1051. $debug_cmd
  1052. func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  1053. }
  1054. fi
  1055. # func_mkdir_p DIRECTORY-PATH
  1056. # ---------------------------
  1057. # Make sure the entire path to DIRECTORY-PATH is available.
  1058. func_mkdir_p ()
  1059. {
  1060. $debug_cmd
  1061. _G_directory_path=$1
  1062. _G_dir_list=
  1063. if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
  1064. # Protect directory names starting with '-'
  1065. case $_G_directory_path in
  1066. -*) _G_directory_path=./$_G_directory_path ;;
  1067. esac
  1068. # While some portion of DIR does not yet exist...
  1069. while test ! -d "$_G_directory_path"; do
  1070. # ...make a list in topmost first order. Use a colon delimited
  1071. # list incase some portion of path contains whitespace.
  1072. _G_dir_list=$_G_directory_path:$_G_dir_list
  1073. # If the last portion added has no slash in it, the list is done
  1074. case $_G_directory_path in */*) ;; *) break ;; esac
  1075. # ...otherwise throw away the child directory and loop
  1076. _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
  1077. done
  1078. _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
  1079. func_mkdir_p_IFS=$IFS; IFS=:
  1080. for _G_dir in $_G_dir_list; do
  1081. IFS=$func_mkdir_p_IFS
  1082. # mkdir can fail with a 'File exist' error if two processes
  1083. # try to create one of the directories concurrently. Don't
  1084. # stop in that case!
  1085. $MKDIR "$_G_dir" 2>/dev/null || :
  1086. done
  1087. IFS=$func_mkdir_p_IFS
  1088. # Bail out if we (or some other process) failed to create a directory.
  1089. test -d "$_G_directory_path" || \
  1090. func_fatal_error "Failed to create '$1'"
  1091. fi
  1092. }
  1093. # func_mktempdir [BASENAME]
  1094. # -------------------------
  1095. # Make a temporary directory that won't clash with other running
  1096. # libtool processes, and avoids race conditions if possible. If
  1097. # given, BASENAME is the basename for that directory.
  1098. func_mktempdir ()
  1099. {
  1100. $debug_cmd
  1101. _G_template=${TMPDIR-/tmp}/${1-$progname}
  1102. if test : = "$opt_dry_run"; then
  1103. # Return a directory name, but don't create it in dry-run mode
  1104. _G_tmpdir=$_G_template-$$
  1105. else
  1106. # If mktemp works, use that first and foremost
  1107. _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
  1108. if test ! -d "$_G_tmpdir"; then
  1109. # Failing that, at least try and use $RANDOM to avoid a race
  1110. _G_tmpdir=$_G_template-${RANDOM-0}$$
  1111. func_mktempdir_umask=`umask`
  1112. umask 0077
  1113. $MKDIR "$_G_tmpdir"
  1114. umask $func_mktempdir_umask
  1115. fi
  1116. # If we're not in dry-run mode, bomb out on failure
  1117. test -d "$_G_tmpdir" || \
  1118. func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
  1119. fi
  1120. $ECHO "$_G_tmpdir"
  1121. }
  1122. # func_normal_abspath PATH
  1123. # ------------------------
  1124. # Remove doubled-up and trailing slashes, "." path components,
  1125. # and cancel out any ".." path components in PATH after making
  1126. # it an absolute path.
  1127. func_normal_abspath ()
  1128. {
  1129. $debug_cmd
  1130. # These SED scripts presuppose an absolute path with a trailing slash.
  1131. _G_pathcar='s|^/\([^/]*\).*$|\1|'
  1132. _G_pathcdr='s|^/[^/]*||'
  1133. _G_removedotparts=':dotsl
  1134. s|/\./|/|g
  1135. t dotsl
  1136. s|/\.$|/|'
  1137. _G_collapseslashes='s|/\{1,\}|/|g'
  1138. _G_finalslash='s|/*$|/|'
  1139. # Start from root dir and reassemble the path.
  1140. func_normal_abspath_result=
  1141. func_normal_abspath_tpath=$1
  1142. func_normal_abspath_altnamespace=
  1143. case $func_normal_abspath_tpath in
  1144. "")
  1145. # Empty path, that just means $cwd.
  1146. func_stripname '' '/' "`pwd`"
  1147. func_normal_abspath_result=$func_stripname_result
  1148. return
  1149. ;;
  1150. # The next three entries are used to spot a run of precisely
  1151. # two leading slashes without using negated character classes;
  1152. # we take advantage of case's first-match behaviour.
  1153. ///*)
  1154. # Unusual form of absolute path, do nothing.
  1155. ;;
  1156. //*)
  1157. # Not necessarily an ordinary path; POSIX reserves leading '//'
  1158. # and for example Cygwin uses it to access remote file shares
  1159. # over CIFS/SMB, so we conserve a leading double slash if found.
  1160. func_normal_abspath_altnamespace=/
  1161. ;;
  1162. /*)
  1163. # Absolute path, do nothing.
  1164. ;;
  1165. *)
  1166. # Relative path, prepend $cwd.
  1167. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
  1168. ;;
  1169. esac
  1170. # Cancel out all the simple stuff to save iterations. We also want
  1171. # the path to end with a slash for ease of parsing, so make sure
  1172. # there is one (and only one) here.
  1173. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1174. -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
  1175. while :; do
  1176. # Processed it all yet?
  1177. if test / = "$func_normal_abspath_tpath"; then
  1178. # If we ascended to the root using ".." the result may be empty now.
  1179. if test -z "$func_normal_abspath_result"; then
  1180. func_normal_abspath_result=/
  1181. fi
  1182. break
  1183. fi
  1184. func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1185. -e "$_G_pathcar"`
  1186. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1187. -e "$_G_pathcdr"`
  1188. # Figure out what to do with it
  1189. case $func_normal_abspath_tcomponent in
  1190. "")
  1191. # Trailing empty path component, ignore it.
  1192. ;;
  1193. ..)
  1194. # Parent dir; strip last assembled component from result.
  1195. func_dirname "$func_normal_abspath_result"
  1196. func_normal_abspath_result=$func_dirname_result
  1197. ;;
  1198. *)
  1199. # Actual path component, append it.
  1200. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
  1201. ;;
  1202. esac
  1203. done
  1204. # Restore leading double-slash if one was found on entry.
  1205. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
  1206. }
  1207. # func_notquiet ARG...
  1208. # --------------------
  1209. # Echo program name prefixed message only when not in quiet mode.
  1210. func_notquiet ()
  1211. {
  1212. $debug_cmd
  1213. $opt_quiet || func_echo ${1+"$@"}
  1214. # A bug in bash halts the script if the last line of a function
  1215. # fails when set -e is in force, so we need another command to
  1216. # work around that:
  1217. :
  1218. }
  1219. # func_relative_path SRCDIR DSTDIR
  1220. # --------------------------------
  1221. # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
  1222. func_relative_path ()
  1223. {
  1224. $debug_cmd
  1225. func_relative_path_result=
  1226. func_normal_abspath "$1"
  1227. func_relative_path_tlibdir=$func_normal_abspath_result
  1228. func_normal_abspath "$2"
  1229. func_relative_path_tbindir=$func_normal_abspath_result
  1230. # Ascend the tree starting from libdir
  1231. while :; do
  1232. # check if we have found a prefix of bindir
  1233. case $func_relative_path_tbindir in
  1234. $func_relative_path_tlibdir)
  1235. # found an exact match
  1236. func_relative_path_tcancelled=
  1237. break
  1238. ;;
  1239. $func_relative_path_tlibdir*)
  1240. # found a matching prefix
  1241. func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
  1242. func_relative_path_tcancelled=$func_stripname_result
  1243. if test -z "$func_relative_path_result"; then
  1244. func_relative_path_result=.
  1245. fi
  1246. break
  1247. ;;
  1248. *)
  1249. func_dirname $func_relative_path_tlibdir
  1250. func_relative_path_tlibdir=$func_dirname_result
  1251. if test -z "$func_relative_path_tlibdir"; then
  1252. # Have to descend all the way to the root!
  1253. func_relative_path_result=../$func_relative_path_result
  1254. func_relative_path_tcancelled=$func_relative_path_tbindir
  1255. break
  1256. fi
  1257. func_relative_path_result=../$func_relative_path_result
  1258. ;;
  1259. esac
  1260. done
  1261. # Now calculate path; take care to avoid doubling-up slashes.
  1262. func_stripname '' '/' "$func_relative_path_result"
  1263. func_relative_path_result=$func_stripname_result
  1264. func_stripname '/' '/' "$func_relative_path_tcancelled"
  1265. if test -n "$func_stripname_result"; then
  1266. func_append func_relative_path_result "/$func_stripname_result"
  1267. fi
  1268. # Normalisation. If bindir is libdir, return '.' else relative path.
  1269. if test -n "$func_relative_path_result"; then
  1270. func_stripname './' '' "$func_relative_path_result"
  1271. func_relative_path_result=$func_stripname_result
  1272. fi
  1273. test -n "$func_relative_path_result" || func_relative_path_result=.
  1274. :
  1275. }
  1276. # func_quote_for_eval ARG...
  1277. # --------------------------
  1278. # Aesthetically quote ARGs to be evaled later.
  1279. # This function returns two values:
  1280. # i) func_quote_for_eval_result
  1281. # double-quoted, suitable for a subsequent eval
  1282. # ii) func_quote_for_eval_unquoted_result
  1283. # has all characters that are still active within double
  1284. # quotes backslashified.
  1285. func_quote_for_eval ()
  1286. {
  1287. $debug_cmd
  1288. func_quote_for_eval_unquoted_result=
  1289. func_quote_for_eval_result=
  1290. while test 0 -lt $#; do
  1291. case $1 in
  1292. *[\\\`\"\$]*)
  1293. _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
  1294. *)
  1295. _G_unquoted_arg=$1 ;;
  1296. esac
  1297. if test -n "$func_quote_for_eval_unquoted_result"; then
  1298. func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
  1299. else
  1300. func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
  1301. fi
  1302. case $_G_unquoted_arg in
  1303. # Double-quote args containing shell metacharacters to delay
  1304. # word splitting, command substitution and variable expansion
  1305. # for a subsequent eval.
  1306. # Many Bourne shells cannot handle close brackets correctly
  1307. # in scan sets, so we specify it separately.
  1308. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1309. _G_quoted_arg=\"$_G_unquoted_arg\"
  1310. ;;
  1311. *)
  1312. _G_quoted_arg=$_G_unquoted_arg
  1313. ;;
  1314. esac
  1315. if test -n "$func_quote_for_eval_result"; then
  1316. func_append func_quote_for_eval_result " $_G_quoted_arg"
  1317. else
  1318. func_append func_quote_for_eval_result "$_G_quoted_arg"
  1319. fi
  1320. shift
  1321. done
  1322. }
  1323. # func_quote_for_expand ARG
  1324. # -------------------------
  1325. # Aesthetically quote ARG to be evaled later; same as above,
  1326. # but do not quote variable references.
  1327. func_quote_for_expand ()
  1328. {
  1329. $debug_cmd
  1330. case $1 in
  1331. *[\\\`\"]*)
  1332. _G_arg=`$ECHO "$1" | $SED \
  1333. -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
  1334. *)
  1335. _G_arg=$1 ;;
  1336. esac
  1337. case $_G_arg in
  1338. # Double-quote args containing shell metacharacters to delay
  1339. # word splitting and command substitution for a subsequent eval.
  1340. # Many Bourne shells cannot handle close brackets correctly
  1341. # in scan sets, so we specify it separately.
  1342. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1343. _G_arg=\"$_G_arg\"
  1344. ;;
  1345. esac
  1346. func_quote_for_expand_result=$_G_arg
  1347. }
  1348. # func_stripname PREFIX SUFFIX NAME
  1349. # ---------------------------------
  1350. # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
  1351. # PREFIX and SUFFIX must not contain globbing or regex special
  1352. # characters, hashes, percent signs, but SUFFIX may contain a leading
  1353. # dot (in which case that matches only a dot).
  1354. if test yes = "$_G_HAVE_XSI_OPS"; then
  1355. eval 'func_stripname ()
  1356. {
  1357. $debug_cmd
  1358. # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  1359. # positional parameters, so assign one to ordinary variable first.
  1360. func_stripname_result=$3
  1361. func_stripname_result=${func_stripname_result#"$1"}
  1362. func_stripname_result=${func_stripname_result%"$2"}
  1363. }'
  1364. else
  1365. func_stripname ()
  1366. {
  1367. $debug_cmd
  1368. case $2 in
  1369. .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
  1370. *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
  1371. esac
  1372. }
  1373. fi
  1374. # func_show_eval CMD [FAIL_EXP]
  1375. # -----------------------------
  1376. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1377. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1378. # is given, then evaluate it.
  1379. func_show_eval ()
  1380. {
  1381. $debug_cmd
  1382. _G_cmd=$1
  1383. _G_fail_exp=${2-':'}
  1384. func_quote_for_expand "$_G_cmd"
  1385. eval "func_notquiet $func_quote_for_expand_result"
  1386. $opt_dry_run || {
  1387. eval "$_G_cmd"
  1388. _G_status=$?
  1389. if test 0 -ne "$_G_status"; then
  1390. eval "(exit $_G_status); $_G_fail_exp"
  1391. fi
  1392. }
  1393. }
  1394. # func_show_eval_locale CMD [FAIL_EXP]
  1395. # ------------------------------------
  1396. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1397. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1398. # is given, then evaluate it. Use the saved locale for evaluation.
  1399. func_show_eval_locale ()
  1400. {
  1401. $debug_cmd
  1402. _G_cmd=$1
  1403. _G_fail_exp=${2-':'}
  1404. $opt_quiet || {
  1405. func_quote_for_expand "$_G_cmd"
  1406. eval "func_echo $func_quote_for_expand_result"
  1407. }
  1408. $opt_dry_run || {
  1409. eval "$_G_user_locale
  1410. $_G_cmd"
  1411. _G_status=$?
  1412. eval "$_G_safe_locale"
  1413. if test 0 -ne "$_G_status"; then
  1414. eval "(exit $_G_status); $_G_fail_exp"
  1415. fi
  1416. }
  1417. }
  1418. # func_tr_sh
  1419. # ----------
  1420. # Turn $1 into a string suitable for a shell variable name.
  1421. # Result is stored in $func_tr_sh_result. All characters
  1422. # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
  1423. # if $1 begins with a digit, a '_' is prepended as well.
  1424. func_tr_sh ()
  1425. {
  1426. $debug_cmd
  1427. case $1 in
  1428. [0-9]* | *[!a-zA-Z0-9_]*)
  1429. func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
  1430. ;;
  1431. * )
  1432. func_tr_sh_result=$1
  1433. ;;
  1434. esac
  1435. }
  1436. # func_verbose ARG...
  1437. # -------------------
  1438. # Echo program name prefixed message in verbose mode only.
  1439. func_verbose ()
  1440. {
  1441. $debug_cmd
  1442. $opt_verbose && func_echo "$*"
  1443. :
  1444. }
  1445. # func_warn_and_continue ARG...
  1446. # -----------------------------
  1447. # Echo program name prefixed warning message to standard error.
  1448. func_warn_and_continue ()
  1449. {
  1450. $debug_cmd
  1451. $require_term_colors
  1452. func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
  1453. }
  1454. # func_warning CATEGORY ARG...
  1455. # ----------------------------
  1456. # Echo program name prefixed warning message to standard error. Warning
  1457. # messages can be filtered according to CATEGORY, where this function
  1458. # elides messages where CATEGORY is not listed in the global variable
  1459. # 'opt_warning_types'.
  1460. func_warning ()
  1461. {
  1462. $debug_cmd
  1463. # CATEGORY must be in the warning_categories list!
  1464. case " $warning_categories " in
  1465. *" $1 "*) ;;
  1466. *) func_internal_error "invalid warning category '$1'" ;;
  1467. esac
  1468. _G_category=$1
  1469. shift
  1470. case " $opt_warning_types " in
  1471. *" $_G_category "*) $warning_func ${1+"$@"} ;;
  1472. esac
  1473. }
  1474. # func_sort_ver VER1 VER2
  1475. # -----------------------
  1476. # 'sort -V' is not generally available.
  1477. # Note this deviates from the version comparison in automake
  1478. # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
  1479. # but this should suffice as we won't be specifying old
  1480. # version formats or redundant trailing .0 in bootstrap.conf.
  1481. # If we did want full compatibility then we should probably
  1482. # use m4_version_compare from autoconf.
  1483. func_sort_ver ()
  1484. {
  1485. $debug_cmd
  1486. printf '%s\n%s\n' "$1" "$2" \
  1487. | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
  1488. }
  1489. # func_lt_ver PREV CURR
  1490. # ---------------------
  1491. # Return true if PREV and CURR are in the correct order according to
  1492. # func_sort_ver, otherwise false. Use it like this:
  1493. #
  1494. # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
  1495. func_lt_ver ()
  1496. {
  1497. $debug_cmd
  1498. test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
  1499. }
  1500. # Local variables:
  1501. # mode: shell-script
  1502. # sh-indentation: 2
  1503. # eval: (add-hook 'before-save-hook 'time-stamp)
  1504. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  1505. # time-stamp-time-zone: "UTC"
  1506. # End:
  1507. #! /bin/sh
  1508. # Set a version string for this script.
  1509. scriptversion=2014-01-07.03; # UTC
  1510. # A portable, pluggable option parser for Bourne shell.
  1511. # Written by Gary V. Vaughan, 2010
  1512. # Copyright (C) 2010-2015 Free Software Foundation, Inc.
  1513. # This is free software; see the source for copying conditions. There is NO
  1514. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1515. # This program is free software: you can redistribute it and/or modify
  1516. # it under the terms of the GNU General Public License as published by
  1517. # the Free Software Foundation, either version 3 of the License, or
  1518. # (at your option) any later version.
  1519. # This program is distributed in the hope that it will be useful,
  1520. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  1521. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1522. # GNU General Public License for more details.
  1523. # You should have received a copy of the GNU General Public License
  1524. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  1525. # Please report bugs or propose patches to gary@gnu.org.
  1526. ## ------ ##
  1527. ## Usage. ##
  1528. ## ------ ##
  1529. # This file is a library for parsing options in your shell scripts along
  1530. # with assorted other useful supporting features that you can make use
  1531. # of too.
  1532. #
  1533. # For the simplest scripts you might need only:
  1534. #
  1535. # #!/bin/sh
  1536. # . relative/path/to/funclib.sh
  1537. # . relative/path/to/options-parser
  1538. # scriptversion=1.0
  1539. # func_options ${1+"$@"}
  1540. # eval set dummy "$func_options_result"; shift
  1541. # ...rest of your script...
  1542. #
  1543. # In order for the '--version' option to work, you will need to have a
  1544. # suitably formatted comment like the one at the top of this file
  1545. # starting with '# Written by ' and ending with '# warranty; '.
  1546. #
  1547. # For '-h' and '--help' to work, you will also need a one line
  1548. # description of your script's purpose in a comment directly above the
  1549. # '# Written by ' line, like the one at the top of this file.
  1550. #
  1551. # The default options also support '--debug', which will turn on shell
  1552. # execution tracing (see the comment above debug_cmd below for another
  1553. # use), and '--verbose' and the func_verbose function to allow your script
  1554. # to display verbose messages only when your user has specified
  1555. # '--verbose'.
  1556. #
  1557. # After sourcing this file, you can plug processing for additional
  1558. # options by amending the variables from the 'Configuration' section
  1559. # below, and following the instructions in the 'Option parsing'
  1560. # section further down.
  1561. ## -------------- ##
  1562. ## Configuration. ##
  1563. ## -------------- ##
  1564. # You should override these variables in your script after sourcing this
  1565. # file so that they reflect the customisations you have added to the
  1566. # option parser.
  1567. # The usage line for option parsing errors and the start of '-h' and
  1568. # '--help' output messages. You can embed shell variables for delayed
  1569. # expansion at the time the message is displayed, but you will need to
  1570. # quote other shell meta-characters carefully to prevent them being
  1571. # expanded when the contents are evaled.
  1572. usage='$progpath [OPTION]...'
  1573. # Short help message in response to '-h' and '--help'. Add to this or
  1574. # override it after sourcing this library to reflect the full set of
  1575. # options your script accepts.
  1576. usage_message="\
  1577. --debug enable verbose shell tracing
  1578. -W, --warnings=CATEGORY
  1579. report the warnings falling in CATEGORY [all]
  1580. -v, --verbose verbosely report processing
  1581. --version print version information and exit
  1582. -h, --help print short or long help message and exit
  1583. "
  1584. # Additional text appended to 'usage_message' in response to '--help'.
  1585. long_help_message="
  1586. Warning categories include:
  1587. 'all' show all warnings
  1588. 'none' turn off all the warnings
  1589. 'error' warnings are treated as fatal errors"
  1590. # Help message printed before fatal option parsing errors.
  1591. fatal_help="Try '\$progname --help' for more information."
  1592. ## ------------------------- ##
  1593. ## Hook function management. ##
  1594. ## ------------------------- ##
  1595. # This section contains functions for adding, removing, and running hooks
  1596. # to the main code. A hook is just a named list of of function, that can
  1597. # be run in order later on.
  1598. # func_hookable FUNC_NAME
  1599. # -----------------------
  1600. # Declare that FUNC_NAME will run hooks added with
  1601. # 'func_add_hook FUNC_NAME ...'.
  1602. func_hookable ()
  1603. {
  1604. $debug_cmd
  1605. func_append hookable_fns " $1"
  1606. }
  1607. # func_add_hook FUNC_NAME HOOK_FUNC
  1608. # ---------------------------------
  1609. # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
  1610. # first have been declared "hookable" by a call to 'func_hookable'.
  1611. func_add_hook ()
  1612. {
  1613. $debug_cmd
  1614. case " $hookable_fns " in
  1615. *" $1 "*) ;;
  1616. *) func_fatal_error "'$1' does not accept hook functions." ;;
  1617. esac
  1618. eval func_append ${1}_hooks '" $2"'
  1619. }
  1620. # func_remove_hook FUNC_NAME HOOK_FUNC
  1621. # ------------------------------------
  1622. # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
  1623. func_remove_hook ()
  1624. {
  1625. $debug_cmd
  1626. eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
  1627. }
  1628. # func_run_hooks FUNC_NAME [ARG]...
  1629. # ---------------------------------
  1630. # Run all hook functions registered to FUNC_NAME.
  1631. # It is assumed that the list of hook functions contains nothing more
  1632. # than a whitespace-delimited list of legal shell function names, and
  1633. # no effort is wasted trying to catch shell meta-characters or preserve
  1634. # whitespace.
  1635. func_run_hooks ()
  1636. {
  1637. $debug_cmd
  1638. case " $hookable_fns " in
  1639. *" $1 "*) ;;
  1640. *) func_fatal_error "'$1' does not support hook funcions.n" ;;
  1641. esac
  1642. eval _G_hook_fns=\$$1_hooks; shift
  1643. for _G_hook in $_G_hook_fns; do
  1644. eval $_G_hook '"$@"'
  1645. # store returned options list back into positional
  1646. # parameters for next 'cmd' execution.
  1647. eval _G_hook_result=\$${_G_hook}_result
  1648. eval set dummy "$_G_hook_result"; shift
  1649. done
  1650. func_quote_for_eval ${1+"$@"}
  1651. func_run_hooks_result=$func_quote_for_eval_result
  1652. }
  1653. ## --------------- ##
  1654. ## Option parsing. ##
  1655. ## --------------- ##
  1656. # In order to add your own option parsing hooks, you must accept the
  1657. # full positional parameter list in your hook function, remove any
  1658. # options that you action, and then pass back the remaining unprocessed
  1659. # options in '<hooked_function_name>_result', escaped suitably for
  1660. # 'eval'. Like this:
  1661. #
  1662. # my_options_prep ()
  1663. # {
  1664. # $debug_cmd
  1665. #
  1666. # # Extend the existing usage message.
  1667. # usage_message=$usage_message'
  1668. # -s, --silent don'\''t print informational messages
  1669. # '
  1670. #
  1671. # func_quote_for_eval ${1+"$@"}
  1672. # my_options_prep_result=$func_quote_for_eval_result
  1673. # }
  1674. # func_add_hook func_options_prep my_options_prep
  1675. #
  1676. #
  1677. # my_silent_option ()
  1678. # {
  1679. # $debug_cmd
  1680. #
  1681. # # Note that for efficiency, we parse as many options as we can
  1682. # # recognise in a loop before passing the remainder back to the
  1683. # # caller on the first unrecognised argument we encounter.
  1684. # while test $# -gt 0; do
  1685. # opt=$1; shift
  1686. # case $opt in
  1687. # --silent|-s) opt_silent=: ;;
  1688. # # Separate non-argument short options:
  1689. # -s*) func_split_short_opt "$_G_opt"
  1690. # set dummy "$func_split_short_opt_name" \
  1691. # "-$func_split_short_opt_arg" ${1+"$@"}
  1692. # shift
  1693. # ;;
  1694. # *) set dummy "$_G_opt" "$*"; shift; break ;;
  1695. # esac
  1696. # done
  1697. #
  1698. # func_quote_for_eval ${1+"$@"}
  1699. # my_silent_option_result=$func_quote_for_eval_result
  1700. # }
  1701. # func_add_hook func_parse_options my_silent_option
  1702. #
  1703. #
  1704. # my_option_validation ()
  1705. # {
  1706. # $debug_cmd
  1707. #
  1708. # $opt_silent && $opt_verbose && func_fatal_help "\
  1709. # '--silent' and '--verbose' options are mutually exclusive."
  1710. #
  1711. # func_quote_for_eval ${1+"$@"}
  1712. # my_option_validation_result=$func_quote_for_eval_result
  1713. # }
  1714. # func_add_hook func_validate_options my_option_validation
  1715. #
  1716. # You'll alse need to manually amend $usage_message to reflect the extra
  1717. # options you parse. It's preferable to append if you can, so that
  1718. # multiple option parsing hooks can be added safely.
  1719. # func_options [ARG]...
  1720. # ---------------------
  1721. # All the functions called inside func_options are hookable. See the
  1722. # individual implementations for details.
  1723. func_hookable func_options
  1724. func_options ()
  1725. {
  1726. $debug_cmd
  1727. func_options_prep ${1+"$@"}
  1728. eval func_parse_options \
  1729. ${func_options_prep_result+"$func_options_prep_result"}
  1730. eval func_validate_options \
  1731. ${func_parse_options_result+"$func_parse_options_result"}
  1732. eval func_run_hooks func_options \
  1733. ${func_validate_options_result+"$func_validate_options_result"}
  1734. # save modified positional parameters for caller
  1735. func_options_result=$func_run_hooks_result
  1736. }
  1737. # func_options_prep [ARG]...
  1738. # --------------------------
  1739. # All initialisations required before starting the option parse loop.
  1740. # Note that when calling hook functions, we pass through the list of
  1741. # positional parameters. If a hook function modifies that list, and
  1742. # needs to propogate that back to rest of this script, then the complete
  1743. # modified list must be put in 'func_run_hooks_result' before
  1744. # returning.
  1745. func_hookable func_options_prep
  1746. func_options_prep ()
  1747. {
  1748. $debug_cmd
  1749. # Option defaults:
  1750. opt_verbose=false
  1751. opt_warning_types=
  1752. func_run_hooks func_options_prep ${1+"$@"}
  1753. # save modified positional parameters for caller
  1754. func_options_prep_result=$func_run_hooks_result
  1755. }
  1756. # func_parse_options [ARG]...
  1757. # ---------------------------
  1758. # The main option parsing loop.
  1759. func_hookable func_parse_options
  1760. func_parse_options ()
  1761. {
  1762. $debug_cmd
  1763. func_parse_options_result=
  1764. # this just eases exit handling
  1765. while test $# -gt 0; do
  1766. # Defer to hook functions for initial option parsing, so they
  1767. # get priority in the event of reusing an option name.
  1768. func_run_hooks func_parse_options ${1+"$@"}
  1769. # Adjust func_parse_options positional parameters to match
  1770. eval set dummy "$func_run_hooks_result"; shift
  1771. # Break out of the loop if we already parsed every option.
  1772. test $# -gt 0 || break
  1773. _G_opt=$1
  1774. shift
  1775. case $_G_opt in
  1776. --debug|-x) debug_cmd='set -x'
  1777. func_echo "enabling shell trace mode"
  1778. $debug_cmd
  1779. ;;
  1780. --no-warnings|--no-warning|--no-warn)
  1781. set dummy --warnings none ${1+"$@"}
  1782. shift
  1783. ;;
  1784. --warnings|--warning|-W)
  1785. test $# = 0 && func_missing_arg $_G_opt && break
  1786. case " $warning_categories $1" in
  1787. *" $1 "*)
  1788. # trailing space prevents matching last $1 above
  1789. func_append_uniq opt_warning_types " $1"
  1790. ;;
  1791. *all)
  1792. opt_warning_types=$warning_categories
  1793. ;;
  1794. *none)
  1795. opt_warning_types=none
  1796. warning_func=:
  1797. ;;
  1798. *error)
  1799. opt_warning_types=$warning_categories
  1800. warning_func=func_fatal_error
  1801. ;;
  1802. *)
  1803. func_fatal_error \
  1804. "unsupported warning category: '$1'"
  1805. ;;
  1806. esac
  1807. shift
  1808. ;;
  1809. --verbose|-v) opt_verbose=: ;;
  1810. --version) func_version ;;
  1811. -\?|-h) func_usage ;;
  1812. --help) func_help ;;
  1813. # Separate optargs to long options (plugins may need this):
  1814. --*=*) func_split_equals "$_G_opt"
  1815. set dummy "$func_split_equals_lhs" \
  1816. "$func_split_equals_rhs" ${1+"$@"}
  1817. shift
  1818. ;;
  1819. # Separate optargs to short options:
  1820. -W*)
  1821. func_split_short_opt "$_G_opt"
  1822. set dummy "$func_split_short_opt_name" \
  1823. "$func_split_short_opt_arg" ${1+"$@"}
  1824. shift
  1825. ;;
  1826. # Separate non-argument short options:
  1827. -\?*|-h*|-v*|-x*)
  1828. func_split_short_opt "$_G_opt"
  1829. set dummy "$func_split_short_opt_name" \
  1830. "-$func_split_short_opt_arg" ${1+"$@"}
  1831. shift
  1832. ;;
  1833. --) break ;;
  1834. -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
  1835. *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  1836. esac
  1837. done
  1838. # save modified positional parameters for caller
  1839. func_quote_for_eval ${1+"$@"}
  1840. func_parse_options_result=$func_quote_for_eval_result
  1841. }
  1842. # func_validate_options [ARG]...
  1843. # ------------------------------
  1844. # Perform any sanity checks on option settings and/or unconsumed
  1845. # arguments.
  1846. func_hookable func_validate_options
  1847. func_validate_options ()
  1848. {
  1849. $debug_cmd
  1850. # Display all warnings if -W was not given.
  1851. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  1852. func_run_hooks func_validate_options ${1+"$@"}
  1853. # Bail if the options were screwed!
  1854. $exit_cmd $EXIT_FAILURE
  1855. # save modified positional parameters for caller
  1856. func_validate_options_result=$func_run_hooks_result
  1857. }
  1858. ## ----------------- ##
  1859. ## Helper functions. ##
  1860. ## ----------------- ##
  1861. # This section contains the helper functions used by the rest of the
  1862. # hookable option parser framework in ascii-betical order.
  1863. # func_fatal_help ARG...
  1864. # ----------------------
  1865. # Echo program name prefixed message to standard error, followed by
  1866. # a help hint, and exit.
  1867. func_fatal_help ()
  1868. {
  1869. $debug_cmd
  1870. eval \$ECHO \""Usage: $usage"\"
  1871. eval \$ECHO \""$fatal_help"\"
  1872. func_error ${1+"$@"}
  1873. exit $EXIT_FAILURE
  1874. }
  1875. # func_help
  1876. # ---------
  1877. # Echo long help message to standard output and exit.
  1878. func_help ()
  1879. {
  1880. $debug_cmd
  1881. func_usage_message
  1882. $ECHO "$long_help_message"
  1883. exit 0
  1884. }
  1885. # func_missing_arg ARGNAME
  1886. # ------------------------
  1887. # Echo program name prefixed message to standard error and set global
  1888. # exit_cmd.
  1889. func_missing_arg ()
  1890. {
  1891. $debug_cmd
  1892. func_error "Missing argument for '$1'."
  1893. exit_cmd=exit
  1894. }
  1895. # func_split_equals STRING
  1896. # ------------------------
  1897. # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
  1898. # splitting STRING at the '=' sign.
  1899. test -z "$_G_HAVE_XSI_OPS" \
  1900. && (eval 'x=a/b/c;
  1901. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1902. && _G_HAVE_XSI_OPS=yes
  1903. if test yes = "$_G_HAVE_XSI_OPS"
  1904. then
  1905. # This is an XSI compatible shell, allowing a faster implementation...
  1906. eval 'func_split_equals ()
  1907. {
  1908. $debug_cmd
  1909. func_split_equals_lhs=${1%%=*}
  1910. func_split_equals_rhs=${1#*=}
  1911. test "x$func_split_equals_lhs" = "x$1" \
  1912. && func_split_equals_rhs=
  1913. }'
  1914. else
  1915. # ...otherwise fall back to using expr, which is often a shell builtin.
  1916. func_split_equals ()
  1917. {
  1918. $debug_cmd
  1919. func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
  1920. func_split_equals_rhs=
  1921. test "x$func_split_equals_lhs" = "x$1" \
  1922. || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  1923. }
  1924. fi #func_split_equals
  1925. # func_split_short_opt SHORTOPT
  1926. # -----------------------------
  1927. # Set func_split_short_opt_name and func_split_short_opt_arg shell
  1928. # variables after splitting SHORTOPT after the 2nd character.
  1929. if test yes = "$_G_HAVE_XSI_OPS"
  1930. then
  1931. # This is an XSI compatible shell, allowing a faster implementation...
  1932. eval 'func_split_short_opt ()
  1933. {
  1934. $debug_cmd
  1935. func_split_short_opt_arg=${1#??}
  1936. func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  1937. }'
  1938. else
  1939. # ...otherwise fall back to using expr, which is often a shell builtin.
  1940. func_split_short_opt ()
  1941. {
  1942. $debug_cmd
  1943. func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
  1944. func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  1945. }
  1946. fi #func_split_short_opt
  1947. # func_usage
  1948. # ----------
  1949. # Echo short help message to standard output and exit.
  1950. func_usage ()
  1951. {
  1952. $debug_cmd
  1953. func_usage_message
  1954. $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
  1955. exit 0
  1956. }
  1957. # func_usage_message
  1958. # ------------------
  1959. # Echo short help message to standard output.
  1960. func_usage_message ()
  1961. {
  1962. $debug_cmd
  1963. eval \$ECHO \""Usage: $usage"\"
  1964. echo
  1965. $SED -n 's|^# ||
  1966. /^Written by/{
  1967. x;p;x
  1968. }
  1969. h
  1970. /^Written by/q' < "$progpath"
  1971. echo
  1972. eval \$ECHO \""$usage_message"\"
  1973. }
  1974. # func_version
  1975. # ------------
  1976. # Echo version message to standard output and exit.
  1977. func_version ()
  1978. {
  1979. $debug_cmd
  1980. printf '%s\n' "$progname $scriptversion"
  1981. $SED -n '
  1982. /(C)/!b go
  1983. :more
  1984. /\./!{
  1985. N
  1986. s|\n# | |
  1987. b more
  1988. }
  1989. :go
  1990. /^# Written by /,/# warranty; / {
  1991. s|^# ||
  1992. s|^# *$||
  1993. s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
  1994. p
  1995. }
  1996. /^# Written by / {
  1997. s|^# ||
  1998. p
  1999. }
  2000. /^warranty; /q' < "$progpath"
  2001. exit $?
  2002. }
  2003. # Local variables:
  2004. # mode: shell-script
  2005. # sh-indentation: 2
  2006. # eval: (add-hook 'before-save-hook 'time-stamp)
  2007. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  2008. # time-stamp-time-zone: "UTC"
  2009. # End:
  2010. # Set a version string.
  2011. scriptversion='(GNU libtool) 2.4.6'
  2012. # func_echo ARG...
  2013. # ----------------
  2014. # Libtool also displays the current mode in messages, so override
  2015. # funclib.sh func_echo with this custom definition.
  2016. func_echo ()
  2017. {
  2018. $debug_cmd
  2019. _G_message=$*
  2020. func_echo_IFS=$IFS
  2021. IFS=$nl
  2022. for _G_line in $_G_message; do
  2023. IFS=$func_echo_IFS
  2024. $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
  2025. done
  2026. IFS=$func_echo_IFS
  2027. }
  2028. # func_warning ARG...
  2029. # -------------------
  2030. # Libtool warnings are not categorized, so override funclib.sh
  2031. # func_warning with this simpler definition.
  2032. func_warning ()
  2033. {
  2034. $debug_cmd
  2035. $warning_func ${1+"$@"}
  2036. }
  2037. ## ---------------- ##
  2038. ## Options parsing. ##
  2039. ## ---------------- ##
  2040. # Hook in the functions to make sure our own options are parsed during
  2041. # the option parsing loop.
  2042. usage='$progpath [OPTION]... [MODE-ARG]...'
  2043. # Short help message in response to '-h'.
  2044. usage_message="Options:
  2045. --config show all configuration variables
  2046. --debug enable verbose shell tracing
  2047. -n, --dry-run display commands without modifying any files
  2048. --features display basic configuration information and exit
  2049. --mode=MODE use operation mode MODE
  2050. --no-warnings equivalent to '-Wnone'
  2051. --preserve-dup-deps don't remove duplicate dependency libraries
  2052. --quiet, --silent don't print informational messages
  2053. --tag=TAG use configuration variables from tag TAG
  2054. -v, --verbose print more informational messages than default
  2055. --version print version information
  2056. -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
  2057. -h, --help, --help-all print short, long, or detailed help message
  2058. "
  2059. # Additional text appended to 'usage_message' in response to '--help'.
  2060. func_help ()
  2061. {
  2062. $debug_cmd
  2063. func_usage_message
  2064. $ECHO "$long_help_message
  2065. MODE must be one of the following:
  2066. clean remove files from the build directory
  2067. compile compile a source file into a libtool object
  2068. execute automatically set library path, then run a program
  2069. finish complete the installation of libtool libraries
  2070. install install libraries or executables
  2071. link create a library or an executable
  2072. uninstall remove libraries from an installed directory
  2073. MODE-ARGS vary depending on the MODE. When passed as first option,
  2074. '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
  2075. Try '$progname --help --mode=MODE' for a more detailed description of MODE.
  2076. When reporting a bug, please describe a test case to reproduce it and
  2077. include the following information:
  2078. host-triplet: $host
  2079. shell: $SHELL
  2080. compiler: $LTCC
  2081. compiler flags: $LTCFLAGS
  2082. linker: $LD (gnu? $with_gnu_ld)
  2083. version: $progname $scriptversion Debian-2.4.6-2
  2084. automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
  2085. autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
  2086. Report bugs to <bug-libtool@gnu.org>.
  2087. GNU libtool home page: <http://www.gnu.org/s/libtool/>.
  2088. General help using GNU software: <http://www.gnu.org/gethelp/>."
  2089. exit 0
  2090. }
  2091. # func_lo2o OBJECT-NAME
  2092. # ---------------------
  2093. # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
  2094. # object suffix.
  2095. lo2o=s/\\.lo\$/.$objext/
  2096. o2lo=s/\\.$objext\$/.lo/
  2097. if test yes = "$_G_HAVE_XSI_OPS"; then
  2098. eval 'func_lo2o ()
  2099. {
  2100. case $1 in
  2101. *.lo) func_lo2o_result=${1%.lo}.$objext ;;
  2102. * ) func_lo2o_result=$1 ;;
  2103. esac
  2104. }'
  2105. # func_xform LIBOBJ-OR-SOURCE
  2106. # ---------------------------
  2107. # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
  2108. # suffix to a '.lo' libtool-object suffix.
  2109. eval 'func_xform ()
  2110. {
  2111. func_xform_result=${1%.*}.lo
  2112. }'
  2113. else
  2114. # ...otherwise fall back to using sed.
  2115. func_lo2o ()
  2116. {
  2117. func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
  2118. }
  2119. func_xform ()
  2120. {
  2121. func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
  2122. }
  2123. fi
  2124. # func_fatal_configuration ARG...
  2125. # -------------------------------
  2126. # Echo program name prefixed message to standard error, followed by
  2127. # a configuration failure hint, and exit.
  2128. func_fatal_configuration ()
  2129. {
  2130. func__fatal_error ${1+"$@"} \
  2131. "See the $PACKAGE documentation for more information." \
  2132. "Fatal configuration error."
  2133. }
  2134. # func_config
  2135. # -----------
  2136. # Display the configuration for all the tags in this script.
  2137. func_config ()
  2138. {
  2139. re_begincf='^# ### BEGIN LIBTOOL'
  2140. re_endcf='^# ### END LIBTOOL'
  2141. # Default configuration.
  2142. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  2143. # Now print the configurations for the tags.
  2144. for tagname in $taglist; do
  2145. $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  2146. done
  2147. exit $?
  2148. }
  2149. # func_features
  2150. # -------------
  2151. # Display the features supported by this script.
  2152. func_features ()
  2153. {
  2154. echo "host: $host"
  2155. if test yes = "$build_libtool_libs"; then
  2156. echo "enable shared libraries"
  2157. else
  2158. echo "disable shared libraries"
  2159. fi
  2160. if test yes = "$build_old_libs"; then
  2161. echo "enable static libraries"
  2162. else
  2163. echo "disable static libraries"
  2164. fi
  2165. exit $?
  2166. }
  2167. # func_enable_tag TAGNAME
  2168. # -----------------------
  2169. # Verify that TAGNAME is valid, and either flag an error and exit, or
  2170. # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  2171. # variable here.
  2172. func_enable_tag ()
  2173. {
  2174. # Global variable:
  2175. tagname=$1
  2176. re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  2177. re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  2178. sed_extractcf=/$re_begincf/,/$re_endcf/p
  2179. # Validate tagname.
  2180. case $tagname in
  2181. *[!-_A-Za-z0-9,/]*)
  2182. func_fatal_error "invalid tag name: $tagname"
  2183. ;;
  2184. esac
  2185. # Don't test for the "default" C tag, as we know it's
  2186. # there but not specially marked.
  2187. case $tagname in
  2188. CC) ;;
  2189. *)
  2190. if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  2191. taglist="$taglist $tagname"
  2192. # Evaluate the configuration. Be careful to quote the path
  2193. # and the sed script, to avoid splitting on whitespace, but
  2194. # also don't use non-portable quotes within backquotes within
  2195. # quotes we have to do it in 2 steps:
  2196. extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  2197. eval "$extractedcf"
  2198. else
  2199. func_error "ignoring unknown tag $tagname"
  2200. fi
  2201. ;;
  2202. esac
  2203. }
  2204. # func_check_version_match
  2205. # ------------------------
  2206. # Ensure that we are using m4 macros, and libtool script from the same
  2207. # release of libtool.
  2208. func_check_version_match ()
  2209. {
  2210. if test "$package_revision" != "$macro_revision"; then
  2211. if test "$VERSION" != "$macro_version"; then
  2212. if test -z "$macro_version"; then
  2213. cat >&2 <<_LT_EOF
  2214. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2215. $progname: definition of this LT_INIT comes from an older release.
  2216. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2217. $progname: and run autoconf again.
  2218. _LT_EOF
  2219. else
  2220. cat >&2 <<_LT_EOF
  2221. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2222. $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  2223. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2224. $progname: and run autoconf again.
  2225. _LT_EOF
  2226. fi
  2227. else
  2228. cat >&2 <<_LT_EOF
  2229. $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  2230. $progname: but the definition of this LT_INIT comes from revision $macro_revision.
  2231. $progname: You should recreate aclocal.m4 with macros from revision $package_revision
  2232. $progname: of $PACKAGE $VERSION and run autoconf again.
  2233. _LT_EOF
  2234. fi
  2235. exit $EXIT_MISMATCH
  2236. fi
  2237. }
  2238. # libtool_options_prep [ARG]...
  2239. # -----------------------------
  2240. # Preparation for options parsed by libtool.
  2241. libtool_options_prep ()
  2242. {
  2243. $debug_mode
  2244. # Option defaults:
  2245. opt_config=false
  2246. opt_dlopen=
  2247. opt_dry_run=false
  2248. opt_help=false
  2249. opt_mode=
  2250. opt_preserve_dup_deps=false
  2251. opt_quiet=false
  2252. nonopt=
  2253. preserve_args=
  2254. # Shorthand for --mode=foo, only valid as the first argument
  2255. case $1 in
  2256. clean|clea|cle|cl)
  2257. shift; set dummy --mode clean ${1+"$@"}; shift
  2258. ;;
  2259. compile|compil|compi|comp|com|co|c)
  2260. shift; set dummy --mode compile ${1+"$@"}; shift
  2261. ;;
  2262. execute|execut|execu|exec|exe|ex|e)
  2263. shift; set dummy --mode execute ${1+"$@"}; shift
  2264. ;;
  2265. finish|finis|fini|fin|fi|f)
  2266. shift; set dummy --mode finish ${1+"$@"}; shift
  2267. ;;
  2268. install|instal|insta|inst|ins|in|i)
  2269. shift; set dummy --mode install ${1+"$@"}; shift
  2270. ;;
  2271. link|lin|li|l)
  2272. shift; set dummy --mode link ${1+"$@"}; shift
  2273. ;;
  2274. uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  2275. shift; set dummy --mode uninstall ${1+"$@"}; shift
  2276. ;;
  2277. esac
  2278. # Pass back the list of options.
  2279. func_quote_for_eval ${1+"$@"}
  2280. libtool_options_prep_result=$func_quote_for_eval_result
  2281. }
  2282. func_add_hook func_options_prep libtool_options_prep
  2283. # libtool_parse_options [ARG]...
  2284. # ---------------------------------
  2285. # Provide handling for libtool specific options.
  2286. libtool_parse_options ()
  2287. {
  2288. $debug_cmd
  2289. # Perform our own loop to consume as many options as possible in
  2290. # each iteration.
  2291. while test $# -gt 0; do
  2292. _G_opt=$1
  2293. shift
  2294. case $_G_opt in
  2295. --dry-run|--dryrun|-n)
  2296. opt_dry_run=:
  2297. ;;
  2298. --config) func_config ;;
  2299. --dlopen|-dlopen)
  2300. opt_dlopen="${opt_dlopen+$opt_dlopen
  2301. }$1"
  2302. shift
  2303. ;;
  2304. --preserve-dup-deps)
  2305. opt_preserve_dup_deps=: ;;
  2306. --features) func_features ;;
  2307. --finish) set dummy --mode finish ${1+"$@"}; shift ;;
  2308. --help) opt_help=: ;;
  2309. --help-all) opt_help=': help-all' ;;
  2310. --mode) test $# = 0 && func_missing_arg $_G_opt && break
  2311. opt_mode=$1
  2312. case $1 in
  2313. # Valid mode arguments:
  2314. clean|compile|execute|finish|install|link|relink|uninstall) ;;
  2315. # Catch anything else as an error
  2316. *) func_error "invalid argument for $_G_opt"
  2317. exit_cmd=exit
  2318. break
  2319. ;;
  2320. esac
  2321. shift
  2322. ;;
  2323. --no-silent|--no-quiet)
  2324. opt_quiet=false
  2325. func_append preserve_args " $_G_opt"
  2326. ;;
  2327. --no-warnings|--no-warning|--no-warn)
  2328. opt_warning=false
  2329. func_append preserve_args " $_G_opt"
  2330. ;;
  2331. --no-verbose)
  2332. opt_verbose=false
  2333. func_append preserve_args " $_G_opt"
  2334. ;;
  2335. --silent|--quiet)
  2336. opt_quiet=:
  2337. opt_verbose=false
  2338. func_append preserve_args " $_G_opt"
  2339. ;;
  2340. --tag) test $# = 0 && func_missing_arg $_G_opt && break
  2341. opt_tag=$1
  2342. func_append preserve_args " $_G_opt $1"
  2343. func_enable_tag "$1"
  2344. shift
  2345. ;;
  2346. --verbose|-v) opt_quiet=false
  2347. opt_verbose=:
  2348. func_append preserve_args " $_G_opt"
  2349. ;;
  2350. # An option not handled by this hook function:
  2351. *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  2352. esac
  2353. done
  2354. # save modified positional parameters for caller
  2355. func_quote_for_eval ${1+"$@"}
  2356. libtool_parse_options_result=$func_quote_for_eval_result
  2357. }
  2358. func_add_hook func_parse_options libtool_parse_options
  2359. # libtool_validate_options [ARG]...
  2360. # ---------------------------------
  2361. # Perform any sanity checks on option settings and/or unconsumed
  2362. # arguments.
  2363. libtool_validate_options ()
  2364. {
  2365. # save first non-option argument
  2366. if test 0 -lt $#; then
  2367. nonopt=$1
  2368. shift
  2369. fi
  2370. # preserve --debug
  2371. test : = "$debug_cmd" || func_append preserve_args " --debug"
  2372. case $host in
  2373. # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
  2374. # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
  2375. *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
  2376. # don't eliminate duplications in $postdeps and $predeps
  2377. opt_duplicate_compiler_generated_deps=:
  2378. ;;
  2379. *)
  2380. opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  2381. ;;
  2382. esac
  2383. $opt_help || {
  2384. # Sanity checks first:
  2385. func_check_version_match
  2386. test yes != "$build_libtool_libs" \
  2387. && test yes != "$build_old_libs" \
  2388. && func_fatal_configuration "not configured to build any kind of library"
  2389. # Darwin sucks
  2390. eval std_shrext=\"$shrext_cmds\"
  2391. # Only execute mode is allowed to have -dlopen flags.
  2392. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
  2393. func_error "unrecognized option '-dlopen'"
  2394. $ECHO "$help" 1>&2
  2395. exit $EXIT_FAILURE
  2396. fi
  2397. # Change the help message to a mode-specific one.
  2398. generic_help=$help
  2399. help="Try '$progname --help --mode=$opt_mode' for more information."
  2400. }
  2401. # Pass back the unparsed argument list
  2402. func_quote_for_eval ${1+"$@"}
  2403. libtool_validate_options_result=$func_quote_for_eval_result
  2404. }
  2405. func_add_hook func_validate_options libtool_validate_options
  2406. # Process options as early as possible so that --help and --version
  2407. # can return quickly.
  2408. func_options ${1+"$@"}
  2409. eval set dummy "$func_options_result"; shift
  2410. ## ----------- ##
  2411. ## Main. ##
  2412. ## ----------- ##
  2413. magic='%%%MAGIC variable%%%'
  2414. magic_exe='%%%MAGIC EXE variable%%%'
  2415. # Global variables.
  2416. extracted_archives=
  2417. extracted_serial=0
  2418. # If this variable is set in any of the actions, the command in it
  2419. # will be execed at the end. This prevents here-documents from being
  2420. # left over by shells.
  2421. exec_cmd=
  2422. # A function that is used when there is no print builtin or printf.
  2423. func_fallback_echo ()
  2424. {
  2425. eval 'cat <<_LTECHO_EOF
  2426. $1
  2427. _LTECHO_EOF'
  2428. }
  2429. # func_generated_by_libtool
  2430. # True iff stdin has been generated by Libtool. This function is only
  2431. # a basic sanity check; it will hardly flush out determined imposters.
  2432. func_generated_by_libtool_p ()
  2433. {
  2434. $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  2435. }
  2436. # func_lalib_p file
  2437. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2438. # This function is only a basic sanity check; it will hardly flush out
  2439. # determined imposters.
  2440. func_lalib_p ()
  2441. {
  2442. test -f "$1" &&
  2443. $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
  2444. }
  2445. # func_lalib_unsafe_p file
  2446. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2447. # This function implements the same check as func_lalib_p without
  2448. # resorting to external programs. To this end, it redirects stdin and
  2449. # closes it afterwards, without saving the original file descriptor.
  2450. # As a safety measure, use it only where a negative result would be
  2451. # fatal anyway. Works if 'file' does not exist.
  2452. func_lalib_unsafe_p ()
  2453. {
  2454. lalib_p=no
  2455. if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  2456. for lalib_p_l in 1 2 3 4
  2457. do
  2458. read lalib_p_line
  2459. case $lalib_p_line in
  2460. \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  2461. esac
  2462. done
  2463. exec 0<&5 5<&-
  2464. fi
  2465. test yes = "$lalib_p"
  2466. }
  2467. # func_ltwrapper_script_p file
  2468. # True iff FILE is a libtool wrapper script
  2469. # This function is only a basic sanity check; it will hardly flush out
  2470. # determined imposters.
  2471. func_ltwrapper_script_p ()
  2472. {
  2473. test -f "$1" &&
  2474. $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
  2475. }
  2476. # func_ltwrapper_executable_p file
  2477. # True iff FILE is a libtool wrapper executable
  2478. # This function is only a basic sanity check; it will hardly flush out
  2479. # determined imposters.
  2480. func_ltwrapper_executable_p ()
  2481. {
  2482. func_ltwrapper_exec_suffix=
  2483. case $1 in
  2484. *.exe) ;;
  2485. *) func_ltwrapper_exec_suffix=.exe ;;
  2486. esac
  2487. $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  2488. }
  2489. # func_ltwrapper_scriptname file
  2490. # Assumes file is an ltwrapper_executable
  2491. # uses $file to determine the appropriate filename for a
  2492. # temporary ltwrapper_script.
  2493. func_ltwrapper_scriptname ()
  2494. {
  2495. func_dirname_and_basename "$1" "" "."
  2496. func_stripname '' '.exe' "$func_basename_result"
  2497. func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
  2498. }
  2499. # func_ltwrapper_p file
  2500. # True iff FILE is a libtool wrapper script or wrapper executable
  2501. # This function is only a basic sanity check; it will hardly flush out
  2502. # determined imposters.
  2503. func_ltwrapper_p ()
  2504. {
  2505. func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  2506. }
  2507. # func_execute_cmds commands fail_cmd
  2508. # Execute tilde-delimited COMMANDS.
  2509. # If FAIL_CMD is given, eval that upon failure.
  2510. # FAIL_CMD may read-access the current command in variable CMD!
  2511. func_execute_cmds ()
  2512. {
  2513. $debug_cmd
  2514. save_ifs=$IFS; IFS='~'
  2515. for cmd in $1; do
  2516. IFS=$sp$nl
  2517. eval cmd=\"$cmd\"
  2518. IFS=$save_ifs
  2519. func_show_eval "$cmd" "${2-:}"
  2520. done
  2521. IFS=$save_ifs
  2522. }
  2523. # func_source file
  2524. # Source FILE, adding directory component if necessary.
  2525. # Note that it is not necessary on cygwin/mingw to append a dot to
  2526. # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  2527. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  2528. # 'FILE.' does not work on cygwin managed mounts.
  2529. func_source ()
  2530. {
  2531. $debug_cmd
  2532. case $1 in
  2533. */* | *\\*) . "$1" ;;
  2534. *) . "./$1" ;;
  2535. esac
  2536. }
  2537. # func_resolve_sysroot PATH
  2538. # Replace a leading = in PATH with a sysroot. Store the result into
  2539. # func_resolve_sysroot_result
  2540. func_resolve_sysroot ()
  2541. {
  2542. func_resolve_sysroot_result=$1
  2543. case $func_resolve_sysroot_result in
  2544. =*)
  2545. func_stripname '=' '' "$func_resolve_sysroot_result"
  2546. func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
  2547. ;;
  2548. esac
  2549. }
  2550. # func_replace_sysroot PATH
  2551. # If PATH begins with the sysroot, replace it with = and
  2552. # store the result into func_replace_sysroot_result.
  2553. func_replace_sysroot ()
  2554. {
  2555. case $lt_sysroot:$1 in
  2556. ?*:"$lt_sysroot"*)
  2557. func_stripname "$lt_sysroot" '' "$1"
  2558. func_replace_sysroot_result='='$func_stripname_result
  2559. ;;
  2560. *)
  2561. # Including no sysroot.
  2562. func_replace_sysroot_result=$1
  2563. ;;
  2564. esac
  2565. }
  2566. # func_infer_tag arg
  2567. # Infer tagged configuration to use if any are available and
  2568. # if one wasn't chosen via the "--tag" command line option.
  2569. # Only attempt this if the compiler in the base compile
  2570. # command doesn't match the default compiler.
  2571. # arg is usually of the form 'gcc ...'
  2572. func_infer_tag ()
  2573. {
  2574. $debug_cmd
  2575. if test -n "$available_tags" && test -z "$tagname"; then
  2576. CC_quoted=
  2577. for arg in $CC; do
  2578. func_append_quoted CC_quoted "$arg"
  2579. done
  2580. CC_expanded=`func_echo_all $CC`
  2581. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2582. case $@ in
  2583. # Blanks in the command may have been stripped by the calling shell,
  2584. # but not from the CC environment variable when configure was run.
  2585. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2586. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
  2587. # Blanks at the start of $base_compile will cause this to fail
  2588. # if we don't check for them as well.
  2589. *)
  2590. for z in $available_tags; do
  2591. if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  2592. # Evaluate the configuration.
  2593. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  2594. CC_quoted=
  2595. for arg in $CC; do
  2596. # Double-quote args containing other shell metacharacters.
  2597. func_append_quoted CC_quoted "$arg"
  2598. done
  2599. CC_expanded=`func_echo_all $CC`
  2600. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2601. case "$@ " in
  2602. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2603. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
  2604. # The compiler in the base compile command matches
  2605. # the one in the tagged configuration.
  2606. # Assume this is the tagged configuration we want.
  2607. tagname=$z
  2608. break
  2609. ;;
  2610. esac
  2611. fi
  2612. done
  2613. # If $tagname still isn't set, then no tagged configuration
  2614. # was found and let the user know that the "--tag" command
  2615. # line option must be used.
  2616. if test -z "$tagname"; then
  2617. func_echo "unable to infer tagged configuration"
  2618. func_fatal_error "specify a tag with '--tag'"
  2619. # else
  2620. # func_verbose "using $tagname tagged configuration"
  2621. fi
  2622. ;;
  2623. esac
  2624. fi
  2625. }
  2626. # func_write_libtool_object output_name pic_name nonpic_name
  2627. # Create a libtool object file (analogous to a ".la" file),
  2628. # but don't create it if we're doing a dry run.
  2629. func_write_libtool_object ()
  2630. {
  2631. write_libobj=$1
  2632. if test yes = "$build_libtool_libs"; then
  2633. write_lobj=\'$2\'
  2634. else
  2635. write_lobj=none
  2636. fi
  2637. if test yes = "$build_old_libs"; then
  2638. write_oldobj=\'$3\'
  2639. else
  2640. write_oldobj=none
  2641. fi
  2642. $opt_dry_run || {
  2643. cat >${write_libobj}T <<EOF
  2644. # $write_libobj - a libtool object file
  2645. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  2646. #
  2647. # Please DO NOT delete this file!
  2648. # It is necessary for linking the library.
  2649. # Name of the PIC object.
  2650. pic_object=$write_lobj
  2651. # Name of the non-PIC object
  2652. non_pic_object=$write_oldobj
  2653. EOF
  2654. $MV "${write_libobj}T" "$write_libobj"
  2655. }
  2656. }
  2657. ##################################################
  2658. # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
  2659. ##################################################
  2660. # func_convert_core_file_wine_to_w32 ARG
  2661. # Helper function used by file name conversion functions when $build is *nix,
  2662. # and $host is mingw, cygwin, or some other w32 environment. Relies on a
  2663. # correctly configured wine environment available, with the winepath program
  2664. # in $build's $PATH.
  2665. #
  2666. # ARG is the $build file name to be converted to w32 format.
  2667. # Result is available in $func_convert_core_file_wine_to_w32_result, and will
  2668. # be empty on error (or when ARG is empty)
  2669. func_convert_core_file_wine_to_w32 ()
  2670. {
  2671. $debug_cmd
  2672. func_convert_core_file_wine_to_w32_result=$1
  2673. if test -n "$1"; then
  2674. # Unfortunately, winepath does not exit with a non-zero error code, so we
  2675. # are forced to check the contents of stdout. On the other hand, if the
  2676. # command is not found, the shell will set an exit code of 127 and print
  2677. # *an error message* to stdout. So we must check for both error code of
  2678. # zero AND non-empty stdout, which explains the odd construction:
  2679. func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
  2680. if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
  2681. func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
  2682. $SED -e "$sed_naive_backslashify"`
  2683. else
  2684. func_convert_core_file_wine_to_w32_result=
  2685. fi
  2686. fi
  2687. }
  2688. # end: func_convert_core_file_wine_to_w32
  2689. # func_convert_core_path_wine_to_w32 ARG
  2690. # Helper function used by path conversion functions when $build is *nix, and
  2691. # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
  2692. # configured wine environment available, with the winepath program in $build's
  2693. # $PATH. Assumes ARG has no leading or trailing path separator characters.
  2694. #
  2695. # ARG is path to be converted from $build format to win32.
  2696. # Result is available in $func_convert_core_path_wine_to_w32_result.
  2697. # Unconvertible file (directory) names in ARG are skipped; if no directory names
  2698. # are convertible, then the result may be empty.
  2699. func_convert_core_path_wine_to_w32 ()
  2700. {
  2701. $debug_cmd
  2702. # unfortunately, winepath doesn't convert paths, only file names
  2703. func_convert_core_path_wine_to_w32_result=
  2704. if test -n "$1"; then
  2705. oldIFS=$IFS
  2706. IFS=:
  2707. for func_convert_core_path_wine_to_w32_f in $1; do
  2708. IFS=$oldIFS
  2709. func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
  2710. if test -n "$func_convert_core_file_wine_to_w32_result"; then
  2711. if test -z "$func_convert_core_path_wine_to_w32_result"; then
  2712. func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
  2713. else
  2714. func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
  2715. fi
  2716. fi
  2717. done
  2718. IFS=$oldIFS
  2719. fi
  2720. }
  2721. # end: func_convert_core_path_wine_to_w32
  2722. # func_cygpath ARGS...
  2723. # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
  2724. # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
  2725. # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
  2726. # (2), returns the Cygwin file name or path in func_cygpath_result (input
  2727. # file name or path is assumed to be in w32 format, as previously converted
  2728. # from $build's *nix or MSYS format). In case (3), returns the w32 file name
  2729. # or path in func_cygpath_result (input file name or path is assumed to be in
  2730. # Cygwin format). Returns an empty string on error.
  2731. #
  2732. # ARGS are passed to cygpath, with the last one being the file name or path to
  2733. # be converted.
  2734. #
  2735. # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
  2736. # environment variable; do not put it in $PATH.
  2737. func_cygpath ()
  2738. {
  2739. $debug_cmd
  2740. if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
  2741. func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
  2742. if test "$?" -ne 0; then
  2743. # on failure, ensure result is empty
  2744. func_cygpath_result=
  2745. fi
  2746. else
  2747. func_cygpath_result=
  2748. func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  2749. fi
  2750. }
  2751. #end: func_cygpath
  2752. # func_convert_core_msys_to_w32 ARG
  2753. # Convert file name or path ARG from MSYS format to w32 format. Return
  2754. # result in func_convert_core_msys_to_w32_result.
  2755. func_convert_core_msys_to_w32 ()
  2756. {
  2757. $debug_cmd
  2758. # awkward: cmd appends spaces to result
  2759. func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
  2760. $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
  2761. }
  2762. #end: func_convert_core_msys_to_w32
  2763. # func_convert_file_check ARG1 ARG2
  2764. # Verify that ARG1 (a file name in $build format) was converted to $host
  2765. # format in ARG2. Otherwise, emit an error message, but continue (resetting
  2766. # func_to_host_file_result to ARG1).
  2767. func_convert_file_check ()
  2768. {
  2769. $debug_cmd
  2770. if test -z "$2" && test -n "$1"; then
  2771. func_error "Could not determine host file name corresponding to"
  2772. func_error " '$1'"
  2773. func_error "Continuing, but uninstalled executables may not work."
  2774. # Fallback:
  2775. func_to_host_file_result=$1
  2776. fi
  2777. }
  2778. # end func_convert_file_check
  2779. # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
  2780. # Verify that FROM_PATH (a path in $build format) was converted to $host
  2781. # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
  2782. # func_to_host_file_result to a simplistic fallback value (see below).
  2783. func_convert_path_check ()
  2784. {
  2785. $debug_cmd
  2786. if test -z "$4" && test -n "$3"; then
  2787. func_error "Could not determine the host path corresponding to"
  2788. func_error " '$3'"
  2789. func_error "Continuing, but uninstalled executables may not work."
  2790. # Fallback. This is a deliberately simplistic "conversion" and
  2791. # should not be "improved". See libtool.info.
  2792. if test "x$1" != "x$2"; then
  2793. lt_replace_pathsep_chars="s|$1|$2|g"
  2794. func_to_host_path_result=`echo "$3" |
  2795. $SED -e "$lt_replace_pathsep_chars"`
  2796. else
  2797. func_to_host_path_result=$3
  2798. fi
  2799. fi
  2800. }
  2801. # end func_convert_path_check
  2802. # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
  2803. # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
  2804. # and appending REPL if ORIG matches BACKPAT.
  2805. func_convert_path_front_back_pathsep ()
  2806. {
  2807. $debug_cmd
  2808. case $4 in
  2809. $1 ) func_to_host_path_result=$3$func_to_host_path_result
  2810. ;;
  2811. esac
  2812. case $4 in
  2813. $2 ) func_append func_to_host_path_result "$3"
  2814. ;;
  2815. esac
  2816. }
  2817. # end func_convert_path_front_back_pathsep
  2818. ##################################################
  2819. # $build to $host FILE NAME CONVERSION FUNCTIONS #
  2820. ##################################################
  2821. # invoked via '$to_host_file_cmd ARG'
  2822. #
  2823. # In each case, ARG is the path to be converted from $build to $host format.
  2824. # Result will be available in $func_to_host_file_result.
  2825. # func_to_host_file ARG
  2826. # Converts the file name ARG from $build format to $host format. Return result
  2827. # in func_to_host_file_result.
  2828. func_to_host_file ()
  2829. {
  2830. $debug_cmd
  2831. $to_host_file_cmd "$1"
  2832. }
  2833. # end func_to_host_file
  2834. # func_to_tool_file ARG LAZY
  2835. # converts the file name ARG from $build format to toolchain format. Return
  2836. # result in func_to_tool_file_result. If the conversion in use is listed
  2837. # in (the comma separated) LAZY, no conversion takes place.
  2838. func_to_tool_file ()
  2839. {
  2840. $debug_cmd
  2841. case ,$2, in
  2842. *,"$to_tool_file_cmd",*)
  2843. func_to_tool_file_result=$1
  2844. ;;
  2845. *)
  2846. $to_tool_file_cmd "$1"
  2847. func_to_tool_file_result=$func_to_host_file_result
  2848. ;;
  2849. esac
  2850. }
  2851. # end func_to_tool_file
  2852. # func_convert_file_noop ARG
  2853. # Copy ARG to func_to_host_file_result.
  2854. func_convert_file_noop ()
  2855. {
  2856. func_to_host_file_result=$1
  2857. }
  2858. # end func_convert_file_noop
  2859. # func_convert_file_msys_to_w32 ARG
  2860. # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
  2861. # conversion to w32 is not available inside the cwrapper. Returns result in
  2862. # func_to_host_file_result.
  2863. func_convert_file_msys_to_w32 ()
  2864. {
  2865. $debug_cmd
  2866. func_to_host_file_result=$1
  2867. if test -n "$1"; then
  2868. func_convert_core_msys_to_w32 "$1"
  2869. func_to_host_file_result=$func_convert_core_msys_to_w32_result
  2870. fi
  2871. func_convert_file_check "$1" "$func_to_host_file_result"
  2872. }
  2873. # end func_convert_file_msys_to_w32
  2874. # func_convert_file_cygwin_to_w32 ARG
  2875. # Convert file name ARG from Cygwin to w32 format. Returns result in
  2876. # func_to_host_file_result.
  2877. func_convert_file_cygwin_to_w32 ()
  2878. {
  2879. $debug_cmd
  2880. func_to_host_file_result=$1
  2881. if test -n "$1"; then
  2882. # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
  2883. # LT_CYGPATH in this case.
  2884. func_to_host_file_result=`cygpath -m "$1"`
  2885. fi
  2886. func_convert_file_check "$1" "$func_to_host_file_result"
  2887. }
  2888. # end func_convert_file_cygwin_to_w32
  2889. # func_convert_file_nix_to_w32 ARG
  2890. # Convert file name ARG from *nix to w32 format. Requires a wine environment
  2891. # and a working winepath. Returns result in func_to_host_file_result.
  2892. func_convert_file_nix_to_w32 ()
  2893. {
  2894. $debug_cmd
  2895. func_to_host_file_result=$1
  2896. if test -n "$1"; then
  2897. func_convert_core_file_wine_to_w32 "$1"
  2898. func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  2899. fi
  2900. func_convert_file_check "$1" "$func_to_host_file_result"
  2901. }
  2902. # end func_convert_file_nix_to_w32
  2903. # func_convert_file_msys_to_cygwin ARG
  2904. # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  2905. # Returns result in func_to_host_file_result.
  2906. func_convert_file_msys_to_cygwin ()
  2907. {
  2908. $debug_cmd
  2909. func_to_host_file_result=$1
  2910. if test -n "$1"; then
  2911. func_convert_core_msys_to_w32 "$1"
  2912. func_cygpath -u "$func_convert_core_msys_to_w32_result"
  2913. func_to_host_file_result=$func_cygpath_result
  2914. fi
  2915. func_convert_file_check "$1" "$func_to_host_file_result"
  2916. }
  2917. # end func_convert_file_msys_to_cygwin
  2918. # func_convert_file_nix_to_cygwin ARG
  2919. # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
  2920. # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
  2921. # in func_to_host_file_result.
  2922. func_convert_file_nix_to_cygwin ()
  2923. {
  2924. $debug_cmd
  2925. func_to_host_file_result=$1
  2926. if test -n "$1"; then
  2927. # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
  2928. func_convert_core_file_wine_to_w32 "$1"
  2929. func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
  2930. func_to_host_file_result=$func_cygpath_result
  2931. fi
  2932. func_convert_file_check "$1" "$func_to_host_file_result"
  2933. }
  2934. # end func_convert_file_nix_to_cygwin
  2935. #############################################
  2936. # $build to $host PATH CONVERSION FUNCTIONS #
  2937. #############################################
  2938. # invoked via '$to_host_path_cmd ARG'
  2939. #
  2940. # In each case, ARG is the path to be converted from $build to $host format.
  2941. # The result will be available in $func_to_host_path_result.
  2942. #
  2943. # Path separators are also converted from $build format to $host format. If
  2944. # ARG begins or ends with a path separator character, it is preserved (but
  2945. # converted to $host format) on output.
  2946. #
  2947. # All path conversion functions are named using the following convention:
  2948. # file name conversion function : func_convert_file_X_to_Y ()
  2949. # path conversion function : func_convert_path_X_to_Y ()
  2950. # where, for any given $build/$host combination the 'X_to_Y' value is the
  2951. # same. If conversion functions are added for new $build/$host combinations,
  2952. # the two new functions must follow this pattern, or func_init_to_host_path_cmd
  2953. # will break.
  2954. # func_init_to_host_path_cmd
  2955. # Ensures that function "pointer" variable $to_host_path_cmd is set to the
  2956. # appropriate value, based on the value of $to_host_file_cmd.
  2957. to_host_path_cmd=
  2958. func_init_to_host_path_cmd ()
  2959. {
  2960. $debug_cmd
  2961. if test -z "$to_host_path_cmd"; then
  2962. func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
  2963. to_host_path_cmd=func_convert_path_$func_stripname_result
  2964. fi
  2965. }
  2966. # func_to_host_path ARG
  2967. # Converts the path ARG from $build format to $host format. Return result
  2968. # in func_to_host_path_result.
  2969. func_to_host_path ()
  2970. {
  2971. $debug_cmd
  2972. func_init_to_host_path_cmd
  2973. $to_host_path_cmd "$1"
  2974. }
  2975. # end func_to_host_path
  2976. # func_convert_path_noop ARG
  2977. # Copy ARG to func_to_host_path_result.
  2978. func_convert_path_noop ()
  2979. {
  2980. func_to_host_path_result=$1
  2981. }
  2982. # end func_convert_path_noop
  2983. # func_convert_path_msys_to_w32 ARG
  2984. # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
  2985. # conversion to w32 is not available inside the cwrapper. Returns result in
  2986. # func_to_host_path_result.
  2987. func_convert_path_msys_to_w32 ()
  2988. {
  2989. $debug_cmd
  2990. func_to_host_path_result=$1
  2991. if test -n "$1"; then
  2992. # Remove leading and trailing path separator characters from ARG. MSYS
  2993. # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
  2994. # and winepath ignores them completely.
  2995. func_stripname : : "$1"
  2996. func_to_host_path_tmp1=$func_stripname_result
  2997. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  2998. func_to_host_path_result=$func_convert_core_msys_to_w32_result
  2999. func_convert_path_check : ";" \
  3000. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3001. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3002. fi
  3003. }
  3004. # end func_convert_path_msys_to_w32
  3005. # func_convert_path_cygwin_to_w32 ARG
  3006. # Convert path ARG from Cygwin to w32 format. Returns result in
  3007. # func_to_host_file_result.
  3008. func_convert_path_cygwin_to_w32 ()
  3009. {
  3010. $debug_cmd
  3011. func_to_host_path_result=$1
  3012. if test -n "$1"; then
  3013. # See func_convert_path_msys_to_w32:
  3014. func_stripname : : "$1"
  3015. func_to_host_path_tmp1=$func_stripname_result
  3016. func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
  3017. func_convert_path_check : ";" \
  3018. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3019. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3020. fi
  3021. }
  3022. # end func_convert_path_cygwin_to_w32
  3023. # func_convert_path_nix_to_w32 ARG
  3024. # Convert path ARG from *nix to w32 format. Requires a wine environment and
  3025. # a working winepath. Returns result in func_to_host_file_result.
  3026. func_convert_path_nix_to_w32 ()
  3027. {
  3028. $debug_cmd
  3029. func_to_host_path_result=$1
  3030. if test -n "$1"; then
  3031. # See func_convert_path_msys_to_w32:
  3032. func_stripname : : "$1"
  3033. func_to_host_path_tmp1=$func_stripname_result
  3034. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3035. func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
  3036. func_convert_path_check : ";" \
  3037. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3038. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3039. fi
  3040. }
  3041. # end func_convert_path_nix_to_w32
  3042. # func_convert_path_msys_to_cygwin ARG
  3043. # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  3044. # Returns result in func_to_host_file_result.
  3045. func_convert_path_msys_to_cygwin ()
  3046. {
  3047. $debug_cmd
  3048. func_to_host_path_result=$1
  3049. if test -n "$1"; then
  3050. # See func_convert_path_msys_to_w32:
  3051. func_stripname : : "$1"
  3052. func_to_host_path_tmp1=$func_stripname_result
  3053. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3054. func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
  3055. func_to_host_path_result=$func_cygpath_result
  3056. func_convert_path_check : : \
  3057. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3058. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3059. fi
  3060. }
  3061. # end func_convert_path_msys_to_cygwin
  3062. # func_convert_path_nix_to_cygwin ARG
  3063. # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
  3064. # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
  3065. # func_to_host_file_result.
  3066. func_convert_path_nix_to_cygwin ()
  3067. {
  3068. $debug_cmd
  3069. func_to_host_path_result=$1
  3070. if test -n "$1"; then
  3071. # Remove leading and trailing path separator characters from
  3072. # ARG. msys behavior is inconsistent here, cygpath turns them
  3073. # into '.;' and ';.', and winepath ignores them completely.
  3074. func_stripname : : "$1"
  3075. func_to_host_path_tmp1=$func_stripname_result
  3076. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3077. func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
  3078. func_to_host_path_result=$func_cygpath_result
  3079. func_convert_path_check : : \
  3080. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3081. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3082. fi
  3083. }
  3084. # end func_convert_path_nix_to_cygwin
  3085. # func_dll_def_p FILE
  3086. # True iff FILE is a Windows DLL '.def' file.
  3087. # Keep in sync with _LT_DLL_DEF_P in libtool.m4
  3088. func_dll_def_p ()
  3089. {
  3090. $debug_cmd
  3091. func_dll_def_p_tmp=`$SED -n \
  3092. -e 's/^[ ]*//' \
  3093. -e '/^\(;.*\)*$/d' \
  3094. -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
  3095. -e q \
  3096. "$1"`
  3097. test DEF = "$func_dll_def_p_tmp"
  3098. }
  3099. # func_mode_compile arg...
  3100. func_mode_compile ()
  3101. {
  3102. $debug_cmd
  3103. # Get the compilation command and the source file.
  3104. base_compile=
  3105. srcfile=$nonopt # always keep a non-empty value in "srcfile"
  3106. suppress_opt=yes
  3107. suppress_output=
  3108. arg_mode=normal
  3109. libobj=
  3110. later=
  3111. pie_flag=
  3112. for arg
  3113. do
  3114. case $arg_mode in
  3115. arg )
  3116. # do not "continue". Instead, add this to base_compile
  3117. lastarg=$arg
  3118. arg_mode=normal
  3119. ;;
  3120. target )
  3121. libobj=$arg
  3122. arg_mode=normal
  3123. continue
  3124. ;;
  3125. normal )
  3126. # Accept any command-line options.
  3127. case $arg in
  3128. -o)
  3129. test -n "$libobj" && \
  3130. func_fatal_error "you cannot specify '-o' more than once"
  3131. arg_mode=target
  3132. continue
  3133. ;;
  3134. -pie | -fpie | -fPIE)
  3135. func_append pie_flag " $arg"
  3136. continue
  3137. ;;
  3138. -shared | -static | -prefer-pic | -prefer-non-pic)
  3139. func_append later " $arg"
  3140. continue
  3141. ;;
  3142. -no-suppress)
  3143. suppress_opt=no
  3144. continue
  3145. ;;
  3146. -Xcompiler)
  3147. arg_mode=arg # the next one goes into the "base_compile" arg list
  3148. continue # The current "srcfile" will either be retained or
  3149. ;; # replaced later. I would guess that would be a bug.
  3150. -Wc,*)
  3151. func_stripname '-Wc,' '' "$arg"
  3152. args=$func_stripname_result
  3153. lastarg=
  3154. save_ifs=$IFS; IFS=,
  3155. for arg in $args; do
  3156. IFS=$save_ifs
  3157. func_append_quoted lastarg "$arg"
  3158. done
  3159. IFS=$save_ifs
  3160. func_stripname ' ' '' "$lastarg"
  3161. lastarg=$func_stripname_result
  3162. # Add the arguments to base_compile.
  3163. func_append base_compile " $lastarg"
  3164. continue
  3165. ;;
  3166. *)
  3167. # Accept the current argument as the source file.
  3168. # The previous "srcfile" becomes the current argument.
  3169. #
  3170. lastarg=$srcfile
  3171. srcfile=$arg
  3172. ;;
  3173. esac # case $arg
  3174. ;;
  3175. esac # case $arg_mode
  3176. # Aesthetically quote the previous argument.
  3177. func_append_quoted base_compile "$lastarg"
  3178. done # for arg
  3179. case $arg_mode in
  3180. arg)
  3181. func_fatal_error "you must specify an argument for -Xcompile"
  3182. ;;
  3183. target)
  3184. func_fatal_error "you must specify a target with '-o'"
  3185. ;;
  3186. *)
  3187. # Get the name of the library object.
  3188. test -z "$libobj" && {
  3189. func_basename "$srcfile"
  3190. libobj=$func_basename_result
  3191. }
  3192. ;;
  3193. esac
  3194. # Recognize several different file suffixes.
  3195. # If the user specifies -o file.o, it is replaced with file.lo
  3196. case $libobj in
  3197. *.[cCFSifmso] | \
  3198. *.ada | *.adb | *.ads | *.asm | \
  3199. *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  3200. *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
  3201. func_xform "$libobj"
  3202. libobj=$func_xform_result
  3203. ;;
  3204. esac
  3205. case $libobj in
  3206. *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  3207. *)
  3208. func_fatal_error "cannot determine name of library object from '$libobj'"
  3209. ;;
  3210. esac
  3211. func_infer_tag $base_compile
  3212. for arg in $later; do
  3213. case $arg in
  3214. -shared)
  3215. test yes = "$build_libtool_libs" \
  3216. || func_fatal_configuration "cannot build a shared library"
  3217. build_old_libs=no
  3218. continue
  3219. ;;
  3220. -static)
  3221. build_libtool_libs=no
  3222. build_old_libs=yes
  3223. continue
  3224. ;;
  3225. -prefer-pic)
  3226. pic_mode=yes
  3227. continue
  3228. ;;
  3229. -prefer-non-pic)
  3230. pic_mode=no
  3231. continue
  3232. ;;
  3233. esac
  3234. done
  3235. func_quote_for_eval "$libobj"
  3236. test "X$libobj" != "X$func_quote_for_eval_result" \
  3237. && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  3238. && func_warning "libobj name '$libobj' may not contain shell special characters."
  3239. func_dirname_and_basename "$obj" "/" ""
  3240. objname=$func_basename_result
  3241. xdir=$func_dirname_result
  3242. lobj=$xdir$objdir/$objname
  3243. test -z "$base_compile" && \
  3244. func_fatal_help "you must specify a compilation command"
  3245. # Delete any leftover library objects.
  3246. if test yes = "$build_old_libs"; then
  3247. removelist="$obj $lobj $libobj ${libobj}T"
  3248. else
  3249. removelist="$lobj $libobj ${libobj}T"
  3250. fi
  3251. # On Cygwin there's no "real" PIC flag so we must build both object types
  3252. case $host_os in
  3253. cygwin* | mingw* | pw32* | os2* | cegcc*)
  3254. pic_mode=default
  3255. ;;
  3256. esac
  3257. if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
  3258. # non-PIC code in shared libraries is not supported
  3259. pic_mode=default
  3260. fi
  3261. # Calculate the filename of the output object if compiler does
  3262. # not support -o with -c
  3263. if test no = "$compiler_c_o"; then
  3264. output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
  3265. lockfile=$output_obj.lock
  3266. else
  3267. output_obj=
  3268. need_locks=no
  3269. lockfile=
  3270. fi
  3271. # Lock this critical section if it is needed
  3272. # We use this script file to make the link, it avoids creating a new file
  3273. if test yes = "$need_locks"; then
  3274. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  3275. func_echo "Waiting for $lockfile to be removed"
  3276. sleep 2
  3277. done
  3278. elif test warn = "$need_locks"; then
  3279. if test -f "$lockfile"; then
  3280. $ECHO "\
  3281. *** ERROR, $lockfile exists and contains:
  3282. `cat $lockfile 2>/dev/null`
  3283. This indicates that another process is trying to use the same
  3284. temporary object file, and libtool could not work around it because
  3285. your compiler does not support '-c' and '-o' together. If you
  3286. repeat this compilation, it may succeed, by chance, but you had better
  3287. avoid parallel builds (make -j) in this platform, or get a better
  3288. compiler."
  3289. $opt_dry_run || $RM $removelist
  3290. exit $EXIT_FAILURE
  3291. fi
  3292. func_append removelist " $output_obj"
  3293. $ECHO "$srcfile" > "$lockfile"
  3294. fi
  3295. $opt_dry_run || $RM $removelist
  3296. func_append removelist " $lockfile"
  3297. trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  3298. func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
  3299. srcfile=$func_to_tool_file_result
  3300. func_quote_for_eval "$srcfile"
  3301. qsrcfile=$func_quote_for_eval_result
  3302. # Only build a PIC object if we are building libtool libraries.
  3303. if test yes = "$build_libtool_libs"; then
  3304. # Without this assignment, base_compile gets emptied.
  3305. fbsd_hideous_sh_bug=$base_compile
  3306. if test no != "$pic_mode"; then
  3307. command="$base_compile $qsrcfile $pic_flag"
  3308. else
  3309. # Don't build PIC code
  3310. command="$base_compile $qsrcfile"
  3311. fi
  3312. func_mkdir_p "$xdir$objdir"
  3313. if test -z "$output_obj"; then
  3314. # Place PIC objects in $objdir
  3315. func_append command " -o $lobj"
  3316. fi
  3317. func_show_eval_locale "$command" \
  3318. 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  3319. if test warn = "$need_locks" &&
  3320. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3321. $ECHO "\
  3322. *** ERROR, $lockfile contains:
  3323. `cat $lockfile 2>/dev/null`
  3324. but it should contain:
  3325. $srcfile
  3326. This indicates that another process is trying to use the same
  3327. temporary object file, and libtool could not work around it because
  3328. your compiler does not support '-c' and '-o' together. If you
  3329. repeat this compilation, it may succeed, by chance, but you had better
  3330. avoid parallel builds (make -j) in this platform, or get a better
  3331. compiler."
  3332. $opt_dry_run || $RM $removelist
  3333. exit $EXIT_FAILURE
  3334. fi
  3335. # Just move the object if needed, then go on to compile the next one
  3336. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  3337. func_show_eval '$MV "$output_obj" "$lobj"' \
  3338. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3339. fi
  3340. # Allow error messages only from the first compilation.
  3341. if test yes = "$suppress_opt"; then
  3342. suppress_output=' >/dev/null 2>&1'
  3343. fi
  3344. fi
  3345. # Only build a position-dependent object if we build old libraries.
  3346. if test yes = "$build_old_libs"; then
  3347. if test yes != "$pic_mode"; then
  3348. # Don't build PIC code
  3349. command="$base_compile $qsrcfile$pie_flag"
  3350. else
  3351. command="$base_compile $qsrcfile $pic_flag"
  3352. fi
  3353. if test yes = "$compiler_c_o"; then
  3354. func_append command " -o $obj"
  3355. fi
  3356. # Suppress compiler output if we already did a PIC compilation.
  3357. func_append command "$suppress_output"
  3358. func_show_eval_locale "$command" \
  3359. '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  3360. if test warn = "$need_locks" &&
  3361. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3362. $ECHO "\
  3363. *** ERROR, $lockfile contains:
  3364. `cat $lockfile 2>/dev/null`
  3365. but it should contain:
  3366. $srcfile
  3367. This indicates that another process is trying to use the same
  3368. temporary object file, and libtool could not work around it because
  3369. your compiler does not support '-c' and '-o' together. If you
  3370. repeat this compilation, it may succeed, by chance, but you had better
  3371. avoid parallel builds (make -j) in this platform, or get a better
  3372. compiler."
  3373. $opt_dry_run || $RM $removelist
  3374. exit $EXIT_FAILURE
  3375. fi
  3376. # Just move the object if needed
  3377. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  3378. func_show_eval '$MV "$output_obj" "$obj"' \
  3379. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3380. fi
  3381. fi
  3382. $opt_dry_run || {
  3383. func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  3384. # Unlock the critical section if it was locked
  3385. if test no != "$need_locks"; then
  3386. removelist=$lockfile
  3387. $RM "$lockfile"
  3388. fi
  3389. }
  3390. exit $EXIT_SUCCESS
  3391. }
  3392. $opt_help || {
  3393. test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
  3394. }
  3395. func_mode_help ()
  3396. {
  3397. # We need to display help for each of the modes.
  3398. case $opt_mode in
  3399. "")
  3400. # Generic help is extracted from the usage comments
  3401. # at the start of this file.
  3402. func_help
  3403. ;;
  3404. clean)
  3405. $ECHO \
  3406. "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  3407. Remove files from the build directory.
  3408. RM is the name of the program to use to delete files associated with each FILE
  3409. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3410. to RM.
  3411. If FILE is a libtool library, object or program, all the files associated
  3412. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  3413. ;;
  3414. compile)
  3415. $ECHO \
  3416. "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3417. Compile a source file into a libtool library object.
  3418. This mode accepts the following additional options:
  3419. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  3420. -no-suppress do not suppress compiler output for multiple passes
  3421. -prefer-pic try to build PIC objects only
  3422. -prefer-non-pic try to build non-PIC objects only
  3423. -shared do not build a '.o' file suitable for static linking
  3424. -static only build a '.o' file suitable for static linking
  3425. -Wc,FLAG pass FLAG directly to the compiler
  3426. COMPILE-COMMAND is a command to be used in creating a 'standard' object file
  3427. from the given SOURCEFILE.
  3428. The output file name is determined by removing the directory component from
  3429. SOURCEFILE, then substituting the C source code suffix '.c' with the
  3430. library object suffix, '.lo'."
  3431. ;;
  3432. execute)
  3433. $ECHO \
  3434. "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  3435. Automatically set library path, then run a program.
  3436. This mode accepts the following additional options:
  3437. -dlopen FILE add the directory containing FILE to the library path
  3438. This mode sets the library path environment variable according to '-dlopen'
  3439. flags.
  3440. If any of the ARGS are libtool executable wrappers, then they are translated
  3441. into their corresponding uninstalled binary, and any of their required library
  3442. directories are added to the library path.
  3443. Then, COMMAND is executed, with ARGS as arguments."
  3444. ;;
  3445. finish)
  3446. $ECHO \
  3447. "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  3448. Complete the installation of libtool libraries.
  3449. Each LIBDIR is a directory that contains libtool libraries.
  3450. The commands that this mode executes may require superuser privileges. Use
  3451. the '--dry-run' option if you just want to see what would be executed."
  3452. ;;
  3453. install)
  3454. $ECHO \
  3455. "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  3456. Install executables or libraries.
  3457. INSTALL-COMMAND is the installation command. The first component should be
  3458. either the 'install' or 'cp' program.
  3459. The following components of INSTALL-COMMAND are treated specially:
  3460. -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  3461. The rest of the components are interpreted as arguments to that command (only
  3462. BSD-compatible install options are recognized)."
  3463. ;;
  3464. link)
  3465. $ECHO \
  3466. "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  3467. Link object files or libraries together to form another library, or to
  3468. create an executable program.
  3469. LINK-COMMAND is a command using the C compiler that you would use to create
  3470. a program from several object files.
  3471. The following components of LINK-COMMAND are treated specially:
  3472. -all-static do not do any dynamic linking at all
  3473. -avoid-version do not add a version suffix if possible
  3474. -bindir BINDIR specify path to binaries directory (for systems where
  3475. libraries must be found in the PATH setting at runtime)
  3476. -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
  3477. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  3478. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  3479. -export-symbols SYMFILE
  3480. try to export only the symbols listed in SYMFILE
  3481. -export-symbols-regex REGEX
  3482. try to export only the symbols matching REGEX
  3483. -LLIBDIR search LIBDIR for required installed libraries
  3484. -lNAME OUTPUT-FILE requires the installed library libNAME
  3485. -module build a library that can dlopened
  3486. -no-fast-install disable the fast-install mode
  3487. -no-install link a not-installable executable
  3488. -no-undefined declare that a library does not refer to external symbols
  3489. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  3490. -objectlist FILE use a list of object files found in FILE to specify objects
  3491. -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
  3492. -precious-files-regex REGEX
  3493. don't remove output files matching REGEX
  3494. -release RELEASE specify package release information
  3495. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  3496. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  3497. -shared only do dynamic linking of libtool libraries
  3498. -shrext SUFFIX override the standard shared library file extension
  3499. -static do not do any dynamic linking of uninstalled libtool libraries
  3500. -static-libtool-libs
  3501. do not do any dynamic linking of libtool libraries
  3502. -version-info CURRENT[:REVISION[:AGE]]
  3503. specify library version info [each variable defaults to 0]
  3504. -weak LIBNAME declare that the target provides the LIBNAME interface
  3505. -Wc,FLAG
  3506. -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
  3507. -Wl,FLAG
  3508. -Xlinker FLAG pass linker-specific FLAG directly to the linker
  3509. -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
  3510. All other options (arguments beginning with '-') are ignored.
  3511. Every other argument is treated as a filename. Files ending in '.la' are
  3512. treated as uninstalled libtool libraries, other files are standard or library
  3513. object files.
  3514. If the OUTPUT-FILE ends in '.la', then a libtool library is created,
  3515. only library objects ('.lo' files) may be specified, and '-rpath' is
  3516. required, except when creating a convenience library.
  3517. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
  3518. using 'ar' and 'ranlib', or on Windows using 'lib'.
  3519. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
  3520. is created, otherwise an executable program is created."
  3521. ;;
  3522. uninstall)
  3523. $ECHO \
  3524. "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  3525. Remove libraries from an installation directory.
  3526. RM is the name of the program to use to delete files associated with each FILE
  3527. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3528. to RM.
  3529. If FILE is a libtool library, all the files associated with it are deleted.
  3530. Otherwise, only FILE itself is deleted using RM."
  3531. ;;
  3532. *)
  3533. func_fatal_help "invalid operation mode '$opt_mode'"
  3534. ;;
  3535. esac
  3536. echo
  3537. $ECHO "Try '$progname --help' for more information about other modes."
  3538. }
  3539. # Now that we've collected a possible --mode arg, show help if necessary
  3540. if $opt_help; then
  3541. if test : = "$opt_help"; then
  3542. func_mode_help
  3543. else
  3544. {
  3545. func_help noexit
  3546. for opt_mode in compile link execute install finish uninstall clean; do
  3547. func_mode_help
  3548. done
  3549. } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
  3550. {
  3551. func_help noexit
  3552. for opt_mode in compile link execute install finish uninstall clean; do
  3553. echo
  3554. func_mode_help
  3555. done
  3556. } |
  3557. $SED '1d
  3558. /^When reporting/,/^Report/{
  3559. H
  3560. d
  3561. }
  3562. $x
  3563. /information about other modes/d
  3564. /more detailed .*MODE/d
  3565. s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  3566. fi
  3567. exit $?
  3568. fi
  3569. # func_mode_execute arg...
  3570. func_mode_execute ()
  3571. {
  3572. $debug_cmd
  3573. # The first argument is the command name.
  3574. cmd=$nonopt
  3575. test -z "$cmd" && \
  3576. func_fatal_help "you must specify a COMMAND"
  3577. # Handle -dlopen flags immediately.
  3578. for file in $opt_dlopen; do
  3579. test -f "$file" \
  3580. || func_fatal_help "'$file' is not a file"
  3581. dir=
  3582. case $file in
  3583. *.la)
  3584. func_resolve_sysroot "$file"
  3585. file=$func_resolve_sysroot_result
  3586. # Check to see that this really is a libtool archive.
  3587. func_lalib_unsafe_p "$file" \
  3588. || func_fatal_help "'$lib' is not a valid libtool archive"
  3589. # Read the libtool library.
  3590. dlname=
  3591. library_names=
  3592. func_source "$file"
  3593. # Skip this library if it cannot be dlopened.
  3594. if test -z "$dlname"; then
  3595. # Warn if it was a shared library.
  3596. test -n "$library_names" && \
  3597. func_warning "'$file' was not linked with '-export-dynamic'"
  3598. continue
  3599. fi
  3600. func_dirname "$file" "" "."
  3601. dir=$func_dirname_result
  3602. if test -f "$dir/$objdir/$dlname"; then
  3603. func_append dir "/$objdir"
  3604. else
  3605. if test ! -f "$dir/$dlname"; then
  3606. func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
  3607. fi
  3608. fi
  3609. ;;
  3610. *.lo)
  3611. # Just add the directory containing the .lo file.
  3612. func_dirname "$file" "" "."
  3613. dir=$func_dirname_result
  3614. ;;
  3615. *)
  3616. func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
  3617. continue
  3618. ;;
  3619. esac
  3620. # Get the absolute pathname.
  3621. absdir=`cd "$dir" && pwd`
  3622. test -n "$absdir" && dir=$absdir
  3623. # Now add the directory to shlibpath_var.
  3624. if eval "test -z \"\$$shlibpath_var\""; then
  3625. eval "$shlibpath_var=\"\$dir\""
  3626. else
  3627. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3628. fi
  3629. done
  3630. # This variable tells wrapper scripts just to set shlibpath_var
  3631. # rather than running their programs.
  3632. libtool_execute_magic=$magic
  3633. # Check if any of the arguments is a wrapper script.
  3634. args=
  3635. for file
  3636. do
  3637. case $file in
  3638. -* | *.la | *.lo ) ;;
  3639. *)
  3640. # Do a test to see if this is really a libtool program.
  3641. if func_ltwrapper_script_p "$file"; then
  3642. func_source "$file"
  3643. # Transform arg to wrapped name.
  3644. file=$progdir/$program
  3645. elif func_ltwrapper_executable_p "$file"; then
  3646. func_ltwrapper_scriptname "$file"
  3647. func_source "$func_ltwrapper_scriptname_result"
  3648. # Transform arg to wrapped name.
  3649. file=$progdir/$program
  3650. fi
  3651. ;;
  3652. esac
  3653. # Quote arguments (to preserve shell metacharacters).
  3654. func_append_quoted args "$file"
  3655. done
  3656. if $opt_dry_run; then
  3657. # Display what would be done.
  3658. if test -n "$shlibpath_var"; then
  3659. eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  3660. echo "export $shlibpath_var"
  3661. fi
  3662. $ECHO "$cmd$args"
  3663. exit $EXIT_SUCCESS
  3664. else
  3665. if test -n "$shlibpath_var"; then
  3666. # Export the shlibpath_var.
  3667. eval "export $shlibpath_var"
  3668. fi
  3669. # Restore saved environment variables
  3670. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  3671. do
  3672. eval "if test \"\${save_$lt_var+set}\" = set; then
  3673. $lt_var=\$save_$lt_var; export $lt_var
  3674. else
  3675. $lt_unset $lt_var
  3676. fi"
  3677. done
  3678. # Now prepare to actually exec the command.
  3679. exec_cmd=\$cmd$args
  3680. fi
  3681. }
  3682. test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
  3683. # func_mode_finish arg...
  3684. func_mode_finish ()
  3685. {
  3686. $debug_cmd
  3687. libs=
  3688. libdirs=
  3689. admincmds=
  3690. for opt in "$nonopt" ${1+"$@"}
  3691. do
  3692. if test -d "$opt"; then
  3693. func_append libdirs " $opt"
  3694. elif test -f "$opt"; then
  3695. if func_lalib_unsafe_p "$opt"; then
  3696. func_append libs " $opt"
  3697. else
  3698. func_warning "'$opt' is not a valid libtool archive"
  3699. fi
  3700. else
  3701. func_fatal_error "invalid argument '$opt'"
  3702. fi
  3703. done
  3704. if test -n "$libs"; then
  3705. if test -n "$lt_sysroot"; then
  3706. sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
  3707. sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
  3708. else
  3709. sysroot_cmd=
  3710. fi
  3711. # Remove sysroot references
  3712. if $opt_dry_run; then
  3713. for lib in $libs; do
  3714. echo "removing references to $lt_sysroot and '=' prefixes from $lib"
  3715. done
  3716. else
  3717. tmpdir=`func_mktempdir`
  3718. for lib in $libs; do
  3719. $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
  3720. > $tmpdir/tmp-la
  3721. mv -f $tmpdir/tmp-la $lib
  3722. done
  3723. ${RM}r "$tmpdir"
  3724. fi
  3725. fi
  3726. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3727. for libdir in $libdirs; do
  3728. if test -n "$finish_cmds"; then
  3729. # Do each command in the finish commands.
  3730. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  3731. '"$cmd"'"'
  3732. fi
  3733. if test -n "$finish_eval"; then
  3734. # Do the single finish_eval.
  3735. eval cmds=\"$finish_eval\"
  3736. $opt_dry_run || eval "$cmds" || func_append admincmds "
  3737. $cmds"
  3738. fi
  3739. done
  3740. fi
  3741. # Exit here if they wanted silent mode.
  3742. $opt_quiet && exit $EXIT_SUCCESS
  3743. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3744. echo "----------------------------------------------------------------------"
  3745. echo "Libraries have been installed in:"
  3746. for libdir in $libdirs; do
  3747. $ECHO " $libdir"
  3748. done
  3749. echo
  3750. echo "If you ever happen to want to link against installed libraries"
  3751. echo "in a given directory, LIBDIR, you must either use libtool, and"
  3752. echo "specify the full pathname of the library, or use the '-LLIBDIR'"
  3753. echo "flag during linking and do at least one of the following:"
  3754. if test -n "$shlibpath_var"; then
  3755. echo " - add LIBDIR to the '$shlibpath_var' environment variable"
  3756. echo " during execution"
  3757. fi
  3758. if test -n "$runpath_var"; then
  3759. echo " - add LIBDIR to the '$runpath_var' environment variable"
  3760. echo " during linking"
  3761. fi
  3762. if test -n "$hardcode_libdir_flag_spec"; then
  3763. libdir=LIBDIR
  3764. eval flag=\"$hardcode_libdir_flag_spec\"
  3765. $ECHO " - use the '$flag' linker flag"
  3766. fi
  3767. if test -n "$admincmds"; then
  3768. $ECHO " - have your system administrator run these commands:$admincmds"
  3769. fi
  3770. if test -f /etc/ld.so.conf; then
  3771. echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
  3772. fi
  3773. echo
  3774. echo "See any operating system documentation about shared libraries for"
  3775. case $host in
  3776. solaris2.[6789]|solaris2.1[0-9])
  3777. echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  3778. echo "pages."
  3779. ;;
  3780. *)
  3781. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3782. ;;
  3783. esac
  3784. echo "----------------------------------------------------------------------"
  3785. fi
  3786. exit $EXIT_SUCCESS
  3787. }
  3788. test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
  3789. # func_mode_install arg...
  3790. func_mode_install ()
  3791. {
  3792. $debug_cmd
  3793. # There may be an optional sh(1) argument at the beginning of
  3794. # install_prog (especially on Windows NT).
  3795. if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
  3796. # Allow the use of GNU shtool's install command.
  3797. case $nonopt in *shtool*) :;; *) false;; esac
  3798. then
  3799. # Aesthetically quote it.
  3800. func_quote_for_eval "$nonopt"
  3801. install_prog="$func_quote_for_eval_result "
  3802. arg=$1
  3803. shift
  3804. else
  3805. install_prog=
  3806. arg=$nonopt
  3807. fi
  3808. # The real first argument should be the name of the installation program.
  3809. # Aesthetically quote it.
  3810. func_quote_for_eval "$arg"
  3811. func_append install_prog "$func_quote_for_eval_result"
  3812. install_shared_prog=$install_prog
  3813. case " $install_prog " in
  3814. *[\\\ /]cp\ *) install_cp=: ;;
  3815. *) install_cp=false ;;
  3816. esac
  3817. # We need to accept at least all the BSD install flags.
  3818. dest=
  3819. files=
  3820. opts=
  3821. prev=
  3822. install_type=
  3823. isdir=false
  3824. stripme=
  3825. no_mode=:
  3826. for arg
  3827. do
  3828. arg2=
  3829. if test -n "$dest"; then
  3830. func_append files " $dest"
  3831. dest=$arg
  3832. continue
  3833. fi
  3834. case $arg in
  3835. -d) isdir=: ;;
  3836. -f)
  3837. if $install_cp; then :; else
  3838. prev=$arg
  3839. fi
  3840. ;;
  3841. -g | -m | -o)
  3842. prev=$arg
  3843. ;;
  3844. -s)
  3845. stripme=" -s"
  3846. continue
  3847. ;;
  3848. -*)
  3849. ;;
  3850. *)
  3851. # If the previous option needed an argument, then skip it.
  3852. if test -n "$prev"; then
  3853. if test X-m = "X$prev" && test -n "$install_override_mode"; then
  3854. arg2=$install_override_mode
  3855. no_mode=false
  3856. fi
  3857. prev=
  3858. else
  3859. dest=$arg
  3860. continue
  3861. fi
  3862. ;;
  3863. esac
  3864. # Aesthetically quote the argument.
  3865. func_quote_for_eval "$arg"
  3866. func_append install_prog " $func_quote_for_eval_result"
  3867. if test -n "$arg2"; then
  3868. func_quote_for_eval "$arg2"
  3869. fi
  3870. func_append install_shared_prog " $func_quote_for_eval_result"
  3871. done
  3872. test -z "$install_prog" && \
  3873. func_fatal_help "you must specify an install program"
  3874. test -n "$prev" && \
  3875. func_fatal_help "the '$prev' option requires an argument"
  3876. if test -n "$install_override_mode" && $no_mode; then
  3877. if $install_cp; then :; else
  3878. func_quote_for_eval "$install_override_mode"
  3879. func_append install_shared_prog " -m $func_quote_for_eval_result"
  3880. fi
  3881. fi
  3882. if test -z "$files"; then
  3883. if test -z "$dest"; then
  3884. func_fatal_help "no file or destination specified"
  3885. else
  3886. func_fatal_help "you must specify a destination"
  3887. fi
  3888. fi
  3889. # Strip any trailing slash from the destination.
  3890. func_stripname '' '/' "$dest"
  3891. dest=$func_stripname_result
  3892. # Check to see that the destination is a directory.
  3893. test -d "$dest" && isdir=:
  3894. if $isdir; then
  3895. destdir=$dest
  3896. destname=
  3897. else
  3898. func_dirname_and_basename "$dest" "" "."
  3899. destdir=$func_dirname_result
  3900. destname=$func_basename_result
  3901. # Not a directory, so check to see that there is only one file specified.
  3902. set dummy $files; shift
  3903. test "$#" -gt 1 && \
  3904. func_fatal_help "'$dest' is not a directory"
  3905. fi
  3906. case $destdir in
  3907. [\\/]* | [A-Za-z]:[\\/]*) ;;
  3908. *)
  3909. for file in $files; do
  3910. case $file in
  3911. *.lo) ;;
  3912. *)
  3913. func_fatal_help "'$destdir' must be an absolute directory name"
  3914. ;;
  3915. esac
  3916. done
  3917. ;;
  3918. esac
  3919. # This variable tells wrapper scripts just to set variables rather
  3920. # than running their programs.
  3921. libtool_install_magic=$magic
  3922. staticlibs=
  3923. future_libdirs=
  3924. current_libdirs=
  3925. for file in $files; do
  3926. # Do each installation.
  3927. case $file in
  3928. *.$libext)
  3929. # Do the static libraries later.
  3930. func_append staticlibs " $file"
  3931. ;;
  3932. *.la)
  3933. func_resolve_sysroot "$file"
  3934. file=$func_resolve_sysroot_result
  3935. # Check to see that this really is a libtool archive.
  3936. func_lalib_unsafe_p "$file" \
  3937. || func_fatal_help "'$file' is not a valid libtool archive"
  3938. library_names=
  3939. old_library=
  3940. relink_command=
  3941. func_source "$file"
  3942. # Add the libdir to current_libdirs if it is the destination.
  3943. if test "X$destdir" = "X$libdir"; then
  3944. case "$current_libdirs " in
  3945. *" $libdir "*) ;;
  3946. *) func_append current_libdirs " $libdir" ;;
  3947. esac
  3948. else
  3949. # Note the libdir as a future libdir.
  3950. case "$future_libdirs " in
  3951. *" $libdir "*) ;;
  3952. *) func_append future_libdirs " $libdir" ;;
  3953. esac
  3954. fi
  3955. func_dirname "$file" "/" ""
  3956. dir=$func_dirname_result
  3957. func_append dir "$objdir"
  3958. if test -n "$relink_command"; then
  3959. # Determine the prefix the user has applied to our future dir.
  3960. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
  3961. # Don't allow the user to place us outside of our expected
  3962. # location b/c this prevents finding dependent libraries that
  3963. # are installed to the same prefix.
  3964. # At present, this check doesn't affect windows .dll's that
  3965. # are installed into $libdir/../bin (currently, that works fine)
  3966. # but it's something to keep an eye on.
  3967. test "$inst_prefix_dir" = "$destdir" && \
  3968. func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
  3969. if test -n "$inst_prefix_dir"; then
  3970. # Stick the inst_prefix_dir data into the link command.
  3971. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  3972. else
  3973. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  3974. fi
  3975. func_warning "relinking '$file'"
  3976. func_show_eval "$relink_command" \
  3977. 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
  3978. fi
  3979. # See the names of the shared library.
  3980. set dummy $library_names; shift
  3981. if test -n "$1"; then
  3982. realname=$1
  3983. shift
  3984. srcname=$realname
  3985. test -n "$relink_command" && srcname=${realname}T
  3986. # Install the shared library and build the symlinks.
  3987. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
  3988. 'exit $?'
  3989. tstripme=$stripme
  3990. case $host_os in
  3991. cygwin* | mingw* | pw32* | cegcc*)
  3992. case $realname in
  3993. *.dll.a)
  3994. tstripme=
  3995. ;;
  3996. esac
  3997. ;;
  3998. os2*)
  3999. case $realname in
  4000. *_dll.a)
  4001. tstripme=
  4002. ;;
  4003. esac
  4004. ;;
  4005. esac
  4006. if test -n "$tstripme" && test -n "$striplib"; then
  4007. func_show_eval "$striplib $destdir/$realname" 'exit $?'
  4008. fi
  4009. if test "$#" -gt 0; then
  4010. # Delete the old symlinks, and create new ones.
  4011. # Try 'ln -sf' first, because the 'ln' binary might depend on
  4012. # the symlink we replace! Solaris /bin/ln does not understand -f,
  4013. # so we also need to try rm && ln -s.
  4014. for linkname
  4015. do
  4016. test "$linkname" != "$realname" \
  4017. && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  4018. done
  4019. fi
  4020. # Do each command in the postinstall commands.
  4021. lib=$destdir/$realname
  4022. func_execute_cmds "$postinstall_cmds" 'exit $?'
  4023. fi
  4024. # Install the pseudo-library for information purposes.
  4025. func_basename "$file"
  4026. name=$func_basename_result
  4027. instname=$dir/${name}i
  4028. func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  4029. # Maybe install the static library, too.
  4030. test -n "$old_library" && func_append staticlibs " $dir/$old_library"
  4031. ;;
  4032. *.lo)
  4033. # Install (i.e. copy) a libtool object.
  4034. # Figure out destination file name, if it wasn't already specified.
  4035. if test -n "$destname"; then
  4036. destfile=$destdir/$destname
  4037. else
  4038. func_basename "$file"
  4039. destfile=$func_basename_result
  4040. destfile=$destdir/$destfile
  4041. fi
  4042. # Deduce the name of the destination old-style object file.
  4043. case $destfile in
  4044. *.lo)
  4045. func_lo2o "$destfile"
  4046. staticdest=$func_lo2o_result
  4047. ;;
  4048. *.$objext)
  4049. staticdest=$destfile
  4050. destfile=
  4051. ;;
  4052. *)
  4053. func_fatal_help "cannot copy a libtool object to '$destfile'"
  4054. ;;
  4055. esac
  4056. # Install the libtool object if requested.
  4057. test -n "$destfile" && \
  4058. func_show_eval "$install_prog $file $destfile" 'exit $?'
  4059. # Install the old object if enabled.
  4060. if test yes = "$build_old_libs"; then
  4061. # Deduce the name of the old-style object file.
  4062. func_lo2o "$file"
  4063. staticobj=$func_lo2o_result
  4064. func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  4065. fi
  4066. exit $EXIT_SUCCESS
  4067. ;;
  4068. *)
  4069. # Figure out destination file name, if it wasn't already specified.
  4070. if test -n "$destname"; then
  4071. destfile=$destdir/$destname
  4072. else
  4073. func_basename "$file"
  4074. destfile=$func_basename_result
  4075. destfile=$destdir/$destfile
  4076. fi
  4077. # If the file is missing, and there is a .exe on the end, strip it
  4078. # because it is most likely a libtool script we actually want to
  4079. # install
  4080. stripped_ext=
  4081. case $file in
  4082. *.exe)
  4083. if test ! -f "$file"; then
  4084. func_stripname '' '.exe' "$file"
  4085. file=$func_stripname_result
  4086. stripped_ext=.exe
  4087. fi
  4088. ;;
  4089. esac
  4090. # Do a test to see if this is really a libtool program.
  4091. case $host in
  4092. *cygwin* | *mingw*)
  4093. if func_ltwrapper_executable_p "$file"; then
  4094. func_ltwrapper_scriptname "$file"
  4095. wrapper=$func_ltwrapper_scriptname_result
  4096. else
  4097. func_stripname '' '.exe' "$file"
  4098. wrapper=$func_stripname_result
  4099. fi
  4100. ;;
  4101. *)
  4102. wrapper=$file
  4103. ;;
  4104. esac
  4105. if func_ltwrapper_script_p "$wrapper"; then
  4106. notinst_deplibs=
  4107. relink_command=
  4108. func_source "$wrapper"
  4109. # Check the variables that should have been set.
  4110. test -z "$generated_by_libtool_version" && \
  4111. func_fatal_error "invalid libtool wrapper script '$wrapper'"
  4112. finalize=:
  4113. for lib in $notinst_deplibs; do
  4114. # Check to see that each library is installed.
  4115. libdir=
  4116. if test -f "$lib"; then
  4117. func_source "$lib"
  4118. fi
  4119. libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
  4120. if test -n "$libdir" && test ! -f "$libfile"; then
  4121. func_warning "'$lib' has not been installed in '$libdir'"
  4122. finalize=false
  4123. fi
  4124. done
  4125. relink_command=
  4126. func_source "$wrapper"
  4127. outputname=
  4128. if test no = "$fast_install" && test -n "$relink_command"; then
  4129. $opt_dry_run || {
  4130. if $finalize; then
  4131. tmpdir=`func_mktempdir`
  4132. func_basename "$file$stripped_ext"
  4133. file=$func_basename_result
  4134. outputname=$tmpdir/$file
  4135. # Replace the output file specification.
  4136. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
  4137. $opt_quiet || {
  4138. func_quote_for_expand "$relink_command"
  4139. eval "func_echo $func_quote_for_expand_result"
  4140. }
  4141. if eval "$relink_command"; then :
  4142. else
  4143. func_error "error: relink '$file' with the above command before installing it"
  4144. $opt_dry_run || ${RM}r "$tmpdir"
  4145. continue
  4146. fi
  4147. file=$outputname
  4148. else
  4149. func_warning "cannot relink '$file'"
  4150. fi
  4151. }
  4152. else
  4153. # Install the binary that we compiled earlier.
  4154. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
  4155. fi
  4156. fi
  4157. # remove .exe since cygwin /usr/bin/install will append another
  4158. # one anyway
  4159. case $install_prog,$host in
  4160. */usr/bin/install*,*cygwin*)
  4161. case $file:$destfile in
  4162. *.exe:*.exe)
  4163. # this is ok
  4164. ;;
  4165. *.exe:*)
  4166. destfile=$destfile.exe
  4167. ;;
  4168. *:*.exe)
  4169. func_stripname '' '.exe' "$destfile"
  4170. destfile=$func_stripname_result
  4171. ;;
  4172. esac
  4173. ;;
  4174. esac
  4175. func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  4176. $opt_dry_run || if test -n "$outputname"; then
  4177. ${RM}r "$tmpdir"
  4178. fi
  4179. ;;
  4180. esac
  4181. done
  4182. for file in $staticlibs; do
  4183. func_basename "$file"
  4184. name=$func_basename_result
  4185. # Set up the ranlib parameters.
  4186. oldlib=$destdir/$name
  4187. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  4188. tool_oldlib=$func_to_tool_file_result
  4189. func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  4190. if test -n "$stripme" && test -n "$old_striplib"; then
  4191. func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
  4192. fi
  4193. # Do each command in the postinstall commands.
  4194. func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  4195. done
  4196. test -n "$future_libdirs" && \
  4197. func_warning "remember to run '$progname --finish$future_libdirs'"
  4198. if test -n "$current_libdirs"; then
  4199. # Maybe just do a dry run.
  4200. $opt_dry_run && current_libdirs=" -n$current_libdirs"
  4201. exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
  4202. else
  4203. exit $EXIT_SUCCESS
  4204. fi
  4205. }
  4206. test install = "$opt_mode" && func_mode_install ${1+"$@"}
  4207. # func_generate_dlsyms outputname originator pic_p
  4208. # Extract symbols from dlprefiles and create ${outputname}S.o with
  4209. # a dlpreopen symbol table.
  4210. func_generate_dlsyms ()
  4211. {
  4212. $debug_cmd
  4213. my_outputname=$1
  4214. my_originator=$2
  4215. my_pic_p=${3-false}
  4216. my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
  4217. my_dlsyms=
  4218. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  4219. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4220. my_dlsyms=${my_outputname}S.c
  4221. else
  4222. func_error "not configured to extract global symbols from dlpreopened files"
  4223. fi
  4224. fi
  4225. if test -n "$my_dlsyms"; then
  4226. case $my_dlsyms in
  4227. "") ;;
  4228. *.c)
  4229. # Discover the nlist of each of the dlfiles.
  4230. nlist=$output_objdir/$my_outputname.nm
  4231. func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  4232. # Parse the name list into a source file.
  4233. func_verbose "creating $output_objdir/$my_dlsyms"
  4234. $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  4235. /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
  4236. /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
  4237. #ifdef __cplusplus
  4238. extern \"C\" {
  4239. #endif
  4240. #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
  4241. #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
  4242. #endif
  4243. /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
  4244. #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
  4245. /* DATA imports from DLLs on WIN32 can't be const, because runtime
  4246. relocations are performed -- see ld's documentation on pseudo-relocs. */
  4247. # define LT_DLSYM_CONST
  4248. #elif defined __osf__
  4249. /* This system does not cope well with relocations in const data. */
  4250. # define LT_DLSYM_CONST
  4251. #else
  4252. # define LT_DLSYM_CONST const
  4253. #endif
  4254. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  4255. /* External symbol declarations for the compiler. */\
  4256. "
  4257. if test yes = "$dlself"; then
  4258. func_verbose "generating symbol list for '$output'"
  4259. $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  4260. # Add our own program objects to the symbol list.
  4261. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  4262. for progfile in $progfiles; do
  4263. func_to_tool_file "$progfile" func_convert_file_msys_to_w32
  4264. func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
  4265. $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
  4266. done
  4267. if test -n "$exclude_expsyms"; then
  4268. $opt_dry_run || {
  4269. eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4270. eval '$MV "$nlist"T "$nlist"'
  4271. }
  4272. fi
  4273. if test -n "$export_symbols_regex"; then
  4274. $opt_dry_run || {
  4275. eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4276. eval '$MV "$nlist"T "$nlist"'
  4277. }
  4278. fi
  4279. # Prepare the list of exported symbols
  4280. if test -z "$export_symbols"; then
  4281. export_symbols=$output_objdir/$outputname.exp
  4282. $opt_dry_run || {
  4283. $RM $export_symbols
  4284. eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4285. case $host in
  4286. *cygwin* | *mingw* | *cegcc* )
  4287. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4288. eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  4289. ;;
  4290. esac
  4291. }
  4292. else
  4293. $opt_dry_run || {
  4294. eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4295. eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4296. eval '$MV "$nlist"T "$nlist"'
  4297. case $host in
  4298. *cygwin* | *mingw* | *cegcc* )
  4299. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4300. eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  4301. ;;
  4302. esac
  4303. }
  4304. fi
  4305. fi
  4306. for dlprefile in $dlprefiles; do
  4307. func_verbose "extracting global C symbols from '$dlprefile'"
  4308. func_basename "$dlprefile"
  4309. name=$func_basename_result
  4310. case $host in
  4311. *cygwin* | *mingw* | *cegcc* )
  4312. # if an import library, we need to obtain dlname
  4313. if func_win32_import_lib_p "$dlprefile"; then
  4314. func_tr_sh "$dlprefile"
  4315. eval "curr_lafile=\$libfile_$func_tr_sh_result"
  4316. dlprefile_dlbasename=
  4317. if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
  4318. # Use subshell, to avoid clobbering current variable values
  4319. dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
  4320. if test -n "$dlprefile_dlname"; then
  4321. func_basename "$dlprefile_dlname"
  4322. dlprefile_dlbasename=$func_basename_result
  4323. else
  4324. # no lafile. user explicitly requested -dlpreopen <import library>.
  4325. $sharedlib_from_linklib_cmd "$dlprefile"
  4326. dlprefile_dlbasename=$sharedlib_from_linklib_result
  4327. fi
  4328. fi
  4329. $opt_dry_run || {
  4330. if test -n "$dlprefile_dlbasename"; then
  4331. eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
  4332. else
  4333. func_warning "Could not compute DLL name from $name"
  4334. eval '$ECHO ": $name " >> "$nlist"'
  4335. fi
  4336. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4337. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
  4338. $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
  4339. }
  4340. else # not an import lib
  4341. $opt_dry_run || {
  4342. eval '$ECHO ": $name " >> "$nlist"'
  4343. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4344. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4345. }
  4346. fi
  4347. ;;
  4348. *)
  4349. $opt_dry_run || {
  4350. eval '$ECHO ": $name " >> "$nlist"'
  4351. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4352. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4353. }
  4354. ;;
  4355. esac
  4356. done
  4357. $opt_dry_run || {
  4358. # Make sure we have at least an empty file.
  4359. test -f "$nlist" || : > "$nlist"
  4360. if test -n "$exclude_expsyms"; then
  4361. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4362. $MV "$nlist"T "$nlist"
  4363. fi
  4364. # Try sorting and uniquifying the output.
  4365. if $GREP -v "^: " < "$nlist" |
  4366. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4367. sort -k 3
  4368. else
  4369. sort +2
  4370. fi |
  4371. uniq > "$nlist"S; then
  4372. :
  4373. else
  4374. $GREP -v "^: " < "$nlist" > "$nlist"S
  4375. fi
  4376. if test -f "$nlist"S; then
  4377. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  4378. else
  4379. echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
  4380. fi
  4381. func_show_eval '$RM "${nlist}I"'
  4382. if test -n "$global_symbol_to_import"; then
  4383. eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
  4384. fi
  4385. echo >> "$output_objdir/$my_dlsyms" "\
  4386. /* The mapping between symbol names and symbols. */
  4387. typedef struct {
  4388. const char *name;
  4389. void *address;
  4390. } lt_dlsymlist;
  4391. extern LT_DLSYM_CONST lt_dlsymlist
  4392. lt_${my_prefix}_LTX_preloaded_symbols[];\
  4393. "
  4394. if test -s "$nlist"I; then
  4395. echo >> "$output_objdir/$my_dlsyms" "\
  4396. static void lt_syminit(void)
  4397. {
  4398. LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
  4399. for (; symbol->name; ++symbol)
  4400. {"
  4401. $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
  4402. echo >> "$output_objdir/$my_dlsyms" "\
  4403. }
  4404. }"
  4405. fi
  4406. echo >> "$output_objdir/$my_dlsyms" "\
  4407. LT_DLSYM_CONST lt_dlsymlist
  4408. lt_${my_prefix}_LTX_preloaded_symbols[] =
  4409. { {\"$my_originator\", (void *) 0},"
  4410. if test -s "$nlist"I; then
  4411. echo >> "$output_objdir/$my_dlsyms" "\
  4412. {\"@INIT@\", (void *) &lt_syminit},"
  4413. fi
  4414. case $need_lib_prefix in
  4415. no)
  4416. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4417. ;;
  4418. *)
  4419. eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4420. ;;
  4421. esac
  4422. echo >> "$output_objdir/$my_dlsyms" "\
  4423. {0, (void *) 0}
  4424. };
  4425. /* This works around a problem in FreeBSD linker */
  4426. #ifdef FREEBSD_WORKAROUND
  4427. static const void *lt_preloaded_setup() {
  4428. return lt_${my_prefix}_LTX_preloaded_symbols;
  4429. }
  4430. #endif
  4431. #ifdef __cplusplus
  4432. }
  4433. #endif\
  4434. "
  4435. } # !$opt_dry_run
  4436. pic_flag_for_symtable=
  4437. case "$compile_command " in
  4438. *" -static "*) ;;
  4439. *)
  4440. case $host in
  4441. # compiling the symbol table file with pic_flag works around
  4442. # a FreeBSD bug that causes programs to crash when -lm is
  4443. # linked before any other PIC object. But we must not use
  4444. # pic_flag when linking with -static. The problem exists in
  4445. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4446. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4447. pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  4448. *-*-hpux*)
  4449. pic_flag_for_symtable=" $pic_flag" ;;
  4450. *)
  4451. $my_pic_p && pic_flag_for_symtable=" $pic_flag"
  4452. ;;
  4453. esac
  4454. ;;
  4455. esac
  4456. symtab_cflags=
  4457. for arg in $LTCFLAGS; do
  4458. case $arg in
  4459. -pie | -fpie | -fPIE) ;;
  4460. *) func_append symtab_cflags " $arg" ;;
  4461. esac
  4462. done
  4463. # Now compile the dynamic symbol file.
  4464. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  4465. # Clean up the generated files.
  4466. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
  4467. # Transform the symbol file into the correct name.
  4468. symfileobj=$output_objdir/${my_outputname}S.$objext
  4469. case $host in
  4470. *cygwin* | *mingw* | *cegcc* )
  4471. if test -f "$output_objdir/$my_outputname.def"; then
  4472. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4473. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4474. else
  4475. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4476. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4477. fi
  4478. ;;
  4479. *)
  4480. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4481. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4482. ;;
  4483. esac
  4484. ;;
  4485. *)
  4486. func_fatal_error "unknown suffix for '$my_dlsyms'"
  4487. ;;
  4488. esac
  4489. else
  4490. # We keep going just in case the user didn't refer to
  4491. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4492. # really was required.
  4493. # Nullify the symbol file.
  4494. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
  4495. finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
  4496. fi
  4497. }
  4498. # func_cygming_gnu_implib_p ARG
  4499. # This predicate returns with zero status (TRUE) if
  4500. # ARG is a GNU/binutils-style import library. Returns
  4501. # with nonzero status (FALSE) otherwise.
  4502. func_cygming_gnu_implib_p ()
  4503. {
  4504. $debug_cmd
  4505. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4506. 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)$'`
  4507. test -n "$func_cygming_gnu_implib_tmp"
  4508. }
  4509. # func_cygming_ms_implib_p ARG
  4510. # This predicate returns with zero status (TRUE) if
  4511. # ARG is an MS-style import library. Returns
  4512. # with nonzero status (FALSE) otherwise.
  4513. func_cygming_ms_implib_p ()
  4514. {
  4515. $debug_cmd
  4516. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4517. func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  4518. test -n "$func_cygming_ms_implib_tmp"
  4519. }
  4520. # func_win32_libid arg
  4521. # return the library type of file 'arg'
  4522. #
  4523. # Need a lot of goo to handle *both* DLLs and import libs
  4524. # Has to be a shell function in order to 'eat' the argument
  4525. # that is supplied when $file_magic_command is called.
  4526. # Despite the name, also deal with 64 bit binaries.
  4527. func_win32_libid ()
  4528. {
  4529. $debug_cmd
  4530. win32_libid_type=unknown
  4531. win32_fileres=`file -L $1 2>/dev/null`
  4532. case $win32_fileres in
  4533. *ar\ archive\ import\ library*) # definitely import
  4534. win32_libid_type="x86 archive import"
  4535. ;;
  4536. *ar\ archive*) # could be an import, or static
  4537. # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
  4538. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  4539. $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
  4540. case $nm_interface in
  4541. "MS dumpbin")
  4542. if func_cygming_ms_implib_p "$1" ||
  4543. func_cygming_gnu_implib_p "$1"
  4544. then
  4545. win32_nmres=import
  4546. else
  4547. win32_nmres=
  4548. fi
  4549. ;;
  4550. *)
  4551. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4552. win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
  4553. $SED -n -e '
  4554. 1,100{
  4555. / I /{
  4556. s|.*|import|
  4557. p
  4558. q
  4559. }
  4560. }'`
  4561. ;;
  4562. esac
  4563. case $win32_nmres in
  4564. import*) win32_libid_type="x86 archive import";;
  4565. *) win32_libid_type="x86 archive static";;
  4566. esac
  4567. fi
  4568. ;;
  4569. *DLL*)
  4570. win32_libid_type="x86 DLL"
  4571. ;;
  4572. *executable*) # but shell scripts are "executable" too...
  4573. case $win32_fileres in
  4574. *MS\ Windows\ PE\ Intel*)
  4575. win32_libid_type="x86 DLL"
  4576. ;;
  4577. esac
  4578. ;;
  4579. esac
  4580. $ECHO "$win32_libid_type"
  4581. }
  4582. # func_cygming_dll_for_implib ARG
  4583. #
  4584. # Platform-specific function to extract the
  4585. # name of the DLL associated with the specified
  4586. # import library ARG.
  4587. # Invoked by eval'ing the libtool variable
  4588. # $sharedlib_from_linklib_cmd
  4589. # Result is available in the variable
  4590. # $sharedlib_from_linklib_result
  4591. func_cygming_dll_for_implib ()
  4592. {
  4593. $debug_cmd
  4594. sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
  4595. }
  4596. # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
  4597. #
  4598. # The is the core of a fallback implementation of a
  4599. # platform-specific function to extract the name of the
  4600. # DLL associated with the specified import library LIBNAME.
  4601. #
  4602. # SECTION_NAME is either .idata$6 or .idata$7, depending
  4603. # on the platform and compiler that created the implib.
  4604. #
  4605. # Echos the name of the DLL associated with the
  4606. # specified import library.
  4607. func_cygming_dll_for_implib_fallback_core ()
  4608. {
  4609. $debug_cmd
  4610. match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  4611. $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
  4612. $SED '/^Contents of section '"$match_literal"':/{
  4613. # Place marker at beginning of archive member dllname section
  4614. s/.*/====MARK====/
  4615. p
  4616. d
  4617. }
  4618. # These lines can sometimes be longer than 43 characters, but
  4619. # are always uninteresting
  4620. /:[ ]*file format pe[i]\{,1\}-/d
  4621. /^In archive [^:]*:/d
  4622. # Ensure marker is printed
  4623. /^====MARK====/p
  4624. # Remove all lines with less than 43 characters
  4625. /^.\{43\}/!d
  4626. # From remaining lines, remove first 43 characters
  4627. s/^.\{43\}//' |
  4628. $SED -n '
  4629. # Join marker and all lines until next marker into a single line
  4630. /^====MARK====/ b para
  4631. H
  4632. $ b para
  4633. b
  4634. :para
  4635. x
  4636. s/\n//g
  4637. # Remove the marker
  4638. s/^====MARK====//
  4639. # Remove trailing dots and whitespace
  4640. s/[\. \t]*$//
  4641. # Print
  4642. /./p' |
  4643. # we now have a list, one entry per line, of the stringified
  4644. # contents of the appropriate section of all members of the
  4645. # archive that possess that section. Heuristic: eliminate
  4646. # all those that have a first or second character that is
  4647. # a '.' (that is, objdump's representation of an unprintable
  4648. # character.) This should work for all archives with less than
  4649. # 0x302f exports -- but will fail for DLLs whose name actually
  4650. # begins with a literal '.' or a single character followed by
  4651. # a '.'.
  4652. #
  4653. # Of those that remain, print the first one.
  4654. $SED -e '/^\./d;/^.\./d;q'
  4655. }
  4656. # func_cygming_dll_for_implib_fallback ARG
  4657. # Platform-specific function to extract the
  4658. # name of the DLL associated with the specified
  4659. # import library ARG.
  4660. #
  4661. # This fallback implementation is for use when $DLLTOOL
  4662. # does not support the --identify-strict option.
  4663. # Invoked by eval'ing the libtool variable
  4664. # $sharedlib_from_linklib_cmd
  4665. # Result is available in the variable
  4666. # $sharedlib_from_linklib_result
  4667. func_cygming_dll_for_implib_fallback ()
  4668. {
  4669. $debug_cmd
  4670. if func_cygming_gnu_implib_p "$1"; then
  4671. # binutils import library
  4672. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  4673. elif func_cygming_ms_implib_p "$1"; then
  4674. # ms-generated import library
  4675. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  4676. else
  4677. # unknown
  4678. sharedlib_from_linklib_result=
  4679. fi
  4680. }
  4681. # func_extract_an_archive dir oldlib
  4682. func_extract_an_archive ()
  4683. {
  4684. $debug_cmd
  4685. f_ex_an_ar_dir=$1; shift
  4686. f_ex_an_ar_oldlib=$1
  4687. if test yes = "$lock_old_archive_extraction"; then
  4688. lockfile=$f_ex_an_ar_oldlib.lock
  4689. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  4690. func_echo "Waiting for $lockfile to be removed"
  4691. sleep 2
  4692. done
  4693. fi
  4694. func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
  4695. 'stat=$?; rm -f "$lockfile"; exit $stat'
  4696. if test yes = "$lock_old_archive_extraction"; then
  4697. $opt_dry_run || rm -f "$lockfile"
  4698. fi
  4699. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  4700. :
  4701. else
  4702. func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  4703. fi
  4704. }
  4705. # func_extract_archives gentop oldlib ...
  4706. func_extract_archives ()
  4707. {
  4708. $debug_cmd
  4709. my_gentop=$1; shift
  4710. my_oldlibs=${1+"$@"}
  4711. my_oldobjs=
  4712. my_xlib=
  4713. my_xabs=
  4714. my_xdir=
  4715. for my_xlib in $my_oldlibs; do
  4716. # Extract the objects.
  4717. case $my_xlib in
  4718. [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
  4719. *) my_xabs=`pwd`"/$my_xlib" ;;
  4720. esac
  4721. func_basename "$my_xlib"
  4722. my_xlib=$func_basename_result
  4723. my_xlib_u=$my_xlib
  4724. while :; do
  4725. case " $extracted_archives " in
  4726. *" $my_xlib_u "*)
  4727. func_arith $extracted_serial + 1
  4728. extracted_serial=$func_arith_result
  4729. my_xlib_u=lt$extracted_serial-$my_xlib ;;
  4730. *) break ;;
  4731. esac
  4732. done
  4733. extracted_archives="$extracted_archives $my_xlib_u"
  4734. my_xdir=$my_gentop/$my_xlib_u
  4735. func_mkdir_p "$my_xdir"
  4736. case $host in
  4737. *-darwin*)
  4738. func_verbose "Extracting $my_xabs"
  4739. # Do not bother doing anything if just a dry run
  4740. $opt_dry_run || {
  4741. darwin_orig_dir=`pwd`
  4742. cd $my_xdir || exit $?
  4743. darwin_archive=$my_xabs
  4744. darwin_curdir=`pwd`
  4745. func_basename "$darwin_archive"
  4746. darwin_base_archive=$func_basename_result
  4747. darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  4748. if test -n "$darwin_arches"; then
  4749. darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  4750. darwin_arch=
  4751. func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  4752. for darwin_arch in $darwin_arches; do
  4753. func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
  4754. $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
  4755. cd "unfat-$$/$darwin_base_archive-$darwin_arch"
  4756. func_extract_an_archive "`pwd`" "$darwin_base_archive"
  4757. cd "$darwin_curdir"
  4758. $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
  4759. done # $darwin_arches
  4760. ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  4761. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
  4762. darwin_file=
  4763. darwin_files=
  4764. for darwin_file in $darwin_filelist; do
  4765. darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  4766. $LIPO -create -output "$darwin_file" $darwin_files
  4767. done # $darwin_filelist
  4768. $RM -rf unfat-$$
  4769. cd "$darwin_orig_dir"
  4770. else
  4771. cd $darwin_orig_dir
  4772. func_extract_an_archive "$my_xdir" "$my_xabs"
  4773. fi # $darwin_arches
  4774. } # !$opt_dry_run
  4775. ;;
  4776. *)
  4777. func_extract_an_archive "$my_xdir" "$my_xabs"
  4778. ;;
  4779. esac
  4780. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  4781. done
  4782. func_extract_archives_result=$my_oldobjs
  4783. }
  4784. # func_emit_wrapper [arg=no]
  4785. #
  4786. # Emit a libtool wrapper script on stdout.
  4787. # Don't directly open a file because we may want to
  4788. # incorporate the script contents within a cygwin/mingw
  4789. # wrapper executable. Must ONLY be called from within
  4790. # func_mode_link because it depends on a number of variables
  4791. # set therein.
  4792. #
  4793. # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  4794. # variable will take. If 'yes', then the emitted script
  4795. # will assume that the directory where it is stored is
  4796. # the $objdir directory. This is a cygwin/mingw-specific
  4797. # behavior.
  4798. func_emit_wrapper ()
  4799. {
  4800. func_emit_wrapper_arg1=${1-no}
  4801. $ECHO "\
  4802. #! $SHELL
  4803. # $output - temporary wrapper script for $objdir/$outputname
  4804. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  4805. #
  4806. # The $output program cannot be directly executed until all the libtool
  4807. # libraries that it depends on are installed.
  4808. #
  4809. # This wrapper script should never be moved out of the build directory.
  4810. # If it is, it will not operate correctly.
  4811. # Sed substitution that helps us do robust quoting. It backslashifies
  4812. # metacharacters that are still active within double-quoted strings.
  4813. sed_quote_subst='$sed_quote_subst'
  4814. # Be Bourne compatible
  4815. if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  4816. emulate sh
  4817. NULLCMD=:
  4818. # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  4819. # is contrary to our usage. Disable this feature.
  4820. alias -g '\${1+\"\$@\"}'='\"\$@\"'
  4821. setopt NO_GLOB_SUBST
  4822. else
  4823. case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  4824. fi
  4825. BIN_SH=xpg4; export BIN_SH # for Tru64
  4826. DUALCASE=1; export DUALCASE # for MKS sh
  4827. # The HP-UX ksh and POSIX shell print the target directory to stdout
  4828. # if CDPATH is set.
  4829. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  4830. relink_command=\"$relink_command\"
  4831. # This environment variable determines our operation mode.
  4832. if test \"\$libtool_install_magic\" = \"$magic\"; then
  4833. # install mode needs the following variables:
  4834. generated_by_libtool_version='$macro_version'
  4835. notinst_deplibs='$notinst_deplibs'
  4836. else
  4837. # When we are sourced in execute mode, \$file and \$ECHO are already set.
  4838. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4839. file=\"\$0\""
  4840. qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
  4841. $ECHO "\
  4842. # A function that is used when there is no print builtin or printf.
  4843. func_fallback_echo ()
  4844. {
  4845. eval 'cat <<_LTECHO_EOF
  4846. \$1
  4847. _LTECHO_EOF'
  4848. }
  4849. ECHO=\"$qECHO\"
  4850. fi
  4851. # Very basic option parsing. These options are (a) specific to
  4852. # the libtool wrapper, (b) are identical between the wrapper
  4853. # /script/ and the wrapper /executable/ that is used only on
  4854. # windows platforms, and (c) all begin with the string "--lt-"
  4855. # (application programs are unlikely to have options that match
  4856. # this pattern).
  4857. #
  4858. # There are only two supported options: --lt-debug and
  4859. # --lt-dump-script. There is, deliberately, no --lt-help.
  4860. #
  4861. # The first argument to this parsing function should be the
  4862. # script's $0 value, followed by "$@".
  4863. lt_option_debug=
  4864. func_parse_lt_options ()
  4865. {
  4866. lt_script_arg0=\$0
  4867. shift
  4868. for lt_opt
  4869. do
  4870. case \"\$lt_opt\" in
  4871. --lt-debug) lt_option_debug=1 ;;
  4872. --lt-dump-script)
  4873. lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
  4874. test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
  4875. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
  4876. cat \"\$lt_dump_D/\$lt_dump_F\"
  4877. exit 0
  4878. ;;
  4879. --lt-*)
  4880. \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
  4881. exit 1
  4882. ;;
  4883. esac
  4884. done
  4885. # Print the debug banner immediately:
  4886. if test -n \"\$lt_option_debug\"; then
  4887. echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  4888. fi
  4889. }
  4890. # Used when --lt-debug. Prints its arguments to stdout
  4891. # (redirection is the responsibility of the caller)
  4892. func_lt_dump_args ()
  4893. {
  4894. lt_dump_args_N=1;
  4895. for lt_arg
  4896. do
  4897. \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
  4898. lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  4899. done
  4900. }
  4901. # Core function for launching the target application
  4902. func_exec_program_core ()
  4903. {
  4904. "
  4905. case $host in
  4906. # Backslashes separate directories on plain windows
  4907. *-*-mingw | *-*-os2* | *-cegcc*)
  4908. $ECHO "\
  4909. if test -n \"\$lt_option_debug\"; then
  4910. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
  4911. func_lt_dump_args \${1+\"\$@\"} 1>&2
  4912. fi
  4913. exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  4914. "
  4915. ;;
  4916. *)
  4917. $ECHO "\
  4918. if test -n \"\$lt_option_debug\"; then
  4919. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
  4920. func_lt_dump_args \${1+\"\$@\"} 1>&2
  4921. fi
  4922. exec \"\$progdir/\$program\" \${1+\"\$@\"}
  4923. "
  4924. ;;
  4925. esac
  4926. $ECHO "\
  4927. \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  4928. exit 1
  4929. }
  4930. # A function to encapsulate launching the target application
  4931. # Strips options in the --lt-* namespace from \$@ and
  4932. # launches target application with the remaining arguments.
  4933. func_exec_program ()
  4934. {
  4935. case \" \$* \" in
  4936. *\\ --lt-*)
  4937. for lt_wr_arg
  4938. do
  4939. case \$lt_wr_arg in
  4940. --lt-*) ;;
  4941. *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
  4942. esac
  4943. shift
  4944. done ;;
  4945. esac
  4946. func_exec_program_core \${1+\"\$@\"}
  4947. }
  4948. # Parse options
  4949. func_parse_lt_options \"\$0\" \${1+\"\$@\"}
  4950. # Find the directory that this script lives in.
  4951. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
  4952. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  4953. # Follow symbolic links until we get to the real thisdir.
  4954. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
  4955. while test -n \"\$file\"; do
  4956. destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
  4957. # If there was a directory component, then change thisdir.
  4958. if test \"x\$destdir\" != \"x\$file\"; then
  4959. case \"\$destdir\" in
  4960. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  4961. *) thisdir=\"\$thisdir/\$destdir\" ;;
  4962. esac
  4963. fi
  4964. file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
  4965. file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
  4966. done
  4967. # Usually 'no', except on cygwin/mingw when embedded into
  4968. # the cwrapper.
  4969. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
  4970. if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  4971. # special case for '.'
  4972. if test \"\$thisdir\" = \".\"; then
  4973. thisdir=\`pwd\`
  4974. fi
  4975. # remove .libs from thisdir
  4976. case \"\$thisdir\" in
  4977. *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
  4978. $objdir ) thisdir=. ;;
  4979. esac
  4980. fi
  4981. # Try to get the absolute directory name.
  4982. absdir=\`cd \"\$thisdir\" && pwd\`
  4983. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  4984. "
  4985. if test yes = "$fast_install"; then
  4986. $ECHO "\
  4987. program=lt-'$outputname'$exeext
  4988. progdir=\"\$thisdir/$objdir\"
  4989. if test ! -f \"\$progdir/\$program\" ||
  4990. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
  4991. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  4992. file=\"\$\$-\$program\"
  4993. if test ! -d \"\$progdir\"; then
  4994. $MKDIR \"\$progdir\"
  4995. else
  4996. $RM \"\$progdir/\$file\"
  4997. fi"
  4998. $ECHO "\
  4999. # relink executable if necessary
  5000. if test -n \"\$relink_command\"; then
  5001. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  5002. else
  5003. \$ECHO \"\$relink_command_output\" >&2
  5004. $RM \"\$progdir/\$file\"
  5005. exit 1
  5006. fi
  5007. fi
  5008. $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  5009. { $RM \"\$progdir/\$program\";
  5010. $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  5011. $RM \"\$progdir/\$file\"
  5012. fi"
  5013. else
  5014. $ECHO "\
  5015. program='$outputname'
  5016. progdir=\"\$thisdir/$objdir\"
  5017. "
  5018. fi
  5019. $ECHO "\
  5020. if test -f \"\$progdir/\$program\"; then"
  5021. # fixup the dll searchpath if we need to.
  5022. #
  5023. # Fix the DLL searchpath if we need to. Do this before prepending
  5024. # to shlibpath, because on Windows, both are PATH and uninstalled
  5025. # libraries must come first.
  5026. if test -n "$dllsearchpath"; then
  5027. $ECHO "\
  5028. # Add the dll search path components to the executable PATH
  5029. PATH=$dllsearchpath:\$PATH
  5030. "
  5031. fi
  5032. # Export our shlibpath_var if we have one.
  5033. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5034. $ECHO "\
  5035. # Add our own library path to $shlibpath_var
  5036. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  5037. # Some systems cannot cope with colon-terminated $shlibpath_var
  5038. # The second colon is a workaround for a bug in BeOS R4 sed
  5039. $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
  5040. export $shlibpath_var
  5041. "
  5042. fi
  5043. $ECHO "\
  5044. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5045. # Run the actual program with our arguments.
  5046. func_exec_program \${1+\"\$@\"}
  5047. fi
  5048. else
  5049. # The program doesn't exist.
  5050. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
  5051. \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  5052. \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  5053. exit 1
  5054. fi
  5055. fi\
  5056. "
  5057. }
  5058. # func_emit_cwrapperexe_src
  5059. # emit the source code for a wrapper executable on stdout
  5060. # Must ONLY be called from within func_mode_link because
  5061. # it depends on a number of variable set therein.
  5062. func_emit_cwrapperexe_src ()
  5063. {
  5064. cat <<EOF
  5065. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  5066. Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  5067. The $output program cannot be directly executed until all the libtool
  5068. libraries that it depends on are installed.
  5069. This wrapper executable should never be moved out of the build directory.
  5070. If it is, it will not operate correctly.
  5071. */
  5072. EOF
  5073. cat <<"EOF"
  5074. #ifdef _MSC_VER
  5075. # define _CRT_SECURE_NO_DEPRECATE 1
  5076. #endif
  5077. #include <stdio.h>
  5078. #include <stdlib.h>
  5079. #ifdef _MSC_VER
  5080. # include <direct.h>
  5081. # include <process.h>
  5082. # include <io.h>
  5083. #else
  5084. # include <unistd.h>
  5085. # include <stdint.h>
  5086. # ifdef __CYGWIN__
  5087. # include <io.h>
  5088. # endif
  5089. #endif
  5090. #include <malloc.h>
  5091. #include <stdarg.h>
  5092. #include <assert.h>
  5093. #include <string.h>
  5094. #include <ctype.h>
  5095. #include <errno.h>
  5096. #include <fcntl.h>
  5097. #include <sys/stat.h>
  5098. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  5099. /* declarations of non-ANSI functions */
  5100. #if defined __MINGW32__
  5101. # ifdef __STRICT_ANSI__
  5102. int _putenv (const char *);
  5103. # endif
  5104. #elif defined __CYGWIN__
  5105. # ifdef __STRICT_ANSI__
  5106. char *realpath (const char *, char *);
  5107. int putenv (char *);
  5108. int setenv (const char *, const char *, int);
  5109. # endif
  5110. /* #elif defined other_platform || defined ... */
  5111. #endif
  5112. /* portability defines, excluding path handling macros */
  5113. #if defined _MSC_VER
  5114. # define setmode _setmode
  5115. # define stat _stat
  5116. # define chmod _chmod
  5117. # define getcwd _getcwd
  5118. # define putenv _putenv
  5119. # define S_IXUSR _S_IEXEC
  5120. #elif defined __MINGW32__
  5121. # define setmode _setmode
  5122. # define stat _stat
  5123. # define chmod _chmod
  5124. # define getcwd _getcwd
  5125. # define putenv _putenv
  5126. #elif defined __CYGWIN__
  5127. # define HAVE_SETENV
  5128. # define FOPEN_WB "wb"
  5129. /* #elif defined other platforms ... */
  5130. #endif
  5131. #if defined PATH_MAX
  5132. # define LT_PATHMAX PATH_MAX
  5133. #elif defined MAXPATHLEN
  5134. # define LT_PATHMAX MAXPATHLEN
  5135. #else
  5136. # define LT_PATHMAX 1024
  5137. #endif
  5138. #ifndef S_IXOTH
  5139. # define S_IXOTH 0
  5140. #endif
  5141. #ifndef S_IXGRP
  5142. # define S_IXGRP 0
  5143. #endif
  5144. /* path handling portability macros */
  5145. #ifndef DIR_SEPARATOR
  5146. # define DIR_SEPARATOR '/'
  5147. # define PATH_SEPARATOR ':'
  5148. #endif
  5149. #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
  5150. defined __OS2__
  5151. # define HAVE_DOS_BASED_FILE_SYSTEM
  5152. # define FOPEN_WB "wb"
  5153. # ifndef DIR_SEPARATOR_2
  5154. # define DIR_SEPARATOR_2 '\\'
  5155. # endif
  5156. # ifndef PATH_SEPARATOR_2
  5157. # define PATH_SEPARATOR_2 ';'
  5158. # endif
  5159. #endif
  5160. #ifndef DIR_SEPARATOR_2
  5161. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  5162. #else /* DIR_SEPARATOR_2 */
  5163. # define IS_DIR_SEPARATOR(ch) \
  5164. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  5165. #endif /* DIR_SEPARATOR_2 */
  5166. #ifndef PATH_SEPARATOR_2
  5167. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  5168. #else /* PATH_SEPARATOR_2 */
  5169. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  5170. #endif /* PATH_SEPARATOR_2 */
  5171. #ifndef FOPEN_WB
  5172. # define FOPEN_WB "w"
  5173. #endif
  5174. #ifndef _O_BINARY
  5175. # define _O_BINARY 0
  5176. #endif
  5177. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  5178. #define XFREE(stale) do { \
  5179. if (stale) { free (stale); stale = 0; } \
  5180. } while (0)
  5181. #if defined LT_DEBUGWRAPPER
  5182. static int lt_debug = 1;
  5183. #else
  5184. static int lt_debug = 0;
  5185. #endif
  5186. const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
  5187. void *xmalloc (size_t num);
  5188. char *xstrdup (const char *string);
  5189. const char *base_name (const char *name);
  5190. char *find_executable (const char *wrapper);
  5191. char *chase_symlinks (const char *pathspec);
  5192. int make_executable (const char *path);
  5193. int check_executable (const char *path);
  5194. char *strendzap (char *str, const char *pat);
  5195. void lt_debugprintf (const char *file, int line, const char *fmt, ...);
  5196. void lt_fatal (const char *file, int line, const char *message, ...);
  5197. static const char *nonnull (const char *s);
  5198. static const char *nonempty (const char *s);
  5199. void lt_setenv (const char *name, const char *value);
  5200. char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  5201. void lt_update_exe_path (const char *name, const char *value);
  5202. void lt_update_lib_path (const char *name, const char *value);
  5203. char **prepare_spawn (char **argv);
  5204. void lt_dump_script (FILE *f);
  5205. EOF
  5206. cat <<EOF
  5207. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  5208. # define externally_visible volatile
  5209. #else
  5210. # define externally_visible __attribute__((externally_visible)) volatile
  5211. #endif
  5212. externally_visible const char * MAGIC_EXE = "$magic_exe";
  5213. const char * LIB_PATH_VARNAME = "$shlibpath_var";
  5214. EOF
  5215. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5216. func_to_host_path "$temp_rpath"
  5217. cat <<EOF
  5218. const char * LIB_PATH_VALUE = "$func_to_host_path_result";
  5219. EOF
  5220. else
  5221. cat <<"EOF"
  5222. const char * LIB_PATH_VALUE = "";
  5223. EOF
  5224. fi
  5225. if test -n "$dllsearchpath"; then
  5226. func_to_host_path "$dllsearchpath:"
  5227. cat <<EOF
  5228. const char * EXE_PATH_VARNAME = "PATH";
  5229. const char * EXE_PATH_VALUE = "$func_to_host_path_result";
  5230. EOF
  5231. else
  5232. cat <<"EOF"
  5233. const char * EXE_PATH_VARNAME = "";
  5234. const char * EXE_PATH_VALUE = "";
  5235. EOF
  5236. fi
  5237. if test yes = "$fast_install"; then
  5238. cat <<EOF
  5239. const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  5240. EOF
  5241. else
  5242. cat <<EOF
  5243. const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  5244. EOF
  5245. fi
  5246. cat <<"EOF"
  5247. #define LTWRAPPER_OPTION_PREFIX "--lt-"
  5248. static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  5249. static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  5250. static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
  5251. int
  5252. main (int argc, char *argv[])
  5253. {
  5254. char **newargz;
  5255. int newargc;
  5256. char *tmp_pathspec;
  5257. char *actual_cwrapper_path;
  5258. char *actual_cwrapper_name;
  5259. char *target_name;
  5260. char *lt_argv_zero;
  5261. int rval = 127;
  5262. int i;
  5263. program_name = (char *) xstrdup (base_name (argv[0]));
  5264. newargz = XMALLOC (char *, (size_t) argc + 1);
  5265. /* very simple arg parsing; don't want to rely on getopt
  5266. * also, copy all non cwrapper options to newargz, except
  5267. * argz[0], which is handled differently
  5268. */
  5269. newargc=0;
  5270. for (i = 1; i < argc; i++)
  5271. {
  5272. if (STREQ (argv[i], dumpscript_opt))
  5273. {
  5274. EOF
  5275. case $host in
  5276. *mingw* | *cygwin* )
  5277. # make stdout use "unix" line endings
  5278. echo " setmode(1,_O_BINARY);"
  5279. ;;
  5280. esac
  5281. cat <<"EOF"
  5282. lt_dump_script (stdout);
  5283. return 0;
  5284. }
  5285. if (STREQ (argv[i], debug_opt))
  5286. {
  5287. lt_debug = 1;
  5288. continue;
  5289. }
  5290. if (STREQ (argv[i], ltwrapper_option_prefix))
  5291. {
  5292. /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  5293. namespace, but it is not one of the ones we know about and
  5294. have already dealt with, above (inluding dump-script), then
  5295. report an error. Otherwise, targets might begin to believe
  5296. they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  5297. namespace. The first time any user complains about this, we'll
  5298. need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  5299. or a configure.ac-settable value.
  5300. */
  5301. lt_fatal (__FILE__, __LINE__,
  5302. "unrecognized %s option: '%s'",
  5303. ltwrapper_option_prefix, argv[i]);
  5304. }
  5305. /* otherwise ... */
  5306. newargz[++newargc] = xstrdup (argv[i]);
  5307. }
  5308. newargz[++newargc] = NULL;
  5309. EOF
  5310. cat <<EOF
  5311. /* The GNU banner must be the first non-error debug message */
  5312. lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
  5313. EOF
  5314. cat <<"EOF"
  5315. lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  5316. lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
  5317. tmp_pathspec = find_executable (argv[0]);
  5318. if (tmp_pathspec == NULL)
  5319. lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  5320. lt_debugprintf (__FILE__, __LINE__,
  5321. "(main) found exe (before symlink chase) at: %s\n",
  5322. tmp_pathspec);
  5323. actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  5324. lt_debugprintf (__FILE__, __LINE__,
  5325. "(main) found exe (after symlink chase) at: %s\n",
  5326. actual_cwrapper_path);
  5327. XFREE (tmp_pathspec);
  5328. actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  5329. strendzap (actual_cwrapper_path, actual_cwrapper_name);
  5330. /* wrapper name transforms */
  5331. strendzap (actual_cwrapper_name, ".exe");
  5332. tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  5333. XFREE (actual_cwrapper_name);
  5334. actual_cwrapper_name = tmp_pathspec;
  5335. tmp_pathspec = 0;
  5336. /* target_name transforms -- use actual target program name; might have lt- prefix */
  5337. target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  5338. strendzap (target_name, ".exe");
  5339. tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  5340. XFREE (target_name);
  5341. target_name = tmp_pathspec;
  5342. tmp_pathspec = 0;
  5343. lt_debugprintf (__FILE__, __LINE__,
  5344. "(main) libtool target name: %s\n",
  5345. target_name);
  5346. EOF
  5347. cat <<EOF
  5348. newargz[0] =
  5349. XMALLOC (char, (strlen (actual_cwrapper_path) +
  5350. strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  5351. strcpy (newargz[0], actual_cwrapper_path);
  5352. strcat (newargz[0], "$objdir");
  5353. strcat (newargz[0], "/");
  5354. EOF
  5355. cat <<"EOF"
  5356. /* stop here, and copy so we don't have to do this twice */
  5357. tmp_pathspec = xstrdup (newargz[0]);
  5358. /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  5359. strcat (newargz[0], actual_cwrapper_name);
  5360. /* DO want the lt- prefix here if it exists, so use target_name */
  5361. lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  5362. XFREE (tmp_pathspec);
  5363. tmp_pathspec = NULL;
  5364. EOF
  5365. case $host_os in
  5366. mingw*)
  5367. cat <<"EOF"
  5368. {
  5369. char* p;
  5370. while ((p = strchr (newargz[0], '\\')) != NULL)
  5371. {
  5372. *p = '/';
  5373. }
  5374. while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  5375. {
  5376. *p = '/';
  5377. }
  5378. }
  5379. EOF
  5380. ;;
  5381. esac
  5382. cat <<"EOF"
  5383. XFREE (target_name);
  5384. XFREE (actual_cwrapper_path);
  5385. XFREE (actual_cwrapper_name);
  5386. lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  5387. lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  5388. /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
  5389. be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
  5390. because on Windows, both *_VARNAMEs are PATH but uninstalled
  5391. libraries must come first. */
  5392. lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  5393. lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  5394. lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
  5395. nonnull (lt_argv_zero));
  5396. for (i = 0; i < newargc; i++)
  5397. {
  5398. lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
  5399. i, nonnull (newargz[i]));
  5400. }
  5401. EOF
  5402. case $host_os in
  5403. mingw*)
  5404. cat <<"EOF"
  5405. /* execv doesn't actually work on mingw as expected on unix */
  5406. newargz = prepare_spawn (newargz);
  5407. rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  5408. if (rval == -1)
  5409. {
  5410. /* failed to start process */
  5411. lt_debugprintf (__FILE__, __LINE__,
  5412. "(main) failed to launch target \"%s\": %s\n",
  5413. lt_argv_zero, nonnull (strerror (errno)));
  5414. return 127;
  5415. }
  5416. return rval;
  5417. EOF
  5418. ;;
  5419. *)
  5420. cat <<"EOF"
  5421. execv (lt_argv_zero, newargz);
  5422. return rval; /* =127, but avoids unused variable warning */
  5423. EOF
  5424. ;;
  5425. esac
  5426. cat <<"EOF"
  5427. }
  5428. void *
  5429. xmalloc (size_t num)
  5430. {
  5431. void *p = (void *) malloc (num);
  5432. if (!p)
  5433. lt_fatal (__FILE__, __LINE__, "memory exhausted");
  5434. return p;
  5435. }
  5436. char *
  5437. xstrdup (const char *string)
  5438. {
  5439. return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  5440. string) : NULL;
  5441. }
  5442. const char *
  5443. base_name (const char *name)
  5444. {
  5445. const char *base;
  5446. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5447. /* Skip over the disk name in MSDOS pathnames. */
  5448. if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  5449. name += 2;
  5450. #endif
  5451. for (base = name; *name; name++)
  5452. if (IS_DIR_SEPARATOR (*name))
  5453. base = name + 1;
  5454. return base;
  5455. }
  5456. int
  5457. check_executable (const char *path)
  5458. {
  5459. struct stat st;
  5460. lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
  5461. nonempty (path));
  5462. if ((!path) || (!*path))
  5463. return 0;
  5464. if ((stat (path, &st) >= 0)
  5465. && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  5466. return 1;
  5467. else
  5468. return 0;
  5469. }
  5470. int
  5471. make_executable (const char *path)
  5472. {
  5473. int rval = 0;
  5474. struct stat st;
  5475. lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
  5476. nonempty (path));
  5477. if ((!path) || (!*path))
  5478. return 0;
  5479. if (stat (path, &st) >= 0)
  5480. {
  5481. rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  5482. }
  5483. return rval;
  5484. }
  5485. /* Searches for the full path of the wrapper. Returns
  5486. newly allocated full path name if found, NULL otherwise
  5487. Does not chase symlinks, even on platforms that support them.
  5488. */
  5489. char *
  5490. find_executable (const char *wrapper)
  5491. {
  5492. int has_slash = 0;
  5493. const char *p;
  5494. const char *p_next;
  5495. /* static buffer for getcwd */
  5496. char tmp[LT_PATHMAX + 1];
  5497. size_t tmp_len;
  5498. char *concat_name;
  5499. lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
  5500. nonempty (wrapper));
  5501. if ((wrapper == NULL) || (*wrapper == '\0'))
  5502. return NULL;
  5503. /* Absolute path? */
  5504. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5505. if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  5506. {
  5507. concat_name = xstrdup (wrapper);
  5508. if (check_executable (concat_name))
  5509. return concat_name;
  5510. XFREE (concat_name);
  5511. }
  5512. else
  5513. {
  5514. #endif
  5515. if (IS_DIR_SEPARATOR (wrapper[0]))
  5516. {
  5517. concat_name = xstrdup (wrapper);
  5518. if (check_executable (concat_name))
  5519. return concat_name;
  5520. XFREE (concat_name);
  5521. }
  5522. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5523. }
  5524. #endif
  5525. for (p = wrapper; *p; p++)
  5526. if (*p == '/')
  5527. {
  5528. has_slash = 1;
  5529. break;
  5530. }
  5531. if (!has_slash)
  5532. {
  5533. /* no slashes; search PATH */
  5534. const char *path = getenv ("PATH");
  5535. if (path != NULL)
  5536. {
  5537. for (p = path; *p; p = p_next)
  5538. {
  5539. const char *q;
  5540. size_t p_len;
  5541. for (q = p; *q; q++)
  5542. if (IS_PATH_SEPARATOR (*q))
  5543. break;
  5544. p_len = (size_t) (q - p);
  5545. p_next = (*q == '\0' ? q : q + 1);
  5546. if (p_len == 0)
  5547. {
  5548. /* empty path: current directory */
  5549. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5550. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5551. nonnull (strerror (errno)));
  5552. tmp_len = strlen (tmp);
  5553. concat_name =
  5554. XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5555. memcpy (concat_name, tmp, tmp_len);
  5556. concat_name[tmp_len] = '/';
  5557. strcpy (concat_name + tmp_len + 1, wrapper);
  5558. }
  5559. else
  5560. {
  5561. concat_name =
  5562. XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  5563. memcpy (concat_name, p, p_len);
  5564. concat_name[p_len] = '/';
  5565. strcpy (concat_name + p_len + 1, wrapper);
  5566. }
  5567. if (check_executable (concat_name))
  5568. return concat_name;
  5569. XFREE (concat_name);
  5570. }
  5571. }
  5572. /* not found in PATH; assume curdir */
  5573. }
  5574. /* Relative path | not found in path: prepend cwd */
  5575. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5576. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5577. nonnull (strerror (errno)));
  5578. tmp_len = strlen (tmp);
  5579. concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5580. memcpy (concat_name, tmp, tmp_len);
  5581. concat_name[tmp_len] = '/';
  5582. strcpy (concat_name + tmp_len + 1, wrapper);
  5583. if (check_executable (concat_name))
  5584. return concat_name;
  5585. XFREE (concat_name);
  5586. return NULL;
  5587. }
  5588. char *
  5589. chase_symlinks (const char *pathspec)
  5590. {
  5591. #ifndef S_ISLNK
  5592. return xstrdup (pathspec);
  5593. #else
  5594. char buf[LT_PATHMAX];
  5595. struct stat s;
  5596. char *tmp_pathspec = xstrdup (pathspec);
  5597. char *p;
  5598. int has_symlinks = 0;
  5599. while (strlen (tmp_pathspec) && !has_symlinks)
  5600. {
  5601. lt_debugprintf (__FILE__, __LINE__,
  5602. "checking path component for symlinks: %s\n",
  5603. tmp_pathspec);
  5604. if (lstat (tmp_pathspec, &s) == 0)
  5605. {
  5606. if (S_ISLNK (s.st_mode) != 0)
  5607. {
  5608. has_symlinks = 1;
  5609. break;
  5610. }
  5611. /* search backwards for last DIR_SEPARATOR */
  5612. p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  5613. while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5614. p--;
  5615. if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5616. {
  5617. /* no more DIR_SEPARATORS left */
  5618. break;
  5619. }
  5620. *p = '\0';
  5621. }
  5622. else
  5623. {
  5624. lt_fatal (__FILE__, __LINE__,
  5625. "error accessing file \"%s\": %s",
  5626. tmp_pathspec, nonnull (strerror (errno)));
  5627. }
  5628. }
  5629. XFREE (tmp_pathspec);
  5630. if (!has_symlinks)
  5631. {
  5632. return xstrdup (pathspec);
  5633. }
  5634. tmp_pathspec = realpath (pathspec, buf);
  5635. if (tmp_pathspec == 0)
  5636. {
  5637. lt_fatal (__FILE__, __LINE__,
  5638. "could not follow symlinks for %s", pathspec);
  5639. }
  5640. return xstrdup (tmp_pathspec);
  5641. #endif
  5642. }
  5643. char *
  5644. strendzap (char *str, const char *pat)
  5645. {
  5646. size_t len, patlen;
  5647. assert (str != NULL);
  5648. assert (pat != NULL);
  5649. len = strlen (str);
  5650. patlen = strlen (pat);
  5651. if (patlen <= len)
  5652. {
  5653. str += len - patlen;
  5654. if (STREQ (str, pat))
  5655. *str = '\0';
  5656. }
  5657. return str;
  5658. }
  5659. void
  5660. lt_debugprintf (const char *file, int line, const char *fmt, ...)
  5661. {
  5662. va_list args;
  5663. if (lt_debug)
  5664. {
  5665. (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
  5666. va_start (args, fmt);
  5667. (void) vfprintf (stderr, fmt, args);
  5668. va_end (args);
  5669. }
  5670. }
  5671. static void
  5672. lt_error_core (int exit_status, const char *file,
  5673. int line, const char *mode,
  5674. const char *message, va_list ap)
  5675. {
  5676. fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
  5677. vfprintf (stderr, message, ap);
  5678. fprintf (stderr, ".\n");
  5679. if (exit_status >= 0)
  5680. exit (exit_status);
  5681. }
  5682. void
  5683. lt_fatal (const char *file, int line, const char *message, ...)
  5684. {
  5685. va_list ap;
  5686. va_start (ap, message);
  5687. lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
  5688. va_end (ap);
  5689. }
  5690. static const char *
  5691. nonnull (const char *s)
  5692. {
  5693. return s ? s : "(null)";
  5694. }
  5695. static const char *
  5696. nonempty (const char *s)
  5697. {
  5698. return (s && !*s) ? "(empty)" : nonnull (s);
  5699. }
  5700. void
  5701. lt_setenv (const char *name, const char *value)
  5702. {
  5703. lt_debugprintf (__FILE__, __LINE__,
  5704. "(lt_setenv) setting '%s' to '%s'\n",
  5705. nonnull (name), nonnull (value));
  5706. {
  5707. #ifdef HAVE_SETENV
  5708. /* always make a copy, for consistency with !HAVE_SETENV */
  5709. char *str = xstrdup (value);
  5710. setenv (name, str, 1);
  5711. #else
  5712. size_t len = strlen (name) + 1 + strlen (value) + 1;
  5713. char *str = XMALLOC (char, len);
  5714. sprintf (str, "%s=%s", name, value);
  5715. if (putenv (str) != EXIT_SUCCESS)
  5716. {
  5717. XFREE (str);
  5718. }
  5719. #endif
  5720. }
  5721. }
  5722. char *
  5723. lt_extend_str (const char *orig_value, const char *add, int to_end)
  5724. {
  5725. char *new_value;
  5726. if (orig_value && *orig_value)
  5727. {
  5728. size_t orig_value_len = strlen (orig_value);
  5729. size_t add_len = strlen (add);
  5730. new_value = XMALLOC (char, add_len + orig_value_len + 1);
  5731. if (to_end)
  5732. {
  5733. strcpy (new_value, orig_value);
  5734. strcpy (new_value + orig_value_len, add);
  5735. }
  5736. else
  5737. {
  5738. strcpy (new_value, add);
  5739. strcpy (new_value + add_len, orig_value);
  5740. }
  5741. }
  5742. else
  5743. {
  5744. new_value = xstrdup (add);
  5745. }
  5746. return new_value;
  5747. }
  5748. void
  5749. lt_update_exe_path (const char *name, const char *value)
  5750. {
  5751. lt_debugprintf (__FILE__, __LINE__,
  5752. "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  5753. nonnull (name), nonnull (value));
  5754. if (name && *name && value && *value)
  5755. {
  5756. char *new_value = lt_extend_str (getenv (name), value, 0);
  5757. /* some systems can't cope with a ':'-terminated path #' */
  5758. size_t len = strlen (new_value);
  5759. while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  5760. {
  5761. new_value[--len] = '\0';
  5762. }
  5763. lt_setenv (name, new_value);
  5764. XFREE (new_value);
  5765. }
  5766. }
  5767. void
  5768. lt_update_lib_path (const char *name, const char *value)
  5769. {
  5770. lt_debugprintf (__FILE__, __LINE__,
  5771. "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  5772. nonnull (name), nonnull (value));
  5773. if (name && *name && value && *value)
  5774. {
  5775. char *new_value = lt_extend_str (getenv (name), value, 0);
  5776. lt_setenv (name, new_value);
  5777. XFREE (new_value);
  5778. }
  5779. }
  5780. EOF
  5781. case $host_os in
  5782. mingw*)
  5783. cat <<"EOF"
  5784. /* Prepares an argument vector before calling spawn().
  5785. Note that spawn() does not by itself call the command interpreter
  5786. (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
  5787. ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  5788. GetVersionEx(&v);
  5789. v.dwPlatformId == VER_PLATFORM_WIN32_NT;
  5790. }) ? "cmd.exe" : "command.com").
  5791. Instead it simply concatenates the arguments, separated by ' ', and calls
  5792. CreateProcess(). We must quote the arguments since Win32 CreateProcess()
  5793. interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
  5794. special way:
  5795. - Space and tab are interpreted as delimiters. They are not treated as
  5796. delimiters if they are surrounded by double quotes: "...".
  5797. - Unescaped double quotes are removed from the input. Their only effect is
  5798. that within double quotes, space and tab are treated like normal
  5799. characters.
  5800. - Backslashes not followed by double quotes are not special.
  5801. - But 2*n+1 backslashes followed by a double quote become
  5802. n backslashes followed by a double quote (n >= 0):
  5803. \" -> "
  5804. \\\" -> \"
  5805. \\\\\" -> \\"
  5806. */
  5807. #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"
  5808. #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"
  5809. char **
  5810. prepare_spawn (char **argv)
  5811. {
  5812. size_t argc;
  5813. char **new_argv;
  5814. size_t i;
  5815. /* Count number of arguments. */
  5816. for (argc = 0; argv[argc] != NULL; argc++)
  5817. ;
  5818. /* Allocate new argument vector. */
  5819. new_argv = XMALLOC (char *, argc + 1);
  5820. /* Put quoted arguments into the new argument vector. */
  5821. for (i = 0; i < argc; i++)
  5822. {
  5823. const char *string = argv[i];
  5824. if (string[0] == '\0')
  5825. new_argv[i] = xstrdup ("\"\"");
  5826. else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
  5827. {
  5828. int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
  5829. size_t length;
  5830. unsigned int backslashes;
  5831. const char *s;
  5832. char *quoted_string;
  5833. char *p;
  5834. length = 0;
  5835. backslashes = 0;
  5836. if (quote_around)
  5837. length++;
  5838. for (s = string; *s != '\0'; s++)
  5839. {
  5840. char c = *s;
  5841. if (c == '"')
  5842. length += backslashes + 1;
  5843. length++;
  5844. if (c == '\\')
  5845. backslashes++;
  5846. else
  5847. backslashes = 0;
  5848. }
  5849. if (quote_around)
  5850. length += backslashes + 1;
  5851. quoted_string = XMALLOC (char, length + 1);
  5852. p = quoted_string;
  5853. backslashes = 0;
  5854. if (quote_around)
  5855. *p++ = '"';
  5856. for (s = string; *s != '\0'; s++)
  5857. {
  5858. char c = *s;
  5859. if (c == '"')
  5860. {
  5861. unsigned int j;
  5862. for (j = backslashes + 1; j > 0; j--)
  5863. *p++ = '\\';
  5864. }
  5865. *p++ = c;
  5866. if (c == '\\')
  5867. backslashes++;
  5868. else
  5869. backslashes = 0;
  5870. }
  5871. if (quote_around)
  5872. {
  5873. unsigned int j;
  5874. for (j = backslashes; j > 0; j--)
  5875. *p++ = '\\';
  5876. *p++ = '"';
  5877. }
  5878. *p = '\0';
  5879. new_argv[i] = quoted_string;
  5880. }
  5881. else
  5882. new_argv[i] = (char *) string;
  5883. }
  5884. new_argv[argc] = NULL;
  5885. return new_argv;
  5886. }
  5887. EOF
  5888. ;;
  5889. esac
  5890. cat <<"EOF"
  5891. void lt_dump_script (FILE* f)
  5892. {
  5893. EOF
  5894. func_emit_wrapper yes |
  5895. $SED -n -e '
  5896. s/^\(.\{79\}\)\(..*\)/\1\
  5897. \2/
  5898. h
  5899. s/\([\\"]\)/\\\1/g
  5900. s/$/\\n/
  5901. s/\([^\n]*\).*/ fputs ("\1", f);/p
  5902. g
  5903. D'
  5904. cat <<"EOF"
  5905. }
  5906. EOF
  5907. }
  5908. # end: func_emit_cwrapperexe_src
  5909. # func_win32_import_lib_p ARG
  5910. # True if ARG is an import lib, as indicated by $file_magic_cmd
  5911. func_win32_import_lib_p ()
  5912. {
  5913. $debug_cmd
  5914. case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
  5915. *import*) : ;;
  5916. *) false ;;
  5917. esac
  5918. }
  5919. # func_suncc_cstd_abi
  5920. # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
  5921. # Several compiler flags select an ABI that is incompatible with the
  5922. # Cstd library. Avoid specifying it if any are in CXXFLAGS.
  5923. func_suncc_cstd_abi ()
  5924. {
  5925. $debug_cmd
  5926. case " $compile_command " in
  5927. *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
  5928. suncc_use_cstd_abi=no
  5929. ;;
  5930. *)
  5931. suncc_use_cstd_abi=yes
  5932. ;;
  5933. esac
  5934. }
  5935. # func_mode_link arg...
  5936. func_mode_link ()
  5937. {
  5938. $debug_cmd
  5939. case $host in
  5940. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  5941. # It is impossible to link a dll without this setting, and
  5942. # we shouldn't force the makefile maintainer to figure out
  5943. # what system we are compiling for in order to pass an extra
  5944. # flag for every libtool invocation.
  5945. # allow_undefined=no
  5946. # FIXME: Unfortunately, there are problems with the above when trying
  5947. # to make a dll that has undefined symbols, in which case not
  5948. # even a static library is built. For now, we need to specify
  5949. # -no-undefined on the libtool link line when we can be certain
  5950. # that all symbols are satisfied, otherwise we get a static library.
  5951. allow_undefined=yes
  5952. ;;
  5953. *)
  5954. allow_undefined=yes
  5955. ;;
  5956. esac
  5957. libtool_args=$nonopt
  5958. base_compile="$nonopt $@"
  5959. compile_command=$nonopt
  5960. finalize_command=$nonopt
  5961. compile_rpath=
  5962. finalize_rpath=
  5963. compile_shlibpath=
  5964. finalize_shlibpath=
  5965. convenience=
  5966. old_convenience=
  5967. deplibs=
  5968. old_deplibs=
  5969. compiler_flags=
  5970. linker_flags=
  5971. dllsearchpath=
  5972. lib_search_path=`pwd`
  5973. inst_prefix_dir=
  5974. new_inherited_linker_flags=
  5975. avoid_version=no
  5976. bindir=
  5977. dlfiles=
  5978. dlprefiles=
  5979. dlself=no
  5980. export_dynamic=no
  5981. export_symbols=
  5982. export_symbols_regex=
  5983. generated=
  5984. libobjs=
  5985. ltlibs=
  5986. module=no
  5987. no_install=no
  5988. objs=
  5989. os2dllname=
  5990. non_pic_objects=
  5991. precious_files_regex=
  5992. prefer_static_libs=no
  5993. preload=false
  5994. prev=
  5995. prevarg=
  5996. release=
  5997. rpath=
  5998. xrpath=
  5999. perm_rpath=
  6000. temp_rpath=
  6001. thread_safe=no
  6002. vinfo=
  6003. vinfo_number=no
  6004. weak_libs=
  6005. single_module=$wl-single_module
  6006. func_infer_tag $base_compile
  6007. # We need to know -static, to get the right output filenames.
  6008. for arg
  6009. do
  6010. case $arg in
  6011. -shared)
  6012. test yes != "$build_libtool_libs" \
  6013. && func_fatal_configuration "cannot build a shared library"
  6014. build_old_libs=no
  6015. break
  6016. ;;
  6017. -all-static | -static | -static-libtool-libs)
  6018. case $arg in
  6019. -all-static)
  6020. if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  6021. func_warning "complete static linking is impossible in this configuration"
  6022. fi
  6023. if test -n "$link_static_flag"; then
  6024. dlopen_self=$dlopen_self_static
  6025. fi
  6026. prefer_static_libs=yes
  6027. ;;
  6028. -static)
  6029. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6030. dlopen_self=$dlopen_self_static
  6031. fi
  6032. prefer_static_libs=built
  6033. ;;
  6034. -static-libtool-libs)
  6035. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6036. dlopen_self=$dlopen_self_static
  6037. fi
  6038. prefer_static_libs=yes
  6039. ;;
  6040. esac
  6041. build_libtool_libs=no
  6042. build_old_libs=yes
  6043. break
  6044. ;;
  6045. esac
  6046. done
  6047. # See if our shared archives depend on static archives.
  6048. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  6049. # Go through the arguments, transforming them on the way.
  6050. while test "$#" -gt 0; do
  6051. arg=$1
  6052. shift
  6053. func_quote_for_eval "$arg"
  6054. qarg=$func_quote_for_eval_unquoted_result
  6055. func_append libtool_args " $func_quote_for_eval_result"
  6056. # If the previous option needs an argument, assign it.
  6057. if test -n "$prev"; then
  6058. case $prev in
  6059. output)
  6060. func_append compile_command " @OUTPUT@"
  6061. func_append finalize_command " @OUTPUT@"
  6062. ;;
  6063. esac
  6064. case $prev in
  6065. bindir)
  6066. bindir=$arg
  6067. prev=
  6068. continue
  6069. ;;
  6070. dlfiles|dlprefiles)
  6071. $preload || {
  6072. # Add the symbol object into the linking commands.
  6073. func_append compile_command " @SYMFILE@"
  6074. func_append finalize_command " @SYMFILE@"
  6075. preload=:
  6076. }
  6077. case $arg in
  6078. *.la | *.lo) ;; # We handle these cases below.
  6079. force)
  6080. if test no = "$dlself"; then
  6081. dlself=needless
  6082. export_dynamic=yes
  6083. fi
  6084. prev=
  6085. continue
  6086. ;;
  6087. self)
  6088. if test dlprefiles = "$prev"; then
  6089. dlself=yes
  6090. elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
  6091. dlself=yes
  6092. else
  6093. dlself=needless
  6094. export_dynamic=yes
  6095. fi
  6096. prev=
  6097. continue
  6098. ;;
  6099. *)
  6100. if test dlfiles = "$prev"; then
  6101. func_append dlfiles " $arg"
  6102. else
  6103. func_append dlprefiles " $arg"
  6104. fi
  6105. prev=
  6106. continue
  6107. ;;
  6108. esac
  6109. ;;
  6110. expsyms)
  6111. export_symbols=$arg
  6112. test -f "$arg" \
  6113. || func_fatal_error "symbol file '$arg' does not exist"
  6114. prev=
  6115. continue
  6116. ;;
  6117. expsyms_regex)
  6118. export_symbols_regex=$arg
  6119. prev=
  6120. continue
  6121. ;;
  6122. framework)
  6123. case $host in
  6124. *-*-darwin*)
  6125. case "$deplibs " in
  6126. *" $qarg.ltframework "*) ;;
  6127. *) func_append deplibs " $qarg.ltframework" # this is fixed later
  6128. ;;
  6129. esac
  6130. ;;
  6131. esac
  6132. prev=
  6133. continue
  6134. ;;
  6135. inst_prefix)
  6136. inst_prefix_dir=$arg
  6137. prev=
  6138. continue
  6139. ;;
  6140. mllvm)
  6141. # Clang does not use LLVM to link, so we can simply discard any
  6142. # '-mllvm $arg' options when doing the link step.
  6143. prev=
  6144. continue
  6145. ;;
  6146. objectlist)
  6147. if test -f "$arg"; then
  6148. save_arg=$arg
  6149. moreargs=
  6150. for fil in `cat "$save_arg"`
  6151. do
  6152. # func_append moreargs " $fil"
  6153. arg=$fil
  6154. # A libtool-controlled object.
  6155. # Check to see that this really is a libtool object.
  6156. if func_lalib_unsafe_p "$arg"; then
  6157. pic_object=
  6158. non_pic_object=
  6159. # Read the .lo file
  6160. func_source "$arg"
  6161. if test -z "$pic_object" ||
  6162. test -z "$non_pic_object" ||
  6163. test none = "$pic_object" &&
  6164. test none = "$non_pic_object"; then
  6165. func_fatal_error "cannot find name of object for '$arg'"
  6166. fi
  6167. # Extract subdirectory from the argument.
  6168. func_dirname "$arg" "/" ""
  6169. xdir=$func_dirname_result
  6170. if test none != "$pic_object"; then
  6171. # Prepend the subdirectory the object is found in.
  6172. pic_object=$xdir$pic_object
  6173. if test dlfiles = "$prev"; then
  6174. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6175. func_append dlfiles " $pic_object"
  6176. prev=
  6177. continue
  6178. else
  6179. # If libtool objects are unsupported, then we need to preload.
  6180. prev=dlprefiles
  6181. fi
  6182. fi
  6183. # CHECK ME: I think I busted this. -Ossama
  6184. if test dlprefiles = "$prev"; then
  6185. # Preload the old-style object.
  6186. func_append dlprefiles " $pic_object"
  6187. prev=
  6188. fi
  6189. # A PIC object.
  6190. func_append libobjs " $pic_object"
  6191. arg=$pic_object
  6192. fi
  6193. # Non-PIC object.
  6194. if test none != "$non_pic_object"; then
  6195. # Prepend the subdirectory the object is found in.
  6196. non_pic_object=$xdir$non_pic_object
  6197. # A standard non-PIC object
  6198. func_append non_pic_objects " $non_pic_object"
  6199. if test -z "$pic_object" || test none = "$pic_object"; then
  6200. arg=$non_pic_object
  6201. fi
  6202. else
  6203. # If the PIC object exists, use it instead.
  6204. # $xdir was prepended to $pic_object above.
  6205. non_pic_object=$pic_object
  6206. func_append non_pic_objects " $non_pic_object"
  6207. fi
  6208. else
  6209. # Only an error if not doing a dry-run.
  6210. if $opt_dry_run; then
  6211. # Extract subdirectory from the argument.
  6212. func_dirname "$arg" "/" ""
  6213. xdir=$func_dirname_result
  6214. func_lo2o "$arg"
  6215. pic_object=$xdir$objdir/$func_lo2o_result
  6216. non_pic_object=$xdir$func_lo2o_result
  6217. func_append libobjs " $pic_object"
  6218. func_append non_pic_objects " $non_pic_object"
  6219. else
  6220. func_fatal_error "'$arg' is not a valid libtool object"
  6221. fi
  6222. fi
  6223. done
  6224. else
  6225. func_fatal_error "link input file '$arg' does not exist"
  6226. fi
  6227. arg=$save_arg
  6228. prev=
  6229. continue
  6230. ;;
  6231. os2dllname)
  6232. os2dllname=$arg
  6233. prev=
  6234. continue
  6235. ;;
  6236. precious_regex)
  6237. precious_files_regex=$arg
  6238. prev=
  6239. continue
  6240. ;;
  6241. release)
  6242. release=-$arg
  6243. prev=
  6244. continue
  6245. ;;
  6246. rpath | xrpath)
  6247. # We need an absolute path.
  6248. case $arg in
  6249. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6250. *)
  6251. func_fatal_error "only absolute run-paths are allowed"
  6252. ;;
  6253. esac
  6254. if test rpath = "$prev"; then
  6255. case "$rpath " in
  6256. *" $arg "*) ;;
  6257. *) func_append rpath " $arg" ;;
  6258. esac
  6259. else
  6260. case "$xrpath " in
  6261. *" $arg "*) ;;
  6262. *) func_append xrpath " $arg" ;;
  6263. esac
  6264. fi
  6265. prev=
  6266. continue
  6267. ;;
  6268. shrext)
  6269. shrext_cmds=$arg
  6270. prev=
  6271. continue
  6272. ;;
  6273. weak)
  6274. func_append weak_libs " $arg"
  6275. prev=
  6276. continue
  6277. ;;
  6278. xcclinker)
  6279. func_append linker_flags " $qarg"
  6280. func_append compiler_flags " $qarg"
  6281. prev=
  6282. func_append compile_command " $qarg"
  6283. func_append finalize_command " $qarg"
  6284. continue
  6285. ;;
  6286. xcompiler)
  6287. func_append compiler_flags " $qarg"
  6288. prev=
  6289. func_append compile_command " $qarg"
  6290. func_append finalize_command " $qarg"
  6291. continue
  6292. ;;
  6293. xlinker)
  6294. func_append linker_flags " $qarg"
  6295. func_append compiler_flags " $wl$qarg"
  6296. prev=
  6297. func_append compile_command " $wl$qarg"
  6298. func_append finalize_command " $wl$qarg"
  6299. continue
  6300. ;;
  6301. *)
  6302. eval "$prev=\"\$arg\""
  6303. prev=
  6304. continue
  6305. ;;
  6306. esac
  6307. fi # test -n "$prev"
  6308. prevarg=$arg
  6309. case $arg in
  6310. -all-static)
  6311. if test -n "$link_static_flag"; then
  6312. # See comment for -static flag below, for more details.
  6313. func_append compile_command " $link_static_flag"
  6314. func_append finalize_command " $link_static_flag"
  6315. fi
  6316. continue
  6317. ;;
  6318. -allow-undefined)
  6319. # FIXME: remove this flag sometime in the future.
  6320. func_fatal_error "'-allow-undefined' must not be used because it is the default"
  6321. ;;
  6322. -avoid-version)
  6323. avoid_version=yes
  6324. continue
  6325. ;;
  6326. -bindir)
  6327. prev=bindir
  6328. continue
  6329. ;;
  6330. -dlopen)
  6331. prev=dlfiles
  6332. continue
  6333. ;;
  6334. -dlpreopen)
  6335. prev=dlprefiles
  6336. continue
  6337. ;;
  6338. -export-dynamic)
  6339. export_dynamic=yes
  6340. continue
  6341. ;;
  6342. -export-symbols | -export-symbols-regex)
  6343. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  6344. func_fatal_error "more than one -exported-symbols argument is not allowed"
  6345. fi
  6346. if test X-export-symbols = "X$arg"; then
  6347. prev=expsyms
  6348. else
  6349. prev=expsyms_regex
  6350. fi
  6351. continue
  6352. ;;
  6353. -framework)
  6354. prev=framework
  6355. continue
  6356. ;;
  6357. -inst-prefix-dir)
  6358. prev=inst_prefix
  6359. continue
  6360. ;;
  6361. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  6362. # so, if we see these flags be careful not to treat them like -L
  6363. -L[A-Z][A-Z]*:*)
  6364. case $with_gcc/$host in
  6365. no/*-*-irix* | /*-*-irix*)
  6366. func_append compile_command " $arg"
  6367. func_append finalize_command " $arg"
  6368. ;;
  6369. esac
  6370. continue
  6371. ;;
  6372. -L*)
  6373. func_stripname "-L" '' "$arg"
  6374. if test -z "$func_stripname_result"; then
  6375. if test "$#" -gt 0; then
  6376. func_fatal_error "require no space between '-L' and '$1'"
  6377. else
  6378. func_fatal_error "need path for '-L' option"
  6379. fi
  6380. fi
  6381. func_resolve_sysroot "$func_stripname_result"
  6382. dir=$func_resolve_sysroot_result
  6383. # We need an absolute path.
  6384. case $dir in
  6385. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6386. *)
  6387. absdir=`cd "$dir" && pwd`
  6388. test -z "$absdir" && \
  6389. func_fatal_error "cannot determine absolute directory name of '$dir'"
  6390. dir=$absdir
  6391. ;;
  6392. esac
  6393. case "$deplibs " in
  6394. *" -L$dir "* | *" $arg "*)
  6395. # Will only happen for absolute or sysroot arguments
  6396. ;;
  6397. *)
  6398. # Preserve sysroot, but never include relative directories
  6399. case $dir in
  6400. [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
  6401. *) func_append deplibs " -L$dir" ;;
  6402. esac
  6403. func_append lib_search_path " $dir"
  6404. ;;
  6405. esac
  6406. case $host in
  6407. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6408. testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
  6409. case :$dllsearchpath: in
  6410. *":$dir:"*) ;;
  6411. ::) dllsearchpath=$dir;;
  6412. *) func_append dllsearchpath ":$dir";;
  6413. esac
  6414. case :$dllsearchpath: in
  6415. *":$testbindir:"*) ;;
  6416. ::) dllsearchpath=$testbindir;;
  6417. *) func_append dllsearchpath ":$testbindir";;
  6418. esac
  6419. ;;
  6420. esac
  6421. continue
  6422. ;;
  6423. -l*)
  6424. if test X-lc = "X$arg" || test X-lm = "X$arg"; then
  6425. case $host in
  6426. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
  6427. # These systems don't actually have a C or math library (as such)
  6428. continue
  6429. ;;
  6430. *-*-os2*)
  6431. # These systems don't actually have a C library (as such)
  6432. test X-lc = "X$arg" && continue
  6433. ;;
  6434. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6435. # Do not include libc due to us having libc/libc_r.
  6436. test X-lc = "X$arg" && continue
  6437. ;;
  6438. *-*-rhapsody* | *-*-darwin1.[012])
  6439. # Rhapsody C and math libraries are in the System framework
  6440. func_append deplibs " System.ltframework"
  6441. continue
  6442. ;;
  6443. *-*-sco3.2v5* | *-*-sco5v6*)
  6444. # Causes problems with __ctype
  6445. test X-lc = "X$arg" && continue
  6446. ;;
  6447. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  6448. # Compiler inserts libc in the correct place for threads to work
  6449. test X-lc = "X$arg" && continue
  6450. ;;
  6451. esac
  6452. elif test X-lc_r = "X$arg"; then
  6453. case $host in
  6454. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6455. # Do not include libc_r directly, use -pthread flag.
  6456. continue
  6457. ;;
  6458. esac
  6459. fi
  6460. func_append deplibs " $arg"
  6461. continue
  6462. ;;
  6463. -mllvm)
  6464. prev=mllvm
  6465. continue
  6466. ;;
  6467. -module)
  6468. module=yes
  6469. continue
  6470. ;;
  6471. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  6472. # classes, name mangling, and exception handling.
  6473. # Darwin uses the -arch flag to determine output architecture.
  6474. -model|-arch|-isysroot|--sysroot)
  6475. func_append compiler_flags " $arg"
  6476. func_append compile_command " $arg"
  6477. func_append finalize_command " $arg"
  6478. prev=xcompiler
  6479. continue
  6480. ;;
  6481. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  6482. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  6483. func_append compiler_flags " $arg"
  6484. func_append compile_command " $arg"
  6485. func_append finalize_command " $arg"
  6486. case "$new_inherited_linker_flags " in
  6487. *" $arg "*) ;;
  6488. * ) func_append new_inherited_linker_flags " $arg" ;;
  6489. esac
  6490. continue
  6491. ;;
  6492. -multi_module)
  6493. single_module=$wl-multi_module
  6494. continue
  6495. ;;
  6496. -no-fast-install)
  6497. fast_install=no
  6498. continue
  6499. ;;
  6500. -no-install)
  6501. case $host in
  6502. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  6503. # The PATH hackery in wrapper scripts is required on Windows
  6504. # and Darwin in order for the loader to find any dlls it needs.
  6505. func_warning "'-no-install' is ignored for $host"
  6506. func_warning "assuming '-no-fast-install' instead"
  6507. fast_install=no
  6508. ;;
  6509. *) no_install=yes ;;
  6510. esac
  6511. continue
  6512. ;;
  6513. -no-undefined)
  6514. allow_undefined=no
  6515. continue
  6516. ;;
  6517. -objectlist)
  6518. prev=objectlist
  6519. continue
  6520. ;;
  6521. -os2dllname)
  6522. prev=os2dllname
  6523. continue
  6524. ;;
  6525. -o) prev=output ;;
  6526. -precious-files-regex)
  6527. prev=precious_regex
  6528. continue
  6529. ;;
  6530. -release)
  6531. prev=release
  6532. continue
  6533. ;;
  6534. -rpath)
  6535. prev=rpath
  6536. continue
  6537. ;;
  6538. -R)
  6539. prev=xrpath
  6540. continue
  6541. ;;
  6542. -R*)
  6543. func_stripname '-R' '' "$arg"
  6544. dir=$func_stripname_result
  6545. # We need an absolute path.
  6546. case $dir in
  6547. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6548. =*)
  6549. func_stripname '=' '' "$dir"
  6550. dir=$lt_sysroot$func_stripname_result
  6551. ;;
  6552. *)
  6553. func_fatal_error "only absolute run-paths are allowed"
  6554. ;;
  6555. esac
  6556. case "$xrpath " in
  6557. *" $dir "*) ;;
  6558. *) func_append xrpath " $dir" ;;
  6559. esac
  6560. continue
  6561. ;;
  6562. -shared)
  6563. # The effects of -shared are defined in a previous loop.
  6564. continue
  6565. ;;
  6566. -shrext)
  6567. prev=shrext
  6568. continue
  6569. ;;
  6570. -static | -static-libtool-libs)
  6571. # The effects of -static are defined in a previous loop.
  6572. # We used to do the same as -all-static on platforms that
  6573. # didn't have a PIC flag, but the assumption that the effects
  6574. # would be equivalent was wrong. It would break on at least
  6575. # Digital Unix and AIX.
  6576. continue
  6577. ;;
  6578. -thread-safe)
  6579. thread_safe=yes
  6580. continue
  6581. ;;
  6582. -version-info)
  6583. prev=vinfo
  6584. continue
  6585. ;;
  6586. -version-number)
  6587. prev=vinfo
  6588. vinfo_number=yes
  6589. continue
  6590. ;;
  6591. -weak)
  6592. prev=weak
  6593. continue
  6594. ;;
  6595. -Wc,*)
  6596. func_stripname '-Wc,' '' "$arg"
  6597. args=$func_stripname_result
  6598. arg=
  6599. save_ifs=$IFS; IFS=,
  6600. for flag in $args; do
  6601. IFS=$save_ifs
  6602. func_quote_for_eval "$flag"
  6603. func_append arg " $func_quote_for_eval_result"
  6604. func_append compiler_flags " $func_quote_for_eval_result"
  6605. done
  6606. IFS=$save_ifs
  6607. func_stripname ' ' '' "$arg"
  6608. arg=$func_stripname_result
  6609. ;;
  6610. -Wl,*)
  6611. func_stripname '-Wl,' '' "$arg"
  6612. args=$func_stripname_result
  6613. arg=
  6614. save_ifs=$IFS; IFS=,
  6615. for flag in $args; do
  6616. IFS=$save_ifs
  6617. func_quote_for_eval "$flag"
  6618. func_append arg " $wl$func_quote_for_eval_result"
  6619. func_append compiler_flags " $wl$func_quote_for_eval_result"
  6620. func_append linker_flags " $func_quote_for_eval_result"
  6621. done
  6622. IFS=$save_ifs
  6623. func_stripname ' ' '' "$arg"
  6624. arg=$func_stripname_result
  6625. ;;
  6626. -Xcompiler)
  6627. prev=xcompiler
  6628. continue
  6629. ;;
  6630. -Xlinker)
  6631. prev=xlinker
  6632. continue
  6633. ;;
  6634. -XCClinker)
  6635. prev=xcclinker
  6636. continue
  6637. ;;
  6638. # -msg_* for osf cc
  6639. -msg_*)
  6640. func_quote_for_eval "$arg"
  6641. arg=$func_quote_for_eval_result
  6642. ;;
  6643. # Flags to be passed through unchanged, with rationale:
  6644. # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
  6645. # -r[0-9][0-9]* specify processor for the SGI compiler
  6646. # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  6647. # +DA*, +DD* enable 64-bit mode for the HP compiler
  6648. # -q* compiler args for the IBM compiler
  6649. # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  6650. # -F/path path to uninstalled frameworks, gcc on darwin
  6651. # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
  6652. # -fstack-protector* stack protector flags for GCC
  6653. # @file GCC response files
  6654. # -tp=* Portland pgcc target processor selection
  6655. # --sysroot=* for sysroot support
  6656. # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
  6657. # -specs=* GCC specs files
  6658. # -stdlib=* select c++ std lib with clang
  6659. # -fsanitize=* Clang/GCC memory and address sanitizer
  6660. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  6661. -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
  6662. -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
  6663. -specs=*|-fsanitize=*)
  6664. func_quote_for_eval "$arg"
  6665. arg=$func_quote_for_eval_result
  6666. func_append compile_command " $arg"
  6667. func_append finalize_command " $arg"
  6668. func_append compiler_flags " $arg"
  6669. continue
  6670. ;;
  6671. -Z*)
  6672. if test os2 = "`expr $host : '.*\(os2\)'`"; then
  6673. # OS/2 uses -Zxxx to specify OS/2-specific options
  6674. compiler_flags="$compiler_flags $arg"
  6675. func_append compile_command " $arg"
  6676. func_append finalize_command " $arg"
  6677. case $arg in
  6678. -Zlinker | -Zstack)
  6679. prev=xcompiler
  6680. ;;
  6681. esac
  6682. continue
  6683. else
  6684. # Otherwise treat like 'Some other compiler flag' below
  6685. func_quote_for_eval "$arg"
  6686. arg=$func_quote_for_eval_result
  6687. fi
  6688. ;;
  6689. # Some other compiler flag.
  6690. -* | +*)
  6691. func_quote_for_eval "$arg"
  6692. arg=$func_quote_for_eval_result
  6693. ;;
  6694. *.$objext)
  6695. # A standard object.
  6696. func_append objs " $arg"
  6697. ;;
  6698. *.lo)
  6699. # A libtool-controlled object.
  6700. # Check to see that this really is a libtool object.
  6701. if func_lalib_unsafe_p "$arg"; then
  6702. pic_object=
  6703. non_pic_object=
  6704. # Read the .lo file
  6705. func_source "$arg"
  6706. if test -z "$pic_object" ||
  6707. test -z "$non_pic_object" ||
  6708. test none = "$pic_object" &&
  6709. test none = "$non_pic_object"; then
  6710. func_fatal_error "cannot find name of object for '$arg'"
  6711. fi
  6712. # Extract subdirectory from the argument.
  6713. func_dirname "$arg" "/" ""
  6714. xdir=$func_dirname_result
  6715. test none = "$pic_object" || {
  6716. # Prepend the subdirectory the object is found in.
  6717. pic_object=$xdir$pic_object
  6718. if test dlfiles = "$prev"; then
  6719. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6720. func_append dlfiles " $pic_object"
  6721. prev=
  6722. continue
  6723. else
  6724. # If libtool objects are unsupported, then we need to preload.
  6725. prev=dlprefiles
  6726. fi
  6727. fi
  6728. # CHECK ME: I think I busted this. -Ossama
  6729. if test dlprefiles = "$prev"; then
  6730. # Preload the old-style object.
  6731. func_append dlprefiles " $pic_object"
  6732. prev=
  6733. fi
  6734. # A PIC object.
  6735. func_append libobjs " $pic_object"
  6736. arg=$pic_object
  6737. }
  6738. # Non-PIC object.
  6739. if test none != "$non_pic_object"; then
  6740. # Prepend the subdirectory the object is found in.
  6741. non_pic_object=$xdir$non_pic_object
  6742. # A standard non-PIC object
  6743. func_append non_pic_objects " $non_pic_object"
  6744. if test -z "$pic_object" || test none = "$pic_object"; then
  6745. arg=$non_pic_object
  6746. fi
  6747. else
  6748. # If the PIC object exists, use it instead.
  6749. # $xdir was prepended to $pic_object above.
  6750. non_pic_object=$pic_object
  6751. func_append non_pic_objects " $non_pic_object"
  6752. fi
  6753. else
  6754. # Only an error if not doing a dry-run.
  6755. if $opt_dry_run; then
  6756. # Extract subdirectory from the argument.
  6757. func_dirname "$arg" "/" ""
  6758. xdir=$func_dirname_result
  6759. func_lo2o "$arg"
  6760. pic_object=$xdir$objdir/$func_lo2o_result
  6761. non_pic_object=$xdir$func_lo2o_result
  6762. func_append libobjs " $pic_object"
  6763. func_append non_pic_objects " $non_pic_object"
  6764. else
  6765. func_fatal_error "'$arg' is not a valid libtool object"
  6766. fi
  6767. fi
  6768. ;;
  6769. *.$libext)
  6770. # An archive.
  6771. func_append deplibs " $arg"
  6772. func_append old_deplibs " $arg"
  6773. continue
  6774. ;;
  6775. *.la)
  6776. # A libtool-controlled library.
  6777. func_resolve_sysroot "$arg"
  6778. if test dlfiles = "$prev"; then
  6779. # This library was specified with -dlopen.
  6780. func_append dlfiles " $func_resolve_sysroot_result"
  6781. prev=
  6782. elif test dlprefiles = "$prev"; then
  6783. # The library was specified with -dlpreopen.
  6784. func_append dlprefiles " $func_resolve_sysroot_result"
  6785. prev=
  6786. else
  6787. func_append deplibs " $func_resolve_sysroot_result"
  6788. fi
  6789. continue
  6790. ;;
  6791. # Some other compiler argument.
  6792. *)
  6793. # Unknown arguments in both finalize_command and compile_command need
  6794. # to be aesthetically quoted because they are evaled later.
  6795. func_quote_for_eval "$arg"
  6796. arg=$func_quote_for_eval_result
  6797. ;;
  6798. esac # arg
  6799. # Now actually substitute the argument into the commands.
  6800. if test -n "$arg"; then
  6801. func_append compile_command " $arg"
  6802. func_append finalize_command " $arg"
  6803. fi
  6804. done # argument parsing loop
  6805. test -n "$prev" && \
  6806. func_fatal_help "the '$prevarg' option requires an argument"
  6807. if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
  6808. eval arg=\"$export_dynamic_flag_spec\"
  6809. func_append compile_command " $arg"
  6810. func_append finalize_command " $arg"
  6811. fi
  6812. oldlibs=
  6813. # calculate the name of the file, without its directory
  6814. func_basename "$output"
  6815. outputname=$func_basename_result
  6816. libobjs_save=$libobjs
  6817. if test -n "$shlibpath_var"; then
  6818. # get the directories listed in $shlibpath_var
  6819. eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
  6820. else
  6821. shlib_search_path=
  6822. fi
  6823. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  6824. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  6825. # Definition is injected by LT_CONFIG during libtool generation.
  6826. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
  6827. func_dirname "$output" "/" ""
  6828. output_objdir=$func_dirname_result$objdir
  6829. func_to_tool_file "$output_objdir/"
  6830. tool_output_objdir=$func_to_tool_file_result
  6831. # Create the object directory.
  6832. func_mkdir_p "$output_objdir"
  6833. # Determine the type of output
  6834. case $output in
  6835. "")
  6836. func_fatal_help "you must specify an output file"
  6837. ;;
  6838. *.$libext) linkmode=oldlib ;;
  6839. *.lo | *.$objext) linkmode=obj ;;
  6840. *.la) linkmode=lib ;;
  6841. *) linkmode=prog ;; # Anything else should be a program.
  6842. esac
  6843. specialdeplibs=
  6844. libs=
  6845. # Find all interdependent deplibs by searching for libraries
  6846. # that are linked more than once (e.g. -la -lb -la)
  6847. for deplib in $deplibs; do
  6848. if $opt_preserve_dup_deps; then
  6849. case "$libs " in
  6850. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  6851. esac
  6852. fi
  6853. func_append libs " $deplib"
  6854. done
  6855. if test lib = "$linkmode"; then
  6856. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  6857. # Compute libraries that are listed more than once in $predeps
  6858. # $postdeps and mark them as special (i.e., whose duplicates are
  6859. # not to be eliminated).
  6860. pre_post_deps=
  6861. if $opt_duplicate_compiler_generated_deps; then
  6862. for pre_post_dep in $predeps $postdeps; do
  6863. case "$pre_post_deps " in
  6864. *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
  6865. esac
  6866. func_append pre_post_deps " $pre_post_dep"
  6867. done
  6868. fi
  6869. pre_post_deps=
  6870. fi
  6871. deplibs=
  6872. newdependency_libs=
  6873. newlib_search_path=
  6874. need_relink=no # whether we're linking any uninstalled libtool libraries
  6875. notinst_deplibs= # not-installed libtool libraries
  6876. notinst_path= # paths that contain not-installed libtool libraries
  6877. case $linkmode in
  6878. lib)
  6879. passes="conv dlpreopen link"
  6880. for file in $dlfiles $dlprefiles; do
  6881. case $file in
  6882. *.la) ;;
  6883. *)
  6884. func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
  6885. ;;
  6886. esac
  6887. done
  6888. ;;
  6889. prog)
  6890. compile_deplibs=
  6891. finalize_deplibs=
  6892. alldeplibs=false
  6893. newdlfiles=
  6894. newdlprefiles=
  6895. passes="conv scan dlopen dlpreopen link"
  6896. ;;
  6897. *) passes="conv"
  6898. ;;
  6899. esac
  6900. for pass in $passes; do
  6901. # The preopen pass in lib mode reverses $deplibs; put it back here
  6902. # so that -L comes before libs that need it for instance...
  6903. if test lib,link = "$linkmode,$pass"; then
  6904. ## FIXME: Find the place where the list is rebuilt in the wrong
  6905. ## order, and fix it there properly
  6906. tmp_deplibs=
  6907. for deplib in $deplibs; do
  6908. tmp_deplibs="$deplib $tmp_deplibs"
  6909. done
  6910. deplibs=$tmp_deplibs
  6911. fi
  6912. if test lib,link = "$linkmode,$pass" ||
  6913. test prog,scan = "$linkmode,$pass"; then
  6914. libs=$deplibs
  6915. deplibs=
  6916. fi
  6917. if test prog = "$linkmode"; then
  6918. case $pass in
  6919. dlopen) libs=$dlfiles ;;
  6920. dlpreopen) libs=$dlprefiles ;;
  6921. link)
  6922. libs="$deplibs %DEPLIBS%"
  6923. test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
  6924. ;;
  6925. esac
  6926. fi
  6927. if test lib,dlpreopen = "$linkmode,$pass"; then
  6928. # Collect and forward deplibs of preopened libtool libs
  6929. for lib in $dlprefiles; do
  6930. # Ignore non-libtool-libs
  6931. dependency_libs=
  6932. func_resolve_sysroot "$lib"
  6933. case $lib in
  6934. *.la) func_source "$func_resolve_sysroot_result" ;;
  6935. esac
  6936. # Collect preopened libtool deplibs, except any this library
  6937. # has declared as weak libs
  6938. for deplib in $dependency_libs; do
  6939. func_basename "$deplib"
  6940. deplib_base=$func_basename_result
  6941. case " $weak_libs " in
  6942. *" $deplib_base "*) ;;
  6943. *) func_append deplibs " $deplib" ;;
  6944. esac
  6945. done
  6946. done
  6947. libs=$dlprefiles
  6948. fi
  6949. if test dlopen = "$pass"; then
  6950. # Collect dlpreopened libraries
  6951. save_deplibs=$deplibs
  6952. deplibs=
  6953. fi
  6954. for deplib in $libs; do
  6955. lib=
  6956. found=false
  6957. case $deplib in
  6958. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  6959. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  6960. if test prog,link = "$linkmode,$pass"; then
  6961. compile_deplibs="$deplib $compile_deplibs"
  6962. finalize_deplibs="$deplib $finalize_deplibs"
  6963. else
  6964. func_append compiler_flags " $deplib"
  6965. if test lib = "$linkmode"; then
  6966. case "$new_inherited_linker_flags " in
  6967. *" $deplib "*) ;;
  6968. * ) func_append new_inherited_linker_flags " $deplib" ;;
  6969. esac
  6970. fi
  6971. fi
  6972. continue
  6973. ;;
  6974. -l*)
  6975. if test lib != "$linkmode" && test prog != "$linkmode"; then
  6976. func_warning "'-l' is ignored for archives/objects"
  6977. continue
  6978. fi
  6979. func_stripname '-l' '' "$deplib"
  6980. name=$func_stripname_result
  6981. if test lib = "$linkmode"; then
  6982. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  6983. else
  6984. searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  6985. fi
  6986. for searchdir in $searchdirs; do
  6987. for search_ext in .la $std_shrext .so .a; do
  6988. # Search the libtool library
  6989. lib=$searchdir/lib$name$search_ext
  6990. if test -f "$lib"; then
  6991. if test .la = "$search_ext"; then
  6992. found=:
  6993. else
  6994. found=false
  6995. fi
  6996. break 2
  6997. fi
  6998. done
  6999. done
  7000. if $found; then
  7001. # deplib is a libtool library
  7002. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  7003. # We need to do some special things here, and not later.
  7004. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  7005. case " $predeps $postdeps " in
  7006. *" $deplib "*)
  7007. if func_lalib_p "$lib"; then
  7008. library_names=
  7009. old_library=
  7010. func_source "$lib"
  7011. for l in $old_library $library_names; do
  7012. ll=$l
  7013. done
  7014. if test "X$ll" = "X$old_library"; then # only static version available
  7015. found=false
  7016. func_dirname "$lib" "" "."
  7017. ladir=$func_dirname_result
  7018. lib=$ladir/$old_library
  7019. if test prog,link = "$linkmode,$pass"; then
  7020. compile_deplibs="$deplib $compile_deplibs"
  7021. finalize_deplibs="$deplib $finalize_deplibs"
  7022. else
  7023. deplibs="$deplib $deplibs"
  7024. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7025. fi
  7026. continue
  7027. fi
  7028. fi
  7029. ;;
  7030. *) ;;
  7031. esac
  7032. fi
  7033. else
  7034. # deplib doesn't seem to be a libtool library
  7035. if test prog,link = "$linkmode,$pass"; then
  7036. compile_deplibs="$deplib $compile_deplibs"
  7037. finalize_deplibs="$deplib $finalize_deplibs"
  7038. else
  7039. deplibs="$deplib $deplibs"
  7040. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7041. fi
  7042. continue
  7043. fi
  7044. ;; # -l
  7045. *.ltframework)
  7046. if test prog,link = "$linkmode,$pass"; then
  7047. compile_deplibs="$deplib $compile_deplibs"
  7048. finalize_deplibs="$deplib $finalize_deplibs"
  7049. else
  7050. deplibs="$deplib $deplibs"
  7051. if test lib = "$linkmode"; then
  7052. case "$new_inherited_linker_flags " in
  7053. *" $deplib "*) ;;
  7054. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7055. esac
  7056. fi
  7057. fi
  7058. continue
  7059. ;;
  7060. -L*)
  7061. case $linkmode in
  7062. lib)
  7063. deplibs="$deplib $deplibs"
  7064. test conv = "$pass" && continue
  7065. newdependency_libs="$deplib $newdependency_libs"
  7066. func_stripname '-L' '' "$deplib"
  7067. func_resolve_sysroot "$func_stripname_result"
  7068. func_append newlib_search_path " $func_resolve_sysroot_result"
  7069. ;;
  7070. prog)
  7071. if test conv = "$pass"; then
  7072. deplibs="$deplib $deplibs"
  7073. continue
  7074. fi
  7075. if test scan = "$pass"; then
  7076. deplibs="$deplib $deplibs"
  7077. else
  7078. compile_deplibs="$deplib $compile_deplibs"
  7079. finalize_deplibs="$deplib $finalize_deplibs"
  7080. fi
  7081. func_stripname '-L' '' "$deplib"
  7082. func_resolve_sysroot "$func_stripname_result"
  7083. func_append newlib_search_path " $func_resolve_sysroot_result"
  7084. ;;
  7085. *)
  7086. func_warning "'-L' is ignored for archives/objects"
  7087. ;;
  7088. esac # linkmode
  7089. continue
  7090. ;; # -L
  7091. -R*)
  7092. if test link = "$pass"; then
  7093. func_stripname '-R' '' "$deplib"
  7094. func_resolve_sysroot "$func_stripname_result"
  7095. dir=$func_resolve_sysroot_result
  7096. # Make sure the xrpath contains only unique directories.
  7097. case "$xrpath " in
  7098. *" $dir "*) ;;
  7099. *) func_append xrpath " $dir" ;;
  7100. esac
  7101. fi
  7102. deplibs="$deplib $deplibs"
  7103. continue
  7104. ;;
  7105. *.la)
  7106. func_resolve_sysroot "$deplib"
  7107. lib=$func_resolve_sysroot_result
  7108. ;;
  7109. *.$libext)
  7110. if test conv = "$pass"; then
  7111. deplibs="$deplib $deplibs"
  7112. continue
  7113. fi
  7114. case $linkmode in
  7115. lib)
  7116. # Linking convenience modules into shared libraries is allowed,
  7117. # but linking other static libraries is non-portable.
  7118. case " $dlpreconveniencelibs " in
  7119. *" $deplib "*) ;;
  7120. *)
  7121. valid_a_lib=false
  7122. case $deplibs_check_method in
  7123. match_pattern*)
  7124. set dummy $deplibs_check_method; shift
  7125. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  7126. if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  7127. | $EGREP "$match_pattern_regex" > /dev/null; then
  7128. valid_a_lib=:
  7129. fi
  7130. ;;
  7131. pass_all)
  7132. valid_a_lib=:
  7133. ;;
  7134. esac
  7135. if $valid_a_lib; then
  7136. echo
  7137. $ECHO "*** Warning: Linking the shared library $output against the"
  7138. $ECHO "*** static library $deplib is not portable!"
  7139. deplibs="$deplib $deplibs"
  7140. else
  7141. echo
  7142. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  7143. echo "*** I have the capability to make that library automatically link in when"
  7144. echo "*** you link to this library. But I can only do this if you have a"
  7145. echo "*** shared version of the library, which you do not appear to have"
  7146. echo "*** because the file extensions .$libext of this argument makes me believe"
  7147. echo "*** that it is just a static archive that I should not use here."
  7148. fi
  7149. ;;
  7150. esac
  7151. continue
  7152. ;;
  7153. prog)
  7154. if test link != "$pass"; then
  7155. deplibs="$deplib $deplibs"
  7156. else
  7157. compile_deplibs="$deplib $compile_deplibs"
  7158. finalize_deplibs="$deplib $finalize_deplibs"
  7159. fi
  7160. continue
  7161. ;;
  7162. esac # linkmode
  7163. ;; # *.$libext
  7164. *.lo | *.$objext)
  7165. if test conv = "$pass"; then
  7166. deplibs="$deplib $deplibs"
  7167. elif test prog = "$linkmode"; then
  7168. if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
  7169. # If there is no dlopen support or we're linking statically,
  7170. # we need to preload.
  7171. func_append newdlprefiles " $deplib"
  7172. compile_deplibs="$deplib $compile_deplibs"
  7173. finalize_deplibs="$deplib $finalize_deplibs"
  7174. else
  7175. func_append newdlfiles " $deplib"
  7176. fi
  7177. fi
  7178. continue
  7179. ;;
  7180. %DEPLIBS%)
  7181. alldeplibs=:
  7182. continue
  7183. ;;
  7184. esac # case $deplib
  7185. $found || test -f "$lib" \
  7186. || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
  7187. # Check to see that this really is a libtool archive.
  7188. func_lalib_unsafe_p "$lib" \
  7189. || func_fatal_error "'$lib' is not a valid libtool archive"
  7190. func_dirname "$lib" "" "."
  7191. ladir=$func_dirname_result
  7192. dlname=
  7193. dlopen=
  7194. dlpreopen=
  7195. libdir=
  7196. library_names=
  7197. old_library=
  7198. inherited_linker_flags=
  7199. # If the library was installed with an old release of libtool,
  7200. # it will not redefine variables installed, or shouldnotlink
  7201. installed=yes
  7202. shouldnotlink=no
  7203. avoidtemprpath=
  7204. # Read the .la file
  7205. func_source "$lib"
  7206. # Convert "-framework foo" to "foo.ltframework"
  7207. if test -n "$inherited_linker_flags"; then
  7208. tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  7209. for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  7210. case " $new_inherited_linker_flags " in
  7211. *" $tmp_inherited_linker_flag "*) ;;
  7212. *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
  7213. esac
  7214. done
  7215. fi
  7216. dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7217. if test lib,link = "$linkmode,$pass" ||
  7218. test prog,scan = "$linkmode,$pass" ||
  7219. { test prog != "$linkmode" && test lib != "$linkmode"; }; then
  7220. test -n "$dlopen" && func_append dlfiles " $dlopen"
  7221. test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
  7222. fi
  7223. if test conv = "$pass"; then
  7224. # Only check for convenience libraries
  7225. deplibs="$lib $deplibs"
  7226. if test -z "$libdir"; then
  7227. if test -z "$old_library"; then
  7228. func_fatal_error "cannot find name of link library for '$lib'"
  7229. fi
  7230. # It is a libtool convenience library, so add in its objects.
  7231. func_append convenience " $ladir/$objdir/$old_library"
  7232. func_append old_convenience " $ladir/$objdir/$old_library"
  7233. tmp_libs=
  7234. for deplib in $dependency_libs; do
  7235. deplibs="$deplib $deplibs"
  7236. if $opt_preserve_dup_deps; then
  7237. case "$tmp_libs " in
  7238. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7239. esac
  7240. fi
  7241. func_append tmp_libs " $deplib"
  7242. done
  7243. elif test prog != "$linkmode" && test lib != "$linkmode"; then
  7244. func_fatal_error "'$lib' is not a convenience library"
  7245. fi
  7246. continue
  7247. fi # $pass = conv
  7248. # Get the name of the library we link against.
  7249. linklib=
  7250. if test -n "$old_library" &&
  7251. { test yes = "$prefer_static_libs" ||
  7252. test built,no = "$prefer_static_libs,$installed"; }; then
  7253. linklib=$old_library
  7254. else
  7255. for l in $old_library $library_names; do
  7256. linklib=$l
  7257. done
  7258. fi
  7259. if test -z "$linklib"; then
  7260. func_fatal_error "cannot find name of link library for '$lib'"
  7261. fi
  7262. # This library was specified with -dlopen.
  7263. if test dlopen = "$pass"; then
  7264. test -z "$libdir" \
  7265. && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
  7266. if test -z "$dlname" ||
  7267. test yes != "$dlopen_support" ||
  7268. test no = "$build_libtool_libs"
  7269. then
  7270. # If there is no dlname, no dlopen support or we're linking
  7271. # statically, we need to preload. We also need to preload any
  7272. # dependent libraries so libltdl's deplib preloader doesn't
  7273. # bomb out in the load deplibs phase.
  7274. func_append dlprefiles " $lib $dependency_libs"
  7275. else
  7276. func_append newdlfiles " $lib"
  7277. fi
  7278. continue
  7279. fi # $pass = dlopen
  7280. # We need an absolute path.
  7281. case $ladir in
  7282. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
  7283. *)
  7284. abs_ladir=`cd "$ladir" && pwd`
  7285. if test -z "$abs_ladir"; then
  7286. func_warning "cannot determine absolute directory name of '$ladir'"
  7287. func_warning "passing it literally to the linker, although it might fail"
  7288. abs_ladir=$ladir
  7289. fi
  7290. ;;
  7291. esac
  7292. func_basename "$lib"
  7293. laname=$func_basename_result
  7294. # Find the relevant object directory and library name.
  7295. if test yes = "$installed"; then
  7296. if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7297. func_warning "library '$lib' was moved."
  7298. dir=$ladir
  7299. absdir=$abs_ladir
  7300. libdir=$abs_ladir
  7301. else
  7302. dir=$lt_sysroot$libdir
  7303. absdir=$lt_sysroot$libdir
  7304. fi
  7305. test yes = "$hardcode_automatic" && avoidtemprpath=yes
  7306. else
  7307. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7308. dir=$ladir
  7309. absdir=$abs_ladir
  7310. # Remove this search path later
  7311. func_append notinst_path " $abs_ladir"
  7312. else
  7313. dir=$ladir/$objdir
  7314. absdir=$abs_ladir/$objdir
  7315. # Remove this search path later
  7316. func_append notinst_path " $abs_ladir"
  7317. fi
  7318. fi # $installed = yes
  7319. func_stripname 'lib' '.la' "$laname"
  7320. name=$func_stripname_result
  7321. # This library was specified with -dlpreopen.
  7322. if test dlpreopen = "$pass"; then
  7323. if test -z "$libdir" && test prog = "$linkmode"; then
  7324. func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
  7325. fi
  7326. case $host in
  7327. # special handling for platforms with PE-DLLs.
  7328. *cygwin* | *mingw* | *cegcc* )
  7329. # Linker will automatically link against shared library if both
  7330. # static and shared are present. Therefore, ensure we extract
  7331. # symbols from the import library if a shared library is present
  7332. # (otherwise, the dlopen module name will be incorrect). We do
  7333. # this by putting the import library name into $newdlprefiles.
  7334. # We recover the dlopen module name by 'saving' the la file
  7335. # name in a special purpose variable, and (later) extracting the
  7336. # dlname from the la file.
  7337. if test -n "$dlname"; then
  7338. func_tr_sh "$dir/$linklib"
  7339. eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  7340. func_append newdlprefiles " $dir/$linklib"
  7341. else
  7342. func_append newdlprefiles " $dir/$old_library"
  7343. # Keep a list of preopened convenience libraries to check
  7344. # that they are being used correctly in the link pass.
  7345. test -z "$libdir" && \
  7346. func_append dlpreconveniencelibs " $dir/$old_library"
  7347. fi
  7348. ;;
  7349. * )
  7350. # Prefer using a static library (so that no silly _DYNAMIC symbols
  7351. # are required to link).
  7352. if test -n "$old_library"; then
  7353. func_append newdlprefiles " $dir/$old_library"
  7354. # Keep a list of preopened convenience libraries to check
  7355. # that they are being used correctly in the link pass.
  7356. test -z "$libdir" && \
  7357. func_append dlpreconveniencelibs " $dir/$old_library"
  7358. # Otherwise, use the dlname, so that lt_dlopen finds it.
  7359. elif test -n "$dlname"; then
  7360. func_append newdlprefiles " $dir/$dlname"
  7361. else
  7362. func_append newdlprefiles " $dir/$linklib"
  7363. fi
  7364. ;;
  7365. esac
  7366. fi # $pass = dlpreopen
  7367. if test -z "$libdir"; then
  7368. # Link the convenience library
  7369. if test lib = "$linkmode"; then
  7370. deplibs="$dir/$old_library $deplibs"
  7371. elif test prog,link = "$linkmode,$pass"; then
  7372. compile_deplibs="$dir/$old_library $compile_deplibs"
  7373. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  7374. else
  7375. deplibs="$lib $deplibs" # used for prog,scan pass
  7376. fi
  7377. continue
  7378. fi
  7379. if test prog = "$linkmode" && test link != "$pass"; then
  7380. func_append newlib_search_path " $ladir"
  7381. deplibs="$lib $deplibs"
  7382. linkalldeplibs=false
  7383. if test no != "$link_all_deplibs" || test -z "$library_names" ||
  7384. test no = "$build_libtool_libs"; then
  7385. linkalldeplibs=:
  7386. fi
  7387. tmp_libs=
  7388. for deplib in $dependency_libs; do
  7389. case $deplib in
  7390. -L*) func_stripname '-L' '' "$deplib"
  7391. func_resolve_sysroot "$func_stripname_result"
  7392. func_append newlib_search_path " $func_resolve_sysroot_result"
  7393. ;;
  7394. esac
  7395. # Need to link against all dependency_libs?
  7396. if $linkalldeplibs; then
  7397. deplibs="$deplib $deplibs"
  7398. else
  7399. # Need to hardcode shared library paths
  7400. # or/and link against static libraries
  7401. newdependency_libs="$deplib $newdependency_libs"
  7402. fi
  7403. if $opt_preserve_dup_deps; then
  7404. case "$tmp_libs " in
  7405. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7406. esac
  7407. fi
  7408. func_append tmp_libs " $deplib"
  7409. done # for deplib
  7410. continue
  7411. fi # $linkmode = prog...
  7412. if test prog,link = "$linkmode,$pass"; then
  7413. if test -n "$library_names" &&
  7414. { { test no = "$prefer_static_libs" ||
  7415. test built,yes = "$prefer_static_libs,$installed"; } ||
  7416. test -z "$old_library"; }; then
  7417. # We need to hardcode the library path
  7418. if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
  7419. # Make sure the rpath contains only unique directories.
  7420. case $temp_rpath: in
  7421. *"$absdir:"*) ;;
  7422. *) func_append temp_rpath "$absdir:" ;;
  7423. esac
  7424. fi
  7425. # Hardcode the library path.
  7426. # Skip directories that are in the system default run-time
  7427. # search path.
  7428. case " $sys_lib_dlsearch_path " in
  7429. *" $absdir "*) ;;
  7430. *)
  7431. case "$compile_rpath " in
  7432. *" $absdir "*) ;;
  7433. *) func_append compile_rpath " $absdir" ;;
  7434. esac
  7435. ;;
  7436. esac
  7437. case " $sys_lib_dlsearch_path " in
  7438. *" $libdir "*) ;;
  7439. *)
  7440. case "$finalize_rpath " in
  7441. *" $libdir "*) ;;
  7442. *) func_append finalize_rpath " $libdir" ;;
  7443. esac
  7444. ;;
  7445. esac
  7446. fi # $linkmode,$pass = prog,link...
  7447. if $alldeplibs &&
  7448. { test pass_all = "$deplibs_check_method" ||
  7449. { test yes = "$build_libtool_libs" &&
  7450. test -n "$library_names"; }; }; then
  7451. # We only need to search for static libraries
  7452. continue
  7453. fi
  7454. fi
  7455. link_static=no # Whether the deplib will be linked statically
  7456. use_static_libs=$prefer_static_libs
  7457. if test built = "$use_static_libs" && test yes = "$installed"; then
  7458. use_static_libs=no
  7459. fi
  7460. if test -n "$library_names" &&
  7461. { test no = "$use_static_libs" || test -z "$old_library"; }; then
  7462. case $host in
  7463. *cygwin* | *mingw* | *cegcc* | *os2*)
  7464. # No point in relinking DLLs because paths are not encoded
  7465. func_append notinst_deplibs " $lib"
  7466. need_relink=no
  7467. ;;
  7468. *)
  7469. if test no = "$installed"; then
  7470. func_append notinst_deplibs " $lib"
  7471. need_relink=yes
  7472. fi
  7473. ;;
  7474. esac
  7475. # This is a shared library
  7476. # Warn about portability, can't link against -module's on some
  7477. # systems (darwin). Don't bleat about dlopened modules though!
  7478. dlopenmodule=
  7479. for dlpremoduletest in $dlprefiles; do
  7480. if test "X$dlpremoduletest" = "X$lib"; then
  7481. dlopenmodule=$dlpremoduletest
  7482. break
  7483. fi
  7484. done
  7485. if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
  7486. echo
  7487. if test prog = "$linkmode"; then
  7488. $ECHO "*** Warning: Linking the executable $output against the loadable module"
  7489. else
  7490. $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  7491. fi
  7492. $ECHO "*** $linklib is not portable!"
  7493. fi
  7494. if test lib = "$linkmode" &&
  7495. test yes = "$hardcode_into_libs"; then
  7496. # Hardcode the library path.
  7497. # Skip directories that are in the system default run-time
  7498. # search path.
  7499. case " $sys_lib_dlsearch_path " in
  7500. *" $absdir "*) ;;
  7501. *)
  7502. case "$compile_rpath " in
  7503. *" $absdir "*) ;;
  7504. *) func_append compile_rpath " $absdir" ;;
  7505. esac
  7506. ;;
  7507. esac
  7508. case " $sys_lib_dlsearch_path " in
  7509. *" $libdir "*) ;;
  7510. *)
  7511. case "$finalize_rpath " in
  7512. *" $libdir "*) ;;
  7513. *) func_append finalize_rpath " $libdir" ;;
  7514. esac
  7515. ;;
  7516. esac
  7517. fi
  7518. if test -n "$old_archive_from_expsyms_cmds"; then
  7519. # figure out the soname
  7520. set dummy $library_names
  7521. shift
  7522. realname=$1
  7523. shift
  7524. libname=`eval "\\$ECHO \"$libname_spec\""`
  7525. # use dlname if we got it. it's perfectly good, no?
  7526. if test -n "$dlname"; then
  7527. soname=$dlname
  7528. elif test -n "$soname_spec"; then
  7529. # bleh windows
  7530. case $host in
  7531. *cygwin* | mingw* | *cegcc* | *os2*)
  7532. func_arith $current - $age
  7533. major=$func_arith_result
  7534. versuffix=-$major
  7535. ;;
  7536. esac
  7537. eval soname=\"$soname_spec\"
  7538. else
  7539. soname=$realname
  7540. fi
  7541. # Make a new name for the extract_expsyms_cmds to use
  7542. soroot=$soname
  7543. func_basename "$soroot"
  7544. soname=$func_basename_result
  7545. func_stripname 'lib' '.dll' "$soname"
  7546. newlib=libimp-$func_stripname_result.a
  7547. # If the library has no export list, then create one now
  7548. if test -f "$output_objdir/$soname-def"; then :
  7549. else
  7550. func_verbose "extracting exported symbol list from '$soname'"
  7551. func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  7552. fi
  7553. # Create $newlib
  7554. if test -f "$output_objdir/$newlib"; then :; else
  7555. func_verbose "generating import library for '$soname'"
  7556. func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  7557. fi
  7558. # make sure the library variables are pointing to the new library
  7559. dir=$output_objdir
  7560. linklib=$newlib
  7561. fi # test -n "$old_archive_from_expsyms_cmds"
  7562. if test prog = "$linkmode" || test relink != "$opt_mode"; then
  7563. add_shlibpath=
  7564. add_dir=
  7565. add=
  7566. lib_linked=yes
  7567. case $hardcode_action in
  7568. immediate | unsupported)
  7569. if test no = "$hardcode_direct"; then
  7570. add=$dir/$linklib
  7571. case $host in
  7572. *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
  7573. *-*-sysv4*uw2*) add_dir=-L$dir ;;
  7574. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  7575. *-*-unixware7*) add_dir=-L$dir ;;
  7576. *-*-darwin* )
  7577. # if the lib is a (non-dlopened) module then we cannot
  7578. # link against it, someone is ignoring the earlier warnings
  7579. if /usr/bin/file -L $add 2> /dev/null |
  7580. $GREP ": [^:]* bundle" >/dev/null; then
  7581. if test "X$dlopenmodule" != "X$lib"; then
  7582. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  7583. if test -z "$old_library"; then
  7584. echo
  7585. echo "*** And there doesn't seem to be a static archive available"
  7586. echo "*** The link will probably fail, sorry"
  7587. else
  7588. add=$dir/$old_library
  7589. fi
  7590. elif test -n "$old_library"; then
  7591. add=$dir/$old_library
  7592. fi
  7593. fi
  7594. esac
  7595. elif test no = "$hardcode_minus_L"; then
  7596. case $host in
  7597. *-*-sunos*) add_shlibpath=$dir ;;
  7598. esac
  7599. add_dir=-L$dir
  7600. add=-l$name
  7601. elif test no = "$hardcode_shlibpath_var"; then
  7602. add_shlibpath=$dir
  7603. add=-l$name
  7604. else
  7605. lib_linked=no
  7606. fi
  7607. ;;
  7608. relink)
  7609. if test yes = "$hardcode_direct" &&
  7610. test no = "$hardcode_direct_absolute"; then
  7611. add=$dir/$linklib
  7612. elif test yes = "$hardcode_minus_L"; then
  7613. add_dir=-L$absdir
  7614. # Try looking first in the location we're being installed to.
  7615. if test -n "$inst_prefix_dir"; then
  7616. case $libdir in
  7617. [\\/]*)
  7618. func_append add_dir " -L$inst_prefix_dir$libdir"
  7619. ;;
  7620. esac
  7621. fi
  7622. add=-l$name
  7623. elif test yes = "$hardcode_shlibpath_var"; then
  7624. add_shlibpath=$dir
  7625. add=-l$name
  7626. else
  7627. lib_linked=no
  7628. fi
  7629. ;;
  7630. *) lib_linked=no ;;
  7631. esac
  7632. if test yes != "$lib_linked"; then
  7633. func_fatal_configuration "unsupported hardcode properties"
  7634. fi
  7635. if test -n "$add_shlibpath"; then
  7636. case :$compile_shlibpath: in
  7637. *":$add_shlibpath:"*) ;;
  7638. *) func_append compile_shlibpath "$add_shlibpath:" ;;
  7639. esac
  7640. fi
  7641. if test prog = "$linkmode"; then
  7642. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  7643. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  7644. else
  7645. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7646. test -n "$add" && deplibs="$add $deplibs"
  7647. if test yes != "$hardcode_direct" &&
  7648. test yes != "$hardcode_minus_L" &&
  7649. test yes = "$hardcode_shlibpath_var"; then
  7650. case :$finalize_shlibpath: in
  7651. *":$libdir:"*) ;;
  7652. *) func_append finalize_shlibpath "$libdir:" ;;
  7653. esac
  7654. fi
  7655. fi
  7656. fi
  7657. if test prog = "$linkmode" || test relink = "$opt_mode"; then
  7658. add_shlibpath=
  7659. add_dir=
  7660. add=
  7661. # Finalize command for both is simple: just hardcode it.
  7662. if test yes = "$hardcode_direct" &&
  7663. test no = "$hardcode_direct_absolute"; then
  7664. add=$libdir/$linklib
  7665. elif test yes = "$hardcode_minus_L"; then
  7666. add_dir=-L$libdir
  7667. add=-l$name
  7668. elif test yes = "$hardcode_shlibpath_var"; then
  7669. case :$finalize_shlibpath: in
  7670. *":$libdir:"*) ;;
  7671. *) func_append finalize_shlibpath "$libdir:" ;;
  7672. esac
  7673. add=-l$name
  7674. elif test yes = "$hardcode_automatic"; then
  7675. if test -n "$inst_prefix_dir" &&
  7676. test -f "$inst_prefix_dir$libdir/$linklib"; then
  7677. add=$inst_prefix_dir$libdir/$linklib
  7678. else
  7679. add=$libdir/$linklib
  7680. fi
  7681. else
  7682. # We cannot seem to hardcode it, guess we'll fake it.
  7683. add_dir=-L$libdir
  7684. # Try looking first in the location we're being installed to.
  7685. if test -n "$inst_prefix_dir"; then
  7686. case $libdir in
  7687. [\\/]*)
  7688. func_append add_dir " -L$inst_prefix_dir$libdir"
  7689. ;;
  7690. esac
  7691. fi
  7692. add=-l$name
  7693. fi
  7694. if test prog = "$linkmode"; then
  7695. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  7696. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  7697. else
  7698. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7699. test -n "$add" && deplibs="$add $deplibs"
  7700. fi
  7701. fi
  7702. elif test prog = "$linkmode"; then
  7703. # Here we assume that one of hardcode_direct or hardcode_minus_L
  7704. # is not unsupported. This is valid on all known static and
  7705. # shared platforms.
  7706. if test unsupported != "$hardcode_direct"; then
  7707. test -n "$old_library" && linklib=$old_library
  7708. compile_deplibs="$dir/$linklib $compile_deplibs"
  7709. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  7710. else
  7711. compile_deplibs="-l$name -L$dir $compile_deplibs"
  7712. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  7713. fi
  7714. elif test yes = "$build_libtool_libs"; then
  7715. # Not a shared library
  7716. if test pass_all != "$deplibs_check_method"; then
  7717. # We're trying link a shared library against a static one
  7718. # but the system doesn't support it.
  7719. # Just print a warning and add the library to dependency_libs so
  7720. # that the program can be linked against the static library.
  7721. echo
  7722. $ECHO "*** Warning: This system cannot link to static lib archive $lib."
  7723. echo "*** I have the capability to make that library automatically link in when"
  7724. echo "*** you link to this library. But I can only do this if you have a"
  7725. echo "*** shared version of the library, which you do not appear to have."
  7726. if test yes = "$module"; then
  7727. echo "*** But as you try to build a module library, libtool will still create "
  7728. echo "*** a static module, that should work as long as the dlopening application"
  7729. echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  7730. if test -z "$global_symbol_pipe"; then
  7731. echo
  7732. echo "*** However, this would only work if libtool was able to extract symbol"
  7733. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  7734. echo "*** not find such a program. So, this module is probably useless."
  7735. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  7736. fi
  7737. if test no = "$build_old_libs"; then
  7738. build_libtool_libs=module
  7739. build_old_libs=yes
  7740. else
  7741. build_libtool_libs=no
  7742. fi
  7743. fi
  7744. else
  7745. deplibs="$dir/$old_library $deplibs"
  7746. link_static=yes
  7747. fi
  7748. fi # link shared/static library?
  7749. if test lib = "$linkmode"; then
  7750. if test -n "$dependency_libs" &&
  7751. { test yes != "$hardcode_into_libs" ||
  7752. test yes = "$build_old_libs" ||
  7753. test yes = "$link_static"; }; then
  7754. # Extract -R from dependency_libs
  7755. temp_deplibs=
  7756. for libdir in $dependency_libs; do
  7757. case $libdir in
  7758. -R*) func_stripname '-R' '' "$libdir"
  7759. temp_xrpath=$func_stripname_result
  7760. case " $xrpath " in
  7761. *" $temp_xrpath "*) ;;
  7762. *) func_append xrpath " $temp_xrpath";;
  7763. esac;;
  7764. *) func_append temp_deplibs " $libdir";;
  7765. esac
  7766. done
  7767. dependency_libs=$temp_deplibs
  7768. fi
  7769. func_append newlib_search_path " $absdir"
  7770. # Link against this library
  7771. test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  7772. # ... and its dependency_libs
  7773. tmp_libs=
  7774. for deplib in $dependency_libs; do
  7775. newdependency_libs="$deplib $newdependency_libs"
  7776. case $deplib in
  7777. -L*) func_stripname '-L' '' "$deplib"
  7778. func_resolve_sysroot "$func_stripname_result";;
  7779. *) func_resolve_sysroot "$deplib" ;;
  7780. esac
  7781. if $opt_preserve_dup_deps; then
  7782. case "$tmp_libs " in
  7783. *" $func_resolve_sysroot_result "*)
  7784. func_append specialdeplibs " $func_resolve_sysroot_result" ;;
  7785. esac
  7786. fi
  7787. func_append tmp_libs " $func_resolve_sysroot_result"
  7788. done
  7789. if test no != "$link_all_deplibs"; then
  7790. # Add the search paths of all dependency libraries
  7791. for deplib in $dependency_libs; do
  7792. path=
  7793. case $deplib in
  7794. -L*) path=$deplib ;;
  7795. *.la)
  7796. func_resolve_sysroot "$deplib"
  7797. deplib=$func_resolve_sysroot_result
  7798. func_dirname "$deplib" "" "."
  7799. dir=$func_dirname_result
  7800. # We need an absolute path.
  7801. case $dir in
  7802. [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
  7803. *)
  7804. absdir=`cd "$dir" && pwd`
  7805. if test -z "$absdir"; then
  7806. func_warning "cannot determine absolute directory name of '$dir'"
  7807. absdir=$dir
  7808. fi
  7809. ;;
  7810. esac
  7811. if $GREP "^installed=no" $deplib > /dev/null; then
  7812. case $host in
  7813. *-*-darwin*)
  7814. depdepl=
  7815. eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  7816. if test -n "$deplibrary_names"; then
  7817. for tmp in $deplibrary_names; do
  7818. depdepl=$tmp
  7819. done
  7820. if test -f "$absdir/$objdir/$depdepl"; then
  7821. depdepl=$absdir/$objdir/$depdepl
  7822. darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  7823. if test -z "$darwin_install_name"; then
  7824. darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  7825. fi
  7826. func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
  7827. func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
  7828. path=
  7829. fi
  7830. fi
  7831. ;;
  7832. *)
  7833. path=-L$absdir/$objdir
  7834. ;;
  7835. esac
  7836. else
  7837. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  7838. test -z "$libdir" && \
  7839. func_fatal_error "'$deplib' is not a valid libtool archive"
  7840. test "$absdir" != "$libdir" && \
  7841. func_warning "'$deplib' seems to be moved"
  7842. path=-L$absdir
  7843. fi
  7844. ;;
  7845. esac
  7846. case " $deplibs " in
  7847. *" $path "*) ;;
  7848. *) deplibs="$path $deplibs" ;;
  7849. esac
  7850. done
  7851. fi # link_all_deplibs != no
  7852. fi # linkmode = lib
  7853. done # for deplib in $libs
  7854. if test link = "$pass"; then
  7855. if test prog = "$linkmode"; then
  7856. compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  7857. finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  7858. else
  7859. compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7860. fi
  7861. fi
  7862. dependency_libs=$newdependency_libs
  7863. if test dlpreopen = "$pass"; then
  7864. # Link the dlpreopened libraries before other libraries
  7865. for deplib in $save_deplibs; do
  7866. deplibs="$deplib $deplibs"
  7867. done
  7868. fi
  7869. if test dlopen != "$pass"; then
  7870. test conv = "$pass" || {
  7871. # Make sure lib_search_path contains only unique directories.
  7872. lib_search_path=
  7873. for dir in $newlib_search_path; do
  7874. case "$lib_search_path " in
  7875. *" $dir "*) ;;
  7876. *) func_append lib_search_path " $dir" ;;
  7877. esac
  7878. done
  7879. newlib_search_path=
  7880. }
  7881. if test prog,link = "$linkmode,$pass"; then
  7882. vars="compile_deplibs finalize_deplibs"
  7883. else
  7884. vars=deplibs
  7885. fi
  7886. for var in $vars dependency_libs; do
  7887. # Add libraries to $var in reverse order
  7888. eval tmp_libs=\"\$$var\"
  7889. new_libs=
  7890. for deplib in $tmp_libs; do
  7891. # FIXME: Pedantically, this is the right thing to do, so
  7892. # that some nasty dependency loop isn't accidentally
  7893. # broken:
  7894. #new_libs="$deplib $new_libs"
  7895. # Pragmatically, this seems to cause very few problems in
  7896. # practice:
  7897. case $deplib in
  7898. -L*) new_libs="$deplib $new_libs" ;;
  7899. -R*) ;;
  7900. *)
  7901. # And here is the reason: when a library appears more
  7902. # than once as an explicit dependence of a library, or
  7903. # is implicitly linked in more than once by the
  7904. # compiler, it is considered special, and multiple
  7905. # occurrences thereof are not removed. Compare this
  7906. # with having the same library being listed as a
  7907. # dependency of multiple other libraries: in this case,
  7908. # we know (pedantically, we assume) the library does not
  7909. # need to be listed more than once, so we keep only the
  7910. # last copy. This is not always right, but it is rare
  7911. # enough that we require users that really mean to play
  7912. # such unportable linking tricks to link the library
  7913. # using -Wl,-lname, so that libtool does not consider it
  7914. # for duplicate removal.
  7915. case " $specialdeplibs " in
  7916. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  7917. *)
  7918. case " $new_libs " in
  7919. *" $deplib "*) ;;
  7920. *) new_libs="$deplib $new_libs" ;;
  7921. esac
  7922. ;;
  7923. esac
  7924. ;;
  7925. esac
  7926. done
  7927. tmp_libs=
  7928. for deplib in $new_libs; do
  7929. case $deplib in
  7930. -L*)
  7931. case " $tmp_libs " in
  7932. *" $deplib "*) ;;
  7933. *) func_append tmp_libs " $deplib" ;;
  7934. esac
  7935. ;;
  7936. *) func_append tmp_libs " $deplib" ;;
  7937. esac
  7938. done
  7939. eval $var=\"$tmp_libs\"
  7940. done # for var
  7941. fi
  7942. # Add Sun CC postdeps if required:
  7943. test CXX = "$tagname" && {
  7944. case $host_os in
  7945. linux*)
  7946. case `$CC -V 2>&1 | sed 5q` in
  7947. *Sun\ C*) # Sun C++ 5.9
  7948. func_suncc_cstd_abi
  7949. if test no != "$suncc_use_cstd_abi"; then
  7950. func_append postdeps ' -library=Cstd -library=Crun'
  7951. fi
  7952. ;;
  7953. esac
  7954. ;;
  7955. solaris*)
  7956. func_cc_basename "$CC"
  7957. case $func_cc_basename_result in
  7958. CC* | sunCC*)
  7959. func_suncc_cstd_abi
  7960. if test no != "$suncc_use_cstd_abi"; then
  7961. func_append postdeps ' -library=Cstd -library=Crun'
  7962. fi
  7963. ;;
  7964. esac
  7965. ;;
  7966. esac
  7967. }
  7968. # Last step: remove runtime libs from dependency_libs
  7969. # (they stay in deplibs)
  7970. tmp_libs=
  7971. for i in $dependency_libs; do
  7972. case " $predeps $postdeps $compiler_lib_search_path " in
  7973. *" $i "*)
  7974. i=
  7975. ;;
  7976. esac
  7977. if test -n "$i"; then
  7978. func_append tmp_libs " $i"
  7979. fi
  7980. done
  7981. dependency_libs=$tmp_libs
  7982. done # for pass
  7983. if test prog = "$linkmode"; then
  7984. dlfiles=$newdlfiles
  7985. fi
  7986. if test prog = "$linkmode" || test lib = "$linkmode"; then
  7987. dlprefiles=$newdlprefiles
  7988. fi
  7989. case $linkmode in
  7990. oldlib)
  7991. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  7992. func_warning "'-dlopen' is ignored for archives"
  7993. fi
  7994. case " $deplibs" in
  7995. *\ -l* | *\ -L*)
  7996. func_warning "'-l' and '-L' are ignored for archives" ;;
  7997. esac
  7998. test -n "$rpath" && \
  7999. func_warning "'-rpath' is ignored for archives"
  8000. test -n "$xrpath" && \
  8001. func_warning "'-R' is ignored for archives"
  8002. test -n "$vinfo" && \
  8003. func_warning "'-version-info/-version-number' is ignored for archives"
  8004. test -n "$release" && \
  8005. func_warning "'-release' is ignored for archives"
  8006. test -n "$export_symbols$export_symbols_regex" && \
  8007. func_warning "'-export-symbols' is ignored for archives"
  8008. # Now set the variables for building old libraries.
  8009. build_libtool_libs=no
  8010. oldlibs=$output
  8011. func_append objs "$old_deplibs"
  8012. ;;
  8013. lib)
  8014. # Make sure we only generate libraries of the form 'libNAME.la'.
  8015. case $outputname in
  8016. lib*)
  8017. func_stripname 'lib' '.la' "$outputname"
  8018. name=$func_stripname_result
  8019. eval shared_ext=\"$shrext_cmds\"
  8020. eval libname=\"$libname_spec\"
  8021. ;;
  8022. *)
  8023. test no = "$module" \
  8024. && func_fatal_help "libtool library '$output' must begin with 'lib'"
  8025. if test no != "$need_lib_prefix"; then
  8026. # Add the "lib" prefix for modules if required
  8027. func_stripname '' '.la' "$outputname"
  8028. name=$func_stripname_result
  8029. eval shared_ext=\"$shrext_cmds\"
  8030. eval libname=\"$libname_spec\"
  8031. else
  8032. func_stripname '' '.la' "$outputname"
  8033. libname=$func_stripname_result
  8034. fi
  8035. ;;
  8036. esac
  8037. if test -n "$objs"; then
  8038. if test pass_all != "$deplibs_check_method"; then
  8039. func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
  8040. else
  8041. echo
  8042. $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  8043. $ECHO "*** objects $objs is not portable!"
  8044. func_append libobjs " $objs"
  8045. fi
  8046. fi
  8047. test no = "$dlself" \
  8048. || func_warning "'-dlopen self' is ignored for libtool libraries"
  8049. set dummy $rpath
  8050. shift
  8051. test 1 -lt "$#" \
  8052. && func_warning "ignoring multiple '-rpath's for a libtool library"
  8053. install_libdir=$1
  8054. oldlibs=
  8055. if test -z "$rpath"; then
  8056. if test yes = "$build_libtool_libs"; then
  8057. # Building a libtool convenience library.
  8058. # Some compilers have problems with a '.al' extension so
  8059. # convenience libraries should have the same extension an
  8060. # archive normally would.
  8061. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  8062. build_libtool_libs=convenience
  8063. build_old_libs=yes
  8064. fi
  8065. test -n "$vinfo" && \
  8066. func_warning "'-version-info/-version-number' is ignored for convenience libraries"
  8067. test -n "$release" && \
  8068. func_warning "'-release' is ignored for convenience libraries"
  8069. else
  8070. # Parse the version information argument.
  8071. save_ifs=$IFS; IFS=:
  8072. set dummy $vinfo 0 0 0
  8073. shift
  8074. IFS=$save_ifs
  8075. test -n "$7" && \
  8076. func_fatal_help "too many parameters to '-version-info'"
  8077. # convert absolute version numbers to libtool ages
  8078. # this retains compatibility with .la files and attempts
  8079. # to make the code below a bit more comprehensible
  8080. case $vinfo_number in
  8081. yes)
  8082. number_major=$1
  8083. number_minor=$2
  8084. number_revision=$3
  8085. #
  8086. # There are really only two kinds -- those that
  8087. # use the current revision as the major version
  8088. # and those that subtract age and use age as
  8089. # a minor version. But, then there is irix
  8090. # that has an extra 1 added just for fun
  8091. #
  8092. case $version_type in
  8093. # correct linux to gnu/linux during the next big refactor
  8094. darwin|freebsd-elf|linux|osf|windows|none)
  8095. func_arith $number_major + $number_minor
  8096. current=$func_arith_result
  8097. age=$number_minor
  8098. revision=$number_revision
  8099. ;;
  8100. freebsd-aout|qnx|sunos)
  8101. current=$number_major
  8102. revision=$number_minor
  8103. age=0
  8104. ;;
  8105. irix|nonstopux)
  8106. func_arith $number_major + $number_minor
  8107. current=$func_arith_result
  8108. age=$number_minor
  8109. revision=$number_minor
  8110. lt_irix_increment=no
  8111. ;;
  8112. *)
  8113. func_fatal_configuration "$modename: unknown library version type '$version_type'"
  8114. ;;
  8115. esac
  8116. ;;
  8117. no)
  8118. current=$1
  8119. revision=$2
  8120. age=$3
  8121. ;;
  8122. esac
  8123. # Check that each of the things are valid numbers.
  8124. case $current in
  8125. 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]) ;;
  8126. *)
  8127. func_error "CURRENT '$current' must be a nonnegative integer"
  8128. func_fatal_error "'$vinfo' is not valid version information"
  8129. ;;
  8130. esac
  8131. case $revision in
  8132. 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]) ;;
  8133. *)
  8134. func_error "REVISION '$revision' must be a nonnegative integer"
  8135. func_fatal_error "'$vinfo' is not valid version information"
  8136. ;;
  8137. esac
  8138. case $age in
  8139. 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]) ;;
  8140. *)
  8141. func_error "AGE '$age' must be a nonnegative integer"
  8142. func_fatal_error "'$vinfo' is not valid version information"
  8143. ;;
  8144. esac
  8145. if test "$age" -gt "$current"; then
  8146. func_error "AGE '$age' is greater than the current interface number '$current'"
  8147. func_fatal_error "'$vinfo' is not valid version information"
  8148. fi
  8149. # Calculate the version variables.
  8150. major=
  8151. versuffix=
  8152. verstring=
  8153. case $version_type in
  8154. none) ;;
  8155. darwin)
  8156. # Like Linux, but with the current version available in
  8157. # verstring for coding it into the library header
  8158. func_arith $current - $age
  8159. major=.$func_arith_result
  8160. versuffix=$major.$age.$revision
  8161. # Darwin ld doesn't like 0 for these options...
  8162. func_arith $current + 1
  8163. minor_current=$func_arith_result
  8164. xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8165. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8166. # On Darwin other compilers
  8167. case $CC in
  8168. nagfor*)
  8169. verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8170. ;;
  8171. *)
  8172. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8173. ;;
  8174. esac
  8175. ;;
  8176. freebsd-aout)
  8177. major=.$current
  8178. versuffix=.$current.$revision
  8179. ;;
  8180. freebsd-elf)
  8181. func_arith $current - $age
  8182. major=.$func_arith_result
  8183. versuffix=$major.$age.$revision
  8184. ;;
  8185. irix | nonstopux)
  8186. if test no = "$lt_irix_increment"; then
  8187. func_arith $current - $age
  8188. else
  8189. func_arith $current - $age + 1
  8190. fi
  8191. major=$func_arith_result
  8192. case $version_type in
  8193. nonstopux) verstring_prefix=nonstopux ;;
  8194. *) verstring_prefix=sgi ;;
  8195. esac
  8196. verstring=$verstring_prefix$major.$revision
  8197. # Add in all the interfaces that we are compatible with.
  8198. loop=$revision
  8199. while test 0 -ne "$loop"; do
  8200. func_arith $revision - $loop
  8201. iface=$func_arith_result
  8202. func_arith $loop - 1
  8203. loop=$func_arith_result
  8204. verstring=$verstring_prefix$major.$iface:$verstring
  8205. done
  8206. # Before this point, $major must not contain '.'.
  8207. major=.$major
  8208. versuffix=$major.$revision
  8209. ;;
  8210. linux) # correct to gnu/linux during the next big refactor
  8211. func_arith $current - $age
  8212. major=.$func_arith_result
  8213. versuffix=$major.$age.$revision
  8214. ;;
  8215. osf)
  8216. func_arith $current - $age
  8217. major=.$func_arith_result
  8218. versuffix=.$current.$age.$revision
  8219. verstring=$current.$age.$revision
  8220. # Add in all the interfaces that we are compatible with.
  8221. loop=$age
  8222. while test 0 -ne "$loop"; do
  8223. func_arith $current - $loop
  8224. iface=$func_arith_result
  8225. func_arith $loop - 1
  8226. loop=$func_arith_result
  8227. verstring=$verstring:$iface.0
  8228. done
  8229. # Make executables depend on our current version.
  8230. func_append verstring ":$current.0"
  8231. ;;
  8232. qnx)
  8233. major=.$current
  8234. versuffix=.$current
  8235. ;;
  8236. sco)
  8237. major=.$current
  8238. versuffix=.$current
  8239. ;;
  8240. sunos)
  8241. major=.$current
  8242. versuffix=.$current.$revision
  8243. ;;
  8244. windows)
  8245. # Use '-' rather than '.', since we only want one
  8246. # extension on DOS 8.3 file systems.
  8247. func_arith $current - $age
  8248. major=$func_arith_result
  8249. versuffix=-$major
  8250. ;;
  8251. *)
  8252. func_fatal_configuration "unknown library version type '$version_type'"
  8253. ;;
  8254. esac
  8255. # Clear the version info if we defaulted, and they specified a release.
  8256. if test -z "$vinfo" && test -n "$release"; then
  8257. major=
  8258. case $version_type in
  8259. darwin)
  8260. # we can't check for "0.0" in archive_cmds due to quoting
  8261. # problems, so we reset it completely
  8262. verstring=
  8263. ;;
  8264. *)
  8265. verstring=0.0
  8266. ;;
  8267. esac
  8268. if test no = "$need_version"; then
  8269. versuffix=
  8270. else
  8271. versuffix=.0.0
  8272. fi
  8273. fi
  8274. # Remove version info from name if versioning should be avoided
  8275. if test yes,no = "$avoid_version,$need_version"; then
  8276. major=
  8277. versuffix=
  8278. verstring=
  8279. fi
  8280. # Check to see if the archive will have undefined symbols.
  8281. if test yes = "$allow_undefined"; then
  8282. if test unsupported = "$allow_undefined_flag"; then
  8283. if test yes = "$build_old_libs"; then
  8284. func_warning "undefined symbols not allowed in $host shared libraries; building static only"
  8285. build_libtool_libs=no
  8286. else
  8287. func_fatal_error "can't build $host shared library unless -no-undefined is specified"
  8288. fi
  8289. fi
  8290. else
  8291. # Don't allow undefined symbols.
  8292. allow_undefined_flag=$no_undefined_flag
  8293. fi
  8294. fi
  8295. func_generate_dlsyms "$libname" "$libname" :
  8296. func_append libobjs " $symfileobj"
  8297. test " " = "$libobjs" && libobjs=
  8298. if test relink != "$opt_mode"; then
  8299. # Remove our outputs, but don't remove object files since they
  8300. # may have been created when compiling PIC objects.
  8301. removelist=
  8302. tempremovelist=`$ECHO "$output_objdir/*"`
  8303. for p in $tempremovelist; do
  8304. case $p in
  8305. *.$objext | *.gcno)
  8306. ;;
  8307. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
  8308. if test -n "$precious_files_regex"; then
  8309. if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  8310. then
  8311. continue
  8312. fi
  8313. fi
  8314. func_append removelist " $p"
  8315. ;;
  8316. *) ;;
  8317. esac
  8318. done
  8319. test -n "$removelist" && \
  8320. func_show_eval "${RM}r \$removelist"
  8321. fi
  8322. # Now set the variables for building old libraries.
  8323. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
  8324. func_append oldlibs " $output_objdir/$libname.$libext"
  8325. # Transform .lo files to .o files.
  8326. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
  8327. fi
  8328. # Eliminate all temporary directories.
  8329. #for path in $notinst_path; do
  8330. # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  8331. # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  8332. # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  8333. #done
  8334. if test -n "$xrpath"; then
  8335. # If the user specified any rpath flags, then add them.
  8336. temp_xrpath=
  8337. for libdir in $xrpath; do
  8338. func_replace_sysroot "$libdir"
  8339. func_append temp_xrpath " -R$func_replace_sysroot_result"
  8340. case "$finalize_rpath " in
  8341. *" $libdir "*) ;;
  8342. *) func_append finalize_rpath " $libdir" ;;
  8343. esac
  8344. done
  8345. if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
  8346. dependency_libs="$temp_xrpath $dependency_libs"
  8347. fi
  8348. fi
  8349. # Make sure dlfiles contains only unique files that won't be dlpreopened
  8350. old_dlfiles=$dlfiles
  8351. dlfiles=
  8352. for lib in $old_dlfiles; do
  8353. case " $dlprefiles $dlfiles " in
  8354. *" $lib "*) ;;
  8355. *) func_append dlfiles " $lib" ;;
  8356. esac
  8357. done
  8358. # Make sure dlprefiles contains only unique files
  8359. old_dlprefiles=$dlprefiles
  8360. dlprefiles=
  8361. for lib in $old_dlprefiles; do
  8362. case "$dlprefiles " in
  8363. *" $lib "*) ;;
  8364. *) func_append dlprefiles " $lib" ;;
  8365. esac
  8366. done
  8367. if test yes = "$build_libtool_libs"; then
  8368. if test -n "$rpath"; then
  8369. case $host in
  8370. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  8371. # these systems don't actually have a c library (as such)!
  8372. ;;
  8373. *-*-rhapsody* | *-*-darwin1.[012])
  8374. # Rhapsody C library is in the System framework
  8375. func_append deplibs " System.ltframework"
  8376. ;;
  8377. *-*-netbsd*)
  8378. # Don't link with libc until the a.out ld.so is fixed.
  8379. ;;
  8380. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  8381. # Do not include libc due to us having libc/libc_r.
  8382. ;;
  8383. *-*-sco3.2v5* | *-*-sco5v6*)
  8384. # Causes problems with __ctype
  8385. ;;
  8386. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  8387. # Compiler inserts libc in the correct place for threads to work
  8388. ;;
  8389. *)
  8390. # Add libc to deplibs on all other systems if necessary.
  8391. if test yes = "$build_libtool_need_lc"; then
  8392. func_append deplibs " -lc"
  8393. fi
  8394. ;;
  8395. esac
  8396. fi
  8397. # Transform deplibs into only deplibs that can be linked in shared.
  8398. name_save=$name
  8399. libname_save=$libname
  8400. release_save=$release
  8401. versuffix_save=$versuffix
  8402. major_save=$major
  8403. # I'm not sure if I'm treating the release correctly. I think
  8404. # release should show up in the -l (ie -lgmp5) so we don't want to
  8405. # add it in twice. Is that correct?
  8406. release=
  8407. versuffix=
  8408. major=
  8409. newdeplibs=
  8410. droppeddeps=no
  8411. case $deplibs_check_method in
  8412. pass_all)
  8413. # Don't check for shared/static. Everything works.
  8414. # This might be a little naive. We might want to check
  8415. # whether the library exists or not. But this is on
  8416. # osf3 & osf4 and I'm not really sure... Just
  8417. # implementing what was already the behavior.
  8418. newdeplibs=$deplibs
  8419. ;;
  8420. test_compile)
  8421. # This code stresses the "libraries are programs" paradigm to its
  8422. # limits. Maybe even breaks it. We compile a program, linking it
  8423. # against the deplibs as a proxy for the library. Then we can check
  8424. # whether they linked in statically or dynamically with ldd.
  8425. $opt_dry_run || $RM conftest.c
  8426. cat > conftest.c <<EOF
  8427. int main() { return 0; }
  8428. EOF
  8429. $opt_dry_run || $RM conftest
  8430. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  8431. ldd_output=`ldd conftest`
  8432. for i in $deplibs; do
  8433. case $i in
  8434. -l*)
  8435. func_stripname -l '' "$i"
  8436. name=$func_stripname_result
  8437. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8438. case " $predeps $postdeps " in
  8439. *" $i "*)
  8440. func_append newdeplibs " $i"
  8441. i=
  8442. ;;
  8443. esac
  8444. fi
  8445. if test -n "$i"; then
  8446. libname=`eval "\\$ECHO \"$libname_spec\""`
  8447. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8448. set dummy $deplib_matches; shift
  8449. deplib_match=$1
  8450. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8451. func_append newdeplibs " $i"
  8452. else
  8453. droppeddeps=yes
  8454. echo
  8455. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8456. echo "*** I have the capability to make that library automatically link in when"
  8457. echo "*** you link to this library. But I can only do this if you have a"
  8458. echo "*** shared version of the library, which I believe you do not have"
  8459. echo "*** because a test_compile did reveal that the linker did not use it for"
  8460. echo "*** its dynamic dependency list that programs get resolved with at runtime."
  8461. fi
  8462. fi
  8463. ;;
  8464. *)
  8465. func_append newdeplibs " $i"
  8466. ;;
  8467. esac
  8468. done
  8469. else
  8470. # Error occurred in the first compile. Let's try to salvage
  8471. # the situation: Compile a separate program for each library.
  8472. for i in $deplibs; do
  8473. case $i in
  8474. -l*)
  8475. func_stripname -l '' "$i"
  8476. name=$func_stripname_result
  8477. $opt_dry_run || $RM conftest
  8478. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  8479. ldd_output=`ldd conftest`
  8480. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8481. case " $predeps $postdeps " in
  8482. *" $i "*)
  8483. func_append newdeplibs " $i"
  8484. i=
  8485. ;;
  8486. esac
  8487. fi
  8488. if test -n "$i"; then
  8489. libname=`eval "\\$ECHO \"$libname_spec\""`
  8490. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8491. set dummy $deplib_matches; shift
  8492. deplib_match=$1
  8493. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8494. func_append newdeplibs " $i"
  8495. else
  8496. droppeddeps=yes
  8497. echo
  8498. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8499. echo "*** I have the capability to make that library automatically link in when"
  8500. echo "*** you link to this library. But I can only do this if you have a"
  8501. echo "*** shared version of the library, which you do not appear to have"
  8502. echo "*** because a test_compile did reveal that the linker did not use this one"
  8503. echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  8504. fi
  8505. fi
  8506. else
  8507. droppeddeps=yes
  8508. echo
  8509. $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  8510. echo "*** make it link in! You will probably need to install it or some"
  8511. echo "*** library that it depends on before this library will be fully"
  8512. echo "*** functional. Installing it before continuing would be even better."
  8513. fi
  8514. ;;
  8515. *)
  8516. func_append newdeplibs " $i"
  8517. ;;
  8518. esac
  8519. done
  8520. fi
  8521. ;;
  8522. file_magic*)
  8523. set dummy $deplibs_check_method; shift
  8524. file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8525. for a_deplib in $deplibs; do
  8526. case $a_deplib in
  8527. -l*)
  8528. func_stripname -l '' "$a_deplib"
  8529. name=$func_stripname_result
  8530. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8531. case " $predeps $postdeps " in
  8532. *" $a_deplib "*)
  8533. func_append newdeplibs " $a_deplib"
  8534. a_deplib=
  8535. ;;
  8536. esac
  8537. fi
  8538. if test -n "$a_deplib"; then
  8539. libname=`eval "\\$ECHO \"$libname_spec\""`
  8540. if test -n "$file_magic_glob"; then
  8541. libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  8542. else
  8543. libnameglob=$libname
  8544. fi
  8545. test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
  8546. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8547. if test yes = "$want_nocaseglob"; then
  8548. shopt -s nocaseglob
  8549. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8550. $nocaseglob
  8551. else
  8552. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8553. fi
  8554. for potent_lib in $potential_libs; do
  8555. # Follow soft links.
  8556. if ls -lLd "$potent_lib" 2>/dev/null |
  8557. $GREP " -> " >/dev/null; then
  8558. continue
  8559. fi
  8560. # The statement above tries to avoid entering an
  8561. # endless loop below, in case of cyclic links.
  8562. # We might still enter an endless loop, since a link
  8563. # loop can be closed while we follow links,
  8564. # but so what?
  8565. potlib=$potent_lib
  8566. while test -h "$potlib" 2>/dev/null; do
  8567. potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
  8568. case $potliblink in
  8569. [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
  8570. *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
  8571. esac
  8572. done
  8573. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  8574. $SED -e 10q |
  8575. $EGREP "$file_magic_regex" > /dev/null; then
  8576. func_append newdeplibs " $a_deplib"
  8577. a_deplib=
  8578. break 2
  8579. fi
  8580. done
  8581. done
  8582. fi
  8583. if test -n "$a_deplib"; then
  8584. droppeddeps=yes
  8585. echo
  8586. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8587. echo "*** I have the capability to make that library automatically link in when"
  8588. echo "*** you link to this library. But I can only do this if you have a"
  8589. echo "*** shared version of the library, which you do not appear to have"
  8590. echo "*** because I did check the linker path looking for a file starting"
  8591. if test -z "$potlib"; then
  8592. $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  8593. else
  8594. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8595. $ECHO "*** using a file magic. Last file checked: $potlib"
  8596. fi
  8597. fi
  8598. ;;
  8599. *)
  8600. # Add a -L argument.
  8601. func_append newdeplibs " $a_deplib"
  8602. ;;
  8603. esac
  8604. done # Gone through all deplibs.
  8605. ;;
  8606. match_pattern*)
  8607. set dummy $deplibs_check_method; shift
  8608. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8609. for a_deplib in $deplibs; do
  8610. case $a_deplib in
  8611. -l*)
  8612. func_stripname -l '' "$a_deplib"
  8613. name=$func_stripname_result
  8614. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8615. case " $predeps $postdeps " in
  8616. *" $a_deplib "*)
  8617. func_append newdeplibs " $a_deplib"
  8618. a_deplib=
  8619. ;;
  8620. esac
  8621. fi
  8622. if test -n "$a_deplib"; then
  8623. libname=`eval "\\$ECHO \"$libname_spec\""`
  8624. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8625. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  8626. for potent_lib in $potential_libs; do
  8627. potlib=$potent_lib # see symlink-check above in file_magic test
  8628. if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  8629. $EGREP "$match_pattern_regex" > /dev/null; then
  8630. func_append newdeplibs " $a_deplib"
  8631. a_deplib=
  8632. break 2
  8633. fi
  8634. done
  8635. done
  8636. fi
  8637. if test -n "$a_deplib"; then
  8638. droppeddeps=yes
  8639. echo
  8640. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8641. echo "*** I have the capability to make that library automatically link in when"
  8642. echo "*** you link to this library. But I can only do this if you have a"
  8643. echo "*** shared version of the library, which you do not appear to have"
  8644. echo "*** because I did check the linker path looking for a file starting"
  8645. if test -z "$potlib"; then
  8646. $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  8647. else
  8648. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8649. $ECHO "*** using a regex pattern. Last file checked: $potlib"
  8650. fi
  8651. fi
  8652. ;;
  8653. *)
  8654. # Add a -L argument.
  8655. func_append newdeplibs " $a_deplib"
  8656. ;;
  8657. esac
  8658. done # Gone through all deplibs.
  8659. ;;
  8660. none | unknown | *)
  8661. newdeplibs=
  8662. tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  8663. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8664. for i in $predeps $postdeps; do
  8665. # can't use Xsed below, because $i might contain '/'
  8666. tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
  8667. done
  8668. fi
  8669. case $tmp_deplibs in
  8670. *[!\ \ ]*)
  8671. echo
  8672. if test none = "$deplibs_check_method"; then
  8673. echo "*** Warning: inter-library dependencies are not supported in this platform."
  8674. else
  8675. echo "*** Warning: inter-library dependencies are not known to be supported."
  8676. fi
  8677. echo "*** All declared inter-library dependencies are being dropped."
  8678. droppeddeps=yes
  8679. ;;
  8680. esac
  8681. ;;
  8682. esac
  8683. versuffix=$versuffix_save
  8684. major=$major_save
  8685. release=$release_save
  8686. libname=$libname_save
  8687. name=$name_save
  8688. case $host in
  8689. *-*-rhapsody* | *-*-darwin1.[012])
  8690. # On Rhapsody replace the C library with the System framework
  8691. newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  8692. ;;
  8693. esac
  8694. if test yes = "$droppeddeps"; then
  8695. if test yes = "$module"; then
  8696. echo
  8697. echo "*** Warning: libtool could not satisfy all declared inter-library"
  8698. $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  8699. echo "*** a static module, that should work as long as the dlopening"
  8700. echo "*** application is linked with the -dlopen flag."
  8701. if test -z "$global_symbol_pipe"; then
  8702. echo
  8703. echo "*** However, this would only work if libtool was able to extract symbol"
  8704. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  8705. echo "*** not find such a program. So, this module is probably useless."
  8706. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  8707. fi
  8708. if test no = "$build_old_libs"; then
  8709. oldlibs=$output_objdir/$libname.$libext
  8710. build_libtool_libs=module
  8711. build_old_libs=yes
  8712. else
  8713. build_libtool_libs=no
  8714. fi
  8715. else
  8716. echo "*** The inter-library dependencies that have been dropped here will be"
  8717. echo "*** automatically added whenever a program is linked with this library"
  8718. echo "*** or is declared to -dlopen it."
  8719. if test no = "$allow_undefined"; then
  8720. echo
  8721. echo "*** Since this library must not contain undefined symbols,"
  8722. echo "*** because either the platform does not support them or"
  8723. echo "*** it was explicitly requested with -no-undefined,"
  8724. echo "*** libtool will only create a static version of it."
  8725. if test no = "$build_old_libs"; then
  8726. oldlibs=$output_objdir/$libname.$libext
  8727. build_libtool_libs=module
  8728. build_old_libs=yes
  8729. else
  8730. build_libtool_libs=no
  8731. fi
  8732. fi
  8733. fi
  8734. fi
  8735. # Done checking deplibs!
  8736. deplibs=$newdeplibs
  8737. fi
  8738. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  8739. case $host in
  8740. *-*-darwin*)
  8741. newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8742. new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8743. deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8744. ;;
  8745. esac
  8746. # move library search paths that coincide with paths to not yet
  8747. # installed libraries to the beginning of the library search list
  8748. new_libs=
  8749. for path in $notinst_path; do
  8750. case " $new_libs " in
  8751. *" -L$path/$objdir "*) ;;
  8752. *)
  8753. case " $deplibs " in
  8754. *" -L$path/$objdir "*)
  8755. func_append new_libs " -L$path/$objdir" ;;
  8756. esac
  8757. ;;
  8758. esac
  8759. done
  8760. for deplib in $deplibs; do
  8761. case $deplib in
  8762. -L*)
  8763. case " $new_libs " in
  8764. *" $deplib "*) ;;
  8765. *) func_append new_libs " $deplib" ;;
  8766. esac
  8767. ;;
  8768. *) func_append new_libs " $deplib" ;;
  8769. esac
  8770. done
  8771. deplibs=$new_libs
  8772. # All the library-specific variables (install_libdir is set above).
  8773. library_names=
  8774. old_library=
  8775. dlname=
  8776. # Test again, we may have decided not to build it any more
  8777. if test yes = "$build_libtool_libs"; then
  8778. # Remove $wl instances when linking with ld.
  8779. # FIXME: should test the right _cmds variable.
  8780. case $archive_cmds in
  8781. *\$LD\ *) wl= ;;
  8782. esac
  8783. if test yes = "$hardcode_into_libs"; then
  8784. # Hardcode the library paths
  8785. hardcode_libdirs=
  8786. dep_rpath=
  8787. rpath=$finalize_rpath
  8788. test relink = "$opt_mode" || rpath=$compile_rpath$rpath
  8789. for libdir in $rpath; do
  8790. if test -n "$hardcode_libdir_flag_spec"; then
  8791. if test -n "$hardcode_libdir_separator"; then
  8792. func_replace_sysroot "$libdir"
  8793. libdir=$func_replace_sysroot_result
  8794. if test -z "$hardcode_libdirs"; then
  8795. hardcode_libdirs=$libdir
  8796. else
  8797. # Just accumulate the unique libdirs.
  8798. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  8799. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  8800. ;;
  8801. *)
  8802. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  8803. ;;
  8804. esac
  8805. fi
  8806. else
  8807. eval flag=\"$hardcode_libdir_flag_spec\"
  8808. func_append dep_rpath " $flag"
  8809. fi
  8810. elif test -n "$runpath_var"; then
  8811. case "$perm_rpath " in
  8812. *" $libdir "*) ;;
  8813. *) func_append perm_rpath " $libdir" ;;
  8814. esac
  8815. fi
  8816. done
  8817. # Substitute the hardcoded libdirs into the rpath.
  8818. if test -n "$hardcode_libdir_separator" &&
  8819. test -n "$hardcode_libdirs"; then
  8820. libdir=$hardcode_libdirs
  8821. eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
  8822. fi
  8823. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  8824. # We should set the runpath_var.
  8825. rpath=
  8826. for dir in $perm_rpath; do
  8827. func_append rpath "$dir:"
  8828. done
  8829. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  8830. fi
  8831. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  8832. fi
  8833. shlibpath=$finalize_shlibpath
  8834. test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
  8835. if test -n "$shlibpath"; then
  8836. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  8837. fi
  8838. # Get the real and link names of the library.
  8839. eval shared_ext=\"$shrext_cmds\"
  8840. eval library_names=\"$library_names_spec\"
  8841. set dummy $library_names
  8842. shift
  8843. realname=$1
  8844. shift
  8845. if test -n "$soname_spec"; then
  8846. eval soname=\"$soname_spec\"
  8847. else
  8848. soname=$realname
  8849. fi
  8850. if test -z "$dlname"; then
  8851. dlname=$soname
  8852. fi
  8853. lib=$output_objdir/$realname
  8854. linknames=
  8855. for link
  8856. do
  8857. func_append linknames " $link"
  8858. done
  8859. # Use standard objects if they are pic
  8860. test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  8861. test "X$libobjs" = "X " && libobjs=
  8862. delfiles=
  8863. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  8864. $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  8865. export_symbols=$output_objdir/$libname.uexp
  8866. func_append delfiles " $export_symbols"
  8867. fi
  8868. orig_export_symbols=
  8869. case $host_os in
  8870. cygwin* | mingw* | cegcc*)
  8871. if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  8872. # exporting using user supplied symfile
  8873. func_dll_def_p "$export_symbols" || {
  8874. # and it's NOT already a .def file. Must figure out
  8875. # which of the given symbols are data symbols and tag
  8876. # them as such. So, trigger use of export_symbols_cmds.
  8877. # export_symbols gets reassigned inside the "prepare
  8878. # the list of exported symbols" if statement, so the
  8879. # include_expsyms logic still works.
  8880. orig_export_symbols=$export_symbols
  8881. export_symbols=
  8882. always_export_symbols=yes
  8883. }
  8884. fi
  8885. ;;
  8886. esac
  8887. # Prepare the list of exported symbols
  8888. if test -z "$export_symbols"; then
  8889. if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
  8890. func_verbose "generating symbol list for '$libname.la'"
  8891. export_symbols=$output_objdir/$libname.exp
  8892. $opt_dry_run || $RM $export_symbols
  8893. cmds=$export_symbols_cmds
  8894. save_ifs=$IFS; IFS='~'
  8895. for cmd1 in $cmds; do
  8896. IFS=$save_ifs
  8897. # Take the normal branch if the nm_file_list_spec branch
  8898. # doesn't work or if tool conversion is not needed.
  8899. case $nm_file_list_spec~$to_tool_file_cmd in
  8900. *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
  8901. try_normal_branch=yes
  8902. eval cmd=\"$cmd1\"
  8903. func_len " $cmd"
  8904. len=$func_len_result
  8905. ;;
  8906. *)
  8907. try_normal_branch=no
  8908. ;;
  8909. esac
  8910. if test yes = "$try_normal_branch" \
  8911. && { test "$len" -lt "$max_cmd_len" \
  8912. || test "$max_cmd_len" -le -1; }
  8913. then
  8914. func_show_eval "$cmd" 'exit $?'
  8915. skipped_export=false
  8916. elif test -n "$nm_file_list_spec"; then
  8917. func_basename "$output"
  8918. output_la=$func_basename_result
  8919. save_libobjs=$libobjs
  8920. save_output=$output
  8921. output=$output_objdir/$output_la.nm
  8922. func_to_tool_file "$output"
  8923. libobjs=$nm_file_list_spec$func_to_tool_file_result
  8924. func_append delfiles " $output"
  8925. func_verbose "creating $NM input file list: $output"
  8926. for obj in $save_libobjs; do
  8927. func_to_tool_file "$obj"
  8928. $ECHO "$func_to_tool_file_result"
  8929. done > "$output"
  8930. eval cmd=\"$cmd1\"
  8931. func_show_eval "$cmd" 'exit $?'
  8932. output=$save_output
  8933. libobjs=$save_libobjs
  8934. skipped_export=false
  8935. else
  8936. # The command line is too long to execute in one step.
  8937. func_verbose "using reloadable object file for export list..."
  8938. skipped_export=:
  8939. # Break out early, otherwise skipped_export may be
  8940. # set to false by a later but shorter cmd.
  8941. break
  8942. fi
  8943. done
  8944. IFS=$save_ifs
  8945. if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
  8946. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  8947. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  8948. fi
  8949. fi
  8950. fi
  8951. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  8952. tmp_export_symbols=$export_symbols
  8953. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  8954. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  8955. fi
  8956. if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
  8957. # The given exports_symbols file has to be filtered, so filter it.
  8958. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  8959. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  8960. # 's' commands, which not all seds can handle. GNU sed should be fine
  8961. # though. Also, the filter scales superlinearly with the number of
  8962. # global variables. join(1) would be nice here, but unfortunately
  8963. # isn't a blessed tool.
  8964. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  8965. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  8966. export_symbols=$output_objdir/$libname.def
  8967. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  8968. fi
  8969. tmp_deplibs=
  8970. for test_deplib in $deplibs; do
  8971. case " $convenience " in
  8972. *" $test_deplib "*) ;;
  8973. *)
  8974. func_append tmp_deplibs " $test_deplib"
  8975. ;;
  8976. esac
  8977. done
  8978. deplibs=$tmp_deplibs
  8979. if test -n "$convenience"; then
  8980. if test -n "$whole_archive_flag_spec" &&
  8981. test yes = "$compiler_needs_object" &&
  8982. test -z "$libobjs"; then
  8983. # extract the archives, so we have objects to list.
  8984. # TODO: could optimize this to just extract one archive.
  8985. whole_archive_flag_spec=
  8986. fi
  8987. if test -n "$whole_archive_flag_spec"; then
  8988. save_libobjs=$libobjs
  8989. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  8990. test "X$libobjs" = "X " && libobjs=
  8991. else
  8992. gentop=$output_objdir/${outputname}x
  8993. func_append generated " $gentop"
  8994. func_extract_archives $gentop $convenience
  8995. func_append libobjs " $func_extract_archives_result"
  8996. test "X$libobjs" = "X " && libobjs=
  8997. fi
  8998. fi
  8999. if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
  9000. eval flag=\"$thread_safe_flag_spec\"
  9001. func_append linker_flags " $flag"
  9002. fi
  9003. # Make a backup of the uninstalled library when relinking
  9004. if test relink = "$opt_mode"; then
  9005. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  9006. fi
  9007. # Do each of the archive commands.
  9008. if test yes = "$module" && test -n "$module_cmds"; then
  9009. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9010. eval test_cmds=\"$module_expsym_cmds\"
  9011. cmds=$module_expsym_cmds
  9012. else
  9013. eval test_cmds=\"$module_cmds\"
  9014. cmds=$module_cmds
  9015. fi
  9016. else
  9017. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9018. eval test_cmds=\"$archive_expsym_cmds\"
  9019. cmds=$archive_expsym_cmds
  9020. else
  9021. eval test_cmds=\"$archive_cmds\"
  9022. cmds=$archive_cmds
  9023. fi
  9024. fi
  9025. if test : != "$skipped_export" &&
  9026. func_len " $test_cmds" &&
  9027. len=$func_len_result &&
  9028. test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9029. :
  9030. else
  9031. # The command line is too long to link in one step, link piecewise
  9032. # or, if using GNU ld and skipped_export is not :, use a linker
  9033. # script.
  9034. # Save the value of $output and $libobjs because we want to
  9035. # use them later. If we have whole_archive_flag_spec, we
  9036. # want to use save_libobjs as it was before
  9037. # whole_archive_flag_spec was expanded, because we can't
  9038. # assume the linker understands whole_archive_flag_spec.
  9039. # This may have to be revisited, in case too many
  9040. # convenience libraries get linked in and end up exceeding
  9041. # the spec.
  9042. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  9043. save_libobjs=$libobjs
  9044. fi
  9045. save_output=$output
  9046. func_basename "$output"
  9047. output_la=$func_basename_result
  9048. # Clear the reloadable object creation command queue and
  9049. # initialize k to one.
  9050. test_cmds=
  9051. concat_cmds=
  9052. objlist=
  9053. last_robj=
  9054. k=1
  9055. if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
  9056. output=$output_objdir/$output_la.lnkscript
  9057. func_verbose "creating GNU ld script: $output"
  9058. echo 'INPUT (' > $output
  9059. for obj in $save_libobjs
  9060. do
  9061. func_to_tool_file "$obj"
  9062. $ECHO "$func_to_tool_file_result" >> $output
  9063. done
  9064. echo ')' >> $output
  9065. func_append delfiles " $output"
  9066. func_to_tool_file "$output"
  9067. output=$func_to_tool_file_result
  9068. elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
  9069. output=$output_objdir/$output_la.lnk
  9070. func_verbose "creating linker input file list: $output"
  9071. : > $output
  9072. set x $save_libobjs
  9073. shift
  9074. firstobj=
  9075. if test yes = "$compiler_needs_object"; then
  9076. firstobj="$1 "
  9077. shift
  9078. fi
  9079. for obj
  9080. do
  9081. func_to_tool_file "$obj"
  9082. $ECHO "$func_to_tool_file_result" >> $output
  9083. done
  9084. func_append delfiles " $output"
  9085. func_to_tool_file "$output"
  9086. output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
  9087. else
  9088. if test -n "$save_libobjs"; then
  9089. func_verbose "creating reloadable object files..."
  9090. output=$output_objdir/$output_la-$k.$objext
  9091. eval test_cmds=\"$reload_cmds\"
  9092. func_len " $test_cmds"
  9093. len0=$func_len_result
  9094. len=$len0
  9095. # Loop over the list of objects to be linked.
  9096. for obj in $save_libobjs
  9097. do
  9098. func_len " $obj"
  9099. func_arith $len + $func_len_result
  9100. len=$func_arith_result
  9101. if test -z "$objlist" ||
  9102. test "$len" -lt "$max_cmd_len"; then
  9103. func_append objlist " $obj"
  9104. else
  9105. # The command $test_cmds is almost too long, add a
  9106. # command to the queue.
  9107. if test 1 -eq "$k"; then
  9108. # The first file doesn't have a previous command to add.
  9109. reload_objs=$objlist
  9110. eval concat_cmds=\"$reload_cmds\"
  9111. else
  9112. # All subsequent reloadable object files will link in
  9113. # the last one created.
  9114. reload_objs="$objlist $last_robj"
  9115. eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
  9116. fi
  9117. last_robj=$output_objdir/$output_la-$k.$objext
  9118. func_arith $k + 1
  9119. k=$func_arith_result
  9120. output=$output_objdir/$output_la-$k.$objext
  9121. objlist=" $obj"
  9122. func_len " $last_robj"
  9123. func_arith $len0 + $func_len_result
  9124. len=$func_arith_result
  9125. fi
  9126. done
  9127. # Handle the remaining objects by creating one last
  9128. # reloadable object file. All subsequent reloadable object
  9129. # files will link in the last one created.
  9130. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9131. reload_objs="$objlist $last_robj"
  9132. eval concat_cmds=\"\$concat_cmds$reload_cmds\"
  9133. if test -n "$last_robj"; then
  9134. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9135. fi
  9136. func_append delfiles " $output"
  9137. else
  9138. output=
  9139. fi
  9140. ${skipped_export-false} && {
  9141. func_verbose "generating symbol list for '$libname.la'"
  9142. export_symbols=$output_objdir/$libname.exp
  9143. $opt_dry_run || $RM $export_symbols
  9144. libobjs=$output
  9145. # Append the command to create the export file.
  9146. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9147. eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  9148. if test -n "$last_robj"; then
  9149. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9150. fi
  9151. }
  9152. test -n "$save_libobjs" &&
  9153. func_verbose "creating a temporary reloadable object file: $output"
  9154. # Loop through the commands generated above and execute them.
  9155. save_ifs=$IFS; IFS='~'
  9156. for cmd in $concat_cmds; do
  9157. IFS=$save_ifs
  9158. $opt_quiet || {
  9159. func_quote_for_expand "$cmd"
  9160. eval "func_echo $func_quote_for_expand_result"
  9161. }
  9162. $opt_dry_run || eval "$cmd" || {
  9163. lt_exit=$?
  9164. # Restore the uninstalled library and exit
  9165. if test relink = "$opt_mode"; then
  9166. ( cd "$output_objdir" && \
  9167. $RM "${realname}T" && \
  9168. $MV "${realname}U" "$realname" )
  9169. fi
  9170. exit $lt_exit
  9171. }
  9172. done
  9173. IFS=$save_ifs
  9174. if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  9175. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9176. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9177. fi
  9178. fi
  9179. ${skipped_export-false} && {
  9180. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9181. tmp_export_symbols=$export_symbols
  9182. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9183. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9184. fi
  9185. if test -n "$orig_export_symbols"; then
  9186. # The given exports_symbols file has to be filtered, so filter it.
  9187. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9188. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9189. # 's' commands, which not all seds can handle. GNU sed should be fine
  9190. # though. Also, the filter scales superlinearly with the number of
  9191. # global variables. join(1) would be nice here, but unfortunately
  9192. # isn't a blessed tool.
  9193. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9194. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9195. export_symbols=$output_objdir/$libname.def
  9196. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9197. fi
  9198. }
  9199. libobjs=$output
  9200. # Restore the value of output.
  9201. output=$save_output
  9202. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  9203. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9204. test "X$libobjs" = "X " && libobjs=
  9205. fi
  9206. # Expand the library linking commands again to reset the
  9207. # value of $libobjs for piecewise linking.
  9208. # Do each of the archive commands.
  9209. if test yes = "$module" && test -n "$module_cmds"; then
  9210. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9211. cmds=$module_expsym_cmds
  9212. else
  9213. cmds=$module_cmds
  9214. fi
  9215. else
  9216. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9217. cmds=$archive_expsym_cmds
  9218. else
  9219. cmds=$archive_cmds
  9220. fi
  9221. fi
  9222. fi
  9223. if test -n "$delfiles"; then
  9224. # Append the command to remove temporary files to $cmds.
  9225. eval cmds=\"\$cmds~\$RM $delfiles\"
  9226. fi
  9227. # Add any objects from preloaded convenience libraries
  9228. if test -n "$dlprefiles"; then
  9229. gentop=$output_objdir/${outputname}x
  9230. func_append generated " $gentop"
  9231. func_extract_archives $gentop $dlprefiles
  9232. func_append libobjs " $func_extract_archives_result"
  9233. test "X$libobjs" = "X " && libobjs=
  9234. fi
  9235. save_ifs=$IFS; IFS='~'
  9236. for cmd in $cmds; do
  9237. IFS=$sp$nl
  9238. eval cmd=\"$cmd\"
  9239. IFS=$save_ifs
  9240. $opt_quiet || {
  9241. func_quote_for_expand "$cmd"
  9242. eval "func_echo $func_quote_for_expand_result"
  9243. }
  9244. $opt_dry_run || eval "$cmd" || {
  9245. lt_exit=$?
  9246. # Restore the uninstalled library and exit
  9247. if test relink = "$opt_mode"; then
  9248. ( cd "$output_objdir" && \
  9249. $RM "${realname}T" && \
  9250. $MV "${realname}U" "$realname" )
  9251. fi
  9252. exit $lt_exit
  9253. }
  9254. done
  9255. IFS=$save_ifs
  9256. # Restore the uninstalled library and exit
  9257. if test relink = "$opt_mode"; then
  9258. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  9259. if test -n "$convenience"; then
  9260. if test -z "$whole_archive_flag_spec"; then
  9261. func_show_eval '${RM}r "$gentop"'
  9262. fi
  9263. fi
  9264. exit $EXIT_SUCCESS
  9265. fi
  9266. # Create links to the real library.
  9267. for linkname in $linknames; do
  9268. if test "$realname" != "$linkname"; then
  9269. func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  9270. fi
  9271. done
  9272. # If -module or -export-dynamic was specified, set the dlname.
  9273. if test yes = "$module" || test yes = "$export_dynamic"; then
  9274. # On all known operating systems, these are identical.
  9275. dlname=$soname
  9276. fi
  9277. fi
  9278. ;;
  9279. obj)
  9280. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  9281. func_warning "'-dlopen' is ignored for objects"
  9282. fi
  9283. case " $deplibs" in
  9284. *\ -l* | *\ -L*)
  9285. func_warning "'-l' and '-L' are ignored for objects" ;;
  9286. esac
  9287. test -n "$rpath" && \
  9288. func_warning "'-rpath' is ignored for objects"
  9289. test -n "$xrpath" && \
  9290. func_warning "'-R' is ignored for objects"
  9291. test -n "$vinfo" && \
  9292. func_warning "'-version-info' is ignored for objects"
  9293. test -n "$release" && \
  9294. func_warning "'-release' is ignored for objects"
  9295. case $output in
  9296. *.lo)
  9297. test -n "$objs$old_deplibs" && \
  9298. func_fatal_error "cannot build library object '$output' from non-libtool objects"
  9299. libobj=$output
  9300. func_lo2o "$libobj"
  9301. obj=$func_lo2o_result
  9302. ;;
  9303. *)
  9304. libobj=
  9305. obj=$output
  9306. ;;
  9307. esac
  9308. # Delete the old objects.
  9309. $opt_dry_run || $RM $obj $libobj
  9310. # Objects from convenience libraries. This assumes
  9311. # single-version convenience libraries. Whenever we create
  9312. # different ones for PIC/non-PIC, this we'll have to duplicate
  9313. # the extraction.
  9314. reload_conv_objs=
  9315. gentop=
  9316. # if reload_cmds runs $LD directly, get rid of -Wl from
  9317. # whole_archive_flag_spec and hope we can get by with turning comma
  9318. # into space.
  9319. case $reload_cmds in
  9320. *\$LD[\ \$]*) wl= ;;
  9321. esac
  9322. if test -n "$convenience"; then
  9323. if test -n "$whole_archive_flag_spec"; then
  9324. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  9325. test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
  9326. reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
  9327. else
  9328. gentop=$output_objdir/${obj}x
  9329. func_append generated " $gentop"
  9330. func_extract_archives $gentop $convenience
  9331. reload_conv_objs="$reload_objs $func_extract_archives_result"
  9332. fi
  9333. fi
  9334. # If we're not building shared, we need to use non_pic_objs
  9335. test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
  9336. # Create the old-style object.
  9337. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
  9338. output=$obj
  9339. func_execute_cmds "$reload_cmds" 'exit $?'
  9340. # Exit if we aren't doing a library object file.
  9341. if test -z "$libobj"; then
  9342. if test -n "$gentop"; then
  9343. func_show_eval '${RM}r "$gentop"'
  9344. fi
  9345. exit $EXIT_SUCCESS
  9346. fi
  9347. test yes = "$build_libtool_libs" || {
  9348. if test -n "$gentop"; then
  9349. func_show_eval '${RM}r "$gentop"'
  9350. fi
  9351. # Create an invalid libtool object if no PIC, so that we don't
  9352. # accidentally link it into a program.
  9353. # $show "echo timestamp > $libobj"
  9354. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  9355. exit $EXIT_SUCCESS
  9356. }
  9357. if test -n "$pic_flag" || test default != "$pic_mode"; then
  9358. # Only do commands if we really have different PIC objects.
  9359. reload_objs="$libobjs $reload_conv_objs"
  9360. output=$libobj
  9361. func_execute_cmds "$reload_cmds" 'exit $?'
  9362. fi
  9363. if test -n "$gentop"; then
  9364. func_show_eval '${RM}r "$gentop"'
  9365. fi
  9366. exit $EXIT_SUCCESS
  9367. ;;
  9368. prog)
  9369. case $host in
  9370. *cygwin*) func_stripname '' '.exe' "$output"
  9371. output=$func_stripname_result.exe;;
  9372. esac
  9373. test -n "$vinfo" && \
  9374. func_warning "'-version-info' is ignored for programs"
  9375. test -n "$release" && \
  9376. func_warning "'-release' is ignored for programs"
  9377. $preload \
  9378. && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
  9379. && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
  9380. case $host in
  9381. *-*-rhapsody* | *-*-darwin1.[012])
  9382. # On Rhapsody replace the C library is the System framework
  9383. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9384. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9385. ;;
  9386. esac
  9387. case $host in
  9388. *-*-darwin*)
  9389. # Don't allow lazy linking, it breaks C++ global constructors
  9390. # But is supposedly fixed on 10.4 or later (yay!).
  9391. if test CXX = "$tagname"; then
  9392. case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  9393. 10.[0123])
  9394. func_append compile_command " $wl-bind_at_load"
  9395. func_append finalize_command " $wl-bind_at_load"
  9396. ;;
  9397. esac
  9398. fi
  9399. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  9400. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9401. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9402. ;;
  9403. esac
  9404. # move library search paths that coincide with paths to not yet
  9405. # installed libraries to the beginning of the library search list
  9406. new_libs=
  9407. for path in $notinst_path; do
  9408. case " $new_libs " in
  9409. *" -L$path/$objdir "*) ;;
  9410. *)
  9411. case " $compile_deplibs " in
  9412. *" -L$path/$objdir "*)
  9413. func_append new_libs " -L$path/$objdir" ;;
  9414. esac
  9415. ;;
  9416. esac
  9417. done
  9418. for deplib in $compile_deplibs; do
  9419. case $deplib in
  9420. -L*)
  9421. case " $new_libs " in
  9422. *" $deplib "*) ;;
  9423. *) func_append new_libs " $deplib" ;;
  9424. esac
  9425. ;;
  9426. *) func_append new_libs " $deplib" ;;
  9427. esac
  9428. done
  9429. compile_deplibs=$new_libs
  9430. func_append compile_command " $compile_deplibs"
  9431. func_append finalize_command " $finalize_deplibs"
  9432. if test -n "$rpath$xrpath"; then
  9433. # If the user specified any rpath flags, then add them.
  9434. for libdir in $rpath $xrpath; do
  9435. # This is the magic to use -rpath.
  9436. case "$finalize_rpath " in
  9437. *" $libdir "*) ;;
  9438. *) func_append finalize_rpath " $libdir" ;;
  9439. esac
  9440. done
  9441. fi
  9442. # Now hardcode the library paths
  9443. rpath=
  9444. hardcode_libdirs=
  9445. for libdir in $compile_rpath $finalize_rpath; do
  9446. if test -n "$hardcode_libdir_flag_spec"; then
  9447. if test -n "$hardcode_libdir_separator"; then
  9448. if test -z "$hardcode_libdirs"; then
  9449. hardcode_libdirs=$libdir
  9450. else
  9451. # Just accumulate the unique libdirs.
  9452. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9453. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9454. ;;
  9455. *)
  9456. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9457. ;;
  9458. esac
  9459. fi
  9460. else
  9461. eval flag=\"$hardcode_libdir_flag_spec\"
  9462. func_append rpath " $flag"
  9463. fi
  9464. elif test -n "$runpath_var"; then
  9465. case "$perm_rpath " in
  9466. *" $libdir "*) ;;
  9467. *) func_append perm_rpath " $libdir" ;;
  9468. esac
  9469. fi
  9470. case $host in
  9471. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  9472. testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
  9473. case :$dllsearchpath: in
  9474. *":$libdir:"*) ;;
  9475. ::) dllsearchpath=$libdir;;
  9476. *) func_append dllsearchpath ":$libdir";;
  9477. esac
  9478. case :$dllsearchpath: in
  9479. *":$testbindir:"*) ;;
  9480. ::) dllsearchpath=$testbindir;;
  9481. *) func_append dllsearchpath ":$testbindir";;
  9482. esac
  9483. ;;
  9484. esac
  9485. done
  9486. # Substitute the hardcoded libdirs into the rpath.
  9487. if test -n "$hardcode_libdir_separator" &&
  9488. test -n "$hardcode_libdirs"; then
  9489. libdir=$hardcode_libdirs
  9490. eval rpath=\" $hardcode_libdir_flag_spec\"
  9491. fi
  9492. compile_rpath=$rpath
  9493. rpath=
  9494. hardcode_libdirs=
  9495. for libdir in $finalize_rpath; do
  9496. if test -n "$hardcode_libdir_flag_spec"; then
  9497. if test -n "$hardcode_libdir_separator"; then
  9498. if test -z "$hardcode_libdirs"; then
  9499. hardcode_libdirs=$libdir
  9500. else
  9501. # Just accumulate the unique libdirs.
  9502. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9503. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9504. ;;
  9505. *)
  9506. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9507. ;;
  9508. esac
  9509. fi
  9510. else
  9511. eval flag=\"$hardcode_libdir_flag_spec\"
  9512. func_append rpath " $flag"
  9513. fi
  9514. elif test -n "$runpath_var"; then
  9515. case "$finalize_perm_rpath " in
  9516. *" $libdir "*) ;;
  9517. *) func_append finalize_perm_rpath " $libdir" ;;
  9518. esac
  9519. fi
  9520. done
  9521. # Substitute the hardcoded libdirs into the rpath.
  9522. if test -n "$hardcode_libdir_separator" &&
  9523. test -n "$hardcode_libdirs"; then
  9524. libdir=$hardcode_libdirs
  9525. eval rpath=\" $hardcode_libdir_flag_spec\"
  9526. fi
  9527. finalize_rpath=$rpath
  9528. if test -n "$libobjs" && test yes = "$build_old_libs"; then
  9529. # Transform all the library objects into standard objects.
  9530. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9531. finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9532. fi
  9533. func_generate_dlsyms "$outputname" "@PROGRAM@" false
  9534. # template prelinking step
  9535. if test -n "$prelink_cmds"; then
  9536. func_execute_cmds "$prelink_cmds" 'exit $?'
  9537. fi
  9538. wrappers_required=:
  9539. case $host in
  9540. *cegcc* | *mingw32ce*)
  9541. # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
  9542. wrappers_required=false
  9543. ;;
  9544. *cygwin* | *mingw* )
  9545. test yes = "$build_libtool_libs" || wrappers_required=false
  9546. ;;
  9547. *)
  9548. if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
  9549. wrappers_required=false
  9550. fi
  9551. ;;
  9552. esac
  9553. $wrappers_required || {
  9554. # Replace the output file specification.
  9555. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9556. link_command=$compile_command$compile_rpath
  9557. # We have no uninstalled library dependencies, so finalize right now.
  9558. exit_status=0
  9559. func_show_eval "$link_command" 'exit_status=$?'
  9560. if test -n "$postlink_cmds"; then
  9561. func_to_tool_file "$output"
  9562. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9563. func_execute_cmds "$postlink_cmds" 'exit $?'
  9564. fi
  9565. # Delete the generated files.
  9566. if test -f "$output_objdir/${outputname}S.$objext"; then
  9567. func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
  9568. fi
  9569. exit $exit_status
  9570. }
  9571. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  9572. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  9573. fi
  9574. if test -n "$finalize_shlibpath"; then
  9575. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  9576. fi
  9577. compile_var=
  9578. finalize_var=
  9579. if test -n "$runpath_var"; then
  9580. if test -n "$perm_rpath"; then
  9581. # We should set the runpath_var.
  9582. rpath=
  9583. for dir in $perm_rpath; do
  9584. func_append rpath "$dir:"
  9585. done
  9586. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9587. fi
  9588. if test -n "$finalize_perm_rpath"; then
  9589. # We should set the runpath_var.
  9590. rpath=
  9591. for dir in $finalize_perm_rpath; do
  9592. func_append rpath "$dir:"
  9593. done
  9594. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9595. fi
  9596. fi
  9597. if test yes = "$no_install"; then
  9598. # We don't need to create a wrapper script.
  9599. link_command=$compile_var$compile_command$compile_rpath
  9600. # Replace the output file specification.
  9601. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9602. # Delete the old output file.
  9603. $opt_dry_run || $RM $output
  9604. # Link the executable and exit
  9605. func_show_eval "$link_command" 'exit $?'
  9606. if test -n "$postlink_cmds"; then
  9607. func_to_tool_file "$output"
  9608. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9609. func_execute_cmds "$postlink_cmds" 'exit $?'
  9610. fi
  9611. exit $EXIT_SUCCESS
  9612. fi
  9613. case $hardcode_action,$fast_install in
  9614. relink,*)
  9615. # Fast installation is not supported
  9616. link_command=$compile_var$compile_command$compile_rpath
  9617. relink_command=$finalize_var$finalize_command$finalize_rpath
  9618. func_warning "this platform does not like uninstalled shared libraries"
  9619. func_warning "'$output' will be relinked during installation"
  9620. ;;
  9621. *,yes)
  9622. link_command=$finalize_var$compile_command$finalize_rpath
  9623. relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
  9624. ;;
  9625. *,no)
  9626. link_command=$compile_var$compile_command$compile_rpath
  9627. relink_command=$finalize_var$finalize_command$finalize_rpath
  9628. ;;
  9629. *,needless)
  9630. link_command=$finalize_var$compile_command$finalize_rpath
  9631. relink_command=
  9632. ;;
  9633. esac
  9634. # Replace the output file specification.
  9635. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  9636. # Delete the old output files.
  9637. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  9638. func_show_eval "$link_command" 'exit $?'
  9639. if test -n "$postlink_cmds"; then
  9640. func_to_tool_file "$output_objdir/$outputname"
  9641. 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'`
  9642. func_execute_cmds "$postlink_cmds" 'exit $?'
  9643. fi
  9644. # Now create the wrapper script.
  9645. func_verbose "creating $output"
  9646. # Quote the relink command for shipping.
  9647. if test -n "$relink_command"; then
  9648. # Preserve any variables that may affect compiler behavior
  9649. for var in $variables_saved_for_relink; do
  9650. if eval test -z \"\${$var+set}\"; then
  9651. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  9652. elif eval var_value=\$$var; test -z "$var_value"; then
  9653. relink_command="$var=; export $var; $relink_command"
  9654. else
  9655. func_quote_for_eval "$var_value"
  9656. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  9657. fi
  9658. done
  9659. relink_command="(cd `pwd`; $relink_command)"
  9660. relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  9661. fi
  9662. # Only actually do things if not in dry run mode.
  9663. $opt_dry_run || {
  9664. # win32 will think the script is a binary if it has
  9665. # a .exe suffix, so we strip it off here.
  9666. case $output in
  9667. *.exe) func_stripname '' '.exe' "$output"
  9668. output=$func_stripname_result ;;
  9669. esac
  9670. # test for cygwin because mv fails w/o .exe extensions
  9671. case $host in
  9672. *cygwin*)
  9673. exeext=.exe
  9674. func_stripname '' '.exe' "$outputname"
  9675. outputname=$func_stripname_result ;;
  9676. *) exeext= ;;
  9677. esac
  9678. case $host in
  9679. *cygwin* | *mingw* )
  9680. func_dirname_and_basename "$output" "" "."
  9681. output_name=$func_basename_result
  9682. output_path=$func_dirname_result
  9683. cwrappersource=$output_path/$objdir/lt-$output_name.c
  9684. cwrapper=$output_path/$output_name.exe
  9685. $RM $cwrappersource $cwrapper
  9686. trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  9687. func_emit_cwrapperexe_src > $cwrappersource
  9688. # The wrapper executable is built using the $host compiler,
  9689. # because it contains $host paths and files. If cross-
  9690. # compiling, it, like the target executable, must be
  9691. # executed on the $host or under an emulation environment.
  9692. $opt_dry_run || {
  9693. $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  9694. $STRIP $cwrapper
  9695. }
  9696. # Now, create the wrapper script for func_source use:
  9697. func_ltwrapper_scriptname $cwrapper
  9698. $RM $func_ltwrapper_scriptname_result
  9699. trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  9700. $opt_dry_run || {
  9701. # note: this script will not be executed, so do not chmod.
  9702. if test "x$build" = "x$host"; then
  9703. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  9704. else
  9705. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  9706. fi
  9707. }
  9708. ;;
  9709. * )
  9710. $RM $output
  9711. trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  9712. func_emit_wrapper no > $output
  9713. chmod +x $output
  9714. ;;
  9715. esac
  9716. }
  9717. exit $EXIT_SUCCESS
  9718. ;;
  9719. esac
  9720. # See if we need to build an old-fashioned archive.
  9721. for oldlib in $oldlibs; do
  9722. case $build_libtool_libs in
  9723. convenience)
  9724. oldobjs="$libobjs_save $symfileobj"
  9725. addlibs=$convenience
  9726. build_libtool_libs=no
  9727. ;;
  9728. module)
  9729. oldobjs=$libobjs_save
  9730. addlibs=$old_convenience
  9731. build_libtool_libs=no
  9732. ;;
  9733. *)
  9734. oldobjs="$old_deplibs $non_pic_objects"
  9735. $preload && test -f "$symfileobj" \
  9736. && func_append oldobjs " $symfileobj"
  9737. addlibs=$old_convenience
  9738. ;;
  9739. esac
  9740. if test -n "$addlibs"; then
  9741. gentop=$output_objdir/${outputname}x
  9742. func_append generated " $gentop"
  9743. func_extract_archives $gentop $addlibs
  9744. func_append oldobjs " $func_extract_archives_result"
  9745. fi
  9746. # Do each command in the archive commands.
  9747. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
  9748. cmds=$old_archive_from_new_cmds
  9749. else
  9750. # Add any objects from preloaded convenience libraries
  9751. if test -n "$dlprefiles"; then
  9752. gentop=$output_objdir/${outputname}x
  9753. func_append generated " $gentop"
  9754. func_extract_archives $gentop $dlprefiles
  9755. func_append oldobjs " $func_extract_archives_result"
  9756. fi
  9757. # POSIX demands no paths to be encoded in archives. We have
  9758. # to avoid creating archives with duplicate basenames if we
  9759. # might have to extract them afterwards, e.g., when creating a
  9760. # static archive out of a convenience library, or when linking
  9761. # the entirety of a libtool archive into another (currently
  9762. # not supported by libtool).
  9763. if (for obj in $oldobjs
  9764. do
  9765. func_basename "$obj"
  9766. $ECHO "$func_basename_result"
  9767. done | sort | sort -uc >/dev/null 2>&1); then
  9768. :
  9769. else
  9770. echo "copying selected object files to avoid basename conflicts..."
  9771. gentop=$output_objdir/${outputname}x
  9772. func_append generated " $gentop"
  9773. func_mkdir_p "$gentop"
  9774. save_oldobjs=$oldobjs
  9775. oldobjs=
  9776. counter=1
  9777. for obj in $save_oldobjs
  9778. do
  9779. func_basename "$obj"
  9780. objbase=$func_basename_result
  9781. case " $oldobjs " in
  9782. " ") oldobjs=$obj ;;
  9783. *[\ /]"$objbase "*)
  9784. while :; do
  9785. # Make sure we don't pick an alternate name that also
  9786. # overlaps.
  9787. newobj=lt$counter-$objbase
  9788. func_arith $counter + 1
  9789. counter=$func_arith_result
  9790. case " $oldobjs " in
  9791. *[\ /]"$newobj "*) ;;
  9792. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  9793. esac
  9794. done
  9795. func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  9796. func_append oldobjs " $gentop/$newobj"
  9797. ;;
  9798. *) func_append oldobjs " $obj" ;;
  9799. esac
  9800. done
  9801. fi
  9802. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  9803. tool_oldlib=$func_to_tool_file_result
  9804. eval cmds=\"$old_archive_cmds\"
  9805. func_len " $cmds"
  9806. len=$func_len_result
  9807. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9808. cmds=$old_archive_cmds
  9809. elif test -n "$archiver_list_spec"; then
  9810. func_verbose "using command file archive linking..."
  9811. for obj in $oldobjs
  9812. do
  9813. func_to_tool_file "$obj"
  9814. $ECHO "$func_to_tool_file_result"
  9815. done > $output_objdir/$libname.libcmd
  9816. func_to_tool_file "$output_objdir/$libname.libcmd"
  9817. oldobjs=" $archiver_list_spec$func_to_tool_file_result"
  9818. cmds=$old_archive_cmds
  9819. else
  9820. # the command line is too long to link in one step, link in parts
  9821. func_verbose "using piecewise archive linking..."
  9822. save_RANLIB=$RANLIB
  9823. RANLIB=:
  9824. objlist=
  9825. concat_cmds=
  9826. save_oldobjs=$oldobjs
  9827. oldobjs=
  9828. # Is there a better way of finding the last object in the list?
  9829. for obj in $save_oldobjs
  9830. do
  9831. last_oldobj=$obj
  9832. done
  9833. eval test_cmds=\"$old_archive_cmds\"
  9834. func_len " $test_cmds"
  9835. len0=$func_len_result
  9836. len=$len0
  9837. for obj in $save_oldobjs
  9838. do
  9839. func_len " $obj"
  9840. func_arith $len + $func_len_result
  9841. len=$func_arith_result
  9842. func_append objlist " $obj"
  9843. if test "$len" -lt "$max_cmd_len"; then
  9844. :
  9845. else
  9846. # the above command should be used before it gets too long
  9847. oldobjs=$objlist
  9848. if test "$obj" = "$last_oldobj"; then
  9849. RANLIB=$save_RANLIB
  9850. fi
  9851. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9852. eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
  9853. objlist=
  9854. len=$len0
  9855. fi
  9856. done
  9857. RANLIB=$save_RANLIB
  9858. oldobjs=$objlist
  9859. if test -z "$oldobjs"; then
  9860. eval cmds=\"\$concat_cmds\"
  9861. else
  9862. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  9863. fi
  9864. fi
  9865. fi
  9866. func_execute_cmds "$cmds" 'exit $?'
  9867. done
  9868. test -n "$generated" && \
  9869. func_show_eval "${RM}r$generated"
  9870. # Now create the libtool archive.
  9871. case $output in
  9872. *.la)
  9873. old_library=
  9874. test yes = "$build_old_libs" && old_library=$libname.$libext
  9875. func_verbose "creating $output"
  9876. # Preserve any variables that may affect compiler behavior
  9877. for var in $variables_saved_for_relink; do
  9878. if eval test -z \"\${$var+set}\"; then
  9879. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  9880. elif eval var_value=\$$var; test -z "$var_value"; then
  9881. relink_command="$var=; export $var; $relink_command"
  9882. else
  9883. func_quote_for_eval "$var_value"
  9884. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  9885. fi
  9886. done
  9887. # Quote the link command for shipping.
  9888. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  9889. relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  9890. if test yes = "$hardcode_automatic"; then
  9891. relink_command=
  9892. fi
  9893. # Only create the output if not a dry run.
  9894. $opt_dry_run || {
  9895. for installed in no yes; do
  9896. if test yes = "$installed"; then
  9897. if test -z "$install_libdir"; then
  9898. break
  9899. fi
  9900. output=$output_objdir/${outputname}i
  9901. # Replace all uninstalled libtool libraries with the installed ones
  9902. newdependency_libs=
  9903. for deplib in $dependency_libs; do
  9904. case $deplib in
  9905. *.la)
  9906. func_basename "$deplib"
  9907. name=$func_basename_result
  9908. func_resolve_sysroot "$deplib"
  9909. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
  9910. test -z "$libdir" && \
  9911. func_fatal_error "'$deplib' is not a valid libtool archive"
  9912. func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
  9913. ;;
  9914. -L*)
  9915. func_stripname -L '' "$deplib"
  9916. func_replace_sysroot "$func_stripname_result"
  9917. func_append newdependency_libs " -L$func_replace_sysroot_result"
  9918. ;;
  9919. -R*)
  9920. func_stripname -R '' "$deplib"
  9921. func_replace_sysroot "$func_stripname_result"
  9922. func_append newdependency_libs " -R$func_replace_sysroot_result"
  9923. ;;
  9924. *) func_append newdependency_libs " $deplib" ;;
  9925. esac
  9926. done
  9927. dependency_libs=$newdependency_libs
  9928. newdlfiles=
  9929. for lib in $dlfiles; do
  9930. case $lib in
  9931. *.la)
  9932. func_basename "$lib"
  9933. name=$func_basename_result
  9934. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  9935. test -z "$libdir" && \
  9936. func_fatal_error "'$lib' is not a valid libtool archive"
  9937. func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
  9938. ;;
  9939. *) func_append newdlfiles " $lib" ;;
  9940. esac
  9941. done
  9942. dlfiles=$newdlfiles
  9943. newdlprefiles=
  9944. for lib in $dlprefiles; do
  9945. case $lib in
  9946. *.la)
  9947. # Only pass preopened files to the pseudo-archive (for
  9948. # eventual linking with the app. that links it) if we
  9949. # didn't already link the preopened objects directly into
  9950. # the library:
  9951. func_basename "$lib"
  9952. name=$func_basename_result
  9953. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  9954. test -z "$libdir" && \
  9955. func_fatal_error "'$lib' is not a valid libtool archive"
  9956. func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
  9957. ;;
  9958. esac
  9959. done
  9960. dlprefiles=$newdlprefiles
  9961. else
  9962. newdlfiles=
  9963. for lib in $dlfiles; do
  9964. case $lib in
  9965. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  9966. *) abs=`pwd`"/$lib" ;;
  9967. esac
  9968. func_append newdlfiles " $abs"
  9969. done
  9970. dlfiles=$newdlfiles
  9971. newdlprefiles=
  9972. for lib in $dlprefiles; do
  9973. case $lib in
  9974. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  9975. *) abs=`pwd`"/$lib" ;;
  9976. esac
  9977. func_append newdlprefiles " $abs"
  9978. done
  9979. dlprefiles=$newdlprefiles
  9980. fi
  9981. $RM $output
  9982. # place dlname in correct position for cygwin
  9983. # In fact, it would be nice if we could use this code for all target
  9984. # systems that can't hard-code library paths into their executables
  9985. # and that have no shared library path variable independent of PATH,
  9986. # but it turns out we can't easily determine that from inspecting
  9987. # libtool variables, so we have to hard-code the OSs to which it
  9988. # applies here; at the moment, that means platforms that use the PE
  9989. # object format with DLL files. See the long comment at the top of
  9990. # tests/bindir.at for full details.
  9991. tdlname=$dlname
  9992. case $host,$output,$installed,$module,$dlname in
  9993. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
  9994. # If a -bindir argument was supplied, place the dll there.
  9995. if test -n "$bindir"; then
  9996. func_relative_path "$install_libdir" "$bindir"
  9997. tdlname=$func_relative_path_result/$dlname
  9998. else
  9999. # Otherwise fall back on heuristic.
  10000. tdlname=../bin/$dlname
  10001. fi
  10002. ;;
  10003. esac
  10004. $ECHO > $output "\
  10005. # $outputname - a libtool library file
  10006. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  10007. #
  10008. # Please DO NOT delete this file!
  10009. # It is necessary for linking the library.
  10010. # The name that we can dlopen(3).
  10011. dlname='$tdlname'
  10012. # Names of this library.
  10013. library_names='$library_names'
  10014. # The name of the static archive.
  10015. old_library='$old_library'
  10016. # Linker flags that cannot go in dependency_libs.
  10017. inherited_linker_flags='$new_inherited_linker_flags'
  10018. # Libraries that this one depends upon.
  10019. dependency_libs='$dependency_libs'
  10020. # Names of additional weak libraries provided by this library
  10021. weak_library_names='$weak_libs'
  10022. # Version information for $libname.
  10023. current=$current
  10024. age=$age
  10025. revision=$revision
  10026. # Is this an already installed library?
  10027. installed=$installed
  10028. # Should we warn about portability when linking against -modules?
  10029. shouldnotlink=$module
  10030. # Files to dlopen/dlpreopen
  10031. dlopen='$dlfiles'
  10032. dlpreopen='$dlprefiles'
  10033. # Directory that this library needs to be installed in:
  10034. libdir='$install_libdir'"
  10035. if test no,yes = "$installed,$need_relink"; then
  10036. $ECHO >> $output "\
  10037. relink_command=\"$relink_command\""
  10038. fi
  10039. done
  10040. }
  10041. # Do a symbolic link so that the libtool archive can be found in
  10042. # LD_LIBRARY_PATH before the program is installed.
  10043. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  10044. ;;
  10045. esac
  10046. exit $EXIT_SUCCESS
  10047. }
  10048. if test link = "$opt_mode" || test relink = "$opt_mode"; then
  10049. func_mode_link ${1+"$@"}
  10050. fi
  10051. # func_mode_uninstall arg...
  10052. func_mode_uninstall ()
  10053. {
  10054. $debug_cmd
  10055. RM=$nonopt
  10056. files=
  10057. rmforce=false
  10058. exit_status=0
  10059. # This variable tells wrapper scripts just to set variables rather
  10060. # than running their programs.
  10061. libtool_install_magic=$magic
  10062. for arg
  10063. do
  10064. case $arg in
  10065. -f) func_append RM " $arg"; rmforce=: ;;
  10066. -*) func_append RM " $arg" ;;
  10067. *) func_append files " $arg" ;;
  10068. esac
  10069. done
  10070. test -z "$RM" && \
  10071. func_fatal_help "you must specify an RM program"
  10072. rmdirs=
  10073. for file in $files; do
  10074. func_dirname "$file" "" "."
  10075. dir=$func_dirname_result
  10076. if test . = "$dir"; then
  10077. odir=$objdir
  10078. else
  10079. odir=$dir/$objdir
  10080. fi
  10081. func_basename "$file"
  10082. name=$func_basename_result
  10083. test uninstall = "$opt_mode" && odir=$dir
  10084. # Remember odir for removal later, being careful to avoid duplicates
  10085. if test clean = "$opt_mode"; then
  10086. case " $rmdirs " in
  10087. *" $odir "*) ;;
  10088. *) func_append rmdirs " $odir" ;;
  10089. esac
  10090. fi
  10091. # Don't error if the file doesn't exist and rm -f was used.
  10092. if { test -L "$file"; } >/dev/null 2>&1 ||
  10093. { test -h "$file"; } >/dev/null 2>&1 ||
  10094. test -f "$file"; then
  10095. :
  10096. elif test -d "$file"; then
  10097. exit_status=1
  10098. continue
  10099. elif $rmforce; then
  10100. continue
  10101. fi
  10102. rmfiles=$file
  10103. case $name in
  10104. *.la)
  10105. # Possibly a libtool archive, so verify it.
  10106. if func_lalib_p "$file"; then
  10107. func_source $dir/$name
  10108. # Delete the libtool libraries and symlinks.
  10109. for n in $library_names; do
  10110. func_append rmfiles " $odir/$n"
  10111. done
  10112. test -n "$old_library" && func_append rmfiles " $odir/$old_library"
  10113. case $opt_mode in
  10114. clean)
  10115. case " $library_names " in
  10116. *" $dlname "*) ;;
  10117. *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
  10118. esac
  10119. test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
  10120. ;;
  10121. uninstall)
  10122. if test -n "$library_names"; then
  10123. # Do each command in the postuninstall commands.
  10124. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
  10125. fi
  10126. if test -n "$old_library"; then
  10127. # Do each command in the old_postuninstall commands.
  10128. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
  10129. fi
  10130. # FIXME: should reinstall the best remaining shared library.
  10131. ;;
  10132. esac
  10133. fi
  10134. ;;
  10135. *.lo)
  10136. # Possibly a libtool object, so verify it.
  10137. if func_lalib_p "$file"; then
  10138. # Read the .lo file
  10139. func_source $dir/$name
  10140. # Add PIC object to the list of files to remove.
  10141. if test -n "$pic_object" && test none != "$pic_object"; then
  10142. func_append rmfiles " $dir/$pic_object"
  10143. fi
  10144. # Add non-PIC object to the list of files to remove.
  10145. if test -n "$non_pic_object" && test none != "$non_pic_object"; then
  10146. func_append rmfiles " $dir/$non_pic_object"
  10147. fi
  10148. fi
  10149. ;;
  10150. *)
  10151. if test clean = "$opt_mode"; then
  10152. noexename=$name
  10153. case $file in
  10154. *.exe)
  10155. func_stripname '' '.exe' "$file"
  10156. file=$func_stripname_result
  10157. func_stripname '' '.exe' "$name"
  10158. noexename=$func_stripname_result
  10159. # $file with .exe has already been added to rmfiles,
  10160. # add $file without .exe
  10161. func_append rmfiles " $file"
  10162. ;;
  10163. esac
  10164. # Do a test to see if this is a libtool program.
  10165. if func_ltwrapper_p "$file"; then
  10166. if func_ltwrapper_executable_p "$file"; then
  10167. func_ltwrapper_scriptname "$file"
  10168. relink_command=
  10169. func_source $func_ltwrapper_scriptname_result
  10170. func_append rmfiles " $func_ltwrapper_scriptname_result"
  10171. else
  10172. relink_command=
  10173. func_source $dir/$noexename
  10174. fi
  10175. # note $name still contains .exe if it was in $file originally
  10176. # as does the version of $file that was added into $rmfiles
  10177. func_append rmfiles " $odir/$name $odir/${name}S.$objext"
  10178. if test yes = "$fast_install" && test -n "$relink_command"; then
  10179. func_append rmfiles " $odir/lt-$name"
  10180. fi
  10181. if test "X$noexename" != "X$name"; then
  10182. func_append rmfiles " $odir/lt-$noexename.c"
  10183. fi
  10184. fi
  10185. fi
  10186. ;;
  10187. esac
  10188. func_show_eval "$RM $rmfiles" 'exit_status=1'
  10189. done
  10190. # Try to remove the $objdir's in the directories where we deleted files
  10191. for dir in $rmdirs; do
  10192. if test -d "$dir"; then
  10193. func_show_eval "rmdir $dir >/dev/null 2>&1"
  10194. fi
  10195. done
  10196. exit $exit_status
  10197. }
  10198. if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
  10199. func_mode_uninstall ${1+"$@"}
  10200. fi
  10201. test -z "$opt_mode" && {
  10202. help=$generic_help
  10203. func_fatal_help "you must specify a MODE"
  10204. }
  10205. test -z "$exec_cmd" && \
  10206. func_fatal_help "invalid operation mode '$opt_mode'"
  10207. if test -n "$exec_cmd"; then
  10208. eval exec "$exec_cmd"
  10209. exit $EXIT_FAILURE
  10210. fi
  10211. exit $exit_status
  10212. # The TAGs below are defined such that we never get into a situation
  10213. # where we disable both kinds of libraries. Given conflicting
  10214. # choices, we go for a static library, that is the most portable,
  10215. # since we can't tell whether shared libraries were disabled because
  10216. # the user asked for that or because the platform doesn't support
  10217. # them. This is particularly important on AIX, because we don't
  10218. # support having both static and shared libraries enabled at the same
  10219. # time on that platform, so we default to a shared-only configuration.
  10220. # If a disable-shared tag is given, we'll fallback to a static-only
  10221. # configuration. But we'll never go from static-only to shared-only.
  10222. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  10223. build_libtool_libs=no
  10224. build_old_libs=yes
  10225. # ### END LIBTOOL TAG CONFIG: disable-shared
  10226. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  10227. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  10228. # ### END LIBTOOL TAG CONFIG: disable-static
  10229. # Local Variables:
  10230. # mode:shell-script
  10231. # sh-indentation:2
  10232. # End:
  10233. # ### BEGIN LIBTOOL TAG CONFIG: CXX
  10234. # The linker used to build libraries.
  10235. LD="/usr/bin/ld -m elf_x86_64"
  10236. # How to create reloadable object files.
  10237. reload_flag=" -r"
  10238. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10239. # Commands used to build an old-style archive.
  10240. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10241. # A language specific compiler.
  10242. CC="g++"
  10243. # Is the compiler the GNU compiler?
  10244. with_gcc=yes
  10245. # Compiler flag to turn off builtin functions.
  10246. no_builtin_flag=" -fno-builtin"
  10247. # Additional compiler flags for building library objects.
  10248. pic_flag=" -fPIC -DPIC"
  10249. # How to pass a linker flag through the compiler.
  10250. wl="-Wl,"
  10251. # Compiler flag to prevent dynamic linking.
  10252. link_static_flag="-static"
  10253. # Does compiler simultaneously support -c and -o options?
  10254. compiler_c_o="yes"
  10255. # Whether or not to add -lc for building shared libraries.
  10256. build_libtool_need_lc=no
  10257. # Whether or not to disallow shared libs when runtime libs are static.
  10258. allow_libtool_libs_with_static_runtimes=no
  10259. # Compiler flag to allow reflexive dlopens.
  10260. export_dynamic_flag_spec="\$wl--export-dynamic"
  10261. # Compiler flag to generate shared objects directly from archives.
  10262. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  10263. # Whether the compiler copes with passing no objects directly.
  10264. compiler_needs_object="no"
  10265. # Create an old-style archive from a shared archive.
  10266. old_archive_from_new_cmds=""
  10267. # Create a temporary old-style archive to link instead of a shared archive.
  10268. old_archive_from_expsyms_cmds=""
  10269. # Commands used to build a shared archive.
  10270. archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  10271. 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"
  10272. # Commands used to build a loadable module if different from building
  10273. # a shared archive.
  10274. module_cmds=""
  10275. module_expsym_cmds=""
  10276. # Whether we are building with GNU ld or not.
  10277. with_gnu_ld="yes"
  10278. # Flag that allows shared libraries with undefined symbols to be built.
  10279. allow_undefined_flag=""
  10280. # Flag that enforces no undefined symbols.
  10281. no_undefined_flag=""
  10282. # Flag to hardcode $libdir into a binary during linking.
  10283. # This must work even if $libdir does not exist
  10284. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  10285. # Whether we need a single "-rpath" flag with a separated argument.
  10286. hardcode_libdir_separator=""
  10287. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10288. # DIR into the resulting binary.
  10289. hardcode_direct=no
  10290. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10291. # DIR into the resulting binary and the resulting library dependency is
  10292. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10293. # library is relocated.
  10294. hardcode_direct_absolute=no
  10295. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10296. # into the resulting binary.
  10297. hardcode_minus_L=no
  10298. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10299. # into the resulting binary.
  10300. hardcode_shlibpath_var=unsupported
  10301. # Set to "yes" if building a shared library automatically hardcodes DIR
  10302. # into the library and all subsequent libraries and executables linked
  10303. # against it.
  10304. hardcode_automatic=no
  10305. # Set to yes if linker adds runtime paths of dependent libraries
  10306. # to runtime path list.
  10307. inherit_rpath=no
  10308. # Whether libtool must link a program against all its dependency libraries.
  10309. link_all_deplibs=no
  10310. # Set to "yes" if exported symbols are required.
  10311. always_export_symbols=no
  10312. # The commands to list exported symbols.
  10313. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  10314. # Symbols that should not be listed in the preloaded symbols.
  10315. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  10316. # Symbols that must always be exported.
  10317. include_expsyms=""
  10318. # Commands necessary for linking programs (against libraries) with templates.
  10319. prelink_cmds=""
  10320. # Commands necessary for finishing linking programs.
  10321. postlink_cmds=""
  10322. # Specify filename containing input files.
  10323. file_list_spec=""
  10324. # How to hardcode a shared library path into an executable.
  10325. hardcode_action=immediate
  10326. # The directories searched by this compiler when creating a shared library.
  10327. compiler_lib_search_dirs="/home/makni/starpu/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/7 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /home/makni/starpu/lib . /usr/lib/gcc/x86_64-linux-gnu/7/../../.."
  10328. # Dependencies to place before and after the objects being linked to
  10329. # create a shared library.
  10330. predep_objects="/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o"
  10331. postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o"
  10332. predeps=""
  10333. postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
  10334. # The library search path used internally by the compiler when linking
  10335. # a shared library.
  10336. compiler_lib_search_path="-L/home/makni/starpu/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/home/makni/starpu/lib -L. -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.."
  10337. # ### END LIBTOOL TAG CONFIG: CXX
  10338. # ### BEGIN LIBTOOL TAG CONFIG: F77
  10339. # The linker used to build libraries.
  10340. LD=""
  10341. # How to create reloadable object files.
  10342. reload_flag=" -r"
  10343. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10344. # Commands used to build an old-style archive.
  10345. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10346. # A language specific compiler.
  10347. CC=""
  10348. # Is the compiler the GNU compiler?
  10349. with_gcc=
  10350. # Compiler flag to turn off builtin functions.
  10351. no_builtin_flag=""
  10352. # Additional compiler flags for building library objects.
  10353. pic_flag=""
  10354. # How to pass a linker flag through the compiler.
  10355. wl=""
  10356. # Compiler flag to prevent dynamic linking.
  10357. link_static_flag=""
  10358. # Does compiler simultaneously support -c and -o options?
  10359. compiler_c_o=""
  10360. # Whether or not to add -lc for building shared libraries.
  10361. build_libtool_need_lc=no
  10362. # Whether or not to disallow shared libs when runtime libs are static.
  10363. allow_libtool_libs_with_static_runtimes=no
  10364. # Compiler flag to allow reflexive dlopens.
  10365. export_dynamic_flag_spec=""
  10366. # Compiler flag to generate shared objects directly from archives.
  10367. whole_archive_flag_spec=""
  10368. # Whether the compiler copes with passing no objects directly.
  10369. compiler_needs_object=""
  10370. # Create an old-style archive from a shared archive.
  10371. old_archive_from_new_cmds=""
  10372. # Create a temporary old-style archive to link instead of a shared archive.
  10373. old_archive_from_expsyms_cmds=""
  10374. # Commands used to build a shared archive.
  10375. archive_cmds=""
  10376. archive_expsym_cmds=""
  10377. # Commands used to build a loadable module if different from building
  10378. # a shared archive.
  10379. module_cmds=""
  10380. module_expsym_cmds=""
  10381. # Whether we are building with GNU ld or not.
  10382. with_gnu_ld=""
  10383. # Flag that allows shared libraries with undefined symbols to be built.
  10384. allow_undefined_flag=""
  10385. # Flag that enforces no undefined symbols.
  10386. no_undefined_flag=""
  10387. # Flag to hardcode $libdir into a binary during linking.
  10388. # This must work even if $libdir does not exist
  10389. hardcode_libdir_flag_spec=""
  10390. # Whether we need a single "-rpath" flag with a separated argument.
  10391. hardcode_libdir_separator=""
  10392. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10393. # DIR into the resulting binary.
  10394. hardcode_direct=no
  10395. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10396. # DIR into the resulting binary and the resulting library dependency is
  10397. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10398. # library is relocated.
  10399. hardcode_direct_absolute=no
  10400. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10401. # into the resulting binary.
  10402. hardcode_minus_L=no
  10403. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10404. # into the resulting binary.
  10405. hardcode_shlibpath_var=
  10406. # Set to "yes" if building a shared library automatically hardcodes DIR
  10407. # into the library and all subsequent libraries and executables linked
  10408. # against it.
  10409. hardcode_automatic=no
  10410. # Set to yes if linker adds runtime paths of dependent libraries
  10411. # to runtime path list.
  10412. inherit_rpath=no
  10413. # Whether libtool must link a program against all its dependency libraries.
  10414. link_all_deplibs=unknown
  10415. # Set to "yes" if exported symbols are required.
  10416. always_export_symbols=no
  10417. # The commands to list exported symbols.
  10418. export_symbols_cmds=""
  10419. # Symbols that should not be listed in the preloaded symbols.
  10420. exclude_expsyms=""
  10421. # Symbols that must always be exported.
  10422. include_expsyms=""
  10423. # Commands necessary for linking programs (against libraries) with templates.
  10424. prelink_cmds=""
  10425. # Commands necessary for finishing linking programs.
  10426. postlink_cmds=""
  10427. # Specify filename containing input files.
  10428. file_list_spec=""
  10429. # How to hardcode a shared library path into an executable.
  10430. hardcode_action=
  10431. # The directories searched by this compiler when creating a shared library.
  10432. compiler_lib_search_dirs=""
  10433. # Dependencies to place before and after the objects being linked to
  10434. # create a shared library.
  10435. predep_objects=""
  10436. postdep_objects=""
  10437. predeps=""
  10438. postdeps=""
  10439. # The library search path used internally by the compiler when linking
  10440. # a shared library.
  10441. compiler_lib_search_path=""
  10442. # ### END LIBTOOL TAG CONFIG: F77
  10443. # ### BEGIN LIBTOOL TAG CONFIG: FC
  10444. # The linker used to build libraries.
  10445. LD=""
  10446. # How to create reloadable object files.
  10447. reload_flag=" -r"
  10448. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10449. # Commands used to build an old-style archive.
  10450. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10451. # A language specific compiler.
  10452. CC=""
  10453. # Is the compiler the GNU compiler?
  10454. with_gcc=
  10455. # Compiler flag to turn off builtin functions.
  10456. no_builtin_flag=""
  10457. # Additional compiler flags for building library objects.
  10458. pic_flag=""
  10459. # How to pass a linker flag through the compiler.
  10460. wl=""
  10461. # Compiler flag to prevent dynamic linking.
  10462. link_static_flag=""
  10463. # Does compiler simultaneously support -c and -o options?
  10464. compiler_c_o=""
  10465. # Whether or not to add -lc for building shared libraries.
  10466. build_libtool_need_lc=no
  10467. # Whether or not to disallow shared libs when runtime libs are static.
  10468. allow_libtool_libs_with_static_runtimes=no
  10469. # Compiler flag to allow reflexive dlopens.
  10470. export_dynamic_flag_spec=""
  10471. # Compiler flag to generate shared objects directly from archives.
  10472. whole_archive_flag_spec=""
  10473. # Whether the compiler copes with passing no objects directly.
  10474. compiler_needs_object=""
  10475. # Create an old-style archive from a shared archive.
  10476. old_archive_from_new_cmds=""
  10477. # Create a temporary old-style archive to link instead of a shared archive.
  10478. old_archive_from_expsyms_cmds=""
  10479. # Commands used to build a shared archive.
  10480. archive_cmds=""
  10481. archive_expsym_cmds=""
  10482. # Commands used to build a loadable module if different from building
  10483. # a shared archive.
  10484. module_cmds=""
  10485. module_expsym_cmds=""
  10486. # Whether we are building with GNU ld or not.
  10487. with_gnu_ld=""
  10488. # Flag that allows shared libraries with undefined symbols to be built.
  10489. allow_undefined_flag=""
  10490. # Flag that enforces no undefined symbols.
  10491. no_undefined_flag=""
  10492. # Flag to hardcode $libdir into a binary during linking.
  10493. # This must work even if $libdir does not exist
  10494. hardcode_libdir_flag_spec=""
  10495. # Whether we need a single "-rpath" flag with a separated argument.
  10496. hardcode_libdir_separator=""
  10497. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10498. # DIR into the resulting binary.
  10499. hardcode_direct=no
  10500. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10501. # DIR into the resulting binary and the resulting library dependency is
  10502. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10503. # library is relocated.
  10504. hardcode_direct_absolute=no
  10505. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10506. # into the resulting binary.
  10507. hardcode_minus_L=no
  10508. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10509. # into the resulting binary.
  10510. hardcode_shlibpath_var=
  10511. # Set to "yes" if building a shared library automatically hardcodes DIR
  10512. # into the library and all subsequent libraries and executables linked
  10513. # against it.
  10514. hardcode_automatic=no
  10515. # Set to yes if linker adds runtime paths of dependent libraries
  10516. # to runtime path list.
  10517. inherit_rpath=no
  10518. # Whether libtool must link a program against all its dependency libraries.
  10519. link_all_deplibs=unknown
  10520. # Set to "yes" if exported symbols are required.
  10521. always_export_symbols=no
  10522. # The commands to list exported symbols.
  10523. export_symbols_cmds=""
  10524. # Symbols that should not be listed in the preloaded symbols.
  10525. exclude_expsyms=""
  10526. # Symbols that must always be exported.
  10527. include_expsyms=""
  10528. # Commands necessary for linking programs (against libraries) with templates.
  10529. prelink_cmds=""
  10530. # Commands necessary for finishing linking programs.
  10531. postlink_cmds=""
  10532. # Specify filename containing input files.
  10533. file_list_spec=""
  10534. # How to hardcode a shared library path into an executable.
  10535. hardcode_action=
  10536. # The directories searched by this compiler when creating a shared library.
  10537. compiler_lib_search_dirs=""
  10538. # Dependencies to place before and after the objects being linked to
  10539. # create a shared library.
  10540. predep_objects=""
  10541. postdep_objects=""
  10542. predeps=""
  10543. postdeps=""
  10544. # The library search path used internally by the compiler when linking
  10545. # a shared library.
  10546. compiler_lib_search_path=""
  10547. # ### END LIBTOOL TAG CONFIG: FC