patch-ltmain_sh 248 KB

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