libtool 254 KB

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