libtool 213 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520
  1. #! /bin/bash
  2. # libtoolT - Provide generalized library-building support services.
  3. # Generated automatically by (GNU )
  4. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  5. #
  6. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
  7. # Free Software Foundation, Inc.
  8. #
  9. # This file is part of GNU Libtool:
  10. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; either version 2 of the License, or
  15. # (at your option) any later version.
  16. #
  17. # This program is distributed in the hope that it will be useful, but
  18. # WITHOUT ANY WARRANTY; without even the implied warranty of
  19. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. # General Public License for more details.
  21. #
  22. # You should have received a copy of the GNU General Public License
  23. # along with this program; if not, write to the Free Software
  24. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  25. #
  26. # As a special exception to the GNU General Public License, if you
  27. # distribute this file as part of a program that contains a
  28. # configuration script generated by Autoconf, you may include it under
  29. # the same distribution terms that you use for the rest of that program.
  30. # A sed program that does not truncate output.
  31. SED="/bin/sed"
  32. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  33. Xsed="/bin/sed -e 1s/^X//"
  34. # The HP-UX ksh and POSIX shell print the target directory to stdout
  35. # if CDPATH is set.
  36. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  37. # The names of the tagged configurations supported by this script.
  38. available_tags=" CXX"
  39. # ### BEGIN LIBTOOL CONFIG
  40. # Libtool was configured on host raspberrypi:
  41. # Shell to use when invoking shell scripts.
  42. SHELL="/bin/bash"
  43. # Whether or not to build shared libraries.
  44. build_libtool_libs=yes
  45. # Whether or not to build static libraries.
  46. build_old_libs=yes
  47. # Whether or not to add -lc for building shared libraries.
  48. build_libtool_need_lc=no
  49. # Whether or not to disallow shared libs when runtime libs are static
  50. allow_libtool_libs_with_static_runtimes=no
  51. # Whether or not to optimize for fast installation.
  52. fast_install=yes
  53. # The host system.
  54. host_alias=
  55. host=armv7l-unknown-linux-gnu
  56. host_os=linux-gnu
  57. # The build system.
  58. build_alias=
  59. build=armv7l-unknown-linux-gnu
  60. build_os=linux-gnu
  61. # An echo program that does not interpret backslashes.
  62. echo="echo"
  63. # The archiver.
  64. AR="ar"
  65. AR_FLAGS="cru"
  66. # A C compiler.
  67. LTCC="gcc"
  68. # LTCC compiler flags.
  69. LTCFLAGS="-g -O2"
  70. # A language-specific compiler.
  71. CC="gcc"
  72. # Is the compiler the GNU C compiler?
  73. with_gcc=yes
  74. # An ERE matcher.
  75. EGREP="grep -E"
  76. # The linker used to build libraries.
  77. LD="/usr/bin/ld"
  78. # Whether we need hard or soft links.
  79. LN_S="ln -s"
  80. # A BSD-compatible nm program.
  81. NM="/usr/bin/nm -B"
  82. # A symbol stripping program
  83. STRIP="strip"
  84. # Used to examine libraries when file_magic_cmd begins "file"
  85. MAGIC_CMD=file
  86. # Used on cygwin: DLL creation program.
  87. DLLTOOL="dlltool"
  88. # Used on cygwin: object dumper.
  89. OBJDUMP="objdump"
  90. # Used on cygwin: assembler.
  91. AS="as"
  92. # The name of the directory that contains temporary libtool files.
  93. objdir=.libs
  94. # How to create reloadable object files.
  95. reload_flag=" -r"
  96. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  97. # How to pass a linker flag through the compiler.
  98. wl="-Wl,"
  99. # Object file suffix (normally "o").
  100. objext="o"
  101. # Old archive suffix (normally "a").
  102. libext="a"
  103. # Shared library suffix (normally ".so").
  104. shrext_cmds='.so'
  105. # Executable file suffix (normally "").
  106. exeext=""
  107. # Additional compiler flags for building library objects.
  108. pic_flag=" -fPIC -DPIC"
  109. pic_mode=default
  110. # What is the maximum length of a command?
  111. max_cmd_len=32768
  112. # Does compiler simultaneously support -c and -o options?
  113. compiler_c_o="yes"
  114. # Must we lock files when doing compilation?
  115. need_locks="no"
  116. # Do we need the lib prefix for modules?
  117. need_lib_prefix=no
  118. # Do we need a version for libraries?
  119. need_version=no
  120. # Whether dlopen is supported.
  121. dlopen_support=unknown
  122. # Whether dlopen of programs is supported.
  123. dlopen_self=unknown
  124. # Whether dlopen of statically linked programs is supported.
  125. dlopen_self_static=unknown
  126. # Compiler flag to prevent dynamic linking.
  127. link_static_flag="-static"
  128. # Compiler flag to turn off builtin functions.
  129. no_builtin_flag=" -fno-builtin"
  130. # Compiler flag to allow reflexive dlopens.
  131. export_dynamic_flag_spec="\${wl}--export-dynamic"
  132. # Compiler flag to generate shared objects directly from archives.
  133. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
  134. # Compiler flag to generate thread-safe objects.
  135. thread_safe_flag_spec=""
  136. # Library versioning type.
  137. version_type=linux
  138. # Format of library name prefix.
  139. libname_spec="lib\$name"
  140. # List of archive names. First name is the real one, the rest are links.
  141. # The last name is the one that the linker finds with -lNAME.
  142. library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
  143. # The coded name of the library, if different from the real name.
  144. soname_spec="\${libname}\${release}\${shared_ext}\$major"
  145. # Commands used to build and install an old-style archive.
  146. RANLIB="ranlib"
  147. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
  148. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
  149. old_postuninstall_cmds=""
  150. # Create an old-style archive from a shared archive.
  151. old_archive_from_new_cmds=""
  152. # Create a temporary old-style archive to link instead of a shared archive.
  153. old_archive_from_expsyms_cmds=""
  154. # Commands used to build and install a shared archive.
  155. archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
  156. archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  157. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  158. \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  159. \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
  160. postinstall_cmds=""
  161. postuninstall_cmds=""
  162. # Commands used to build a loadable module (assumed same as above if empty)
  163. module_cmds=""
  164. module_expsym_cmds=""
  165. # Commands to strip libraries.
  166. old_striplib="strip --strip-debug"
  167. striplib="strip --strip-unneeded"
  168. # Dependencies to place before the objects being linked to create a
  169. # shared library.
  170. predep_objects=""
  171. # Dependencies to place after the objects being linked to create a
  172. # shared library.
  173. postdep_objects=""
  174. # Dependencies to place before the objects being linked to create a
  175. # shared library.
  176. predeps=""
  177. # Dependencies to place after the objects being linked to create a
  178. # shared library.
  179. postdeps=""
  180. # The library search path used internally by the compiler when linking
  181. # a shared library.
  182. compiler_lib_search_path=""
  183. # Method to check whether dependent libraries are shared objects.
  184. deplibs_check_method="pass_all"
  185. # Command to use when deplibs_check_method == file_magic.
  186. file_magic_cmd="\$MAGIC_CMD"
  187. # Flag that allows shared libraries with undefined symbols to be built.
  188. allow_undefined_flag=""
  189. # Flag that forces no undefined symbols.
  190. no_undefined_flag=""
  191. # Commands used to finish a libtool library installation in a directory.
  192. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  193. # Same as above, but a single script fragment to be evaled but not shown.
  194. finish_eval=""
  195. # Take the output of nm and produce a listing of raw symbols and C names.
  196. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
  197. # Transform the output of nm in a proper C declaration
  198. global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
  199. # Transform the output of nm in a C name address pair
  200. global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
  201. # This is the shared library runtime path variable.
  202. runpath_var=LD_RUN_PATH
  203. # This is the shared library path variable.
  204. shlibpath_var=LD_LIBRARY_PATH
  205. # Is shlibpath searched before the hard-coded library search path?
  206. shlibpath_overrides_runpath=no
  207. # How to hardcode a shared library path into an executable.
  208. hardcode_action=immediate
  209. # Whether we should hardcode library paths into libraries.
  210. hardcode_into_libs=yes
  211. # Flag to hardcode $libdir into a binary during linking.
  212. # This must work even if $libdir does not exist.
  213. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
  214. # If ld is used when linking, flag to hardcode $libdir into
  215. # a binary during linking. This must work even if $libdir does
  216. # not exist.
  217. hardcode_libdir_flag_spec_ld=""
  218. # Whether we need a single -rpath flag with a separated argument.
  219. hardcode_libdir_separator=""
  220. # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
  221. # resulting binary.
  222. hardcode_direct=no
  223. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  224. # resulting binary.
  225. hardcode_minus_L=no
  226. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  227. # the resulting binary.
  228. hardcode_shlibpath_var=unsupported
  229. # Set to yes if building a shared library automatically hardcodes DIR into the library
  230. # and all subsequent libraries and executables linked against it.
  231. hardcode_automatic=no
  232. # Variables whose values should be saved in libtool wrapper scripts and
  233. # restored at relink time.
  234. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  235. # Whether libtool must link a program against all its dependency libraries.
  236. link_all_deplibs=unknown
  237. # Compile-time system search path for libraries
  238. sys_lib_search_path_spec=" /usr/lib/gcc/arm-linux-gnueabihf/8/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/8/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/8/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../ /lib/arm-linux-gnueabihf/8/ /lib/arm-linux-gnueabihf/ /lib/ /usr/lib/arm-linux-gnueabihf/8/ /usr/lib/arm-linux-gnueabihf/ /usr/lib/"
  239. # Run-time system search path for libraries
  240. sys_lib_dlsearch_path_spec="/lib /usr/lib /opt/vc/lib /usr/local/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf/libfakeroot /usr/local/lib "
  241. # Fix the shell variable $srcfile for the compiler.
  242. fix_srcfile_path=""
  243. # Set to yes if exported symbols are required.
  244. always_export_symbols=no
  245. # The commands to list exported symbols.
  246. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  247. # The commands to extract the exported symbol list from a shared archive.
  248. extract_expsyms_cmds=""
  249. # Symbols that should not be listed in the preloaded symbols.
  250. exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  251. # Symbols that must always be exported.
  252. include_expsyms=""
  253. # ### END LIBTOOL CONFIG
  254. # ltmain.sh - Provide generalized library-building support services.
  255. # NOTE: Changing this file will not affect anything until you rerun configure.
  256. #
  257. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
  258. # Free Software Foundation, Inc.
  259. # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  260. #
  261. # This program is free software; you can redistribute it and/or modify
  262. # it under the terms of the GNU General Public License as published by
  263. # the Free Software Foundation; either version 2 of the License, or
  264. # (at your option) any later version.
  265. #
  266. # This program is distributed in the hope that it will be useful, but
  267. # WITHOUT ANY WARRANTY; without even the implied warranty of
  268. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  269. # General Public License for more details.
  270. #
  271. # You should have received a copy of the GNU General Public License
  272. # along with this program; if not, write to the Free Software
  273. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  274. #
  275. # As a special exception to the GNU General Public License, if you
  276. # distribute this file as part of a program that contains a
  277. # configuration script generated by Autoconf, you may include it under
  278. # the same distribution terms that you use for the rest of that program.
  279. basename="s,^.*/,,g"
  280. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  281. # is ksh but when the shell is invoked as "sh" and the current value of
  282. # the _XPG environment variable is not equal to 1 (one), the special
  283. # positional parameter $0, within a function call, is the name of the
  284. # function.
  285. progpath="$0"
  286. # The name of this program:
  287. progname=`echo "$progpath" | $SED $basename`
  288. modename="$progname"
  289. # Global variables:
  290. EXIT_SUCCESS=0
  291. EXIT_FAILURE=1
  292. PROGRAM=ltmain.sh
  293. PACKAGE=libtool
  294. VERSION=1.5.22
  295. TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
  296. # See if we are running on zsh, and set the options which allow our
  297. # commands through without removal of \ escapes.
  298. if test -n "${ZSH_VERSION+set}" ; then
  299. setopt NO_GLOB_SUBST
  300. fi
  301. # Check that we have a working $echo.
  302. if test "X$1" = X--no-reexec; then
  303. # Discard the --no-reexec flag, and continue.
  304. shift
  305. elif test "X$1" = X--fallback-echo; then
  306. # Avoid inline document here, it may be left over
  307. :
  308. elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  309. # Yippee, $echo works!
  310. :
  311. else
  312. # Restart under the correct shell, and then maybe $echo will work.
  313. exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  314. fi
  315. if test "X$1" = X--fallback-echo; then
  316. # used as fallback echo
  317. shift
  318. cat <<EOF
  319. $*
  320. EOF
  321. exit $EXIT_SUCCESS
  322. fi
  323. default_mode=
  324. help="Try \`$progname --help' for more information."
  325. magic="%%%MAGIC variable%%%"
  326. mkdir="mkdir"
  327. mv="mv -f"
  328. rm="rm -f"
  329. # Sed substitution that helps us do robust quoting. It backslashifies
  330. # metacharacters that are still active within double-quoted strings.
  331. Xsed="${SED}"' -e 1s/^X//'
  332. sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  333. # test EBCDIC or ASCII
  334. case `echo X|tr X '\101'` in
  335. A) # ASCII based system
  336. # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
  337. SP2NL='tr \040 \012'
  338. NL2SP='tr \015\012 \040\040'
  339. ;;
  340. *) # EBCDIC based system
  341. SP2NL='tr \100 \n'
  342. NL2SP='tr \r\n \100\100'
  343. ;;
  344. esac
  345. # NLS nuisances.
  346. # Only set LANG and LC_ALL to C if already set.
  347. # These must not be set unconditionally because not all systems understand
  348. # e.g. LANG=C (notably SCO).
  349. # We save the old values to restore during execute mode.
  350. if test "${LC_ALL+set}" = set; then
  351. save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  352. fi
  353. if test "${LANG+set}" = set; then
  354. save_LANG="$LANG"; LANG=C; export LANG
  355. fi
  356. # Make sure IFS has a sensible default
  357. lt_nl='
  358. '
  359. IFS=" $lt_nl"
  360. if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  361. $echo "$modename: not configured to build any kind of library" 1>&2
  362. $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  363. exit $EXIT_FAILURE
  364. fi
  365. # Global variables.
  366. mode=$default_mode
  367. nonopt=
  368. prev=
  369. prevopt=
  370. run=
  371. show="$echo"
  372. show_help=
  373. execute_dlfiles=
  374. duplicate_deps=no
  375. preserve_args=
  376. lo2o="s/\\.lo\$/.${objext}/"
  377. o2lo="s/\\.${objext}\$/.lo/"
  378. #####################################
  379. # Shell function definitions:
  380. # This seems to be the best place for them
  381. # func_mktempdir [string]
  382. # Make a temporary directory that won't clash with other running
  383. # libtool processes, and avoids race conditions if possible. If
  384. # given, STRING is the basename for that directory.
  385. func_mktempdir ()
  386. {
  387. my_template="${TMPDIR-/tmp}/${1-$progname}"
  388. if test "$run" = ":"; then
  389. # Return a directory name, but don't create it in dry-run mode
  390. my_tmpdir="${my_template}-$$"
  391. else
  392. # If mktemp works, use that first and foremost
  393. my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
  394. if test ! -d "$my_tmpdir"; then
  395. # Failing that, at least try and use $RANDOM to avoid a race
  396. my_tmpdir="${my_template}-${RANDOM-0}$$"
  397. save_mktempdir_umask=`umask`
  398. umask 0077
  399. $mkdir "$my_tmpdir"
  400. umask $save_mktempdir_umask
  401. fi
  402. # If we're not in dry-run mode, bomb out on failure
  403. test -d "$my_tmpdir" || {
  404. $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
  405. exit $EXIT_FAILURE
  406. }
  407. fi
  408. $echo "X$my_tmpdir" | $Xsed
  409. }
  410. # func_win32_libid arg
  411. # return the library type of file 'arg'
  412. #
  413. # Need a lot of goo to handle *both* DLLs and import libs
  414. # Has to be a shell function in order to 'eat' the argument
  415. # that is supplied when $file_magic_command is called.
  416. func_win32_libid ()
  417. {
  418. win32_libid_type="unknown"
  419. win32_fileres=`file -L $1 2>/dev/null`
  420. case $win32_fileres in
  421. *ar\ archive\ import\ library*) # definitely import
  422. win32_libid_type="x86 archive import"
  423. ;;
  424. *ar\ archive*) # could be an import, or static
  425. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
  426. $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  427. win32_nmres=`eval $NM -f posix -A $1 | \
  428. $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
  429. case $win32_nmres in
  430. import*) win32_libid_type="x86 archive import";;
  431. *) win32_libid_type="x86 archive static";;
  432. esac
  433. fi
  434. ;;
  435. *DLL*)
  436. win32_libid_type="x86 DLL"
  437. ;;
  438. *executable*) # but shell scripts are "executable" too...
  439. case $win32_fileres in
  440. *MS\ Windows\ PE\ Intel*)
  441. win32_libid_type="x86 DLL"
  442. ;;
  443. esac
  444. ;;
  445. esac
  446. $echo $win32_libid_type
  447. }
  448. # func_infer_tag arg
  449. # Infer tagged configuration to use if any are available and
  450. # if one wasn't chosen via the "--tag" command line option.
  451. # Only attempt this if the compiler in the base compile
  452. # command doesn't match the default compiler.
  453. # arg is usually of the form 'gcc ...'
  454. func_infer_tag ()
  455. {
  456. if test -n "$available_tags" && test -z "$tagname"; then
  457. CC_quoted=
  458. for arg in $CC; do
  459. case $arg in
  460. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  461. arg="\"$arg\""
  462. ;;
  463. esac
  464. CC_quoted="$CC_quoted $arg"
  465. done
  466. case $@ in
  467. # Blanks in the command may have been stripped by the calling shell,
  468. # but not from the CC environment variable when configure was run.
  469. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
  470. # Blanks at the start of $base_compile will cause this to fail
  471. # if we don't check for them as well.
  472. *)
  473. for z in $available_tags; do
  474. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  475. # Evaluate the configuration.
  476. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  477. CC_quoted=
  478. for arg in $CC; do
  479. # Double-quote args containing other shell metacharacters.
  480. case $arg in
  481. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  482. arg="\"$arg\""
  483. ;;
  484. esac
  485. CC_quoted="$CC_quoted $arg"
  486. done
  487. case "$@ " in
  488. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
  489. # The compiler in the base compile command matches
  490. # the one in the tagged configuration.
  491. # Assume this is the tagged configuration we want.
  492. tagname=$z
  493. break
  494. ;;
  495. esac
  496. fi
  497. done
  498. # If $tagname still isn't set, then no tagged configuration
  499. # was found and let the user know that the "--tag" command
  500. # line option must be used.
  501. if test -z "$tagname"; then
  502. $echo "$modename: unable to infer tagged configuration"
  503. $echo "$modename: specify a tag with \`--tag'" 1>&2
  504. exit $EXIT_FAILURE
  505. # else
  506. # $echo "$modename: using $tagname tagged configuration"
  507. fi
  508. ;;
  509. esac
  510. fi
  511. }
  512. # func_extract_an_archive dir oldlib
  513. func_extract_an_archive ()
  514. {
  515. f_ex_an_ar_dir="$1"; shift
  516. f_ex_an_ar_oldlib="$1"
  517. $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
  518. $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
  519. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  520. :
  521. else
  522. $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
  523. exit $EXIT_FAILURE
  524. fi
  525. }
  526. # func_extract_archives gentop oldlib ...
  527. func_extract_archives ()
  528. {
  529. my_gentop="$1"; shift
  530. my_oldlibs=${1+"$@"}
  531. my_oldobjs=""
  532. my_xlib=""
  533. my_xabs=""
  534. my_xdir=""
  535. my_status=""
  536. $show "${rm}r $my_gentop"
  537. $run ${rm}r "$my_gentop"
  538. $show "$mkdir $my_gentop"
  539. $run $mkdir "$my_gentop"
  540. my_status=$?
  541. if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
  542. exit $my_status
  543. fi
  544. for my_xlib in $my_oldlibs; do
  545. # Extract the objects.
  546. case $my_xlib in
  547. [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  548. *) my_xabs=`pwd`"/$my_xlib" ;;
  549. esac
  550. my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
  551. my_xdir="$my_gentop/$my_xlib"
  552. $show "${rm}r $my_xdir"
  553. $run ${rm}r "$my_xdir"
  554. $show "$mkdir $my_xdir"
  555. $run $mkdir "$my_xdir"
  556. exit_status=$?
  557. if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
  558. exit $exit_status
  559. fi
  560. case $host in
  561. *-darwin*)
  562. $show "Extracting $my_xabs"
  563. # Do not bother doing anything if just a dry run
  564. if test -z "$run"; then
  565. darwin_orig_dir=`pwd`
  566. cd $my_xdir || exit $?
  567. darwin_archive=$my_xabs
  568. darwin_curdir=`pwd`
  569. darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
  570. darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
  571. if test -n "$darwin_arches"; then
  572. darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
  573. darwin_arch=
  574. $show "$darwin_base_archive has multiple architectures $darwin_arches"
  575. for darwin_arch in $darwin_arches ; do
  576. mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  577. lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  578. cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  579. func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  580. cd "$darwin_curdir"
  581. $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  582. done # $darwin_arches
  583. ## Okay now we have a bunch of thin objects, gotta fatten them up :)
  584. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
  585. darwin_file=
  586. darwin_files=
  587. for darwin_file in $darwin_filelist; do
  588. darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  589. lipo -create -output "$darwin_file" $darwin_files
  590. done # $darwin_filelist
  591. ${rm}r unfat-$$
  592. cd "$darwin_orig_dir"
  593. else
  594. cd "$darwin_orig_dir"
  595. func_extract_an_archive "$my_xdir" "$my_xabs"
  596. fi # $darwin_arches
  597. fi # $run
  598. ;;
  599. *)
  600. func_extract_an_archive "$my_xdir" "$my_xabs"
  601. ;;
  602. esac
  603. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  604. done
  605. func_extract_archives_result="$my_oldobjs"
  606. }
  607. # End of Shell function definitions
  608. #####################################
  609. # Darwin sucks
  610. eval std_shrext=\"$shrext_cmds\"
  611. disable_libs=no
  612. # Parse our command line options once, thoroughly.
  613. while test "$#" -gt 0
  614. do
  615. arg="$1"
  616. shift
  617. case $arg in
  618. -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  619. *) optarg= ;;
  620. esac
  621. # If the previous option needs an argument, assign it.
  622. if test -n "$prev"; then
  623. case $prev in
  624. execute_dlfiles)
  625. execute_dlfiles="$execute_dlfiles $arg"
  626. ;;
  627. tag)
  628. tagname="$arg"
  629. preserve_args="${preserve_args}=$arg"
  630. # Check whether tagname contains only valid characters
  631. case $tagname in
  632. *[!-_A-Za-z0-9,/]*)
  633. $echo "$progname: invalid tag name: $tagname" 1>&2
  634. exit $EXIT_FAILURE
  635. ;;
  636. esac
  637. case $tagname in
  638. CC)
  639. # Don't test for the "default" C tag, as we know, it's there, but
  640. # not specially marked.
  641. ;;
  642. *)
  643. if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
  644. taglist="$taglist $tagname"
  645. # Evaluate the configuration.
  646. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
  647. else
  648. $echo "$progname: ignoring unknown tag $tagname" 1>&2
  649. fi
  650. ;;
  651. esac
  652. ;;
  653. *)
  654. eval "$prev=\$arg"
  655. ;;
  656. esac
  657. prev=
  658. prevopt=
  659. continue
  660. fi
  661. # Have we seen a non-optional argument yet?
  662. case $arg in
  663. --help)
  664. show_help=yes
  665. ;;
  666. --version)
  667. $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  668. $echo
  669. $echo "Copyright (C) 2005 Free Software Foundation, Inc."
  670. $echo "This is free software; see the source for copying conditions. There is NO"
  671. $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  672. exit $?
  673. ;;
  674. --config)
  675. ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
  676. # Now print the configurations for the tags.
  677. for tagname in $taglist; do
  678. ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
  679. done
  680. exit $?
  681. ;;
  682. --debug)
  683. $echo "$progname: enabling shell trace mode"
  684. set -x
  685. preserve_args="$preserve_args $arg"
  686. ;;
  687. --dry-run | -n)
  688. run=:
  689. ;;
  690. --features)
  691. $echo "host: $host"
  692. if test "$build_libtool_libs" = yes; then
  693. $echo "enable shared libraries"
  694. else
  695. $echo "disable shared libraries"
  696. fi
  697. if test "$build_old_libs" = yes; then
  698. $echo "enable static libraries"
  699. else
  700. $echo "disable static libraries"
  701. fi
  702. exit $?
  703. ;;
  704. --finish) mode="finish" ;;
  705. --mode) prevopt="--mode" prev=mode ;;
  706. --mode=*) mode="$optarg" ;;
  707. --preserve-dup-deps) duplicate_deps="yes" ;;
  708. --quiet | --silent)
  709. show=:
  710. preserve_args="$preserve_args $arg"
  711. ;;
  712. --tag)
  713. prevopt="--tag"
  714. prev=tag
  715. preserve_args="$preserve_args --tag"
  716. ;;
  717. --tag=*)
  718. set tag "$optarg" ${1+"$@"}
  719. shift
  720. prev=tag
  721. preserve_args="$preserve_args --tag"
  722. ;;
  723. -dlopen)
  724. prevopt="-dlopen"
  725. prev=execute_dlfiles
  726. ;;
  727. -*)
  728. $echo "$modename: unrecognized option \`$arg'" 1>&2
  729. $echo "$help" 1>&2
  730. exit $EXIT_FAILURE
  731. ;;
  732. *)
  733. nonopt="$arg"
  734. break
  735. ;;
  736. esac
  737. done
  738. if test -n "$prevopt"; then
  739. $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  740. $echo "$help" 1>&2
  741. exit $EXIT_FAILURE
  742. fi
  743. case $disable_libs in
  744. no)
  745. ;;
  746. shared)
  747. build_libtool_libs=no
  748. build_old_libs=yes
  749. ;;
  750. static)
  751. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  752. ;;
  753. esac
  754. # If this variable is set in any of the actions, the command in it
  755. # will be execed at the end. This prevents here-documents from being
  756. # left over by shells.
  757. exec_cmd=
  758. if test -z "$show_help"; then
  759. # Infer the operation mode.
  760. if test -z "$mode"; then
  761. $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
  762. $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
  763. case $nonopt in
  764. *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
  765. mode=link
  766. for arg
  767. do
  768. case $arg in
  769. -c)
  770. mode=compile
  771. break
  772. ;;
  773. esac
  774. done
  775. ;;
  776. *db | *dbx | *strace | *truss)
  777. mode=execute
  778. ;;
  779. *install*|cp|mv)
  780. mode=install
  781. ;;
  782. *rm)
  783. mode=uninstall
  784. ;;
  785. *)
  786. # If we have no mode, but dlfiles were specified, then do execute mode.
  787. test -n "$execute_dlfiles" && mode=execute
  788. # Just use the default operation mode.
  789. if test -z "$mode"; then
  790. if test -n "$nonopt"; then
  791. $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  792. else
  793. $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  794. fi
  795. fi
  796. ;;
  797. esac
  798. fi
  799. # Only execute mode is allowed to have -dlopen flags.
  800. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  801. $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  802. $echo "$help" 1>&2
  803. exit $EXIT_FAILURE
  804. fi
  805. # Change the help message to a mode-specific one.
  806. generic_help="$help"
  807. help="Try \`$modename --help --mode=$mode' for more information."
  808. # These modes are in order of execution frequency so that they run quickly.
  809. case $mode in
  810. # libtool compile mode
  811. compile)
  812. modename="$modename: compile"
  813. # Get the compilation command and the source file.
  814. base_compile=
  815. srcfile="$nonopt" # always keep a non-empty value in "srcfile"
  816. suppress_opt=yes
  817. suppress_output=
  818. arg_mode=normal
  819. libobj=
  820. later=
  821. for arg
  822. do
  823. case $arg_mode in
  824. arg )
  825. # do not "continue". Instead, add this to base_compile
  826. lastarg="$arg"
  827. arg_mode=normal
  828. ;;
  829. target )
  830. libobj="$arg"
  831. arg_mode=normal
  832. continue
  833. ;;
  834. normal )
  835. # Accept any command-line options.
  836. case $arg in
  837. -o)
  838. if test -n "$libobj" ; then
  839. $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  840. exit $EXIT_FAILURE
  841. fi
  842. arg_mode=target
  843. continue
  844. ;;
  845. -static | -prefer-pic | -prefer-non-pic)
  846. later="$later $arg"
  847. continue
  848. ;;
  849. -no-suppress)
  850. suppress_opt=no
  851. continue
  852. ;;
  853. -Xcompiler)
  854. arg_mode=arg # the next one goes into the "base_compile" arg list
  855. continue # The current "srcfile" will either be retained or
  856. ;; # replaced later. I would guess that would be a bug.
  857. -Wc,*)
  858. args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  859. lastarg=
  860. save_ifs="$IFS"; IFS=','
  861. for arg in $args; do
  862. IFS="$save_ifs"
  863. # Double-quote args containing other shell metacharacters.
  864. # Many Bourne shells cannot handle close brackets correctly
  865. # in scan sets, so we specify it separately.
  866. case $arg in
  867. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  868. arg="\"$arg\""
  869. ;;
  870. esac
  871. lastarg="$lastarg $arg"
  872. done
  873. IFS="$save_ifs"
  874. lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  875. # Add the arguments to base_compile.
  876. base_compile="$base_compile $lastarg"
  877. continue
  878. ;;
  879. * )
  880. # Accept the current argument as the source file.
  881. # The previous "srcfile" becomes the current argument.
  882. #
  883. lastarg="$srcfile"
  884. srcfile="$arg"
  885. ;;
  886. esac # case $arg
  887. ;;
  888. esac # case $arg_mode
  889. # Aesthetically quote the previous argument.
  890. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  891. case $lastarg in
  892. # Double-quote args containing other shell metacharacters.
  893. # Many Bourne shells cannot handle close brackets correctly
  894. # in scan sets, and some SunOS ksh mistreat backslash-escaping
  895. # in scan sets (worked around with variable expansion),
  896. # and furthermore cannot handle '|' '&' '(' ')' in scan sets
  897. # at all, so we specify them separately.
  898. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  899. lastarg="\"$lastarg\""
  900. ;;
  901. esac
  902. base_compile="$base_compile $lastarg"
  903. done # for arg
  904. case $arg_mode in
  905. arg)
  906. $echo "$modename: you must specify an argument for -Xcompile"
  907. exit $EXIT_FAILURE
  908. ;;
  909. target)
  910. $echo "$modename: you must specify a target with \`-o'" 1>&2
  911. exit $EXIT_FAILURE
  912. ;;
  913. *)
  914. # Get the name of the library object.
  915. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  916. ;;
  917. esac
  918. # Recognize several different file suffixes.
  919. # If the user specifies -o file.o, it is replaced with file.lo
  920. xform='[cCFSifmso]'
  921. case $libobj in
  922. *.ada) xform=ada ;;
  923. *.adb) xform=adb ;;
  924. *.ads) xform=ads ;;
  925. *.asm) xform=asm ;;
  926. *.c++) xform=c++ ;;
  927. *.cc) xform=cc ;;
  928. *.ii) xform=ii ;;
  929. *.class) xform=class ;;
  930. *.cpp) xform=cpp ;;
  931. *.cxx) xform=cxx ;;
  932. *.f90) xform=f90 ;;
  933. *.for) xform=for ;;
  934. *.java) xform=java ;;
  935. esac
  936. libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  937. case $libobj in
  938. *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  939. *)
  940. $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  941. exit $EXIT_FAILURE
  942. ;;
  943. esac
  944. func_infer_tag $base_compile
  945. for arg in $later; do
  946. case $arg in
  947. -static)
  948. build_old_libs=yes
  949. continue
  950. ;;
  951. -prefer-pic)
  952. pic_mode=yes
  953. continue
  954. ;;
  955. -prefer-non-pic)
  956. pic_mode=no
  957. continue
  958. ;;
  959. esac
  960. done
  961. qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
  962. case $qlibobj in
  963. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  964. qlibobj="\"$qlibobj\"" ;;
  965. esac
  966. test "X$libobj" != "X$qlibobj" \
  967. && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
  968. && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
  969. objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  970. xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  971. if test "X$xdir" = "X$obj"; then
  972. xdir=
  973. else
  974. xdir=$xdir/
  975. fi
  976. lobj=${xdir}$objdir/$objname
  977. if test -z "$base_compile"; then
  978. $echo "$modename: you must specify a compilation command" 1>&2
  979. $echo "$help" 1>&2
  980. exit $EXIT_FAILURE
  981. fi
  982. # Delete any leftover library objects.
  983. if test "$build_old_libs" = yes; then
  984. removelist="$obj $lobj $libobj ${libobj}T"
  985. else
  986. removelist="$lobj $libobj ${libobj}T"
  987. fi
  988. $run $rm $removelist
  989. trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  990. # On Cygwin there's no "real" PIC flag so we must build both object types
  991. case $host_os in
  992. cygwin* | mingw* | pw32* | os2*)
  993. pic_mode=default
  994. ;;
  995. esac
  996. if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
  997. # non-PIC code in shared libraries is not supported
  998. pic_mode=default
  999. fi
  1000. # Calculate the filename of the output object if compiler does
  1001. # not support -o with -c
  1002. if test "$compiler_c_o" = no; then
  1003. output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  1004. lockfile="$output_obj.lock"
  1005. removelist="$removelist $output_obj $lockfile"
  1006. trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  1007. else
  1008. output_obj=
  1009. need_locks=no
  1010. lockfile=
  1011. fi
  1012. # Lock this critical section if it is needed
  1013. # We use this script file to make the link, it avoids creating a new file
  1014. if test "$need_locks" = yes; then
  1015. until $run ln "$progpath" "$lockfile" 2>/dev/null; do
  1016. $show "Waiting for $lockfile to be removed"
  1017. sleep 2
  1018. done
  1019. elif test "$need_locks" = warn; then
  1020. if test -f "$lockfile"; then
  1021. $echo "\
  1022. *** ERROR, $lockfile exists and contains:
  1023. `cat $lockfile 2>/dev/null`
  1024. This indicates that another process is trying to use the same
  1025. temporary object file, and libtool could not work around it because
  1026. your compiler does not support \`-c' and \`-o' together. If you
  1027. repeat this compilation, it may succeed, by chance, but you had better
  1028. avoid parallel builds (make -j) in this platform, or get a better
  1029. compiler."
  1030. $run $rm $removelist
  1031. exit $EXIT_FAILURE
  1032. fi
  1033. $echo "$srcfile" > "$lockfile"
  1034. fi
  1035. if test -n "$fix_srcfile_path"; then
  1036. eval srcfile=\"$fix_srcfile_path\"
  1037. fi
  1038. qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
  1039. case $qsrcfile in
  1040. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1041. qsrcfile="\"$qsrcfile\"" ;;
  1042. esac
  1043. $run $rm "$libobj" "${libobj}T"
  1044. # Create a libtool object file (analogous to a ".la" file),
  1045. # but don't create it if we're doing a dry run.
  1046. test -z "$run" && cat > ${libobj}T <<EOF
  1047. # $libobj - a libtool object file
  1048. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  1049. #
  1050. # Please DO NOT delete this file!
  1051. # It is necessary for linking the library.
  1052. # Name of the PIC object.
  1053. EOF
  1054. # Only build a PIC object if we are building libtool libraries.
  1055. if test "$build_libtool_libs" = yes; then
  1056. # Without this assignment, base_compile gets emptied.
  1057. fbsd_hideous_sh_bug=$base_compile
  1058. if test "$pic_mode" != no; then
  1059. command="$base_compile $qsrcfile $pic_flag"
  1060. else
  1061. # Don't build PIC code
  1062. command="$base_compile $qsrcfile"
  1063. fi
  1064. if test ! -d "${xdir}$objdir"; then
  1065. $show "$mkdir ${xdir}$objdir"
  1066. $run $mkdir ${xdir}$objdir
  1067. exit_status=$?
  1068. if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
  1069. exit $exit_status
  1070. fi
  1071. fi
  1072. if test -z "$output_obj"; then
  1073. # Place PIC objects in $objdir
  1074. command="$command -o $lobj"
  1075. fi
  1076. $run $rm "$lobj" "$output_obj"
  1077. $show "$command"
  1078. if $run eval "$command"; then :
  1079. else
  1080. test -n "$output_obj" && $run $rm $removelist
  1081. exit $EXIT_FAILURE
  1082. fi
  1083. if test "$need_locks" = warn &&
  1084. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1085. $echo "\
  1086. *** ERROR, $lockfile contains:
  1087. `cat $lockfile 2>/dev/null`
  1088. but it should contain:
  1089. $srcfile
  1090. This indicates that another process is trying to use the same
  1091. temporary object file, and libtool could not work around it because
  1092. your compiler does not support \`-c' and \`-o' together. If you
  1093. repeat this compilation, it may succeed, by chance, but you had better
  1094. avoid parallel builds (make -j) in this platform, or get a better
  1095. compiler."
  1096. $run $rm $removelist
  1097. exit $EXIT_FAILURE
  1098. fi
  1099. # Just move the object if needed, then go on to compile the next one
  1100. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  1101. $show "$mv $output_obj $lobj"
  1102. if $run $mv $output_obj $lobj; then :
  1103. else
  1104. error=$?
  1105. $run $rm $removelist
  1106. exit $error
  1107. fi
  1108. fi
  1109. # Append the name of the PIC object to the libtool object file.
  1110. test -z "$run" && cat >> ${libobj}T <<EOF
  1111. pic_object='$objdir/$objname'
  1112. EOF
  1113. # Allow error messages only from the first compilation.
  1114. if test "$suppress_opt" = yes; then
  1115. suppress_output=' >/dev/null 2>&1'
  1116. fi
  1117. else
  1118. # No PIC object so indicate it doesn't exist in the libtool
  1119. # object file.
  1120. test -z "$run" && cat >> ${libobj}T <<EOF
  1121. pic_object=none
  1122. EOF
  1123. fi
  1124. # Only build a position-dependent object if we build old libraries.
  1125. if test "$build_old_libs" = yes; then
  1126. if test "$pic_mode" != yes; then
  1127. # Don't build PIC code
  1128. command="$base_compile $qsrcfile"
  1129. else
  1130. command="$base_compile $qsrcfile $pic_flag"
  1131. fi
  1132. if test "$compiler_c_o" = yes; then
  1133. command="$command -o $obj"
  1134. fi
  1135. # Suppress compiler output if we already did a PIC compilation.
  1136. command="$command$suppress_output"
  1137. $run $rm "$obj" "$output_obj"
  1138. $show "$command"
  1139. if $run eval "$command"; then :
  1140. else
  1141. $run $rm $removelist
  1142. exit $EXIT_FAILURE
  1143. fi
  1144. if test "$need_locks" = warn &&
  1145. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1146. $echo "\
  1147. *** ERROR, $lockfile contains:
  1148. `cat $lockfile 2>/dev/null`
  1149. but it should contain:
  1150. $srcfile
  1151. This indicates that another process is trying to use the same
  1152. temporary object file, and libtool could not work around it because
  1153. your compiler does not support \`-c' and \`-o' together. If you
  1154. repeat this compilation, it may succeed, by chance, but you had better
  1155. avoid parallel builds (make -j) in this platform, or get a better
  1156. compiler."
  1157. $run $rm $removelist
  1158. exit $EXIT_FAILURE
  1159. fi
  1160. # Just move the object if needed
  1161. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  1162. $show "$mv $output_obj $obj"
  1163. if $run $mv $output_obj $obj; then :
  1164. else
  1165. error=$?
  1166. $run $rm $removelist
  1167. exit $error
  1168. fi
  1169. fi
  1170. # Append the name of the non-PIC object the libtool object file.
  1171. # Only append if the libtool object file exists.
  1172. test -z "$run" && cat >> ${libobj}T <<EOF
  1173. # Name of the non-PIC object.
  1174. non_pic_object='$objname'
  1175. EOF
  1176. else
  1177. # Append the name of the non-PIC object the libtool object file.
  1178. # Only append if the libtool object file exists.
  1179. test -z "$run" && cat >> ${libobj}T <<EOF
  1180. # Name of the non-PIC object.
  1181. non_pic_object=none
  1182. EOF
  1183. fi
  1184. $run $mv "${libobj}T" "${libobj}"
  1185. # Unlock the critical section if it was locked
  1186. if test "$need_locks" != no; then
  1187. $run $rm "$lockfile"
  1188. fi
  1189. exit $EXIT_SUCCESS
  1190. ;;
  1191. # libtool link mode
  1192. link | relink)
  1193. modename="$modename: link"
  1194. case $host in
  1195. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1196. # It is impossible to link a dll without this setting, and
  1197. # we shouldn't force the makefile maintainer to figure out
  1198. # which system we are compiling for in order to pass an extra
  1199. # flag for every libtool invocation.
  1200. # allow_undefined=no
  1201. # FIXME: Unfortunately, there are problems with the above when trying
  1202. # to make a dll which has undefined symbols, in which case not
  1203. # even a static library is built. For now, we need to specify
  1204. # -no-undefined on the libtool link line when we can be certain
  1205. # that all symbols are satisfied, otherwise we get a static library.
  1206. allow_undefined=yes
  1207. ;;
  1208. *)
  1209. allow_undefined=yes
  1210. ;;
  1211. esac
  1212. libtool_args="$nonopt"
  1213. base_compile="$nonopt $@"
  1214. compile_command="$nonopt"
  1215. finalize_command="$nonopt"
  1216. compile_rpath=
  1217. finalize_rpath=
  1218. compile_shlibpath=
  1219. finalize_shlibpath=
  1220. convenience=
  1221. old_convenience=
  1222. deplibs=
  1223. old_deplibs=
  1224. compiler_flags=
  1225. linker_flags=
  1226. dllsearchpath=
  1227. lib_search_path=`pwd`
  1228. inst_prefix_dir=
  1229. avoid_version=no
  1230. dlfiles=
  1231. dlprefiles=
  1232. dlself=no
  1233. export_dynamic=no
  1234. export_symbols=
  1235. export_symbols_regex=
  1236. generated=
  1237. libobjs=
  1238. ltlibs=
  1239. module=no
  1240. no_install=no
  1241. objs=
  1242. non_pic_objects=
  1243. notinst_path= # paths that contain not-installed libtool libraries
  1244. precious_files_regex=
  1245. prefer_static_libs=no
  1246. preload=no
  1247. prev=
  1248. prevarg=
  1249. release=
  1250. rpath=
  1251. xrpath=
  1252. perm_rpath=
  1253. temp_rpath=
  1254. thread_safe=no
  1255. vinfo=
  1256. vinfo_number=no
  1257. func_infer_tag $base_compile
  1258. # We need to know -static, to get the right output filenames.
  1259. for arg
  1260. do
  1261. case $arg in
  1262. -all-static | -static)
  1263. if test "X$arg" = "X-all-static"; then
  1264. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  1265. $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  1266. fi
  1267. if test -n "$link_static_flag"; then
  1268. dlopen_self=$dlopen_self_static
  1269. fi
  1270. prefer_static_libs=yes
  1271. else
  1272. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1273. dlopen_self=$dlopen_self_static
  1274. fi
  1275. prefer_static_libs=built
  1276. fi
  1277. build_libtool_libs=no
  1278. build_old_libs=yes
  1279. break
  1280. ;;
  1281. esac
  1282. done
  1283. # See if our shared archives depend on static archives.
  1284. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  1285. # Go through the arguments, transforming them on the way.
  1286. while test "$#" -gt 0; do
  1287. arg="$1"
  1288. shift
  1289. case $arg in
  1290. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1291. qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  1292. ;;
  1293. *) qarg=$arg ;;
  1294. esac
  1295. libtool_args="$libtool_args $qarg"
  1296. # If the previous option needs an argument, assign it.
  1297. if test -n "$prev"; then
  1298. case $prev in
  1299. output)
  1300. compile_command="$compile_command @OUTPUT@"
  1301. finalize_command="$finalize_command @OUTPUT@"
  1302. ;;
  1303. esac
  1304. case $prev in
  1305. dlfiles|dlprefiles)
  1306. if test "$preload" = no; then
  1307. # Add the symbol object into the linking commands.
  1308. compile_command="$compile_command @SYMFILE@"
  1309. finalize_command="$finalize_command @SYMFILE@"
  1310. preload=yes
  1311. fi
  1312. case $arg in
  1313. *.la | *.lo) ;; # We handle these cases below.
  1314. force)
  1315. if test "$dlself" = no; then
  1316. dlself=needless
  1317. export_dynamic=yes
  1318. fi
  1319. prev=
  1320. continue
  1321. ;;
  1322. self)
  1323. if test "$prev" = dlprefiles; then
  1324. dlself=yes
  1325. elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  1326. dlself=yes
  1327. else
  1328. dlself=needless
  1329. export_dynamic=yes
  1330. fi
  1331. prev=
  1332. continue
  1333. ;;
  1334. *)
  1335. if test "$prev" = dlfiles; then
  1336. dlfiles="$dlfiles $arg"
  1337. else
  1338. dlprefiles="$dlprefiles $arg"
  1339. fi
  1340. prev=
  1341. continue
  1342. ;;
  1343. esac
  1344. ;;
  1345. expsyms)
  1346. export_symbols="$arg"
  1347. if test ! -f "$arg"; then
  1348. $echo "$modename: symbol file \`$arg' does not exist"
  1349. exit $EXIT_FAILURE
  1350. fi
  1351. prev=
  1352. continue
  1353. ;;
  1354. expsyms_regex)
  1355. export_symbols_regex="$arg"
  1356. prev=
  1357. continue
  1358. ;;
  1359. inst_prefix)
  1360. inst_prefix_dir="$arg"
  1361. prev=
  1362. continue
  1363. ;;
  1364. precious_regex)
  1365. precious_files_regex="$arg"
  1366. prev=
  1367. continue
  1368. ;;
  1369. release)
  1370. release="-$arg"
  1371. prev=
  1372. continue
  1373. ;;
  1374. objectlist)
  1375. if test -f "$arg"; then
  1376. save_arg=$arg
  1377. moreargs=
  1378. for fil in `cat $save_arg`
  1379. do
  1380. # moreargs="$moreargs $fil"
  1381. arg=$fil
  1382. # A libtool-controlled object.
  1383. # Check to see that this really is a libtool object.
  1384. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1385. pic_object=
  1386. non_pic_object=
  1387. # Read the .lo file
  1388. # If there is no directory component, then add one.
  1389. case $arg in
  1390. */* | *\\*) . $arg ;;
  1391. *) . ./$arg ;;
  1392. esac
  1393. if test -z "$pic_object" || \
  1394. test -z "$non_pic_object" ||
  1395. test "$pic_object" = none && \
  1396. test "$non_pic_object" = none; then
  1397. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1398. exit $EXIT_FAILURE
  1399. fi
  1400. # Extract subdirectory from the argument.
  1401. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1402. if test "X$xdir" = "X$arg"; then
  1403. xdir=
  1404. else
  1405. xdir="$xdir/"
  1406. fi
  1407. if test "$pic_object" != none; then
  1408. # Prepend the subdirectory the object is found in.
  1409. pic_object="$xdir$pic_object"
  1410. if test "$prev" = dlfiles; then
  1411. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1412. dlfiles="$dlfiles $pic_object"
  1413. prev=
  1414. continue
  1415. else
  1416. # If libtool objects are unsupported, then we need to preload.
  1417. prev=dlprefiles
  1418. fi
  1419. fi
  1420. # CHECK ME: I think I busted this. -Ossama
  1421. if test "$prev" = dlprefiles; then
  1422. # Preload the old-style object.
  1423. dlprefiles="$dlprefiles $pic_object"
  1424. prev=
  1425. fi
  1426. # A PIC object.
  1427. libobjs="$libobjs $pic_object"
  1428. arg="$pic_object"
  1429. fi
  1430. # Non-PIC object.
  1431. if test "$non_pic_object" != none; then
  1432. # Prepend the subdirectory the object is found in.
  1433. non_pic_object="$xdir$non_pic_object"
  1434. # A standard non-PIC object
  1435. non_pic_objects="$non_pic_objects $non_pic_object"
  1436. if test -z "$pic_object" || test "$pic_object" = none ; then
  1437. arg="$non_pic_object"
  1438. fi
  1439. else
  1440. # If the PIC object exists, use it instead.
  1441. # $xdir was prepended to $pic_object above.
  1442. non_pic_object="$pic_object"
  1443. non_pic_objects="$non_pic_objects $non_pic_object"
  1444. fi
  1445. else
  1446. # Only an error if not doing a dry-run.
  1447. if test -z "$run"; then
  1448. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1449. exit $EXIT_FAILURE
  1450. else
  1451. # Dry-run case.
  1452. # Extract subdirectory from the argument.
  1453. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1454. if test "X$xdir" = "X$arg"; then
  1455. xdir=
  1456. else
  1457. xdir="$xdir/"
  1458. fi
  1459. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1460. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1461. libobjs="$libobjs $pic_object"
  1462. non_pic_objects="$non_pic_objects $non_pic_object"
  1463. fi
  1464. fi
  1465. done
  1466. else
  1467. $echo "$modename: link input file \`$save_arg' does not exist"
  1468. exit $EXIT_FAILURE
  1469. fi
  1470. arg=$save_arg
  1471. prev=
  1472. continue
  1473. ;;
  1474. rpath | xrpath)
  1475. # We need an absolute path.
  1476. case $arg in
  1477. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1478. *)
  1479. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1480. exit $EXIT_FAILURE
  1481. ;;
  1482. esac
  1483. if test "$prev" = rpath; then
  1484. case "$rpath " in
  1485. *" $arg "*) ;;
  1486. *) rpath="$rpath $arg" ;;
  1487. esac
  1488. else
  1489. case "$xrpath " in
  1490. *" $arg "*) ;;
  1491. *) xrpath="$xrpath $arg" ;;
  1492. esac
  1493. fi
  1494. prev=
  1495. continue
  1496. ;;
  1497. xcompiler)
  1498. compiler_flags="$compiler_flags $qarg"
  1499. prev=
  1500. compile_command="$compile_command $qarg"
  1501. finalize_command="$finalize_command $qarg"
  1502. continue
  1503. ;;
  1504. xlinker)
  1505. linker_flags="$linker_flags $qarg"
  1506. compiler_flags="$compiler_flags $wl$qarg"
  1507. prev=
  1508. compile_command="$compile_command $wl$qarg"
  1509. finalize_command="$finalize_command $wl$qarg"
  1510. continue
  1511. ;;
  1512. xcclinker)
  1513. linker_flags="$linker_flags $qarg"
  1514. compiler_flags="$compiler_flags $qarg"
  1515. prev=
  1516. compile_command="$compile_command $qarg"
  1517. finalize_command="$finalize_command $qarg"
  1518. continue
  1519. ;;
  1520. shrext)
  1521. shrext_cmds="$arg"
  1522. prev=
  1523. continue
  1524. ;;
  1525. darwin_framework|darwin_framework_skip)
  1526. test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
  1527. compile_command="$compile_command $arg"
  1528. finalize_command="$finalize_command $arg"
  1529. prev=
  1530. continue
  1531. ;;
  1532. *)
  1533. eval "$prev=\"\$arg\""
  1534. prev=
  1535. continue
  1536. ;;
  1537. esac
  1538. fi # test -n "$prev"
  1539. prevarg="$arg"
  1540. case $arg in
  1541. -all-static)
  1542. if test -n "$link_static_flag"; then
  1543. compile_command="$compile_command $link_static_flag"
  1544. finalize_command="$finalize_command $link_static_flag"
  1545. fi
  1546. continue
  1547. ;;
  1548. -allow-undefined)
  1549. # FIXME: remove this flag sometime in the future.
  1550. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  1551. continue
  1552. ;;
  1553. -avoid-version)
  1554. avoid_version=yes
  1555. continue
  1556. ;;
  1557. -dlopen)
  1558. prev=dlfiles
  1559. continue
  1560. ;;
  1561. -dlpreopen)
  1562. prev=dlprefiles
  1563. continue
  1564. ;;
  1565. -export-dynamic)
  1566. export_dynamic=yes
  1567. continue
  1568. ;;
  1569. -export-symbols | -export-symbols-regex)
  1570. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  1571. $echo "$modename: more than one -exported-symbols argument is not allowed"
  1572. exit $EXIT_FAILURE
  1573. fi
  1574. if test "X$arg" = "X-export-symbols"; then
  1575. prev=expsyms
  1576. else
  1577. prev=expsyms_regex
  1578. fi
  1579. continue
  1580. ;;
  1581. -framework|-arch|-isysroot)
  1582. case " $CC " in
  1583. *" ${arg} ${1} "* | *" ${arg} ${1} "*)
  1584. prev=darwin_framework_skip ;;
  1585. *) compiler_flags="$compiler_flags $arg"
  1586. prev=darwin_framework ;;
  1587. esac
  1588. compile_command="$compile_command $arg"
  1589. finalize_command="$finalize_command $arg"
  1590. continue
  1591. ;;
  1592. -inst-prefix-dir)
  1593. prev=inst_prefix
  1594. continue
  1595. ;;
  1596. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  1597. # so, if we see these flags be careful not to treat them like -L
  1598. -L[A-Z][A-Z]*:*)
  1599. case $with_gcc/$host in
  1600. no/*-*-irix* | /*-*-irix*)
  1601. compile_command="$compile_command $arg"
  1602. finalize_command="$finalize_command $arg"
  1603. ;;
  1604. esac
  1605. continue
  1606. ;;
  1607. -L*)
  1608. dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  1609. # We need an absolute path.
  1610. case $dir in
  1611. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1612. *)
  1613. absdir=`cd "$dir" && pwd`
  1614. if test -z "$absdir"; then
  1615. $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1616. absdir="$dir"
  1617. notinst_path="$notinst_path $dir"
  1618. fi
  1619. dir="$absdir"
  1620. ;;
  1621. esac
  1622. case "$deplibs " in
  1623. *" -L$dir "*) ;;
  1624. *)
  1625. deplibs="$deplibs -L$dir"
  1626. lib_search_path="$lib_search_path $dir"
  1627. ;;
  1628. esac
  1629. case $host in
  1630. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1631. testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  1632. case :$dllsearchpath: in
  1633. *":$dir:"*) ;;
  1634. *) dllsearchpath="$dllsearchpath:$dir";;
  1635. esac
  1636. case :$dllsearchpath: in
  1637. *":$testbindir:"*) ;;
  1638. *) dllsearchpath="$dllsearchpath:$testbindir";;
  1639. esac
  1640. ;;
  1641. esac
  1642. continue
  1643. ;;
  1644. -l*)
  1645. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  1646. case $host in
  1647. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
  1648. # These systems don't actually have a C or math library (as such)
  1649. continue
  1650. ;;
  1651. *-*-os2*)
  1652. # These systems don't actually have a C library (as such)
  1653. test "X$arg" = "X-lc" && continue
  1654. ;;
  1655. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1656. # Do not include libc due to us having libc/libc_r.
  1657. test "X$arg" = "X-lc" && continue
  1658. ;;
  1659. *-*-rhapsody* | *-*-darwin1.[012])
  1660. # Rhapsody C and math libraries are in the System framework
  1661. deplibs="$deplibs -framework System"
  1662. continue
  1663. ;;
  1664. *-*-sco3.2v5* | *-*-sco5v6*)
  1665. # Causes problems with __ctype
  1666. test "X$arg" = "X-lc" && continue
  1667. ;;
  1668. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  1669. # Compiler inserts libc in the correct place for threads to work
  1670. test "X$arg" = "X-lc" && continue
  1671. ;;
  1672. esac
  1673. elif test "X$arg" = "X-lc_r"; then
  1674. case $host in
  1675. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  1676. # Do not include libc_r directly, use -pthread flag.
  1677. continue
  1678. ;;
  1679. esac
  1680. fi
  1681. deplibs="$deplibs $arg"
  1682. continue
  1683. ;;
  1684. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  1685. # classes, name mangling, and exception handling.
  1686. -model)
  1687. compile_command="$compile_command $arg"
  1688. compiler_flags="$compiler_flags $arg"
  1689. finalize_command="$finalize_command $arg"
  1690. prev=xcompiler
  1691. continue
  1692. ;;
  1693. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  1694. compiler_flags="$compiler_flags $arg"
  1695. compile_command="$compile_command $arg"
  1696. finalize_command="$finalize_command $arg"
  1697. continue
  1698. ;;
  1699. -module)
  1700. module=yes
  1701. continue
  1702. ;;
  1703. # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  1704. # -r[0-9][0-9]* specifies the processor on the SGI compiler
  1705. # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  1706. # +DA*, +DD* enable 64-bit mode on the HP compiler
  1707. # -q* pass through compiler args for the IBM compiler
  1708. # -m* pass through architecture-specific compiler args for GCC
  1709. # -m*, -t[45]*, -txscale* pass through architecture-specific
  1710. # compiler args for GCC
  1711. # -pg pass through profiling flag for GCC
  1712. # @file GCC response files
  1713. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
  1714. -t[45]*|-txscale*|@*)
  1715. # Unknown arguments in both finalize_command and compile_command need
  1716. # to be aesthetically quoted because they are evaled later.
  1717. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1718. case $arg in
  1719. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1720. arg="\"$arg\""
  1721. ;;
  1722. esac
  1723. compile_command="$compile_command $arg"
  1724. finalize_command="$finalize_command $arg"
  1725. compiler_flags="$compiler_flags $arg"
  1726. continue
  1727. ;;
  1728. -shrext)
  1729. prev=shrext
  1730. continue
  1731. ;;
  1732. -no-fast-install)
  1733. fast_install=no
  1734. continue
  1735. ;;
  1736. -no-install)
  1737. case $host in
  1738. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  1739. # The PATH hackery in wrapper scripts is required on Windows
  1740. # in order for the loader to find any dlls it needs.
  1741. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  1742. $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  1743. fast_install=no
  1744. ;;
  1745. *) no_install=yes ;;
  1746. esac
  1747. continue
  1748. ;;
  1749. -no-undefined)
  1750. allow_undefined=no
  1751. continue
  1752. ;;
  1753. -objectlist)
  1754. prev=objectlist
  1755. continue
  1756. ;;
  1757. -o) prev=output ;;
  1758. -precious-files-regex)
  1759. prev=precious_regex
  1760. continue
  1761. ;;
  1762. -release)
  1763. prev=release
  1764. continue
  1765. ;;
  1766. -rpath)
  1767. prev=rpath
  1768. continue
  1769. ;;
  1770. -R)
  1771. prev=xrpath
  1772. continue
  1773. ;;
  1774. -R*)
  1775. dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1776. # We need an absolute path.
  1777. case $dir in
  1778. [\\/]* | [A-Za-z]:[\\/]*) ;;
  1779. *)
  1780. $echo "$modename: only absolute run-paths are allowed" 1>&2
  1781. exit $EXIT_FAILURE
  1782. ;;
  1783. esac
  1784. case "$xrpath " in
  1785. *" $dir "*) ;;
  1786. *) xrpath="$xrpath $dir" ;;
  1787. esac
  1788. continue
  1789. ;;
  1790. -static)
  1791. # The effects of -static are defined in a previous loop.
  1792. # We used to do the same as -all-static on platforms that
  1793. # didn't have a PIC flag, but the assumption that the effects
  1794. # would be equivalent was wrong. It would break on at least
  1795. # Digital Unix and AIX.
  1796. continue
  1797. ;;
  1798. -thread-safe)
  1799. thread_safe=yes
  1800. continue
  1801. ;;
  1802. -version-info)
  1803. prev=vinfo
  1804. continue
  1805. ;;
  1806. -version-number)
  1807. prev=vinfo
  1808. vinfo_number=yes
  1809. continue
  1810. ;;
  1811. -Wc,*)
  1812. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  1813. arg=
  1814. save_ifs="$IFS"; IFS=','
  1815. for flag in $args; do
  1816. IFS="$save_ifs"
  1817. case $flag in
  1818. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1819. flag="\"$flag\""
  1820. ;;
  1821. esac
  1822. arg="$arg $wl$flag"
  1823. compiler_flags="$compiler_flags $flag"
  1824. done
  1825. IFS="$save_ifs"
  1826. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1827. ;;
  1828. -Wl,*)
  1829. args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  1830. arg=
  1831. save_ifs="$IFS"; IFS=','
  1832. for flag in $args; do
  1833. IFS="$save_ifs"
  1834. case $flag in
  1835. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1836. flag="\"$flag\""
  1837. ;;
  1838. esac
  1839. arg="$arg $wl$flag"
  1840. compiler_flags="$compiler_flags $wl$flag"
  1841. linker_flags="$linker_flags $flag"
  1842. done
  1843. IFS="$save_ifs"
  1844. arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  1845. ;;
  1846. -Xcompiler)
  1847. prev=xcompiler
  1848. continue
  1849. ;;
  1850. -Xlinker)
  1851. prev=xlinker
  1852. continue
  1853. ;;
  1854. -XCClinker)
  1855. prev=xcclinker
  1856. continue
  1857. ;;
  1858. # Some other compiler flag.
  1859. -* | +*)
  1860. # Unknown arguments in both finalize_command and compile_command need
  1861. # to be aesthetically quoted because they are evaled later.
  1862. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1863. case $arg in
  1864. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1865. arg="\"$arg\""
  1866. ;;
  1867. esac
  1868. ;;
  1869. *.$objext)
  1870. # A standard object.
  1871. objs="$objs $arg"
  1872. ;;
  1873. *.lo)
  1874. # A libtool-controlled object.
  1875. # Check to see that this really is a libtool object.
  1876. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  1877. pic_object=
  1878. non_pic_object=
  1879. # Read the .lo file
  1880. # If there is no directory component, then add one.
  1881. case $arg in
  1882. */* | *\\*) . $arg ;;
  1883. *) . ./$arg ;;
  1884. esac
  1885. if test -z "$pic_object" || \
  1886. test -z "$non_pic_object" ||
  1887. test "$pic_object" = none && \
  1888. test "$non_pic_object" = none; then
  1889. $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  1890. exit $EXIT_FAILURE
  1891. fi
  1892. # Extract subdirectory from the argument.
  1893. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1894. if test "X$xdir" = "X$arg"; then
  1895. xdir=
  1896. else
  1897. xdir="$xdir/"
  1898. fi
  1899. if test "$pic_object" != none; then
  1900. # Prepend the subdirectory the object is found in.
  1901. pic_object="$xdir$pic_object"
  1902. if test "$prev" = dlfiles; then
  1903. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
  1904. dlfiles="$dlfiles $pic_object"
  1905. prev=
  1906. continue
  1907. else
  1908. # If libtool objects are unsupported, then we need to preload.
  1909. prev=dlprefiles
  1910. fi
  1911. fi
  1912. # CHECK ME: I think I busted this. -Ossama
  1913. if test "$prev" = dlprefiles; then
  1914. # Preload the old-style object.
  1915. dlprefiles="$dlprefiles $pic_object"
  1916. prev=
  1917. fi
  1918. # A PIC object.
  1919. libobjs="$libobjs $pic_object"
  1920. arg="$pic_object"
  1921. fi
  1922. # Non-PIC object.
  1923. if test "$non_pic_object" != none; then
  1924. # Prepend the subdirectory the object is found in.
  1925. non_pic_object="$xdir$non_pic_object"
  1926. # A standard non-PIC object
  1927. non_pic_objects="$non_pic_objects $non_pic_object"
  1928. if test -z "$pic_object" || test "$pic_object" = none ; then
  1929. arg="$non_pic_object"
  1930. fi
  1931. else
  1932. # If the PIC object exists, use it instead.
  1933. # $xdir was prepended to $pic_object above.
  1934. non_pic_object="$pic_object"
  1935. non_pic_objects="$non_pic_objects $non_pic_object"
  1936. fi
  1937. else
  1938. # Only an error if not doing a dry-run.
  1939. if test -z "$run"; then
  1940. $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  1941. exit $EXIT_FAILURE
  1942. else
  1943. # Dry-run case.
  1944. # Extract subdirectory from the argument.
  1945. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1946. if test "X$xdir" = "X$arg"; then
  1947. xdir=
  1948. else
  1949. xdir="$xdir/"
  1950. fi
  1951. pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  1952. non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  1953. libobjs="$libobjs $pic_object"
  1954. non_pic_objects="$non_pic_objects $non_pic_object"
  1955. fi
  1956. fi
  1957. ;;
  1958. *.$libext)
  1959. # An archive.
  1960. deplibs="$deplibs $arg"
  1961. old_deplibs="$old_deplibs $arg"
  1962. continue
  1963. ;;
  1964. *.la)
  1965. # A libtool-controlled library.
  1966. if test "$prev" = dlfiles; then
  1967. # This library was specified with -dlopen.
  1968. dlfiles="$dlfiles $arg"
  1969. prev=
  1970. elif test "$prev" = dlprefiles; then
  1971. # The library was specified with -dlpreopen.
  1972. dlprefiles="$dlprefiles $arg"
  1973. prev=
  1974. else
  1975. deplibs="$deplibs $arg"
  1976. fi
  1977. continue
  1978. ;;
  1979. # Some other compiler argument.
  1980. *)
  1981. # Unknown arguments in both finalize_command and compile_command need
  1982. # to be aesthetically quoted because they are evaled later.
  1983. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1984. case $arg in
  1985. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1986. arg="\"$arg\""
  1987. ;;
  1988. esac
  1989. ;;
  1990. esac # arg
  1991. # Now actually substitute the argument into the commands.
  1992. if test -n "$arg"; then
  1993. compile_command="$compile_command $arg"
  1994. finalize_command="$finalize_command $arg"
  1995. fi
  1996. done # argument parsing loop
  1997. if test -n "$prev"; then
  1998. $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  1999. $echo "$help" 1>&2
  2000. exit $EXIT_FAILURE
  2001. fi
  2002. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  2003. eval arg=\"$export_dynamic_flag_spec\"
  2004. compile_command="$compile_command $arg"
  2005. finalize_command="$finalize_command $arg"
  2006. fi
  2007. oldlibs=
  2008. # calculate the name of the file, without its directory
  2009. outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  2010. libobjs_save="$libobjs"
  2011. if test -n "$shlibpath_var"; then
  2012. # get the directories listed in $shlibpath_var
  2013. eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  2014. else
  2015. shlib_search_path=
  2016. fi
  2017. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  2018. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  2019. output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2020. if test "X$output_objdir" = "X$output"; then
  2021. output_objdir="$objdir"
  2022. else
  2023. output_objdir="$output_objdir/$objdir"
  2024. fi
  2025. # Create the object directory.
  2026. if test ! -d "$output_objdir"; then
  2027. $show "$mkdir $output_objdir"
  2028. $run $mkdir $output_objdir
  2029. exit_status=$?
  2030. if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
  2031. exit $exit_status
  2032. fi
  2033. fi
  2034. # Determine the type of output
  2035. case $output in
  2036. "")
  2037. $echo "$modename: you must specify an output file" 1>&2
  2038. $echo "$help" 1>&2
  2039. exit $EXIT_FAILURE
  2040. ;;
  2041. *.$libext) linkmode=oldlib ;;
  2042. *.lo | *.$objext) linkmode=obj ;;
  2043. *.la) linkmode=lib ;;
  2044. *) linkmode=prog ;; # Anything else should be a program.
  2045. esac
  2046. case $host in
  2047. *cygwin* | *mingw* | *pw32*)
  2048. # don't eliminate duplications in $postdeps and $predeps
  2049. duplicate_compiler_generated_deps=yes
  2050. ;;
  2051. *)
  2052. duplicate_compiler_generated_deps=$duplicate_deps
  2053. ;;
  2054. esac
  2055. specialdeplibs=
  2056. libs=
  2057. # Find all interdependent deplibs by searching for libraries
  2058. # that are linked more than once (e.g. -la -lb -la)
  2059. for deplib in $deplibs; do
  2060. if test "X$duplicate_deps" = "Xyes" ; then
  2061. case "$libs " in
  2062. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2063. esac
  2064. fi
  2065. libs="$libs $deplib"
  2066. done
  2067. if test "$linkmode" = lib; then
  2068. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  2069. # Compute libraries that are listed more than once in $predeps
  2070. # $postdeps and mark them as special (i.e., whose duplicates are
  2071. # not to be eliminated).
  2072. pre_post_deps=
  2073. if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
  2074. for pre_post_dep in $predeps $postdeps; do
  2075. case "$pre_post_deps " in
  2076. *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  2077. esac
  2078. pre_post_deps="$pre_post_deps $pre_post_dep"
  2079. done
  2080. fi
  2081. pre_post_deps=
  2082. fi
  2083. deplibs=
  2084. newdependency_libs=
  2085. newlib_search_path=
  2086. need_relink=no # whether we're linking any uninstalled libtool libraries
  2087. notinst_deplibs= # not-installed libtool libraries
  2088. case $linkmode in
  2089. lib)
  2090. passes="conv link"
  2091. for file in $dlfiles $dlprefiles; do
  2092. case $file in
  2093. *.la) ;;
  2094. *)
  2095. $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  2096. exit $EXIT_FAILURE
  2097. ;;
  2098. esac
  2099. done
  2100. ;;
  2101. prog)
  2102. compile_deplibs=
  2103. finalize_deplibs=
  2104. alldeplibs=no
  2105. newdlfiles=
  2106. newdlprefiles=
  2107. passes="conv scan dlopen dlpreopen link"
  2108. ;;
  2109. *) passes="conv"
  2110. ;;
  2111. esac
  2112. for pass in $passes; do
  2113. if test "$linkmode,$pass" = "lib,link" ||
  2114. test "$linkmode,$pass" = "prog,scan"; then
  2115. libs="$deplibs"
  2116. deplibs=
  2117. fi
  2118. if test "$linkmode" = prog; then
  2119. case $pass in
  2120. dlopen) libs="$dlfiles" ;;
  2121. dlpreopen) libs="$dlprefiles" ;;
  2122. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  2123. esac
  2124. fi
  2125. if test "$pass" = dlopen; then
  2126. # Collect dlpreopened libraries
  2127. save_deplibs="$deplibs"
  2128. deplibs=
  2129. fi
  2130. for deplib in $libs; do
  2131. lib=
  2132. found=no
  2133. case $deplib in
  2134. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
  2135. if test "$linkmode,$pass" = "prog,link"; then
  2136. compile_deplibs="$deplib $compile_deplibs"
  2137. finalize_deplibs="$deplib $finalize_deplibs"
  2138. else
  2139. compiler_flags="$compiler_flags $deplib"
  2140. fi
  2141. continue
  2142. ;;
  2143. -l*)
  2144. if test "$linkmode" != lib && test "$linkmode" != prog; then
  2145. $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  2146. continue
  2147. fi
  2148. name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  2149. for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
  2150. for search_ext in .la $std_shrext .so .a; do
  2151. # Search the libtool library
  2152. lib="$searchdir/lib${name}${search_ext}"
  2153. if test -f "$lib"; then
  2154. if test "$search_ext" = ".la"; then
  2155. found=yes
  2156. else
  2157. found=no
  2158. fi
  2159. break 2
  2160. fi
  2161. done
  2162. done
  2163. if test "$found" != yes; then
  2164. # deplib doesn't seem to be a libtool library
  2165. if test "$linkmode,$pass" = "prog,link"; then
  2166. compile_deplibs="$deplib $compile_deplibs"
  2167. finalize_deplibs="$deplib $finalize_deplibs"
  2168. else
  2169. deplibs="$deplib $deplibs"
  2170. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  2171. fi
  2172. continue
  2173. else # deplib is a libtool library
  2174. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  2175. # We need to do some special things here, and not later.
  2176. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  2177. case " $predeps $postdeps " in
  2178. *" $deplib "*)
  2179. if (${SED} -e '2q' $lib |
  2180. grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  2181. library_names=
  2182. old_library=
  2183. case $lib in
  2184. */* | *\\*) . $lib ;;
  2185. *) . ./$lib ;;
  2186. esac
  2187. for l in $old_library $library_names; do
  2188. ll="$l"
  2189. done
  2190. if test "X$ll" = "X$old_library" ; then # only static version available
  2191. found=no
  2192. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2193. test "X$ladir" = "X$lib" && ladir="."
  2194. lib=$ladir/$old_library
  2195. if test "$linkmode,$pass" = "prog,link"; then
  2196. compile_deplibs="$deplib $compile_deplibs"
  2197. finalize_deplibs="$deplib $finalize_deplibs"
  2198. else
  2199. deplibs="$deplib $deplibs"
  2200. test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
  2201. fi
  2202. continue
  2203. fi
  2204. fi
  2205. ;;
  2206. *) ;;
  2207. esac
  2208. fi
  2209. fi
  2210. ;; # -l
  2211. -L*)
  2212. case $linkmode in
  2213. lib)
  2214. deplibs="$deplib $deplibs"
  2215. test "$pass" = conv && continue
  2216. newdependency_libs="$deplib $newdependency_libs"
  2217. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  2218. ;;
  2219. prog)
  2220. if test "$pass" = conv; then
  2221. deplibs="$deplib $deplibs"
  2222. continue
  2223. fi
  2224. if test "$pass" = scan; then
  2225. deplibs="$deplib $deplibs"
  2226. else
  2227. compile_deplibs="$deplib $compile_deplibs"
  2228. finalize_deplibs="$deplib $finalize_deplibs"
  2229. fi
  2230. newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  2231. ;;
  2232. *)
  2233. $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  2234. ;;
  2235. esac # linkmode
  2236. continue
  2237. ;; # -L
  2238. -R*)
  2239. if test "$pass" = link; then
  2240. dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  2241. # Make sure the xrpath contains only unique directories.
  2242. case "$xrpath " in
  2243. *" $dir "*) ;;
  2244. *) xrpath="$xrpath $dir" ;;
  2245. esac
  2246. fi
  2247. deplibs="$deplib $deplibs"
  2248. continue
  2249. ;;
  2250. *.la) lib="$deplib" ;;
  2251. *.$libext)
  2252. if test "$pass" = conv; then
  2253. deplibs="$deplib $deplibs"
  2254. continue
  2255. fi
  2256. case $linkmode in
  2257. lib)
  2258. valid_a_lib=no
  2259. case $deplibs_check_method in
  2260. match_pattern*)
  2261. set dummy $deplibs_check_method
  2262. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  2263. if eval $echo \"$deplib\" 2>/dev/null \
  2264. | $SED 10q \
  2265. | $EGREP "$match_pattern_regex" > /dev/null; then
  2266. valid_a_lib=yes
  2267. fi
  2268. ;;
  2269. pass_all)
  2270. valid_a_lib=yes
  2271. ;;
  2272. esac
  2273. if test "$valid_a_lib" != yes; then
  2274. $echo
  2275. $echo "*** Warning: Trying to link with static lib archive $deplib."
  2276. $echo "*** I have the capability to make that library automatically link in when"
  2277. $echo "*** you link to this library. But I can only do this if you have a"
  2278. $echo "*** shared version of the library, which you do not appear to have"
  2279. $echo "*** because the file extensions .$libext of this argument makes me believe"
  2280. $echo "*** that it is just a static archive that I should not used here."
  2281. else
  2282. $echo
  2283. $echo "*** Warning: Linking the shared library $output against the"
  2284. $echo "*** static library $deplib is not portable!"
  2285. deplibs="$deplib $deplibs"
  2286. fi
  2287. continue
  2288. ;;
  2289. prog)
  2290. if test "$pass" != link; then
  2291. deplibs="$deplib $deplibs"
  2292. else
  2293. compile_deplibs="$deplib $compile_deplibs"
  2294. finalize_deplibs="$deplib $finalize_deplibs"
  2295. fi
  2296. continue
  2297. ;;
  2298. esac # linkmode
  2299. ;; # *.$libext
  2300. *.lo | *.$objext)
  2301. if test "$pass" = conv; then
  2302. deplibs="$deplib $deplibs"
  2303. elif test "$linkmode" = prog; then
  2304. if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
  2305. # If there is no dlopen support or we're linking statically,
  2306. # we need to preload.
  2307. newdlprefiles="$newdlprefiles $deplib"
  2308. compile_deplibs="$deplib $compile_deplibs"
  2309. finalize_deplibs="$deplib $finalize_deplibs"
  2310. else
  2311. newdlfiles="$newdlfiles $deplib"
  2312. fi
  2313. fi
  2314. continue
  2315. ;;
  2316. %DEPLIBS%)
  2317. alldeplibs=yes
  2318. continue
  2319. ;;
  2320. esac # case $deplib
  2321. if test "$found" = yes || test -f "$lib"; then :
  2322. else
  2323. $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
  2324. exit $EXIT_FAILURE
  2325. fi
  2326. # Check to see that this really is a libtool archive.
  2327. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  2328. else
  2329. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  2330. exit $EXIT_FAILURE
  2331. fi
  2332. ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  2333. test "X$ladir" = "X$lib" && ladir="."
  2334. dlname=
  2335. dlopen=
  2336. dlpreopen=
  2337. libdir=
  2338. library_names=
  2339. old_library=
  2340. # If the library was installed with an old release of libtool,
  2341. # it will not redefine variables installed, or shouldnotlink
  2342. installed=yes
  2343. shouldnotlink=no
  2344. avoidtemprpath=
  2345. # Read the .la file
  2346. case $lib in
  2347. */* | *\\*) . $lib ;;
  2348. *) . ./$lib ;;
  2349. esac
  2350. if test "$linkmode,$pass" = "lib,link" ||
  2351. test "$linkmode,$pass" = "prog,scan" ||
  2352. { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  2353. test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
  2354. test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
  2355. fi
  2356. if test "$pass" = conv; then
  2357. # Only check for convenience libraries
  2358. deplibs="$lib $deplibs"
  2359. if test -z "$libdir"; then
  2360. if test -z "$old_library"; then
  2361. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2362. exit $EXIT_FAILURE
  2363. fi
  2364. # It is a libtool convenience library, so add in its objects.
  2365. convenience="$convenience $ladir/$objdir/$old_library"
  2366. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  2367. tmp_libs=
  2368. for deplib in $dependency_libs; do
  2369. deplibs="$deplib $deplibs"
  2370. if test "X$duplicate_deps" = "Xyes" ; then
  2371. case "$tmp_libs " in
  2372. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2373. esac
  2374. fi
  2375. tmp_libs="$tmp_libs $deplib"
  2376. done
  2377. elif test "$linkmode" != prog && test "$linkmode" != lib; then
  2378. $echo "$modename: \`$lib' is not a convenience library" 1>&2
  2379. exit $EXIT_FAILURE
  2380. fi
  2381. continue
  2382. fi # $pass = conv
  2383. # Get the name of the library we link against.
  2384. linklib=
  2385. for l in $old_library $library_names; do
  2386. linklib="$l"
  2387. done
  2388. if test -z "$linklib"; then
  2389. $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  2390. exit $EXIT_FAILURE
  2391. fi
  2392. # This library was specified with -dlopen.
  2393. if test "$pass" = dlopen; then
  2394. if test -z "$libdir"; then
  2395. $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  2396. exit $EXIT_FAILURE
  2397. fi
  2398. if test -z "$dlname" ||
  2399. test "$dlopen_support" != yes ||
  2400. test "$build_libtool_libs" = no; then
  2401. # If there is no dlname, no dlopen support or we're linking
  2402. # statically, we need to preload. We also need to preload any
  2403. # dependent libraries so libltdl's deplib preloader doesn't
  2404. # bomb out in the load deplibs phase.
  2405. dlprefiles="$dlprefiles $lib $dependency_libs"
  2406. else
  2407. newdlfiles="$newdlfiles $lib"
  2408. fi
  2409. continue
  2410. fi # $pass = dlopen
  2411. # We need an absolute path.
  2412. case $ladir in
  2413. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
  2414. *)
  2415. abs_ladir=`cd "$ladir" && pwd`
  2416. if test -z "$abs_ladir"; then
  2417. $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  2418. $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  2419. abs_ladir="$ladir"
  2420. fi
  2421. ;;
  2422. esac
  2423. laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  2424. # Find the relevant object directory and library name.
  2425. if test "X$installed" = Xyes; then
  2426. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2427. $echo "$modename: warning: library \`$lib' was moved." 1>&2
  2428. dir="$ladir"
  2429. absdir="$abs_ladir"
  2430. libdir="$abs_ladir"
  2431. else
  2432. dir="$libdir"
  2433. absdir="$libdir"
  2434. fi
  2435. test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
  2436. else
  2437. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  2438. dir="$ladir"
  2439. absdir="$abs_ladir"
  2440. # Remove this search path later
  2441. notinst_path="$notinst_path $abs_ladir"
  2442. else
  2443. dir="$ladir/$objdir"
  2444. absdir="$abs_ladir/$objdir"
  2445. # Remove this search path later
  2446. notinst_path="$notinst_path $abs_ladir"
  2447. fi
  2448. fi # $installed = yes
  2449. name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  2450. # This library was specified with -dlpreopen.
  2451. if test "$pass" = dlpreopen; then
  2452. if test -z "$libdir"; then
  2453. $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  2454. exit $EXIT_FAILURE
  2455. fi
  2456. # Prefer using a static library (so that no silly _DYNAMIC symbols
  2457. # are required to link).
  2458. if test -n "$old_library"; then
  2459. newdlprefiles="$newdlprefiles $dir/$old_library"
  2460. # Otherwise, use the dlname, so that lt_dlopen finds it.
  2461. elif test -n "$dlname"; then
  2462. newdlprefiles="$newdlprefiles $dir/$dlname"
  2463. else
  2464. newdlprefiles="$newdlprefiles $dir/$linklib"
  2465. fi
  2466. fi # $pass = dlpreopen
  2467. if test -z "$libdir"; then
  2468. # Link the convenience library
  2469. if test "$linkmode" = lib; then
  2470. deplibs="$dir/$old_library $deplibs"
  2471. elif test "$linkmode,$pass" = "prog,link"; then
  2472. compile_deplibs="$dir/$old_library $compile_deplibs"
  2473. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  2474. else
  2475. deplibs="$lib $deplibs" # used for prog,scan pass
  2476. fi
  2477. continue
  2478. fi
  2479. if test "$linkmode" = prog && test "$pass" != link; then
  2480. newlib_search_path="$newlib_search_path $ladir"
  2481. deplibs="$lib $deplibs"
  2482. linkalldeplibs=no
  2483. if test "$link_all_deplibs" != no || test -z "$library_names" ||
  2484. test "$build_libtool_libs" = no; then
  2485. linkalldeplibs=yes
  2486. fi
  2487. tmp_libs=
  2488. for deplib in $dependency_libs; do
  2489. case $deplib in
  2490. -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  2491. esac
  2492. # Need to link against all dependency_libs?
  2493. if test "$linkalldeplibs" = yes; then
  2494. deplibs="$deplib $deplibs"
  2495. else
  2496. # Need to hardcode shared library paths
  2497. # or/and link against static libraries
  2498. newdependency_libs="$deplib $newdependency_libs"
  2499. fi
  2500. if test "X$duplicate_deps" = "Xyes" ; then
  2501. case "$tmp_libs " in
  2502. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2503. esac
  2504. fi
  2505. tmp_libs="$tmp_libs $deplib"
  2506. done # for deplib
  2507. continue
  2508. fi # $linkmode = prog...
  2509. if test "$linkmode,$pass" = "prog,link"; then
  2510. if test -n "$library_names" &&
  2511. { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
  2512. # We need to hardcode the library path
  2513. if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  2514. # Make sure the rpath contains only unique directories.
  2515. case "$temp_rpath " in
  2516. *" $dir "*) ;;
  2517. *" $absdir "*) ;;
  2518. *) temp_rpath="$temp_rpath $absdir" ;;
  2519. esac
  2520. fi
  2521. # Hardcode the library path.
  2522. # Skip directories that are in the system default run-time
  2523. # search path.
  2524. case " $sys_lib_dlsearch_path " in
  2525. *" $absdir "*) ;;
  2526. *)
  2527. case "$compile_rpath " in
  2528. *" $absdir "*) ;;
  2529. *) compile_rpath="$compile_rpath $absdir"
  2530. esac
  2531. ;;
  2532. esac
  2533. case " $sys_lib_dlsearch_path " in
  2534. *" $libdir "*) ;;
  2535. *)
  2536. case "$finalize_rpath " in
  2537. *" $libdir "*) ;;
  2538. *) finalize_rpath="$finalize_rpath $libdir"
  2539. esac
  2540. ;;
  2541. esac
  2542. fi # $linkmode,$pass = prog,link...
  2543. if test "$alldeplibs" = yes &&
  2544. { test "$deplibs_check_method" = pass_all ||
  2545. { test "$build_libtool_libs" = yes &&
  2546. test -n "$library_names"; }; }; then
  2547. # We only need to search for static libraries
  2548. continue
  2549. fi
  2550. fi
  2551. link_static=no # Whether the deplib will be linked statically
  2552. use_static_libs=$prefer_static_libs
  2553. if test "$use_static_libs" = built && test "$installed" = yes ; then
  2554. use_static_libs=no
  2555. fi
  2556. if test -n "$library_names" &&
  2557. { test "$use_static_libs" = no || test -z "$old_library"; }; then
  2558. if test "$installed" = no; then
  2559. notinst_deplibs="$notinst_deplibs $lib"
  2560. need_relink=yes
  2561. fi
  2562. # This is a shared library
  2563. # Warn about portability, can't link against -module's on
  2564. # some systems (darwin)
  2565. if test "$shouldnotlink" = yes && test "$pass" = link ; then
  2566. $echo
  2567. if test "$linkmode" = prog; then
  2568. $echo "*** Warning: Linking the executable $output against the loadable module"
  2569. else
  2570. $echo "*** Warning: Linking the shared library $output against the loadable module"
  2571. fi
  2572. $echo "*** $linklib is not portable!"
  2573. fi
  2574. if test "$linkmode" = lib &&
  2575. test "$hardcode_into_libs" = yes; then
  2576. # Hardcode the library path.
  2577. # Skip directories that are in the system default run-time
  2578. # search path.
  2579. case " $sys_lib_dlsearch_path " in
  2580. *" $absdir "*) ;;
  2581. *)
  2582. case "$compile_rpath " in
  2583. *" $absdir "*) ;;
  2584. *) compile_rpath="$compile_rpath $absdir"
  2585. esac
  2586. ;;
  2587. esac
  2588. case " $sys_lib_dlsearch_path " in
  2589. *" $libdir "*) ;;
  2590. *)
  2591. case "$finalize_rpath " in
  2592. *" $libdir "*) ;;
  2593. *) finalize_rpath="$finalize_rpath $libdir"
  2594. esac
  2595. ;;
  2596. esac
  2597. fi
  2598. if test -n "$old_archive_from_expsyms_cmds"; then
  2599. # figure out the soname
  2600. set dummy $library_names
  2601. realname="$2"
  2602. shift; shift
  2603. libname=`eval \\$echo \"$libname_spec\"`
  2604. # use dlname if we got it. it's perfectly good, no?
  2605. if test -n "$dlname"; then
  2606. soname="$dlname"
  2607. elif test -n "$soname_spec"; then
  2608. # bleh windows
  2609. case $host in
  2610. *cygwin* | mingw*)
  2611. major=`expr $current - $age`
  2612. versuffix="-$major"
  2613. ;;
  2614. esac
  2615. eval soname=\"$soname_spec\"
  2616. else
  2617. soname="$realname"
  2618. fi
  2619. # Make a new name for the extract_expsyms_cmds to use
  2620. soroot="$soname"
  2621. soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
  2622. newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  2623. # If the library has no export list, then create one now
  2624. if test -f "$output_objdir/$soname-def"; then :
  2625. else
  2626. $show "extracting exported symbol list from \`$soname'"
  2627. save_ifs="$IFS"; IFS='~'
  2628. cmds=$extract_expsyms_cmds
  2629. for cmd in $cmds; do
  2630. IFS="$save_ifs"
  2631. eval cmd=\"$cmd\"
  2632. $show "$cmd"
  2633. $run eval "$cmd" || exit $?
  2634. done
  2635. IFS="$save_ifs"
  2636. fi
  2637. # Create $newlib
  2638. if test -f "$output_objdir/$newlib"; then :; else
  2639. $show "generating import library for \`$soname'"
  2640. save_ifs="$IFS"; IFS='~'
  2641. cmds=$old_archive_from_expsyms_cmds
  2642. for cmd in $cmds; do
  2643. IFS="$save_ifs"
  2644. eval cmd=\"$cmd\"
  2645. $show "$cmd"
  2646. $run eval "$cmd" || exit $?
  2647. done
  2648. IFS="$save_ifs"
  2649. fi
  2650. # make sure the library variables are pointing to the new library
  2651. dir=$output_objdir
  2652. linklib=$newlib
  2653. fi # test -n "$old_archive_from_expsyms_cmds"
  2654. if test "$linkmode" = prog || test "$mode" != relink; then
  2655. add_shlibpath=
  2656. add_dir=
  2657. add=
  2658. lib_linked=yes
  2659. case $hardcode_action in
  2660. immediate | unsupported)
  2661. if test "$hardcode_direct" = no; then
  2662. add="$dir/$linklib"
  2663. case $host in
  2664. *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
  2665. *-*-sysv4*uw2*) add_dir="-L$dir" ;;
  2666. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  2667. *-*-unixware7*) add_dir="-L$dir" ;;
  2668. *-*-darwin* )
  2669. # if the lib is a module then we can not link against
  2670. # it, someone is ignoring the new warnings I added
  2671. if /usr/bin/file -L $add 2> /dev/null |
  2672. $EGREP ": [^:]* bundle" >/dev/null ; then
  2673. $echo "** Warning, lib $linklib is a module, not a shared library"
  2674. if test -z "$old_library" ; then
  2675. $echo
  2676. $echo "** And there doesn't seem to be a static archive available"
  2677. $echo "** The link will probably fail, sorry"
  2678. else
  2679. add="$dir/$old_library"
  2680. fi
  2681. fi
  2682. esac
  2683. elif test "$hardcode_minus_L" = no; then
  2684. case $host in
  2685. *-*-sunos*) add_shlibpath="$dir" ;;
  2686. esac
  2687. add_dir="-L$dir"
  2688. add="-l$name"
  2689. elif test "$hardcode_shlibpath_var" = no; then
  2690. add_shlibpath="$dir"
  2691. add="-l$name"
  2692. else
  2693. lib_linked=no
  2694. fi
  2695. ;;
  2696. relink)
  2697. if test "$hardcode_direct" = yes; then
  2698. add="$dir/$linklib"
  2699. elif test "$hardcode_minus_L" = yes; then
  2700. add_dir="-L$dir"
  2701. # Try looking first in the location we're being installed to.
  2702. if test -n "$inst_prefix_dir"; then
  2703. case $libdir in
  2704. [\\/]*)
  2705. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2706. ;;
  2707. esac
  2708. fi
  2709. add="-l$name"
  2710. elif test "$hardcode_shlibpath_var" = yes; then
  2711. add_shlibpath="$dir"
  2712. add="-l$name"
  2713. else
  2714. lib_linked=no
  2715. fi
  2716. ;;
  2717. *) lib_linked=no ;;
  2718. esac
  2719. if test "$lib_linked" != yes; then
  2720. $echo "$modename: configuration error: unsupported hardcode properties"
  2721. exit $EXIT_FAILURE
  2722. fi
  2723. if test -n "$add_shlibpath"; then
  2724. case :$compile_shlibpath: in
  2725. *":$add_shlibpath:"*) ;;
  2726. *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
  2727. esac
  2728. fi
  2729. if test "$linkmode" = prog; then
  2730. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  2731. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  2732. else
  2733. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2734. test -n "$add" && deplibs="$add $deplibs"
  2735. if test "$hardcode_direct" != yes && \
  2736. test "$hardcode_minus_L" != yes && \
  2737. test "$hardcode_shlibpath_var" = yes; then
  2738. case :$finalize_shlibpath: in
  2739. *":$libdir:"*) ;;
  2740. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2741. esac
  2742. fi
  2743. fi
  2744. fi
  2745. if test "$linkmode" = prog || test "$mode" = relink; then
  2746. add_shlibpath=
  2747. add_dir=
  2748. add=
  2749. # Finalize command for both is simple: just hardcode it.
  2750. if test "$hardcode_direct" = yes; then
  2751. add="$libdir/$linklib"
  2752. elif test "$hardcode_minus_L" = yes; then
  2753. add_dir="-L$libdir"
  2754. add="-l$name"
  2755. elif test "$hardcode_shlibpath_var" = yes; then
  2756. case :$finalize_shlibpath: in
  2757. *":$libdir:"*) ;;
  2758. *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
  2759. esac
  2760. add="-l$name"
  2761. elif test "$hardcode_automatic" = yes; then
  2762. if test -n "$inst_prefix_dir" &&
  2763. test -f "$inst_prefix_dir$libdir/$linklib" ; then
  2764. add="$inst_prefix_dir$libdir/$linklib"
  2765. else
  2766. add="$libdir/$linklib"
  2767. fi
  2768. else
  2769. # We cannot seem to hardcode it, guess we'll fake it.
  2770. add_dir="-L$libdir"
  2771. # Try looking first in the location we're being installed to.
  2772. if test -n "$inst_prefix_dir"; then
  2773. case $libdir in
  2774. [\\/]*)
  2775. add_dir="$add_dir -L$inst_prefix_dir$libdir"
  2776. ;;
  2777. esac
  2778. fi
  2779. add="-l$name"
  2780. fi
  2781. if test "$linkmode" = prog; then
  2782. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  2783. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  2784. else
  2785. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  2786. test -n "$add" && deplibs="$add $deplibs"
  2787. fi
  2788. fi
  2789. elif test "$linkmode" = prog; then
  2790. # Here we assume that one of hardcode_direct or hardcode_minus_L
  2791. # is not unsupported. This is valid on all known static and
  2792. # shared platforms.
  2793. if test "$hardcode_direct" != unsupported; then
  2794. test -n "$old_library" && linklib="$old_library"
  2795. compile_deplibs="$dir/$linklib $compile_deplibs"
  2796. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  2797. else
  2798. compile_deplibs="-l$name -L$dir $compile_deplibs"
  2799. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  2800. fi
  2801. elif test "$build_libtool_libs" = yes; then
  2802. # Not a shared library
  2803. if test "$deplibs_check_method" != pass_all; then
  2804. # We're trying link a shared library against a static one
  2805. # but the system doesn't support it.
  2806. # Just print a warning and add the library to dependency_libs so
  2807. # that the program can be linked against the static library.
  2808. $echo
  2809. $echo "*** Warning: This system can not link to static lib archive $lib."
  2810. $echo "*** I have the capability to make that library automatically link in when"
  2811. $echo "*** you link to this library. But I can only do this if you have a"
  2812. $echo "*** shared version of the library, which you do not appear to have."
  2813. if test "$module" = yes; then
  2814. $echo "*** But as you try to build a module library, libtool will still create "
  2815. $echo "*** a static module, that should work as long as the dlopening application"
  2816. $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  2817. if test -z "$global_symbol_pipe"; then
  2818. $echo
  2819. $echo "*** However, this would only work if libtool was able to extract symbol"
  2820. $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2821. $echo "*** not find such a program. So, this module is probably useless."
  2822. $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2823. fi
  2824. if test "$build_old_libs" = no; then
  2825. build_libtool_libs=module
  2826. build_old_libs=yes
  2827. else
  2828. build_libtool_libs=no
  2829. fi
  2830. fi
  2831. else
  2832. deplibs="$dir/$old_library $deplibs"
  2833. link_static=yes
  2834. fi
  2835. fi # link shared/static library?
  2836. if test "$linkmode" = lib; then
  2837. if test -n "$dependency_libs" &&
  2838. { test "$hardcode_into_libs" != yes ||
  2839. test "$build_old_libs" = yes ||
  2840. test "$link_static" = yes; }; then
  2841. # Extract -R from dependency_libs
  2842. temp_deplibs=
  2843. for libdir in $dependency_libs; do
  2844. case $libdir in
  2845. -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  2846. case " $xrpath " in
  2847. *" $temp_xrpath "*) ;;
  2848. *) xrpath="$xrpath $temp_xrpath";;
  2849. esac;;
  2850. *) temp_deplibs="$temp_deplibs $libdir";;
  2851. esac
  2852. done
  2853. dependency_libs="$temp_deplibs"
  2854. fi
  2855. newlib_search_path="$newlib_search_path $absdir"
  2856. # Link against this library
  2857. test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  2858. # ... and its dependency_libs
  2859. tmp_libs=
  2860. for deplib in $dependency_libs; do
  2861. newdependency_libs="$deplib $newdependency_libs"
  2862. if test "X$duplicate_deps" = "Xyes" ; then
  2863. case "$tmp_libs " in
  2864. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  2865. esac
  2866. fi
  2867. tmp_libs="$tmp_libs $deplib"
  2868. done
  2869. if test "$link_all_deplibs" != no; then
  2870. # Add the search paths of all dependency libraries
  2871. for deplib in $dependency_libs; do
  2872. case $deplib in
  2873. -L*) path="$deplib" ;;
  2874. *.la)
  2875. dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  2876. test "X$dir" = "X$deplib" && dir="."
  2877. # We need an absolute path.
  2878. case $dir in
  2879. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  2880. *)
  2881. absdir=`cd "$dir" && pwd`
  2882. if test -z "$absdir"; then
  2883. $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  2884. absdir="$dir"
  2885. fi
  2886. ;;
  2887. esac
  2888. if grep "^installed=no" $deplib > /dev/null; then
  2889. path="$absdir/$objdir"
  2890. else
  2891. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  2892. if test -z "$libdir"; then
  2893. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  2894. exit $EXIT_FAILURE
  2895. fi
  2896. if test "$absdir" != "$libdir"; then
  2897. $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  2898. fi
  2899. path="$absdir"
  2900. fi
  2901. depdepl=
  2902. case $host in
  2903. *-*-darwin*)
  2904. # we do not want to link against static libs,
  2905. # but need to link against shared
  2906. eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  2907. if test -n "$deplibrary_names" ; then
  2908. for tmp in $deplibrary_names ; do
  2909. depdepl=$tmp
  2910. done
  2911. if test -f "$path/$depdepl" ; then
  2912. depdepl="$path/$depdepl"
  2913. fi
  2914. # do not add paths which are already there
  2915. case " $newlib_search_path " in
  2916. *" $path "*) ;;
  2917. *) newlib_search_path="$newlib_search_path $path";;
  2918. esac
  2919. fi
  2920. path=""
  2921. ;;
  2922. *)
  2923. path="-L$path"
  2924. ;;
  2925. esac
  2926. ;;
  2927. -l*)
  2928. case $host in
  2929. *-*-darwin*)
  2930. # Again, we only want to link against shared libraries
  2931. eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  2932. for tmp in $newlib_search_path ; do
  2933. if test -f "$tmp/lib$tmp_libs.dylib" ; then
  2934. eval depdepl="$tmp/lib$tmp_libs.dylib"
  2935. break
  2936. fi
  2937. done
  2938. path=""
  2939. ;;
  2940. *) continue ;;
  2941. esac
  2942. ;;
  2943. *) continue ;;
  2944. esac
  2945. case " $deplibs " in
  2946. *" $path "*) ;;
  2947. *) deplibs="$path $deplibs" ;;
  2948. esac
  2949. case " $deplibs " in
  2950. *" $depdepl "*) ;;
  2951. *) deplibs="$depdepl $deplibs" ;;
  2952. esac
  2953. done
  2954. fi # link_all_deplibs != no
  2955. fi # linkmode = lib
  2956. done # for deplib in $libs
  2957. dependency_libs="$newdependency_libs"
  2958. if test "$pass" = dlpreopen; then
  2959. # Link the dlpreopened libraries before other libraries
  2960. for deplib in $save_deplibs; do
  2961. deplibs="$deplib $deplibs"
  2962. done
  2963. fi
  2964. if test "$pass" != dlopen; then
  2965. if test "$pass" != conv; then
  2966. # Make sure lib_search_path contains only unique directories.
  2967. lib_search_path=
  2968. for dir in $newlib_search_path; do
  2969. case "$lib_search_path " in
  2970. *" $dir "*) ;;
  2971. *) lib_search_path="$lib_search_path $dir" ;;
  2972. esac
  2973. done
  2974. newlib_search_path=
  2975. fi
  2976. if test "$linkmode,$pass" != "prog,link"; then
  2977. vars="deplibs"
  2978. else
  2979. vars="compile_deplibs finalize_deplibs"
  2980. fi
  2981. for var in $vars dependency_libs; do
  2982. # Add libraries to $var in reverse order
  2983. eval tmp_libs=\"\$$var\"
  2984. new_libs=
  2985. for deplib in $tmp_libs; do
  2986. # FIXME: Pedantically, this is the right thing to do, so
  2987. # that some nasty dependency loop isn't accidentally
  2988. # broken:
  2989. #new_libs="$deplib $new_libs"
  2990. # Pragmatically, this seems to cause very few problems in
  2991. # practice:
  2992. case $deplib in
  2993. -L*) new_libs="$deplib $new_libs" ;;
  2994. -R*) ;;
  2995. *)
  2996. # And here is the reason: when a library appears more
  2997. # than once as an explicit dependence of a library, or
  2998. # is implicitly linked in more than once by the
  2999. # compiler, it is considered special, and multiple
  3000. # occurrences thereof are not removed. Compare this
  3001. # with having the same library being listed as a
  3002. # dependency of multiple other libraries: in this case,
  3003. # we know (pedantically, we assume) the library does not
  3004. # need to be listed more than once, so we keep only the
  3005. # last copy. This is not always right, but it is rare
  3006. # enough that we require users that really mean to play
  3007. # such unportable linking tricks to link the library
  3008. # using -Wl,-lname, so that libtool does not consider it
  3009. # for duplicate removal.
  3010. case " $specialdeplibs " in
  3011. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  3012. *)
  3013. case " $new_libs " in
  3014. *" $deplib "*) ;;
  3015. *) new_libs="$deplib $new_libs" ;;
  3016. esac
  3017. ;;
  3018. esac
  3019. ;;
  3020. esac
  3021. done
  3022. tmp_libs=
  3023. for deplib in $new_libs; do
  3024. case $deplib in
  3025. -L*)
  3026. case " $tmp_libs " in
  3027. *" $deplib "*) ;;
  3028. *) tmp_libs="$tmp_libs $deplib" ;;
  3029. esac
  3030. ;;
  3031. *) tmp_libs="$tmp_libs $deplib" ;;
  3032. esac
  3033. done
  3034. eval $var=\"$tmp_libs\"
  3035. done # for var
  3036. fi
  3037. # Last step: remove runtime libs from dependency_libs
  3038. # (they stay in deplibs)
  3039. tmp_libs=
  3040. for i in $dependency_libs ; do
  3041. case " $predeps $postdeps $compiler_lib_search_path " in
  3042. *" $i "*)
  3043. i=""
  3044. ;;
  3045. esac
  3046. if test -n "$i" ; then
  3047. tmp_libs="$tmp_libs $i"
  3048. fi
  3049. done
  3050. dependency_libs=$tmp_libs
  3051. done # for pass
  3052. if test "$linkmode" = prog; then
  3053. dlfiles="$newdlfiles"
  3054. dlprefiles="$newdlprefiles"
  3055. fi
  3056. case $linkmode in
  3057. oldlib)
  3058. if test -n "$deplibs"; then
  3059. $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  3060. fi
  3061. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  3062. $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  3063. fi
  3064. if test -n "$rpath"; then
  3065. $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  3066. fi
  3067. if test -n "$xrpath"; then
  3068. $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  3069. fi
  3070. if test -n "$vinfo"; then
  3071. $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
  3072. fi
  3073. if test -n "$release"; then
  3074. $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  3075. fi
  3076. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  3077. $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  3078. fi
  3079. # Now set the variables for building old libraries.
  3080. build_libtool_libs=no
  3081. oldlibs="$output"
  3082. objs="$objs$old_deplibs"
  3083. ;;
  3084. lib)
  3085. # Make sure we only generate libraries of the form `libNAME.la'.
  3086. case $outputname in
  3087. lib*)
  3088. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  3089. eval shared_ext=\"$shrext_cmds\"
  3090. eval libname=\"$libname_spec\"
  3091. ;;
  3092. *)
  3093. if test "$module" = no; then
  3094. $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  3095. $echo "$help" 1>&2
  3096. exit $EXIT_FAILURE
  3097. fi
  3098. if test "$need_lib_prefix" != no; then
  3099. # Add the "lib" prefix for modules if required
  3100. name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  3101. eval shared_ext=\"$shrext_cmds\"
  3102. eval libname=\"$libname_spec\"
  3103. else
  3104. libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  3105. fi
  3106. ;;
  3107. esac
  3108. if test -n "$objs"; then
  3109. if test "$deplibs_check_method" != pass_all; then
  3110. $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  3111. exit $EXIT_FAILURE
  3112. else
  3113. $echo
  3114. $echo "*** Warning: Linking the shared library $output against the non-libtool"
  3115. $echo "*** objects $objs is not portable!"
  3116. libobjs="$libobjs $objs"
  3117. fi
  3118. fi
  3119. if test "$dlself" != no; then
  3120. $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  3121. fi
  3122. set dummy $rpath
  3123. if test "$#" -gt 2; then
  3124. $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  3125. fi
  3126. install_libdir="$2"
  3127. oldlibs=
  3128. if test -z "$rpath"; then
  3129. if test "$build_libtool_libs" = yes; then
  3130. # Building a libtool convenience library.
  3131. # Some compilers have problems with a `.al' extension so
  3132. # convenience libraries should have the same extension an
  3133. # archive normally would.
  3134. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  3135. build_libtool_libs=convenience
  3136. build_old_libs=yes
  3137. fi
  3138. if test -n "$vinfo"; then
  3139. $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
  3140. fi
  3141. if test -n "$release"; then
  3142. $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  3143. fi
  3144. else
  3145. # Parse the version information argument.
  3146. save_ifs="$IFS"; IFS=':'
  3147. set dummy $vinfo 0 0 0
  3148. IFS="$save_ifs"
  3149. if test -n "$8"; then
  3150. $echo "$modename: too many parameters to \`-version-info'" 1>&2
  3151. $echo "$help" 1>&2
  3152. exit $EXIT_FAILURE
  3153. fi
  3154. # convert absolute version numbers to libtool ages
  3155. # this retains compatibility with .la files and attempts
  3156. # to make the code below a bit more comprehensible
  3157. case $vinfo_number in
  3158. yes)
  3159. number_major="$2"
  3160. number_minor="$3"
  3161. number_revision="$4"
  3162. #
  3163. # There are really only two kinds -- those that
  3164. # use the current revision as the major version
  3165. # and those that subtract age and use age as
  3166. # a minor version. But, then there is irix
  3167. # which has an extra 1 added just for fun
  3168. #
  3169. case $version_type in
  3170. darwin|linux|osf|windows)
  3171. current=`expr $number_major + $number_minor`
  3172. age="$number_minor"
  3173. revision="$number_revision"
  3174. ;;
  3175. freebsd-aout|freebsd-elf|sunos)
  3176. current="$number_major"
  3177. revision="$number_minor"
  3178. age="0"
  3179. ;;
  3180. irix|nonstopux)
  3181. current=`expr $number_major + $number_minor - 1`
  3182. age="$number_minor"
  3183. revision="$number_minor"
  3184. ;;
  3185. esac
  3186. ;;
  3187. no)
  3188. current="$2"
  3189. revision="$3"
  3190. age="$4"
  3191. ;;
  3192. esac
  3193. # Check that each of the things are valid numbers.
  3194. case $current in
  3195. 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]) ;;
  3196. *)
  3197. $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
  3198. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3199. exit $EXIT_FAILURE
  3200. ;;
  3201. esac
  3202. case $revision in
  3203. 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]) ;;
  3204. *)
  3205. $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
  3206. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3207. exit $EXIT_FAILURE
  3208. ;;
  3209. esac
  3210. case $age in
  3211. 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]) ;;
  3212. *)
  3213. $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
  3214. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3215. exit $EXIT_FAILURE
  3216. ;;
  3217. esac
  3218. if test "$age" -gt "$current"; then
  3219. $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  3220. $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  3221. exit $EXIT_FAILURE
  3222. fi
  3223. # Calculate the version variables.
  3224. major=
  3225. versuffix=
  3226. verstring=
  3227. case $version_type in
  3228. none) ;;
  3229. darwin)
  3230. # Like Linux, but with the current version available in
  3231. # verstring for coding it into the library header
  3232. major=.`expr $current - $age`
  3233. versuffix="$major.$age.$revision"
  3234. # Darwin ld doesn't like 0 for these options...
  3235. minor_current=`expr $current + 1`
  3236. verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  3237. ;;
  3238. freebsd-aout)
  3239. major=".$current"
  3240. versuffix=".$current.$revision";
  3241. ;;
  3242. freebsd-elf)
  3243. major=".$current"
  3244. versuffix=".$current";
  3245. ;;
  3246. irix | nonstopux)
  3247. major=`expr $current - $age + 1`
  3248. case $version_type in
  3249. nonstopux) verstring_prefix=nonstopux ;;
  3250. *) verstring_prefix=sgi ;;
  3251. esac
  3252. verstring="$verstring_prefix$major.$revision"
  3253. # Add in all the interfaces that we are compatible with.
  3254. loop=$revision
  3255. while test "$loop" -ne 0; do
  3256. iface=`expr $revision - $loop`
  3257. loop=`expr $loop - 1`
  3258. verstring="$verstring_prefix$major.$iface:$verstring"
  3259. done
  3260. # Before this point, $major must not contain `.'.
  3261. major=.$major
  3262. versuffix="$major.$revision"
  3263. ;;
  3264. linux)
  3265. major=.`expr $current - $age`
  3266. versuffix="$major.$age.$revision"
  3267. ;;
  3268. osf)
  3269. major=.`expr $current - $age`
  3270. versuffix=".$current.$age.$revision"
  3271. verstring="$current.$age.$revision"
  3272. # Add in all the interfaces that we are compatible with.
  3273. loop=$age
  3274. while test "$loop" -ne 0; do
  3275. iface=`expr $current - $loop`
  3276. loop=`expr $loop - 1`
  3277. verstring="$verstring:${iface}.0"
  3278. done
  3279. # Make executables depend on our current version.
  3280. verstring="$verstring:${current}.0"
  3281. ;;
  3282. sunos)
  3283. major=".$current"
  3284. versuffix=".$current.$revision"
  3285. ;;
  3286. windows)
  3287. # Use '-' rather than '.', since we only want one
  3288. # extension on DOS 8.3 filesystems.
  3289. major=`expr $current - $age`
  3290. versuffix="-$major"
  3291. ;;
  3292. *)
  3293. $echo "$modename: unknown library version type \`$version_type'" 1>&2
  3294. $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  3295. exit $EXIT_FAILURE
  3296. ;;
  3297. esac
  3298. # Clear the version info if we defaulted, and they specified a release.
  3299. if test -z "$vinfo" && test -n "$release"; then
  3300. major=
  3301. case $version_type in
  3302. darwin)
  3303. # we can't check for "0.0" in archive_cmds due to quoting
  3304. # problems, so we reset it completely
  3305. verstring=
  3306. ;;
  3307. *)
  3308. verstring="0.0"
  3309. ;;
  3310. esac
  3311. if test "$need_version" = no; then
  3312. versuffix=
  3313. else
  3314. versuffix=".0.0"
  3315. fi
  3316. fi
  3317. # Remove version info from name if versioning should be avoided
  3318. if test "$avoid_version" = yes && test "$need_version" = no; then
  3319. major=
  3320. versuffix=
  3321. verstring=""
  3322. fi
  3323. # Check to see if the archive will have undefined symbols.
  3324. if test "$allow_undefined" = yes; then
  3325. if test "$allow_undefined_flag" = unsupported; then
  3326. $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  3327. build_libtool_libs=no
  3328. build_old_libs=yes
  3329. fi
  3330. else
  3331. # Don't allow undefined symbols.
  3332. allow_undefined_flag="$no_undefined_flag"
  3333. fi
  3334. fi
  3335. if test "$mode" != relink; then
  3336. # Remove our outputs, but don't remove object files since they
  3337. # may have been created when compiling PIC objects.
  3338. removelist=
  3339. tempremovelist=`$echo "$output_objdir/*"`
  3340. for p in $tempremovelist; do
  3341. case $p in
  3342. *.$objext)
  3343. ;;
  3344. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  3345. if test "X$precious_files_regex" != "X"; then
  3346. if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  3347. then
  3348. continue
  3349. fi
  3350. fi
  3351. removelist="$removelist $p"
  3352. ;;
  3353. *) ;;
  3354. esac
  3355. done
  3356. if test -n "$removelist"; then
  3357. $show "${rm}r $removelist"
  3358. $run ${rm}r $removelist
  3359. fi
  3360. fi
  3361. # Now set the variables for building old libraries.
  3362. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  3363. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  3364. # Transform .lo files to .o files.
  3365. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  3366. fi
  3367. # Eliminate all temporary directories.
  3368. for path in $notinst_path; do
  3369. lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
  3370. deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
  3371. dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
  3372. done
  3373. if test -n "$xrpath"; then
  3374. # If the user specified any rpath flags, then add them.
  3375. temp_xrpath=
  3376. for libdir in $xrpath; do
  3377. temp_xrpath="$temp_xrpath -R$libdir"
  3378. case "$finalize_rpath " in
  3379. *" $libdir "*) ;;
  3380. *) finalize_rpath="$finalize_rpath $libdir" ;;
  3381. esac
  3382. done
  3383. if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
  3384. dependency_libs="$temp_xrpath $dependency_libs"
  3385. fi
  3386. fi
  3387. # Make sure dlfiles contains only unique files that won't be dlpreopened
  3388. old_dlfiles="$dlfiles"
  3389. dlfiles=
  3390. for lib in $old_dlfiles; do
  3391. case " $dlprefiles $dlfiles " in
  3392. *" $lib "*) ;;
  3393. *) dlfiles="$dlfiles $lib" ;;
  3394. esac
  3395. done
  3396. # Make sure dlprefiles contains only unique files
  3397. old_dlprefiles="$dlprefiles"
  3398. dlprefiles=
  3399. for lib in $old_dlprefiles; do
  3400. case "$dlprefiles " in
  3401. *" $lib "*) ;;
  3402. *) dlprefiles="$dlprefiles $lib" ;;
  3403. esac
  3404. done
  3405. if test "$build_libtool_libs" = yes; then
  3406. if test -n "$rpath"; then
  3407. case $host in
  3408. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  3409. # these systems don't actually have a c library (as such)!
  3410. ;;
  3411. *-*-rhapsody* | *-*-darwin1.[012])
  3412. # Rhapsody C library is in the System framework
  3413. deplibs="$deplibs -framework System"
  3414. ;;
  3415. *-*-netbsd*)
  3416. # Don't link with libc until the a.out ld.so is fixed.
  3417. ;;
  3418. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  3419. # Do not include libc due to us having libc/libc_r.
  3420. ;;
  3421. *-*-sco3.2v5* | *-*-sco5v6*)
  3422. # Causes problems with __ctype
  3423. ;;
  3424. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  3425. # Compiler inserts libc in the correct place for threads to work
  3426. ;;
  3427. *)
  3428. # Add libc to deplibs on all other systems if necessary.
  3429. if test "$build_libtool_need_lc" = "yes"; then
  3430. deplibs="$deplibs -lc"
  3431. fi
  3432. ;;
  3433. esac
  3434. fi
  3435. # Transform deplibs into only deplibs that can be linked in shared.
  3436. name_save=$name
  3437. libname_save=$libname
  3438. release_save=$release
  3439. versuffix_save=$versuffix
  3440. major_save=$major
  3441. # I'm not sure if I'm treating the release correctly. I think
  3442. # release should show up in the -l (ie -lgmp5) so we don't want to
  3443. # add it in twice. Is that correct?
  3444. release=""
  3445. versuffix=""
  3446. major=""
  3447. newdeplibs=
  3448. droppeddeps=no
  3449. case $deplibs_check_method in
  3450. pass_all)
  3451. # Don't check for shared/static. Everything works.
  3452. # This might be a little naive. We might want to check
  3453. # whether the library exists or not. But this is on
  3454. # osf3 & osf4 and I'm not really sure... Just
  3455. # implementing what was already the behavior.
  3456. newdeplibs=$deplibs
  3457. ;;
  3458. test_compile)
  3459. # This code stresses the "libraries are programs" paradigm to its
  3460. # limits. Maybe even breaks it. We compile a program, linking it
  3461. # against the deplibs as a proxy for the library. Then we can check
  3462. # whether they linked in statically or dynamically with ldd.
  3463. $rm conftest.c
  3464. cat > conftest.c <<EOF
  3465. int main() { return 0; }
  3466. EOF
  3467. $rm conftest
  3468. $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
  3469. if test "$?" -eq 0 ; then
  3470. ldd_output=`ldd conftest`
  3471. for i in $deplibs; do
  3472. name=`expr $i : '-l\(.*\)'`
  3473. # If $name is empty we are operating on a -L argument.
  3474. if test "$name" != "" && test "$name" -ne "0"; then
  3475. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3476. case " $predeps $postdeps " in
  3477. *" $i "*)
  3478. newdeplibs="$newdeplibs $i"
  3479. i=""
  3480. ;;
  3481. esac
  3482. fi
  3483. if test -n "$i" ; then
  3484. libname=`eval \\$echo \"$libname_spec\"`
  3485. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3486. set dummy $deplib_matches
  3487. deplib_match=$2
  3488. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3489. newdeplibs="$newdeplibs $i"
  3490. else
  3491. droppeddeps=yes
  3492. $echo
  3493. $echo "*** Warning: dynamic linker does not accept needed library $i."
  3494. $echo "*** I have the capability to make that library automatically link in when"
  3495. $echo "*** you link to this library. But I can only do this if you have a"
  3496. $echo "*** shared version of the library, which I believe you do not have"
  3497. $echo "*** because a test_compile did reveal that the linker did not use it for"
  3498. $echo "*** its dynamic dependency list that programs get resolved with at runtime."
  3499. fi
  3500. fi
  3501. else
  3502. newdeplibs="$newdeplibs $i"
  3503. fi
  3504. done
  3505. else
  3506. # Error occurred in the first compile. Let's try to salvage
  3507. # the situation: Compile a separate program for each library.
  3508. for i in $deplibs; do
  3509. name=`expr $i : '-l\(.*\)'`
  3510. # If $name is empty we are operating on a -L argument.
  3511. if test "$name" != "" && test "$name" != "0"; then
  3512. $rm conftest
  3513. $LTCC $LTCFLAGS -o conftest conftest.c $i
  3514. # Did it work?
  3515. if test "$?" -eq 0 ; then
  3516. ldd_output=`ldd conftest`
  3517. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3518. case " $predeps $postdeps " in
  3519. *" $i "*)
  3520. newdeplibs="$newdeplibs $i"
  3521. i=""
  3522. ;;
  3523. esac
  3524. fi
  3525. if test -n "$i" ; then
  3526. libname=`eval \\$echo \"$libname_spec\"`
  3527. deplib_matches=`eval \\$echo \"$library_names_spec\"`
  3528. set dummy $deplib_matches
  3529. deplib_match=$2
  3530. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  3531. newdeplibs="$newdeplibs $i"
  3532. else
  3533. droppeddeps=yes
  3534. $echo
  3535. $echo "*** Warning: dynamic linker does not accept needed library $i."
  3536. $echo "*** I have the capability to make that library automatically link in when"
  3537. $echo "*** you link to this library. But I can only do this if you have a"
  3538. $echo "*** shared version of the library, which you do not appear to have"
  3539. $echo "*** because a test_compile did reveal that the linker did not use this one"
  3540. $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  3541. fi
  3542. fi
  3543. else
  3544. droppeddeps=yes
  3545. $echo
  3546. $echo "*** Warning! Library $i is needed by this library but I was not able to"
  3547. $echo "*** make it link in! You will probably need to install it or some"
  3548. $echo "*** library that it depends on before this library will be fully"
  3549. $echo "*** functional. Installing it before continuing would be even better."
  3550. fi
  3551. else
  3552. newdeplibs="$newdeplibs $i"
  3553. fi
  3554. done
  3555. fi
  3556. ;;
  3557. file_magic*)
  3558. set dummy $deplibs_check_method
  3559. file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3560. for a_deplib in $deplibs; do
  3561. name=`expr $a_deplib : '-l\(.*\)'`
  3562. # If $name is empty we are operating on a -L argument.
  3563. if test "$name" != "" && test "$name" != "0"; then
  3564. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3565. case " $predeps $postdeps " in
  3566. *" $a_deplib "*)
  3567. newdeplibs="$newdeplibs $a_deplib"
  3568. a_deplib=""
  3569. ;;
  3570. esac
  3571. fi
  3572. if test -n "$a_deplib" ; then
  3573. libname=`eval \\$echo \"$libname_spec\"`
  3574. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3575. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3576. for potent_lib in $potential_libs; do
  3577. # Follow soft links.
  3578. if ls -lLd "$potent_lib" 2>/dev/null \
  3579. | grep " -> " >/dev/null; then
  3580. continue
  3581. fi
  3582. # The statement above tries to avoid entering an
  3583. # endless loop below, in case of cyclic links.
  3584. # We might still enter an endless loop, since a link
  3585. # loop can be closed while we follow links,
  3586. # but so what?
  3587. potlib="$potent_lib"
  3588. while test -h "$potlib" 2>/dev/null; do
  3589. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  3590. case $potliblink in
  3591. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  3592. *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  3593. esac
  3594. done
  3595. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  3596. | ${SED} 10q \
  3597. | $EGREP "$file_magic_regex" > /dev/null; then
  3598. newdeplibs="$newdeplibs $a_deplib"
  3599. a_deplib=""
  3600. break 2
  3601. fi
  3602. done
  3603. done
  3604. fi
  3605. if test -n "$a_deplib" ; then
  3606. droppeddeps=yes
  3607. $echo
  3608. $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3609. $echo "*** I have the capability to make that library automatically link in when"
  3610. $echo "*** you link to this library. But I can only do this if you have a"
  3611. $echo "*** shared version of the library, which you do not appear to have"
  3612. $echo "*** because I did check the linker path looking for a file starting"
  3613. if test -z "$potlib" ; then
  3614. $echo "*** with $libname but no candidates were found. (...for file magic test)"
  3615. else
  3616. $echo "*** with $libname and none of the candidates passed a file format test"
  3617. $echo "*** using a file magic. Last file checked: $potlib"
  3618. fi
  3619. fi
  3620. else
  3621. # Add a -L argument.
  3622. newdeplibs="$newdeplibs $a_deplib"
  3623. fi
  3624. done # Gone through all deplibs.
  3625. ;;
  3626. match_pattern*)
  3627. set dummy $deplibs_check_method
  3628. match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  3629. for a_deplib in $deplibs; do
  3630. name=`expr $a_deplib : '-l\(.*\)'`
  3631. # If $name is empty we are operating on a -L argument.
  3632. if test -n "$name" && test "$name" != "0"; then
  3633. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3634. case " $predeps $postdeps " in
  3635. *" $a_deplib "*)
  3636. newdeplibs="$newdeplibs $a_deplib"
  3637. a_deplib=""
  3638. ;;
  3639. esac
  3640. fi
  3641. if test -n "$a_deplib" ; then
  3642. libname=`eval \\$echo \"$libname_spec\"`
  3643. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  3644. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  3645. for potent_lib in $potential_libs; do
  3646. potlib="$potent_lib" # see symlink-check above in file_magic test
  3647. if eval $echo \"$potent_lib\" 2>/dev/null \
  3648. | ${SED} 10q \
  3649. | $EGREP "$match_pattern_regex" > /dev/null; then
  3650. newdeplibs="$newdeplibs $a_deplib"
  3651. a_deplib=""
  3652. break 2
  3653. fi
  3654. done
  3655. done
  3656. fi
  3657. if test -n "$a_deplib" ; then
  3658. droppeddeps=yes
  3659. $echo
  3660. $echo "*** Warning: linker path does not have real file for library $a_deplib."
  3661. $echo "*** I have the capability to make that library automatically link in when"
  3662. $echo "*** you link to this library. But I can only do this if you have a"
  3663. $echo "*** shared version of the library, which you do not appear to have"
  3664. $echo "*** because I did check the linker path looking for a file starting"
  3665. if test -z "$potlib" ; then
  3666. $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  3667. else
  3668. $echo "*** with $libname and none of the candidates passed a file format test"
  3669. $echo "*** using a regex pattern. Last file checked: $potlib"
  3670. fi
  3671. fi
  3672. else
  3673. # Add a -L argument.
  3674. newdeplibs="$newdeplibs $a_deplib"
  3675. fi
  3676. done # Gone through all deplibs.
  3677. ;;
  3678. none | unknown | *)
  3679. newdeplibs=""
  3680. tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  3681. -e 's/ -[LR][^ ]*//g'`
  3682. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  3683. for i in $predeps $postdeps ; do
  3684. # can't use Xsed below, because $i might contain '/'
  3685. tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
  3686. done
  3687. fi
  3688. if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
  3689. | grep . >/dev/null; then
  3690. $echo
  3691. if test "X$deplibs_check_method" = "Xnone"; then
  3692. $echo "*** Warning: inter-library dependencies are not supported in this platform."
  3693. else
  3694. $echo "*** Warning: inter-library dependencies are not known to be supported."
  3695. fi
  3696. $echo "*** All declared inter-library dependencies are being dropped."
  3697. droppeddeps=yes
  3698. fi
  3699. ;;
  3700. esac
  3701. versuffix=$versuffix_save
  3702. major=$major_save
  3703. release=$release_save
  3704. libname=$libname_save
  3705. name=$name_save
  3706. case $host in
  3707. *-*-rhapsody* | *-*-darwin1.[012])
  3708. # On Rhapsody replace the C library is the System framework
  3709. newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  3710. ;;
  3711. esac
  3712. if test "$droppeddeps" = yes; then
  3713. if test "$module" = yes; then
  3714. $echo
  3715. $echo "*** Warning: libtool could not satisfy all declared inter-library"
  3716. $echo "*** dependencies of module $libname. Therefore, libtool will create"
  3717. $echo "*** a static module, that should work as long as the dlopening"
  3718. $echo "*** application is linked with the -dlopen flag."
  3719. if test -z "$global_symbol_pipe"; then
  3720. $echo
  3721. $echo "*** However, this would only work if libtool was able to extract symbol"
  3722. $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  3723. $echo "*** not find such a program. So, this module is probably useless."
  3724. $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  3725. fi
  3726. if test "$build_old_libs" = no; then
  3727. oldlibs="$output_objdir/$libname.$libext"
  3728. build_libtool_libs=module
  3729. build_old_libs=yes
  3730. else
  3731. build_libtool_libs=no
  3732. fi
  3733. else
  3734. $echo "*** The inter-library dependencies that have been dropped here will be"
  3735. $echo "*** automatically added whenever a program is linked with this library"
  3736. $echo "*** or is declared to -dlopen it."
  3737. if test "$allow_undefined" = no; then
  3738. $echo
  3739. $echo "*** Since this library must not contain undefined symbols,"
  3740. $echo "*** because either the platform does not support them or"
  3741. $echo "*** it was explicitly requested with -no-undefined,"
  3742. $echo "*** libtool will only create a static version of it."
  3743. if test "$build_old_libs" = no; then
  3744. oldlibs="$output_objdir/$libname.$libext"
  3745. build_libtool_libs=module
  3746. build_old_libs=yes
  3747. else
  3748. build_libtool_libs=no
  3749. fi
  3750. fi
  3751. fi
  3752. fi
  3753. # Done checking deplibs!
  3754. deplibs=$newdeplibs
  3755. fi
  3756. # move library search paths that coincide with paths to not yet
  3757. # installed libraries to the beginning of the library search list
  3758. new_libs=
  3759. for path in $notinst_path; do
  3760. case " $new_libs " in
  3761. *" -L$path/$objdir "*) ;;
  3762. *)
  3763. case " $deplibs " in
  3764. *" -L$path/$objdir "*)
  3765. new_libs="$new_libs -L$path/$objdir" ;;
  3766. esac
  3767. ;;
  3768. esac
  3769. done
  3770. for deplib in $deplibs; do
  3771. case $deplib in
  3772. -L*)
  3773. case " $new_libs " in
  3774. *" $deplib "*) ;;
  3775. *) new_libs="$new_libs $deplib" ;;
  3776. esac
  3777. ;;
  3778. *) new_libs="$new_libs $deplib" ;;
  3779. esac
  3780. done
  3781. deplibs="$new_libs"
  3782. # All the library-specific variables (install_libdir is set above).
  3783. library_names=
  3784. old_library=
  3785. dlname=
  3786. # Test again, we may have decided not to build it any more
  3787. if test "$build_libtool_libs" = yes; then
  3788. if test "$hardcode_into_libs" = yes; then
  3789. # Hardcode the library paths
  3790. hardcode_libdirs=
  3791. dep_rpath=
  3792. rpath="$finalize_rpath"
  3793. test "$mode" != relink && rpath="$compile_rpath$rpath"
  3794. for libdir in $rpath; do
  3795. if test -n "$hardcode_libdir_flag_spec"; then
  3796. if test -n "$hardcode_libdir_separator"; then
  3797. if test -z "$hardcode_libdirs"; then
  3798. hardcode_libdirs="$libdir"
  3799. else
  3800. # Just accumulate the unique libdirs.
  3801. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  3802. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  3803. ;;
  3804. *)
  3805. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  3806. ;;
  3807. esac
  3808. fi
  3809. else
  3810. eval flag=\"$hardcode_libdir_flag_spec\"
  3811. dep_rpath="$dep_rpath $flag"
  3812. fi
  3813. elif test -n "$runpath_var"; then
  3814. case "$perm_rpath " in
  3815. *" $libdir "*) ;;
  3816. *) perm_rpath="$perm_rpath $libdir" ;;
  3817. esac
  3818. fi
  3819. done
  3820. # Substitute the hardcoded libdirs into the rpath.
  3821. if test -n "$hardcode_libdir_separator" &&
  3822. test -n "$hardcode_libdirs"; then
  3823. libdir="$hardcode_libdirs"
  3824. if test -n "$hardcode_libdir_flag_spec_ld"; then
  3825. eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  3826. else
  3827. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  3828. fi
  3829. fi
  3830. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  3831. # We should set the runpath_var.
  3832. rpath=
  3833. for dir in $perm_rpath; do
  3834. rpath="$rpath$dir:"
  3835. done
  3836. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  3837. fi
  3838. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  3839. fi
  3840. shlibpath="$finalize_shlibpath"
  3841. test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
  3842. if test -n "$shlibpath"; then
  3843. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  3844. fi
  3845. # Get the real and link names of the library.
  3846. eval shared_ext=\"$shrext_cmds\"
  3847. eval library_names=\"$library_names_spec\"
  3848. set dummy $library_names
  3849. realname="$2"
  3850. shift; shift
  3851. if test -n "$soname_spec"; then
  3852. eval soname=\"$soname_spec\"
  3853. else
  3854. soname="$realname"
  3855. fi
  3856. if test -z "$dlname"; then
  3857. dlname=$soname
  3858. fi
  3859. lib="$output_objdir/$realname"
  3860. linknames=
  3861. for link
  3862. do
  3863. linknames="$linknames $link"
  3864. done
  3865. # Use standard objects if they are pic
  3866. test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  3867. # Prepare the list of exported symbols
  3868. if test -z "$export_symbols"; then
  3869. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  3870. $show "generating symbol list for \`$libname.la'"
  3871. export_symbols="$output_objdir/$libname.exp"
  3872. $run $rm $export_symbols
  3873. cmds=$export_symbols_cmds
  3874. save_ifs="$IFS"; IFS='~'
  3875. for cmd in $cmds; do
  3876. IFS="$save_ifs"
  3877. eval cmd=\"$cmd\"
  3878. if len=`expr "X$cmd" : ".*"` &&
  3879. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3880. $show "$cmd"
  3881. $run eval "$cmd" || exit $?
  3882. skipped_export=false
  3883. else
  3884. # The command line is too long to execute in one step.
  3885. $show "using reloadable object file for export list..."
  3886. skipped_export=:
  3887. # Break out early, otherwise skipped_export may be
  3888. # set to false by a later but shorter cmd.
  3889. break
  3890. fi
  3891. done
  3892. IFS="$save_ifs"
  3893. if test -n "$export_symbols_regex"; then
  3894. $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  3895. $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  3896. $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  3897. $run eval '$mv "${export_symbols}T" "$export_symbols"'
  3898. fi
  3899. fi
  3900. fi
  3901. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  3902. $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  3903. fi
  3904. tmp_deplibs=
  3905. for test_deplib in $deplibs; do
  3906. case " $convenience " in
  3907. *" $test_deplib "*) ;;
  3908. *)
  3909. tmp_deplibs="$tmp_deplibs $test_deplib"
  3910. ;;
  3911. esac
  3912. done
  3913. deplibs="$tmp_deplibs"
  3914. if test -n "$convenience"; then
  3915. if test -n "$whole_archive_flag_spec"; then
  3916. save_libobjs=$libobjs
  3917. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  3918. else
  3919. gentop="$output_objdir/${outputname}x"
  3920. generated="$generated $gentop"
  3921. func_extract_archives $gentop $convenience
  3922. libobjs="$libobjs $func_extract_archives_result"
  3923. fi
  3924. fi
  3925. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  3926. eval flag=\"$thread_safe_flag_spec\"
  3927. linker_flags="$linker_flags $flag"
  3928. fi
  3929. # Make a backup of the uninstalled library when relinking
  3930. if test "$mode" = relink; then
  3931. $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  3932. fi
  3933. # Do each of the archive commands.
  3934. if test "$module" = yes && test -n "$module_cmds" ; then
  3935. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  3936. eval test_cmds=\"$module_expsym_cmds\"
  3937. cmds=$module_expsym_cmds
  3938. else
  3939. eval test_cmds=\"$module_cmds\"
  3940. cmds=$module_cmds
  3941. fi
  3942. else
  3943. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  3944. eval test_cmds=\"$archive_expsym_cmds\"
  3945. cmds=$archive_expsym_cmds
  3946. else
  3947. eval test_cmds=\"$archive_cmds\"
  3948. cmds=$archive_cmds
  3949. fi
  3950. fi
  3951. if test "X$skipped_export" != "X:" &&
  3952. len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  3953. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  3954. :
  3955. else
  3956. # The command line is too long to link in one step, link piecewise.
  3957. $echo "creating reloadable object files..."
  3958. # Save the value of $output and $libobjs because we want to
  3959. # use them later. If we have whole_archive_flag_spec, we
  3960. # want to use save_libobjs as it was before
  3961. # whole_archive_flag_spec was expanded, because we can't
  3962. # assume the linker understands whole_archive_flag_spec.
  3963. # This may have to be revisited, in case too many
  3964. # convenience libraries get linked in and end up exceeding
  3965. # the spec.
  3966. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  3967. save_libobjs=$libobjs
  3968. fi
  3969. save_output=$output
  3970. output_la=`$echo "X$output" | $Xsed -e "$basename"`
  3971. # Clear the reloadable object creation command queue and
  3972. # initialize k to one.
  3973. test_cmds=
  3974. concat_cmds=
  3975. objlist=
  3976. delfiles=
  3977. last_robj=
  3978. k=1
  3979. output=$output_objdir/$output_la-${k}.$objext
  3980. # Loop over the list of objects to be linked.
  3981. for obj in $save_libobjs
  3982. do
  3983. eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  3984. if test "X$objlist" = X ||
  3985. { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  3986. test "$len" -le "$max_cmd_len"; }; then
  3987. objlist="$objlist $obj"
  3988. else
  3989. # The command $test_cmds is almost too long, add a
  3990. # command to the queue.
  3991. if test "$k" -eq 1 ; then
  3992. # The first file doesn't have a previous command to add.
  3993. eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  3994. else
  3995. # All subsequent reloadable object files will link in
  3996. # the last one created.
  3997. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  3998. fi
  3999. last_robj=$output_objdir/$output_la-${k}.$objext
  4000. k=`expr $k + 1`
  4001. output=$output_objdir/$output_la-${k}.$objext
  4002. objlist=$obj
  4003. len=1
  4004. fi
  4005. done
  4006. # Handle the remaining objects by creating one last
  4007. # reloadable object file. All subsequent reloadable object
  4008. # files will link in the last one created.
  4009. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  4010. eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  4011. if ${skipped_export-false}; then
  4012. $show "generating symbol list for \`$libname.la'"
  4013. export_symbols="$output_objdir/$libname.exp"
  4014. $run $rm $export_symbols
  4015. libobjs=$output
  4016. # Append the command to create the export file.
  4017. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
  4018. fi
  4019. # Set up a command to remove the reloadable object files
  4020. # after they are used.
  4021. i=0
  4022. while test "$i" -lt "$k"
  4023. do
  4024. i=`expr $i + 1`
  4025. delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
  4026. done
  4027. $echo "creating a temporary reloadable object file: $output"
  4028. # Loop through the commands generated above and execute them.
  4029. save_ifs="$IFS"; IFS='~'
  4030. for cmd in $concat_cmds; do
  4031. IFS="$save_ifs"
  4032. $show "$cmd"
  4033. $run eval "$cmd" || exit $?
  4034. done
  4035. IFS="$save_ifs"
  4036. libobjs=$output
  4037. # Restore the value of output.
  4038. output=$save_output
  4039. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  4040. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  4041. fi
  4042. # Expand the library linking commands again to reset the
  4043. # value of $libobjs for piecewise linking.
  4044. # Do each of the archive commands.
  4045. if test "$module" = yes && test -n "$module_cmds" ; then
  4046. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  4047. cmds=$module_expsym_cmds
  4048. else
  4049. cmds=$module_cmds
  4050. fi
  4051. else
  4052. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  4053. cmds=$archive_expsym_cmds
  4054. else
  4055. cmds=$archive_cmds
  4056. fi
  4057. fi
  4058. # Append the command to remove the reloadable object files
  4059. # to the just-reset $cmds.
  4060. eval cmds=\"\$cmds~\$rm $delfiles\"
  4061. fi
  4062. save_ifs="$IFS"; IFS='~'
  4063. for cmd in $cmds; do
  4064. IFS="$save_ifs"
  4065. eval cmd=\"$cmd\"
  4066. $show "$cmd"
  4067. $run eval "$cmd" || {
  4068. lt_exit=$?
  4069. # Restore the uninstalled library and exit
  4070. if test "$mode" = relink; then
  4071. $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
  4072. fi
  4073. exit $lt_exit
  4074. }
  4075. done
  4076. IFS="$save_ifs"
  4077. # Restore the uninstalled library and exit
  4078. if test "$mode" = relink; then
  4079. $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  4080. if test -n "$convenience"; then
  4081. if test -z "$whole_archive_flag_spec"; then
  4082. $show "${rm}r $gentop"
  4083. $run ${rm}r "$gentop"
  4084. fi
  4085. fi
  4086. exit $EXIT_SUCCESS
  4087. fi
  4088. # Create links to the real library.
  4089. for linkname in $linknames; do
  4090. if test "$realname" != "$linkname"; then
  4091. $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  4092. $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  4093. fi
  4094. done
  4095. # If -module or -export-dynamic was specified, set the dlname.
  4096. if test "$module" = yes || test "$export_dynamic" = yes; then
  4097. # On all known operating systems, these are identical.
  4098. dlname="$soname"
  4099. fi
  4100. fi
  4101. ;;
  4102. obj)
  4103. if test -n "$deplibs"; then
  4104. $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  4105. fi
  4106. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  4107. $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  4108. fi
  4109. if test -n "$rpath"; then
  4110. $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  4111. fi
  4112. if test -n "$xrpath"; then
  4113. $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  4114. fi
  4115. if test -n "$vinfo"; then
  4116. $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  4117. fi
  4118. if test -n "$release"; then
  4119. $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  4120. fi
  4121. case $output in
  4122. *.lo)
  4123. if test -n "$objs$old_deplibs"; then
  4124. $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  4125. exit $EXIT_FAILURE
  4126. fi
  4127. libobj="$output"
  4128. obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  4129. ;;
  4130. *)
  4131. libobj=
  4132. obj="$output"
  4133. ;;
  4134. esac
  4135. # Delete the old objects.
  4136. $run $rm $obj $libobj
  4137. # Objects from convenience libraries. This assumes
  4138. # single-version convenience libraries. Whenever we create
  4139. # different ones for PIC/non-PIC, this we'll have to duplicate
  4140. # the extraction.
  4141. reload_conv_objs=
  4142. gentop=
  4143. # reload_cmds runs $LD directly, so let us get rid of
  4144. # -Wl from whole_archive_flag_spec
  4145. wl=
  4146. if test -n "$convenience"; then
  4147. if test -n "$whole_archive_flag_spec"; then
  4148. eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
  4149. else
  4150. gentop="$output_objdir/${obj}x"
  4151. generated="$generated $gentop"
  4152. func_extract_archives $gentop $convenience
  4153. reload_conv_objs="$reload_objs $func_extract_archives_result"
  4154. fi
  4155. fi
  4156. # Create the old-style object.
  4157. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  4158. output="$obj"
  4159. cmds=$reload_cmds
  4160. save_ifs="$IFS"; IFS='~'
  4161. for cmd in $cmds; do
  4162. IFS="$save_ifs"
  4163. eval cmd=\"$cmd\"
  4164. $show "$cmd"
  4165. $run eval "$cmd" || exit $?
  4166. done
  4167. IFS="$save_ifs"
  4168. # Exit if we aren't doing a library object file.
  4169. if test -z "$libobj"; then
  4170. if test -n "$gentop"; then
  4171. $show "${rm}r $gentop"
  4172. $run ${rm}r $gentop
  4173. fi
  4174. exit $EXIT_SUCCESS
  4175. fi
  4176. if test "$build_libtool_libs" != yes; then
  4177. if test -n "$gentop"; then
  4178. $show "${rm}r $gentop"
  4179. $run ${rm}r $gentop
  4180. fi
  4181. # Create an invalid libtool object if no PIC, so that we don't
  4182. # accidentally link it into a program.
  4183. # $show "echo timestamp > $libobj"
  4184. # $run eval "echo timestamp > $libobj" || exit $?
  4185. exit $EXIT_SUCCESS
  4186. fi
  4187. if test -n "$pic_flag" || test "$pic_mode" != default; then
  4188. # Only do commands if we really have different PIC objects.
  4189. reload_objs="$libobjs $reload_conv_objs"
  4190. output="$libobj"
  4191. cmds=$reload_cmds
  4192. save_ifs="$IFS"; IFS='~'
  4193. for cmd in $cmds; do
  4194. IFS="$save_ifs"
  4195. eval cmd=\"$cmd\"
  4196. $show "$cmd"
  4197. $run eval "$cmd" || exit $?
  4198. done
  4199. IFS="$save_ifs"
  4200. fi
  4201. if test -n "$gentop"; then
  4202. $show "${rm}r $gentop"
  4203. $run ${rm}r $gentop
  4204. fi
  4205. exit $EXIT_SUCCESS
  4206. ;;
  4207. prog)
  4208. case $host in
  4209. *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  4210. esac
  4211. if test -n "$vinfo"; then
  4212. $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  4213. fi
  4214. if test -n "$release"; then
  4215. $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  4216. fi
  4217. if test "$preload" = yes; then
  4218. if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  4219. test "$dlopen_self_static" = unknown; then
  4220. $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  4221. fi
  4222. fi
  4223. case $host in
  4224. *-*-rhapsody* | *-*-darwin1.[012])
  4225. # On Rhapsody replace the C library is the System framework
  4226. compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  4227. finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  4228. ;;
  4229. esac
  4230. case $host in
  4231. *darwin*)
  4232. # Don't allow lazy linking, it breaks C++ global constructors
  4233. if test "$tagname" = CXX ; then
  4234. compile_command="$compile_command ${wl}-bind_at_load"
  4235. finalize_command="$finalize_command ${wl}-bind_at_load"
  4236. fi
  4237. ;;
  4238. esac
  4239. # move library search paths that coincide with paths to not yet
  4240. # installed libraries to the beginning of the library search list
  4241. new_libs=
  4242. for path in $notinst_path; do
  4243. case " $new_libs " in
  4244. *" -L$path/$objdir "*) ;;
  4245. *)
  4246. case " $compile_deplibs " in
  4247. *" -L$path/$objdir "*)
  4248. new_libs="$new_libs -L$path/$objdir" ;;
  4249. esac
  4250. ;;
  4251. esac
  4252. done
  4253. for deplib in $compile_deplibs; do
  4254. case $deplib in
  4255. -L*)
  4256. case " $new_libs " in
  4257. *" $deplib "*) ;;
  4258. *) new_libs="$new_libs $deplib" ;;
  4259. esac
  4260. ;;
  4261. *) new_libs="$new_libs $deplib" ;;
  4262. esac
  4263. done
  4264. compile_deplibs="$new_libs"
  4265. compile_command="$compile_command $compile_deplibs"
  4266. finalize_command="$finalize_command $finalize_deplibs"
  4267. if test -n "$rpath$xrpath"; then
  4268. # If the user specified any rpath flags, then add them.
  4269. for libdir in $rpath $xrpath; do
  4270. # This is the magic to use -rpath.
  4271. case "$finalize_rpath " in
  4272. *" $libdir "*) ;;
  4273. *) finalize_rpath="$finalize_rpath $libdir" ;;
  4274. esac
  4275. done
  4276. fi
  4277. # Now hardcode the library paths
  4278. rpath=
  4279. hardcode_libdirs=
  4280. for libdir in $compile_rpath $finalize_rpath; do
  4281. if test -n "$hardcode_libdir_flag_spec"; then
  4282. if test -n "$hardcode_libdir_separator"; then
  4283. if test -z "$hardcode_libdirs"; then
  4284. hardcode_libdirs="$libdir"
  4285. else
  4286. # Just accumulate the unique libdirs.
  4287. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  4288. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  4289. ;;
  4290. *)
  4291. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  4292. ;;
  4293. esac
  4294. fi
  4295. else
  4296. eval flag=\"$hardcode_libdir_flag_spec\"
  4297. rpath="$rpath $flag"
  4298. fi
  4299. elif test -n "$runpath_var"; then
  4300. case "$perm_rpath " in
  4301. *" $libdir "*) ;;
  4302. *) perm_rpath="$perm_rpath $libdir" ;;
  4303. esac
  4304. fi
  4305. case $host in
  4306. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  4307. testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
  4308. case :$dllsearchpath: in
  4309. *":$libdir:"*) ;;
  4310. *) dllsearchpath="$dllsearchpath:$libdir";;
  4311. esac
  4312. case :$dllsearchpath: in
  4313. *":$testbindir:"*) ;;
  4314. *) dllsearchpath="$dllsearchpath:$testbindir";;
  4315. esac
  4316. ;;
  4317. esac
  4318. done
  4319. # Substitute the hardcoded libdirs into the rpath.
  4320. if test -n "$hardcode_libdir_separator" &&
  4321. test -n "$hardcode_libdirs"; then
  4322. libdir="$hardcode_libdirs"
  4323. eval rpath=\" $hardcode_libdir_flag_spec\"
  4324. fi
  4325. compile_rpath="$rpath"
  4326. rpath=
  4327. hardcode_libdirs=
  4328. for libdir in $finalize_rpath; do
  4329. if test -n "$hardcode_libdir_flag_spec"; then
  4330. if test -n "$hardcode_libdir_separator"; then
  4331. if test -z "$hardcode_libdirs"; then
  4332. hardcode_libdirs="$libdir"
  4333. else
  4334. # Just accumulate the unique libdirs.
  4335. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  4336. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  4337. ;;
  4338. *)
  4339. hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  4340. ;;
  4341. esac
  4342. fi
  4343. else
  4344. eval flag=\"$hardcode_libdir_flag_spec\"
  4345. rpath="$rpath $flag"
  4346. fi
  4347. elif test -n "$runpath_var"; then
  4348. case "$finalize_perm_rpath " in
  4349. *" $libdir "*) ;;
  4350. *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  4351. esac
  4352. fi
  4353. done
  4354. # Substitute the hardcoded libdirs into the rpath.
  4355. if test -n "$hardcode_libdir_separator" &&
  4356. test -n "$hardcode_libdirs"; then
  4357. libdir="$hardcode_libdirs"
  4358. eval rpath=\" $hardcode_libdir_flag_spec\"
  4359. fi
  4360. finalize_rpath="$rpath"
  4361. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  4362. # Transform all the library objects into standard objects.
  4363. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4364. finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4365. fi
  4366. dlsyms=
  4367. if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  4368. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4369. dlsyms="${outputname}S.c"
  4370. else
  4371. $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  4372. fi
  4373. fi
  4374. if test -n "$dlsyms"; then
  4375. case $dlsyms in
  4376. "") ;;
  4377. *.c)
  4378. # Discover the nlist of each of the dlfiles.
  4379. nlist="$output_objdir/${outputname}.nm"
  4380. $show "$rm $nlist ${nlist}S ${nlist}T"
  4381. $run $rm "$nlist" "${nlist}S" "${nlist}T"
  4382. # Parse the name list into a source file.
  4383. $show "creating $output_objdir/$dlsyms"
  4384. test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  4385. /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  4386. /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  4387. #ifdef __cplusplus
  4388. extern \"C\" {
  4389. #endif
  4390. /* Prevent the only kind of declaration conflicts we can make. */
  4391. #define lt_preloaded_symbols some_other_symbol
  4392. /* External symbol declarations for the compiler. */\
  4393. "
  4394. if test "$dlself" = yes; then
  4395. $show "generating symbol list for \`$output'"
  4396. test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  4397. # Add our own program objects to the symbol list.
  4398. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  4399. for arg in $progfiles; do
  4400. $show "extracting global C symbols from \`$arg'"
  4401. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4402. done
  4403. if test -n "$exclude_expsyms"; then
  4404. $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4405. $run eval '$mv "$nlist"T "$nlist"'
  4406. fi
  4407. if test -n "$export_symbols_regex"; then
  4408. $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4409. $run eval '$mv "$nlist"T "$nlist"'
  4410. fi
  4411. # Prepare the list of exported symbols
  4412. if test -z "$export_symbols"; then
  4413. export_symbols="$output_objdir/$outputname.exp"
  4414. $run $rm $export_symbols
  4415. $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4416. case $host in
  4417. *cygwin* | *mingw* )
  4418. $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4419. $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  4420. ;;
  4421. esac
  4422. else
  4423. $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4424. $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4425. $run eval 'mv "$nlist"T "$nlist"'
  4426. case $host in
  4427. *cygwin* | *mingw* )
  4428. $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4429. $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  4430. ;;
  4431. esac
  4432. fi
  4433. fi
  4434. for arg in $dlprefiles; do
  4435. $show "extracting global C symbols from \`$arg'"
  4436. name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
  4437. $run eval '$echo ": $name " >> "$nlist"'
  4438. $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  4439. done
  4440. if test -z "$run"; then
  4441. # Make sure we have at least an empty file.
  4442. test -f "$nlist" || : > "$nlist"
  4443. if test -n "$exclude_expsyms"; then
  4444. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4445. $mv "$nlist"T "$nlist"
  4446. fi
  4447. # Try sorting and uniquifying the output.
  4448. if grep -v "^: " < "$nlist" |
  4449. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4450. sort -k 3
  4451. else
  4452. sort +2
  4453. fi |
  4454. uniq > "$nlist"S; then
  4455. :
  4456. else
  4457. grep -v "^: " < "$nlist" > "$nlist"S
  4458. fi
  4459. if test -f "$nlist"S; then
  4460. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  4461. else
  4462. $echo '/* NONE */' >> "$output_objdir/$dlsyms"
  4463. fi
  4464. $echo >> "$output_objdir/$dlsyms" "\
  4465. #undef lt_preloaded_symbols
  4466. #if defined (__STDC__) && __STDC__
  4467. # define lt_ptr void *
  4468. #else
  4469. # define lt_ptr char *
  4470. # define const
  4471. #endif
  4472. /* The mapping between symbol names and symbols. */
  4473. "
  4474. case $host in
  4475. *cygwin* | *mingw* )
  4476. $echo >> "$output_objdir/$dlsyms" "\
  4477. /* DATA imports from DLLs on WIN32 can't be const, because
  4478. runtime relocations are performed -- see ld's documentation
  4479. on pseudo-relocs */
  4480. struct {
  4481. "
  4482. ;;
  4483. * )
  4484. $echo >> "$output_objdir/$dlsyms" "\
  4485. const struct {
  4486. "
  4487. ;;
  4488. esac
  4489. $echo >> "$output_objdir/$dlsyms" "\
  4490. const char *name;
  4491. lt_ptr address;
  4492. }
  4493. lt_preloaded_symbols[] =
  4494. {\
  4495. "
  4496. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  4497. $echo >> "$output_objdir/$dlsyms" "\
  4498. {0, (lt_ptr) 0}
  4499. };
  4500. /* This works around a problem in FreeBSD linker */
  4501. #ifdef FREEBSD_WORKAROUND
  4502. static const void *lt_preloaded_setup() {
  4503. return lt_preloaded_symbols;
  4504. }
  4505. #endif
  4506. #ifdef __cplusplus
  4507. }
  4508. #endif\
  4509. "
  4510. fi
  4511. pic_flag_for_symtable=
  4512. case $host in
  4513. # compiling the symbol table file with pic_flag works around
  4514. # a FreeBSD bug that causes programs to crash when -lm is
  4515. # linked before any other PIC object. But we must not use
  4516. # pic_flag when linking with -static. The problem exists in
  4517. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4518. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4519. case "$compile_command " in
  4520. *" -static "*) ;;
  4521. *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  4522. esac;;
  4523. *-*-hpux*)
  4524. case "$compile_command " in
  4525. *" -static "*) ;;
  4526. *) pic_flag_for_symtable=" $pic_flag";;
  4527. esac
  4528. esac
  4529. # Now compile the dynamic symbol file.
  4530. $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  4531. $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  4532. # Clean up the generated files.
  4533. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  4534. $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  4535. # Transform the symbol file into the correct name.
  4536. case $host in
  4537. *cygwin* | *mingw* )
  4538. if test -f "$output_objdir/${outputname}.def" ; then
  4539. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
  4540. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
  4541. else
  4542. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4543. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4544. fi
  4545. ;;
  4546. * )
  4547. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4548. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
  4549. ;;
  4550. esac
  4551. ;;
  4552. *)
  4553. $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  4554. exit $EXIT_FAILURE
  4555. ;;
  4556. esac
  4557. else
  4558. # We keep going just in case the user didn't refer to
  4559. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4560. # really was required.
  4561. # Nullify the symbol file.
  4562. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  4563. finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  4564. fi
  4565. if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  4566. # Replace the output file specification.
  4567. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4568. link_command="$compile_command$compile_rpath"
  4569. # We have no uninstalled library dependencies, so finalize right now.
  4570. $show "$link_command"
  4571. $run eval "$link_command"
  4572. exit_status=$?
  4573. # Delete the generated files.
  4574. if test -n "$dlsyms"; then
  4575. $show "$rm $output_objdir/${outputname}S.${objext}"
  4576. $run $rm "$output_objdir/${outputname}S.${objext}"
  4577. fi
  4578. exit $exit_status
  4579. fi
  4580. if test -n "$shlibpath_var"; then
  4581. # We should set the shlibpath_var
  4582. rpath=
  4583. for dir in $temp_rpath; do
  4584. case $dir in
  4585. [\\/]* | [A-Za-z]:[\\/]*)
  4586. # Absolute path.
  4587. rpath="$rpath$dir:"
  4588. ;;
  4589. *)
  4590. # Relative path: add a thisdir entry.
  4591. rpath="$rpath\$thisdir/$dir:"
  4592. ;;
  4593. esac
  4594. done
  4595. temp_rpath="$rpath"
  4596. fi
  4597. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  4598. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  4599. fi
  4600. if test -n "$finalize_shlibpath"; then
  4601. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  4602. fi
  4603. compile_var=
  4604. finalize_var=
  4605. if test -n "$runpath_var"; then
  4606. if test -n "$perm_rpath"; then
  4607. # We should set the runpath_var.
  4608. rpath=
  4609. for dir in $perm_rpath; do
  4610. rpath="$rpath$dir:"
  4611. done
  4612. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4613. fi
  4614. if test -n "$finalize_perm_rpath"; then
  4615. # We should set the runpath_var.
  4616. rpath=
  4617. for dir in $finalize_perm_rpath; do
  4618. rpath="$rpath$dir:"
  4619. done
  4620. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  4621. fi
  4622. fi
  4623. if test "$no_install" = yes; then
  4624. # We don't need to create a wrapper script.
  4625. link_command="$compile_var$compile_command$compile_rpath"
  4626. # Replace the output file specification.
  4627. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  4628. # Delete the old output file.
  4629. $run $rm $output
  4630. # Link the executable and exit
  4631. $show "$link_command"
  4632. $run eval "$link_command" || exit $?
  4633. exit $EXIT_SUCCESS
  4634. fi
  4635. if test "$hardcode_action" = relink; then
  4636. # Fast installation is not supported
  4637. link_command="$compile_var$compile_command$compile_rpath"
  4638. relink_command="$finalize_var$finalize_command$finalize_rpath"
  4639. $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  4640. $echo "$modename: \`$output' will be relinked during installation" 1>&2
  4641. else
  4642. if test "$fast_install" != no; then
  4643. link_command="$finalize_var$compile_command$finalize_rpath"
  4644. if test "$fast_install" = yes; then
  4645. relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  4646. else
  4647. # fast_install is set to needless
  4648. relink_command=
  4649. fi
  4650. else
  4651. link_command="$compile_var$compile_command$compile_rpath"
  4652. relink_command="$finalize_var$finalize_command$finalize_rpath"
  4653. fi
  4654. fi
  4655. # Replace the output file specification.
  4656. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  4657. # Delete the old output files.
  4658. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  4659. $show "$link_command"
  4660. $run eval "$link_command" || exit $?
  4661. # Now create the wrapper script.
  4662. $show "creating $output"
  4663. # Quote the relink command for shipping.
  4664. if test -n "$relink_command"; then
  4665. # Preserve any variables that may affect compiler behavior
  4666. for var in $variables_saved_for_relink; do
  4667. if eval test -z \"\${$var+set}\"; then
  4668. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  4669. elif eval var_value=\$$var; test -z "$var_value"; then
  4670. relink_command="$var=; export $var; $relink_command"
  4671. else
  4672. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  4673. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  4674. fi
  4675. done
  4676. relink_command="(cd `pwd`; $relink_command)"
  4677. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  4678. fi
  4679. # Quote $echo for shipping.
  4680. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  4681. case $progpath in
  4682. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  4683. *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  4684. esac
  4685. qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  4686. else
  4687. qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  4688. fi
  4689. # Only actually do things if our run command is non-null.
  4690. if test -z "$run"; then
  4691. # win32 will think the script is a binary if it has
  4692. # a .exe suffix, so we strip it off here.
  4693. case $output in
  4694. *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
  4695. esac
  4696. # test for cygwin because mv fails w/o .exe extensions
  4697. case $host in
  4698. *cygwin*)
  4699. exeext=.exe
  4700. outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
  4701. *) exeext= ;;
  4702. esac
  4703. case $host in
  4704. *cygwin* | *mingw* )
  4705. output_name=`basename $output`
  4706. output_path=`dirname $output`
  4707. cwrappersource="$output_path/$objdir/lt-$output_name.c"
  4708. cwrapper="$output_path/$output_name.exe"
  4709. $rm $cwrappersource $cwrapper
  4710. trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  4711. cat > $cwrappersource <<EOF
  4712. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  4713. Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  4714. The $output program cannot be directly executed until all the libtool
  4715. libraries that it depends on are installed.
  4716. This wrapper executable should never be moved out of the build directory.
  4717. If it is, it will not operate correctly.
  4718. Currently, it simply execs the wrapper *script* "/bin/sh $output",
  4719. but could eventually absorb all of the scripts functionality and
  4720. exec $objdir/$outputname directly.
  4721. */
  4722. EOF
  4723. cat >> $cwrappersource<<"EOF"
  4724. #include <stdio.h>
  4725. #include <stdlib.h>
  4726. #include <unistd.h>
  4727. #include <malloc.h>
  4728. #include <stdarg.h>
  4729. #include <assert.h>
  4730. #include <string.h>
  4731. #include <ctype.h>
  4732. #include <sys/stat.h>
  4733. #if defined(PATH_MAX)
  4734. # define LT_PATHMAX PATH_MAX
  4735. #elif defined(MAXPATHLEN)
  4736. # define LT_PATHMAX MAXPATHLEN
  4737. #else
  4738. # define LT_PATHMAX 1024
  4739. #endif
  4740. #ifndef DIR_SEPARATOR
  4741. # define DIR_SEPARATOR '/'
  4742. # define PATH_SEPARATOR ':'
  4743. #endif
  4744. #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  4745. defined (__OS2__)
  4746. # define HAVE_DOS_BASED_FILE_SYSTEM
  4747. # ifndef DIR_SEPARATOR_2
  4748. # define DIR_SEPARATOR_2 '\\'
  4749. # endif
  4750. # ifndef PATH_SEPARATOR_2
  4751. # define PATH_SEPARATOR_2 ';'
  4752. # endif
  4753. #endif
  4754. #ifndef DIR_SEPARATOR_2
  4755. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  4756. #else /* DIR_SEPARATOR_2 */
  4757. # define IS_DIR_SEPARATOR(ch) \
  4758. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  4759. #endif /* DIR_SEPARATOR_2 */
  4760. #ifndef PATH_SEPARATOR_2
  4761. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  4762. #else /* PATH_SEPARATOR_2 */
  4763. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  4764. #endif /* PATH_SEPARATOR_2 */
  4765. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  4766. #define XFREE(stale) do { \
  4767. if (stale) { free ((void *) stale); stale = 0; } \
  4768. } while (0)
  4769. /* -DDEBUG is fairly common in CFLAGS. */
  4770. #undef DEBUG
  4771. #if defined DEBUGWRAPPER
  4772. # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
  4773. #else
  4774. # define DEBUG(format, ...)
  4775. #endif
  4776. const char *program_name = NULL;
  4777. void * xmalloc (size_t num);
  4778. char * xstrdup (const char *string);
  4779. const char * base_name (const char *name);
  4780. char * find_executable(const char *wrapper);
  4781. int check_executable(const char *path);
  4782. char * strendzap(char *str, const char *pat);
  4783. void lt_fatal (const char *message, ...);
  4784. int
  4785. main (int argc, char *argv[])
  4786. {
  4787. char **newargz;
  4788. int i;
  4789. program_name = (char *) xstrdup (base_name (argv[0]));
  4790. DEBUG("(main) argv[0] : %s\n",argv[0]);
  4791. DEBUG("(main) program_name : %s\n",program_name);
  4792. newargz = XMALLOC(char *, argc+2);
  4793. EOF
  4794. cat >> $cwrappersource <<EOF
  4795. newargz[0] = (char *) xstrdup("$SHELL");
  4796. EOF
  4797. cat >> $cwrappersource <<"EOF"
  4798. newargz[1] = find_executable(argv[0]);
  4799. if (newargz[1] == NULL)
  4800. lt_fatal("Couldn't find %s", argv[0]);
  4801. DEBUG("(main) found exe at : %s\n",newargz[1]);
  4802. /* we know the script has the same name, without the .exe */
  4803. /* so make sure newargz[1] doesn't end in .exe */
  4804. strendzap(newargz[1],".exe");
  4805. for (i = 1; i < argc; i++)
  4806. newargz[i+1] = xstrdup(argv[i]);
  4807. newargz[argc+1] = NULL;
  4808. for (i=0; i<argc+1; i++)
  4809. {
  4810. DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
  4811. ;
  4812. }
  4813. EOF
  4814. case $host_os in
  4815. mingw*)
  4816. cat >> $cwrappersource <<EOF
  4817. execv("$SHELL",(char const **)newargz);
  4818. EOF
  4819. ;;
  4820. *)
  4821. cat >> $cwrappersource <<EOF
  4822. execv("$SHELL",newargz);
  4823. EOF
  4824. ;;
  4825. esac
  4826. cat >> $cwrappersource <<"EOF"
  4827. return 127;
  4828. }
  4829. void *
  4830. xmalloc (size_t num)
  4831. {
  4832. void * p = (void *) malloc (num);
  4833. if (!p)
  4834. lt_fatal ("Memory exhausted");
  4835. return p;
  4836. }
  4837. char *
  4838. xstrdup (const char *string)
  4839. {
  4840. return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  4841. ;
  4842. }
  4843. const char *
  4844. base_name (const char *name)
  4845. {
  4846. const char *base;
  4847. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4848. /* Skip over the disk name in MSDOS pathnames. */
  4849. if (isalpha ((unsigned char)name[0]) && name[1] == ':')
  4850. name += 2;
  4851. #endif
  4852. for (base = name; *name; name++)
  4853. if (IS_DIR_SEPARATOR (*name))
  4854. base = name + 1;
  4855. return base;
  4856. }
  4857. int
  4858. check_executable(const char * path)
  4859. {
  4860. struct stat st;
  4861. DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
  4862. if ((!path) || (!*path))
  4863. return 0;
  4864. if ((stat (path, &st) >= 0) &&
  4865. (
  4866. /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
  4867. #if defined (S_IXOTH)
  4868. ((st.st_mode & S_IXOTH) == S_IXOTH) ||
  4869. #endif
  4870. #if defined (S_IXGRP)
  4871. ((st.st_mode & S_IXGRP) == S_IXGRP) ||
  4872. #endif
  4873. ((st.st_mode & S_IXUSR) == S_IXUSR))
  4874. )
  4875. return 1;
  4876. else
  4877. return 0;
  4878. }
  4879. /* Searches for the full path of the wrapper. Returns
  4880. newly allocated full path name if found, NULL otherwise */
  4881. char *
  4882. find_executable (const char* wrapper)
  4883. {
  4884. int has_slash = 0;
  4885. const char* p;
  4886. const char* p_next;
  4887. /* static buffer for getcwd */
  4888. char tmp[LT_PATHMAX + 1];
  4889. int tmp_len;
  4890. char* concat_name;
  4891. DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
  4892. if ((wrapper == NULL) || (*wrapper == '\0'))
  4893. return NULL;
  4894. /* Absolute path? */
  4895. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4896. if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
  4897. {
  4898. concat_name = xstrdup (wrapper);
  4899. if (check_executable(concat_name))
  4900. return concat_name;
  4901. XFREE(concat_name);
  4902. }
  4903. else
  4904. {
  4905. #endif
  4906. if (IS_DIR_SEPARATOR (wrapper[0]))
  4907. {
  4908. concat_name = xstrdup (wrapper);
  4909. if (check_executable(concat_name))
  4910. return concat_name;
  4911. XFREE(concat_name);
  4912. }
  4913. #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4914. }
  4915. #endif
  4916. for (p = wrapper; *p; p++)
  4917. if (*p == '/')
  4918. {
  4919. has_slash = 1;
  4920. break;
  4921. }
  4922. if (!has_slash)
  4923. {
  4924. /* no slashes; search PATH */
  4925. const char* path = getenv ("PATH");
  4926. if (path != NULL)
  4927. {
  4928. for (p = path; *p; p = p_next)
  4929. {
  4930. const char* q;
  4931. size_t p_len;
  4932. for (q = p; *q; q++)
  4933. if (IS_PATH_SEPARATOR(*q))
  4934. break;
  4935. p_len = q - p;
  4936. p_next = (*q == '\0' ? q : q + 1);
  4937. if (p_len == 0)
  4938. {
  4939. /* empty path: current directory */
  4940. if (getcwd (tmp, LT_PATHMAX) == NULL)
  4941. lt_fatal ("getcwd failed");
  4942. tmp_len = strlen(tmp);
  4943. concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  4944. memcpy (concat_name, tmp, tmp_len);
  4945. concat_name[tmp_len] = '/';
  4946. strcpy (concat_name + tmp_len + 1, wrapper);
  4947. }
  4948. else
  4949. {
  4950. concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
  4951. memcpy (concat_name, p, p_len);
  4952. concat_name[p_len] = '/';
  4953. strcpy (concat_name + p_len + 1, wrapper);
  4954. }
  4955. if (check_executable(concat_name))
  4956. return concat_name;
  4957. XFREE(concat_name);
  4958. }
  4959. }
  4960. /* not found in PATH; assume curdir */
  4961. }
  4962. /* Relative path | not found in path: prepend cwd */
  4963. if (getcwd (tmp, LT_PATHMAX) == NULL)
  4964. lt_fatal ("getcwd failed");
  4965. tmp_len = strlen(tmp);
  4966. concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  4967. memcpy (concat_name, tmp, tmp_len);
  4968. concat_name[tmp_len] = '/';
  4969. strcpy (concat_name + tmp_len + 1, wrapper);
  4970. if (check_executable(concat_name))
  4971. return concat_name;
  4972. XFREE(concat_name);
  4973. return NULL;
  4974. }
  4975. char *
  4976. strendzap(char *str, const char *pat)
  4977. {
  4978. size_t len, patlen;
  4979. assert(str != NULL);
  4980. assert(pat != NULL);
  4981. len = strlen(str);
  4982. patlen = strlen(pat);
  4983. if (patlen <= len)
  4984. {
  4985. str += len - patlen;
  4986. if (strcmp(str, pat) == 0)
  4987. *str = '\0';
  4988. }
  4989. return str;
  4990. }
  4991. static void
  4992. lt_error_core (int exit_status, const char * mode,
  4993. const char * message, va_list ap)
  4994. {
  4995. fprintf (stderr, "%s: %s: ", program_name, mode);
  4996. vfprintf (stderr, message, ap);
  4997. fprintf (stderr, ".\n");
  4998. if (exit_status >= 0)
  4999. exit (exit_status);
  5000. }
  5001. void
  5002. lt_fatal (const char *message, ...)
  5003. {
  5004. va_list ap;
  5005. va_start (ap, message);
  5006. lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  5007. va_end (ap);
  5008. }
  5009. EOF
  5010. # we should really use a build-platform specific compiler
  5011. # here, but OTOH, the wrappers (shell script and this C one)
  5012. # are only useful if you want to execute the "real" binary.
  5013. # Since the "real" binary is built for $host, then this
  5014. # wrapper might as well be built for $host, too.
  5015. $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
  5016. ;;
  5017. esac
  5018. $rm $output
  5019. trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  5020. $echo > $output "\
  5021. #! $SHELL
  5022. # $output - temporary wrapper script for $objdir/$outputname
  5023. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  5024. #
  5025. # The $output program cannot be directly executed until all the libtool
  5026. # libraries that it depends on are installed.
  5027. #
  5028. # This wrapper script should never be moved out of the build directory.
  5029. # If it is, it will not operate correctly.
  5030. # Sed substitution that helps us do robust quoting. It backslashifies
  5031. # metacharacters that are still active within double-quoted strings.
  5032. Xsed='${SED} -e 1s/^X//'
  5033. sed_quote_subst='$sed_quote_subst'
  5034. # The HP-UX ksh and POSIX shell print the target directory to stdout
  5035. # if CDPATH is set.
  5036. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  5037. relink_command=\"$relink_command\"
  5038. # This environment variable determines our operation mode.
  5039. if test \"\$libtool_install_magic\" = \"$magic\"; then
  5040. # install mode needs the following variable:
  5041. notinst_deplibs='$notinst_deplibs'
  5042. else
  5043. # When we are sourced in execute mode, \$file and \$echo are already set.
  5044. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5045. echo=\"$qecho\"
  5046. file=\"\$0\"
  5047. # Make sure echo works.
  5048. if test \"X\$1\" = X--no-reexec; then
  5049. # Discard the --no-reexec flag, and continue.
  5050. shift
  5051. elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  5052. # Yippee, \$echo works!
  5053. :
  5054. else
  5055. # Restart under the correct shell, and then maybe \$echo will work.
  5056. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  5057. fi
  5058. fi\
  5059. "
  5060. $echo >> $output "\
  5061. # Find the directory that this script lives in.
  5062. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  5063. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  5064. # Follow symbolic links until we get to the real thisdir.
  5065. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  5066. while test -n \"\$file\"; do
  5067. destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  5068. # If there was a directory component, then change thisdir.
  5069. if test \"x\$destdir\" != \"x\$file\"; then
  5070. case \"\$destdir\" in
  5071. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  5072. *) thisdir=\"\$thisdir/\$destdir\" ;;
  5073. esac
  5074. fi
  5075. file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  5076. file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  5077. done
  5078. # Try to get the absolute directory name.
  5079. absdir=\`cd \"\$thisdir\" && pwd\`
  5080. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  5081. "
  5082. if test "$fast_install" = yes; then
  5083. $echo >> $output "\
  5084. program=lt-'$outputname'$exeext
  5085. progdir=\"\$thisdir/$objdir\"
  5086. if test ! -f \"\$progdir/\$program\" || \\
  5087. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  5088. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  5089. file=\"\$\$-\$program\"
  5090. if test ! -d \"\$progdir\"; then
  5091. $mkdir \"\$progdir\"
  5092. else
  5093. $rm \"\$progdir/\$file\"
  5094. fi"
  5095. $echo >> $output "\
  5096. # relink executable if necessary
  5097. if test -n \"\$relink_command\"; then
  5098. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  5099. else
  5100. $echo \"\$relink_command_output\" >&2
  5101. $rm \"\$progdir/\$file\"
  5102. exit $EXIT_FAILURE
  5103. fi
  5104. fi
  5105. $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  5106. { $rm \"\$progdir/\$program\";
  5107. $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  5108. $rm \"\$progdir/\$file\"
  5109. fi"
  5110. else
  5111. $echo >> $output "\
  5112. program='$outputname'
  5113. progdir=\"\$thisdir/$objdir\"
  5114. "
  5115. fi
  5116. $echo >> $output "\
  5117. if test -f \"\$progdir/\$program\"; then"
  5118. # Export our shlibpath_var if we have one.
  5119. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5120. $echo >> $output "\
  5121. # Add our own library path to $shlibpath_var
  5122. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  5123. # Some systems cannot cope with colon-terminated $shlibpath_var
  5124. # The second colon is a workaround for a bug in BeOS R4 sed
  5125. $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  5126. export $shlibpath_var
  5127. "
  5128. fi
  5129. # fixup the dll searchpath if we need to.
  5130. if test -n "$dllsearchpath"; then
  5131. $echo >> $output "\
  5132. # Add the dll search path components to the executable PATH
  5133. PATH=$dllsearchpath:\$PATH
  5134. "
  5135. fi
  5136. $echo >> $output "\
  5137. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5138. # Run the actual program with our arguments.
  5139. "
  5140. case $host in
  5141. # Backslashes separate directories on plain windows
  5142. *-*-mingw | *-*-os2*)
  5143. $echo >> $output "\
  5144. exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  5145. "
  5146. ;;
  5147. *)
  5148. $echo >> $output "\
  5149. exec \"\$progdir/\$program\" \${1+\"\$@\"}
  5150. "
  5151. ;;
  5152. esac
  5153. $echo >> $output "\
  5154. \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  5155. exit $EXIT_FAILURE
  5156. fi
  5157. else
  5158. # The program doesn't exist.
  5159. \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
  5160. \$echo \"This script is just a wrapper for \$program.\" 1>&2
  5161. $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  5162. exit $EXIT_FAILURE
  5163. fi
  5164. fi\
  5165. "
  5166. chmod +x $output
  5167. fi
  5168. exit $EXIT_SUCCESS
  5169. ;;
  5170. esac
  5171. # See if we need to build an old-fashioned archive.
  5172. for oldlib in $oldlibs; do
  5173. if test "$build_libtool_libs" = convenience; then
  5174. oldobjs="$libobjs_save"
  5175. addlibs="$convenience"
  5176. build_libtool_libs=no
  5177. else
  5178. if test "$build_libtool_libs" = module; then
  5179. oldobjs="$libobjs_save"
  5180. build_libtool_libs=no
  5181. else
  5182. oldobjs="$old_deplibs $non_pic_objects"
  5183. fi
  5184. addlibs="$old_convenience"
  5185. fi
  5186. if test -n "$addlibs"; then
  5187. gentop="$output_objdir/${outputname}x"
  5188. generated="$generated $gentop"
  5189. func_extract_archives $gentop $addlibs
  5190. oldobjs="$oldobjs $func_extract_archives_result"
  5191. fi
  5192. # Do each command in the archive commands.
  5193. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  5194. cmds=$old_archive_from_new_cmds
  5195. else
  5196. # POSIX demands no paths to be encoded in archives. We have
  5197. # to avoid creating archives with duplicate basenames if we
  5198. # might have to extract them afterwards, e.g., when creating a
  5199. # static archive out of a convenience library, or when linking
  5200. # the entirety of a libtool archive into another (currently
  5201. # not supported by libtool).
  5202. if (for obj in $oldobjs
  5203. do
  5204. $echo "X$obj" | $Xsed -e 's%^.*/%%'
  5205. done | sort | sort -uc >/dev/null 2>&1); then
  5206. :
  5207. else
  5208. $echo "copying selected object files to avoid basename conflicts..."
  5209. if test -z "$gentop"; then
  5210. gentop="$output_objdir/${outputname}x"
  5211. generated="$generated $gentop"
  5212. $show "${rm}r $gentop"
  5213. $run ${rm}r "$gentop"
  5214. $show "$mkdir $gentop"
  5215. $run $mkdir "$gentop"
  5216. exit_status=$?
  5217. if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
  5218. exit $exit_status
  5219. fi
  5220. fi
  5221. save_oldobjs=$oldobjs
  5222. oldobjs=
  5223. counter=1
  5224. for obj in $save_oldobjs
  5225. do
  5226. objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  5227. case " $oldobjs " in
  5228. " ") oldobjs=$obj ;;
  5229. *[\ /]"$objbase "*)
  5230. while :; do
  5231. # Make sure we don't pick an alternate name that also
  5232. # overlaps.
  5233. newobj=lt$counter-$objbase
  5234. counter=`expr $counter + 1`
  5235. case " $oldobjs " in
  5236. *[\ /]"$newobj "*) ;;
  5237. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  5238. esac
  5239. done
  5240. $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  5241. $run ln "$obj" "$gentop/$newobj" ||
  5242. $run cp "$obj" "$gentop/$newobj"
  5243. oldobjs="$oldobjs $gentop/$newobj"
  5244. ;;
  5245. *) oldobjs="$oldobjs $obj" ;;
  5246. esac
  5247. done
  5248. fi
  5249. eval cmds=\"$old_archive_cmds\"
  5250. if len=`expr "X$cmds" : ".*"` &&
  5251. test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  5252. cmds=$old_archive_cmds
  5253. else
  5254. # the command line is too long to link in one step, link in parts
  5255. $echo "using piecewise archive linking..."
  5256. save_RANLIB=$RANLIB
  5257. RANLIB=:
  5258. objlist=
  5259. concat_cmds=
  5260. save_oldobjs=$oldobjs
  5261. # Is there a better way of finding the last object in the list?
  5262. for obj in $save_oldobjs
  5263. do
  5264. last_oldobj=$obj
  5265. done
  5266. for obj in $save_oldobjs
  5267. do
  5268. oldobjs="$objlist $obj"
  5269. objlist="$objlist $obj"
  5270. eval test_cmds=\"$old_archive_cmds\"
  5271. if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  5272. test "$len" -le "$max_cmd_len"; then
  5273. :
  5274. else
  5275. # the above command should be used before it gets too long
  5276. oldobjs=$objlist
  5277. if test "$obj" = "$last_oldobj" ; then
  5278. RANLIB=$save_RANLIB
  5279. fi
  5280. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  5281. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  5282. objlist=
  5283. fi
  5284. done
  5285. RANLIB=$save_RANLIB
  5286. oldobjs=$objlist
  5287. if test "X$oldobjs" = "X" ; then
  5288. eval cmds=\"\$concat_cmds\"
  5289. else
  5290. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  5291. fi
  5292. fi
  5293. fi
  5294. save_ifs="$IFS"; IFS='~'
  5295. for cmd in $cmds; do
  5296. eval cmd=\"$cmd\"
  5297. IFS="$save_ifs"
  5298. $show "$cmd"
  5299. $run eval "$cmd" || exit $?
  5300. done
  5301. IFS="$save_ifs"
  5302. done
  5303. if test -n "$generated"; then
  5304. $show "${rm}r$generated"
  5305. $run ${rm}r$generated
  5306. fi
  5307. # Now create the libtool archive.
  5308. case $output in
  5309. *.la)
  5310. old_library=
  5311. test "$build_old_libs" = yes && old_library="$libname.$libext"
  5312. $show "creating $output"
  5313. # Preserve any variables that may affect compiler behavior
  5314. for var in $variables_saved_for_relink; do
  5315. if eval test -z \"\${$var+set}\"; then
  5316. relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  5317. elif eval var_value=\$$var; test -z "$var_value"; then
  5318. relink_command="$var=; export $var; $relink_command"
  5319. else
  5320. var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  5321. relink_command="$var=\"$var_value\"; export $var; $relink_command"
  5322. fi
  5323. done
  5324. # Quote the link command for shipping.
  5325. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  5326. relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  5327. if test "$hardcode_automatic" = yes ; then
  5328. relink_command=
  5329. fi
  5330. # Only create the output if not a dry run.
  5331. if test -z "$run"; then
  5332. for installed in no yes; do
  5333. if test "$installed" = yes; then
  5334. if test -z "$install_libdir"; then
  5335. break
  5336. fi
  5337. output="$output_objdir/$outputname"i
  5338. # Replace all uninstalled libtool libraries with the installed ones
  5339. newdependency_libs=
  5340. for deplib in $dependency_libs; do
  5341. case $deplib in
  5342. *.la)
  5343. name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  5344. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  5345. if test -z "$libdir"; then
  5346. $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  5347. exit $EXIT_FAILURE
  5348. fi
  5349. newdependency_libs="$newdependency_libs $libdir/$name"
  5350. ;;
  5351. *) newdependency_libs="$newdependency_libs $deplib" ;;
  5352. esac
  5353. done
  5354. dependency_libs="$newdependency_libs"
  5355. newdlfiles=
  5356. for lib in $dlfiles; do
  5357. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5358. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5359. if test -z "$libdir"; then
  5360. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5361. exit $EXIT_FAILURE
  5362. fi
  5363. newdlfiles="$newdlfiles $libdir/$name"
  5364. done
  5365. dlfiles="$newdlfiles"
  5366. newdlprefiles=
  5367. for lib in $dlprefiles; do
  5368. name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5369. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  5370. if test -z "$libdir"; then
  5371. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5372. exit $EXIT_FAILURE
  5373. fi
  5374. newdlprefiles="$newdlprefiles $libdir/$name"
  5375. done
  5376. dlprefiles="$newdlprefiles"
  5377. else
  5378. newdlfiles=
  5379. for lib in $dlfiles; do
  5380. case $lib in
  5381. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  5382. *) abs=`pwd`"/$lib" ;;
  5383. esac
  5384. newdlfiles="$newdlfiles $abs"
  5385. done
  5386. dlfiles="$newdlfiles"
  5387. newdlprefiles=
  5388. for lib in $dlprefiles; do
  5389. case $lib in
  5390. [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
  5391. *) abs=`pwd`"/$lib" ;;
  5392. esac
  5393. newdlprefiles="$newdlprefiles $abs"
  5394. done
  5395. dlprefiles="$newdlprefiles"
  5396. fi
  5397. $rm $output
  5398. # place dlname in correct position for cygwin
  5399. tdlname=$dlname
  5400. case $host,$output,$installed,$module,$dlname in
  5401. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  5402. esac
  5403. $echo > $output "\
  5404. # $outputname - a libtool library file
  5405. # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  5406. #
  5407. # Please DO NOT delete this file!
  5408. # It is necessary for linking the library.
  5409. # The name that we can dlopen(3).
  5410. dlname='$tdlname'
  5411. # Names of this library.
  5412. library_names='$library_names'
  5413. # The name of the static archive.
  5414. old_library='$old_library'
  5415. # Libraries that this one depends upon.
  5416. dependency_libs='$dependency_libs'
  5417. # Version information for $libname.
  5418. current=$current
  5419. age=$age
  5420. revision=$revision
  5421. # Is this an already installed library?
  5422. installed=$installed
  5423. # Should we warn about portability when linking against -modules?
  5424. shouldnotlink=$module
  5425. # Files to dlopen/dlpreopen
  5426. dlopen='$dlfiles'
  5427. dlpreopen='$dlprefiles'
  5428. # Directory that this library needs to be installed in:
  5429. libdir='$install_libdir'"
  5430. if test "$installed" = no && test "$need_relink" = yes; then
  5431. $echo >> $output "\
  5432. relink_command=\"$relink_command\""
  5433. fi
  5434. done
  5435. fi
  5436. # Do a symbolic link so that the libtool archive can be found in
  5437. # LD_LIBRARY_PATH before the program is installed.
  5438. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  5439. $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  5440. ;;
  5441. esac
  5442. exit $EXIT_SUCCESS
  5443. ;;
  5444. # libtool install mode
  5445. install)
  5446. modename="$modename: install"
  5447. # There may be an optional sh(1) argument at the beginning of
  5448. # install_prog (especially on Windows NT).
  5449. if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  5450. # Allow the use of GNU shtool's install command.
  5451. $echo "X$nonopt" | grep shtool > /dev/null; then
  5452. # Aesthetically quote it.
  5453. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  5454. case $arg in
  5455. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5456. arg="\"$arg\""
  5457. ;;
  5458. esac
  5459. install_prog="$arg "
  5460. arg="$1"
  5461. shift
  5462. else
  5463. install_prog=
  5464. arg=$nonopt
  5465. fi
  5466. # The real first argument should be the name of the installation program.
  5467. # Aesthetically quote it.
  5468. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5469. case $arg in
  5470. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5471. arg="\"$arg\""
  5472. ;;
  5473. esac
  5474. install_prog="$install_prog$arg"
  5475. # We need to accept at least all the BSD install flags.
  5476. dest=
  5477. files=
  5478. opts=
  5479. prev=
  5480. install_type=
  5481. isdir=no
  5482. stripme=
  5483. for arg
  5484. do
  5485. if test -n "$dest"; then
  5486. files="$files $dest"
  5487. dest=$arg
  5488. continue
  5489. fi
  5490. case $arg in
  5491. -d) isdir=yes ;;
  5492. -f)
  5493. case " $install_prog " in
  5494. *[\\\ /]cp\ *) ;;
  5495. *) prev=$arg ;;
  5496. esac
  5497. ;;
  5498. -g | -m | -o) prev=$arg ;;
  5499. -s)
  5500. stripme=" -s"
  5501. continue
  5502. ;;
  5503. -*)
  5504. ;;
  5505. *)
  5506. # If the previous option needed an argument, then skip it.
  5507. if test -n "$prev"; then
  5508. prev=
  5509. else
  5510. dest=$arg
  5511. continue
  5512. fi
  5513. ;;
  5514. esac
  5515. # Aesthetically quote the argument.
  5516. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5517. case $arg in
  5518. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5519. arg="\"$arg\""
  5520. ;;
  5521. esac
  5522. install_prog="$install_prog $arg"
  5523. done
  5524. if test -z "$install_prog"; then
  5525. $echo "$modename: you must specify an install program" 1>&2
  5526. $echo "$help" 1>&2
  5527. exit $EXIT_FAILURE
  5528. fi
  5529. if test -n "$prev"; then
  5530. $echo "$modename: the \`$prev' option requires an argument" 1>&2
  5531. $echo "$help" 1>&2
  5532. exit $EXIT_FAILURE
  5533. fi
  5534. if test -z "$files"; then
  5535. if test -z "$dest"; then
  5536. $echo "$modename: no file or destination specified" 1>&2
  5537. else
  5538. $echo "$modename: you must specify a destination" 1>&2
  5539. fi
  5540. $echo "$help" 1>&2
  5541. exit $EXIT_FAILURE
  5542. fi
  5543. # Strip any trailing slash from the destination.
  5544. dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  5545. # Check to see that the destination is a directory.
  5546. test -d "$dest" && isdir=yes
  5547. if test "$isdir" = yes; then
  5548. destdir="$dest"
  5549. destname=
  5550. else
  5551. destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  5552. test "X$destdir" = "X$dest" && destdir=.
  5553. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  5554. # Not a directory, so check to see that there is only one file specified.
  5555. set dummy $files
  5556. if test "$#" -gt 2; then
  5557. $echo "$modename: \`$dest' is not a directory" 1>&2
  5558. $echo "$help" 1>&2
  5559. exit $EXIT_FAILURE
  5560. fi
  5561. fi
  5562. case $destdir in
  5563. [\\/]* | [A-Za-z]:[\\/]*) ;;
  5564. *)
  5565. for file in $files; do
  5566. case $file in
  5567. *.lo) ;;
  5568. *)
  5569. $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  5570. $echo "$help" 1>&2
  5571. exit $EXIT_FAILURE
  5572. ;;
  5573. esac
  5574. done
  5575. ;;
  5576. esac
  5577. # This variable tells wrapper scripts just to set variables rather
  5578. # than running their programs.
  5579. libtool_install_magic="$magic"
  5580. staticlibs=
  5581. future_libdirs=
  5582. current_libdirs=
  5583. for file in $files; do
  5584. # Do each installation.
  5585. case $file in
  5586. *.$libext)
  5587. # Do the static libraries later.
  5588. staticlibs="$staticlibs $file"
  5589. ;;
  5590. *.la)
  5591. # Check to see that this really is a libtool archive.
  5592. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5593. else
  5594. $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  5595. $echo "$help" 1>&2
  5596. exit $EXIT_FAILURE
  5597. fi
  5598. library_names=
  5599. old_library=
  5600. relink_command=
  5601. # If there is no directory component, then add one.
  5602. case $file in
  5603. */* | *\\*) . $file ;;
  5604. *) . ./$file ;;
  5605. esac
  5606. # Add the libdir to current_libdirs if it is the destination.
  5607. if test "X$destdir" = "X$libdir"; then
  5608. case "$current_libdirs " in
  5609. *" $libdir "*) ;;
  5610. *) current_libdirs="$current_libdirs $libdir" ;;
  5611. esac
  5612. else
  5613. # Note the libdir as a future libdir.
  5614. case "$future_libdirs " in
  5615. *" $libdir "*) ;;
  5616. *) future_libdirs="$future_libdirs $libdir" ;;
  5617. esac
  5618. fi
  5619. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  5620. test "X$dir" = "X$file/" && dir=
  5621. dir="$dir$objdir"
  5622. if test -n "$relink_command"; then
  5623. # Determine the prefix the user has applied to our future dir.
  5624. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
  5625. # Don't allow the user to place us outside of our expected
  5626. # location b/c this prevents finding dependent libraries that
  5627. # are installed to the same prefix.
  5628. # At present, this check doesn't affect windows .dll's that
  5629. # are installed into $libdir/../bin (currently, that works fine)
  5630. # but it's something to keep an eye on.
  5631. if test "$inst_prefix_dir" = "$destdir"; then
  5632. $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  5633. exit $EXIT_FAILURE
  5634. fi
  5635. if test -n "$inst_prefix_dir"; then
  5636. # Stick the inst_prefix_dir data into the link command.
  5637. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  5638. else
  5639. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  5640. fi
  5641. $echo "$modename: warning: relinking \`$file'" 1>&2
  5642. $show "$relink_command"
  5643. if $run eval "$relink_command"; then :
  5644. else
  5645. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5646. exit $EXIT_FAILURE
  5647. fi
  5648. fi
  5649. # See the names of the shared library.
  5650. set dummy $library_names
  5651. if test -n "$2"; then
  5652. realname="$2"
  5653. shift
  5654. shift
  5655. srcname="$realname"
  5656. test -n "$relink_command" && srcname="$realname"T
  5657. # Install the shared library and build the symlinks.
  5658. $show "$install_prog $dir/$srcname $destdir/$realname"
  5659. $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  5660. if test -n "$stripme" && test -n "$striplib"; then
  5661. $show "$striplib $destdir/$realname"
  5662. $run eval "$striplib $destdir/$realname" || exit $?
  5663. fi
  5664. if test "$#" -gt 0; then
  5665. # Delete the old symlinks, and create new ones.
  5666. # Try `ln -sf' first, because the `ln' binary might depend on
  5667. # the symlink we replace! Solaris /bin/ln does not understand -f,
  5668. # so we also need to try rm && ln -s.
  5669. for linkname
  5670. do
  5671. if test "$linkname" != "$realname"; then
  5672. $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
  5673. $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
  5674. fi
  5675. done
  5676. fi
  5677. # Do each command in the postinstall commands.
  5678. lib="$destdir/$realname"
  5679. cmds=$postinstall_cmds
  5680. save_ifs="$IFS"; IFS='~'
  5681. for cmd in $cmds; do
  5682. IFS="$save_ifs"
  5683. eval cmd=\"$cmd\"
  5684. $show "$cmd"
  5685. $run eval "$cmd" || {
  5686. lt_exit=$?
  5687. # Restore the uninstalled library and exit
  5688. if test "$mode" = relink; then
  5689. $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
  5690. fi
  5691. exit $lt_exit
  5692. }
  5693. done
  5694. IFS="$save_ifs"
  5695. fi
  5696. # Install the pseudo-library for information purposes.
  5697. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5698. instname="$dir/$name"i
  5699. $show "$install_prog $instname $destdir/$name"
  5700. $run eval "$install_prog $instname $destdir/$name" || exit $?
  5701. # Maybe install the static library, too.
  5702. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  5703. ;;
  5704. *.lo)
  5705. # Install (i.e. copy) a libtool object.
  5706. # Figure out destination file name, if it wasn't already specified.
  5707. if test -n "$destname"; then
  5708. destfile="$destdir/$destname"
  5709. else
  5710. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5711. destfile="$destdir/$destfile"
  5712. fi
  5713. # Deduce the name of the destination old-style object file.
  5714. case $destfile in
  5715. *.lo)
  5716. staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  5717. ;;
  5718. *.$objext)
  5719. staticdest="$destfile"
  5720. destfile=
  5721. ;;
  5722. *)
  5723. $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  5724. $echo "$help" 1>&2
  5725. exit $EXIT_FAILURE
  5726. ;;
  5727. esac
  5728. # Install the libtool object if requested.
  5729. if test -n "$destfile"; then
  5730. $show "$install_prog $file $destfile"
  5731. $run eval "$install_prog $file $destfile" || exit $?
  5732. fi
  5733. # Install the old object if enabled.
  5734. if test "$build_old_libs" = yes; then
  5735. # Deduce the name of the old-style object file.
  5736. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  5737. $show "$install_prog $staticobj $staticdest"
  5738. $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  5739. fi
  5740. exit $EXIT_SUCCESS
  5741. ;;
  5742. *)
  5743. # Figure out destination file name, if it wasn't already specified.
  5744. if test -n "$destname"; then
  5745. destfile="$destdir/$destname"
  5746. else
  5747. destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5748. destfile="$destdir/$destfile"
  5749. fi
  5750. # If the file is missing, and there is a .exe on the end, strip it
  5751. # because it is most likely a libtool script we actually want to
  5752. # install
  5753. stripped_ext=""
  5754. case $file in
  5755. *.exe)
  5756. if test ! -f "$file"; then
  5757. file=`$echo $file|${SED} 's,.exe$,,'`
  5758. stripped_ext=".exe"
  5759. fi
  5760. ;;
  5761. esac
  5762. # Do a test to see if this is really a libtool program.
  5763. case $host in
  5764. *cygwin*|*mingw*)
  5765. wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
  5766. ;;
  5767. *)
  5768. wrapper=$file
  5769. ;;
  5770. esac
  5771. if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  5772. notinst_deplibs=
  5773. relink_command=
  5774. # Note that it is not necessary on cygwin/mingw to append a dot to
  5775. # foo even if both foo and FILE.exe exist: automatic-append-.exe
  5776. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  5777. # `FILE.' does not work on cygwin managed mounts.
  5778. #
  5779. # If there is no directory component, then add one.
  5780. case $wrapper in
  5781. */* | *\\*) . ${wrapper} ;;
  5782. *) . ./${wrapper} ;;
  5783. esac
  5784. # Check the variables that should have been set.
  5785. if test -z "$notinst_deplibs"; then
  5786. $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  5787. exit $EXIT_FAILURE
  5788. fi
  5789. finalize=yes
  5790. for lib in $notinst_deplibs; do
  5791. # Check to see that each library is installed.
  5792. libdir=
  5793. if test -f "$lib"; then
  5794. # If there is no directory component, then add one.
  5795. case $lib in
  5796. */* | *\\*) . $lib ;;
  5797. *) . ./$lib ;;
  5798. esac
  5799. fi
  5800. libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  5801. if test -n "$libdir" && test ! -f "$libfile"; then
  5802. $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  5803. finalize=no
  5804. fi
  5805. done
  5806. relink_command=
  5807. # Note that it is not necessary on cygwin/mingw to append a dot to
  5808. # foo even if both foo and FILE.exe exist: automatic-append-.exe
  5809. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  5810. # `FILE.' does not work on cygwin managed mounts.
  5811. #
  5812. # If there is no directory component, then add one.
  5813. case $wrapper in
  5814. */* | *\\*) . ${wrapper} ;;
  5815. *) . ./${wrapper} ;;
  5816. esac
  5817. outputname=
  5818. if test "$fast_install" = no && test -n "$relink_command"; then
  5819. if test "$finalize" = yes && test -z "$run"; then
  5820. tmpdir=`func_mktempdir`
  5821. file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  5822. outputname="$tmpdir/$file"
  5823. # Replace the output file specification.
  5824. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  5825. $show "$relink_command"
  5826. if $run eval "$relink_command"; then :
  5827. else
  5828. $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  5829. ${rm}r "$tmpdir"
  5830. continue
  5831. fi
  5832. file="$outputname"
  5833. else
  5834. $echo "$modename: warning: cannot relink \`$file'" 1>&2
  5835. fi
  5836. else
  5837. # Install the binary that we compiled earlier.
  5838. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  5839. fi
  5840. fi
  5841. # remove .exe since cygwin /usr/bin/install will append another
  5842. # one anyway
  5843. case $install_prog,$host in
  5844. */usr/bin/install*,*cygwin*)
  5845. case $file:$destfile in
  5846. *.exe:*.exe)
  5847. # this is ok
  5848. ;;
  5849. *.exe:*)
  5850. destfile=$destfile.exe
  5851. ;;
  5852. *:*.exe)
  5853. destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
  5854. ;;
  5855. esac
  5856. ;;
  5857. esac
  5858. $show "$install_prog$stripme $file $destfile"
  5859. $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  5860. test -n "$outputname" && ${rm}r "$tmpdir"
  5861. ;;
  5862. esac
  5863. done
  5864. for file in $staticlibs; do
  5865. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  5866. # Set up the ranlib parameters.
  5867. oldlib="$destdir/$name"
  5868. $show "$install_prog $file $oldlib"
  5869. $run eval "$install_prog \$file \$oldlib" || exit $?
  5870. if test -n "$stripme" && test -n "$old_striplib"; then
  5871. $show "$old_striplib $oldlib"
  5872. $run eval "$old_striplib $oldlib" || exit $?
  5873. fi
  5874. # Do each command in the postinstall commands.
  5875. cmds=$old_postinstall_cmds
  5876. save_ifs="$IFS"; IFS='~'
  5877. for cmd in $cmds; do
  5878. IFS="$save_ifs"
  5879. eval cmd=\"$cmd\"
  5880. $show "$cmd"
  5881. $run eval "$cmd" || exit $?
  5882. done
  5883. IFS="$save_ifs"
  5884. done
  5885. if test -n "$future_libdirs"; then
  5886. $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  5887. fi
  5888. if test -n "$current_libdirs"; then
  5889. # Maybe just do a dry run.
  5890. test -n "$run" && current_libdirs=" -n$current_libdirs"
  5891. exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  5892. else
  5893. exit $EXIT_SUCCESS
  5894. fi
  5895. ;;
  5896. # libtool finish mode
  5897. finish)
  5898. modename="$modename: finish"
  5899. libdirs="$nonopt"
  5900. admincmds=
  5901. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  5902. for dir
  5903. do
  5904. libdirs="$libdirs $dir"
  5905. done
  5906. for libdir in $libdirs; do
  5907. if test -n "$finish_cmds"; then
  5908. # Do each command in the finish commands.
  5909. cmds=$finish_cmds
  5910. save_ifs="$IFS"; IFS='~'
  5911. for cmd in $cmds; do
  5912. IFS="$save_ifs"
  5913. eval cmd=\"$cmd\"
  5914. $show "$cmd"
  5915. $run eval "$cmd" || admincmds="$admincmds
  5916. $cmd"
  5917. done
  5918. IFS="$save_ifs"
  5919. fi
  5920. if test -n "$finish_eval"; then
  5921. # Do the single finish_eval.
  5922. eval cmds=\"$finish_eval\"
  5923. $run eval "$cmds" || admincmds="$admincmds
  5924. $cmds"
  5925. fi
  5926. done
  5927. fi
  5928. # Exit here if they wanted silent mode.
  5929. test "$show" = : && exit $EXIT_SUCCESS
  5930. $echo "X----------------------------------------------------------------------" | $Xsed
  5931. $echo "Libraries have been installed in:"
  5932. for libdir in $libdirs; do
  5933. $echo " $libdir"
  5934. done
  5935. $echo
  5936. $echo "If you ever happen to want to link against installed libraries"
  5937. $echo "in a given directory, LIBDIR, you must either use libtool, and"
  5938. $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  5939. $echo "flag during linking and do at least one of the following:"
  5940. if test -n "$shlibpath_var"; then
  5941. $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  5942. $echo " during execution"
  5943. fi
  5944. if test -n "$runpath_var"; then
  5945. $echo " - add LIBDIR to the \`$runpath_var' environment variable"
  5946. $echo " during linking"
  5947. fi
  5948. if test -n "$hardcode_libdir_flag_spec"; then
  5949. libdir=LIBDIR
  5950. eval flag=\"$hardcode_libdir_flag_spec\"
  5951. $echo " - use the \`$flag' linker flag"
  5952. fi
  5953. if test -n "$admincmds"; then
  5954. $echo " - have your system administrator run these commands:$admincmds"
  5955. fi
  5956. if test -f /etc/ld.so.conf; then
  5957. $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  5958. fi
  5959. $echo
  5960. $echo "See any operating system documentation about shared libraries for"
  5961. $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  5962. $echo "X----------------------------------------------------------------------" | $Xsed
  5963. exit $EXIT_SUCCESS
  5964. ;;
  5965. # libtool execute mode
  5966. execute)
  5967. modename="$modename: execute"
  5968. # The first argument is the command name.
  5969. cmd="$nonopt"
  5970. if test -z "$cmd"; then
  5971. $echo "$modename: you must specify a COMMAND" 1>&2
  5972. $echo "$help"
  5973. exit $EXIT_FAILURE
  5974. fi
  5975. # Handle -dlopen flags immediately.
  5976. for file in $execute_dlfiles; do
  5977. if test ! -f "$file"; then
  5978. $echo "$modename: \`$file' is not a file" 1>&2
  5979. $echo "$help" 1>&2
  5980. exit $EXIT_FAILURE
  5981. fi
  5982. dir=
  5983. case $file in
  5984. *.la)
  5985. # Check to see that this really is a libtool archive.
  5986. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5987. else
  5988. $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5989. $echo "$help" 1>&2
  5990. exit $EXIT_FAILURE
  5991. fi
  5992. # Read the libtool library.
  5993. dlname=
  5994. library_names=
  5995. # If there is no directory component, then add one.
  5996. case $file in
  5997. */* | *\\*) . $file ;;
  5998. *) . ./$file ;;
  5999. esac
  6000. # Skip this library if it cannot be dlopened.
  6001. if test -z "$dlname"; then
  6002. # Warn if it was a shared library.
  6003. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  6004. continue
  6005. fi
  6006. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  6007. test "X$dir" = "X$file" && dir=.
  6008. if test -f "$dir/$objdir/$dlname"; then
  6009. dir="$dir/$objdir"
  6010. else
  6011. $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  6012. exit $EXIT_FAILURE
  6013. fi
  6014. ;;
  6015. *.lo)
  6016. # Just add the directory containing the .lo file.
  6017. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  6018. test "X$dir" = "X$file" && dir=.
  6019. ;;
  6020. *)
  6021. $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  6022. continue
  6023. ;;
  6024. esac
  6025. # Get the absolute pathname.
  6026. absdir=`cd "$dir" && pwd`
  6027. test -n "$absdir" && dir="$absdir"
  6028. # Now add the directory to shlibpath_var.
  6029. if eval "test -z \"\$$shlibpath_var\""; then
  6030. eval "$shlibpath_var=\"\$dir\""
  6031. else
  6032. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  6033. fi
  6034. done
  6035. # This variable tells wrapper scripts just to set shlibpath_var
  6036. # rather than running their programs.
  6037. libtool_execute_magic="$magic"
  6038. # Check if any of the arguments is a wrapper script.
  6039. args=
  6040. for file
  6041. do
  6042. case $file in
  6043. -*) ;;
  6044. *)
  6045. # Do a test to see if this is really a libtool program.
  6046. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6047. # If there is no directory component, then add one.
  6048. case $file in
  6049. */* | *\\*) . $file ;;
  6050. *) . ./$file ;;
  6051. esac
  6052. # Transform arg to wrapped name.
  6053. file="$progdir/$program"
  6054. fi
  6055. ;;
  6056. esac
  6057. # Quote arguments (to preserve shell metacharacters).
  6058. file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  6059. args="$args \"$file\""
  6060. done
  6061. if test -z "$run"; then
  6062. if test -n "$shlibpath_var"; then
  6063. # Export the shlibpath_var.
  6064. eval "export $shlibpath_var"
  6065. fi
  6066. # Restore saved environment variables
  6067. if test "${save_LC_ALL+set}" = set; then
  6068. LC_ALL="$save_LC_ALL"; export LC_ALL
  6069. fi
  6070. if test "${save_LANG+set}" = set; then
  6071. LANG="$save_LANG"; export LANG
  6072. fi
  6073. # Now prepare to actually exec the command.
  6074. exec_cmd="\$cmd$args"
  6075. else
  6076. # Display what would be done.
  6077. if test -n "$shlibpath_var"; then
  6078. eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  6079. $echo "export $shlibpath_var"
  6080. fi
  6081. $echo "$cmd$args"
  6082. exit $EXIT_SUCCESS
  6083. fi
  6084. ;;
  6085. # libtool clean and uninstall mode
  6086. clean | uninstall)
  6087. modename="$modename: $mode"
  6088. rm="$nonopt"
  6089. files=
  6090. rmforce=
  6091. exit_status=0
  6092. # This variable tells wrapper scripts just to set variables rather
  6093. # than running their programs.
  6094. libtool_install_magic="$magic"
  6095. for arg
  6096. do
  6097. case $arg in
  6098. -f) rm="$rm $arg"; rmforce=yes ;;
  6099. -*) rm="$rm $arg" ;;
  6100. *) files="$files $arg" ;;
  6101. esac
  6102. done
  6103. if test -z "$rm"; then
  6104. $echo "$modename: you must specify an RM program" 1>&2
  6105. $echo "$help" 1>&2
  6106. exit $EXIT_FAILURE
  6107. fi
  6108. rmdirs=
  6109. origobjdir="$objdir"
  6110. for file in $files; do
  6111. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  6112. if test "X$dir" = "X$file"; then
  6113. dir=.
  6114. objdir="$origobjdir"
  6115. else
  6116. objdir="$dir/$origobjdir"
  6117. fi
  6118. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  6119. test "$mode" = uninstall && objdir="$dir"
  6120. # Remember objdir for removal later, being careful to avoid duplicates
  6121. if test "$mode" = clean; then
  6122. case " $rmdirs " in
  6123. *" $objdir "*) ;;
  6124. *) rmdirs="$rmdirs $objdir" ;;
  6125. esac
  6126. fi
  6127. # Don't error if the file doesn't exist and rm -f was used.
  6128. if (test -L "$file") >/dev/null 2>&1 \
  6129. || (test -h "$file") >/dev/null 2>&1 \
  6130. || test -f "$file"; then
  6131. :
  6132. elif test -d "$file"; then
  6133. exit_status=1
  6134. continue
  6135. elif test "$rmforce" = yes; then
  6136. continue
  6137. fi
  6138. rmfiles="$file"
  6139. case $name in
  6140. *.la)
  6141. # Possibly a libtool archive, so verify it.
  6142. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6143. . $dir/$name
  6144. # Delete the libtool libraries and symlinks.
  6145. for n in $library_names; do
  6146. rmfiles="$rmfiles $objdir/$n"
  6147. done
  6148. test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
  6149. case "$mode" in
  6150. clean)
  6151. case " $library_names " in
  6152. # " " in the beginning catches empty $dlname
  6153. *" $dlname "*) ;;
  6154. *) rmfiles="$rmfiles $objdir/$dlname" ;;
  6155. esac
  6156. test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  6157. ;;
  6158. uninstall)
  6159. if test -n "$library_names"; then
  6160. # Do each command in the postuninstall commands.
  6161. cmds=$postuninstall_cmds
  6162. save_ifs="$IFS"; IFS='~'
  6163. for cmd in $cmds; do
  6164. IFS="$save_ifs"
  6165. eval cmd=\"$cmd\"
  6166. $show "$cmd"
  6167. $run eval "$cmd"
  6168. if test "$?" -ne 0 && test "$rmforce" != yes; then
  6169. exit_status=1
  6170. fi
  6171. done
  6172. IFS="$save_ifs"
  6173. fi
  6174. if test -n "$old_library"; then
  6175. # Do each command in the old_postuninstall commands.
  6176. cmds=$old_postuninstall_cmds
  6177. save_ifs="$IFS"; IFS='~'
  6178. for cmd in $cmds; do
  6179. IFS="$save_ifs"
  6180. eval cmd=\"$cmd\"
  6181. $show "$cmd"
  6182. $run eval "$cmd"
  6183. if test "$?" -ne 0 && test "$rmforce" != yes; then
  6184. exit_status=1
  6185. fi
  6186. done
  6187. IFS="$save_ifs"
  6188. fi
  6189. # FIXME: should reinstall the best remaining shared library.
  6190. ;;
  6191. esac
  6192. fi
  6193. ;;
  6194. *.lo)
  6195. # Possibly a libtool object, so verify it.
  6196. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6197. # Read the .lo file
  6198. . $dir/$name
  6199. # Add PIC object to the list of files to remove.
  6200. if test -n "$pic_object" \
  6201. && test "$pic_object" != none; then
  6202. rmfiles="$rmfiles $dir/$pic_object"
  6203. fi
  6204. # Add non-PIC object to the list of files to remove.
  6205. if test -n "$non_pic_object" \
  6206. && test "$non_pic_object" != none; then
  6207. rmfiles="$rmfiles $dir/$non_pic_object"
  6208. fi
  6209. fi
  6210. ;;
  6211. *)
  6212. if test "$mode" = clean ; then
  6213. noexename=$name
  6214. case $file in
  6215. *.exe)
  6216. file=`$echo $file|${SED} 's,.exe$,,'`
  6217. noexename=`$echo $name|${SED} 's,.exe$,,'`
  6218. # $file with .exe has already been added to rmfiles,
  6219. # add $file without .exe
  6220. rmfiles="$rmfiles $file"
  6221. ;;
  6222. esac
  6223. # Do a test to see if this is a libtool program.
  6224. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  6225. relink_command=
  6226. . $dir/$noexename
  6227. # note $name still contains .exe if it was in $file originally
  6228. # as does the version of $file that was added into $rmfiles
  6229. rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
  6230. if test "$fast_install" = yes && test -n "$relink_command"; then
  6231. rmfiles="$rmfiles $objdir/lt-$name"
  6232. fi
  6233. if test "X$noexename" != "X$name" ; then
  6234. rmfiles="$rmfiles $objdir/lt-${noexename}.c"
  6235. fi
  6236. fi
  6237. fi
  6238. ;;
  6239. esac
  6240. $show "$rm $rmfiles"
  6241. $run $rm $rmfiles || exit_status=1
  6242. done
  6243. objdir="$origobjdir"
  6244. # Try to remove the ${objdir}s in the directories where we deleted files
  6245. for dir in $rmdirs; do
  6246. if test -d "$dir"; then
  6247. $show "rmdir $dir"
  6248. $run rmdir $dir >/dev/null 2>&1
  6249. fi
  6250. done
  6251. exit $exit_status
  6252. ;;
  6253. "")
  6254. $echo "$modename: you must specify a MODE" 1>&2
  6255. $echo "$generic_help" 1>&2
  6256. exit $EXIT_FAILURE
  6257. ;;
  6258. esac
  6259. if test -z "$exec_cmd"; then
  6260. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6261. $echo "$generic_help" 1>&2
  6262. exit $EXIT_FAILURE
  6263. fi
  6264. fi # test -z "$show_help"
  6265. if test -n "$exec_cmd"; then
  6266. eval exec $exec_cmd
  6267. exit $EXIT_FAILURE
  6268. fi
  6269. # We need to display help for each of the modes.
  6270. case $mode in
  6271. "") $echo \
  6272. "Usage: $modename [OPTION]... [MODE-ARG]...
  6273. Provide generalized library-building support services.
  6274. --config show all configuration variables
  6275. --debug enable verbose shell tracing
  6276. -n, --dry-run display commands without modifying any files
  6277. --features display basic configuration information and exit
  6278. --finish same as \`--mode=finish'
  6279. --help display this help message and exit
  6280. --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  6281. --quiet same as \`--silent'
  6282. --silent don't print informational messages
  6283. --tag=TAG use configuration variables from tag TAG
  6284. --version print version information
  6285. MODE must be one of the following:
  6286. clean remove files from the build directory
  6287. compile compile a source file into a libtool object
  6288. execute automatically set library path, then run a program
  6289. finish complete the installation of libtool libraries
  6290. install install libraries or executables
  6291. link create a library or an executable
  6292. uninstall remove libraries from an installed directory
  6293. MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  6294. a more detailed description of MODE.
  6295. Report bugs to <bug-libtool@gnu.org>."
  6296. exit $EXIT_SUCCESS
  6297. ;;
  6298. clean)
  6299. $echo \
  6300. "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  6301. Remove files from the build directory.
  6302. RM is the name of the program to use to delete files associated with each FILE
  6303. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  6304. to RM.
  6305. If FILE is a libtool library, object or program, all the files associated
  6306. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  6307. ;;
  6308. compile)
  6309. $echo \
  6310. "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  6311. Compile a source file into a libtool library object.
  6312. This mode accepts the following additional options:
  6313. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  6314. -prefer-pic try to building PIC objects only
  6315. -prefer-non-pic try to building non-PIC objects only
  6316. -static always build a \`.o' file suitable for static linking
  6317. COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  6318. from the given SOURCEFILE.
  6319. The output file name is determined by removing the directory component from
  6320. SOURCEFILE, then substituting the C source code suffix \`.c' with the
  6321. library object suffix, \`.lo'."
  6322. ;;
  6323. execute)
  6324. $echo \
  6325. "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  6326. Automatically set library path, then run a program.
  6327. This mode accepts the following additional options:
  6328. -dlopen FILE add the directory containing FILE to the library path
  6329. This mode sets the library path environment variable according to \`-dlopen'
  6330. flags.
  6331. If any of the ARGS are libtool executable wrappers, then they are translated
  6332. into their corresponding uninstalled binary, and any of their required library
  6333. directories are added to the library path.
  6334. Then, COMMAND is executed, with ARGS as arguments."
  6335. ;;
  6336. finish)
  6337. $echo \
  6338. "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  6339. Complete the installation of libtool libraries.
  6340. Each LIBDIR is a directory that contains libtool libraries.
  6341. The commands that this mode executes may require superuser privileges. Use
  6342. the \`--dry-run' option if you just want to see what would be executed."
  6343. ;;
  6344. install)
  6345. $echo \
  6346. "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  6347. Install executables or libraries.
  6348. INSTALL-COMMAND is the installation command. The first component should be
  6349. either the \`install' or \`cp' program.
  6350. The rest of the components are interpreted as arguments to that command (only
  6351. BSD-compatible install options are recognized)."
  6352. ;;
  6353. link)
  6354. $echo \
  6355. "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  6356. Link object files or libraries together to form another library, or to
  6357. create an executable program.
  6358. LINK-COMMAND is a command using the C compiler that you would use to create
  6359. a program from several object files.
  6360. The following components of LINK-COMMAND are treated specially:
  6361. -all-static do not do any dynamic linking at all
  6362. -avoid-version do not add a version suffix if possible
  6363. -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  6364. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  6365. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  6366. -export-symbols SYMFILE
  6367. try to export only the symbols listed in SYMFILE
  6368. -export-symbols-regex REGEX
  6369. try to export only the symbols matching REGEX
  6370. -LLIBDIR search LIBDIR for required installed libraries
  6371. -lNAME OUTPUT-FILE requires the installed library libNAME
  6372. -module build a library that can dlopened
  6373. -no-fast-install disable the fast-install mode
  6374. -no-install link a not-installable executable
  6375. -no-undefined declare that a library does not refer to external symbols
  6376. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  6377. -objectlist FILE Use a list of object files found in FILE to specify objects
  6378. -precious-files-regex REGEX
  6379. don't remove output files matching REGEX
  6380. -release RELEASE specify package release information
  6381. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  6382. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  6383. -static do not do any dynamic linking of libtool libraries
  6384. -version-info CURRENT[:REVISION[:AGE]]
  6385. specify library version info [each variable defaults to 0]
  6386. All other options (arguments beginning with \`-') are ignored.
  6387. Every other argument is treated as a filename. Files ending in \`.la' are
  6388. treated as uninstalled libtool libraries, other files are standard or library
  6389. object files.
  6390. If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  6391. only library objects (\`.lo' files) may be specified, and \`-rpath' is
  6392. required, except when creating a convenience library.
  6393. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  6394. using \`ar' and \`ranlib', or on Windows using \`lib'.
  6395. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  6396. is created, otherwise an executable program is created."
  6397. ;;
  6398. uninstall)
  6399. $echo \
  6400. "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  6401. Remove libraries from an installation directory.
  6402. RM is the name of the program to use to delete files associated with each FILE
  6403. (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  6404. to RM.
  6405. If FILE is a libtool library, all the files associated with it are deleted.
  6406. Otherwise, only FILE itself is deleted using RM."
  6407. ;;
  6408. *)
  6409. $echo "$modename: invalid operation mode \`$mode'" 1>&2
  6410. $echo "$help" 1>&2
  6411. exit $EXIT_FAILURE
  6412. ;;
  6413. esac
  6414. $echo
  6415. $echo "Try \`$modename --help' for more information about other modes."
  6416. exit $?
  6417. # The TAGs below are defined such that we never get into a situation
  6418. # in which we disable both kinds of libraries. Given conflicting
  6419. # choices, we go for a static library, that is the most portable,
  6420. # since we can't tell whether shared libraries were disabled because
  6421. # the user asked for that or because the platform doesn't support
  6422. # them. This is particularly important on AIX, because we don't
  6423. # support having both static and shared libraries enabled at the same
  6424. # time on that platform, so we default to a shared-only configuration.
  6425. # If a disable-shared tag is given, we'll fallback to a static-only
  6426. # configuration. But we'll never go from static-only to shared-only.
  6427. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  6428. disable_libs=shared
  6429. # ### END LIBTOOL TAG CONFIG: disable-shared
  6430. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  6431. disable_libs=static
  6432. # ### END LIBTOOL TAG CONFIG: disable-static
  6433. # Local Variables:
  6434. # mode:shell-script
  6435. # sh-indentation:2
  6436. # End:
  6437. # ### BEGIN LIBTOOL TAG CONFIG: CXX
  6438. # Libtool was configured on host raspberrypi:
  6439. # Shell to use when invoking shell scripts.
  6440. SHELL="/bin/bash"
  6441. # Whether or not to build shared libraries.
  6442. build_libtool_libs=yes
  6443. # Whether or not to build static libraries.
  6444. build_old_libs=yes
  6445. # Whether or not to add -lc for building shared libraries.
  6446. build_libtool_need_lc=no
  6447. # Whether or not to disallow shared libs when runtime libs are static
  6448. allow_libtool_libs_with_static_runtimes=no
  6449. # Whether or not to optimize for fast installation.
  6450. fast_install=yes
  6451. # The host system.
  6452. host_alias=
  6453. host=armv7l-unknown-linux-gnu
  6454. host_os=linux-gnu
  6455. # The build system.
  6456. build_alias=
  6457. build=armv7l-unknown-linux-gnu
  6458. build_os=linux-gnu
  6459. # An echo program that does not interpret backslashes.
  6460. echo="echo"
  6461. # The archiver.
  6462. AR="ar"
  6463. AR_FLAGS="cru"
  6464. # A C compiler.
  6465. LTCC="gcc"
  6466. # LTCC compiler flags.
  6467. LTCFLAGS="-g -O2"
  6468. # A language-specific compiler.
  6469. CC="g++"
  6470. # Is the compiler the GNU C compiler?
  6471. with_gcc=yes
  6472. # An ERE matcher.
  6473. EGREP="grep -E"
  6474. # The linker used to build libraries.
  6475. LD="/usr/bin/ld"
  6476. # Whether we need hard or soft links.
  6477. LN_S="ln -s"
  6478. # A BSD-compatible nm program.
  6479. NM="/usr/bin/nm -B"
  6480. # A symbol stripping program
  6481. STRIP="strip"
  6482. # Used to examine libraries when file_magic_cmd begins "file"
  6483. MAGIC_CMD=file
  6484. # Used on cygwin: DLL creation program.
  6485. DLLTOOL="dlltool"
  6486. # Used on cygwin: object dumper.
  6487. OBJDUMP="objdump"
  6488. # Used on cygwin: assembler.
  6489. AS="as"
  6490. # The name of the directory that contains temporary libtool files.
  6491. objdir=.libs
  6492. # How to create reloadable object files.
  6493. reload_flag=" -r"
  6494. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  6495. # How to pass a linker flag through the compiler.
  6496. wl="-Wl,"
  6497. # Object file suffix (normally "o").
  6498. objext="o"
  6499. # Old archive suffix (normally "a").
  6500. libext="a"
  6501. # Shared library suffix (normally ".so").
  6502. shrext_cmds='.so'
  6503. # Executable file suffix (normally "").
  6504. exeext=""
  6505. # Additional compiler flags for building library objects.
  6506. pic_flag=" -fPIC -DPIC"
  6507. pic_mode=default
  6508. # What is the maximum length of a command?
  6509. max_cmd_len=32768
  6510. # Does compiler simultaneously support -c and -o options?
  6511. compiler_c_o="yes"
  6512. # Must we lock files when doing compilation?
  6513. need_locks="no"
  6514. # Do we need the lib prefix for modules?
  6515. need_lib_prefix=no
  6516. # Do we need a version for libraries?
  6517. need_version=no
  6518. # Whether dlopen is supported.
  6519. dlopen_support=unknown
  6520. # Whether dlopen of programs is supported.
  6521. dlopen_self=unknown
  6522. # Whether dlopen of statically linked programs is supported.
  6523. dlopen_self_static=unknown
  6524. # Compiler flag to prevent dynamic linking.
  6525. link_static_flag="-static"
  6526. # Compiler flag to turn off builtin functions.
  6527. no_builtin_flag=" -fno-builtin"
  6528. # Compiler flag to allow reflexive dlopens.
  6529. export_dynamic_flag_spec="\${wl}--export-dynamic"
  6530. # Compiler flag to generate shared objects directly from archives.
  6531. whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
  6532. # Compiler flag to generate thread-safe objects.
  6533. thread_safe_flag_spec=""
  6534. # Library versioning type.
  6535. version_type=linux
  6536. # Format of library name prefix.
  6537. libname_spec="lib\$name"
  6538. # List of archive names. First name is the real one, the rest are links.
  6539. # The last name is the one that the linker finds with -lNAME.
  6540. library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
  6541. # The coded name of the library, if different from the real name.
  6542. soname_spec="\${libname}\${release}\${shared_ext}\$major"
  6543. # Commands used to build and install an old-style archive.
  6544. RANLIB="ranlib"
  6545. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
  6546. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib"
  6547. old_postuninstall_cmds=""
  6548. # Create an old-style archive from a shared archive.
  6549. old_archive_from_new_cmds=""
  6550. # Create a temporary old-style archive to link instead of a shared archive.
  6551. old_archive_from_expsyms_cmds=""
  6552. # Commands used to build and install a shared archive.
  6553. archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
  6554. archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
  6555. postinstall_cmds=""
  6556. postuninstall_cmds=""
  6557. # Commands used to build a loadable module (assumed same as above if empty)
  6558. module_cmds=""
  6559. module_expsym_cmds=""
  6560. # Commands to strip libraries.
  6561. old_striplib="strip --strip-debug"
  6562. striplib="strip --strip-unneeded"
  6563. # Dependencies to place before the objects being linked to create a
  6564. # shared library.
  6565. predep_objects="/usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crti.o /usr/lib/gcc/arm-linux-gnueabihf/8/crtbeginS.o"
  6566. # Dependencies to place after the objects being linked to create a
  6567. # shared library.
  6568. postdep_objects="/usr/lib/gcc/arm-linux-gnueabihf/8/crtendS.o /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/crtn.o"
  6569. # Dependencies to place before the objects being linked to create a
  6570. # shared library.
  6571. predeps=""
  6572. # Dependencies to place after the objects being linked to create a
  6573. # shared library.
  6574. postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
  6575. # The library search path used internally by the compiler when linking
  6576. # a shared library.
  6577. compiler_lib_search_path="-L/usr/lib/gcc/arm-linux-gnueabihf/8 -L/usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/8/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf"
  6578. # Method to check whether dependent libraries are shared objects.
  6579. deplibs_check_method="pass_all"
  6580. # Command to use when deplibs_check_method == file_magic.
  6581. file_magic_cmd="\$MAGIC_CMD"
  6582. # Flag that allows shared libraries with undefined symbols to be built.
  6583. allow_undefined_flag=""
  6584. # Flag that forces no undefined symbols.
  6585. no_undefined_flag=""
  6586. # Commands used to finish a libtool library installation in a directory.
  6587. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  6588. # Same as above, but a single script fragment to be evaled but not shown.
  6589. finish_eval=""
  6590. # Take the output of nm and produce a listing of raw symbols and C names.
  6591. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'"
  6592. # Transform the output of nm in a proper C declaration
  6593. global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
  6594. # Transform the output of nm in a C name address pair
  6595. global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
  6596. # This is the shared library runtime path variable.
  6597. runpath_var=LD_RUN_PATH
  6598. # This is the shared library path variable.
  6599. shlibpath_var=LD_LIBRARY_PATH
  6600. # Is shlibpath searched before the hard-coded library search path?
  6601. shlibpath_overrides_runpath=no
  6602. # How to hardcode a shared library path into an executable.
  6603. hardcode_action=immediate
  6604. # Whether we should hardcode library paths into libraries.
  6605. hardcode_into_libs=yes
  6606. # Flag to hardcode $libdir into a binary during linking.
  6607. # This must work even if $libdir does not exist.
  6608. hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
  6609. # If ld is used when linking, flag to hardcode $libdir into
  6610. # a binary during linking. This must work even if $libdir does
  6611. # not exist.
  6612. hardcode_libdir_flag_spec_ld=""
  6613. # Whether we need a single -rpath flag with a separated argument.
  6614. hardcode_libdir_separator=""
  6615. # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
  6616. # resulting binary.
  6617. hardcode_direct=no
  6618. # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
  6619. # resulting binary.
  6620. hardcode_minus_L=no
  6621. # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  6622. # the resulting binary.
  6623. hardcode_shlibpath_var=unsupported
  6624. # Set to yes if building a shared library automatically hardcodes DIR into the library
  6625. # and all subsequent libraries and executables linked against it.
  6626. hardcode_automatic=no
  6627. # Variables whose values should be saved in libtool wrapper scripts and
  6628. # restored at relink time.
  6629. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  6630. # Whether libtool must link a program against all its dependency libraries.
  6631. link_all_deplibs=unknown
  6632. # Compile-time system search path for libraries
  6633. sys_lib_search_path_spec=" /usr/lib/gcc/arm-linux-gnueabihf/8/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/8/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../../arm-linux-gnueabihf/lib/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/8/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../arm-linux-gnueabihf/ /usr/lib/gcc/arm-linux-gnueabihf/8/../../../ /lib/arm-linux-gnueabihf/8/ /lib/arm-linux-gnueabihf/ /lib/ /usr/lib/arm-linux-gnueabihf/8/ /usr/lib/arm-linux-gnueabihf/ /usr/lib/"
  6634. # Run-time system search path for libraries
  6635. sys_lib_dlsearch_path_spec="/lib /usr/lib /opt/vc/lib /usr/local/lib/arm-linux-gnueabihf /lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf /usr/lib/arm-linux-gnueabihf/libfakeroot /usr/local/lib "
  6636. # Fix the shell variable $srcfile for the compiler.
  6637. fix_srcfile_path=""
  6638. # Set to yes if exported symbols are required.
  6639. always_export_symbols=no
  6640. # The commands to list exported symbols.
  6641. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  6642. # The commands to extract the exported symbol list from a shared archive.
  6643. extract_expsyms_cmds=""
  6644. # Symbols that should not be listed in the preloaded symbols.
  6645. exclude_expsyms=""
  6646. # Symbols that must always be exported.
  6647. include_expsyms=""
  6648. # ### END LIBTOOL TAG CONFIG: CXX