libtool 206 KB

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