libtool 214 KB

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