patch-ltmain_sh 330 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- libtirpc-0.2.0.orig/ltmain.sh 2008-08-30 00:27:25.000000000 +0200
  3. +++ libtirpc-0.2.0/ltmain.sh 2009-05-29 20:18:46.665705040 +0200
  4. @@ -1,52 +1,83 @@
  5. -# ltmain.sh - Provide generalized library-building support services.
  6. -# NOTE: Changing this file will not affect anything until you rerun configure.
  7. -#
  8. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
  9. -# 2007, 2008 Free Software Foundation, Inc.
  10. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  11. -#
  12. -# This program is free software; you can redistribute it and/or modify
  13. +# Generated from ltmain.m4sh.
  14. +
  15. +# ltmain.sh (GNU libtool) 2.2.6
  16. +# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  17. +
  18. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
  19. +# This is free software; see the source for copying conditions. There is NO
  20. +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21. +
  22. +# GNU Libtool is free software; you can redistribute it and/or modify
  23. # it under the terms of the GNU General Public License as published by
  24. # the Free Software Foundation; either version 2 of the License, or
  25. # (at your option) any later version.
  26. #
  27. -# This program is distributed in the hope that it will be useful, but
  28. +# As a special exception to the GNU General Public License,
  29. +# if you distribute this file as part of a program or library that
  30. +# is built using GNU Libtool, you may include this file under the
  31. +# same distribution terms that you use for the rest of that program.
  32. +#
  33. +# GNU Libtool is distributed in the hope that it will be useful, but
  34. # WITHOUT ANY WARRANTY; without even the implied warranty of
  35. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  36. # General Public License for more details.
  37. #
  38. # You should have received a copy of the GNU General Public License
  39. -# along with this program; if not, write to the Free Software
  40. -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  41. -#
  42. -# As a special exception to the GNU General Public License, if you
  43. -# distribute this file as part of a program that contains a
  44. -# configuration script generated by Autoconf, you may include it under
  45. -# the same distribution terms that you use for the rest of that program.
  46. -
  47. -basename="s,^.*/,,g"
  48. -
  49. -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  50. -# is ksh but when the shell is invoked as "sh" and the current value of
  51. -# the _XPG environment variable is not equal to 1 (one), the special
  52. -# positional parameter $0, within a function call, is the name of the
  53. -# function.
  54. -progpath="$0"
  55. -
  56. -# The name of this program:
  57. -progname=`echo "$progpath" | $SED $basename`
  58. -modename="$progname"
  59. +# along with GNU Libtool; see the file COPYING. If not, a copy
  60. +# can be downloaded from http://www.gnu.org/licenses/gpl.html,
  61. +# or obtained by writing to the Free Software Foundation, Inc.,
  62. +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  63. -# Global variables:
  64. -EXIT_SUCCESS=0
  65. -EXIT_FAILURE=1
  66. +# Usage: $progname [OPTION]... [MODE-ARG]...
  67. +#
  68. +# Provide generalized library-building support services.
  69. +#
  70. +# --config show all configuration variables
  71. +# --debug enable verbose shell tracing
  72. +# -n, --dry-run display commands without modifying any files
  73. +# --features display basic configuration information and exit
  74. +# --mode=MODE use operation mode MODE
  75. +# --preserve-dup-deps don't remove duplicate dependency libraries
  76. +# --quiet, --silent don't print informational messages
  77. +# --tag=TAG use configuration variables from tag TAG
  78. +# -v, --verbose print informational messages (default)
  79. +# --version print version information
  80. +# -h, --help print short or long help message
  81. +#
  82. +# MODE must be one of the following:
  83. +#
  84. +# clean remove files from the build directory
  85. +# compile compile a source file into a libtool object
  86. +# execute automatically set library path, then run a program
  87. +# finish complete the installation of libtool libraries
  88. +# install install libraries or executables
  89. +# link create a library or an executable
  90. +# uninstall remove libraries from an installed directory
  91. +#
  92. +# MODE-ARGS vary depending on the MODE.
  93. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
  94. +#
  95. +# When reporting a bug, please describe a test case to reproduce it and
  96. +# include the following information:
  97. +#
  98. +# host-triplet: $host
  99. +# shell: $SHELL
  100. +# compiler: $LTCC
  101. +# compiler flags: $LTCFLAGS
  102. +# linker: $LD (gnu? $with_gnu_ld)
  103. +# $progname: (GNU libtool) 2.2.6
  104. +# automake: $automake_version
  105. +# autoconf: $autoconf_version
  106. +#
  107. +# Report bugs to <bug-libtool@gnu.org>.
  108. PROGRAM=ltmain.sh
  109. PACKAGE=libtool
  110. -VERSION=1.5.26
  111. -TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
  112. +VERSION=2.2.6
  113. +TIMESTAMP=""
  114. +package_revision=1.3012
  115. -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
  116. +# Be Bourne compatible
  117. if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
  118. emulate sh
  119. NULLCMD=:
  120. @@ -60,104 +91,261 @@ fi
  121. BIN_SH=xpg4; export BIN_SH # for Tru64
  122. DUALCASE=1; export DUALCASE # for MKS sh
  123. -# Check that we have a working $echo.
  124. -if test "X$1" = X--no-reexec; then
  125. - # Discard the --no-reexec flag, and continue.
  126. - shift
  127. -elif test "X$1" = X--fallback-echo; then
  128. - # Avoid inline document here, it may be left over
  129. - :
  130. -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  131. - # Yippee, $echo works!
  132. - :
  133. -else
  134. - # Restart under the correct shell, and then maybe $echo will work.
  135. - exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  136. -fi
  137. -
  138. -if test "X$1" = X--fallback-echo; then
  139. - # used as fallback echo
  140. - shift
  141. - cat <<EOF
  142. -$*
  143. -EOF
  144. - exit $EXIT_SUCCESS
  145. -fi
  146. -
  147. -default_mode=
  148. -help="Try \`$progname --help' for more information."
  149. -magic="%%%MAGIC variable%%%"
  150. -mkdir="mkdir"
  151. -mv="mv -f"
  152. -rm="rm -f"
  153. -
  154. -# Sed substitution that helps us do robust quoting. It backslashifies
  155. -# metacharacters that are still active within double-quoted strings.
  156. -Xsed="${SED}"' -e 1s/^X//'
  157. -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  158. -# test EBCDIC or ASCII
  159. -case `echo X|tr X '\101'` in
  160. - A) # ASCII based system
  161. - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
  162. - SP2NL='tr \040 \012'
  163. - NL2SP='tr \015\012 \040\040'
  164. - ;;
  165. - *) # EBCDIC based system
  166. - SP2NL='tr \100 \n'
  167. - NL2SP='tr \r\n \100\100'
  168. - ;;
  169. -esac
  170. -
  171. -# NLS nuisances.
  172. +# NLS nuisances: We save the old values to restore during execute mode.
  173. # Only set LANG and LC_ALL to C if already set.
  174. # These must not be set unconditionally because not all systems understand
  175. # e.g. LANG=C (notably SCO).
  176. -# We save the old values to restore during execute mode.
  177. -lt_env=
  178. +lt_user_locale=
  179. +lt_safe_locale=
  180. for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  181. do
  182. eval "if test \"\${$lt_var+set}\" = set; then
  183. - save_$lt_var=\$$lt_var
  184. - lt_env=\"$lt_var=\$$lt_var \$lt_env\"
  185. - $lt_var=C
  186. + save_$lt_var=\$$lt_var
  187. + $lt_var=C
  188. export $lt_var
  189. + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
  190. + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
  191. fi"
  192. done
  193. -if test -n "$lt_env"; then
  194. - lt_env="env $lt_env"
  195. -fi
  196. +$lt_unset CDPATH
  197. +
  198. +
  199. +
  200. +
  201. +
  202. +: ${CP="cp -f"}
  203. +: ${ECHO="echo"}
  204. +: ${EGREP="/usr/bin/grep -E"}
  205. +: ${FGREP="/usr/bin/grep -F"}
  206. +: ${GREP="/usr/bin/grep"}
  207. +: ${LN_S="ln -s"}
  208. +: ${MAKE="make"}
  209. +: ${MKDIR="mkdir"}
  210. +: ${MV="mv -f"}
  211. +: ${RM="rm -f"}
  212. +: ${SED="/opt/local/bin/gsed"}
  213. +: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
  214. +: ${Xsed="$SED -e 1s/^X//"}
  215. +
  216. +# Global variables:
  217. +EXIT_SUCCESS=0
  218. +EXIT_FAILURE=1
  219. +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
  220. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
  221. +
  222. +exit_status=$EXIT_SUCCESS
  223. # Make sure IFS has a sensible default
  224. lt_nl='
  225. '
  226. IFS=" $lt_nl"
  227. -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  228. - $echo "$modename: not configured to build any kind of library" 1>&2
  229. - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  230. - exit $EXIT_FAILURE
  231. -fi
  232. +dirname="s,/[^/]*$,,"
  233. +basename="s,^.*/,,"
  234. -# Global variables.
  235. -mode=$default_mode
  236. -nonopt=
  237. -prev=
  238. -prevopt=
  239. -run=
  240. -show="$echo"
  241. -show_help=
  242. -execute_dlfiles=
  243. -duplicate_deps=no
  244. -preserve_args=
  245. -lo2o="s/\\.lo\$/.${objext}/"
  246. -o2lo="s/\\.${objext}\$/.lo/"
  247. -extracted_archives=
  248. -extracted_serial=0
  249. +# func_dirname_and_basename file append nondir_replacement
  250. +# perform func_basename and func_dirname in a single function
  251. +# call:
  252. +# dirname: Compute the dirname of FILE. If nonempty,
  253. +# add APPEND to the result, otherwise set result
  254. +# to NONDIR_REPLACEMENT.
  255. +# value returned in "$func_dirname_result"
  256. +# basename: Compute filename of FILE.
  257. +# value retuned in "$func_basename_result"
  258. +# Implementation must be kept synchronized with func_dirname
  259. +# and func_basename. For efficiency, we do not delegate to
  260. +# those functions but instead duplicate the functionality here.
  261. +func_dirname_and_basename ()
  262. +{
  263. + # Extract subdirectory from the argument.
  264. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
  265. + if test "X$func_dirname_result" = "X${1}"; then
  266. + func_dirname_result="${3}"
  267. + else
  268. + func_dirname_result="$func_dirname_result${2}"
  269. + fi
  270. + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
  271. +}
  272. +
  273. +# Generated shell functions inserted here.
  274. +
  275. +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
  276. +# is ksh but when the shell is invoked as "sh" and the current value of
  277. +# the _XPG environment variable is not equal to 1 (one), the special
  278. +# positional parameter $0, within a function call, is the name of the
  279. +# function.
  280. +progpath="$0"
  281. +
  282. +# The name of this program:
  283. +# In the unlikely event $progname began with a '-', it would play havoc with
  284. +# func_echo (imagine progname=-n), so we prepend ./ in that case:
  285. +func_dirname_and_basename "$progpath"
  286. +progname=$func_basename_result
  287. +case $progname in
  288. + -*) progname=./$progname ;;
  289. +esac
  290. +
  291. +# Make sure we have an absolute path for reexecution:
  292. +case $progpath in
  293. + [\\/]*|[A-Za-z]:\\*) ;;
  294. + *[\\/]*)
  295. + progdir=$func_dirname_result
  296. + progdir=`cd "$progdir" && pwd`
  297. + progpath="$progdir/$progname"
  298. + ;;
  299. + *)
  300. + save_IFS="$IFS"
  301. + IFS=:
  302. + for progdir in $PATH; do
  303. + IFS="$save_IFS"
  304. + test -x "$progdir/$progname" && break
  305. + done
  306. + IFS="$save_IFS"
  307. + test -n "$progdir" || progdir=`pwd`
  308. + progpath="$progdir/$progname"
  309. + ;;
  310. +esac
  311. +
  312. +# Sed substitution that helps us do robust quoting. It backslashifies
  313. +# metacharacters that are still active within double-quoted strings.
  314. +Xsed="${SED}"' -e 1s/^X//'
  315. +sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
  316. +
  317. +# Same as above, but do not quote variable references.
  318. +double_quote_subst='s/\(["`\\]\)/\\\1/g'
  319. +
  320. +# Re-`\' parameter expansions in output of double_quote_subst that were
  321. +# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
  322. +# in input to double_quote_subst, that '$' was protected from expansion.
  323. +# Since each input `\' is now two `\'s, look for any number of runs of
  324. +# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
  325. +bs='\\'
  326. +bs2='\\\\'
  327. +bs4='\\\\\\\\'
  328. +dollar='\$'
  329. +sed_double_backslash="\
  330. + s/$bs4/&\\
  331. +/g
  332. + s/^$bs2$dollar/$bs&/
  333. + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
  334. + s/\n//g"
  335. +
  336. +# Standard options:
  337. +opt_dry_run=false
  338. +opt_help=false
  339. +opt_quiet=false
  340. +opt_verbose=false
  341. +opt_warning=:
  342. +
  343. +# func_echo arg...
  344. +# Echo program name prefixed message, along with the current mode
  345. +# name if it has been set yet.
  346. +func_echo ()
  347. +{
  348. + $ECHO "$progname${mode+: }$mode: $*"
  349. +}
  350. +
  351. +# func_verbose arg...
  352. +# Echo program name prefixed message in verbose mode only.
  353. +func_verbose ()
  354. +{
  355. + $opt_verbose && func_echo ${1+"$@"}
  356. +
  357. + # A bug in bash halts the script if the last line of a function
  358. + # fails when set -e is in force, so we need another command to
  359. + # work around that:
  360. + :
  361. +}
  362. +
  363. +# func_error arg...
  364. +# Echo program name prefixed message to standard error.
  365. +func_error ()
  366. +{
  367. + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
  368. +}
  369. +
  370. +# func_warning arg...
  371. +# Echo program name prefixed warning message to standard error.
  372. +func_warning ()
  373. +{
  374. + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
  375. +
  376. + # bash bug again:
  377. + :
  378. +}
  379. +
  380. +# func_fatal_error arg...
  381. +# Echo program name prefixed message to standard error, and exit.
  382. +func_fatal_error ()
  383. +{
  384. + func_error ${1+"$@"}
  385. + exit $EXIT_FAILURE
  386. +}
  387. +
  388. +# func_fatal_help arg...
  389. +# Echo program name prefixed message to standard error, followed by
  390. +# a help hint, and exit.
  391. +func_fatal_help ()
  392. +{
  393. + func_error ${1+"$@"}
  394. + func_fatal_error "$help"
  395. +}
  396. +help="Try \`$progname --help' for more information." ## default
  397. +
  398. +
  399. +# func_grep expression filename
  400. +# Check whether EXPRESSION matches any line of FILENAME, without output.
  401. +func_grep ()
  402. +{
  403. + $GREP "$1" "$2" >/dev/null 2>&1
  404. +}
  405. +
  406. +
  407. +# func_mkdir_p directory-path
  408. +# Make sure the entire path to DIRECTORY-PATH is available.
  409. +func_mkdir_p ()
  410. +{
  411. + my_directory_path="$1"
  412. + my_dir_list=
  413. +
  414. + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
  415. +
  416. + # Protect directory names starting with `-'
  417. + case $my_directory_path in
  418. + -*) my_directory_path="./$my_directory_path" ;;
  419. + esac
  420. +
  421. + # While some portion of DIR does not yet exist...
  422. + while test ! -d "$my_directory_path"; do
  423. + # ...make a list in topmost first order. Use a colon delimited
  424. + # list incase some portion of path contains whitespace.
  425. + my_dir_list="$my_directory_path:$my_dir_list"
  426. +
  427. + # If the last portion added has no slash in it, the list is done
  428. + case $my_directory_path in */*) ;; *) break ;; esac
  429. +
  430. + # ...otherwise throw away the child directory and loop
  431. + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
  432. + done
  433. + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
  434. +
  435. + save_mkdir_p_IFS="$IFS"; IFS=':'
  436. + for my_dir in $my_dir_list; do
  437. + IFS="$save_mkdir_p_IFS"
  438. + # mkdir can fail with a `File exist' error if two processes
  439. + # try to create one of the directories concurrently. Don't
  440. + # stop in that case!
  441. + $MKDIR "$my_dir" 2>/dev/null || :
  442. + done
  443. + IFS="$save_mkdir_p_IFS"
  444. +
  445. + # Bail out if we (or some other process) failed to create a directory.
  446. + test -d "$my_directory_path" || \
  447. + func_fatal_error "Failed to create \`$1'"
  448. + fi
  449. +}
  450. -#####################################
  451. -# Shell function definitions:
  452. -# This seems to be the best place for them
  453. # func_mktempdir [string]
  454. # Make a temporary directory that won't clash with other running
  455. @@ -167,7 +355,7 @@ func_mktempdir ()
  456. {
  457. my_template="${TMPDIR-/tmp}/${1-$progname}"
  458. - if test "$run" = ":"; then
  459. + if test "$opt_dry_run" = ":"; then
  460. # Return a directory name, but don't create it in dry-run mode
  461. my_tmpdir="${my_template}-$$"
  462. else
  463. @@ -176,486 +364,750 @@ func_mktempdir ()
  464. my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
  465. if test ! -d "$my_tmpdir"; then
  466. - # Failing that, at least try and use $RANDOM to avoid a race
  467. - my_tmpdir="${my_template}-${RANDOM-0}$$"
  468. + # Failing that, at least try and use $RANDOM to avoid a race
  469. + my_tmpdir="${my_template}-${RANDOM-0}$$"
  470. - save_mktempdir_umask=`umask`
  471. - umask 0077
  472. - $mkdir "$my_tmpdir"
  473. - umask $save_mktempdir_umask
  474. + save_mktempdir_umask=`umask`
  475. + umask 0077
  476. + $MKDIR "$my_tmpdir"
  477. + umask $save_mktempdir_umask
  478. fi
  479. # If we're not in dry-run mode, bomb out on failure
  480. - test -d "$my_tmpdir" || {
  481. - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
  482. - exit $EXIT_FAILURE
  483. - }
  484. + test -d "$my_tmpdir" || \
  485. + func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
  486. fi
  487. - $echo "X$my_tmpdir" | $Xsed
  488. + $ECHO "X$my_tmpdir" | $Xsed
  489. }
  490. -# func_win32_libid arg
  491. -# return the library type of file 'arg'
  492. -#
  493. -# Need a lot of goo to handle *both* DLLs and import libs
  494. -# Has to be a shell function in order to 'eat' the argument
  495. -# that is supplied when $file_magic_command is called.
  496. -func_win32_libid ()
  497. +# func_quote_for_eval arg
  498. +# Aesthetically quote ARG to be evaled later.
  499. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
  500. +# is double-quoted, suitable for a subsequent eval, whereas
  501. +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
  502. +# which are still active within double quotes backslashified.
  503. +func_quote_for_eval ()
  504. {
  505. - win32_libid_type="unknown"
  506. - win32_fileres=`file -L $1 2>/dev/null`
  507. - case $win32_fileres in
  508. - *ar\ archive\ import\ library*) # definitely import
  509. - win32_libid_type="x86 archive import"
  510. - ;;
  511. - *ar\ archive*) # could be an import, or static
  512. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
  513. - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  514. - win32_nmres=`eval $NM -f posix -A $1 | \
  515. - $SED -n -e '1,100{
  516. - / I /{
  517. - s,.*,import,
  518. - p
  519. - q
  520. - }
  521. - }'`
  522. - case $win32_nmres in
  523. - import*) win32_libid_type="x86 archive import";;
  524. - *) win32_libid_type="x86 archive static";;
  525. - esac
  526. - fi
  527. - ;;
  528. - *DLL*)
  529. - win32_libid_type="x86 DLL"
  530. - ;;
  531. - *executable*) # but shell scripts are "executable" too...
  532. - case $win32_fileres in
  533. - *MS\ Windows\ PE\ Intel*)
  534. - win32_libid_type="x86 DLL"
  535. - ;;
  536. + case $1 in
  537. + *[\\\`\"\$]*)
  538. + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
  539. + *)
  540. + func_quote_for_eval_unquoted_result="$1" ;;
  541. + esac
  542. +
  543. + case $func_quote_for_eval_unquoted_result in
  544. + # Double-quote args containing shell metacharacters to delay
  545. + # word splitting, command substitution and and variable
  546. + # expansion for a subsequent eval.
  547. + # Many Bourne shells cannot handle close brackets correctly
  548. + # in scan sets, so we specify it separately.
  549. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  550. + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
  551. + ;;
  552. + *)
  553. + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
  554. esac
  555. - ;;
  556. - esac
  557. - $echo $win32_libid_type
  558. }
  559. -# func_infer_tag arg
  560. -# Infer tagged configuration to use if any are available and
  561. -# if one wasn't chosen via the "--tag" command line option.
  562. -# Only attempt this if the compiler in the base compile
  563. -# command doesn't match the default compiler.
  564. -# arg is usually of the form 'gcc ...'
  565. -func_infer_tag ()
  566. +# func_quote_for_expand arg
  567. +# Aesthetically quote ARG to be evaled later; same as above,
  568. +# but do not quote variable references.
  569. +func_quote_for_expand ()
  570. {
  571. - if test -n "$available_tags" && test -z "$tagname"; then
  572. - CC_quoted=
  573. - for arg in $CC; do
  574. - case $arg in
  575. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  576. - arg="\"$arg\""
  577. - ;;
  578. - esac
  579. - CC_quoted="$CC_quoted $arg"
  580. - done
  581. - case $@ in
  582. - # Blanks in the command may have been stripped by the calling shell,
  583. - # but not from the CC environment variable when configure was run.
  584. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
  585. - # Blanks at the start of $base_compile will cause this to fail
  586. - # if we don't check for them as well.
  587. + case $1 in
  588. + *[\\\`\"]*)
  589. + my_arg=`$ECHO "X$1" | $Xsed \
  590. + -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
  591. *)
  592. - for z in $available_tags; do
  593. - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  594. - # Evaluate the configuration.
  595. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  596. - CC_quoted=
  597. - for arg in $CC; do
  598. - # Double-quote args containing other shell metacharacters.
  599. - case $arg in
  600. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  601. - arg="\"$arg\""
  602. - ;;
  603. - esac
  604. - CC_quoted="$CC_quoted $arg"
  605. - done
  606. - case "$@ " in
  607. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
  608. - # The compiler in the base compile command matches
  609. - # the one in the tagged configuration.
  610. - # Assume this is the tagged configuration we want.
  611. - tagname=$z
  612. - break
  613. - ;;
  614. - esac
  615. - fi
  616. - done
  617. - # If $tagname still isn't set, then no tagged configuration
  618. - # was found and let the user know that the "--tag" command
  619. - # line option must be used.
  620. - if test -z "$tagname"; then
  621. - $echo "$modename: unable to infer tagged configuration"
  622. - $echo "$modename: specify a tag with \`--tag'" 1>&2
  623. - exit $EXIT_FAILURE
  624. -# else
  625. -# $echo "$modename: using $tagname tagged configuration"
  626. - fi
  627. - ;;
  628. - esac
  629. - fi
  630. + my_arg="$1" ;;
  631. + esac
  632. +
  633. + case $my_arg in
  634. + # Double-quote args containing shell metacharacters to delay
  635. + # word splitting and command substitution for a subsequent eval.
  636. + # Many Bourne shells cannot handle close brackets correctly
  637. + # in scan sets, so we specify it separately.
  638. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  639. + my_arg="\"$my_arg\""
  640. + ;;
  641. + esac
  642. +
  643. + func_quote_for_expand_result="$my_arg"
  644. }
  645. -# func_extract_an_archive dir oldlib
  646. -func_extract_an_archive ()
  647. +# func_show_eval cmd [fail_exp]
  648. +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
  649. +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  650. +# is given, then evaluate it.
  651. +func_show_eval ()
  652. {
  653. - f_ex_an_ar_dir="$1"; shift
  654. - f_ex_an_ar_oldlib="$1"
  655. + my_cmd="$1"
  656. + my_fail_exp="${2-:}"
  657. - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
  658. - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
  659. - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  660. - :
  661. - else
  662. - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
  663. - exit $EXIT_FAILURE
  664. + ${opt_silent-false} || {
  665. + func_quote_for_expand "$my_cmd"
  666. + eval "func_echo $func_quote_for_expand_result"
  667. + }
  668. +
  669. + if ${opt_dry_run-false}; then :; else
  670. + eval "$my_cmd"
  671. + my_status=$?
  672. + if test "$my_status" -eq 0; then :; else
  673. + eval "(exit $my_status); $my_fail_exp"
  674. + fi
  675. fi
  676. }
  677. -# func_extract_archives gentop oldlib ...
  678. -func_extract_archives ()
  679. +
  680. +# func_show_eval_locale cmd [fail_exp]
  681. +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
  682. +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
  683. +# is given, then evaluate it. Use the saved locale for evaluation.
  684. +func_show_eval_locale ()
  685. {
  686. - my_gentop="$1"; shift
  687. - my_oldlibs=${1+"$@"}
  688. - my_oldobjs=""
  689. - my_xlib=""
  690. - my_xabs=""
  691. - my_xdir=""
  692. - my_status=""
  693. + my_cmd="$1"
  694. + my_fail_exp="${2-:}"
  695. - $show "${rm}r $my_gentop"
  696. - $run ${rm}r "$my_gentop"
  697. - $show "$mkdir $my_gentop"
  698. - $run $mkdir "$my_gentop"
  699. - my_status=$?
  700. - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
  701. - exit $my_status
  702. + ${opt_silent-false} || {
  703. + func_quote_for_expand "$my_cmd"
  704. + eval "func_echo $func_quote_for_expand_result"
  705. + }
  706. +
  707. + if ${opt_dry_run-false}; then :; else
  708. + eval "$lt_user_locale
  709. + $my_cmd"
  710. + my_status=$?
  711. + eval "$lt_safe_locale"
  712. + if test "$my_status" -eq 0; then :; else
  713. + eval "(exit $my_status); $my_fail_exp"
  714. + fi
  715. fi
  716. +}
  717. - for my_xlib in $my_oldlibs; do
  718. - # Extract the objects.
  719. - case $my_xlib in
  720. - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  721. - *) my_xabs=`pwd`"/$my_xlib" ;;
  722. - esac
  723. - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
  724. - my_xlib_u=$my_xlib
  725. - while :; do
  726. - case " $extracted_archives " in
  727. - *" $my_xlib_u "*)
  728. - extracted_serial=`expr $extracted_serial + 1`
  729. - my_xlib_u=lt$extracted_serial-$my_xlib ;;
  730. - *) break ;;
  731. - esac
  732. - done
  733. - extracted_archives="$extracted_archives $my_xlib_u"
  734. - my_xdir="$my_gentop/$my_xlib_u"
  735. - $show "${rm}r $my_xdir"
  736. - $run ${rm}r "$my_xdir"
  737. - $show "$mkdir $my_xdir"
  738. - $run $mkdir "$my_xdir"
  739. - exit_status=$?
  740. - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
  741. - exit $exit_status
  742. - fi
  743. - case $host in
  744. - *-darwin*)
  745. - $show "Extracting $my_xabs"
  746. - # Do not bother doing anything if just a dry run
  747. - if test -z "$run"; then
  748. - darwin_orig_dir=`pwd`
  749. - cd $my_xdir || exit $?
  750. - darwin_archive=$my_xabs
  751. - darwin_curdir=`pwd`
  752. - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
  753. - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
  754. - if test -n "$darwin_arches"; then
  755. - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
  756. - darwin_arch=
  757. - $show "$darwin_base_archive has multiple architectures $darwin_arches"
  758. - for darwin_arch in $darwin_arches ; do
  759. - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  760. - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  761. - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  762. - func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  763. - cd "$darwin_curdir"
  764. - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  765. - done # $darwin_arches
  766. - ## Okay now we have a bunch of thin objects, gotta fatten them up :)
  767. - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
  768. - darwin_file=
  769. - darwin_files=
  770. - for darwin_file in $darwin_filelist; do
  771. - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  772. - lipo -create -output "$darwin_file" $darwin_files
  773. - done # $darwin_filelist
  774. - ${rm}r unfat-$$
  775. - cd "$darwin_orig_dir"
  776. - else
  777. - cd "$darwin_orig_dir"
  778. - func_extract_an_archive "$my_xdir" "$my_xabs"
  779. - fi # $darwin_arches
  780. - fi # $run
  781. - ;;
  782. - *)
  783. - func_extract_an_archive "$my_xdir" "$my_xabs"
  784. - ;;
  785. - esac
  786. - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  787. - done
  788. - func_extract_archives_result="$my_oldobjs"
  789. +
  790. +
  791. +
  792. +# func_version
  793. +# Echo version message to standard output and exit.
  794. +func_version ()
  795. +{
  796. + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
  797. + s/^# //
  798. + s/^# *$//
  799. + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
  800. + p
  801. + }' < "$progpath"
  802. + exit $?
  803. }
  804. -# End of Shell function definitions
  805. -#####################################
  806. -# Darwin sucks
  807. -eval std_shrext=\"$shrext_cmds\"
  808. +# func_usage
  809. +# Echo short help message to standard output and exit.
  810. +func_usage ()
  811. +{
  812. + $SED -n '/^# Usage:/,/# -h/ {
  813. + s/^# //
  814. + s/^# *$//
  815. + s/\$progname/'$progname'/
  816. + p
  817. + }' < "$progpath"
  818. + $ECHO
  819. + $ECHO "run \`$progname --help | more' for full usage"
  820. + exit $?
  821. +}
  822. -disable_libs=no
  823. +# func_help
  824. +# Echo long help message to standard output and exit.
  825. +func_help ()
  826. +{
  827. + $SED -n '/^# Usage:/,/# Report bugs to/ {
  828. + s/^# //
  829. + s/^# *$//
  830. + s*\$progname*'$progname'*
  831. + s*\$host*'"$host"'*
  832. + s*\$SHELL*'"$SHELL"'*
  833. + s*\$LTCC*'"$LTCC"'*
  834. + s*\$LTCFLAGS*'"$LTCFLAGS"'*
  835. + s*\$LD*'"$LD"'*
  836. + s/\$with_gnu_ld/'"$with_gnu_ld"'/
  837. + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
  838. + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
  839. + p
  840. + }' < "$progpath"
  841. + exit $?
  842. +}
  843. -# Parse our command line options once, thoroughly.
  844. -while test "$#" -gt 0
  845. -do
  846. - arg="$1"
  847. +# func_missing_arg argname
  848. +# Echo program name prefixed message to standard error and set global
  849. +# exit_cmd.
  850. +func_missing_arg ()
  851. +{
  852. + func_error "missing argument for $1"
  853. + exit_cmd=exit
  854. +}
  855. +
  856. +exit_cmd=:
  857. +
  858. +
  859. +
  860. +
  861. +
  862. +# Check that we have a working $ECHO.
  863. +if test "X$1" = X--no-reexec; then
  864. + # Discard the --no-reexec flag, and continue.
  865. shift
  866. +elif test "X$1" = X--fallback-echo; then
  867. + # Avoid inline document here, it may be left over
  868. + :
  869. +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
  870. + # Yippee, $ECHO works!
  871. + :
  872. +else
  873. + # Restart under the correct shell, and then maybe $ECHO will work.
  874. + exec $SHELL "$progpath" --no-reexec ${1+"$@"}
  875. +fi
  876. +# Same for EGREP, and just to be sure, do LTCC as well
  877. +if test "x$EGREP" = x ; then
  878. + EGREP=egrep
  879. +fi
  880. +if test "x$LTCC" = x ; then
  881. + LTCC=${CC-gcc}
  882. +fi
  883. - case $arg in
  884. - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  885. - *) optarg= ;;
  886. - esac
  887. +if test "X$1" = X--fallback-echo; then
  888. + # used as fallback echo
  889. + shift
  890. + cat <<EOF
  891. +$*
  892. +EOF
  893. + exit $EXIT_SUCCESS
  894. +fi
  895. - # If the previous option needs an argument, assign it.
  896. - if test -n "$prev"; then
  897. - case $prev in
  898. - execute_dlfiles)
  899. - execute_dlfiles="$execute_dlfiles $arg"
  900. - ;;
  901. - tag)
  902. - tagname="$arg"
  903. - preserve_args="${preserve_args}=$arg"
  904. +magic="%%%MAGIC variable%%%"
  905. +magic_exe="%%%MAGIC EXE variable%%%"
  906. - # Check whether tagname contains only valid characters
  907. - case $tagname in
  908. - *[!-_A-Za-z0-9,/]*)
  909. - $echo "$progname: invalid tag name: $tagname" 1>&2
  910. - exit $EXIT_FAILURE
  911. - ;;
  912. - esac
  913. +# Global variables.
  914. +# $mode is unset
  915. +nonopt=
  916. +execute_dlfiles=
  917. +preserve_args=
  918. +lo2o="s/\\.lo\$/.${objext}/"
  919. +o2lo="s/\\.${objext}\$/.lo/"
  920. +extracted_archives=
  921. +extracted_serial=0
  922. - case $tagname in
  923. - CC)
  924. - # Don't test for the "default" C tag, as we know, it's there, but
  925. - # not specially marked.
  926. - ;;
  927. - *)
  928. - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
  929. - taglist="$taglist $tagname"
  930. - # Evaluate the configuration.
  931. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
  932. - else
  933. - $echo "$progname: ignoring unknown tag $tagname" 1>&2
  934. - fi
  935. - ;;
  936. - esac
  937. - ;;
  938. - *)
  939. - eval "$prev=\$arg"
  940. - ;;
  941. - esac
  942. +opt_dry_run=false
  943. +opt_duplicate_deps=false
  944. +opt_silent=false
  945. +opt_debug=:
  946. - prev=
  947. - prevopt=
  948. - continue
  949. - fi
  950. +# If this variable is set in any of the actions, the command in it
  951. +# will be execed at the end. This prevents here-documents from being
  952. +# left over by shells.
  953. +exec_cmd=
  954. - # Have we seen a non-optional argument yet?
  955. - case $arg in
  956. - --help)
  957. - show_help=yes
  958. - ;;
  959. +# func_fatal_configuration arg...
  960. +# Echo program name prefixed message to standard error, followed by
  961. +# a configuration failure hint, and exit.
  962. +func_fatal_configuration ()
  963. +{
  964. + func_error ${1+"$@"}
  965. + func_error "See the $PACKAGE documentation for more information."
  966. + func_fatal_error "Fatal configuration error."
  967. +}
  968. - --version)
  969. - echo "\
  970. -$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
  971. -Copyright (C) 2008 Free Software Foundation, Inc.
  972. -This is free software; see the source for copying conditions. There is NO
  973. -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  974. - exit $?
  975. - ;;
  976. +# func_config
  977. +# Display the configuration for all the tags in this script.
  978. +func_config ()
  979. +{
  980. + re_begincf='^# ### BEGIN LIBTOOL'
  981. + re_endcf='^# ### END LIBTOOL'
  982. +
  983. + # Default configuration.
  984. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
  985. - --config)
  986. - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
  987. # Now print the configurations for the tags.
  988. for tagname in $taglist; do
  989. - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
  990. + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
  991. done
  992. - exit $?
  993. - ;;
  994. - --debug)
  995. - $echo "$progname: enabling shell trace mode"
  996. - set -x
  997. - preserve_args="$preserve_args $arg"
  998. - ;;
  999. -
  1000. - --dry-run | -n)
  1001. - run=:
  1002. - ;;
  1003. + exit $?
  1004. +}
  1005. - --features)
  1006. - $echo "host: $host"
  1007. +# func_features
  1008. +# Display the features supported by this script.
  1009. +func_features ()
  1010. +{
  1011. + $ECHO "host: $host"
  1012. if test "$build_libtool_libs" = yes; then
  1013. - $echo "enable shared libraries"
  1014. + $ECHO "enable shared libraries"
  1015. else
  1016. - $echo "disable shared libraries"
  1017. + $ECHO "disable shared libraries"
  1018. fi
  1019. if test "$build_old_libs" = yes; then
  1020. - $echo "enable static libraries"
  1021. + $ECHO "enable static libraries"
  1022. else
  1023. - $echo "disable static libraries"
  1024. + $ECHO "disable static libraries"
  1025. fi
  1026. +
  1027. exit $?
  1028. - ;;
  1029. +}
  1030. - --finish) mode="finish" ;;
  1031. +# func_enable_tag tagname
  1032. +# Verify that TAGNAME is valid, and either flag an error and exit, or
  1033. +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
  1034. +# variable here.
  1035. +func_enable_tag ()
  1036. +{
  1037. + # Global variable:
  1038. + tagname="$1"
  1039. - --mode) prevopt="--mode" prev=mode ;;
  1040. - --mode=*) mode="$optarg" ;;
  1041. + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
  1042. + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
  1043. + sed_extractcf="/$re_begincf/,/$re_endcf/p"
  1044. - --preserve-dup-deps) duplicate_deps="yes" ;;
  1045. + # Validate tagname.
  1046. + case $tagname in
  1047. + *[!-_A-Za-z0-9,/]*)
  1048. + func_fatal_error "invalid tag name: $tagname"
  1049. + ;;
  1050. + esac
  1051. - --quiet | --silent)
  1052. - show=:
  1053. - preserve_args="$preserve_args $arg"
  1054. - ;;
  1055. + # Don't test for the "default" C tag, as we know it's
  1056. + # there but not specially marked.
  1057. + case $tagname in
  1058. + CC) ;;
  1059. + *)
  1060. + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
  1061. + taglist="$taglist $tagname"
  1062. - --tag)
  1063. - prevopt="--tag"
  1064. - prev=tag
  1065. - preserve_args="$preserve_args --tag"
  1066. + # Evaluate the configuration. Be careful to quote the path
  1067. + # and the sed script, to avoid splitting on whitespace, but
  1068. + # also don't use non-portable quotes within backquotes within
  1069. + # quotes we have to do it in 2 steps:
  1070. + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
  1071. + eval "$extractedcf"
  1072. + else
  1073. + func_error "ignoring unknown tag $tagname"
  1074. + fi
  1075. + ;;
  1076. + esac
  1077. +}
  1078. +
  1079. +# Parse options once, thoroughly. This comes as soon as possible in
  1080. +# the script to make things like `libtool --version' happen quickly.
  1081. +{
  1082. +
  1083. + # Shorthand for --mode=foo, only valid as the first argument
  1084. + case $1 in
  1085. + clean|clea|cle|cl)
  1086. + shift; set dummy --mode clean ${1+"$@"}; shift
  1087. ;;
  1088. - --tag=*)
  1089. - set tag "$optarg" ${1+"$@"}
  1090. - shift
  1091. - prev=tag
  1092. - preserve_args="$preserve_args --tag"
  1093. + compile|compil|compi|comp|com|co|c)
  1094. + shift; set dummy --mode compile ${1+"$@"}; shift
  1095. ;;
  1096. -
  1097. - -dlopen)
  1098. - prevopt="-dlopen"
  1099. - prev=execute_dlfiles
  1100. + execute|execut|execu|exec|exe|ex|e)
  1101. + shift; set dummy --mode execute ${1+"$@"}; shift
  1102. ;;
  1103. -
  1104. - -*)
  1105. - $echo "$modename: unrecognized option \`$arg'" 1>&2
  1106. - $echo "$help" 1>&2
  1107. - exit $EXIT_FAILURE
  1108. + finish|finis|fini|fin|fi|f)
  1109. + shift; set dummy --mode finish ${1+"$@"}; shift
  1110. ;;
  1111. -
  1112. - *)
  1113. - nonopt="$arg"
  1114. - break
  1115. + install|instal|insta|inst|ins|in|i)
  1116. + shift; set dummy --mode install ${1+"$@"}; shift
  1117. + ;;
  1118. + link|lin|li|l)
  1119. + shift; set dummy --mode link ${1+"$@"}; shift
  1120. + ;;
  1121. + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
  1122. + shift; set dummy --mode uninstall ${1+"$@"}; shift
  1123. ;;
  1124. esac
  1125. -done
  1126. -if test -n "$prevopt"; then
  1127. - $echo "$modename: option \`$prevopt' requires an argument" 1>&2
  1128. - $echo "$help" 1>&2
  1129. - exit $EXIT_FAILURE
  1130. -fi
  1131. + # Parse non-mode specific arguments:
  1132. + while test "$#" -gt 0; do
  1133. + opt="$1"
  1134. + shift
  1135. -case $disable_libs in
  1136. -no)
  1137. - ;;
  1138. -shared)
  1139. - build_libtool_libs=no
  1140. - build_old_libs=yes
  1141. - ;;
  1142. -static)
  1143. - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  1144. - ;;
  1145. -esac
  1146. + case $opt in
  1147. + --config) func_config ;;
  1148. -# If this variable is set in any of the actions, the command in it
  1149. -# will be execed at the end. This prevents here-documents from being
  1150. -# left over by shells.
  1151. -exec_cmd=
  1152. + --debug) preserve_args="$preserve_args $opt"
  1153. + func_echo "enabling shell trace mode"
  1154. + opt_debug='set -x'
  1155. + $opt_debug
  1156. + ;;
  1157. -if test -z "$show_help"; then
  1158. + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
  1159. + execute_dlfiles="$execute_dlfiles $1"
  1160. + shift
  1161. + ;;
  1162. - # Infer the operation mode.
  1163. - if test -z "$mode"; then
  1164. - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
  1165. - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
  1166. - case $nonopt in
  1167. - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
  1168. - mode=link
  1169. - for arg
  1170. - do
  1171. - case $arg in
  1172. - -c)
  1173. - mode=compile
  1174. - break
  1175. - ;;
  1176. - esac
  1177. - done
  1178. - ;;
  1179. - *db | *dbx | *strace | *truss)
  1180. - mode=execute
  1181. - ;;
  1182. - *install*|cp|mv)
  1183. - mode=install
  1184. - ;;
  1185. - *rm)
  1186. - mode=uninstall
  1187. + --dry-run | -n) opt_dry_run=: ;;
  1188. + --features) func_features ;;
  1189. + --finish) mode="finish" ;;
  1190. +
  1191. + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
  1192. + case $1 in
  1193. + # Valid mode arguments:
  1194. + clean) ;;
  1195. + compile) ;;
  1196. + execute) ;;
  1197. + finish) ;;
  1198. + install) ;;
  1199. + link) ;;
  1200. + relink) ;;
  1201. + uninstall) ;;
  1202. +
  1203. + # Catch anything else as an error
  1204. + *) func_error "invalid argument for $opt"
  1205. + exit_cmd=exit
  1206. + break
  1207. + ;;
  1208. + esac
  1209. +
  1210. + mode="$1"
  1211. + shift
  1212. + ;;
  1213. +
  1214. + --preserve-dup-deps)
  1215. + opt_duplicate_deps=: ;;
  1216. +
  1217. + --quiet|--silent) preserve_args="$preserve_args $opt"
  1218. + opt_silent=:
  1219. + ;;
  1220. +
  1221. + --verbose| -v) preserve_args="$preserve_args $opt"
  1222. + opt_silent=false
  1223. + ;;
  1224. +
  1225. + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
  1226. + preserve_args="$preserve_args $opt $1"
  1227. + func_enable_tag "$1" # tagname is set here
  1228. + shift
  1229. + ;;
  1230. +
  1231. + # Separate optargs to long options:
  1232. + -dlopen=*|--mode=*|--tag=*)
  1233. + func_opt_split "$opt"
  1234. + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
  1235. + shift
  1236. + ;;
  1237. +
  1238. + -\?|-h) func_usage ;;
  1239. + --help) opt_help=: ;;
  1240. + --version) func_version ;;
  1241. +
  1242. + -*) func_fatal_help "unrecognized option \`$opt'" ;;
  1243. +
  1244. + *) nonopt="$opt"
  1245. + break
  1246. + ;;
  1247. + esac
  1248. + done
  1249. +
  1250. +
  1251. + case $host in
  1252. + *cygwin* | *mingw* | *pw32* | *cegcc*)
  1253. + # don't eliminate duplications in $postdeps and $predeps
  1254. + opt_duplicate_compiler_generated_deps=:
  1255. ;;
  1256. *)
  1257. - # If we have no mode, but dlfiles were specified, then do execute mode.
  1258. - test -n "$execute_dlfiles" && mode=execute
  1259. + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
  1260. + ;;
  1261. + esac
  1262. - # Just use the default operation mode.
  1263. - if test -z "$mode"; then
  1264. - if test -n "$nonopt"; then
  1265. - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  1266. - else
  1267. - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  1268. - fi
  1269. + # Having warned about all mis-specified options, bail out if
  1270. + # anything was wrong.
  1271. + $exit_cmd $EXIT_FAILURE
  1272. +}
  1273. +
  1274. +# func_check_version_match
  1275. +# Ensure that we are using m4 macros, and libtool script from the same
  1276. +# release of libtool.
  1277. +func_check_version_match ()
  1278. +{
  1279. + if test "$package_revision" != "$macro_revision"; then
  1280. + if test "$VERSION" != "$macro_version"; then
  1281. + if test -z "$macro_version"; then
  1282. + cat >&2 <<_LT_EOF
  1283. +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  1284. +$progname: definition of this LT_INIT comes from an older release.
  1285. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  1286. +$progname: and run autoconf again.
  1287. +_LT_EOF
  1288. + else
  1289. + cat >&2 <<_LT_EOF
  1290. +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
  1291. +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
  1292. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
  1293. +$progname: and run autoconf again.
  1294. +_LT_EOF
  1295. fi
  1296. - ;;
  1297. - esac
  1298. + else
  1299. + cat >&2 <<_LT_EOF
  1300. +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
  1301. +$progname: but the definition of this LT_INIT comes from revision $macro_revision.
  1302. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision
  1303. +$progname: of $PACKAGE $VERSION and run autoconf again.
  1304. +_LT_EOF
  1305. + fi
  1306. +
  1307. + exit $EXIT_MISMATCH
  1308. fi
  1309. +}
  1310. +
  1311. +
  1312. +## ----------- ##
  1313. +## Main. ##
  1314. +## ----------- ##
  1315. +
  1316. +$opt_help || {
  1317. + # Sanity checks first:
  1318. + func_check_version_match
  1319. +
  1320. + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
  1321. + func_fatal_configuration "not configured to build any kind of library"
  1322. + fi
  1323. +
  1324. + test -z "$mode" && func_fatal_error "error: you must specify a MODE."
  1325. +
  1326. +
  1327. + # Darwin sucks
  1328. + eval std_shrext=\"$shrext_cmds\"
  1329. +
  1330. # Only execute mode is allowed to have -dlopen flags.
  1331. if test -n "$execute_dlfiles" && test "$mode" != execute; then
  1332. - $echo "$modename: unrecognized option \`-dlopen'" 1>&2
  1333. - $echo "$help" 1>&2
  1334. + func_error "unrecognized option \`-dlopen'"
  1335. + $ECHO "$help" 1>&2
  1336. exit $EXIT_FAILURE
  1337. fi
  1338. # Change the help message to a mode-specific one.
  1339. generic_help="$help"
  1340. - help="Try \`$modename --help --mode=$mode' for more information."
  1341. + help="Try \`$progname --help --mode=$mode' for more information."
  1342. +}
  1343. - # These modes are in order of execution frequency so that they run quickly.
  1344. - case $mode in
  1345. - # libtool compile mode
  1346. - compile)
  1347. - modename="$modename: compile"
  1348. +
  1349. +# func_lalib_p file
  1350. +# True iff FILE is a libtool `.la' library or `.lo' object file.
  1351. +# This function is only a basic sanity check; it will hardly flush out
  1352. +# determined imposters.
  1353. +func_lalib_p ()
  1354. +{
  1355. + test -f "$1" &&
  1356. + $SED -e 4q "$1" 2>/dev/null \
  1357. + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
  1358. +}
  1359. +
  1360. +# func_lalib_unsafe_p file
  1361. +# True iff FILE is a libtool `.la' library or `.lo' object file.
  1362. +# This function implements the same check as func_lalib_p without
  1363. +# resorting to external programs. To this end, it redirects stdin and
  1364. +# closes it afterwards, without saving the original file descriptor.
  1365. +# As a safety measure, use it only where a negative result would be
  1366. +# fatal anyway. Works if `file' does not exist.
  1367. +func_lalib_unsafe_p ()
  1368. +{
  1369. + lalib_p=no
  1370. + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
  1371. + for lalib_p_l in 1 2 3 4
  1372. + do
  1373. + read lalib_p_line
  1374. + case "$lalib_p_line" in
  1375. + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
  1376. + esac
  1377. + done
  1378. + exec 0<&5 5<&-
  1379. + fi
  1380. + test "$lalib_p" = yes
  1381. +}
  1382. +
  1383. +# func_ltwrapper_script_p file
  1384. +# True iff FILE is a libtool wrapper script
  1385. +# This function is only a basic sanity check; it will hardly flush out
  1386. +# determined imposters.
  1387. +func_ltwrapper_script_p ()
  1388. +{
  1389. + func_lalib_p "$1"
  1390. +}
  1391. +
  1392. +# func_ltwrapper_executable_p file
  1393. +# True iff FILE is a libtool wrapper executable
  1394. +# This function is only a basic sanity check; it will hardly flush out
  1395. +# determined imposters.
  1396. +func_ltwrapper_executable_p ()
  1397. +{
  1398. + func_ltwrapper_exec_suffix=
  1399. + case $1 in
  1400. + *.exe) ;;
  1401. + *) func_ltwrapper_exec_suffix=.exe ;;
  1402. + esac
  1403. + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
  1404. +}
  1405. +
  1406. +# func_ltwrapper_scriptname file
  1407. +# Assumes file is an ltwrapper_executable
  1408. +# uses $file to determine the appropriate filename for a
  1409. +# temporary ltwrapper_script.
  1410. +func_ltwrapper_scriptname ()
  1411. +{
  1412. + func_ltwrapper_scriptname_result=""
  1413. + if func_ltwrapper_executable_p "$1"; then
  1414. + func_dirname_and_basename "$1" "" "."
  1415. + func_stripname '' '.exe' "$func_basename_result"
  1416. + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
  1417. + fi
  1418. +}
  1419. +
  1420. +# func_ltwrapper_p file
  1421. +# True iff FILE is a libtool wrapper script or wrapper executable
  1422. +# This function is only a basic sanity check; it will hardly flush out
  1423. +# determined imposters.
  1424. +func_ltwrapper_p ()
  1425. +{
  1426. + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
  1427. +}
  1428. +
  1429. +
  1430. +# func_execute_cmds commands fail_cmd
  1431. +# Execute tilde-delimited COMMANDS.
  1432. +# If FAIL_CMD is given, eval that upon failure.
  1433. +# FAIL_CMD may read-access the current command in variable CMD!
  1434. +func_execute_cmds ()
  1435. +{
  1436. + $opt_debug
  1437. + save_ifs=$IFS; IFS='~'
  1438. + for cmd in $1; do
  1439. + IFS=$save_ifs
  1440. + eval cmd=\"$cmd\"
  1441. + func_show_eval "$cmd" "${2-:}"
  1442. + done
  1443. + IFS=$save_ifs
  1444. +}
  1445. +
  1446. +
  1447. +# func_source file
  1448. +# Source FILE, adding directory component if necessary.
  1449. +# Note that it is not necessary on cygwin/mingw to append a dot to
  1450. +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
  1451. +# behavior happens only for exec(3), not for open(2)! Also, sourcing
  1452. +# `FILE.' does not work on cygwin managed mounts.
  1453. +func_source ()
  1454. +{
  1455. + $opt_debug
  1456. + case $1 in
  1457. + */* | *\\*) . "$1" ;;
  1458. + *) . "./$1" ;;
  1459. + esac
  1460. +}
  1461. +
  1462. +
  1463. +# func_infer_tag arg
  1464. +# Infer tagged configuration to use if any are available and
  1465. +# if one wasn't chosen via the "--tag" command line option.
  1466. +# Only attempt this if the compiler in the base compile
  1467. +# command doesn't match the default compiler.
  1468. +# arg is usually of the form 'gcc ...'
  1469. +func_infer_tag ()
  1470. +{
  1471. + $opt_debug
  1472. + if test -n "$available_tags" && test -z "$tagname"; then
  1473. + CC_quoted=
  1474. + for arg in $CC; do
  1475. + func_quote_for_eval "$arg"
  1476. + CC_quoted="$CC_quoted $func_quote_for_eval_result"
  1477. + done
  1478. + case $@ in
  1479. + # Blanks in the command may have been stripped by the calling shell,
  1480. + # but not from the CC environment variable when configure was run.
  1481. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
  1482. + # Blanks at the start of $base_compile will cause this to fail
  1483. + # if we don't check for them as well.
  1484. + *)
  1485. + for z in $available_tags; do
  1486. + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
  1487. + # Evaluate the configuration.
  1488. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
  1489. + CC_quoted=
  1490. + for arg in $CC; do
  1491. + # Double-quote args containing other shell metacharacters.
  1492. + func_quote_for_eval "$arg"
  1493. + CC_quoted="$CC_quoted $func_quote_for_eval_result"
  1494. + done
  1495. + case "$@ " in
  1496. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
  1497. + # The compiler in the base compile command matches
  1498. + # the one in the tagged configuration.
  1499. + # Assume this is the tagged configuration we want.
  1500. + tagname=$z
  1501. + break
  1502. + ;;
  1503. + esac
  1504. + fi
  1505. + done
  1506. + # If $tagname still isn't set, then no tagged configuration
  1507. + # was found and let the user know that the "--tag" command
  1508. + # line option must be used.
  1509. + if test -z "$tagname"; then
  1510. + func_echo "unable to infer tagged configuration"
  1511. + func_fatal_error "specify a tag with \`--tag'"
  1512. +# else
  1513. +# func_verbose "using $tagname tagged configuration"
  1514. + fi
  1515. + ;;
  1516. + esac
  1517. + fi
  1518. +}
  1519. +
  1520. +
  1521. +
  1522. +# func_write_libtool_object output_name pic_name nonpic_name
  1523. +# Create a libtool object file (analogous to a ".la" file),
  1524. +# but don't create it if we're doing a dry run.
  1525. +func_write_libtool_object ()
  1526. +{
  1527. + write_libobj=${1}
  1528. + if test "$build_libtool_libs" = yes; then
  1529. + write_lobj=\'${2}\'
  1530. + else
  1531. + write_lobj=none
  1532. + fi
  1533. +
  1534. + if test "$build_old_libs" = yes; then
  1535. + write_oldobj=\'${3}\'
  1536. + else
  1537. + write_oldobj=none
  1538. + fi
  1539. +
  1540. + $opt_dry_run || {
  1541. + cat >${write_libobj}T <<EOF
  1542. +# $write_libobj - a libtool object file
  1543. +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  1544. +#
  1545. +# Please DO NOT delete this file!
  1546. +# It is necessary for linking the library.
  1547. +
  1548. +# Name of the PIC object.
  1549. +pic_object=$write_lobj
  1550. +
  1551. +# Name of the non-PIC object
  1552. +non_pic_object=$write_oldobj
  1553. +
  1554. +EOF
  1555. + $MV "${write_libobj}T" "${write_libobj}"
  1556. + }
  1557. +}
  1558. +
  1559. +# func_mode_compile arg...
  1560. +func_mode_compile ()
  1561. +{
  1562. + $opt_debug
  1563. # Get the compilation command and the source file.
  1564. base_compile=
  1565. srcfile="$nonopt" # always keep a non-empty value in "srcfile"
  1566. @@ -664,6 +1116,7 @@ if test -z "$show_help"; then
  1567. arg_mode=normal
  1568. libobj=
  1569. later=
  1570. + pie_flag=
  1571. for arg
  1572. do
  1573. @@ -684,15 +1137,18 @@ if test -z "$show_help"; then
  1574. # Accept any command-line options.
  1575. case $arg in
  1576. -o)
  1577. - if test -n "$libobj" ; then
  1578. - $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  1579. - exit $EXIT_FAILURE
  1580. - fi
  1581. + test -n "$libobj" && \
  1582. + func_fatal_error "you cannot specify \`-o' more than once"
  1583. arg_mode=target
  1584. continue
  1585. ;;
  1586. - -static | -prefer-pic | -prefer-non-pic)
  1587. + -pie | -fpie | -fPIE)
  1588. + pie_flag="$pie_flag $arg"
  1589. + continue
  1590. + ;;
  1591. +
  1592. + -shared | -static | -prefer-pic | -prefer-non-pic)
  1593. later="$later $arg"
  1594. continue
  1595. ;;
  1596. @@ -708,31 +1164,25 @@ if test -z "$show_help"; then
  1597. ;; # replaced later. I would guess that would be a bug.
  1598. -Wc,*)
  1599. - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
  1600. + func_stripname '-Wc,' '' "$arg"
  1601. + args=$func_stripname_result
  1602. lastarg=
  1603. save_ifs="$IFS"; IFS=','
  1604. - for arg in $args; do
  1605. + for arg in $args; do
  1606. IFS="$save_ifs"
  1607. -
  1608. - # Double-quote args containing other shell metacharacters.
  1609. - # Many Bourne shells cannot handle close brackets correctly
  1610. - # in scan sets, so we specify it separately.
  1611. - case $arg in
  1612. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1613. - arg="\"$arg\""
  1614. - ;;
  1615. - esac
  1616. - lastarg="$lastarg $arg"
  1617. + func_quote_for_eval "$arg"
  1618. + lastarg="$lastarg $func_quote_for_eval_result"
  1619. done
  1620. IFS="$save_ifs"
  1621. - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
  1622. + func_stripname ' ' '' "$lastarg"
  1623. + lastarg=$func_stripname_result
  1624. # Add the arguments to base_compile.
  1625. base_compile="$base_compile $lastarg"
  1626. continue
  1627. ;;
  1628. - * )
  1629. + *)
  1630. # Accept the current argument as the source file.
  1631. # The previous "srcfile" becomes the current argument.
  1632. #
  1633. @@ -744,66 +1194,42 @@ if test -z "$show_help"; then
  1634. esac # case $arg_mode
  1635. # Aesthetically quote the previous argument.
  1636. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  1637. -
  1638. - case $lastarg in
  1639. - # Double-quote args containing other shell metacharacters.
  1640. - # Many Bourne shells cannot handle close brackets correctly
  1641. - # in scan sets, and some SunOS ksh mistreat backslash-escaping
  1642. - # in scan sets (worked around with variable expansion),
  1643. - # and furthermore cannot handle '|' '&' '(' ')' in scan sets
  1644. - # at all, so we specify them separately.
  1645. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1646. - lastarg="\"$lastarg\""
  1647. - ;;
  1648. - esac
  1649. -
  1650. - base_compile="$base_compile $lastarg"
  1651. + func_quote_for_eval "$lastarg"
  1652. + base_compile="$base_compile $func_quote_for_eval_result"
  1653. done # for arg
  1654. case $arg_mode in
  1655. arg)
  1656. - $echo "$modename: you must specify an argument for -Xcompile"
  1657. - exit $EXIT_FAILURE
  1658. + func_fatal_error "you must specify an argument for -Xcompile"
  1659. ;;
  1660. target)
  1661. - $echo "$modename: you must specify a target with \`-o'" 1>&2
  1662. - exit $EXIT_FAILURE
  1663. + func_fatal_error "you must specify a target with \`-o'"
  1664. ;;
  1665. *)
  1666. # Get the name of the library object.
  1667. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  1668. + test -z "$libobj" && {
  1669. + func_basename "$srcfile"
  1670. + libobj="$func_basename_result"
  1671. + }
  1672. ;;
  1673. esac
  1674. # Recognize several different file suffixes.
  1675. # If the user specifies -o file.o, it is replaced with file.lo
  1676. - xform='[cCFSifmso]'
  1677. case $libobj in
  1678. - *.ada) xform=ada ;;
  1679. - *.adb) xform=adb ;;
  1680. - *.ads) xform=ads ;;
  1681. - *.asm) xform=asm ;;
  1682. - *.c++) xform=c++ ;;
  1683. - *.cc) xform=cc ;;
  1684. - *.ii) xform=ii ;;
  1685. - *.class) xform=class ;;
  1686. - *.cpp) xform=cpp ;;
  1687. - *.cxx) xform=cxx ;;
  1688. - *.[fF][09]?) xform=[fF][09]. ;;
  1689. - *.for) xform=for ;;
  1690. - *.java) xform=java ;;
  1691. - *.obj) xform=obj ;;
  1692. - *.sx) xform=sx ;;
  1693. + *.[cCFSifmso] | \
  1694. + *.ada | *.adb | *.ads | *.asm | \
  1695. + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
  1696. + *.[fF][09]? | *.for | *.java | *.obj | *.sx)
  1697. + func_xform "$libobj"
  1698. + libobj=$func_xform_result
  1699. + ;;
  1700. esac
  1701. - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  1702. -
  1703. case $libobj in
  1704. - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  1705. + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
  1706. *)
  1707. - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  1708. - exit $EXIT_FAILURE
  1709. + func_fatal_error "cannot determine name of library object from \`$libobj'"
  1710. ;;
  1711. esac
  1712. @@ -811,7 +1237,15 @@ if test -z "$show_help"; then
  1713. for arg in $later; do
  1714. case $arg in
  1715. + -shared)
  1716. + test "$build_libtool_libs" != yes && \
  1717. + func_fatal_configuration "can not build a shared library"
  1718. + build_old_libs=no
  1719. + continue
  1720. + ;;
  1721. +
  1722. -static)
  1723. + build_libtool_libs=no
  1724. build_old_libs=yes
  1725. continue
  1726. ;;
  1727. @@ -828,28 +1262,17 @@ if test -z "$show_help"; then
  1728. esac
  1729. done
  1730. - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
  1731. - case $qlibobj in
  1732. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1733. - qlibobj="\"$qlibobj\"" ;;
  1734. - esac
  1735. - test "X$libobj" != "X$qlibobj" \
  1736. - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
  1737. - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
  1738. - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  1739. - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
  1740. - if test "X$xdir" = "X$obj"; then
  1741. - xdir=
  1742. - else
  1743. - xdir=$xdir/
  1744. - fi
  1745. + func_quote_for_eval "$libobj"
  1746. + test "X$libobj" != "X$func_quote_for_eval_result" \
  1747. + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
  1748. + && func_warning "libobj name \`$libobj' may not contain shell special characters."
  1749. + func_dirname_and_basename "$obj" "/" ""
  1750. + objname="$func_basename_result"
  1751. + xdir="$func_dirname_result"
  1752. lobj=${xdir}$objdir/$objname
  1753. - if test -z "$base_compile"; then
  1754. - $echo "$modename: you must specify a compilation command" 1>&2
  1755. - $echo "$help" 1>&2
  1756. - exit $EXIT_FAILURE
  1757. - fi
  1758. + test -z "$base_compile" && \
  1759. + func_fatal_help "you must specify a compilation command"
  1760. # Delete any leftover library objects.
  1761. if test "$build_old_libs" = yes; then
  1762. @@ -858,12 +1281,9 @@ if test -z "$show_help"; then
  1763. removelist="$lobj $libobj ${libobj}T"
  1764. fi
  1765. - $run $rm $removelist
  1766. - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  1767. -
  1768. # On Cygwin there's no "real" PIC flag so we must build both object types
  1769. case $host_os in
  1770. - cygwin* | mingw* | pw32* | os2*)
  1771. + cygwin* | mingw* | pw32* | os2* | cegcc*)
  1772. pic_mode=default
  1773. ;;
  1774. esac
  1775. @@ -875,10 +1295,8 @@ if test -z "$show_help"; then
  1776. # Calculate the filename of the output object if compiler does
  1777. # not support -o with -c
  1778. if test "$compiler_c_o" = no; then
  1779. - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  1780. + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
  1781. lockfile="$output_obj.lock"
  1782. - removelist="$removelist $output_obj $lockfile"
  1783. - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
  1784. else
  1785. output_obj=
  1786. need_locks=no
  1787. @@ -888,13 +1306,13 @@ if test -z "$show_help"; then
  1788. # Lock this critical section if it is needed
  1789. # We use this script file to make the link, it avoids creating a new file
  1790. if test "$need_locks" = yes; then
  1791. - until $run ln "$progpath" "$lockfile" 2>/dev/null; do
  1792. - $show "Waiting for $lockfile to be removed"
  1793. + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
  1794. + func_echo "Waiting for $lockfile to be removed"
  1795. sleep 2
  1796. done
  1797. elif test "$need_locks" = warn; then
  1798. if test -f "$lockfile"; then
  1799. - $echo "\
  1800. + $ECHO "\
  1801. *** ERROR, $lockfile exists and contains:
  1802. `cat $lockfile 2>/dev/null`
  1803. @@ -905,34 +1323,22 @@ repeat this compilation, it may succeed,
  1804. avoid parallel builds (make -j) in this platform, or get a better
  1805. compiler."
  1806. - $run $rm $removelist
  1807. + $opt_dry_run || $RM $removelist
  1808. exit $EXIT_FAILURE
  1809. fi
  1810. - $echo "$srcfile" > "$lockfile"
  1811. + removelist="$removelist $output_obj"
  1812. + $ECHO "$srcfile" > "$lockfile"
  1813. fi
  1814. + $opt_dry_run || $RM $removelist
  1815. + removelist="$removelist $lockfile"
  1816. + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
  1817. +
  1818. if test -n "$fix_srcfile_path"; then
  1819. eval srcfile=\"$fix_srcfile_path\"
  1820. fi
  1821. - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
  1822. - case $qsrcfile in
  1823. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  1824. - qsrcfile="\"$qsrcfile\"" ;;
  1825. - esac
  1826. -
  1827. - $run $rm "$libobj" "${libobj}T"
  1828. -
  1829. - # Create a libtool object file (analogous to a ".la" file),
  1830. - # but don't create it if we're doing a dry run.
  1831. - test -z "$run" && cat > ${libobj}T <<EOF
  1832. -# $libobj - a libtool object file
  1833. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  1834. -#
  1835. -# Please DO NOT delete this file!
  1836. -# It is necessary for linking the library.
  1837. -
  1838. -# Name of the PIC object.
  1839. -EOF
  1840. + func_quote_for_eval "$srcfile"
  1841. + qsrcfile=$func_quote_for_eval_result
  1842. # Only build a PIC object if we are building libtool libraries.
  1843. if test "$build_libtool_libs" = yes; then
  1844. @@ -946,32 +1352,19 @@ EOF
  1845. command="$base_compile $qsrcfile"
  1846. fi
  1847. - if test ! -d "${xdir}$objdir"; then
  1848. - $show "$mkdir ${xdir}$objdir"
  1849. - $run $mkdir ${xdir}$objdir
  1850. - exit_status=$?
  1851. - if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
  1852. - exit $exit_status
  1853. - fi
  1854. - fi
  1855. + func_mkdir_p "$xdir$objdir"
  1856. if test -z "$output_obj"; then
  1857. # Place PIC objects in $objdir
  1858. command="$command -o $lobj"
  1859. fi
  1860. - $run $rm "$lobj" "$output_obj"
  1861. -
  1862. - $show "$command"
  1863. - if $run eval $lt_env "$command"; then :
  1864. - else
  1865. - test -n "$output_obj" && $run $rm $removelist
  1866. - exit $EXIT_FAILURE
  1867. - fi
  1868. + func_show_eval_locale "$command" \
  1869. + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
  1870. if test "$need_locks" = warn &&
  1871. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1872. - $echo "\
  1873. + $ECHO "\
  1874. *** ERROR, $lockfile contains:
  1875. `cat $lockfile 2>/dev/null`
  1876. @@ -985,45 +1378,27 @@ repeat this compilation, it may succeed,
  1877. avoid parallel builds (make -j) in this platform, or get a better
  1878. compiler."
  1879. - $run $rm $removelist
  1880. + $opt_dry_run || $RM $removelist
  1881. exit $EXIT_FAILURE
  1882. fi
  1883. # Just move the object if needed, then go on to compile the next one
  1884. if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
  1885. - $show "$mv $output_obj $lobj"
  1886. - if $run $mv $output_obj $lobj; then :
  1887. - else
  1888. - error=$?
  1889. - $run $rm $removelist
  1890. - exit $error
  1891. - fi
  1892. + func_show_eval '$MV "$output_obj" "$lobj"' \
  1893. + 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  1894. fi
  1895. - # Append the name of the PIC object to the libtool object file.
  1896. - test -z "$run" && cat >> ${libobj}T <<EOF
  1897. -pic_object='$objdir/$objname'
  1898. -
  1899. -EOF
  1900. -
  1901. # Allow error messages only from the first compilation.
  1902. if test "$suppress_opt" = yes; then
  1903. - suppress_output=' >/dev/null 2>&1'
  1904. + suppress_output=' >/dev/null 2>&1'
  1905. fi
  1906. - else
  1907. - # No PIC object so indicate it doesn't exist in the libtool
  1908. - # object file.
  1909. - test -z "$run" && cat >> ${libobj}T <<EOF
  1910. -pic_object=none
  1911. -
  1912. -EOF
  1913. fi
  1914. # Only build a position-dependent object if we build old libraries.
  1915. if test "$build_old_libs" = yes; then
  1916. if test "$pic_mode" != yes; then
  1917. # Don't build PIC code
  1918. - command="$base_compile $qsrcfile"
  1919. + command="$base_compile $qsrcfile$pie_flag"
  1920. else
  1921. command="$base_compile $qsrcfile $pic_flag"
  1922. fi
  1923. @@ -1033,17 +1408,12 @@ EOF
  1924. # Suppress compiler output if we already did a PIC compilation.
  1925. command="$command$suppress_output"
  1926. - $run $rm "$obj" "$output_obj"
  1927. - $show "$command"
  1928. - if $run eval $lt_env "$command"; then :
  1929. - else
  1930. - $run $rm $removelist
  1931. - exit $EXIT_FAILURE
  1932. - fi
  1933. + func_show_eval_locale "$command" \
  1934. + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
  1935. if test "$need_locks" = warn &&
  1936. test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
  1937. - $echo "\
  1938. + $ECHO "\
  1939. *** ERROR, $lockfile contains:
  1940. `cat $lockfile 2>/dev/null`
  1941. @@ -1057,53 +1427,2620 @@ repeat this compilation, it may succeed,
  1942. avoid parallel builds (make -j) in this platform, or get a better
  1943. compiler."
  1944. - $run $rm $removelist
  1945. + $opt_dry_run || $RM $removelist
  1946. exit $EXIT_FAILURE
  1947. fi
  1948. # Just move the object if needed
  1949. if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
  1950. - $show "$mv $output_obj $obj"
  1951. - if $run $mv $output_obj $obj; then :
  1952. + func_show_eval '$MV "$output_obj" "$obj"' \
  1953. + 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
  1954. + fi
  1955. + fi
  1956. +
  1957. + $opt_dry_run || {
  1958. + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
  1959. +
  1960. + # Unlock the critical section if it was locked
  1961. + if test "$need_locks" != no; then
  1962. + removelist=$lockfile
  1963. + $RM "$lockfile"
  1964. + fi
  1965. + }
  1966. +
  1967. + exit $EXIT_SUCCESS
  1968. +}
  1969. +
  1970. +$opt_help || {
  1971. +test "$mode" = compile && func_mode_compile ${1+"$@"}
  1972. +}
  1973. +
  1974. +func_mode_help ()
  1975. +{
  1976. + # We need to display help for each of the modes.
  1977. + case $mode in
  1978. + "")
  1979. + # Generic help is extracted from the usage comments
  1980. + # at the start of this file.
  1981. + func_help
  1982. + ;;
  1983. +
  1984. + clean)
  1985. + $ECHO \
  1986. +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  1987. +
  1988. +Remove files from the build directory.
  1989. +
  1990. +RM is the name of the program to use to delete files associated with each FILE
  1991. +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  1992. +to RM.
  1993. +
  1994. +If FILE is a libtool library, object or program, all the files associated
  1995. +with it are deleted. Otherwise, only FILE itself is deleted using RM."
  1996. + ;;
  1997. +
  1998. + compile)
  1999. + $ECHO \
  2000. +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  2001. +
  2002. +Compile a source file into a libtool library object.
  2003. +
  2004. +This mode accepts the following additional options:
  2005. +
  2006. + -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  2007. + -no-suppress do not suppress compiler output for multiple passes
  2008. + -prefer-pic try to building PIC objects only
  2009. + -prefer-non-pic try to building non-PIC objects only
  2010. + -shared do not build a \`.o' file suitable for static linking
  2011. + -static only build a \`.o' file suitable for static linking
  2012. +
  2013. +COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  2014. +from the given SOURCEFILE.
  2015. +
  2016. +The output file name is determined by removing the directory component from
  2017. +SOURCEFILE, then substituting the C source code suffix \`.c' with the
  2018. +library object suffix, \`.lo'."
  2019. + ;;
  2020. +
  2021. + execute)
  2022. + $ECHO \
  2023. +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
  2024. +
  2025. +Automatically set library path, then run a program.
  2026. +
  2027. +This mode accepts the following additional options:
  2028. +
  2029. + -dlopen FILE add the directory containing FILE to the library path
  2030. +
  2031. +This mode sets the library path environment variable according to \`-dlopen'
  2032. +flags.
  2033. +
  2034. +If any of the ARGS are libtool executable wrappers, then they are translated
  2035. +into their corresponding uninstalled binary, and any of their required library
  2036. +directories are added to the library path.
  2037. +
  2038. +Then, COMMAND is executed, with ARGS as arguments."
  2039. + ;;
  2040. +
  2041. + finish)
  2042. + $ECHO \
  2043. +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
  2044. +
  2045. +Complete the installation of libtool libraries.
  2046. +
  2047. +Each LIBDIR is a directory that contains libtool libraries.
  2048. +
  2049. +The commands that this mode executes may require superuser privileges. Use
  2050. +the \`--dry-run' option if you just want to see what would be executed."
  2051. + ;;
  2052. +
  2053. + install)
  2054. + $ECHO \
  2055. +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
  2056. +
  2057. +Install executables or libraries.
  2058. +
  2059. +INSTALL-COMMAND is the installation command. The first component should be
  2060. +either the \`install' or \`cp' program.
  2061. +
  2062. +The following components of INSTALL-COMMAND are treated specially:
  2063. +
  2064. + -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
  2065. +
  2066. +The rest of the components are interpreted as arguments to that command (only
  2067. +BSD-compatible install options are recognized)."
  2068. + ;;
  2069. +
  2070. + link)
  2071. + $ECHO \
  2072. +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
  2073. +
  2074. +Link object files or libraries together to form another library, or to
  2075. +create an executable program.
  2076. +
  2077. +LINK-COMMAND is a command using the C compiler that you would use to create
  2078. +a program from several object files.
  2079. +
  2080. +The following components of LINK-COMMAND are treated specially:
  2081. +
  2082. + -all-static do not do any dynamic linking at all
  2083. + -avoid-version do not add a version suffix if possible
  2084. + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  2085. + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  2086. + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  2087. + -export-symbols SYMFILE
  2088. + try to export only the symbols listed in SYMFILE
  2089. + -export-symbols-regex REGEX
  2090. + try to export only the symbols matching REGEX
  2091. + -LLIBDIR search LIBDIR for required installed libraries
  2092. + -lNAME OUTPUT-FILE requires the installed library libNAME
  2093. + -module build a library that can dlopened
  2094. + -no-fast-install disable the fast-install mode
  2095. + -no-install link a not-installable executable
  2096. + -no-undefined declare that a library does not refer to external symbols
  2097. + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  2098. + -objectlist FILE Use a list of object files found in FILE to specify objects
  2099. + -precious-files-regex REGEX
  2100. + don't remove output files matching REGEX
  2101. + -release RELEASE specify package release information
  2102. + -rpath LIBDIR the created library will eventually be installed in LIBDIR
  2103. + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  2104. + -shared only do dynamic linking of libtool libraries
  2105. + -shrext SUFFIX override the standard shared library file extension
  2106. + -static do not do any dynamic linking of uninstalled libtool libraries
  2107. + -static-libtool-libs
  2108. + do not do any dynamic linking of libtool libraries
  2109. + -version-info CURRENT[:REVISION[:AGE]]
  2110. + specify library version info [each variable defaults to 0]
  2111. + -weak LIBNAME declare that the target provides the LIBNAME interface
  2112. +
  2113. +All other options (arguments beginning with \`-') are ignored.
  2114. +
  2115. +Every other argument is treated as a filename. Files ending in \`.la' are
  2116. +treated as uninstalled libtool libraries, other files are standard or library
  2117. +object files.
  2118. +
  2119. +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  2120. +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  2121. +required, except when creating a convenience library.
  2122. +
  2123. +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  2124. +using \`ar' and \`ranlib', or on Windows using \`lib'.
  2125. +
  2126. +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  2127. +is created, otherwise an executable program is created."
  2128. + ;;
  2129. +
  2130. + uninstall)
  2131. + $ECHO \
  2132. +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  2133. +
  2134. +Remove libraries from an installation directory.
  2135. +
  2136. +RM is the name of the program to use to delete files associated with each FILE
  2137. +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  2138. +to RM.
  2139. +
  2140. +If FILE is a libtool library, all the files associated with it are deleted.
  2141. +Otherwise, only FILE itself is deleted using RM."
  2142. + ;;
  2143. +
  2144. + *)
  2145. + func_fatal_help "invalid operation mode \`$mode'"
  2146. + ;;
  2147. + esac
  2148. +
  2149. + $ECHO
  2150. + $ECHO "Try \`$progname --help' for more information about other modes."
  2151. +
  2152. + exit $?
  2153. +}
  2154. +
  2155. + # Now that we've collected a possible --mode arg, show help if necessary
  2156. + $opt_help && func_mode_help
  2157. +
  2158. +
  2159. +# func_mode_execute arg...
  2160. +func_mode_execute ()
  2161. +{
  2162. + $opt_debug
  2163. + # The first argument is the command name.
  2164. + cmd="$nonopt"
  2165. + test -z "$cmd" && \
  2166. + func_fatal_help "you must specify a COMMAND"
  2167. +
  2168. + # Handle -dlopen flags immediately.
  2169. + for file in $execute_dlfiles; do
  2170. + test -f "$file" \
  2171. + || func_fatal_help "\`$file' is not a file"
  2172. +
  2173. + dir=
  2174. + case $file in
  2175. + *.la)
  2176. + # Check to see that this really is a libtool archive.
  2177. + func_lalib_unsafe_p "$file" \
  2178. + || func_fatal_help "\`$lib' is not a valid libtool archive"
  2179. +
  2180. + # Read the libtool library.
  2181. + dlname=
  2182. + library_names=
  2183. + func_source "$file"
  2184. +
  2185. + # Skip this library if it cannot be dlopened.
  2186. + if test -z "$dlname"; then
  2187. + # Warn if it was a shared library.
  2188. + test -n "$library_names" && \
  2189. + func_warning "\`$file' was not linked with \`-export-dynamic'"
  2190. + continue
  2191. + fi
  2192. +
  2193. + func_dirname "$file" "" "."
  2194. + dir="$func_dirname_result"
  2195. +
  2196. + if test -f "$dir/$objdir/$dlname"; then
  2197. + dir="$dir/$objdir"
  2198. else
  2199. - error=$?
  2200. - $run $rm $removelist
  2201. - exit $error
  2202. + if test ! -f "$dir/$dlname"; then
  2203. + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
  2204. + fi
  2205. fi
  2206. + ;;
  2207. +
  2208. + *.lo)
  2209. + # Just add the directory containing the .lo file.
  2210. + func_dirname "$file" "" "."
  2211. + dir="$func_dirname_result"
  2212. + ;;
  2213. +
  2214. + *)
  2215. + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
  2216. + continue
  2217. + ;;
  2218. + esac
  2219. +
  2220. + # Get the absolute pathname.
  2221. + absdir=`cd "$dir" && pwd`
  2222. + test -n "$absdir" && dir="$absdir"
  2223. +
  2224. + # Now add the directory to shlibpath_var.
  2225. + if eval "test -z \"\$$shlibpath_var\""; then
  2226. + eval "$shlibpath_var=\"\$dir\""
  2227. + else
  2228. + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  2229. fi
  2230. + done
  2231. - # Append the name of the non-PIC object the libtool object file.
  2232. - # Only append if the libtool object file exists.
  2233. - test -z "$run" && cat >> ${libobj}T <<EOF
  2234. -# Name of the non-PIC object.
  2235. -non_pic_object='$objname'
  2236. + # This variable tells wrapper scripts just to set shlibpath_var
  2237. + # rather than running their programs.
  2238. + libtool_execute_magic="$magic"
  2239. -EOF
  2240. + # Check if any of the arguments is a wrapper script.
  2241. + args=
  2242. + for file
  2243. + do
  2244. + case $file in
  2245. + -*) ;;
  2246. + *)
  2247. + # Do a test to see if this is really a libtool program.
  2248. + if func_ltwrapper_script_p "$file"; then
  2249. + func_source "$file"
  2250. + # Transform arg to wrapped name.
  2251. + file="$progdir/$program"
  2252. + elif func_ltwrapper_executable_p "$file"; then
  2253. + func_ltwrapper_scriptname "$file"
  2254. + func_source "$func_ltwrapper_scriptname_result"
  2255. + # Transform arg to wrapped name.
  2256. + file="$progdir/$program"
  2257. + fi
  2258. + ;;
  2259. + esac
  2260. + # Quote arguments (to preserve shell metacharacters).
  2261. + func_quote_for_eval "$file"
  2262. + args="$args $func_quote_for_eval_result"
  2263. + done
  2264. +
  2265. + if test "X$opt_dry_run" = Xfalse; then
  2266. + if test -n "$shlibpath_var"; then
  2267. + # Export the shlibpath_var.
  2268. + eval "export $shlibpath_var"
  2269. + fi
  2270. +
  2271. + # Restore saved environment variables
  2272. + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  2273. + do
  2274. + eval "if test \"\${save_$lt_var+set}\" = set; then
  2275. + $lt_var=\$save_$lt_var; export $lt_var
  2276. + else
  2277. + $lt_unset $lt_var
  2278. + fi"
  2279. + done
  2280. +
  2281. + # Now prepare to actually exec the command.
  2282. + exec_cmd="\$cmd$args"
  2283. else
  2284. - # Append the name of the non-PIC object the libtool object file.
  2285. - # Only append if the libtool object file exists.
  2286. - test -z "$run" && cat >> ${libobj}T <<EOF
  2287. -# Name of the non-PIC object.
  2288. -non_pic_object=none
  2289. + # Display what would be done.
  2290. + if test -n "$shlibpath_var"; then
  2291. + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
  2292. + $ECHO "export $shlibpath_var"
  2293. + fi
  2294. + $ECHO "$cmd$args"
  2295. + exit $EXIT_SUCCESS
  2296. + fi
  2297. +}
  2298. -EOF
  2299. +test "$mode" = execute && func_mode_execute ${1+"$@"}
  2300. +
  2301. +
  2302. +# func_mode_finish arg...
  2303. +func_mode_finish ()
  2304. +{
  2305. + $opt_debug
  2306. + libdirs="$nonopt"
  2307. + admincmds=
  2308. +
  2309. + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  2310. + for dir
  2311. + do
  2312. + libdirs="$libdirs $dir"
  2313. + done
  2314. +
  2315. + for libdir in $libdirs; do
  2316. + if test -n "$finish_cmds"; then
  2317. + # Do each command in the finish commands.
  2318. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
  2319. +'"$cmd"'"'
  2320. + fi
  2321. + if test -n "$finish_eval"; then
  2322. + # Do the single finish_eval.
  2323. + eval cmds=\"$finish_eval\"
  2324. + $opt_dry_run || eval "$cmds" || admincmds="$admincmds
  2325. + $cmds"
  2326. + fi
  2327. + done
  2328. fi
  2329. - $run $mv "${libobj}T" "${libobj}"
  2330. + # Exit here if they wanted silent mode.
  2331. + $opt_silent && exit $EXIT_SUCCESS
  2332. - # Unlock the critical section if it was locked
  2333. - if test "$need_locks" != no; then
  2334. - $run $rm "$lockfile"
  2335. + $ECHO "X----------------------------------------------------------------------" | $Xsed
  2336. + $ECHO "Libraries have been installed in:"
  2337. + for libdir in $libdirs; do
  2338. + $ECHO " $libdir"
  2339. + done
  2340. + $ECHO
  2341. + $ECHO "If you ever happen to want to link against installed libraries"
  2342. + $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
  2343. + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
  2344. + $ECHO "flag during linking and do at least one of the following:"
  2345. + if test -n "$shlibpath_var"; then
  2346. + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
  2347. + $ECHO " during execution"
  2348. + fi
  2349. + if test -n "$runpath_var"; then
  2350. + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
  2351. + $ECHO " during linking"
  2352. + fi
  2353. + if test -n "$hardcode_libdir_flag_spec"; then
  2354. + libdir=LIBDIR
  2355. + eval flag=\"$hardcode_libdir_flag_spec\"
  2356. +
  2357. + $ECHO " - use the \`$flag' linker flag"
  2358. + fi
  2359. + if test -n "$admincmds"; then
  2360. + $ECHO " - have your system administrator run these commands:$admincmds"
  2361. + fi
  2362. + if test -f /etc/ld.so.conf; then
  2363. + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  2364. fi
  2365. + $ECHO
  2366. + $ECHO "See any operating system documentation about shared libraries for"
  2367. + case $host in
  2368. + solaris2.[6789]|solaris2.1[0-9])
  2369. + $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
  2370. + $ECHO "pages."
  2371. + ;;
  2372. + *)
  2373. + $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
  2374. + ;;
  2375. + esac
  2376. + $ECHO "X----------------------------------------------------------------------" | $Xsed
  2377. exit $EXIT_SUCCESS
  2378. +}
  2379. +
  2380. +test "$mode" = finish && func_mode_finish ${1+"$@"}
  2381. +
  2382. +
  2383. +# func_mode_install arg...
  2384. +func_mode_install ()
  2385. +{
  2386. + $opt_debug
  2387. + # There may be an optional sh(1) argument at the beginning of
  2388. + # install_prog (especially on Windows NT).
  2389. + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  2390. + # Allow the use of GNU shtool's install command.
  2391. + $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
  2392. + # Aesthetically quote it.
  2393. + func_quote_for_eval "$nonopt"
  2394. + install_prog="$func_quote_for_eval_result "
  2395. + arg=$1
  2396. + shift
  2397. + else
  2398. + install_prog=
  2399. + arg=$nonopt
  2400. + fi
  2401. +
  2402. + # The real first argument should be the name of the installation program.
  2403. + # Aesthetically quote it.
  2404. + func_quote_for_eval "$arg"
  2405. + install_prog="$install_prog$func_quote_for_eval_result"
  2406. +
  2407. + # We need to accept at least all the BSD install flags.
  2408. + dest=
  2409. + files=
  2410. + opts=
  2411. + prev=
  2412. + install_type=
  2413. + isdir=no
  2414. + stripme=
  2415. + for arg
  2416. + do
  2417. + if test -n "$dest"; then
  2418. + files="$files $dest"
  2419. + dest=$arg
  2420. + continue
  2421. + fi
  2422. +
  2423. + case $arg in
  2424. + -d) isdir=yes ;;
  2425. + -f)
  2426. + case " $install_prog " in
  2427. + *[\\\ /]cp\ *) ;;
  2428. + *) prev=$arg ;;
  2429. + esac
  2430. + ;;
  2431. + -g | -m | -o)
  2432. + prev=$arg
  2433. + ;;
  2434. + -s)
  2435. + stripme=" -s"
  2436. + continue
  2437. + ;;
  2438. + -*)
  2439. + ;;
  2440. + *)
  2441. + # If the previous option needed an argument, then skip it.
  2442. + if test -n "$prev"; then
  2443. + prev=
  2444. + else
  2445. + dest=$arg
  2446. + continue
  2447. + fi
  2448. + ;;
  2449. + esac
  2450. +
  2451. + # Aesthetically quote the argument.
  2452. + func_quote_for_eval "$arg"
  2453. + install_prog="$install_prog $func_quote_for_eval_result"
  2454. + done
  2455. +
  2456. + test -z "$install_prog" && \
  2457. + func_fatal_help "you must specify an install program"
  2458. +
  2459. + test -n "$prev" && \
  2460. + func_fatal_help "the \`$prev' option requires an argument"
  2461. +
  2462. + if test -z "$files"; then
  2463. + if test -z "$dest"; then
  2464. + func_fatal_help "no file or destination specified"
  2465. + else
  2466. + func_fatal_help "you must specify a destination"
  2467. + fi
  2468. + fi
  2469. +
  2470. + # Strip any trailing slash from the destination.
  2471. + func_stripname '' '/' "$dest"
  2472. + dest=$func_stripname_result
  2473. +
  2474. + # Check to see that the destination is a directory.
  2475. + test -d "$dest" && isdir=yes
  2476. + if test "$isdir" = yes; then
  2477. + destdir="$dest"
  2478. + destname=
  2479. + else
  2480. + func_dirname_and_basename "$dest" "" "."
  2481. + destdir="$func_dirname_result"
  2482. + destname="$func_basename_result"
  2483. +
  2484. + # Not a directory, so check to see that there is only one file specified.
  2485. + set dummy $files; shift
  2486. + test "$#" -gt 1 && \
  2487. + func_fatal_help "\`$dest' is not a directory"
  2488. + fi
  2489. + case $destdir in
  2490. + [\\/]* | [A-Za-z]:[\\/]*) ;;
  2491. + *)
  2492. + for file in $files; do
  2493. + case $file in
  2494. + *.lo) ;;
  2495. + *)
  2496. + func_fatal_help "\`$destdir' must be an absolute directory name"
  2497. + ;;
  2498. + esac
  2499. + done
  2500. + ;;
  2501. + esac
  2502. +
  2503. + # This variable tells wrapper scripts just to set variables rather
  2504. + # than running their programs.
  2505. + libtool_install_magic="$magic"
  2506. +
  2507. + staticlibs=
  2508. + future_libdirs=
  2509. + current_libdirs=
  2510. + for file in $files; do
  2511. +
  2512. + # Do each installation.
  2513. + case $file in
  2514. + *.$libext)
  2515. + # Do the static libraries later.
  2516. + staticlibs="$staticlibs $file"
  2517. + ;;
  2518. +
  2519. + *.la)
  2520. + # Check to see that this really is a libtool archive.
  2521. + func_lalib_unsafe_p "$file" \
  2522. + || func_fatal_help "\`$file' is not a valid libtool archive"
  2523. +
  2524. + library_names=
  2525. + old_library=
  2526. + relink_command=
  2527. + func_source "$file"
  2528. +
  2529. + # Add the libdir to current_libdirs if it is the destination.
  2530. + if test "X$destdir" = "X$libdir"; then
  2531. + case "$current_libdirs " in
  2532. + *" $libdir "*) ;;
  2533. + *) current_libdirs="$current_libdirs $libdir" ;;
  2534. + esac
  2535. + else
  2536. + # Note the libdir as a future libdir.
  2537. + case "$future_libdirs " in
  2538. + *" $libdir "*) ;;
  2539. + *) future_libdirs="$future_libdirs $libdir" ;;
  2540. + esac
  2541. + fi
  2542. +
  2543. + func_dirname "$file" "/" ""
  2544. + dir="$func_dirname_result"
  2545. + dir="$dir$objdir"
  2546. +
  2547. + if test -n "$relink_command"; then
  2548. + # Determine the prefix the user has applied to our future dir.
  2549. + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
  2550. +
  2551. + # Don't allow the user to place us outside of our expected
  2552. + # location b/c this prevents finding dependent libraries that
  2553. + # are installed to the same prefix.
  2554. + # At present, this check doesn't affect windows .dll's that
  2555. + # are installed into $libdir/../bin (currently, that works fine)
  2556. + # but it's something to keep an eye on.
  2557. + test "$inst_prefix_dir" = "$destdir" && \
  2558. + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
  2559. +
  2560. + if test -n "$inst_prefix_dir"; then
  2561. + # Stick the inst_prefix_dir data into the link command.
  2562. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
  2563. + else
  2564. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
  2565. + fi
  2566. +
  2567. + func_warning "relinking \`$file'"
  2568. + func_show_eval "$relink_command" \
  2569. + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
  2570. + fi
  2571. +
  2572. + # See the names of the shared library.
  2573. + set dummy $library_names; shift
  2574. + if test -n "$1"; then
  2575. + realname="$1"
  2576. + shift
  2577. +
  2578. + srcname="$realname"
  2579. + test -n "$relink_command" && srcname="$realname"T
  2580. +
  2581. + # Install the shared library and build the symlinks.
  2582. + func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
  2583. + 'exit $?'
  2584. + tstripme="$stripme"
  2585. + case $host_os in
  2586. + cygwin* | mingw* | pw32* | cegcc*)
  2587. + case $realname in
  2588. + *.dll.a)
  2589. + tstripme=""
  2590. + ;;
  2591. + esac
  2592. + ;;
  2593. + esac
  2594. + if test -n "$tstripme" && test -n "$striplib"; then
  2595. + func_show_eval "$striplib $destdir/$realname" 'exit $?'
  2596. + fi
  2597. +
  2598. + if test "$#" -gt 0; then
  2599. + # Delete the old symlinks, and create new ones.
  2600. + # Try `ln -sf' first, because the `ln' binary might depend on
  2601. + # the symlink we replace! Solaris /bin/ln does not understand -f,
  2602. + # so we also need to try rm && ln -s.
  2603. + for linkname
  2604. + do
  2605. + test "$linkname" != "$realname" \
  2606. + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
  2607. + done
  2608. + fi
  2609. +
  2610. + # Do each command in the postinstall commands.
  2611. + lib="$destdir/$realname"
  2612. + func_execute_cmds "$postinstall_cmds" 'exit $?'
  2613. + fi
  2614. +
  2615. + # Install the pseudo-library for information purposes.
  2616. + func_basename "$file"
  2617. + name="$func_basename_result"
  2618. + instname="$dir/$name"i
  2619. + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
  2620. +
  2621. + # Maybe install the static library, too.
  2622. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  2623. + ;;
  2624. +
  2625. + *.lo)
  2626. + # Install (i.e. copy) a libtool object.
  2627. +
  2628. + # Figure out destination file name, if it wasn't already specified.
  2629. + if test -n "$destname"; then
  2630. + destfile="$destdir/$destname"
  2631. + else
  2632. + func_basename "$file"
  2633. + destfile="$func_basename_result"
  2634. + destfile="$destdir/$destfile"
  2635. + fi
  2636. +
  2637. + # Deduce the name of the destination old-style object file.
  2638. + case $destfile in
  2639. + *.lo)
  2640. + func_lo2o "$destfile"
  2641. + staticdest=$func_lo2o_result
  2642. + ;;
  2643. + *.$objext)
  2644. + staticdest="$destfile"
  2645. + destfile=
  2646. + ;;
  2647. + *)
  2648. + func_fatal_help "cannot copy a libtool object to \`$destfile'"
  2649. + ;;
  2650. + esac
  2651. +
  2652. + # Install the libtool object if requested.
  2653. + test -n "$destfile" && \
  2654. + func_show_eval "$install_prog $file $destfile" 'exit $?'
  2655. +
  2656. + # Install the old object if enabled.
  2657. + if test "$build_old_libs" = yes; then
  2658. + # Deduce the name of the old-style object file.
  2659. + func_lo2o "$file"
  2660. + staticobj=$func_lo2o_result
  2661. + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
  2662. + fi
  2663. + exit $EXIT_SUCCESS
  2664. + ;;
  2665. +
  2666. + *)
  2667. + # Figure out destination file name, if it wasn't already specified.
  2668. + if test -n "$destname"; then
  2669. + destfile="$destdir/$destname"
  2670. + else
  2671. + func_basename "$file"
  2672. + destfile="$func_basename_result"
  2673. + destfile="$destdir/$destfile"
  2674. + fi
  2675. +
  2676. + # If the file is missing, and there is a .exe on the end, strip it
  2677. + # because it is most likely a libtool script we actually want to
  2678. + # install
  2679. + stripped_ext=""
  2680. + case $file in
  2681. + *.exe)
  2682. + if test ! -f "$file"; then
  2683. + func_stripname '' '.exe' "$file"
  2684. + file=$func_stripname_result
  2685. + stripped_ext=".exe"
  2686. + fi
  2687. + ;;
  2688. + esac
  2689. +
  2690. + # Do a test to see if this is really a libtool program.
  2691. + case $host in
  2692. + *cygwin* | *mingw*)
  2693. + if func_ltwrapper_executable_p "$file"; then
  2694. + func_ltwrapper_scriptname "$file"
  2695. + wrapper=$func_ltwrapper_scriptname_result
  2696. + else
  2697. + func_stripname '' '.exe' "$file"
  2698. + wrapper=$func_stripname_result
  2699. + fi
  2700. + ;;
  2701. + *)
  2702. + wrapper=$file
  2703. + ;;
  2704. + esac
  2705. + if func_ltwrapper_script_p "$wrapper"; then
  2706. + notinst_deplibs=
  2707. + relink_command=
  2708. +
  2709. + func_source "$wrapper"
  2710. +
  2711. + # Check the variables that should have been set.
  2712. + test -z "$generated_by_libtool_version" && \
  2713. + func_fatal_error "invalid libtool wrapper script \`$wrapper'"
  2714. +
  2715. + finalize=yes
  2716. + for lib in $notinst_deplibs; do
  2717. + # Check to see that each library is installed.
  2718. + libdir=
  2719. + if test -f "$lib"; then
  2720. + func_source "$lib"
  2721. + fi
  2722. + libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  2723. + if test -n "$libdir" && test ! -f "$libfile"; then
  2724. + func_warning "\`$lib' has not been installed in \`$libdir'"
  2725. + finalize=no
  2726. + fi
  2727. + done
  2728. +
  2729. + relink_command=
  2730. + func_source "$wrapper"
  2731. +
  2732. + outputname=
  2733. + if test "$fast_install" = no && test -n "$relink_command"; then
  2734. + $opt_dry_run || {
  2735. + if test "$finalize" = yes; then
  2736. + tmpdir=`func_mktempdir`
  2737. + func_basename "$file$stripped_ext"
  2738. + file="$func_basename_result"
  2739. + outputname="$tmpdir/$file"
  2740. + # Replace the output file specification.
  2741. + relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  2742. +
  2743. + $opt_silent || {
  2744. + func_quote_for_expand "$relink_command"
  2745. + eval "func_echo $func_quote_for_expand_result"
  2746. + }
  2747. + if eval "$relink_command"; then :
  2748. + else
  2749. + func_error "error: relink \`$file' with the above command before installing it"
  2750. + $opt_dry_run || ${RM}r "$tmpdir"
  2751. + continue
  2752. + fi
  2753. + file="$outputname"
  2754. + else
  2755. + func_warning "cannot relink \`$file'"
  2756. + fi
  2757. + }
  2758. + else
  2759. + # Install the binary that we compiled earlier.
  2760. + file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  2761. + fi
  2762. + fi
  2763. +
  2764. + # remove .exe since cygwin /usr/bin/install will append another
  2765. + # one anyway
  2766. + case $install_prog,$host in
  2767. + */usr/bin/install*,*cygwin*)
  2768. + case $file:$destfile in
  2769. + *.exe:*.exe)
  2770. + # this is ok
  2771. + ;;
  2772. + *.exe:*)
  2773. + destfile=$destfile.exe
  2774. + ;;
  2775. + *:*.exe)
  2776. + func_stripname '' '.exe' "$destfile"
  2777. + destfile=$func_stripname_result
  2778. + ;;
  2779. + esac
  2780. + ;;
  2781. + esac
  2782. + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
  2783. + $opt_dry_run || if test -n "$outputname"; then
  2784. + ${RM}r "$tmpdir"
  2785. + fi
  2786. + ;;
  2787. + esac
  2788. + done
  2789. +
  2790. + for file in $staticlibs; do
  2791. + func_basename "$file"
  2792. + name="$func_basename_result"
  2793. +
  2794. + # Set up the ranlib parameters.
  2795. + oldlib="$destdir/$name"
  2796. +
  2797. + func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
  2798. +
  2799. + if test -n "$stripme" && test -n "$old_striplib"; then
  2800. + func_show_eval "$old_striplib $oldlib" 'exit $?'
  2801. + fi
  2802. +
  2803. + # Do each command in the postinstall commands.
  2804. + func_execute_cmds "$old_postinstall_cmds" 'exit $?'
  2805. + done
  2806. +
  2807. + test -n "$future_libdirs" && \
  2808. + func_warning "remember to run \`$progname --finish$future_libdirs'"
  2809. +
  2810. + if test -n "$current_libdirs"; then
  2811. + # Maybe just do a dry run.
  2812. + $opt_dry_run && current_libdirs=" -n$current_libdirs"
  2813. + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  2814. + else
  2815. + exit $EXIT_SUCCESS
  2816. + fi
  2817. +}
  2818. +
  2819. +test "$mode" = install && func_mode_install ${1+"$@"}
  2820. +
  2821. +
  2822. +# func_generate_dlsyms outputname originator pic_p
  2823. +# Extract symbols from dlprefiles and create ${outputname}S.o with
  2824. +# a dlpreopen symbol table.
  2825. +func_generate_dlsyms ()
  2826. +{
  2827. + $opt_debug
  2828. + my_outputname="$1"
  2829. + my_originator="$2"
  2830. + my_pic_p="${3-no}"
  2831. + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
  2832. + my_dlsyms=
  2833. +
  2834. + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  2835. + if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2836. + my_dlsyms="${my_outputname}S.c"
  2837. + else
  2838. + func_error "not configured to extract global symbols from dlpreopened files"
  2839. + fi
  2840. + fi
  2841. +
  2842. + if test -n "$my_dlsyms"; then
  2843. + case $my_dlsyms in
  2844. + "") ;;
  2845. + *.c)
  2846. + # Discover the nlist of each of the dlfiles.
  2847. + nlist="$output_objdir/${my_outputname}.nm"
  2848. +
  2849. + func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
  2850. +
  2851. + # Parse the name list into a source file.
  2852. + func_verbose "creating $output_objdir/$my_dlsyms"
  2853. +
  2854. + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
  2855. +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
  2856. +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
  2857. +
  2858. +#ifdef __cplusplus
  2859. +extern \"C\" {
  2860. +#endif
  2861. +
  2862. +/* External symbol declarations for the compiler. */\
  2863. +"
  2864. +
  2865. + if test "$dlself" = yes; then
  2866. + func_verbose "generating symbol list for \`$output'"
  2867. +
  2868. + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
  2869. +
  2870. + # Add our own program objects to the symbol list.
  2871. + progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2872. + for progfile in $progfiles; do
  2873. + func_verbose "extracting global C symbols from \`$progfile'"
  2874. + $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
  2875. + done
  2876. +
  2877. + if test -n "$exclude_expsyms"; then
  2878. + $opt_dry_run || {
  2879. + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2880. + eval '$MV "$nlist"T "$nlist"'
  2881. + }
  2882. + fi
  2883. +
  2884. + if test -n "$export_symbols_regex"; then
  2885. + $opt_dry_run || {
  2886. + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2887. + eval '$MV "$nlist"T "$nlist"'
  2888. + }
  2889. + fi
  2890. +
  2891. + # Prepare the list of exported symbols
  2892. + if test -z "$export_symbols"; then
  2893. + export_symbols="$output_objdir/$outputname.exp"
  2894. + $opt_dry_run || {
  2895. + $RM $export_symbols
  2896. + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2897. + case $host in
  2898. + *cygwin* | *mingw* | *cegcc* )
  2899. + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  2900. + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  2901. + ;;
  2902. + esac
  2903. + }
  2904. + else
  2905. + $opt_dry_run || {
  2906. + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  2907. + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  2908. + eval '$MV "$nlist"T "$nlist"'
  2909. + case $host in
  2910. + *cygwin | *mingw* | *cegcc* )
  2911. + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  2912. + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  2913. + ;;
  2914. + esac
  2915. + }
  2916. + fi
  2917. + fi
  2918. +
  2919. + for dlprefile in $dlprefiles; do
  2920. + func_verbose "extracting global C symbols from \`$dlprefile'"
  2921. + func_basename "$dlprefile"
  2922. + name="$func_basename_result"
  2923. + $opt_dry_run || {
  2924. + eval '$ECHO ": $name " >> "$nlist"'
  2925. + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
  2926. + }
  2927. + done
  2928. +
  2929. + $opt_dry_run || {
  2930. + # Make sure we have at least an empty file.
  2931. + test -f "$nlist" || : > "$nlist"
  2932. +
  2933. + if test -n "$exclude_expsyms"; then
  2934. + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2935. + $MV "$nlist"T "$nlist"
  2936. + fi
  2937. +
  2938. + # Try sorting and uniquifying the output.
  2939. + if $GREP -v "^: " < "$nlist" |
  2940. + if sort -k 3 </dev/null >/dev/null 2>&1; then
  2941. + sort -k 3
  2942. + else
  2943. + sort +2
  2944. + fi |
  2945. + uniq > "$nlist"S; then
  2946. + :
  2947. + else
  2948. + $GREP -v "^: " < "$nlist" > "$nlist"S
  2949. + fi
  2950. +
  2951. + if test -f "$nlist"S; then
  2952. + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
  2953. + else
  2954. + $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
  2955. + fi
  2956. +
  2957. + $ECHO >> "$output_objdir/$my_dlsyms" "\
  2958. +
  2959. +/* The mapping between symbol names and symbols. */
  2960. +typedef struct {
  2961. + const char *name;
  2962. + void *address;
  2963. +} lt_dlsymlist;
  2964. +"
  2965. + case $host in
  2966. + *cygwin* | *mingw* | *cegcc* )
  2967. + $ECHO >> "$output_objdir/$my_dlsyms" "\
  2968. +/* DATA imports from DLLs on WIN32 con't be const, because
  2969. + runtime relocations are performed -- see ld's documentation
  2970. + on pseudo-relocs. */"
  2971. + lt_dlsym_const= ;;
  2972. + *osf5*)
  2973. + echo >> "$output_objdir/$my_dlsyms" "\
  2974. +/* This system does not cope well with relocations in const data */"
  2975. + lt_dlsym_const= ;;
  2976. + *)
  2977. + lt_dlsym_const=const ;;
  2978. + esac
  2979. +
  2980. + $ECHO >> "$output_objdir/$my_dlsyms" "\
  2981. +extern $lt_dlsym_const lt_dlsymlist
  2982. +lt_${my_prefix}_LTX_preloaded_symbols[];
  2983. +$lt_dlsym_const lt_dlsymlist
  2984. +lt_${my_prefix}_LTX_preloaded_symbols[] =
  2985. +{\
  2986. + { \"$my_originator\", (void *) 0 },"
  2987. +
  2988. + case $need_lib_prefix in
  2989. + no)
  2990. + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
  2991. + ;;
  2992. + *)
  2993. + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
  2994. + ;;
  2995. + esac
  2996. + $ECHO >> "$output_objdir/$my_dlsyms" "\
  2997. + {0, (void *) 0}
  2998. +};
  2999. +
  3000. +/* This works around a problem in FreeBSD linker */
  3001. +#ifdef FREEBSD_WORKAROUND
  3002. +static const void *lt_preloaded_setup() {
  3003. + return lt_${my_prefix}_LTX_preloaded_symbols;
  3004. +}
  3005. +#endif
  3006. +
  3007. +#ifdef __cplusplus
  3008. +}
  3009. +#endif\
  3010. +"
  3011. + } # !$opt_dry_run
  3012. +
  3013. + pic_flag_for_symtable=
  3014. + case "$compile_command " in
  3015. + *" -static "*) ;;
  3016. + *)
  3017. + case $host in
  3018. + # compiling the symbol table file with pic_flag works around
  3019. + # a FreeBSD bug that causes programs to crash when -lm is
  3020. + # linked before any other PIC object. But we must not use
  3021. + # pic_flag when linking with -static. The problem exists in
  3022. + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  3023. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  3024. + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
  3025. + *-*-hpux*)
  3026. + pic_flag_for_symtable=" $pic_flag" ;;
  3027. + *)
  3028. + if test "X$my_pic_p" != Xno; then
  3029. + pic_flag_for_symtable=" $pic_flag"
  3030. + fi
  3031. + ;;
  3032. + esac
  3033. + ;;
  3034. + esac
  3035. + symtab_cflags=
  3036. + for arg in $LTCFLAGS; do
  3037. + case $arg in
  3038. + -pie | -fpie | -fPIE) ;;
  3039. + *) symtab_cflags="$symtab_cflags $arg" ;;
  3040. + esac
  3041. + done
  3042. +
  3043. + # Now compile the dynamic symbol file.
  3044. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
  3045. +
  3046. + # Clean up the generated files.
  3047. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
  3048. +
  3049. + # Transform the symbol file into the correct name.
  3050. + symfileobj="$output_objdir/${my_outputname}S.$objext"
  3051. + case $host in
  3052. + *cygwin* | *mingw* | *cegcc* )
  3053. + if test -f "$output_objdir/$my_outputname.def"; then
  3054. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  3055. + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
  3056. + else
  3057. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  3058. + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  3059. + fi
  3060. + ;;
  3061. + *)
  3062. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  3063. + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
  3064. + ;;
  3065. + esac
  3066. + ;;
  3067. + *)
  3068. + func_fatal_error "unknown suffix for \`$my_dlsyms'"
  3069. + ;;
  3070. + esac
  3071. + else
  3072. + # We keep going just in case the user didn't refer to
  3073. + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  3074. + # really was required.
  3075. +
  3076. + # Nullify the symbol file.
  3077. + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  3078. + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  3079. + fi
  3080. +}
  3081. +
  3082. +# func_win32_libid arg
  3083. +# return the library type of file 'arg'
  3084. +#
  3085. +# Need a lot of goo to handle *both* DLLs and import libs
  3086. +# Has to be a shell function in order to 'eat' the argument
  3087. +# that is supplied when $file_magic_command is called.
  3088. +func_win32_libid ()
  3089. +{
  3090. + $opt_debug
  3091. + win32_libid_type="unknown"
  3092. + win32_fileres=`file -L $1 2>/dev/null`
  3093. + case $win32_fileres in
  3094. + *ar\ archive\ import\ library*) # definitely import
  3095. + win32_libid_type="x86 archive import"
  3096. ;;
  3097. + *ar\ archive*) # could be an import, or static
  3098. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
  3099. + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
  3100. + win32_nmres=`eval $NM -f posix -A $1 |
  3101. + $SED -n -e '
  3102. + 1,100{
  3103. + / I /{
  3104. + s,.*,import,
  3105. + p
  3106. + q
  3107. + }
  3108. + }'`
  3109. + case $win32_nmres in
  3110. + import*) win32_libid_type="x86 archive import";;
  3111. + *) win32_libid_type="x86 archive static";;
  3112. + esac
  3113. + fi
  3114. + ;;
  3115. + *DLL*)
  3116. + win32_libid_type="x86 DLL"
  3117. + ;;
  3118. + *executable*) # but shell scripts are "executable" too...
  3119. + case $win32_fileres in
  3120. + *MS\ Windows\ PE\ Intel*)
  3121. + win32_libid_type="x86 DLL"
  3122. + ;;
  3123. + esac
  3124. + ;;
  3125. + esac
  3126. + $ECHO "$win32_libid_type"
  3127. +}
  3128. - # libtool link mode
  3129. - link | relink)
  3130. - modename="$modename: link"
  3131. +
  3132. +
  3133. +# func_extract_an_archive dir oldlib
  3134. +func_extract_an_archive ()
  3135. +{
  3136. + $opt_debug
  3137. + f_ex_an_ar_dir="$1"; shift
  3138. + f_ex_an_ar_oldlib="$1"
  3139. + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
  3140. + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
  3141. + :
  3142. + else
  3143. + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
  3144. + fi
  3145. +}
  3146. +
  3147. +
  3148. +# func_extract_archives gentop oldlib ...
  3149. +func_extract_archives ()
  3150. +{
  3151. + $opt_debug
  3152. + my_gentop="$1"; shift
  3153. + my_oldlibs=${1+"$@"}
  3154. + my_oldobjs=""
  3155. + my_xlib=""
  3156. + my_xabs=""
  3157. + my_xdir=""
  3158. +
  3159. + for my_xlib in $my_oldlibs; do
  3160. + # Extract the objects.
  3161. + case $my_xlib in
  3162. + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
  3163. + *) my_xabs=`pwd`"/$my_xlib" ;;
  3164. + esac
  3165. + func_basename "$my_xlib"
  3166. + my_xlib="$func_basename_result"
  3167. + my_xlib_u=$my_xlib
  3168. + while :; do
  3169. + case " $extracted_archives " in
  3170. + *" $my_xlib_u "*)
  3171. + func_arith $extracted_serial + 1
  3172. + extracted_serial=$func_arith_result
  3173. + my_xlib_u=lt$extracted_serial-$my_xlib ;;
  3174. + *) break ;;
  3175. + esac
  3176. + done
  3177. + extracted_archives="$extracted_archives $my_xlib_u"
  3178. + my_xdir="$my_gentop/$my_xlib_u"
  3179. +
  3180. + func_mkdir_p "$my_xdir"
  3181. +
  3182. + case $host in
  3183. + *-darwin*)
  3184. + func_verbose "Extracting $my_xabs"
  3185. + # Do not bother doing anything if just a dry run
  3186. + $opt_dry_run || {
  3187. + darwin_orig_dir=`pwd`
  3188. + cd $my_xdir || exit $?
  3189. + darwin_archive=$my_xabs
  3190. + darwin_curdir=`pwd`
  3191. + darwin_base_archive=`basename "$darwin_archive"`
  3192. + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
  3193. + if test -n "$darwin_arches"; then
  3194. + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
  3195. + darwin_arch=
  3196. + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
  3197. + for darwin_arch in $darwin_arches ; do
  3198. + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  3199. + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
  3200. + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
  3201. + func_extract_an_archive "`pwd`" "${darwin_base_archive}"
  3202. + cd "$darwin_curdir"
  3203. + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
  3204. + done # $darwin_arches
  3205. + ## Okay now we've a bunch of thin objects, gotta fatten them up :)
  3206. + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
  3207. + darwin_file=
  3208. + darwin_files=
  3209. + for darwin_file in $darwin_filelist; do
  3210. + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
  3211. + $LIPO -create -output "$darwin_file" $darwin_files
  3212. + done # $darwin_filelist
  3213. + $RM -rf unfat-$$
  3214. + cd "$darwin_orig_dir"
  3215. + else
  3216. + cd $darwin_orig_dir
  3217. + func_extract_an_archive "$my_xdir" "$my_xabs"
  3218. + fi # $darwin_arches
  3219. + } # !$opt_dry_run
  3220. + ;;
  3221. + *)
  3222. + func_extract_an_archive "$my_xdir" "$my_xabs"
  3223. + ;;
  3224. + esac
  3225. + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
  3226. + done
  3227. +
  3228. + func_extract_archives_result="$my_oldobjs"
  3229. +}
  3230. +
  3231. +
  3232. +
  3233. +# func_emit_wrapper_part1 [arg=no]
  3234. +#
  3235. +# Emit the first part of a libtool wrapper script on stdout.
  3236. +# For more information, see the description associated with
  3237. +# func_emit_wrapper(), below.
  3238. +func_emit_wrapper_part1 ()
  3239. +{
  3240. + func_emit_wrapper_part1_arg1=no
  3241. + if test -n "$1" ; then
  3242. + func_emit_wrapper_part1_arg1=$1
  3243. + fi
  3244. +
  3245. + $ECHO "\
  3246. +#! $SHELL
  3247. +
  3248. +# $output - temporary wrapper script for $objdir/$outputname
  3249. +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  3250. +#
  3251. +# The $output program cannot be directly executed until all the libtool
  3252. +# libraries that it depends on are installed.
  3253. +#
  3254. +# This wrapper script should never be moved out of the build directory.
  3255. +# If it is, it will not operate correctly.
  3256. +
  3257. +# Sed substitution that helps us do robust quoting. It backslashifies
  3258. +# metacharacters that are still active within double-quoted strings.
  3259. +Xsed='${SED} -e 1s/^X//'
  3260. +sed_quote_subst='$sed_quote_subst'
  3261. +
  3262. +# Be Bourne compatible
  3263. +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  3264. + emulate sh
  3265. + NULLCMD=:
  3266. + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  3267. + # is contrary to our usage. Disable this feature.
  3268. + alias -g '\${1+\"\$@\"}'='\"\$@\"'
  3269. + setopt NO_GLOB_SUBST
  3270. +else
  3271. + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  3272. +fi
  3273. +BIN_SH=xpg4; export BIN_SH # for Tru64
  3274. +DUALCASE=1; export DUALCASE # for MKS sh
  3275. +
  3276. +# The HP-UX ksh and POSIX shell print the target directory to stdout
  3277. +# if CDPATH is set.
  3278. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  3279. +
  3280. +relink_command=\"$relink_command\"
  3281. +
  3282. +# This environment variable determines our operation mode.
  3283. +if test \"\$libtool_install_magic\" = \"$magic\"; then
  3284. + # install mode needs the following variables:
  3285. + generated_by_libtool_version='$macro_version'
  3286. + notinst_deplibs='$notinst_deplibs'
  3287. +else
  3288. + # When we are sourced in execute mode, \$file and \$ECHO are already set.
  3289. + if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3290. + ECHO=\"$qecho\"
  3291. + file=\"\$0\"
  3292. + # Make sure echo works.
  3293. + if test \"X\$1\" = X--no-reexec; then
  3294. + # Discard the --no-reexec flag, and continue.
  3295. + shift
  3296. + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
  3297. + # Yippee, \$ECHO works!
  3298. + :
  3299. + else
  3300. + # Restart under the correct shell, and then maybe \$ECHO will work.
  3301. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  3302. + fi
  3303. + fi\
  3304. +"
  3305. + $ECHO "\
  3306. +
  3307. + # Find the directory that this script lives in.
  3308. + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  3309. + test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  3310. +
  3311. + # Follow symbolic links until we get to the real thisdir.
  3312. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  3313. + while test -n \"\$file\"; do
  3314. + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  3315. +
  3316. + # If there was a directory component, then change thisdir.
  3317. + if test \"x\$destdir\" != \"x\$file\"; then
  3318. + case \"\$destdir\" in
  3319. + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  3320. + *) thisdir=\"\$thisdir/\$destdir\" ;;
  3321. + esac
  3322. + fi
  3323. +
  3324. + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  3325. + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  3326. + done
  3327. +"
  3328. +}
  3329. +# end: func_emit_wrapper_part1
  3330. +
  3331. +# func_emit_wrapper_part2 [arg=no]
  3332. +#
  3333. +# Emit the second part of a libtool wrapper script on stdout.
  3334. +# For more information, see the description associated with
  3335. +# func_emit_wrapper(), below.
  3336. +func_emit_wrapper_part2 ()
  3337. +{
  3338. + func_emit_wrapper_part2_arg1=no
  3339. + if test -n "$1" ; then
  3340. + func_emit_wrapper_part2_arg1=$1
  3341. + fi
  3342. +
  3343. + $ECHO "\
  3344. +
  3345. + # Usually 'no', except on cygwin/mingw when embedded into
  3346. + # the cwrapper.
  3347. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
  3348. + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
  3349. + # special case for '.'
  3350. + if test \"\$thisdir\" = \".\"; then
  3351. + thisdir=\`pwd\`
  3352. + fi
  3353. + # remove .libs from thisdir
  3354. + case \"\$thisdir\" in
  3355. + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
  3356. + $objdir ) thisdir=. ;;
  3357. + esac
  3358. + fi
  3359. +
  3360. + # Try to get the absolute directory name.
  3361. + absdir=\`cd \"\$thisdir\" && pwd\`
  3362. + test -n \"\$absdir\" && thisdir=\"\$absdir\"
  3363. +"
  3364. +
  3365. + if test "$fast_install" = yes; then
  3366. + $ECHO "\
  3367. + program=lt-'$outputname'$exeext
  3368. + progdir=\"\$thisdir/$objdir\"
  3369. +
  3370. + if test ! -f \"\$progdir/\$program\" ||
  3371. + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  3372. + test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  3373. +
  3374. + file=\"\$\$-\$program\"
  3375. +
  3376. + if test ! -d \"\$progdir\"; then
  3377. + $MKDIR \"\$progdir\"
  3378. + else
  3379. + $RM \"\$progdir/\$file\"
  3380. + fi"
  3381. +
  3382. + $ECHO "\
  3383. +
  3384. + # relink executable if necessary
  3385. + if test -n \"\$relink_command\"; then
  3386. + if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  3387. + else
  3388. + $ECHO \"\$relink_command_output\" >&2
  3389. + $RM \"\$progdir/\$file\"
  3390. + exit 1
  3391. + fi
  3392. + fi
  3393. +
  3394. + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3395. + { $RM \"\$progdir/\$program\";
  3396. + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3397. + $RM \"\$progdir/\$file\"
  3398. + fi"
  3399. + else
  3400. + $ECHO "\
  3401. + program='$outputname'
  3402. + progdir=\"\$thisdir/$objdir\"
  3403. +"
  3404. + fi
  3405. +
  3406. + $ECHO "\
  3407. +
  3408. + if test -f \"\$progdir/\$program\"; then"
  3409. +
  3410. + # Export our shlibpath_var if we have one.
  3411. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3412. + $ECHO "\
  3413. + # Add our own library path to $shlibpath_var
  3414. + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3415. +
  3416. + # Some systems cannot cope with colon-terminated $shlibpath_var
  3417. + # The second colon is a workaround for a bug in BeOS R4 sed
  3418. + $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3419. +
  3420. + export $shlibpath_var
  3421. +"
  3422. + fi
  3423. +
  3424. + # fixup the dll searchpath if we need to.
  3425. + if test -n "$dllsearchpath"; then
  3426. + $ECHO "\
  3427. + # Add the dll search path components to the executable PATH
  3428. + PATH=$dllsearchpath:\$PATH
  3429. +"
  3430. + fi
  3431. +
  3432. + $ECHO "\
  3433. + if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3434. + # Run the actual program with our arguments.
  3435. +"
  3436. + case $host in
  3437. + # Backslashes separate directories on plain windows
  3438. + *-*-mingw | *-*-os2* | *-cegcc*)
  3439. + $ECHO "\
  3440. + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  3441. +"
  3442. + ;;
  3443. +
  3444. + *)
  3445. + $ECHO "\
  3446. + exec \"\$progdir/\$program\" \${1+\"\$@\"}
  3447. +"
  3448. + ;;
  3449. + esac
  3450. + $ECHO "\
  3451. + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
  3452. + exit 1
  3453. + fi
  3454. + else
  3455. + # The program doesn't exist.
  3456. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
  3457. + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
  3458. + $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
  3459. + exit 1
  3460. + fi
  3461. +fi\
  3462. +"
  3463. +}
  3464. +# end: func_emit_wrapper_part2
  3465. +
  3466. +
  3467. +# func_emit_wrapper [arg=no]
  3468. +#
  3469. +# Emit a libtool wrapper script on stdout.
  3470. +# Don't directly open a file because we may want to
  3471. +# incorporate the script contents within a cygwin/mingw
  3472. +# wrapper executable. Must ONLY be called from within
  3473. +# func_mode_link because it depends on a number of variables
  3474. +# set therein.
  3475. +#
  3476. +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
  3477. +# variable will take. If 'yes', then the emitted script
  3478. +# will assume that the directory in which it is stored is
  3479. +# the $objdir directory. This is a cygwin/mingw-specific
  3480. +# behavior.
  3481. +func_emit_wrapper ()
  3482. +{
  3483. + func_emit_wrapper_arg1=no
  3484. + if test -n "$1" ; then
  3485. + func_emit_wrapper_arg1=$1
  3486. + fi
  3487. +
  3488. + # split this up so that func_emit_cwrapperexe_src
  3489. + # can call each part independently.
  3490. + func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
  3491. + func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
  3492. +}
  3493. +
  3494. +
  3495. +# func_to_host_path arg
  3496. +#
  3497. +# Convert paths to host format when used with build tools.
  3498. +# Intended for use with "native" mingw (where libtool itself
  3499. +# is running under the msys shell), or in the following cross-
  3500. +# build environments:
  3501. +# $build $host
  3502. +# mingw (msys) mingw [e.g. native]
  3503. +# cygwin mingw
  3504. +# *nix + wine mingw
  3505. +# where wine is equipped with the `winepath' executable.
  3506. +# In the native mingw case, the (msys) shell automatically
  3507. +# converts paths for any non-msys applications it launches,
  3508. +# but that facility isn't available from inside the cwrapper.
  3509. +# Similar accommodations are necessary for $host mingw and
  3510. +# $build cygwin. Calling this function does no harm for other
  3511. +# $host/$build combinations not listed above.
  3512. +#
  3513. +# ARG is the path (on $build) that should be converted to
  3514. +# the proper representation for $host. The result is stored
  3515. +# in $func_to_host_path_result.
  3516. +func_to_host_path ()
  3517. +{
  3518. + func_to_host_path_result="$1"
  3519. + if test -n "$1" ; then
  3520. case $host in
  3521. - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  3522. + *mingw* )
  3523. + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  3524. + case $build in
  3525. + *mingw* ) # actually, msys
  3526. + # awkward: cmd appends spaces to result
  3527. + lt_sed_strip_trailing_spaces="s/[ ]*\$//"
  3528. + func_to_host_path_tmp1=`( cmd //c echo "$1" |\
  3529. + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
  3530. + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  3531. + $SED -e "$lt_sed_naive_backslashify"`
  3532. + ;;
  3533. + *cygwin* )
  3534. + func_to_host_path_tmp1=`cygpath -w "$1"`
  3535. + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  3536. + $SED -e "$lt_sed_naive_backslashify"`
  3537. + ;;
  3538. + * )
  3539. + # Unfortunately, winepath does not exit with a non-zero
  3540. + # error code, so we are forced to check the contents of
  3541. + # stdout. On the other hand, if the command is not
  3542. + # found, the shell will set an exit code of 127 and print
  3543. + # *an error message* to stdout. So we must check for both
  3544. + # error code of zero AND non-empty stdout, which explains
  3545. + # the odd construction:
  3546. + func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
  3547. + if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
  3548. + func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
  3549. + $SED -e "$lt_sed_naive_backslashify"`
  3550. + else
  3551. + # Allow warning below.
  3552. + func_to_host_path_result=""
  3553. + fi
  3554. + ;;
  3555. + esac
  3556. + if test -z "$func_to_host_path_result" ; then
  3557. + func_error "Could not determine host path corresponding to"
  3558. + func_error " '$1'"
  3559. + func_error "Continuing, but uninstalled executables may not work."
  3560. + # Fallback:
  3561. + func_to_host_path_result="$1"
  3562. + fi
  3563. + ;;
  3564. + esac
  3565. + fi
  3566. +}
  3567. +# end: func_to_host_path
  3568. +
  3569. +# func_to_host_pathlist arg
  3570. +#
  3571. +# Convert pathlists to host format when used with build tools.
  3572. +# See func_to_host_path(), above. This function supports the
  3573. +# following $build/$host combinations (but does no harm for
  3574. +# combinations not listed here):
  3575. +# $build $host
  3576. +# mingw (msys) mingw [e.g. native]
  3577. +# cygwin mingw
  3578. +# *nix + wine mingw
  3579. +#
  3580. +# Path separators are also converted from $build format to
  3581. +# $host format. If ARG begins or ends with a path separator
  3582. +# character, it is preserved (but converted to $host format)
  3583. +# on output.
  3584. +#
  3585. +# ARG is a pathlist (on $build) that should be converted to
  3586. +# the proper representation on $host. The result is stored
  3587. +# in $func_to_host_pathlist_result.
  3588. +func_to_host_pathlist ()
  3589. +{
  3590. + func_to_host_pathlist_result="$1"
  3591. + if test -n "$1" ; then
  3592. + case $host in
  3593. + *mingw* )
  3594. + lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
  3595. + # Remove leading and trailing path separator characters from
  3596. + # ARG. msys behavior is inconsistent here, cygpath turns them
  3597. + # into '.;' and ';.', and winepath ignores them completely.
  3598. + func_to_host_pathlist_tmp2="$1"
  3599. + # Once set for this call, this variable should not be
  3600. + # reassigned. It is used in tha fallback case.
  3601. + func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
  3602. + $SED -e 's|^:*||' -e 's|:*$||'`
  3603. + case $build in
  3604. + *mingw* ) # Actually, msys.
  3605. + # Awkward: cmd appends spaces to result.
  3606. + lt_sed_strip_trailing_spaces="s/[ ]*\$//"
  3607. + func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
  3608. + $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
  3609. + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
  3610. + $SED -e "$lt_sed_naive_backslashify"`
  3611. + ;;
  3612. + *cygwin* )
  3613. + func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
  3614. + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
  3615. + $SED -e "$lt_sed_naive_backslashify"`
  3616. + ;;
  3617. + * )
  3618. + # unfortunately, winepath doesn't convert pathlists
  3619. + func_to_host_pathlist_result=""
  3620. + func_to_host_pathlist_oldIFS=$IFS
  3621. + IFS=:
  3622. + for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
  3623. + IFS=$func_to_host_pathlist_oldIFS
  3624. + if test -n "$func_to_host_pathlist_f" ; then
  3625. + func_to_host_path "$func_to_host_pathlist_f"
  3626. + if test -n "$func_to_host_path_result" ; then
  3627. + if test -z "$func_to_host_pathlist_result" ; then
  3628. + func_to_host_pathlist_result="$func_to_host_path_result"
  3629. + else
  3630. + func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
  3631. + fi
  3632. + fi
  3633. + fi
  3634. + IFS=:
  3635. + done
  3636. + IFS=$func_to_host_pathlist_oldIFS
  3637. + ;;
  3638. + esac
  3639. + if test -z "$func_to_host_pathlist_result" ; then
  3640. + func_error "Could not determine the host path(s) corresponding to"
  3641. + func_error " '$1'"
  3642. + func_error "Continuing, but uninstalled executables may not work."
  3643. + # Fallback. This may break if $1 contains DOS-style drive
  3644. + # specifications. The fix is not to complicate the expression
  3645. + # below, but for the user to provide a working wine installation
  3646. + # with winepath so that path translation in the cross-to-mingw
  3647. + # case works properly.
  3648. + lt_replace_pathsep_nix_to_dos="s|:|;|g"
  3649. + func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
  3650. + $SED -e "$lt_replace_pathsep_nix_to_dos"`
  3651. + fi
  3652. + # Now, add the leading and trailing path separators back
  3653. + case "$1" in
  3654. + :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
  3655. + ;;
  3656. + esac
  3657. + case "$1" in
  3658. + *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
  3659. + ;;
  3660. + esac
  3661. + ;;
  3662. + esac
  3663. + fi
  3664. +}
  3665. +# end: func_to_host_pathlist
  3666. +
  3667. +# func_emit_cwrapperexe_src
  3668. +# emit the source code for a wrapper executable on stdout
  3669. +# Must ONLY be called from within func_mode_link because
  3670. +# it depends on a number of variable set therein.
  3671. +func_emit_cwrapperexe_src ()
  3672. +{
  3673. + cat <<EOF
  3674. +
  3675. +/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  3676. + Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  3677. +
  3678. + The $output program cannot be directly executed until all the libtool
  3679. + libraries that it depends on are installed.
  3680. +
  3681. + This wrapper executable should never be moved out of the build directory.
  3682. + If it is, it will not operate correctly.
  3683. +
  3684. + Currently, it simply execs the wrapper *script* "$SHELL $output",
  3685. + but could eventually absorb all of the scripts functionality and
  3686. + exec $objdir/$outputname directly.
  3687. +*/
  3688. +EOF
  3689. + cat <<"EOF"
  3690. +#include <stdio.h>
  3691. +#include <stdlib.h>
  3692. +#ifdef _MSC_VER
  3693. +# include <direct.h>
  3694. +# include <process.h>
  3695. +# include <io.h>
  3696. +# define setmode _setmode
  3697. +#else
  3698. +# include <unistd.h>
  3699. +# include <stdint.h>
  3700. +# ifdef __CYGWIN__
  3701. +# include <io.h>
  3702. +# define HAVE_SETENV
  3703. +# ifdef __STRICT_ANSI__
  3704. +char *realpath (const char *, char *);
  3705. +int putenv (char *);
  3706. +int setenv (const char *, const char *, int);
  3707. +# endif
  3708. +# endif
  3709. +#endif
  3710. +#include <malloc.h>
  3711. +#include <stdarg.h>
  3712. +#include <assert.h>
  3713. +#include <string.h>
  3714. +#include <ctype.h>
  3715. +#include <errno.h>
  3716. +#include <fcntl.h>
  3717. +#include <sys/stat.h>
  3718. +
  3719. +#if defined(PATH_MAX)
  3720. +# define LT_PATHMAX PATH_MAX
  3721. +#elif defined(MAXPATHLEN)
  3722. +# define LT_PATHMAX MAXPATHLEN
  3723. +#else
  3724. +# define LT_PATHMAX 1024
  3725. +#endif
  3726. +
  3727. +#ifndef S_IXOTH
  3728. +# define S_IXOTH 0
  3729. +#endif
  3730. +#ifndef S_IXGRP
  3731. +# define S_IXGRP 0
  3732. +#endif
  3733. +
  3734. +#ifdef _MSC_VER
  3735. +# define S_IXUSR _S_IEXEC
  3736. +# define stat _stat
  3737. +# ifndef _INTPTR_T_DEFINED
  3738. +# define intptr_t int
  3739. +# endif
  3740. +#endif
  3741. +
  3742. +#ifndef DIR_SEPARATOR
  3743. +# define DIR_SEPARATOR '/'
  3744. +# define PATH_SEPARATOR ':'
  3745. +#endif
  3746. +
  3747. +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  3748. + defined (__OS2__)
  3749. +# define HAVE_DOS_BASED_FILE_SYSTEM
  3750. +# define FOPEN_WB "wb"
  3751. +# ifndef DIR_SEPARATOR_2
  3752. +# define DIR_SEPARATOR_2 '\\'
  3753. +# endif
  3754. +# ifndef PATH_SEPARATOR_2
  3755. +# define PATH_SEPARATOR_2 ';'
  3756. +# endif
  3757. +#endif
  3758. +
  3759. +#ifndef DIR_SEPARATOR_2
  3760. +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  3761. +#else /* DIR_SEPARATOR_2 */
  3762. +# define IS_DIR_SEPARATOR(ch) \
  3763. + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  3764. +#endif /* DIR_SEPARATOR_2 */
  3765. +
  3766. +#ifndef PATH_SEPARATOR_2
  3767. +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  3768. +#else /* PATH_SEPARATOR_2 */
  3769. +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  3770. +#endif /* PATH_SEPARATOR_2 */
  3771. +
  3772. +#ifdef __CYGWIN__
  3773. +# define FOPEN_WB "wb"
  3774. +#endif
  3775. +
  3776. +#ifndef FOPEN_WB
  3777. +# define FOPEN_WB "w"
  3778. +#endif
  3779. +#ifndef _O_BINARY
  3780. +# define _O_BINARY 0
  3781. +#endif
  3782. +
  3783. +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  3784. +#define XFREE(stale) do { \
  3785. + if (stale) { free ((void *) stale); stale = 0; } \
  3786. +} while (0)
  3787. +
  3788. +#undef LTWRAPPER_DEBUGPRINTF
  3789. +#if defined DEBUGWRAPPER
  3790. +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
  3791. +static void
  3792. +ltwrapper_debugprintf (const char *fmt, ...)
  3793. +{
  3794. + va_list args;
  3795. + va_start (args, fmt);
  3796. + (void) vfprintf (stderr, fmt, args);
  3797. + va_end (args);
  3798. +}
  3799. +#else
  3800. +# define LTWRAPPER_DEBUGPRINTF(args)
  3801. +#endif
  3802. +
  3803. +const char *program_name = NULL;
  3804. +
  3805. +void *xmalloc (size_t num);
  3806. +char *xstrdup (const char *string);
  3807. +const char *base_name (const char *name);
  3808. +char *find_executable (const char *wrapper);
  3809. +char *chase_symlinks (const char *pathspec);
  3810. +int make_executable (const char *path);
  3811. +int check_executable (const char *path);
  3812. +char *strendzap (char *str, const char *pat);
  3813. +void lt_fatal (const char *message, ...);
  3814. +void lt_setenv (const char *name, const char *value);
  3815. +char *lt_extend_str (const char *orig_value, const char *add, int to_end);
  3816. +void lt_opt_process_env_set (const char *arg);
  3817. +void lt_opt_process_env_prepend (const char *arg);
  3818. +void lt_opt_process_env_append (const char *arg);
  3819. +int lt_split_name_value (const char *arg, char** name, char** value);
  3820. +void lt_update_exe_path (const char *name, const char *value);
  3821. +void lt_update_lib_path (const char *name, const char *value);
  3822. +
  3823. +static const char *script_text_part1 =
  3824. +EOF
  3825. +
  3826. + func_emit_wrapper_part1 yes |
  3827. + $SED -e 's/\([\\"]\)/\\\1/g' \
  3828. + -e 's/^/ "/' -e 's/$/\\n"/'
  3829. + echo ";"
  3830. + cat <<EOF
  3831. +
  3832. +static const char *script_text_part2 =
  3833. +EOF
  3834. + func_emit_wrapper_part2 yes |
  3835. + $SED -e 's/\([\\"]\)/\\\1/g' \
  3836. + -e 's/^/ "/' -e 's/$/\\n"/'
  3837. + echo ";"
  3838. +
  3839. + cat <<EOF
  3840. +const char * MAGIC_EXE = "$magic_exe";
  3841. +const char * LIB_PATH_VARNAME = "$shlibpath_var";
  3842. +EOF
  3843. +
  3844. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3845. + func_to_host_pathlist "$temp_rpath"
  3846. + cat <<EOF
  3847. +const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
  3848. +EOF
  3849. + else
  3850. + cat <<"EOF"
  3851. +const char * LIB_PATH_VALUE = "";
  3852. +EOF
  3853. + fi
  3854. +
  3855. + if test -n "$dllsearchpath"; then
  3856. + func_to_host_pathlist "$dllsearchpath:"
  3857. + cat <<EOF
  3858. +const char * EXE_PATH_VARNAME = "PATH";
  3859. +const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
  3860. +EOF
  3861. + else
  3862. + cat <<"EOF"
  3863. +const char * EXE_PATH_VARNAME = "";
  3864. +const char * EXE_PATH_VALUE = "";
  3865. +EOF
  3866. + fi
  3867. +
  3868. + if test "$fast_install" = yes; then
  3869. + cat <<EOF
  3870. +const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
  3871. +EOF
  3872. + else
  3873. + cat <<EOF
  3874. +const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
  3875. +EOF
  3876. + fi
  3877. +
  3878. +
  3879. + cat <<"EOF"
  3880. +
  3881. +#define LTWRAPPER_OPTION_PREFIX "--lt-"
  3882. +#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
  3883. +
  3884. +static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
  3885. +static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
  3886. +
  3887. +static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
  3888. +
  3889. +static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
  3890. +static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
  3891. + /* argument is putenv-style "foo=bar", value of foo is set to bar */
  3892. +
  3893. +static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
  3894. +static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
  3895. + /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
  3896. +
  3897. +static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
  3898. +static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
  3899. + /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
  3900. +
  3901. +int
  3902. +main (int argc, char *argv[])
  3903. +{
  3904. + char **newargz;
  3905. + int newargc;
  3906. + char *tmp_pathspec;
  3907. + char *actual_cwrapper_path;
  3908. + char *actual_cwrapper_name;
  3909. + char *target_name;
  3910. + char *lt_argv_zero;
  3911. + intptr_t rval = 127;
  3912. +
  3913. + int i;
  3914. +
  3915. + program_name = (char *) xstrdup (base_name (argv[0]));
  3916. + LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
  3917. + LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
  3918. +
  3919. + /* very simple arg parsing; don't want to rely on getopt */
  3920. + for (i = 1; i < argc; i++)
  3921. + {
  3922. + if (strcmp (argv[i], dumpscript_opt) == 0)
  3923. + {
  3924. +EOF
  3925. + case "$host" in
  3926. + *mingw* | *cygwin* )
  3927. + # make stdout use "unix" line endings
  3928. + echo " setmode(1,_O_BINARY);"
  3929. + ;;
  3930. + esac
  3931. +
  3932. + cat <<"EOF"
  3933. + printf ("%s", script_text_part1);
  3934. + printf ("%s", script_text_part2);
  3935. + return 0;
  3936. + }
  3937. + }
  3938. +
  3939. + newargz = XMALLOC (char *, argc + 1);
  3940. + tmp_pathspec = find_executable (argv[0]);
  3941. + if (tmp_pathspec == NULL)
  3942. + lt_fatal ("Couldn't find %s", argv[0]);
  3943. + LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
  3944. + tmp_pathspec));
  3945. +
  3946. + actual_cwrapper_path = chase_symlinks (tmp_pathspec);
  3947. + LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
  3948. + actual_cwrapper_path));
  3949. + XFREE (tmp_pathspec);
  3950. +
  3951. + actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
  3952. + strendzap (actual_cwrapper_path, actual_cwrapper_name);
  3953. +
  3954. + /* wrapper name transforms */
  3955. + strendzap (actual_cwrapper_name, ".exe");
  3956. + tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
  3957. + XFREE (actual_cwrapper_name);
  3958. + actual_cwrapper_name = tmp_pathspec;
  3959. + tmp_pathspec = 0;
  3960. +
  3961. + /* target_name transforms -- use actual target program name; might have lt- prefix */
  3962. + target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
  3963. + strendzap (target_name, ".exe");
  3964. + tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
  3965. + XFREE (target_name);
  3966. + target_name = tmp_pathspec;
  3967. + tmp_pathspec = 0;
  3968. +
  3969. + LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
  3970. + target_name));
  3971. +EOF
  3972. +
  3973. + cat <<EOF
  3974. + newargz[0] =
  3975. + XMALLOC (char, (strlen (actual_cwrapper_path) +
  3976. + strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
  3977. + strcpy (newargz[0], actual_cwrapper_path);
  3978. + strcat (newargz[0], "$objdir");
  3979. + strcat (newargz[0], "/");
  3980. +EOF
  3981. +
  3982. + cat <<"EOF"
  3983. + /* stop here, and copy so we don't have to do this twice */
  3984. + tmp_pathspec = xstrdup (newargz[0]);
  3985. +
  3986. + /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
  3987. + strcat (newargz[0], actual_cwrapper_name);
  3988. +
  3989. + /* DO want the lt- prefix here if it exists, so use target_name */
  3990. + lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
  3991. + XFREE (tmp_pathspec);
  3992. + tmp_pathspec = NULL;
  3993. +EOF
  3994. +
  3995. + case $host_os in
  3996. + mingw*)
  3997. + cat <<"EOF"
  3998. + {
  3999. + char* p;
  4000. + while ((p = strchr (newargz[0], '\\')) != NULL)
  4001. + {
  4002. + *p = '/';
  4003. + }
  4004. + while ((p = strchr (lt_argv_zero, '\\')) != NULL)
  4005. + {
  4006. + *p = '/';
  4007. + }
  4008. + }
  4009. +EOF
  4010. + ;;
  4011. + esac
  4012. +
  4013. + cat <<"EOF"
  4014. + XFREE (target_name);
  4015. + XFREE (actual_cwrapper_path);
  4016. + XFREE (actual_cwrapper_name);
  4017. +
  4018. + lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
  4019. + lt_setenv ("DUALCASE", "1"); /* for MSK sh */
  4020. + lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
  4021. + lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
  4022. +
  4023. + newargc=0;
  4024. + for (i = 1; i < argc; i++)
  4025. + {
  4026. + if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
  4027. + {
  4028. + if (argv[i][env_set_opt_len] == '=')
  4029. + {
  4030. + const char *p = argv[i] + env_set_opt_len + 1;
  4031. + lt_opt_process_env_set (p);
  4032. + }
  4033. + else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
  4034. + {
  4035. + lt_opt_process_env_set (argv[++i]); /* don't copy */
  4036. + }
  4037. + else
  4038. + lt_fatal ("%s missing required argument", env_set_opt);
  4039. + continue;
  4040. + }
  4041. + if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
  4042. + {
  4043. + if (argv[i][env_prepend_opt_len] == '=')
  4044. + {
  4045. + const char *p = argv[i] + env_prepend_opt_len + 1;
  4046. + lt_opt_process_env_prepend (p);
  4047. + }
  4048. + else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
  4049. + {
  4050. + lt_opt_process_env_prepend (argv[++i]); /* don't copy */
  4051. + }
  4052. + else
  4053. + lt_fatal ("%s missing required argument", env_prepend_opt);
  4054. + continue;
  4055. + }
  4056. + if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
  4057. + {
  4058. + if (argv[i][env_append_opt_len] == '=')
  4059. + {
  4060. + const char *p = argv[i] + env_append_opt_len + 1;
  4061. + lt_opt_process_env_append (p);
  4062. + }
  4063. + else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
  4064. + {
  4065. + lt_opt_process_env_append (argv[++i]); /* don't copy */
  4066. + }
  4067. + else
  4068. + lt_fatal ("%s missing required argument", env_append_opt);
  4069. + continue;
  4070. + }
  4071. + if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
  4072. + {
  4073. + /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
  4074. + namespace, but it is not one of the ones we know about and
  4075. + have already dealt with, above (inluding dump-script), then
  4076. + report an error. Otherwise, targets might begin to believe
  4077. + they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
  4078. + namespace. The first time any user complains about this, we'll
  4079. + need to make LTWRAPPER_OPTION_PREFIX a configure-time option
  4080. + or a configure.ac-settable value.
  4081. + */
  4082. + lt_fatal ("Unrecognized option in %s namespace: '%s'",
  4083. + ltwrapper_option_prefix, argv[i]);
  4084. + }
  4085. + /* otherwise ... */
  4086. + newargz[++newargc] = xstrdup (argv[i]);
  4087. + }
  4088. + newargz[++newargc] = NULL;
  4089. +
  4090. + LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
  4091. + for (i = 0; i < newargc; i++)
  4092. + {
  4093. + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
  4094. + }
  4095. +
  4096. +EOF
  4097. +
  4098. + case $host_os in
  4099. + mingw*)
  4100. + cat <<"EOF"
  4101. + /* execv doesn't actually work on mingw as expected on unix */
  4102. + rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
  4103. + if (rval == -1)
  4104. + {
  4105. + /* failed to start process */
  4106. + LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
  4107. + return 127;
  4108. + }
  4109. + return rval;
  4110. +EOF
  4111. + ;;
  4112. + *)
  4113. + cat <<"EOF"
  4114. + execv (lt_argv_zero, newargz);
  4115. + return rval; /* =127, but avoids unused variable warning */
  4116. +EOF
  4117. + ;;
  4118. + esac
  4119. +
  4120. + cat <<"EOF"
  4121. +}
  4122. +
  4123. +void *
  4124. +xmalloc (size_t num)
  4125. +{
  4126. + void *p = (void *) malloc (num);
  4127. + if (!p)
  4128. + lt_fatal ("Memory exhausted");
  4129. +
  4130. + return p;
  4131. +}
  4132. +
  4133. +char *
  4134. +xstrdup (const char *string)
  4135. +{
  4136. + return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
  4137. + string) : NULL;
  4138. +}
  4139. +
  4140. +const char *
  4141. +base_name (const char *name)
  4142. +{
  4143. + const char *base;
  4144. +
  4145. +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4146. + /* Skip over the disk name in MSDOS pathnames. */
  4147. + if (isalpha ((unsigned char) name[0]) && name[1] == ':')
  4148. + name += 2;
  4149. +#endif
  4150. +
  4151. + for (base = name; *name; name++)
  4152. + if (IS_DIR_SEPARATOR (*name))
  4153. + base = name + 1;
  4154. + return base;
  4155. +}
  4156. +
  4157. +int
  4158. +check_executable (const char *path)
  4159. +{
  4160. + struct stat st;
  4161. +
  4162. + LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
  4163. + path ? (*path ? path : "EMPTY!") : "NULL!"));
  4164. + if ((!path) || (!*path))
  4165. + return 0;
  4166. +
  4167. + if ((stat (path, &st) >= 0)
  4168. + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
  4169. + return 1;
  4170. + else
  4171. + return 0;
  4172. +}
  4173. +
  4174. +int
  4175. +make_executable (const char *path)
  4176. +{
  4177. + int rval = 0;
  4178. + struct stat st;
  4179. +
  4180. + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
  4181. + path ? (*path ? path : "EMPTY!") : "NULL!"));
  4182. + if ((!path) || (!*path))
  4183. + return 0;
  4184. +
  4185. + if (stat (path, &st) >= 0)
  4186. + {
  4187. + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
  4188. + }
  4189. + return rval;
  4190. +}
  4191. +
  4192. +/* Searches for the full path of the wrapper. Returns
  4193. + newly allocated full path name if found, NULL otherwise
  4194. + Does not chase symlinks, even on platforms that support them.
  4195. +*/
  4196. +char *
  4197. +find_executable (const char *wrapper)
  4198. +{
  4199. + int has_slash = 0;
  4200. + const char *p;
  4201. + const char *p_next;
  4202. + /* static buffer for getcwd */
  4203. + char tmp[LT_PATHMAX + 1];
  4204. + int tmp_len;
  4205. + char *concat_name;
  4206. +
  4207. + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
  4208. + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
  4209. +
  4210. + if ((wrapper == NULL) || (*wrapper == '\0'))
  4211. + return NULL;
  4212. +
  4213. + /* Absolute path? */
  4214. +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4215. + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
  4216. + {
  4217. + concat_name = xstrdup (wrapper);
  4218. + if (check_executable (concat_name))
  4219. + return concat_name;
  4220. + XFREE (concat_name);
  4221. + }
  4222. + else
  4223. + {
  4224. +#endif
  4225. + if (IS_DIR_SEPARATOR (wrapper[0]))
  4226. + {
  4227. + concat_name = xstrdup (wrapper);
  4228. + if (check_executable (concat_name))
  4229. + return concat_name;
  4230. + XFREE (concat_name);
  4231. + }
  4232. +#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  4233. + }
  4234. +#endif
  4235. +
  4236. + for (p = wrapper; *p; p++)
  4237. + if (*p == '/')
  4238. + {
  4239. + has_slash = 1;
  4240. + break;
  4241. + }
  4242. + if (!has_slash)
  4243. + {
  4244. + /* no slashes; search PATH */
  4245. + const char *path = getenv ("PATH");
  4246. + if (path != NULL)
  4247. + {
  4248. + for (p = path; *p; p = p_next)
  4249. + {
  4250. + const char *q;
  4251. + size_t p_len;
  4252. + for (q = p; *q; q++)
  4253. + if (IS_PATH_SEPARATOR (*q))
  4254. + break;
  4255. + p_len = q - p;
  4256. + p_next = (*q == '\0' ? q : q + 1);
  4257. + if (p_len == 0)
  4258. + {
  4259. + /* empty path: current directory */
  4260. + if (getcwd (tmp, LT_PATHMAX) == NULL)
  4261. + lt_fatal ("getcwd failed");
  4262. + tmp_len = strlen (tmp);
  4263. + concat_name =
  4264. + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  4265. + memcpy (concat_name, tmp, tmp_len);
  4266. + concat_name[tmp_len] = '/';
  4267. + strcpy (concat_name + tmp_len + 1, wrapper);
  4268. + }
  4269. + else
  4270. + {
  4271. + concat_name =
  4272. + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
  4273. + memcpy (concat_name, p, p_len);
  4274. + concat_name[p_len] = '/';
  4275. + strcpy (concat_name + p_len + 1, wrapper);
  4276. + }
  4277. + if (check_executable (concat_name))
  4278. + return concat_name;
  4279. + XFREE (concat_name);
  4280. + }
  4281. + }
  4282. + /* not found in PATH; assume curdir */
  4283. + }
  4284. + /* Relative path | not found in path: prepend cwd */
  4285. + if (getcwd (tmp, LT_PATHMAX) == NULL)
  4286. + lt_fatal ("getcwd failed");
  4287. + tmp_len = strlen (tmp);
  4288. + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
  4289. + memcpy (concat_name, tmp, tmp_len);
  4290. + concat_name[tmp_len] = '/';
  4291. + strcpy (concat_name + tmp_len + 1, wrapper);
  4292. +
  4293. + if (check_executable (concat_name))
  4294. + return concat_name;
  4295. + XFREE (concat_name);
  4296. + return NULL;
  4297. +}
  4298. +
  4299. +char *
  4300. +chase_symlinks (const char *pathspec)
  4301. +{
  4302. +#ifndef S_ISLNK
  4303. + return xstrdup (pathspec);
  4304. +#else
  4305. + char buf[LT_PATHMAX];
  4306. + struct stat s;
  4307. + char *tmp_pathspec = xstrdup (pathspec);
  4308. + char *p;
  4309. + int has_symlinks = 0;
  4310. + while (strlen (tmp_pathspec) && !has_symlinks)
  4311. + {
  4312. + LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
  4313. + tmp_pathspec));
  4314. + if (lstat (tmp_pathspec, &s) == 0)
  4315. + {
  4316. + if (S_ISLNK (s.st_mode) != 0)
  4317. + {
  4318. + has_symlinks = 1;
  4319. + break;
  4320. + }
  4321. +
  4322. + /* search backwards for last DIR_SEPARATOR */
  4323. + p = tmp_pathspec + strlen (tmp_pathspec) - 1;
  4324. + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  4325. + p--;
  4326. + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
  4327. + {
  4328. + /* no more DIR_SEPARATORS left */
  4329. + break;
  4330. + }
  4331. + *p = '\0';
  4332. + }
  4333. + else
  4334. + {
  4335. + char *errstr = strerror (errno);
  4336. + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
  4337. + }
  4338. + }
  4339. + XFREE (tmp_pathspec);
  4340. +
  4341. + if (!has_symlinks)
  4342. + {
  4343. + return xstrdup (pathspec);
  4344. + }
  4345. +
  4346. + tmp_pathspec = realpath (pathspec, buf);
  4347. + if (tmp_pathspec == 0)
  4348. + {
  4349. + lt_fatal ("Could not follow symlinks for %s", pathspec);
  4350. + }
  4351. + return xstrdup (tmp_pathspec);
  4352. +#endif
  4353. +}
  4354. +
  4355. +char *
  4356. +strendzap (char *str, const char *pat)
  4357. +{
  4358. + size_t len, patlen;
  4359. +
  4360. + assert (str != NULL);
  4361. + assert (pat != NULL);
  4362. +
  4363. + len = strlen (str);
  4364. + patlen = strlen (pat);
  4365. +
  4366. + if (patlen <= len)
  4367. + {
  4368. + str += len - patlen;
  4369. + if (strcmp (str, pat) == 0)
  4370. + *str = '\0';
  4371. + }
  4372. + return str;
  4373. +}
  4374. +
  4375. +static void
  4376. +lt_error_core (int exit_status, const char *mode,
  4377. + const char *message, va_list ap)
  4378. +{
  4379. + fprintf (stderr, "%s: %s: ", program_name, mode);
  4380. + vfprintf (stderr, message, ap);
  4381. + fprintf (stderr, ".\n");
  4382. +
  4383. + if (exit_status >= 0)
  4384. + exit (exit_status);
  4385. +}
  4386. +
  4387. +void
  4388. +lt_fatal (const char *message, ...)
  4389. +{
  4390. + va_list ap;
  4391. + va_start (ap, message);
  4392. + lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  4393. + va_end (ap);
  4394. +}
  4395. +
  4396. +void
  4397. +lt_setenv (const char *name, const char *value)
  4398. +{
  4399. + LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
  4400. + (name ? name : "<NULL>"),
  4401. + (value ? value : "<NULL>")));
  4402. + {
  4403. +#ifdef HAVE_SETENV
  4404. + /* always make a copy, for consistency with !HAVE_SETENV */
  4405. + char *str = xstrdup (value);
  4406. + setenv (name, str, 1);
  4407. +#else
  4408. + int len = strlen (name) + 1 + strlen (value) + 1;
  4409. + char *str = XMALLOC (char, len);
  4410. + sprintf (str, "%s=%s", name, value);
  4411. + if (putenv (str) != EXIT_SUCCESS)
  4412. + {
  4413. + XFREE (str);
  4414. + }
  4415. +#endif
  4416. + }
  4417. +}
  4418. +
  4419. +char *
  4420. +lt_extend_str (const char *orig_value, const char *add, int to_end)
  4421. +{
  4422. + char *new_value;
  4423. + if (orig_value && *orig_value)
  4424. + {
  4425. + int orig_value_len = strlen (orig_value);
  4426. + int add_len = strlen (add);
  4427. + new_value = XMALLOC (char, add_len + orig_value_len + 1);
  4428. + if (to_end)
  4429. + {
  4430. + strcpy (new_value, orig_value);
  4431. + strcpy (new_value + orig_value_len, add);
  4432. + }
  4433. + else
  4434. + {
  4435. + strcpy (new_value, add);
  4436. + strcpy (new_value + add_len, orig_value);
  4437. + }
  4438. + }
  4439. + else
  4440. + {
  4441. + new_value = xstrdup (add);
  4442. + }
  4443. + return new_value;
  4444. +}
  4445. +
  4446. +int
  4447. +lt_split_name_value (const char *arg, char** name, char** value)
  4448. +{
  4449. + const char *p;
  4450. + int len;
  4451. + if (!arg || !*arg)
  4452. + return 1;
  4453. +
  4454. + p = strchr (arg, (int)'=');
  4455. +
  4456. + if (!p)
  4457. + return 1;
  4458. +
  4459. + *value = xstrdup (++p);
  4460. +
  4461. + len = strlen (arg) - strlen (*value);
  4462. + *name = XMALLOC (char, len);
  4463. + strncpy (*name, arg, len-1);
  4464. + (*name)[len - 1] = '\0';
  4465. +
  4466. + return 0;
  4467. +}
  4468. +
  4469. +void
  4470. +lt_opt_process_env_set (const char *arg)
  4471. +{
  4472. + char *name = NULL;
  4473. + char *value = NULL;
  4474. +
  4475. + if (lt_split_name_value (arg, &name, &value) != 0)
  4476. + {
  4477. + XFREE (name);
  4478. + XFREE (value);
  4479. + lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
  4480. + }
  4481. +
  4482. + lt_setenv (name, value);
  4483. + XFREE (name);
  4484. + XFREE (value);
  4485. +}
  4486. +
  4487. +void
  4488. +lt_opt_process_env_prepend (const char *arg)
  4489. +{
  4490. + char *name = NULL;
  4491. + char *value = NULL;
  4492. + char *new_value = NULL;
  4493. +
  4494. + if (lt_split_name_value (arg, &name, &value) != 0)
  4495. + {
  4496. + XFREE (name);
  4497. + XFREE (value);
  4498. + lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
  4499. + }
  4500. +
  4501. + new_value = lt_extend_str (getenv (name), value, 0);
  4502. + lt_setenv (name, new_value);
  4503. + XFREE (new_value);
  4504. + XFREE (name);
  4505. + XFREE (value);
  4506. +}
  4507. +
  4508. +void
  4509. +lt_opt_process_env_append (const char *arg)
  4510. +{
  4511. + char *name = NULL;
  4512. + char *value = NULL;
  4513. + char *new_value = NULL;
  4514. +
  4515. + if (lt_split_name_value (arg, &name, &value) != 0)
  4516. + {
  4517. + XFREE (name);
  4518. + XFREE (value);
  4519. + lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
  4520. + }
  4521. +
  4522. + new_value = lt_extend_str (getenv (name), value, 1);
  4523. + lt_setenv (name, new_value);
  4524. + XFREE (new_value);
  4525. + XFREE (name);
  4526. + XFREE (value);
  4527. +}
  4528. +
  4529. +void
  4530. +lt_update_exe_path (const char *name, const char *value)
  4531. +{
  4532. + LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
  4533. + (name ? name : "<NULL>"),
  4534. + (value ? value : "<NULL>")));
  4535. +
  4536. + if (name && *name && value && *value)
  4537. + {
  4538. + char *new_value = lt_extend_str (getenv (name), value, 0);
  4539. + /* some systems can't cope with a ':'-terminated path #' */
  4540. + int len = strlen (new_value);
  4541. + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
  4542. + {
  4543. + new_value[len-1] = '\0';
  4544. + }
  4545. + lt_setenv (name, new_value);
  4546. + XFREE (new_value);
  4547. + }
  4548. +}
  4549. +
  4550. +void
  4551. +lt_update_lib_path (const char *name, const char *value)
  4552. +{
  4553. + LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
  4554. + (name ? name : "<NULL>"),
  4555. + (value ? value : "<NULL>")));
  4556. +
  4557. + if (name && *name && value && *value)
  4558. + {
  4559. + char *new_value = lt_extend_str (getenv (name), value, 0);
  4560. + lt_setenv (name, new_value);
  4561. + XFREE (new_value);
  4562. + }
  4563. +}
  4564. +
  4565. +
  4566. +EOF
  4567. +}
  4568. +# end: func_emit_cwrapperexe_src
  4569. +
  4570. +# func_mode_link arg...
  4571. +func_mode_link ()
  4572. +{
  4573. + $opt_debug
  4574. + case $host in
  4575. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  4576. # It is impossible to link a dll without this setting, and
  4577. # we shouldn't force the makefile maintainer to figure out
  4578. # which system we are compiling for in order to pass an extra
  4579. @@ -1121,10 +4058,10 @@ EOF
  4580. allow_undefined=yes
  4581. ;;
  4582. esac
  4583. - libtool_args="$nonopt"
  4584. + libtool_args=$nonopt
  4585. base_compile="$nonopt $@"
  4586. - compile_command="$nonopt"
  4587. - finalize_command="$nonopt"
  4588. + compile_command=$nonopt
  4589. + finalize_command=$nonopt
  4590. compile_rpath=
  4591. finalize_rpath=
  4592. @@ -1139,6 +4076,7 @@ EOF
  4593. dllsearchpath=
  4594. lib_search_path=`pwd`
  4595. inst_prefix_dir=
  4596. + new_inherited_linker_flags=
  4597. avoid_version=no
  4598. dlfiles=
  4599. @@ -1154,7 +4092,6 @@ EOF
  4600. no_install=no
  4601. objs=
  4602. non_pic_objects=
  4603. - notinst_path= # paths that contain not-installed libtool libraries
  4604. precious_files_regex=
  4605. prefer_static_libs=no
  4606. preload=no
  4607. @@ -1168,19 +4105,25 @@ EOF
  4608. thread_safe=no
  4609. vinfo=
  4610. vinfo_number=no
  4611. + weak_libs=
  4612. single_module="${wl}-single_module"
  4613. -
  4614. func_infer_tag $base_compile
  4615. # We need to know -static, to get the right output filenames.
  4616. for arg
  4617. do
  4618. case $arg in
  4619. + -shared)
  4620. + test "$build_libtool_libs" != yes && \
  4621. + func_fatal_configuration "can not build a shared library"
  4622. + build_old_libs=no
  4623. + break
  4624. + ;;
  4625. -all-static | -static | -static-libtool-libs)
  4626. case $arg in
  4627. -all-static)
  4628. if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  4629. - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  4630. + func_warning "complete static linking is impossible in this configuration"
  4631. fi
  4632. if test -n "$link_static_flag"; then
  4633. dlopen_self=$dlopen_self_static
  4634. @@ -1214,20 +4157,16 @@ EOF
  4635. while test "$#" -gt 0; do
  4636. arg="$1"
  4637. shift
  4638. - case $arg in
  4639. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  4640. - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
  4641. - ;;
  4642. - *) qarg=$arg ;;
  4643. - esac
  4644. - libtool_args="$libtool_args $qarg"
  4645. + func_quote_for_eval "$arg"
  4646. + qarg=$func_quote_for_eval_unquoted_result
  4647. + func_append libtool_args " $func_quote_for_eval_result"
  4648. # If the previous option needs an argument, assign it.
  4649. if test -n "$prev"; then
  4650. case $prev in
  4651. output)
  4652. - compile_command="$compile_command @OUTPUT@"
  4653. - finalize_command="$finalize_command @OUTPUT@"
  4654. + func_append compile_command " @OUTPUT@"
  4655. + func_append finalize_command " @OUTPUT@"
  4656. ;;
  4657. esac
  4658. @@ -1235,8 +4174,8 @@ EOF
  4659. dlfiles|dlprefiles)
  4660. if test "$preload" = no; then
  4661. # Add the symbol object into the linking commands.
  4662. - compile_command="$compile_command @SYMFILE@"
  4663. - finalize_command="$finalize_command @SYMFILE@"
  4664. + func_append compile_command " @SYMFILE@"
  4665. + func_append finalize_command " @SYMFILE@"
  4666. preload=yes
  4667. fi
  4668. case $arg in
  4669. @@ -1274,10 +4213,8 @@ EOF
  4670. ;;
  4671. expsyms)
  4672. export_symbols="$arg"
  4673. - if test ! -f "$arg"; then
  4674. - $echo "$modename: symbol file \`$arg' does not exist"
  4675. - exit $EXIT_FAILURE
  4676. - fi
  4677. + test -f "$arg" \
  4678. + || func_fatal_error "symbol file \`$arg' does not exist"
  4679. prev=
  4680. continue
  4681. ;;
  4682. @@ -1286,18 +4223,21 @@ EOF
  4683. prev=
  4684. continue
  4685. ;;
  4686. - inst_prefix)
  4687. - inst_prefix_dir="$arg"
  4688. - prev=
  4689. - continue
  4690. - ;;
  4691. - precious_regex)
  4692. - precious_files_regex="$arg"
  4693. + framework)
  4694. + case $host in
  4695. + *-*-darwin*)
  4696. + case "$deplibs " in
  4697. + *" $qarg.ltframework "*) ;;
  4698. + *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
  4699. + ;;
  4700. + esac
  4701. + ;;
  4702. + esac
  4703. prev=
  4704. continue
  4705. ;;
  4706. - release)
  4707. - release="-$arg"
  4708. + inst_prefix)
  4709. + inst_prefix_dir="$arg"
  4710. prev=
  4711. continue
  4712. ;;
  4713. @@ -1305,39 +4245,30 @@ EOF
  4714. if test -f "$arg"; then
  4715. save_arg=$arg
  4716. moreargs=
  4717. - for fil in `cat $save_arg`
  4718. + for fil in `cat "$save_arg"`
  4719. do
  4720. # moreargs="$moreargs $fil"
  4721. arg=$fil
  4722. # A libtool-controlled object.
  4723. # Check to see that this really is a libtool object.
  4724. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4725. + if func_lalib_unsafe_p "$arg"; then
  4726. pic_object=
  4727. non_pic_object=
  4728. # Read the .lo file
  4729. - # If there is no directory component, then add one.
  4730. - case $arg in
  4731. - */* | *\\*) . $arg ;;
  4732. - *) . ./$arg ;;
  4733. - esac
  4734. + func_source "$arg"
  4735. - if test -z "$pic_object" || \
  4736. + if test -z "$pic_object" ||
  4737. test -z "$non_pic_object" ||
  4738. - test "$pic_object" = none && \
  4739. + test "$pic_object" = none &&
  4740. test "$non_pic_object" = none; then
  4741. - $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  4742. - exit $EXIT_FAILURE
  4743. + func_fatal_error "cannot find name of object for \`$arg'"
  4744. fi
  4745. # Extract subdirectory from the argument.
  4746. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  4747. - if test "X$xdir" = "X$arg"; then
  4748. - xdir=
  4749. - else
  4750. - xdir="$xdir/"
  4751. - fi
  4752. + func_dirname "$arg" "/" ""
  4753. + xdir="$func_dirname_result"
  4754. if test "$pic_object" != none; then
  4755. # Prepend the subdirectory the object is found in.
  4756. @@ -1362,7 +4293,7 @@ EOF
  4757. fi
  4758. # A PIC object.
  4759. - libobjs="$libobjs $pic_object"
  4760. + func_append libobjs " $pic_object"
  4761. arg="$pic_object"
  4762. fi
  4763. @@ -1372,7 +4303,7 @@ EOF
  4764. non_pic_object="$xdir$non_pic_object"
  4765. # A standard non-PIC object
  4766. - non_pic_objects="$non_pic_objects $non_pic_object"
  4767. + func_append non_pic_objects " $non_pic_object"
  4768. if test -z "$pic_object" || test "$pic_object" = none ; then
  4769. arg="$non_pic_object"
  4770. fi
  4771. @@ -1380,46 +4311,48 @@ EOF
  4772. # If the PIC object exists, use it instead.
  4773. # $xdir was prepended to $pic_object above.
  4774. non_pic_object="$pic_object"
  4775. - non_pic_objects="$non_pic_objects $non_pic_object"
  4776. + func_append non_pic_objects " $non_pic_object"
  4777. fi
  4778. else
  4779. # Only an error if not doing a dry-run.
  4780. - if test -z "$run"; then
  4781. - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  4782. - exit $EXIT_FAILURE
  4783. - else
  4784. - # Dry-run case.
  4785. -
  4786. + if $opt_dry_run; then
  4787. # Extract subdirectory from the argument.
  4788. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  4789. - if test "X$xdir" = "X$arg"; then
  4790. - xdir=
  4791. - else
  4792. - xdir="$xdir/"
  4793. - fi
  4794. + func_dirname "$arg" "/" ""
  4795. + xdir="$func_dirname_result"
  4796. - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  4797. - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  4798. - libobjs="$libobjs $pic_object"
  4799. - non_pic_objects="$non_pic_objects $non_pic_object"
  4800. + func_lo2o "$arg"
  4801. + pic_object=$xdir$objdir/$func_lo2o_result
  4802. + non_pic_object=$xdir$func_lo2o_result
  4803. + func_append libobjs " $pic_object"
  4804. + func_append non_pic_objects " $non_pic_object"
  4805. + else
  4806. + func_fatal_error "\`$arg' is not a valid libtool object"
  4807. fi
  4808. fi
  4809. done
  4810. else
  4811. - $echo "$modename: link input file \`$save_arg' does not exist"
  4812. - exit $EXIT_FAILURE
  4813. + func_fatal_error "link input file \`$arg' does not exist"
  4814. fi
  4815. arg=$save_arg
  4816. prev=
  4817. continue
  4818. ;;
  4819. + precious_regex)
  4820. + precious_files_regex="$arg"
  4821. + prev=
  4822. + continue
  4823. + ;;
  4824. + release)
  4825. + release="-$arg"
  4826. + prev=
  4827. + continue
  4828. + ;;
  4829. rpath | xrpath)
  4830. # We need an absolute path.
  4831. case $arg in
  4832. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4833. *)
  4834. - $echo "$modename: only absolute run-paths are allowed" 1>&2
  4835. - exit $EXIT_FAILURE
  4836. + func_fatal_error "only absolute run-paths are allowed"
  4837. ;;
  4838. esac
  4839. if test "$prev" = rpath; then
  4840. @@ -1436,39 +4369,37 @@ EOF
  4841. prev=
  4842. continue
  4843. ;;
  4844. - xcompiler)
  4845. - compiler_flags="$compiler_flags $qarg"
  4846. + shrext)
  4847. + shrext_cmds="$arg"
  4848. prev=
  4849. - compile_command="$compile_command $qarg"
  4850. - finalize_command="$finalize_command $qarg"
  4851. continue
  4852. ;;
  4853. - xlinker)
  4854. - linker_flags="$linker_flags $qarg"
  4855. - compiler_flags="$compiler_flags $wl$qarg"
  4856. + weak)
  4857. + weak_libs="$weak_libs $arg"
  4858. prev=
  4859. - compile_command="$compile_command $wl$qarg"
  4860. - finalize_command="$finalize_command $wl$qarg"
  4861. continue
  4862. ;;
  4863. xcclinker)
  4864. linker_flags="$linker_flags $qarg"
  4865. compiler_flags="$compiler_flags $qarg"
  4866. prev=
  4867. - compile_command="$compile_command $qarg"
  4868. - finalize_command="$finalize_command $qarg"
  4869. + func_append compile_command " $qarg"
  4870. + func_append finalize_command " $qarg"
  4871. continue
  4872. ;;
  4873. - shrext)
  4874. - shrext_cmds="$arg"
  4875. + xcompiler)
  4876. + compiler_flags="$compiler_flags $qarg"
  4877. prev=
  4878. + func_append compile_command " $qarg"
  4879. + func_append finalize_command " $qarg"
  4880. continue
  4881. ;;
  4882. - darwin_framework|darwin_framework_skip)
  4883. - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
  4884. - compile_command="$compile_command $arg"
  4885. - finalize_command="$finalize_command $arg"
  4886. + xlinker)
  4887. + linker_flags="$linker_flags $qarg"
  4888. + compiler_flags="$compiler_flags $wl$qarg"
  4889. prev=
  4890. + func_append compile_command " $wl$qarg"
  4891. + func_append finalize_command " $wl$qarg"
  4892. continue
  4893. ;;
  4894. *)
  4895. @@ -1484,16 +4415,16 @@ EOF
  4896. case $arg in
  4897. -all-static)
  4898. if test -n "$link_static_flag"; then
  4899. - compile_command="$compile_command $link_static_flag"
  4900. - finalize_command="$finalize_command $link_static_flag"
  4901. + # See comment for -static flag below, for more details.
  4902. + func_append compile_command " $link_static_flag"
  4903. + func_append finalize_command " $link_static_flag"
  4904. fi
  4905. continue
  4906. ;;
  4907. -allow-undefined)
  4908. # FIXME: remove this flag sometime in the future.
  4909. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
  4910. - continue
  4911. + func_fatal_error "\`-allow-undefined' must not be used because it is the default"
  4912. ;;
  4913. -avoid-version)
  4914. @@ -1518,8 +4449,7 @@ EOF
  4915. -export-symbols | -export-symbols-regex)
  4916. if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  4917. - $echo "$modename: more than one -exported-symbols argument is not allowed"
  4918. - exit $EXIT_FAILURE
  4919. + func_fatal_error "more than one -exported-symbols argument is not allowed"
  4920. fi
  4921. if test "X$arg" = "X-export-symbols"; then
  4922. prev=expsyms
  4923. @@ -1529,15 +4459,8 @@ EOF
  4924. continue
  4925. ;;
  4926. - -framework|-arch|-isysroot)
  4927. - case " $CC " in
  4928. - *" ${arg} ${1} "* | *" ${arg} ${1} "*)
  4929. - prev=darwin_framework_skip ;;
  4930. - *) compiler_flags="$compiler_flags $arg"
  4931. - prev=darwin_framework ;;
  4932. - esac
  4933. - compile_command="$compile_command $arg"
  4934. - finalize_command="$finalize_command $arg"
  4935. + -framework)
  4936. + prev=framework
  4937. continue
  4938. ;;
  4939. @@ -1551,25 +4474,30 @@ EOF
  4940. -L[A-Z][A-Z]*:*)
  4941. case $with_gcc/$host in
  4942. no/*-*-irix* | /*-*-irix*)
  4943. - compile_command="$compile_command $arg"
  4944. - finalize_command="$finalize_command $arg"
  4945. + func_append compile_command " $arg"
  4946. + func_append finalize_command " $arg"
  4947. ;;
  4948. esac
  4949. continue
  4950. ;;
  4951. -L*)
  4952. - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
  4953. + func_stripname '-L' '' "$arg"
  4954. + dir=$func_stripname_result
  4955. + if test -z "$dir"; then
  4956. + if test "$#" -gt 0; then
  4957. + func_fatal_error "require no space between \`-L' and \`$1'"
  4958. + else
  4959. + func_fatal_error "need path for \`-L' option"
  4960. + fi
  4961. + fi
  4962. # We need an absolute path.
  4963. case $dir in
  4964. [\\/]* | [A-Za-z]:[\\/]*) ;;
  4965. *)
  4966. absdir=`cd "$dir" && pwd`
  4967. - if test -z "$absdir"; then
  4968. - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  4969. - absdir="$dir"
  4970. - notinst_path="$notinst_path $dir"
  4971. - fi
  4972. + test -z "$absdir" && \
  4973. + func_fatal_error "cannot determine absolute directory name of \`$dir'"
  4974. dir="$absdir"
  4975. ;;
  4976. esac
  4977. @@ -1581,14 +4509,16 @@ EOF
  4978. ;;
  4979. esac
  4980. case $host in
  4981. - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  4982. - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  4983. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  4984. + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
  4985. case :$dllsearchpath: in
  4986. *":$dir:"*) ;;
  4987. + ::) dllsearchpath=$dir;;
  4988. *) dllsearchpath="$dllsearchpath:$dir";;
  4989. esac
  4990. case :$dllsearchpath: in
  4991. *":$testbindir:"*) ;;
  4992. + ::) dllsearchpath=$testbindir;;
  4993. *) dllsearchpath="$dllsearchpath:$testbindir";;
  4994. esac
  4995. ;;
  4996. @@ -1599,7 +4529,7 @@ EOF
  4997. -l*)
  4998. if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
  4999. case $host in
  5000. - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
  5001. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
  5002. # These systems don't actually have a C or math library (as such)
  5003. continue
  5004. ;;
  5005. @@ -1613,7 +4543,7 @@ EOF
  5006. ;;
  5007. *-*-rhapsody* | *-*-darwin1.[012])
  5008. # Rhapsody C and math libraries are in the System framework
  5009. - deplibs="$deplibs -framework System"
  5010. + deplibs="$deplibs System.ltframework"
  5011. continue
  5012. ;;
  5013. *-*-sco3.2v5* | *-*-sco5v6*)
  5014. @@ -1637,20 +4567,30 @@ EOF
  5015. continue
  5016. ;;
  5017. + -module)
  5018. + module=yes
  5019. + continue
  5020. + ;;
  5021. +
  5022. # Tru64 UNIX uses -model [arg] to determine the layout of C++
  5023. # classes, name mangling, and exception handling.
  5024. - -model)
  5025. - compile_command="$compile_command $arg"
  5026. + # Darwin uses the -arch flag to determine output architecture.
  5027. + -model|-arch|-isysroot)
  5028. compiler_flags="$compiler_flags $arg"
  5029. - finalize_command="$finalize_command $arg"
  5030. + func_append compile_command " $arg"
  5031. + func_append finalize_command " $arg"
  5032. prev=xcompiler
  5033. continue
  5034. ;;
  5035. - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  5036. + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
  5037. compiler_flags="$compiler_flags $arg"
  5038. - compile_command="$compile_command $arg"
  5039. - finalize_command="$finalize_command $arg"
  5040. + func_append compile_command " $arg"
  5041. + func_append finalize_command " $arg"
  5042. + case "$new_inherited_linker_flags " in
  5043. + *" $arg "*) ;;
  5044. + * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
  5045. + esac
  5046. continue
  5047. ;;
  5048. @@ -1659,44 +4599,6 @@ EOF
  5049. continue
  5050. ;;
  5051. - -module)
  5052. - module=yes
  5053. - continue
  5054. - ;;
  5055. -
  5056. - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  5057. - # -r[0-9][0-9]* specifies the processor on the SGI compiler
  5058. - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  5059. - # +DA*, +DD* enable 64-bit mode on the HP compiler
  5060. - # -q* pass through compiler args for the IBM compiler
  5061. - # -m* pass through architecture-specific compiler args for GCC
  5062. - # -m*, -t[45]*, -txscale* pass through architecture-specific
  5063. - # compiler args for GCC
  5064. - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
  5065. - # -F/path gives path to uninstalled frameworks, gcc on darwin
  5066. - # @file GCC response files
  5067. - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  5068. - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
  5069. -
  5070. - # Unknown arguments in both finalize_command and compile_command need
  5071. - # to be aesthetically quoted because they are evaled later.
  5072. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5073. - case $arg in
  5074. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5075. - arg="\"$arg\""
  5076. - ;;
  5077. - esac
  5078. - compile_command="$compile_command $arg"
  5079. - finalize_command="$finalize_command $arg"
  5080. - compiler_flags="$compiler_flags $arg"
  5081. - continue
  5082. - ;;
  5083. -
  5084. - -shrext)
  5085. - prev=shrext
  5086. - continue
  5087. - ;;
  5088. -
  5089. -no-fast-install)
  5090. fast_install=no
  5091. continue
  5092. @@ -1704,11 +4606,11 @@ EOF
  5093. -no-install)
  5094. case $host in
  5095. - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
  5096. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
  5097. # The PATH hackery in wrapper scripts is required on Windows
  5098. # and Darwin in order for the loader to find any dlls it needs.
  5099. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
  5100. - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
  5101. + func_warning "\`-no-install' is ignored for $host"
  5102. + func_warning "assuming \`-no-fast-install' instead"
  5103. fast_install=no
  5104. ;;
  5105. *) no_install=yes ;;
  5106. @@ -1749,13 +4651,13 @@ EOF
  5107. ;;
  5108. -R*)
  5109. - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
  5110. + func_stripname '-R' '' "$arg"
  5111. + dir=$func_stripname_result
  5112. # We need an absolute path.
  5113. case $dir in
  5114. [\\/]* | [A-Za-z]:[\\/]*) ;;
  5115. *)
  5116. - $echo "$modename: only absolute run-paths are allowed" 1>&2
  5117. - exit $EXIT_FAILURE
  5118. + func_fatal_error "only absolute run-paths are allowed"
  5119. ;;
  5120. esac
  5121. case "$xrpath " in
  5122. @@ -1765,6 +4667,16 @@ EOF
  5123. continue
  5124. ;;
  5125. + -shared)
  5126. + # The effects of -shared are defined in a previous loop.
  5127. + continue
  5128. + ;;
  5129. +
  5130. + -shrext)
  5131. + prev=shrext
  5132. + continue
  5133. + ;;
  5134. +
  5135. -static | -static-libtool-libs)
  5136. # The effects of -static are defined in a previous loop.
  5137. # We used to do the same as -all-static on platforms that
  5138. @@ -1783,47 +4695,49 @@ EOF
  5139. prev=vinfo
  5140. continue
  5141. ;;
  5142. +
  5143. -version-number)
  5144. prev=vinfo
  5145. vinfo_number=yes
  5146. continue
  5147. ;;
  5148. + -weak)
  5149. + prev=weak
  5150. + continue
  5151. + ;;
  5152. +
  5153. -Wc,*)
  5154. - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
  5155. + func_stripname '-Wc,' '' "$arg"
  5156. + args=$func_stripname_result
  5157. arg=
  5158. save_ifs="$IFS"; IFS=','
  5159. for flag in $args; do
  5160. IFS="$save_ifs"
  5161. - case $flag in
  5162. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5163. - flag="\"$flag\""
  5164. - ;;
  5165. - esac
  5166. - arg="$arg $wl$flag"
  5167. - compiler_flags="$compiler_flags $flag"
  5168. + func_quote_for_eval "$flag"
  5169. + arg="$arg $wl$func_quote_for_eval_result"
  5170. + compiler_flags="$compiler_flags $func_quote_for_eval_result"
  5171. done
  5172. IFS="$save_ifs"
  5173. - arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  5174. + func_stripname ' ' '' "$arg"
  5175. + arg=$func_stripname_result
  5176. ;;
  5177. -Wl,*)
  5178. - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
  5179. + func_stripname '-Wl,' '' "$arg"
  5180. + args=$func_stripname_result
  5181. arg=
  5182. save_ifs="$IFS"; IFS=','
  5183. for flag in $args; do
  5184. IFS="$save_ifs"
  5185. - case $flag in
  5186. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5187. - flag="\"$flag\""
  5188. - ;;
  5189. - esac
  5190. - arg="$arg $wl$flag"
  5191. - compiler_flags="$compiler_flags $wl$flag"
  5192. - linker_flags="$linker_flags $flag"
  5193. + func_quote_for_eval "$flag"
  5194. + arg="$arg $wl$func_quote_for_eval_result"
  5195. + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
  5196. + linker_flags="$linker_flags $func_quote_for_eval_result"
  5197. done
  5198. IFS="$save_ifs"
  5199. - arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
  5200. + func_stripname ' ' '' "$arg"
  5201. + arg=$func_stripname_result
  5202. ;;
  5203. -Xcompiler)
  5204. @@ -1841,16 +4755,36 @@ EOF
  5205. continue
  5206. ;;
  5207. + # -msg_* for osf cc
  5208. + -msg_*)
  5209. + func_quote_for_eval "$arg"
  5210. + arg="$func_quote_for_eval_result"
  5211. + ;;
  5212. +
  5213. + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
  5214. + # -r[0-9][0-9]* specifies the processor on the SGI compiler
  5215. + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
  5216. + # +DA*, +DD* enable 64-bit mode on the HP compiler
  5217. + # -q* pass through compiler args for the IBM compiler
  5218. + # -m*, -t[45]*, -txscale* pass through architecture-specific
  5219. + # compiler args for GCC
  5220. + # -F/path gives path to uninstalled frameworks, gcc on darwin
  5221. + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
  5222. + # @file GCC response files
  5223. + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
  5224. + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
  5225. + func_quote_for_eval "$arg"
  5226. + arg="$func_quote_for_eval_result"
  5227. + func_append compile_command " $arg"
  5228. + func_append finalize_command " $arg"
  5229. + compiler_flags="$compiler_flags $arg"
  5230. + continue
  5231. + ;;
  5232. +
  5233. # Some other compiler flag.
  5234. -* | +*)
  5235. - # Unknown arguments in both finalize_command and compile_command need
  5236. - # to be aesthetically quoted because they are evaled later.
  5237. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5238. - case $arg in
  5239. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5240. - arg="\"$arg\""
  5241. - ;;
  5242. - esac
  5243. + func_quote_for_eval "$arg"
  5244. + arg="$func_quote_for_eval_result"
  5245. ;;
  5246. *.$objext)
  5247. @@ -1862,32 +4796,23 @@ EOF
  5248. # A libtool-controlled object.
  5249. # Check to see that this really is a libtool object.
  5250. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5251. + if func_lalib_unsafe_p "$arg"; then
  5252. pic_object=
  5253. non_pic_object=
  5254. # Read the .lo file
  5255. - # If there is no directory component, then add one.
  5256. - case $arg in
  5257. - */* | *\\*) . $arg ;;
  5258. - *) . ./$arg ;;
  5259. - esac
  5260. + func_source "$arg"
  5261. - if test -z "$pic_object" || \
  5262. + if test -z "$pic_object" ||
  5263. test -z "$non_pic_object" ||
  5264. - test "$pic_object" = none && \
  5265. + test "$pic_object" = none &&
  5266. test "$non_pic_object" = none; then
  5267. - $echo "$modename: cannot find name of object for \`$arg'" 1>&2
  5268. - exit $EXIT_FAILURE
  5269. + func_fatal_error "cannot find name of object for \`$arg'"
  5270. fi
  5271. # Extract subdirectory from the argument.
  5272. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  5273. - if test "X$xdir" = "X$arg"; then
  5274. - xdir=
  5275. - else
  5276. - xdir="$xdir/"
  5277. - fi
  5278. + func_dirname "$arg" "/" ""
  5279. + xdir="$func_dirname_result"
  5280. if test "$pic_object" != none; then
  5281. # Prepend the subdirectory the object is found in.
  5282. @@ -1912,7 +4837,7 @@ EOF
  5283. fi
  5284. # A PIC object.
  5285. - libobjs="$libobjs $pic_object"
  5286. + func_append libobjs " $pic_object"
  5287. arg="$pic_object"
  5288. fi
  5289. @@ -1922,7 +4847,7 @@ EOF
  5290. non_pic_object="$xdir$non_pic_object"
  5291. # A standard non-PIC object
  5292. - non_pic_objects="$non_pic_objects $non_pic_object"
  5293. + func_append non_pic_objects " $non_pic_object"
  5294. if test -z "$pic_object" || test "$pic_object" = none ; then
  5295. arg="$non_pic_object"
  5296. fi
  5297. @@ -1930,28 +4855,22 @@ EOF
  5298. # If the PIC object exists, use it instead.
  5299. # $xdir was prepended to $pic_object above.
  5300. non_pic_object="$pic_object"
  5301. - non_pic_objects="$non_pic_objects $non_pic_object"
  5302. + func_append non_pic_objects " $non_pic_object"
  5303. fi
  5304. else
  5305. # Only an error if not doing a dry-run.
  5306. - if test -z "$run"; then
  5307. - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
  5308. - exit $EXIT_FAILURE
  5309. - else
  5310. - # Dry-run case.
  5311. -
  5312. + if $opt_dry_run; then
  5313. # Extract subdirectory from the argument.
  5314. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  5315. - if test "X$xdir" = "X$arg"; then
  5316. - xdir=
  5317. - else
  5318. - xdir="$xdir/"
  5319. - fi
  5320. + func_dirname "$arg" "/" ""
  5321. + xdir="$func_dirname_result"
  5322. - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
  5323. - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
  5324. - libobjs="$libobjs $pic_object"
  5325. - non_pic_objects="$non_pic_objects $non_pic_object"
  5326. + func_lo2o "$arg"
  5327. + pic_object=$xdir$objdir/$func_lo2o_result
  5328. + non_pic_object=$xdir$func_lo2o_result
  5329. + func_append libobjs " $pic_object"
  5330. + func_append non_pic_objects " $non_pic_object"
  5331. + else
  5332. + func_fatal_error "\`$arg' is not a valid libtool object"
  5333. fi
  5334. fi
  5335. ;;
  5336. @@ -1984,70 +4903,51 @@ EOF
  5337. *)
  5338. # Unknown arguments in both finalize_command and compile_command need
  5339. # to be aesthetically quoted because they are evaled later.
  5340. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  5341. - case $arg in
  5342. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  5343. - arg="\"$arg\""
  5344. - ;;
  5345. - esac
  5346. + func_quote_for_eval "$arg"
  5347. + arg="$func_quote_for_eval_result"
  5348. ;;
  5349. esac # arg
  5350. # Now actually substitute the argument into the commands.
  5351. if test -n "$arg"; then
  5352. - compile_command="$compile_command $arg"
  5353. - finalize_command="$finalize_command $arg"
  5354. + func_append compile_command " $arg"
  5355. + func_append finalize_command " $arg"
  5356. fi
  5357. done # argument parsing loop
  5358. - if test -n "$prev"; then
  5359. - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
  5360. - $echo "$help" 1>&2
  5361. - exit $EXIT_FAILURE
  5362. - fi
  5363. + test -n "$prev" && \
  5364. + func_fatal_help "the \`$prevarg' option requires an argument"
  5365. if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
  5366. eval arg=\"$export_dynamic_flag_spec\"
  5367. - compile_command="$compile_command $arg"
  5368. - finalize_command="$finalize_command $arg"
  5369. + func_append compile_command " $arg"
  5370. + func_append finalize_command " $arg"
  5371. fi
  5372. oldlibs=
  5373. # calculate the name of the file, without its directory
  5374. - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  5375. + func_basename "$output"
  5376. + outputname="$func_basename_result"
  5377. libobjs_save="$libobjs"
  5378. if test -n "$shlibpath_var"; then
  5379. # get the directories listed in $shlibpath_var
  5380. - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  5381. + eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  5382. else
  5383. shlib_search_path=
  5384. fi
  5385. eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
  5386. eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  5387. - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  5388. - if test "X$output_objdir" = "X$output"; then
  5389. - output_objdir="$objdir"
  5390. - else
  5391. - output_objdir="$output_objdir/$objdir"
  5392. - fi
  5393. + func_dirname "$output" "/" ""
  5394. + output_objdir="$func_dirname_result$objdir"
  5395. # Create the object directory.
  5396. - if test ! -d "$output_objdir"; then
  5397. - $show "$mkdir $output_objdir"
  5398. - $run $mkdir $output_objdir
  5399. - exit_status=$?
  5400. - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
  5401. - exit $exit_status
  5402. - fi
  5403. - fi
  5404. + func_mkdir_p "$output_objdir"
  5405. # Determine the type of output
  5406. case $output in
  5407. "")
  5408. - $echo "$modename: you must specify an output file" 1>&2
  5409. - $echo "$help" 1>&2
  5410. - exit $EXIT_FAILURE
  5411. + func_fatal_help "you must specify an output file"
  5412. ;;
  5413. *.$libext) linkmode=oldlib ;;
  5414. *.lo | *.$objext) linkmode=obj ;;
  5415. @@ -2055,22 +4955,13 @@ EOF
  5416. *) linkmode=prog ;; # Anything else should be a program.
  5417. esac
  5418. - case $host in
  5419. - *cygwin* | *mingw* | *pw32*)
  5420. - # don't eliminate duplications in $postdeps and $predeps
  5421. - duplicate_compiler_generated_deps=yes
  5422. - ;;
  5423. - *)
  5424. - duplicate_compiler_generated_deps=$duplicate_deps
  5425. - ;;
  5426. - esac
  5427. specialdeplibs=
  5428. libs=
  5429. # Find all interdependent deplibs by searching for libraries
  5430. # that are linked more than once (e.g. -la -lb -la)
  5431. for deplib in $deplibs; do
  5432. - if test "X$duplicate_deps" = "Xyes" ; then
  5433. + if $opt_duplicate_deps ; then
  5434. case "$libs " in
  5435. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5436. esac
  5437. @@ -2085,7 +4976,7 @@ EOF
  5438. # $postdeps and mark them as special (i.e., whose duplicates are
  5439. # not to be eliminated).
  5440. pre_post_deps=
  5441. - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
  5442. + if $opt_duplicate_compiler_generated_deps; then
  5443. for pre_post_dep in $predeps $postdeps; do
  5444. case "$pre_post_deps " in
  5445. *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
  5446. @@ -2101,15 +4992,16 @@ EOF
  5447. newlib_search_path=
  5448. need_relink=no # whether we're linking any uninstalled libtool libraries
  5449. notinst_deplibs= # not-installed libtool libraries
  5450. + notinst_path= # paths that contain not-installed libtool libraries
  5451. +
  5452. case $linkmode in
  5453. lib)
  5454. - passes="conv link"
  5455. + passes="conv dlpreopen link"
  5456. for file in $dlfiles $dlprefiles; do
  5457. case $file in
  5458. *.la) ;;
  5459. *)
  5460. - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
  5461. - exit $EXIT_FAILURE
  5462. + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
  5463. ;;
  5464. esac
  5465. done
  5466. @@ -2125,7 +5017,20 @@ EOF
  5467. *) passes="conv"
  5468. ;;
  5469. esac
  5470. +
  5471. for pass in $passes; do
  5472. + # The preopen pass in lib mode reverses $deplibs; put it back here
  5473. + # so that -L comes before libs that need it for instance...
  5474. + if test "$linkmode,$pass" = "lib,link"; then
  5475. + ## FIXME: Find the place where the list is rebuilt in the wrong
  5476. + ## order, and fix it there properly
  5477. + tmp_deplibs=
  5478. + for deplib in $deplibs; do
  5479. + tmp_deplibs="$deplib $tmp_deplibs"
  5480. + done
  5481. + deplibs="$tmp_deplibs"
  5482. + fi
  5483. +
  5484. if test "$linkmode,$pass" = "lib,link" ||
  5485. test "$linkmode,$pass" = "prog,scan"; then
  5486. libs="$deplibs"
  5487. @@ -2138,11 +5043,33 @@ EOF
  5488. link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
  5489. esac
  5490. fi
  5491. + if test "$linkmode,$pass" = "lib,dlpreopen"; then
  5492. + # Collect and forward deplibs of preopened libtool libs
  5493. + for lib in $dlprefiles; do
  5494. + # Ignore non-libtool-libs
  5495. + dependency_libs=
  5496. + case $lib in
  5497. + *.la) func_source "$lib" ;;
  5498. + esac
  5499. +
  5500. + # Collect preopened libtool deplibs, except any this library
  5501. + # has declared as weak libs
  5502. + for deplib in $dependency_libs; do
  5503. + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
  5504. + case " $weak_libs " in
  5505. + *" $deplib_base "*) ;;
  5506. + *) deplibs="$deplibs $deplib" ;;
  5507. + esac
  5508. + done
  5509. + done
  5510. + libs="$dlprefiles"
  5511. + fi
  5512. if test "$pass" = dlopen; then
  5513. # Collect dlpreopened libraries
  5514. save_deplibs="$deplibs"
  5515. deplibs=
  5516. fi
  5517. +
  5518. for deplib in $libs; do
  5519. lib=
  5520. found=no
  5521. @@ -2153,15 +5080,22 @@ EOF
  5522. finalize_deplibs="$deplib $finalize_deplibs"
  5523. else
  5524. compiler_flags="$compiler_flags $deplib"
  5525. + if test "$linkmode" = lib ; then
  5526. + case "$new_inherited_linker_flags " in
  5527. + *" $deplib "*) ;;
  5528. + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  5529. + esac
  5530. + fi
  5531. fi
  5532. continue
  5533. ;;
  5534. -l*)
  5535. if test "$linkmode" != lib && test "$linkmode" != prog; then
  5536. - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
  5537. + func_warning "\`-l' is ignored for archives/objects"
  5538. continue
  5539. fi
  5540. - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
  5541. + func_stripname '-l' '' "$deplib"
  5542. + name=$func_stripname_result
  5543. if test "$linkmode" = lib; then
  5544. searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
  5545. else
  5546. @@ -2197,21 +5131,17 @@ EOF
  5547. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  5548. case " $predeps $postdeps " in
  5549. *" $deplib "*)
  5550. - if (${SED} -e '2q' $lib |
  5551. - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  5552. + if func_lalib_p "$lib"; then
  5553. library_names=
  5554. old_library=
  5555. - case $lib in
  5556. - */* | *\\*) . $lib ;;
  5557. - *) . ./$lib ;;
  5558. - esac
  5559. + func_source "$lib"
  5560. for l in $old_library $library_names; do
  5561. ll="$l"
  5562. done
  5563. if test "X$ll" = "X$old_library" ; then # only static version available
  5564. found=no
  5565. - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  5566. - test "X$ladir" = "X$lib" && ladir="."
  5567. + func_dirname "$lib" "" "."
  5568. + ladir="$func_dirname_result"
  5569. lib=$ladir/$old_library
  5570. if test "$linkmode,$pass" = "prog,link"; then
  5571. compile_deplibs="$deplib $compile_deplibs"
  5572. @@ -2223,19 +5153,35 @@ EOF
  5573. continue
  5574. fi
  5575. fi
  5576. - ;;
  5577. + ;;
  5578. *) ;;
  5579. esac
  5580. fi
  5581. fi
  5582. ;; # -l
  5583. + *.ltframework)
  5584. + if test "$linkmode,$pass" = "prog,link"; then
  5585. + compile_deplibs="$deplib $compile_deplibs"
  5586. + finalize_deplibs="$deplib $finalize_deplibs"
  5587. + else
  5588. + deplibs="$deplib $deplibs"
  5589. + if test "$linkmode" = lib ; then
  5590. + case "$new_inherited_linker_flags " in
  5591. + *" $deplib "*) ;;
  5592. + * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
  5593. + esac
  5594. + fi
  5595. + fi
  5596. + continue
  5597. + ;;
  5598. -L*)
  5599. case $linkmode in
  5600. lib)
  5601. deplibs="$deplib $deplibs"
  5602. test "$pass" = conv && continue
  5603. newdependency_libs="$deplib $newdependency_libs"
  5604. - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  5605. + func_stripname '-L' '' "$deplib"
  5606. + newlib_search_path="$newlib_search_path $func_stripname_result"
  5607. ;;
  5608. prog)
  5609. if test "$pass" = conv; then
  5610. @@ -2248,17 +5194,19 @@ EOF
  5611. compile_deplibs="$deplib $compile_deplibs"
  5612. finalize_deplibs="$deplib $finalize_deplibs"
  5613. fi
  5614. - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
  5615. + func_stripname '-L' '' "$deplib"
  5616. + newlib_search_path="$newlib_search_path $func_stripname_result"
  5617. ;;
  5618. *)
  5619. - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
  5620. + func_warning "\`-L' is ignored for archives/objects"
  5621. ;;
  5622. esac # linkmode
  5623. continue
  5624. ;; # -L
  5625. -R*)
  5626. if test "$pass" = link; then
  5627. - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  5628. + func_stripname '-R' '' "$deplib"
  5629. + dir=$func_stripname_result
  5630. # Make sure the xrpath contains only unique directories.
  5631. case "$xrpath " in
  5632. *" $dir "*) ;;
  5633. @@ -2276,35 +5224,41 @@ EOF
  5634. fi
  5635. case $linkmode in
  5636. lib)
  5637. - valid_a_lib=no
  5638. - case $deplibs_check_method in
  5639. - match_pattern*)
  5640. - set dummy $deplibs_check_method
  5641. - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  5642. - if eval $echo \"$deplib\" 2>/dev/null \
  5643. - | $SED 10q \
  5644. + # Linking convenience modules into shared libraries is allowed,
  5645. + # but linking other static libraries is non-portable.
  5646. + case " $dlpreconveniencelibs " in
  5647. + *" $deplib "*) ;;
  5648. + *)
  5649. + valid_a_lib=no
  5650. + case $deplibs_check_method in
  5651. + match_pattern*)
  5652. + set dummy $deplibs_check_method; shift
  5653. + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  5654. + if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
  5655. | $EGREP "$match_pattern_regex" > /dev/null; then
  5656. - valid_a_lib=yes
  5657. - fi
  5658. + valid_a_lib=yes
  5659. + fi
  5660. ;;
  5661. - pass_all)
  5662. - valid_a_lib=yes
  5663. + pass_all)
  5664. + valid_a_lib=yes
  5665. ;;
  5666. - esac
  5667. - if test "$valid_a_lib" != yes; then
  5668. - $echo
  5669. - $echo "*** Warning: Trying to link with static lib archive $deplib."
  5670. - $echo "*** I have the capability to make that library automatically link in when"
  5671. - $echo "*** you link to this library. But I can only do this if you have a"
  5672. - $echo "*** shared version of the library, which you do not appear to have"
  5673. - $echo "*** because the file extensions .$libext of this argument makes me believe"
  5674. - $echo "*** that it is just a static archive that I should not used here."
  5675. - else
  5676. - $echo
  5677. - $echo "*** Warning: Linking the shared library $output against the"
  5678. - $echo "*** static library $deplib is not portable!"
  5679. - deplibs="$deplib $deplibs"
  5680. - fi
  5681. + esac
  5682. + if test "$valid_a_lib" != yes; then
  5683. + $ECHO
  5684. + $ECHO "*** Warning: Trying to link with static lib archive $deplib."
  5685. + $ECHO "*** I have the capability to make that library automatically link in when"
  5686. + $ECHO "*** you link to this library. But I can only do this if you have a"
  5687. + $ECHO "*** shared version of the library, which you do not appear to have"
  5688. + $ECHO "*** because the file extensions .$libext of this argument makes me believe"
  5689. + $ECHO "*** that it is just a static archive that I should not use here."
  5690. + else
  5691. + $ECHO
  5692. + $ECHO "*** Warning: Linking the shared library $output against the"
  5693. + $ECHO "*** static library $deplib is not portable!"
  5694. + deplibs="$deplib $deplibs"
  5695. + fi
  5696. + ;;
  5697. + esac
  5698. continue
  5699. ;;
  5700. prog)
  5701. @@ -2339,21 +5293,18 @@ EOF
  5702. continue
  5703. ;;
  5704. esac # case $deplib
  5705. +
  5706. if test "$found" = yes || test -f "$lib"; then :
  5707. else
  5708. - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
  5709. - exit $EXIT_FAILURE
  5710. + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
  5711. fi
  5712. # Check to see that this really is a libtool archive.
  5713. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  5714. - else
  5715. - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  5716. - exit $EXIT_FAILURE
  5717. - fi
  5718. + func_lalib_unsafe_p "$lib" \
  5719. + || func_fatal_error "\`$lib' is not a valid libtool archive"
  5720. - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
  5721. - test "X$ladir" = "X$lib" && ladir="."
  5722. + func_dirname "$lib" "" "."
  5723. + ladir="$func_dirname_result"
  5724. dlname=
  5725. dlopen=
  5726. @@ -2361,6 +5312,7 @@ EOF
  5727. libdir=
  5728. library_names=
  5729. old_library=
  5730. + inherited_linker_flags=
  5731. # If the library was installed with an old release of libtool,
  5732. # it will not redefine variables installed, or shouldnotlink
  5733. installed=yes
  5734. @@ -2369,11 +5321,19 @@ EOF
  5735. # Read the .la file
  5736. - case $lib in
  5737. - */* | *\\*) . $lib ;;
  5738. - *) . ./$lib ;;
  5739. - esac
  5740. + func_source "$lib"
  5741. + # Convert "-framework foo" to "foo.ltframework"
  5742. + if test -n "$inherited_linker_flags"; then
  5743. + tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
  5744. + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
  5745. + case " $new_inherited_linker_flags " in
  5746. + *" $tmp_inherited_linker_flag "*) ;;
  5747. + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
  5748. + esac
  5749. + done
  5750. + fi
  5751. + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  5752. if test "$linkmode,$pass" = "lib,link" ||
  5753. test "$linkmode,$pass" = "prog,scan" ||
  5754. { test "$linkmode" != prog && test "$linkmode" != lib; }; then
  5755. @@ -2386,26 +5346,24 @@ EOF
  5756. deplibs="$lib $deplibs"
  5757. if test -z "$libdir"; then
  5758. if test -z "$old_library"; then
  5759. - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  5760. - exit $EXIT_FAILURE
  5761. + func_fatal_error "cannot find name of link library for \`$lib'"
  5762. fi
  5763. # It is a libtool convenience library, so add in its objects.
  5764. convenience="$convenience $ladir/$objdir/$old_library"
  5765. old_convenience="$old_convenience $ladir/$objdir/$old_library"
  5766. - tmp_libs=
  5767. - for deplib in $dependency_libs; do
  5768. - deplibs="$deplib $deplibs"
  5769. - if test "X$duplicate_deps" = "Xyes" ; then
  5770. - case "$tmp_libs " in
  5771. - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5772. - esac
  5773. - fi
  5774. - tmp_libs="$tmp_libs $deplib"
  5775. - done
  5776. elif test "$linkmode" != prog && test "$linkmode" != lib; then
  5777. - $echo "$modename: \`$lib' is not a convenience library" 1>&2
  5778. - exit $EXIT_FAILURE
  5779. + func_fatal_error "\`$lib' is not a convenience library"
  5780. fi
  5781. + tmp_libs=
  5782. + for deplib in $dependency_libs; do
  5783. + deplibs="$deplib $deplibs"
  5784. + if $opt_duplicate_deps ; then
  5785. + case "$tmp_libs " in
  5786. + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5787. + esac
  5788. + fi
  5789. + tmp_libs="$tmp_libs $deplib"
  5790. + done
  5791. continue
  5792. fi # $pass = conv
  5793. @@ -2416,15 +5374,13 @@ EOF
  5794. linklib="$l"
  5795. done
  5796. if test -z "$linklib"; then
  5797. - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
  5798. - exit $EXIT_FAILURE
  5799. + func_fatal_error "cannot find name of link library for \`$lib'"
  5800. fi
  5801. # This library was specified with -dlopen.
  5802. if test "$pass" = dlopen; then
  5803. if test -z "$libdir"; then
  5804. - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
  5805. - exit $EXIT_FAILURE
  5806. + func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
  5807. fi
  5808. if test -z "$dlname" ||
  5809. test "$dlopen_support" != yes ||
  5810. @@ -2446,18 +5402,19 @@ EOF
  5811. *)
  5812. abs_ladir=`cd "$ladir" && pwd`
  5813. if test -z "$abs_ladir"; then
  5814. - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
  5815. - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
  5816. + func_warning "cannot determine absolute directory name of \`$ladir'"
  5817. + func_warning "passing it literally to the linker, although it might fail"
  5818. abs_ladir="$ladir"
  5819. fi
  5820. ;;
  5821. esac
  5822. - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  5823. + func_basename "$lib"
  5824. + laname="$func_basename_result"
  5825. # Find the relevant object directory and library name.
  5826. if test "X$installed" = Xyes; then
  5827. if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
  5828. - $echo "$modename: warning: library \`$lib' was moved." 1>&2
  5829. + func_warning "library \`$lib' was moved."
  5830. dir="$ladir"
  5831. absdir="$abs_ladir"
  5832. libdir="$abs_ladir"
  5833. @@ -2479,18 +5436,22 @@ EOF
  5834. notinst_path="$notinst_path $abs_ladir"
  5835. fi
  5836. fi # $installed = yes
  5837. - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  5838. + func_stripname 'lib' '.la' "$laname"
  5839. + name=$func_stripname_result
  5840. # This library was specified with -dlpreopen.
  5841. if test "$pass" = dlpreopen; then
  5842. - if test -z "$libdir"; then
  5843. - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
  5844. - exit $EXIT_FAILURE
  5845. + if test -z "$libdir" && test "$linkmode" = prog; then
  5846. + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
  5847. fi
  5848. # Prefer using a static library (so that no silly _DYNAMIC symbols
  5849. # are required to link).
  5850. if test -n "$old_library"; then
  5851. newdlprefiles="$newdlprefiles $dir/$old_library"
  5852. + # Keep a list of preopened convenience libraries to check
  5853. + # that they are being used correctly in the link pass.
  5854. + test -z "$libdir" && \
  5855. + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
  5856. # Otherwise, use the dlname, so that lt_dlopen finds it.
  5857. elif test -n "$dlname"; then
  5858. newdlprefiles="$newdlprefiles $dir/$dlname"
  5859. @@ -2526,7 +5487,9 @@ EOF
  5860. tmp_libs=
  5861. for deplib in $dependency_libs; do
  5862. case $deplib in
  5863. - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
  5864. + -L*) func_stripname '-L' '' "$deplib"
  5865. + newlib_search_path="$newlib_search_path $func_stripname_result"
  5866. + ;;
  5867. esac
  5868. # Need to link against all dependency_libs?
  5869. if test "$linkalldeplibs" = yes; then
  5870. @@ -2536,7 +5499,7 @@ EOF
  5871. # or/and link against static libraries
  5872. newdependency_libs="$deplib $newdependency_libs"
  5873. fi
  5874. - if test "X$duplicate_deps" = "Xyes" ; then
  5875. + if $opt_duplicate_deps ; then
  5876. case "$tmp_libs " in
  5877. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  5878. esac
  5879. @@ -2549,15 +5512,14 @@ EOF
  5880. if test "$linkmode,$pass" = "prog,link"; then
  5881. if test -n "$library_names" &&
  5882. { { test "$prefer_static_libs" = no ||
  5883. - test "$prefer_static_libs,$installed" = "built,yes"; } ||
  5884. + test "$prefer_static_libs,$installed" = "built,yes"; } ||
  5885. test -z "$old_library"; }; then
  5886. # We need to hardcode the library path
  5887. if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
  5888. # Make sure the rpath contains only unique directories.
  5889. - case "$temp_rpath " in
  5890. - *" $dir "*) ;;
  5891. - *" $absdir "*) ;;
  5892. - *) temp_rpath="$temp_rpath $absdir" ;;
  5893. + case "$temp_rpath:" in
  5894. + *"$absdir:"*) ;;
  5895. + *) temp_rpath="$temp_rpath$absdir:" ;;
  5896. esac
  5897. fi
  5898. @@ -2595,27 +5557,43 @@ EOF
  5899. link_static=no # Whether the deplib will be linked statically
  5900. use_static_libs=$prefer_static_libs
  5901. - if test "$use_static_libs" = built && test "$installed" = yes ; then
  5902. + if test "$use_static_libs" = built && test "$installed" = yes; then
  5903. use_static_libs=no
  5904. fi
  5905. if test -n "$library_names" &&
  5906. { test "$use_static_libs" = no || test -z "$old_library"; }; then
  5907. - if test "$installed" = no; then
  5908. - notinst_deplibs="$notinst_deplibs $lib"
  5909. - need_relink=yes
  5910. - fi
  5911. + case $host in
  5912. + *cygwin* | *mingw* | *cegcc*)
  5913. + # No point in relinking DLLs because paths are not encoded
  5914. + notinst_deplibs="$notinst_deplibs $lib"
  5915. + need_relink=no
  5916. + ;;
  5917. + *)
  5918. + if test "$installed" = no; then
  5919. + notinst_deplibs="$notinst_deplibs $lib"
  5920. + need_relink=yes
  5921. + fi
  5922. + ;;
  5923. + esac
  5924. # This is a shared library
  5925. - # Warn about portability, can't link against -module's on
  5926. - # some systems (darwin)
  5927. - if test "$shouldnotlink" = yes && test "$pass" = link ; then
  5928. - $echo
  5929. + # Warn about portability, can't link against -module's on some
  5930. + # systems (darwin). Don't bleat about dlopened modules though!
  5931. + dlopenmodule=""
  5932. + for dlpremoduletest in $dlprefiles; do
  5933. + if test "X$dlpremoduletest" = "X$lib"; then
  5934. + dlopenmodule="$dlpremoduletest"
  5935. + break
  5936. + fi
  5937. + done
  5938. + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
  5939. + $ECHO
  5940. if test "$linkmode" = prog; then
  5941. - $echo "*** Warning: Linking the executable $output against the loadable module"
  5942. + $ECHO "*** Warning: Linking the executable $output against the loadable module"
  5943. else
  5944. - $echo "*** Warning: Linking the shared library $output against the loadable module"
  5945. + $ECHO "*** Warning: Linking the shared library $output against the loadable module"
  5946. fi
  5947. - $echo "*** $linklib is not portable!"
  5948. + $ECHO "*** $linklib is not portable!"
  5949. fi
  5950. if test "$linkmode" = lib &&
  5951. test "$hardcode_into_libs" = yes; then
  5952. @@ -2645,17 +5623,19 @@ EOF
  5953. if test -n "$old_archive_from_expsyms_cmds"; then
  5954. # figure out the soname
  5955. set dummy $library_names
  5956. - realname="$2"
  5957. - shift; shift
  5958. - libname=`eval \\$echo \"$libname_spec\"`
  5959. + shift
  5960. + realname="$1"
  5961. + shift
  5962. + libname=`eval "\\$ECHO \"$libname_spec\""`
  5963. # use dlname if we got it. it's perfectly good, no?
  5964. if test -n "$dlname"; then
  5965. soname="$dlname"
  5966. elif test -n "$soname_spec"; then
  5967. # bleh windows
  5968. case $host in
  5969. - *cygwin* | mingw*)
  5970. - major=`expr $current - $age`
  5971. + *cygwin* | mingw* | *cegcc*)
  5972. + func_arith $current - $age
  5973. + major=$func_arith_result
  5974. versuffix="-$major"
  5975. ;;
  5976. esac
  5977. @@ -2666,36 +5646,22 @@ EOF
  5978. # Make a new name for the extract_expsyms_cmds to use
  5979. soroot="$soname"
  5980. - soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
  5981. - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
  5982. + func_basename "$soroot"
  5983. + soname="$func_basename_result"
  5984. + func_stripname 'lib' '.dll' "$soname"
  5985. + newlib=libimp-$func_stripname_result.a
  5986. # If the library has no export list, then create one now
  5987. if test -f "$output_objdir/$soname-def"; then :
  5988. else
  5989. - $show "extracting exported symbol list from \`$soname'"
  5990. - save_ifs="$IFS"; IFS='~'
  5991. - cmds=$extract_expsyms_cmds
  5992. - for cmd in $cmds; do
  5993. - IFS="$save_ifs"
  5994. - eval cmd=\"$cmd\"
  5995. - $show "$cmd"
  5996. - $run eval "$cmd" || exit $?
  5997. - done
  5998. - IFS="$save_ifs"
  5999. + func_verbose "extracting exported symbol list from \`$soname'"
  6000. + func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
  6001. fi
  6002. # Create $newlib
  6003. if test -f "$output_objdir/$newlib"; then :; else
  6004. - $show "generating import library for \`$soname'"
  6005. - save_ifs="$IFS"; IFS='~'
  6006. - cmds=$old_archive_from_expsyms_cmds
  6007. - for cmd in $cmds; do
  6008. - IFS="$save_ifs"
  6009. - eval cmd=\"$cmd\"
  6010. - $show "$cmd"
  6011. - $run eval "$cmd" || exit $?
  6012. - done
  6013. - IFS="$save_ifs"
  6014. + func_verbose "generating import library for \`$soname'"
  6015. + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
  6016. fi
  6017. # make sure the library variables are pointing to the new library
  6018. dir=$output_objdir
  6019. @@ -2717,17 +5683,21 @@ EOF
  6020. *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
  6021. *-*-unixware7*) add_dir="-L$dir" ;;
  6022. *-*-darwin* )
  6023. - # if the lib is a module then we can not link against
  6024. - # it, someone is ignoring the new warnings I added
  6025. + # if the lib is a (non-dlopened) module then we can not
  6026. + # link against it, someone is ignoring the earlier warnings
  6027. if /usr/bin/file -L $add 2> /dev/null |
  6028. - $EGREP ": [^:]* bundle" >/dev/null ; then
  6029. - $echo "** Warning, lib $linklib is a module, not a shared library"
  6030. - if test -z "$old_library" ; then
  6031. - $echo
  6032. - $echo "** And there doesn't seem to be a static archive available"
  6033. - $echo "** The link will probably fail, sorry"
  6034. - else
  6035. - add="$dir/$old_library"
  6036. + $GREP ": [^:]* bundle" >/dev/null ; then
  6037. + if test "X$dlopenmodule" != "X$lib"; then
  6038. + $ECHO "*** Warning: lib $linklib is a module, not a shared library"
  6039. + if test -z "$old_library" ; then
  6040. + $ECHO
  6041. + $ECHO "*** And there doesn't seem to be a static archive available"
  6042. + $ECHO "*** The link will probably fail, sorry"
  6043. + else
  6044. + add="$dir/$old_library"
  6045. + fi
  6046. + elif test -n "$old_library"; then
  6047. + add="$dir/$old_library"
  6048. fi
  6049. fi
  6050. esac
  6051. @@ -2745,7 +5715,8 @@ EOF
  6052. fi
  6053. ;;
  6054. relink)
  6055. - if test "$hardcode_direct" = yes; then
  6056. + if test "$hardcode_direct" = yes &&
  6057. + test "$hardcode_direct_absolute" = no; then
  6058. add="$dir/$linklib"
  6059. elif test "$hardcode_minus_L" = yes; then
  6060. add_dir="-L$dir"
  6061. @@ -2769,8 +5740,7 @@ EOF
  6062. esac
  6063. if test "$lib_linked" != yes; then
  6064. - $echo "$modename: configuration error: unsupported hardcode properties"
  6065. - exit $EXIT_FAILURE
  6066. + func_fatal_configuration "unsupported hardcode properties"
  6067. fi
  6068. if test -n "$add_shlibpath"; then
  6069. @@ -2785,8 +5755,8 @@ EOF
  6070. else
  6071. test -n "$add_dir" && deplibs="$add_dir $deplibs"
  6072. test -n "$add" && deplibs="$add $deplibs"
  6073. - if test "$hardcode_direct" != yes && \
  6074. - test "$hardcode_minus_L" != yes && \
  6075. + if test "$hardcode_direct" != yes &&
  6076. + test "$hardcode_minus_L" != yes &&
  6077. test "$hardcode_shlibpath_var" = yes; then
  6078. case :$finalize_shlibpath: in
  6079. *":$libdir:"*) ;;
  6080. @@ -2801,7 +5771,8 @@ EOF
  6081. add_dir=
  6082. add=
  6083. # Finalize command for both is simple: just hardcode it.
  6084. - if test "$hardcode_direct" = yes; then
  6085. + if test "$hardcode_direct" = yes &&
  6086. + test "$hardcode_direct_absolute" = no; then
  6087. add="$libdir/$linklib"
  6088. elif test "$hardcode_minus_L" = yes; then
  6089. add_dir="-L$libdir"
  6090. @@ -2815,9 +5786,9 @@ EOF
  6091. elif test "$hardcode_automatic" = yes; then
  6092. if test -n "$inst_prefix_dir" &&
  6093. test -f "$inst_prefix_dir$libdir/$linklib" ; then
  6094. - add="$inst_prefix_dir$libdir/$linklib"
  6095. + add="$inst_prefix_dir$libdir/$linklib"
  6096. else
  6097. - add="$libdir/$linklib"
  6098. + add="$libdir/$linklib"
  6099. fi
  6100. else
  6101. # We cannot seem to hardcode it, guess we'll fake it.
  6102. @@ -2861,21 +5832,21 @@ EOF
  6103. # Just print a warning and add the library to dependency_libs so
  6104. # that the program can be linked against the static library.
  6105. - $echo
  6106. - $echo "*** Warning: This system can not link to static lib archive $lib."
  6107. - $echo "*** I have the capability to make that library automatically link in when"
  6108. - $echo "*** you link to this library. But I can only do this if you have a"
  6109. - $echo "*** shared version of the library, which you do not appear to have."
  6110. + $ECHO
  6111. + $ECHO "*** Warning: This system can not link to static lib archive $lib."
  6112. + $ECHO "*** I have the capability to make that library automatically link in when"
  6113. + $ECHO "*** you link to this library. But I can only do this if you have a"
  6114. + $ECHO "*** shared version of the library, which you do not appear to have."
  6115. if test "$module" = yes; then
  6116. - $echo "*** But as you try to build a module library, libtool will still create "
  6117. - $echo "*** a static module, that should work as long as the dlopening application"
  6118. - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
  6119. + $ECHO "*** But as you try to build a module library, libtool will still create "
  6120. + $ECHO "*** a static module, that should work as long as the dlopening application"
  6121. + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
  6122. if test -z "$global_symbol_pipe"; then
  6123. - $echo
  6124. - $echo "*** However, this would only work if libtool was able to extract symbol"
  6125. - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  6126. - $echo "*** not find such a program. So, this module is probably useless."
  6127. - $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  6128. + $ECHO
  6129. + $ECHO "*** However, this would only work if libtool was able to extract symbol"
  6130. + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  6131. + $ECHO "*** not find such a program. So, this module is probably useless."
  6132. + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  6133. fi
  6134. if test "$build_old_libs" = no; then
  6135. build_libtool_libs=module
  6136. @@ -2899,7 +5870,8 @@ EOF
  6137. temp_deplibs=
  6138. for libdir in $dependency_libs; do
  6139. case $libdir in
  6140. - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
  6141. + -R*) func_stripname '-R' '' "$libdir"
  6142. + temp_xrpath=$func_stripname_result
  6143. case " $xrpath " in
  6144. *" $temp_xrpath "*) ;;
  6145. *) xrpath="$xrpath $temp_xrpath";;
  6146. @@ -2917,7 +5889,7 @@ EOF
  6147. tmp_libs=
  6148. for deplib in $dependency_libs; do
  6149. newdependency_libs="$deplib $newdependency_libs"
  6150. - if test "X$duplicate_deps" = "Xyes" ; then
  6151. + if $opt_duplicate_deps ; then
  6152. case "$tmp_libs " in
  6153. *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
  6154. esac
  6155. @@ -2931,94 +5903,71 @@ EOF
  6156. case $deplib in
  6157. -L*) path="$deplib" ;;
  6158. *.la)
  6159. - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
  6160. - test "X$dir" = "X$deplib" && dir="."
  6161. + func_dirname "$deplib" "" "."
  6162. + dir="$func_dirname_result"
  6163. # We need an absolute path.
  6164. case $dir in
  6165. [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
  6166. *)
  6167. absdir=`cd "$dir" && pwd`
  6168. if test -z "$absdir"; then
  6169. - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
  6170. + func_warning "cannot determine absolute directory name of \`$dir'"
  6171. absdir="$dir"
  6172. fi
  6173. ;;
  6174. esac
  6175. - if grep "^installed=no" $deplib > /dev/null; then
  6176. - path="$absdir/$objdir"
  6177. - else
  6178. - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  6179. - if test -z "$libdir"; then
  6180. - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  6181. - exit $EXIT_FAILURE
  6182. - fi
  6183. - if test "$absdir" != "$libdir"; then
  6184. - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
  6185. - fi
  6186. - path="$absdir"
  6187. - fi
  6188. - depdepl=
  6189. + if $GREP "^installed=no" $deplib > /dev/null; then
  6190. case $host in
  6191. *-*-darwin*)
  6192. - # we do not want to link against static libs,
  6193. - # but need to link against shared
  6194. + depdepl=
  6195. eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
  6196. - eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  6197. if test -n "$deplibrary_names" ; then
  6198. for tmp in $deplibrary_names ; do
  6199. depdepl=$tmp
  6200. done
  6201. - if test -f "$deplibdir/$depdepl" ; then
  6202. - depdepl="$deplibdir/$depdepl"
  6203. - elif test -f "$path/$depdepl" ; then
  6204. - depdepl="$path/$depdepl"
  6205. - else
  6206. - # Can't find it, oh well...
  6207. - depdepl=
  6208. + if test -f "$absdir/$objdir/$depdepl" ; then
  6209. + depdepl="$absdir/$objdir/$depdepl"
  6210. + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  6211. + if test -z "$darwin_install_name"; then
  6212. + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
  6213. + fi
  6214. + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
  6215. + linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
  6216. + path=
  6217. fi
  6218. - # do not add paths which are already there
  6219. - case " $newlib_search_path " in
  6220. - *" $path "*) ;;
  6221. - *) newlib_search_path="$newlib_search_path $path";;
  6222. - esac
  6223. fi
  6224. - path=""
  6225. ;;
  6226. *)
  6227. - path="-L$path"
  6228. - ;;
  6229. - esac
  6230. - ;;
  6231. - -l*)
  6232. - case $host in
  6233. - *-*-darwin*)
  6234. - # Again, we only want to link against shared libraries
  6235. - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
  6236. - for tmp in $newlib_search_path ; do
  6237. - if test -f "$tmp/lib$tmp_libs.dylib" ; then
  6238. - eval depdepl="$tmp/lib$tmp_libs.dylib"
  6239. - break
  6240. - fi
  6241. - done
  6242. - path=""
  6243. + path="-L$absdir/$objdir"
  6244. ;;
  6245. - *) continue ;;
  6246. esac
  6247. + else
  6248. + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  6249. + test -z "$libdir" && \
  6250. + func_fatal_error "\`$deplib' is not a valid libtool archive"
  6251. + test "$absdir" != "$libdir" && \
  6252. + func_warning "\`$deplib' seems to be moved"
  6253. +
  6254. + path="-L$absdir"
  6255. + fi
  6256. ;;
  6257. - *) continue ;;
  6258. esac
  6259. case " $deplibs " in
  6260. *" $path "*) ;;
  6261. *) deplibs="$path $deplibs" ;;
  6262. esac
  6263. - case " $deplibs " in
  6264. - *" $depdepl "*) ;;
  6265. - *) deplibs="$depdepl $deplibs" ;;
  6266. - esac
  6267. done
  6268. fi # link_all_deplibs != no
  6269. fi # linkmode = lib
  6270. done # for deplib in $libs
  6271. + if test "$pass" = link; then
  6272. + if test "$linkmode" = "prog"; then
  6273. + compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
  6274. + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
  6275. + else
  6276. + compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  6277. + fi
  6278. + fi
  6279. dependency_libs="$newdependency_libs"
  6280. if test "$pass" = dlpreopen; then
  6281. # Link the dlpreopened libraries before other libraries
  6282. @@ -3117,39 +6066,36 @@ EOF
  6283. done # for pass
  6284. if test "$linkmode" = prog; then
  6285. dlfiles="$newdlfiles"
  6286. + fi
  6287. + if test "$linkmode" = prog || test "$linkmode" = lib; then
  6288. dlprefiles="$newdlprefiles"
  6289. fi
  6290. case $linkmode in
  6291. oldlib)
  6292. + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  6293. + func_warning "\`-dlopen' is ignored for archives"
  6294. + fi
  6295. +
  6296. case " $deplibs" in
  6297. *\ -l* | *\ -L*)
  6298. - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
  6299. + func_warning "\`-l' and \`-L' are ignored for archives" ;;
  6300. esac
  6301. - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  6302. - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  6303. - fi
  6304. -
  6305. - if test -n "$rpath"; then
  6306. - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  6307. - fi
  6308. + test -n "$rpath" && \
  6309. + func_warning "\`-rpath' is ignored for archives"
  6310. - if test -n "$xrpath"; then
  6311. - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  6312. - fi
  6313. + test -n "$xrpath" && \
  6314. + func_warning "\`-R' is ignored for archives"
  6315. - if test -n "$vinfo"; then
  6316. - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
  6317. - fi
  6318. + test -n "$vinfo" && \
  6319. + func_warning "\`-version-info/-version-number' is ignored for archives"
  6320. - if test -n "$release"; then
  6321. - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  6322. - fi
  6323. + test -n "$release" && \
  6324. + func_warning "\`-release' is ignored for archives"
  6325. - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  6326. - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  6327. - fi
  6328. + test -n "$export_symbols$export_symbols_regex" && \
  6329. + func_warning "\`-export-symbols' is ignored for archives"
  6330. # Now set the variables for building old libraries.
  6331. build_libtool_libs=no
  6332. @@ -3161,48 +6107,48 @@ EOF
  6333. # Make sure we only generate libraries of the form `libNAME.la'.
  6334. case $outputname in
  6335. lib*)
  6336. - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  6337. + func_stripname 'lib' '.la' "$outputname"
  6338. + name=$func_stripname_result
  6339. eval shared_ext=\"$shrext_cmds\"
  6340. eval libname=\"$libname_spec\"
  6341. ;;
  6342. *)
  6343. - if test "$module" = no; then
  6344. - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  6345. - $echo "$help" 1>&2
  6346. - exit $EXIT_FAILURE
  6347. - fi
  6348. + test "$module" = no && \
  6349. + func_fatal_help "libtool library \`$output' must begin with \`lib'"
  6350. +
  6351. if test "$need_lib_prefix" != no; then
  6352. # Add the "lib" prefix for modules if required
  6353. - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  6354. + func_stripname '' '.la' "$outputname"
  6355. + name=$func_stripname_result
  6356. eval shared_ext=\"$shrext_cmds\"
  6357. eval libname=\"$libname_spec\"
  6358. else
  6359. - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  6360. + func_stripname '' '.la' "$outputname"
  6361. + libname=$func_stripname_result
  6362. fi
  6363. ;;
  6364. esac
  6365. if test -n "$objs"; then
  6366. if test "$deplibs_check_method" != pass_all; then
  6367. - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
  6368. - exit $EXIT_FAILURE
  6369. + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
  6370. else
  6371. - $echo
  6372. - $echo "*** Warning: Linking the shared library $output against the non-libtool"
  6373. - $echo "*** objects $objs is not portable!"
  6374. + $ECHO
  6375. + $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
  6376. + $ECHO "*** objects $objs is not portable!"
  6377. libobjs="$libobjs $objs"
  6378. fi
  6379. fi
  6380. - if test "$dlself" != no; then
  6381. - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
  6382. - fi
  6383. + test "$dlself" != no && \
  6384. + func_warning "\`-dlopen self' is ignored for libtool libraries"
  6385. set dummy $rpath
  6386. - if test "$#" -gt 2; then
  6387. - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
  6388. - fi
  6389. - install_libdir="$2"
  6390. + shift
  6391. + test "$#" -gt 1 && \
  6392. + func_warning "ignoring multiple \`-rpath's for a libtool library"
  6393. +
  6394. + install_libdir="$1"
  6395. oldlibs=
  6396. if test -z "$rpath"; then
  6397. @@ -3216,25 +6162,21 @@ EOF
  6398. build_old_libs=yes
  6399. fi
  6400. - if test -n "$vinfo"; then
  6401. - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
  6402. - fi
  6403. + test -n "$vinfo" && \
  6404. + func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
  6405. - if test -n "$release"; then
  6406. - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  6407. - fi
  6408. + test -n "$release" && \
  6409. + func_warning "\`-release' is ignored for convenience libraries"
  6410. else
  6411. # Parse the version information argument.
  6412. save_ifs="$IFS"; IFS=':'
  6413. set dummy $vinfo 0 0 0
  6414. + shift
  6415. IFS="$save_ifs"
  6416. - if test -n "$8"; then
  6417. - $echo "$modename: too many parameters to \`-version-info'" 1>&2
  6418. - $echo "$help" 1>&2
  6419. - exit $EXIT_FAILURE
  6420. - fi
  6421. + test -n "$7" && \
  6422. + func_fatal_help "too many parameters to \`-version-info'"
  6423. # convert absolute version numbers to libtool ages
  6424. # this retains compatibility with .la files and attempts
  6425. @@ -3242,9 +6184,9 @@ EOF
  6426. case $vinfo_number in
  6427. yes)
  6428. - number_major="$2"
  6429. - number_minor="$3"
  6430. - number_revision="$4"
  6431. + number_major="$1"
  6432. + number_minor="$2"
  6433. + number_revision="$3"
  6434. #
  6435. # There are really only two kinds -- those that
  6436. # use the current revision as the major version
  6437. @@ -3254,7 +6196,8 @@ EOF
  6438. #
  6439. case $version_type in
  6440. darwin|linux|osf|windows|none)
  6441. - current=`expr $number_major + $number_minor`
  6442. + func_arith $number_major + $number_minor
  6443. + current=$func_arith_result
  6444. age="$number_minor"
  6445. revision="$number_revision"
  6446. ;;
  6447. @@ -3264,7 +6207,8 @@ EOF
  6448. age="0"
  6449. ;;
  6450. irix|nonstopux)
  6451. - current=`expr $number_major + $number_minor`
  6452. + func_arith $number_major + $number_minor
  6453. + current=$func_arith_result
  6454. age="$number_minor"
  6455. revision="$number_minor"
  6456. lt_irix_increment=no
  6457. @@ -3272,9 +6216,9 @@ EOF
  6458. esac
  6459. ;;
  6460. no)
  6461. - current="$2"
  6462. - revision="$3"
  6463. - age="$4"
  6464. + current="$1"
  6465. + revision="$2"
  6466. + age="$3"
  6467. ;;
  6468. esac
  6469. @@ -3282,34 +6226,30 @@ EOF
  6470. case $current in
  6471. 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]) ;;
  6472. *)
  6473. - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
  6474. - $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  6475. - exit $EXIT_FAILURE
  6476. + func_error "CURRENT \`$current' must be a nonnegative integer"
  6477. + func_fatal_error "\`$vinfo' is not valid version information"
  6478. ;;
  6479. esac
  6480. case $revision in
  6481. 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]) ;;
  6482. *)
  6483. - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
  6484. - $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  6485. - exit $EXIT_FAILURE
  6486. + func_error "REVISION \`$revision' must be a nonnegative integer"
  6487. + func_fatal_error "\`$vinfo' is not valid version information"
  6488. ;;
  6489. esac
  6490. case $age in
  6491. 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]) ;;
  6492. *)
  6493. - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
  6494. - $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  6495. - exit $EXIT_FAILURE
  6496. + func_error "AGE \`$age' must be a nonnegative integer"
  6497. + func_fatal_error "\`$vinfo' is not valid version information"
  6498. ;;
  6499. esac
  6500. if test "$age" -gt "$current"; then
  6501. - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  6502. - $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  6503. - exit $EXIT_FAILURE
  6504. + func_error "AGE \`$age' is greater than the current interface number \`$current'"
  6505. + func_fatal_error "\`$vinfo' is not valid version information"
  6506. fi
  6507. # Calculate the version variables.
  6508. @@ -3322,10 +6262,12 @@ EOF
  6509. darwin)
  6510. # Like Linux, but with the current version available in
  6511. # verstring for coding it into the library header
  6512. - major=.`expr $current - $age`
  6513. + func_arith $current - $age
  6514. + major=.$func_arith_result
  6515. versuffix="$major.$age.$revision"
  6516. # Darwin ld doesn't like 0 for these options...
  6517. - minor_current=`expr $current + 1`
  6518. + func_arith $current + 1
  6519. + minor_current=$func_arith_result
  6520. xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
  6521. verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
  6522. ;;
  6523. @@ -3337,15 +6279,17 @@ EOF
  6524. freebsd-elf)
  6525. major=".$current"
  6526. - versuffix=".$current";
  6527. + versuffix=".$current"
  6528. ;;
  6529. irix | nonstopux)
  6530. if test "X$lt_irix_increment" = "Xno"; then
  6531. - major=`expr $current - $age`
  6532. + func_arith $current - $age
  6533. else
  6534. - major=`expr $current - $age + 1`
  6535. + func_arith $current - $age + 1
  6536. fi
  6537. + major=$func_arith_result
  6538. +
  6539. case $version_type in
  6540. nonstopux) verstring_prefix=nonstopux ;;
  6541. *) verstring_prefix=sgi ;;
  6542. @@ -3355,8 +6299,10 @@ EOF
  6543. # Add in all the interfaces that we are compatible with.
  6544. loop=$revision
  6545. while test "$loop" -ne 0; do
  6546. - iface=`expr $revision - $loop`
  6547. - loop=`expr $loop - 1`
  6548. + func_arith $revision - $loop
  6549. + iface=$func_arith_result
  6550. + func_arith $loop - 1
  6551. + loop=$func_arith_result
  6552. verstring="$verstring_prefix$major.$iface:$verstring"
  6553. done
  6554. @@ -3366,20 +6312,24 @@ EOF
  6555. ;;
  6556. linux)
  6557. - major=.`expr $current - $age`
  6558. + func_arith $current - $age
  6559. + major=.$func_arith_result
  6560. versuffix="$major.$age.$revision"
  6561. ;;
  6562. osf)
  6563. - major=.`expr $current - $age`
  6564. + func_arith $current - $age
  6565. + major=.$func_arith_result
  6566. versuffix=".$current.$age.$revision"
  6567. verstring="$current.$age.$revision"
  6568. # Add in all the interfaces that we are compatible with.
  6569. loop=$age
  6570. while test "$loop" -ne 0; do
  6571. - iface=`expr $current - $loop`
  6572. - loop=`expr $loop - 1`
  6573. + func_arith $current - $loop
  6574. + iface=$func_arith_result
  6575. + func_arith $loop - 1
  6576. + loop=$func_arith_result
  6577. verstring="$verstring:${iface}.0"
  6578. done
  6579. @@ -3387,6 +6337,11 @@ EOF
  6580. verstring="$verstring:${current}.0"
  6581. ;;
  6582. + qnx)
  6583. + major=".$current"
  6584. + versuffix=".$current"
  6585. + ;;
  6586. +
  6587. sunos)
  6588. major=".$current"
  6589. versuffix=".$current.$revision"
  6590. @@ -3395,14 +6350,13 @@ EOF
  6591. windows)
  6592. # Use '-' rather than '.', since we only want one
  6593. # extension on DOS 8.3 filesystems.
  6594. - major=`expr $current - $age`
  6595. + func_arith $current - $age
  6596. + major=$func_arith_result
  6597. versuffix="-$major"
  6598. ;;
  6599. *)
  6600. - $echo "$modename: unknown library version type \`$version_type'" 1>&2
  6601. - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
  6602. - exit $EXIT_FAILURE
  6603. + func_fatal_configuration "unknown library version type \`$version_type'"
  6604. ;;
  6605. esac
  6606. @@ -3436,7 +6390,7 @@ EOF
  6607. # Check to see if the archive will have undefined symbols.
  6608. if test "$allow_undefined" = yes; then
  6609. if test "$allow_undefined_flag" = unsupported; then
  6610. - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  6611. + func_warning "undefined symbols not allowed in $host shared libraries"
  6612. build_libtool_libs=no
  6613. build_old_libs=yes
  6614. fi
  6615. @@ -3444,21 +6398,26 @@ EOF
  6616. # Don't allow undefined symbols.
  6617. allow_undefined_flag="$no_undefined_flag"
  6618. fi
  6619. +
  6620. fi
  6621. + func_generate_dlsyms "$libname" "$libname" "yes"
  6622. + libobjs="$libobjs $symfileobj"
  6623. + test "X$libobjs" = "X " && libobjs=
  6624. +
  6625. if test "$mode" != relink; then
  6626. # Remove our outputs, but don't remove object files since they
  6627. # may have been created when compiling PIC objects.
  6628. removelist=
  6629. - tempremovelist=`$echo "$output_objdir/*"`
  6630. + tempremovelist=`$ECHO "$output_objdir/*"`
  6631. for p in $tempremovelist; do
  6632. case $p in
  6633. - *.$objext)
  6634. + *.$objext | *.gcno)
  6635. ;;
  6636. $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
  6637. if test "X$precious_files_regex" != "X"; then
  6638. - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  6639. - then
  6640. + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
  6641. + then
  6642. continue
  6643. fi
  6644. fi
  6645. @@ -3467,10 +6426,8 @@ EOF
  6646. *) ;;
  6647. esac
  6648. done
  6649. - if test -n "$removelist"; then
  6650. - $show "${rm}r $removelist"
  6651. - $run ${rm}r $removelist
  6652. - fi
  6653. + test -n "$removelist" && \
  6654. + func_show_eval "${RM}r \$removelist"
  6655. fi
  6656. # Now set the variables for building old libraries.
  6657. @@ -3478,14 +6435,14 @@ EOF
  6658. oldlibs="$oldlibs $output_objdir/$libname.$libext"
  6659. # Transform .lo files to .o files.
  6660. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  6661. + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  6662. fi
  6663. # Eliminate all temporary directories.
  6664. #for path in $notinst_path; do
  6665. - # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
  6666. - # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
  6667. - # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
  6668. + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
  6669. + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
  6670. + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
  6671. #done
  6672. if test -n "$xrpath"; then
  6673. @@ -3526,12 +6483,12 @@ EOF
  6674. if test "$build_libtool_libs" = yes; then
  6675. if test -n "$rpath"; then
  6676. case $host in
  6677. - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
  6678. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
  6679. # these systems don't actually have a c library (as such)!
  6680. ;;
  6681. *-*-rhapsody* | *-*-darwin1.[012])
  6682. # Rhapsody C library is in the System framework
  6683. - deplibs="$deplibs -framework System"
  6684. + deplibs="$deplibs System.ltframework"
  6685. ;;
  6686. *-*-netbsd*)
  6687. # Don't link with libc until the a.out ld.so is fixed.
  6688. @@ -3545,7 +6502,7 @@ EOF
  6689. *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
  6690. # Compiler inserts libc in the correct place for threads to work
  6691. ;;
  6692. - *)
  6693. + *)
  6694. # Add libc to deplibs on all other systems if necessary.
  6695. if test "$build_libtool_need_lc" = "yes"; then
  6696. deplibs="$deplibs -lc"
  6697. @@ -3582,17 +6539,18 @@ EOF
  6698. # limits. Maybe even breaks it. We compile a program, linking it
  6699. # against the deplibs as a proxy for the library. Then we can check
  6700. # whether they linked in statically or dynamically with ldd.
  6701. - $rm conftest.c
  6702. + $opt_dry_run || $RM conftest.c
  6703. cat > conftest.c <<EOF
  6704. int main() { return 0; }
  6705. EOF
  6706. - $rm conftest
  6707. + $opt_dry_run || $RM conftest
  6708. if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
  6709. ldd_output=`ldd conftest`
  6710. for i in $deplibs; do
  6711. - name=`expr $i : '-l\(.*\)'`
  6712. - # If $name is empty we are operating on a -L argument.
  6713. - if test "$name" != "" && test "$name" != "0"; then
  6714. + case $i in
  6715. + -l*)
  6716. + func_stripname -l '' "$i"
  6717. + name=$func_stripname_result
  6718. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6719. case " $predeps $postdeps " in
  6720. *" $i "*)
  6721. @@ -3600,37 +6558,40 @@ EOF
  6722. i=""
  6723. ;;
  6724. esac
  6725. - fi
  6726. + fi
  6727. if test -n "$i" ; then
  6728. - libname=`eval \\$echo \"$libname_spec\"`
  6729. - deplib_matches=`eval \\$echo \"$library_names_spec\"`
  6730. - set dummy $deplib_matches
  6731. - deplib_match=$2
  6732. + libname=`eval "\\$ECHO \"$libname_spec\""`
  6733. + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  6734. + set dummy $deplib_matches; shift
  6735. + deplib_match=$1
  6736. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  6737. newdeplibs="$newdeplibs $i"
  6738. else
  6739. droppeddeps=yes
  6740. - $echo
  6741. - $echo "*** Warning: dynamic linker does not accept needed library $i."
  6742. - $echo "*** I have the capability to make that library automatically link in when"
  6743. - $echo "*** you link to this library. But I can only do this if you have a"
  6744. - $echo "*** shared version of the library, which I believe you do not have"
  6745. - $echo "*** because a test_compile did reveal that the linker did not use it for"
  6746. - $echo "*** its dynamic dependency list that programs get resolved with at runtime."
  6747. + $ECHO
  6748. + $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  6749. + $ECHO "*** I have the capability to make that library automatically link in when"
  6750. + $ECHO "*** you link to this library. But I can only do this if you have a"
  6751. + $ECHO "*** shared version of the library, which I believe you do not have"
  6752. + $ECHO "*** because a test_compile did reveal that the linker did not use it for"
  6753. + $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
  6754. fi
  6755. fi
  6756. - else
  6757. + ;;
  6758. + *)
  6759. newdeplibs="$newdeplibs $i"
  6760. - fi
  6761. + ;;
  6762. + esac
  6763. done
  6764. else
  6765. # Error occurred in the first compile. Let's try to salvage
  6766. # the situation: Compile a separate program for each library.
  6767. for i in $deplibs; do
  6768. - name=`expr $i : '-l\(.*\)'`
  6769. - # If $name is empty we are operating on a -L argument.
  6770. - if test "$name" != "" && test "$name" != "0"; then
  6771. - $rm conftest
  6772. + case $i in
  6773. + -l*)
  6774. + func_stripname -l '' "$i"
  6775. + name=$func_stripname_result
  6776. + $opt_dry_run || $RM conftest
  6777. if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
  6778. ldd_output=`ldd conftest`
  6779. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6780. @@ -3642,44 +6603,47 @@ EOF
  6781. esac
  6782. fi
  6783. if test -n "$i" ; then
  6784. - libname=`eval \\$echo \"$libname_spec\"`
  6785. - deplib_matches=`eval \\$echo \"$library_names_spec\"`
  6786. - set dummy $deplib_matches
  6787. - deplib_match=$2
  6788. + libname=`eval "\\$ECHO \"$libname_spec\""`
  6789. + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
  6790. + set dummy $deplib_matches; shift
  6791. + deplib_match=$1
  6792. if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  6793. newdeplibs="$newdeplibs $i"
  6794. else
  6795. droppeddeps=yes
  6796. - $echo
  6797. - $echo "*** Warning: dynamic linker does not accept needed library $i."
  6798. - $echo "*** I have the capability to make that library automatically link in when"
  6799. - $echo "*** you link to this library. But I can only do this if you have a"
  6800. - $echo "*** shared version of the library, which you do not appear to have"
  6801. - $echo "*** because a test_compile did reveal that the linker did not use this one"
  6802. - $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
  6803. + $ECHO
  6804. + $ECHO "*** Warning: dynamic linker does not accept needed library $i."
  6805. + $ECHO "*** I have the capability to make that library automatically link in when"
  6806. + $ECHO "*** you link to this library. But I can only do this if you have a"
  6807. + $ECHO "*** shared version of the library, which you do not appear to have"
  6808. + $ECHO "*** because a test_compile did reveal that the linker did not use this one"
  6809. + $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
  6810. fi
  6811. fi
  6812. else
  6813. droppeddeps=yes
  6814. - $echo
  6815. - $echo "*** Warning! Library $i is needed by this library but I was not able to"
  6816. - $echo "*** make it link in! You will probably need to install it or some"
  6817. - $echo "*** library that it depends on before this library will be fully"
  6818. - $echo "*** functional. Installing it before continuing would be even better."
  6819. + $ECHO
  6820. + $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
  6821. + $ECHO "*** make it link in! You will probably need to install it or some"
  6822. + $ECHO "*** library that it depends on before this library will be fully"
  6823. + $ECHO "*** functional. Installing it before continuing would be even better."
  6824. fi
  6825. - else
  6826. + ;;
  6827. + *)
  6828. newdeplibs="$newdeplibs $i"
  6829. - fi
  6830. + ;;
  6831. + esac
  6832. done
  6833. fi
  6834. ;;
  6835. file_magic*)
  6836. - set dummy $deplibs_check_method
  6837. - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  6838. + set dummy $deplibs_check_method; shift
  6839. + file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  6840. for a_deplib in $deplibs; do
  6841. - name=`expr $a_deplib : '-l\(.*\)'`
  6842. - # If $name is empty we are operating on a -L argument.
  6843. - if test "$name" != "" && test "$name" != "0"; then
  6844. + case $a_deplib in
  6845. + -l*)
  6846. + func_stripname -l '' "$a_deplib"
  6847. + name=$func_stripname_result
  6848. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6849. case " $predeps $postdeps " in
  6850. *" $a_deplib "*)
  6851. @@ -3689,13 +6653,13 @@ EOF
  6852. esac
  6853. fi
  6854. if test -n "$a_deplib" ; then
  6855. - libname=`eval \\$echo \"$libname_spec\"`
  6856. + libname=`eval "\\$ECHO \"$libname_spec\""`
  6857. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  6858. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  6859. for potent_lib in $potential_libs; do
  6860. # Follow soft links.
  6861. - if ls -lLd "$potent_lib" 2>/dev/null \
  6862. - | grep " -> " >/dev/null; then
  6863. + if ls -lLd "$potent_lib" 2>/dev/null |
  6864. + $GREP " -> " >/dev/null; then
  6865. continue
  6866. fi
  6867. # The statement above tries to avoid entering an
  6868. @@ -3708,12 +6672,12 @@ EOF
  6869. potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
  6870. case $potliblink in
  6871. [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
  6872. - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  6873. + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  6874. esac
  6875. done
  6876. - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
  6877. - | ${SED} 10q \
  6878. - | $EGREP "$file_magic_regex" > /dev/null; then
  6879. + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
  6880. + $SED -e 10q |
  6881. + $EGREP "$file_magic_regex" > /dev/null; then
  6882. newdeplibs="$newdeplibs $a_deplib"
  6883. a_deplib=""
  6884. break 2
  6885. @@ -3723,32 +6687,35 @@ EOF
  6886. fi
  6887. if test -n "$a_deplib" ; then
  6888. droppeddeps=yes
  6889. - $echo
  6890. - $echo "*** Warning: linker path does not have real file for library $a_deplib."
  6891. - $echo "*** I have the capability to make that library automatically link in when"
  6892. - $echo "*** you link to this library. But I can only do this if you have a"
  6893. - $echo "*** shared version of the library, which you do not appear to have"
  6894. - $echo "*** because I did check the linker path looking for a file starting"
  6895. + $ECHO
  6896. + $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  6897. + $ECHO "*** I have the capability to make that library automatically link in when"
  6898. + $ECHO "*** you link to this library. But I can only do this if you have a"
  6899. + $ECHO "*** shared version of the library, which you do not appear to have"
  6900. + $ECHO "*** because I did check the linker path looking for a file starting"
  6901. if test -z "$potlib" ; then
  6902. - $echo "*** with $libname but no candidates were found. (...for file magic test)"
  6903. + $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
  6904. else
  6905. - $echo "*** with $libname and none of the candidates passed a file format test"
  6906. - $echo "*** using a file magic. Last file checked: $potlib"
  6907. + $ECHO "*** with $libname and none of the candidates passed a file format test"
  6908. + $ECHO "*** using a file magic. Last file checked: $potlib"
  6909. fi
  6910. fi
  6911. - else
  6912. + ;;
  6913. + *)
  6914. # Add a -L argument.
  6915. newdeplibs="$newdeplibs $a_deplib"
  6916. - fi
  6917. + ;;
  6918. + esac
  6919. done # Gone through all deplibs.
  6920. ;;
  6921. match_pattern*)
  6922. - set dummy $deplibs_check_method
  6923. - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
  6924. + set dummy $deplibs_check_method; shift
  6925. + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
  6926. for a_deplib in $deplibs; do
  6927. - name=`expr $a_deplib : '-l\(.*\)'`
  6928. - # If $name is empty we are operating on a -L argument.
  6929. - if test -n "$name" && test "$name" != "0"; then
  6930. + case $a_deplib in
  6931. + -l*)
  6932. + func_stripname -l '' "$a_deplib"
  6933. + name=$func_stripname_result
  6934. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6935. case " $predeps $postdeps " in
  6936. *" $a_deplib "*)
  6937. @@ -3758,14 +6725,13 @@ EOF
  6938. esac
  6939. fi
  6940. if test -n "$a_deplib" ; then
  6941. - libname=`eval \\$echo \"$libname_spec\"`
  6942. + libname=`eval "\\$ECHO \"$libname_spec\""`
  6943. for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
  6944. potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  6945. for potent_lib in $potential_libs; do
  6946. potlib="$potent_lib" # see symlink-check above in file_magic test
  6947. - if eval $echo \"$potent_lib\" 2>/dev/null \
  6948. - | ${SED} 10q \
  6949. - | $EGREP "$match_pattern_regex" > /dev/null; then
  6950. + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
  6951. + $EGREP "$match_pattern_regex" > /dev/null; then
  6952. newdeplibs="$newdeplibs $a_deplib"
  6953. a_deplib=""
  6954. break 2
  6955. @@ -3775,44 +6741,46 @@ EOF
  6956. fi
  6957. if test -n "$a_deplib" ; then
  6958. droppeddeps=yes
  6959. - $echo
  6960. - $echo "*** Warning: linker path does not have real file for library $a_deplib."
  6961. - $echo "*** I have the capability to make that library automatically link in when"
  6962. - $echo "*** you link to this library. But I can only do this if you have a"
  6963. - $echo "*** shared version of the library, which you do not appear to have"
  6964. - $echo "*** because I did check the linker path looking for a file starting"
  6965. + $ECHO
  6966. + $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
  6967. + $ECHO "*** I have the capability to make that library automatically link in when"
  6968. + $ECHO "*** you link to this library. But I can only do this if you have a"
  6969. + $ECHO "*** shared version of the library, which you do not appear to have"
  6970. + $ECHO "*** because I did check the linker path looking for a file starting"
  6971. if test -z "$potlib" ; then
  6972. - $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
  6973. + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
  6974. else
  6975. - $echo "*** with $libname and none of the candidates passed a file format test"
  6976. - $echo "*** using a regex pattern. Last file checked: $potlib"
  6977. + $ECHO "*** with $libname and none of the candidates passed a file format test"
  6978. + $ECHO "*** using a regex pattern. Last file checked: $potlib"
  6979. fi
  6980. fi
  6981. - else
  6982. + ;;
  6983. + *)
  6984. # Add a -L argument.
  6985. newdeplibs="$newdeplibs $a_deplib"
  6986. - fi
  6987. + ;;
  6988. + esac
  6989. done # Gone through all deplibs.
  6990. ;;
  6991. none | unknown | *)
  6992. newdeplibs=""
  6993. - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  6994. - -e 's/ -[LR][^ ]*//g'`
  6995. + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
  6996. + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
  6997. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
  6998. for i in $predeps $postdeps ; do
  6999. # can't use Xsed below, because $i might contain '/'
  7000. - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
  7001. + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
  7002. done
  7003. fi
  7004. - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
  7005. - | grep . >/dev/null; then
  7006. - $echo
  7007. + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
  7008. + $GREP . >/dev/null; then
  7009. + $ECHO
  7010. if test "X$deplibs_check_method" = "Xnone"; then
  7011. - $echo "*** Warning: inter-library dependencies are not supported in this platform."
  7012. + $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
  7013. else
  7014. - $echo "*** Warning: inter-library dependencies are not known to be supported."
  7015. + $ECHO "*** Warning: inter-library dependencies are not known to be supported."
  7016. fi
  7017. - $echo "*** All declared inter-library dependencies are being dropped."
  7018. + $ECHO "*** All declared inter-library dependencies are being dropped."
  7019. droppeddeps=yes
  7020. fi
  7021. ;;
  7022. @@ -3825,24 +6793,24 @@ EOF
  7023. case $host in
  7024. *-*-rhapsody* | *-*-darwin1.[012])
  7025. - # On Rhapsody replace the C library is the System framework
  7026. - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
  7027. + # On Rhapsody replace the C library with the System framework
  7028. + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  7029. ;;
  7030. esac
  7031. if test "$droppeddeps" = yes; then
  7032. if test "$module" = yes; then
  7033. - $echo
  7034. - $echo "*** Warning: libtool could not satisfy all declared inter-library"
  7035. - $echo "*** dependencies of module $libname. Therefore, libtool will create"
  7036. - $echo "*** a static module, that should work as long as the dlopening"
  7037. - $echo "*** application is linked with the -dlopen flag."
  7038. + $ECHO
  7039. + $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
  7040. + $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
  7041. + $ECHO "*** a static module, that should work as long as the dlopening"
  7042. + $ECHO "*** application is linked with the -dlopen flag."
  7043. if test -z "$global_symbol_pipe"; then
  7044. - $echo
  7045. - $echo "*** However, this would only work if libtool was able to extract symbol"
  7046. - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  7047. - $echo "*** not find such a program. So, this module is probably useless."
  7048. - $echo "*** \`nm' from GNU binutils and a full rebuild may help."
  7049. + $ECHO
  7050. + $ECHO "*** However, this would only work if libtool was able to extract symbol"
  7051. + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
  7052. + $ECHO "*** not find such a program. So, this module is probably useless."
  7053. + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
  7054. fi
  7055. if test "$build_old_libs" = no; then
  7056. oldlibs="$output_objdir/$libname.$libext"
  7057. @@ -3852,16 +6820,16 @@ EOF
  7058. build_libtool_libs=no
  7059. fi
  7060. else
  7061. - $echo "*** The inter-library dependencies that have been dropped here will be"
  7062. - $echo "*** automatically added whenever a program is linked with this library"
  7063. - $echo "*** or is declared to -dlopen it."
  7064. + $ECHO "*** The inter-library dependencies that have been dropped here will be"
  7065. + $ECHO "*** automatically added whenever a program is linked with this library"
  7066. + $ECHO "*** or is declared to -dlopen it."
  7067. if test "$allow_undefined" = no; then
  7068. - $echo
  7069. - $echo "*** Since this library must not contain undefined symbols,"
  7070. - $echo "*** because either the platform does not support them or"
  7071. - $echo "*** it was explicitly requested with -no-undefined,"
  7072. - $echo "*** libtool will only create a static version of it."
  7073. + $ECHO
  7074. + $ECHO "*** Since this library must not contain undefined symbols,"
  7075. + $ECHO "*** because either the platform does not support them or"
  7076. + $ECHO "*** it was explicitly requested with -no-undefined,"
  7077. + $ECHO "*** libtool will only create a static version of it."
  7078. if test "$build_old_libs" = no; then
  7079. oldlibs="$output_objdir/$libname.$libext"
  7080. build_libtool_libs=module
  7081. @@ -3875,7 +6843,14 @@ EOF
  7082. # Done checking deplibs!
  7083. deplibs=$newdeplibs
  7084. fi
  7085. -
  7086. + # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  7087. + case $host in
  7088. + *-*-darwin*)
  7089. + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7090. + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7091. + deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7092. + ;;
  7093. + esac
  7094. # move library search paths that coincide with paths to not yet
  7095. # installed libraries to the beginning of the library search list
  7096. @@ -3904,7 +6879,6 @@ EOF
  7097. done
  7098. deplibs="$new_libs"
  7099. -
  7100. # All the library-specific variables (install_libdir is set above).
  7101. library_names=
  7102. old_library=
  7103. @@ -3949,10 +6923,7 @@ EOF
  7104. test -n "$hardcode_libdirs"; then
  7105. libdir="$hardcode_libdirs"
  7106. if test -n "$hardcode_libdir_flag_spec_ld"; then
  7107. - case $archive_cmds in
  7108. - *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
  7109. - *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
  7110. - esac
  7111. + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
  7112. else
  7113. eval dep_rpath=\"$hardcode_libdir_flag_spec\"
  7114. fi
  7115. @@ -3978,8 +6949,9 @@ EOF
  7116. eval shared_ext=\"$shrext_cmds\"
  7117. eval library_names=\"$library_names_spec\"
  7118. set dummy $library_names
  7119. - realname="$2"
  7120. - shift; shift
  7121. + shift
  7122. + realname="$1"
  7123. + shift
  7124. if test -n "$soname_spec"; then
  7125. eval soname=\"$soname_spec\"
  7126. @@ -3998,71 +6970,122 @@ EOF
  7127. done
  7128. # Use standard objects if they are pic
  7129. - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7130. + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7131. + test "X$libobjs" = "X " && libobjs=
  7132. +
  7133. + delfiles=
  7134. + if test -n "$export_symbols" && test -n "$include_expsyms"; then
  7135. + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
  7136. + export_symbols="$output_objdir/$libname.uexp"
  7137. + delfiles="$delfiles $export_symbols"
  7138. + fi
  7139. +
  7140. + orig_export_symbols=
  7141. + case $host_os in
  7142. + cygwin* | mingw* | cegcc*)
  7143. + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
  7144. + # exporting using user supplied symfile
  7145. + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
  7146. + # and it's NOT already a .def file. Must figure out
  7147. + # which of the given symbols are data symbols and tag
  7148. + # them as such. So, trigger use of export_symbols_cmds.
  7149. + # export_symbols gets reassigned inside the "prepare
  7150. + # the list of exported symbols" if statement, so the
  7151. + # include_expsyms logic still works.
  7152. + orig_export_symbols="$export_symbols"
  7153. + export_symbols=
  7154. + always_export_symbols=yes
  7155. + fi
  7156. + fi
  7157. + ;;
  7158. + esac
  7159. # Prepare the list of exported symbols
  7160. if test -z "$export_symbols"; then
  7161. if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  7162. - $show "generating symbol list for \`$libname.la'"
  7163. + func_verbose "generating symbol list for \`$libname.la'"
  7164. export_symbols="$output_objdir/$libname.exp"
  7165. - $run $rm $export_symbols
  7166. + $opt_dry_run || $RM $export_symbols
  7167. cmds=$export_symbols_cmds
  7168. save_ifs="$IFS"; IFS='~'
  7169. for cmd in $cmds; do
  7170. IFS="$save_ifs"
  7171. eval cmd=\"$cmd\"
  7172. - if len=`expr "X$cmd" : ".*"` &&
  7173. - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  7174. - $show "$cmd"
  7175. - $run eval "$cmd" || exit $?
  7176. - skipped_export=false
  7177. + func_len " $cmd"
  7178. + len=$func_len_result
  7179. + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  7180. + func_show_eval "$cmd" 'exit $?'
  7181. + skipped_export=false
  7182. else
  7183. - # The command line is too long to execute in one step.
  7184. - $show "using reloadable object file for export list..."
  7185. - skipped_export=:
  7186. + # The command line is too long to execute in one step.
  7187. + func_verbose "using reloadable object file for export list..."
  7188. + skipped_export=:
  7189. # Break out early, otherwise skipped_export may be
  7190. # set to false by a later but shorter cmd.
  7191. break
  7192. fi
  7193. done
  7194. IFS="$save_ifs"
  7195. - if test -n "$export_symbols_regex"; then
  7196. - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  7197. - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  7198. - $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  7199. - $run eval '$mv "${export_symbols}T" "$export_symbols"'
  7200. + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
  7201. + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  7202. + func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  7203. fi
  7204. fi
  7205. fi
  7206. if test -n "$export_symbols" && test -n "$include_expsyms"; then
  7207. - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  7208. + tmp_export_symbols="$export_symbols"
  7209. + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  7210. + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  7211. + fi
  7212. +
  7213. + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
  7214. + # The given exports_symbols file has to be filtered, so filter it.
  7215. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  7216. + # FIXME: $output_objdir/$libname.filter potentially contains lots of
  7217. + # 's' commands which not all seds can handle. GNU sed should be fine
  7218. + # though. Also, the filter scales superlinearly with the number of
  7219. + # global variables. join(1) would be nice here, but unfortunately
  7220. + # isn't a blessed tool.
  7221. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  7222. + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  7223. + export_symbols=$output_objdir/$libname.def
  7224. + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  7225. fi
  7226. tmp_deplibs=
  7227. for test_deplib in $deplibs; do
  7228. - case " $convenience " in
  7229. - *" $test_deplib "*) ;;
  7230. - *)
  7231. - tmp_deplibs="$tmp_deplibs $test_deplib"
  7232. - ;;
  7233. - esac
  7234. + case " $convenience " in
  7235. + *" $test_deplib "*) ;;
  7236. + *)
  7237. + tmp_deplibs="$tmp_deplibs $test_deplib"
  7238. + ;;
  7239. + esac
  7240. done
  7241. deplibs="$tmp_deplibs"
  7242. if test -n "$convenience"; then
  7243. + if test -n "$whole_archive_flag_spec" &&
  7244. + test "$compiler_needs_object" = yes &&
  7245. + test -z "$libobjs"; then
  7246. + # extract the archives, so we have objects to list.
  7247. + # TODO: could optimize this to just extract one archive.
  7248. + whole_archive_flag_spec=
  7249. + fi
  7250. if test -n "$whole_archive_flag_spec"; then
  7251. save_libobjs=$libobjs
  7252. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  7253. + test "X$libobjs" = "X " && libobjs=
  7254. else
  7255. gentop="$output_objdir/${outputname}x"
  7256. generated="$generated $gentop"
  7257. func_extract_archives $gentop $convenience
  7258. libobjs="$libobjs $func_extract_archives_result"
  7259. + test "X$libobjs" = "X " && libobjs=
  7260. fi
  7261. fi
  7262. -
  7263. +
  7264. if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  7265. eval flag=\"$thread_safe_flag_spec\"
  7266. linker_flags="$linker_flags $flag"
  7267. @@ -4070,7 +7093,7 @@ EOF
  7268. # Make a backup of the uninstalled library when relinking
  7269. if test "$mode" = relink; then
  7270. - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
  7271. + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
  7272. fi
  7273. # Do each of the archive commands.
  7274. @@ -4083,22 +7106,24 @@ EOF
  7275. cmds=$module_cmds
  7276. fi
  7277. else
  7278. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  7279. - eval test_cmds=\"$archive_expsym_cmds\"
  7280. - cmds=$archive_expsym_cmds
  7281. - else
  7282. - eval test_cmds=\"$archive_cmds\"
  7283. - cmds=$archive_cmds
  7284. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  7285. + eval test_cmds=\"$archive_expsym_cmds\"
  7286. + cmds=$archive_expsym_cmds
  7287. + else
  7288. + eval test_cmds=\"$archive_cmds\"
  7289. + cmds=$archive_cmds
  7290. fi
  7291. fi
  7292. if test "X$skipped_export" != "X:" &&
  7293. - len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  7294. - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  7295. + func_len " $test_cmds" &&
  7296. + len=$func_len_result &&
  7297. + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  7298. :
  7299. else
  7300. - # The command line is too long to link in one step, link piecewise.
  7301. - $echo "creating reloadable object files..."
  7302. + # The command line is too long to link in one step, link piecewise
  7303. + # or, if using GNU ld and skipped_export is not :, use a linker
  7304. + # script.
  7305. # Save the value of $output and $libobjs because we want to
  7306. # use them later. If we have whole_archive_flag_spec, we
  7307. @@ -4112,77 +7137,162 @@ EOF
  7308. save_libobjs=$libobjs
  7309. fi
  7310. save_output=$output
  7311. - output_la=`$echo "X$output" | $Xsed -e "$basename"`
  7312. + output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
  7313. # Clear the reloadable object creation command queue and
  7314. # initialize k to one.
  7315. test_cmds=
  7316. concat_cmds=
  7317. objlist=
  7318. - delfiles=
  7319. last_robj=
  7320. k=1
  7321. - output=$output_objdir/$output_la-${k}.$objext
  7322. - # Loop over the list of objects to be linked.
  7323. - for obj in $save_libobjs
  7324. - do
  7325. - eval test_cmds=\"$reload_cmds $objlist $last_robj\"
  7326. - if test "X$objlist" = X ||
  7327. - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  7328. - test "$len" -le "$max_cmd_len"; }; then
  7329. - objlist="$objlist $obj"
  7330. +
  7331. + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
  7332. + output=${output_objdir}/${output_la}.lnkscript
  7333. + func_verbose "creating GNU ld script: $output"
  7334. + $ECHO 'INPUT (' > $output
  7335. + for obj in $save_libobjs
  7336. + do
  7337. + $ECHO "$obj" >> $output
  7338. + done
  7339. + $ECHO ')' >> $output
  7340. + delfiles="$delfiles $output"
  7341. + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
  7342. + output=${output_objdir}/${output_la}.lnk
  7343. + func_verbose "creating linker input file list: $output"
  7344. + : > $output
  7345. + set x $save_libobjs
  7346. + shift
  7347. + firstobj=
  7348. + if test "$compiler_needs_object" = yes; then
  7349. + firstobj="$1 "
  7350. + shift
  7351. + fi
  7352. + for obj
  7353. + do
  7354. + $ECHO "$obj" >> $output
  7355. + done
  7356. + delfiles="$delfiles $output"
  7357. + output=$firstobj\"$file_list_spec$output\"
  7358. + else
  7359. + if test -n "$save_libobjs"; then
  7360. + func_verbose "creating reloadable object files..."
  7361. + output=$output_objdir/$output_la-${k}.$objext
  7362. + eval test_cmds=\"$reload_cmds\"
  7363. + func_len " $test_cmds"
  7364. + len0=$func_len_result
  7365. + len=$len0
  7366. +
  7367. + # Loop over the list of objects to be linked.
  7368. + for obj in $save_libobjs
  7369. + do
  7370. + func_len " $obj"
  7371. + func_arith $len + $func_len_result
  7372. + len=$func_arith_result
  7373. + if test "X$objlist" = X ||
  7374. + test "$len" -lt "$max_cmd_len"; then
  7375. + func_append objlist " $obj"
  7376. + else
  7377. + # The command $test_cmds is almost too long, add a
  7378. + # command to the queue.
  7379. + if test "$k" -eq 1 ; then
  7380. + # The first file doesn't have a previous command to add.
  7381. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  7382. + else
  7383. + # All subsequent reloadable object files will link in
  7384. + # the last one created.
  7385. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
  7386. + fi
  7387. + last_robj=$output_objdir/$output_la-${k}.$objext
  7388. + func_arith $k + 1
  7389. + k=$func_arith_result
  7390. + output=$output_objdir/$output_la-${k}.$objext
  7391. + objlist=$obj
  7392. + func_len " $last_robj"
  7393. + func_arith $len0 + $func_len_result
  7394. + len=$func_arith_result
  7395. + fi
  7396. + done
  7397. + # Handle the remaining objects by creating one last
  7398. + # reloadable object file. All subsequent reloadable object
  7399. + # files will link in the last one created.
  7400. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  7401. + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  7402. + if test -n "$last_robj"; then
  7403. + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
  7404. + fi
  7405. + delfiles="$delfiles $output"
  7406. +
  7407. else
  7408. - # The command $test_cmds is almost too long, add a
  7409. - # command to the queue.
  7410. - if test "$k" -eq 1 ; then
  7411. - # The first file doesn't have a previous command to add.
  7412. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
  7413. - else
  7414. - # All subsequent reloadable object files will link in
  7415. - # the last one created.
  7416. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
  7417. + output=
  7418. + fi
  7419. +
  7420. + if ${skipped_export-false}; then
  7421. + func_verbose "generating symbol list for \`$libname.la'"
  7422. + export_symbols="$output_objdir/$libname.exp"
  7423. + $opt_dry_run || $RM $export_symbols
  7424. + libobjs=$output
  7425. + # Append the command to create the export file.
  7426. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  7427. + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
  7428. + if test -n "$last_robj"; then
  7429. + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
  7430. fi
  7431. - last_robj=$output_objdir/$output_la-${k}.$objext
  7432. - k=`expr $k + 1`
  7433. - output=$output_objdir/$output_la-${k}.$objext
  7434. - objlist=$obj
  7435. - len=1
  7436. fi
  7437. - done
  7438. - # Handle the remaining objects by creating one last
  7439. - # reloadable object file. All subsequent reloadable object
  7440. - # files will link in the last one created.
  7441. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  7442. - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
  7443. - if ${skipped_export-false}; then
  7444. - $show "generating symbol list for \`$libname.la'"
  7445. - export_symbols="$output_objdir/$libname.exp"
  7446. - $run $rm $export_symbols
  7447. - libobjs=$output
  7448. - # Append the command to create the export file.
  7449. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
  7450. - fi
  7451. + test -n "$save_libobjs" &&
  7452. + func_verbose "creating a temporary reloadable object file: $output"
  7453. - # Set up a command to remove the reloadable object files
  7454. - # after they are used.
  7455. - i=0
  7456. - while test "$i" -lt "$k"
  7457. - do
  7458. - i=`expr $i + 1`
  7459. - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
  7460. - done
  7461. + # Loop through the commands generated above and execute them.
  7462. + save_ifs="$IFS"; IFS='~'
  7463. + for cmd in $concat_cmds; do
  7464. + IFS="$save_ifs"
  7465. + $opt_silent || {
  7466. + func_quote_for_expand "$cmd"
  7467. + eval "func_echo $func_quote_for_expand_result"
  7468. + }
  7469. + $opt_dry_run || eval "$cmd" || {
  7470. + lt_exit=$?
  7471. - $echo "creating a temporary reloadable object file: $output"
  7472. + # Restore the uninstalled library and exit
  7473. + if test "$mode" = relink; then
  7474. + ( cd "$output_objdir" && \
  7475. + $RM "${realname}T" && \
  7476. + $MV "${realname}U" "$realname" )
  7477. + fi
  7478. - # Loop through the commands generated above and execute them.
  7479. - save_ifs="$IFS"; IFS='~'
  7480. - for cmd in $concat_cmds; do
  7481. + exit $lt_exit
  7482. + }
  7483. + done
  7484. IFS="$save_ifs"
  7485. - $show "$cmd"
  7486. - $run eval "$cmd" || exit $?
  7487. - done
  7488. - IFS="$save_ifs"
  7489. +
  7490. + if test -n "$export_symbols_regex" && ${skipped_export-false}; then
  7491. + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  7492. + func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
  7493. + fi
  7494. + fi
  7495. +
  7496. + if ${skipped_export-false}; then
  7497. + if test -n "$export_symbols" && test -n "$include_expsyms"; then
  7498. + tmp_export_symbols="$export_symbols"
  7499. + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
  7500. + $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
  7501. + fi
  7502. +
  7503. + if test -n "$orig_export_symbols"; then
  7504. + # The given exports_symbols file has to be filtered, so filter it.
  7505. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
  7506. + # FIXME: $output_objdir/$libname.filter potentially contains lots of
  7507. + # 's' commands which not all seds can handle. GNU sed should be fine
  7508. + # though. Also, the filter scales superlinearly with the number of
  7509. + # global variables. join(1) would be nice here, but unfortunately
  7510. + # isn't a blessed tool.
  7511. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
  7512. + delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
  7513. + export_symbols=$output_objdir/$libname.def
  7514. + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
  7515. + fi
  7516. + fi
  7517. libobjs=$output
  7518. # Restore the value of output.
  7519. @@ -4190,6 +7300,7 @@ EOF
  7520. if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
  7521. eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  7522. + test "X$libobjs" = "X " && libobjs=
  7523. fi
  7524. # Expand the library linking commands again to reset the
  7525. # value of $libobjs for piecewise linking.
  7526. @@ -4202,28 +7313,45 @@ EOF
  7527. cmds=$module_cmds
  7528. fi
  7529. else
  7530. - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  7531. - cmds=$archive_expsym_cmds
  7532. - else
  7533. - cmds=$archive_cmds
  7534. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  7535. + cmds=$archive_expsym_cmds
  7536. + else
  7537. + cmds=$archive_cmds
  7538. fi
  7539. fi
  7540. + fi
  7541. - # Append the command to remove the reloadable object files
  7542. - # to the just-reset $cmds.
  7543. - eval cmds=\"\$cmds~\$rm $delfiles\"
  7544. + if test -n "$delfiles"; then
  7545. + # Append the command to remove temporary files to $cmds.
  7546. + eval cmds=\"\$cmds~\$RM $delfiles\"
  7547. fi
  7548. +
  7549. + # Add any objects from preloaded convenience libraries
  7550. + if test -n "$dlprefiles"; then
  7551. + gentop="$output_objdir/${outputname}x"
  7552. + generated="$generated $gentop"
  7553. +
  7554. + func_extract_archives $gentop $dlprefiles
  7555. + libobjs="$libobjs $func_extract_archives_result"
  7556. + test "X$libobjs" = "X " && libobjs=
  7557. + fi
  7558. +
  7559. save_ifs="$IFS"; IFS='~'
  7560. for cmd in $cmds; do
  7561. IFS="$save_ifs"
  7562. eval cmd=\"$cmd\"
  7563. - $show "$cmd"
  7564. - $run eval "$cmd" || {
  7565. + $opt_silent || {
  7566. + func_quote_for_expand "$cmd"
  7567. + eval "func_echo $func_quote_for_expand_result"
  7568. + }
  7569. + $opt_dry_run || eval "$cmd" || {
  7570. lt_exit=$?
  7571. # Restore the uninstalled library and exit
  7572. if test "$mode" = relink; then
  7573. - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
  7574. + ( cd "$output_objdir" && \
  7575. + $RM "${realname}T" && \
  7576. + $MV "${realname}U" "$realname" )
  7577. fi
  7578. exit $lt_exit
  7579. @@ -4233,12 +7361,11 @@ EOF
  7580. # Restore the uninstalled library and exit
  7581. if test "$mode" = relink; then
  7582. - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
  7583. + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
  7584. if test -n "$convenience"; then
  7585. if test -z "$whole_archive_flag_spec"; then
  7586. - $show "${rm}r $gentop"
  7587. - $run ${rm}r "$gentop"
  7588. + func_show_eval '${RM}r "$gentop"'
  7589. fi
  7590. fi
  7591. @@ -4248,8 +7375,7 @@ EOF
  7592. # Create links to the real library.
  7593. for linkname in $linknames; do
  7594. if test "$realname" != "$linkname"; then
  7595. - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  7596. - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  7597. + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
  7598. fi
  7599. done
  7600. @@ -4262,39 +7388,35 @@ EOF
  7601. ;;
  7602. obj)
  7603. + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  7604. + func_warning "\`-dlopen' is ignored for objects"
  7605. + fi
  7606. +
  7607. case " $deplibs" in
  7608. *\ -l* | *\ -L*)
  7609. - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
  7610. + func_warning "\`-l' and \`-L' are ignored for objects" ;;
  7611. esac
  7612. - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  7613. - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  7614. - fi
  7615. -
  7616. - if test -n "$rpath"; then
  7617. - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  7618. - fi
  7619. + test -n "$rpath" && \
  7620. + func_warning "\`-rpath' is ignored for objects"
  7621. - if test -n "$xrpath"; then
  7622. - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  7623. - fi
  7624. + test -n "$xrpath" && \
  7625. + func_warning "\`-R' is ignored for objects"
  7626. - if test -n "$vinfo"; then
  7627. - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  7628. - fi
  7629. + test -n "$vinfo" && \
  7630. + func_warning "\`-version-info' is ignored for objects"
  7631. - if test -n "$release"; then
  7632. - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  7633. - fi
  7634. + test -n "$release" && \
  7635. + func_warning "\`-release' is ignored for objects"
  7636. case $output in
  7637. *.lo)
  7638. - if test -n "$objs$old_deplibs"; then
  7639. - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  7640. - exit $EXIT_FAILURE
  7641. - fi
  7642. - libobj="$output"
  7643. - obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  7644. + test -n "$objs$old_deplibs" && \
  7645. + func_fatal_error "cannot build library object \`$output' from non-libtool objects"
  7646. +
  7647. + libobj=$output
  7648. + func_lo2o "$libobj"
  7649. + obj=$func_lo2o_result
  7650. ;;
  7651. *)
  7652. libobj=
  7653. @@ -4303,7 +7425,7 @@ EOF
  7654. esac
  7655. # Delete the old objects.
  7656. - $run $rm $obj $libobj
  7657. + $opt_dry_run || $RM $obj $libobj
  7658. # Objects from convenience libraries. This assumes
  7659. # single-version convenience libraries. Whenever we create
  7660. @@ -4319,7 +7441,7 @@ EOF
  7661. if test -n "$convenience"; then
  7662. if test -n "$whole_archive_flag_spec"; then
  7663. eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
  7664. - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
  7665. + reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
  7666. else
  7667. gentop="$output_objdir/${obj}x"
  7668. generated="$generated $gentop"
  7669. @@ -4330,24 +7452,15 @@ EOF
  7670. fi
  7671. # Create the old-style object.
  7672. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  7673. + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
  7674. output="$obj"
  7675. - cmds=$reload_cmds
  7676. - save_ifs="$IFS"; IFS='~'
  7677. - for cmd in $cmds; do
  7678. - IFS="$save_ifs"
  7679. - eval cmd=\"$cmd\"
  7680. - $show "$cmd"
  7681. - $run eval "$cmd" || exit $?
  7682. - done
  7683. - IFS="$save_ifs"
  7684. + func_execute_cmds "$reload_cmds" 'exit $?'
  7685. # Exit if we aren't doing a library object file.
  7686. if test -z "$libobj"; then
  7687. if test -n "$gentop"; then
  7688. - $show "${rm}r $gentop"
  7689. - $run ${rm}r $gentop
  7690. + func_show_eval '${RM}r "$gentop"'
  7691. fi
  7692. exit $EXIT_SUCCESS
  7693. @@ -4355,14 +7468,13 @@ EOF
  7694. if test "$build_libtool_libs" != yes; then
  7695. if test -n "$gentop"; then
  7696. - $show "${rm}r $gentop"
  7697. - $run ${rm}r $gentop
  7698. + func_show_eval '${RM}r "$gentop"'
  7699. fi
  7700. # Create an invalid libtool object if no PIC, so that we don't
  7701. # accidentally link it into a program.
  7702. # $show "echo timestamp > $libobj"
  7703. - # $run eval "echo timestamp > $libobj" || exit $?
  7704. + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
  7705. exit $EXIT_SUCCESS
  7706. fi
  7707. @@ -4370,20 +7482,11 @@ EOF
  7708. # Only do commands if we really have different PIC objects.
  7709. reload_objs="$libobjs $reload_conv_objs"
  7710. output="$libobj"
  7711. - cmds=$reload_cmds
  7712. - save_ifs="$IFS"; IFS='~'
  7713. - for cmd in $cmds; do
  7714. - IFS="$save_ifs"
  7715. - eval cmd=\"$cmd\"
  7716. - $show "$cmd"
  7717. - $run eval "$cmd" || exit $?
  7718. - done
  7719. - IFS="$save_ifs"
  7720. + func_execute_cmds "$reload_cmds" 'exit $?'
  7721. fi
  7722. if test -n "$gentop"; then
  7723. - $show "${rm}r $gentop"
  7724. - $run ${rm}r $gentop
  7725. + func_show_eval '${RM}r "$gentop"'
  7726. fi
  7727. exit $EXIT_SUCCESS
  7728. @@ -4391,39 +7494,45 @@ EOF
  7729. prog)
  7730. case $host in
  7731. - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
  7732. + *cygwin*) func_stripname '' '.exe' "$output"
  7733. + output=$func_stripname_result.exe;;
  7734. esac
  7735. - if test -n "$vinfo"; then
  7736. - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  7737. - fi
  7738. + test -n "$vinfo" && \
  7739. + func_warning "\`-version-info' is ignored for programs"
  7740. - if test -n "$release"; then
  7741. - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  7742. - fi
  7743. + test -n "$release" && \
  7744. + func_warning "\`-release' is ignored for programs"
  7745. - if test "$preload" = yes; then
  7746. - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
  7747. - test "$dlopen_self_static" = unknown; then
  7748. - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  7749. - fi
  7750. - fi
  7751. + test "$preload" = yes \
  7752. + && test "$dlopen_support" = unknown \
  7753. + && test "$dlopen_self" = unknown \
  7754. + && test "$dlopen_self_static" = unknown && \
  7755. + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
  7756. case $host in
  7757. *-*-rhapsody* | *-*-darwin1.[012])
  7758. # On Rhapsody replace the C library is the System framework
  7759. - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  7760. - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
  7761. + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  7762. + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
  7763. ;;
  7764. esac
  7765. case $host in
  7766. - *darwin*)
  7767. - # Don't allow lazy linking, it breaks C++ global constructors
  7768. - if test "$tagname" = CXX ; then
  7769. - compile_command="$compile_command ${wl}-bind_at_load"
  7770. - finalize_command="$finalize_command ${wl}-bind_at_load"
  7771. - fi
  7772. - ;;
  7773. + *-*-darwin*)
  7774. + # Don't allow lazy linking, it breaks C++ global constructors
  7775. + # But is supposedly fixed on 10.4 or later (yay!).
  7776. + if test "$tagname" = CXX ; then
  7777. + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
  7778. + 10.[0123])
  7779. + compile_command="$compile_command ${wl}-bind_at_load"
  7780. + finalize_command="$finalize_command ${wl}-bind_at_load"
  7781. + ;;
  7782. + esac
  7783. + fi
  7784. + # Time to change all our "foo.ltframework" stuff back to "-framework foo"
  7785. + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7786. + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
  7787. + ;;
  7788. esac
  7789. @@ -4498,14 +7607,16 @@ EOF
  7790. esac
  7791. fi
  7792. case $host in
  7793. - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
  7794. - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
  7795. + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
  7796. + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
  7797. case :$dllsearchpath: in
  7798. *":$libdir:"*) ;;
  7799. + ::) dllsearchpath=$libdir;;
  7800. *) dllsearchpath="$dllsearchpath:$libdir";;
  7801. esac
  7802. case :$dllsearchpath: in
  7803. *":$testbindir:"*) ;;
  7804. + ::) dllsearchpath=$testbindir;;
  7805. *) dllsearchpath="$dllsearchpath:$testbindir";;
  7806. esac
  7807. ;;
  7808. @@ -4557,281 +7668,51 @@ EOF
  7809. if test -n "$libobjs" && test "$build_old_libs" = yes; then
  7810. # Transform all the library objects into standard objects.
  7811. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7812. - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7813. - fi
  7814. -
  7815. - dlsyms=
  7816. - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
  7817. - if test -n "$NM" && test -n "$global_symbol_pipe"; then
  7818. - dlsyms="${outputname}S.c"
  7819. - else
  7820. - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  7821. - fi
  7822. + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7823. + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7824. fi
  7825. - if test -n "$dlsyms"; then
  7826. - case $dlsyms in
  7827. - "") ;;
  7828. - *.c)
  7829. - # Discover the nlist of each of the dlfiles.
  7830. - nlist="$output_objdir/${outputname}.nm"
  7831. -
  7832. - $show "$rm $nlist ${nlist}S ${nlist}T"
  7833. - $run $rm "$nlist" "${nlist}S" "${nlist}T"
  7834. -
  7835. - # Parse the name list into a source file.
  7836. - $show "creating $output_objdir/$dlsyms"
  7837. -
  7838. - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
  7839. -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  7840. -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  7841. -
  7842. -#ifdef __cplusplus
  7843. -extern \"C\" {
  7844. -#endif
  7845. -
  7846. -/* Prevent the only kind of declaration conflicts we can make. */
  7847. -#define lt_preloaded_symbols some_other_symbol
  7848. -
  7849. -/* External symbol declarations for the compiler. */\
  7850. -"
  7851. -
  7852. - if test "$dlself" = yes; then
  7853. - $show "generating symbol list for \`$output'"
  7854. -
  7855. - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
  7856. -
  7857. - # Add our own program objects to the symbol list.
  7858. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  7859. - for arg in $progfiles; do
  7860. - $show "extracting global C symbols from \`$arg'"
  7861. - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  7862. - done
  7863. -
  7864. - if test -n "$exclude_expsyms"; then
  7865. - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  7866. - $run eval '$mv "$nlist"T "$nlist"'
  7867. - fi
  7868. -
  7869. - if test -n "$export_symbols_regex"; then
  7870. - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  7871. - $run eval '$mv "$nlist"T "$nlist"'
  7872. - fi
  7873. -
  7874. - # Prepare the list of exported symbols
  7875. - if test -z "$export_symbols"; then
  7876. - export_symbols="$output_objdir/$outputname.exp"
  7877. - $run $rm $export_symbols
  7878. - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  7879. - case $host in
  7880. - *cygwin* | *mingw* )
  7881. - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  7882. - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
  7883. - ;;
  7884. - esac
  7885. - else
  7886. - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
  7887. - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
  7888. - $run eval 'mv "$nlist"T "$nlist"'
  7889. - case $host in
  7890. - *cygwin* | *mingw* )
  7891. - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
  7892. - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
  7893. - ;;
  7894. - esac
  7895. - fi
  7896. - fi
  7897. -
  7898. - for arg in $dlprefiles; do
  7899. - $show "extracting global C symbols from \`$arg'"
  7900. - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
  7901. - $run eval '$echo ": $name " >> "$nlist"'
  7902. - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  7903. - done
  7904. -
  7905. - if test -z "$run"; then
  7906. - # Make sure we have at least an empty file.
  7907. - test -f "$nlist" || : > "$nlist"
  7908. -
  7909. - if test -n "$exclude_expsyms"; then
  7910. - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  7911. - $mv "$nlist"T "$nlist"
  7912. - fi
  7913. -
  7914. - # Try sorting and uniquifying the output.
  7915. - if grep -v "^: " < "$nlist" |
  7916. - if sort -k 3 </dev/null >/dev/null 2>&1; then
  7917. - sort -k 3
  7918. - else
  7919. - sort +2
  7920. - fi |
  7921. - uniq > "$nlist"S; then
  7922. - :
  7923. - else
  7924. - grep -v "^: " < "$nlist" > "$nlist"S
  7925. - fi
  7926. -
  7927. - if test -f "$nlist"S; then
  7928. - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  7929. - else
  7930. - $echo '/* NONE */' >> "$output_objdir/$dlsyms"
  7931. - fi
  7932. -
  7933. - $echo >> "$output_objdir/$dlsyms" "\
  7934. -
  7935. -#undef lt_preloaded_symbols
  7936. -
  7937. -#if defined (__STDC__) && __STDC__
  7938. -# define lt_ptr void *
  7939. -#else
  7940. -# define lt_ptr char *
  7941. -# define const
  7942. -#endif
  7943. -
  7944. -/* The mapping between symbol names and symbols. */
  7945. -"
  7946. -
  7947. - case $host in
  7948. - *cygwin* | *mingw* )
  7949. - $echo >> "$output_objdir/$dlsyms" "\
  7950. -/* DATA imports from DLLs on WIN32 can't be const, because
  7951. - runtime relocations are performed -- see ld's documentation
  7952. - on pseudo-relocs */
  7953. -struct {
  7954. -"
  7955. - ;;
  7956. - * )
  7957. - $echo >> "$output_objdir/$dlsyms" "\
  7958. -const struct {
  7959. -"
  7960. - ;;
  7961. - esac
  7962. -
  7963. -
  7964. - $echo >> "$output_objdir/$dlsyms" "\
  7965. - const char *name;
  7966. - lt_ptr address;
  7967. -}
  7968. -lt_preloaded_symbols[] =
  7969. -{\
  7970. -"
  7971. -
  7972. - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
  7973. -
  7974. - $echo >> "$output_objdir/$dlsyms" "\
  7975. - {0, (lt_ptr) 0}
  7976. -};
  7977. -
  7978. -/* This works around a problem in FreeBSD linker */
  7979. -#ifdef FREEBSD_WORKAROUND
  7980. -static const void *lt_preloaded_setup() {
  7981. - return lt_preloaded_symbols;
  7982. -}
  7983. -#endif
  7984. -
  7985. -#ifdef __cplusplus
  7986. -}
  7987. -#endif\
  7988. -"
  7989. - fi
  7990. -
  7991. - pic_flag_for_symtable=
  7992. - case $host in
  7993. - # compiling the symbol table file with pic_flag works around
  7994. - # a FreeBSD bug that causes programs to crash when -lm is
  7995. - # linked before any other PIC object. But we must not use
  7996. - # pic_flag when linking with -static. The problem exists in
  7997. - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  7998. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
  7999. - case "$compile_command " in
  8000. - *" -static "*) ;;
  8001. - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
  8002. - esac;;
  8003. - *-*-hpux*)
  8004. - case "$compile_command " in
  8005. - *" -static "*) ;;
  8006. - *) pic_flag_for_symtable=" $pic_flag";;
  8007. - esac
  8008. - esac
  8009. -
  8010. - # Now compile the dynamic symbol file.
  8011. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  8012. - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  8013. -
  8014. - # Clean up the generated files.
  8015. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
  8016. - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
  8017. -
  8018. - # Transform the symbol file into the correct name.
  8019. - case $host in
  8020. - *cygwin* | *mingw* )
  8021. - if test -f "$output_objdir/${outputname}.def" ; then
  8022. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
  8023. - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
  8024. - else
  8025. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
  8026. - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
  8027. - fi
  8028. - ;;
  8029. - * )
  8030. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
  8031. - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
  8032. - ;;
  8033. - esac
  8034. - ;;
  8035. - *)
  8036. - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  8037. - exit $EXIT_FAILURE
  8038. - ;;
  8039. - esac
  8040. - else
  8041. - # We keep going just in case the user didn't refer to
  8042. - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
  8043. - # really was required.
  8044. + func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
  8045. - # Nullify the symbol file.
  8046. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
  8047. - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
  8048. + # template prelinking step
  8049. + if test -n "$prelink_cmds"; then
  8050. + func_execute_cmds "$prelink_cmds" 'exit $?'
  8051. fi
  8052. - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  8053. + wrappers_required=yes
  8054. + case $host in
  8055. + *cygwin* | *mingw* )
  8056. + if test "$build_libtool_libs" != yes; then
  8057. + wrappers_required=no
  8058. + fi
  8059. + ;;
  8060. + *cegcc)
  8061. + # Disable wrappers for cegcc, we are cross compiling anyway.
  8062. + wrappers_required=no
  8063. + ;;
  8064. + *)
  8065. + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
  8066. + wrappers_required=no
  8067. + fi
  8068. + ;;
  8069. + esac
  8070. + if test "$wrappers_required" = no; then
  8071. # Replace the output file specification.
  8072. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
  8073. + compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  8074. link_command="$compile_command$compile_rpath"
  8075. # We have no uninstalled library dependencies, so finalize right now.
  8076. - $show "$link_command"
  8077. - $run eval "$link_command"
  8078. - exit_status=$?
  8079. + exit_status=0
  8080. + func_show_eval "$link_command" 'exit_status=$?'
  8081. # Delete the generated files.
  8082. - if test -n "$dlsyms"; then
  8083. - $show "$rm $output_objdir/${outputname}S.${objext}"
  8084. - $run $rm "$output_objdir/${outputname}S.${objext}"
  8085. + if test -f "$output_objdir/${outputname}S.${objext}"; then
  8086. + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
  8087. fi
  8088. exit $exit_status
  8089. fi
  8090. - if test -n "$shlibpath_var"; then
  8091. - # We should set the shlibpath_var
  8092. - rpath=
  8093. - for dir in $temp_rpath; do
  8094. - case $dir in
  8095. - [\\/]* | [A-Za-z]:[\\/]*)
  8096. - # Absolute path.
  8097. - rpath="$rpath$dir:"
  8098. - ;;
  8099. - *)
  8100. - # Relative path: add a thisdir entry.
  8101. - rpath="$rpath\$thisdir/$dir:"
  8102. - ;;
  8103. - esac
  8104. - done
  8105. - temp_rpath="$rpath"
  8106. - fi
  8107. -
  8108. if test -n "$compile_shlibpath$finalize_shlibpath"; then
  8109. compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  8110. fi
  8111. @@ -4864,12 +7745,11 @@ static const void *lt_preloaded_setup()
  8112. # We don't need to create a wrapper script.
  8113. link_command="$compile_var$compile_command$compile_rpath"
  8114. # Replace the output file specification.
  8115. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  8116. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  8117. # Delete the old output file.
  8118. - $run $rm $output
  8119. + $opt_dry_run || $RM $output
  8120. # Link the executable and exit
  8121. - $show "$link_command"
  8122. - $run eval "$link_command" || exit $?
  8123. + func_show_eval "$link_command" 'exit $?'
  8124. exit $EXIT_SUCCESS
  8125. fi
  8126. @@ -4878,13 +7758,13 @@ static const void *lt_preloaded_setup()
  8127. link_command="$compile_var$compile_command$compile_rpath"
  8128. relink_command="$finalize_var$finalize_command$finalize_rpath"
  8129. - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  8130. - $echo "$modename: \`$output' will be relinked during installation" 1>&2
  8131. + func_warning "this platform does not like uninstalled shared libraries"
  8132. + func_warning "\`$output' will be relinked during installation"
  8133. else
  8134. if test "$fast_install" != no; then
  8135. link_command="$finalize_var$compile_command$finalize_rpath"
  8136. if test "$fast_install" = yes; then
  8137. - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
  8138. + relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  8139. else
  8140. # fast_install is set to needless
  8141. relink_command=
  8142. @@ -4896,608 +7776,103 @@ static const void *lt_preloaded_setup()
  8143. fi
  8144. # Replace the output file specification.
  8145. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  8146. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  8147. # Delete the old output files.
  8148. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  8149. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
  8150. - $show "$link_command"
  8151. - $run eval "$link_command" || exit $?
  8152. + func_show_eval "$link_command" 'exit $?'
  8153. # Now create the wrapper script.
  8154. - $show "creating $output"
  8155. + func_verbose "creating $output"
  8156. # Quote the relink command for shipping.
  8157. if test -n "$relink_command"; then
  8158. # Preserve any variables that may affect compiler behavior
  8159. for var in $variables_saved_for_relink; do
  8160. if eval test -z \"\${$var+set}\"; then
  8161. - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  8162. + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  8163. elif eval var_value=\$$var; test -z "$var_value"; then
  8164. relink_command="$var=; export $var; $relink_command"
  8165. else
  8166. - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  8167. - relink_command="$var=\"$var_value\"; export $var; $relink_command"
  8168. + func_quote_for_eval "$var_value"
  8169. + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  8170. fi
  8171. done
  8172. relink_command="(cd `pwd`; $relink_command)"
  8173. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
  8174. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  8175. fi
  8176. - # Quote $echo for shipping.
  8177. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
  8178. + # Quote $ECHO for shipping.
  8179. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
  8180. case $progpath in
  8181. [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
  8182. *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
  8183. esac
  8184. - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  8185. + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
  8186. else
  8187. - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  8188. + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
  8189. fi
  8190. - # Only actually do things if our run command is non-null.
  8191. - if test -z "$run"; then
  8192. + # Only actually do things if not in dry run mode.
  8193. + $opt_dry_run || {
  8194. # win32 will think the script is a binary if it has
  8195. # a .exe suffix, so we strip it off here.
  8196. case $output in
  8197. - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
  8198. + *.exe) func_stripname '' '.exe' "$output"
  8199. + output=$func_stripname_result ;;
  8200. esac
  8201. # test for cygwin because mv fails w/o .exe extensions
  8202. case $host in
  8203. *cygwin*)
  8204. exeext=.exe
  8205. - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
  8206. + func_stripname '' '.exe' "$outputname"
  8207. + outputname=$func_stripname_result ;;
  8208. *) exeext= ;;
  8209. esac
  8210. case $host in
  8211. *cygwin* | *mingw* )
  8212. - output_name=`basename $output`
  8213. - output_path=`dirname $output`
  8214. - cwrappersource="$output_path/$objdir/lt-$output_name.c"
  8215. - cwrapper="$output_path/$output_name.exe"
  8216. - $rm $cwrappersource $cwrapper
  8217. - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  8218. -
  8219. - cat > $cwrappersource <<EOF
  8220. -
  8221. -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
  8222. - Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  8223. -
  8224. - The $output program cannot be directly executed until all the libtool
  8225. - libraries that it depends on are installed.
  8226. -
  8227. - This wrapper executable should never be moved out of the build directory.
  8228. - If it is, it will not operate correctly.
  8229. -
  8230. - Currently, it simply execs the wrapper *script* "/bin/sh $output",
  8231. - but could eventually absorb all of the scripts functionality and
  8232. - exec $objdir/$outputname directly.
  8233. -*/
  8234. -EOF
  8235. - cat >> $cwrappersource<<"EOF"
  8236. -#include <stdio.h>
  8237. -#include <stdlib.h>
  8238. -#include <unistd.h>
  8239. -#include <malloc.h>
  8240. -#include <stdarg.h>
  8241. -#include <assert.h>
  8242. -#include <string.h>
  8243. -#include <ctype.h>
  8244. -#include <sys/stat.h>
  8245. -
  8246. -#if defined(PATH_MAX)
  8247. -# define LT_PATHMAX PATH_MAX
  8248. -#elif defined(MAXPATHLEN)
  8249. -# define LT_PATHMAX MAXPATHLEN
  8250. -#else
  8251. -# define LT_PATHMAX 1024
  8252. -#endif
  8253. -
  8254. -#ifndef DIR_SEPARATOR
  8255. -# define DIR_SEPARATOR '/'
  8256. -# define PATH_SEPARATOR ':'
  8257. -#endif
  8258. -
  8259. -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
  8260. - defined (__OS2__)
  8261. -# define HAVE_DOS_BASED_FILE_SYSTEM
  8262. -# ifndef DIR_SEPARATOR_2
  8263. -# define DIR_SEPARATOR_2 '\\'
  8264. -# endif
  8265. -# ifndef PATH_SEPARATOR_2
  8266. -# define PATH_SEPARATOR_2 ';'
  8267. -# endif
  8268. -#endif
  8269. -
  8270. -#ifndef DIR_SEPARATOR_2
  8271. -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
  8272. -#else /* DIR_SEPARATOR_2 */
  8273. -# define IS_DIR_SEPARATOR(ch) \
  8274. - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
  8275. -#endif /* DIR_SEPARATOR_2 */
  8276. -
  8277. -#ifndef PATH_SEPARATOR_2
  8278. -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
  8279. -#else /* PATH_SEPARATOR_2 */
  8280. -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
  8281. -#endif /* PATH_SEPARATOR_2 */
  8282. -
  8283. -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
  8284. -#define XFREE(stale) do { \
  8285. - if (stale) { free ((void *) stale); stale = 0; } \
  8286. -} while (0)
  8287. -
  8288. -/* -DDEBUG is fairly common in CFLAGS. */
  8289. -#undef DEBUG
  8290. -#if defined DEBUGWRAPPER
  8291. -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
  8292. -#else
  8293. -# define DEBUG(format, ...)
  8294. -#endif
  8295. -
  8296. -const char *program_name = NULL;
  8297. -
  8298. -void * xmalloc (size_t num);
  8299. -char * xstrdup (const char *string);
  8300. -const char * base_name (const char *name);
  8301. -char * find_executable(const char *wrapper);
  8302. -int check_executable(const char *path);
  8303. -char * strendzap(char *str, const char *pat);
  8304. -void lt_fatal (const char *message, ...);
  8305. -
  8306. -int
  8307. -main (int argc, char *argv[])
  8308. -{
  8309. - char **newargz;
  8310. - int i;
  8311. -
  8312. - program_name = (char *) xstrdup (base_name (argv[0]));
  8313. - DEBUG("(main) argv[0] : %s\n",argv[0]);
  8314. - DEBUG("(main) program_name : %s\n",program_name);
  8315. - newargz = XMALLOC(char *, argc+2);
  8316. -EOF
  8317. -
  8318. - cat >> $cwrappersource <<EOF
  8319. - newargz[0] = (char *) xstrdup("$SHELL");
  8320. -EOF
  8321. -
  8322. - cat >> $cwrappersource <<"EOF"
  8323. - newargz[1] = find_executable(argv[0]);
  8324. - if (newargz[1] == NULL)
  8325. - lt_fatal("Couldn't find %s", argv[0]);
  8326. - DEBUG("(main) found exe at : %s\n",newargz[1]);
  8327. - /* we know the script has the same name, without the .exe */
  8328. - /* so make sure newargz[1] doesn't end in .exe */
  8329. - strendzap(newargz[1],".exe");
  8330. - for (i = 1; i < argc; i++)
  8331. - newargz[i+1] = xstrdup(argv[i]);
  8332. - newargz[argc+1] = NULL;
  8333. -
  8334. - for (i=0; i<argc+1; i++)
  8335. - {
  8336. - DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
  8337. - ;
  8338. - }
  8339. -
  8340. -EOF
  8341. -
  8342. - case $host_os in
  8343. - mingw*)
  8344. - cat >> $cwrappersource <<EOF
  8345. - execv("$SHELL",(char const **)newargz);
  8346. -EOF
  8347. - ;;
  8348. - *)
  8349. - cat >> $cwrappersource <<EOF
  8350. - execv("$SHELL",newargz);
  8351. -EOF
  8352. - ;;
  8353. - esac
  8354. -
  8355. - cat >> $cwrappersource <<"EOF"
  8356. - return 127;
  8357. -}
  8358. -
  8359. -void *
  8360. -xmalloc (size_t num)
  8361. -{
  8362. - void * p = (void *) malloc (num);
  8363. - if (!p)
  8364. - lt_fatal ("Memory exhausted");
  8365. -
  8366. - return p;
  8367. -}
  8368. -
  8369. -char *
  8370. -xstrdup (const char *string)
  8371. -{
  8372. - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
  8373. -;
  8374. -}
  8375. -
  8376. -const char *
  8377. -base_name (const char *name)
  8378. -{
  8379. - const char *base;
  8380. -
  8381. -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  8382. - /* Skip over the disk name in MSDOS pathnames. */
  8383. - if (isalpha ((unsigned char)name[0]) && name[1] == ':')
  8384. - name += 2;
  8385. -#endif
  8386. -
  8387. - for (base = name; *name; name++)
  8388. - if (IS_DIR_SEPARATOR (*name))
  8389. - base = name + 1;
  8390. - return base;
  8391. -}
  8392. -
  8393. -int
  8394. -check_executable(const char * path)
  8395. -{
  8396. - struct stat st;
  8397. -
  8398. - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
  8399. - if ((!path) || (!*path))
  8400. - return 0;
  8401. -
  8402. - if ((stat (path, &st) >= 0) &&
  8403. - (
  8404. - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
  8405. -#if defined (S_IXOTH)
  8406. - ((st.st_mode & S_IXOTH) == S_IXOTH) ||
  8407. -#endif
  8408. -#if defined (S_IXGRP)
  8409. - ((st.st_mode & S_IXGRP) == S_IXGRP) ||
  8410. -#endif
  8411. - ((st.st_mode & S_IXUSR) == S_IXUSR))
  8412. - )
  8413. - return 1;
  8414. - else
  8415. - return 0;
  8416. -}
  8417. -
  8418. -/* Searches for the full path of the wrapper. Returns
  8419. - newly allocated full path name if found, NULL otherwise */
  8420. -char *
  8421. -find_executable (const char* wrapper)
  8422. -{
  8423. - int has_slash = 0;
  8424. - const char* p;
  8425. - const char* p_next;
  8426. - /* static buffer for getcwd */
  8427. - char tmp[LT_PATHMAX + 1];
  8428. - int tmp_len;
  8429. - char* concat_name;
  8430. -
  8431. - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
  8432. -
  8433. - if ((wrapper == NULL) || (*wrapper == '\0'))
  8434. - return NULL;
  8435. -
  8436. - /* Absolute path? */
  8437. -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  8438. - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
  8439. - {
  8440. - concat_name = xstrdup (wrapper);
  8441. - if (check_executable(concat_name))
  8442. - return concat_name;
  8443. - XFREE(concat_name);
  8444. - }
  8445. - else
  8446. - {
  8447. -#endif
  8448. - if (IS_DIR_SEPARATOR (wrapper[0]))
  8449. - {
  8450. - concat_name = xstrdup (wrapper);
  8451. - if (check_executable(concat_name))
  8452. - return concat_name;
  8453. - XFREE(concat_name);
  8454. - }
  8455. -#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
  8456. - }
  8457. -#endif
  8458. -
  8459. - for (p = wrapper; *p; p++)
  8460. - if (*p == '/')
  8461. - {
  8462. - has_slash = 1;
  8463. - break;
  8464. - }
  8465. - if (!has_slash)
  8466. - {
  8467. - /* no slashes; search PATH */
  8468. - const char* path = getenv ("PATH");
  8469. - if (path != NULL)
  8470. - {
  8471. - for (p = path; *p; p = p_next)
  8472. - {
  8473. - const char* q;
  8474. - size_t p_len;
  8475. - for (q = p; *q; q++)
  8476. - if (IS_PATH_SEPARATOR(*q))
  8477. - break;
  8478. - p_len = q - p;
  8479. - p_next = (*q == '\0' ? q : q + 1);
  8480. - if (p_len == 0)
  8481. - {
  8482. - /* empty path: current directory */
  8483. - if (getcwd (tmp, LT_PATHMAX) == NULL)
  8484. - lt_fatal ("getcwd failed");
  8485. - tmp_len = strlen(tmp);
  8486. - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  8487. - memcpy (concat_name, tmp, tmp_len);
  8488. - concat_name[tmp_len] = '/';
  8489. - strcpy (concat_name + tmp_len + 1, wrapper);
  8490. - }
  8491. - else
  8492. - {
  8493. - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
  8494. - memcpy (concat_name, p, p_len);
  8495. - concat_name[p_len] = '/';
  8496. - strcpy (concat_name + p_len + 1, wrapper);
  8497. - }
  8498. - if (check_executable(concat_name))
  8499. - return concat_name;
  8500. - XFREE(concat_name);
  8501. - }
  8502. - }
  8503. - /* not found in PATH; assume curdir */
  8504. - }
  8505. - /* Relative path | not found in path: prepend cwd */
  8506. - if (getcwd (tmp, LT_PATHMAX) == NULL)
  8507. - lt_fatal ("getcwd failed");
  8508. - tmp_len = strlen(tmp);
  8509. - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
  8510. - memcpy (concat_name, tmp, tmp_len);
  8511. - concat_name[tmp_len] = '/';
  8512. - strcpy (concat_name + tmp_len + 1, wrapper);
  8513. -
  8514. - if (check_executable(concat_name))
  8515. - return concat_name;
  8516. - XFREE(concat_name);
  8517. - return NULL;
  8518. -}
  8519. -
  8520. -char *
  8521. -strendzap(char *str, const char *pat)
  8522. -{
  8523. - size_t len, patlen;
  8524. -
  8525. - assert(str != NULL);
  8526. - assert(pat != NULL);
  8527. -
  8528. - len = strlen(str);
  8529. - patlen = strlen(pat);
  8530. -
  8531. - if (patlen <= len)
  8532. - {
  8533. - str += len - patlen;
  8534. - if (strcmp(str, pat) == 0)
  8535. - *str = '\0';
  8536. - }
  8537. - return str;
  8538. -}
  8539. -
  8540. -static void
  8541. -lt_error_core (int exit_status, const char * mode,
  8542. - const char * message, va_list ap)
  8543. -{
  8544. - fprintf (stderr, "%s: %s: ", program_name, mode);
  8545. - vfprintf (stderr, message, ap);
  8546. - fprintf (stderr, ".\n");
  8547. -
  8548. - if (exit_status >= 0)
  8549. - exit (exit_status);
  8550. -}
  8551. -
  8552. -void
  8553. -lt_fatal (const char *message, ...)
  8554. -{
  8555. - va_list ap;
  8556. - va_start (ap, message);
  8557. - lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
  8558. - va_end (ap);
  8559. -}
  8560. -EOF
  8561. - # we should really use a build-platform specific compiler
  8562. - # here, but OTOH, the wrappers (shell script and this C one)
  8563. - # are only useful if you want to execute the "real" binary.
  8564. - # Since the "real" binary is built for $host, then this
  8565. - # wrapper might as well be built for $host, too.
  8566. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
  8567. - ;;
  8568. - esac
  8569. - $rm $output
  8570. - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
  8571. -
  8572. - $echo > $output "\
  8573. -#! $SHELL
  8574. -
  8575. -# $output - temporary wrapper script for $objdir/$outputname
  8576. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  8577. -#
  8578. -# The $output program cannot be directly executed until all the libtool
  8579. -# libraries that it depends on are installed.
  8580. -#
  8581. -# This wrapper script should never be moved out of the build directory.
  8582. -# If it is, it will not operate correctly.
  8583. -
  8584. -# Sed substitution that helps us do robust quoting. It backslashifies
  8585. -# metacharacters that are still active within double-quoted strings.
  8586. -Xsed='${SED} -e 1s/^X//'
  8587. -sed_quote_subst='$sed_quote_subst'
  8588. -
  8589. -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
  8590. -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
  8591. - emulate sh
  8592. - NULLCMD=:
  8593. - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
  8594. - # is contrary to our usage. Disable this feature.
  8595. - alias -g '\${1+\"\$@\"}'='\"\$@\"'
  8596. - setopt NO_GLOB_SUBST
  8597. -else
  8598. - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
  8599. -fi
  8600. -BIN_SH=xpg4; export BIN_SH # for Tru64
  8601. -DUALCASE=1; export DUALCASE # for MKS sh
  8602. -
  8603. -# The HP-UX ksh and POSIX shell print the target directory to stdout
  8604. -# if CDPATH is set.
  8605. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  8606. -
  8607. -relink_command=\"$relink_command\"
  8608. -
  8609. -# This environment variable determines our operation mode.
  8610. -if test \"\$libtool_install_magic\" = \"$magic\"; then
  8611. - # install mode needs the following variable:
  8612. - notinst_deplibs='$notinst_deplibs'
  8613. -else
  8614. - # When we are sourced in execute mode, \$file and \$echo are already set.
  8615. - if test \"\$libtool_execute_magic\" != \"$magic\"; then
  8616. - echo=\"$qecho\"
  8617. - file=\"\$0\"
  8618. - # Make sure echo works.
  8619. - if test \"X\$1\" = X--no-reexec; then
  8620. - # Discard the --no-reexec flag, and continue.
  8621. - shift
  8622. - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  8623. - # Yippee, \$echo works!
  8624. - :
  8625. - else
  8626. - # Restart under the correct shell, and then maybe \$echo will work.
  8627. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  8628. - fi
  8629. - fi\
  8630. -"
  8631. - $echo >> $output "\
  8632. -
  8633. - # Find the directory that this script lives in.
  8634. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  8635. - test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  8636. -
  8637. - # Follow symbolic links until we get to the real thisdir.
  8638. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
  8639. - while test -n \"\$file\"; do
  8640. - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  8641. -
  8642. - # If there was a directory component, then change thisdir.
  8643. - if test \"x\$destdir\" != \"x\$file\"; then
  8644. - case \"\$destdir\" in
  8645. - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
  8646. - *) thisdir=\"\$thisdir/\$destdir\" ;;
  8647. - esac
  8648. - fi
  8649. -
  8650. - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  8651. - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
  8652. - done
  8653. -
  8654. - # Try to get the absolute directory name.
  8655. - absdir=\`cd \"\$thisdir\" && pwd\`
  8656. - test -n \"\$absdir\" && thisdir=\"\$absdir\"
  8657. -"
  8658. -
  8659. - if test "$fast_install" = yes; then
  8660. - $echo >> $output "\
  8661. - program=lt-'$outputname'$exeext
  8662. - progdir=\"\$thisdir/$objdir\"
  8663. -
  8664. - if test ! -f \"\$progdir/\$program\" || \\
  8665. - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
  8666. - test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  8667. -
  8668. - file=\"\$\$-\$program\"
  8669. -
  8670. - if test ! -d \"\$progdir\"; then
  8671. - $mkdir \"\$progdir\"
  8672. - else
  8673. - $rm \"\$progdir/\$file\"
  8674. - fi"
  8675. -
  8676. - $echo >> $output "\
  8677. -
  8678. - # relink executable if necessary
  8679. - if test -n \"\$relink_command\"; then
  8680. - if relink_command_output=\`eval \$relink_command 2>&1\`; then :
  8681. - else
  8682. - $echo \"\$relink_command_output\" >&2
  8683. - $rm \"\$progdir/\$file\"
  8684. - exit $EXIT_FAILURE
  8685. - fi
  8686. - fi
  8687. -
  8688. - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  8689. - { $rm \"\$progdir/\$program\";
  8690. - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  8691. - $rm \"\$progdir/\$file\"
  8692. - fi"
  8693. - else
  8694. - $echo >> $output "\
  8695. - program='$outputname'
  8696. - progdir=\"\$thisdir/$objdir\"
  8697. -"
  8698. - fi
  8699. -
  8700. - $echo >> $output "\
  8701. -
  8702. - if test -f \"\$progdir/\$program\"; then"
  8703. -
  8704. - # Export our shlibpath_var if we have one.
  8705. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  8706. - $echo >> $output "\
  8707. - # Add our own library path to $shlibpath_var
  8708. - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  8709. -
  8710. - # Some systems cannot cope with colon-terminated $shlibpath_var
  8711. - # The second colon is a workaround for a bug in BeOS R4 sed
  8712. - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  8713. + func_dirname_and_basename "$output" "" "."
  8714. + output_name=$func_basename_result
  8715. + output_path=$func_dirname_result
  8716. + cwrappersource="$output_path/$objdir/lt-$output_name.c"
  8717. + cwrapper="$output_path/$output_name.exe"
  8718. + $RM $cwrappersource $cwrapper
  8719. + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
  8720. - export $shlibpath_var
  8721. -"
  8722. - fi
  8723. + func_emit_cwrapperexe_src > $cwrappersource
  8724. - # fixup the dll searchpath if we need to.
  8725. - if test -n "$dllsearchpath"; then
  8726. - $echo >> $output "\
  8727. - # Add the dll search path components to the executable PATH
  8728. - PATH=$dllsearchpath:\$PATH
  8729. -"
  8730. - fi
  8731. + # The wrapper executable is built using the $host compiler,
  8732. + # because it contains $host paths and files. If cross-
  8733. + # compiling, it, like the target executable, must be
  8734. + # executed on the $host or under an emulation environment.
  8735. + $opt_dry_run || {
  8736. + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
  8737. + $STRIP $cwrapper
  8738. + }
  8739. - $echo >> $output "\
  8740. - if test \"\$libtool_execute_magic\" != \"$magic\"; then
  8741. - # Run the actual program with our arguments.
  8742. -"
  8743. - case $host in
  8744. - # Backslashes separate directories on plain windows
  8745. - *-*-mingw | *-*-os2*)
  8746. - $echo >> $output "\
  8747. - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
  8748. -"
  8749. + # Now, create the wrapper script for func_source use:
  8750. + func_ltwrapper_scriptname $cwrapper
  8751. + $RM $func_ltwrapper_scriptname_result
  8752. + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
  8753. + $opt_dry_run || {
  8754. + # note: this script will not be executed, so do not chmod.
  8755. + if test "x$build" = "x$host" ; then
  8756. + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
  8757. + else
  8758. + func_emit_wrapper no > $func_ltwrapper_scriptname_result
  8759. + fi
  8760. + }
  8761. ;;
  8762. + * )
  8763. + $RM $output
  8764. + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
  8765. - *)
  8766. - $echo >> $output "\
  8767. - exec \"\$progdir/\$program\" \${1+\"\$@\"}
  8768. -"
  8769. + func_emit_wrapper no > $output
  8770. + chmod +x $output
  8771. ;;
  8772. esac
  8773. - $echo >> $output "\
  8774. - \$echo \"\$0: cannot exec \$program \$*\"
  8775. - exit $EXIT_FAILURE
  8776. - fi
  8777. - else
  8778. - # The program doesn't exist.
  8779. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
  8780. - \$echo \"This script is just a wrapper for \$program.\" 1>&2
  8781. - $echo \"See the $PACKAGE documentation for more information.\" 1>&2
  8782. - exit $EXIT_FAILURE
  8783. - fi
  8784. -fi\
  8785. -"
  8786. - chmod +x $output
  8787. - fi
  8788. + }
  8789. exit $EXIT_SUCCESS
  8790. ;;
  8791. esac
  8792. @@ -5506,7 +7881,7 @@ fi\
  8793. for oldlib in $oldlibs; do
  8794. if test "$build_libtool_libs" = convenience; then
  8795. - oldobjs="$libobjs_save"
  8796. + oldobjs="$libobjs_save $symfileobj"
  8797. addlibs="$convenience"
  8798. build_libtool_libs=no
  8799. else
  8800. @@ -5515,6 +7890,9 @@ fi\
  8801. build_libtool_libs=no
  8802. else
  8803. oldobjs="$old_deplibs $non_pic_objects"
  8804. + if test "$preload" = yes && test -f "$symfileobj"; then
  8805. + oldobjs="$oldobjs $symfileobj"
  8806. + fi
  8807. fi
  8808. addlibs="$old_convenience"
  8809. fi
  8810. @@ -5529,8 +7907,18 @@ fi\
  8811. # Do each command in the archive commands.
  8812. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  8813. - cmds=$old_archive_from_new_cmds
  8814. + cmds=$old_archive_from_new_cmds
  8815. else
  8816. +
  8817. + # Add any objects from preloaded convenience libraries
  8818. + if test -n "$dlprefiles"; then
  8819. + gentop="$output_objdir/${outputname}x"
  8820. + generated="$generated $gentop"
  8821. +
  8822. + func_extract_archives $gentop $dlprefiles
  8823. + oldobjs="$oldobjs $func_extract_archives_result"
  8824. + fi
  8825. +
  8826. # POSIX demands no paths to be encoded in archives. We have
  8827. # to avoid creating archives with duplicate basenames if we
  8828. # might have to extract them afterwards, e.g., when creating a
  8829. @@ -5539,32 +7927,22 @@ fi\
  8830. # not supported by libtool).
  8831. if (for obj in $oldobjs
  8832. do
  8833. - $echo "X$obj" | $Xsed -e 's%^.*/%%'
  8834. + func_basename "$obj"
  8835. + $ECHO "$func_basename_result"
  8836. done | sort | sort -uc >/dev/null 2>&1); then
  8837. :
  8838. else
  8839. - $echo "copying selected object files to avoid basename conflicts..."
  8840. -
  8841. - if test -z "$gentop"; then
  8842. - gentop="$output_objdir/${outputname}x"
  8843. - generated="$generated $gentop"
  8844. -
  8845. - $show "${rm}r $gentop"
  8846. - $run ${rm}r "$gentop"
  8847. - $show "$mkdir $gentop"
  8848. - $run $mkdir "$gentop"
  8849. - exit_status=$?
  8850. - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
  8851. - exit $exit_status
  8852. - fi
  8853. - fi
  8854. -
  8855. + $ECHO "copying selected object files to avoid basename conflicts..."
  8856. + gentop="$output_objdir/${outputname}x"
  8857. + generated="$generated $gentop"
  8858. + func_mkdir_p "$gentop"
  8859. save_oldobjs=$oldobjs
  8860. oldobjs=
  8861. counter=1
  8862. for obj in $save_oldobjs
  8863. do
  8864. - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
  8865. + func_basename "$obj"
  8866. + objbase="$func_basename_result"
  8867. case " $oldobjs " in
  8868. " ") oldobjs=$obj ;;
  8869. *[\ /]"$objbase "*)
  8870. @@ -5572,58 +7950,62 @@ fi\
  8871. # Make sure we don't pick an alternate name that also
  8872. # overlaps.
  8873. newobj=lt$counter-$objbase
  8874. - counter=`expr $counter + 1`
  8875. + func_arith $counter + 1
  8876. + counter=$func_arith_result
  8877. case " $oldobjs " in
  8878. *[\ /]"$newobj "*) ;;
  8879. *) if test ! -f "$gentop/$newobj"; then break; fi ;;
  8880. esac
  8881. done
  8882. - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  8883. - $run ln "$obj" "$gentop/$newobj" ||
  8884. - $run cp "$obj" "$gentop/$newobj"
  8885. + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
  8886. oldobjs="$oldobjs $gentop/$newobj"
  8887. ;;
  8888. *) oldobjs="$oldobjs $obj" ;;
  8889. esac
  8890. done
  8891. fi
  8892. -
  8893. eval cmds=\"$old_archive_cmds\"
  8894. - if len=`expr "X$cmds" : ".*"` &&
  8895. - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  8896. + func_len " $cmds"
  8897. + len=$func_len_result
  8898. + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
  8899. cmds=$old_archive_cmds
  8900. else
  8901. # the command line is too long to link in one step, link in parts
  8902. - $echo "using piecewise archive linking..."
  8903. + func_verbose "using piecewise archive linking..."
  8904. save_RANLIB=$RANLIB
  8905. RANLIB=:
  8906. objlist=
  8907. concat_cmds=
  8908. save_oldobjs=$oldobjs
  8909. -
  8910. + oldobjs=
  8911. # Is there a better way of finding the last object in the list?
  8912. for obj in $save_oldobjs
  8913. do
  8914. last_oldobj=$obj
  8915. done
  8916. + eval test_cmds=\"$old_archive_cmds\"
  8917. + func_len " $test_cmds"
  8918. + len0=$func_len_result
  8919. + len=$len0
  8920. for obj in $save_oldobjs
  8921. do
  8922. - oldobjs="$objlist $obj"
  8923. - objlist="$objlist $obj"
  8924. - eval test_cmds=\"$old_archive_cmds\"
  8925. - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
  8926. - test "$len" -le "$max_cmd_len"; then
  8927. + func_len " $obj"
  8928. + func_arith $len + $func_len_result
  8929. + len=$func_arith_result
  8930. + func_append objlist " $obj"
  8931. + if test "$len" -lt "$max_cmd_len"; then
  8932. :
  8933. else
  8934. # the above command should be used before it gets too long
  8935. oldobjs=$objlist
  8936. if test "$obj" = "$last_oldobj" ; then
  8937. - RANLIB=$save_RANLIB
  8938. + RANLIB=$save_RANLIB
  8939. fi
  8940. test -z "$concat_cmds" || concat_cmds=$concat_cmds~
  8941. eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
  8942. objlist=
  8943. + len=$len0
  8944. fi
  8945. done
  8946. RANLIB=$save_RANLIB
  8947. @@ -5635,49 +8017,39 @@ fi\
  8948. fi
  8949. fi
  8950. fi
  8951. - save_ifs="$IFS"; IFS='~'
  8952. - for cmd in $cmds; do
  8953. - eval cmd=\"$cmd\"
  8954. - IFS="$save_ifs"
  8955. - $show "$cmd"
  8956. - $run eval "$cmd" || exit $?
  8957. - done
  8958. - IFS="$save_ifs"
  8959. + func_execute_cmds "$cmds" 'exit $?'
  8960. done
  8961. - if test -n "$generated"; then
  8962. - $show "${rm}r$generated"
  8963. - $run ${rm}r$generated
  8964. - fi
  8965. + test -n "$generated" && \
  8966. + func_show_eval "${RM}r$generated"
  8967. # Now create the libtool archive.
  8968. case $output in
  8969. *.la)
  8970. old_library=
  8971. test "$build_old_libs" = yes && old_library="$libname.$libext"
  8972. - $show "creating $output"
  8973. + func_verbose "creating $output"
  8974. # Preserve any variables that may affect compiler behavior
  8975. for var in $variables_saved_for_relink; do
  8976. if eval test -z \"\${$var+set}\"; then
  8977. - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
  8978. + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
  8979. elif eval var_value=\$$var; test -z "$var_value"; then
  8980. relink_command="$var=; export $var; $relink_command"
  8981. else
  8982. - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
  8983. - relink_command="$var=\"$var_value\"; export $var; $relink_command"
  8984. + func_quote_for_eval "$var_value"
  8985. + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
  8986. fi
  8987. done
  8988. # Quote the link command for shipping.
  8989. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
  8990. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
  8991. + relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  8992. if test "$hardcode_automatic" = yes ; then
  8993. relink_command=
  8994. fi
  8995. -
  8996. # Only create the output if not a dry run.
  8997. - if test -z "$run"; then
  8998. + $opt_dry_run || {
  8999. for installed in no yes; do
  9000. if test "$installed" = yes; then
  9001. if test -z "$install_libdir"; then
  9002. @@ -5689,38 +8061,93 @@ fi\
  9003. for deplib in $dependency_libs; do
  9004. case $deplib in
  9005. *.la)
  9006. - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
  9007. + func_basename "$deplib"
  9008. + name="$func_basename_result"
  9009. eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
  9010. - if test -z "$libdir"; then
  9011. - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
  9012. - exit $EXIT_FAILURE
  9013. + test -z "$libdir" && \
  9014. + func_fatal_error "\`$deplib' is not a valid libtool archive"
  9015. + if test "x$EGREP" = x ; then
  9016. + EGREP=egrep
  9017. + fi
  9018. + # We do not want portage's install root ($D) present. Check only for
  9019. + # this if the .la is being installed.
  9020. + if test "$installed" = yes && test "$D"; then
  9021. + eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
  9022. + else
  9023. + mynewdependency_lib="$libdir/$name"
  9024. + fi
  9025. + # Do not add duplicates
  9026. + if test "$mynewdependency_lib"; then
  9027. + my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
  9028. + if test -z "$my_little_ninja_foo_1"; then
  9029. + newdependency_libs="$newdependency_libs $mynewdependency_lib"
  9030. + fi
  9031. + fi
  9032. + ;;
  9033. + *)
  9034. + if test "$installed" = yes; then
  9035. + # Rather use S=WORKDIR if our version of portage supports it.
  9036. + # This is because some ebuild (gcc) do not use $S as buildroot.
  9037. + if test "$PWORKDIR"; then
  9038. + S="$PWORKDIR"
  9039. + fi
  9040. + # We do not want portage's build root ($S) present.
  9041. + my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"`
  9042. + # We do not want portage's install root ($D) present.
  9043. + my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"`
  9044. + if test -n "$my_little_ninja_foo_2" && test "$S"; then
  9045. + mynewdependency_lib=""
  9046. + elif test -n "$my_little_ninja_foo_3" && test "$D"; then
  9047. + eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
  9048. + else
  9049. + mynewdependency_lib="$deplib"
  9050. + fi
  9051. + else
  9052. + mynewdependency_lib="$deplib"
  9053. + fi
  9054. + # Do not add duplicates
  9055. + if test "$mynewdependency_lib"; then
  9056. + my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"`
  9057. + if test -z "$my_little_ninja_foo_4"; then
  9058. + newdependency_libs="$newdependency_libs $mynewdependency_lib"
  9059. + fi
  9060. fi
  9061. - newdependency_libs="$newdependency_libs $libdir/$name"
  9062. ;;
  9063. - *) newdependency_libs="$newdependency_libs $deplib" ;;
  9064. esac
  9065. done
  9066. dependency_libs="$newdependency_libs"
  9067. newdlfiles=
  9068. +
  9069. for lib in $dlfiles; do
  9070. - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  9071. - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  9072. - if test -z "$libdir"; then
  9073. - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  9074. - exit $EXIT_FAILURE
  9075. - fi
  9076. - newdlfiles="$newdlfiles $libdir/$name"
  9077. + case $lib in
  9078. + *.la)
  9079. + func_basename "$lib"
  9080. + name="$func_basename_result"
  9081. + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  9082. + test -z "$libdir" && \
  9083. + func_fatal_error "\`$lib' is not a valid libtool archive"
  9084. + newdlfiles="$newdlfiles $libdir/$name"
  9085. + ;;
  9086. + *) newdlfiles="$newdlfiles $lib" ;;
  9087. + esac
  9088. done
  9089. dlfiles="$newdlfiles"
  9090. newdlprefiles=
  9091. for lib in $dlprefiles; do
  9092. - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
  9093. - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  9094. - if test -z "$libdir"; then
  9095. - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  9096. - exit $EXIT_FAILURE
  9097. - fi
  9098. - newdlprefiles="$newdlprefiles $libdir/$name"
  9099. + case $lib in
  9100. + *.la)
  9101. + # Only pass preopened files to the pseudo-archive (for
  9102. + # eventual linking with the app. that links it) if we
  9103. + # didn't already link the preopened objects directly into
  9104. + # the library:
  9105. + func_basename "$lib"
  9106. + name="$func_basename_result"
  9107. + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
  9108. + test -z "$libdir" && \
  9109. + func_fatal_error "\`$lib' is not a valid libtool archive"
  9110. + newdlprefiles="$newdlprefiles $libdir/$name"
  9111. + ;;
  9112. + esac
  9113. done
  9114. dlprefiles="$newdlprefiles"
  9115. else
  9116. @@ -5743,15 +8170,19 @@ fi\
  9117. done
  9118. dlprefiles="$newdlprefiles"
  9119. fi
  9120. - $rm $output
  9121. + $RM $output
  9122. # place dlname in correct position for cygwin
  9123. tdlname=$dlname
  9124. case $host,$output,$installed,$module,$dlname in
  9125. - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  9126. + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
  9127. esac
  9128. - $echo > $output "\
  9129. + # Do not add duplicates
  9130. + if test "$installed" = yes && test "$D"; then
  9131. + install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'`
  9132. + fi
  9133. + $ECHO > $output "\
  9134. # $outputname - a libtool library file
  9135. -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  9136. +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
  9137. #
  9138. # Please DO NOT delete this file!
  9139. # It is necessary for linking the library.
  9140. @@ -5765,9 +8196,15 @@ library_names='$library_names'
  9141. # The name of the static archive.
  9142. old_library='$old_library'
  9143. +# Linker flags that can not go in dependency_libs.
  9144. +inherited_linker_flags='$new_inherited_linker_flags'
  9145. +
  9146. # Libraries that this one depends upon.
  9147. dependency_libs='$dependency_libs'
  9148. +# Names of additional weak libraries provided by this library
  9149. +weak_library_names='$weak_libs'
  9150. +
  9151. # Version information for $libname.
  9152. current=$current
  9153. age=$age
  9154. @@ -5786,748 +8223,29 @@ dlpreopen='$dlprefiles'
  9155. # Directory that this library needs to be installed in:
  9156. libdir='$install_libdir'"
  9157. if test "$installed" = no && test "$need_relink" = yes; then
  9158. - $echo >> $output "\
  9159. + $ECHO >> $output "\
  9160. relink_command=\"$relink_command\""
  9161. fi
  9162. done
  9163. - fi
  9164. + }
  9165. # Do a symbolic link so that the libtool archive can be found in
  9166. # LD_LIBRARY_PATH before the program is installed.
  9167. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  9168. - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
  9169. - ;;
  9170. - esac
  9171. - exit $EXIT_SUCCESS
  9172. - ;;
  9173. -
  9174. - # libtool install mode
  9175. - install)
  9176. - modename="$modename: install"
  9177. -
  9178. - # There may be an optional sh(1) argument at the beginning of
  9179. - # install_prog (especially on Windows NT).
  9180. - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
  9181. - # Allow the use of GNU shtool's install command.
  9182. - $echo "X$nonopt" | grep shtool > /dev/null; then
  9183. - # Aesthetically quote it.
  9184. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  9185. - case $arg in
  9186. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  9187. - arg="\"$arg\""
  9188. - ;;
  9189. - esac
  9190. - install_prog="$arg "
  9191. - arg="$1"
  9192. - shift
  9193. - else
  9194. - install_prog=
  9195. - arg=$nonopt
  9196. - fi
  9197. -
  9198. - # The real first argument should be the name of the installation program.
  9199. - # Aesthetically quote it.
  9200. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  9201. - case $arg in
  9202. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  9203. - arg="\"$arg\""
  9204. - ;;
  9205. - esac
  9206. - install_prog="$install_prog$arg"
  9207. -
  9208. - # We need to accept at least all the BSD install flags.
  9209. - dest=
  9210. - files=
  9211. - opts=
  9212. - prev=
  9213. - install_type=
  9214. - isdir=no
  9215. - stripme=
  9216. - for arg
  9217. - do
  9218. - if test -n "$dest"; then
  9219. - files="$files $dest"
  9220. - dest=$arg
  9221. - continue
  9222. - fi
  9223. -
  9224. - case $arg in
  9225. - -d) isdir=yes ;;
  9226. - -f)
  9227. - case " $install_prog " in
  9228. - *[\\\ /]cp\ *) ;;
  9229. - *) prev=$arg ;;
  9230. - esac
  9231. - ;;
  9232. - -g | -m | -o) prev=$arg ;;
  9233. - -s)
  9234. - stripme=" -s"
  9235. - continue
  9236. - ;;
  9237. - -*)
  9238. - ;;
  9239. - *)
  9240. - # If the previous option needed an argument, then skip it.
  9241. - if test -n "$prev"; then
  9242. - prev=
  9243. - else
  9244. - dest=$arg
  9245. - continue
  9246. - fi
  9247. - ;;
  9248. - esac
  9249. -
  9250. - # Aesthetically quote the argument.
  9251. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  9252. - case $arg in
  9253. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
  9254. - arg="\"$arg\""
  9255. - ;;
  9256. - esac
  9257. - install_prog="$install_prog $arg"
  9258. - done
  9259. -
  9260. - if test -z "$install_prog"; then
  9261. - $echo "$modename: you must specify an install program" 1>&2
  9262. - $echo "$help" 1>&2
  9263. - exit $EXIT_FAILURE
  9264. - fi
  9265. -
  9266. - if test -n "$prev"; then
  9267. - $echo "$modename: the \`$prev' option requires an argument" 1>&2
  9268. - $echo "$help" 1>&2
  9269. - exit $EXIT_FAILURE
  9270. - fi
  9271. -
  9272. - if test -z "$files"; then
  9273. - if test -z "$dest"; then
  9274. - $echo "$modename: no file or destination specified" 1>&2
  9275. - else
  9276. - $echo "$modename: you must specify a destination" 1>&2
  9277. - fi
  9278. - $echo "$help" 1>&2
  9279. - exit $EXIT_FAILURE
  9280. - fi
  9281. -
  9282. - # Strip any trailing slash from the destination.
  9283. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  9284. -
  9285. - # Check to see that the destination is a directory.
  9286. - test -d "$dest" && isdir=yes
  9287. - if test "$isdir" = yes; then
  9288. - destdir="$dest"
  9289. - destname=
  9290. - else
  9291. - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  9292. - test "X$destdir" = "X$dest" && destdir=.
  9293. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  9294. -
  9295. - # Not a directory, so check to see that there is only one file specified.
  9296. - set dummy $files
  9297. - if test "$#" -gt 2; then
  9298. - $echo "$modename: \`$dest' is not a directory" 1>&2
  9299. - $echo "$help" 1>&2
  9300. - exit $EXIT_FAILURE
  9301. - fi
  9302. - fi
  9303. - case $destdir in
  9304. - [\\/]* | [A-Za-z]:[\\/]*) ;;
  9305. - *)
  9306. - for file in $files; do
  9307. - case $file in
  9308. - *.lo) ;;
  9309. - *)
  9310. - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  9311. - $echo "$help" 1>&2
  9312. - exit $EXIT_FAILURE
  9313. - ;;
  9314. - esac
  9315. - done
  9316. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
  9317. ;;
  9318. esac
  9319. -
  9320. - # This variable tells wrapper scripts just to set variables rather
  9321. - # than running their programs.
  9322. - libtool_install_magic="$magic"
  9323. -
  9324. - staticlibs=
  9325. - future_libdirs=
  9326. - current_libdirs=
  9327. - for file in $files; do
  9328. -
  9329. - # Do each installation.
  9330. - case $file in
  9331. - *.$libext)
  9332. - # Do the static libraries later.
  9333. - staticlibs="$staticlibs $file"
  9334. - ;;
  9335. -
  9336. - *.la)
  9337. - # Check to see that this really is a libtool archive.
  9338. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  9339. - else
  9340. - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  9341. - $echo "$help" 1>&2
  9342. - exit $EXIT_FAILURE
  9343. - fi
  9344. -
  9345. - library_names=
  9346. - old_library=
  9347. - relink_command=
  9348. - # If there is no directory component, then add one.
  9349. - case $file in
  9350. - */* | *\\*) . $file ;;
  9351. - *) . ./$file ;;
  9352. - esac
  9353. -
  9354. - # Add the libdir to current_libdirs if it is the destination.
  9355. - if test "X$destdir" = "X$libdir"; then
  9356. - case "$current_libdirs " in
  9357. - *" $libdir "*) ;;
  9358. - *) current_libdirs="$current_libdirs $libdir" ;;
  9359. - esac
  9360. - else
  9361. - # Note the libdir as a future libdir.
  9362. - case "$future_libdirs " in
  9363. - *" $libdir "*) ;;
  9364. - *) future_libdirs="$future_libdirs $libdir" ;;
  9365. - esac
  9366. - fi
  9367. -
  9368. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
  9369. - test "X$dir" = "X$file/" && dir=
  9370. - dir="$dir$objdir"
  9371. -
  9372. - if test -n "$relink_command"; then
  9373. - # Determine the prefix the user has applied to our future dir.
  9374. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
  9375. -
  9376. - # Don't allow the user to place us outside of our expected
  9377. - # location b/c this prevents finding dependent libraries that
  9378. - # are installed to the same prefix.
  9379. - # At present, this check doesn't affect windows .dll's that
  9380. - # are installed into $libdir/../bin (currently, that works fine)
  9381. - # but it's something to keep an eye on.
  9382. - if test "$inst_prefix_dir" = "$destdir"; then
  9383. - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
  9384. - exit $EXIT_FAILURE
  9385. - fi
  9386. -
  9387. - if test -n "$inst_prefix_dir"; then
  9388. - # Stick the inst_prefix_dir data into the link command.
  9389. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
  9390. - else
  9391. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
  9392. - fi
  9393. -
  9394. - $echo "$modename: warning: relinking \`$file'" 1>&2
  9395. - $show "$relink_command"
  9396. - if $run eval "$relink_command"; then :
  9397. - else
  9398. - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  9399. - exit $EXIT_FAILURE
  9400. - fi
  9401. - fi
  9402. -
  9403. - # See the names of the shared library.
  9404. - set dummy $library_names
  9405. - if test -n "$2"; then
  9406. - realname="$2"
  9407. - shift
  9408. - shift
  9409. -
  9410. - srcname="$realname"
  9411. - test -n "$relink_command" && srcname="$realname"T
  9412. -
  9413. - # Install the shared library and build the symlinks.
  9414. - $show "$install_prog $dir/$srcname $destdir/$realname"
  9415. - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
  9416. - if test -n "$stripme" && test -n "$striplib"; then
  9417. - $show "$striplib $destdir/$realname"
  9418. - $run eval "$striplib $destdir/$realname" || exit $?
  9419. - fi
  9420. -
  9421. - if test "$#" -gt 0; then
  9422. - # Delete the old symlinks, and create new ones.
  9423. - # Try `ln -sf' first, because the `ln' binary might depend on
  9424. - # the symlink we replace! Solaris /bin/ln does not understand -f,
  9425. - # so we also need to try rm && ln -s.
  9426. - for linkname
  9427. - do
  9428. - if test "$linkname" != "$realname"; then
  9429. - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
  9430. - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
  9431. - fi
  9432. - done
  9433. - fi
  9434. -
  9435. - # Do each command in the postinstall commands.
  9436. - lib="$destdir/$realname"
  9437. - cmds=$postinstall_cmds
  9438. - save_ifs="$IFS"; IFS='~'
  9439. - for cmd in $cmds; do
  9440. - IFS="$save_ifs"
  9441. - eval cmd=\"$cmd\"
  9442. - $show "$cmd"
  9443. - $run eval "$cmd" || {
  9444. - lt_exit=$?
  9445. -
  9446. - # Restore the uninstalled library and exit
  9447. - if test "$mode" = relink; then
  9448. - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
  9449. - fi
  9450. -
  9451. - exit $lt_exit
  9452. - }
  9453. - done
  9454. - IFS="$save_ifs"
  9455. - fi
  9456. -
  9457. - # Install the pseudo-library for information purposes.
  9458. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  9459. - instname="$dir/$name"i
  9460. - $show "$install_prog $instname $destdir/$name"
  9461. - $run eval "$install_prog $instname $destdir/$name" || exit $?
  9462. -
  9463. - # Maybe install the static library, too.
  9464. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  9465. - ;;
  9466. -
  9467. - *.lo)
  9468. - # Install (i.e. copy) a libtool object.
  9469. -
  9470. - # Figure out destination file name, if it wasn't already specified.
  9471. - if test -n "$destname"; then
  9472. - destfile="$destdir/$destname"
  9473. - else
  9474. - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  9475. - destfile="$destdir/$destfile"
  9476. - fi
  9477. -
  9478. - # Deduce the name of the destination old-style object file.
  9479. - case $destfile in
  9480. - *.lo)
  9481. - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  9482. - ;;
  9483. - *.$objext)
  9484. - staticdest="$destfile"
  9485. - destfile=
  9486. - ;;
  9487. - *)
  9488. - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  9489. - $echo "$help" 1>&2
  9490. - exit $EXIT_FAILURE
  9491. - ;;
  9492. - esac
  9493. -
  9494. - # Install the libtool object if requested.
  9495. - if test -n "$destfile"; then
  9496. - $show "$install_prog $file $destfile"
  9497. - $run eval "$install_prog $file $destfile" || exit $?
  9498. - fi
  9499. -
  9500. - # Install the old object if enabled.
  9501. - if test "$build_old_libs" = yes; then
  9502. - # Deduce the name of the old-style object file.
  9503. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  9504. -
  9505. - $show "$install_prog $staticobj $staticdest"
  9506. - $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  9507. - fi
  9508. - exit $EXIT_SUCCESS
  9509. - ;;
  9510. -
  9511. - *)
  9512. - # Figure out destination file name, if it wasn't already specified.
  9513. - if test -n "$destname"; then
  9514. - destfile="$destdir/$destname"
  9515. - else
  9516. - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  9517. - destfile="$destdir/$destfile"
  9518. - fi
  9519. -
  9520. - # If the file is missing, and there is a .exe on the end, strip it
  9521. - # because it is most likely a libtool script we actually want to
  9522. - # install
  9523. - stripped_ext=""
  9524. - case $file in
  9525. - *.exe)
  9526. - if test ! -f "$file"; then
  9527. - file=`$echo $file|${SED} 's,.exe$,,'`
  9528. - stripped_ext=".exe"
  9529. - fi
  9530. - ;;
  9531. - esac
  9532. -
  9533. - # Do a test to see if this is really a libtool program.
  9534. - case $host in
  9535. - *cygwin*|*mingw*)
  9536. - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
  9537. - ;;
  9538. - *)
  9539. - wrapper=$file
  9540. - ;;
  9541. - esac
  9542. - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
  9543. - notinst_deplibs=
  9544. - relink_command=
  9545. -
  9546. - # Note that it is not necessary on cygwin/mingw to append a dot to
  9547. - # foo even if both foo and FILE.exe exist: automatic-append-.exe
  9548. - # behavior happens only for exec(3), not for open(2)! Also, sourcing
  9549. - # `FILE.' does not work on cygwin managed mounts.
  9550. - #
  9551. - # If there is no directory component, then add one.
  9552. - case $wrapper in
  9553. - */* | *\\*) . ${wrapper} ;;
  9554. - *) . ./${wrapper} ;;
  9555. - esac
  9556. -
  9557. - # Check the variables that should have been set.
  9558. - if test -z "$notinst_deplibs"; then
  9559. - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
  9560. - exit $EXIT_FAILURE
  9561. - fi
  9562. -
  9563. - finalize=yes
  9564. - for lib in $notinst_deplibs; do
  9565. - # Check to see that each library is installed.
  9566. - libdir=
  9567. - if test -f "$lib"; then
  9568. - # If there is no directory component, then add one.
  9569. - case $lib in
  9570. - */* | *\\*) . $lib ;;
  9571. - *) . ./$lib ;;
  9572. - esac
  9573. - fi
  9574. - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
  9575. - if test -n "$libdir" && test ! -f "$libfile"; then
  9576. - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  9577. - finalize=no
  9578. - fi
  9579. - done
  9580. -
  9581. - relink_command=
  9582. - # Note that it is not necessary on cygwin/mingw to append a dot to
  9583. - # foo even if both foo and FILE.exe exist: automatic-append-.exe
  9584. - # behavior happens only for exec(3), not for open(2)! Also, sourcing
  9585. - # `FILE.' does not work on cygwin managed mounts.
  9586. - #
  9587. - # If there is no directory component, then add one.
  9588. - case $wrapper in
  9589. - */* | *\\*) . ${wrapper} ;;
  9590. - *) . ./${wrapper} ;;
  9591. - esac
  9592. -
  9593. - outputname=
  9594. - if test "$fast_install" = no && test -n "$relink_command"; then
  9595. - if test "$finalize" = yes && test -z "$run"; then
  9596. - tmpdir=`func_mktempdir`
  9597. - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
  9598. - outputname="$tmpdir/$file"
  9599. - # Replace the output file specification.
  9600. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
  9601. -
  9602. - $show "$relink_command"
  9603. - if $run eval "$relink_command"; then :
  9604. - else
  9605. - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  9606. - ${rm}r "$tmpdir"
  9607. - continue
  9608. - fi
  9609. - file="$outputname"
  9610. - else
  9611. - $echo "$modename: warning: cannot relink \`$file'" 1>&2
  9612. - fi
  9613. - else
  9614. - # Install the binary that we compiled earlier.
  9615. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  9616. - fi
  9617. - fi
  9618. -
  9619. - # remove .exe since cygwin /usr/bin/install will append another
  9620. - # one anyway
  9621. - case $install_prog,$host in
  9622. - */usr/bin/install*,*cygwin*)
  9623. - case $file:$destfile in
  9624. - *.exe:*.exe)
  9625. - # this is ok
  9626. - ;;
  9627. - *.exe:*)
  9628. - destfile=$destfile.exe
  9629. - ;;
  9630. - *:*.exe)
  9631. - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
  9632. - ;;
  9633. - esac
  9634. - ;;
  9635. - esac
  9636. - $show "$install_prog$stripme $file $destfile"
  9637. - $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  9638. - test -n "$outputname" && ${rm}r "$tmpdir"
  9639. - ;;
  9640. - esac
  9641. - done
  9642. -
  9643. - for file in $staticlibs; do
  9644. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  9645. -
  9646. - # Set up the ranlib parameters.
  9647. - oldlib="$destdir/$name"
  9648. -
  9649. - $show "$install_prog $file $oldlib"
  9650. - $run eval "$install_prog \$file \$oldlib" || exit $?
  9651. -
  9652. - if test -n "$stripme" && test -n "$old_striplib"; then
  9653. - $show "$old_striplib $oldlib"
  9654. - $run eval "$old_striplib $oldlib" || exit $?
  9655. - fi
  9656. -
  9657. - # Do each command in the postinstall commands.
  9658. - cmds=$old_postinstall_cmds
  9659. - save_ifs="$IFS"; IFS='~'
  9660. - for cmd in $cmds; do
  9661. - IFS="$save_ifs"
  9662. - eval cmd=\"$cmd\"
  9663. - $show "$cmd"
  9664. - $run eval "$cmd" || exit $?
  9665. - done
  9666. - IFS="$save_ifs"
  9667. - done
  9668. -
  9669. - if test -n "$future_libdirs"; then
  9670. - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
  9671. - fi
  9672. -
  9673. - if test -n "$current_libdirs"; then
  9674. - # Maybe just do a dry run.
  9675. - test -n "$run" && current_libdirs=" -n$current_libdirs"
  9676. - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
  9677. - else
  9678. - exit $EXIT_SUCCESS
  9679. - fi
  9680. - ;;
  9681. -
  9682. - # libtool finish mode
  9683. - finish)
  9684. - modename="$modename: finish"
  9685. - libdirs="$nonopt"
  9686. - admincmds=
  9687. -
  9688. - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  9689. - for dir
  9690. - do
  9691. - libdirs="$libdirs $dir"
  9692. - done
  9693. -
  9694. - for libdir in $libdirs; do
  9695. - if test -n "$finish_cmds"; then
  9696. - # Do each command in the finish commands.
  9697. - cmds=$finish_cmds
  9698. - save_ifs="$IFS"; IFS='~'
  9699. - for cmd in $cmds; do
  9700. - IFS="$save_ifs"
  9701. - eval cmd=\"$cmd\"
  9702. - $show "$cmd"
  9703. - $run eval "$cmd" || admincmds="$admincmds
  9704. - $cmd"
  9705. - done
  9706. - IFS="$save_ifs"
  9707. - fi
  9708. - if test -n "$finish_eval"; then
  9709. - # Do the single finish_eval.
  9710. - eval cmds=\"$finish_eval\"
  9711. - $run eval "$cmds" || admincmds="$admincmds
  9712. - $cmds"
  9713. - fi
  9714. - done
  9715. - fi
  9716. -
  9717. - # Exit here if they wanted silent mode.
  9718. - test "$show" = : && exit $EXIT_SUCCESS
  9719. -
  9720. - $echo "X----------------------------------------------------------------------" | $Xsed
  9721. - $echo "Libraries have been installed in:"
  9722. - for libdir in $libdirs; do
  9723. - $echo " $libdir"
  9724. - done
  9725. - $echo
  9726. - $echo "If you ever happen to want to link against installed libraries"
  9727. - $echo "in a given directory, LIBDIR, you must either use libtool, and"
  9728. - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
  9729. - $echo "flag during linking and do at least one of the following:"
  9730. - if test -n "$shlibpath_var"; then
  9731. - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
  9732. - $echo " during execution"
  9733. - fi
  9734. - if test -n "$runpath_var"; then
  9735. - $echo " - add LIBDIR to the \`$runpath_var' environment variable"
  9736. - $echo " during linking"
  9737. - fi
  9738. - if test -n "$hardcode_libdir_flag_spec"; then
  9739. - libdir=LIBDIR
  9740. - eval flag=\"$hardcode_libdir_flag_spec\"
  9741. -
  9742. - $echo " - use the \`$flag' linker flag"
  9743. - fi
  9744. - if test -n "$admincmds"; then
  9745. - $echo " - have your system administrator run these commands:$admincmds"
  9746. - fi
  9747. - if test -f /etc/ld.so.conf; then
  9748. - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  9749. - fi
  9750. - $echo
  9751. - $echo "See any operating system documentation about shared libraries for"
  9752. - $echo "more information, such as the ld(1) and ld.so(8) manual pages."
  9753. - $echo "X----------------------------------------------------------------------" | $Xsed
  9754. exit $EXIT_SUCCESS
  9755. - ;;
  9756. -
  9757. - # libtool execute mode
  9758. - execute)
  9759. - modename="$modename: execute"
  9760. -
  9761. - # The first argument is the command name.
  9762. - cmd="$nonopt"
  9763. - if test -z "$cmd"; then
  9764. - $echo "$modename: you must specify a COMMAND" 1>&2
  9765. - $echo "$help"
  9766. - exit $EXIT_FAILURE
  9767. - fi
  9768. -
  9769. - # Handle -dlopen flags immediately.
  9770. - for file in $execute_dlfiles; do
  9771. - if test ! -f "$file"; then
  9772. - $echo "$modename: \`$file' is not a file" 1>&2
  9773. - $echo "$help" 1>&2
  9774. - exit $EXIT_FAILURE
  9775. - fi
  9776. -
  9777. - dir=
  9778. - case $file in
  9779. - *.la)
  9780. - # Check to see that this really is a libtool archive.
  9781. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  9782. - else
  9783. - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  9784. - $echo "$help" 1>&2
  9785. - exit $EXIT_FAILURE
  9786. - fi
  9787. -
  9788. - # Read the libtool library.
  9789. - dlname=
  9790. - library_names=
  9791. -
  9792. - # If there is no directory component, then add one.
  9793. - case $file in
  9794. - */* | *\\*) . $file ;;
  9795. - *) . ./$file ;;
  9796. - esac
  9797. -
  9798. - # Skip this library if it cannot be dlopened.
  9799. - if test -z "$dlname"; then
  9800. - # Warn if it was a shared library.
  9801. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
  9802. - continue
  9803. - fi
  9804. -
  9805. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  9806. - test "X$dir" = "X$file" && dir=.
  9807. -
  9808. - if test -f "$dir/$objdir/$dlname"; then
  9809. - dir="$dir/$objdir"
  9810. - else
  9811. - if test ! -f "$dir/$dlname"; then
  9812. - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
  9813. - exit $EXIT_FAILURE
  9814. - fi
  9815. - fi
  9816. - ;;
  9817. -
  9818. - *.lo)
  9819. - # Just add the directory containing the .lo file.
  9820. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  9821. - test "X$dir" = "X$file" && dir=.
  9822. - ;;
  9823. -
  9824. - *)
  9825. - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  9826. - continue
  9827. - ;;
  9828. - esac
  9829. -
  9830. - # Get the absolute pathname.
  9831. - absdir=`cd "$dir" && pwd`
  9832. - test -n "$absdir" && dir="$absdir"
  9833. -
  9834. - # Now add the directory to shlibpath_var.
  9835. - if eval "test -z \"\$$shlibpath_var\""; then
  9836. - eval "$shlibpath_var=\"\$dir\""
  9837. - else
  9838. - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
  9839. - fi
  9840. - done
  9841. -
  9842. - # This variable tells wrapper scripts just to set shlibpath_var
  9843. - # rather than running their programs.
  9844. - libtool_execute_magic="$magic"
  9845. -
  9846. - # Check if any of the arguments is a wrapper script.
  9847. - args=
  9848. - for file
  9849. - do
  9850. - case $file in
  9851. - -*) ;;
  9852. - *)
  9853. - # Do a test to see if this is really a libtool program.
  9854. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  9855. - # If there is no directory component, then add one.
  9856. - case $file in
  9857. - */* | *\\*) . $file ;;
  9858. - *) . ./$file ;;
  9859. - esac
  9860. -
  9861. - # Transform arg to wrapped name.
  9862. - file="$progdir/$program"
  9863. - fi
  9864. - ;;
  9865. - esac
  9866. - # Quote arguments (to preserve shell metacharacters).
  9867. - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  9868. - args="$args \"$file\""
  9869. - done
  9870. +}
  9871. - if test -z "$run"; then
  9872. - if test -n "$shlibpath_var"; then
  9873. - # Export the shlibpath_var.
  9874. - eval "export $shlibpath_var"
  9875. - fi
  9876. +{ test "$mode" = link || test "$mode" = relink; } &&
  9877. + func_mode_link ${1+"$@"}
  9878. - # Restore saved environment variables
  9879. - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
  9880. - do
  9881. - eval "if test \"\${save_$lt_var+set}\" = set; then
  9882. - $lt_var=\$save_$lt_var; export $lt_var
  9883. - fi"
  9884. - done
  9885. - # Now prepare to actually exec the command.
  9886. - exec_cmd="\$cmd$args"
  9887. - else
  9888. - # Display what would be done.
  9889. - if test -n "$shlibpath_var"; then
  9890. - eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
  9891. - $echo "export $shlibpath_var"
  9892. - fi
  9893. - $echo "$cmd$args"
  9894. - exit $EXIT_SUCCESS
  9895. - fi
  9896. - ;;
  9897. -
  9898. - # libtool clean and uninstall mode
  9899. - clean | uninstall)
  9900. - modename="$modename: $mode"
  9901. - rm="$nonopt"
  9902. +# func_mode_uninstall arg...
  9903. +func_mode_uninstall ()
  9904. +{
  9905. + $opt_debug
  9906. + RM="$nonopt"
  9907. files=
  9908. rmforce=
  9909. exit_status=0
  9910. @@ -6539,30 +8257,28 @@ relink_command=\"$relink_command\""
  9911. for arg
  9912. do
  9913. case $arg in
  9914. - -f) rm="$rm $arg"; rmforce=yes ;;
  9915. - -*) rm="$rm $arg" ;;
  9916. + -f) RM="$RM $arg"; rmforce=yes ;;
  9917. + -*) RM="$RM $arg" ;;
  9918. *) files="$files $arg" ;;
  9919. esac
  9920. done
  9921. - if test -z "$rm"; then
  9922. - $echo "$modename: you must specify an RM program" 1>&2
  9923. - $echo "$help" 1>&2
  9924. - exit $EXIT_FAILURE
  9925. - fi
  9926. + test -z "$RM" && \
  9927. + func_fatal_help "you must specify an RM program"
  9928. rmdirs=
  9929. origobjdir="$objdir"
  9930. for file in $files; do
  9931. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  9932. - if test "X$dir" = "X$file"; then
  9933. - dir=.
  9934. + func_dirname "$file" "" "."
  9935. + dir="$func_dirname_result"
  9936. + if test "X$dir" = X.; then
  9937. objdir="$origobjdir"
  9938. else
  9939. objdir="$dir/$origobjdir"
  9940. fi
  9941. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  9942. + func_basename "$file"
  9943. + name="$func_basename_result"
  9944. test "$mode" = uninstall && objdir="$dir"
  9945. # Remember objdir for removal later, being careful to avoid duplicates
  9946. @@ -6574,9 +8290,9 @@ relink_command=\"$relink_command\""
  9947. fi
  9948. # Don't error if the file doesn't exist and rm -f was used.
  9949. - if (test -L "$file") >/dev/null 2>&1 \
  9950. - || (test -h "$file") >/dev/null 2>&1 \
  9951. - || test -f "$file"; then
  9952. + if { test -L "$file"; } >/dev/null 2>&1 ||
  9953. + { test -h "$file"; } >/dev/null 2>&1 ||
  9954. + test -f "$file"; then
  9955. :
  9956. elif test -d "$file"; then
  9957. exit_status=1
  9958. @@ -6590,8 +8306,8 @@ relink_command=\"$relink_command\""
  9959. case $name in
  9960. *.la)
  9961. # Possibly a libtool archive, so verify it.
  9962. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  9963. - . $dir/$name
  9964. + if func_lalib_p "$file"; then
  9965. + func_source $dir/$name
  9966. # Delete the libtool libraries and symlinks.
  9967. for n in $library_names; do
  9968. @@ -6606,39 +8322,17 @@ relink_command=\"$relink_command\""
  9969. *" $dlname "*) ;;
  9970. *) rmfiles="$rmfiles $objdir/$dlname" ;;
  9971. esac
  9972. - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  9973. + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
  9974. ;;
  9975. uninstall)
  9976. if test -n "$library_names"; then
  9977. # Do each command in the postuninstall commands.
  9978. - cmds=$postuninstall_cmds
  9979. - save_ifs="$IFS"; IFS='~'
  9980. - for cmd in $cmds; do
  9981. - IFS="$save_ifs"
  9982. - eval cmd=\"$cmd\"
  9983. - $show "$cmd"
  9984. - $run eval "$cmd"
  9985. - if test "$?" -ne 0 && test "$rmforce" != yes; then
  9986. - exit_status=1
  9987. - fi
  9988. - done
  9989. - IFS="$save_ifs"
  9990. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  9991. fi
  9992. if test -n "$old_library"; then
  9993. # Do each command in the old_postuninstall commands.
  9994. - cmds=$old_postuninstall_cmds
  9995. - save_ifs="$IFS"; IFS='~'
  9996. - for cmd in $cmds; do
  9997. - IFS="$save_ifs"
  9998. - eval cmd=\"$cmd\"
  9999. - $show "$cmd"
  10000. - $run eval "$cmd"
  10001. - if test "$?" -ne 0 && test "$rmforce" != yes; then
  10002. - exit_status=1
  10003. - fi
  10004. - done
  10005. - IFS="$save_ifs"
  10006. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
  10007. fi
  10008. # FIXME: should reinstall the best remaining shared library.
  10009. ;;
  10010. @@ -6648,20 +8342,20 @@ relink_command=\"$relink_command\""
  10011. *.lo)
  10012. # Possibly a libtool object, so verify it.
  10013. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  10014. + if func_lalib_p "$file"; then
  10015. # Read the .lo file
  10016. - . $dir/$name
  10017. + func_source $dir/$name
  10018. # Add PIC object to the list of files to remove.
  10019. - if test -n "$pic_object" \
  10020. - && test "$pic_object" != none; then
  10021. + if test -n "$pic_object" &&
  10022. + test "$pic_object" != none; then
  10023. rmfiles="$rmfiles $dir/$pic_object"
  10024. fi
  10025. # Add non-PIC object to the list of files to remove.
  10026. - if test -n "$non_pic_object" \
  10027. - && test "$non_pic_object" != none; then
  10028. + if test -n "$non_pic_object" &&
  10029. + test "$non_pic_object" != none; then
  10030. rmfiles="$rmfiles $dir/$non_pic_object"
  10031. fi
  10032. fi
  10033. @@ -6672,17 +8366,26 @@ relink_command=\"$relink_command\""
  10034. noexename=$name
  10035. case $file in
  10036. *.exe)
  10037. - file=`$echo $file|${SED} 's,.exe$,,'`
  10038. - noexename=`$echo $name|${SED} 's,.exe$,,'`
  10039. + func_stripname '' '.exe' "$file"
  10040. + file=$func_stripname_result
  10041. + func_stripname '' '.exe' "$name"
  10042. + noexename=$func_stripname_result
  10043. # $file with .exe has already been added to rmfiles,
  10044. # add $file without .exe
  10045. rmfiles="$rmfiles $file"
  10046. ;;
  10047. esac
  10048. # Do a test to see if this is a libtool program.
  10049. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  10050. - relink_command=
  10051. - . $dir/$noexename
  10052. + if func_ltwrapper_p "$file"; then
  10053. + if func_ltwrapper_executable_p "$file"; then
  10054. + func_ltwrapper_scriptname "$file"
  10055. + relink_command=
  10056. + func_source $func_ltwrapper_scriptname_result
  10057. + rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
  10058. + else
  10059. + relink_command=
  10060. + func_source $dir/$noexename
  10061. + fi
  10062. # note $name still contains .exe if it was in $file originally
  10063. # as does the version of $file that was added into $rmfiles
  10064. @@ -6697,239 +8400,38 @@ relink_command=\"$relink_command\""
  10065. fi
  10066. ;;
  10067. esac
  10068. - $show "$rm $rmfiles"
  10069. - $run $rm $rmfiles || exit_status=1
  10070. + func_show_eval "$RM $rmfiles" 'exit_status=1'
  10071. done
  10072. objdir="$origobjdir"
  10073. # Try to remove the ${objdir}s in the directories where we deleted files
  10074. for dir in $rmdirs; do
  10075. if test -d "$dir"; then
  10076. - $show "rmdir $dir"
  10077. - $run rmdir $dir >/dev/null 2>&1
  10078. + func_show_eval "rmdir $dir >/dev/null 2>&1"
  10079. fi
  10080. done
  10081. exit $exit_status
  10082. - ;;
  10083. +}
  10084. - "")
  10085. - $echo "$modename: you must specify a MODE" 1>&2
  10086. - $echo "$generic_help" 1>&2
  10087. - exit $EXIT_FAILURE
  10088. - ;;
  10089. - esac
  10090. +{ test "$mode" = uninstall || test "$mode" = clean; } &&
  10091. + func_mode_uninstall ${1+"$@"}
  10092. - if test -z "$exec_cmd"; then
  10093. - $echo "$modename: invalid operation mode \`$mode'" 1>&2
  10094. - $echo "$generic_help" 1>&2
  10095. - exit $EXIT_FAILURE
  10096. - fi
  10097. -fi # test -z "$show_help"
  10098. +test -z "$mode" && {
  10099. + help="$generic_help"
  10100. + func_fatal_help "you must specify a MODE"
  10101. +}
  10102. +
  10103. +test -z "$exec_cmd" && \
  10104. + func_fatal_help "invalid operation mode \`$mode'"
  10105. if test -n "$exec_cmd"; then
  10106. - eval exec $exec_cmd
  10107. + eval exec "$exec_cmd"
  10108. exit $EXIT_FAILURE
  10109. fi
  10110. -# We need to display help for each of the modes.
  10111. -case $mode in
  10112. -"") $echo \
  10113. -"Usage: $modename [OPTION]... [MODE-ARG]...
  10114. -
  10115. -Provide generalized library-building support services.
  10116. -
  10117. - --config show all configuration variables
  10118. - --debug enable verbose shell tracing
  10119. --n, --dry-run display commands without modifying any files
  10120. - --features display basic configuration information and exit
  10121. - --finish same as \`--mode=finish'
  10122. - --help display this help message and exit
  10123. - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
  10124. - --quiet same as \`--silent'
  10125. - --silent don't print informational messages
  10126. - --tag=TAG use configuration variables from tag TAG
  10127. - --version print version information
  10128. -
  10129. -MODE must be one of the following:
  10130. -
  10131. - clean remove files from the build directory
  10132. - compile compile a source file into a libtool object
  10133. - execute automatically set library path, then run a program
  10134. - finish complete the installation of libtool libraries
  10135. - install install libraries or executables
  10136. - link create a library or an executable
  10137. - uninstall remove libraries from an installed directory
  10138. -
  10139. -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
  10140. -a more detailed description of MODE.
  10141. -
  10142. -Report bugs to <bug-libtool@gnu.org>."
  10143. - exit $EXIT_SUCCESS
  10144. - ;;
  10145. -
  10146. -clean)
  10147. - $echo \
  10148. -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
  10149. -
  10150. -Remove files from the build directory.
  10151. -
  10152. -RM is the name of the program to use to delete files associated with each FILE
  10153. -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  10154. -to RM.
  10155. -
  10156. -If FILE is a libtool library, object or program, all the files associated
  10157. -with it are deleted. Otherwise, only FILE itself is deleted using RM."
  10158. - ;;
  10159. -
  10160. -compile)
  10161. - $echo \
  10162. -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  10163. -
  10164. -Compile a source file into a libtool library object.
  10165. -
  10166. -This mode accepts the following additional options:
  10167. -
  10168. - -o OUTPUT-FILE set the output file name to OUTPUT-FILE
  10169. - -prefer-pic try to building PIC objects only
  10170. - -prefer-non-pic try to building non-PIC objects only
  10171. - -static always build a \`.o' file suitable for static linking
  10172. -
  10173. -COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  10174. -from the given SOURCEFILE.
  10175. -
  10176. -The output file name is determined by removing the directory component from
  10177. -SOURCEFILE, then substituting the C source code suffix \`.c' with the
  10178. -library object suffix, \`.lo'."
  10179. - ;;
  10180. -
  10181. -execute)
  10182. - $echo \
  10183. -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  10184. -
  10185. -Automatically set library path, then run a program.
  10186. -
  10187. -This mode accepts the following additional options:
  10188. -
  10189. - -dlopen FILE add the directory containing FILE to the library path
  10190. -
  10191. -This mode sets the library path environment variable according to \`-dlopen'
  10192. -flags.
  10193. -
  10194. -If any of the ARGS are libtool executable wrappers, then they are translated
  10195. -into their corresponding uninstalled binary, and any of their required library
  10196. -directories are added to the library path.
  10197. -
  10198. -Then, COMMAND is executed, with ARGS as arguments."
  10199. - ;;
  10200. -
  10201. -finish)
  10202. - $echo \
  10203. -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  10204. -
  10205. -Complete the installation of libtool libraries.
  10206. -
  10207. -Each LIBDIR is a directory that contains libtool libraries.
  10208. -
  10209. -The commands that this mode executes may require superuser privileges. Use
  10210. -the \`--dry-run' option if you just want to see what would be executed."
  10211. - ;;
  10212. -
  10213. -install)
  10214. - $echo \
  10215. -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  10216. -
  10217. -Install executables or libraries.
  10218. -
  10219. -INSTALL-COMMAND is the installation command. The first component should be
  10220. -either the \`install' or \`cp' program.
  10221. -
  10222. -The rest of the components are interpreted as arguments to that command (only
  10223. -BSD-compatible install options are recognized)."
  10224. - ;;
  10225. -
  10226. -link)
  10227. - $echo \
  10228. -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  10229. -
  10230. -Link object files or libraries together to form another library, or to
  10231. -create an executable program.
  10232. -
  10233. -LINK-COMMAND is a command using the C compiler that you would use to create
  10234. -a program from several object files.
  10235. -
  10236. -The following components of LINK-COMMAND are treated specially:
  10237. -
  10238. - -all-static do not do any dynamic linking at all
  10239. - -avoid-version do not add a version suffix if possible
  10240. - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
  10241. - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
  10242. - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  10243. - -export-symbols SYMFILE
  10244. - try to export only the symbols listed in SYMFILE
  10245. - -export-symbols-regex REGEX
  10246. - try to export only the symbols matching REGEX
  10247. - -LLIBDIR search LIBDIR for required installed libraries
  10248. - -lNAME OUTPUT-FILE requires the installed library libNAME
  10249. - -module build a library that can dlopened
  10250. - -no-fast-install disable the fast-install mode
  10251. - -no-install link a not-installable executable
  10252. - -no-undefined declare that a library does not refer to external symbols
  10253. - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
  10254. - -objectlist FILE Use a list of object files found in FILE to specify objects
  10255. - -precious-files-regex REGEX
  10256. - don't remove output files matching REGEX
  10257. - -release RELEASE specify package release information
  10258. - -rpath LIBDIR the created library will eventually be installed in LIBDIR
  10259. - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
  10260. - -static do not do any dynamic linking of uninstalled libtool libraries
  10261. - -static-libtool-libs
  10262. - do not do any dynamic linking of libtool libraries
  10263. - -version-info CURRENT[:REVISION[:AGE]]
  10264. - specify library version info [each variable defaults to 0]
  10265. -
  10266. -All other options (arguments beginning with \`-') are ignored.
  10267. -
  10268. -Every other argument is treated as a filename. Files ending in \`.la' are
  10269. -treated as uninstalled libtool libraries, other files are standard or library
  10270. -object files.
  10271. -
  10272. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  10273. -only library objects (\`.lo' files) may be specified, and \`-rpath' is
  10274. -required, except when creating a convenience library.
  10275. -
  10276. -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  10277. -using \`ar' and \`ranlib', or on Windows using \`lib'.
  10278. -
  10279. -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  10280. -is created, otherwise an executable program is created."
  10281. - ;;
  10282. -
  10283. -uninstall)
  10284. - $echo \
  10285. -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  10286. -
  10287. -Remove libraries from an installation directory.
  10288. -
  10289. -RM is the name of the program to use to delete files associated with each FILE
  10290. -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
  10291. -to RM.
  10292. -
  10293. -If FILE is a libtool library, all the files associated with it are deleted.
  10294. -Otherwise, only FILE itself is deleted using RM."
  10295. - ;;
  10296. -
  10297. -*)
  10298. - $echo "$modename: invalid operation mode \`$mode'" 1>&2
  10299. - $echo "$help" 1>&2
  10300. - exit $EXIT_FAILURE
  10301. - ;;
  10302. -esac
  10303. -
  10304. -$echo
  10305. -$echo "Try \`$modename --help' for more information about other modes."
  10306. +exit $exit_status
  10307. -exit $?
  10308. # The TAGs below are defined such that we never get into a situation
  10309. # in which we disable both kinds of libraries. Given conflicting
  10310. @@ -6943,14 +8445,17 @@ exit $?
  10311. # configuration. But we'll never go from static-only to shared-only.
  10312. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
  10313. -disable_libs=shared
  10314. +build_libtool_libs=no
  10315. +build_old_libs=yes
  10316. # ### END LIBTOOL TAG CONFIG: disable-shared
  10317. # ### BEGIN LIBTOOL TAG CONFIG: disable-static
  10318. -disable_libs=static
  10319. +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
  10320. # ### END LIBTOOL TAG CONFIG: disable-static
  10321. # Local Variables:
  10322. # mode:shell-script
  10323. # sh-indentation:2
  10324. # End:
  10325. +# vi:sw=2
  10326. +