libtool 240 KB

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