libtool 254 KB

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