libtool 362 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668
  1. #! /bin/bash
  2. # Generated automatically by config.status (libtool) 2.4.6
  3. # Libtool was configured on host ubuntu-16:
  4. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
  5. # Provide generalized library-building support services.
  6. # Written by Gordon Matzigkeit, 1996
  7. # Copyright (C) 2014 Free Software Foundation, Inc.
  8. # This is free software; see the source for copying conditions. There is NO
  9. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. # GNU Libtool is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2 of of the License, or
  13. # (at your option) any later version.
  14. #
  15. # As a special exception to the GNU General Public License, if you
  16. # distribute this file as part of a program or library that is built
  17. # using GNU Libtool, you may include this file under the same
  18. # distribution terms that you use for the rest of that program.
  19. #
  20. # GNU Libtool is distributed in the hope that it will be useful, but
  21. # WITHOUT ANY WARRANTY; without even the implied warranty of
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. # GNU General Public License for more details.
  24. #
  25. # You should have received a copy of the GNU General Public License
  26. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  27. # The names of the tagged configurations supported by this script.
  28. available_tags='CXX F77 FC GO GCJ RC '
  29. # Configured defaults for sys_lib_dlsearch_path munging.
  30. : ${LT_SYS_LIBRARY_PATH=""}
  31. # ### BEGIN LIBTOOL CONFIG
  32. # Which release of libtool.m4 was used?
  33. macro_version=2.4.6
  34. macro_revision=2.4.6
  35. # Assembler program.
  36. AS="arm-linux-gnueabihf-as "
  37. # DLL creation program.
  38. DLLTOOL="false"
  39. # Object dumper program.
  40. OBJDUMP="arm-linux-gnueabihf-objdump"
  41. # Whether or not to build shared libraries.
  42. build_libtool_libs=yes
  43. # Whether or not to build static libraries.
  44. build_old_libs=yes
  45. # What type of objects to build.
  46. pic_mode=default
  47. # Whether or not to optimize for fast installation.
  48. fast_install=yes
  49. # Shared archive member basename,for filename based shared library versioning on AIX.
  50. shared_archive_member_spec=
  51. # Shell to use when invoking shell scripts.
  52. SHELL="/bin/bash"
  53. # An echo program that protects backslashes.
  54. ECHO="printf %s\\n"
  55. # The PATH separator for the build system.
  56. PATH_SEPARATOR=":"
  57. # The host system.
  58. host_alias=arm-linux-gnueabi
  59. host=arm-unknown-linux-gnueabi
  60. host_os=linux-gnueabi
  61. # The build system.
  62. build_alias=x86_64-linux
  63. build=x86_64-pc-linux-gnu
  64. build_os=linux-gnu
  65. # A sed program that does not truncate output.
  66. SED="sed"
  67. # Sed that helps us avoid accidentally triggering echo(1) options like -n.
  68. Xsed="$SED -e 1s/^X//"
  69. # A grep program that handles long lines.
  70. GREP="grep"
  71. # An ERE matcher.
  72. EGREP="grep -E"
  73. # A literal string matcher.
  74. FGREP="grep -F"
  75. # A BSD- or MS-compatible name lister.
  76. NM="arm-linux-gnueabihf-nm"
  77. # Whether we need soft or hard links.
  78. LN_S="ln -s"
  79. # What is the maximum length of a command?
  80. max_cmd_len=1572864
  81. # Object file suffix (normally "o").
  82. objext=o
  83. # Executable file suffix (normally "").
  84. exeext=
  85. # whether the shell understands "unset".
  86. lt_unset=unset
  87. # turn spaces into newlines.
  88. SP2NL="tr \\040 \\012"
  89. # turn newlines into spaces.
  90. NL2SP="tr \\015\\012 \\040\\040"
  91. # convert $build file names to $host format.
  92. to_host_file_cmd=func_convert_file_noop
  93. # convert $build files to toolchain format.
  94. to_tool_file_cmd=func_convert_file_noop
  95. # Method to check whether dependent libraries are shared objects.
  96. deplibs_check_method="pass_all"
  97. # Command to use when deplibs_check_method = "file_magic".
  98. file_magic_cmd="\$MAGIC_CMD"
  99. # How to find potential files when deplibs_check_method = "file_magic".
  100. file_magic_glob=""
  101. # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
  102. want_nocaseglob="no"
  103. # Command to associate shared and link libraries.
  104. sharedlib_from_linklib_cmd="printf %s\\n"
  105. # The archiver.
  106. AR="arm-linux-gnueabihf-ar"
  107. # Flags to create an archive.
  108. AR_FLAGS="cru"
  109. # How to feed a file listing to the archiver.
  110. archiver_list_spec="@"
  111. # A symbol stripping program.
  112. STRIP="arm-linux-gnueabihf-strip"
  113. # Commands used to install an old-style archive.
  114. RANLIB="arm-linux-gnueabihf-ranlib"
  115. old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
  116. old_postuninstall_cmds=""
  117. # Whether to use a lock for old archive extraction.
  118. lock_old_archive_extraction=no
  119. # A C compiler.
  120. LTCC="arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard "
  121. # LTCC compiler flags.
  122. LTCFLAGS=" -isystem/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/libtool/2.4.6-r0=/usr/src/debug/libtool/2.4.6-r0 -fdebug-prefix-map== -fdebug-prefix-map== "
  123. # Take the output of nm and produce a listing of raw symbols and C names.
  124. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
  125. # Transform the output of nm in a proper C declaration.
  126. global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
  127. # Transform the output of nm into a list of symbols to manually relocate.
  128. global_symbol_to_import=""
  129. # Transform the output of nm in a C name address pair.
  130. global_symbol_to_c_name_address="sed -n -e 's/^: \\(.*\\) .*\$/ {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p'"
  131. # Transform the output of nm in a C name address pair when lib prefix is needed.
  132. global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\(.*\\) .*\$/ {\"\\1\", (void *) 0},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(lib.*\\)\$/ {\"\\1\", (void *) \\&\\1},/p' -e 's/^[ABCDGIRSTW][ABCDGIRSTW]* .* \\(.*\\)\$/ {\"lib\\1\", (void *) \\&\\1},/p'"
  133. # The name lister interface.
  134. nm_interface="BSD nm"
  135. # Specify filename containing input files for $NM.
  136. nm_file_list_spec="@"
  137. # The root where to search for dependent libraries,and where our libraries should be installed.
  138. lt_sysroot=
  139. # Command to truncate a binary pipe.
  140. lt_truncate_bin="/bin/dd bs=4096 count=1"
  141. # The name of the directory that contains temporary libtool files.
  142. objdir=.libs
  143. # Used to examine libraries when file_magic_cmd begins with "file".
  144. MAGIC_CMD=file
  145. # Must we lock files when doing compilation?
  146. need_locks="no"
  147. # Manifest tool.
  148. MANIFEST_TOOL=":"
  149. # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
  150. DSYMUTIL=""
  151. # Tool to change global to local symbols on Mac OS X.
  152. NMEDIT=""
  153. # Tool to manipulate fat objects and archives on Mac OS X.
  154. LIPO=""
  155. # ldd/readelf like tool for Mach-O binaries on Mac OS X.
  156. OTOOL=""
  157. # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
  158. OTOOL64=""
  159. # Old archive suffix (normally "a").
  160. libext=a
  161. # Shared library suffix (normally ".so").
  162. shrext_cmds=".so"
  163. # The commands to extract the exported symbol list from a shared archive.
  164. extract_expsyms_cmds=""
  165. # Variables whose values should be saved in libtool wrapper scripts and
  166. # restored at link time.
  167. variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
  168. # Do we need the "lib" prefix for modules?
  169. need_lib_prefix=no
  170. # Do we need a version for libraries?
  171. need_version=no
  172. # Library versioning type.
  173. version_type=linux
  174. # Shared library runtime path variable.
  175. runpath_var=LD_RUN_PATH
  176. # Shared library path variable.
  177. shlibpath_var=LD_LIBRARY_PATH
  178. # Is shlibpath searched before the hard-coded library search path?
  179. shlibpath_overrides_runpath=no
  180. # Format of library name prefix.
  181. libname_spec="lib\$name"
  182. # List of archive names. First name is the real one, the rest are links.
  183. # The last name is the one that the linker finds with -lNAME
  184. library_names_spec="\$libname\$release\$shared_ext\$versuffix \$libname\$release\$shared_ext\$major \$libname\$shared_ext"
  185. # The coded name of the library, if different from the real name.
  186. soname_spec="\$libname\$release\$shared_ext\$major"
  187. # Permission mode override for installation of shared libraries.
  188. install_override_mode=""
  189. # Command to use after installation of a shared archive.
  190. postinstall_cmds=""
  191. # Command to use after uninstallation of a shared archive.
  192. postuninstall_cmds=""
  193. # Commands used to finish a libtool library installation in a directory.
  194. finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
  195. # As "finish_cmds", except a single script fragment to be evaled but
  196. # not shown.
  197. finish_eval=""
  198. # Whether we should hardcode library paths into libraries.
  199. hardcode_into_libs=yes
  200. # Compile-time system search path for libraries.
  201. sys_lib_search_path_spec="/usr/lib /lib"
  202. # Detected run-time system search path for libraries.
  203. sys_lib_dlsearch_path_spec="/usr/lib /lib"
  204. # Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
  205. configure_time_lt_sys_library_path=""
  206. # Whether dlopen is supported.
  207. dlopen_support=yes
  208. # Whether dlopen of programs is supported.
  209. dlopen_self=unknown
  210. # Whether dlopen of statically linked programs is supported.
  211. dlopen_self_static=unknown
  212. # Commands to strip libraries.
  213. old_striplib="arm-linux-gnueabihf-strip --strip-debug"
  214. striplib="arm-linux-gnueabihf-strip --strip-unneeded"
  215. # The linker used to build libraries.
  216. LD="arm-linux-gnueabihf-ld "
  217. # How to create reloadable object files.
  218. reload_flag=" -r"
  219. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  220. # Commands used to build an old-style archive.
  221. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  222. # A language specific compiler.
  223. CC="arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard "
  224. # Is the compiler the GNU compiler?
  225. with_gcc=yes
  226. # Compiler flag to turn off builtin functions.
  227. no_builtin_flag=" -fno-builtin"
  228. # Additional compiler flags for building library objects.
  229. pic_flag=" -fPIC -DPIC"
  230. # How to pass a linker flag through the compiler.
  231. wl="-Wl,"
  232. # Compiler flag to prevent dynamic linking.
  233. link_static_flag="-static"
  234. # Does compiler simultaneously support -c and -o options?
  235. compiler_c_o="yes"
  236. # Whether or not to add -lc for building shared libraries.
  237. build_libtool_need_lc=no
  238. # Whether or not to disallow shared libs when runtime libs are static.
  239. allow_libtool_libs_with_static_runtimes=no
  240. # Compiler flag to allow reflexive dlopens.
  241. export_dynamic_flag_spec="\$wl--export-dynamic"
  242. # Compiler flag to generate shared objects directly from archives.
  243. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  244. # Whether the compiler copes with passing no objects directly.
  245. compiler_needs_object="no"
  246. # Create an old-style archive from a shared archive.
  247. old_archive_from_new_cmds=""
  248. # Create a temporary old-style archive to link instead of a shared archive.
  249. old_archive_from_expsyms_cmds=""
  250. # Commands used to build a shared archive.
  251. archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  252. archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  253. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  254. echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  255. \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
  256. # Commands used to build a loadable module if different from building
  257. # a shared archive.
  258. module_cmds=""
  259. module_expsym_cmds=""
  260. # Whether we are building with GNU ld or not.
  261. with_gnu_ld="yes"
  262. # Flag that allows shared libraries with undefined symbols to be built.
  263. allow_undefined_flag=""
  264. # Flag that enforces no undefined symbols.
  265. no_undefined_flag=""
  266. # Flag to hardcode $libdir into a binary during linking.
  267. # This must work even if $libdir does not exist
  268. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  269. # Whether we need a single "-rpath" flag with a separated argument.
  270. hardcode_libdir_separator=""
  271. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  272. # DIR into the resulting binary.
  273. hardcode_direct=no
  274. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  275. # DIR into the resulting binary and the resulting library dependency is
  276. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  277. # library is relocated.
  278. hardcode_direct_absolute=no
  279. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  280. # into the resulting binary.
  281. hardcode_minus_L=no
  282. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  283. # into the resulting binary.
  284. hardcode_shlibpath_var=unsupported
  285. # Set to "yes" if building a shared library automatically hardcodes DIR
  286. # into the library and all subsequent libraries and executables linked
  287. # against it.
  288. hardcode_automatic=no
  289. # Set to yes if linker adds runtime paths of dependent libraries
  290. # to runtime path list.
  291. inherit_rpath=no
  292. # Whether libtool must link a program against all its dependency libraries.
  293. link_all_deplibs=unknown
  294. # Set to "yes" if exported symbols are required.
  295. always_export_symbols=no
  296. # The commands to list exported symbols.
  297. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  298. # Symbols that should not be listed in the preloaded symbols.
  299. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  300. # Symbols that must always be exported.
  301. include_expsyms=""
  302. # Commands necessary for linking programs (against libraries) with templates.
  303. prelink_cmds=""
  304. # Commands necessary for finishing linking programs.
  305. postlink_cmds=""
  306. # Specify filename containing input files.
  307. file_list_spec=""
  308. # How to hardcode a shared library path into an executable.
  309. hardcode_action=immediate
  310. # The directories searched by this compiler when creating a shared library.
  311. compiler_lib_search_dirs="/usr/lib /lib"
  312. # Dependencies to place before and after the objects being linked to
  313. # create a shared library.
  314. predep_objects=""
  315. postdep_objects=""
  316. predeps=""
  317. postdeps=""
  318. # The library search path used internally by the compiler when linking
  319. # a shared library.
  320. compiler_lib_search_path="/usr/lib /lib"
  321. # ### END LIBTOOL CONFIG
  322. # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
  323. # func_munge_path_list VARIABLE PATH
  324. # -----------------------------------
  325. # VARIABLE is name of variable containing _space_ separated list of
  326. # directories to be munged by the contents of PATH, which is string
  327. # having a format:
  328. # "DIR[:DIR]:"
  329. # string "DIR[ DIR]" will be prepended to VARIABLE
  330. # ":DIR[:DIR]"
  331. # string "DIR[ DIR]" will be appended to VARIABLE
  332. # "DIRP[:DIRP]::[DIRA:]DIRA"
  333. # string "DIRP[ DIRP]" will be prepended to VARIABLE and string
  334. # "DIRA[ DIRA]" will be appended to VARIABLE
  335. # "DIR[:DIR]"
  336. # VARIABLE will be replaced by "DIR[ DIR]"
  337. func_munge_path_list ()
  338. {
  339. case x$2 in
  340. x)
  341. ;;
  342. *:)
  343. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
  344. ;;
  345. x:*)
  346. eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
  347. ;;
  348. *::*)
  349. eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
  350. eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
  351. ;;
  352. *)
  353. eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
  354. ;;
  355. esac
  356. }
  357. # Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
  358. func_cc_basename ()
  359. {
  360. for cc_temp in $*""; do
  361. case $cc_temp in
  362. compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
  363. distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
  364. \-*) ;;
  365. *) break;;
  366. esac
  367. done
  368. func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
  369. }
  370. # ### END FUNCTIONS SHARED WITH CONFIGURE
  371. #! /bin/sh
  372. ## DO NOT EDIT - This file generated from ../libtool-2.4.6/build-aux/ltmain.in
  373. ## by inline-source v2014-01-03.01
  374. # libtool (GNU libtool) 2.4.6
  375. # Provide generalized library-building support services.
  376. # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  377. # Copyright (C) 1996-2015 Free Software Foundation, Inc.
  378. # This is free software; see the source for copying conditions. There is NO
  379. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  380. # GNU Libtool is free software; you can redistribute it and/or modify
  381. # it under the terms of the GNU General Public License as published by
  382. # the Free Software Foundation; either version 2 of the License, or
  383. # (at your option) any later version.
  384. #
  385. # As a special exception to the GNU General Public License,
  386. # if you distribute this file as part of a program or library that
  387. # is built using GNU Libtool, you may include this file under the
  388. # same distribution terms that you use for the rest of that program.
  389. #
  390. # GNU Libtool is distributed in the hope that it will be useful, but
  391. # WITHOUT ANY WARRANTY; without even the implied warranty of
  392. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  393. # General Public License for more details.
  394. #
  395. # You should have received a copy of the GNU General Public License
  396. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  397. PROGRAM=libtool
  398. PACKAGE=libtool
  399. VERSION=2.4.6
  400. package_revision=2.4.6
  401. ## ------ ##
  402. ## Usage. ##
  403. ## ------ ##
  404. # Run './libtool --help' for help with using this script from the
  405. # command line.
  406. ## ------------------------------- ##
  407. ## User overridable command paths. ##
  408. ## ------------------------------- ##
  409. # After configure completes, it has a better idea of some of the
  410. # shell tools we need than the defaults used by the functions shared
  411. # with bootstrap, so set those here where they can still be over-
  412. # ridden by the user, but otherwise take precedence.
  413. : ${AUTOCONF="autoconf"}
  414. : ${AUTOMAKE="automake"}
  415. ## -------------------------- ##
  416. ## Source external libraries. ##
  417. ## -------------------------- ##
  418. # Much of our low-level functionality needs to be sourced from external
  419. # libraries, which are installed to $pkgauxdir.
  420. # Set a version string for this script.
  421. scriptversion=2015-01-20.17; # UTC
  422. # General shell script boiler plate, and helper functions.
  423. # Written by Gary V. Vaughan, 2004
  424. # Copyright (C) 2004-2015 Free Software Foundation, Inc.
  425. # This is free software; see the source for copying conditions. There is NO
  426. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  427. # This program is free software; you can redistribute it and/or modify
  428. # it under the terms of the GNU General Public License as published by
  429. # the Free Software Foundation; either version 3 of the License, or
  430. # (at your option) any later version.
  431. # As a special exception to the GNU General Public License, if you distribute
  432. # this file as part of a program or library that is built using GNU Libtool,
  433. # you may include this file under the same distribution terms that you use
  434. # for the rest of that program.
  435. # This program is distributed in the hope that it will be useful,
  436. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  437. # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
  438. # General Public License for more details.
  439. # You should have received a copy of the GNU General Public License
  440. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  441. # Please report bugs or propose patches to gary@gnu.org.
  442. ## ------ ##
  443. ## Usage. ##
  444. ## ------ ##
  445. # Evaluate this file near the top of your script to gain access to
  446. # the functions and variables defined here:
  447. #
  448. # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
  449. #
  450. # If you need to override any of the default environment variable
  451. # settings, do that before evaluating this file.
  452. ## -------------------- ##
  453. ## Shell normalisation. ##
  454. ## -------------------- ##
  455. # Some shells need a little help to be as Bourne compatible as possible.
  456. # Before doing anything else, make sure all that help has been provided!
  457. DUALCASE=1; export DUALCASE # for MKS sh
  458. if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  459. emulate sh
  460. NULLCMD=:
  461. # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
  462. # is contrary to our usage. Disable this feature.
  463. alias -g '${1+"$@"}'='"$@"'
  464. setopt NO_GLOB_SUBST
  465. else
  466. case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
  467. fi
  468. # NLS nuisances: We save the old values in case they are required later.
  469. _G_user_locale=
  470. _G_safe_locale=
  471. for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  472. do
  473. eval "if test set = \"\${$_G_var+set}\"; then
  474. save_$_G_var=\$$_G_var
  475. $_G_var=C
  476. export $_G_var
  477. _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
  478. _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
  479. fi"
  480. done
  481. # CDPATH.
  482. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  483. # Make sure IFS has a sensible default
  484. sp=' '
  485. nl='
  486. '
  487. IFS="$sp $nl"
  488. # There are apparently some retarded systems that use ';' as a PATH separator!
  489. if test "${PATH_SEPARATOR+set}" != set; then
  490. PATH_SEPARATOR=:
  491. (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
  492. (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
  493. PATH_SEPARATOR=';'
  494. }
  495. fi
  496. ## ------------------------- ##
  497. ## Locate command utilities. ##
  498. ## ------------------------- ##
  499. # func_executable_p FILE
  500. # ----------------------
  501. # Check that FILE is an executable regular file.
  502. func_executable_p ()
  503. {
  504. test -f "$1" && test -x "$1"
  505. }
  506. # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
  507. # --------------------------------------------
  508. # Search for either a program that responds to --version with output
  509. # containing "GNU", or else returned by CHECK_FUNC otherwise, by
  510. # trying all the directories in PATH with each of the elements of
  511. # PROGS_LIST.
  512. #
  513. # CHECK_FUNC should accept the path to a candidate program, and
  514. # set $func_check_prog_result if it truncates its output less than
  515. # $_G_path_prog_max characters.
  516. func_path_progs ()
  517. {
  518. _G_progs_list=$1
  519. _G_check_func=$2
  520. _G_PATH=${3-"$PATH"}
  521. _G_path_prog_max=0
  522. _G_path_prog_found=false
  523. _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
  524. for _G_dir in $_G_PATH; do
  525. IFS=$_G_save_IFS
  526. test -z "$_G_dir" && _G_dir=.
  527. for _G_prog_name in $_G_progs_list; do
  528. for _exeext in '' .EXE; do
  529. _G_path_prog=$_G_dir/$_G_prog_name$_exeext
  530. func_executable_p "$_G_path_prog" || continue
  531. case `"$_G_path_prog" --version 2>&1` in
  532. *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
  533. *) $_G_check_func $_G_path_prog
  534. func_path_progs_result=$func_check_prog_result
  535. ;;
  536. esac
  537. $_G_path_prog_found && break 3
  538. done
  539. done
  540. done
  541. IFS=$_G_save_IFS
  542. test -z "$func_path_progs_result" && {
  543. echo "no acceptable sed could be found in \$PATH" >&2
  544. exit 1
  545. }
  546. }
  547. # We want to be able to use the functions in this file before configure
  548. # has figured out where the best binaries are kept, which means we have
  549. # to search for them ourselves - except when the results are already set
  550. # where we skip the searches.
  551. # Unless the user overrides by setting SED, search the path for either GNU
  552. # sed, or the sed that truncates its output the least.
  553. test -z "$SED" && {
  554. _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
  555. for _G_i in 1 2 3 4 5 6 7; do
  556. _G_sed_script=$_G_sed_script$nl$_G_sed_script
  557. done
  558. echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
  559. _G_sed_script=
  560. func_check_prog_sed ()
  561. {
  562. _G_path_prog=$1
  563. _G_count=0
  564. printf 0123456789 >conftest.in
  565. while :
  566. do
  567. cat conftest.in conftest.in >conftest.tmp
  568. mv conftest.tmp conftest.in
  569. cp conftest.in conftest.nl
  570. echo '' >> conftest.nl
  571. "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
  572. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  573. _G_count=`expr $_G_count + 1`
  574. if test "$_G_count" -gt "$_G_path_prog_max"; then
  575. # Best one so far, save it but keep looking for a better one
  576. func_check_prog_result=$_G_path_prog
  577. _G_path_prog_max=$_G_count
  578. fi
  579. # 10*(2^10) chars as input seems more than enough
  580. test 10 -lt "$_G_count" && break
  581. done
  582. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  583. }
  584. func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
  585. rm -f conftest.sed
  586. SED=$func_path_progs_result
  587. }
  588. # Unless the user overrides by setting GREP, search the path for either GNU
  589. # grep, or the grep that truncates its output the least.
  590. test -z "$GREP" && {
  591. func_check_prog_grep ()
  592. {
  593. _G_path_prog=$1
  594. _G_count=0
  595. _G_path_prog_max=0
  596. printf 0123456789 >conftest.in
  597. while :
  598. do
  599. cat conftest.in conftest.in >conftest.tmp
  600. mv conftest.tmp conftest.in
  601. cp conftest.in conftest.nl
  602. echo 'GREP' >> conftest.nl
  603. "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
  604. diff conftest.out conftest.nl >/dev/null 2>&1 || break
  605. _G_count=`expr $_G_count + 1`
  606. if test "$_G_count" -gt "$_G_path_prog_max"; then
  607. # Best one so far, save it but keep looking for a better one
  608. func_check_prog_result=$_G_path_prog
  609. _G_path_prog_max=$_G_count
  610. fi
  611. # 10*(2^10) chars as input seems more than enough
  612. test 10 -lt "$_G_count" && break
  613. done
  614. rm -f conftest.in conftest.tmp conftest.nl conftest.out
  615. }
  616. func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
  617. GREP=$func_path_progs_result
  618. }
  619. ## ------------------------------- ##
  620. ## User overridable command paths. ##
  621. ## ------------------------------- ##
  622. # All uppercase variable names are used for environment variables. These
  623. # variables can be overridden by the user before calling a script that
  624. # uses them if a suitable command of that name is not already available
  625. # in the command search PATH.
  626. : ${CP="cp -f"}
  627. : ${ECHO="printf %s\n"}
  628. : ${EGREP="$GREP -E"}
  629. : ${FGREP="$GREP -F"}
  630. : ${LN_S="ln -s"}
  631. : ${MAKE="make"}
  632. : ${MKDIR="mkdir"}
  633. : ${MV="mv -f"}
  634. : ${RM="rm -f"}
  635. : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  636. ## -------------------- ##
  637. ## Useful sed snippets. ##
  638. ## -------------------- ##
  639. sed_dirname='s|/[^/]*$||'
  640. sed_basename='s|^.*/||'
  641. # Sed substitution that helps us do robust quoting. It backslashifies
  642. # metacharacters that are still active within double-quoted strings.
  643. sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
  644. # Same as above, but do not quote variable references.
  645. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
  646. # Sed substitution that turns a string into a regex matching for the
  647. # string literally.
  648. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
  649. # Sed substitution that converts a w32 file name or path
  650. # that contains forward slashes, into one that contains
  651. # (escaped) backslashes. A very naive implementation.
  652. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  653. # Re-'\' parameter expansions in output of sed_double_quote_subst that
  654. # were '\'-ed in input to the same. If an odd number of '\' preceded a
  655. # '$' in input to sed_double_quote_subst, that '$' was protected from
  656. # expansion. Since each input '\' is now two '\'s, look for any number
  657. # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
  658. _G_bs='\\'
  659. _G_bs2='\\\\'
  660. _G_bs4='\\\\\\\\'
  661. _G_dollar='\$'
  662. sed_double_backslash="\
  663. s/$_G_bs4/&\\
  664. /g
  665. s/^$_G_bs2$_G_dollar/$_G_bs&/
  666. s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
  667. s/\n//g"
  668. ## ----------------- ##
  669. ## Global variables. ##
  670. ## ----------------- ##
  671. # Except for the global variables explicitly listed below, the following
  672. # functions in the '^func_' namespace, and the '^require_' namespace
  673. # variables initialised in the 'Resource management' section, sourcing
  674. # this file will not pollute your global namespace with anything
  675. # else. There's no portable way to scope variables in Bourne shell
  676. # though, so actually running these functions will sometimes place
  677. # results into a variable named after the function, and often use
  678. # temporary variables in the '^_G_' namespace. If you are careful to
  679. # avoid using those namespaces casually in your sourcing script, things
  680. # should continue to work as you expect. And, of course, you can freely
  681. # overwrite any of the functions or variables defined here before
  682. # calling anything to customize them.
  683. EXIT_SUCCESS=0
  684. EXIT_FAILURE=1
  685. EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  686. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  687. # Allow overriding, eg assuming that you follow the convention of
  688. # putting '$debug_cmd' at the start of all your functions, you can get
  689. # bash to show function call trace with:
  690. #
  691. # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
  692. debug_cmd=${debug_cmd-":"}
  693. exit_cmd=:
  694. # By convention, finish your script with:
  695. #
  696. # exit $exit_status
  697. #
  698. # so that you can set exit_status to non-zero if you want to indicate
  699. # something went wrong during execution without actually bailing out at
  700. # the point of failure.
  701. exit_status=$EXIT_SUCCESS
  702. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  703. # is ksh but when the shell is invoked as "sh" and the current value of
  704. # the _XPG environment variable is not equal to 1 (one), the special
  705. # positional parameter $0, within a function call, is the name of the
  706. # function.
  707. progpath=$0
  708. # The name of this program.
  709. progname=`$ECHO "$progpath" |$SED "$sed_basename"`
  710. # Make sure we have an absolute progpath for reexecution:
  711. case $progpath in
  712. [\\/]*|[A-Za-z]:\\*) ;;
  713. *[\\/]*)
  714. progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
  715. progdir=`cd "$progdir" && pwd`
  716. progpath=$progdir/$progname
  717. ;;
  718. *)
  719. _G_IFS=$IFS
  720. IFS=${PATH_SEPARATOR-:}
  721. for progdir in $PATH; do
  722. IFS=$_G_IFS
  723. test -x "$progdir/$progname" && break
  724. done
  725. IFS=$_G_IFS
  726. test -n "$progdir" || progdir=`pwd`
  727. progpath=$progdir/$progname
  728. ;;
  729. esac
  730. ## ----------------- ##
  731. ## Standard options. ##
  732. ## ----------------- ##
  733. # The following options affect the operation of the functions defined
  734. # below, and should be set appropriately depending on run-time para-
  735. # meters passed on the command line.
  736. opt_dry_run=false
  737. opt_quiet=false
  738. opt_verbose=false
  739. # Categories 'all' and 'none' are always available. Append any others
  740. # you will pass as the first argument to func_warning from your own
  741. # code.
  742. warning_categories=
  743. # By default, display warnings according to 'opt_warning_types'. Set
  744. # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
  745. # treat the next displayed warning as a fatal error.
  746. warning_func=func_warn_and_continue
  747. # Set to 'all' to display all warnings, 'none' to suppress all
  748. # warnings, or a space delimited list of some subset of
  749. # 'warning_categories' to display only the listed warnings.
  750. opt_warning_types=all
  751. ## -------------------- ##
  752. ## Resource management. ##
  753. ## -------------------- ##
  754. # This section contains definitions for functions that each ensure a
  755. # particular resource (a file, or a non-empty configuration variable for
  756. # example) is available, and if appropriate to extract default values
  757. # from pertinent package files. Call them using their associated
  758. # 'require_*' variable to ensure that they are executed, at most, once.
  759. #
  760. # It's entirely deliberate that calling these functions can set
  761. # variables that don't obey the namespace limitations obeyed by the rest
  762. # of this file, in order that that they be as useful as possible to
  763. # callers.
  764. # require_term_colors
  765. # -------------------
  766. # Allow display of bold text on terminals that support it.
  767. require_term_colors=func_require_term_colors
  768. func_require_term_colors ()
  769. {
  770. $debug_cmd
  771. test -t 1 && {
  772. # COLORTERM and USE_ANSI_COLORS environment variables take
  773. # precedence, because most terminfo databases neglect to describe
  774. # whether color sequences are supported.
  775. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
  776. if test 1 = "$USE_ANSI_COLORS"; then
  777. # Standard ANSI escape sequences
  778. tc_reset=''
  779. tc_bold=''; tc_standout=''
  780. tc_red=''; tc_green=''
  781. tc_blue=''; tc_cyan=''
  782. else
  783. # Otherwise trust the terminfo database after all.
  784. test -n "`tput sgr0 2>/dev/null`" && {
  785. tc_reset=`tput sgr0`
  786. test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
  787. tc_standout=$tc_bold
  788. test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
  789. test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
  790. test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
  791. test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
  792. test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
  793. }
  794. fi
  795. }
  796. require_term_colors=:
  797. }
  798. ## ----------------- ##
  799. ## Function library. ##
  800. ## ----------------- ##
  801. # This section contains a variety of useful functions to call in your
  802. # scripts. Take note of the portable wrappers for features provided by
  803. # some modern shells, which will fall back to slower equivalents on
  804. # less featureful shells.
  805. # func_append VAR VALUE
  806. # ---------------------
  807. # Append VALUE onto the existing contents of VAR.
  808. # We should try to minimise forks, especially on Windows where they are
  809. # unreasonably slow, so skip the feature probes when bash or zsh are
  810. # being used:
  811. if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
  812. : ${_G_HAVE_ARITH_OP="yes"}
  813. : ${_G_HAVE_XSI_OPS="yes"}
  814. # The += operator was introduced in bash 3.1
  815. case $BASH_VERSION in
  816. [12].* | 3.0 | 3.0*) ;;
  817. *)
  818. : ${_G_HAVE_PLUSEQ_OP="yes"}
  819. ;;
  820. esac
  821. fi
  822. # _G_HAVE_PLUSEQ_OP
  823. # Can be empty, in which case the shell is probed, "yes" if += is
  824. # useable or anything else if it does not work.
  825. test -z "$_G_HAVE_PLUSEQ_OP" \
  826. && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
  827. && _G_HAVE_PLUSEQ_OP=yes
  828. if test yes = "$_G_HAVE_PLUSEQ_OP"
  829. then
  830. # This is an XSI compatible shell, allowing a faster implementation...
  831. eval 'func_append ()
  832. {
  833. $debug_cmd
  834. eval "$1+=\$2"
  835. }'
  836. else
  837. # ...otherwise fall back to using expr, which is often a shell builtin.
  838. func_append ()
  839. {
  840. $debug_cmd
  841. eval "$1=\$$1\$2"
  842. }
  843. fi
  844. # func_append_quoted VAR VALUE
  845. # ----------------------------
  846. # Quote VALUE and append to the end of shell variable VAR, separated
  847. # by a space.
  848. if test yes = "$_G_HAVE_PLUSEQ_OP"; then
  849. eval 'func_append_quoted ()
  850. {
  851. $debug_cmd
  852. func_quote_for_eval "$2"
  853. eval "$1+=\\ \$func_quote_for_eval_result"
  854. }'
  855. else
  856. func_append_quoted ()
  857. {
  858. $debug_cmd
  859. func_quote_for_eval "$2"
  860. eval "$1=\$$1\\ \$func_quote_for_eval_result"
  861. }
  862. fi
  863. # func_append_uniq VAR VALUE
  864. # --------------------------
  865. # Append unique VALUE onto the existing contents of VAR, assuming
  866. # entries are delimited by the first character of VALUE. For example:
  867. #
  868. # func_append_uniq options " --another-option option-argument"
  869. #
  870. # will only append to $options if " --another-option option-argument "
  871. # is not already present somewhere in $options already (note spaces at
  872. # each end implied by leading space in second argument).
  873. func_append_uniq ()
  874. {
  875. $debug_cmd
  876. eval _G_current_value='`$ECHO $'$1'`'
  877. _G_delim=`expr "$2" : '\(.\)'`
  878. case $_G_delim$_G_current_value$_G_delim in
  879. *"$2$_G_delim"*) ;;
  880. *) func_append "$@" ;;
  881. esac
  882. }
  883. # func_arith TERM...
  884. # ------------------
  885. # Set func_arith_result to the result of evaluating TERMs.
  886. test -z "$_G_HAVE_ARITH_OP" \
  887. && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
  888. && _G_HAVE_ARITH_OP=yes
  889. if test yes = "$_G_HAVE_ARITH_OP"; then
  890. eval 'func_arith ()
  891. {
  892. $debug_cmd
  893. func_arith_result=$(( $* ))
  894. }'
  895. else
  896. func_arith ()
  897. {
  898. $debug_cmd
  899. func_arith_result=`expr "$@"`
  900. }
  901. fi
  902. # func_basename FILE
  903. # ------------------
  904. # Set func_basename_result to FILE with everything up to and including
  905. # the last / stripped.
  906. if test yes = "$_G_HAVE_XSI_OPS"; then
  907. # If this shell supports suffix pattern removal, then use it to avoid
  908. # forking. Hide the definitions single quotes in case the shell chokes
  909. # on unsupported syntax...
  910. _b='func_basename_result=${1##*/}'
  911. _d='case $1 in
  912. */*) func_dirname_result=${1%/*}$2 ;;
  913. * ) func_dirname_result=$3 ;;
  914. esac'
  915. else
  916. # ...otherwise fall back to using sed.
  917. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
  918. _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
  919. if test "X$func_dirname_result" = "X$1"; then
  920. func_dirname_result=$3
  921. else
  922. func_append func_dirname_result "$2"
  923. fi'
  924. fi
  925. eval 'func_basename ()
  926. {
  927. $debug_cmd
  928. '"$_b"'
  929. }'
  930. # func_dirname FILE APPEND NONDIR_REPLACEMENT
  931. # -------------------------------------------
  932. # Compute the dirname of FILE. If nonempty, add APPEND to the result,
  933. # otherwise set result to NONDIR_REPLACEMENT.
  934. eval 'func_dirname ()
  935. {
  936. $debug_cmd
  937. '"$_d"'
  938. }'
  939. # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
  940. # --------------------------------------------------------
  941. # Perform func_basename and func_dirname in a single function
  942. # call:
  943. # dirname: Compute the dirname of FILE. If nonempty,
  944. # add APPEND to the result, otherwise set result
  945. # to NONDIR_REPLACEMENT.
  946. # value returned in "$func_dirname_result"
  947. # basename: Compute filename of FILE.
  948. # value retuned in "$func_basename_result"
  949. # For efficiency, we do not delegate to the functions above but instead
  950. # duplicate the functionality here.
  951. eval 'func_dirname_and_basename ()
  952. {
  953. $debug_cmd
  954. '"$_b"'
  955. '"$_d"'
  956. }'
  957. # func_echo ARG...
  958. # ----------------
  959. # Echo program name prefixed message.
  960. func_echo ()
  961. {
  962. $debug_cmd
  963. _G_message=$*
  964. func_echo_IFS=$IFS
  965. IFS=$nl
  966. for _G_line in $_G_message; do
  967. IFS=$func_echo_IFS
  968. $ECHO "$progname: $_G_line"
  969. done
  970. IFS=$func_echo_IFS
  971. }
  972. # func_echo_all ARG...
  973. # --------------------
  974. # Invoke $ECHO with all args, space-separated.
  975. func_echo_all ()
  976. {
  977. $ECHO "$*"
  978. }
  979. # func_echo_infix_1 INFIX ARG...
  980. # ------------------------------
  981. # Echo program name, followed by INFIX on the first line, with any
  982. # additional lines not showing INFIX.
  983. func_echo_infix_1 ()
  984. {
  985. $debug_cmd
  986. $require_term_colors
  987. _G_infix=$1; shift
  988. _G_indent=$_G_infix
  989. _G_prefix="$progname: $_G_infix: "
  990. _G_message=$*
  991. # Strip color escape sequences before counting printable length
  992. for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
  993. do
  994. test -n "$_G_tc" && {
  995. _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
  996. _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
  997. }
  998. done
  999. _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
  1000. func_echo_infix_1_IFS=$IFS
  1001. IFS=$nl
  1002. for _G_line in $_G_message; do
  1003. IFS=$func_echo_infix_1_IFS
  1004. $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
  1005. _G_prefix=$_G_indent
  1006. done
  1007. IFS=$func_echo_infix_1_IFS
  1008. }
  1009. # func_error ARG...
  1010. # -----------------
  1011. # Echo program name prefixed message to standard error.
  1012. func_error ()
  1013. {
  1014. $debug_cmd
  1015. $require_term_colors
  1016. func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
  1017. }
  1018. # func_fatal_error ARG...
  1019. # -----------------------
  1020. # Echo program name prefixed message to standard error, and exit.
  1021. func_fatal_error ()
  1022. {
  1023. $debug_cmd
  1024. func_error "$*"
  1025. exit $EXIT_FAILURE
  1026. }
  1027. # func_grep EXPRESSION FILENAME
  1028. # -----------------------------
  1029. # Check whether EXPRESSION matches any line of FILENAME, without output.
  1030. func_grep ()
  1031. {
  1032. $debug_cmd
  1033. $GREP "$1" "$2" >/dev/null 2>&1
  1034. }
  1035. # func_len STRING
  1036. # ---------------
  1037. # Set func_len_result to the length of STRING. STRING may not
  1038. # start with a hyphen.
  1039. test -z "$_G_HAVE_XSI_OPS" \
  1040. && (eval 'x=a/b/c;
  1041. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1042. && _G_HAVE_XSI_OPS=yes
  1043. if test yes = "$_G_HAVE_XSI_OPS"; then
  1044. eval 'func_len ()
  1045. {
  1046. $debug_cmd
  1047. func_len_result=${#1}
  1048. }'
  1049. else
  1050. func_len ()
  1051. {
  1052. $debug_cmd
  1053. func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
  1054. }
  1055. fi
  1056. # func_mkdir_p DIRECTORY-PATH
  1057. # ---------------------------
  1058. # Make sure the entire path to DIRECTORY-PATH is available.
  1059. func_mkdir_p ()
  1060. {
  1061. $debug_cmd
  1062. _G_directory_path=$1
  1063. _G_dir_list=
  1064. if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
  1065. # Protect directory names starting with '-'
  1066. case $_G_directory_path in
  1067. -*) _G_directory_path=./$_G_directory_path ;;
  1068. esac
  1069. # While some portion of DIR does not yet exist...
  1070. while test ! -d "$_G_directory_path"; do
  1071. # ...make a list in topmost first order. Use a colon delimited
  1072. # list incase some portion of path contains whitespace.
  1073. _G_dir_list=$_G_directory_path:$_G_dir_list
  1074. # If the last portion added has no slash in it, the list is done
  1075. case $_G_directory_path in */*) ;; *) break ;; esac
  1076. # ...otherwise throw away the child directory and loop
  1077. _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
  1078. done
  1079. _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
  1080. func_mkdir_p_IFS=$IFS; IFS=:
  1081. for _G_dir in $_G_dir_list; do
  1082. IFS=$func_mkdir_p_IFS
  1083. # mkdir can fail with a 'File exist' error if two processes
  1084. # try to create one of the directories concurrently. Don't
  1085. # stop in that case!
  1086. $MKDIR "$_G_dir" 2>/dev/null || :
  1087. done
  1088. IFS=$func_mkdir_p_IFS
  1089. # Bail out if we (or some other process) failed to create a directory.
  1090. test -d "$_G_directory_path" || \
  1091. func_fatal_error "Failed to create '$1'"
  1092. fi
  1093. }
  1094. # func_mktempdir [BASENAME]
  1095. # -------------------------
  1096. # Make a temporary directory that won't clash with other running
  1097. # libtool processes, and avoids race conditions if possible. If
  1098. # given, BASENAME is the basename for that directory.
  1099. func_mktempdir ()
  1100. {
  1101. $debug_cmd
  1102. _G_template=${TMPDIR-/tmp}/${1-$progname}
  1103. if test : = "$opt_dry_run"; then
  1104. # Return a directory name, but don't create it in dry-run mode
  1105. _G_tmpdir=$_G_template-$$
  1106. else
  1107. # If mktemp works, use that first and foremost
  1108. _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
  1109. if test ! -d "$_G_tmpdir"; then
  1110. # Failing that, at least try and use $RANDOM to avoid a race
  1111. _G_tmpdir=$_G_template-${RANDOM-0}$$
  1112. func_mktempdir_umask=`umask`
  1113. umask 0077
  1114. $MKDIR "$_G_tmpdir"
  1115. umask $func_mktempdir_umask
  1116. fi
  1117. # If we're not in dry-run mode, bomb out on failure
  1118. test -d "$_G_tmpdir" || \
  1119. func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
  1120. fi
  1121. $ECHO "$_G_tmpdir"
  1122. }
  1123. # func_normal_abspath PATH
  1124. # ------------------------
  1125. # Remove doubled-up and trailing slashes, "." path components,
  1126. # and cancel out any ".." path components in PATH after making
  1127. # it an absolute path.
  1128. func_normal_abspath ()
  1129. {
  1130. $debug_cmd
  1131. # These SED scripts presuppose an absolute path with a trailing slash.
  1132. _G_pathcar='s|^/\([^/]*\).*$|\1|'
  1133. _G_pathcdr='s|^/[^/]*||'
  1134. _G_removedotparts=':dotsl
  1135. s|/\./|/|g
  1136. t dotsl
  1137. s|/\.$|/|'
  1138. _G_collapseslashes='s|/\{1,\}|/|g'
  1139. _G_finalslash='s|/*$|/|'
  1140. # Start from root dir and reassemble the path.
  1141. func_normal_abspath_result=
  1142. func_normal_abspath_tpath=$1
  1143. func_normal_abspath_altnamespace=
  1144. case $func_normal_abspath_tpath in
  1145. "")
  1146. # Empty path, that just means $cwd.
  1147. func_stripname '' '/' "`pwd`"
  1148. func_normal_abspath_result=$func_stripname_result
  1149. return
  1150. ;;
  1151. # The next three entries are used to spot a run of precisely
  1152. # two leading slashes without using negated character classes;
  1153. # we take advantage of case's first-match behaviour.
  1154. ///*)
  1155. # Unusual form of absolute path, do nothing.
  1156. ;;
  1157. //*)
  1158. # Not necessarily an ordinary path; POSIX reserves leading '//'
  1159. # and for example Cygwin uses it to access remote file shares
  1160. # over CIFS/SMB, so we conserve a leading double slash if found.
  1161. func_normal_abspath_altnamespace=/
  1162. ;;
  1163. /*)
  1164. # Absolute path, do nothing.
  1165. ;;
  1166. *)
  1167. # Relative path, prepend $cwd.
  1168. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
  1169. ;;
  1170. esac
  1171. # Cancel out all the simple stuff to save iterations. We also want
  1172. # the path to end with a slash for ease of parsing, so make sure
  1173. # there is one (and only one) here.
  1174. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1175. -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
  1176. while :; do
  1177. # Processed it all yet?
  1178. if test / = "$func_normal_abspath_tpath"; then
  1179. # If we ascended to the root using ".." the result may be empty now.
  1180. if test -z "$func_normal_abspath_result"; then
  1181. func_normal_abspath_result=/
  1182. fi
  1183. break
  1184. fi
  1185. func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1186. -e "$_G_pathcar"`
  1187. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
  1188. -e "$_G_pathcdr"`
  1189. # Figure out what to do with it
  1190. case $func_normal_abspath_tcomponent in
  1191. "")
  1192. # Trailing empty path component, ignore it.
  1193. ;;
  1194. ..)
  1195. # Parent dir; strip last assembled component from result.
  1196. func_dirname "$func_normal_abspath_result"
  1197. func_normal_abspath_result=$func_dirname_result
  1198. ;;
  1199. *)
  1200. # Actual path component, append it.
  1201. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
  1202. ;;
  1203. esac
  1204. done
  1205. # Restore leading double-slash if one was found on entry.
  1206. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
  1207. }
  1208. # func_notquiet ARG...
  1209. # --------------------
  1210. # Echo program name prefixed message only when not in quiet mode.
  1211. func_notquiet ()
  1212. {
  1213. $debug_cmd
  1214. $opt_quiet || func_echo ${1+"$@"}
  1215. # A bug in bash halts the script if the last line of a function
  1216. # fails when set -e is in force, so we need another command to
  1217. # work around that:
  1218. :
  1219. }
  1220. # func_relative_path SRCDIR DSTDIR
  1221. # --------------------------------
  1222. # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
  1223. func_relative_path ()
  1224. {
  1225. $debug_cmd
  1226. func_relative_path_result=
  1227. func_normal_abspath "$1"
  1228. func_relative_path_tlibdir=$func_normal_abspath_result
  1229. func_normal_abspath "$2"
  1230. func_relative_path_tbindir=$func_normal_abspath_result
  1231. # Ascend the tree starting from libdir
  1232. while :; do
  1233. # check if we have found a prefix of bindir
  1234. case $func_relative_path_tbindir in
  1235. $func_relative_path_tlibdir)
  1236. # found an exact match
  1237. func_relative_path_tcancelled=
  1238. break
  1239. ;;
  1240. $func_relative_path_tlibdir*)
  1241. # found a matching prefix
  1242. func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
  1243. func_relative_path_tcancelled=$func_stripname_result
  1244. if test -z "$func_relative_path_result"; then
  1245. func_relative_path_result=.
  1246. fi
  1247. break
  1248. ;;
  1249. *)
  1250. func_dirname $func_relative_path_tlibdir
  1251. func_relative_path_tlibdir=$func_dirname_result
  1252. if test -z "$func_relative_path_tlibdir"; then
  1253. # Have to descend all the way to the root!
  1254. func_relative_path_result=../$func_relative_path_result
  1255. func_relative_path_tcancelled=$func_relative_path_tbindir
  1256. break
  1257. fi
  1258. func_relative_path_result=../$func_relative_path_result
  1259. ;;
  1260. esac
  1261. done
  1262. # Now calculate path; take care to avoid doubling-up slashes.
  1263. func_stripname '' '/' "$func_relative_path_result"
  1264. func_relative_path_result=$func_stripname_result
  1265. func_stripname '/' '/' "$func_relative_path_tcancelled"
  1266. if test -n "$func_stripname_result"; then
  1267. func_append func_relative_path_result "/$func_stripname_result"
  1268. fi
  1269. # Normalisation. If bindir is libdir, return '.' else relative path.
  1270. if test -n "$func_relative_path_result"; then
  1271. func_stripname './' '' "$func_relative_path_result"
  1272. func_relative_path_result=$func_stripname_result
  1273. fi
  1274. test -n "$func_relative_path_result" || func_relative_path_result=.
  1275. :
  1276. }
  1277. # func_quote_for_eval ARG...
  1278. # --------------------------
  1279. # Aesthetically quote ARGs to be evaled later.
  1280. # This function returns two values:
  1281. # i) func_quote_for_eval_result
  1282. # double-quoted, suitable for a subsequent eval
  1283. # ii) func_quote_for_eval_unquoted_result
  1284. # has all characters that are still active within double
  1285. # quotes backslashified.
  1286. func_quote_for_eval ()
  1287. {
  1288. $debug_cmd
  1289. func_quote_for_eval_unquoted_result=
  1290. func_quote_for_eval_result=
  1291. while test 0 -lt $#; do
  1292. case $1 in
  1293. *[\\\`\"\$]*)
  1294. _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
  1295. *)
  1296. _G_unquoted_arg=$1 ;;
  1297. esac
  1298. if test -n "$func_quote_for_eval_unquoted_result"; then
  1299. func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
  1300. else
  1301. func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
  1302. fi
  1303. case $_G_unquoted_arg in
  1304. # Double-quote args containing shell metacharacters to delay
  1305. # word splitting, command substitution and variable expansion
  1306. # for a subsequent eval.
  1307. # Many Bourne shells cannot handle close brackets correctly
  1308. # in scan sets, so we specify it separately.
  1309. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1310. _G_quoted_arg=\"$_G_unquoted_arg\"
  1311. ;;
  1312. *)
  1313. _G_quoted_arg=$_G_unquoted_arg
  1314. ;;
  1315. esac
  1316. if test -n "$func_quote_for_eval_result"; then
  1317. func_append func_quote_for_eval_result " $_G_quoted_arg"
  1318. else
  1319. func_append func_quote_for_eval_result "$_G_quoted_arg"
  1320. fi
  1321. shift
  1322. done
  1323. }
  1324. # func_quote_for_expand ARG
  1325. # -------------------------
  1326. # Aesthetically quote ARG to be evaled later; same as above,
  1327. # but do not quote variable references.
  1328. func_quote_for_expand ()
  1329. {
  1330. $debug_cmd
  1331. case $1 in
  1332. *[\\\`\"]*)
  1333. _G_arg=`$ECHO "$1" | $SED \
  1334. -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
  1335. *)
  1336. _G_arg=$1 ;;
  1337. esac
  1338. case $_G_arg in
  1339. # Double-quote args containing shell metacharacters to delay
  1340. # word splitting and command substitution for a subsequent eval.
  1341. # Many Bourne shells cannot handle close brackets correctly
  1342. # in scan sets, so we specify it separately.
  1343. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1344. _G_arg=\"$_G_arg\"
  1345. ;;
  1346. esac
  1347. func_quote_for_expand_result=$_G_arg
  1348. }
  1349. # func_stripname PREFIX SUFFIX NAME
  1350. # ---------------------------------
  1351. # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
  1352. # PREFIX and SUFFIX must not contain globbing or regex special
  1353. # characters, hashes, percent signs, but SUFFIX may contain a leading
  1354. # dot (in which case that matches only a dot).
  1355. if test yes = "$_G_HAVE_XSI_OPS"; then
  1356. eval 'func_stripname ()
  1357. {
  1358. $debug_cmd
  1359. # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
  1360. # positional parameters, so assign one to ordinary variable first.
  1361. func_stripname_result=$3
  1362. func_stripname_result=${func_stripname_result#"$1"}
  1363. func_stripname_result=${func_stripname_result%"$2"}
  1364. }'
  1365. else
  1366. func_stripname ()
  1367. {
  1368. $debug_cmd
  1369. case $2 in
  1370. .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
  1371. *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
  1372. esac
  1373. }
  1374. fi
  1375. # func_show_eval CMD [FAIL_EXP]
  1376. # -----------------------------
  1377. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1378. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1379. # is given, then evaluate it.
  1380. func_show_eval ()
  1381. {
  1382. $debug_cmd
  1383. _G_cmd=$1
  1384. _G_fail_exp=${2-':'}
  1385. func_quote_for_expand "$_G_cmd"
  1386. eval "func_notquiet $func_quote_for_expand_result"
  1387. $opt_dry_run || {
  1388. eval "$_G_cmd"
  1389. _G_status=$?
  1390. if test 0 -ne "$_G_status"; then
  1391. eval "(exit $_G_status); $_G_fail_exp"
  1392. fi
  1393. }
  1394. }
  1395. # func_show_eval_locale CMD [FAIL_EXP]
  1396. # ------------------------------------
  1397. # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
  1398. # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  1399. # is given, then evaluate it. Use the saved locale for evaluation.
  1400. func_show_eval_locale ()
  1401. {
  1402. $debug_cmd
  1403. _G_cmd=$1
  1404. _G_fail_exp=${2-':'}
  1405. $opt_quiet || {
  1406. func_quote_for_expand "$_G_cmd"
  1407. eval "func_echo $func_quote_for_expand_result"
  1408. }
  1409. $opt_dry_run || {
  1410. eval "$_G_user_locale
  1411. $_G_cmd"
  1412. _G_status=$?
  1413. eval "$_G_safe_locale"
  1414. if test 0 -ne "$_G_status"; then
  1415. eval "(exit $_G_status); $_G_fail_exp"
  1416. fi
  1417. }
  1418. }
  1419. # func_tr_sh
  1420. # ----------
  1421. # Turn $1 into a string suitable for a shell variable name.
  1422. # Result is stored in $func_tr_sh_result. All characters
  1423. # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
  1424. # if $1 begins with a digit, a '_' is prepended as well.
  1425. func_tr_sh ()
  1426. {
  1427. $debug_cmd
  1428. case $1 in
  1429. [0-9]* | *[!a-zA-Z0-9_]*)
  1430. func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
  1431. ;;
  1432. * )
  1433. func_tr_sh_result=$1
  1434. ;;
  1435. esac
  1436. }
  1437. # func_verbose ARG...
  1438. # -------------------
  1439. # Echo program name prefixed message in verbose mode only.
  1440. func_verbose ()
  1441. {
  1442. $debug_cmd
  1443. $opt_verbose && func_echo "$*"
  1444. :
  1445. }
  1446. # func_warn_and_continue ARG...
  1447. # -----------------------------
  1448. # Echo program name prefixed warning message to standard error.
  1449. func_warn_and_continue ()
  1450. {
  1451. $debug_cmd
  1452. $require_term_colors
  1453. func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
  1454. }
  1455. # func_warning CATEGORY ARG...
  1456. # ----------------------------
  1457. # Echo program name prefixed warning message to standard error. Warning
  1458. # messages can be filtered according to CATEGORY, where this function
  1459. # elides messages where CATEGORY is not listed in the global variable
  1460. # 'opt_warning_types'.
  1461. func_warning ()
  1462. {
  1463. $debug_cmd
  1464. # CATEGORY must be in the warning_categories list!
  1465. case " $warning_categories " in
  1466. *" $1 "*) ;;
  1467. *) func_internal_error "invalid warning category '$1'" ;;
  1468. esac
  1469. _G_category=$1
  1470. shift
  1471. case " $opt_warning_types " in
  1472. *" $_G_category "*) $warning_func ${1+"$@"} ;;
  1473. esac
  1474. }
  1475. # func_sort_ver VER1 VER2
  1476. # -----------------------
  1477. # 'sort -V' is not generally available.
  1478. # Note this deviates from the version comparison in automake
  1479. # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
  1480. # but this should suffice as we won't be specifying old
  1481. # version formats or redundant trailing .0 in bootstrap.conf.
  1482. # If we did want full compatibility then we should probably
  1483. # use m4_version_compare from autoconf.
  1484. func_sort_ver ()
  1485. {
  1486. $debug_cmd
  1487. printf '%s\n%s\n' "$1" "$2" \
  1488. | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
  1489. }
  1490. # func_lt_ver PREV CURR
  1491. # ---------------------
  1492. # Return true if PREV and CURR are in the correct order according to
  1493. # func_sort_ver, otherwise false. Use it like this:
  1494. #
  1495. # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
  1496. func_lt_ver ()
  1497. {
  1498. $debug_cmd
  1499. test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
  1500. }
  1501. # Local variables:
  1502. # mode: shell-script
  1503. # sh-indentation: 2
  1504. # eval: (add-hook 'before-save-hook 'time-stamp)
  1505. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  1506. # time-stamp-time-zone: "UTC"
  1507. # End:
  1508. #! /bin/sh
  1509. # Set a version string for this script.
  1510. scriptversion=2014-01-07.03; # UTC
  1511. # A portable, pluggable option parser for Bourne shell.
  1512. # Written by Gary V. Vaughan, 2010
  1513. # Copyright (C) 2010-2015 Free Software Foundation, Inc.
  1514. # This is free software; see the source for copying conditions. There is NO
  1515. # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1516. # This program is free software: you can redistribute it and/or modify
  1517. # it under the terms of the GNU General Public License as published by
  1518. # the Free Software Foundation, either version 3 of the License, or
  1519. # (at your option) any later version.
  1520. # This program is distributed in the hope that it will be useful,
  1521. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  1522. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1523. # GNU General Public License for more details.
  1524. # You should have received a copy of the GNU General Public License
  1525. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  1526. # Please report bugs or propose patches to gary@gnu.org.
  1527. ## ------ ##
  1528. ## Usage. ##
  1529. ## ------ ##
  1530. # This file is a library for parsing options in your shell scripts along
  1531. # with assorted other useful supporting features that you can make use
  1532. # of too.
  1533. #
  1534. # For the simplest scripts you might need only:
  1535. #
  1536. # #!/bin/sh
  1537. # . relative/path/to/funclib.sh
  1538. # . relative/path/to/options-parser
  1539. # scriptversion=1.0
  1540. # func_options ${1+"$@"}
  1541. # eval set dummy "$func_options_result"; shift
  1542. # ...rest of your script...
  1543. #
  1544. # In order for the '--version' option to work, you will need to have a
  1545. # suitably formatted comment like the one at the top of this file
  1546. # starting with '# Written by ' and ending with '# warranty; '.
  1547. #
  1548. # For '-h' and '--help' to work, you will also need a one line
  1549. # description of your script's purpose in a comment directly above the
  1550. # '# Written by ' line, like the one at the top of this file.
  1551. #
  1552. # The default options also support '--debug', which will turn on shell
  1553. # execution tracing (see the comment above debug_cmd below for another
  1554. # use), and '--verbose' and the func_verbose function to allow your script
  1555. # to display verbose messages only when your user has specified
  1556. # '--verbose'.
  1557. #
  1558. # After sourcing this file, you can plug processing for additional
  1559. # options by amending the variables from the 'Configuration' section
  1560. # below, and following the instructions in the 'Option parsing'
  1561. # section further down.
  1562. ## -------------- ##
  1563. ## Configuration. ##
  1564. ## -------------- ##
  1565. # You should override these variables in your script after sourcing this
  1566. # file so that they reflect the customisations you have added to the
  1567. # option parser.
  1568. # The usage line for option parsing errors and the start of '-h' and
  1569. # '--help' output messages. You can embed shell variables for delayed
  1570. # expansion at the time the message is displayed, but you will need to
  1571. # quote other shell meta-characters carefully to prevent them being
  1572. # expanded when the contents are evaled.
  1573. usage='$progpath [OPTION]...'
  1574. # Short help message in response to '-h' and '--help'. Add to this or
  1575. # override it after sourcing this library to reflect the full set of
  1576. # options your script accepts.
  1577. usage_message="\
  1578. --debug enable verbose shell tracing
  1579. -W, --warnings=CATEGORY
  1580. report the warnings falling in CATEGORY [all]
  1581. -v, --verbose verbosely report processing
  1582. --version print version information and exit
  1583. -h, --help print short or long help message and exit
  1584. "
  1585. # Additional text appended to 'usage_message' in response to '--help'.
  1586. long_help_message="
  1587. Warning categories include:
  1588. 'all' show all warnings
  1589. 'none' turn off all the warnings
  1590. 'error' warnings are treated as fatal errors"
  1591. # Help message printed before fatal option parsing errors.
  1592. fatal_help="Try '\$progname --help' for more information."
  1593. ## ------------------------- ##
  1594. ## Hook function management. ##
  1595. ## ------------------------- ##
  1596. # This section contains functions for adding, removing, and running hooks
  1597. # to the main code. A hook is just a named list of of function, that can
  1598. # be run in order later on.
  1599. # func_hookable FUNC_NAME
  1600. # -----------------------
  1601. # Declare that FUNC_NAME will run hooks added with
  1602. # 'func_add_hook FUNC_NAME ...'.
  1603. func_hookable ()
  1604. {
  1605. $debug_cmd
  1606. func_append hookable_fns " $1"
  1607. }
  1608. # func_add_hook FUNC_NAME HOOK_FUNC
  1609. # ---------------------------------
  1610. # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
  1611. # first have been declared "hookable" by a call to 'func_hookable'.
  1612. func_add_hook ()
  1613. {
  1614. $debug_cmd
  1615. case " $hookable_fns " in
  1616. *" $1 "*) ;;
  1617. *) func_fatal_error "'$1' does not accept hook functions." ;;
  1618. esac
  1619. eval func_append ${1}_hooks '" $2"'
  1620. }
  1621. # func_remove_hook FUNC_NAME HOOK_FUNC
  1622. # ------------------------------------
  1623. # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
  1624. func_remove_hook ()
  1625. {
  1626. $debug_cmd
  1627. eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
  1628. }
  1629. # func_run_hooks FUNC_NAME [ARG]...
  1630. # ---------------------------------
  1631. # Run all hook functions registered to FUNC_NAME.
  1632. # It is assumed that the list of hook functions contains nothing more
  1633. # than a whitespace-delimited list of legal shell function names, and
  1634. # no effort is wasted trying to catch shell meta-characters or preserve
  1635. # whitespace.
  1636. func_run_hooks ()
  1637. {
  1638. $debug_cmd
  1639. case " $hookable_fns " in
  1640. *" $1 "*) ;;
  1641. *) func_fatal_error "'$1' does not support hook funcions.n" ;;
  1642. esac
  1643. eval _G_hook_fns=\$$1_hooks; shift
  1644. for _G_hook in $_G_hook_fns; do
  1645. eval $_G_hook '"$@"'
  1646. # store returned options list back into positional
  1647. # parameters for next 'cmd' execution.
  1648. eval _G_hook_result=\$${_G_hook}_result
  1649. eval set dummy "$_G_hook_result"; shift
  1650. done
  1651. func_quote_for_eval ${1+"$@"}
  1652. func_run_hooks_result=$func_quote_for_eval_result
  1653. }
  1654. ## --------------- ##
  1655. ## Option parsing. ##
  1656. ## --------------- ##
  1657. # In order to add your own option parsing hooks, you must accept the
  1658. # full positional parameter list in your hook function, remove any
  1659. # options that you action, and then pass back the remaining unprocessed
  1660. # options in '<hooked_function_name>_result', escaped suitably for
  1661. # 'eval'. Like this:
  1662. #
  1663. # my_options_prep ()
  1664. # {
  1665. # $debug_cmd
  1666. #
  1667. # # Extend the existing usage message.
  1668. # usage_message=$usage_message'
  1669. # -s, --silent don'\''t print informational messages
  1670. # '
  1671. #
  1672. # func_quote_for_eval ${1+"$@"}
  1673. # my_options_prep_result=$func_quote_for_eval_result
  1674. # }
  1675. # func_add_hook func_options_prep my_options_prep
  1676. #
  1677. #
  1678. # my_silent_option ()
  1679. # {
  1680. # $debug_cmd
  1681. #
  1682. # # Note that for efficiency, we parse as many options as we can
  1683. # # recognise in a loop before passing the remainder back to the
  1684. # # caller on the first unrecognised argument we encounter.
  1685. # while test $# -gt 0; do
  1686. # opt=$1; shift
  1687. # case $opt in
  1688. # --silent|-s) opt_silent=: ;;
  1689. # # Separate non-argument short options:
  1690. # -s*) func_split_short_opt "$_G_opt"
  1691. # set dummy "$func_split_short_opt_name" \
  1692. # "-$func_split_short_opt_arg" ${1+"$@"}
  1693. # shift
  1694. # ;;
  1695. # *) set dummy "$_G_opt" "$*"; shift; break ;;
  1696. # esac
  1697. # done
  1698. #
  1699. # func_quote_for_eval ${1+"$@"}
  1700. # my_silent_option_result=$func_quote_for_eval_result
  1701. # }
  1702. # func_add_hook func_parse_options my_silent_option
  1703. #
  1704. #
  1705. # my_option_validation ()
  1706. # {
  1707. # $debug_cmd
  1708. #
  1709. # $opt_silent && $opt_verbose && func_fatal_help "\
  1710. # '--silent' and '--verbose' options are mutually exclusive."
  1711. #
  1712. # func_quote_for_eval ${1+"$@"}
  1713. # my_option_validation_result=$func_quote_for_eval_result
  1714. # }
  1715. # func_add_hook func_validate_options my_option_validation
  1716. #
  1717. # You'll alse need to manually amend $usage_message to reflect the extra
  1718. # options you parse. It's preferable to append if you can, so that
  1719. # multiple option parsing hooks can be added safely.
  1720. # func_options [ARG]...
  1721. # ---------------------
  1722. # All the functions called inside func_options are hookable. See the
  1723. # individual implementations for details.
  1724. func_hookable func_options
  1725. func_options ()
  1726. {
  1727. $debug_cmd
  1728. func_options_prep ${1+"$@"}
  1729. eval func_parse_options \
  1730. ${func_options_prep_result+"$func_options_prep_result"}
  1731. eval func_validate_options \
  1732. ${func_parse_options_result+"$func_parse_options_result"}
  1733. eval func_run_hooks func_options \
  1734. ${func_validate_options_result+"$func_validate_options_result"}
  1735. # save modified positional parameters for caller
  1736. func_options_result=$func_run_hooks_result
  1737. }
  1738. # func_options_prep [ARG]...
  1739. # --------------------------
  1740. # All initialisations required before starting the option parse loop.
  1741. # Note that when calling hook functions, we pass through the list of
  1742. # positional parameters. If a hook function modifies that list, and
  1743. # needs to propogate that back to rest of this script, then the complete
  1744. # modified list must be put in 'func_run_hooks_result' before
  1745. # returning.
  1746. func_hookable func_options_prep
  1747. func_options_prep ()
  1748. {
  1749. $debug_cmd
  1750. # Option defaults:
  1751. opt_verbose=false
  1752. opt_warning_types=
  1753. func_run_hooks func_options_prep ${1+"$@"}
  1754. # save modified positional parameters for caller
  1755. func_options_prep_result=$func_run_hooks_result
  1756. }
  1757. # func_parse_options [ARG]...
  1758. # ---------------------------
  1759. # The main option parsing loop.
  1760. func_hookable func_parse_options
  1761. func_parse_options ()
  1762. {
  1763. $debug_cmd
  1764. func_parse_options_result=
  1765. # this just eases exit handling
  1766. while test $# -gt 0; do
  1767. # Defer to hook functions for initial option parsing, so they
  1768. # get priority in the event of reusing an option name.
  1769. func_run_hooks func_parse_options ${1+"$@"}
  1770. # Adjust func_parse_options positional parameters to match
  1771. eval set dummy "$func_run_hooks_result"; shift
  1772. # Break out of the loop if we already parsed every option.
  1773. test $# -gt 0 || break
  1774. _G_opt=$1
  1775. shift
  1776. case $_G_opt in
  1777. --debug|-x) debug_cmd='set -x'
  1778. func_echo "enabling shell trace mode"
  1779. $debug_cmd
  1780. ;;
  1781. --no-warnings|--no-warning|--no-warn)
  1782. set dummy --warnings none ${1+"$@"}
  1783. shift
  1784. ;;
  1785. --warnings|--warning|-W)
  1786. test $# = 0 && func_missing_arg $_G_opt && break
  1787. case " $warning_categories $1" in
  1788. *" $1 "*)
  1789. # trailing space prevents matching last $1 above
  1790. func_append_uniq opt_warning_types " $1"
  1791. ;;
  1792. *all)
  1793. opt_warning_types=$warning_categories
  1794. ;;
  1795. *none)
  1796. opt_warning_types=none
  1797. warning_func=:
  1798. ;;
  1799. *error)
  1800. opt_warning_types=$warning_categories
  1801. warning_func=func_fatal_error
  1802. ;;
  1803. *)
  1804. func_fatal_error \
  1805. "unsupported warning category: '$1'"
  1806. ;;
  1807. esac
  1808. shift
  1809. ;;
  1810. --verbose|-v) opt_verbose=: ;;
  1811. --version) func_version ;;
  1812. -\?|-h) func_usage ;;
  1813. --help) func_help ;;
  1814. # Separate optargs to long options (plugins may need this):
  1815. --*=*) func_split_equals "$_G_opt"
  1816. set dummy "$func_split_equals_lhs" \
  1817. "$func_split_equals_rhs" ${1+"$@"}
  1818. shift
  1819. ;;
  1820. # Separate optargs to short options:
  1821. -W*)
  1822. func_split_short_opt "$_G_opt"
  1823. set dummy "$func_split_short_opt_name" \
  1824. "$func_split_short_opt_arg" ${1+"$@"}
  1825. shift
  1826. ;;
  1827. # Separate non-argument short options:
  1828. -\?*|-h*|-v*|-x*)
  1829. func_split_short_opt "$_G_opt"
  1830. set dummy "$func_split_short_opt_name" \
  1831. "-$func_split_short_opt_arg" ${1+"$@"}
  1832. shift
  1833. ;;
  1834. --) break ;;
  1835. -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
  1836. *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  1837. esac
  1838. done
  1839. # save modified positional parameters for caller
  1840. func_quote_for_eval ${1+"$@"}
  1841. func_parse_options_result=$func_quote_for_eval_result
  1842. }
  1843. # func_validate_options [ARG]...
  1844. # ------------------------------
  1845. # Perform any sanity checks on option settings and/or unconsumed
  1846. # arguments.
  1847. func_hookable func_validate_options
  1848. func_validate_options ()
  1849. {
  1850. $debug_cmd
  1851. # Display all warnings if -W was not given.
  1852. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  1853. func_run_hooks func_validate_options ${1+"$@"}
  1854. # Bail if the options were screwed!
  1855. $exit_cmd $EXIT_FAILURE
  1856. # save modified positional parameters for caller
  1857. func_validate_options_result=$func_run_hooks_result
  1858. }
  1859. ## ----------------- ##
  1860. ## Helper functions. ##
  1861. ## ----------------- ##
  1862. # This section contains the helper functions used by the rest of the
  1863. # hookable option parser framework in ascii-betical order.
  1864. # func_fatal_help ARG...
  1865. # ----------------------
  1866. # Echo program name prefixed message to standard error, followed by
  1867. # a help hint, and exit.
  1868. func_fatal_help ()
  1869. {
  1870. $debug_cmd
  1871. eval \$ECHO \""Usage: $usage"\"
  1872. eval \$ECHO \""$fatal_help"\"
  1873. func_error ${1+"$@"}
  1874. exit $EXIT_FAILURE
  1875. }
  1876. # func_help
  1877. # ---------
  1878. # Echo long help message to standard output and exit.
  1879. func_help ()
  1880. {
  1881. $debug_cmd
  1882. func_usage_message
  1883. $ECHO "$long_help_message"
  1884. exit 0
  1885. }
  1886. # func_missing_arg ARGNAME
  1887. # ------------------------
  1888. # Echo program name prefixed message to standard error and set global
  1889. # exit_cmd.
  1890. func_missing_arg ()
  1891. {
  1892. $debug_cmd
  1893. func_error "Missing argument for '$1'."
  1894. exit_cmd=exit
  1895. }
  1896. # func_split_equals STRING
  1897. # ------------------------
  1898. # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
  1899. # splitting STRING at the '=' sign.
  1900. test -z "$_G_HAVE_XSI_OPS" \
  1901. && (eval 'x=a/b/c;
  1902. test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
  1903. && _G_HAVE_XSI_OPS=yes
  1904. if test yes = "$_G_HAVE_XSI_OPS"
  1905. then
  1906. # This is an XSI compatible shell, allowing a faster implementation...
  1907. eval 'func_split_equals ()
  1908. {
  1909. $debug_cmd
  1910. func_split_equals_lhs=${1%%=*}
  1911. func_split_equals_rhs=${1#*=}
  1912. test "x$func_split_equals_lhs" = "x$1" \
  1913. && func_split_equals_rhs=
  1914. }'
  1915. else
  1916. # ...otherwise fall back to using expr, which is often a shell builtin.
  1917. func_split_equals ()
  1918. {
  1919. $debug_cmd
  1920. func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
  1921. func_split_equals_rhs=
  1922. test "x$func_split_equals_lhs" = "x$1" \
  1923. || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
  1924. }
  1925. fi #func_split_equals
  1926. # func_split_short_opt SHORTOPT
  1927. # -----------------------------
  1928. # Set func_split_short_opt_name and func_split_short_opt_arg shell
  1929. # variables after splitting SHORTOPT after the 2nd character.
  1930. if test yes = "$_G_HAVE_XSI_OPS"
  1931. then
  1932. # This is an XSI compatible shell, allowing a faster implementation...
  1933. eval 'func_split_short_opt ()
  1934. {
  1935. $debug_cmd
  1936. func_split_short_opt_arg=${1#??}
  1937. func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
  1938. }'
  1939. else
  1940. # ...otherwise fall back to using expr, which is often a shell builtin.
  1941. func_split_short_opt ()
  1942. {
  1943. $debug_cmd
  1944. func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
  1945. func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
  1946. }
  1947. fi #func_split_short_opt
  1948. # func_usage
  1949. # ----------
  1950. # Echo short help message to standard output and exit.
  1951. func_usage ()
  1952. {
  1953. $debug_cmd
  1954. func_usage_message
  1955. $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
  1956. exit 0
  1957. }
  1958. # func_usage_message
  1959. # ------------------
  1960. # Echo short help message to standard output.
  1961. func_usage_message ()
  1962. {
  1963. $debug_cmd
  1964. eval \$ECHO \""Usage: $usage"\"
  1965. echo
  1966. $SED -n 's|^# ||
  1967. /^Written by/{
  1968. x;p;x
  1969. }
  1970. h
  1971. /^Written by/q' < "$progpath"
  1972. echo
  1973. eval \$ECHO \""$usage_message"\"
  1974. }
  1975. # func_version
  1976. # ------------
  1977. # Echo version message to standard output and exit.
  1978. func_version ()
  1979. {
  1980. $debug_cmd
  1981. printf '%s\n' "$progname $scriptversion"
  1982. $SED -n '
  1983. /(C)/!b go
  1984. :more
  1985. /\./!{
  1986. N
  1987. s|\n# | |
  1988. b more
  1989. }
  1990. :go
  1991. /^# Written by /,/# warranty; / {
  1992. s|^# ||
  1993. s|^# *$||
  1994. s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
  1995. p
  1996. }
  1997. /^# Written by / {
  1998. s|^# ||
  1999. p
  2000. }
  2001. /^warranty; /q' < "$progpath"
  2002. exit $?
  2003. }
  2004. # Local variables:
  2005. # mode: shell-script
  2006. # sh-indentation: 2
  2007. # eval: (add-hook 'before-save-hook 'time-stamp)
  2008. # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
  2009. # time-stamp-time-zone: "UTC"
  2010. # End:
  2011. # Set a version string.
  2012. scriptversion='(GNU libtool) 2.4.6'
  2013. # func_echo ARG...
  2014. # ----------------
  2015. # Libtool also displays the current mode in messages, so override
  2016. # funclib.sh func_echo with this custom definition.
  2017. func_echo ()
  2018. {
  2019. $debug_cmd
  2020. _G_message=$*
  2021. func_echo_IFS=$IFS
  2022. IFS=$nl
  2023. for _G_line in $_G_message; do
  2024. IFS=$func_echo_IFS
  2025. $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
  2026. done
  2027. IFS=$func_echo_IFS
  2028. }
  2029. # func_warning ARG...
  2030. # -------------------
  2031. # Libtool warnings are not categorized, so override funclib.sh
  2032. # func_warning with this simpler definition.
  2033. func_warning ()
  2034. {
  2035. $debug_cmd
  2036. $warning_func ${1+"$@"}
  2037. }
  2038. ## ---------------- ##
  2039. ## Options parsing. ##
  2040. ## ---------------- ##
  2041. # Hook in the functions to make sure our own options are parsed during
  2042. # the option parsing loop.
  2043. usage='$progpath [OPTION]... [MODE-ARG]...'
  2044. # Short help message in response to '-h'.
  2045. usage_message="Options:
  2046. --config show all configuration variables
  2047. --debug enable verbose shell tracing
  2048. -n, --dry-run display commands without modifying any files
  2049. --features display basic configuration information and exit
  2050. --mode=MODE use operation mode MODE
  2051. --no-warnings equivalent to '-Wnone'
  2052. --preserve-dup-deps don't remove duplicate dependency libraries
  2053. --quiet, --silent don't print informational messages
  2054. --tag=TAG use configuration variables from tag TAG
  2055. -v, --verbose print more informational messages than default
  2056. --version print version information
  2057. -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
  2058. -h, --help, --help-all print short, long, or detailed help message
  2059. "
  2060. # Additional text appended to 'usage_message' in response to '--help'.
  2061. func_help ()
  2062. {
  2063. $debug_cmd
  2064. func_usage_message
  2065. $ECHO "$long_help_message
  2066. MODE must be one of the following:
  2067. clean remove files from the build directory
  2068. compile compile a source file into a libtool object
  2069. execute automatically set library path, then run a program
  2070. finish complete the installation of libtool libraries
  2071. install install libraries or executables
  2072. link create a library or an executable
  2073. uninstall remove libraries from an installed directory
  2074. MODE-ARGS vary depending on the MODE. When passed as first option,
  2075. '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
  2076. Try '$progname --help --mode=MODE' for a more detailed description of MODE.
  2077. When reporting a bug, please describe a test case to reproduce it and
  2078. include the following information:
  2079. host-triplet: $host
  2080. shell: $SHELL
  2081. compiler: $LTCC
  2082. compiler flags: $LTCFLAGS
  2083. linker: $LD (gnu? $with_gnu_ld)
  2084. version: $progname (GNU libtool) 2.4.6
  2085. automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
  2086. autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
  2087. Report bugs to <bug-libtool@gnu.org>.
  2088. GNU libtool home page: <http://www.gnu.org/software/libtool/>.
  2089. General help using GNU software: <http://www.gnu.org/gethelp/>."
  2090. exit 0
  2091. }
  2092. # func_lo2o OBJECT-NAME
  2093. # ---------------------
  2094. # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
  2095. # object suffix.
  2096. lo2o=s/\\.lo\$/.$objext/
  2097. o2lo=s/\\.$objext\$/.lo/
  2098. if test yes = "$_G_HAVE_XSI_OPS"; then
  2099. eval 'func_lo2o ()
  2100. {
  2101. case $1 in
  2102. *.lo) func_lo2o_result=${1%.lo}.$objext ;;
  2103. * ) func_lo2o_result=$1 ;;
  2104. esac
  2105. }'
  2106. # func_xform LIBOBJ-OR-SOURCE
  2107. # ---------------------------
  2108. # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
  2109. # suffix to a '.lo' libtool-object suffix.
  2110. eval 'func_xform ()
  2111. {
  2112. func_xform_result=${1%.*}.lo
  2113. }'
  2114. else
  2115. # ...otherwise fall back to using sed.
  2116. func_lo2o ()
  2117. {
  2118. func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
  2119. }
  2120. func_xform ()
  2121. {
  2122. func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
  2123. }
  2124. fi
  2125. # func_fatal_configuration ARG...
  2126. # -------------------------------
  2127. # Echo program name prefixed message to standard error, followed by
  2128. # a configuration failure hint, and exit.
  2129. func_fatal_configuration ()
  2130. {
  2131. func__fatal_error ${1+"$@"} \
  2132. "See the $PACKAGE documentation for more information." \
  2133. "Fatal configuration error."
  2134. }
  2135. # func_config
  2136. # -----------
  2137. # Display the configuration for all the tags in this script.
  2138. func_config ()
  2139. {
  2140. re_begincf='^# ### BEGIN LIBTOOL'
  2141. re_endcf='^# ### END LIBTOOL'
  2142. # Default configuration.
  2143. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  2144. # Now print the configurations for the tags.
  2145. for tagname in $taglist; do
  2146. $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  2147. done
  2148. exit $?
  2149. }
  2150. # func_features
  2151. # -------------
  2152. # Display the features supported by this script.
  2153. func_features ()
  2154. {
  2155. echo "host: $host"
  2156. if test yes = "$build_libtool_libs"; then
  2157. echo "enable shared libraries"
  2158. else
  2159. echo "disable shared libraries"
  2160. fi
  2161. if test yes = "$build_old_libs"; then
  2162. echo "enable static libraries"
  2163. else
  2164. echo "disable static libraries"
  2165. fi
  2166. exit $?
  2167. }
  2168. # func_enable_tag TAGNAME
  2169. # -----------------------
  2170. # Verify that TAGNAME is valid, and either flag an error and exit, or
  2171. # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  2172. # variable here.
  2173. func_enable_tag ()
  2174. {
  2175. # Global variable:
  2176. tagname=$1
  2177. re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  2178. re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  2179. sed_extractcf=/$re_begincf/,/$re_endcf/p
  2180. # Validate tagname.
  2181. case $tagname in
  2182. *[!-_A-Za-z0-9,/]*)
  2183. func_fatal_error "invalid tag name: $tagname"
  2184. ;;
  2185. esac
  2186. # Don't test for the "default" C tag, as we know it's
  2187. # there but not specially marked.
  2188. case $tagname in
  2189. CC) ;;
  2190. *)
  2191. if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  2192. taglist="$taglist $tagname"
  2193. # Evaluate the configuration. Be careful to quote the path
  2194. # and the sed script, to avoid splitting on whitespace, but
  2195. # also don't use non-portable quotes within backquotes within
  2196. # quotes we have to do it in 2 steps:
  2197. extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  2198. eval "$extractedcf"
  2199. else
  2200. func_error "ignoring unknown tag $tagname"
  2201. fi
  2202. ;;
  2203. esac
  2204. }
  2205. # func_check_version_match
  2206. # ------------------------
  2207. # Ensure that we are using m4 macros, and libtool script from the same
  2208. # release of libtool.
  2209. func_check_version_match ()
  2210. {
  2211. if test "$package_revision" != "$macro_revision"; then
  2212. if test "$VERSION" != "$macro_version"; then
  2213. if test -z "$macro_version"; then
  2214. cat >&2 <<_LT_EOF
  2215. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2216. $progname: definition of this LT_INIT comes from an older release.
  2217. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2218. $progname: and run autoconf again.
  2219. _LT_EOF
  2220. else
  2221. cat >&2 <<_LT_EOF
  2222. $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  2223. $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  2224. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  2225. $progname: and run autoconf again.
  2226. _LT_EOF
  2227. fi
  2228. else
  2229. cat >&2 <<_LT_EOF
  2230. $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  2231. $progname: but the definition of this LT_INIT comes from revision $macro_revision.
  2232. $progname: You should recreate aclocal.m4 with macros from revision $package_revision
  2233. $progname: of $PACKAGE $VERSION and run autoconf again.
  2234. _LT_EOF
  2235. fi
  2236. exit $EXIT_MISMATCH
  2237. fi
  2238. }
  2239. # libtool_options_prep [ARG]...
  2240. # -----------------------------
  2241. # Preparation for options parsed by libtool.
  2242. #libtool_options_prep ()
  2243. #{
  2244. $debug_mode
  2245. # Option defaults:
  2246. opt_verbose=false
  2247. opt_warning_types=
  2248. # Option defaults:
  2249. opt_config=false
  2250. opt_dlopen=
  2251. opt_dry_run=false
  2252. opt_help=false
  2253. opt_mode=
  2254. opt_preserve_dup_deps=false
  2255. opt_quiet=false
  2256. nonopt=
  2257. preserve_args=
  2258. # Shorthand for --mode=foo, only valid as the first argument
  2259. case $1 in
  2260. clean|clea|cle|cl)
  2261. shift; set dummy --mode clean ${1+"$@"}; shift
  2262. ;;
  2263. compile|compil|compi|comp|com|co|c)
  2264. shift; set dummy --mode compile ${1+"$@"}; shift
  2265. ;;
  2266. execute|execut|execu|exec|exe|ex|e)
  2267. shift; set dummy --mode execute ${1+"$@"}; shift
  2268. ;;
  2269. finish|finis|fini|fin|fi|f)
  2270. shift; set dummy --mode finish ${1+"$@"}; shift
  2271. ;;
  2272. install|instal|insta|inst|ins|in|i)
  2273. shift; set dummy --mode install ${1+"$@"}; shift
  2274. ;;
  2275. link|lin|li|l)
  2276. shift; set dummy --mode link ${1+"$@"}; shift
  2277. ;;
  2278. uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  2279. shift; set dummy --mode uninstall ${1+"$@"}; shift
  2280. ;;
  2281. esac
  2282. #}
  2283. # libtool_parse_options [ARG]...
  2284. # ---------------------------------
  2285. # Provide handling for libtool specific options.
  2286. #libtool_parse_options ()
  2287. #{
  2288. $debug_cmd
  2289. # Perform our own loop to consume as many options as possible in
  2290. # each iteration.
  2291. while test $# -gt 0; do
  2292. _G_opt=$1
  2293. shift
  2294. case $_G_opt in
  2295. --dry-run|--dryrun|-n)
  2296. opt_dry_run=:
  2297. ;;
  2298. --config) func_config ;;
  2299. --dlopen|-dlopen)
  2300. opt_dlopen="${opt_dlopen+$opt_dlopen
  2301. }$1"
  2302. shift
  2303. ;;
  2304. --preserve-dup-deps)
  2305. opt_preserve_dup_deps=: ;;
  2306. --features) func_features ;;
  2307. --finish) set dummy --mode finish ${1+"$@"}; shift ;;
  2308. --help) opt_help=: ;;
  2309. --help-all) opt_help=': help-all' ;;
  2310. --mode) test $# = 0 && func_missing_arg $_G_opt && break
  2311. opt_mode=$1
  2312. case $1 in
  2313. # Valid mode arguments:
  2314. clean|compile|execute|finish|install|link|relink|uninstall) ;;
  2315. # Catch anything else as an error
  2316. *) func_error "invalid argument for $_G_opt"
  2317. exit_cmd=exit
  2318. break
  2319. ;;
  2320. esac
  2321. shift
  2322. ;;
  2323. --no-silent|--no-quiet)
  2324. opt_quiet=false
  2325. func_append preserve_args " $_G_opt"
  2326. ;;
  2327. --no-warnings|--no-warning|--no-warn)
  2328. opt_warning=false
  2329. func_append preserve_args " $_G_opt"
  2330. ;;
  2331. --no-verbose)
  2332. opt_verbose=false
  2333. func_append preserve_args " $_G_opt"
  2334. ;;
  2335. --silent|--quiet)
  2336. opt_quiet=:
  2337. opt_verbose=false
  2338. func_append preserve_args " $_G_opt"
  2339. ;;
  2340. --tag) test $# = 0 && func_missing_arg $_G_opt && break
  2341. opt_tag=$1
  2342. func_append preserve_args " $_G_opt $1"
  2343. func_enable_tag "$1"
  2344. shift
  2345. ;;
  2346. --verbose|-v) opt_quiet=false
  2347. opt_verbose=:
  2348. func_append preserve_args " $_G_opt"
  2349. ;;
  2350. --debug|-x) debug_cmd='set -x'
  2351. func_echo "enabling shell trace mode"
  2352. $debug_cmd
  2353. ;;
  2354. --no-warnings|--no-warning|--no-warn)
  2355. set dummy --warnings none ${1+"$@"}
  2356. shift
  2357. ;;
  2358. --warnings|--warning|-W)
  2359. test $# = 0 && func_missing_arg $_G_opt && break
  2360. case " $warning_categories $1" in
  2361. *" $1 "*)
  2362. # trailing space prevents matching last $1 above
  2363. func_append_uniq opt_warning_types " $1"
  2364. ;;
  2365. *all)
  2366. opt_warning_types=$warning_categories
  2367. ;;
  2368. *none)
  2369. opt_warning_types=none
  2370. warning_func=:
  2371. ;;
  2372. *error)
  2373. opt_warning_types=$warning_categories
  2374. warning_func=func_fatal_error
  2375. ;;
  2376. *)
  2377. func_fatal_error \
  2378. "unsupported warning category: '$1'"
  2379. ;;
  2380. esac
  2381. shift
  2382. ;;
  2383. --verbose|-v) opt_verbose=: ;;
  2384. --version) func_version ;;
  2385. -\?|-h) func_usage ;;
  2386. --help) func_help ;;
  2387. # Separate optargs to long options (plugins may need this):
  2388. --*=*) func_split_equals "$_G_opt"
  2389. set dummy "$func_split_equals_lhs" \
  2390. "$func_split_equals_rhs" ${1+"$@"}
  2391. shift
  2392. ;;
  2393. # Separate optargs to short options:
  2394. -W*)
  2395. func_split_short_opt "$_G_opt"
  2396. set dummy "$func_split_short_opt_name" \
  2397. "$func_split_short_opt_arg" ${1+"$@"}
  2398. shift
  2399. ;;
  2400. # Separate non-argument short options:
  2401. -\?*|-h*|-v*|-x*)
  2402. func_split_short_opt "$_G_opt"
  2403. set dummy "$func_split_short_opt_name" \
  2404. "-$func_split_short_opt_arg" ${1+"$@"}
  2405. shift
  2406. ;;
  2407. --) break ;;
  2408. -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
  2409. *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
  2410. esac
  2411. done
  2412. #}
  2413. # Display all warnings if -W was not given.
  2414. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
  2415. # libtool_validate_options [ARG]...
  2416. # ---------------------------------
  2417. # Perform any sanity checks on option settings and/or unconsumed
  2418. # arguments.
  2419. #libtool_validate_options ()
  2420. #{
  2421. # save first non-option argument
  2422. if test 0 -lt $#; then
  2423. nonopt=$_G_opt
  2424. shift
  2425. fi
  2426. # preserve --debug
  2427. test : = "$debug_cmd" || func_append preserve_args " --debug"
  2428. case $host in
  2429. # For NIOS2, we want to make sure that it's not caught by the
  2430. # more general OS/2 check below. Otherwise, NIOS2 is the same
  2431. # as the default option.
  2432. *nios2*)
  2433. opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  2434. ;;
  2435. # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
  2436. # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
  2437. *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
  2438. # don't eliminate duplications in $postdeps and $predeps
  2439. opt_duplicate_compiler_generated_deps=:
  2440. ;;
  2441. *)
  2442. opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
  2443. ;;
  2444. esac
  2445. $opt_help || {
  2446. # Sanity checks first:
  2447. func_check_version_match
  2448. test yes != "$build_libtool_libs" \
  2449. && test yes != "$build_old_libs" \
  2450. && func_fatal_configuration "not configured to build any kind of library"
  2451. # Darwin sucks
  2452. eval std_shrext=\"$shrext_cmds\"
  2453. # Only execute mode is allowed to have -dlopen flags.
  2454. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
  2455. func_error "unrecognized option '-dlopen'"
  2456. $ECHO "$help" 1>&2
  2457. exit $EXIT_FAILURE
  2458. fi
  2459. # Change the help message to a mode-specific one.
  2460. generic_help=$help
  2461. help="Try '$progname --help --mode=$opt_mode' for more information."
  2462. }
  2463. #}
  2464. # Bail if the options were screwed!
  2465. $exit_cmd $EXIT_FAILURE
  2466. ## ----------- ##
  2467. ## Main. ##
  2468. ## ----------- ##
  2469. magic='%%%MAGIC variable%%%'
  2470. magic_exe='%%%MAGIC EXE variable%%%'
  2471. # Global variables.
  2472. extracted_archives=
  2473. extracted_serial=0
  2474. # If this variable is set in any of the actions, the command in it
  2475. # will be execed at the end. This prevents here-documents from being
  2476. # left over by shells.
  2477. exec_cmd=
  2478. # A function that is used when there is no print builtin or printf.
  2479. func_fallback_echo ()
  2480. {
  2481. eval 'cat <<_LTECHO_EOF
  2482. $1
  2483. _LTECHO_EOF'
  2484. }
  2485. # func_generated_by_libtool
  2486. # True iff stdin has been generated by Libtool. This function is only
  2487. # a basic sanity check; it will hardly flush out determined imposters.
  2488. func_generated_by_libtool_p ()
  2489. {
  2490. $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  2491. }
  2492. # func_lalib_p file
  2493. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2494. # This function is only a basic sanity check; it will hardly flush out
  2495. # determined imposters.
  2496. func_lalib_p ()
  2497. {
  2498. test -f "$1" &&
  2499. $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
  2500. }
  2501. # func_lalib_unsafe_p file
  2502. # True iff FILE is a libtool '.la' library or '.lo' object file.
  2503. # This function implements the same check as func_lalib_p without
  2504. # resorting to external programs. To this end, it redirects stdin and
  2505. # closes it afterwards, without saving the original file descriptor.
  2506. # As a safety measure, use it only where a negative result would be
  2507. # fatal anyway. Works if 'file' does not exist.
  2508. func_lalib_unsafe_p ()
  2509. {
  2510. lalib_p=no
  2511. if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  2512. for lalib_p_l in 1 2 3 4
  2513. do
  2514. read lalib_p_line
  2515. case $lalib_p_line in
  2516. \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  2517. esac
  2518. done
  2519. exec 0<&5 5<&-
  2520. fi
  2521. test yes = "$lalib_p"
  2522. }
  2523. # func_ltwrapper_script_p file
  2524. # True iff FILE is a libtool wrapper script
  2525. # This function is only a basic sanity check; it will hardly flush out
  2526. # determined imposters.
  2527. func_ltwrapper_script_p ()
  2528. {
  2529. test -f "$1" &&
  2530. $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
  2531. }
  2532. # func_ltwrapper_executable_p file
  2533. # True iff FILE is a libtool wrapper executable
  2534. # This function is only a basic sanity check; it will hardly flush out
  2535. # determined imposters.
  2536. func_ltwrapper_executable_p ()
  2537. {
  2538. func_ltwrapper_exec_suffix=
  2539. case $1 in
  2540. *.exe) ;;
  2541. *) func_ltwrapper_exec_suffix=.exe ;;
  2542. esac
  2543. $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  2544. }
  2545. # func_ltwrapper_scriptname file
  2546. # Assumes file is an ltwrapper_executable
  2547. # uses $file to determine the appropriate filename for a
  2548. # temporary ltwrapper_script.
  2549. func_ltwrapper_scriptname ()
  2550. {
  2551. func_dirname_and_basename "$1" "" "."
  2552. func_stripname '' '.exe' "$func_basename_result"
  2553. func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
  2554. }
  2555. # func_ltwrapper_p file
  2556. # True iff FILE is a libtool wrapper script or wrapper executable
  2557. # This function is only a basic sanity check; it will hardly flush out
  2558. # determined imposters.
  2559. func_ltwrapper_p ()
  2560. {
  2561. func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  2562. }
  2563. # func_execute_cmds commands fail_cmd
  2564. # Execute tilde-delimited COMMANDS.
  2565. # If FAIL_CMD is given, eval that upon failure.
  2566. # FAIL_CMD may read-access the current command in variable CMD!
  2567. func_execute_cmds ()
  2568. {
  2569. $debug_cmd
  2570. save_ifs=$IFS; IFS='~'
  2571. for cmd in $1; do
  2572. IFS=$sp$nl
  2573. eval cmd=\"$cmd\"
  2574. IFS=$save_ifs
  2575. func_show_eval "$cmd" "${2-:}"
  2576. done
  2577. IFS=$save_ifs
  2578. }
  2579. # func_source file
  2580. # Source FILE, adding directory component if necessary.
  2581. # Note that it is not necessary on cygwin/mingw to append a dot to
  2582. # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  2583. # behavior happens only for exec(3), not for open(2)! Also, sourcing
  2584. # 'FILE.' does not work on cygwin managed mounts.
  2585. func_source ()
  2586. {
  2587. $debug_cmd
  2588. case $1 in
  2589. */* | *\\*) . "$1" ;;
  2590. *) . "./$1" ;;
  2591. esac
  2592. }
  2593. # func_resolve_sysroot PATH
  2594. # Replace a leading = in PATH with a sysroot. Store the result into
  2595. # func_resolve_sysroot_result
  2596. func_resolve_sysroot ()
  2597. {
  2598. func_resolve_sysroot_result=$1
  2599. case $func_resolve_sysroot_result in
  2600. =*)
  2601. func_stripname '=' '' "$func_resolve_sysroot_result"
  2602. func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
  2603. ;;
  2604. esac
  2605. }
  2606. # func_replace_sysroot PATH
  2607. # If PATH begins with the sysroot, replace it with = and
  2608. # store the result into func_replace_sysroot_result.
  2609. func_replace_sysroot ()
  2610. {
  2611. case $lt_sysroot:$1 in
  2612. ?*:"$lt_sysroot"*)
  2613. func_stripname "$lt_sysroot" '' "$1"
  2614. func_replace_sysroot_result='='$func_stripname_result
  2615. ;;
  2616. *)
  2617. # Including no sysroot.
  2618. func_replace_sysroot_result=$1
  2619. ;;
  2620. esac
  2621. }
  2622. # func_infer_tag arg
  2623. # Infer tagged configuration to use if any are available and
  2624. # if one wasn't chosen via the "--tag" command line option.
  2625. # Only attempt this if the compiler in the base compile
  2626. # command doesn't match the default compiler.
  2627. # arg is usually of the form 'gcc ...'
  2628. func_infer_tag ()
  2629. {
  2630. $debug_cmd
  2631. if test -n "$available_tags" && test -z "$tagname"; then
  2632. CC_quoted=
  2633. for arg in $CC; do
  2634. func_append_quoted CC_quoted "$arg"
  2635. done
  2636. CC_expanded=`func_echo_all $CC`
  2637. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2638. case $@ in
  2639. # Blanks in the command may have been stripped by the calling shell,
  2640. # but not from the CC environment variable when configure was run.
  2641. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2642. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
  2643. # Blanks at the start of $base_compile will cause this to fail
  2644. # if we don't check for them as well.
  2645. *)
  2646. for z in $available_tags; do
  2647. if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  2648. # Evaluate the configuration.
  2649. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  2650. CC_quoted=
  2651. for arg in $CC; do
  2652. # Double-quote args containing other shell metacharacters.
  2653. func_append_quoted CC_quoted "$arg"
  2654. done
  2655. CC_expanded=`func_echo_all $CC`
  2656. CC_quoted_expanded=`func_echo_all $CC_quoted`
  2657. case "$@ " in
  2658. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
  2659. " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
  2660. # The compiler in the base compile command matches
  2661. # the one in the tagged configuration.
  2662. # Assume this is the tagged configuration we want.
  2663. tagname=$z
  2664. break
  2665. ;;
  2666. esac
  2667. fi
  2668. done
  2669. # If $tagname still isn't set, then no tagged configuration
  2670. # was found and let the user know that the "--tag" command
  2671. # line option must be used.
  2672. if test -z "$tagname"; then
  2673. func_echo "unable to infer tagged configuration"
  2674. func_fatal_error "specify a tag with '--tag'"
  2675. # else
  2676. # func_verbose "using $tagname tagged configuration"
  2677. fi
  2678. ;;
  2679. esac
  2680. fi
  2681. }
  2682. # func_write_libtool_object output_name pic_name nonpic_name
  2683. # Create a libtool object file (analogous to a ".la" file),
  2684. # but don't create it if we're doing a dry run.
  2685. func_write_libtool_object ()
  2686. {
  2687. write_libobj=$1
  2688. if test yes = "$build_libtool_libs"; then
  2689. write_lobj=\'$2\'
  2690. else
  2691. write_lobj=none
  2692. fi
  2693. if test yes = "$build_old_libs"; then
  2694. write_oldobj=\'$3\'
  2695. else
  2696. write_oldobj=none
  2697. fi
  2698. $opt_dry_run || {
  2699. cat >${write_libobj}T <<EOF
  2700. # $write_libobj - a libtool object file
  2701. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  2702. #
  2703. # Please DO NOT delete this file!
  2704. # It is necessary for linking the library.
  2705. # Name of the PIC object.
  2706. pic_object=$write_lobj
  2707. # Name of the non-PIC object
  2708. non_pic_object=$write_oldobj
  2709. EOF
  2710. $MV "${write_libobj}T" "$write_libobj"
  2711. }
  2712. }
  2713. ##################################################
  2714. # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
  2715. ##################################################
  2716. # func_convert_core_file_wine_to_w32 ARG
  2717. # Helper function used by file name conversion functions when $build is *nix,
  2718. # and $host is mingw, cygwin, or some other w32 environment. Relies on a
  2719. # correctly configured wine environment available, with the winepath program
  2720. # in $build's $PATH.
  2721. #
  2722. # ARG is the $build file name to be converted to w32 format.
  2723. # Result is available in $func_convert_core_file_wine_to_w32_result, and will
  2724. # be empty on error (or when ARG is empty)
  2725. func_convert_core_file_wine_to_w32 ()
  2726. {
  2727. $debug_cmd
  2728. func_convert_core_file_wine_to_w32_result=$1
  2729. if test -n "$1"; then
  2730. # Unfortunately, winepath does not exit with a non-zero error code, so we
  2731. # are forced to check the contents of stdout. On the other hand, if the
  2732. # command is not found, the shell will set an exit code of 127 and print
  2733. # *an error message* to stdout. So we must check for both error code of
  2734. # zero AND non-empty stdout, which explains the odd construction:
  2735. func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
  2736. if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
  2737. func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
  2738. $SED -e "$sed_naive_backslashify"`
  2739. else
  2740. func_convert_core_file_wine_to_w32_result=
  2741. fi
  2742. fi
  2743. }
  2744. # end: func_convert_core_file_wine_to_w32
  2745. # func_convert_core_path_wine_to_w32 ARG
  2746. # Helper function used by path conversion functions when $build is *nix, and
  2747. # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
  2748. # configured wine environment available, with the winepath program in $build's
  2749. # $PATH. Assumes ARG has no leading or trailing path separator characters.
  2750. #
  2751. # ARG is path to be converted from $build format to win32.
  2752. # Result is available in $func_convert_core_path_wine_to_w32_result.
  2753. # Unconvertible file (directory) names in ARG are skipped; if no directory names
  2754. # are convertible, then the result may be empty.
  2755. func_convert_core_path_wine_to_w32 ()
  2756. {
  2757. $debug_cmd
  2758. # unfortunately, winepath doesn't convert paths, only file names
  2759. func_convert_core_path_wine_to_w32_result=
  2760. if test -n "$1"; then
  2761. oldIFS=$IFS
  2762. IFS=:
  2763. for func_convert_core_path_wine_to_w32_f in $1; do
  2764. IFS=$oldIFS
  2765. func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
  2766. if test -n "$func_convert_core_file_wine_to_w32_result"; then
  2767. if test -z "$func_convert_core_path_wine_to_w32_result"; then
  2768. func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
  2769. else
  2770. func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
  2771. fi
  2772. fi
  2773. done
  2774. IFS=$oldIFS
  2775. fi
  2776. }
  2777. # end: func_convert_core_path_wine_to_w32
  2778. # func_cygpath ARGS...
  2779. # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
  2780. # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
  2781. # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
  2782. # (2), returns the Cygwin file name or path in func_cygpath_result (input
  2783. # file name or path is assumed to be in w32 format, as previously converted
  2784. # from $build's *nix or MSYS format). In case (3), returns the w32 file name
  2785. # or path in func_cygpath_result (input file name or path is assumed to be in
  2786. # Cygwin format). Returns an empty string on error.
  2787. #
  2788. # ARGS are passed to cygpath, with the last one being the file name or path to
  2789. # be converted.
  2790. #
  2791. # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
  2792. # environment variable; do not put it in $PATH.
  2793. func_cygpath ()
  2794. {
  2795. $debug_cmd
  2796. if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
  2797. func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
  2798. if test "$?" -ne 0; then
  2799. # on failure, ensure result is empty
  2800. func_cygpath_result=
  2801. fi
  2802. else
  2803. func_cygpath_result=
  2804. func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
  2805. fi
  2806. }
  2807. #end: func_cygpath
  2808. # func_convert_core_msys_to_w32 ARG
  2809. # Convert file name or path ARG from MSYS format to w32 format. Return
  2810. # result in func_convert_core_msys_to_w32_result.
  2811. func_convert_core_msys_to_w32 ()
  2812. {
  2813. $debug_cmd
  2814. # awkward: cmd appends spaces to result
  2815. func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
  2816. $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
  2817. }
  2818. #end: func_convert_core_msys_to_w32
  2819. # func_convert_file_check ARG1 ARG2
  2820. # Verify that ARG1 (a file name in $build format) was converted to $host
  2821. # format in ARG2. Otherwise, emit an error message, but continue (resetting
  2822. # func_to_host_file_result to ARG1).
  2823. func_convert_file_check ()
  2824. {
  2825. $debug_cmd
  2826. if test -z "$2" && test -n "$1"; then
  2827. func_error "Could not determine host file name corresponding to"
  2828. func_error " '$1'"
  2829. func_error "Continuing, but uninstalled executables may not work."
  2830. # Fallback:
  2831. func_to_host_file_result=$1
  2832. fi
  2833. }
  2834. # end func_convert_file_check
  2835. # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
  2836. # Verify that FROM_PATH (a path in $build format) was converted to $host
  2837. # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
  2838. # func_to_host_file_result to a simplistic fallback value (see below).
  2839. func_convert_path_check ()
  2840. {
  2841. $debug_cmd
  2842. if test -z "$4" && test -n "$3"; then
  2843. func_error "Could not determine the host path corresponding to"
  2844. func_error " '$3'"
  2845. func_error "Continuing, but uninstalled executables may not work."
  2846. # Fallback. This is a deliberately simplistic "conversion" and
  2847. # should not be "improved". See libtool.info.
  2848. if test "x$1" != "x$2"; then
  2849. lt_replace_pathsep_chars="s|$1|$2|g"
  2850. func_to_host_path_result=`echo "$3" |
  2851. $SED -e "$lt_replace_pathsep_chars"`
  2852. else
  2853. func_to_host_path_result=$3
  2854. fi
  2855. fi
  2856. }
  2857. # end func_convert_path_check
  2858. # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
  2859. # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
  2860. # and appending REPL if ORIG matches BACKPAT.
  2861. func_convert_path_front_back_pathsep ()
  2862. {
  2863. $debug_cmd
  2864. case $4 in
  2865. $1 ) func_to_host_path_result=$3$func_to_host_path_result
  2866. ;;
  2867. esac
  2868. case $4 in
  2869. $2 ) func_append func_to_host_path_result "$3"
  2870. ;;
  2871. esac
  2872. }
  2873. # end func_convert_path_front_back_pathsep
  2874. ##################################################
  2875. # $build to $host FILE NAME CONVERSION FUNCTIONS #
  2876. ##################################################
  2877. # invoked via '$to_host_file_cmd ARG'
  2878. #
  2879. # In each case, ARG is the path to be converted from $build to $host format.
  2880. # Result will be available in $func_to_host_file_result.
  2881. # func_to_host_file ARG
  2882. # Converts the file name ARG from $build format to $host format. Return result
  2883. # in func_to_host_file_result.
  2884. func_to_host_file ()
  2885. {
  2886. $debug_cmd
  2887. $to_host_file_cmd "$1"
  2888. }
  2889. # end func_to_host_file
  2890. # func_to_tool_file ARG LAZY
  2891. # converts the file name ARG from $build format to toolchain format. Return
  2892. # result in func_to_tool_file_result. If the conversion in use is listed
  2893. # in (the comma separated) LAZY, no conversion takes place.
  2894. func_to_tool_file ()
  2895. {
  2896. $debug_cmd
  2897. case ,$2, in
  2898. *,"$to_tool_file_cmd",*)
  2899. func_to_tool_file_result=$1
  2900. ;;
  2901. *)
  2902. $to_tool_file_cmd "$1"
  2903. func_to_tool_file_result=$func_to_host_file_result
  2904. ;;
  2905. esac
  2906. }
  2907. # end func_to_tool_file
  2908. # func_convert_file_noop ARG
  2909. # Copy ARG to func_to_host_file_result.
  2910. func_convert_file_noop ()
  2911. {
  2912. func_to_host_file_result=$1
  2913. }
  2914. # end func_convert_file_noop
  2915. # func_convert_file_msys_to_w32 ARG
  2916. # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
  2917. # conversion to w32 is not available inside the cwrapper. Returns result in
  2918. # func_to_host_file_result.
  2919. func_convert_file_msys_to_w32 ()
  2920. {
  2921. $debug_cmd
  2922. func_to_host_file_result=$1
  2923. if test -n "$1"; then
  2924. func_convert_core_msys_to_w32 "$1"
  2925. func_to_host_file_result=$func_convert_core_msys_to_w32_result
  2926. fi
  2927. func_convert_file_check "$1" "$func_to_host_file_result"
  2928. }
  2929. # end func_convert_file_msys_to_w32
  2930. # func_convert_file_cygwin_to_w32 ARG
  2931. # Convert file name ARG from Cygwin to w32 format. Returns result in
  2932. # func_to_host_file_result.
  2933. func_convert_file_cygwin_to_w32 ()
  2934. {
  2935. $debug_cmd
  2936. func_to_host_file_result=$1
  2937. if test -n "$1"; then
  2938. # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
  2939. # LT_CYGPATH in this case.
  2940. func_to_host_file_result=`cygpath -m "$1"`
  2941. fi
  2942. func_convert_file_check "$1" "$func_to_host_file_result"
  2943. }
  2944. # end func_convert_file_cygwin_to_w32
  2945. # func_convert_file_nix_to_w32 ARG
  2946. # Convert file name ARG from *nix to w32 format. Requires a wine environment
  2947. # and a working winepath. Returns result in func_to_host_file_result.
  2948. func_convert_file_nix_to_w32 ()
  2949. {
  2950. $debug_cmd
  2951. func_to_host_file_result=$1
  2952. if test -n "$1"; then
  2953. func_convert_core_file_wine_to_w32 "$1"
  2954. func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
  2955. fi
  2956. func_convert_file_check "$1" "$func_to_host_file_result"
  2957. }
  2958. # end func_convert_file_nix_to_w32
  2959. # func_convert_file_msys_to_cygwin ARG
  2960. # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  2961. # Returns result in func_to_host_file_result.
  2962. func_convert_file_msys_to_cygwin ()
  2963. {
  2964. $debug_cmd
  2965. func_to_host_file_result=$1
  2966. if test -n "$1"; then
  2967. func_convert_core_msys_to_w32 "$1"
  2968. func_cygpath -u "$func_convert_core_msys_to_w32_result"
  2969. func_to_host_file_result=$func_cygpath_result
  2970. fi
  2971. func_convert_file_check "$1" "$func_to_host_file_result"
  2972. }
  2973. # end func_convert_file_msys_to_cygwin
  2974. # func_convert_file_nix_to_cygwin ARG
  2975. # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
  2976. # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
  2977. # in func_to_host_file_result.
  2978. func_convert_file_nix_to_cygwin ()
  2979. {
  2980. $debug_cmd
  2981. func_to_host_file_result=$1
  2982. if test -n "$1"; then
  2983. # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
  2984. func_convert_core_file_wine_to_w32 "$1"
  2985. func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
  2986. func_to_host_file_result=$func_cygpath_result
  2987. fi
  2988. func_convert_file_check "$1" "$func_to_host_file_result"
  2989. }
  2990. # end func_convert_file_nix_to_cygwin
  2991. #############################################
  2992. # $build to $host PATH CONVERSION FUNCTIONS #
  2993. #############################################
  2994. # invoked via '$to_host_path_cmd ARG'
  2995. #
  2996. # In each case, ARG is the path to be converted from $build to $host format.
  2997. # The result will be available in $func_to_host_path_result.
  2998. #
  2999. # Path separators are also converted from $build format to $host format. If
  3000. # ARG begins or ends with a path separator character, it is preserved (but
  3001. # converted to $host format) on output.
  3002. #
  3003. # All path conversion functions are named using the following convention:
  3004. # file name conversion function : func_convert_file_X_to_Y ()
  3005. # path conversion function : func_convert_path_X_to_Y ()
  3006. # where, for any given $build/$host combination the 'X_to_Y' value is the
  3007. # same. If conversion functions are added for new $build/$host combinations,
  3008. # the two new functions must follow this pattern, or func_init_to_host_path_cmd
  3009. # will break.
  3010. # func_init_to_host_path_cmd
  3011. # Ensures that function "pointer" variable $to_host_path_cmd is set to the
  3012. # appropriate value, based on the value of $to_host_file_cmd.
  3013. to_host_path_cmd=
  3014. func_init_to_host_path_cmd ()
  3015. {
  3016. $debug_cmd
  3017. if test -z "$to_host_path_cmd"; then
  3018. func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
  3019. to_host_path_cmd=func_convert_path_$func_stripname_result
  3020. fi
  3021. }
  3022. # func_to_host_path ARG
  3023. # Converts the path ARG from $build format to $host format. Return result
  3024. # in func_to_host_path_result.
  3025. func_to_host_path ()
  3026. {
  3027. $debug_cmd
  3028. func_init_to_host_path_cmd
  3029. $to_host_path_cmd "$1"
  3030. }
  3031. # end func_to_host_path
  3032. # func_convert_path_noop ARG
  3033. # Copy ARG to func_to_host_path_result.
  3034. func_convert_path_noop ()
  3035. {
  3036. func_to_host_path_result=$1
  3037. }
  3038. # end func_convert_path_noop
  3039. # func_convert_path_msys_to_w32 ARG
  3040. # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
  3041. # conversion to w32 is not available inside the cwrapper. Returns result in
  3042. # func_to_host_path_result.
  3043. func_convert_path_msys_to_w32 ()
  3044. {
  3045. $debug_cmd
  3046. func_to_host_path_result=$1
  3047. if test -n "$1"; then
  3048. # Remove leading and trailing path separator characters from ARG. MSYS
  3049. # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
  3050. # and winepath ignores them completely.
  3051. func_stripname : : "$1"
  3052. func_to_host_path_tmp1=$func_stripname_result
  3053. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3054. func_to_host_path_result=$func_convert_core_msys_to_w32_result
  3055. func_convert_path_check : ";" \
  3056. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3057. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3058. fi
  3059. }
  3060. # end func_convert_path_msys_to_w32
  3061. # func_convert_path_cygwin_to_w32 ARG
  3062. # Convert path ARG from Cygwin to w32 format. Returns result in
  3063. # func_to_host_file_result.
  3064. func_convert_path_cygwin_to_w32 ()
  3065. {
  3066. $debug_cmd
  3067. func_to_host_path_result=$1
  3068. if test -n "$1"; then
  3069. # See func_convert_path_msys_to_w32:
  3070. func_stripname : : "$1"
  3071. func_to_host_path_tmp1=$func_stripname_result
  3072. func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
  3073. func_convert_path_check : ";" \
  3074. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3075. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3076. fi
  3077. }
  3078. # end func_convert_path_cygwin_to_w32
  3079. # func_convert_path_nix_to_w32 ARG
  3080. # Convert path ARG from *nix to w32 format. Requires a wine environment and
  3081. # a working winepath. Returns result in func_to_host_file_result.
  3082. func_convert_path_nix_to_w32 ()
  3083. {
  3084. $debug_cmd
  3085. func_to_host_path_result=$1
  3086. if test -n "$1"; then
  3087. # See func_convert_path_msys_to_w32:
  3088. func_stripname : : "$1"
  3089. func_to_host_path_tmp1=$func_stripname_result
  3090. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3091. func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
  3092. func_convert_path_check : ";" \
  3093. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3094. func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
  3095. fi
  3096. }
  3097. # end func_convert_path_nix_to_w32
  3098. # func_convert_path_msys_to_cygwin ARG
  3099. # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
  3100. # Returns result in func_to_host_file_result.
  3101. func_convert_path_msys_to_cygwin ()
  3102. {
  3103. $debug_cmd
  3104. func_to_host_path_result=$1
  3105. if test -n "$1"; then
  3106. # See func_convert_path_msys_to_w32:
  3107. func_stripname : : "$1"
  3108. func_to_host_path_tmp1=$func_stripname_result
  3109. func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
  3110. func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
  3111. func_to_host_path_result=$func_cygpath_result
  3112. func_convert_path_check : : \
  3113. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3114. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3115. fi
  3116. }
  3117. # end func_convert_path_msys_to_cygwin
  3118. # func_convert_path_nix_to_cygwin ARG
  3119. # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
  3120. # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
  3121. # func_to_host_file_result.
  3122. func_convert_path_nix_to_cygwin ()
  3123. {
  3124. $debug_cmd
  3125. func_to_host_path_result=$1
  3126. if test -n "$1"; then
  3127. # Remove leading and trailing path separator characters from
  3128. # ARG. msys behavior is inconsistent here, cygpath turns them
  3129. # into '.;' and ';.', and winepath ignores them completely.
  3130. func_stripname : : "$1"
  3131. func_to_host_path_tmp1=$func_stripname_result
  3132. func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
  3133. func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
  3134. func_to_host_path_result=$func_cygpath_result
  3135. func_convert_path_check : : \
  3136. "$func_to_host_path_tmp1" "$func_to_host_path_result"
  3137. func_convert_path_front_back_pathsep ":*" "*:" : "$1"
  3138. fi
  3139. }
  3140. # end func_convert_path_nix_to_cygwin
  3141. # func_dll_def_p FILE
  3142. # True iff FILE is a Windows DLL '.def' file.
  3143. # Keep in sync with _LT_DLL_DEF_P in libtool.m4
  3144. func_dll_def_p ()
  3145. {
  3146. $debug_cmd
  3147. func_dll_def_p_tmp=`$SED -n \
  3148. -e 's/^[ ]*//' \
  3149. -e '/^\(;.*\)*$/d' \
  3150. -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
  3151. -e q \
  3152. "$1"`
  3153. test DEF = "$func_dll_def_p_tmp"
  3154. }
  3155. # func_mode_compile arg...
  3156. func_mode_compile ()
  3157. {
  3158. $debug_cmd
  3159. # Get the compilation command and the source file.
  3160. base_compile=
  3161. srcfile=$nonopt # always keep a non-empty value in "srcfile"
  3162. suppress_opt=yes
  3163. suppress_output=
  3164. arg_mode=normal
  3165. libobj=
  3166. later=
  3167. pie_flag=
  3168. for arg
  3169. do
  3170. case $arg_mode in
  3171. arg )
  3172. # do not "continue". Instead, add this to base_compile
  3173. lastarg=$arg
  3174. arg_mode=normal
  3175. ;;
  3176. target )
  3177. libobj=$arg
  3178. arg_mode=normal
  3179. continue
  3180. ;;
  3181. normal )
  3182. # Accept any command-line options.
  3183. case $arg in
  3184. -o)
  3185. test -n "$libobj" && \
  3186. func_fatal_error "you cannot specify '-o' more than once"
  3187. arg_mode=target
  3188. continue
  3189. ;;
  3190. -pie | -fpie | -fPIE)
  3191. func_append pie_flag " $arg"
  3192. continue
  3193. ;;
  3194. -shared | -static | -prefer-pic | -prefer-non-pic)
  3195. func_append later " $arg"
  3196. continue
  3197. ;;
  3198. -no-suppress)
  3199. suppress_opt=no
  3200. continue
  3201. ;;
  3202. -Xcompiler)
  3203. arg_mode=arg # the next one goes into the "base_compile" arg list
  3204. continue # The current "srcfile" will either be retained or
  3205. ;; # replaced later. I would guess that would be a bug.
  3206. -Wc,*)
  3207. func_stripname '-Wc,' '' "$arg"
  3208. args=$func_stripname_result
  3209. lastarg=
  3210. save_ifs=$IFS; IFS=,
  3211. for arg in $args; do
  3212. IFS=$save_ifs
  3213. func_append_quoted lastarg "$arg"
  3214. done
  3215. IFS=$save_ifs
  3216. func_stripname ' ' '' "$lastarg"
  3217. lastarg=$func_stripname_result
  3218. # Add the arguments to base_compile.
  3219. func_append base_compile " $lastarg"
  3220. continue
  3221. ;;
  3222. *)
  3223. # Accept the current argument as the source file.
  3224. # The previous "srcfile" becomes the current argument.
  3225. #
  3226. lastarg=$srcfile
  3227. srcfile=$arg
  3228. ;;
  3229. esac # case $arg
  3230. ;;
  3231. esac # case $arg_mode
  3232. # Aesthetically quote the previous argument.
  3233. func_append_quoted base_compile "$lastarg"
  3234. done # for arg
  3235. case $arg_mode in
  3236. arg)
  3237. func_fatal_error "you must specify an argument for -Xcompile"
  3238. ;;
  3239. target)
  3240. func_fatal_error "you must specify a target with '-o'"
  3241. ;;
  3242. *)
  3243. # Get the name of the library object.
  3244. test -z "$libobj" && {
  3245. func_basename "$srcfile"
  3246. libobj=$func_basename_result
  3247. }
  3248. ;;
  3249. esac
  3250. # Recognize several different file suffixes.
  3251. # If the user specifies -o file.o, it is replaced with file.lo
  3252. case $libobj in
  3253. *.[cCFSifmso] | \
  3254. *.ada | *.adb | *.ads | *.asm | \
  3255. *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  3256. *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
  3257. func_xform "$libobj"
  3258. libobj=$func_xform_result
  3259. ;;
  3260. esac
  3261. case $libobj in
  3262. *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  3263. *)
  3264. func_fatal_error "cannot determine name of library object from '$libobj'"
  3265. ;;
  3266. esac
  3267. func_infer_tag $base_compile
  3268. for arg in $later; do
  3269. case $arg in
  3270. -shared)
  3271. test yes = "$build_libtool_libs" \
  3272. || func_fatal_configuration "cannot build a shared library"
  3273. build_old_libs=no
  3274. continue
  3275. ;;
  3276. -static)
  3277. build_libtool_libs=no
  3278. build_old_libs=yes
  3279. continue
  3280. ;;
  3281. -prefer-pic)
  3282. pic_mode=yes
  3283. continue
  3284. ;;
  3285. -prefer-non-pic)
  3286. pic_mode=no
  3287. continue
  3288. ;;
  3289. esac
  3290. done
  3291. func_quote_for_eval "$libobj"
  3292. test "X$libobj" != "X$func_quote_for_eval_result" \
  3293. && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  3294. && func_warning "libobj name '$libobj' may not contain shell special characters."
  3295. func_dirname_and_basename "$obj" "/" ""
  3296. objname=$func_basename_result
  3297. xdir=$func_dirname_result
  3298. lobj=$xdir$objdir/$objname
  3299. test -z "$base_compile" && \
  3300. func_fatal_help "you must specify a compilation command"
  3301. # Delete any leftover library objects.
  3302. if test yes = "$build_old_libs"; then
  3303. removelist="$obj $lobj $libobj ${libobj}T"
  3304. else
  3305. removelist="$lobj $libobj ${libobj}T"
  3306. fi
  3307. # On Cygwin there's no "real" PIC flag so we must build both object types
  3308. case $host_os in
  3309. cygwin* | mingw* | pw32* | os2* | cegcc*)
  3310. pic_mode=default
  3311. ;;
  3312. esac
  3313. if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
  3314. # non-PIC code in shared libraries is not supported
  3315. pic_mode=default
  3316. fi
  3317. # Calculate the filename of the output object if compiler does
  3318. # not support -o with -c
  3319. if test no = "$compiler_c_o"; then
  3320. output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
  3321. lockfile=$output_obj.lock
  3322. else
  3323. output_obj=
  3324. need_locks=no
  3325. lockfile=
  3326. fi
  3327. # Lock this critical section if it is needed
  3328. # We use this script file to make the link, it avoids creating a new file
  3329. if test yes = "$need_locks"; then
  3330. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  3331. func_echo "Waiting for $lockfile to be removed"
  3332. sleep 2
  3333. done
  3334. elif test warn = "$need_locks"; then
  3335. if test -f "$lockfile"; then
  3336. $ECHO "\
  3337. *** ERROR, $lockfile exists and contains:
  3338. `cat $lockfile 2>/dev/null`
  3339. This indicates that another process is trying to use the same
  3340. temporary object file, and libtool could not work around it because
  3341. your compiler does not support '-c' and '-o' together. If you
  3342. repeat this compilation, it may succeed, by chance, but you had better
  3343. avoid parallel builds (make -j) in this platform, or get a better
  3344. compiler."
  3345. $opt_dry_run || $RM $removelist
  3346. exit $EXIT_FAILURE
  3347. fi
  3348. func_append removelist " $output_obj"
  3349. $ECHO "$srcfile" > "$lockfile"
  3350. fi
  3351. $opt_dry_run || $RM $removelist
  3352. func_append removelist " $lockfile"
  3353. trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  3354. func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
  3355. srcfile=$func_to_tool_file_result
  3356. func_quote_for_eval "$srcfile"
  3357. qsrcfile=$func_quote_for_eval_result
  3358. # Only build a PIC object if we are building libtool libraries.
  3359. if test yes = "$build_libtool_libs"; then
  3360. # Without this assignment, base_compile gets emptied.
  3361. fbsd_hideous_sh_bug=$base_compile
  3362. if test no != "$pic_mode"; then
  3363. command="$base_compile $qsrcfile $pic_flag"
  3364. else
  3365. # Don't build PIC code
  3366. command="$base_compile $qsrcfile"
  3367. fi
  3368. func_mkdir_p "$xdir$objdir"
  3369. if test -z "$output_obj"; then
  3370. # Place PIC objects in $objdir
  3371. func_append command " -o $lobj"
  3372. fi
  3373. func_show_eval_locale "$command" \
  3374. 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  3375. if test warn = "$need_locks" &&
  3376. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3377. $ECHO "\
  3378. *** ERROR, $lockfile contains:
  3379. `cat $lockfile 2>/dev/null`
  3380. but it should contain:
  3381. $srcfile
  3382. This indicates that another process is trying to use the same
  3383. temporary object file, and libtool could not work around it because
  3384. your compiler does not support '-c' and '-o' together. If you
  3385. repeat this compilation, it may succeed, by chance, but you had better
  3386. avoid parallel builds (make -j) in this platform, or get a better
  3387. compiler."
  3388. $opt_dry_run || $RM $removelist
  3389. exit $EXIT_FAILURE
  3390. fi
  3391. # Just move the object if needed, then go on to compile the next one
  3392. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  3393. func_show_eval '$MV "$output_obj" "$lobj"' \
  3394. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3395. fi
  3396. # Allow error messages only from the first compilation.
  3397. if test yes = "$suppress_opt"; then
  3398. suppress_output=' >/dev/null 2>&1'
  3399. fi
  3400. fi
  3401. # Only build a position-dependent object if we build old libraries.
  3402. if test yes = "$build_old_libs"; then
  3403. if test yes != "$pic_mode"; then
  3404. # Don't build PIC code
  3405. command="$base_compile $qsrcfile$pie_flag"
  3406. else
  3407. command="$base_compile $qsrcfile $pic_flag"
  3408. fi
  3409. if test yes = "$compiler_c_o"; then
  3410. func_append command " -o $obj"
  3411. fi
  3412. # Suppress compiler output if we already did a PIC compilation.
  3413. func_append command "$suppress_output"
  3414. func_show_eval_locale "$command" \
  3415. '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  3416. if test warn = "$need_locks" &&
  3417. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  3418. $ECHO "\
  3419. *** ERROR, $lockfile contains:
  3420. `cat $lockfile 2>/dev/null`
  3421. but it should contain:
  3422. $srcfile
  3423. This indicates that another process is trying to use the same
  3424. temporary object file, and libtool could not work around it because
  3425. your compiler does not support '-c' and '-o' together. If you
  3426. repeat this compilation, it may succeed, by chance, but you had better
  3427. avoid parallel builds (make -j) in this platform, or get a better
  3428. compiler."
  3429. $opt_dry_run || $RM $removelist
  3430. exit $EXIT_FAILURE
  3431. fi
  3432. # Just move the object if needed
  3433. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  3434. func_show_eval '$MV "$output_obj" "$obj"' \
  3435. 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  3436. fi
  3437. fi
  3438. $opt_dry_run || {
  3439. func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  3440. # Unlock the critical section if it was locked
  3441. if test no != "$need_locks"; then
  3442. removelist=$lockfile
  3443. $RM "$lockfile"
  3444. fi
  3445. }
  3446. exit $EXIT_SUCCESS
  3447. }
  3448. $opt_help || {
  3449. test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
  3450. }
  3451. func_mode_help ()
  3452. {
  3453. # We need to display help for each of the modes.
  3454. case $opt_mode in
  3455. "")
  3456. # Generic help is extracted from the usage comments
  3457. # at the start of this file.
  3458. func_help
  3459. ;;
  3460. clean)
  3461. $ECHO \
  3462. "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  3463. Remove files from the build directory.
  3464. RM is the name of the program to use to delete files associated with each FILE
  3465. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3466. to RM.
  3467. If FILE is a libtool library, object or program, all the files associated
  3468. with it are deleted. Otherwise, only FILE itself is deleted using RM."
  3469. ;;
  3470. compile)
  3471. $ECHO \
  3472. "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  3473. Compile a source file into a libtool library object.
  3474. This mode accepts the following additional options:
  3475. -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  3476. -no-suppress do not suppress compiler output for multiple passes
  3477. -prefer-pic try to build PIC objects only
  3478. -prefer-non-pic try to build non-PIC objects only
  3479. -shared do not build a '.o' file suitable for static linking
  3480. -static only build a '.o' file suitable for static linking
  3481. -Wc,FLAG pass FLAG directly to the compiler
  3482. COMPILE-COMMAND is a command to be used in creating a 'standard' object file
  3483. from the given SOURCEFILE.
  3484. The output file name is determined by removing the directory component from
  3485. SOURCEFILE, then substituting the C source code suffix '.c' with the
  3486. library object suffix, '.lo'."
  3487. ;;
  3488. execute)
  3489. $ECHO \
  3490. "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  3491. Automatically set library path, then run a program.
  3492. This mode accepts the following additional options:
  3493. -dlopen FILE add the directory containing FILE to the library path
  3494. This mode sets the library path environment variable according to '-dlopen'
  3495. flags.
  3496. If any of the ARGS are libtool executable wrappers, then they are translated
  3497. into their corresponding uninstalled binary, and any of their required library
  3498. directories are added to the library path.
  3499. Then, COMMAND is executed, with ARGS as arguments."
  3500. ;;
  3501. finish)
  3502. $ECHO \
  3503. "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  3504. Complete the installation of libtool libraries.
  3505. Each LIBDIR is a directory that contains libtool libraries.
  3506. The commands that this mode executes may require superuser privileges. Use
  3507. the '--dry-run' option if you just want to see what would be executed."
  3508. ;;
  3509. install)
  3510. $ECHO \
  3511. "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  3512. Install executables or libraries.
  3513. INSTALL-COMMAND is the installation command. The first component should be
  3514. either the 'install' or 'cp' program.
  3515. The following components of INSTALL-COMMAND are treated specially:
  3516. -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  3517. The rest of the components are interpreted as arguments to that command (only
  3518. BSD-compatible install options are recognized)."
  3519. ;;
  3520. link)
  3521. $ECHO \
  3522. "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  3523. Link object files or libraries together to form another library, or to
  3524. create an executable program.
  3525. LINK-COMMAND is a command using the C compiler that you would use to create
  3526. a program from several object files.
  3527. The following components of LINK-COMMAND are treated specially:
  3528. -all-static do not do any dynamic linking at all
  3529. -avoid-version do not add a version suffix if possible
  3530. -bindir BINDIR specify path to binaries directory (for systems where
  3531. libraries must be found in the PATH setting at runtime)
  3532. -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
  3533. -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  3534. -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  3535. -export-symbols SYMFILE
  3536. try to export only the symbols listed in SYMFILE
  3537. -export-symbols-regex REGEX
  3538. try to export only the symbols matching REGEX
  3539. -LLIBDIR search LIBDIR for required installed libraries
  3540. -lNAME OUTPUT-FILE requires the installed library libNAME
  3541. -module build a library that can dlopened
  3542. -no-fast-install disable the fast-install mode
  3543. -no-install link a not-installable executable
  3544. -no-undefined declare that a library does not refer to external symbols
  3545. -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  3546. -objectlist FILE use a list of object files found in FILE to specify objects
  3547. -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
  3548. -precious-files-regex REGEX
  3549. don't remove output files matching REGEX
  3550. -release RELEASE specify package release information
  3551. -rpath LIBDIR the created library will eventually be installed in LIBDIR
  3552. -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  3553. -shared only do dynamic linking of libtool libraries
  3554. -shrext SUFFIX override the standard shared library file extension
  3555. -static do not do any dynamic linking of uninstalled libtool libraries
  3556. -static-libtool-libs
  3557. do not do any dynamic linking of libtool libraries
  3558. -version-info CURRENT[:REVISION[:AGE]]
  3559. specify library version info [each variable defaults to 0]
  3560. -weak LIBNAME declare that the target provides the LIBNAME interface
  3561. -Wc,FLAG
  3562. -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
  3563. -Wl,FLAG
  3564. -Xlinker FLAG pass linker-specific FLAG directly to the linker
  3565. -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
  3566. All other options (arguments beginning with '-') are ignored.
  3567. Every other argument is treated as a filename. Files ending in '.la' are
  3568. treated as uninstalled libtool libraries, other files are standard or library
  3569. object files.
  3570. If the OUTPUT-FILE ends in '.la', then a libtool library is created,
  3571. only library objects ('.lo' files) may be specified, and '-rpath' is
  3572. required, except when creating a convenience library.
  3573. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
  3574. using 'ar' and 'ranlib', or on Windows using 'lib'.
  3575. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
  3576. is created, otherwise an executable program is created."
  3577. ;;
  3578. uninstall)
  3579. $ECHO \
  3580. "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  3581. Remove libraries from an installation directory.
  3582. RM is the name of the program to use to delete files associated with each FILE
  3583. (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
  3584. to RM.
  3585. If FILE is a libtool library, all the files associated with it are deleted.
  3586. Otherwise, only FILE itself is deleted using RM."
  3587. ;;
  3588. *)
  3589. func_fatal_help "invalid operation mode '$opt_mode'"
  3590. ;;
  3591. esac
  3592. echo
  3593. $ECHO "Try '$progname --help' for more information about other modes."
  3594. }
  3595. # Now that we've collected a possible --mode arg, show help if necessary
  3596. if $opt_help; then
  3597. if test : = "$opt_help"; then
  3598. func_mode_help
  3599. else
  3600. {
  3601. func_help noexit
  3602. for opt_mode in compile link execute install finish uninstall clean; do
  3603. func_mode_help
  3604. done
  3605. } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
  3606. {
  3607. func_help noexit
  3608. for opt_mode in compile link execute install finish uninstall clean; do
  3609. echo
  3610. func_mode_help
  3611. done
  3612. } |
  3613. $SED '1d
  3614. /^When reporting/,/^Report/{
  3615. H
  3616. d
  3617. }
  3618. $x
  3619. /information about other modes/d
  3620. /more detailed .*MODE/d
  3621. s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
  3622. fi
  3623. exit $?
  3624. fi
  3625. # func_mode_execute arg...
  3626. func_mode_execute ()
  3627. {
  3628. $debug_cmd
  3629. # The first argument is the command name.
  3630. cmd=$nonopt
  3631. test -z "$cmd" && \
  3632. func_fatal_help "you must specify a COMMAND"
  3633. # Handle -dlopen flags immediately.
  3634. for file in $opt_dlopen; do
  3635. test -f "$file" \
  3636. || func_fatal_help "'$file' is not a file"
  3637. dir=
  3638. case $file in
  3639. *.la)
  3640. func_resolve_sysroot "$file"
  3641. file=$func_resolve_sysroot_result
  3642. # Check to see that this really is a libtool archive.
  3643. func_lalib_unsafe_p "$file" \
  3644. || func_fatal_help "'$lib' is not a valid libtool archive"
  3645. # Read the libtool library.
  3646. dlname=
  3647. library_names=
  3648. func_source "$file"
  3649. # Skip this library if it cannot be dlopened.
  3650. if test -z "$dlname"; then
  3651. # Warn if it was a shared library.
  3652. test -n "$library_names" && \
  3653. func_warning "'$file' was not linked with '-export-dynamic'"
  3654. continue
  3655. fi
  3656. func_dirname "$file" "" "."
  3657. dir=$func_dirname_result
  3658. if test -f "$dir/$objdir/$dlname"; then
  3659. func_append dir "/$objdir"
  3660. else
  3661. if test ! -f "$dir/$dlname"; then
  3662. func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
  3663. fi
  3664. fi
  3665. ;;
  3666. *.lo)
  3667. # Just add the directory containing the .lo file.
  3668. func_dirname "$file" "" "."
  3669. dir=$func_dirname_result
  3670. ;;
  3671. *)
  3672. func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
  3673. continue
  3674. ;;
  3675. esac
  3676. # Get the absolute pathname.
  3677. absdir=`cd "$dir" && pwd`
  3678. test -n "$absdir" && dir=$absdir
  3679. # Now add the directory to shlibpath_var.
  3680. if eval "test -z \"\$$shlibpath_var\""; then
  3681. eval "$shlibpath_var=\"\$dir\""
  3682. else
  3683. eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  3684. fi
  3685. done
  3686. # This variable tells wrapper scripts just to set shlibpath_var
  3687. # rather than running their programs.
  3688. libtool_execute_magic=$magic
  3689. # Check if any of the arguments is a wrapper script.
  3690. args=
  3691. for file
  3692. do
  3693. case $file in
  3694. -* | *.la | *.lo ) ;;
  3695. *)
  3696. # Do a test to see if this is really a libtool program.
  3697. if func_ltwrapper_script_p "$file"; then
  3698. func_source "$file"
  3699. # Transform arg to wrapped name.
  3700. file=$progdir/$program
  3701. elif func_ltwrapper_executable_p "$file"; then
  3702. func_ltwrapper_scriptname "$file"
  3703. func_source "$func_ltwrapper_scriptname_result"
  3704. # Transform arg to wrapped name.
  3705. file=$progdir/$program
  3706. fi
  3707. ;;
  3708. esac
  3709. # Quote arguments (to preserve shell metacharacters).
  3710. func_append_quoted args "$file"
  3711. done
  3712. if $opt_dry_run; then
  3713. # Display what would be done.
  3714. if test -n "$shlibpath_var"; then
  3715. eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  3716. echo "export $shlibpath_var"
  3717. fi
  3718. $ECHO "$cmd$args"
  3719. exit $EXIT_SUCCESS
  3720. else
  3721. if test -n "$shlibpath_var"; then
  3722. # Export the shlibpath_var.
  3723. eval "export $shlibpath_var"
  3724. fi
  3725. # Restore saved environment variables
  3726. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  3727. do
  3728. eval "if test \"\${save_$lt_var+set}\" = set; then
  3729. $lt_var=\$save_$lt_var; export $lt_var
  3730. else
  3731. $lt_unset $lt_var
  3732. fi"
  3733. done
  3734. # Now prepare to actually exec the command.
  3735. exec_cmd=\$cmd$args
  3736. fi
  3737. }
  3738. test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
  3739. # func_mode_finish arg...
  3740. func_mode_finish ()
  3741. {
  3742. $debug_cmd
  3743. libs=
  3744. libdirs=
  3745. admincmds=
  3746. for opt in "$nonopt" ${1+"$@"}
  3747. do
  3748. if test -d "$opt"; then
  3749. func_append libdirs " $opt"
  3750. elif test -f "$opt"; then
  3751. if func_lalib_unsafe_p "$opt"; then
  3752. func_append libs " $opt"
  3753. else
  3754. func_warning "'$opt' is not a valid libtool archive"
  3755. fi
  3756. else
  3757. func_fatal_error "invalid argument '$opt'"
  3758. fi
  3759. done
  3760. if test -n "$libs"; then
  3761. if test -n "$lt_sysroot"; then
  3762. sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
  3763. sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
  3764. else
  3765. sysroot_cmd=
  3766. fi
  3767. # Remove sysroot references
  3768. if $opt_dry_run; then
  3769. for lib in $libs; do
  3770. echo "removing references to $lt_sysroot and '=' prefixes from $lib"
  3771. done
  3772. else
  3773. tmpdir=`func_mktempdir`
  3774. for lib in $libs; do
  3775. $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
  3776. > $tmpdir/tmp-la
  3777. mv -f $tmpdir/tmp-la $lib
  3778. done
  3779. ${RM}r "$tmpdir"
  3780. fi
  3781. fi
  3782. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3783. for libdir in $libdirs; do
  3784. if test -n "$finish_cmds"; then
  3785. # Do each command in the finish commands.
  3786. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  3787. '"$cmd"'"'
  3788. fi
  3789. if test -n "$finish_eval"; then
  3790. # Do the single finish_eval.
  3791. eval cmds=\"$finish_eval\"
  3792. $opt_dry_run || eval "$cmds" || func_append admincmds "
  3793. $cmds"
  3794. fi
  3795. done
  3796. fi
  3797. # Exit here if they wanted silent mode.
  3798. $opt_quiet && exit $EXIT_SUCCESS
  3799. if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  3800. echo "----------------------------------------------------------------------"
  3801. echo "Libraries have been installed in:"
  3802. for libdir in $libdirs; do
  3803. $ECHO " $libdir"
  3804. done
  3805. echo
  3806. echo "If you ever happen to want to link against installed libraries"
  3807. echo "in a given directory, LIBDIR, you must either use libtool, and"
  3808. echo "specify the full pathname of the library, or use the '-LLIBDIR'"
  3809. echo "flag during linking and do at least one of the following:"
  3810. if test -n "$shlibpath_var"; then
  3811. echo " - add LIBDIR to the '$shlibpath_var' environment variable"
  3812. echo " during execution"
  3813. fi
  3814. if test -n "$runpath_var"; then
  3815. echo " - add LIBDIR to the '$runpath_var' environment variable"
  3816. echo " during linking"
  3817. fi
  3818. if test -n "$hardcode_libdir_flag_spec"; then
  3819. libdir=LIBDIR
  3820. eval flag=\"$hardcode_libdir_flag_spec\"
  3821. $ECHO " - use the '$flag' linker flag"
  3822. fi
  3823. if test -n "$admincmds"; then
  3824. $ECHO " - have your system administrator run these commands:$admincmds"
  3825. fi
  3826. if test -f /etc/ld.so.conf; then
  3827. echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
  3828. fi
  3829. echo
  3830. echo "See any operating system documentation about shared libraries for"
  3831. case $host in
  3832. solaris2.[6789]|solaris2.1[0-9])
  3833. echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  3834. echo "pages."
  3835. ;;
  3836. *)
  3837. echo "more information, such as the ld(1) and ld.so(8) manual pages."
  3838. ;;
  3839. esac
  3840. echo "----------------------------------------------------------------------"
  3841. fi
  3842. exit $EXIT_SUCCESS
  3843. }
  3844. test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
  3845. # func_mode_install arg...
  3846. func_mode_install ()
  3847. {
  3848. $debug_cmd
  3849. # There may be an optional sh(1) argument at the beginning of
  3850. # install_prog (especially on Windows NT).
  3851. if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
  3852. # Allow the use of GNU shtool's install command.
  3853. case $nonopt in *shtool*) :;; *) false;; esac
  3854. then
  3855. # Aesthetically quote it.
  3856. func_quote_for_eval "$nonopt"
  3857. install_prog="$func_quote_for_eval_result "
  3858. arg=$1
  3859. shift
  3860. else
  3861. install_prog=
  3862. arg=$nonopt
  3863. fi
  3864. # The real first argument should be the name of the installation program.
  3865. # Aesthetically quote it.
  3866. func_quote_for_eval "$arg"
  3867. func_append install_prog "$func_quote_for_eval_result"
  3868. install_shared_prog=$install_prog
  3869. case " $install_prog " in
  3870. *[\\\ /]cp\ *) install_cp=: ;;
  3871. *) install_cp=false ;;
  3872. esac
  3873. # We need to accept at least all the BSD install flags.
  3874. dest=
  3875. files=
  3876. opts=
  3877. prev=
  3878. install_type=
  3879. isdir=false
  3880. stripme=
  3881. no_mode=:
  3882. for arg
  3883. do
  3884. arg2=
  3885. if test -n "$dest"; then
  3886. func_append files " $dest"
  3887. dest=$arg
  3888. continue
  3889. fi
  3890. case $arg in
  3891. -d) isdir=: ;;
  3892. -f)
  3893. if $install_cp; then :; else
  3894. prev=$arg
  3895. fi
  3896. ;;
  3897. -g | -m | -o)
  3898. prev=$arg
  3899. ;;
  3900. -s)
  3901. stripme=" -s"
  3902. continue
  3903. ;;
  3904. -*)
  3905. ;;
  3906. *)
  3907. # If the previous option needed an argument, then skip it.
  3908. if test -n "$prev"; then
  3909. if test X-m = "X$prev" && test -n "$install_override_mode"; then
  3910. arg2=$install_override_mode
  3911. no_mode=false
  3912. fi
  3913. prev=
  3914. else
  3915. dest=$arg
  3916. continue
  3917. fi
  3918. ;;
  3919. esac
  3920. # Aesthetically quote the argument.
  3921. func_quote_for_eval "$arg"
  3922. func_append install_prog " $func_quote_for_eval_result"
  3923. if test -n "$arg2"; then
  3924. func_quote_for_eval "$arg2"
  3925. fi
  3926. func_append install_shared_prog " $func_quote_for_eval_result"
  3927. done
  3928. test -z "$install_prog" && \
  3929. func_fatal_help "you must specify an install program"
  3930. test -n "$prev" && \
  3931. func_fatal_help "the '$prev' option requires an argument"
  3932. if test -n "$install_override_mode" && $no_mode; then
  3933. if $install_cp; then :; else
  3934. func_quote_for_eval "$install_override_mode"
  3935. func_append install_shared_prog " -m $func_quote_for_eval_result"
  3936. fi
  3937. fi
  3938. if test -z "$files"; then
  3939. if test -z "$dest"; then
  3940. func_fatal_help "no file or destination specified"
  3941. else
  3942. func_fatal_help "you must specify a destination"
  3943. fi
  3944. fi
  3945. # Strip any trailing slash from the destination.
  3946. func_stripname '' '/' "$dest"
  3947. dest=$func_stripname_result
  3948. # Check to see that the destination is a directory.
  3949. test -d "$dest" && isdir=:
  3950. if $isdir; then
  3951. destdir=$dest
  3952. destname=
  3953. else
  3954. func_dirname_and_basename "$dest" "" "."
  3955. destdir=$func_dirname_result
  3956. destname=$func_basename_result
  3957. # Not a directory, so check to see that there is only one file specified.
  3958. set dummy $files; shift
  3959. test "$#" -gt 1 && \
  3960. func_fatal_help "'$dest' is not a directory"
  3961. fi
  3962. case $destdir in
  3963. [\\/]* | [A-Za-z]:[\\/]*) ;;
  3964. *)
  3965. for file in $files; do
  3966. case $file in
  3967. *.lo) ;;
  3968. *)
  3969. func_fatal_help "'$destdir' must be an absolute directory name"
  3970. ;;
  3971. esac
  3972. done
  3973. ;;
  3974. esac
  3975. # This variable tells wrapper scripts just to set variables rather
  3976. # than running their programs.
  3977. libtool_install_magic=$magic
  3978. staticlibs=
  3979. future_libdirs=
  3980. current_libdirs=
  3981. for file in $files; do
  3982. # Do each installation.
  3983. case $file in
  3984. *.$libext)
  3985. # Do the static libraries later.
  3986. func_append staticlibs " $file"
  3987. ;;
  3988. *.la)
  3989. func_resolve_sysroot "$file"
  3990. file=$func_resolve_sysroot_result
  3991. # Check to see that this really is a libtool archive.
  3992. func_lalib_unsafe_p "$file" \
  3993. || func_fatal_help "'$file' is not a valid libtool archive"
  3994. library_names=
  3995. old_library=
  3996. relink_command=
  3997. func_source "$file"
  3998. # Add the libdir to current_libdirs if it is the destination.
  3999. if test "X$destdir" = "X$libdir"; then
  4000. case "$current_libdirs " in
  4001. *" $libdir "*) ;;
  4002. *) func_append current_libdirs " $libdir" ;;
  4003. esac
  4004. else
  4005. # Note the libdir as a future libdir.
  4006. case "$future_libdirs " in
  4007. *" $libdir "*) ;;
  4008. *) func_append future_libdirs " $libdir" ;;
  4009. esac
  4010. fi
  4011. func_dirname "$file" "/" ""
  4012. dir=$func_dirname_result
  4013. func_append dir "$objdir"
  4014. if test -n "$relink_command"; then
  4015. # Strip any trailing slash from the destination.
  4016. func_stripname '' '/' "$libdir"
  4017. destlibdir=$func_stripname_result
  4018. func_stripname '' '/' "$destdir"
  4019. s_destdir=$func_stripname_result
  4020. # Determine the prefix the user has applied to our future dir.
  4021. inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
  4022. # Don't allow the user to place us outside of our expected
  4023. # location b/c this prevents finding dependent libraries that
  4024. # are installed to the same prefix.
  4025. # At present, this check doesn't affect windows .dll's that
  4026. # are installed into $libdir/../bin (currently, that works fine)
  4027. # but it's something to keep an eye on.
  4028. test "$inst_prefix_dir" = "$destdir" && \
  4029. func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
  4030. if test -n "$inst_prefix_dir"; then
  4031. # Stick the inst_prefix_dir data into the link command.
  4032. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  4033. else
  4034. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
  4035. fi
  4036. func_warning "relinking '$file'"
  4037. func_show_eval "$relink_command" \
  4038. 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
  4039. fi
  4040. # See the names of the shared library.
  4041. set dummy $library_names; shift
  4042. if test -n "$1"; then
  4043. realname=$1
  4044. shift
  4045. srcname=$realname
  4046. test -n "$relink_command" && srcname=${realname}T
  4047. # Install the shared library and build the symlinks.
  4048. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
  4049. 'exit $?'
  4050. tstripme=$stripme
  4051. case $host_os in
  4052. cygwin* | mingw* | pw32* | cegcc*)
  4053. case $realname in
  4054. *.dll.a)
  4055. tstripme=
  4056. ;;
  4057. esac
  4058. ;;
  4059. os2*)
  4060. case $realname in
  4061. *_dll.a)
  4062. tstripme=
  4063. ;;
  4064. esac
  4065. ;;
  4066. esac
  4067. if test -n "$tstripme" && test -n "$striplib"; then
  4068. func_show_eval "$striplib $destdir/$realname" 'exit $?'
  4069. fi
  4070. if test "$#" -gt 0; then
  4071. # Delete the old symlinks, and create new ones.
  4072. # Try 'ln -sf' first, because the 'ln' binary might depend on
  4073. # the symlink we replace! Solaris /bin/ln does not understand -f,
  4074. # so we also need to try rm && ln -s.
  4075. for linkname
  4076. do
  4077. test "$linkname" != "$realname" \
  4078. && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  4079. done
  4080. fi
  4081. # Do each command in the postinstall commands.
  4082. lib=$destdir/$realname
  4083. func_execute_cmds "$postinstall_cmds" 'exit $?'
  4084. fi
  4085. # Install the pseudo-library for information purposes.
  4086. func_basename "$file"
  4087. name=$func_basename_result
  4088. instname=$dir/${name}i
  4089. func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  4090. # Maybe install the static library, too.
  4091. test -n "$old_library" && func_append staticlibs " $dir/$old_library"
  4092. ;;
  4093. *.lo)
  4094. # Install (i.e. copy) a libtool object.
  4095. # Figure out destination file name, if it wasn't already specified.
  4096. if test -n "$destname"; then
  4097. destfile=$destdir/$destname
  4098. else
  4099. func_basename "$file"
  4100. destfile=$func_basename_result
  4101. destfile=$destdir/$destfile
  4102. fi
  4103. # Deduce the name of the destination old-style object file.
  4104. case $destfile in
  4105. *.lo)
  4106. func_lo2o "$destfile"
  4107. staticdest=$func_lo2o_result
  4108. ;;
  4109. *.$objext)
  4110. staticdest=$destfile
  4111. destfile=
  4112. ;;
  4113. *)
  4114. func_fatal_help "cannot copy a libtool object to '$destfile'"
  4115. ;;
  4116. esac
  4117. # Install the libtool object if requested.
  4118. test -n "$destfile" && \
  4119. func_show_eval "$install_prog $file $destfile" 'exit $?'
  4120. # Install the old object if enabled.
  4121. if test yes = "$build_old_libs"; then
  4122. # Deduce the name of the old-style object file.
  4123. func_lo2o "$file"
  4124. staticobj=$func_lo2o_result
  4125. func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  4126. fi
  4127. exit $EXIT_SUCCESS
  4128. ;;
  4129. *)
  4130. # Figure out destination file name, if it wasn't already specified.
  4131. if test -n "$destname"; then
  4132. destfile=$destdir/$destname
  4133. else
  4134. func_basename "$file"
  4135. destfile=$func_basename_result
  4136. destfile=$destdir/$destfile
  4137. fi
  4138. # If the file is missing, and there is a .exe on the end, strip it
  4139. # because it is most likely a libtool script we actually want to
  4140. # install
  4141. stripped_ext=
  4142. case $file in
  4143. *.exe)
  4144. if test ! -f "$file"; then
  4145. func_stripname '' '.exe' "$file"
  4146. file=$func_stripname_result
  4147. stripped_ext=.exe
  4148. fi
  4149. ;;
  4150. esac
  4151. # Do a test to see if this is really a libtool program.
  4152. case $host in
  4153. *cygwin* | *mingw*)
  4154. if func_ltwrapper_executable_p "$file"; then
  4155. func_ltwrapper_scriptname "$file"
  4156. wrapper=$func_ltwrapper_scriptname_result
  4157. else
  4158. func_stripname '' '.exe' "$file"
  4159. wrapper=$func_stripname_result
  4160. fi
  4161. ;;
  4162. *)
  4163. wrapper=$file
  4164. ;;
  4165. esac
  4166. if func_ltwrapper_script_p "$wrapper"; then
  4167. notinst_deplibs=
  4168. relink_command=
  4169. func_source "$wrapper"
  4170. # Check the variables that should have been set.
  4171. test -z "$generated_by_libtool_version" && \
  4172. func_fatal_error "invalid libtool wrapper script '$wrapper'"
  4173. finalize=:
  4174. for lib in $notinst_deplibs; do
  4175. # Check to see that each library is installed.
  4176. libdir=
  4177. if test -f "$lib"; then
  4178. func_source "$lib"
  4179. fi
  4180. libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
  4181. if test -n "$libdir" && test ! -f "$libfile"; then
  4182. func_warning "'$lib' has not been installed in '$libdir'"
  4183. finalize=false
  4184. fi
  4185. done
  4186. relink_command=
  4187. func_source "$wrapper"
  4188. outputname=
  4189. if test no = "$fast_install" && test -n "$relink_command"; then
  4190. $opt_dry_run || {
  4191. if $finalize; then
  4192. tmpdir=`func_mktempdir`
  4193. func_basename "$file$stripped_ext"
  4194. file=$func_basename_result
  4195. outputname=$tmpdir/$file
  4196. # Replace the output file specification.
  4197. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
  4198. $opt_quiet || {
  4199. func_quote_for_expand "$relink_command"
  4200. eval "func_echo $func_quote_for_expand_result"
  4201. }
  4202. if eval "$relink_command"; then :
  4203. else
  4204. func_error "error: relink '$file' with the above command before installing it"
  4205. $opt_dry_run || ${RM}r "$tmpdir"
  4206. continue
  4207. fi
  4208. file=$outputname
  4209. else
  4210. func_warning "cannot relink '$file'"
  4211. fi
  4212. }
  4213. else
  4214. # Install the binary that we compiled earlier.
  4215. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
  4216. fi
  4217. fi
  4218. # remove .exe since cygwin /usr/bin/install will append another
  4219. # one anyway
  4220. case $install_prog,$host in
  4221. */usr/bin/install*,*cygwin*)
  4222. case $file:$destfile in
  4223. *.exe:*.exe)
  4224. # this is ok
  4225. ;;
  4226. *.exe:*)
  4227. destfile=$destfile.exe
  4228. ;;
  4229. *:*.exe)
  4230. func_stripname '' '.exe' "$destfile"
  4231. destfile=$func_stripname_result
  4232. ;;
  4233. esac
  4234. ;;
  4235. esac
  4236. func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  4237. $opt_dry_run || if test -n "$outputname"; then
  4238. ${RM}r "$tmpdir"
  4239. fi
  4240. ;;
  4241. esac
  4242. done
  4243. for file in $staticlibs; do
  4244. func_basename "$file"
  4245. name=$func_basename_result
  4246. # Set up the ranlib parameters.
  4247. oldlib=$destdir/$name
  4248. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  4249. tool_oldlib=$func_to_tool_file_result
  4250. func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  4251. if test -n "$stripme" && test -n "$old_striplib"; then
  4252. func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
  4253. fi
  4254. # Do each command in the postinstall commands.
  4255. func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  4256. done
  4257. test -n "$future_libdirs" && \
  4258. func_warning "remember to run '$progname --finish$future_libdirs'"
  4259. if test -n "$current_libdirs"; then
  4260. # Maybe just do a dry run.
  4261. $opt_dry_run && current_libdirs=" -n$current_libdirs"
  4262. exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
  4263. else
  4264. exit $EXIT_SUCCESS
  4265. fi
  4266. }
  4267. test install = "$opt_mode" && func_mode_install ${1+"$@"}
  4268. # func_generate_dlsyms outputname originator pic_p
  4269. # Extract symbols from dlprefiles and create ${outputname}S.o with
  4270. # a dlpreopen symbol table.
  4271. func_generate_dlsyms ()
  4272. {
  4273. $debug_cmd
  4274. my_outputname=$1
  4275. my_originator=$2
  4276. my_pic_p=${3-false}
  4277. my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
  4278. my_dlsyms=
  4279. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  4280. if test -n "$NM" && test -n "$global_symbol_pipe"; then
  4281. my_dlsyms=${my_outputname}S.c
  4282. else
  4283. func_error "not configured to extract global symbols from dlpreopened files"
  4284. fi
  4285. fi
  4286. if test -n "$my_dlsyms"; then
  4287. case $my_dlsyms in
  4288. "") ;;
  4289. *.c)
  4290. # Discover the nlist of each of the dlfiles.
  4291. nlist=$output_objdir/$my_outputname.nm
  4292. func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  4293. # Parse the name list into a source file.
  4294. func_verbose "creating $output_objdir/$my_dlsyms"
  4295. $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  4296. /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
  4297. /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
  4298. #ifdef __cplusplus
  4299. extern \"C\" {
  4300. #endif
  4301. #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
  4302. #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
  4303. #endif
  4304. /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
  4305. #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
  4306. /* DATA imports from DLLs on WIN32 can't be const, because runtime
  4307. relocations are performed -- see ld's documentation on pseudo-relocs. */
  4308. # define LT_DLSYM_CONST
  4309. #elif defined __osf__
  4310. /* This system does not cope well with relocations in const data. */
  4311. # define LT_DLSYM_CONST
  4312. #else
  4313. # define LT_DLSYM_CONST const
  4314. #endif
  4315. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  4316. /* External symbol declarations for the compiler. */\
  4317. "
  4318. if test yes = "$dlself"; then
  4319. func_verbose "generating symbol list for '$output'"
  4320. $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  4321. # Add our own program objects to the symbol list.
  4322. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  4323. for progfile in $progfiles; do
  4324. func_to_tool_file "$progfile" func_convert_file_msys_to_w32
  4325. func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
  4326. $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
  4327. done
  4328. if test -n "$exclude_expsyms"; then
  4329. $opt_dry_run || {
  4330. eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  4331. eval '$MV "$nlist"T "$nlist"'
  4332. }
  4333. fi
  4334. if test -n "$export_symbols_regex"; then
  4335. $opt_dry_run || {
  4336. eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  4337. eval '$MV "$nlist"T "$nlist"'
  4338. }
  4339. fi
  4340. # Prepare the list of exported symbols
  4341. if test -z "$export_symbols"; then
  4342. export_symbols=$output_objdir/$outputname.exp
  4343. $opt_dry_run || {
  4344. $RM $export_symbols
  4345. eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  4346. case $host in
  4347. *cygwin* | *mingw* | *cegcc* )
  4348. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4349. eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  4350. ;;
  4351. esac
  4352. }
  4353. else
  4354. $opt_dry_run || {
  4355. eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  4356. eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  4357. eval '$MV "$nlist"T "$nlist"'
  4358. case $host in
  4359. *cygwin* | *mingw* | *cegcc* )
  4360. eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  4361. eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  4362. ;;
  4363. esac
  4364. }
  4365. fi
  4366. fi
  4367. for dlprefile in $dlprefiles; do
  4368. func_verbose "extracting global C symbols from '$dlprefile'"
  4369. func_basename "$dlprefile"
  4370. name=$func_basename_result
  4371. case $host in
  4372. *cygwin* | *mingw* | *cegcc* )
  4373. # if an import library, we need to obtain dlname
  4374. if func_win32_import_lib_p "$dlprefile"; then
  4375. func_tr_sh "$dlprefile"
  4376. eval "curr_lafile=\$libfile_$func_tr_sh_result"
  4377. dlprefile_dlbasename=
  4378. if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
  4379. # Use subshell, to avoid clobbering current variable values
  4380. dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
  4381. if test -n "$dlprefile_dlname"; then
  4382. func_basename "$dlprefile_dlname"
  4383. dlprefile_dlbasename=$func_basename_result
  4384. else
  4385. # no lafile. user explicitly requested -dlpreopen <import library>.
  4386. $sharedlib_from_linklib_cmd "$dlprefile"
  4387. dlprefile_dlbasename=$sharedlib_from_linklib_result
  4388. fi
  4389. fi
  4390. $opt_dry_run || {
  4391. if test -n "$dlprefile_dlbasename"; then
  4392. eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
  4393. else
  4394. func_warning "Could not compute DLL name from $name"
  4395. eval '$ECHO ": $name " >> "$nlist"'
  4396. fi
  4397. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4398. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
  4399. $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
  4400. }
  4401. else # not an import lib
  4402. $opt_dry_run || {
  4403. eval '$ECHO ": $name " >> "$nlist"'
  4404. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4405. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4406. }
  4407. fi
  4408. ;;
  4409. *)
  4410. $opt_dry_run || {
  4411. eval '$ECHO ": $name " >> "$nlist"'
  4412. func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
  4413. eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  4414. }
  4415. ;;
  4416. esac
  4417. done
  4418. $opt_dry_run || {
  4419. # Make sure we have at least an empty file.
  4420. test -f "$nlist" || : > "$nlist"
  4421. if test -n "$exclude_expsyms"; then
  4422. $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  4423. $MV "$nlist"T "$nlist"
  4424. fi
  4425. # Try sorting and uniquifying the output.
  4426. if $GREP -v "^: " < "$nlist" |
  4427. if sort -k 3 </dev/null >/dev/null 2>&1; then
  4428. sort -k 3
  4429. else
  4430. sort +2
  4431. fi |
  4432. uniq > "$nlist"S; then
  4433. :
  4434. else
  4435. $GREP -v "^: " < "$nlist" > "$nlist"S
  4436. fi
  4437. if test -f "$nlist"S; then
  4438. eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  4439. else
  4440. echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
  4441. fi
  4442. func_show_eval '$RM "${nlist}I"'
  4443. if test -n "$global_symbol_to_import"; then
  4444. eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
  4445. fi
  4446. echo >> "$output_objdir/$my_dlsyms" "\
  4447. /* The mapping between symbol names and symbols. */
  4448. typedef struct {
  4449. const char *name;
  4450. void *address;
  4451. } lt_dlsymlist;
  4452. extern LT_DLSYM_CONST lt_dlsymlist
  4453. lt_${my_prefix}_LTX_preloaded_symbols[];\
  4454. "
  4455. if test -s "$nlist"I; then
  4456. echo >> "$output_objdir/$my_dlsyms" "\
  4457. static void lt_syminit(void)
  4458. {
  4459. LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
  4460. for (; symbol->name; ++symbol)
  4461. {"
  4462. $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
  4463. echo >> "$output_objdir/$my_dlsyms" "\
  4464. }
  4465. }"
  4466. fi
  4467. echo >> "$output_objdir/$my_dlsyms" "\
  4468. LT_DLSYM_CONST lt_dlsymlist
  4469. lt_${my_prefix}_LTX_preloaded_symbols[] =
  4470. { {\"$my_originator\", (void *) 0},"
  4471. if test -s "$nlist"I; then
  4472. echo >> "$output_objdir/$my_dlsyms" "\
  4473. {\"@INIT@\", (void *) &lt_syminit},"
  4474. fi
  4475. case $need_lib_prefix in
  4476. no)
  4477. eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4478. ;;
  4479. *)
  4480. eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  4481. ;;
  4482. esac
  4483. echo >> "$output_objdir/$my_dlsyms" "\
  4484. {0, (void *) 0}
  4485. };
  4486. /* This works around a problem in FreeBSD linker */
  4487. #ifdef FREEBSD_WORKAROUND
  4488. static const void *lt_preloaded_setup() {
  4489. return lt_${my_prefix}_LTX_preloaded_symbols;
  4490. }
  4491. #endif
  4492. #ifdef __cplusplus
  4493. }
  4494. #endif\
  4495. "
  4496. } # !$opt_dry_run
  4497. pic_flag_for_symtable=
  4498. case "$compile_command " in
  4499. *" -static "*) ;;
  4500. *)
  4501. case $host in
  4502. # compiling the symbol table file with pic_flag works around
  4503. # a FreeBSD bug that causes programs to crash when -lm is
  4504. # linked before any other PIC object. But we must not use
  4505. # pic_flag when linking with -static. The problem exists in
  4506. # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  4507. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  4508. pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  4509. *-*-hpux*)
  4510. pic_flag_for_symtable=" $pic_flag" ;;
  4511. *)
  4512. $my_pic_p && pic_flag_for_symtable=" $pic_flag"
  4513. ;;
  4514. esac
  4515. ;;
  4516. esac
  4517. symtab_cflags=
  4518. for arg in $LTCFLAGS; do
  4519. case $arg in
  4520. -pie | -fpie | -fPIE) ;;
  4521. *) func_append symtab_cflags " $arg" ;;
  4522. esac
  4523. done
  4524. # Now compile the dynamic symbol file.
  4525. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  4526. # Clean up the generated files.
  4527. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
  4528. # Transform the symbol file into the correct name.
  4529. symfileobj=$output_objdir/${my_outputname}S.$objext
  4530. case $host in
  4531. *cygwin* | *mingw* | *cegcc* )
  4532. if test -f "$output_objdir/$my_outputname.def"; then
  4533. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4534. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  4535. else
  4536. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4537. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4538. fi
  4539. ;;
  4540. *)
  4541. compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4542. finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
  4543. ;;
  4544. esac
  4545. ;;
  4546. *)
  4547. func_fatal_error "unknown suffix for '$my_dlsyms'"
  4548. ;;
  4549. esac
  4550. else
  4551. # We keep going just in case the user didn't refer to
  4552. # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  4553. # really was required.
  4554. # Nullify the symbol file.
  4555. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
  4556. finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
  4557. fi
  4558. }
  4559. # func_cygming_gnu_implib_p ARG
  4560. # This predicate returns with zero status (TRUE) if
  4561. # ARG is a GNU/binutils-style import library. Returns
  4562. # with nonzero status (FALSE) otherwise.
  4563. func_cygming_gnu_implib_p ()
  4564. {
  4565. $debug_cmd
  4566. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4567. func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
  4568. test -n "$func_cygming_gnu_implib_tmp"
  4569. }
  4570. # func_cygming_ms_implib_p ARG
  4571. # This predicate returns with zero status (TRUE) if
  4572. # ARG is an MS-style import library. Returns
  4573. # with nonzero status (FALSE) otherwise.
  4574. func_cygming_ms_implib_p ()
  4575. {
  4576. $debug_cmd
  4577. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4578. func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
  4579. test -n "$func_cygming_ms_implib_tmp"
  4580. }
  4581. # func_win32_libid arg
  4582. # return the library type of file 'arg'
  4583. #
  4584. # Need a lot of goo to handle *both* DLLs and import libs
  4585. # Has to be a shell function in order to 'eat' the argument
  4586. # that is supplied when $file_magic_command is called.
  4587. # Despite the name, also deal with 64 bit binaries.
  4588. func_win32_libid ()
  4589. {
  4590. $debug_cmd
  4591. win32_libid_type=unknown
  4592. win32_fileres=`file -L $1 2>/dev/null`
  4593. case $win32_fileres in
  4594. *ar\ archive\ import\ library*) # definitely import
  4595. win32_libid_type="x86 archive import"
  4596. ;;
  4597. *ar\ archive*) # could be an import, or static
  4598. # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
  4599. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  4600. $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
  4601. case $nm_interface in
  4602. "MS dumpbin")
  4603. if func_cygming_ms_implib_p "$1" ||
  4604. func_cygming_gnu_implib_p "$1"
  4605. then
  4606. win32_nmres=import
  4607. else
  4608. win32_nmres=
  4609. fi
  4610. ;;
  4611. *)
  4612. func_to_tool_file "$1" func_convert_file_msys_to_w32
  4613. win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
  4614. $SED -n -e '
  4615. 1,100{
  4616. / I /{
  4617. s|.*|import|
  4618. p
  4619. q
  4620. }
  4621. }'`
  4622. ;;
  4623. esac
  4624. case $win32_nmres in
  4625. import*) win32_libid_type="x86 archive import";;
  4626. *) win32_libid_type="x86 archive static";;
  4627. esac
  4628. fi
  4629. ;;
  4630. *DLL*)
  4631. win32_libid_type="x86 DLL"
  4632. ;;
  4633. *executable*) # but shell scripts are "executable" too...
  4634. case $win32_fileres in
  4635. *MS\ Windows\ PE\ Intel*)
  4636. win32_libid_type="x86 DLL"
  4637. ;;
  4638. esac
  4639. ;;
  4640. esac
  4641. $ECHO "$win32_libid_type"
  4642. }
  4643. # func_cygming_dll_for_implib ARG
  4644. #
  4645. # Platform-specific function to extract the
  4646. # name of the DLL associated with the specified
  4647. # import library ARG.
  4648. # Invoked by eval'ing the libtool variable
  4649. # $sharedlib_from_linklib_cmd
  4650. # Result is available in the variable
  4651. # $sharedlib_from_linklib_result
  4652. func_cygming_dll_for_implib ()
  4653. {
  4654. $debug_cmd
  4655. sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
  4656. }
  4657. # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
  4658. #
  4659. # The is the core of a fallback implementation of a
  4660. # platform-specific function to extract the name of the
  4661. # DLL associated with the specified import library LIBNAME.
  4662. #
  4663. # SECTION_NAME is either .idata$6 or .idata$7, depending
  4664. # on the platform and compiler that created the implib.
  4665. #
  4666. # Echos the name of the DLL associated with the
  4667. # specified import library.
  4668. func_cygming_dll_for_implib_fallback_core ()
  4669. {
  4670. $debug_cmd
  4671. match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
  4672. $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
  4673. $SED '/^Contents of section '"$match_literal"':/{
  4674. # Place marker at beginning of archive member dllname section
  4675. s/.*/====MARK====/
  4676. p
  4677. d
  4678. }
  4679. # These lines can sometimes be longer than 43 characters, but
  4680. # are always uninteresting
  4681. /:[ ]*file format pe[i]\{,1\}-/d
  4682. /^In archive [^:]*:/d
  4683. # Ensure marker is printed
  4684. /^====MARK====/p
  4685. # Remove all lines with less than 43 characters
  4686. /^.\{43\}/!d
  4687. # From remaining lines, remove first 43 characters
  4688. s/^.\{43\}//' |
  4689. $SED -n '
  4690. # Join marker and all lines until next marker into a single line
  4691. /^====MARK====/ b para
  4692. H
  4693. $ b para
  4694. b
  4695. :para
  4696. x
  4697. s/\n//g
  4698. # Remove the marker
  4699. s/^====MARK====//
  4700. # Remove trailing dots and whitespace
  4701. s/[\. \t]*$//
  4702. # Print
  4703. /./p' |
  4704. # we now have a list, one entry per line, of the stringified
  4705. # contents of the appropriate section of all members of the
  4706. # archive that possess that section. Heuristic: eliminate
  4707. # all those that have a first or second character that is
  4708. # a '.' (that is, objdump's representation of an unprintable
  4709. # character.) This should work for all archives with less than
  4710. # 0x302f exports -- but will fail for DLLs whose name actually
  4711. # begins with a literal '.' or a single character followed by
  4712. # a '.'.
  4713. #
  4714. # Of those that remain, print the first one.
  4715. $SED -e '/^\./d;/^.\./d;q'
  4716. }
  4717. # func_cygming_dll_for_implib_fallback ARG
  4718. # Platform-specific function to extract the
  4719. # name of the DLL associated with the specified
  4720. # import library ARG.
  4721. #
  4722. # This fallback implementation is for use when $DLLTOOL
  4723. # does not support the --identify-strict option.
  4724. # Invoked by eval'ing the libtool variable
  4725. # $sharedlib_from_linklib_cmd
  4726. # Result is available in the variable
  4727. # $sharedlib_from_linklib_result
  4728. func_cygming_dll_for_implib_fallback ()
  4729. {
  4730. $debug_cmd
  4731. if func_cygming_gnu_implib_p "$1"; then
  4732. # binutils import library
  4733. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
  4734. elif func_cygming_ms_implib_p "$1"; then
  4735. # ms-generated import library
  4736. sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
  4737. else
  4738. # unknown
  4739. sharedlib_from_linklib_result=
  4740. fi
  4741. }
  4742. # func_extract_an_archive dir oldlib
  4743. func_extract_an_archive ()
  4744. {
  4745. $debug_cmd
  4746. f_ex_an_ar_dir=$1; shift
  4747. f_ex_an_ar_oldlib=$1
  4748. if test yes = "$lock_old_archive_extraction"; then
  4749. lockfile=$f_ex_an_ar_oldlib.lock
  4750. until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  4751. func_echo "Waiting for $lockfile to be removed"
  4752. sleep 2
  4753. done
  4754. fi
  4755. func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
  4756. 'stat=$?; rm -f "$lockfile"; exit $stat'
  4757. if test yes = "$lock_old_archive_extraction"; then
  4758. $opt_dry_run || rm -f "$lockfile"
  4759. fi
  4760. if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  4761. :
  4762. else
  4763. func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  4764. fi
  4765. }
  4766. # func_extract_archives gentop oldlib ...
  4767. func_extract_archives ()
  4768. {
  4769. $debug_cmd
  4770. my_gentop=$1; shift
  4771. my_oldlibs=${1+"$@"}
  4772. my_oldobjs=
  4773. my_xlib=
  4774. my_xabs=
  4775. my_xdir=
  4776. for my_xlib in $my_oldlibs; do
  4777. # Extract the objects.
  4778. case $my_xlib in
  4779. [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
  4780. *) my_xabs=`pwd`"/$my_xlib" ;;
  4781. esac
  4782. func_basename "$my_xlib"
  4783. my_xlib=$func_basename_result
  4784. my_xlib_u=$my_xlib
  4785. while :; do
  4786. case " $extracted_archives " in
  4787. *" $my_xlib_u "*)
  4788. func_arith $extracted_serial + 1
  4789. extracted_serial=$func_arith_result
  4790. my_xlib_u=lt$extracted_serial-$my_xlib ;;
  4791. *) break ;;
  4792. esac
  4793. done
  4794. extracted_archives="$extracted_archives $my_xlib_u"
  4795. my_xdir=$my_gentop/$my_xlib_u
  4796. func_mkdir_p "$my_xdir"
  4797. case $host in
  4798. *-darwin*)
  4799. func_verbose "Extracting $my_xabs"
  4800. # Do not bother doing anything if just a dry run
  4801. $opt_dry_run || {
  4802. darwin_orig_dir=`pwd`
  4803. cd $my_xdir || exit $?
  4804. darwin_archive=$my_xabs
  4805. darwin_curdir=`pwd`
  4806. func_basename "$darwin_archive"
  4807. darwin_base_archive=$func_basename_result
  4808. darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  4809. if test -n "$darwin_arches"; then
  4810. darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  4811. darwin_arch=
  4812. func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  4813. for darwin_arch in $darwin_arches; do
  4814. func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
  4815. $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
  4816. cd "unfat-$$/$darwin_base_archive-$darwin_arch"
  4817. func_extract_an_archive "`pwd`" "$darwin_base_archive"
  4818. cd "$darwin_curdir"
  4819. $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
  4820. done # $darwin_arches
  4821. ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  4822. darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
  4823. darwin_file=
  4824. darwin_files=
  4825. for darwin_file in $darwin_filelist; do
  4826. darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
  4827. $LIPO -create -output "$darwin_file" $darwin_files
  4828. done # $darwin_filelist
  4829. $RM -rf unfat-$$
  4830. cd "$darwin_orig_dir"
  4831. else
  4832. cd $darwin_orig_dir
  4833. func_extract_an_archive "$my_xdir" "$my_xabs"
  4834. fi # $darwin_arches
  4835. } # !$opt_dry_run
  4836. ;;
  4837. *)
  4838. func_extract_an_archive "$my_xdir" "$my_xabs"
  4839. ;;
  4840. esac
  4841. my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
  4842. done
  4843. func_extract_archives_result=$my_oldobjs
  4844. }
  4845. # func_emit_wrapper [arg=no]
  4846. #
  4847. # Emit a libtool wrapper script on stdout.
  4848. # Don't directly open a file because we may want to
  4849. # incorporate the script contents within a cygwin/mingw
  4850. # wrapper executable. Must ONLY be called from within
  4851. # func_mode_link because it depends on a number of variables
  4852. # set therein.
  4853. #
  4854. # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  4855. # variable will take. If 'yes', then the emitted script
  4856. # will assume that the directory where it is stored is
  4857. # the $objdir directory. This is a cygwin/mingw-specific
  4858. # behavior.
  4859. func_emit_wrapper ()
  4860. {
  4861. func_emit_wrapper_arg1=${1-no}
  4862. $ECHO "\
  4863. #! $SHELL
  4864. # $output - temporary wrapper script for $objdir/$outputname
  4865. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  4866. #
  4867. # The $output program cannot be directly executed until all the libtool
  4868. # libraries that it depends on are installed.
  4869. #
  4870. # This wrapper script should never be moved out of the build directory.
  4871. # If it is, it will not operate correctly.
  4872. # Sed substitution that helps us do robust quoting. It backslashifies
  4873. # metacharacters that are still active within double-quoted strings.
  4874. sed_quote_subst='$sed_quote_subst'
  4875. # Be Bourne compatible
  4876. if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  4877. emulate sh
  4878. NULLCMD=:
  4879. # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  4880. # is contrary to our usage. Disable this feature.
  4881. alias -g '\${1+\"\$@\"}'='\"\$@\"'
  4882. setopt NO_GLOB_SUBST
  4883. else
  4884. case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  4885. fi
  4886. BIN_SH=xpg4; export BIN_SH # for Tru64
  4887. DUALCASE=1; export DUALCASE # for MKS sh
  4888. # The HP-UX ksh and POSIX shell print the target directory to stdout
  4889. # if CDPATH is set.
  4890. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  4891. relink_command=\"$relink_command\"
  4892. # This environment variable determines our operation mode.
  4893. if test \"\$libtool_install_magic\" = \"$magic\"; then
  4894. # install mode needs the following variables:
  4895. generated_by_libtool_version='$macro_version'
  4896. notinst_deplibs='$notinst_deplibs'
  4897. else
  4898. # When we are sourced in execute mode, \$file and \$ECHO are already set.
  4899. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  4900. file=\"\$0\""
  4901. qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
  4902. $ECHO "\
  4903. # A function that is used when there is no print builtin or printf.
  4904. func_fallback_echo ()
  4905. {
  4906. eval 'cat <<_LTECHO_EOF
  4907. \$1
  4908. _LTECHO_EOF'
  4909. }
  4910. ECHO=\"$qECHO\"
  4911. fi
  4912. # Very basic option parsing. These options are (a) specific to
  4913. # the libtool wrapper, (b) are identical between the wrapper
  4914. # /script/ and the wrapper /executable/ that is used only on
  4915. # windows platforms, and (c) all begin with the string "--lt-"
  4916. # (application programs are unlikely to have options that match
  4917. # this pattern).
  4918. #
  4919. # There are only two supported options: --lt-debug and
  4920. # --lt-dump-script. There is, deliberately, no --lt-help.
  4921. #
  4922. # The first argument to this parsing function should be the
  4923. # script's $0 value, followed by "$@".
  4924. lt_option_debug=
  4925. func_parse_lt_options ()
  4926. {
  4927. lt_script_arg0=\$0
  4928. shift
  4929. for lt_opt
  4930. do
  4931. case \"\$lt_opt\" in
  4932. --lt-debug) lt_option_debug=1 ;;
  4933. --lt-dump-script)
  4934. lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
  4935. test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
  4936. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
  4937. cat \"\$lt_dump_D/\$lt_dump_F\"
  4938. exit 0
  4939. ;;
  4940. --lt-*)
  4941. \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
  4942. exit 1
  4943. ;;
  4944. esac
  4945. done
  4946. # Print the debug banner immediately:
  4947. if test -n \"\$lt_option_debug\"; then
  4948. echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
  4949. fi
  4950. }
  4951. # Used when --lt-debug. Prints its arguments to stdout
  4952. # (redirection is the responsibility of the caller)
  4953. func_lt_dump_args ()
  4954. {
  4955. lt_dump_args_N=1;
  4956. for lt_arg
  4957. do
  4958. \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
  4959. lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
  4960. done
  4961. }
  4962. # Core function for launching the target application
  4963. func_exec_program_core ()
  4964. {
  4965. "
  4966. case $host in
  4967. # Backslashes separate directories on plain windows
  4968. *-*-mingw | *-*-os2* | *-cegcc*)
  4969. $ECHO "\
  4970. if test -n \"\$lt_option_debug\"; then
  4971. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
  4972. func_lt_dump_args \${1+\"\$@\"} 1>&2
  4973. fi
  4974. exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  4975. "
  4976. ;;
  4977. *)
  4978. $ECHO "\
  4979. if test -n \"\$lt_option_debug\"; then
  4980. \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
  4981. func_lt_dump_args \${1+\"\$@\"} 1>&2
  4982. fi
  4983. exec \"\$progdir/\$program\" \${1+\"\$@\"}
  4984. "
  4985. ;;
  4986. esac
  4987. $ECHO "\
  4988. \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  4989. exit 1
  4990. }
  4991. # A function to encapsulate launching the target application
  4992. # Strips options in the --lt-* namespace from \$@ and
  4993. # launches target application with the remaining arguments.
  4994. func_exec_program ()
  4995. {
  4996. case \" \$* \" in
  4997. *\\ --lt-*)
  4998. for lt_wr_arg
  4999. do
  5000. case \$lt_wr_arg in
  5001. --lt-*) ;;
  5002. *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
  5003. esac
  5004. shift
  5005. done ;;
  5006. esac
  5007. func_exec_program_core \${1+\"\$@\"}
  5008. }
  5009. # Parse options
  5010. func_parse_lt_options \"\$0\" \${1+\"\$@\"}
  5011. # Find the directory that this script lives in.
  5012. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
  5013. test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  5014. # Follow symbolic links until we get to the real thisdir.
  5015. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
  5016. while test -n \"\$file\"; do
  5017. destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
  5018. # If there was a directory component, then change thisdir.
  5019. if test \"x\$destdir\" != \"x\$file\"; then
  5020. case \"\$destdir\" in
  5021. [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  5022. *) thisdir=\"\$thisdir/\$destdir\" ;;
  5023. esac
  5024. fi
  5025. file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
  5026. file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
  5027. done
  5028. # Usually 'no', except on cygwin/mingw when embedded into
  5029. # the cwrapper.
  5030. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
  5031. if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  5032. # special case for '.'
  5033. if test \"\$thisdir\" = \".\"; then
  5034. thisdir=\`pwd\`
  5035. fi
  5036. # remove .libs from thisdir
  5037. case \"\$thisdir\" in
  5038. *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
  5039. $objdir ) thisdir=. ;;
  5040. esac
  5041. fi
  5042. # Try to get the absolute directory name.
  5043. absdir=\`cd \"\$thisdir\" && pwd\`
  5044. test -n \"\$absdir\" && thisdir=\"\$absdir\"
  5045. "
  5046. if test yes = "$fast_install"; then
  5047. $ECHO "\
  5048. program=lt-'$outputname'$exeext
  5049. progdir=\"\$thisdir/$objdir\"
  5050. if test ! -f \"\$progdir/\$program\" ||
  5051. { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
  5052. test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  5053. file=\"\$\$-\$program\"
  5054. if test ! -d \"\$progdir\"; then
  5055. $MKDIR \"\$progdir\"
  5056. else
  5057. $RM \"\$progdir/\$file\"
  5058. fi"
  5059. $ECHO "\
  5060. # relink executable if necessary
  5061. if test -n \"\$relink_command\"; then
  5062. if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  5063. else
  5064. \$ECHO \"\$relink_command_output\" >&2
  5065. $RM \"\$progdir/\$file\"
  5066. exit 1
  5067. fi
  5068. fi
  5069. $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  5070. { $RM \"\$progdir/\$program\";
  5071. $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  5072. $RM \"\$progdir/\$file\"
  5073. fi"
  5074. else
  5075. $ECHO "\
  5076. program='$outputname'
  5077. progdir=\"\$thisdir/$objdir\"
  5078. "
  5079. fi
  5080. $ECHO "\
  5081. if test -f \"\$progdir/\$program\"; then"
  5082. # fixup the dll searchpath if we need to.
  5083. #
  5084. # Fix the DLL searchpath if we need to. Do this before prepending
  5085. # to shlibpath, because on Windows, both are PATH and uninstalled
  5086. # libraries must come first.
  5087. if test -n "$dllsearchpath"; then
  5088. $ECHO "\
  5089. # Add the dll search path components to the executable PATH
  5090. PATH=$dllsearchpath:\$PATH
  5091. "
  5092. fi
  5093. # Export our shlibpath_var if we have one.
  5094. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5095. $ECHO "\
  5096. # Add our own library path to $shlibpath_var
  5097. $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  5098. # Some systems cannot cope with colon-terminated $shlibpath_var
  5099. # The second colon is a workaround for a bug in BeOS R4 sed
  5100. $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
  5101. export $shlibpath_var
  5102. "
  5103. fi
  5104. $ECHO "\
  5105. if test \"\$libtool_execute_magic\" != \"$magic\"; then
  5106. # Run the actual program with our arguments.
  5107. func_exec_program \${1+\"\$@\"}
  5108. fi
  5109. else
  5110. # The program doesn't exist.
  5111. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
  5112. \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  5113. \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  5114. exit 1
  5115. fi
  5116. fi\
  5117. "
  5118. }
  5119. # func_emit_cwrapperexe_src
  5120. # emit the source code for a wrapper executable on stdout
  5121. # Must ONLY be called from within func_mode_link because
  5122. # it depends on a number of variable set therein.
  5123. func_emit_cwrapperexe_src ()
  5124. {
  5125. cat <<EOF
  5126. /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  5127. Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  5128. The $output program cannot be directly executed until all the libtool
  5129. libraries that it depends on are installed.
  5130. This wrapper executable should never be moved out of the build directory.
  5131. If it is, it will not operate correctly.
  5132. */
  5133. EOF
  5134. cat <<"EOF"
  5135. #ifdef _MSC_VER
  5136. # define _CRT_SECURE_NO_DEPRECATE 1
  5137. #endif
  5138. #include <stdio.h>
  5139. #include <stdlib.h>
  5140. #ifdef _MSC_VER
  5141. # include <direct.h>
  5142. # include <process.h>
  5143. # include <io.h>
  5144. #else
  5145. # include <unistd.h>
  5146. # include <stdint.h>
  5147. # ifdef __CYGWIN__
  5148. # include <io.h>
  5149. # endif
  5150. #endif
  5151. #include <malloc.h>
  5152. #include <stdarg.h>
  5153. #include <assert.h>
  5154. #include <string.h>
  5155. #include <ctype.h>
  5156. #include <errno.h>
  5157. #include <fcntl.h>
  5158. #include <sys/stat.h>
  5159. #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
  5160. /* declarations of non-ANSI functions */
  5161. #if defined __MINGW32__
  5162. # ifdef __STRICT_ANSI__
  5163. int _putenv (const char *);
  5164. # endif
  5165. #elif defined __CYGWIN__
  5166. # ifdef __STRICT_ANSI__
  5167. char *realpath (const char *, char *);
  5168. int putenv (char *);
  5169. int setenv (const char *, const char *, int);
  5170. # endif
  5171. /* #elif defined other_platform || defined ... */
  5172. #endif
  5173. /* portability defines, excluding path handling macros */
  5174. #if defined _MSC_VER
  5175. # define setmode _setmode
  5176. # define stat _stat
  5177. # define chmod _chmod
  5178. # define getcwd _getcwd
  5179. # define putenv _putenv
  5180. # define S_IXUSR _S_IEXEC
  5181. #elif defined __MINGW32__
  5182. # define setmode _setmode
  5183. # define stat _stat
  5184. # define chmod _chmod
  5185. # define getcwd _getcwd
  5186. # define putenv _putenv
  5187. #elif defined __CYGWIN__
  5188. # define HAVE_SETENV
  5189. # define FOPEN_WB "wb"
  5190. /* #elif defined other platforms ... */
  5191. #endif
  5192. #if defined PATH_MAX
  5193. # define LT_PATHMAX PATH_MAX
  5194. #elif defined MAXPATHLEN
  5195. # define LT_PATHMAX MAXPATHLEN
  5196. #else
  5197. # define LT_PATHMAX 1024
  5198. #endif
  5199. #ifndef S_IXOTH
  5200. # define S_IXOTH 0
  5201. #endif
  5202. #ifndef S_IXGRP
  5203. # define S_IXGRP 0
  5204. #endif
  5205. /* path handling portability macros */
  5206. #ifndef DIR_SEPARATOR
  5207. # define DIR_SEPARATOR '/'
  5208. # define PATH_SEPARATOR ':'
  5209. #endif
  5210. #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
  5211. defined __OS2__
  5212. # define HAVE_DOS_BASED_FILE_SYSTEM
  5213. # define FOPEN_WB "wb"
  5214. # ifndef DIR_SEPARATOR_2
  5215. # define DIR_SEPARATOR_2 '\\'
  5216. # endif
  5217. # ifndef PATH_SEPARATOR_2
  5218. # define PATH_SEPARATOR_2 ';'
  5219. # endif
  5220. #endif
  5221. #ifndef DIR_SEPARATOR_2
  5222. # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  5223. #else /* DIR_SEPARATOR_2 */
  5224. # define IS_DIR_SEPARATOR(ch) \
  5225. (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  5226. #endif /* DIR_SEPARATOR_2 */
  5227. #ifndef PATH_SEPARATOR_2
  5228. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  5229. #else /* PATH_SEPARATOR_2 */
  5230. # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  5231. #endif /* PATH_SEPARATOR_2 */
  5232. #ifndef FOPEN_WB
  5233. # define FOPEN_WB "w"
  5234. #endif
  5235. #ifndef _O_BINARY
  5236. # define _O_BINARY 0
  5237. #endif
  5238. #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  5239. #define XFREE(stale) do { \
  5240. if (stale) { free (stale); stale = 0; } \
  5241. } while (0)
  5242. #if defined LT_DEBUGWRAPPER
  5243. static int lt_debug = 1;
  5244. #else
  5245. static int lt_debug = 0;
  5246. #endif
  5247. const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
  5248. void *xmalloc (size_t num);
  5249. char *xstrdup (const char *string);
  5250. const char *base_name (const char *name);
  5251. char *find_executable (const char *wrapper);
  5252. char *chase_symlinks (const char *pathspec);
  5253. int make_executable (const char *path);
  5254. int check_executable (const char *path);
  5255. char *strendzap (char *str, const char *pat);
  5256. void lt_debugprintf (const char *file, int line, const char *fmt, ...);
  5257. void lt_fatal (const char *file, int line, const char *message, ...);
  5258. static const char *nonnull (const char *s);
  5259. static const char *nonempty (const char *s);
  5260. void lt_setenv (const char *name, const char *value);
  5261. char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  5262. void lt_update_exe_path (const char *name, const char *value);
  5263. void lt_update_lib_path (const char *name, const char *value);
  5264. char **prepare_spawn (char **argv);
  5265. void lt_dump_script (FILE *f);
  5266. EOF
  5267. cat <<EOF
  5268. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
  5269. # define externally_visible volatile
  5270. #else
  5271. # define externally_visible __attribute__((externally_visible)) volatile
  5272. #endif
  5273. externally_visible const char * MAGIC_EXE = "$magic_exe";
  5274. const char * LIB_PATH_VARNAME = "$shlibpath_var";
  5275. EOF
  5276. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  5277. func_to_host_path "$temp_rpath"
  5278. cat <<EOF
  5279. const char * LIB_PATH_VALUE = "$func_to_host_path_result";
  5280. EOF
  5281. else
  5282. cat <<"EOF"
  5283. const char * LIB_PATH_VALUE = "";
  5284. EOF
  5285. fi
  5286. if test -n "$dllsearchpath"; then
  5287. func_to_host_path "$dllsearchpath:"
  5288. cat <<EOF
  5289. const char * EXE_PATH_VARNAME = "PATH";
  5290. const char * EXE_PATH_VALUE = "$func_to_host_path_result";
  5291. EOF
  5292. else
  5293. cat <<"EOF"
  5294. const char * EXE_PATH_VARNAME = "";
  5295. const char * EXE_PATH_VALUE = "";
  5296. EOF
  5297. fi
  5298. if test yes = "$fast_install"; then
  5299. cat <<EOF
  5300. const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  5301. EOF
  5302. else
  5303. cat <<EOF
  5304. const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  5305. EOF
  5306. fi
  5307. cat <<"EOF"
  5308. #define LTWRAPPER_OPTION_PREFIX "--lt-"
  5309. static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  5310. static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  5311. static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
  5312. int
  5313. main (int argc, char *argv[])
  5314. {
  5315. char **newargz;
  5316. int newargc;
  5317. char *tmp_pathspec;
  5318. char *actual_cwrapper_path;
  5319. char *actual_cwrapper_name;
  5320. char *target_name;
  5321. char *lt_argv_zero;
  5322. int rval = 127;
  5323. int i;
  5324. program_name = (char *) xstrdup (base_name (argv[0]));
  5325. newargz = XMALLOC (char *, (size_t) argc + 1);
  5326. /* very simple arg parsing; don't want to rely on getopt
  5327. * also, copy all non cwrapper options to newargz, except
  5328. * argz[0], which is handled differently
  5329. */
  5330. newargc=0;
  5331. for (i = 1; i < argc; i++)
  5332. {
  5333. if (STREQ (argv[i], dumpscript_opt))
  5334. {
  5335. EOF
  5336. case $host in
  5337. *mingw* | *cygwin* )
  5338. # make stdout use "unix" line endings
  5339. echo " setmode(1,_O_BINARY);"
  5340. ;;
  5341. esac
  5342. cat <<"EOF"
  5343. lt_dump_script (stdout);
  5344. return 0;
  5345. }
  5346. if (STREQ (argv[i], debug_opt))
  5347. {
  5348. lt_debug = 1;
  5349. continue;
  5350. }
  5351. if (STREQ (argv[i], ltwrapper_option_prefix))
  5352. {
  5353. /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  5354. namespace, but it is not one of the ones we know about and
  5355. have already dealt with, above (inluding dump-script), then
  5356. report an error. Otherwise, targets might begin to believe
  5357. they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  5358. namespace. The first time any user complains about this, we'll
  5359. need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  5360. or a configure.ac-settable value.
  5361. */
  5362. lt_fatal (__FILE__, __LINE__,
  5363. "unrecognized %s option: '%s'",
  5364. ltwrapper_option_prefix, argv[i]);
  5365. }
  5366. /* otherwise ... */
  5367. newargz[++newargc] = xstrdup (argv[i]);
  5368. }
  5369. newargz[++newargc] = NULL;
  5370. EOF
  5371. cat <<EOF
  5372. /* The GNU banner must be the first non-error debug message */
  5373. lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
  5374. EOF
  5375. cat <<"EOF"
  5376. lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
  5377. lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
  5378. tmp_pathspec = find_executable (argv[0]);
  5379. if (tmp_pathspec == NULL)
  5380. lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
  5381. lt_debugprintf (__FILE__, __LINE__,
  5382. "(main) found exe (before symlink chase) at: %s\n",
  5383. tmp_pathspec);
  5384. actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  5385. lt_debugprintf (__FILE__, __LINE__,
  5386. "(main) found exe (after symlink chase) at: %s\n",
  5387. actual_cwrapper_path);
  5388. XFREE (tmp_pathspec);
  5389. actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
  5390. strendzap (actual_cwrapper_path, actual_cwrapper_name);
  5391. /* wrapper name transforms */
  5392. strendzap (actual_cwrapper_name, ".exe");
  5393. tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  5394. XFREE (actual_cwrapper_name);
  5395. actual_cwrapper_name = tmp_pathspec;
  5396. tmp_pathspec = 0;
  5397. /* target_name transforms -- use actual target program name; might have lt- prefix */
  5398. target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  5399. strendzap (target_name, ".exe");
  5400. tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  5401. XFREE (target_name);
  5402. target_name = tmp_pathspec;
  5403. tmp_pathspec = 0;
  5404. lt_debugprintf (__FILE__, __LINE__,
  5405. "(main) libtool target name: %s\n",
  5406. target_name);
  5407. EOF
  5408. cat <<EOF
  5409. newargz[0] =
  5410. XMALLOC (char, (strlen (actual_cwrapper_path) +
  5411. strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  5412. strcpy (newargz[0], actual_cwrapper_path);
  5413. strcat (newargz[0], "$objdir");
  5414. strcat (newargz[0], "/");
  5415. EOF
  5416. cat <<"EOF"
  5417. /* stop here, and copy so we don't have to do this twice */
  5418. tmp_pathspec = xstrdup (newargz[0]);
  5419. /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  5420. strcat (newargz[0], actual_cwrapper_name);
  5421. /* DO want the lt- prefix here if it exists, so use target_name */
  5422. lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  5423. XFREE (tmp_pathspec);
  5424. tmp_pathspec = NULL;
  5425. EOF
  5426. case $host_os in
  5427. mingw*)
  5428. cat <<"EOF"
  5429. {
  5430. char* p;
  5431. while ((p = strchr (newargz[0], '\\')) != NULL)
  5432. {
  5433. *p = '/';
  5434. }
  5435. while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  5436. {
  5437. *p = '/';
  5438. }
  5439. }
  5440. EOF
  5441. ;;
  5442. esac
  5443. cat <<"EOF"
  5444. XFREE (target_name);
  5445. XFREE (actual_cwrapper_path);
  5446. XFREE (actual_cwrapper_name);
  5447. lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  5448. lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  5449. /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
  5450. be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
  5451. because on Windows, both *_VARNAMEs are PATH but uninstalled
  5452. libraries must come first. */
  5453. lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  5454. lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  5455. lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
  5456. nonnull (lt_argv_zero));
  5457. for (i = 0; i < newargc; i++)
  5458. {
  5459. lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
  5460. i, nonnull (newargz[i]));
  5461. }
  5462. EOF
  5463. case $host_os in
  5464. mingw*)
  5465. cat <<"EOF"
  5466. /* execv doesn't actually work on mingw as expected on unix */
  5467. newargz = prepare_spawn (newargz);
  5468. rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  5469. if (rval == -1)
  5470. {
  5471. /* failed to start process */
  5472. lt_debugprintf (__FILE__, __LINE__,
  5473. "(main) failed to launch target \"%s\": %s\n",
  5474. lt_argv_zero, nonnull (strerror (errno)));
  5475. return 127;
  5476. }
  5477. return rval;
  5478. EOF
  5479. ;;
  5480. *)
  5481. cat <<"EOF"
  5482. execv (lt_argv_zero, newargz);
  5483. return rval; /* =127, but avoids unused variable warning */
  5484. EOF
  5485. ;;
  5486. esac
  5487. cat <<"EOF"
  5488. }
  5489. void *
  5490. xmalloc (size_t num)
  5491. {
  5492. void *p = (void *) malloc (num);
  5493. if (!p)
  5494. lt_fatal (__FILE__, __LINE__, "memory exhausted");
  5495. return p;
  5496. }
  5497. char *
  5498. xstrdup (const char *string)
  5499. {
  5500. return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  5501. string) : NULL;
  5502. }
  5503. const char *
  5504. base_name (const char *name)
  5505. {
  5506. const char *base;
  5507. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5508. /* Skip over the disk name in MSDOS pathnames. */
  5509. if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  5510. name += 2;
  5511. #endif
  5512. for (base = name; *name; name++)
  5513. if (IS_DIR_SEPARATOR (*name))
  5514. base = name + 1;
  5515. return base;
  5516. }
  5517. int
  5518. check_executable (const char *path)
  5519. {
  5520. struct stat st;
  5521. lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
  5522. nonempty (path));
  5523. if ((!path) || (!*path))
  5524. return 0;
  5525. if ((stat (path, &st) >= 0)
  5526. && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  5527. return 1;
  5528. else
  5529. return 0;
  5530. }
  5531. int
  5532. make_executable (const char *path)
  5533. {
  5534. int rval = 0;
  5535. struct stat st;
  5536. lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
  5537. nonempty (path));
  5538. if ((!path) || (!*path))
  5539. return 0;
  5540. if (stat (path, &st) >= 0)
  5541. {
  5542. rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  5543. }
  5544. return rval;
  5545. }
  5546. /* Searches for the full path of the wrapper. Returns
  5547. newly allocated full path name if found, NULL otherwise
  5548. Does not chase symlinks, even on platforms that support them.
  5549. */
  5550. char *
  5551. find_executable (const char *wrapper)
  5552. {
  5553. int has_slash = 0;
  5554. const char *p;
  5555. const char *p_next;
  5556. /* static buffer for getcwd */
  5557. char tmp[LT_PATHMAX + 1];
  5558. size_t tmp_len;
  5559. char *concat_name;
  5560. lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
  5561. nonempty (wrapper));
  5562. if ((wrapper == NULL) || (*wrapper == '\0'))
  5563. return NULL;
  5564. /* Absolute path? */
  5565. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5566. if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  5567. {
  5568. concat_name = xstrdup (wrapper);
  5569. if (check_executable (concat_name))
  5570. return concat_name;
  5571. XFREE (concat_name);
  5572. }
  5573. else
  5574. {
  5575. #endif
  5576. if (IS_DIR_SEPARATOR (wrapper[0]))
  5577. {
  5578. concat_name = xstrdup (wrapper);
  5579. if (check_executable (concat_name))
  5580. return concat_name;
  5581. XFREE (concat_name);
  5582. }
  5583. #if defined HAVE_DOS_BASED_FILE_SYSTEM
  5584. }
  5585. #endif
  5586. for (p = wrapper; *p; p++)
  5587. if (*p == '/')
  5588. {
  5589. has_slash = 1;
  5590. break;
  5591. }
  5592. if (!has_slash)
  5593. {
  5594. /* no slashes; search PATH */
  5595. const char *path = getenv ("PATH");
  5596. if (path != NULL)
  5597. {
  5598. for (p = path; *p; p = p_next)
  5599. {
  5600. const char *q;
  5601. size_t p_len;
  5602. for (q = p; *q; q++)
  5603. if (IS_PATH_SEPARATOR (*q))
  5604. break;
  5605. p_len = (size_t) (q - p);
  5606. p_next = (*q == '\0' ? q : q + 1);
  5607. if (p_len == 0)
  5608. {
  5609. /* empty path: current directory */
  5610. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5611. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5612. nonnull (strerror (errno)));
  5613. tmp_len = strlen (tmp);
  5614. concat_name =
  5615. XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5616. memcpy (concat_name, tmp, tmp_len);
  5617. concat_name[tmp_len] = '/';
  5618. strcpy (concat_name + tmp_len + 1, wrapper);
  5619. }
  5620. else
  5621. {
  5622. concat_name =
  5623. XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  5624. memcpy (concat_name, p, p_len);
  5625. concat_name[p_len] = '/';
  5626. strcpy (concat_name + p_len + 1, wrapper);
  5627. }
  5628. if (check_executable (concat_name))
  5629. return concat_name;
  5630. XFREE (concat_name);
  5631. }
  5632. }
  5633. /* not found in PATH; assume curdir */
  5634. }
  5635. /* Relative path | not found in path: prepend cwd */
  5636. if (getcwd (tmp, LT_PATHMAX) == NULL)
  5637. lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
  5638. nonnull (strerror (errno)));
  5639. tmp_len = strlen (tmp);
  5640. concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  5641. memcpy (concat_name, tmp, tmp_len);
  5642. concat_name[tmp_len] = '/';
  5643. strcpy (concat_name + tmp_len + 1, wrapper);
  5644. if (check_executable (concat_name))
  5645. return concat_name;
  5646. XFREE (concat_name);
  5647. return NULL;
  5648. }
  5649. char *
  5650. chase_symlinks (const char *pathspec)
  5651. {
  5652. #ifndef S_ISLNK
  5653. return xstrdup (pathspec);
  5654. #else
  5655. char buf[LT_PATHMAX];
  5656. struct stat s;
  5657. char *tmp_pathspec = xstrdup (pathspec);
  5658. char *p;
  5659. int has_symlinks = 0;
  5660. while (strlen (tmp_pathspec) && !has_symlinks)
  5661. {
  5662. lt_debugprintf (__FILE__, __LINE__,
  5663. "checking path component for symlinks: %s\n",
  5664. tmp_pathspec);
  5665. if (lstat (tmp_pathspec, &s) == 0)
  5666. {
  5667. if (S_ISLNK (s.st_mode) != 0)
  5668. {
  5669. has_symlinks = 1;
  5670. break;
  5671. }
  5672. /* search backwards for last DIR_SEPARATOR */
  5673. p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  5674. while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5675. p--;
  5676. if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  5677. {
  5678. /* no more DIR_SEPARATORS left */
  5679. break;
  5680. }
  5681. *p = '\0';
  5682. }
  5683. else
  5684. {
  5685. lt_fatal (__FILE__, __LINE__,
  5686. "error accessing file \"%s\": %s",
  5687. tmp_pathspec, nonnull (strerror (errno)));
  5688. }
  5689. }
  5690. XFREE (tmp_pathspec);
  5691. if (!has_symlinks)
  5692. {
  5693. return xstrdup (pathspec);
  5694. }
  5695. tmp_pathspec = realpath (pathspec, buf);
  5696. if (tmp_pathspec == 0)
  5697. {
  5698. lt_fatal (__FILE__, __LINE__,
  5699. "could not follow symlinks for %s", pathspec);
  5700. }
  5701. return xstrdup (tmp_pathspec);
  5702. #endif
  5703. }
  5704. char *
  5705. strendzap (char *str, const char *pat)
  5706. {
  5707. size_t len, patlen;
  5708. assert (str != NULL);
  5709. assert (pat != NULL);
  5710. len = strlen (str);
  5711. patlen = strlen (pat);
  5712. if (patlen <= len)
  5713. {
  5714. str += len - patlen;
  5715. if (STREQ (str, pat))
  5716. *str = '\0';
  5717. }
  5718. return str;
  5719. }
  5720. void
  5721. lt_debugprintf (const char *file, int line, const char *fmt, ...)
  5722. {
  5723. va_list args;
  5724. if (lt_debug)
  5725. {
  5726. (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
  5727. va_start (args, fmt);
  5728. (void) vfprintf (stderr, fmt, args);
  5729. va_end (args);
  5730. }
  5731. }
  5732. static void
  5733. lt_error_core (int exit_status, const char *file,
  5734. int line, const char *mode,
  5735. const char *message, va_list ap)
  5736. {
  5737. fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
  5738. vfprintf (stderr, message, ap);
  5739. fprintf (stderr, ".\n");
  5740. if (exit_status >= 0)
  5741. exit (exit_status);
  5742. }
  5743. void
  5744. lt_fatal (const char *file, int line, const char *message, ...)
  5745. {
  5746. va_list ap;
  5747. va_start (ap, message);
  5748. lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
  5749. va_end (ap);
  5750. }
  5751. static const char *
  5752. nonnull (const char *s)
  5753. {
  5754. return s ? s : "(null)";
  5755. }
  5756. static const char *
  5757. nonempty (const char *s)
  5758. {
  5759. return (s && !*s) ? "(empty)" : nonnull (s);
  5760. }
  5761. void
  5762. lt_setenv (const char *name, const char *value)
  5763. {
  5764. lt_debugprintf (__FILE__, __LINE__,
  5765. "(lt_setenv) setting '%s' to '%s'\n",
  5766. nonnull (name), nonnull (value));
  5767. {
  5768. #ifdef HAVE_SETENV
  5769. /* always make a copy, for consistency with !HAVE_SETENV */
  5770. char *str = xstrdup (value);
  5771. setenv (name, str, 1);
  5772. #else
  5773. size_t len = strlen (name) + 1 + strlen (value) + 1;
  5774. char *str = XMALLOC (char, len);
  5775. sprintf (str, "%s=%s", name, value);
  5776. if (putenv (str) != EXIT_SUCCESS)
  5777. {
  5778. XFREE (str);
  5779. }
  5780. #endif
  5781. }
  5782. }
  5783. char *
  5784. lt_extend_str (const char *orig_value, const char *add, int to_end)
  5785. {
  5786. char *new_value;
  5787. if (orig_value && *orig_value)
  5788. {
  5789. size_t orig_value_len = strlen (orig_value);
  5790. size_t add_len = strlen (add);
  5791. new_value = XMALLOC (char, add_len + orig_value_len + 1);
  5792. if (to_end)
  5793. {
  5794. strcpy (new_value, orig_value);
  5795. strcpy (new_value + orig_value_len, add);
  5796. }
  5797. else
  5798. {
  5799. strcpy (new_value, add);
  5800. strcpy (new_value + add_len, orig_value);
  5801. }
  5802. }
  5803. else
  5804. {
  5805. new_value = xstrdup (add);
  5806. }
  5807. return new_value;
  5808. }
  5809. void
  5810. lt_update_exe_path (const char *name, const char *value)
  5811. {
  5812. lt_debugprintf (__FILE__, __LINE__,
  5813. "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  5814. nonnull (name), nonnull (value));
  5815. if (name && *name && value && *value)
  5816. {
  5817. char *new_value = lt_extend_str (getenv (name), value, 0);
  5818. /* some systems can't cope with a ':'-terminated path #' */
  5819. size_t len = strlen (new_value);
  5820. while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  5821. {
  5822. new_value[--len] = '\0';
  5823. }
  5824. lt_setenv (name, new_value);
  5825. XFREE (new_value);
  5826. }
  5827. }
  5828. void
  5829. lt_update_lib_path (const char *name, const char *value)
  5830. {
  5831. lt_debugprintf (__FILE__, __LINE__,
  5832. "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  5833. nonnull (name), nonnull (value));
  5834. if (name && *name && value && *value)
  5835. {
  5836. char *new_value = lt_extend_str (getenv (name), value, 0);
  5837. lt_setenv (name, new_value);
  5838. XFREE (new_value);
  5839. }
  5840. }
  5841. EOF
  5842. case $host_os in
  5843. mingw*)
  5844. cat <<"EOF"
  5845. /* Prepares an argument vector before calling spawn().
  5846. Note that spawn() does not by itself call the command interpreter
  5847. (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
  5848. ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  5849. GetVersionEx(&v);
  5850. v.dwPlatformId == VER_PLATFORM_WIN32_NT;
  5851. }) ? "cmd.exe" : "command.com").
  5852. Instead it simply concatenates the arguments, separated by ' ', and calls
  5853. CreateProcess(). We must quote the arguments since Win32 CreateProcess()
  5854. interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
  5855. special way:
  5856. - Space and tab are interpreted as delimiters. They are not treated as
  5857. delimiters if they are surrounded by double quotes: "...".
  5858. - Unescaped double quotes are removed from the input. Their only effect is
  5859. that within double quotes, space and tab are treated like normal
  5860. characters.
  5861. - Backslashes not followed by double quotes are not special.
  5862. - But 2*n+1 backslashes followed by a double quote become
  5863. n backslashes followed by a double quote (n >= 0):
  5864. \" -> "
  5865. \\\" -> \"
  5866. \\\\\" -> \\"
  5867. */
  5868. #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
  5869. #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
  5870. char **
  5871. prepare_spawn (char **argv)
  5872. {
  5873. size_t argc;
  5874. char **new_argv;
  5875. size_t i;
  5876. /* Count number of arguments. */
  5877. for (argc = 0; argv[argc] != NULL; argc++)
  5878. ;
  5879. /* Allocate new argument vector. */
  5880. new_argv = XMALLOC (char *, argc + 1);
  5881. /* Put quoted arguments into the new argument vector. */
  5882. for (i = 0; i < argc; i++)
  5883. {
  5884. const char *string = argv[i];
  5885. if (string[0] == '\0')
  5886. new_argv[i] = xstrdup ("\"\"");
  5887. else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
  5888. {
  5889. int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
  5890. size_t length;
  5891. unsigned int backslashes;
  5892. const char *s;
  5893. char *quoted_string;
  5894. char *p;
  5895. length = 0;
  5896. backslashes = 0;
  5897. if (quote_around)
  5898. length++;
  5899. for (s = string; *s != '\0'; s++)
  5900. {
  5901. char c = *s;
  5902. if (c == '"')
  5903. length += backslashes + 1;
  5904. length++;
  5905. if (c == '\\')
  5906. backslashes++;
  5907. else
  5908. backslashes = 0;
  5909. }
  5910. if (quote_around)
  5911. length += backslashes + 1;
  5912. quoted_string = XMALLOC (char, length + 1);
  5913. p = quoted_string;
  5914. backslashes = 0;
  5915. if (quote_around)
  5916. *p++ = '"';
  5917. for (s = string; *s != '\0'; s++)
  5918. {
  5919. char c = *s;
  5920. if (c == '"')
  5921. {
  5922. unsigned int j;
  5923. for (j = backslashes + 1; j > 0; j--)
  5924. *p++ = '\\';
  5925. }
  5926. *p++ = c;
  5927. if (c == '\\')
  5928. backslashes++;
  5929. else
  5930. backslashes = 0;
  5931. }
  5932. if (quote_around)
  5933. {
  5934. unsigned int j;
  5935. for (j = backslashes; j > 0; j--)
  5936. *p++ = '\\';
  5937. *p++ = '"';
  5938. }
  5939. *p = '\0';
  5940. new_argv[i] = quoted_string;
  5941. }
  5942. else
  5943. new_argv[i] = (char *) string;
  5944. }
  5945. new_argv[argc] = NULL;
  5946. return new_argv;
  5947. }
  5948. EOF
  5949. ;;
  5950. esac
  5951. cat <<"EOF"
  5952. void lt_dump_script (FILE* f)
  5953. {
  5954. EOF
  5955. func_emit_wrapper yes |
  5956. $SED -n -e '
  5957. s/^\(.\{79\}\)\(..*\)/\1\
  5958. \2/
  5959. h
  5960. s/\([\\"]\)/\\\1/g
  5961. s/$/\\n/
  5962. s/\([^\n]*\).*/ fputs ("\1", f);/p
  5963. g
  5964. D'
  5965. cat <<"EOF"
  5966. }
  5967. EOF
  5968. }
  5969. # end: func_emit_cwrapperexe_src
  5970. # func_win32_import_lib_p ARG
  5971. # True if ARG is an import lib, as indicated by $file_magic_cmd
  5972. func_win32_import_lib_p ()
  5973. {
  5974. $debug_cmd
  5975. case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
  5976. *import*) : ;;
  5977. *) false ;;
  5978. esac
  5979. }
  5980. # func_suncc_cstd_abi
  5981. # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
  5982. # Several compiler flags select an ABI that is incompatible with the
  5983. # Cstd library. Avoid specifying it if any are in CXXFLAGS.
  5984. func_suncc_cstd_abi ()
  5985. {
  5986. $debug_cmd
  5987. case " $compile_command " in
  5988. *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
  5989. suncc_use_cstd_abi=no
  5990. ;;
  5991. *)
  5992. suncc_use_cstd_abi=yes
  5993. ;;
  5994. esac
  5995. }
  5996. # func_mode_link arg...
  5997. func_mode_link ()
  5998. {
  5999. $debug_cmd
  6000. case $host in
  6001. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6002. # It is impossible to link a dll without this setting, and
  6003. # we shouldn't force the makefile maintainer to figure out
  6004. # what system we are compiling for in order to pass an extra
  6005. # flag for every libtool invocation.
  6006. # allow_undefined=no
  6007. # FIXME: Unfortunately, there are problems with the above when trying
  6008. # to make a dll that has undefined symbols, in which case not
  6009. # even a static library is built. For now, we need to specify
  6010. # -no-undefined on the libtool link line when we can be certain
  6011. # that all symbols are satisfied, otherwise we get a static library.
  6012. allow_undefined=yes
  6013. ;;
  6014. *)
  6015. allow_undefined=yes
  6016. ;;
  6017. esac
  6018. libtool_args=$nonopt
  6019. base_compile="$nonopt $@"
  6020. compile_command=$nonopt
  6021. finalize_command=$nonopt
  6022. compile_rpath=
  6023. finalize_rpath=
  6024. compile_shlibpath=
  6025. finalize_shlibpath=
  6026. convenience=
  6027. old_convenience=
  6028. deplibs=
  6029. old_deplibs=
  6030. compiler_flags=
  6031. linker_flags=
  6032. dllsearchpath=
  6033. lib_search_path=`pwd`
  6034. inst_prefix_dir=
  6035. new_inherited_linker_flags=
  6036. avoid_version=no
  6037. bindir=
  6038. dlfiles=
  6039. dlprefiles=
  6040. dlself=no
  6041. export_dynamic=no
  6042. export_symbols=
  6043. export_symbols_regex=
  6044. generated=
  6045. libobjs=
  6046. ltlibs=
  6047. module=no
  6048. no_install=no
  6049. objs=
  6050. os2dllname=
  6051. non_pic_objects=
  6052. precious_files_regex=
  6053. prefer_static_libs=no
  6054. preload=false
  6055. prev=
  6056. prevarg=
  6057. release=
  6058. rpath=
  6059. xrpath=
  6060. perm_rpath=
  6061. temp_rpath=
  6062. thread_safe=no
  6063. vinfo=
  6064. vinfo_number=no
  6065. weak_libs=
  6066. single_module=$wl-single_module
  6067. func_infer_tag $base_compile
  6068. # We need to know -static, to get the right output filenames.
  6069. for arg
  6070. do
  6071. case $arg in
  6072. -shared)
  6073. test yes != "$build_libtool_libs" \
  6074. && func_fatal_configuration "cannot build a shared library"
  6075. build_old_libs=no
  6076. break
  6077. ;;
  6078. -all-static | -static | -static-libtool-libs)
  6079. case $arg in
  6080. -all-static)
  6081. if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
  6082. func_warning "complete static linking is impossible in this configuration"
  6083. fi
  6084. if test -n "$link_static_flag"; then
  6085. dlopen_self=$dlopen_self_static
  6086. fi
  6087. prefer_static_libs=yes
  6088. ;;
  6089. -static)
  6090. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6091. dlopen_self=$dlopen_self_static
  6092. fi
  6093. prefer_static_libs=built
  6094. ;;
  6095. -static-libtool-libs)
  6096. if test -z "$pic_flag" && test -n "$link_static_flag"; then
  6097. dlopen_self=$dlopen_self_static
  6098. fi
  6099. prefer_static_libs=yes
  6100. ;;
  6101. esac
  6102. build_libtool_libs=no
  6103. build_old_libs=yes
  6104. break
  6105. ;;
  6106. esac
  6107. done
  6108. # See if our shared archives depend on static archives.
  6109. test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  6110. # Go through the arguments, transforming them on the way.
  6111. while test "$#" -gt 0; do
  6112. arg=$1
  6113. shift
  6114. func_quote_for_eval "$arg"
  6115. qarg=$func_quote_for_eval_unquoted_result
  6116. func_append libtool_args " $func_quote_for_eval_result"
  6117. # If the previous option needs an argument, assign it.
  6118. if test -n "$prev"; then
  6119. case $prev in
  6120. output)
  6121. func_append compile_command " @OUTPUT@"
  6122. func_append finalize_command " @OUTPUT@"
  6123. ;;
  6124. esac
  6125. case $prev in
  6126. bindir)
  6127. bindir=$arg
  6128. prev=
  6129. continue
  6130. ;;
  6131. dlfiles|dlprefiles)
  6132. $preload || {
  6133. # Add the symbol object into the linking commands.
  6134. func_append compile_command " @SYMFILE@"
  6135. func_append finalize_command " @SYMFILE@"
  6136. preload=:
  6137. }
  6138. case $arg in
  6139. *.la | *.lo) ;; # We handle these cases below.
  6140. force)
  6141. if test no = "$dlself"; then
  6142. dlself=needless
  6143. export_dynamic=yes
  6144. fi
  6145. prev=
  6146. continue
  6147. ;;
  6148. self)
  6149. if test dlprefiles = "$prev"; then
  6150. dlself=yes
  6151. elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
  6152. dlself=yes
  6153. else
  6154. dlself=needless
  6155. export_dynamic=yes
  6156. fi
  6157. prev=
  6158. continue
  6159. ;;
  6160. *)
  6161. if test dlfiles = "$prev"; then
  6162. func_append dlfiles " $arg"
  6163. else
  6164. func_append dlprefiles " $arg"
  6165. fi
  6166. prev=
  6167. continue
  6168. ;;
  6169. esac
  6170. ;;
  6171. expsyms)
  6172. export_symbols=$arg
  6173. test -f "$arg" \
  6174. || func_fatal_error "symbol file '$arg' does not exist"
  6175. prev=
  6176. continue
  6177. ;;
  6178. expsyms_regex)
  6179. export_symbols_regex=$arg
  6180. prev=
  6181. continue
  6182. ;;
  6183. framework)
  6184. case $host in
  6185. *-*-darwin*)
  6186. case "$deplibs " in
  6187. *" $qarg.ltframework "*) ;;
  6188. *) func_append deplibs " $qarg.ltframework" # this is fixed later
  6189. ;;
  6190. esac
  6191. ;;
  6192. esac
  6193. prev=
  6194. continue
  6195. ;;
  6196. inst_prefix)
  6197. inst_prefix_dir=$arg
  6198. prev=
  6199. continue
  6200. ;;
  6201. mllvm)
  6202. # Clang does not use LLVM to link, so we can simply discard any
  6203. # '-mllvm $arg' options when doing the link step.
  6204. prev=
  6205. continue
  6206. ;;
  6207. objectlist)
  6208. if test -f "$arg"; then
  6209. save_arg=$arg
  6210. moreargs=
  6211. for fil in `cat "$save_arg"`
  6212. do
  6213. # func_append moreargs " $fil"
  6214. arg=$fil
  6215. # A libtool-controlled object.
  6216. # Check to see that this really is a libtool object.
  6217. if func_lalib_unsafe_p "$arg"; then
  6218. pic_object=
  6219. non_pic_object=
  6220. # Read the .lo file
  6221. func_source "$arg"
  6222. if test -z "$pic_object" ||
  6223. test -z "$non_pic_object" ||
  6224. test none = "$pic_object" &&
  6225. test none = "$non_pic_object"; then
  6226. func_fatal_error "cannot find name of object for '$arg'"
  6227. fi
  6228. # Extract subdirectory from the argument.
  6229. func_dirname "$arg" "/" ""
  6230. xdir=$func_dirname_result
  6231. if test none != "$pic_object"; then
  6232. # Prepend the subdirectory the object is found in.
  6233. pic_object=$xdir$pic_object
  6234. if test dlfiles = "$prev"; then
  6235. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6236. func_append dlfiles " $pic_object"
  6237. prev=
  6238. continue
  6239. else
  6240. # If libtool objects are unsupported, then we need to preload.
  6241. prev=dlprefiles
  6242. fi
  6243. fi
  6244. # CHECK ME: I think I busted this. -Ossama
  6245. if test dlprefiles = "$prev"; then
  6246. # Preload the old-style object.
  6247. func_append dlprefiles " $pic_object"
  6248. prev=
  6249. fi
  6250. # A PIC object.
  6251. func_append libobjs " $pic_object"
  6252. arg=$pic_object
  6253. fi
  6254. # Non-PIC object.
  6255. if test none != "$non_pic_object"; then
  6256. # Prepend the subdirectory the object is found in.
  6257. non_pic_object=$xdir$non_pic_object
  6258. # A standard non-PIC object
  6259. func_append non_pic_objects " $non_pic_object"
  6260. if test -z "$pic_object" || test none = "$pic_object"; then
  6261. arg=$non_pic_object
  6262. fi
  6263. else
  6264. # If the PIC object exists, use it instead.
  6265. # $xdir was prepended to $pic_object above.
  6266. non_pic_object=$pic_object
  6267. func_append non_pic_objects " $non_pic_object"
  6268. fi
  6269. else
  6270. # Only an error if not doing a dry-run.
  6271. if $opt_dry_run; then
  6272. # Extract subdirectory from the argument.
  6273. func_dirname "$arg" "/" ""
  6274. xdir=$func_dirname_result
  6275. func_lo2o "$arg"
  6276. pic_object=$xdir$objdir/$func_lo2o_result
  6277. non_pic_object=$xdir$func_lo2o_result
  6278. func_append libobjs " $pic_object"
  6279. func_append non_pic_objects " $non_pic_object"
  6280. else
  6281. func_fatal_error "'$arg' is not a valid libtool object"
  6282. fi
  6283. fi
  6284. done
  6285. else
  6286. func_fatal_error "link input file '$arg' does not exist"
  6287. fi
  6288. arg=$save_arg
  6289. prev=
  6290. continue
  6291. ;;
  6292. os2dllname)
  6293. os2dllname=$arg
  6294. prev=
  6295. continue
  6296. ;;
  6297. precious_regex)
  6298. precious_files_regex=$arg
  6299. prev=
  6300. continue
  6301. ;;
  6302. release)
  6303. release=-$arg
  6304. prev=
  6305. continue
  6306. ;;
  6307. rpath | xrpath)
  6308. # We need an absolute path.
  6309. case $arg in
  6310. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6311. *)
  6312. func_fatal_error "only absolute run-paths are allowed"
  6313. ;;
  6314. esac
  6315. if test rpath = "$prev"; then
  6316. case "$rpath " in
  6317. *" $arg "*) ;;
  6318. *) func_append rpath " $arg" ;;
  6319. esac
  6320. else
  6321. case "$xrpath " in
  6322. *" $arg "*) ;;
  6323. *) func_append xrpath " $arg" ;;
  6324. esac
  6325. fi
  6326. prev=
  6327. continue
  6328. ;;
  6329. shrext)
  6330. shrext_cmds=$arg
  6331. prev=
  6332. continue
  6333. ;;
  6334. weak)
  6335. func_append weak_libs " $arg"
  6336. prev=
  6337. continue
  6338. ;;
  6339. xcclinker)
  6340. func_append linker_flags " $qarg"
  6341. func_append compiler_flags " $qarg"
  6342. prev=
  6343. func_append compile_command " $qarg"
  6344. func_append finalize_command " $qarg"
  6345. continue
  6346. ;;
  6347. xcompiler)
  6348. func_append compiler_flags " $qarg"
  6349. prev=
  6350. func_append compile_command " $qarg"
  6351. func_append finalize_command " $qarg"
  6352. continue
  6353. ;;
  6354. xlinker)
  6355. func_append linker_flags " $qarg"
  6356. func_append compiler_flags " $wl$qarg"
  6357. prev=
  6358. func_append compile_command " $wl$qarg"
  6359. func_append finalize_command " $wl$qarg"
  6360. continue
  6361. ;;
  6362. *)
  6363. eval "$prev=\"\$arg\""
  6364. prev=
  6365. continue
  6366. ;;
  6367. esac
  6368. fi # test -n "$prev"
  6369. prevarg=$arg
  6370. case $arg in
  6371. -all-static)
  6372. if test -n "$link_static_flag"; then
  6373. # See comment for -static flag below, for more details.
  6374. func_append compile_command " $link_static_flag"
  6375. func_append finalize_command " $link_static_flag"
  6376. fi
  6377. continue
  6378. ;;
  6379. -allow-undefined)
  6380. # FIXME: remove this flag sometime in the future.
  6381. func_fatal_error "'-allow-undefined' must not be used because it is the default"
  6382. ;;
  6383. -avoid-version)
  6384. avoid_version=yes
  6385. continue
  6386. ;;
  6387. -bindir)
  6388. prev=bindir
  6389. continue
  6390. ;;
  6391. -dlopen)
  6392. prev=dlfiles
  6393. continue
  6394. ;;
  6395. -dlpreopen)
  6396. prev=dlprefiles
  6397. continue
  6398. ;;
  6399. -export-dynamic)
  6400. export_dynamic=yes
  6401. continue
  6402. ;;
  6403. -export-symbols | -export-symbols-regex)
  6404. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  6405. func_fatal_error "more than one -exported-symbols argument is not allowed"
  6406. fi
  6407. if test X-export-symbols = "X$arg"; then
  6408. prev=expsyms
  6409. else
  6410. prev=expsyms_regex
  6411. fi
  6412. continue
  6413. ;;
  6414. -framework)
  6415. prev=framework
  6416. continue
  6417. ;;
  6418. -inst-prefix-dir)
  6419. prev=inst_prefix
  6420. continue
  6421. ;;
  6422. # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
  6423. # so, if we see these flags be careful not to treat them like -L
  6424. -L[A-Z][A-Z]*:*)
  6425. case $with_gcc/$host in
  6426. no/*-*-irix* | /*-*-irix*)
  6427. func_append compile_command " $arg"
  6428. func_append finalize_command " $arg"
  6429. ;;
  6430. esac
  6431. continue
  6432. ;;
  6433. -L*)
  6434. func_stripname "-L" '' "$arg"
  6435. if test -z "$func_stripname_result"; then
  6436. if test "$#" -gt 0; then
  6437. func_fatal_error "require no space between '-L' and '$1'"
  6438. else
  6439. func_fatal_error "need path for '-L' option"
  6440. fi
  6441. fi
  6442. func_resolve_sysroot "$func_stripname_result"
  6443. dir=$func_resolve_sysroot_result
  6444. # We need an absolute path.
  6445. case $dir in
  6446. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6447. *)
  6448. absdir=`cd "$dir" && pwd`
  6449. test -z "$absdir" && \
  6450. func_fatal_error "cannot determine absolute directory name of '$dir'"
  6451. dir=$absdir
  6452. ;;
  6453. esac
  6454. case "$deplibs " in
  6455. *" -L$dir "* | *" $arg "*)
  6456. # Will only happen for absolute or sysroot arguments
  6457. ;;
  6458. *)
  6459. # Preserve sysroot, but never include relative directories
  6460. case $dir in
  6461. [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
  6462. *) func_append deplibs " -L$dir" ;;
  6463. esac
  6464. func_append lib_search_path " $dir"
  6465. ;;
  6466. esac
  6467. case $host in
  6468. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  6469. testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
  6470. case :$dllsearchpath: in
  6471. *":$dir:"*) ;;
  6472. ::) dllsearchpath=$dir;;
  6473. *) func_append dllsearchpath ":$dir";;
  6474. esac
  6475. case :$dllsearchpath: in
  6476. *":$testbindir:"*) ;;
  6477. ::) dllsearchpath=$testbindir;;
  6478. *) func_append dllsearchpath ":$testbindir";;
  6479. esac
  6480. ;;
  6481. esac
  6482. continue
  6483. ;;
  6484. -l*)
  6485. if test X-lc = "X$arg" || test X-lm = "X$arg"; then
  6486. case $host in
  6487. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
  6488. # These systems don't actually have a C or math library (as such)
  6489. continue
  6490. ;;
  6491. *-*-os2*)
  6492. # These systems don't actually have a C library (as such)
  6493. test X-lc = "X$arg" && continue
  6494. ;;
  6495. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6496. # Do not include libc due to us having libc/libc_r.
  6497. test X-lc = "X$arg" && continue
  6498. ;;
  6499. *-*-rhapsody* | *-*-darwin1.[012])
  6500. # Rhapsody C and math libraries are in the System framework
  6501. func_append deplibs " System.ltframework"
  6502. continue
  6503. ;;
  6504. *-*-sco3.2v5* | *-*-sco5v6*)
  6505. # Causes problems with __ctype
  6506. test X-lc = "X$arg" && continue
  6507. ;;
  6508. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  6509. # Compiler inserts libc in the correct place for threads to work
  6510. test X-lc = "X$arg" && continue
  6511. ;;
  6512. esac
  6513. elif test X-lc_r = "X$arg"; then
  6514. case $host in
  6515. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
  6516. # Do not include libc_r directly, use -pthread flag.
  6517. continue
  6518. ;;
  6519. esac
  6520. fi
  6521. func_append deplibs " $arg"
  6522. continue
  6523. ;;
  6524. -mllvm)
  6525. prev=mllvm
  6526. continue
  6527. ;;
  6528. -module)
  6529. module=yes
  6530. continue
  6531. ;;
  6532. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  6533. # classes, name mangling, and exception handling.
  6534. # Darwin uses the -arch flag to determine output architecture.
  6535. -model|-arch|-isysroot|--sysroot)
  6536. func_append compiler_flags " $arg"
  6537. func_append compile_command " $arg"
  6538. func_append finalize_command " $arg"
  6539. prev=xcompiler
  6540. continue
  6541. ;;
  6542. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  6543. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  6544. func_append compiler_flags " $arg"
  6545. func_append compile_command " $arg"
  6546. func_append finalize_command " $arg"
  6547. case "$new_inherited_linker_flags " in
  6548. *" $arg "*) ;;
  6549. * ) func_append new_inherited_linker_flags " $arg" ;;
  6550. esac
  6551. continue
  6552. ;;
  6553. -multi_module)
  6554. single_module=$wl-multi_module
  6555. continue
  6556. ;;
  6557. -no-fast-install)
  6558. fast_install=no
  6559. continue
  6560. ;;
  6561. -no-install)
  6562. case $host in
  6563. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  6564. # The PATH hackery in wrapper scripts is required on Windows
  6565. # and Darwin in order for the loader to find any dlls it needs.
  6566. func_warning "'-no-install' is ignored for $host"
  6567. func_warning "assuming '-no-fast-install' instead"
  6568. fast_install=no
  6569. ;;
  6570. *) no_install=yes ;;
  6571. esac
  6572. continue
  6573. ;;
  6574. -no-undefined)
  6575. allow_undefined=no
  6576. continue
  6577. ;;
  6578. -objectlist)
  6579. prev=objectlist
  6580. continue
  6581. ;;
  6582. -os2dllname)
  6583. prev=os2dllname
  6584. continue
  6585. ;;
  6586. -o) prev=output ;;
  6587. -precious-files-regex)
  6588. prev=precious_regex
  6589. continue
  6590. ;;
  6591. -release)
  6592. prev=release
  6593. continue
  6594. ;;
  6595. -rpath)
  6596. prev=rpath
  6597. continue
  6598. ;;
  6599. -R)
  6600. prev=xrpath
  6601. continue
  6602. ;;
  6603. -R*)
  6604. func_stripname '-R' '' "$arg"
  6605. dir=$func_stripname_result
  6606. # We need an absolute path.
  6607. case $dir in
  6608. [\\/]* | [A-Za-z]:[\\/]*) ;;
  6609. =*)
  6610. func_stripname '=' '' "$dir"
  6611. dir=$lt_sysroot$func_stripname_result
  6612. ;;
  6613. *)
  6614. func_fatal_error "only absolute run-paths are allowed"
  6615. ;;
  6616. esac
  6617. case "$xrpath " in
  6618. *" $dir "*) ;;
  6619. *) func_append xrpath " $dir" ;;
  6620. esac
  6621. continue
  6622. ;;
  6623. -shared)
  6624. # The effects of -shared are defined in a previous loop.
  6625. continue
  6626. ;;
  6627. -shrext)
  6628. prev=shrext
  6629. continue
  6630. ;;
  6631. -static | -static-libtool-libs)
  6632. # The effects of -static are defined in a previous loop.
  6633. # We used to do the same as -all-static on platforms that
  6634. # didn't have a PIC flag, but the assumption that the effects
  6635. # would be equivalent was wrong. It would break on at least
  6636. # Digital Unix and AIX.
  6637. continue
  6638. ;;
  6639. -thread-safe)
  6640. thread_safe=yes
  6641. continue
  6642. ;;
  6643. -version-info)
  6644. prev=vinfo
  6645. continue
  6646. ;;
  6647. -version-number)
  6648. prev=vinfo
  6649. vinfo_number=yes
  6650. continue
  6651. ;;
  6652. -weak)
  6653. prev=weak
  6654. continue
  6655. ;;
  6656. -Wc,*)
  6657. func_stripname '-Wc,' '' "$arg"
  6658. args=$func_stripname_result
  6659. arg=
  6660. save_ifs=$IFS; IFS=,
  6661. for flag in $args; do
  6662. IFS=$save_ifs
  6663. func_quote_for_eval "$flag"
  6664. func_append arg " $func_quote_for_eval_result"
  6665. func_append compiler_flags " $func_quote_for_eval_result"
  6666. done
  6667. IFS=$save_ifs
  6668. func_stripname ' ' '' "$arg"
  6669. arg=$func_stripname_result
  6670. ;;
  6671. -Wl,*)
  6672. func_stripname '-Wl,' '' "$arg"
  6673. args=$func_stripname_result
  6674. arg=
  6675. save_ifs=$IFS; IFS=,
  6676. for flag in $args; do
  6677. IFS=$save_ifs
  6678. func_quote_for_eval "$flag"
  6679. func_append arg " $wl$func_quote_for_eval_result"
  6680. func_append compiler_flags " $wl$func_quote_for_eval_result"
  6681. func_append linker_flags " $func_quote_for_eval_result"
  6682. done
  6683. IFS=$save_ifs
  6684. func_stripname ' ' '' "$arg"
  6685. arg=$func_stripname_result
  6686. ;;
  6687. -Xcompiler)
  6688. prev=xcompiler
  6689. continue
  6690. ;;
  6691. -Xlinker)
  6692. prev=xlinker
  6693. continue
  6694. ;;
  6695. -XCClinker)
  6696. prev=xcclinker
  6697. continue
  6698. ;;
  6699. # -msg_* for osf cc
  6700. -msg_*)
  6701. func_quote_for_eval "$arg"
  6702. arg=$func_quote_for_eval_result
  6703. ;;
  6704. # Flags to be passed through unchanged, with rationale:
  6705. # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
  6706. # -r[0-9][0-9]* specify processor for the SGI compiler
  6707. # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
  6708. # +DA*, +DD* enable 64-bit mode for the HP compiler
  6709. # -q* compiler args for the IBM compiler
  6710. # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
  6711. # -F/path path to uninstalled frameworks, gcc on darwin
  6712. # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
  6713. # -fstack-protector* stack protector flags for GCC
  6714. # @file GCC response files
  6715. # -tp=* Portland pgcc target processor selection
  6716. # --sysroot=* for sysroot support
  6717. # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
  6718. # -stdlib=* select c++ std lib with clang
  6719. -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  6720. -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
  6721. -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
  6722. func_quote_for_eval "$arg"
  6723. arg=$func_quote_for_eval_result
  6724. func_append compile_command " $arg"
  6725. func_append finalize_command " $arg"
  6726. func_append compiler_flags " $arg"
  6727. continue
  6728. ;;
  6729. -Z*)
  6730. if test os2 = "`expr $host : '.*\(os2\)'`"; then
  6731. # OS/2 uses -Zxxx to specify OS/2-specific options
  6732. compiler_flags="$compiler_flags $arg"
  6733. func_append compile_command " $arg"
  6734. func_append finalize_command " $arg"
  6735. case $arg in
  6736. -Zlinker | -Zstack)
  6737. prev=xcompiler
  6738. ;;
  6739. esac
  6740. continue
  6741. else
  6742. # Otherwise treat like 'Some other compiler flag' below
  6743. func_quote_for_eval "$arg"
  6744. arg=$func_quote_for_eval_result
  6745. fi
  6746. ;;
  6747. # Some other compiler flag.
  6748. -* | +*)
  6749. func_quote_for_eval "$arg"
  6750. arg=$func_quote_for_eval_result
  6751. ;;
  6752. *.$objext)
  6753. # A standard object.
  6754. func_append objs " $arg"
  6755. ;;
  6756. *.lo)
  6757. # A libtool-controlled object.
  6758. # Check to see that this really is a libtool object.
  6759. if func_lalib_unsafe_p "$arg"; then
  6760. pic_object=
  6761. non_pic_object=
  6762. # Read the .lo file
  6763. func_source "$arg"
  6764. if test -z "$pic_object" ||
  6765. test -z "$non_pic_object" ||
  6766. test none = "$pic_object" &&
  6767. test none = "$non_pic_object"; then
  6768. func_fatal_error "cannot find name of object for '$arg'"
  6769. fi
  6770. # Extract subdirectory from the argument.
  6771. func_dirname "$arg" "/" ""
  6772. xdir=$func_dirname_result
  6773. test none = "$pic_object" || {
  6774. # Prepend the subdirectory the object is found in.
  6775. pic_object=$xdir$pic_object
  6776. if test dlfiles = "$prev"; then
  6777. if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
  6778. func_append dlfiles " $pic_object"
  6779. prev=
  6780. continue
  6781. else
  6782. # If libtool objects are unsupported, then we need to preload.
  6783. prev=dlprefiles
  6784. fi
  6785. fi
  6786. # CHECK ME: I think I busted this. -Ossama
  6787. if test dlprefiles = "$prev"; then
  6788. # Preload the old-style object.
  6789. func_append dlprefiles " $pic_object"
  6790. prev=
  6791. fi
  6792. # A PIC object.
  6793. func_append libobjs " $pic_object"
  6794. arg=$pic_object
  6795. }
  6796. # Non-PIC object.
  6797. if test none != "$non_pic_object"; then
  6798. # Prepend the subdirectory the object is found in.
  6799. non_pic_object=$xdir$non_pic_object
  6800. # A standard non-PIC object
  6801. func_append non_pic_objects " $non_pic_object"
  6802. if test -z "$pic_object" || test none = "$pic_object"; then
  6803. arg=$non_pic_object
  6804. fi
  6805. else
  6806. # If the PIC object exists, use it instead.
  6807. # $xdir was prepended to $pic_object above.
  6808. non_pic_object=$pic_object
  6809. func_append non_pic_objects " $non_pic_object"
  6810. fi
  6811. else
  6812. # Only an error if not doing a dry-run.
  6813. if $opt_dry_run; then
  6814. # Extract subdirectory from the argument.
  6815. func_dirname "$arg" "/" ""
  6816. xdir=$func_dirname_result
  6817. func_lo2o "$arg"
  6818. pic_object=$xdir$objdir/$func_lo2o_result
  6819. non_pic_object=$xdir$func_lo2o_result
  6820. func_append libobjs " $pic_object"
  6821. func_append non_pic_objects " $non_pic_object"
  6822. else
  6823. func_fatal_error "'$arg' is not a valid libtool object"
  6824. fi
  6825. fi
  6826. ;;
  6827. *.$libext)
  6828. # An archive.
  6829. func_append deplibs " $arg"
  6830. func_append old_deplibs " $arg"
  6831. continue
  6832. ;;
  6833. *.la)
  6834. # A libtool-controlled library.
  6835. func_resolve_sysroot "$arg"
  6836. if test dlfiles = "$prev"; then
  6837. # This library was specified with -dlopen.
  6838. func_append dlfiles " $func_resolve_sysroot_result"
  6839. prev=
  6840. elif test dlprefiles = "$prev"; then
  6841. # The library was specified with -dlpreopen.
  6842. func_append dlprefiles " $func_resolve_sysroot_result"
  6843. prev=
  6844. else
  6845. func_append deplibs " $func_resolve_sysroot_result"
  6846. fi
  6847. continue
  6848. ;;
  6849. # Some other compiler argument.
  6850. *)
  6851. # Unknown arguments in both finalize_command and compile_command need
  6852. # to be aesthetically quoted because they are evaled later.
  6853. func_quote_for_eval "$arg"
  6854. arg=$func_quote_for_eval_result
  6855. ;;
  6856. esac # arg
  6857. # Now actually substitute the argument into the commands.
  6858. if test -n "$arg"; then
  6859. func_append compile_command " $arg"
  6860. func_append finalize_command " $arg"
  6861. fi
  6862. done # argument parsing loop
  6863. test -n "$prev" && \
  6864. func_fatal_help "the '$prevarg' option requires an argument"
  6865. if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
  6866. eval arg=\"$export_dynamic_flag_spec\"
  6867. func_append compile_command " $arg"
  6868. func_append finalize_command " $arg"
  6869. fi
  6870. oldlibs=
  6871. # calculate the name of the file, without its directory
  6872. func_basename "$output"
  6873. outputname=$func_basename_result
  6874. libobjs_save=$libobjs
  6875. if test -n "$shlibpath_var"; then
  6876. # get the directories listed in $shlibpath_var
  6877. eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
  6878. else
  6879. shlib_search_path=
  6880. fi
  6881. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  6882. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  6883. # Definition is injected by LT_CONFIG during libtool generation.
  6884. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
  6885. func_dirname "$output" "/" ""
  6886. output_objdir=$func_dirname_result$objdir
  6887. func_to_tool_file "$output_objdir/"
  6888. tool_output_objdir=$func_to_tool_file_result
  6889. # Create the object directory.
  6890. func_mkdir_p "$output_objdir"
  6891. # Determine the type of output
  6892. case $output in
  6893. "")
  6894. func_fatal_help "you must specify an output file"
  6895. ;;
  6896. *.$libext) linkmode=oldlib ;;
  6897. *.lo | *.$objext) linkmode=obj ;;
  6898. *.la) linkmode=lib ;;
  6899. *) linkmode=prog ;; # Anything else should be a program.
  6900. esac
  6901. specialdeplibs=
  6902. libs=
  6903. # Find all interdependent deplibs by searching for libraries
  6904. # that are linked more than once (e.g. -la -lb -la)
  6905. for deplib in $deplibs; do
  6906. if $opt_preserve_dup_deps; then
  6907. case "$libs " in
  6908. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  6909. esac
  6910. fi
  6911. func_append libs " $deplib"
  6912. done
  6913. if test lib = "$linkmode"; then
  6914. libs="$predeps $libs $compiler_lib_search_path $postdeps"
  6915. # Compute libraries that are listed more than once in $predeps
  6916. # $postdeps and mark them as special (i.e., whose duplicates are
  6917. # not to be eliminated).
  6918. pre_post_deps=
  6919. if $opt_duplicate_compiler_generated_deps; then
  6920. for pre_post_dep in $predeps $postdeps; do
  6921. case "$pre_post_deps " in
  6922. *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
  6923. esac
  6924. func_append pre_post_deps " $pre_post_dep"
  6925. done
  6926. fi
  6927. pre_post_deps=
  6928. fi
  6929. deplibs=
  6930. newdependency_libs=
  6931. newlib_search_path=
  6932. need_relink=no # whether we're linking any uninstalled libtool libraries
  6933. notinst_deplibs= # not-installed libtool libraries
  6934. notinst_path= # paths that contain not-installed libtool libraries
  6935. case $linkmode in
  6936. lib)
  6937. passes="conv dlpreopen link"
  6938. for file in $dlfiles $dlprefiles; do
  6939. case $file in
  6940. *.la) ;;
  6941. *)
  6942. func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
  6943. ;;
  6944. esac
  6945. done
  6946. ;;
  6947. prog)
  6948. compile_deplibs=
  6949. finalize_deplibs=
  6950. alldeplibs=false
  6951. newdlfiles=
  6952. newdlprefiles=
  6953. passes="conv scan dlopen dlpreopen link"
  6954. ;;
  6955. *) passes="conv"
  6956. ;;
  6957. esac
  6958. for pass in $passes; do
  6959. # The preopen pass in lib mode reverses $deplibs; put it back here
  6960. # so that -L comes before libs that need it for instance...
  6961. if test lib,link = "$linkmode,$pass"; then
  6962. ## FIXME: Find the place where the list is rebuilt in the wrong
  6963. ## order, and fix it there properly
  6964. tmp_deplibs=
  6965. for deplib in $deplibs; do
  6966. tmp_deplibs="$deplib $tmp_deplibs"
  6967. done
  6968. deplibs=$tmp_deplibs
  6969. fi
  6970. if test lib,link = "$linkmode,$pass" ||
  6971. test prog,scan = "$linkmode,$pass"; then
  6972. libs=$deplibs
  6973. deplibs=
  6974. fi
  6975. if test prog = "$linkmode"; then
  6976. case $pass in
  6977. dlopen) libs=$dlfiles ;;
  6978. dlpreopen) libs=$dlprefiles ;;
  6979. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  6980. esac
  6981. fi
  6982. if test lib,dlpreopen = "$linkmode,$pass"; then
  6983. # Collect and forward deplibs of preopened libtool libs
  6984. for lib in $dlprefiles; do
  6985. # Ignore non-libtool-libs
  6986. dependency_libs=
  6987. func_resolve_sysroot "$lib"
  6988. case $lib in
  6989. *.la) func_source "$func_resolve_sysroot_result" ;;
  6990. esac
  6991. # Collect preopened libtool deplibs, except any this library
  6992. # has declared as weak libs
  6993. for deplib in $dependency_libs; do
  6994. func_basename "$deplib"
  6995. deplib_base=$func_basename_result
  6996. case " $weak_libs " in
  6997. *" $deplib_base "*) ;;
  6998. *) func_append deplibs " $deplib" ;;
  6999. esac
  7000. done
  7001. done
  7002. libs=$dlprefiles
  7003. fi
  7004. if test dlopen = "$pass"; then
  7005. # Collect dlpreopened libraries
  7006. save_deplibs=$deplibs
  7007. deplibs=
  7008. fi
  7009. for deplib in $libs; do
  7010. lib=
  7011. found=false
  7012. case $deplib in
  7013. -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
  7014. |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
  7015. if test prog,link = "$linkmode,$pass"; then
  7016. compile_deplibs="$deplib $compile_deplibs"
  7017. finalize_deplibs="$deplib $finalize_deplibs"
  7018. else
  7019. func_append compiler_flags " $deplib"
  7020. if test lib = "$linkmode"; then
  7021. case "$new_inherited_linker_flags " in
  7022. *" $deplib "*) ;;
  7023. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7024. esac
  7025. fi
  7026. fi
  7027. continue
  7028. ;;
  7029. -l*)
  7030. if test lib != "$linkmode" && test prog != "$linkmode"; then
  7031. func_warning "'-l' is ignored for archives/objects"
  7032. continue
  7033. fi
  7034. func_stripname '-l' '' "$deplib"
  7035. name=$func_stripname_result
  7036. if test lib = "$linkmode"; then
  7037. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  7038. else
  7039. searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
  7040. fi
  7041. for searchdir in $searchdirs; do
  7042. for search_ext in .la $std_shrext .so .a; do
  7043. # Search the libtool library
  7044. lib=$searchdir/lib$name$search_ext
  7045. if test -f "$lib"; then
  7046. if test .la = "$search_ext"; then
  7047. found=:
  7048. else
  7049. found=false
  7050. fi
  7051. break 2
  7052. fi
  7053. done
  7054. done
  7055. if $found; then
  7056. # deplib is a libtool library
  7057. # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
  7058. # We need to do some special things here, and not later.
  7059. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  7060. case " $predeps $postdeps " in
  7061. *" $deplib "*)
  7062. if func_lalib_p "$lib"; then
  7063. library_names=
  7064. old_library=
  7065. func_source "$lib"
  7066. for l in $old_library $library_names; do
  7067. ll=$l
  7068. done
  7069. if test "X$ll" = "X$old_library"; then # only static version available
  7070. found=false
  7071. func_dirname "$lib" "" "."
  7072. ladir=$func_dirname_result
  7073. lib=$ladir/$old_library
  7074. if test prog,link = "$linkmode,$pass"; then
  7075. compile_deplibs="$deplib $compile_deplibs"
  7076. finalize_deplibs="$deplib $finalize_deplibs"
  7077. else
  7078. deplibs="$deplib $deplibs"
  7079. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7080. fi
  7081. continue
  7082. fi
  7083. fi
  7084. ;;
  7085. *) ;;
  7086. esac
  7087. fi
  7088. else
  7089. # deplib doesn't seem to be a libtool library
  7090. if test prog,link = "$linkmode,$pass"; then
  7091. compile_deplibs="$deplib $compile_deplibs"
  7092. finalize_deplibs="$deplib $finalize_deplibs"
  7093. else
  7094. deplibs="$deplib $deplibs"
  7095. test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
  7096. fi
  7097. continue
  7098. fi
  7099. ;; # -l
  7100. *.ltframework)
  7101. if test prog,link = "$linkmode,$pass"; then
  7102. compile_deplibs="$deplib $compile_deplibs"
  7103. finalize_deplibs="$deplib $finalize_deplibs"
  7104. else
  7105. deplibs="$deplib $deplibs"
  7106. if test lib = "$linkmode"; then
  7107. case "$new_inherited_linker_flags " in
  7108. *" $deplib "*) ;;
  7109. * ) func_append new_inherited_linker_flags " $deplib" ;;
  7110. esac
  7111. fi
  7112. fi
  7113. continue
  7114. ;;
  7115. -L*)
  7116. case $linkmode in
  7117. lib)
  7118. deplibs="$deplib $deplibs"
  7119. test conv = "$pass" && continue
  7120. newdependency_libs="$deplib $newdependency_libs"
  7121. func_stripname '-L' '' "$deplib"
  7122. func_resolve_sysroot "$func_stripname_result"
  7123. func_append newlib_search_path " $func_resolve_sysroot_result"
  7124. ;;
  7125. prog)
  7126. if test conv = "$pass"; then
  7127. deplibs="$deplib $deplibs"
  7128. continue
  7129. fi
  7130. if test scan = "$pass"; then
  7131. deplibs="$deplib $deplibs"
  7132. else
  7133. compile_deplibs="$deplib $compile_deplibs"
  7134. finalize_deplibs="$deplib $finalize_deplibs"
  7135. fi
  7136. func_stripname '-L' '' "$deplib"
  7137. func_resolve_sysroot "$func_stripname_result"
  7138. func_append newlib_search_path " $func_resolve_sysroot_result"
  7139. ;;
  7140. *)
  7141. func_warning "'-L' is ignored for archives/objects"
  7142. ;;
  7143. esac # linkmode
  7144. continue
  7145. ;; # -L
  7146. -R*)
  7147. if test link = "$pass"; then
  7148. func_stripname '-R' '' "$deplib"
  7149. func_resolve_sysroot "$func_stripname_result"
  7150. dir=$func_resolve_sysroot_result
  7151. # Make sure the xrpath contains only unique directories.
  7152. case "$xrpath " in
  7153. *" $dir "*) ;;
  7154. *) func_append xrpath " $dir" ;;
  7155. esac
  7156. fi
  7157. deplibs="$deplib $deplibs"
  7158. continue
  7159. ;;
  7160. *.la)
  7161. func_resolve_sysroot "$deplib"
  7162. lib=$func_resolve_sysroot_result
  7163. ;;
  7164. *.$libext)
  7165. if test conv = "$pass"; then
  7166. deplibs="$deplib $deplibs"
  7167. continue
  7168. fi
  7169. case $linkmode in
  7170. lib)
  7171. # Linking convenience modules into shared libraries is allowed,
  7172. # but linking other static libraries is non-portable.
  7173. case " $dlpreconveniencelibs " in
  7174. *" $deplib "*) ;;
  7175. *)
  7176. valid_a_lib=false
  7177. case $deplibs_check_method in
  7178. match_pattern*)
  7179. set dummy $deplibs_check_method; shift
  7180. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  7181. if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
  7182. | $EGREP "$match_pattern_regex" > /dev/null; then
  7183. valid_a_lib=:
  7184. fi
  7185. ;;
  7186. pass_all)
  7187. valid_a_lib=:
  7188. ;;
  7189. esac
  7190. if $valid_a_lib; then
  7191. echo
  7192. $ECHO "*** Warning: Linking the shared library $output against the"
  7193. $ECHO "*** static library $deplib is not portable!"
  7194. deplibs="$deplib $deplibs"
  7195. else
  7196. echo
  7197. $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  7198. echo "*** I have the capability to make that library automatically link in when"
  7199. echo "*** you link to this library. But I can only do this if you have a"
  7200. echo "*** shared version of the library, which you do not appear to have"
  7201. echo "*** because the file extensions .$libext of this argument makes me believe"
  7202. echo "*** that it is just a static archive that I should not use here."
  7203. fi
  7204. ;;
  7205. esac
  7206. continue
  7207. ;;
  7208. prog)
  7209. if test link != "$pass"; then
  7210. deplibs="$deplib $deplibs"
  7211. else
  7212. compile_deplibs="$deplib $compile_deplibs"
  7213. finalize_deplibs="$deplib $finalize_deplibs"
  7214. fi
  7215. continue
  7216. ;;
  7217. esac # linkmode
  7218. ;; # *.$libext
  7219. *.lo | *.$objext)
  7220. if test conv = "$pass"; then
  7221. deplibs="$deplib $deplibs"
  7222. elif test prog = "$linkmode"; then
  7223. if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
  7224. # If there is no dlopen support or we're linking statically,
  7225. # we need to preload.
  7226. func_append newdlprefiles " $deplib"
  7227. compile_deplibs="$deplib $compile_deplibs"
  7228. finalize_deplibs="$deplib $finalize_deplibs"
  7229. else
  7230. func_append newdlfiles " $deplib"
  7231. fi
  7232. fi
  7233. continue
  7234. ;;
  7235. %DEPLIBS%)
  7236. alldeplibs=:
  7237. continue
  7238. ;;
  7239. esac # case $deplib
  7240. $found || test -f "$lib" \
  7241. || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
  7242. # Check to see that this really is a libtool archive.
  7243. func_lalib_unsafe_p "$lib" \
  7244. || func_fatal_error "'$lib' is not a valid libtool archive"
  7245. func_dirname "$lib" "" "."
  7246. ladir=$func_dirname_result
  7247. dlname=
  7248. dlopen=
  7249. dlpreopen=
  7250. libdir=
  7251. library_names=
  7252. old_library=
  7253. inherited_linker_flags=
  7254. # If the library was installed with an old release of libtool,
  7255. # it will not redefine variables installed, or shouldnotlink
  7256. installed=yes
  7257. shouldnotlink=no
  7258. avoidtemprpath=
  7259. # Read the .la file
  7260. func_source "$lib"
  7261. # Convert "-framework foo" to "foo.ltframework"
  7262. if test -n "$inherited_linker_flags"; then
  7263. tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
  7264. for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  7265. case " $new_inherited_linker_flags " in
  7266. *" $tmp_inherited_linker_flag "*) ;;
  7267. *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
  7268. esac
  7269. done
  7270. fi
  7271. dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7272. if test lib,link = "$linkmode,$pass" ||
  7273. test prog,scan = "$linkmode,$pass" ||
  7274. { test prog != "$linkmode" && test lib != "$linkmode"; }; then
  7275. test -n "$dlopen" && func_append dlfiles " $dlopen"
  7276. test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
  7277. fi
  7278. if test conv = "$pass"; then
  7279. # Only check for convenience libraries
  7280. deplibs="$lib $deplibs"
  7281. if test -z "$libdir"; then
  7282. if test -z "$old_library"; then
  7283. func_fatal_error "cannot find name of link library for '$lib'"
  7284. fi
  7285. # It is a libtool convenience library, so add in its objects.
  7286. func_append convenience " $ladir/$objdir/$old_library"
  7287. func_append old_convenience " $ladir/$objdir/$old_library"
  7288. elif test prog != "$linkmode" && test lib != "$linkmode"; then
  7289. func_fatal_error "'$lib' is not a convenience library"
  7290. fi
  7291. tmp_libs=
  7292. for deplib in $dependency_libs; do
  7293. deplibs="$deplib $deplibs"
  7294. if $opt_preserve_dup_deps; then
  7295. case "$tmp_libs " in
  7296. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7297. esac
  7298. fi
  7299. func_append tmp_libs " $deplib"
  7300. done
  7301. continue
  7302. fi # $pass = conv
  7303. # Get the name of the library we link against.
  7304. linklib=
  7305. if test -n "$old_library" &&
  7306. { test yes = "$prefer_static_libs" ||
  7307. test built,no = "$prefer_static_libs,$installed"; }; then
  7308. linklib=$old_library
  7309. else
  7310. for l in $old_library $library_names; do
  7311. linklib=$l
  7312. done
  7313. fi
  7314. if test -z "$linklib"; then
  7315. func_fatal_error "cannot find name of link library for '$lib'"
  7316. fi
  7317. # This library was specified with -dlopen.
  7318. if test dlopen = "$pass"; then
  7319. test -z "$libdir" \
  7320. && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
  7321. if test -z "$dlname" ||
  7322. test yes != "$dlopen_support" ||
  7323. test no = "$build_libtool_libs"
  7324. then
  7325. # If there is no dlname, no dlopen support or we're linking
  7326. # statically, we need to preload. We also need to preload any
  7327. # dependent libraries so libltdl's deplib preloader doesn't
  7328. # bomb out in the load deplibs phase.
  7329. func_append dlprefiles " $lib $dependency_libs"
  7330. else
  7331. func_append newdlfiles " $lib"
  7332. fi
  7333. continue
  7334. fi # $pass = dlopen
  7335. # We need an absolute path.
  7336. case $ladir in
  7337. [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
  7338. *)
  7339. abs_ladir=`cd "$ladir" && pwd`
  7340. if test -z "$abs_ladir"; then
  7341. func_warning "cannot determine absolute directory name of '$ladir'"
  7342. func_warning "passing it literally to the linker, although it might fail"
  7343. abs_ladir=$ladir
  7344. fi
  7345. ;;
  7346. esac
  7347. func_basename "$lib"
  7348. laname=$func_basename_result
  7349. # Find the relevant object directory and library name.
  7350. if test yes = "$installed"; then
  7351. if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7352. func_warning "library '$lib' was moved."
  7353. dir=$ladir
  7354. absdir=$abs_ladir
  7355. libdir=$abs_ladir
  7356. else
  7357. dir=$lt_sysroot$libdir
  7358. absdir=$lt_sysroot$libdir
  7359. fi
  7360. test yes = "$hardcode_automatic" && avoidtemprpath=yes
  7361. else
  7362. if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  7363. dir=$ladir
  7364. absdir=$abs_ladir
  7365. # Remove this search path later
  7366. func_append notinst_path " $abs_ladir"
  7367. else
  7368. dir=$ladir/$objdir
  7369. absdir=$abs_ladir/$objdir
  7370. # Remove this search path later
  7371. func_append notinst_path " $abs_ladir"
  7372. fi
  7373. fi # $installed = yes
  7374. func_stripname 'lib' '.la' "$laname"
  7375. name=$func_stripname_result
  7376. # This library was specified with -dlpreopen.
  7377. if test dlpreopen = "$pass"; then
  7378. if test -z "$libdir" && test prog = "$linkmode"; then
  7379. func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
  7380. fi
  7381. case $host in
  7382. # special handling for platforms with PE-DLLs.
  7383. *cygwin* | *mingw* | *cegcc* )
  7384. # Linker will automatically link against shared library if both
  7385. # static and shared are present. Therefore, ensure we extract
  7386. # symbols from the import library if a shared library is present
  7387. # (otherwise, the dlopen module name will be incorrect). We do
  7388. # this by putting the import library name into $newdlprefiles.
  7389. # We recover the dlopen module name by 'saving' the la file
  7390. # name in a special purpose variable, and (later) extracting the
  7391. # dlname from the la file.
  7392. if test -n "$dlname"; then
  7393. func_tr_sh "$dir/$linklib"
  7394. eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
  7395. func_append newdlprefiles " $dir/$linklib"
  7396. else
  7397. func_append newdlprefiles " $dir/$old_library"
  7398. # Keep a list of preopened convenience libraries to check
  7399. # that they are being used correctly in the link pass.
  7400. test -z "$libdir" && \
  7401. func_append dlpreconveniencelibs " $dir/$old_library"
  7402. fi
  7403. ;;
  7404. * )
  7405. # Prefer using a static library (so that no silly _DYNAMIC symbols
  7406. # are required to link).
  7407. if test -n "$old_library"; then
  7408. func_append newdlprefiles " $dir/$old_library"
  7409. # Keep a list of preopened convenience libraries to check
  7410. # that they are being used correctly in the link pass.
  7411. test -z "$libdir" && \
  7412. func_append dlpreconveniencelibs " $dir/$old_library"
  7413. # Otherwise, use the dlname, so that lt_dlopen finds it.
  7414. elif test -n "$dlname"; then
  7415. func_append newdlprefiles " $dir/$dlname"
  7416. else
  7417. func_append newdlprefiles " $dir/$linklib"
  7418. fi
  7419. ;;
  7420. esac
  7421. fi # $pass = dlpreopen
  7422. if test -z "$libdir"; then
  7423. # Link the convenience library
  7424. if test lib = "$linkmode"; then
  7425. deplibs="$dir/$old_library $deplibs"
  7426. elif test prog,link = "$linkmode,$pass"; then
  7427. compile_deplibs="$dir/$old_library $compile_deplibs"
  7428. finalize_deplibs="$dir/$old_library $finalize_deplibs"
  7429. else
  7430. deplibs="$lib $deplibs" # used for prog,scan pass
  7431. fi
  7432. continue
  7433. fi
  7434. if test prog = "$linkmode" && test link != "$pass"; then
  7435. func_append newlib_search_path " $ladir"
  7436. deplibs="$lib $deplibs"
  7437. linkalldeplibs=false
  7438. if test no != "$link_all_deplibs" || test -z "$library_names" ||
  7439. test no = "$build_libtool_libs"; then
  7440. linkalldeplibs=:
  7441. fi
  7442. tmp_libs=
  7443. for deplib in $dependency_libs; do
  7444. case $deplib in
  7445. -L*) func_stripname '-L' '' "$deplib"
  7446. func_resolve_sysroot "$func_stripname_result"
  7447. func_append newlib_search_path " $func_resolve_sysroot_result"
  7448. ;;
  7449. esac
  7450. # Need to link against all dependency_libs?
  7451. if $linkalldeplibs; then
  7452. deplibs="$deplib $deplibs"
  7453. else
  7454. # Need to hardcode shared library paths
  7455. # or/and link against static libraries
  7456. newdependency_libs="$deplib $newdependency_libs"
  7457. fi
  7458. if $opt_preserve_dup_deps; then
  7459. case "$tmp_libs " in
  7460. *" $deplib "*) func_append specialdeplibs " $deplib" ;;
  7461. esac
  7462. fi
  7463. func_append tmp_libs " $deplib"
  7464. done # for deplib
  7465. continue
  7466. fi # $linkmode = prog...
  7467. if test prog,link = "$linkmode,$pass"; then
  7468. if test -n "$library_names" &&
  7469. { { test no = "$prefer_static_libs" ||
  7470. test built,yes = "$prefer_static_libs,$installed"; } ||
  7471. test -z "$old_library"; }; then
  7472. # We need to hardcode the library path
  7473. if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
  7474. # Make sure the rpath contains only unique directories.
  7475. case $temp_rpath: in
  7476. *"$absdir:"*) ;;
  7477. *) func_append temp_rpath "$absdir:" ;;
  7478. esac
  7479. fi
  7480. # Hardcode the library path.
  7481. # Skip directories that are in the system default run-time
  7482. # search path.
  7483. case " $sys_lib_dlsearch_path " in
  7484. *" $absdir "*) ;;
  7485. *)
  7486. case "$compile_rpath " in
  7487. *" $absdir "*) ;;
  7488. *) func_append compile_rpath " $absdir" ;;
  7489. esac
  7490. ;;
  7491. esac
  7492. case " $sys_lib_dlsearch_path " in
  7493. *" $libdir "*) ;;
  7494. *)
  7495. case "$finalize_rpath " in
  7496. *" $libdir "*) ;;
  7497. *) func_append finalize_rpath " $libdir" ;;
  7498. esac
  7499. ;;
  7500. esac
  7501. fi # $linkmode,$pass = prog,link...
  7502. if $alldeplibs &&
  7503. { test pass_all = "$deplibs_check_method" ||
  7504. { test yes = "$build_libtool_libs" &&
  7505. test -n "$library_names"; }; }; then
  7506. # We only need to search for static libraries
  7507. continue
  7508. fi
  7509. fi
  7510. link_static=no # Whether the deplib will be linked statically
  7511. use_static_libs=$prefer_static_libs
  7512. if test built = "$use_static_libs" && test yes = "$installed"; then
  7513. use_static_libs=no
  7514. fi
  7515. if test -n "$library_names" &&
  7516. { test no = "$use_static_libs" || test -z "$old_library"; }; then
  7517. case $host in
  7518. *nios2*)
  7519. # For NIOS2, we want to make sure that it's not caught by the
  7520. # more general OS/2 check below. Otherwise, NIOS2 is the same
  7521. # as the default option.
  7522. if test no = "$installed"; then
  7523. func_append notinst_deplibs " $lib"
  7524. need_relink=yes
  7525. fi
  7526. ;;
  7527. *cygwin* | *mingw* | *cegcc* | *os2*)
  7528. # No point in relinking DLLs because paths are not encoded
  7529. func_append notinst_deplibs " $lib"
  7530. need_relink=no
  7531. ;;
  7532. *)
  7533. if test no = "$installed"; then
  7534. func_append notinst_deplibs " $lib"
  7535. need_relink=yes
  7536. fi
  7537. ;;
  7538. esac
  7539. # This is a shared library
  7540. # Warn about portability, can't link against -module's on some
  7541. # systems (darwin). Don't bleat about dlopened modules though!
  7542. dlopenmodule=
  7543. for dlpremoduletest in $dlprefiles; do
  7544. if test "X$dlpremoduletest" = "X$lib"; then
  7545. dlopenmodule=$dlpremoduletest
  7546. break
  7547. fi
  7548. done
  7549. if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
  7550. echo
  7551. if test prog = "$linkmode"; then
  7552. $ECHO "*** Warning: Linking the executable $output against the loadable module"
  7553. else
  7554. $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  7555. fi
  7556. $ECHO "*** $linklib is not portable!"
  7557. fi
  7558. if test lib = "$linkmode" &&
  7559. test yes = "$hardcode_into_libs"; then
  7560. # Hardcode the library path.
  7561. # Skip directories that are in the system default run-time
  7562. # search path.
  7563. case " $sys_lib_dlsearch_path " in
  7564. *" $absdir "*) ;;
  7565. *)
  7566. case "$compile_rpath " in
  7567. *" $absdir "*) ;;
  7568. *) func_append compile_rpath " $absdir" ;;
  7569. esac
  7570. ;;
  7571. esac
  7572. case " $sys_lib_dlsearch_path " in
  7573. *" $libdir "*) ;;
  7574. *)
  7575. case "$finalize_rpath " in
  7576. *" $libdir "*) ;;
  7577. *) func_append finalize_rpath " $libdir" ;;
  7578. esac
  7579. ;;
  7580. esac
  7581. fi
  7582. if test -n "$old_archive_from_expsyms_cmds"; then
  7583. # figure out the soname
  7584. set dummy $library_names
  7585. shift
  7586. realname=$1
  7587. shift
  7588. libname=`eval "\\$ECHO \"$libname_spec\""`
  7589. # use dlname if we got it. it's perfectly good, no?
  7590. if test -n "$dlname"; then
  7591. soname=$dlname
  7592. elif test -n "$soname_spec"; then
  7593. # bleh windows
  7594. case $host in
  7595. *nios2*)
  7596. # For NIOS2, we want to make sure that it's not caught by the
  7597. # more general OS/2 check below. Otherwise, NIOS2 is the same
  7598. # as the default option.
  7599. ;;
  7600. *cygwin* | mingw* | *cegcc* | *os2*)
  7601. func_arith $current - $age
  7602. major=$func_arith_result
  7603. versuffix=-$major
  7604. ;;
  7605. esac
  7606. eval soname=\"$soname_spec\"
  7607. else
  7608. soname=$realname
  7609. fi
  7610. # Make a new name for the extract_expsyms_cmds to use
  7611. soroot=$soname
  7612. func_basename "$soroot"
  7613. soname=$func_basename_result
  7614. func_stripname 'lib' '.dll' "$soname"
  7615. newlib=libimp-$func_stripname_result.a
  7616. # If the library has no export list, then create one now
  7617. if test -f "$output_objdir/$soname-def"; then :
  7618. else
  7619. func_verbose "extracting exported symbol list from '$soname'"
  7620. func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  7621. fi
  7622. # Create $newlib
  7623. if test -f "$output_objdir/$newlib"; then :; else
  7624. func_verbose "generating import library for '$soname'"
  7625. func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  7626. fi
  7627. # make sure the library variables are pointing to the new library
  7628. dir=$output_objdir
  7629. linklib=$newlib
  7630. fi # test -n "$old_archive_from_expsyms_cmds"
  7631. if test prog = "$linkmode" || test relink != "$opt_mode"; then
  7632. add_shlibpath=
  7633. add_dir=
  7634. add=
  7635. lib_linked=yes
  7636. case $hardcode_action in
  7637. immediate | unsupported)
  7638. if test no = "$hardcode_direct"; then
  7639. add=$dir/$linklib
  7640. case $host in
  7641. *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
  7642. *-*-sysv4*uw2*) add_dir=-L$dir ;;
  7643. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  7644. *-*-unixware7*) add_dir=-L$dir ;;
  7645. *-*-darwin* )
  7646. # if the lib is a (non-dlopened) module then we cannot
  7647. # link against it, someone is ignoring the earlier warnings
  7648. if /usr/bin/file -L $add 2> /dev/null |
  7649. $GREP ": [^:]* bundle" >/dev/null; then
  7650. if test "X$dlopenmodule" != "X$lib"; then
  7651. $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  7652. if test -z "$old_library"; then
  7653. echo
  7654. echo "*** And there doesn't seem to be a static archive available"
  7655. echo "*** The link will probably fail, sorry"
  7656. else
  7657. add=$dir/$old_library
  7658. fi
  7659. elif test -n "$old_library"; then
  7660. add=$dir/$old_library
  7661. fi
  7662. fi
  7663. esac
  7664. elif test no = "$hardcode_minus_L"; then
  7665. case $host in
  7666. *-*-sunos*) add_shlibpath=$dir ;;
  7667. esac
  7668. add_dir=-L$dir
  7669. add=-l$name
  7670. elif test no = "$hardcode_shlibpath_var"; then
  7671. add_shlibpath=$dir
  7672. add=-l$name
  7673. else
  7674. lib_linked=no
  7675. fi
  7676. ;;
  7677. relink)
  7678. if test yes = "$hardcode_direct" &&
  7679. test no = "$hardcode_direct_absolute"; then
  7680. add=$dir/$linklib
  7681. elif test yes = "$hardcode_minus_L"; then
  7682. add_dir=-L$absdir
  7683. # Try looking first in the location we're being installed to.
  7684. if test -n "$inst_prefix_dir"; then
  7685. case $libdir in
  7686. [\\/]*)
  7687. func_append add_dir " -L$inst_prefix_dir$libdir"
  7688. ;;
  7689. esac
  7690. fi
  7691. add=-l$name
  7692. elif test yes = "$hardcode_shlibpath_var"; then
  7693. add_shlibpath=$dir
  7694. add=-l$name
  7695. else
  7696. lib_linked=no
  7697. fi
  7698. ;;
  7699. *) lib_linked=no ;;
  7700. esac
  7701. if test yes != "$lib_linked"; then
  7702. func_fatal_configuration "unsupported hardcode properties"
  7703. fi
  7704. if test -n "$add_shlibpath"; then
  7705. case :$compile_shlibpath: in
  7706. *":$add_shlibpath:"*) ;;
  7707. *) func_append compile_shlibpath "$add_shlibpath:" ;;
  7708. esac
  7709. fi
  7710. if test prog = "$linkmode"; then
  7711. test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
  7712. test -n "$add" && compile_deplibs="$add $compile_deplibs"
  7713. else
  7714. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7715. test -n "$add" && deplibs="$add $deplibs"
  7716. if test yes != "$hardcode_direct" &&
  7717. test yes != "$hardcode_minus_L" &&
  7718. test yes = "$hardcode_shlibpath_var"; then
  7719. case :$finalize_shlibpath: in
  7720. *":$libdir:"*) ;;
  7721. *) func_append finalize_shlibpath "$libdir:" ;;
  7722. esac
  7723. fi
  7724. fi
  7725. fi
  7726. if test prog = "$linkmode" || test relink = "$opt_mode"; then
  7727. add_shlibpath=
  7728. add_dir=
  7729. add=
  7730. # Finalize command for both is simple: just hardcode it.
  7731. if test yes = "$hardcode_direct" &&
  7732. test no = "$hardcode_direct_absolute"; then
  7733. add=$libdir/$linklib
  7734. elif test yes = "$hardcode_minus_L"; then
  7735. add_dir=-L$libdir
  7736. add=-l$name
  7737. elif test yes = "$hardcode_shlibpath_var"; then
  7738. case :$finalize_shlibpath: in
  7739. *":$libdir:"*) ;;
  7740. *) func_append finalize_shlibpath "$libdir:" ;;
  7741. esac
  7742. add=-l$name
  7743. elif test yes = "$hardcode_automatic"; then
  7744. if test -n "$inst_prefix_dir" &&
  7745. test -f "$inst_prefix_dir$libdir/$linklib"; then
  7746. add=$inst_prefix_dir$libdir/$linklib
  7747. else
  7748. add=$libdir/$linklib
  7749. fi
  7750. else
  7751. # We cannot seem to hardcode it, guess we'll fake it.
  7752. add_dir="-L$lt_sysroot$libdir"
  7753. # Try looking first in the location we're being installed to.
  7754. if test -n "$inst_prefix_dir"; then
  7755. case $libdir in
  7756. [\\/]*)
  7757. func_append add_dir " -L$inst_prefix_dir$libdir"
  7758. ;;
  7759. esac
  7760. fi
  7761. add=-l$name
  7762. fi
  7763. if test prog = "$linkmode"; then
  7764. test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
  7765. test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
  7766. else
  7767. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  7768. test -n "$add" && deplibs="$add $deplibs"
  7769. fi
  7770. fi
  7771. elif test prog = "$linkmode"; then
  7772. # Here we assume that one of hardcode_direct or hardcode_minus_L
  7773. # is not unsupported. This is valid on all known static and
  7774. # shared platforms.
  7775. if test unsupported != "$hardcode_direct"; then
  7776. test -n "$old_library" && linklib=$old_library
  7777. compile_deplibs="$dir/$linklib $compile_deplibs"
  7778. finalize_deplibs="$dir/$linklib $finalize_deplibs"
  7779. else
  7780. compile_deplibs="-l$name -L$dir $compile_deplibs"
  7781. finalize_deplibs="-l$name -L$dir $finalize_deplibs"
  7782. fi
  7783. elif test yes = "$build_libtool_libs"; then
  7784. # Not a shared library
  7785. if test pass_all != "$deplibs_check_method"; then
  7786. # We're trying link a shared library against a static one
  7787. # but the system doesn't support it.
  7788. # Just print a warning and add the library to dependency_libs so
  7789. # that the program can be linked against the static library.
  7790. echo
  7791. $ECHO "*** Warning: This system cannot link to static lib archive $lib."
  7792. echo "*** I have the capability to make that library automatically link in when"
  7793. echo "*** you link to this library. But I can only do this if you have a"
  7794. echo "*** shared version of the library, which you do not appear to have."
  7795. if test yes = "$module"; then
  7796. echo "*** But as you try to build a module library, libtool will still create "
  7797. echo "*** a static module, that should work as long as the dlopening application"
  7798. echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  7799. if test -z "$global_symbol_pipe"; then
  7800. echo
  7801. echo "*** However, this would only work if libtool was able to extract symbol"
  7802. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  7803. echo "*** not find such a program. So, this module is probably useless."
  7804. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  7805. fi
  7806. if test no = "$build_old_libs"; then
  7807. build_libtool_libs=module
  7808. build_old_libs=yes
  7809. else
  7810. build_libtool_libs=no
  7811. fi
  7812. fi
  7813. else
  7814. deplibs="$dir/$old_library $deplibs"
  7815. link_static=yes
  7816. fi
  7817. fi # link shared/static library?
  7818. if test lib = "$linkmode"; then
  7819. if test -n "$dependency_libs" &&
  7820. { test yes != "$hardcode_into_libs" ||
  7821. test yes = "$build_old_libs" ||
  7822. test yes = "$link_static"; }; then
  7823. # Extract -R from dependency_libs
  7824. temp_deplibs=
  7825. for libdir in $dependency_libs; do
  7826. case $libdir in
  7827. -R*) func_stripname '-R' '' "$libdir"
  7828. temp_xrpath=$func_stripname_result
  7829. case " $xrpath " in
  7830. *" $temp_xrpath "*) ;;
  7831. *) func_append xrpath " $temp_xrpath";;
  7832. esac;;
  7833. *) func_append temp_deplibs " $libdir";;
  7834. esac
  7835. done
  7836. dependency_libs=$temp_deplibs
  7837. fi
  7838. func_append newlib_search_path " $absdir"
  7839. # Link against this library
  7840. test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
  7841. # ... and its dependency_libs
  7842. tmp_libs=
  7843. for deplib in $dependency_libs; do
  7844. newdependency_libs="$deplib $newdependency_libs"
  7845. case $deplib in
  7846. -L*) func_stripname '-L' '' "$deplib"
  7847. func_resolve_sysroot "$func_stripname_result";;
  7848. *) func_resolve_sysroot "$deplib" ;;
  7849. esac
  7850. if $opt_preserve_dup_deps; then
  7851. case "$tmp_libs " in
  7852. *" $func_resolve_sysroot_result "*)
  7853. func_append specialdeplibs " $func_resolve_sysroot_result" ;;
  7854. esac
  7855. fi
  7856. func_append tmp_libs " $func_resolve_sysroot_result"
  7857. done
  7858. if test no != "$link_all_deplibs"; then
  7859. # Add the search paths of all dependency libraries
  7860. for deplib in $dependency_libs; do
  7861. path=
  7862. case $deplib in
  7863. -L*) path=$deplib ;;
  7864. *.la)
  7865. func_resolve_sysroot "$deplib"
  7866. deplib=$func_resolve_sysroot_result
  7867. func_dirname "$deplib" "" "."
  7868. dir=$func_dirname_result
  7869. # We need an absolute path.
  7870. case $dir in
  7871. [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
  7872. *)
  7873. absdir=`cd "$dir" && pwd`
  7874. if test -z "$absdir"; then
  7875. func_warning "cannot determine absolute directory name of '$dir'"
  7876. absdir=$dir
  7877. fi
  7878. ;;
  7879. esac
  7880. if $GREP "^installed=no" $deplib > /dev/null; then
  7881. case $host in
  7882. *-*-darwin*)
  7883. depdepl=
  7884. eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  7885. if test -n "$deplibrary_names"; then
  7886. for tmp in $deplibrary_names; do
  7887. depdepl=$tmp
  7888. done
  7889. if test -f "$absdir/$objdir/$depdepl"; then
  7890. depdepl=$absdir/$objdir/$depdepl
  7891. darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  7892. if test -z "$darwin_install_name"; then
  7893. darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  7894. fi
  7895. func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
  7896. func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
  7897. path=
  7898. fi
  7899. fi
  7900. ;;
  7901. *)
  7902. path=-L$absdir/$objdir
  7903. ;;
  7904. esac
  7905. else
  7906. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  7907. test -z "$libdir" && \
  7908. func_fatal_error "'$deplib' is not a valid libtool archive"
  7909. test "$absdir" != "$libdir" && \
  7910. func_warning "'$deplib' seems to be moved"
  7911. path=-L$absdir
  7912. fi
  7913. ;;
  7914. esac
  7915. case " $deplibs " in
  7916. *" $path "*) ;;
  7917. *) deplibs="$path $deplibs" ;;
  7918. esac
  7919. done
  7920. fi # link_all_deplibs != no
  7921. fi # linkmode = lib
  7922. done # for deplib in $libs
  7923. if test link = "$pass"; then
  7924. if test prog = "$linkmode"; then
  7925. compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  7926. finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  7927. else
  7928. compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  7929. fi
  7930. fi
  7931. dependency_libs=$newdependency_libs
  7932. if test dlpreopen = "$pass"; then
  7933. # Link the dlpreopened libraries before other libraries
  7934. for deplib in $save_deplibs; do
  7935. deplibs="$deplib $deplibs"
  7936. done
  7937. fi
  7938. if test dlopen != "$pass"; then
  7939. test conv = "$pass" || {
  7940. # Make sure lib_search_path contains only unique directories.
  7941. lib_search_path=
  7942. for dir in $newlib_search_path; do
  7943. case "$lib_search_path " in
  7944. *" $dir "*) ;;
  7945. *) func_append lib_search_path " $dir" ;;
  7946. esac
  7947. done
  7948. newlib_search_path=
  7949. }
  7950. if test prog,link = "$linkmode,$pass"; then
  7951. vars="compile_deplibs finalize_deplibs"
  7952. else
  7953. vars=deplibs
  7954. fi
  7955. for var in $vars dependency_libs; do
  7956. # Add libraries to $var in reverse order
  7957. eval tmp_libs=\"\$$var\"
  7958. new_libs=
  7959. for deplib in $tmp_libs; do
  7960. # FIXME: Pedantically, this is the right thing to do, so
  7961. # that some nasty dependency loop isn't accidentally
  7962. # broken:
  7963. #new_libs="$deplib $new_libs"
  7964. # Pragmatically, this seems to cause very few problems in
  7965. # practice:
  7966. case $deplib in
  7967. -L*) new_libs="$deplib $new_libs" ;;
  7968. -R*) ;;
  7969. *)
  7970. # And here is the reason: when a library appears more
  7971. # than once as an explicit dependence of a library, or
  7972. # is implicitly linked in more than once by the
  7973. # compiler, it is considered special, and multiple
  7974. # occurrences thereof are not removed. Compare this
  7975. # with having the same library being listed as a
  7976. # dependency of multiple other libraries: in this case,
  7977. # we know (pedantically, we assume) the library does not
  7978. # need to be listed more than once, so we keep only the
  7979. # last copy. This is not always right, but it is rare
  7980. # enough that we require users that really mean to play
  7981. # such unportable linking tricks to link the library
  7982. # using -Wl,-lname, so that libtool does not consider it
  7983. # for duplicate removal.
  7984. case " $specialdeplibs " in
  7985. *" $deplib "*) new_libs="$deplib $new_libs" ;;
  7986. *)
  7987. case " $new_libs " in
  7988. *" $deplib "*) ;;
  7989. *) new_libs="$deplib $new_libs" ;;
  7990. esac
  7991. ;;
  7992. esac
  7993. ;;
  7994. esac
  7995. done
  7996. tmp_libs=
  7997. for deplib in $new_libs; do
  7998. case $deplib in
  7999. -L*)
  8000. case " $tmp_libs " in
  8001. *" $deplib "*) ;;
  8002. *) func_append tmp_libs " $deplib" ;;
  8003. esac
  8004. ;;
  8005. *) func_append tmp_libs " $deplib" ;;
  8006. esac
  8007. done
  8008. eval $var=\"$tmp_libs\"
  8009. done # for var
  8010. fi
  8011. # Add Sun CC postdeps if required:
  8012. test CXX = "$tagname" && {
  8013. case $host_os in
  8014. linux*)
  8015. case `$CC -V 2>&1 | sed 5q` in
  8016. *Sun\ C*) # Sun C++ 5.9
  8017. func_suncc_cstd_abi
  8018. if test no != "$suncc_use_cstd_abi"; then
  8019. func_append postdeps ' -library=Cstd -library=Crun'
  8020. fi
  8021. ;;
  8022. esac
  8023. ;;
  8024. solaris*)
  8025. func_cc_basename "$CC"
  8026. case $func_cc_basename_result in
  8027. CC* | sunCC*)
  8028. func_suncc_cstd_abi
  8029. if test no != "$suncc_use_cstd_abi"; then
  8030. func_append postdeps ' -library=Cstd -library=Crun'
  8031. fi
  8032. ;;
  8033. esac
  8034. ;;
  8035. esac
  8036. }
  8037. # Last step: remove runtime libs from dependency_libs
  8038. # (they stay in deplibs)
  8039. tmp_libs=
  8040. for i in $dependency_libs; do
  8041. case " $predeps $postdeps $compiler_lib_search_path " in
  8042. *" $i "*)
  8043. i=
  8044. ;;
  8045. esac
  8046. if test -n "$i"; then
  8047. func_append tmp_libs " $i"
  8048. fi
  8049. done
  8050. dependency_libs=$tmp_libs
  8051. done # for pass
  8052. if test prog = "$linkmode"; then
  8053. dlfiles=$newdlfiles
  8054. fi
  8055. if test prog = "$linkmode" || test lib = "$linkmode"; then
  8056. dlprefiles=$newdlprefiles
  8057. fi
  8058. case $linkmode in
  8059. oldlib)
  8060. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  8061. func_warning "'-dlopen' is ignored for archives"
  8062. fi
  8063. case " $deplibs" in
  8064. *\ -l* | *\ -L*)
  8065. func_warning "'-l' and '-L' are ignored for archives" ;;
  8066. esac
  8067. test -n "$rpath" && \
  8068. func_warning "'-rpath' is ignored for archives"
  8069. test -n "$xrpath" && \
  8070. func_warning "'-R' is ignored for archives"
  8071. test -n "$vinfo" && \
  8072. func_warning "'-version-info/-version-number' is ignored for archives"
  8073. test -n "$release" && \
  8074. func_warning "'-release' is ignored for archives"
  8075. test -n "$export_symbols$export_symbols_regex" && \
  8076. func_warning "'-export-symbols' is ignored for archives"
  8077. # Now set the variables for building old libraries.
  8078. build_libtool_libs=no
  8079. oldlibs=$output
  8080. func_append objs "$old_deplibs"
  8081. ;;
  8082. lib)
  8083. # Make sure we only generate libraries of the form 'libNAME.la'.
  8084. case $outputname in
  8085. lib*)
  8086. func_stripname 'lib' '.la' "$outputname"
  8087. name=$func_stripname_result
  8088. eval shared_ext=\"$shrext_cmds\"
  8089. eval libname=\"$libname_spec\"
  8090. ;;
  8091. *)
  8092. test no = "$module" \
  8093. && func_fatal_help "libtool library '$output' must begin with 'lib'"
  8094. if test no != "$need_lib_prefix"; then
  8095. # Add the "lib" prefix for modules if required
  8096. func_stripname '' '.la' "$outputname"
  8097. name=$func_stripname_result
  8098. eval shared_ext=\"$shrext_cmds\"
  8099. eval libname=\"$libname_spec\"
  8100. else
  8101. func_stripname '' '.la' "$outputname"
  8102. libname=$func_stripname_result
  8103. fi
  8104. ;;
  8105. esac
  8106. if test -n "$objs"; then
  8107. if test pass_all != "$deplibs_check_method"; then
  8108. func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
  8109. else
  8110. echo
  8111. $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  8112. $ECHO "*** objects $objs is not portable!"
  8113. func_append libobjs " $objs"
  8114. fi
  8115. fi
  8116. test no = "$dlself" \
  8117. || func_warning "'-dlopen self' is ignored for libtool libraries"
  8118. set dummy $rpath
  8119. shift
  8120. test 1 -lt "$#" \
  8121. && func_warning "ignoring multiple '-rpath's for a libtool library"
  8122. install_libdir=$1
  8123. oldlibs=
  8124. if test -z "$rpath"; then
  8125. if test yes = "$build_libtool_libs"; then
  8126. # Building a libtool convenience library.
  8127. # Some compilers have problems with a '.al' extension so
  8128. # convenience libraries should have the same extension an
  8129. # archive normally would.
  8130. oldlibs="$output_objdir/$libname.$libext $oldlibs"
  8131. build_libtool_libs=convenience
  8132. build_old_libs=yes
  8133. fi
  8134. test -n "$vinfo" && \
  8135. func_warning "'-version-info/-version-number' is ignored for convenience libraries"
  8136. test -n "$release" && \
  8137. func_warning "'-release' is ignored for convenience libraries"
  8138. else
  8139. # Parse the version information argument.
  8140. save_ifs=$IFS; IFS=:
  8141. set dummy $vinfo 0 0 0
  8142. shift
  8143. IFS=$save_ifs
  8144. test -n "$7" && \
  8145. func_fatal_help "too many parameters to '-version-info'"
  8146. # convert absolute version numbers to libtool ages
  8147. # this retains compatibility with .la files and attempts
  8148. # to make the code below a bit more comprehensible
  8149. case $vinfo_number in
  8150. yes)
  8151. number_major=$1
  8152. number_minor=$2
  8153. number_revision=$3
  8154. #
  8155. # There are really only two kinds -- those that
  8156. # use the current revision as the major version
  8157. # and those that subtract age and use age as
  8158. # a minor version. But, then there is irix
  8159. # that has an extra 1 added just for fun
  8160. #
  8161. case $version_type in
  8162. # correct linux to gnu/linux during the next big refactor
  8163. darwin|freebsd-elf|linux|osf|windows|none)
  8164. func_arith $number_major + $number_minor
  8165. current=$func_arith_result
  8166. age=$number_minor
  8167. revision=$number_revision
  8168. ;;
  8169. freebsd-aout|qnx|sunos)
  8170. current=$number_major
  8171. revision=$number_minor
  8172. age=0
  8173. ;;
  8174. irix|nonstopux)
  8175. func_arith $number_major + $number_minor
  8176. current=$func_arith_result
  8177. age=$number_minor
  8178. revision=$number_minor
  8179. lt_irix_increment=no
  8180. ;;
  8181. esac
  8182. ;;
  8183. no)
  8184. current=$1
  8185. revision=$2
  8186. age=$3
  8187. ;;
  8188. esac
  8189. # Check that each of the things are valid numbers.
  8190. case $current in
  8191. 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]) ;;
  8192. *)
  8193. func_error "CURRENT '$current' must be a nonnegative integer"
  8194. func_fatal_error "'$vinfo' is not valid version information"
  8195. ;;
  8196. esac
  8197. case $revision in
  8198. 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]) ;;
  8199. *)
  8200. func_error "REVISION '$revision' must be a nonnegative integer"
  8201. func_fatal_error "'$vinfo' is not valid version information"
  8202. ;;
  8203. esac
  8204. case $age in
  8205. 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]) ;;
  8206. *)
  8207. func_error "AGE '$age' must be a nonnegative integer"
  8208. func_fatal_error "'$vinfo' is not valid version information"
  8209. ;;
  8210. esac
  8211. if test "$age" -gt "$current"; then
  8212. func_error "AGE '$age' is greater than the current interface number '$current'"
  8213. func_fatal_error "'$vinfo' is not valid version information"
  8214. fi
  8215. # Calculate the version variables.
  8216. major=
  8217. versuffix=
  8218. verstring=
  8219. case $version_type in
  8220. none) ;;
  8221. darwin)
  8222. # Like Linux, but with the current version available in
  8223. # verstring for coding it into the library header
  8224. func_arith $current - $age
  8225. major=.$func_arith_result
  8226. versuffix=$major.$age.$revision
  8227. # Darwin ld doesn't like 0 for these options...
  8228. func_arith $current + 1
  8229. minor_current=$func_arith_result
  8230. xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8231. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8232. # On Darwin other compilers
  8233. case $CC in
  8234. nagfor*)
  8235. verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
  8236. ;;
  8237. *)
  8238. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  8239. ;;
  8240. esac
  8241. ;;
  8242. freebsd-aout)
  8243. major=.$current
  8244. versuffix=.$current.$revision
  8245. ;;
  8246. freebsd-elf)
  8247. func_arith $current - $age
  8248. major=.$func_arith_result
  8249. versuffix=$major.$age.$revision
  8250. ;;
  8251. irix | nonstopux)
  8252. if test no = "$lt_irix_increment"; then
  8253. func_arith $current - $age
  8254. else
  8255. func_arith $current - $age + 1
  8256. fi
  8257. major=$func_arith_result
  8258. case $version_type in
  8259. nonstopux) verstring_prefix=nonstopux ;;
  8260. *) verstring_prefix=sgi ;;
  8261. esac
  8262. verstring=$verstring_prefix$major.$revision
  8263. # Add in all the interfaces that we are compatible with.
  8264. loop=$revision
  8265. while test 0 -ne "$loop"; do
  8266. func_arith $revision - $loop
  8267. iface=$func_arith_result
  8268. func_arith $loop - 1
  8269. loop=$func_arith_result
  8270. verstring=$verstring_prefix$major.$iface:$verstring
  8271. done
  8272. # Before this point, $major must not contain '.'.
  8273. major=.$major
  8274. versuffix=$major.$revision
  8275. ;;
  8276. linux) # correct to gnu/linux during the next big refactor
  8277. func_arith $current - $age
  8278. major=.$func_arith_result
  8279. versuffix=$major.$age.$revision
  8280. ;;
  8281. osf)
  8282. func_arith $current - $age
  8283. major=.$func_arith_result
  8284. versuffix=.$current.$age.$revision
  8285. verstring=$current.$age.$revision
  8286. # Add in all the interfaces that we are compatible with.
  8287. loop=$age
  8288. while test 0 -ne "$loop"; do
  8289. func_arith $current - $loop
  8290. iface=$func_arith_result
  8291. func_arith $loop - 1
  8292. loop=$func_arith_result
  8293. verstring=$verstring:$iface.0
  8294. done
  8295. # Make executables depend on our current version.
  8296. func_append verstring ":$current.0"
  8297. ;;
  8298. qnx)
  8299. major=.$current
  8300. versuffix=.$current
  8301. ;;
  8302. sco)
  8303. major=.$current
  8304. versuffix=.$current
  8305. ;;
  8306. sunos)
  8307. major=.$current
  8308. versuffix=.$current.$revision
  8309. ;;
  8310. windows)
  8311. # Use '-' rather than '.', since we only want one
  8312. # extension on DOS 8.3 file systems.
  8313. func_arith $current - $age
  8314. major=$func_arith_result
  8315. versuffix=-$major
  8316. ;;
  8317. *)
  8318. func_fatal_configuration "unknown library version type '$version_type'"
  8319. ;;
  8320. esac
  8321. # Clear the version info if we defaulted, and they specified a release.
  8322. if test -z "$vinfo" && test -n "$release"; then
  8323. major=
  8324. case $version_type in
  8325. darwin)
  8326. # we can't check for "0.0" in archive_cmds due to quoting
  8327. # problems, so we reset it completely
  8328. verstring=
  8329. ;;
  8330. *)
  8331. verstring=0.0
  8332. ;;
  8333. esac
  8334. if test no = "$need_version"; then
  8335. versuffix=
  8336. else
  8337. versuffix=.0.0
  8338. fi
  8339. fi
  8340. # Remove version info from name if versioning should be avoided
  8341. if test yes,no = "$avoid_version,$need_version"; then
  8342. major=
  8343. versuffix=
  8344. verstring=
  8345. fi
  8346. # Check to see if the archive will have undefined symbols.
  8347. if test yes = "$allow_undefined"; then
  8348. if test unsupported = "$allow_undefined_flag"; then
  8349. if test yes = "$build_old_libs"; then
  8350. func_warning "undefined symbols not allowed in $host shared libraries; building static only"
  8351. build_libtool_libs=no
  8352. else
  8353. func_fatal_error "can't build $host shared library unless -no-undefined is specified"
  8354. fi
  8355. fi
  8356. else
  8357. # Don't allow undefined symbols.
  8358. allow_undefined_flag=$no_undefined_flag
  8359. fi
  8360. fi
  8361. func_generate_dlsyms "$libname" "$libname" :
  8362. func_append libobjs " $symfileobj"
  8363. test " " = "$libobjs" && libobjs=
  8364. if test relink != "$opt_mode"; then
  8365. # Remove our outputs, but don't remove object files since they
  8366. # may have been created when compiling PIC objects.
  8367. removelist=
  8368. tempremovelist=`$ECHO "$output_objdir/*"`
  8369. for p in $tempremovelist; do
  8370. case $p in
  8371. *.$objext | *.gcno)
  8372. ;;
  8373. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
  8374. if test -n "$precious_files_regex"; then
  8375. if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  8376. then
  8377. continue
  8378. fi
  8379. fi
  8380. func_append removelist " $p"
  8381. ;;
  8382. *) ;;
  8383. esac
  8384. done
  8385. test -n "$removelist" && \
  8386. func_show_eval "${RM}r \$removelist"
  8387. fi
  8388. # Now set the variables for building old libraries.
  8389. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
  8390. func_append oldlibs " $output_objdir/$libname.$libext"
  8391. # Transform .lo files to .o files.
  8392. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
  8393. fi
  8394. # Eliminate all temporary directories.
  8395. #for path in $notinst_path; do
  8396. # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
  8397. # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
  8398. # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
  8399. #done
  8400. if test -n "$xrpath"; then
  8401. # If the user specified any rpath flags, then add them.
  8402. temp_xrpath=
  8403. for libdir in $xrpath; do
  8404. func_replace_sysroot "$libdir"
  8405. func_append temp_xrpath " -R$func_replace_sysroot_result"
  8406. case "$finalize_rpath " in
  8407. *" $libdir "*) ;;
  8408. *) func_append finalize_rpath " $libdir" ;;
  8409. esac
  8410. done
  8411. if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
  8412. dependency_libs="$temp_xrpath $dependency_libs"
  8413. fi
  8414. fi
  8415. # Make sure dlfiles contains only unique files that won't be dlpreopened
  8416. old_dlfiles=$dlfiles
  8417. dlfiles=
  8418. for lib in $old_dlfiles; do
  8419. case " $dlprefiles $dlfiles " in
  8420. *" $lib "*) ;;
  8421. *) func_append dlfiles " $lib" ;;
  8422. esac
  8423. done
  8424. # Make sure dlprefiles contains only unique files
  8425. old_dlprefiles=$dlprefiles
  8426. dlprefiles=
  8427. for lib in $old_dlprefiles; do
  8428. case "$dlprefiles " in
  8429. *" $lib "*) ;;
  8430. *) func_append dlprefiles " $lib" ;;
  8431. esac
  8432. done
  8433. if test yes = "$build_libtool_libs"; then
  8434. if test -n "$rpath"; then
  8435. case $host in
  8436. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
  8437. # these systems don't actually have a c library (as such)!
  8438. ;;
  8439. *-*-rhapsody* | *-*-darwin1.[012])
  8440. # Rhapsody C library is in the System framework
  8441. func_append deplibs " System.ltframework"
  8442. ;;
  8443. *-*-netbsd*)
  8444. # Don't link with libc until the a.out ld.so is fixed.
  8445. ;;
  8446. *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
  8447. # Do not include libc due to us having libc/libc_r.
  8448. ;;
  8449. *-*-sco3.2v5* | *-*-sco5v6*)
  8450. # Causes problems with __ctype
  8451. ;;
  8452. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  8453. # Compiler inserts libc in the correct place for threads to work
  8454. ;;
  8455. *)
  8456. # Add libc to deplibs on all other systems if necessary.
  8457. if test yes = "$build_libtool_need_lc"; then
  8458. func_append deplibs " -lc"
  8459. fi
  8460. ;;
  8461. esac
  8462. fi
  8463. # Transform deplibs into only deplibs that can be linked in shared.
  8464. name_save=$name
  8465. libname_save=$libname
  8466. release_save=$release
  8467. versuffix_save=$versuffix
  8468. major_save=$major
  8469. # I'm not sure if I'm treating the release correctly. I think
  8470. # release should show up in the -l (ie -lgmp5) so we don't want to
  8471. # add it in twice. Is that correct?
  8472. release=
  8473. versuffix=
  8474. major=
  8475. newdeplibs=
  8476. droppeddeps=no
  8477. case $deplibs_check_method in
  8478. pass_all)
  8479. # Don't check for shared/static. Everything works.
  8480. # This might be a little naive. We might want to check
  8481. # whether the library exists or not. But this is on
  8482. # osf3 & osf4 and I'm not really sure... Just
  8483. # implementing what was already the behavior.
  8484. newdeplibs=$deplibs
  8485. ;;
  8486. test_compile)
  8487. # This code stresses the "libraries are programs" paradigm to its
  8488. # limits. Maybe even breaks it. We compile a program, linking it
  8489. # against the deplibs as a proxy for the library. Then we can check
  8490. # whether they linked in statically or dynamically with ldd.
  8491. $opt_dry_run || $RM conftest.c
  8492. cat > conftest.c <<EOF
  8493. int main() { return 0; }
  8494. EOF
  8495. $opt_dry_run || $RM conftest
  8496. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  8497. ldd_output=`ldd conftest`
  8498. for i in $deplibs; do
  8499. case $i in
  8500. -l*)
  8501. func_stripname -l '' "$i"
  8502. name=$func_stripname_result
  8503. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8504. case " $predeps $postdeps " in
  8505. *" $i "*)
  8506. func_append newdeplibs " $i"
  8507. i=
  8508. ;;
  8509. esac
  8510. fi
  8511. if test -n "$i"; then
  8512. libname=`eval "\\$ECHO \"$libname_spec\""`
  8513. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8514. set dummy $deplib_matches; shift
  8515. deplib_match=$1
  8516. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8517. func_append newdeplibs " $i"
  8518. else
  8519. droppeddeps=yes
  8520. echo
  8521. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8522. echo "*** I have the capability to make that library automatically link in when"
  8523. echo "*** you link to this library. But I can only do this if you have a"
  8524. echo "*** shared version of the library, which I believe you do not have"
  8525. echo "*** because a test_compile did reveal that the linker did not use it for"
  8526. echo "*** its dynamic dependency list that programs get resolved with at runtime."
  8527. fi
  8528. fi
  8529. ;;
  8530. *)
  8531. func_append newdeplibs " $i"
  8532. ;;
  8533. esac
  8534. done
  8535. else
  8536. # Error occurred in the first compile. Let's try to salvage
  8537. # the situation: Compile a separate program for each library.
  8538. for i in $deplibs; do
  8539. case $i in
  8540. -l*)
  8541. func_stripname -l '' "$i"
  8542. name=$func_stripname_result
  8543. $opt_dry_run || $RM conftest
  8544. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  8545. ldd_output=`ldd conftest`
  8546. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8547. case " $predeps $postdeps " in
  8548. *" $i "*)
  8549. func_append newdeplibs " $i"
  8550. i=
  8551. ;;
  8552. esac
  8553. fi
  8554. if test -n "$i"; then
  8555. libname=`eval "\\$ECHO \"$libname_spec\""`
  8556. deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  8557. set dummy $deplib_matches; shift
  8558. deplib_match=$1
  8559. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
  8560. func_append newdeplibs " $i"
  8561. else
  8562. droppeddeps=yes
  8563. echo
  8564. $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  8565. echo "*** I have the capability to make that library automatically link in when"
  8566. echo "*** you link to this library. But I can only do this if you have a"
  8567. echo "*** shared version of the library, which you do not appear to have"
  8568. echo "*** because a test_compile did reveal that the linker did not use this one"
  8569. echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  8570. fi
  8571. fi
  8572. else
  8573. droppeddeps=yes
  8574. echo
  8575. $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  8576. echo "*** make it link in! You will probably need to install it or some"
  8577. echo "*** library that it depends on before this library will be fully"
  8578. echo "*** functional. Installing it before continuing would be even better."
  8579. fi
  8580. ;;
  8581. *)
  8582. func_append newdeplibs " $i"
  8583. ;;
  8584. esac
  8585. done
  8586. fi
  8587. ;;
  8588. file_magic*)
  8589. set dummy $deplibs_check_method; shift
  8590. file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8591. for a_deplib in $deplibs; do
  8592. case $a_deplib in
  8593. -l*)
  8594. func_stripname -l '' "$a_deplib"
  8595. name=$func_stripname_result
  8596. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8597. case " $predeps $postdeps " in
  8598. *" $a_deplib "*)
  8599. func_append newdeplibs " $a_deplib"
  8600. a_deplib=
  8601. ;;
  8602. esac
  8603. fi
  8604. if test -n "$a_deplib"; then
  8605. libname=`eval "\\$ECHO \"$libname_spec\""`
  8606. if test -n "$file_magic_glob"; then
  8607. libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
  8608. else
  8609. libnameglob=$libname
  8610. fi
  8611. test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
  8612. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8613. if test yes = "$want_nocaseglob"; then
  8614. shopt -s nocaseglob
  8615. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8616. $nocaseglob
  8617. else
  8618. potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
  8619. fi
  8620. for potent_lib in $potential_libs; do
  8621. # Follow soft links.
  8622. if ls -lLd "$potent_lib" 2>/dev/null |
  8623. $GREP " -> " >/dev/null; then
  8624. continue
  8625. fi
  8626. # The statement above tries to avoid entering an
  8627. # endless loop below, in case of cyclic links.
  8628. # We might still enter an endless loop, since a link
  8629. # loop can be closed while we follow links,
  8630. # but so what?
  8631. potlib=$potent_lib
  8632. while test -h "$potlib" 2>/dev/null; do
  8633. potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
  8634. case $potliblink in
  8635. [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
  8636. *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
  8637. esac
  8638. done
  8639. if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  8640. $SED -e 10q |
  8641. $EGREP "$file_magic_regex" > /dev/null; then
  8642. func_append newdeplibs " $a_deplib"
  8643. a_deplib=
  8644. break 2
  8645. fi
  8646. done
  8647. done
  8648. fi
  8649. if test -n "$a_deplib"; then
  8650. droppeddeps=yes
  8651. echo
  8652. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8653. echo "*** I have the capability to make that library automatically link in when"
  8654. echo "*** you link to this library. But I can only do this if you have a"
  8655. echo "*** shared version of the library, which you do not appear to have"
  8656. echo "*** because I did check the linker path looking for a file starting"
  8657. if test -z "$potlib"; then
  8658. $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  8659. else
  8660. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8661. $ECHO "*** using a file magic. Last file checked: $potlib"
  8662. fi
  8663. fi
  8664. ;;
  8665. *)
  8666. # Add a -L argument.
  8667. func_append newdeplibs " $a_deplib"
  8668. ;;
  8669. esac
  8670. done # Gone through all deplibs.
  8671. ;;
  8672. match_pattern*)
  8673. set dummy $deplibs_check_method; shift
  8674. match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  8675. for a_deplib in $deplibs; do
  8676. case $a_deplib in
  8677. -l*)
  8678. func_stripname -l '' "$a_deplib"
  8679. name=$func_stripname_result
  8680. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8681. case " $predeps $postdeps " in
  8682. *" $a_deplib "*)
  8683. func_append newdeplibs " $a_deplib"
  8684. a_deplib=
  8685. ;;
  8686. esac
  8687. fi
  8688. if test -n "$a_deplib"; then
  8689. libname=`eval "\\$ECHO \"$libname_spec\""`
  8690. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  8691. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  8692. for potent_lib in $potential_libs; do
  8693. potlib=$potent_lib # see symlink-check above in file_magic test
  8694. if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
  8695. $EGREP "$match_pattern_regex" > /dev/null; then
  8696. func_append newdeplibs " $a_deplib"
  8697. a_deplib=
  8698. break 2
  8699. fi
  8700. done
  8701. done
  8702. fi
  8703. if test -n "$a_deplib"; then
  8704. droppeddeps=yes
  8705. echo
  8706. $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  8707. echo "*** I have the capability to make that library automatically link in when"
  8708. echo "*** you link to this library. But I can only do this if you have a"
  8709. echo "*** shared version of the library, which you do not appear to have"
  8710. echo "*** because I did check the linker path looking for a file starting"
  8711. if test -z "$potlib"; then
  8712. $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  8713. else
  8714. $ECHO "*** with $libname and none of the candidates passed a file format test"
  8715. $ECHO "*** using a regex pattern. Last file checked: $potlib"
  8716. fi
  8717. fi
  8718. ;;
  8719. *)
  8720. # Add a -L argument.
  8721. func_append newdeplibs " $a_deplib"
  8722. ;;
  8723. esac
  8724. done # Gone through all deplibs.
  8725. ;;
  8726. none | unknown | *)
  8727. newdeplibs=
  8728. tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
  8729. if test yes = "$allow_libtool_libs_with_static_runtimes"; then
  8730. for i in $predeps $postdeps; do
  8731. # can't use Xsed below, because $i might contain '/'
  8732. tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
  8733. done
  8734. fi
  8735. case $tmp_deplibs in
  8736. *[!\ \ ]*)
  8737. echo
  8738. if test none = "$deplibs_check_method"; then
  8739. echo "*** Warning: inter-library dependencies are not supported in this platform."
  8740. else
  8741. echo "*** Warning: inter-library dependencies are not known to be supported."
  8742. fi
  8743. echo "*** All declared inter-library dependencies are being dropped."
  8744. droppeddeps=yes
  8745. ;;
  8746. esac
  8747. ;;
  8748. esac
  8749. versuffix=$versuffix_save
  8750. major=$major_save
  8751. release=$release_save
  8752. libname=$libname_save
  8753. name=$name_save
  8754. case $host in
  8755. *-*-rhapsody* | *-*-darwin1.[012])
  8756. # On Rhapsody replace the C library with the System framework
  8757. newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
  8758. ;;
  8759. esac
  8760. if test yes = "$droppeddeps"; then
  8761. if test yes = "$module"; then
  8762. echo
  8763. echo "*** Warning: libtool could not satisfy all declared inter-library"
  8764. $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  8765. echo "*** a static module, that should work as long as the dlopening"
  8766. echo "*** application is linked with the -dlopen flag."
  8767. if test -z "$global_symbol_pipe"; then
  8768. echo
  8769. echo "*** However, this would only work if libtool was able to extract symbol"
  8770. echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
  8771. echo "*** not find such a program. So, this module is probably useless."
  8772. echo "*** 'nm' from GNU binutils and a full rebuild may help."
  8773. fi
  8774. if test no = "$build_old_libs"; then
  8775. oldlibs=$output_objdir/$libname.$libext
  8776. build_libtool_libs=module
  8777. build_old_libs=yes
  8778. else
  8779. build_libtool_libs=no
  8780. fi
  8781. else
  8782. echo "*** The inter-library dependencies that have been dropped here will be"
  8783. echo "*** automatically added whenever a program is linked with this library"
  8784. echo "*** or is declared to -dlopen it."
  8785. if test no = "$allow_undefined"; then
  8786. echo
  8787. echo "*** Since this library must not contain undefined symbols,"
  8788. echo "*** because either the platform does not support them or"
  8789. echo "*** it was explicitly requested with -no-undefined,"
  8790. echo "*** libtool will only create a static version of it."
  8791. if test no = "$build_old_libs"; then
  8792. oldlibs=$output_objdir/$libname.$libext
  8793. build_libtool_libs=module
  8794. build_old_libs=yes
  8795. else
  8796. build_libtool_libs=no
  8797. fi
  8798. fi
  8799. fi
  8800. fi
  8801. # Done checking deplibs!
  8802. deplibs=$newdeplibs
  8803. fi
  8804. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  8805. case $host in
  8806. *-*-darwin*)
  8807. newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8808. new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8809. deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  8810. ;;
  8811. esac
  8812. # move library search paths that coincide with paths to not yet
  8813. # installed libraries to the beginning of the library search list
  8814. new_libs=
  8815. for path in $notinst_path; do
  8816. case " $new_libs " in
  8817. *" -L$path/$objdir "*) ;;
  8818. *)
  8819. case " $deplibs " in
  8820. *" -L$path/$objdir "*)
  8821. func_append new_libs " -L$path/$objdir" ;;
  8822. esac
  8823. ;;
  8824. esac
  8825. done
  8826. for deplib in $deplibs; do
  8827. case $deplib in
  8828. -L*)
  8829. case " $new_libs " in
  8830. *" $deplib "*) ;;
  8831. *) func_append new_libs " $deplib" ;;
  8832. esac
  8833. ;;
  8834. *) func_append new_libs " $deplib" ;;
  8835. esac
  8836. done
  8837. deplibs=$new_libs
  8838. # All the library-specific variables (install_libdir is set above).
  8839. library_names=
  8840. old_library=
  8841. dlname=
  8842. # Test again, we may have decided not to build it any more
  8843. if test yes = "$build_libtool_libs"; then
  8844. # Remove $wl instances when linking with ld.
  8845. # FIXME: should test the right _cmds variable.
  8846. case $archive_cmds in
  8847. *\$LD\ *) wl= ;;
  8848. esac
  8849. if test yes = "$hardcode_into_libs"; then
  8850. # Hardcode the library paths
  8851. hardcode_libdirs=
  8852. dep_rpath=
  8853. rpath=$finalize_rpath
  8854. test relink = "$opt_mode" || rpath=$compile_rpath$rpath
  8855. for libdir in $rpath; do
  8856. if test -n "$hardcode_libdir_flag_spec"; then
  8857. func_replace_sysroot "$libdir"
  8858. libdir=$func_replace_sysroot_result
  8859. func_stripname '=' '' "$libdir"
  8860. libdir=$func_stripname_result
  8861. if test -n "$hardcode_libdir_separator"; then
  8862. if test -z "$hardcode_libdirs"; then
  8863. hardcode_libdirs=$libdir
  8864. else
  8865. # Just accumulate the unique libdirs.
  8866. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  8867. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  8868. ;;
  8869. *)
  8870. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  8871. ;;
  8872. esac
  8873. fi
  8874. else
  8875. # We only want to hardcode in an rpath if it isn't in the
  8876. # default dlsearch path.
  8877. func_normal_abspath "$libdir"
  8878. libdir_norm=$func_normal_abspath_result
  8879. case " $sys_lib_dlsearch_path " in
  8880. *" $libdir_norm "*) ;;
  8881. *) eval flag=\"$hardcode_libdir_flag_spec\"
  8882. func_append dep_rpath " $flag"
  8883. ;;
  8884. esac
  8885. fi
  8886. elif test -n "$runpath_var"; then
  8887. case "$perm_rpath " in
  8888. *" $libdir "*) ;;
  8889. *) func_append perm_rpath " $libdir" ;;
  8890. esac
  8891. fi
  8892. done
  8893. # Substitute the hardcoded libdirs into the rpath.
  8894. if test -n "$hardcode_libdir_separator" &&
  8895. test -n "$hardcode_libdirs"; then
  8896. libdir=$hardcode_libdirs
  8897. eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
  8898. fi
  8899. if test -n "$runpath_var" && test -n "$perm_rpath"; then
  8900. # We should set the runpath_var.
  8901. rpath=
  8902. for dir in $perm_rpath; do
  8903. func_append rpath "$dir:"
  8904. done
  8905. eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
  8906. fi
  8907. test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
  8908. fi
  8909. shlibpath=$finalize_shlibpath
  8910. test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
  8911. if test -n "$shlibpath"; then
  8912. eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
  8913. fi
  8914. # Get the real and link names of the library.
  8915. eval shared_ext=\"$shrext_cmds\"
  8916. eval library_names=\"$library_names_spec\"
  8917. set dummy $library_names
  8918. shift
  8919. realname=$1
  8920. shift
  8921. if test -n "$soname_spec"; then
  8922. eval soname=\"$soname_spec\"
  8923. else
  8924. soname=$realname
  8925. fi
  8926. if test -z "$dlname"; then
  8927. dlname=$soname
  8928. fi
  8929. lib=$output_objdir/$realname
  8930. linknames=
  8931. for link
  8932. do
  8933. func_append linknames " $link"
  8934. done
  8935. # Use standard objects if they are pic
  8936. test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
  8937. test "X$libobjs" = "X " && libobjs=
  8938. delfiles=
  8939. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  8940. $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  8941. export_symbols=$output_objdir/$libname.uexp
  8942. func_append delfiles " $export_symbols"
  8943. fi
  8944. orig_export_symbols=
  8945. case $host_os in
  8946. cygwin* | mingw* | cegcc*)
  8947. if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  8948. # exporting using user supplied symfile
  8949. func_dll_def_p "$export_symbols" || {
  8950. # and it's NOT already a .def file. Must figure out
  8951. # which of the given symbols are data symbols and tag
  8952. # them as such. So, trigger use of export_symbols_cmds.
  8953. # export_symbols gets reassigned inside the "prepare
  8954. # the list of exported symbols" if statement, so the
  8955. # include_expsyms logic still works.
  8956. orig_export_symbols=$export_symbols
  8957. export_symbols=
  8958. always_export_symbols=yes
  8959. }
  8960. fi
  8961. ;;
  8962. esac
  8963. # Prepare the list of exported symbols
  8964. if test -z "$export_symbols"; then
  8965. if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
  8966. func_verbose "generating symbol list for '$libname.la'"
  8967. export_symbols=$output_objdir/$libname.exp
  8968. $opt_dry_run || $RM $export_symbols
  8969. cmds=$export_symbols_cmds
  8970. save_ifs=$IFS; IFS='~'
  8971. for cmd1 in $cmds; do
  8972. IFS=$save_ifs
  8973. # Take the normal branch if the nm_file_list_spec branch
  8974. # doesn't work or if tool conversion is not needed.
  8975. case $nm_file_list_spec~$to_tool_file_cmd in
  8976. *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
  8977. try_normal_branch=yes
  8978. eval cmd=\"$cmd1\"
  8979. func_len " $cmd"
  8980. len=$func_len_result
  8981. ;;
  8982. *)
  8983. try_normal_branch=no
  8984. ;;
  8985. esac
  8986. if test yes = "$try_normal_branch" \
  8987. && { test "$len" -lt "$max_cmd_len" \
  8988. || test "$max_cmd_len" -le -1; }
  8989. then
  8990. func_show_eval "$cmd" 'exit $?'
  8991. skipped_export=false
  8992. elif test -n "$nm_file_list_spec"; then
  8993. func_basename "$output"
  8994. output_la=$func_basename_result
  8995. save_libobjs=$libobjs
  8996. save_output=$output
  8997. output=$output_objdir/$output_la.nm
  8998. func_to_tool_file "$output"
  8999. libobjs=$nm_file_list_spec$func_to_tool_file_result
  9000. func_append delfiles " $output"
  9001. func_verbose "creating $NM input file list: $output"
  9002. for obj in $save_libobjs; do
  9003. func_to_tool_file "$obj"
  9004. $ECHO "$func_to_tool_file_result"
  9005. done > "$output"
  9006. eval cmd=\"$cmd1\"
  9007. func_show_eval "$cmd" 'exit $?'
  9008. output=$save_output
  9009. libobjs=$save_libobjs
  9010. skipped_export=false
  9011. else
  9012. # The command line is too long to execute in one step.
  9013. func_verbose "using reloadable object file for export list..."
  9014. skipped_export=:
  9015. # Break out early, otherwise skipped_export may be
  9016. # set to false by a later but shorter cmd.
  9017. break
  9018. fi
  9019. done
  9020. IFS=$save_ifs
  9021. if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
  9022. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9023. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9024. fi
  9025. fi
  9026. fi
  9027. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9028. tmp_export_symbols=$export_symbols
  9029. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9030. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9031. fi
  9032. if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
  9033. # The given exports_symbols file has to be filtered, so filter it.
  9034. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9035. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9036. # 's' commands, which not all seds can handle. GNU sed should be fine
  9037. # though. Also, the filter scales superlinearly with the number of
  9038. # global variables. join(1) would be nice here, but unfortunately
  9039. # isn't a blessed tool.
  9040. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9041. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9042. export_symbols=$output_objdir/$libname.def
  9043. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9044. fi
  9045. tmp_deplibs=
  9046. for test_deplib in $deplibs; do
  9047. case " $convenience " in
  9048. *" $test_deplib "*) ;;
  9049. *)
  9050. func_append tmp_deplibs " $test_deplib"
  9051. ;;
  9052. esac
  9053. done
  9054. deplibs=$tmp_deplibs
  9055. if test -n "$convenience"; then
  9056. if test -n "$whole_archive_flag_spec" &&
  9057. test yes = "$compiler_needs_object" &&
  9058. test -z "$libobjs"; then
  9059. # extract the archives, so we have objects to list.
  9060. # TODO: could optimize this to just extract one archive.
  9061. whole_archive_flag_spec=
  9062. fi
  9063. if test -n "$whole_archive_flag_spec"; then
  9064. save_libobjs=$libobjs
  9065. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9066. test "X$libobjs" = "X " && libobjs=
  9067. else
  9068. gentop=$output_objdir/${outputname}x
  9069. func_append generated " $gentop"
  9070. func_extract_archives $gentop $convenience
  9071. func_append libobjs " $func_extract_archives_result"
  9072. test "X$libobjs" = "X " && libobjs=
  9073. fi
  9074. fi
  9075. if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
  9076. eval flag=\"$thread_safe_flag_spec\"
  9077. func_append linker_flags " $flag"
  9078. fi
  9079. # Make a backup of the uninstalled library when relinking
  9080. if test relink = "$opt_mode"; then
  9081. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  9082. fi
  9083. # Do each of the archive commands.
  9084. if test yes = "$module" && test -n "$module_cmds"; then
  9085. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9086. eval test_cmds=\"$module_expsym_cmds\"
  9087. cmds=$module_expsym_cmds
  9088. else
  9089. eval test_cmds=\"$module_cmds\"
  9090. cmds=$module_cmds
  9091. fi
  9092. else
  9093. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9094. eval test_cmds=\"$archive_expsym_cmds\"
  9095. cmds=$archive_expsym_cmds
  9096. else
  9097. eval test_cmds=\"$archive_cmds\"
  9098. cmds=$archive_cmds
  9099. fi
  9100. fi
  9101. if test : != "$skipped_export" &&
  9102. func_len " $test_cmds" &&
  9103. len=$func_len_result &&
  9104. test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9105. :
  9106. else
  9107. # The command line is too long to link in one step, link piecewise
  9108. # or, if using GNU ld and skipped_export is not :, use a linker
  9109. # script.
  9110. # Save the value of $output and $libobjs because we want to
  9111. # use them later. If we have whole_archive_flag_spec, we
  9112. # want to use save_libobjs as it was before
  9113. # whole_archive_flag_spec was expanded, because we can't
  9114. # assume the linker understands whole_archive_flag_spec.
  9115. # This may have to be revisited, in case too many
  9116. # convenience libraries get linked in and end up exceeding
  9117. # the spec.
  9118. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
  9119. save_libobjs=$libobjs
  9120. fi
  9121. save_output=$output
  9122. func_basename "$output"
  9123. output_la=$func_basename_result
  9124. # Clear the reloadable object creation command queue and
  9125. # initialize k to one.
  9126. test_cmds=
  9127. concat_cmds=
  9128. objlist=
  9129. last_robj=
  9130. k=1
  9131. if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
  9132. output=$output_objdir/$output_la.lnkscript
  9133. func_verbose "creating GNU ld script: $output"
  9134. echo 'INPUT (' > $output
  9135. for obj in $save_libobjs
  9136. do
  9137. func_to_tool_file "$obj"
  9138. $ECHO "$func_to_tool_file_result" >> $output
  9139. done
  9140. echo ')' >> $output
  9141. func_append delfiles " $output"
  9142. func_to_tool_file "$output"
  9143. output=$func_to_tool_file_result
  9144. elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
  9145. output=$output_objdir/$output_la.lnk
  9146. func_verbose "creating linker input file list: $output"
  9147. : > $output
  9148. set x $save_libobjs
  9149. shift
  9150. firstobj=
  9151. if test yes = "$compiler_needs_object"; then
  9152. firstobj="$1 "
  9153. shift
  9154. fi
  9155. for obj
  9156. do
  9157. func_to_tool_file "$obj"
  9158. $ECHO "$func_to_tool_file_result" >> $output
  9159. done
  9160. func_append delfiles " $output"
  9161. func_to_tool_file "$output"
  9162. output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
  9163. else
  9164. if test -n "$save_libobjs"; then
  9165. func_verbose "creating reloadable object files..."
  9166. output=$output_objdir/$output_la-$k.$objext
  9167. eval test_cmds=\"$reload_cmds\"
  9168. func_len " $test_cmds"
  9169. len0=$func_len_result
  9170. len=$len0
  9171. # Loop over the list of objects to be linked.
  9172. for obj in $save_libobjs
  9173. do
  9174. func_len " $obj"
  9175. func_arith $len + $func_len_result
  9176. len=$func_arith_result
  9177. if test -z "$objlist" ||
  9178. test "$len" -lt "$max_cmd_len"; then
  9179. func_append objlist " $obj"
  9180. else
  9181. # The command $test_cmds is almost too long, add a
  9182. # command to the queue.
  9183. if test 1 -eq "$k"; then
  9184. # The first file doesn't have a previous command to add.
  9185. reload_objs=$objlist
  9186. eval concat_cmds=\"$reload_cmds\"
  9187. else
  9188. # All subsequent reloadable object files will link in
  9189. # the last one created.
  9190. reload_objs="$objlist $last_robj"
  9191. eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
  9192. fi
  9193. last_robj=$output_objdir/$output_la-$k.$objext
  9194. func_arith $k + 1
  9195. k=$func_arith_result
  9196. output=$output_objdir/$output_la-$k.$objext
  9197. objlist=" $obj"
  9198. func_len " $last_robj"
  9199. func_arith $len0 + $func_len_result
  9200. len=$func_arith_result
  9201. fi
  9202. done
  9203. # Handle the remaining objects by creating one last
  9204. # reloadable object file. All subsequent reloadable object
  9205. # files will link in the last one created.
  9206. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9207. reload_objs="$objlist $last_robj"
  9208. eval concat_cmds=\"\$concat_cmds$reload_cmds\"
  9209. if test -n "$last_robj"; then
  9210. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9211. fi
  9212. func_append delfiles " $output"
  9213. else
  9214. output=
  9215. fi
  9216. ${skipped_export-false} && {
  9217. func_verbose "generating symbol list for '$libname.la'"
  9218. export_symbols=$output_objdir/$libname.exp
  9219. $opt_dry_run || $RM $export_symbols
  9220. libobjs=$output
  9221. # Append the command to create the export file.
  9222. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9223. eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  9224. if test -n "$last_robj"; then
  9225. eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  9226. fi
  9227. }
  9228. test -n "$save_libobjs" &&
  9229. func_verbose "creating a temporary reloadable object file: $output"
  9230. # Loop through the commands generated above and execute them.
  9231. save_ifs=$IFS; IFS='~'
  9232. for cmd in $concat_cmds; do
  9233. IFS=$save_ifs
  9234. $opt_quiet || {
  9235. func_quote_for_expand "$cmd"
  9236. eval "func_echo $func_quote_for_expand_result"
  9237. }
  9238. $opt_dry_run || eval "$cmd" || {
  9239. lt_exit=$?
  9240. # Restore the uninstalled library and exit
  9241. if test relink = "$opt_mode"; then
  9242. ( cd "$output_objdir" && \
  9243. $RM "${realname}T" && \
  9244. $MV "${realname}U" "$realname" )
  9245. fi
  9246. exit $lt_exit
  9247. }
  9248. done
  9249. IFS=$save_ifs
  9250. if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  9251. func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  9252. func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  9253. fi
  9254. fi
  9255. ${skipped_export-false} && {
  9256. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  9257. tmp_export_symbols=$export_symbols
  9258. test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
  9259. $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
  9260. fi
  9261. if test -n "$orig_export_symbols"; then
  9262. # The given exports_symbols file has to be filtered, so filter it.
  9263. func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
  9264. # FIXME: $output_objdir/$libname.filter potentially contains lots of
  9265. # 's' commands, which not all seds can handle. GNU sed should be fine
  9266. # though. Also, the filter scales superlinearly with the number of
  9267. # global variables. join(1) would be nice here, but unfortunately
  9268. # isn't a blessed tool.
  9269. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  9270. func_append delfiles " $export_symbols $output_objdir/$libname.filter"
  9271. export_symbols=$output_objdir/$libname.def
  9272. $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  9273. fi
  9274. }
  9275. libobjs=$output
  9276. # Restore the value of output.
  9277. output=$save_output
  9278. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  9279. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  9280. test "X$libobjs" = "X " && libobjs=
  9281. fi
  9282. # Expand the library linking commands again to reset the
  9283. # value of $libobjs for piecewise linking.
  9284. # Do each of the archive commands.
  9285. if test yes = "$module" && test -n "$module_cmds"; then
  9286. if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
  9287. cmds=$module_expsym_cmds
  9288. else
  9289. cmds=$module_cmds
  9290. fi
  9291. else
  9292. if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  9293. cmds=$archive_expsym_cmds
  9294. else
  9295. cmds=$archive_cmds
  9296. fi
  9297. fi
  9298. fi
  9299. if test -n "$delfiles"; then
  9300. # Append the command to remove temporary files to $cmds.
  9301. eval cmds=\"\$cmds~\$RM $delfiles\"
  9302. fi
  9303. # Add any objects from preloaded convenience libraries
  9304. if test -n "$dlprefiles"; then
  9305. gentop=$output_objdir/${outputname}x
  9306. func_append generated " $gentop"
  9307. func_extract_archives $gentop $dlprefiles
  9308. func_append libobjs " $func_extract_archives_result"
  9309. test "X$libobjs" = "X " && libobjs=
  9310. fi
  9311. save_ifs=$IFS; IFS='~'
  9312. for cmd in $cmds; do
  9313. IFS=$sp$nl
  9314. eval cmd=\"$cmd\"
  9315. IFS=$save_ifs
  9316. $opt_quiet || {
  9317. func_quote_for_expand "$cmd"
  9318. eval "func_echo $func_quote_for_expand_result"
  9319. }
  9320. $opt_dry_run || eval "$cmd" || {
  9321. lt_exit=$?
  9322. # Restore the uninstalled library and exit
  9323. if test relink = "$opt_mode"; then
  9324. ( cd "$output_objdir" && \
  9325. $RM "${realname}T" && \
  9326. $MV "${realname}U" "$realname" )
  9327. fi
  9328. exit $lt_exit
  9329. }
  9330. done
  9331. IFS=$save_ifs
  9332. # Restore the uninstalled library and exit
  9333. if test relink = "$opt_mode"; then
  9334. $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  9335. if test -n "$convenience"; then
  9336. if test -z "$whole_archive_flag_spec"; then
  9337. func_show_eval '${RM}r "$gentop"'
  9338. fi
  9339. fi
  9340. exit $EXIT_SUCCESS
  9341. fi
  9342. # Create links to the real library.
  9343. for linkname in $linknames; do
  9344. if test "$realname" != "$linkname"; then
  9345. func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  9346. fi
  9347. done
  9348. # If -module or -export-dynamic was specified, set the dlname.
  9349. if test yes = "$module" || test yes = "$export_dynamic"; then
  9350. # On all known operating systems, these are identical.
  9351. dlname=$soname
  9352. fi
  9353. fi
  9354. ;;
  9355. obj)
  9356. if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
  9357. func_warning "'-dlopen' is ignored for objects"
  9358. fi
  9359. case " $deplibs" in
  9360. *\ -l* | *\ -L*)
  9361. func_warning "'-l' and '-L' are ignored for objects" ;;
  9362. esac
  9363. test -n "$rpath" && \
  9364. func_warning "'-rpath' is ignored for objects"
  9365. test -n "$xrpath" && \
  9366. func_warning "'-R' is ignored for objects"
  9367. test -n "$vinfo" && \
  9368. func_warning "'-version-info' is ignored for objects"
  9369. test -n "$release" && \
  9370. func_warning "'-release' is ignored for objects"
  9371. case $output in
  9372. *.lo)
  9373. test -n "$objs$old_deplibs" && \
  9374. func_fatal_error "cannot build library object '$output' from non-libtool objects"
  9375. libobj=$output
  9376. func_lo2o "$libobj"
  9377. obj=$func_lo2o_result
  9378. ;;
  9379. *)
  9380. libobj=
  9381. obj=$output
  9382. ;;
  9383. esac
  9384. # Delete the old objects.
  9385. $opt_dry_run || $RM $obj $libobj
  9386. # Objects from convenience libraries. This assumes
  9387. # single-version convenience libraries. Whenever we create
  9388. # different ones for PIC/non-PIC, this we'll have to duplicate
  9389. # the extraction.
  9390. reload_conv_objs=
  9391. gentop=
  9392. # if reload_cmds runs $LD directly, get rid of -Wl from
  9393. # whole_archive_flag_spec and hope we can get by with turning comma
  9394. # into space.
  9395. case $reload_cmds in
  9396. *\$LD[\ \$]*) wl= ;;
  9397. esac
  9398. if test -n "$convenience"; then
  9399. if test -n "$whole_archive_flag_spec"; then
  9400. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  9401. test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
  9402. reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
  9403. else
  9404. gentop=$output_objdir/${obj}x
  9405. func_append generated " $gentop"
  9406. func_extract_archives $gentop $convenience
  9407. reload_conv_objs="$reload_objs $func_extract_archives_result"
  9408. fi
  9409. fi
  9410. # If we're not building shared, we need to use non_pic_objs
  9411. test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
  9412. # Create the old-style object.
  9413. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
  9414. output=$obj
  9415. func_execute_cmds "$reload_cmds" 'exit $?'
  9416. # Exit if we aren't doing a library object file.
  9417. if test -z "$libobj"; then
  9418. if test -n "$gentop"; then
  9419. func_show_eval '${RM}r "$gentop"'
  9420. fi
  9421. exit $EXIT_SUCCESS
  9422. fi
  9423. test yes = "$build_libtool_libs" || {
  9424. if test -n "$gentop"; then
  9425. func_show_eval '${RM}r "$gentop"'
  9426. fi
  9427. # Create an invalid libtool object if no PIC, so that we don't
  9428. # accidentally link it into a program.
  9429. # $show "echo timestamp > $libobj"
  9430. # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  9431. exit $EXIT_SUCCESS
  9432. }
  9433. if test -n "$pic_flag" || test default != "$pic_mode"; then
  9434. # Only do commands if we really have different PIC objects.
  9435. reload_objs="$libobjs $reload_conv_objs"
  9436. output=$libobj
  9437. func_execute_cmds "$reload_cmds" 'exit $?'
  9438. fi
  9439. if test -n "$gentop"; then
  9440. func_show_eval '${RM}r "$gentop"'
  9441. fi
  9442. exit $EXIT_SUCCESS
  9443. ;;
  9444. prog)
  9445. case $host in
  9446. *cygwin*) func_stripname '' '.exe' "$output"
  9447. output=$func_stripname_result.exe;;
  9448. esac
  9449. test -n "$vinfo" && \
  9450. func_warning "'-version-info' is ignored for programs"
  9451. test -n "$release" && \
  9452. func_warning "'-release' is ignored for programs"
  9453. $preload \
  9454. && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
  9455. && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
  9456. case $host in
  9457. *-*-rhapsody* | *-*-darwin1.[012])
  9458. # On Rhapsody replace the C library is the System framework
  9459. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9460. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
  9461. ;;
  9462. esac
  9463. case $host in
  9464. *-*-darwin*)
  9465. # Don't allow lazy linking, it breaks C++ global constructors
  9466. # But is supposedly fixed on 10.4 or later (yay!).
  9467. if test CXX = "$tagname"; then
  9468. case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  9469. 10.[0123])
  9470. func_append compile_command " $wl-bind_at_load"
  9471. func_append finalize_command " $wl-bind_at_load"
  9472. ;;
  9473. esac
  9474. fi
  9475. # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  9476. compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9477. finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
  9478. ;;
  9479. esac
  9480. # move library search paths that coincide with paths to not yet
  9481. # installed libraries to the beginning of the library search list
  9482. new_libs=
  9483. for path in $notinst_path; do
  9484. case " $new_libs " in
  9485. *" -L$path/$objdir "*) ;;
  9486. *)
  9487. case " $compile_deplibs " in
  9488. *" -L$path/$objdir "*)
  9489. func_append new_libs " -L$path/$objdir" ;;
  9490. esac
  9491. ;;
  9492. esac
  9493. done
  9494. for deplib in $compile_deplibs; do
  9495. case $deplib in
  9496. -L*)
  9497. case " $new_libs " in
  9498. *" $deplib "*) ;;
  9499. *) func_append new_libs " $deplib" ;;
  9500. esac
  9501. ;;
  9502. *) func_append new_libs " $deplib" ;;
  9503. esac
  9504. done
  9505. compile_deplibs=$new_libs
  9506. func_append compile_command " $compile_deplibs"
  9507. func_append finalize_command " $finalize_deplibs"
  9508. if test -n "$rpath$xrpath"; then
  9509. # If the user specified any rpath flags, then add them.
  9510. for libdir in $rpath $xrpath; do
  9511. # This is the magic to use -rpath.
  9512. case "$finalize_rpath " in
  9513. *" $libdir "*) ;;
  9514. *) func_append finalize_rpath " $libdir" ;;
  9515. esac
  9516. done
  9517. fi
  9518. # Now hardcode the library paths
  9519. rpath=
  9520. hardcode_libdirs=
  9521. for libdir in $compile_rpath $finalize_rpath; do
  9522. if test -n "$hardcode_libdir_flag_spec"; then
  9523. func_replace_sysroot "$libdir"
  9524. libdir=$func_replace_sysroot_result
  9525. func_stripname '=' '' "$libdir"
  9526. libdir=$func_stripname_result
  9527. if test -n "$hardcode_libdir_separator"; then
  9528. if test -z "$hardcode_libdirs"; then
  9529. hardcode_libdirs=$libdir
  9530. else
  9531. # Just accumulate the unique libdirs.
  9532. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9533. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9534. ;;
  9535. *)
  9536. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9537. ;;
  9538. esac
  9539. fi
  9540. else
  9541. # We only want to hardcode in an rpath if it isn't in the
  9542. # default dlsearch path.
  9543. func_normal_abspath "$libdir"
  9544. libdir_norm=$func_normal_abspath_result
  9545. case " $sys_lib_dlsearch_path " in
  9546. *" $libdir_norm "*) ;;
  9547. *) eval flag=\"$hardcode_libdir_flag_spec\"
  9548. rpath+=" $flag"
  9549. ;;
  9550. esac
  9551. fi
  9552. elif test -n "$runpath_var"; then
  9553. case "$perm_rpath " in
  9554. *" $libdir "*) ;;
  9555. *) func_append perm_rpath " $libdir" ;;
  9556. esac
  9557. fi
  9558. case $host in
  9559. *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  9560. testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
  9561. case :$dllsearchpath: in
  9562. *":$libdir:"*) ;;
  9563. ::) dllsearchpath=$libdir;;
  9564. *) func_append dllsearchpath ":$libdir";;
  9565. esac
  9566. case :$dllsearchpath: in
  9567. *":$testbindir:"*) ;;
  9568. ::) dllsearchpath=$testbindir;;
  9569. *) func_append dllsearchpath ":$testbindir";;
  9570. esac
  9571. ;;
  9572. esac
  9573. done
  9574. # Substitute the hardcoded libdirs into the rpath.
  9575. if test -n "$hardcode_libdir_separator" &&
  9576. test -n "$hardcode_libdirs"; then
  9577. libdir=$hardcode_libdirs
  9578. eval rpath=\" $hardcode_libdir_flag_spec\"
  9579. fi
  9580. compile_rpath=$rpath
  9581. rpath=
  9582. hardcode_libdirs=
  9583. for libdir in $finalize_rpath; do
  9584. if test -n "$hardcode_libdir_flag_spec"; then
  9585. func_replace_sysroot "$libdir"
  9586. libdir=$func_replace_sysroot_result
  9587. func_stripname '=' '' "$libdir"
  9588. libdir=$func_stripname_result
  9589. if test -n "$hardcode_libdir_separator"; then
  9590. if test -z "$hardcode_libdirs"; then
  9591. hardcode_libdirs=$libdir
  9592. else
  9593. # Just accumulate the unique libdirs.
  9594. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
  9595. *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  9596. ;;
  9597. *)
  9598. func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
  9599. ;;
  9600. esac
  9601. fi
  9602. else
  9603. # We only want to hardcode in an rpath if it isn't in the
  9604. # default dlsearch path.
  9605. case " $sys_lib_dlsearch_path " in
  9606. *" $libdir "*) ;;
  9607. *) eval flag=\"$hardcode_libdir_flag_spec\"
  9608. func_append rpath " $flag"
  9609. ;;
  9610. esac
  9611. fi
  9612. elif test -n "$runpath_var"; then
  9613. case "$finalize_perm_rpath " in
  9614. *" $libdir "*) ;;
  9615. *) func_append finalize_perm_rpath " $libdir" ;;
  9616. esac
  9617. fi
  9618. done
  9619. # Substitute the hardcoded libdirs into the rpath.
  9620. if test -n "$hardcode_libdir_separator" &&
  9621. test -n "$hardcode_libdirs"; then
  9622. libdir=$hardcode_libdirs
  9623. eval rpath=\" $hardcode_libdir_flag_spec\"
  9624. fi
  9625. finalize_rpath=$rpath
  9626. if test -n "$libobjs" && test yes = "$build_old_libs"; then
  9627. # Transform all the library objects into standard objects.
  9628. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9629. finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
  9630. fi
  9631. func_generate_dlsyms "$outputname" "@PROGRAM@" false
  9632. # template prelinking step
  9633. if test -n "$prelink_cmds"; then
  9634. func_execute_cmds "$prelink_cmds" 'exit $?'
  9635. fi
  9636. wrappers_required=:
  9637. case $host in
  9638. *cegcc* | *mingw32ce*)
  9639. # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
  9640. wrappers_required=false
  9641. ;;
  9642. *cygwin* | *mingw* )
  9643. test yes = "$build_libtool_libs" || wrappers_required=false
  9644. ;;
  9645. *)
  9646. if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
  9647. wrappers_required=false
  9648. fi
  9649. ;;
  9650. esac
  9651. $wrappers_required || {
  9652. # Replace the output file specification.
  9653. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9654. link_command=$compile_command$compile_rpath
  9655. # We have no uninstalled library dependencies, so finalize right now.
  9656. exit_status=0
  9657. func_show_eval "$link_command" 'exit_status=$?'
  9658. if test -n "$postlink_cmds"; then
  9659. func_to_tool_file "$output"
  9660. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9661. func_execute_cmds "$postlink_cmds" 'exit $?'
  9662. fi
  9663. # Delete the generated files.
  9664. if test -f "$output_objdir/${outputname}S.$objext"; then
  9665. func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
  9666. fi
  9667. exit $exit_status
  9668. }
  9669. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  9670. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  9671. fi
  9672. if test -n "$finalize_shlibpath"; then
  9673. finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  9674. fi
  9675. compile_var=
  9676. finalize_var=
  9677. if test -n "$runpath_var"; then
  9678. if test -n "$perm_rpath"; then
  9679. # We should set the runpath_var.
  9680. rpath=
  9681. for dir in $perm_rpath; do
  9682. func_append rpath "$dir:"
  9683. done
  9684. compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9685. fi
  9686. if test -n "$finalize_perm_rpath"; then
  9687. # We should set the runpath_var.
  9688. rpath=
  9689. for dir in $finalize_perm_rpath; do
  9690. func_append rpath "$dir:"
  9691. done
  9692. finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  9693. fi
  9694. fi
  9695. if test yes = "$no_install"; then
  9696. # We don't need to create a wrapper script.
  9697. link_command=$compile_var$compile_command$compile_rpath
  9698. # Replace the output file specification.
  9699. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
  9700. # Delete the old output file.
  9701. $opt_dry_run || $RM $output
  9702. # Link the executable and exit
  9703. func_show_eval "$link_command" 'exit $?'
  9704. if test -n "$postlink_cmds"; then
  9705. func_to_tool_file "$output"
  9706. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9707. func_execute_cmds "$postlink_cmds" 'exit $?'
  9708. fi
  9709. exit $EXIT_SUCCESS
  9710. fi
  9711. case $hardcode_action,$fast_install in
  9712. relink,*)
  9713. # Fast installation is not supported
  9714. link_command=$compile_var$compile_command$compile_rpath
  9715. relink_command=$finalize_var$finalize_command$finalize_rpath
  9716. func_warning "this platform does not like uninstalled shared libraries"
  9717. func_warning "'$output' will be relinked during installation"
  9718. ;;
  9719. *,yes)
  9720. link_command=$finalize_var$compile_command$finalize_rpath
  9721. relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
  9722. ;;
  9723. *,no)
  9724. link_command=$compile_var$compile_command$compile_rpath
  9725. relink_command=$finalize_var$finalize_command$finalize_rpath
  9726. ;;
  9727. *,needless)
  9728. link_command=$finalize_var$compile_command$finalize_rpath
  9729. relink_command=
  9730. ;;
  9731. esac
  9732. # Replace the output file specification.
  9733. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  9734. # Delete the old output files.
  9735. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  9736. func_show_eval "$link_command" 'exit $?'
  9737. if test -n "$postlink_cmds"; then
  9738. func_to_tool_file "$output_objdir/$outputname"
  9739. postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
  9740. func_execute_cmds "$postlink_cmds" 'exit $?'
  9741. fi
  9742. # Now create the wrapper script.
  9743. func_verbose "creating $output"
  9744. # Quote the relink command for shipping.
  9745. if test -n "$relink_command"; then
  9746. # Preserve any variables that may affect compiler behavior
  9747. for var in $variables_saved_for_relink; do
  9748. if eval test -z \"\${$var+set}\"; then
  9749. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  9750. elif eval var_value=\$$var; test -z "$var_value"; then
  9751. relink_command="$var=; export $var; $relink_command"
  9752. else
  9753. func_quote_for_eval "$var_value"
  9754. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  9755. fi
  9756. done
  9757. relink_command="(cd `pwd`; $relink_command)"
  9758. relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  9759. fi
  9760. # Only actually do things if not in dry run mode.
  9761. $opt_dry_run || {
  9762. # win32 will think the script is a binary if it has
  9763. # a .exe suffix, so we strip it off here.
  9764. case $output in
  9765. *.exe) func_stripname '' '.exe' "$output"
  9766. output=$func_stripname_result ;;
  9767. esac
  9768. # test for cygwin because mv fails w/o .exe extensions
  9769. case $host in
  9770. *cygwin*)
  9771. exeext=.exe
  9772. func_stripname '' '.exe' "$outputname"
  9773. outputname=$func_stripname_result ;;
  9774. *) exeext= ;;
  9775. esac
  9776. case $host in
  9777. *cygwin* | *mingw* )
  9778. func_dirname_and_basename "$output" "" "."
  9779. output_name=$func_basename_result
  9780. output_path=$func_dirname_result
  9781. cwrappersource=$output_path/$objdir/lt-$output_name.c
  9782. cwrapper=$output_path/$output_name.exe
  9783. $RM $cwrappersource $cwrapper
  9784. trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  9785. func_emit_cwrapperexe_src > $cwrappersource
  9786. # The wrapper executable is built using the $host compiler,
  9787. # because it contains $host paths and files. If cross-
  9788. # compiling, it, like the target executable, must be
  9789. # executed on the $host or under an emulation environment.
  9790. $opt_dry_run || {
  9791. $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  9792. $STRIP $cwrapper
  9793. }
  9794. # Now, create the wrapper script for func_source use:
  9795. func_ltwrapper_scriptname $cwrapper
  9796. $RM $func_ltwrapper_scriptname_result
  9797. trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  9798. $opt_dry_run || {
  9799. # note: this script will not be executed, so do not chmod.
  9800. if test "x$build" = "x$host"; then
  9801. $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  9802. else
  9803. func_emit_wrapper no > $func_ltwrapper_scriptname_result
  9804. fi
  9805. }
  9806. ;;
  9807. * )
  9808. $RM $output
  9809. trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  9810. func_emit_wrapper no > $output
  9811. chmod +x $output
  9812. ;;
  9813. esac
  9814. }
  9815. exit $EXIT_SUCCESS
  9816. ;;
  9817. esac
  9818. # See if we need to build an old-fashioned archive.
  9819. for oldlib in $oldlibs; do
  9820. case $build_libtool_libs in
  9821. convenience)
  9822. oldobjs="$libobjs_save $symfileobj"
  9823. addlibs=$convenience
  9824. build_libtool_libs=no
  9825. ;;
  9826. module)
  9827. oldobjs=$libobjs_save
  9828. addlibs=$old_convenience
  9829. build_libtool_libs=no
  9830. ;;
  9831. *)
  9832. oldobjs="$old_deplibs $non_pic_objects"
  9833. $preload && test -f "$symfileobj" \
  9834. && func_append oldobjs " $symfileobj"
  9835. addlibs=$old_convenience
  9836. ;;
  9837. esac
  9838. if test -n "$addlibs"; then
  9839. gentop=$output_objdir/${outputname}x
  9840. func_append generated " $gentop"
  9841. func_extract_archives $gentop $addlibs
  9842. func_append oldobjs " $func_extract_archives_result"
  9843. fi
  9844. # Do each command in the archive commands.
  9845. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
  9846. cmds=$old_archive_from_new_cmds
  9847. else
  9848. # Add any objects from preloaded convenience libraries
  9849. if test -n "$dlprefiles"; then
  9850. gentop=$output_objdir/${outputname}x
  9851. func_append generated " $gentop"
  9852. func_extract_archives $gentop $dlprefiles
  9853. func_append oldobjs " $func_extract_archives_result"
  9854. fi
  9855. # POSIX demands no paths to be encoded in archives. We have
  9856. # to avoid creating archives with duplicate basenames if we
  9857. # might have to extract them afterwards, e.g., when creating a
  9858. # static archive out of a convenience library, or when linking
  9859. # the entirety of a libtool archive into another (currently
  9860. # not supported by libtool).
  9861. if (for obj in $oldobjs
  9862. do
  9863. func_basename "$obj"
  9864. $ECHO "$func_basename_result"
  9865. done | sort | sort -uc >/dev/null 2>&1); then
  9866. :
  9867. else
  9868. echo "copying selected object files to avoid basename conflicts..."
  9869. gentop=$output_objdir/${outputname}x
  9870. func_append generated " $gentop"
  9871. func_mkdir_p "$gentop"
  9872. save_oldobjs=$oldobjs
  9873. oldobjs=
  9874. counter=1
  9875. for obj in $save_oldobjs
  9876. do
  9877. func_basename "$obj"
  9878. objbase=$func_basename_result
  9879. case " $oldobjs " in
  9880. " ") oldobjs=$obj ;;
  9881. *[\ /]"$objbase "*)
  9882. while :; do
  9883. # Make sure we don't pick an alternate name that also
  9884. # overlaps.
  9885. newobj=lt$counter-$objbase
  9886. func_arith $counter + 1
  9887. counter=$func_arith_result
  9888. case " $oldobjs " in
  9889. *[\ /]"$newobj "*) ;;
  9890. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  9891. esac
  9892. done
  9893. func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  9894. func_append oldobjs " $gentop/$newobj"
  9895. ;;
  9896. *) func_append oldobjs " $obj" ;;
  9897. esac
  9898. done
  9899. fi
  9900. func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
  9901. tool_oldlib=$func_to_tool_file_result
  9902. eval cmds=\"$old_archive_cmds\"
  9903. func_len " $cmds"
  9904. len=$func_len_result
  9905. if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  9906. cmds=$old_archive_cmds
  9907. elif test -n "$archiver_list_spec"; then
  9908. func_verbose "using command file archive linking..."
  9909. for obj in $oldobjs
  9910. do
  9911. func_to_tool_file "$obj"
  9912. $ECHO "$func_to_tool_file_result"
  9913. done > $output_objdir/$libname.libcmd
  9914. func_to_tool_file "$output_objdir/$libname.libcmd"
  9915. oldobjs=" $archiver_list_spec$func_to_tool_file_result"
  9916. cmds=$old_archive_cmds
  9917. else
  9918. # the command line is too long to link in one step, link in parts
  9919. func_verbose "using piecewise archive linking..."
  9920. save_RANLIB=$RANLIB
  9921. RANLIB=:
  9922. objlist=
  9923. concat_cmds=
  9924. save_oldobjs=$oldobjs
  9925. oldobjs=
  9926. # Is there a better way of finding the last object in the list?
  9927. for obj in $save_oldobjs
  9928. do
  9929. last_oldobj=$obj
  9930. done
  9931. eval test_cmds=\"$old_archive_cmds\"
  9932. func_len " $test_cmds"
  9933. len0=$func_len_result
  9934. len=$len0
  9935. for obj in $save_oldobjs
  9936. do
  9937. func_len " $obj"
  9938. func_arith $len + $func_len_result
  9939. len=$func_arith_result
  9940. func_append objlist " $obj"
  9941. if test "$len" -lt "$max_cmd_len"; then
  9942. :
  9943. else
  9944. # the above command should be used before it gets too long
  9945. oldobjs=$objlist
  9946. if test "$obj" = "$last_oldobj"; then
  9947. RANLIB=$save_RANLIB
  9948. fi
  9949. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  9950. eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
  9951. objlist=
  9952. len=$len0
  9953. fi
  9954. done
  9955. RANLIB=$save_RANLIB
  9956. oldobjs=$objlist
  9957. if test -z "$oldobjs"; then
  9958. eval cmds=\"\$concat_cmds\"
  9959. else
  9960. eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
  9961. fi
  9962. fi
  9963. fi
  9964. func_execute_cmds "$cmds" 'exit $?'
  9965. done
  9966. test -n "$generated" && \
  9967. func_show_eval "${RM}r$generated"
  9968. # Now create the libtool archive.
  9969. case $output in
  9970. *.la)
  9971. old_library=
  9972. test yes = "$build_old_libs" && old_library=$libname.$libext
  9973. func_verbose "creating $output"
  9974. # Preserve any variables that may affect compiler behavior
  9975. for var in $variables_saved_for_relink; do
  9976. if eval test -z \"\${$var+set}\"; then
  9977. relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  9978. elif eval var_value=\$$var; test -z "$var_value"; then
  9979. relink_command="$var=; export $var; $relink_command"
  9980. else
  9981. func_quote_for_eval "$var_value"
  9982. relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  9983. fi
  9984. done
  9985. # Quote the link command for shipping.
  9986. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  9987. relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
  9988. if test yes = "$hardcode_automatic"; then
  9989. relink_command=
  9990. fi
  9991. # Only create the output if not a dry run.
  9992. $opt_dry_run || {
  9993. for installed in no yes; do
  9994. if test yes = "$installed"; then
  9995. if test -z "$install_libdir"; then
  9996. break
  9997. fi
  9998. output=$output_objdir/${outputname}i
  9999. # Replace all uninstalled libtool libraries with the installed ones
  10000. newdependency_libs=
  10001. for deplib in $dependency_libs; do
  10002. case $deplib in
  10003. *.la)
  10004. func_basename "$deplib"
  10005. name=$func_basename_result
  10006. func_resolve_sysroot "$deplib"
  10007. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
  10008. test -z "$libdir" && \
  10009. func_fatal_error "'$deplib' is not a valid libtool archive"
  10010. func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
  10011. ;;
  10012. -L*)
  10013. func_stripname -L '' "$deplib"
  10014. func_replace_sysroot "$func_stripname_result"
  10015. func_append newdependency_libs " -L$func_replace_sysroot_result"
  10016. ;;
  10017. -R*)
  10018. func_stripname -R '' "$deplib"
  10019. func_replace_sysroot "$func_stripname_result"
  10020. func_append newdependency_libs " -R$func_replace_sysroot_result"
  10021. ;;
  10022. *) func_append newdependency_libs " $deplib" ;;
  10023. esac
  10024. done
  10025. dependency_libs=$newdependency_libs
  10026. newdlfiles=
  10027. for lib in $dlfiles; do
  10028. case $lib in
  10029. *.la)
  10030. func_basename "$lib"
  10031. name=$func_basename_result
  10032. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  10033. test -z "$libdir" && \
  10034. func_fatal_error "'$lib' is not a valid libtool archive"
  10035. func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
  10036. ;;
  10037. *) func_append newdlfiles " $lib" ;;
  10038. esac
  10039. done
  10040. dlfiles=$newdlfiles
  10041. newdlprefiles=
  10042. for lib in $dlprefiles; do
  10043. case $lib in
  10044. *.la)
  10045. # Only pass preopened files to the pseudo-archive (for
  10046. # eventual linking with the app. that links it) if we
  10047. # didn't already link the preopened objects directly into
  10048. # the library:
  10049. func_basename "$lib"
  10050. name=$func_basename_result
  10051. eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  10052. test -z "$libdir" && \
  10053. func_fatal_error "'$lib' is not a valid libtool archive"
  10054. func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
  10055. ;;
  10056. esac
  10057. done
  10058. dlprefiles=$newdlprefiles
  10059. else
  10060. newdlfiles=
  10061. for lib in $dlfiles; do
  10062. case $lib in
  10063. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  10064. *) abs=`pwd`"/$lib" ;;
  10065. esac
  10066. func_append newdlfiles " $abs"
  10067. done
  10068. dlfiles=$newdlfiles
  10069. newdlprefiles=
  10070. for lib in $dlprefiles; do
  10071. case $lib in
  10072. [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
  10073. *) abs=`pwd`"/$lib" ;;
  10074. esac
  10075. func_append newdlprefiles " $abs"
  10076. done
  10077. dlprefiles=$newdlprefiles
  10078. fi
  10079. $RM $output
  10080. # place dlname in correct position for cygwin
  10081. # In fact, it would be nice if we could use this code for all target
  10082. # systems that can't hard-code library paths into their executables
  10083. # and that have no shared library path variable independent of PATH,
  10084. # but it turns out we can't easily determine that from inspecting
  10085. # libtool variables, so we have to hard-code the OSs to which it
  10086. # applies here; at the moment, that means platforms that use the PE
  10087. # object format with DLL files. See the long comment at the top of
  10088. # tests/bindir.at for full details.
  10089. tdlname=$dlname
  10090. case $host,$output,$installed,$module,$dlname in
  10091. *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
  10092. # If a -bindir argument was supplied, place the dll there.
  10093. if test -n "$bindir"; then
  10094. func_relative_path "$install_libdir" "$bindir"
  10095. tdlname=$func_relative_path_result/$dlname
  10096. else
  10097. # Otherwise fall back on heuristic.
  10098. tdlname=../bin/$dlname
  10099. fi
  10100. ;;
  10101. esac
  10102. $ECHO > $output "\
  10103. # $outputname - a libtool library file
  10104. # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
  10105. #
  10106. # Please DO NOT delete this file!
  10107. # It is necessary for linking the library.
  10108. # The name that we can dlopen(3).
  10109. dlname='$tdlname'
  10110. # Names of this library.
  10111. library_names='$library_names'
  10112. # The name of the static archive.
  10113. old_library='$old_library'
  10114. # Linker flags that cannot go in dependency_libs.
  10115. inherited_linker_flags='$new_inherited_linker_flags'
  10116. # Libraries that this one depends upon.
  10117. dependency_libs='$dependency_libs'
  10118. # Names of additional weak libraries provided by this library
  10119. weak_library_names='$weak_libs'
  10120. # Version information for $libname.
  10121. current=$current
  10122. age=$age
  10123. revision=$revision
  10124. # Is this an already installed library?
  10125. installed=$installed
  10126. # Should we warn about portability when linking against -modules?
  10127. shouldnotlink=$module
  10128. # Files to dlopen/dlpreopen
  10129. dlopen='$dlfiles'
  10130. dlpreopen='$dlprefiles'
  10131. # Directory that this library needs to be installed in:
  10132. libdir='$install_libdir'"
  10133. if test no,yes = "$installed,$need_relink"; then
  10134. $ECHO >> $output "\
  10135. relink_command=\"$relink_command\""
  10136. fi
  10137. done
  10138. }
  10139. # Do a symbolic link so that the libtool archive can be found in
  10140. # LD_LIBRARY_PATH before the program is installed.
  10141. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  10142. ;;
  10143. esac
  10144. exit $EXIT_SUCCESS
  10145. }
  10146. if test link = "$opt_mode" || test relink = "$opt_mode"; then
  10147. func_mode_link ${1+"$@"}
  10148. fi
  10149. # func_mode_uninstall arg...
  10150. func_mode_uninstall ()
  10151. {
  10152. $debug_cmd
  10153. RM=$nonopt
  10154. files=
  10155. rmforce=false
  10156. exit_status=0
  10157. # This variable tells wrapper scripts just to set variables rather
  10158. # than running their programs.
  10159. libtool_install_magic=$magic
  10160. for arg
  10161. do
  10162. case $arg in
  10163. -f) func_append RM " $arg"; rmforce=: ;;
  10164. -*) func_append RM " $arg" ;;
  10165. *) func_append files " $arg" ;;
  10166. esac
  10167. done
  10168. test -z "$RM" && \
  10169. func_fatal_help "you must specify an RM program"
  10170. rmdirs=
  10171. for file in $files; do
  10172. func_dirname "$file" "" "."
  10173. dir=$func_dirname_result
  10174. if test . = "$dir"; then
  10175. odir=$objdir
  10176. else
  10177. odir=$dir/$objdir
  10178. fi
  10179. func_basename "$file"
  10180. name=$func_basename_result
  10181. test uninstall = "$opt_mode" && odir=$dir
  10182. # Remember odir for removal later, being careful to avoid duplicates
  10183. if test clean = "$opt_mode"; then
  10184. case " $rmdirs " in
  10185. *" $odir "*) ;;
  10186. *) func_append rmdirs " $odir" ;;
  10187. esac
  10188. fi
  10189. # Don't error if the file doesn't exist and rm -f was used.
  10190. if { test -L "$file"; } >/dev/null 2>&1 ||
  10191. { test -h "$file"; } >/dev/null 2>&1 ||
  10192. test -f "$file"; then
  10193. :
  10194. elif test -d "$file"; then
  10195. exit_status=1
  10196. continue
  10197. elif $rmforce; then
  10198. continue
  10199. fi
  10200. rmfiles=$file
  10201. case $name in
  10202. *.la)
  10203. # Possibly a libtool archive, so verify it.
  10204. if func_lalib_p "$file"; then
  10205. func_source $dir/$name
  10206. # Delete the libtool libraries and symlinks.
  10207. for n in $library_names; do
  10208. func_append rmfiles " $odir/$n"
  10209. done
  10210. test -n "$old_library" && func_append rmfiles " $odir/$old_library"
  10211. case $opt_mode in
  10212. clean)
  10213. case " $library_names " in
  10214. *" $dlname "*) ;;
  10215. *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
  10216. esac
  10217. test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
  10218. ;;
  10219. uninstall)
  10220. if test -n "$library_names"; then
  10221. # Do each command in the postuninstall commands.
  10222. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
  10223. fi
  10224. if test -n "$old_library"; then
  10225. # Do each command in the old_postuninstall commands.
  10226. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
  10227. fi
  10228. # FIXME: should reinstall the best remaining shared library.
  10229. ;;
  10230. esac
  10231. fi
  10232. ;;
  10233. *.lo)
  10234. # Possibly a libtool object, so verify it.
  10235. if func_lalib_p "$file"; then
  10236. # Read the .lo file
  10237. func_source $dir/$name
  10238. # Add PIC object to the list of files to remove.
  10239. if test -n "$pic_object" && test none != "$pic_object"; then
  10240. func_append rmfiles " $dir/$pic_object"
  10241. fi
  10242. # Add non-PIC object to the list of files to remove.
  10243. if test -n "$non_pic_object" && test none != "$non_pic_object"; then
  10244. func_append rmfiles " $dir/$non_pic_object"
  10245. fi
  10246. fi
  10247. ;;
  10248. *)
  10249. if test clean = "$opt_mode"; then
  10250. noexename=$name
  10251. case $file in
  10252. *.exe)
  10253. func_stripname '' '.exe' "$file"
  10254. file=$func_stripname_result
  10255. func_stripname '' '.exe' "$name"
  10256. noexename=$func_stripname_result
  10257. # $file with .exe has already been added to rmfiles,
  10258. # add $file without .exe
  10259. func_append rmfiles " $file"
  10260. ;;
  10261. esac
  10262. # Do a test to see if this is a libtool program.
  10263. if func_ltwrapper_p "$file"; then
  10264. if func_ltwrapper_executable_p "$file"; then
  10265. func_ltwrapper_scriptname "$file"
  10266. relink_command=
  10267. func_source $func_ltwrapper_scriptname_result
  10268. func_append rmfiles " $func_ltwrapper_scriptname_result"
  10269. else
  10270. relink_command=
  10271. func_source $dir/$noexename
  10272. fi
  10273. # note $name still contains .exe if it was in $file originally
  10274. # as does the version of $file that was added into $rmfiles
  10275. func_append rmfiles " $odir/$name $odir/${name}S.$objext"
  10276. if test yes = "$fast_install" && test -n "$relink_command"; then
  10277. func_append rmfiles " $odir/lt-$name"
  10278. fi
  10279. if test "X$noexename" != "X$name"; then
  10280. func_append rmfiles " $odir/lt-$noexename.c"
  10281. fi
  10282. fi
  10283. fi
  10284. ;;
  10285. esac
  10286. func_show_eval "$RM $rmfiles" 'exit_status=1'
  10287. done
  10288. # Try to remove the $objdir's in the directories where we deleted files
  10289. for dir in $rmdirs; do
  10290. if test -d "$dir"; then
  10291. func_show_eval "rmdir $dir >/dev/null 2>&1"
  10292. fi
  10293. done
  10294. exit $exit_status
  10295. }
  10296. if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
  10297. func_mode_uninstall ${1+"$@"}
  10298. fi
  10299. test -z "$opt_mode" && {
  10300. help=$generic_help
  10301. func_fatal_help "you must specify a MODE"
  10302. }
  10303. test -z "$exec_cmd" && \
  10304. func_fatal_help "invalid operation mode '$opt_mode'"
  10305. if test -n "$exec_cmd"; then
  10306. eval exec "$exec_cmd"
  10307. exit $EXIT_FAILURE
  10308. fi
  10309. exit $exit_status
  10310. # The TAGs below are defined such that we never get into a situation
  10311. # where we disable both kinds of libraries. Given conflicting
  10312. # choices, we go for a static library, that is the most portable,
  10313. # since we can't tell whether shared libraries were disabled because
  10314. # the user asked for that or because the platform doesn't support
  10315. # them. This is particularly important on AIX, because we don't
  10316. # support having both static and shared libraries enabled at the same
  10317. # time on that platform, so we default to a shared-only configuration.
  10318. # If a disable-shared tag is given, we'll fallback to a static-only
  10319. # configuration. But we'll never go from static-only to shared-only.
  10320. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  10321. build_libtool_libs=no
  10322. build_old_libs=yes
  10323. # ### END LIBTOOL TAG CONFIG: disable-shared
  10324. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  10325. build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  10326. # ### END LIBTOOL TAG CONFIG: disable-static
  10327. # Local Variables:
  10328. # mode:shell-script
  10329. # sh-indentation:2
  10330. # End:
  10331. # ### BEGIN LIBTOOL TAG CONFIG: CXX
  10332. # The linker used to build libraries.
  10333. LD="arm-linux-gnueabihf-ld "
  10334. # How to create reloadable object files.
  10335. reload_flag=" -r"
  10336. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10337. # Commands used to build an old-style archive.
  10338. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10339. # A language specific compiler.
  10340. CC="arm-linux-gnueabihf-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard "
  10341. # Is the compiler the GNU compiler?
  10342. with_gcc=yes
  10343. # Compiler flag to turn off builtin functions.
  10344. no_builtin_flag=" -fno-builtin"
  10345. # Additional compiler flags for building library objects.
  10346. pic_flag=" -fPIC -DPIC"
  10347. # How to pass a linker flag through the compiler.
  10348. wl="-Wl,"
  10349. # Compiler flag to prevent dynamic linking.
  10350. link_static_flag="-static"
  10351. # Does compiler simultaneously support -c and -o options?
  10352. compiler_c_o="yes"
  10353. # Whether or not to add -lc for building shared libraries.
  10354. build_libtool_need_lc=no
  10355. # Whether or not to disallow shared libs when runtime libs are static.
  10356. allow_libtool_libs_with_static_runtimes=no
  10357. # Compiler flag to allow reflexive dlopens.
  10358. export_dynamic_flag_spec="\$wl--export-dynamic"
  10359. # Compiler flag to generate shared objects directly from archives.
  10360. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  10361. # Whether the compiler copes with passing no objects directly.
  10362. compiler_needs_object="no"
  10363. # Create an old-style archive from a shared archive.
  10364. old_archive_from_new_cmds=""
  10365. # Create a temporary old-style archive to link instead of a shared archive.
  10366. old_archive_from_expsyms_cmds=""
  10367. # Commands used to build a shared archive.
  10368. archive_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  10369. archive_expsym_cmds="\$CC \$pic_flag -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \$wl-soname \$wl\$soname \$wl-retain-symbols-file \$wl\$export_symbols -o \$lib"
  10370. # Commands used to build a loadable module if different from building
  10371. # a shared archive.
  10372. module_cmds=""
  10373. module_expsym_cmds=""
  10374. # Whether we are building with GNU ld or not.
  10375. with_gnu_ld="yes"
  10376. # Flag that allows shared libraries with undefined symbols to be built.
  10377. allow_undefined_flag=""
  10378. # Flag that enforces no undefined symbols.
  10379. no_undefined_flag=""
  10380. # Flag to hardcode $libdir into a binary during linking.
  10381. # This must work even if $libdir does not exist
  10382. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  10383. # Whether we need a single "-rpath" flag with a separated argument.
  10384. hardcode_libdir_separator=""
  10385. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10386. # DIR into the resulting binary.
  10387. hardcode_direct=no
  10388. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10389. # DIR into the resulting binary and the resulting library dependency is
  10390. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10391. # library is relocated.
  10392. hardcode_direct_absolute=no
  10393. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10394. # into the resulting binary.
  10395. hardcode_minus_L=no
  10396. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10397. # into the resulting binary.
  10398. hardcode_shlibpath_var=unsupported
  10399. # Set to "yes" if building a shared library automatically hardcodes DIR
  10400. # into the library and all subsequent libraries and executables linked
  10401. # against it.
  10402. hardcode_automatic=no
  10403. # Set to yes if linker adds runtime paths of dependent libraries
  10404. # to runtime path list.
  10405. inherit_rpath=no
  10406. # Whether libtool must link a program against all its dependency libraries.
  10407. link_all_deplibs=unknown
  10408. # Set to "yes" if exported symbols are required.
  10409. always_export_symbols=no
  10410. # The commands to list exported symbols.
  10411. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  10412. # Symbols that should not be listed in the preloaded symbols.
  10413. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  10414. # Symbols that must always be exported.
  10415. include_expsyms=""
  10416. # Commands necessary for linking programs (against libraries) with templates.
  10417. prelink_cmds=""
  10418. # Commands necessary for finishing linking programs.
  10419. postlink_cmds=""
  10420. # Specify filename containing input files.
  10421. file_list_spec=""
  10422. # How to hardcode a shared library path into an executable.
  10423. hardcode_action=immediate
  10424. # The directories searched by this compiler when creating a shared library.
  10425. compiler_lib_search_dirs="/usr/lib /lib"
  10426. # Dependencies to place before and after the objects being linked to
  10427. # create a shared library.
  10428. predep_objects=""
  10429. postdep_objects=""
  10430. predeps=""
  10431. postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
  10432. # The library search path used internally by the compiler when linking
  10433. # a shared library.
  10434. compiler_lib_search_path="/usr/lib /lib"
  10435. # ### END LIBTOOL TAG CONFIG: CXX
  10436. # ### BEGIN LIBTOOL TAG CONFIG: F77
  10437. # The linker used to build libraries.
  10438. LD=""
  10439. # How to create reloadable object files.
  10440. reload_flag=" -r"
  10441. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10442. # Commands used to build an old-style archive.
  10443. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10444. # A language specific compiler.
  10445. CC=""
  10446. # Is the compiler the GNU compiler?
  10447. with_gcc=
  10448. # Compiler flag to turn off builtin functions.
  10449. no_builtin_flag=""
  10450. # Additional compiler flags for building library objects.
  10451. pic_flag=""
  10452. # How to pass a linker flag through the compiler.
  10453. wl=""
  10454. # Compiler flag to prevent dynamic linking.
  10455. link_static_flag=""
  10456. # Does compiler simultaneously support -c and -o options?
  10457. compiler_c_o=""
  10458. # Whether or not to add -lc for building shared libraries.
  10459. build_libtool_need_lc=no
  10460. # Whether or not to disallow shared libs when runtime libs are static.
  10461. allow_libtool_libs_with_static_runtimes=no
  10462. # Compiler flag to allow reflexive dlopens.
  10463. export_dynamic_flag_spec=""
  10464. # Compiler flag to generate shared objects directly from archives.
  10465. whole_archive_flag_spec=""
  10466. # Whether the compiler copes with passing no objects directly.
  10467. compiler_needs_object=""
  10468. # Create an old-style archive from a shared archive.
  10469. old_archive_from_new_cmds=""
  10470. # Create a temporary old-style archive to link instead of a shared archive.
  10471. old_archive_from_expsyms_cmds=""
  10472. # Commands used to build a shared archive.
  10473. archive_cmds=""
  10474. archive_expsym_cmds=""
  10475. # Commands used to build a loadable module if different from building
  10476. # a shared archive.
  10477. module_cmds=""
  10478. module_expsym_cmds=""
  10479. # Whether we are building with GNU ld or not.
  10480. with_gnu_ld=""
  10481. # Flag that allows shared libraries with undefined symbols to be built.
  10482. allow_undefined_flag=""
  10483. # Flag that enforces no undefined symbols.
  10484. no_undefined_flag=""
  10485. # Flag to hardcode $libdir into a binary during linking.
  10486. # This must work even if $libdir does not exist
  10487. hardcode_libdir_flag_spec=""
  10488. # Whether we need a single "-rpath" flag with a separated argument.
  10489. hardcode_libdir_separator=""
  10490. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10491. # DIR into the resulting binary.
  10492. hardcode_direct=no
  10493. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10494. # DIR into the resulting binary and the resulting library dependency is
  10495. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10496. # library is relocated.
  10497. hardcode_direct_absolute=no
  10498. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10499. # into the resulting binary.
  10500. hardcode_minus_L=no
  10501. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10502. # into the resulting binary.
  10503. hardcode_shlibpath_var=
  10504. # Set to "yes" if building a shared library automatically hardcodes DIR
  10505. # into the library and all subsequent libraries and executables linked
  10506. # against it.
  10507. hardcode_automatic=no
  10508. # Set to yes if linker adds runtime paths of dependent libraries
  10509. # to runtime path list.
  10510. inherit_rpath=no
  10511. # Whether libtool must link a program against all its dependency libraries.
  10512. link_all_deplibs=unknown
  10513. # Set to "yes" if exported symbols are required.
  10514. always_export_symbols=no
  10515. # The commands to list exported symbols.
  10516. export_symbols_cmds=""
  10517. # Symbols that should not be listed in the preloaded symbols.
  10518. exclude_expsyms=""
  10519. # Symbols that must always be exported.
  10520. include_expsyms=""
  10521. # Commands necessary for linking programs (against libraries) with templates.
  10522. prelink_cmds=""
  10523. # Commands necessary for finishing linking programs.
  10524. postlink_cmds=""
  10525. # Specify filename containing input files.
  10526. file_list_spec=""
  10527. # How to hardcode a shared library path into an executable.
  10528. hardcode_action=
  10529. # The directories searched by this compiler when creating a shared library.
  10530. compiler_lib_search_dirs="/usr/lib /lib"
  10531. # Dependencies to place before and after the objects being linked to
  10532. # create a shared library.
  10533. predep_objects=""
  10534. postdep_objects=""
  10535. predeps=""
  10536. postdeps=""
  10537. # The library search path used internally by the compiler when linking
  10538. # a shared library.
  10539. compiler_lib_search_path="/usr/lib /lib"
  10540. # ### END LIBTOOL TAG CONFIG: F77
  10541. # ### BEGIN LIBTOOL TAG CONFIG: FC
  10542. # The linker used to build libraries.
  10543. LD="arm-linux-gnueabihf-ld "
  10544. # How to create reloadable object files.
  10545. reload_flag=" -r"
  10546. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10547. # Commands used to build an old-style archive.
  10548. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10549. # A language specific compiler.
  10550. CC="arm-linux-gnueabihf-gfortran -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard "
  10551. # Is the compiler the GNU compiler?
  10552. with_gcc=yes
  10553. # Compiler flag to turn off builtin functions.
  10554. no_builtin_flag=""
  10555. # Additional compiler flags for building library objects.
  10556. pic_flag=" -fPIC"
  10557. # How to pass a linker flag through the compiler.
  10558. wl="-Wl,"
  10559. # Compiler flag to prevent dynamic linking.
  10560. link_static_flag="-static"
  10561. # Does compiler simultaneously support -c and -o options?
  10562. compiler_c_o="yes"
  10563. # Whether or not to add -lc for building shared libraries.
  10564. build_libtool_need_lc=no
  10565. # Whether or not to disallow shared libs when runtime libs are static.
  10566. allow_libtool_libs_with_static_runtimes=no
  10567. # Compiler flag to allow reflexive dlopens.
  10568. export_dynamic_flag_spec="\$wl--export-dynamic"
  10569. # Compiler flag to generate shared objects directly from archives.
  10570. whole_archive_flag_spec="\$wl--whole-archive\$convenience \$wl--no-whole-archive"
  10571. # Whether the compiler copes with passing no objects directly.
  10572. compiler_needs_object="no"
  10573. # Create an old-style archive from a shared archive.
  10574. old_archive_from_new_cmds=""
  10575. # Create a temporary old-style archive to link instead of a shared archive.
  10576. old_archive_from_expsyms_cmds=""
  10577. # Commands used to build a shared archive.
  10578. archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname -o \$lib"
  10579. archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
  10580. cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
  10581. echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
  10582. \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \$wl-soname \$wl\$soname \$wl-version-script \$wl\$output_objdir/\$libname.ver -o \$lib"
  10583. # Commands used to build a loadable module if different from building
  10584. # a shared archive.
  10585. module_cmds=""
  10586. module_expsym_cmds=""
  10587. # Whether we are building with GNU ld or not.
  10588. with_gnu_ld="yes"
  10589. # Flag that allows shared libraries with undefined symbols to be built.
  10590. allow_undefined_flag=""
  10591. # Flag that enforces no undefined symbols.
  10592. no_undefined_flag=""
  10593. # Flag to hardcode $libdir into a binary during linking.
  10594. # This must work even if $libdir does not exist
  10595. hardcode_libdir_flag_spec="\$wl-rpath \$wl\$libdir"
  10596. # Whether we need a single "-rpath" flag with a separated argument.
  10597. hardcode_libdir_separator=""
  10598. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10599. # DIR into the resulting binary.
  10600. hardcode_direct=no
  10601. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10602. # DIR into the resulting binary and the resulting library dependency is
  10603. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10604. # library is relocated.
  10605. hardcode_direct_absolute=no
  10606. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10607. # into the resulting binary.
  10608. hardcode_minus_L=no
  10609. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10610. # into the resulting binary.
  10611. hardcode_shlibpath_var=unsupported
  10612. # Set to "yes" if building a shared library automatically hardcodes DIR
  10613. # into the library and all subsequent libraries and executables linked
  10614. # against it.
  10615. hardcode_automatic=no
  10616. # Set to yes if linker adds runtime paths of dependent libraries
  10617. # to runtime path list.
  10618. inherit_rpath=no
  10619. # Whether libtool must link a program against all its dependency libraries.
  10620. link_all_deplibs=unknown
  10621. # Set to "yes" if exported symbols are required.
  10622. always_export_symbols=no
  10623. # The commands to list exported symbols.
  10624. export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
  10625. # Symbols that should not be listed in the preloaded symbols.
  10626. exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
  10627. # Symbols that must always be exported.
  10628. include_expsyms=""
  10629. # Commands necessary for linking programs (against libraries) with templates.
  10630. prelink_cmds=""
  10631. # Commands necessary for finishing linking programs.
  10632. postlink_cmds=""
  10633. # Specify filename containing input files.
  10634. file_list_spec=""
  10635. # How to hardcode a shared library path into an executable.
  10636. hardcode_action=immediate
  10637. # The directories searched by this compiler when creating a shared library.
  10638. compiler_lib_search_dirs="/usr/lib /lib"
  10639. # Dependencies to place before and after the objects being linked to
  10640. # create a shared library.
  10641. predep_objects=""
  10642. postdep_objects=""
  10643. predeps=""
  10644. postdeps="-lgfortran -lm -lgcc_s -lm -lgcc_s -lc -lgcc_s"
  10645. # The library search path used internally by the compiler when linking
  10646. # a shared library.
  10647. compiler_lib_search_path="/usr/lib /lib"
  10648. # ### END LIBTOOL TAG CONFIG: FC
  10649. # ### BEGIN LIBTOOL TAG CONFIG: GO
  10650. # The linker used to build libraries.
  10651. LD="arm-linux-gnueabihf-ld "
  10652. # How to create reloadable object files.
  10653. reload_flag=" -r"
  10654. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10655. # Commands used to build an old-style archive.
  10656. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10657. # A language specific compiler.
  10658. CC=""
  10659. # Is the compiler the GNU compiler?
  10660. with_gcc=
  10661. # Compiler flag to turn off builtin functions.
  10662. no_builtin_flag=""
  10663. # Additional compiler flags for building library objects.
  10664. pic_flag=""
  10665. # How to pass a linker flag through the compiler.
  10666. wl=""
  10667. # Compiler flag to prevent dynamic linking.
  10668. link_static_flag=""
  10669. # Does compiler simultaneously support -c and -o options?
  10670. compiler_c_o=""
  10671. # Whether or not to add -lc for building shared libraries.
  10672. build_libtool_need_lc=no
  10673. # Whether or not to disallow shared libs when runtime libs are static.
  10674. allow_libtool_libs_with_static_runtimes=
  10675. # Compiler flag to allow reflexive dlopens.
  10676. export_dynamic_flag_spec=""
  10677. # Compiler flag to generate shared objects directly from archives.
  10678. whole_archive_flag_spec=""
  10679. # Whether the compiler copes with passing no objects directly.
  10680. compiler_needs_object=""
  10681. # Create an old-style archive from a shared archive.
  10682. old_archive_from_new_cmds=""
  10683. # Create a temporary old-style archive to link instead of a shared archive.
  10684. old_archive_from_expsyms_cmds=""
  10685. # Commands used to build a shared archive.
  10686. archive_cmds=""
  10687. archive_expsym_cmds=""
  10688. # Commands used to build a loadable module if different from building
  10689. # a shared archive.
  10690. module_cmds=""
  10691. module_expsym_cmds=""
  10692. # Whether we are building with GNU ld or not.
  10693. with_gnu_ld=""
  10694. # Flag that allows shared libraries with undefined symbols to be built.
  10695. allow_undefined_flag=""
  10696. # Flag that enforces no undefined symbols.
  10697. no_undefined_flag=""
  10698. # Flag to hardcode $libdir into a binary during linking.
  10699. # This must work even if $libdir does not exist
  10700. hardcode_libdir_flag_spec=""
  10701. # Whether we need a single "-rpath" flag with a separated argument.
  10702. hardcode_libdir_separator=""
  10703. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10704. # DIR into the resulting binary.
  10705. hardcode_direct=
  10706. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10707. # DIR into the resulting binary and the resulting library dependency is
  10708. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10709. # library is relocated.
  10710. hardcode_direct_absolute=
  10711. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10712. # into the resulting binary.
  10713. hardcode_minus_L=
  10714. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10715. # into the resulting binary.
  10716. hardcode_shlibpath_var=
  10717. # Set to "yes" if building a shared library automatically hardcodes DIR
  10718. # into the library and all subsequent libraries and executables linked
  10719. # against it.
  10720. hardcode_automatic=
  10721. # Set to yes if linker adds runtime paths of dependent libraries
  10722. # to runtime path list.
  10723. inherit_rpath=
  10724. # Whether libtool must link a program against all its dependency libraries.
  10725. link_all_deplibs=
  10726. # Set to "yes" if exported symbols are required.
  10727. always_export_symbols=
  10728. # The commands to list exported symbols.
  10729. export_symbols_cmds=""
  10730. # Symbols that should not be listed in the preloaded symbols.
  10731. exclude_expsyms=""
  10732. # Symbols that must always be exported.
  10733. include_expsyms=""
  10734. # Commands necessary for linking programs (against libraries) with templates.
  10735. prelink_cmds=""
  10736. # Commands necessary for finishing linking programs.
  10737. postlink_cmds=""
  10738. # Specify filename containing input files.
  10739. file_list_spec=""
  10740. # How to hardcode a shared library path into an executable.
  10741. hardcode_action=
  10742. # The directories searched by this compiler when creating a shared library.
  10743. compiler_lib_search_dirs="/usr/lib /lib"
  10744. # Dependencies to place before and after the objects being linked to
  10745. # create a shared library.
  10746. predep_objects=""
  10747. postdep_objects=""
  10748. predeps=""
  10749. postdeps=""
  10750. # The library search path used internally by the compiler when linking
  10751. # a shared library.
  10752. compiler_lib_search_path="/usr/lib /lib"
  10753. # ### END LIBTOOL TAG CONFIG: GO
  10754. # ### BEGIN LIBTOOL TAG CONFIG: GCJ
  10755. # The linker used to build libraries.
  10756. LD="arm-linux-gnueabihf-ld "
  10757. # How to create reloadable object files.
  10758. reload_flag=" -r"
  10759. reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
  10760. # Commands used to build an old-style archive.
  10761. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
  10762. # A language specific compiler.
  10763. CC=""
  10764. # Is the compiler the GNU compiler?
  10765. with_gcc=
  10766. # Compiler flag to turn off builtin functions.
  10767. no_builtin_flag=""
  10768. # Additional compiler flags for building library objects.
  10769. pic_flag=""
  10770. # How to pass a linker flag through the compiler.
  10771. wl=""
  10772. # Compiler flag to prevent dynamic linking.
  10773. link_static_flag=""
  10774. # Does compiler simultaneously support -c and -o options?
  10775. compiler_c_o=""
  10776. # Whether or not to add -lc for building shared libraries.
  10777. build_libtool_need_lc=no
  10778. # Whether or not to disallow shared libs when runtime libs are static.
  10779. allow_libtool_libs_with_static_runtimes=
  10780. # Compiler flag to allow reflexive dlopens.
  10781. export_dynamic_flag_spec=""
  10782. # Compiler flag to generate shared objects directly from archives.
  10783. whole_archive_flag_spec=""
  10784. # Whether the compiler copes with passing no objects directly.
  10785. compiler_needs_object=""
  10786. # Create an old-style archive from a shared archive.
  10787. old_archive_from_new_cmds=""
  10788. # Create a temporary old-style archive to link instead of a shared archive.
  10789. old_archive_from_expsyms_cmds=""
  10790. # Commands used to build a shared archive.
  10791. archive_cmds=""
  10792. archive_expsym_cmds=""
  10793. # Commands used to build a loadable module if different from building
  10794. # a shared archive.
  10795. module_cmds=""
  10796. module_expsym_cmds=""
  10797. # Whether we are building with GNU ld or not.
  10798. with_gnu_ld=""
  10799. # Flag that allows shared libraries with undefined symbols to be built.
  10800. allow_undefined_flag=""
  10801. # Flag that enforces no undefined symbols.
  10802. no_undefined_flag=""
  10803. # Flag to hardcode $libdir into a binary during linking.
  10804. # This must work even if $libdir does not exist
  10805. hardcode_libdir_flag_spec=""
  10806. # Whether we need a single "-rpath" flag with a separated argument.
  10807. hardcode_libdir_separator=""
  10808. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10809. # DIR into the resulting binary.
  10810. hardcode_direct=
  10811. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10812. # DIR into the resulting binary and the resulting library dependency is
  10813. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10814. # library is relocated.
  10815. hardcode_direct_absolute=
  10816. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10817. # into the resulting binary.
  10818. hardcode_minus_L=
  10819. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10820. # into the resulting binary.
  10821. hardcode_shlibpath_var=
  10822. # Set to "yes" if building a shared library automatically hardcodes DIR
  10823. # into the library and all subsequent libraries and executables linked
  10824. # against it.
  10825. hardcode_automatic=
  10826. # Set to yes if linker adds runtime paths of dependent libraries
  10827. # to runtime path list.
  10828. inherit_rpath=
  10829. # Whether libtool must link a program against all its dependency libraries.
  10830. link_all_deplibs=
  10831. # Set to "yes" if exported symbols are required.
  10832. always_export_symbols=
  10833. # The commands to list exported symbols.
  10834. export_symbols_cmds=""
  10835. # Symbols that should not be listed in the preloaded symbols.
  10836. exclude_expsyms=""
  10837. # Symbols that must always be exported.
  10838. include_expsyms=""
  10839. # Commands necessary for linking programs (against libraries) with templates.
  10840. prelink_cmds=""
  10841. # Commands necessary for finishing linking programs.
  10842. postlink_cmds=""
  10843. # Specify filename containing input files.
  10844. file_list_spec=""
  10845. # How to hardcode a shared library path into an executable.
  10846. hardcode_action=
  10847. # The directories searched by this compiler when creating a shared library.
  10848. compiler_lib_search_dirs="/usr/lib /lib"
  10849. # Dependencies to place before and after the objects being linked to
  10850. # create a shared library.
  10851. predep_objects=""
  10852. postdep_objects=""
  10853. predeps=""
  10854. postdeps=""
  10855. # The library search path used internally by the compiler when linking
  10856. # a shared library.
  10857. compiler_lib_search_path="/usr/lib /lib"
  10858. # ### END LIBTOOL TAG CONFIG: GCJ
  10859. # ### BEGIN LIBTOOL TAG CONFIG: RC
  10860. # The linker used to build libraries.
  10861. LD=""
  10862. # How to create reloadable object files.
  10863. reload_flag=""
  10864. reload_cmds=""
  10865. # Commands used to build an old-style archive.
  10866. old_archive_cmds=""
  10867. # A language specific compiler.
  10868. CC=""
  10869. # Is the compiler the GNU compiler?
  10870. with_gcc=
  10871. # Compiler flag to turn off builtin functions.
  10872. no_builtin_flag=""
  10873. # Additional compiler flags for building library objects.
  10874. pic_flag=""
  10875. # How to pass a linker flag through the compiler.
  10876. wl=""
  10877. # Compiler flag to prevent dynamic linking.
  10878. link_static_flag=""
  10879. # Does compiler simultaneously support -c and -o options?
  10880. compiler_c_o="yes"
  10881. # Whether or not to add -lc for building shared libraries.
  10882. build_libtool_need_lc=
  10883. # Whether or not to disallow shared libs when runtime libs are static.
  10884. allow_libtool_libs_with_static_runtimes=
  10885. # Compiler flag to allow reflexive dlopens.
  10886. export_dynamic_flag_spec=""
  10887. # Compiler flag to generate shared objects directly from archives.
  10888. whole_archive_flag_spec=""
  10889. # Whether the compiler copes with passing no objects directly.
  10890. compiler_needs_object=""
  10891. # Create an old-style archive from a shared archive.
  10892. old_archive_from_new_cmds=""
  10893. # Create a temporary old-style archive to link instead of a shared archive.
  10894. old_archive_from_expsyms_cmds=""
  10895. # Commands used to build a shared archive.
  10896. archive_cmds=""
  10897. archive_expsym_cmds=""
  10898. # Commands used to build a loadable module if different from building
  10899. # a shared archive.
  10900. module_cmds=""
  10901. module_expsym_cmds=""
  10902. # Whether we are building with GNU ld or not.
  10903. with_gnu_ld=""
  10904. # Flag that allows shared libraries with undefined symbols to be built.
  10905. allow_undefined_flag=""
  10906. # Flag that enforces no undefined symbols.
  10907. no_undefined_flag=""
  10908. # Flag to hardcode $libdir into a binary during linking.
  10909. # This must work even if $libdir does not exist
  10910. hardcode_libdir_flag_spec=""
  10911. # Whether we need a single "-rpath" flag with a separated argument.
  10912. hardcode_libdir_separator=""
  10913. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10914. # DIR into the resulting binary.
  10915. hardcode_direct=
  10916. # Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
  10917. # DIR into the resulting binary and the resulting library dependency is
  10918. # "absolute",i.e impossible to change by setting $shlibpath_var if the
  10919. # library is relocated.
  10920. hardcode_direct_absolute=
  10921. # Set to "yes" if using the -LDIR flag during linking hardcodes DIR
  10922. # into the resulting binary.
  10923. hardcode_minus_L=
  10924. # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
  10925. # into the resulting binary.
  10926. hardcode_shlibpath_var=
  10927. # Set to "yes" if building a shared library automatically hardcodes DIR
  10928. # into the library and all subsequent libraries and executables linked
  10929. # against it.
  10930. hardcode_automatic=
  10931. # Set to yes if linker adds runtime paths of dependent libraries
  10932. # to runtime path list.
  10933. inherit_rpath=
  10934. # Whether libtool must link a program against all its dependency libraries.
  10935. link_all_deplibs=
  10936. # Set to "yes" if exported symbols are required.
  10937. always_export_symbols=
  10938. # The commands to list exported symbols.
  10939. export_symbols_cmds=""
  10940. # Symbols that should not be listed in the preloaded symbols.
  10941. exclude_expsyms=""
  10942. # Symbols that must always be exported.
  10943. include_expsyms=""
  10944. # Commands necessary for linking programs (against libraries) with templates.
  10945. prelink_cmds=""
  10946. # Commands necessary for finishing linking programs.
  10947. postlink_cmds=""
  10948. # Specify filename containing input files.
  10949. file_list_spec=""
  10950. # How to hardcode a shared library path into an executable.
  10951. hardcode_action=
  10952. # The directories searched by this compiler when creating a shared library.
  10953. compiler_lib_search_dirs="/usr/lib /lib"
  10954. # Dependencies to place before and after the objects being linked to
  10955. # create a shared library.
  10956. predep_objects=""
  10957. postdep_objects=""
  10958. predeps=""
  10959. postdeps=""
  10960. # The library search path used internally by the compiler when linking
  10961. # a shared library.
  10962. compiler_lib_search_path="/usr/lib /lib"
  10963. # ### END LIBTOOL TAG CONFIG: RC