libtool 291 KB

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